(p=0, size_px=None, size_percent=None, per_channel=False, min_size=4, name=None, deterministic=False,
                  random_state=None)

return MultiplyElementwise(p3, per_channel=per_channel, name=name, deterministic=deterministic,
                               random_state=random_state)

def Func(arg_0=0, arg_1=None, arg_2=None, arg_3=False, arg_4=4, arg_5=None, arg_6=False,
                  arg_7=None):
    """
    Augmenter that sets rectangular areas within images to zero.

    In contrast to Dropout, these areas can have larger sizes.
    (E.g. you might end up with three large black rectangles in an image.)
    Note that the current implementation leads to correlated sizes,
    so when there is one large area that is dropped, there is a high likelihood
    that all other dropped areas are also large.

    This method is implemented by generating the dropout mask at a
    lower resolution (than the image has) and then upsampling the mask
    before dropping the pixels.

    dtype support::

        See ``imgaug.augmenters.arithmetic.MultiplyElementwise``.

    Parameters
    ----------
    p : float or tuple of float or imgaug.parameters.StochasticParameter, optional
        The probability of any pixel being dropped (i.e. set to zero).

            * If a float, then that value will be used for all pixels. A value
              of 1.0 would mean, that all pixels will be dropped. A value of
              0.0 would lead to no pixels being dropped.
            * If a tuple ``(a, b)``, then a value p will be sampled from the
              range ``a <= p <= b`` per image and be used as the pixel's dropout
              probability.
            * If a StochasticParameter, then this parameter will be used to
              determine per pixel whether it should be dropped (sampled value
              of 0) or shouldn't (sampled value of 1).

    size_px : int or tuple of int or imgaug.parameters.StochasticParameter, optional
        The size of the lower resolution image from which to sample the dropout
        mask in absolute pixel dimensions.

            * If an integer, then that size will be used for both height and
              width. E.g. a value of 3 would lead to a ``3x3`` mask, which is then
              upsampled to ``HxW``, where ``H`` is the image size and W the image width.
            * If a tuple ``(a, b)``, then two values ``M``, ``N`` will be sampled from the
              range ``[a..b]`` and the mask will be generated at size ``MxN``, then
              upsampled to ``HxW``.
            * If a StochasticParameter, then this parameter will be used to
              determine the sizes. It is expected to be discrete.

    size_percent : float or tuple of float or imgaug.parameters.StochasticParameter, optional
        The size of the lower resolution image from which to sample the dropout
        mask *in percent* of the input image.

            * If a float, then that value will be used as the percentage of the
              height and width (relative to the original size). E.g. for value
              p, the mask will be sampled from ``(p*H)x(p*W)`` and later upsampled
              to ``HxW``.
            * If a tuple ``(a, b)``, then two values ``m``, ``n`` will be sampled from the
              interval ``(a, b)`` and used as the percentages, i.e the mask size
              will be ``(m*H)x(n*W)``.
            * If a StochasticParameter, then this parameter will be used to
              sample the percentage values. It is expected to be continuous.

    per_channel : bool or float, optional
        Whether to use the same value (is dropped / is not dropped)
        for all channels of a pixel (False) or to sample a new value for each
        channel (True).
        If this value is a float ``p``, then for ``p`` percent of all images
        `per_channel` will be treated as True, otherwise as False.

    min_size : int, optional
        Minimum size of the low resolution mask, both width and height. If
        `size_percent` or `size_px` leads to a lower value than this, `min_size`
        will be used instead. This should never have a value of less than 2,
        otherwise one may end up with a ``1x1`` low resolution mask, leading easily
        to the whole image being dropped.

    name : None or str, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    deterministic : bool, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    random_state : None or int or numpy.random.RandomState, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    Examples
    --------
    >>> aug = iaa.Func(0.02, size_percent=0.5)

    drops 2 percent of all pixels on an lower-resolution image that has
    50 percent of the original image's size, leading to dropped areas that
    have roughly 2x2 pixels size.

    >>> aug = iaa.Func((0.0, 0.05), size_percent=(0.05, 0.5))

    generates a dropout mask at 5 to 50 percent of image's size. In that mask,
    0 to 5 percent of all pixels are dropped (random per image).

    >>> aug = iaa.Func((0.0, 0.05), size_px=(2, 16))

    same as previous example, but the lower resolution image has 2 to 16 pixels
    size.

    >>> aug = iaa.Func(0.02, size_percent=0.5, per_channel=True)

    drops 2 percent of all pixels at 50 percent resolution (2x2 sizes)
    in a channel-wise fashion, i.e. it is unlikely
    for any pixel to have all channels set to zero (black pixels).

    >>> aug = iaa.Func(0.02, size_percent=0.5, per_channel=0.5)

    same as previous example, but the `per_channel` feature is only active
    for 50 percent of all images.

    """
    if ia.is_single_number(arg_0):
        arg_8 = iap.Binomial(1 - arg_0)
    elif ia.is_iterable(arg_0):
        ia.do_assert(len(arg_0) == 2)
        ia.do_assert(arg_0[0] < arg_0[1])
        ia.do_assert(0 <= arg_0[0] <= 1.0)
        ia.do_assert(0 <= arg_0[1] <= 1.0)
        arg_8 = iap.Binomial(iap.Uniform(1 - arg_0[1], 1 - arg_0[0]))
    elif isinstance(arg_0, iap.StochasticParameter):
        arg_8 = arg_0
    else:
        raise Exception("Expected p to be float or int or StochasticParameter, got %s." % (type(arg_0),))

    if arg_1 is not None:
        arg_9 = iap.FromLowerResolution(other_param=arg_8, arg_1=arg_1, arg_4=arg_4)
    elif arg_2 is not None:
        arg_9 = iap.FromLowerResolution(other_param=arg_8, arg_2=arg_2, arg_4=arg_4)
    else:
        raise Exception("Either size_px or size_percent must be set.")

    if arg_5 is None:
        arg_5 = "Unnamed%s" % (ia.caller_name(),)

    return MultiplyElementwise(arg_9, arg_3=arg_3, arg_5=arg_5, arg_6=arg_6,
                               arg_7=arg_7)

Augmenter that sets rectangular areas within images to zero.

    In contrast to Dropout, these areas can have larger sizes.
    (E.g. you might end up with three large black rectangles in an image.)
    Note that the current implementation leads to correlated sizes,
    so when there is one large area that is dropped, there is a high likelihood
    that all other dropped areas are also large.

    This method is implemented by generating the dropout mask at a
    lower resolution (than the image has) and then upsampling the mask
    before dropping the pixels.

    dtype support::

        See ``imgaug.augmenters.arithmetic.MultiplyElementwise``.

    Parameters
    ----------
    p : float or tuple of float or imgaug.parameters.StochasticParameter, optional
        The probability of any pixel being dropped (i.e. set to zero).

            * If a float, then that value will be used for all pixels. A value
              of 1.0 would mean, that all pixels will be dropped. A value of
              0.0 would lead to no pixels being dropped.
            * If a tuple ``(a, b)``, then a value p will be sampled from the
              range ``a <= p <= b`` per image and be used as the pixel's dropout
              probability.
            * If a StochasticParameter, then this parameter will be used to
              determine per pixel whether it should be dropped (sampled value
              of 0) or shouldn't (sampled value of 1).

    size_px : int or tuple of int or imgaug.parameters.StochasticParameter, optional
        The size of the lower resolution image from which to sample the dropout
        mask in absolute pixel dimensions.

            * If an integer, then that size will be used for both height and
              width. E.g. a value of 3 would lead to a ``3x3`` mask, which is then
              upsampled to ``HxW``, where ``H`` is the image size and W the image width.
            * If a tuple ``(a, b)``, then two values ``M``, ``N`` will be sampled from the
              range ``[a..b]`` and the mask will be generated at size ``MxN``, then
              upsampled to ``HxW``.
            * If a StochasticParameter, then this parameter will be used to
              determine the sizes. It is expected to be discrete.

    size_percent : float or tuple of float or imgaug.parameters.StochasticParameter, optional
        The size of the lower resolution image from which to sample the dropout
        mask *in percent* of the input image.

            * If a float, then that value will be used as the percentage of the
              height and width (relative to the original size). E.g. for value
              p, the mask will be sampled from ``(p*H)x(p*W)`` and later upsampled
              to ``HxW``.
            * If a tuple ``(a, b)``, then two values ``m``, ``n`` will be sampled from the
              interval ``(a, b)`` and used as the percentages, i.e the mask size
              will be ``(m*H)x(n*W)``.
            * If a StochasticParameter, then this parameter will be used to
              sample the percentage values. It is expected to be continuous.

    per_channel : bool or float, optional
        Whether to use the same value (is dropped / is not dropped)
        for all channels of a pixel (False) or to sample a new value for each
        channel (True).
        If this value is a float ``p``, then for ``p`` percent of all images
        `per_channel` will be treated as True, otherwise as False.

    min_size : int, optional
        Minimum size of the low resolution mask, both width and height. If
        `size_percent` or `size_px` leads to a lower value than this, `min_size`
        will be used instead. This should never have a value of less than 2,
        otherwise one may end up with a ``1x1`` low resolution mask, leading easily
        to the whole image being dropped.

    name : None or str, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    deterministic : bool, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    random_state : None or int or numpy.random.RandomState, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    Examples
    --------
    >>> aug = iaa.CoarseDropout(0.02, size_percent=0.5)

    drops 2 percent of all pixels on an lower-resolution image that has
    50 percent of the original image's size, leading to dropped areas that
    have roughly 2x2 pixels size.

    >>> aug = iaa.CoarseDropout((0.0, 0.05), size_percent=(0.05, 0.5))

    generates a dropout mask at 5 to 50 percent of image's size. In that mask,
    0 to 5 percent of all pixels are dropped (random per image).

    >>> aug = iaa.CoarseDropout((0.0, 0.05), size_px=(2, 16))

    same as previous example, but the lower resolution image has 2 to 16 pixels
    size.

    >>> aug = iaa.CoarseDropout(0.02, size_percent=0.5, per_channel=True)

    drops 2 percent of all pixels at 50 percent resolution (2x2 sizes)
    in a channel-wise fashion, i.e. it is unlikely
    for any pixel to have all channels set to zero (black pixels).

    >>> aug = iaa.CoarseDropout(0.02, size_percent=0.5, per_channel=0.5)

    same as previous example, but the `per_channel` feature is only active
    for 50 percent of all images.

Augmenter that sets rectangular areas within images to zero .


def Func(arg_0, arg_1):
        """
        Label new data with cluster identities.

        Parameters
        ----------
        data : dict
            A data dict containing the same analytes used to
            fit the classifier.
        sort_by : str
            The name of an analyte used to sort the resulting
            clusters. If None, defaults to the first analyte
            used in fitting.

        Returns
        -------
        array of clusters the same length as the data.
        """
        arg_2 = arg_1[arg_0.analytes[0]].size
        arg_3, arg_4 = arg_0.format_data(arg_1)

        # Func clusters
        arg_5 = arg_0.classifier.Func(arg_3)
        # map clusters to original index
        arg_6 = arg_0.map_clusters(arg_2, arg_4, arg_5)

        return arg_6

Label new data with cluster identities .


def Func(arg_0):
    """
    Raise an ApiUsageError if the given object is not a token that is currently
    participating in the game.  To be participating in the game, the given
    token must have an id number and be associated with the world.
    """
    require_token(arg_0)
    arg_1 = arg_0

    if not arg_1.has_id:
        raise ApiUsageError("""\
                token {token} should have an id, but doesn't.

                This error usually means that a token was added to the world
                without being assigned an id number.  To correct this, make
                sure that you're using a message (i.e. CreateToken) to create
                all of your tokens.""")

    if not arg_1.has_world:
        raise ApiUsageError("""\
                token {token} (id={token.id}) not in world.

                You can get this error if you try to remove the same token from
                the world twice.  This might happen is you don't get rid of
                every reference to a token after it's removed the first time,
                then later on you try to remove the stale reference.""")

Raise an ApiUsageError if the given object is not a token that is currently participating in the game . To be participating in the game the given token must have an id number and be associated with the world .


This function will disown, so the Ardexa service can be restarted

def
Func
(
arg_0
)
:
arg_1
=
os
.
getpid
(
)
arg_2
=
"/proc/"
+
str
(
arg_1
)
+
"/cgroup"
try
:
arg_3
=
open
(
arg_2
,
"r"
)
except
IOError
:
print
(
"Could not open cgroup file: "
,
arg_2
)
return
False
for
arg_4
in
arg_3
:
if
arg_4
.
find
(
"ardexa.service"
)
==
1
:
continue
arg_4
=
arg_4
.
replace
(
"name="
,
""
)
arg_5
=
arg_4
.
split
(
':'
)
arg_6
=
arg_5
[
1
]
arg_7
=
arg_6
+
"/ardexa.Func"
if
not
arg_6
:
continue
arg_8
=
"/sys/fs/cgroup/"
+
arg_7
if
not
os
.
path
.
exists
(
arg_8
)
:
os
.
makedirs
(
arg_8
)
if
arg_0
>=
1
:
print
(
"Making directory: "
,
arg_8
)
else
:
if
arg_0
>=
1
:
print
(
"Directory already exists: "
,
arg_8
)
arg_9
=
arg_8
+
"/cgroup.procs"
arg_10
=
[
"echo"
,
str
(
arg_1
)
,
">"
,
arg_9
]
run_program
(
arg_10
,
arg_0
,
True
)
if
arg_6
.
find
(
","
)
!=
1
:
arg_11
=
arg_6
.
split
(
','
)
arg_6
=
arg_11
[
1
]
+
","
+
arg_11
[
0
]
arg_7
=
arg_6
+
"/ardexa.Func"
arg_8
=
"/sys/fs/cgroup/"
+
arg_7
try
:
if
not
os
.
path
.
exists
(
arg_8
)
:
os
.
makedirs
(
arg_8
)
except
:
continue
arg_9
=
arg_8
+
"/cgroup.procs"
arg_10
=
[
"echo"
,
str
(
arg_1
)
,
">"
,
arg_9
]
run_program
(
arg_10
,
arg_0
,
True
)
arg_3
.
close
(
)
if
arg_0
>=
1
:
arg_10
=
[
"cat"
,
arg_2
]
run_program
(
arg_10
,
arg_0
,
False
)
arg_10
=
[
"grep"
,
"-q"
,
"ardexa.service"
,
arg_2
]
if
run_program
(
arg_10
,
arg_0
,
False
)
:
return
False
return
True

def Func(arg_0):
    """This function will Func, so the Ardexa service can be restarted"""
    # Get the current PID
    arg_1 = os.getpid()
    arg_2 = "/proc/" + str(arg_1) + "/cgroup"
    try:
        arg_3 = open(arg_2, "r")
    except IOError:
        print("Could not open cgroup file: ", arg_2)
        return False

    # Read each line
    for arg_4 in arg_3:
        # Check if the line contains "ardexa.service"
        if arg_4.find("ardexa.service") == -1:
            continue

        # if the lines contains "name=", replace it with nothing
        arg_4 = arg_4.replace("name=", "")
        # Split  the line by commas
        arg_5 = arg_4.split(':')
        arg_6 = arg_5[1]
        arg_7 = arg_6 + "/ardexa.Func"
        # If accounts is empty, continue
        if not arg_6:
            continue

        # Create the dir and all subdirs
        arg_8 = "/sys/fs/cgroup/" + arg_7
        if not os.path.exists(arg_8):
            os.makedirs(arg_8)
            if arg_0 >= 1:
                print("Making directory: ", arg_8)
        else:
            if arg_0 >= 1:
                print("Directory already exists: ", arg_8)

        # Add the PID to the file
        arg_9 = arg_8 + "/cgroup.procs"
        arg_10 = ["echo", str(arg_1), ">", arg_9]
        run_program(arg_10, arg_0, True)

        # If this item contains a comma, then separate it, and reverse
        # some OSes will need cpuacct,cpu reversed to actually work
        if arg_6.find(",") != -1:
            arg_11 = arg_6.split(',')
            arg_6 = arg_11[1] + "," + arg_11[0]
            arg_7 = arg_6 + "/ardexa.Func"
            # Create the dir and all subdirs. But it may not work. So use a TRY
            arg_8 = "/sys/fs/cgroup/" + arg_7
            try:
                if not os.path.exists(arg_8):
                    os.makedirs(arg_8)
            except:
                continue

            # Add the PID to the file
            arg_9 = arg_8 + "/cgroup.procs"
            arg_10 = ["echo", str(arg_1), ">", arg_9]
            run_program(arg_10, arg_0, True)

    arg_3.close()

    # For debug purposes only
    if arg_0 >= 1:
        arg_10 = ["cat", arg_2]
        run_program(arg_10, arg_0, False)

    # If there are any "ardexa.service" in the proc file. If so, exit with error
    arg_10 = ["grep", "-q", "ardexa.service", arg_2]
    if run_program(arg_10, arg_0, False):
        # There are entries still left in the file
        return False

    return True

This function will disown so the Ardexa service can be restarted


def Func(arg_0, arg_1, arg_2=False):
        r'''Method to set the pressure-dependent property methods desired for
        consideration by the user. Can be used to exclude certain methods which
        might have unacceptable accuracy.

        As a side effect, the previously selected method is removed when
        this method is called to ensure user methods are tried in the desired
        order.

        Parameters
        ----------
        user_methods_P : str or list
            Methods by name to be considered or preferred for pressure effect.
        forced : bool, optional
            If True, only the user specified methods will ever be considered;
            if False other methods will be considered if no user methods
            suceed.
        '''
        # Accept either a string or a list of methods, and whether
        # or not to only consider the false methods
        if isinstance(arg_1, str):
            arg_1 = [arg_1]

        # The user's order matters and is retained for use by select_valid_methods
        arg_0.user_methods_P = arg_1
        arg_0.forced_P = arg_2

        # Validate that the user's specified methods are actual methods
        if set(arg_0.user_methods_P).difference(arg_0.all_methods_P):
            raise Exception("One of the given methods is not available for this chemical")
        if not arg_0.user_methods_P and arg_0.forced:
            raise Exception('Only user specified methods are considered when forced is True, but no methods were provided')

        # Remove previously selected methods
        arg_0.method_P = None
        arg_0.sorted_valid_methods_P = []
        arg_0.TP_cached = None

r Method to set the pressure - dependent property methods desired for consideration by the user . Can be used to exclude certain methods which might have unacceptable accuracy .


def Func ( arg_0 ) : if not arg_0 . loaded : arg_0 . load ( arg_0 . source ) for arg_1 in arg_0 . get_items ( ) : arg_2 = arg_0 . Func_item ( arg_1 ) arg_3 = arg_0 . get_instance ( arg_2 ) arg_0 . feed_instance ( arg_2 , arg_3 ) try : arg_0 . save_item ( arg_1 , arg_2 , arg_3 ) except Exception as e : arg_0 . save_error ( arg_2 , sys . exc_info ( ) ) arg_0 . unload ( )

def Func(arg_0):
        """
        Parses all data from the source, saving model instances.
        """
        # Checks if the source is loaded
        if not arg_0.loaded:
            arg_0.load(arg_0.source)

        for arg_1 in arg_0.get_items():
            # Parse the fields from the source into a dict
            arg_2 = arg_0.Func_item(arg_1)
            # Get the instance from the DB, or a new one
            arg_3 = arg_0.get_instance(arg_2)
            # Feed instance with data
            arg_0.feed_instance(arg_2, arg_3)
            # Try to save the instance or keep the error
            try:
                arg_0.save_item(arg_1, arg_2, arg_3)
            except Exception as e:
                arg_0.save_error(arg_2, sys.exc_info())

        # Unload the source
        arg_0.unload()

Parses all data from the source saving model instances .


(self, msg_descr, line=None, confidence=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if arg_0 . config . confidence and arg_3 : if arg_3 . name not in arg_0 . config . confidence : return False try : arg_4 = arg_0 . msgs_store . get_message_definitions ( arg_1 ) arg_5 = [ md . msgid for md in arg_4 ] except UnknownMessageError : arg_5 = [ arg_1 ] for arg_6 in arg_5 : if arg_0 . is_one_message_enabled ( arg_6 , arg_2 ) : return True return False

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """return true if the message associated to the given message id is
        enabled

        msgid may be either a numeric or symbolic message id.
        """
        if arg_0.config.confidence and arg_3:
            if arg_3.name not in arg_0.config.confidence:
                return False
        try:
            arg_4 = arg_0.msgs_store.get_message_definitions(arg_1)
            arg_5 = [md.msgid for md in arg_4]
        except UnknownMessageError:
            # The linter checks for messages that are not registered
            # due to version mismatch, just treat them as message IDs
            # for now.
            arg_5 = [arg_1]
        for arg_6 in arg_5:
            if arg_0.is_one_message_enabled(arg_6, arg_2):
                return True
        return False


def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . globals_ : return arg_0 . globals_ [ arg_1 ] arg_2 = arg_0 . globals_ [ '__builtins__' ] if isinstance ( arg_2 , dict ) : return arg_2 [ arg_1 ] else : return getattr ( arg_2 , arg_1 )

def Func(arg_0, arg_1):
        """
        Implementation of the LOAD_NAME operation
        """
        if arg_1 in arg_0.globals_:
            return arg_0.globals_[arg_1]

        arg_2 = arg_0.globals_['__builtins__']
        if isinstance(arg_2, dict):
            return arg_2[arg_1]
        else:
            return getattr(arg_2, arg_1)


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_1 . value . svalue if arg_3 in PB_SPECIAL_HANDLING : return [ "PB.{0}" . format ( arg_3 ) ] else : return [ "self.{0}" . format ( arg_3 ) ]

def Func(arg_0, arg_1, **arg_2):
    """Convert an AST sepcial handling to python source code."""
    arg_3 = arg_1.value.svalue
    if arg_3 in PB_SPECIAL_HANDLING:
      return ["PB.{0}".format(arg_3)]
    else:
      return ["self.{0}".format(arg_3)]

Convert an AST sepcial handling to python source code .


def
Func
(
arg_0
)
:
if
arg_0
.
tail
and
start_whitespace_re
.
search
(
arg_0
.
tail
)
:
arg_1
=
' '
else
:
arg_1
=
''
return
'</%s>%s'
%
(
arg_0
.
tag
,
arg_1
)

def Func(arg_0):
    """ The text representation of an end tag for a tag.  Includes
    trailing whitespace when appropriate.  """
    if arg_0.tail and start_whitespace_re.search(arg_0.tail):
        arg_1 = ' '
    else:
        arg_1 = ''
    return '</%s>%s' % (arg_0.tag, arg_1)

The text representation of an end tag for a tag . Includes trailing whitespace when appropriate .


(self, groundTruth, prediction, record = None, result = None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : arg_0 . value = arg_0 . avg ( arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3 = None, arg_4 = None):
    """Compute and store metric value"""
    arg_0.value = arg_0.avg(arg_2)


def
Func
(
arg_0
)
:
arg_1
=
open
(
arg_0
,
'rb'
)
arg_2
=
arg_1
.
read
(
30
*
1000
)
arg_1
.
close
(
)
arg_2
=
arg_2
.
decode
(
"utf-8"
,
"ignore"
)
arg_2
=
arg_2
.
split
(
"Clampex"
)
[
1
]
.
split
(
".pro"
)
[
0
]
arg_3
=
os
.
path
.
basename
(
arg_2
)
arg_4
=
arg_3
.
split
(
" "
)
[
0
]
return
arg_4

def Func(arg_0):
    """Determine the protocol used to record an ABF file"""
    arg_1=open(arg_0,'rb')
    arg_2=arg_1.read(30*1000) #it should be in the first 30k of the file
    arg_1.close()
    arg_2=arg_2.decode("utf-8","ignore")
    arg_2=arg_2.split("Clampex")[1].split(".pro")[0]
    arg_3 = os.path.basename(arg_2) # the whole protocol filename
    arg_4 = arg_3.split(" ")[0] # just the first number
    return arg_4


def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
)
:
logger
.
debug
(
"Closing the io handlers..."
)
for
arg_3
in
arg_0
.
io_handlers
:
arg_3
.
close
(
)
if
arg_0
.
event_thread
and
arg_0
.
event_thread
.
is_alive
(
)
:
logger
.
debug
(
"Sending the QUIT signal"
)
arg_0
.
event_queue
.
put
(
QUIT
)
logger
.
debug
(
"  sent"
)
arg_4
=
arg_0
.
io_threads
+
arg_0
.
timeout_threads
for
arg_5
in
arg_4
:
logger
.
debug
(
"Stopping thread: {0!r}"
.
format
(
arg_5
)
)
arg_5
.
Func
(
)
if
not
arg_1
:
return
if
arg_0
.
event_thread
:
arg_4
.
append
(
arg_0
.
event_thread
)
if
arg_2
is
:
for
arg_5
in
arg_4
:
arg_5
.
join
(
)
else
:
arg_6
=
(
arg_2
*
0.01
)
/
len
(
arg_4
)
arg_7
=
[
]
for
arg_5
in
arg_4
:
logger
.
debug
(
"Quick-joining thread {0!r}..."
.
format
(
arg_5
)
)
arg_5
.
join
(
arg_6
)
if
arg_5
.
is_alive
(
)
:
logger
.
debug
(
"  thread still alive"
.
format
(
arg_5
)
)
arg_7
.
append
(
arg_5
)
if
arg_7
:
arg_8
=
(
arg_2
*
0.99
)
/
len
(
arg_7
)
for
arg_5
in
arg_7
:
logger
.
debug
(
"Joining thread {0!r}..."
.
format
(
arg_5
)
)
arg_5
.
join
(
arg_8
)
arg_0
.
io_threads
=
[
]
arg_0
.
event_thread
=

def Func(arg_0, arg_1 = False, arg_2 = None):
        """Stop the threads.

        :Parameters:
            - `join`: join the threads (wait until they exit)
            - `timeout`: maximum time (in seconds) to wait when `join` is
              `True`).  No limit when `timeout` is `None`.
        """
        logger.debug("Closing the io handlers...")
        for arg_3 in arg_0.io_handlers:
            arg_3.close()
        if arg_0.event_thread and arg_0.event_thread.is_alive():
            logger.debug("Sending the QUIT signal")
            arg_0.event_queue.put(QUIT)
        logger.debug("  sent")
        arg_4 = arg_0.io_threads + arg_0.timeout_threads
        for arg_5 in arg_4:
            logger.debug("Stopping thread: {0!r}".format(arg_5))
            arg_5.Func()
        if not arg_1:
            return
        if arg_0.event_thread:
            arg_4.append(arg_0.event_thread)
        if arg_2 is None:
            for arg_5 in arg_4:
                arg_5.join()
        else:
            arg_6 = (arg_2 * 0.01) / len(arg_4)
            arg_7 = []
            for arg_5 in arg_4:
                logger.debug("Quick-joining thread {0!r}...".format(arg_5))
                arg_5.join(arg_6)
                if arg_5.is_alive():
                    logger.debug("  thread still alive".format(arg_5))
                    arg_7.append(arg_5)
            if arg_7:
                arg_8 = (arg_2 * 0.99) / len(arg_7)
                for arg_5 in arg_7:
                    logger.debug("Joining thread {0!r}...".format(arg_5))
                    arg_5.join(arg_8)
        arg_0.io_threads = []
        arg_0.event_thread = None


def Func(arg_0):
    """Restore resource's path and name from storage's table.

    Args:
        table (str): table name

    Returns:
        (str, str): resource path and name

    """
    arg_1 = None
    arg_2 = arg_0.split('___')
    arg_3 = arg_2[0]
    if len(arg_2) == 2:
        arg_1 = arg_2[1]
    arg_3 = arg_3.replace('__', os.path.sep)
    arg_3 += '.csv'
    return arg_3, arg_1

Restore resource s path and name from storage s table .


def Func ( arg_0 ) : def observation_noise_fn ( arg_1 ) : arg_2 = arg_0 [ ... , arg_1 , : ] return tfd . MultivariateNormalDiag ( loc = arg_2 , scale_diag = tf . zeros_like ( arg_2 ) ) return observation_noise_fn

def Func(arg_0):
  """Build an observation_noise_fn that observes a Tensor timeseries."""
  def observation_noise_fn(arg_1):
    arg_2 = arg_0[..., arg_1, :]
    return tfd.MultivariateNormalDiag(
        loc=arg_2,
        scale_diag=tf.zeros_like(arg_2))
  return observation_noise_fn

Build an observation_noise_fn that observes a Tensor timeseries .


return run(cmd, runner=runner, *args, **kwargs)

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_0 . ctx . Func if arg_0 . ctx else None return Func ( arg_1 , arg_4 = arg_4 , * arg_2 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Run a command."""
        arg_4 = arg_0.ctx.Func if arg_0.ctx else None
        return Func(arg_1, arg_4=arg_4, *arg_2, **arg_3)


(
    input_tensorshape, event_shape_in, event_shape_out)

def Func(
    arg_0, arg_1, arg_2):
  """Replaces the event shape dims of a `TensorShape`.

  Args:
    input_tensorshape: a `TensorShape` instance in which to attempt replacing
      event shape.
    event_shape_in: `Tensor` shape representing the event shape expected to
      be present in (rightmost dims of) `tensorshape_in`. Must be compatible
      with the rightmost dims of `tensorshape_in`.
    event_shape_out: `Tensor` shape representing the new event shape, i.e.,
      the replacement of `event_shape_in`,

  Returns:
    output_tensorshape: `TensorShape` with the rightmost `event_shape_in`
      replaced by `event_shape_out`. Might be partially defined, i.e.,
      `TensorShape(None)`.
    is_validated: Python `bool` indicating static validation happened.

  Raises:
    ValueError: if we can determine the event shape portion of
      `tensorshape_in` as well as `event_shape_in` both statically, and they
      are not compatible. "Compatible" here means that they are identical on
      any dims that are not -1 in `event_shape_in`.
  """
  arg_3 = tensorshape_util.num_elements(arg_1.shape)
  if tensorshape_util.rank(
      arg_0) is None or arg_3 is None:
    return tf.TensorShape(None), False  # Not is_validated.

  arg_4 = tensorshape_util.rank(
      arg_0) - arg_3
  if arg_4 < 0:
    raise ValueError(
        'Input has fewer ndims ({}) than event shape ndims ({}).'.format(
            tensorshape_util.rank(arg_0), arg_3))

  arg_5 = arg_0[:arg_4]
  arg_6 = arg_0[arg_4:]

  # Check that `input_event_shape_` and `event_shape_in` are compatible in the
  # sense that they have equal entries in any position that isn't a `-1` in
  # `event_shape_in`. Note that our validations at construction time ensure
  # there is at most one such entry in `event_shape_in`.
  arg_7 = tf.get_static_value(arg_1)
  arg_8 = (
      tensorshape_util.is_fully_defined(arg_6) and
      arg_7 is not None)
  if arg_8:
    arg_9 = np.int32(arg_6)
    arg_10 = arg_7 >= 0
    arg_11 = arg_9[arg_10]
    arg_12 = arg_7[arg_10]
    if not all(arg_11 == arg_12):
      raise ValueError(
          'Input `event_shape` does not match `event_shape_in`. '
          '({} vs {}).'.format(arg_9, arg_7))

  arg_13 = tensorshape_util.constant_value_as_shape(
      arg_2)
  if tensorshape_util.rank(arg_13) is None:
    arg_14 = tf.TensorShape(None)
  else:
    arg_14 = tensorshape_util.concatenate(
        arg_5, arg_13)

  return arg_14, arg_8

Replaces the event shape dims of a TensorShape .


def Func(arg_0, arg_1):
    """Apply updates to the next tuple metrics"""
    arg_0.update_reduced_metric(arg_0.NEXT_TUPLE_LATENCY, arg_1)
    arg_0.update_count(arg_0.NEXT_TUPLE_COUNT)


def Func ( ) : arg_0 = tornado . ioloop . IOLoop . instance ( ) try : return arg_0 . run_sync ( lambda : API . Func ( ) ) except Exception : Log . debug ( traceback . format_exc ( ) ) raise

def Func():
  """Synced API call to get all cluster names"""
  arg_0 = tornado.ioloop.IOLoop.instance()
  # pylint: disable=unnecessary-lambda
  try:
    return arg_0.run_sync(lambda: API.Func())
  except Exception:
    Log.debug(traceback.format_exc())
    raise


def Func(arg_0, arg_1):
        """Remove all of the ancestor operation nodes of node."""
        if isinstance(arg_1, int):
            warnings.warn('Calling Func() with a node id is deprecated,'
                          ' use a DAGNode instead',
                          DeprecationWarning, 2)
            arg_1 = arg_0._id_to_node[arg_1]

        arg_2 = nx.ancestors(arg_0._multi_graph, arg_1)
        # TODO: probably better to do all at once using
        # multi_graph.remove_nodes_from; same for related functions ...
        for arg_3 in arg_2:
            if arg_3.type == "op":
                arg_0.remove_op_node(arg_3)

Remove all of the ancestor operation nodes of node .


def
Func
(
arg_0
=
)
:
arg_1
=
parse_args
(
arg_0
)
arg_2
=
run_predictor
(
arg_1
)
arg_3
=
arg_2
.
to_dataframe
(
)
logger
.
info
(
'\n%s'
,
arg_3
)
if
arg_1
.
output_csv
:
arg_3
.
to_csv
(
arg_1
.
output_csv
,
index
=
False
)
print
(
"Wrote: %s"
%
arg_1
.
output_csv
)

def Func(arg_0=None):
    """
    Script to make pMHC binding predictions from amino acid sequences.

    Usage example:
        mhctools
            --sequence SFFPIQQQQQAAALLLI \
            --sequence SILQQQAQAQQAQAASSSC \
            --extract-subsequences \
            --mhc-predictor netmhc \
            --mhc-alleles HLA-A0201 H2-Db \
            --mhc-predictor netmhc \
            --output-csv epitope.csv
    """
    arg_1 = parse_args(arg_0)
    arg_2 = run_predictor(arg_1)
    arg_3 = arg_2.to_dataframe()
    logger.info('\n%s', arg_3)
    if arg_1.output_csv:
        arg_3.to_csv(arg_1.output_csv, index=False)
        print("Wrote: %s" % arg_1.output_csv)

Script to make pMHC binding predictions from amino acid sequences .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
split_contents
(
)
if
len
(
arg_2
)
>
1
:
raise
TemplateSyntaxError
(
"'%s' takes no arguments"
%
arg_2
[
0
]
)
return
WoopraNode
(
)

def Func(arg_0, arg_1):
    """
    Woopra tracking template tag.

    Renders Javascript code to track page visits.  You must supply
    your Woopra domain in the ``WOOPRA_DOMAIN`` setting.
    """
    arg_2 = arg_1.split_contents()
    if len(arg_2) > 1:
        raise TemplateSyntaxError("'%s' takes no arguments" % arg_2[0])
    return WoopraNode()


return pd.read_csv(StringIO(datasets), header=None, usecols=[1, 2],
                            names = ["Name", "Description"],sep="\t")

def Func ( arg_0 , arg_1 = 'ENSEMBL_MART_ENSEMBL' ) : arg_2 = arg_0 . datasets ( arg_1 , raw = True ) return pd . read_csv ( StringIO ( arg_2 ) , header = None , usecols = [ 1 , 2 ] , names = [ "Name" , "Description" ] , sep = "\t" )

def Func(arg_0, arg_1='ENSEMBL_MART_ENSEMBL'):
        """Get available datasets from mart you've selected"""
        arg_2 = arg_0.datasets(arg_1, raw=True)
        return pd.read_csv(StringIO(arg_2), header=None, usecols=[1, 2],
                            names = ["Name", "Description"],sep="\t")

Get available datasets from mart you ve selected


def Func ( arg_0 , arg_1 ) : arg_0 . mocks = [ m for m in arg_0 . mocks if m is not arg_1 ]

def Func(arg_0, arg_1):
        """
        Removes a specific mock instance by object reference.

        Arguments:
            mock (pook.Mock): mock instance to remove.
        """
        arg_0.mocks = [m for m in arg_0.mocks if m is not arg_1]

Removes a specific mock instance by object reference .


def Func(arg_0, arg_1=False, arg_2=True):
    """
    A generator to convert raw text segments, with xml, and other
    non-textual content to a list of words without any markup.
    Additionally dates are replaced by `7777` for normalization,
    along with wikipedia anchors kept.

    Arguments
    ---------
       text: str, input text to tokenize, strip of markup.
       keep_whitespace : bool, should the output retain the
          whitespace of the input (so that char offsets in the
          output correspond to those in the input).

    Returns
    -------
        generator<list<list<str>>>, a generator for sentences, with
            within each sentence a list of the words separated.
    """
    arg_3 = arg_0
    arg_3 = _remove_mvar(arg_3)
    arg_3 = _remove_squiggly_bracket(arg_3)
    arg_3 = _remove_table(arg_3)
    arg_3 = remove_markup(arg_3)
    arg_3 = remove_wikipedia_link.sub(anchor_replacer, arg_3)
    arg_3 = remove_bullets_nbsps.sub(empty_space, arg_3)
    arg_3 = remove_math_sections(arg_3)
    arg_3 = remove_html(arg_3)
    for arg_4 in sent_tokenize(arg_3, arg_1, arg_2):
        yield arg_4

A generator to convert raw text segments with xml and other non - textual content to a list of words without any markup . Additionally dates are replaced by 7777 for normalization along with wikipedia anchors kept .


def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : return DiscoItem ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 )

def Func(arg_0,arg_1,arg_2=None,arg_3=None,arg_4=None):
        """Add a new item to the `DiscoItems` object.

        :Parameters:
            - `jid`: item JID.
            - `node`: item node name.
            - `name`: item name.
            - `action`: action for a "disco push".
        :Types:
            - `jid`: `pyxmpp.JID`
            - `node`: `unicode`
            - `name`: `unicode`
            - `action`: `unicode`

        :returns: the item created.
        :returntype: `DiscoItem`."""
        return DiscoItem(arg_0,arg_1,arg_2,arg_3,arg_4)

Add a new item to the DiscoItems object .


def Func ( arg_0 ) : arg_1 = list ( arg_0 ) arg_2 = _alphanum for arg_3 , arg_4 in enumerate ( arg_0 ) : if arg_4 not in arg_2 : if arg_4 == "\000" : arg_1 [ arg_3 ] = "\\000" else : arg_1 [ arg_3 ] = "\\" + arg_4 return arg_0 [ : 0 ] . join ( arg_1 )

def Func(arg_0):
    "Escape all non-alphanumeric characters in pattern."
    arg_1 = list(arg_0)
    arg_2 = _alphanum
    for arg_3, arg_4 in enumerate(arg_0):
        if arg_4 not in arg_2:
            if arg_4 == "\000":
                arg_1[arg_3] = "\\000"
            else:
                arg_1[arg_3] = "\\" + arg_4
    return arg_0[:0].join(arg_1)

Escape all non - alphanumeric characters in pattern .


async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . DeleteConversationResponse ( ) await arg_0 . _pb_request ( 'conversations/deleteconversation' , arg_1 , arg_2 ) return arg_2

async def Func(arg_0, arg_1):
        """Leave a one-to-one conversation.

        One-to-one conversations are "sticky"; they can't actually be deleted.
        This API clears the event history of the specified conversation up to
        ``delete_upper_bound_timestamp``, hiding it if no events remain.
        """
        arg_2 = hangouts_pb2.DeleteConversationResponse()
        await arg_0._pb_request('conversations/deleteconversation',
                               arg_1, arg_2)
        return arg_2


(self, data = [], lengthR = 'None', readmode = 1)

def Func(arg_0, arg_1 = [], arg_2 = 'None', arg_3 = 1):
        """Half-duplex SPI write then read. Send command and payload to slave as bytearray
            then consequently read out response from the slave for length in bytes.
        Designed for use with NOR or NAND flash chips, and possibly SD cards...etc...
        Read command is cut in half and performed twice in series to prevent single byte errors.
        Hardware limits per command are enforced before doing anything.
        Read length is an optional argument, so that it can function similar to transfer
            but still half-duplex.
        For reading without writing, one can send a blank array or skip that argument.
        """
        #check for hardware limit of FT232H and similar MPSSE chips
        if (1 > arg_2 > 65536)|(len(arg_1) > 65536):
            print('the FTDI chip is limited to 65536 bytes (64 KB) of input/output per command!')
            print('use for loops for larger reads')
            exit(1)
        #default mode is to act like `transfer` but half-duplex
        if (arg_2 == 'None')&(arg_3 == 1):
            arg_2 = len(arg_1)
        #command parameters definition and math
        #MPSSE engine sees length 0 as 1 byte, so - 1 lengths
        arg_4 = 0x10 | (arg_0.lsbfirst << 3) | arg_0.write_clock_ve
        arg_5 = len(arg_1) - 1
        arg_6  = (arg_5) & 0xFF
        arg_7 = ((arg_5) >> 8) & 0xFF
        arg_8 = 0x20 | (arg_0.lsbfirst << 3) | (arg_0.read_clock_ve << 2)
        #force odd numbers to round up instead of down
	arg_9 = arg_2
	if arg_2 % 2 == 1:
	    arg_9 += 1
	arg_9 = arg_9/2
        #when odd length requested, get the remainder instead of the same number
	arg_10 = arg_2 - arg_9
        arg_11  = (arg_9 - 1) & 0xFF
        arg_12 = ((arg_9 - 1) >> 8) & 0xFF
        #logger debug info
        logger.debug('SPI Func with write command {0:2X}.'.format(arg_4))
        logger.debug('and read command {0:2X}.'.format(arg_8))
        #begin command set
        arg_0._assert_cs()
        #write command, these have to be separated due to TypeError
        arg_0._ft232h._write(str(bytearray((arg_4, arg_6, arg_7))))
        arg_0._ft232h._write(str(bytearray(arg_1)))
        #read command, which is divided into two commands
        arg_0._ft232h._write(str(bytearray((arg_8, arg_11, arg_12))))
        arg_13 = arg_0._ft232h._poll_read(arg_9)
        arg_0._ft232h._write(str(bytearray((arg_8, arg_11, arg_12))))
        arg_14 = arg_0._ft232h._poll_read(arg_10)
        arg_0._deassert_cs()
        #end command set
        # Read response bytes
        return bytearray(arg_13 + arg_14)

Half - duplex SPI write then read . Send command and payload to slave as bytearray then consequently read out response from the slave for length in bytes . Designed for use with NOR or NAND flash chips and possibly SD cards ... etc ... Read command is cut in half and performed twice in series to prevent single byte errors . Hardware limits per command are enforced before doing anything . Read length is an optional argument so that it can function similar to transfer but still half - duplex . For reading without writing one can send a blank array or skip that argument .


def Func(arg_0):
        """Checks if sting is valid for bidirectional printing."""
        arg_1 = False
        arg_2 = False
        for arg_3 in arg_0:
            if stringprep.in_table_d1(arg_3):
                arg_2 = True
            elif stringprep.in_table_d2(arg_3):
                arg_1 = True
        if arg_1 and arg_2:
            raise StringprepError("Both RandALCat and LCat characters present")
        if arg_2 and (not stringprep.in_table_d1(arg_0[0])
                                    or not stringprep.in_table_d1(arg_0[-1])):
            raise StringprepError("The first and the last character must"
                                                                " be RandALCat")
        return arg_0

Checks if sting is valid for bidirectional printing .


def Func(arg_0, arg_1, arg_2):
        ''' Transport a local file to a directory on a remote machine

        Args:
            - local_source (string): Path
            - remote_dir (string): Remote path

        Returns:
            - str: Path to copied file on remote machine

        Raises:
            - BadScriptPath : if script path on the remote side is bad
            - BadPermsScriptPath : You do not have perms to make the channel script dir
            - FileCopyException : FileCopy failed.

        '''
        arg_3 = arg_2 + '/' + os.path.basename(arg_1)

        try:
            arg_0.makedirs(arg_2, exist_ok=True)
        except IOError as e:
            logger.exception("Pushing {0} to {1} failed".format(arg_1, arg_2))
            if e.errno == 2:
                raise BadScriptPath(e, arg_0.hostname)
            elif e.errno == 13:
                raise BadPermsScriptPath(e, arg_0.hostname)
            else:
                logger.exception("File push failed due to SFTP client failure")
                raise FileCopyException(e, arg_0.hostname)
        try:
            arg_0.sftp_client.put(arg_1, arg_3, confirm=True)
            # Set perm because some systems require the script to be executable
            arg_0.sftp_client.chmod(arg_3, 0o777)
        except Exception as e:
            logger.exception("File push from local source {} to remote destination {} failed".format(
                arg_1, arg_3))
            raise FileCopyException(e, arg_0.hostname)

        return arg_3


return (line and _re_class.match(line)
            and stmt_contains_opcode(frame.f_code, frame.f_lineno,
                                     'BUILD_CLASS'))

def Func(arg_0, arg_1):
    """Return True if we are looking at a class definition statement"""
    return (arg_0 and _re_class.match(arg_0)
            and stmt_contains_opcode(arg_1.f_code, arg_1.f_lineno,
                                     'BUILD_CLASS'))


return self.select(lambda Z, N: not(Z % 2) and (N % 2), name=self.name)

def Func ( arg_0 ) : return arg_0 . select ( lambda Z , N : not ( Z % 2 ) and ( N % 2 ) , name = arg_0 . name )

def Func(arg_0):
        """
        Selects even-odd nuclei from the table
        """
        return arg_0.select(lambda Z, N: not(Z % 2) and (N % 2), name=arg_0.name)

Selects even - odd nuclei from the table


def Func(arg_0, arg_1):
        """Get conversion method for instruction."""
        try:
            return arg_0._bound_instructions[type(arg_1)]
        except KeyError:
            raise PulseError('Qobj conversion method for %s is not found.' % arg_1)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
{
"_object_id"
:
{
"_object_name"
:
arg_0
.
object_name
}
,
"_method_name"
:
"delete"
,
"_arguments"
:
{
"type"
:
"queue"
,
"name"
:
arg_1
,
"options"
:
dict
(
)
}
}
logger
.
debug
(
"Message content -> {0}"
.
format
(
arg_2
)
)
return
arg_2
,
arg_0
.
method_properties

def Func(arg_0, arg_1):
        """Create message content and properties to delete queue with QMFv2

        :param name: Name of queue to delete
        :type name: str

        :returns: Tuple containing content and method properties
        """
        arg_2 = {"_object_id": {"_object_name": arg_0.object_name},
                   "_method_name": "delete",
                   "_arguments": {"type": "queue",
                                  "name": arg_1,
                                  "options": dict()}}  # "A nested map with the key options. This is presently unused."
        logger.debug("Message content -> {0}".format(arg_2))

        return arg_2, arg_0.method_properties


return {
            'title': title,
            'markdown': markdown,
            'html': html,
            'summary': summary,
            'title_pic': title_pic
        }

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 , arg_4 , arg_5 = libFuncr . Func ( arg_1 ) if arg_2 == - 1 : raise SeparatorNotFound elif arg_2 == - 2 : raise PostTitleNotFound arg_3 , arg_4 , arg_5 = map ( to_unicode , ( arg_3 , arg_4 , arg_5 ) ) arg_6 = arg_0 . markdown . render ( arg_5 ) arg_7 = arg_0 . markdown . render ( arg_5 [ : 200 ] ) return { 'title' : arg_3 , 'markdown' : arg_5 , 'html' : arg_6 , 'summary' : arg_7 , 'title_pic' : arg_4 }

def Func(arg_0, arg_1):
        """Parse ascii post source, return dict"""

        arg_2, arg_3, arg_4, arg_5 = libFuncr.Func(arg_1)

        if arg_2 == -1:
            raise SeparatorNotFound
        elif arg_2 == -2:
            raise PostTitleNotFound

        # change to unicode
        arg_3, arg_4, arg_5 = map(to_unicode, (arg_3, arg_4,
                                                      arg_5))

        # render to html
        arg_6 = arg_0.markdown.render(arg_5)
        arg_7 = arg_0.markdown.render(arg_5[:200])

        return {
            'title': arg_3,
            'markdown': arg_5,
            'html': arg_6,
            'summary': arg_7,
            'title_pic': arg_4
        }


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = urijoin ( arg_0 . base_url , GitLabClient . PROJECTS , arg_0 . owner + '%2F' + arg_0 . repository , GitLabClient . MERGES , arg_1 , GitLabClient . VERSIONS , arg_2 ) arg_4 = arg_0 . fetch ( arg_3 ) return arg_4 . text

def Func(arg_0, arg_1, arg_2):
        """Get merge version detail"""

        arg_3 = urijoin(arg_0.base_url,
                       GitLabClient.PROJECTS, arg_0.owner + '%2F' + arg_0.repository,
                       GitLabClient.MERGES, arg_1, GitLabClient.VERSIONS, arg_2)

        arg_4 = arg_0.fetch(arg_3)

        return arg_4.text


def Func(arg_0, arg_1=None, arg_2=False):
        """return the likelihood of the observed sequences given the tree

        Parameters
        ----------
        pos : int, optional
            position in the sequence, if none, the sum over all positions will be returned
        full_sequence : bool, optional
            does the position refer to the full or compressed sequence, by default compressed sequence is assumed.

        Returns
        -------
        float
            likelihood
        """
        if not hasattr(arg_0.tree, "total_Func"):
            arg_0.logger("TreeAnc.Func: you need to run marginal ancestral inference first!", 1)
            arg_0.infer_ancestral_sequences(marginal=True)
        if arg_1 is not None:
            if arg_2:
                arg_3 = arg_0.full_to_reduced_sequence_map[arg_1]
            else:
                arg_3 = arg_1
            return arg_0.tree.Func[arg_3]
        else:
            return arg_0.tree.total_Func


def Func ( arg_0 ) : arg_0 . write ( { "running" : arg_0 . running } ) arg_0 . set_status ( 200 ) arg_0 . finish ( )

def Func(arg_0):
        """Check if the profiler is running."""
        arg_0.write({"running": arg_0.running})
        arg_0.set_status(200)
        arg_0.finish()


def Func(arg_0):
    """Stores the zipkin attributes to thread local.

    .. deprecated::
       Use the Tracer interface which offers better multi-threading support.
       Func will be removed in version 1.0.

    :param zipkin_attr: tuple containing zipkin related attrs
    :type zipkin_attr: :class:`zipkin.ZipkinAttrs`
    """
    from py_zipkin.storage import ThreadLocalStack
    log.warning('Func is deprecated. See DEPRECATIONS.rst for'
                'details on how to migrate to using Tracer.')
    return ThreadLocalStack().push(arg_0)

Stores the zipkin attributes to thread local.

    .. deprecated::
       Use the Tracer interface which offers better multi-threading support.
       push_zipkin_attrs will be removed in version 1.0.

    :param zipkin_attr: tuple containing zipkin related attrs
    :type zipkin_attr: :class:`zipkin.ZipkinAttrs`

Stores the zipkin attributes to thread local .


(sampler, x, delta, fraction=None, tries=0)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=0):
    """Sample a new feasible point from the point `x` in direction `delta`."""

    arg_5 = arg_0.problem
    arg_6 = ((np.abs(arg_2) > arg_0.feasibility_tol) &
             np.logical_not(arg_5.variable_fixed))

    # permissible alphas for staying in variable bounds
    arg_7 = ((1.0 - arg_0.bounds_tol) * arg_5.variable_bounds -
               arg_1)[:, arg_6]
    arg_7 = (arg_7 / arg_2[arg_6]).flatten()

    if arg_5.bounds.shape[0] > 0:
        # permissible alphas for staying in constraint bounds
        arg_8 = arg_5.inequalities.dot(arg_2)
        arg_6 = np.abs(arg_8) > arg_0.feasibility_tol
        arg_9 = ((1.0 - arg_0.bounds_tol) * arg_5.bounds -
                   arg_5.inequalities.dot(arg_1))[:, arg_6]
        arg_9 = (arg_9 / arg_8[arg_6]).flatten()

        # combined alphas
        arg_10 = np.hstack([arg_7, arg_9])
    else:
        arg_10 = arg_7
    arg_11 = arg_10[arg_10 > 0.0]
    arg_12 = arg_10[arg_10 <= 0.0]
    arg_13 = np.array([arg_12.max() if len(arg_12) > 0 else 0,
                            arg_11.min() if len(arg_11) > 0 else 0])

    if arg_3:
        arg_14 = arg_13[0] + arg_3 * (arg_13[1] - arg_13[0])
    else:
        arg_14 = np.random.uniform(arg_13[0], arg_13[1])

    arg_15 = arg_1 + arg_14 * arg_2

    # Numerical instabilities may cause bounds invalidation
    # reset sampler and sample from one of the original warmup directions
    # if that occurs. Also reset if we got stuck.
    if (np.any(arg_0._bounds_dist(arg_15) < -arg_0.bounds_tol) or
            np.abs(np.abs(arg_13).max() * arg_2).max() <
            arg_0.bounds_tol):
        if arg_4 > MAX_TRIES:
            raise RuntimeError("Can not escape sampling region, model seems"
                               " numerically unstable :( Reporting the "
                               "model to "
                               "https://github.com/opencobra/cobrapy/issues "
                               "will help us to fix this :)")
        LOGGER.info("found bounds infeasibility in sample, "
                    "resetting to center")
        arg_16 = arg_0.warmup[np.random.randint(arg_0.n_warmup)]
        arg_0.retries += 1

        return Func(arg_0, arg_0.center, arg_16 - arg_0.center, None,
                    arg_4 + 1)
    return arg_15

Sample a new feasible point from the point x in direction delta .


(is_accepted,
                      accepted,
                      rejected,
                      name=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : def _expand_is_accepted_like ( arg_4 ) : with tf . compat . v1 . name_scope ( 'expand_is_accepted_like' ) : arg_5 = tf . concat ( [ tf . shape ( input = arg_0 ) , tf . ones ( [ tf . rank ( arg_4 ) - tf . rank ( arg_0 ) ] , dtype = tf . int32 ) , ] , axis = 0 ) arg_6 = tf . concat ( [ tf . ones ( [ tf . rank ( arg_0 ) ] , dtype = tf . int32 ) , tf . shape ( input = arg_4 ) [ tf . rank ( arg_0 ) : ] , ] , axis = 0 ) arg_7 = tf . tile ( tf . reshape ( arg_0 , arg_5 ) , arg_6 ) arg_7 . set_shape ( arg_7 . shape . merge_with ( arg_4 . shape ) ) return arg_7 def _where ( arg_1 , arg_2 ) : if arg_1 is arg_2 : return arg_1 arg_1 = tf . convert_to_tensor ( value = arg_1 , arg_3 = 'accepted' ) arg_2 = tf . convert_to_tensor ( value = arg_2 , arg_3 = 'rejected' ) arg_8 = tf . where ( _expand_is_accepted_like ( arg_1 ) , arg_1 , arg_2 ) arg_8 . set_shape ( arg_8 . shape . merge_with ( arg_1 . shape . merge_with ( arg_2 . shape ) ) ) return arg_8 with tf . compat . v1 . name_scope ( arg_3 , 'choose' , values = [ arg_0 , arg_1 , arg_2 ] ) : if not is_list_like ( arg_1 ) : return _where ( arg_1 , arg_2 ) return [ ( choose ( arg_0 , arg_9 , arg_8 , arg_3 = arg_3 ) if is_namedtuple_like ( arg_9 ) else _where ( arg_9 , arg_8 ) ) for arg_9 , arg_8 in zip ( arg_1 , arg_2 ) ]

def Func(arg_0,
                      arg_1,
                      arg_2,
                      arg_3=None):
  """Helper to `choose` which expand_dims `is_accepted` and applies tf.where."""
  def _expand_is_accepted_like(arg_4):
    """Helper to expand `is_accepted` like the shape of some input arg."""
    with tf.compat.v1.name_scope('expand_is_accepted_like'):
      arg_5 = tf.concat([
          tf.shape(input=arg_0),
          tf.ones([tf.rank(arg_4) - tf.rank(arg_0)], dtype=tf.int32),
      ],
                               axis=0)
      arg_6 = tf.concat([
          tf.ones([tf.rank(arg_0)], dtype=tf.int32),
          tf.shape(input=arg_4)[tf.rank(arg_0):],
      ],
                            axis=0)
      arg_7 = tf.tile(tf.reshape(arg_0, arg_5),
                  arg_6)
      arg_7.set_shape(arg_7.shape.merge_with(arg_4.shape))
      return arg_7
  def _where(arg_1, arg_2):
    if arg_1 is arg_2:
      return arg_1
    arg_1 = tf.convert_to_tensor(value=arg_1, arg_3='accepted')
    arg_2 = tf.convert_to_tensor(value=arg_2, arg_3='rejected')
    arg_8 = tf.where(_expand_is_accepted_like(arg_1), arg_1, arg_2)
    arg_8.set_shape(arg_8.shape.merge_with(arg_1.shape.merge_with(arg_2.shape)))
    return arg_8

  with tf.compat.v1.name_scope(
      arg_3, 'choose', values=[arg_0, arg_1, arg_2]):
    if not is_list_like(arg_1):
      return _where(arg_1, arg_2)
    return [(choose(arg_0, arg_9, arg_8, arg_3=arg_3) if is_namedtuple_like(arg_9)
             else _where(arg_9, arg_8))
            for arg_9, arg_8 in zip(arg_1, arg_2)]

Helper to choose which expand_dims is_accepted and applies tf . where .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , arg_4 = RTheader . unpack_from ( arg_1 , 0 ) arg_5 , = struct . unpack_from ( "{0}s" . format ( arg_3 - 3 - 8 ) , arg_1 , RTheader . size ) arg_6 , = QRTDiscoveryBasePort . unpack_from ( arg_1 , arg_3 - 2 ) if arg_0 . receiver is not None : arg_0 . receiver ( QRTDiscoveryResponse ( arg_5 , arg_2 [ 0 ] , arg_6 ) )

def Func(arg_0, arg_1, arg_2):
        """ Parse response from QTM instances """
        arg_3, arg_4 = RTheader.unpack_from(arg_1, 0)
        arg_5, = struct.unpack_from("{0}s".format(arg_3 - 3 - 8), arg_1, RTheader.size)
        arg_6, = QRTDiscoveryBasePort.unpack_from(arg_1, arg_3 - 2)

        if arg_0.receiver is not None:
            arg_0.receiver(QRTDiscoveryResponse(arg_5, arg_2[0], arg_6))


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . root_object ( ) if isinstance ( arg_2 , Html ) : arg_3 = arg_1 [ 'name' ] arg_1 = { 'ref' : arg_0 . ref , 'type' : arg_1 [ 'type' ] , 'name' : arg_1 [ 'name' ] , 'value' : arg_1 [ 'value' ] } arg_2 . modified ( arg_1 )

def Func(arg_0, arg_1):
        """  If a change occurs when we have a websocket connection active
        notify the websocket client of the change.
        """
        arg_2 = arg_0.root_object()
        if isinstance(arg_2, Html):
            arg_3 = arg_1['name']
            arg_1 = {
                'ref': arg_0.ref,
                'type': arg_1['type'],
                'name': arg_1['name'],
                'value': arg_1['value']
            }
            arg_2.modified(arg_1)

If a change occurs when we have a websocket connection active notify the websocket client of the change .


def Func(arg_0):
    r"""Bartlett-Hann window

    :param N: window length

    .. math:: w(n) = a_0 + a_1 \left| \frac{n}{N-1} -\frac{1}{2}\right| - a_2 \cos \left( \frac{2\pi n}{N-1} \right)

    with :math:`a_0 = 0.62`, :math:`a_1 = 0.48` and :math:`a_2=0.38`

    .. plot::
        :width: 80%
        :include-source:

        from spectrum import window_visu
        window_visu(64, 'bartlett_hann')

    .. seealso:: :func:`create_window`, :class:`Window`
    """
    if arg_0 == 1:
        return ones(1)
    arg_1 = arange(0, arg_0)

    arg_2 = 0.62
    arg_3 = 0.48
    arg_4 = 0.38

    arg_5 = arg_2 -  arg_3 *abs(arg_1/(arg_0-1.)-0.5) -arg_4 * cos(2*pi*arg_1/(arg_0-1.))
    return arg_5


def Func(arg_0, arg_1=None):
        """Publish new deposit.

        :param id_: The forced record UUID.
        """
        arg_2 = current_pidstore.minters[
            current_app.config['DEPOSIT_PID_MINTER']
        ]
        arg_1 = arg_1 or uuid.uuid4()
        arg_3 = arg_2(arg_1, arg_0)

        arg_0['_deposit']['pid'] = {
            'type': arg_3.pid_type,
            'value': arg_3.pid_value,
            'revision_id': 0,
        }

        arg_4 = dict(arg_0.dumps())
        arg_4['$schema'] = arg_0.record_schema

        with arg_0._process_files(arg_1, arg_4):
            arg_5 = arg_0.published_record_class.create(arg_4, arg_1=arg_1)

        return arg_5


return super(Resource, self).list(all_pages=all_pages, **kwargs)

def Func ( arg_0 , arg_1 = False , ** arg_2 ) : arg_0 . _separate ( arg_2 ) return super ( Resource , arg_0 ) . Func ( arg_1 = arg_1 , ** arg_2 )

def Func(arg_0, arg_1=False, **arg_2):
        """Return a Func of notification templates.

        Note here configuration-related fields like
        'notification_configuration' and 'channels' will not be
        used even provided.

        If one or more filters are provided through keyword arguments,
        filter the results accordingly.

        If no filters are provided, return all results.

        =====API DOCS=====
        Retrieve a Func of objects.

        :param all_pages: Flag that if set, collect all pages of content from the API when returning results.
        :type all_pages: bool
        :param page: The page to show. Ignored if all_pages is set.
        :type page: int
        :param query: Contains 2-tuples used as query parameters to filter resulting resource objects.
        :type query: Func
        :param `**kwargs`: Keyword arguments Func of available fields used for searching resource objects.
        :returns: A JSON object containing details of all resource objects returned by Tower backend.
        :rtype: dict

        =====API DOCS=====
        """
        arg_0._separate(arg_2)
        return super(Resource, arg_0).Func(arg_1=arg_1, **arg_2)

Return a list of notification templates.

        Note here configuration-related fields like
        'notification_configuration' and 'channels' will not be
        used even provided.

        If one or more filters are provided through keyword arguments,
        filter the results accordingly.

        If no filters are provided, return all results.

        =====API DOCS=====
        Retrieve a list of objects.

        :param all_pages: Flag that if set, collect all pages of content from the API when returning results.
        :type all_pages: bool
        :param page: The page to show. Ignored if all_pages is set.
        :type page: int
        :param query: Contains 2-tuples used as query parameters to filter resulting resource objects.
        :type query: list
        :param `**kwargs`: Keyword arguments list of available fields used for searching resource objects.
        :returns: A JSON object containing details of all resource objects returned by Tower backend.
        :rtype: dict

        =====API DOCS=====

Return a list of notification templates .


return [t for t in Task.Iterator(self.task_tree, state)]

def Func(arg_0, arg_1=arg_2.ANY_MASK):
        """
        Returns a list of Task objects with the given state.

        :type  state: integer
        :param state: A bitmask of states.
        :rtype:  list[Task]
        :returns: A list of tasks.
        """
        return [arg_4 for arg_4 in arg_2.Iterator(arg_0.task_tree, arg_1)]

Returns a list of Task objects with the given state .


def Func ( arg_0 , arg_1 ) : if arg_0 . has_key ( arg_1 ) : arg_2 = arg_0 [ arg_1 ] arg_0 . nodes . remove ( arg_2 ) del arg_0 [ arg_1 ] for arg_3 in list ( arg_0 . edges ) : if arg_2 in ( arg_3 . node1 , arg_3 . node2 ) : if arg_2 in arg_3 . node1 . links : arg_3 . node1 . links . remove ( arg_2 ) if arg_2 in arg_3 . node2 . links : arg_3 . node2 . links . remove ( arg_2 ) arg_0 . edges . remove ( arg_3 )

def Func(arg_0, arg_1):

        """ Remove node with given id.
        """

        if arg_0.has_key(arg_1):
            arg_2 = arg_0[arg_1]
            arg_0.nodes.remove(arg_2)
            del arg_0[arg_1]

            # Remove all edges involving id and all links to it.
            for arg_3 in list(arg_0.edges):
                if arg_2 in (arg_3.node1, arg_3.node2):
                    if arg_2 in arg_3.node1.links:
                        arg_3.node1.links.remove(arg_2)
                    if arg_2 in arg_3.node2.links:
                        arg_3.node2.links.remove(arg_2)
                    arg_0.edges.remove(arg_3)


def Func(arg_0, arg_1, arg_2, arg_3=10):
    '''This calculates the residual and chi-sq values for a Legendre
    function fit.

    Parameters
    ----------

    x : np.array
        Array of the independent variable.

    y : np.array
        Array of the dependent variable.

    y_err : np.array
        Array of errors associated with each `y` value. Used to calculate fit
        weights.

    legendredeg : int
        The degree of the Legendre function to use when fitting.

    Returns
    -------

    tuple
        The tuple returned is of the form: (fit_y, fitchisq, fitredchisq)

    '''
    try:
        arg_4 = Legendre.fit(arg_0, arg_1, arg_3)
        arg_5 = arg_4(arg_0)
    except Exception as e:
        arg_5 = npzeros_like(arg_1)

    arg_6 = npsum(
        ((arg_5 - arg_1)*(arg_5 - arg_1)) / (arg_2*arg_2)
    )

    arg_7 = arg_3 + 1
    arg_8 = arg_6/(len(arg_1) - arg_7 - 1)

    LOGINFO(
        'legendre detrend applied. chisq = %.5f, reduced chisq = %.5f' %
        (arg_6, arg_8)
    )

    return arg_5, arg_6, arg_8

This calculates the residual and chi - sq values for a Legendre function fit .


def Func(arg_0, arg_1, arg_2=1):
    """Creates an array like a, with all values
    set to 0 except one.

    Parameters
    ----------
    a : array_like
        The returned one-hot array will have the same shape
        and dtype as this array
    index : int
        The index that should be set to `value`
    value : single value compatible with a.dtype
        The value to set at the given index

    Returns
    -------
    `numpy.ndarray`
        One-hot array with the given value at the given
        location and zeros everywhere else.

    """

    arg_3 = np.zeros_like(arg_0)
    arg_3[arg_1] = arg_2
    return arg_3

Creates an array like a with all values set to 0 except one .


def Func(arg_0, arg_1):
        """Retrive the Func with `Func_id` identifier.

        :param Func_id: identifier of the Func to retrieve
        """
        arg_2 = {
            arg_0.PKEY: arg_0.api_key
        }

        # http://example.com/t/8.json
        arg_3 = arg_0._call(arg_0.TOPIC, arg_1,
                              arg_2=arg_2)

        return arg_3

Retrive the topic with `topic_id` identifier.

        :param topic_id: identifier of the topic to retrieve

Retrive the topic with topic_id identifier .


(ra, decl,
                  survey='DSS2 Red',
                  scaling='Linear',
                  flip=True,
                  convolvewith=None,
                  forcefetch=False,
                  cachedir='~/.astrobase/stamp-cache',
                  timeout=10.0,
                  retry_failed=False,
                  savewcsheader=True,
                  verbose=False)

def Func(arg_0, arg_1,
                  arg_2='DSS2 Red',
                  arg_3='Linear',
                  arg_4=True,
                  arg_5=None,
                  arg_6=False,
                  arg_7='~/.astrobase/stamp-cache',
                  arg_8=10.0,
                  arg_9=False,
                  arg_10=True,
                  arg_11=False):
    '''This downloads a DSS FITS stamp centered on the coordinates specified.

    This wraps the function :py:func:`astrobase.services.skyview.get_stamp`,
    which downloads Digitized Sky Survey stamps in FITS format from the NASA
    SkyView service:

    https://skyview.gsfc.nasa.gov/current/cgi/query.pl

    Also adds some useful operations on top of the FITS file returned.

    Parameters
    ----------

    ra,decl : float
        The center coordinates for the stamp in decimal degrees.

    survey : str
        The survey name to get the stamp from. This is one of the
        values in the 'SkyView Surveys' option boxes on the SkyView
        webpage. Currently, we've only tested using 'DSS2 Red' as the value for
        this kwarg, but the other ones should work in principle.

    scaling : str
        This is the pixel value scaling function to use.

    flip : bool
        Will flip the downloaded image top to bottom. This should usually be
        True because matplotlib and FITS have different image coord origin
        conventions. Alternatively, set this to False and use the
        `origin='lower'` in any call to `matplotlib.pyplot.imshow` when plotting
        this image.

    convolvewith : astropy.convolution Kernel object or None
        If `convolvewith` is an astropy.convolution Kernel object from:

        http://docs.astropy.org/en/stable/convolution/kernels.html

        then, this function will return the stamp convolved with that
        kernel. This can be useful to see effects of wide-field telescopes (like
        the HATNet and HATSouth lenses) degrading the nominal 1 arcsec/px of
        DSS, causing blending of targets and any variability.

    forcefetch : bool
        If True, will disregard any existing cached copies of the stamp already
        downloaded corresponding to the requested center coordinates and
        redownload the FITS from the SkyView service.

    cachedir : str
        This is the path to the astrobase cache directory. All downloaded FITS
        stamps are stored here as .fits.gz files so we can immediately respond
        with the cached copy when a request is made for a coordinate center
        that's already been downloaded.

    timeout : float
        Sets the timeout in seconds to wait for a response from the NASA SkyView
        service.

    retry_failed : bool
        If the initial request to SkyView fails, and this is True, will retry
        until it succeeds.

    savewcsheader : bool
        If this is True, also returns the WCS header of the downloaded FITS
        stamp in addition to the FITS image itself. Useful for projecting object
        coordinates onto image xy coordinates for visualization.

    verbose : bool
        If True, indicates progress.

    Returns
    -------

    tuple or array or None
        This returns based on the value of `savewcsheader`:

        - If `savewcsheader=True`, returns a tuple:
          (FITS stamp image as a numpy array, FITS header)
        - If `savewcsheader=False`, returns only the FITS stamp image as numpy
          array.
        - If the stamp retrieval fails, returns None.

    '''

    arg_12 = get_stamp(arg_0, arg_1,
                          arg_2=arg_2,
                          arg_3=arg_3,
                          arg_6=arg_6,
                          arg_7=arg_7,
                          arg_8=arg_8,
                          arg_9=arg_9,
                          arg_11=arg_11)
    #
    # DONE WITH FETCHING STUFF
    #
    if arg_12:

        # open the frame
        arg_13 = pyfits.open(arg_12['fitsfile'])
        arg_14 = arg_13[0].header
        arg_15 = arg_13[0].data
        arg_13.close()

        # finally, we can process the frame
        if arg_4:
            arg_15 = np.flipud(arg_15)

        if arg_11:
            LOGINFO('fetched stamp successfully for (%.3f, %.3f)'
                    % (arg_0, arg_1))

        if arg_5:

            arg_16 = aconv.convolve(arg_15, arg_5)
            if arg_10:
                return arg_16, arg_14
            else:
                return arg_16

        else:

            if arg_10:
                return arg_15, arg_14
            else:
                return arg_15

    else:
        LOGERROR('could not fetch the requested stamp for '
                 'coords: (%.3f, %.3f) from survey: %s and scaling: %s'
                 % (arg_0, arg_1, arg_2, arg_3))
        return None

This downloads a DSS FITS stamp centered on the coordinates specified .


def Func(arg_0, arg_1, arg_2):
        """Fetch the pull requests"""

        arg_3 = arg_0.client.pulls(arg_1=arg_1)
        for arg_4 in arg_3:
            arg_5 = json.loads(arg_4)

            if str_to_datetime(arg_5['updated_at']) > arg_2:
                return

            arg_0.__init_extra_pull_fields(arg_5)
            for arg_6 in TARGET_PULL_FIELDS:

                if not arg_5[arg_6]:
                    continue

                if arg_6 == 'user':
                    arg_5[arg_6 + '_data'] = arg_0.__get_user(arg_5[arg_6]['login'])
                elif arg_6 == 'merged_by':
                    arg_5[arg_6 + '_data'] = arg_0.__get_user(arg_5[arg_6]['login'])
                elif arg_6 == 'review_comments':
                    arg_5[arg_6 + '_data'] = arg_0.__get_pull_review_comments(arg_5['number'])
                elif arg_6 == 'requested_reviewers':
                    arg_5[arg_6 + '_data'] = arg_0.__get_pull_requested_reviewers(arg_5['number'])
                elif arg_6 == 'commits':
                    arg_5[arg_6 + '_data'] = arg_0.__get_pull_commits(arg_5['number'])

            yield arg_5


(hours, minutes, seconds, returndeg=True)

def Func(arg_0, arg_1, arg_2, arg_3=True):
    '''Converts from HH, MM, SS to a decimal value.

    Parameters
    ----------

    hours : int
        The HH part of a RA coordinate.

    minutes : int
        The MM part of a RA coordinate.

    seconds : float
        The SS.sss part of a RA coordinate.

    returndeg : bool
        If this is True, then will return decimal degrees as the output.
        If this is False, then will return decimal HOURS as the output.
        Decimal hours are sometimes used in FITS headers.

    Returns
    -------

    float
        The right ascension value in either decimal degrees or decimal hours
        depending on `returndeg`.

    '''

    if arg_0 > 24:

        return None

    else:

        arg_4 = fabs(arg_0) + fabs(arg_1)/60.0 + fabs(arg_2)/3600.0

        if arg_3:

            arg_5 = arg_4*15.0

            if arg_5 < 0:
                arg_5 = arg_5 + 360.0
            arg_5 = arg_5 % 360.0
            return arg_5
        else:
            return arg_4

Converts from HH MM SS to a decimal value .


def Func ( arg_0 , arg_1 = "_" ) : if isinstance ( arg_0 , ( tuple , list ) ) : arg_2 = len ( arg_0 ) if arg_2 : return six . text_type ( arg_0 [ - 1 ] ) . isdigit ( ) else : return False else : return Func ( arg_0 . split ( arg_1 ) )

def Func(arg_0, arg_1="_"):
    """
    Given a string or a list will return true if the last word or
    element is a digit.  sep is used when a string is given to know
    what separates one word from another.
    """
    if isinstance(arg_0, (tuple, list)):
        arg_2 = len(arg_0)
        if arg_2:
            return six.text_type(arg_0[-1]).isdigit()
        else:
            return False
    else:
        return Func(arg_0.split(arg_1))

Given a string or a list will return true if the last word or element is a digit . sep is used when a string is given to know what separates one word from another .


def Func(arg_0):
    """Decorator to allow a simple logging configuration.

    This encompasses giving a `log_folder`, `logger_names` as well as `log_levels`.

    """

    @functools.wraps(arg_0)
    def new_func(arg_1, *arg_2, **arg_3):
        if use_simple_logging(arg_3):
            if 'log_config' in arg_3:
                raise ValueError('Please do not specify `log_config` '
                                 'if you want to use the simple '
                                 'way of providing logging configuration '
                                 '(i.e using `log_folder`, `logger_names` and/or `log_levels`).')
            _change_logging_kwargs(arg_3)

        return arg_0(arg_1, *arg_2, **arg_3)

    return new_func

Decorator to allow a simple logging configuration .


def
Func
(
arg_0
=
""
,
arg_1
=
"Please wait"
)
:
def
decorator
(
arg_2
)
:
@
functools
.
wraps
(
arg_2
)
def
wrapper
(
*
arg_3
,
**
arg_4
)
:
arg_5
=
Spinner
(
arg_0
=
arg_0
,
arg_1
=
arg_1
)
arg_5
.
start
(
)
arg_6
=
try
:
arg_6
=
arg_2
(
*
arg_3
,
**
arg_4
)
except
Exception
as
e
:
arg_5
.
msg
=
"Something went wrong: "
arg_5
.
stop_spinning
(
)
arg_5
.
join
(
)
raise
e
arg_5
.
stop_spinning
(
)
arg_5
.
join
(
)
return
arg_6
return
wrapper
return
decorator

def Func(arg_0="", arg_1="Please wait"):
        """
        Decorated methods progress will be displayed to the user as a spinner.
        Mostly for slower functions that do some network IO.
        """
        def decorator(arg_2):
            @functools.wraps(arg_2)
            def wrapper(*arg_3, **arg_4):
                arg_5 = Spinner(arg_0=arg_0, arg_1=arg_1)
                arg_5.start()
                arg_6 = None
                try:
                    arg_6 = arg_2(*arg_3, **arg_4)
                except Exception as e:
                    arg_5.msg = "Something went wrong: "
                    arg_5.stop_spinning()
                    arg_5.join()
                    raise e
                arg_5.stop_spinning()
                arg_5.join()
                return arg_6

            return wrapper

        return decorator

Decorated methods progress will be displayed to the user as a spinner . Mostly for slower functions that do some network IO .


def
Func
(
arg_0
)
:
arg_1
=
{
}
arg_2
=
os
.
path
.
expanduser
(
arg_0
.
path
)
if
not
os
.
path
.
isdir
(
arg_2
)
:
return
arg_1
logger
.
debug
(
"Load project configs from %s"
,
arg_2
)
for
arg_3
in
os
.
listdir
(
arg_2
)
:
arg_4
=
os
.
path
.
splitext
(
arg_3
)
if
arg_4
[
1
]
[
1
:
]
!=
PROJECT_CONFIG_EXTENSION
:
continue
arg_5
=
arg_4
[
0
]
try
:
arg_6
=
os
.
path
.
join
(
arg_2
,
arg_3
)
with
open
(
arg_6
)
as
f
:
arg_7
=
yaml
.
Func
(
f
)
arg_1
[
arg_5
]
=
arg_7
except
ValueError
:
continue
logger
.
debug
(
"Project '{}' config readed from {}"
.
format
(
arg_5
,
arg_6
)
)
return
arg_1

def Func(arg_0):
        """Load the projects config data from local path

        Returns:
            Dict: project_name -> project_data
        """
        arg_1 = {}

        arg_2 = os.path.expanduser(arg_0.path)

        if not os.path.isdir(arg_2):
            return arg_1

        logger.debug("Load project configs from %s", arg_2)

        for arg_3 in os.listdir(arg_2):
            arg_4 = os.path.splitext(arg_3)

            if arg_4[1][1:] != PROJECT_CONFIG_EXTENSION:
                continue
            arg_5 = arg_4[0]

            try:
                arg_6 = os.path.join(arg_2, arg_3)
                with open(arg_6) as f:
                    arg_7 = yaml.Func(f)
                arg_1[arg_5] = arg_7
            except ValueError:
                continue

            logger.debug("Project '{}' config readed from {}".format(arg_5, arg_6))

        return arg_1


def
Func
(
arg_0
)
:
arg_1
=
1
arg_2
=
[
]
while
True
:
logger
.
info
(
'Downloading page %d...'
,
arg_1
)
arg_3
=
requests
.
get
(
WEBOBS_RESULTS_URL
,
params
=
{
'obscode'
:
arg_0
,
'num_results'
:
200
,
'obs_types'
:
'all'
,
'page'
:
arg_1
,
}
)
logger
.
debug
(
arg_3
.
request
.
url
)
arg_4
=
WebObsResultsParser
(
arg_3
.
text
)
arg_2
.
extend
(
arg_4
.
get_observations
(
)
)
if
'>Next</a>'
not
in
arg_3
.
text
:
break
arg_1
+=
1
return
arg_2

def Func(arg_0):
    """
    Downloads all variable star observations by a given observer.

    Performs a series of HTTP requests to AAVSO's WebObs search and
    downloads the results page by page. Each page is then passed to
    :py:class:`~pyaavso.parsers.webobs.WebObsResultsParser` and parse results
    are added to the final observation list.
    """
    arg_1 = 1
    arg_2 = []
    while True:
        logger.info('Downloading page %d...', arg_1)
        arg_3 = requests.get(WEBOBS_RESULTS_URL, params={
            'obscode': arg_0,
            'num_results': 200,
            'obs_types': 'all',
            'page': arg_1,
        })
        logger.debug(arg_3.request.url)
        arg_4 = WebObsResultsParser(arg_3.text)
        arg_2.extend(arg_4.get_observations())
        # kinda silly, but there's no need for lxml machinery here
        if '>Next</a>' not in arg_3.text:
            break
        arg_1 += 1
    return arg_2

Downloads all variable star observations by a given observer .


(
        ra,
        decl,
        radius_arcsec=5.0,
        apiversion='v0',
        forcefetch=False,
        cachedir='~/.astrobase/mast-cache',
        verbose=True,
        timeout=90.0,
        refresh=5.0,
        maxtimeout=180.0,
        maxtries=3,
        jitter=5.0,
        raiseonfail=False
)

return mast_query(service,
                      params,
                      data=xmatch_input,
                      jitter=jitter,
                      apiversion=apiversion,
                      forcefetch=forcefetch,
                      cachedir=cachedir,
                      verbose=verbose,
                      timeout=timeout,
                      refresh=refresh,
                      maxtimeout=maxtimeout,
                      maxtries=maxtries,
                      raiseonfail=raiseonfail)

def Func ( arg_0 , arg_1 , arg_2 = 5.0 , arg_3 = 'v0' , arg_4 = False , arg_5 = '~/.astrobase/mast-cache' , arg_6 = True , arg_7 = 90.0 , arg_8 = 5.0 , arg_9 = 180.0 , arg_10 = 3 , arg_11 = 5.0 , arg_12 = False ) : arg_13 = 'Mast.Tic.Crossmatch' arg_14 = { 'fields' : [ { 'name' : 'ra' , 'type' : 'float' } , { 'name' : 'dec' , 'type' : 'float' } ] } arg_14 [ 'data' ] = [ { 'ra' : x , 'dec' : y } for ( x , y ) in zip ( arg_0 , arg_1 ) ] arg_15 = { 'raColumn' : 'ra' , 'decColumn' : 'dec' , 'radius' : arg_2 / 3600.0 } return mast_query ( arg_13 , arg_15 , data = arg_14 , arg_11 = arg_11 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 , arg_9 = arg_9 , arg_10 = arg_10 , arg_12 = arg_12 )

def Func(
        arg_0,
        arg_1,
        arg_2=5.0,
        arg_3='v0',
        arg_4=False,
        arg_5='~/.astrobase/mast-cache',
        arg_6=True,
        arg_7=90.0,
        arg_8=5.0,
        arg_9=180.0,
        arg_10=3,
        arg_11=5.0,
        arg_12=False
):
    '''This does a cross-match with TIC.

    Parameters
    ----------

    ra,decl : np.arrays or lists of floats
        The coordinates that will be cross-matched against the TIC.

    radius_arcsec : float
        The cross-match radius in arcseconds.

    apiversion : str
        The API version of the MAST service to use. This sets the URL that this
        function will call, using `apiversion` as key into the `MAST_URLS` dict
        above.

    forcefetch : bool
        If this is True, the query will be retried even if cached results for
        it exist.

    cachedir : str
        This points to the directory where results will be downloaded.

    verbose : bool
        If True, will indicate progress and warn of any issues.

    timeout : float
        This sets the amount of time in seconds to wait for the service to
        respond to our initial request.

    refresh : float
        This sets the amount of time in seconds to wait before checking if the
        result file is available. If the results file isn't available after
        `refresh` seconds have elapsed, the function will wait for `refresh`
        seconds continuously, until `maxtimeout` is reached or the results file
        becomes available.

    maxtimeout : float
        The maximum amount of time in seconds to wait for a result to become
        available after submitting our query request.

    maxtries : int
        The maximum number of tries (across all mirrors tried) to make to either
        submit the request or download the results, before giving up.

    jitter : float
        This is used to control the scale of the random wait in seconds before
        starting the query. Useful in parallelized situations.

    raiseonfail : bool
        If this is True, the function will raise an Exception if something goes
        wrong, instead of returning None.

    Returns
    -------

    dict
        This returns a dict of the following form::

            {'params':dict of the input params used for the query,
             'provenance':'cache' or 'new download',
             'result':path to the file on disk with the downloaded data table}

    '''

    arg_13 = 'Mast.Tic.Crossmatch'

    arg_14 = {'fields':[{'name':'ra','type':'float'},
                              {'name':'dec','type':'float'}]}
    arg_14['data'] = [{'ra':x, 'dec':y} for (x,y) in zip(arg_0, arg_1)]

    arg_15 = {'raColumn':'ra',
              'decColumn':'dec',
              'radius':arg_2/3600.0}

    return mast_query(arg_13,
                      arg_15,
                      data=arg_14,
                      arg_11=arg_11,
                      arg_3=arg_3,
                      arg_4=arg_4,
                      arg_5=arg_5,
                      arg_6=arg_6,
                      arg_7=arg_7,
                      arg_8=arg_8,
                      arg_9=arg_9,
                      arg_10=arg_10,
                      arg_12=arg_12)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
re
.
compile
(
r'\\[\s\n]*$'
)
arg_3
=
re
.
compile
(
r':[\s\n]*$'
)
arg_4
=
re
.
compile
(
r'^(\s*)'
)
arg_5
=
[
]
arg_6
=
arg_0
[
arg_1
]
arg_7
=
arg_4
.
match
(
arg_6
)
.
groups
(
)
[
0
]
arg_8
=
arg_0
[
max
(
arg_1
3
,
0
)
:
arg_1
]
arg_8
.
reverse
(
)
arg_9
=
arg_0
[
arg_1
+
1
:
min
(
arg_1
+
4
,
len
(
arg_0
)
)
]
for
arg_10
in
arg_8
:
if
arg_4
.
match
(
arg_10
)
.
groups
(
)
[
0
]
==
arg_7
:
arg_5
.
append
(
arg_10
)
else
:
break
arg_5
.
reverse
(
)
arg_5
.
append
(
arg_6
)
arg_11
=
len
(
arg_5
)
1
arg_12
=
arg_2
.
search
(
arg_6
)
for
arg_10
in
arg_9
:
if
(
(
arg_12
or
arg_4
.
match
(
arg_10
)
.
groups
(
)
[
0
]
==
arg_7
)
and
not
arg_3
.
search
(
arg_10
)
)
:
arg_5
.
append
(
arg_10
)
arg_12
=
arg_2
.
search
(
arg_10
)
else
:
break
log
.
debug
(
"Inspecting lines '''%s''' around %s"
,
arg_5
,
arg_11
)
return
arg_5
,
arg_11

def Func(arg_0, arg_1):
    """Find lines in home that are inspectable.

    Walk back from the err line up to 3 lines, but don't walk back over
    changes in indent level.

    Walk forward up to 3 lines, counting \ separated lines as 1. Don't walk
    over changes in indent level (unless part of an extended line)
    """
    arg_2 = re.compile(r'\\[\s\n]*$')
    arg_3 = re.compile(r':[\s\n]*$')
    arg_4 = re.compile(r'^(\s*)')
    arg_5 = []
    arg_6 = arg_0[arg_1]
    arg_7 = arg_4.match(arg_6).groups()[0]

    arg_8 = arg_0[max(arg_1-3, 0):arg_1]
    arg_8.reverse()
    arg_9 = arg_0[arg_1+1:min(arg_1+4, len(arg_0))]

    for arg_10 in arg_8:
        if arg_4.match(arg_10).groups()[0] == arg_7:
            arg_5.append(arg_10)
        else:
            break
    arg_5.reverse()
    arg_5.append(arg_6)
    arg_11 = len(arg_5)-1
    arg_12 = arg_2.search(arg_6)
    for arg_10 in arg_9:
        if ((arg_12 or arg_4.match(arg_10).groups()[0] == arg_7)
            and not arg_3.search(arg_10)):
            arg_5.append(arg_10)
            arg_12 = arg_2.search(arg_10)
        else:
            break
    log.debug("Inspecting lines '''%s''' around %s", arg_5, arg_11)
    return arg_5, arg_11

Find lines in home that are inspectable . Walk back from the err line up to 3 lines but don t walk back over changes in indent level .


def Func ( arg_0 ) : if arg_0 . redirect is not None : arg_0 . redirect . Func ( ) super ( TeeStringIO , arg_0 ) . Func ( )

def Func(arg_0):  # nocover
        """
        Flush to this and the redirected stream
        """
        if arg_0.redirect is not None:
            arg_0.redirect.Func()
        super(TeeStringIO, arg_0).Func()


def Func ( arg_0 , arg_1 ) : arg_2 = { "spouts" : { } , "bolts" : { } , } for arg_3 in arg_1 . spouts ( ) : arg_4 = arg_3 . comp . name arg_5 = "default" arg_6 = "NA" arg_7 = "NA" arg_8 = arg_3 . comp . config . kvs for arg_9 in arg_8 : if arg_9 . key == "spout.type" : arg_5 = javaobj . loads ( arg_9 . serialized_value ) elif arg_9 . key == "spout.source" : arg_6 = javaobj . loads ( arg_9 . serialized_value ) elif arg_9 . key == "spout.version" : arg_7 = javaobj . loads ( arg_9 . serialized_value ) arg_10 = { "config" : convert_pb_kvs ( arg_8 , include_non_primitives = False ) , "type" : arg_5 , "source" : arg_6 , "version" : arg_7 , "outputs" : [ ] } for arg_11 in list ( arg_3 . outputs ) : arg_10 [ "outputs" ] . append ( { "stream_name" : arg_11 . stream . id } ) arg_2 [ "spouts" ] [ arg_4 ] = arg_10 for arg_12 in arg_1 . bolts ( ) : arg_13 = arg_12 . comp . name arg_14 = { "config" : convert_pb_kvs ( arg_12 . comp . config . kvs , include_non_primitives = False ) , "outputs" : [ ] , "inputs" : [ ] } for arg_11 in list ( arg_12 . outputs ) : arg_14 [ "outputs" ] . append ( { "stream_name" : arg_11 . stream . id } ) for arg_15 in list ( arg_12 . inputs ) : arg_14 [ "inputs" ] . append ( { "stream_name" : arg_15 . stream . id , "component_name" : arg_15 . stream . component_name , "grouping" : topology_pb2 . Grouping . Name ( arg_15 . gtype ) } ) arg_2 [ "bolts" ] [ arg_13 ] = arg_14 return arg_2

def Func(arg_0, arg_1):
    """
    Returns the representation of logical plan that will
    be returned from Tracker.
    """
    arg_2 = {
        "spouts": {},
        "bolts": {},
    }

    # Add spouts.
    for arg_3 in arg_1.spouts():
      arg_4 = arg_3.comp.name
      arg_5 = "default"
      arg_6 = "NA"
      arg_7 = "NA"
      arg_8 = arg_3.comp.config.kvs
      for arg_9 in arg_8:
        if arg_9.key == "spout.type":
          arg_5 = javaobj.loads(arg_9.serialized_value)
        elif arg_9.key == "spout.source":
          arg_6 = javaobj.loads(arg_9.serialized_value)
        elif arg_9.key == "spout.version":
          arg_7 = javaobj.loads(arg_9.serialized_value)
      arg_10 = {
          "config": convert_pb_kvs(arg_8, include_non_primitives=False),
          "type": arg_5,
          "source": arg_6,
          "version": arg_7,
          "outputs": []
      }
      for arg_11 in list(arg_3.outputs):
        arg_10["outputs"].append({
            "stream_name": arg_11.stream.id
        })

      arg_2["spouts"][arg_4] = arg_10

    # Add bolts.
    for arg_12 in arg_1.bolts():
      arg_13 = arg_12.comp.name
      arg_14 = {
          "config": convert_pb_kvs(arg_12.comp.config.kvs, include_non_primitives=False),
          "outputs": [],
          "inputs": []
      }
      for arg_11 in list(arg_12.outputs):
        arg_14["outputs"].append({
            "stream_name": arg_11.stream.id
        })
      for arg_15 in list(arg_12.inputs):
        arg_14["inputs"].append({
            "stream_name": arg_15.stream.id,
            "component_name": arg_15.stream.component_name,
            "grouping": topology_pb2.Grouping.Name(arg_15.gtype)
        })

      arg_2["bolts"][arg_13] = arg_14

    return arg_2

Returns the representation of logical plan that will be returned from Tracker .


def Func ( arg_0 , arg_1 = False ) : arg_2 = arg_1 and run_as_root or arg_0 . run return arg_2 ( 'Func' )

def Func(arg_0, arg_1=False):
        """
        Get the user's Func.

        Returns a string such as ``'0002'``, representing the user's Func
        as an octal number.

        If `use_sudo` is `True`, this function returns root's Func.
        """
        arg_2 = arg_1 and run_as_root or arg_0.run
        return arg_2('Func')

Get the user's umask.

        Returns a string such as ``'0002'``, representing the user's umask
        as an octal number.

        If `use_sudo` is `True`, this function returns root's umask.


return self.get_enrollments_for_section(
            self._sis_id(sis_section_id, sis_field="section"), params)

def Func ( arg_0 , arg_1 , arg_2 = { } ) : return arg_0 . get_enrollments_for_section ( arg_0 . _sis_id ( arg_1 , sis_field = "section" ) , arg_2 )

def Func(arg_0, arg_1, arg_2={}):
        """
        Return a list of all enrollments for the passed section sis id.
        """
        return arg_0.get_enrollments_for_section(
            arg_0._sis_id(arg_1, sis_field="section"), arg_2)

Return a list of all enrollments for the passed section sis id .


def Func ( arg_0 , arg_1 , arg_2 = 'prod' ) : arg_3 = ApiClient . Func ( arg_1 , arg_2 ) return arg_0 ( arg_3 )

def Func(arg_0, arg_1, arg_2='prod'):
        '''Create Func storage service client.

            Arguments:
                environment(str): The service environment to be used for the client.
                    'prod' or 'dev'.
                access_token(str): The access token used to authenticate with the
                    service

            Returns:
                A storage_service.Client instance
        '''

        arg_3 = ApiClient.Func(arg_1, arg_2)
        return arg_0(arg_3)

Create new storage service client.

            Arguments:
                environment(str): The service environment to be used for the client.
                    'prod' or 'dev'.
                access_token(str): The access token used to authenticate with the
                    service

            Returns:
                A storage_service.Client instance


def Func ( arg_0 ) : def decorator ( arg_1 ) : @ functools . wraps ( arg_1 ) def wrapper ( arg_2 , arg_3 ) : arg_3 = arg_3 or [ ] for arg_4 in arg_3 : arg_5 = arg_3 [ arg_4 ] if isinstance ( arg_4 , str ) else arg_4 arg_5 . redshift = arg_5 . redshift or conf . instance . general . get ( "redshift" , arg_0 , float ) return arg_1 ( arg_2 , arg_3 ) return wrapper return decorator

def Func(arg_0):
    """
    Load a default value for redshift from config and set it as the redshift for source or lens galaxies that have
    falsey redshifts

    Parameters
    ----------
    key: str

    Returns
    -------
    decorator
        A decorator that wraps the setter function to set defaults
    """

    def decorator(arg_1):
        @functools.wraps(arg_1)
        def wrapper(arg_2, arg_3):
            arg_3 = arg_3 or []
            for arg_4 in arg_3:
                # noinspection PyTypeChecker
                arg_5 = arg_3[arg_4] if isinstance(arg_4, str) else arg_4
                arg_5.redshift = arg_5.redshift or conf.instance.general.get("redshift", arg_0, float)
            return arg_1(arg_2, arg_3)

        return wrapper

    return decorator


(host, path, secure, expires, name, value)

return http.cookiejar.Cookie(0, name, value, None, False, host, host.startswith('.'), host.startswith('.'), path,
                                 True, secure, expires, False, None, None, {})

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : return http . cookiejar . Cookie ( 0 , arg_4 , arg_5 , None , False , arg_0 , arg_0 . startswith ( '.' ) , arg_0 . startswith ( '.' ) , arg_1 , True , arg_2 , arg_3 , False , None , None , { } )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """Shortcut function to create a cookie
    """
    return http.cookiejar.Cookie(0, arg_4, arg_5, None, False, arg_0, arg_0.startswith('.'), arg_0.startswith('.'), arg_1,
                                 True, arg_2, arg_3, False, None, None, {})


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
=
arg_1
.
shape
[
0
]
if
arg_1
.
shape
!=
(
arg_3
,
arg_3
)
:
raise
TypeError
(
"Input must be a square matrix."
)
arg_4
=
get_memory
(
arg_0
.
memory
)
arg_5
,
arg_6
=
arg_4
.
cache
(
scipy
.
linalg
.
eigh
,
ignore
=
[
'overwrite_a'
]
)
(
arg_1
,
overwrite_a
=
not
arg_0
.
copy
)
arg_5
=
arg_5
[
:
,
]
arg_0
.
flip_
=
np
.
dot
(
arg_6
,
np
.
sign
(
arg_5
)
*
arg_6
.
T
)
return
arg_0

def Func(arg_0, arg_1, arg_2=None):
        '''
        Learn the linear transformation to flipped eigenvalues.

        Parameters
        ----------
        X : array, shape [n, n]
            The *symmetric* input similarities. If X is asymmetric, it will be
            treated as if it were symmetric based on its lower-triangular part.
        '''
        arg_3 = arg_1.shape[0]
        if arg_1.shape != (arg_3, arg_3):
            raise TypeError("Input must be a square matrix.")

        # TODO: only get negative eigs somehow?
        arg_4 = get_memory(arg_0.memory)
        arg_5, arg_6 = arg_4.cache(scipy.linalg.eigh, ignore=['overwrite_a'])(
            arg_1, overwrite_a=not arg_0.copy)
        arg_5 = arg_5[:, None]

        arg_0.flip_ = np.dot(arg_6, np.sign(arg_5) * arg_6.T)
        return arg_0

Learn the linear transformation to flipped eigenvalues .


(sentences, continuous=False, sim_threshold=0.1, alpha=0.9,
            use_divrank=False, divrank_alpha=0.25)

def Func(arg_0, arg_1=False, arg_2=0.1, arg_3=0.9,
            arg_4=False, arg_5=0.25):
    '''
    compute centrality score of sentences.

    Args:
      sentences: [u'こんにちは．', u'私の名前は飯沼です．', ... ]
      continuous: if True, apply continuous LexRank. (see reference)
      sim_threshold: if continuous is False and smilarity is greater or
        equal to sim_threshold, link the sentences.
      alpha: the damping factor of PageRank and DivRank
      divrank: if True, apply DivRank instead of PageRank
      divrank_alpha: strength of self-link [0.0-1.0]
        (it's not the damping factor, see divrank.py)

    Returns: tuple
      (
        {
          # sentence index -> score
          0: 0.003,
          1: 0.002,
          ...
        },
        similarity_matrix
      )

    Reference:
      Günes Erkan and Dragomir R. Radev.
      LexRank: graph-based lexical centrality as salience in text
      summarization. (section 3)
      http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume22/erkan04a-html/erkan04a.html
    '''
    # configure ranker
    arg_6 = {'max_iter': 1000}
    if arg_4:
        arg_7 = divrank_scipy
        arg_6['alpha'] = arg_5
        arg_6['d'] = arg_3
    else:
        arg_7 = networkx.pagerank_scipy
        arg_6['alpha'] = arg_3

    arg_8 = networkx.DiGraph()

    # sentence -> tf
    arg_9 = []
    for arg_10 in arg_0:
        arg_11 = tools.word_segmenter_ja(arg_10)
        arg_12 = collections.Counter(arg_11)
        arg_9.append(arg_12)

    arg_13 = DictVectorizer(sparse=True)
    arg_14 = arg_13.fit_transform(arg_9)

    # compute similarities between senteces
    arg_15 = 1 - pairwise_distances(arg_14, arg_14, metric='cosine')

    if arg_1:
        arg_16, arg_17 = numpy.where(arg_15 > 0)
    else:
        arg_16, arg_17 = numpy.where(arg_15 >= arg_2)

    # create similarity graph
    arg_8.add_nodes_from(range(arg_14.shape[0]))
    for arg_18, arg_19 in zip(arg_16, arg_17):
        if arg_18 == arg_19:
            continue
        arg_20 = arg_15[arg_18,arg_19] if arg_1 else 1.0
        arg_8.add_edge(arg_18, arg_19, {'weight': arg_20})

    arg_21 = arg_7(arg_8, **arg_6)
    return arg_21, arg_15


return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or
          (linenum >= 2 and
           (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$',
                  clean_lines.elided[linenum - 1]) or
            Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$',
                  clean_lines.elided[linenum - 2]) or
            Search(r'\bstd::m?function\s*\<\s*$',
                   clean_lines.elided[linenum - 1]))))

def Func(arg_0, arg_1):
  """Checks whether where function type arguments are expected.

  Args:
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.

  Returns:
    True if the line at 'linenum' is inside something that expects arguments
    of function types.
  """
  arg_2 = arg_0.elided[arg_1]
  return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', arg_2) or
          (arg_1 >= 2 and
           (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$',
                  arg_0.elided[arg_1 - 1]) or
            Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$',
                  arg_0.elided[arg_1 - 2]) or
            Search(r'\bstd::m?function\s*\<\s*$',
                   arg_0.elided[arg_1 - 1]))))

Checks whether where function type arguments are expected .


def Func ( arg_0 , arg_1 ) : arg_2 = '/' + arg_0 . _trajectory_name + '/' + arg_1 . replace ( '.' , '/' ) arg_3 = arg_0 . _hdf5file . get_node ( where = arg_2 ) arg_3 . _f_remove ( )

def Func(arg_0, arg_1):
        """Removes a link from disk"""
        arg_2 = '/' + arg_0._trajectory_name + '/' + arg_1.replace('.','/')
        arg_3 = arg_0._hdf5file.get_node(where=arg_2)
        arg_3._f_remove()