def Func(arg_0, arg_1=arg_2, arg_3=arg_4):
        """Retrieve all items for category using pagination """

        arg_5 = True  # There are more items to be processed
        arg_6 = None  # URI for the next items page query
        arg_7 = ReMoClient.FIRST_PAGE
        arg_7 += int(arg_3 / ReMoClient.ITEMS_PER_PAGE)

        if arg_1 == arg_2:
            arg_8 = arg_0.api_events_url
        elif arg_1 == CATEGORY_ACTIVITY:
            arg_8 = arg_0.api_activities_url
        elif arg_1 == CATEGORY_USER:
            arg_8 = arg_0.api_users_url
        else:
            raise ValueError(arg_1 + ' not supported in ReMo')

        while arg_5:
            arg_9 = {
                "page": arg_7,
                "orderby": "ASC"
            }

            logger.debug("ReMo client calls APIv2: %s params: %s",
                         arg_8, str(arg_9))

            arg_10 = arg_0.fetch(arg_8, payload=arg_9)
            yield arg_10

            arg_11 = json.loads(arg_10)
            arg_6 = arg_11['next']

            if not arg_6:
                arg_5 = False
            else:
                # https://reps.mozilla.org/remo/api/remo/v1/events/?orderby=ASC&page=269
                arg_12 = urllib.parse.urlparse(arg_6)
                arg_13 = urllib.parse.parse_qs(arg_12.query)
                arg_7 = arg_13['page'][0]


return xml_data, xml_encoding, sniffed_xml_encoding

def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = arg_4 = None try : if arg_1 [ : 4 ] == '\x4c\x6f\xa7\x94' : arg_1 = arg_0 . _ebcdic_to_ascii ( arg_1 ) elif arg_1 [ : 4 ] == '\x00\x3c\x00\x3f' : arg_4 = 'utf-16be' arg_1 = unicode ( arg_1 , 'utf-16be' ) . encode ( 'utf-8' ) elif ( len ( arg_1 ) >= 4 ) and ( arg_1 [ : 2 ] == '\xfe\xff' ) and ( arg_1 [ 2 : 4 ] != '\x00\x00' ) : arg_4 = 'utf-16be' arg_1 = unicode ( arg_1 [ 2 : ] , 'utf-16be' ) . encode ( 'utf-8' ) elif arg_1 [ : 4 ] == '\x3c\x00\x3f\x00' : arg_4 = 'utf-16le' arg_1 = unicode ( arg_1 , 'utf-16le' ) . encode ( 'utf-8' ) elif ( len ( arg_1 ) >= 4 ) and ( arg_1 [ : 2 ] == '\xff\xfe' ) and ( arg_1 [ 2 : 4 ] != '\x00\x00' ) : arg_4 = 'utf-16le' arg_1 = unicode ( arg_1 [ 2 : ] , 'utf-16le' ) . encode ( 'utf-8' ) elif arg_1 [ : 4 ] == '\x00\x00\x00\x3c' : arg_4 = 'utf-32be' arg_1 = unicode ( arg_1 , 'utf-32be' ) . encode ( 'utf-8' ) elif arg_1 [ : 4 ] == '\x3c\x00\x00\x00' : arg_4 = 'utf-32le' arg_1 = unicode ( arg_1 , 'utf-32le' ) . encode ( 'utf-8' ) elif arg_1 [ : 4 ] == '\x00\x00\xfe\xff' : arg_4 = 'utf-32be' arg_1 = unicode ( arg_1 [ 4 : ] , 'utf-32be' ) . encode ( 'utf-8' ) elif arg_1 [ : 4 ] == '\xff\xfe\x00\x00' : arg_4 = 'utf-32le' arg_1 = unicode ( arg_1 [ 4 : ] , 'utf-32le' ) . encode ( 'utf-8' ) elif arg_1 [ : 3 ] == '\xef\xbb\xbf' : arg_4 = 'utf-8' arg_1 = unicode ( arg_1 [ 3 : ] , 'utf-8' ) . encode ( 'utf-8' ) else : arg_4 = 'ascii' pass except : arg_5 = None arg_5 = re . compile ( '^<\?.*encoding=[\'"](.*?)[\'"].*\?>' ) . match ( arg_1 ) if not arg_5 and arg_2 : arg_6 = re . compile ( '<\s*meta[^>]+charset=([^>]*?)[;\'">]' , re . I ) arg_5 = arg_6 . search ( arg_1 ) if arg_5 is not None : arg_3 = arg_5 . groups ( ) [ 0 ] . lower ( ) if arg_2 : arg_0 . declaredHTMLEncoding = arg_3 if arg_4 and ( arg_3 in ( 'iso-10646-ucs-2' , 'ucs-2' , 'csunicode' , 'iso-10646-ucs-4' , 'ucs-4' , 'csucs4' , 'utf-16' , 'utf-32' , 'utf_16' , 'utf_32' , 'utf16' , 'u16' ) ) : arg_3 = arg_4 return arg_1 , arg_3 , arg_4

def Func(arg_0, arg_1, arg_2=False):
        """Given a document, tries to detect its XML encoding."""
        arg_3 = arg_4 = None
        try:
            if arg_1[:4] == '\x4c\x6f\xa7\x94':
                # EBCDIC
                arg_1 = arg_0._ebcdic_to_ascii(arg_1)
            elif arg_1[:4] == '\x00\x3c\x00\x3f':
                # UTF-16BE
                arg_4 = 'utf-16be'
                arg_1 = unicode(arg_1, 'utf-16be').encode('utf-8')
            elif (len(arg_1) >= 4) and (arg_1[:2] == '\xfe\xff') \
                     and (arg_1[2:4] != '\x00\x00'):
                # UTF-16BE with BOM
                arg_4 = 'utf-16be'
                arg_1 = unicode(arg_1[2:], 'utf-16be').encode('utf-8')
            elif arg_1[:4] == '\x3c\x00\x3f\x00':
                # UTF-16LE
                arg_4 = 'utf-16le'
                arg_1 = unicode(arg_1, 'utf-16le').encode('utf-8')
            elif (len(arg_1) >= 4) and (arg_1[:2] == '\xff\xfe') and \
                     (arg_1[2:4] != '\x00\x00'):
                # UTF-16LE with BOM
                arg_4 = 'utf-16le'
                arg_1 = unicode(arg_1[2:], 'utf-16le').encode('utf-8')
            elif arg_1[:4] == '\x00\x00\x00\x3c':
                # UTF-32BE
                arg_4 = 'utf-32be'
                arg_1 = unicode(arg_1, 'utf-32be').encode('utf-8')
            elif arg_1[:4] == '\x3c\x00\x00\x00':
                # UTF-32LE
                arg_4 = 'utf-32le'
                arg_1 = unicode(arg_1, 'utf-32le').encode('utf-8')
            elif arg_1[:4] == '\x00\x00\xfe\xff':
                # UTF-32BE with BOM
                arg_4 = 'utf-32be'
                arg_1 = unicode(arg_1[4:], 'utf-32be').encode('utf-8')
            elif arg_1[:4] == '\xff\xfe\x00\x00':
                # UTF-32LE with BOM
                arg_4 = 'utf-32le'
                arg_1 = unicode(arg_1[4:], 'utf-32le').encode('utf-8')
            elif arg_1[:3] == '\xef\xbb\xbf':
                # UTF-8 with BOM
                arg_4 = 'utf-8'
                arg_1 = unicode(arg_1[3:], 'utf-8').encode('utf-8')
            else:
                arg_4 = 'ascii'
                pass
        except:
            arg_5 = None
        arg_5 = re.compile(
            '^<\?.*encoding=[\'"](.*?)[\'"].*\?>').match(arg_1)
        if not arg_5 and arg_2:
            arg_6 = re.compile('<\s*meta[^>]+charset=([^>]*?)[;\'">]', re.I)
            arg_5 = arg_6.search(arg_1)
        if arg_5 is not None:
            arg_3 = arg_5.groups()[0].lower()
            if arg_2:
                arg_0.declaredHTMLEncoding = arg_3
            if arg_4 and \
               (arg_3 in ('iso-10646-ucs-2', 'ucs-2', 'csunicode',
                                 'iso-10646-ucs-4', 'ucs-4', 'csucs4',
                                 'utf-16', 'utf-32', 'utf_16', 'utf_32',
                                 'utf16', 'u16')):
                arg_3 = arg_4
        return arg_1, arg_3, arg_4

Given a document tries to detect its XML encoding .


def Func ( arg_0 , arg_1 , arg_2 = 'R' ) : arg_3 = arg_0 . get_sub_doc ( 'gamelog/{}' . format ( arg_1 ) ) arg_4 = ( arg_3 ( 'table#pgl_basic_playoffs' ) if arg_2 == 'P' else arg_3 ( 'table#pgl_basic' ) ) arg_5 = sportsref . utils . parse_table ( arg_4 ) return arg_5

def Func(arg_0, arg_1, arg_2='R'):
        """Returns a table of a player's basic game-by-game stats for a season.

        :param year: The year representing the desired season.
        :param kind: specifies regular season, playoffs, or both. One of 'R',
            'P', 'B'. Defaults to 'R'.
        :returns: A DataFrame of the player's standard boxscore stats from each
            game of the season.
        :rtype: pd.DataFrame
        """
        arg_3 = arg_0.get_sub_doc('gamelog/{}'.format(arg_1))
        arg_4 = (arg_3('table#pgl_basic_playoffs')
                 if arg_2 == 'P' else arg_3('table#pgl_basic'))
        arg_5 = sportsref.utils.parse_table(arg_4)
        return arg_5

Returns a table of a player s basic game - by - game stats for a season .


def Func ( arg_0 ) : arg_1 . get ( 'sitetrees_reset' ) and arg_0 . empty ( Func = False ) arg_0 . cache = arg_1 . get ( 'sitetrees' , { 'sitetrees' : { } , 'parents' : { } , 'items_by_ids' : { } , 'tree_aliases' : { } } )

def Func(arg_0):
        """Initializes local cache from Django cache."""

        # Drop cache flag set by .reset() method.
        arg_1.get('sitetrees_reset') and arg_0.empty(Func=False)

        arg_0.cache = arg_1.get(
            'sitetrees', {'sitetrees': {}, 'parents': {}, 'items_by_ids': {}, 'tree_aliases': {}})

Initializes local cache from Django cache .


def
Func
(
arg_0
)
:
CLOG
.
debug
(
'Eigen update.'
)
arg_1
,
arg_2
=
np
.
linalg
.
eigh
(
arg_0
.
JTJ
)
arg_3
=
arg_0
.
calc_residuals
(
)
for
arg_4
in
range
(
min
(
[
arg_0
.
num_eig_dirs
,
arg_1
.
size
]
)
)
:
arg_5
=
arg_2
[
(
arg_4
+
1
)
]
arg_6
=
arg_0
.
eig_dl
arg_7
=
arg_0
.
update_function
(
arg_0
.
param_vals
+
arg_6
*
arg_5
)
arg_8
=
arg_0
.
calc_residuals
(
)
arg_9
=
(
arg_8
arg_3
)
/
arg_6
arg_0
.
_rank_1_J_update
(
arg_5
,
arg_9
)
arg_0
.
JTJ
=
np
.
dot
(
arg_0
.
J
,
arg_0
.
J
.
T
)
arg_7
=
arg_0
.
update_function
(
arg_0
.
param_vals
)

def Func(arg_0):
        """Execute an eigen update of J"""
        CLOG.debug('Eigen update.')
        arg_1, arg_2 = np.linalg.eigh(arg_0.JTJ)
        arg_3 = arg_0.calc_residuals()
        for arg_4 in range(min([arg_0.num_eig_dirs, arg_1.size])):
            #1. Finding stiff directions
            arg_5 = arg_2[-(arg_4+1)] #already normalized

            #2. Evaluating derivative along that direction, we'll use dl=5e-4:
            arg_6 = arg_0.eig_dl #1e-5
            arg_7 = arg_0.update_function(arg_0.param_vals + arg_6*arg_5)
            arg_8 = arg_0.calc_residuals()

            #3. Updating
            arg_9 = (arg_8-arg_3)/arg_6
            arg_0._rank_1_J_update(arg_5, arg_9)

        arg_0.JTJ = np.dot(arg_0.J, arg_0.J.T)
        #Putting the parameters back:
        arg_7 = arg_0.update_function(arg_0.param_vals)


def Func(arg_0, arg_1):
        """
        Checks if the attribute name is in the list of attributes to protect. If so, raises
        TranspilerAccessError.

        Args:
            name (string): the attribute name to check

        Raises:
            TranspilerAccessError: when name is the list of attributes to protect.
        """
        if arg_1 in object.__getattribute__(arg_0, '_attributes_to_fence'):
            raise TranspilerAccessError("The fenced %s has the property %s protected" %
                                        (type(object.__getattribute__(arg_0, '_wrapped')), arg_1))

Checks if the attribute name is in the list of attributes to protect . If so raises TranspilerAccessError .


def Func(arg_0):
    """
    Returns the left half of the split complement.

    A list is returned with the same darker and softer colors
    as in the complementary list, but using the hue of the
    left split complement instead of the complement itself.
    """
    arg_1 = split_complementary(arg_0)[1]
    arg_2 = complementary(arg_0)
    arg_2[3].h = arg_1.h
    arg_2[4].h = arg_1.h
    arg_2[5].h = arg_1.h

    arg_2 = colorlist(
        arg_2[0], arg_2[2], arg_2[1], arg_2[3], arg_2[4], arg_2[5]
    )

    return arg_2

Returns the left half of the split complement .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . b_in arg_3 = lambda x : np . sqrt ( np . dot ( x , x ) ) arg_4 = arg_0 . npts [ 1 ] arg_5 = arg_0 . get_values ( arg_0 . barnes_params ) arg_6 = BarnesInterpolationND ( arg_2 , arg_5 , filter_size = arg_0 . filtsize , damp = 0.9 , iterations = 3 , clip = arg_0 . local_updates , clipsize = arg_0 . barnes_clip_size , blocksize = 100 ) return arg_6 ( arg_1 )

def Func(arg_0, arg_1):
        """Creates a barnes interpolant & calculates its values"""
        arg_2 = arg_0.b_in
        arg_3 = lambda x: np.sqrt(np.dot(x,x))
        #we take a filter size as the max distance between the grids along
        #x or y:
        arg_4 = arg_0.npts[1]
        arg_5 = arg_0.get_values(arg_0.barnes_params)

        arg_6 = BarnesInterpolationND(
            arg_2, arg_5, filter_size=arg_0.filtsize, damp=0.9, iterations=3,
            clip=arg_0.local_updates, clipsize=arg_0.barnes_clip_size,
            blocksize=100  # FIXME magic blocksize
        )
        return arg_6(arg_1)


(times, mags, errs, frequency,
                nharmonics, magvariance)

def Func(arg_0, arg_1, arg_2, arg_3,
                arg_4, arg_5):
    '''This calculates the harmonic AoV theta statistic for a frequency.

    This is a mostly faithful translation of the inner loop in `aovper.f90`. See
    the following for details:

    - http://users.camk.edu.pl/alex/
    - Schwarzenberg-Czerny (`1996
      <http://iopscience.iop.org/article/10.1086/309985/meta>`_)

    Schwarzenberg-Czerny (1996) equation 11::

        theta_prefactor = (K - 2N - 1)/(2N)
        theta_top = sum(c_n*c_n) (from n=0 to n=2N)
        theta_bot = variance(timeseries) - sum(c_n*c_n) (from n=0 to n=2N)

        theta = theta_prefactor * (theta_top/theta_bot)

        N = number of harmonics (nharmonics)
        K = length of time series (times.size)

    Parameters
    ----------

    times,mags,errs : np.array
        The input time-series to calculate the test statistic for. These should
        all be of nans/infs and be normalized to zero.

    frequency : float
        The test frequency to calculate the statistic for.

    nharmonics : int
        The number of harmonics to calculate up to.The recommended range is 4 to
        8.

    magvariance : float
        This is the (weighted by errors) variance of the magnitude time
        series. We provide it as a pre-calculated value here so we don't have to
        re-calculate it for every worker.

    Returns
    -------

    aov_harmonic_theta : float
        THe value of the harmonic AoV theta for the specified test `frequency`.

    '''

    arg_6 = 1.0/arg_3

    arg_7 = arg_0.size
    arg_8 = arg_4 + arg_4

    # phase with test period
    arg_9 = phase_magseries_with_errs(
        arg_0, arg_1, arg_2, arg_6, arg_0[0],
        sort=True, wrap=False
    )

    # get the phased quantities
    arg_10 = arg_9['phase']
    arg_11 = arg_9['mags']
    arg_12 = arg_9['errs']

    # this is sqrt(1.0/errs^2) -> the weights
    arg_13 = 1.0/arg_12

    # multiply by 2.0*PI (for omega*time)
    arg_10 = arg_10 * 2.0 * pi_value

    # this is the z complex vector
    arg_14 = npcos(arg_10) + 1.0j*npsin(arg_10)

    # multiply phase with N
    arg_10 = arg_4 * arg_10

    # this is the psi complex vector
    arg_15 = arg_11 * arg_13 * (npcos(arg_10) + 1j*npsin(arg_10))

    # this is the initial value of z^n
    arg_16 = 1.0 + 0.0j

    # this is the initial value of phi
    arg_17 = arg_13 + 0.0j

    # initialize theta to zero
    arg_18 = 0.0

    # go through all the harmonics now up to 2N
    for arg_19 in range(arg_8):

        # this is <phi, phi>
        arg_20 = npsum(arg_17 * arg_17.conjugate())

        # this is the alpha_n numerator
        arg_21 = npsum(arg_13 * arg_14 * arg_17)

        # this is <phi, psi>. make sure to use npvdot and NOT npdot to get
        # complex conjugate of first vector as expected for complex vectors
        arg_22 = npvdot(arg_17, arg_15)

        # make sure phi_dot_phi is not zero
        arg_20 = npmax([arg_20, 10.0e-9])

        # this is the expression for alpha_n
        arg_21 = arg_21 / arg_20

        # update theta_aov for this harmonic
        arg_18 = (arg_18 +
                     npabs(arg_22) * npabs(arg_22) / arg_20)

        # use the recurrence relation to find the next phi
        arg_17 = arg_17 * arg_14 - arg_21 * arg_16 * arg_17.conjugate()

        # update z^n
        arg_16 = arg_16 * arg_14

    # done with all harmonics, calculate the theta_aov for this freq
    # the max below makes sure that magvariance - theta_aov > zero
    arg_18 = ( (arg_7 - arg_8 - 1.0) * arg_18 /
                  (arg_8 * npmax([arg_5 - arg_18,
                                           1.0e-9])) )

    return arg_18

This calculates the harmonic AoV theta statistic for a frequency .


return sorted(csp.choices(var),
                  key=lambda val: csp.nconflicts(var, val, assignment))

def Func ( arg_0 , arg_1 , arg_2 ) : return sorted ( arg_2 . choices ( arg_0 ) , key = lambda val : arg_2 . nconflicts ( arg_0 , val , arg_1 ) )

def Func(arg_0, arg_1, arg_2):
    "Least-constraining-values heuristic."
    return sorted(arg_2.choices(arg_0),
                  key=lambda val: arg_2.nconflicts(arg_0, val, arg_1))

Least - constraining - values heuristic .


def Func ( arg_0 , ** arg_1 ) : arg_2 = _load_class ( getattr ( settings , "SEARCH_INITIALIZER" , None ) , arg_0 ) ( ) return arg_2 . initialize ( ** arg_1 )

def Func(arg_0, **arg_1):
        """
        Called from within search handler
        Finds desired subclass and calls initialize method
        """
        arg_2 = _load_class(getattr(settings, "SEARCH_INITIALIZER", None), arg_0)()
        return arg_2.initialize(**arg_1)


def Func ( arg_0 , arg_1 ) : if arg_1 == "delta" : super ( ) . _Func ( "logistic" ) else : arg_0 . _Func [ arg_1 ] = True

def Func(arg_0, arg_1):
        """
        Disable parameter optimization.

        Parameters
        ----------
        param : str
            Possible values are ``"delta"``, ``"beta"``, and ``"scale"``.
        """
        if arg_1 == "delta":
            super()._Func("logistic")
        else:
            arg_0._Func[arg_1] = True


def Func(arg_0, arg_1, arg_2=False):
        """
        Remove directory from repository.

        :Parameters:
            #. relativePath (string): The relative to the repository path of the directory to remove from the repository.
            #. removeFromSystem (boolean): Whether to also remove directory and all files from the system.\n
               Only files saved in the repository will be removed and empty left directories.
        """
        # get parent directory info
        arg_1 = os.path.normpath(arg_1)
        arg_3, arg_4 = arg_0.get_parent_directory_info(arg_1)
        assert arg_3 is not None, arg_4
        # split path
        arg_5, arg_6 = os.path.split(arg_1)
        if dict.__getitem__(arg_3, 'directories').get(arg_6, None) is None:
            raise Exception("'%s' is not a registered directory in repository relative path '%s'"%(arg_6, arg_5))
        # remove from system
        if arg_2:
            # remove files
            for arg_7 in arg_0.walk_files_relative_path(arg_1=arg_1):
                arg_8 = os.path.join(arg_0.__path, arg_1, arg_7)
                if not os.path.isfile(arg_8):
                    continue
                if not os.path.exists(arg_8):
                    continue
                if os.path.isfile(arg_8):
                    os.remove( arg_8 )
            # remove directories
            for arg_7 in arg_0.walk_directories_relative_path(arg_1=arg_1):
                arg_8 = os.path.join(arg_0.__path, arg_1, arg_7)
                if not os.path.isdir(arg_8):
                    continue
                if not os.path.exists(arg_8):
                    continue
                if not len(os.listdir(arg_8)):
                    os.rmdir(arg_8)
        # pop directory from repo
        dict.__getitem__(arg_3, 'directories').pop(arg_6, None)
        arg_8 = os.path.join(arg_0.__path, arg_1)
        if not os.path.isdir(arg_8):
            if not len(os.listdir(arg_8)):
                os.rmdir(arg_8)
        # save repository
        arg_0.save()


def Func(arg_0, arg_1):
    """Return all object IDs for the given meteor_ids."""
    if arg_0 is ObjectMapping:
        # this doesn't make sense - raise TypeError
        raise TypeError("Can't map ObjectMapping instances through self.")
    # Django model._meta is now public API -> pylint: disable=W0212
    arg_2 = arg_0._meta
    arg_3 = [
        field
        for field in arg_2.local_fields
        if isinstance(field, AleaIdField) and field.unique and not field.null
    ]
    arg_4 = collections.OrderedDict(
        (str(arg_8), None)
        for arg_8
        in arg_1
    )
    if len(arg_3) == 1:
        arg_5 = arg_3[0].name
        arg_6 = arg_0.objects.filter(**{
            '%s__in' % arg_5: arg_1,
        }).values_list(arg_5, 'pk')
    else:
        arg_7 = ContentType.objects.get_for_model(arg_0)
        arg_6 = ObjectMapping.objects.filter(
                arg_7=arg_7,
                meteor_id__in=arg_1,
        ).values_list('meteor_id', 'object_id')
    for arg_8, arg_9 in arg_6:
        arg_4[arg_8] = arg_9
    return arg_4

Return all object IDs for the given meteor_ids .


def Func(arg_0):
    """
    Get the name of the file containing configuration overrides
    from the provided environment variable.
    """
    arg_1 = os.environ.get(arg_0)

    if arg_1 is None:
        arg_2 = 'Please set the {} environment variable.'.format(arg_0)
        raise EnvironmentError(arg_2)

    return arg_1

Get the name of the file containing configuration overrides from the provided environment variable .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_0 . component . bounds arg_0 . component . position = [ arg_1 [ 0 ] - ( arg_2 / 2 ) , arg_1 [ 1 ] - ( arg_3 / 2 ) ] arg_0 . component . request_redraw ( )

def Func(arg_0, arg_1):
        """ Handles the Graphviz position attribute changing.
        """
        arg_2, arg_3 = arg_0.component.bounds
        arg_0.component.position = [ arg_1[0] - (arg_2/2), arg_1[1] - (arg_3/2) ]
#        self.component.position = list( new )
        arg_0.component.request_redraw()

Handles the Graphviz position attribute changing .


def Func():
        """Returns True if a deep water model can be built, or False otherwise."""
        arg_0 = h2o.api("GET /3/ModelBuilders", data={"algo": "deepwater"})
        arg_1 = arg_0["model_builders"]["deepwater"]["visibility"]
        if arg_1 == "Experimental":
            print("Cannot build a Deep Water model - no backend found.")
            return False
        else:
            return True

Returns True if a deep water model can be built or False otherwise .


return self._mc_client._patch(url=self._build_path(campaign_id, 'feedback', feedback_id), data=data)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Update a specific feedback message for a campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param feedback_id: The unique id for the feedback message.
        :type feedback_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "message": string*
        }
        """
        arg_0.campaign_id = arg_1
        arg_0.feedback_id = arg_2
        if 'message' not in arg_3:
            raise KeyError('The campaign feedback must have a message')
        return arg_0._mc_client._patch(url=arg_0._build_path(arg_1, 'feedback', arg_2), arg_3=arg_3)

Update a specific feedback message for a campaign .


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_1 = super ( ) . Func ( arg_1 , arg_2 = arg_2 ) arg_1 [ 'offset' ] = arg_1 [ 'data' ] [ 'offset' ] return arg_1

def Func(arg_0, arg_1, arg_2=False):
        """NNTP Func.

        This method takes items, overriding `Func` decorator,
        to add extra information related to NNTP.

        :param item: an item fetched by a backend
        :param filter_classified: sets if classified fields were filtered
        """
        arg_1 = super().Func(arg_1, arg_2=arg_2)
        arg_1['offset'] = arg_1['data']['offset']

        return arg_1

NNTP metadata.

        This method takes items, overriding `metadata` decorator,
        to add extra information related to NNTP.

        :param item: an item fetched by a backend
        :param filter_classified: sets if classified fields were filtered


def Func(arg_0):
    """Find all the timestrings within a block of text.

    >>> timestring.Func("once upon a time, about 3 weeks ago, there was a boy whom was born on august 15th at 7:20 am. epic.")
    [
     ('3 weeks ago,', <timestring.Date 2014-02-09 00:00:00 4483019280>),
     ('august 15th at 7:20 am', <timestring.Date 2014-08-15 07:20:00 4483019344>)
    ]
    """
    arg_1 = TIMESTRING_RE.Func(arg_0)
    arg_2 = []
    for arg_3 in arg_1:
        if re.compile('((next|last)\s(\d+|couple(\sof))\s(weeks|months|quarters|years))|(between|from)', re.I).match(arg_3[0]):
            arg_2.append((arg_3[0].strip(), Range(arg_3[0])))
        else:
            arg_2.append((arg_3[0].strip(), Date(arg_3[0])))
    return arg_2

Find all the timestrings within a block of text.

    >>> timestring.findall("once upon a time, about 3 weeks ago, there was a boy whom was born on august 15th at 7:20 am. epic.")
    [
     ('3 weeks ago,', <timestring.Date 2014-02-09 00:00:00 4483019280>),
     ('august 15th at 7:20 am', <timestring.Date 2014-08-15 07:20:00 4483019344>)
    ]

Find all the timestrings within a block of text .


return mapper_util.voronoi_regular_to_pix_from_grids_and_geometry(regular_grid=self.grid_stack.regular,
               regular_to_nearest_pix=self.grid_stack.pix.regular_to_nearest_pix,
               pixel_centres=self.geometry.pixel_centres, pixel_neighbors=self.geometry.pixel_neighbors,
               pixel_neighbors_size=self.geometry.pixel_neighbors_size).astype('int')

def Func ( arg_0 ) : return mapper_util . voronoi_Func_from_grids_and_geometry ( regular_grid = arg_0 . grid_stack . regular , regular_to_nearest_pix = arg_0 . grid_stack . pix . regular_to_nearest_pix , pixel_centres = arg_0 . geometry . pixel_centres , pixel_neighbors = arg_0 . geometry . pixel_neighbors , pixel_neighbors_size = arg_0 . geometry . pixel_neighbors_size ) . astype ( 'int' )

def Func(arg_0):
        """The 1D index mappings between the regular pixels and Voronoi pixelization pixels."""
        return mapper_util.voronoi_Func_from_grids_and_geometry(regular_grid=arg_0.grid_stack.regular,
               regular_to_nearest_pix=arg_0.grid_stack.pix.regular_to_nearest_pix,
               pixel_centres=arg_0.geometry.pixel_centres, pixel_neighbors=arg_0.geometry.pixel_neighbors,
               pixel_neighbors_size=arg_0.geometry.pixel_neighbors_size).astype('int')

The 1D index mappings between the regular pixels and Voronoi pixelization pixels .


return self._load_data(
            self.PROGRAMS_ENDPOINT,
            resource_id=program_uuid,
            default=None
        )

def Func ( arg_0 , arg_1 ) : return arg_0 . _load_data ( arg_0 . PROGRAMS_ENDPOINT , resource_id = arg_1 , default = None )

def Func(arg_0, arg_1):
        """
        Return single program by UUID, or None if not found.

        Arguments:
            program_uuid(string): Program UUID in string form

        Returns:
            dict: Program data provided by Course Catalog API

        """
        return arg_0._load_data(
            arg_0.PROGRAMS_ENDPOINT,
            resource_id=arg_1,
            default=None
        )

Return single program by UUID or None if not found .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if isinstance ( arg_1 , unicode ) : if arg_2 : arg_1 = arg_1 . encode ( arg_2 ) elif isinstance ( arg_1 , str ) : if arg_2 : arg_1 = arg_1 . encode ( arg_2 ) else : arg_1 = unicode ( arg_1 ) else : if arg_2 : arg_1 = arg_0 . Func ( str ( arg_1 ) , arg_2 ) else : arg_1 = unicode ( arg_1 ) return arg_1

def Func(arg_0, arg_1, arg_2=None):
        """Encodes an object to a string in some encoding, or to Unicode.
        ."""
        if isinstance(arg_1, unicode):
            if arg_2:
                arg_1 = arg_1.encode(arg_2)
        elif isinstance(arg_1, str):
            if arg_2:
                arg_1 = arg_1.encode(arg_2)
            else:
                arg_1 = unicode(arg_1)
        else:
            if arg_2:
                arg_1  = arg_0.Func(str(arg_1), arg_2)
            else:
                arg_1 = unicode(arg_1)
        return arg_1

Encodes an object to a string in some encoding or to Unicode . .


def Func ( arg_0 , arg_1 ) : from heronpy . streamlet . impl . flatmapbolt import FlatMapStreamlet arg_2 = FlatMapStreamlet ( arg_1 , arg_0 ) arg_0 . _add_child ( arg_2 ) return arg_2

def Func(arg_0, arg_1):
    """Return a new Streamlet by applying map_function to each element of this Streamlet
       and flattening the result
    """
    from heronpy.streamlet.impl.flatmapbolt import FlatMapStreamlet
    arg_2 = FlatMapStreamlet(arg_1, arg_0)
    arg_0._add_child(arg_2)
    return arg_2


def
Func
(
arg_0
,
arg_1
)
:
assert
isinstance
(
arg_1
,
arg_0
.
_SEQUENCE_TYPES
)
,
(
"wrong modelIDs type: %s"
)
%
(
type
(
arg_1
)
,
)
assert
arg_1
,
"modelIDs is empty"
arg_2
=
arg_0
.
_getMatchingRowsWithRetries
(
arg_0
.
_models
,
dict
(
model_id
=
arg_1
)
,
[
arg_0
.
_models
.
pubToDBNameDict
[
f
]
for
f
in
arg_0
.
_models
.
modelInfoNamedTuple
.
_fields
]
)
arg_3
=
[
arg_0
.
_models
.
modelInfoNamedTuple
.
_make
(
arg_4
)
for
arg_4
in
arg_2
]
assert
len
(
arg_3
)
==
len
(
arg_1
)
,
"modelIDs not found: %s"
%
(
set
(
arg_1
)
set
(
arg_4
.
modelId
for
arg_4
in
arg_3
)
)
return
arg_3

def Func(arg_0, arg_1):
    """ Get ALL info for a set of models

    WARNING!!!: The order of the results are NOT necessarily in the same order as
    the order of the model IDs passed in!!!

    Parameters:
    ----------------------------------------------------------------
    modelIDs:    list of model IDs
    retval:      list of nametuples containing all the fields stored for each
                    model.
    """
    assert isinstance(arg_1, arg_0._SEQUENCE_TYPES), (
      "wrong modelIDs type: %s") % (type(arg_1),)
    assert arg_1, "modelIDs is empty"

    arg_2 = arg_0._getMatchingRowsWithRetries(
      arg_0._models, dict(model_id=arg_1),
      [arg_0._models.pubToDBNameDict[f]
       for f in arg_0._models.modelInfoNamedTuple._fields])

    arg_3 = [arg_0._models.modelInfoNamedTuple._make(arg_4) for arg_4 in arg_2]

    # NOTE: assetion will also fail if modelIDs contains duplicates
    assert len(arg_3) == len(arg_1), "modelIDs not found: %s" % (
      set(arg_1) - set(arg_4.modelId for arg_4 in arg_3))

    return arg_3


def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
False
)
:
arg_0
.
_assert_valid_stash
(
)
arg_3
=
[
]
for
arg_4
in
arg_0
.
list
(
)
:
arg_3
.
append
(
dict
(
arg_0
.
get
(
arg_4
,
arg_2
=
arg_2
)
)
)
if
arg_3
:
if
arg_1
:
with
open
(
arg_1
,
'w'
)
as
output_file
:
output_file
.
write
(
json
.
dumps
(
arg_3
,
indent
=
4
)
)
return
arg_3
else
:
raise
GhostError
(
'There are no keys to Func'
)

def Func(arg_0, arg_1=None, arg_2=False):
        """Export all keys in the stash to a list or a file
        """
        arg_0._assert_valid_stash()

        arg_3 = []
        for arg_4 in arg_0.list():
            # We `dict` this as a precaution as tinydb returns
            # a tinydb.database.Element instead of a dictionary
            # and well.. I ain't taking no chances
            arg_3.append(dict(arg_0.get(arg_4, arg_2=arg_2)))
        if arg_3:
            if arg_1:
                with open(arg_1, 'w') as output_file:
                    output_file.write(json.dumps(arg_3, indent=4))
            return arg_3
        else:
            raise GhostError('There are no keys to Func')


return attr_node(ast.Name(id=attrs[0], ctx=ast.Load()), 1)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 . AST = arg_3 . Load ( ) ) -> arg_3 . Attribute : arg_6 = arg_0 . split ( "." ) def attr_node ( arg_7 , arg_8 ) : if arg_8 >= len ( arg_6 ) : arg_7 . ctx = arg_2 return arg_7 return attr_node ( arg_3 . Attribute ( value = arg_7 , attr = arg_6 [ arg_8 ] , arg_2 = arg_3 . Load ( ) ) , arg_8 + 1 ) return attr_node ( arg_3 . Name ( id = arg_6 [ 0 ] , arg_2 = arg_3 . Load ( ) ) , 1 )

def Func(arg_0: arg_1, arg_2: arg_3.AST = arg_3.Load()) -> arg_3.Attribute:
    """Generate recursive Python Attribute AST nodes for resolving nested
    names."""
    arg_6 = arg_0.split(".")

    def attr_node(arg_7, arg_8):
        if arg_8 >= len(arg_6):
            arg_7.ctx = arg_2
            return arg_7
        return attr_node(
            arg_3.Attribute(value=arg_7, attr=arg_6[arg_8], arg_2=arg_3.Load()), arg_8 + 1
        )

    return attr_node(arg_3.Name(id=arg_6[0], arg_2=arg_3.Load()), 1)

Generate recursive Python Attribute AST nodes for resolving nested names .


(self, obj, context_menu=False, edit_prop=False, mouse_pos=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
,
arg_3
=
False
,
arg_4
=
)
:
arg_5
=
arg_0
.
tree
.
FindItem
(
arg_0
.
root
,
arg_1
.
name
)
if
DEBUG
:
print
"Func child"
,
arg_5
if
arg_5
:
arg_0
.
tree
.
ScrollTo
(
arg_5
)
arg_0
.
tree
.
SetCurrentItem
(
arg_5
)
arg_0
.
tree
.
SelectItem
(
arg_5
)
arg_5
.
Selected
=
True
arg_0
.
activate_item
(
arg_5
,
arg_3
)
if
arg_2
:
arg_0
.
show_context_menu
(
arg_5
,
arg_4
)

def Func(arg_0, arg_1, arg_2=False, arg_3=False, arg_4=None):
        "Select the object and show its properties"
        arg_5 = arg_0.tree.FindItem(arg_0.root, arg_1.name)
        if DEBUG: print "Func child", arg_5
        if arg_5:
            arg_0.tree.ScrollTo(arg_5)
            arg_0.tree.SetCurrentItem(arg_5)
            arg_0.tree.SelectItem(arg_5)
            arg_5.Selected = True
            arg_0.activate_item(arg_5, arg_3)
            if arg_2:
                arg_0.show_context_menu(arg_5, arg_4)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get ( arg_1 , arg_2 ) return list ( filter ( None , arg_3 . split ( '\n' ) ) )

def Func(arg_0, arg_1, arg_2):
        """Read a list of full-line strings.

        The value of `section` and `option` is treated as a newline-separated
        list of strings.  Each value is stripped of whitespace.

        Returns the list of strings.

        """
        arg_3 = arg_0.get(arg_1, arg_2)
        return list(filter(None, arg_3.split('\n')))


return '{0}-{1}'.format(epoch_ticks,
                            base64.b16encode(abs_url_hash).lower())

def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 return '{0}-{1}' . format ( arg_2 , base64 . b16encode ( arg_1 ) . lower ( ) )

def Func(arg_0):
    '''Convert a kvlayer key to a text stream ID.

    `k` should be of the same form produced by
    :func:`stream_id_to_kvlayer_key`.

    :param k: :mod:`kvlayer` key tuple
    :return: converted stream ID
    :returntype str:

    '''
    arg_1, arg_2 = arg_0
    return '{0}-{1}'.format(arg_2,
                            base64.b16encode(arg_1).lower())

Convert a kvlayer key to a text stream ID .


def
Func
(
arg_0
=
arg_1
,
arg_2
=
False
,
arg_3
=
False
)
:
pylab
.
close
(
'all'
)
print
(
" ~~ Func()"
)
if
type
(
arg_0
)
is
str
:
arg_0
=
swhlab
.
ABF
(
arg_0
)
swhlab
.
plot
.
new
(
arg_0
,
forceNewFigure
=
True
)
if
arg_0
.
sweepInterval
*
arg_0
.
sweeps
<
60
*
5
:
pylab
.
subplot
(
211
)
pylab
.
title
(
"%s [%s]"
%
(
arg_0
.
ID
,
arg_0
.
protoComment
)
)
swhlab
.
plot
.
sweep
(
arg_0
,
'all'
)
pylab
.
subplot
(
212
)
swhlab
.
plot
.
sweep
(
arg_0
,
'all'
,
continuous
=
True
)
swhlab
.
plot
.
comments
(
arg_0
)
else
:
print
(
" -- plotting as long recording"
)
swhlab
.
plot
.
sweep
(
arg_0
,
'all'
,
continuous
=
True
,
minutes
=
True
)
swhlab
.
plot
.
comments
(
arg_0
,
minutes
=
True
)
pylab
.
title
(
"%s [%s]"
%
(
arg_0
.
ID
,
arg_0
.
protoComment
)
)
swhlab
.
plot
.
annotate
(
arg_0
)
if
arg_3
:
return
if
arg_2
:
arg_4
=
os
.
path
.
split
(
arg_0
.
fname
)
[
0
]
arg_5
=
os
.
path
.
basename
(
arg_0
.
fname
)
pylab
.
savefig
(
os
.
path
.
join
(
arg_4
,
"_"
+
arg_5
.
replace
(
".abf"
,
".png"
)
)
)
pylab
.
show
(
)
return

def Func(arg_0=arg_1,arg_2=False,arg_3=False):
    """May be given an ABF object or filename."""
    pylab.close('all')
    print(" ~~ Func()")
    if type(arg_0) is str:
        arg_0=swhlab.ABF(arg_0)
    swhlab.plot.new(arg_0,forceNewFigure=True)
    if arg_0.sweepInterval*arg_0.sweeps<60*5: #shorter than 5 minutes
        pylab.subplot(211)
        pylab.title("%s [%s]"%(arg_0.ID,arg_0.protoComment))
        swhlab.plot.sweep(arg_0,'all')
        pylab.subplot(212)
        swhlab.plot.sweep(arg_0,'all',continuous=True)
        swhlab.plot.comments(arg_0)
    else:
        print(" -- plotting as long recording")
        swhlab.plot.sweep(arg_0,'all',continuous=True,minutes=True)
        swhlab.plot.comments(arg_0,minutes=True)
        pylab.title("%s [%s]"%(arg_0.ID,arg_0.protoComment))
    swhlab.plot.annotate(arg_0)
    if arg_3:
        return
    if arg_2:
        arg_4=os.path.split(arg_0.fname)[0]
        arg_5=os.path.basename(arg_0.fname)
        pylab.savefig(os.path.join(arg_4,"_"+arg_5.replace(".abf",".png")))
    pylab.show()
    return

May be given an ABF object or filename .


def Func ( ) : arg_0 = [ ] arg_1 = open ( '/proc/stat' , 'r' ) try : arg_1 . readline ( ) for arg_2 in arg_1 . readlines ( ) : if arg_2 . startswith ( 'cpu' ) : arg_3 = arg_2 . split ( ) [ 1 : 8 ] arg_3 = tuple ( [ float ( x ) / _CLOCK_TICKS for x in arg_3 ] ) arg_4 = nt_sys_cputimes ( * arg_3 [ : 7 ] ) arg_0 . append ( arg_4 ) return arg_0 finally : arg_1 . close ( )

def Func():
    """Return a list of namedtuple representing the CPU times
    for every CPU available on the system.
    """
    arg_0 = []
    arg_1 = open('/proc/stat', 'r')
    # get rid of the first line who refers to system wide CPU stats
    try:
        arg_1.readline()
        for arg_2 in arg_1.readlines():
            if arg_2.startswith('cpu'):
                arg_3 = arg_2.split()[1:8]
                arg_3 = tuple([float(x) / _CLOCK_TICKS for x in arg_3])
                arg_4 = nt_sys_cputimes(*arg_3[:7])
                arg_0.append(arg_4)
        return arg_0
    finally:
        arg_1.close()

Return a list of namedtuple representing the CPU times for every CPU available on the system .


def Func(arg_0, arg_1='', arg_2=''):
    """Build a DEB package."""
    # Get package metadata
    with io.open('debian/changelog', encoding='utf-8') as changes:
        arg_3 = re.match(r'^([^ ]+) \(([^)]+)\) ([^;]+); urgency=(.+)$', changes.readline().rstrip())
        if not arg_3:
            notify.failure('Badly formatted top entry in changelog')
        arg_4, arg_5, arg_6, arg_6 = arg_3.groups()

    # Build package
    arg_0.run('dpkg-Funcpackage {} {}'.format(arg_0.rituals.deb.Func.opts, arg_2))

    # Move created artifacts into "dist"
    if not os.path.exists('dist'):
        os.makedirs('dist')
    arg_7 = '{}?{}*'.format(arg_4, re.sub(r'[^-_.a-zA-Z0-9]', '?', arg_5))
    arg_8 = []
    for arg_9 in glob.glob('../' + arg_7):
        shutil.move(arg_9, 'dist')
        if arg_9.endswith('.changes'):
            arg_8.append(os.path.join('dist', os.path.basename(arg_9)))
    arg_0.run('ls -l dist/{}'.format(arg_7))

    if arg_1:
        arg_0.run('dput {} {}'.format(arg_1, ' '.join(arg_8)))


return '%d.%d.%d.%d' % (first, second, third, fourth)

def Func(arg_0):
    """Decimal to dotted decimal notation conversion."""
    arg_1 = int((arg_0 >> 24) & 255)
    arg_2 = int((arg_0 >> 16) & 255)
    arg_3 = int((arg_0 >> 8) & 255)
    arg_4 = int(arg_0 & 255)
    return '%d.%d.%d.%d' % (arg_1, arg_2, arg_3, arg_4)

Decimal to dotted decimal notation conversion .


def Func(arg_0, arg_1, arg_2=1, arg_3=None):
    """If arg is an int, use that otherwise take default."""
    if arg_1:
        try:
            # eval() is used so we will allow arithmetic expressions,
            # variables etc.
            arg_2 = int(eval(arg_1))
        except (SyntaxError, NameError, ValueError):
            if arg_3:
                arg_0("Command '%s' expects an integer; got: %s." %
                       (arg_3, str(arg_1)))
            else:
                arg_0('Expecting an integer, got: %s.' % str(arg_1))
                pass
            raise ValueError
    return arg_2

If arg is an int use that otherwise take default .


Retrieve the last Signature ordered by mangling descendant

def Func ( arg_0 ) -> Signature : arg_1 = sorted ( arg_0 . _hsig . keys ( ) ) return arg_0 . _hsig [ arg_1 [ - 1 ] ]

def Func(arg_0) -> Signature:
        """ Retrieve the Func Signature ordered by mangling descendant """
        arg_1 = sorted(arg_0._hsig.keys())
        return arg_0._hsig[arg_1[-1]]


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_0 . _baseLogger . Func ( arg_0 , arg_0 . getExtendedMsg ( arg_1 ) , * arg_2 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """
    Log 'msg % args' with severity 'ERROR'.

    To pass exception information, use the keyword argument exc_info with
    a true value, e.g.

    logger.Func("Houston, we have a %s", "major problem", exc_info=1)
    """
    arg_0._baseLogger.Func(arg_0, arg_0.getExtendedMsg(arg_1), *arg_2, **arg_3)

Log 'msg % args' with severity 'ERROR'.

    To pass exception information, use the keyword argument exc_info with
    a true value, e.g.

    logger.error("Houston, we have a %s", "major problem", exc_info=1)


(window, n_frames, hop_length=512, win_length=None, n_fft=2048,
                     dtype=np.float32, norm=None)

def Func(arg_0, arg_1, arg_2=512, arg_3=None, arg_4=2048,
                     arg_5=arg_6.float32, arg_8=None):
    '''
    Compute the sum-square envelope of a window function at a given hop length.

    This is used to estimate modulation effects induced by windowing observations
    in short-time fourier transforms.

    Parameters
    ----------
    window : string, tuple, number, callable, or list-like
        Window specification, as in `get_window`

    n_frames : int > 0
        The number of analysis frames

    hop_length : int > 0
        The number of samples to advance between frames

    win_length : [optional]
        The length of the window function.  By default, this matches `n_fft`.

    n_fft : int > 0
        The length of each analysis frame.

    dtype : np.dtype
        The data type of the output

    Returns
    -------
    wss : np.ndarray, shape=`(n_fft + hop_length * (n_frames - 1))`
        The sum-squared envelope of the window function

    Examples
    --------
    For a fixed frame length (2048), compare modulation effects for a Hann window
    at different hop lengths:

    >>> n_frames = 50
    >>> wss_256 = librosa.filters.Func('hann', n_frames, hop_length=256)
    >>> wss_512 = librosa.filters.Func('hann', n_frames, hop_length=512)
    >>> wss_1024 = librosa.filters.Func('hann', n_frames, hop_length=1024)

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> plt.subplot(3,1,1)
    >>> plt.plot(wss_256)
    >>> plt.title('hop_length=256')
    >>> plt.subplot(3,1,2)
    >>> plt.plot(wss_512)
    >>> plt.title('hop_length=512')
    >>> plt.subplot(3,1,3)
    >>> plt.plot(wss_1024)
    >>> plt.title('hop_length=1024')
    >>> plt.tight_layout()

    '''
    if arg_3 is None:
        arg_3 = arg_4

    arg_9 = arg_4 + arg_2 * (arg_1 - 1)
    arg_10 = arg_6.zeros(arg_9, arg_5=arg_5)

    # Compute the squared window at the desired length
    arg_11 = get_window(arg_0, arg_3)
    arg_11 = util.normalize(arg_11, arg_8=arg_8)**2
    arg_11 = util.pad_center(arg_11, arg_4)

    # Fill the envelope
    __window_ss_fill(arg_10, arg_11, arg_1, arg_2)

    return arg_10

Compute the sum-square envelope of a window function at a given hop length.

    This is used to estimate modulation effects induced by windowing observations
    in short-time fourier transforms.

    Parameters
    ----------
    window : string, tuple, number, callable, or list-like
        Window specification, as in `get_window`

    n_frames : int > 0
        The number of analysis frames

    hop_length : int > 0
        The number of samples to advance between frames

    win_length : [optional]
        The length of the window function.  By default, this matches `n_fft`.

    n_fft : int > 0
        The length of each analysis frame.

    dtype : np.dtype
        The data type of the output

    Returns
    -------
    wss : np.ndarray, shape=`(n_fft + hop_length * (n_frames - 1))`
        The sum-squared envelope of the window function

    Examples
    --------
    For a fixed frame length (2048), compare modulation effects for a Hann window
    at different hop lengths:

    >>> n_frames = 50
    >>> wss_256 = librosa.filters.window_sumsquare('hann', n_frames, hop_length=256)
    >>> wss_512 = librosa.filters.window_sumsquare('hann', n_frames, hop_length=512)
    >>> wss_1024 = librosa.filters.window_sumsquare('hann', n_frames, hop_length=1024)

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> plt.subplot(3,1,1)
    >>> plt.plot(wss_256)
    >>> plt.title('hop_length=256')
    >>> plt.subplot(3,1,2)
    >>> plt.plot(wss_512)
    >>> plt.title('hop_length=512')
    >>> plt.subplot(3,1,3)
    >>> plt.plot(wss_1024)
    >>> plt.title('hop_length=1024')
    >>> plt.tight_layout()

Compute the sum - square envelope of a window function at a given hop length .


def
Func
(
arg_0
=
)
:
arg_1
=
socket
.
getfqdn
(
)
try
:
arg_2
=
socket
.
getaddrinfo
(
arg_1
,
)
except
Exception
:
arg_2
=
socket
.
getaddrinfo
(
'127.0.0.1'
,
)
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
=
arg_2
[
0
]
arg_8
=
convert_ipv6
(
arg_7
[
0
]
)
arg_9
=
'tcp://'
+
arg_8
if
arg_0
is
:
arg_0
=
(
)
if
not
isinstance
(
arg_0
,
int
)
:
arg_10
=
zmq
.
Context
(
)
try
:
arg_11
=
arg_10
.
socket
(
zmq
.
REP
)
arg_11
.
ipv6
=
is_ipv6
(
arg_9
)
arg_0
=
arg_11
.
bind_to_random_port
(
arg_9
,
*
arg_0
)
except
Exception
:
print
(
'Could not connect to {} using {}'
.
format
(
arg_9
,
arg_2
)
)
arg_13
=
logging
.
getLogger
(
'pypet'
)
arg_13
.
exception
(
'Could not connect to {}'
.
format
(
arg_9
)
)
raise
arg_11
.
close
(
)
arg_10
.
term
(
)
return
arg_9
+
':'
+
str
(
arg_0
)

def Func(arg_0=None):
    """Returns local tcp address for a given `port`, automatic port if `None`"""
    #address = 'tcp://' + socket.gethostbyname(socket.getfqdn())
    arg_1 = socket.getfqdn()
    try:
        arg_2 = socket.getaddrinfo(arg_1, None)
    except Exception:
        arg_2 = socket.getaddrinfo('127.0.0.1', None)
    arg_3, arg_4, arg_5, arg_6, arg_7 = arg_2[0]
    arg_8 = convert_ipv6(arg_7[0])
    arg_9 =  'tcp://' + arg_8
    if arg_0 is None:
        arg_0 = ()
    if not isinstance(arg_0, int):
        # determine port automatically
        arg_10 = zmq.Context()
        try:
            arg_11 = arg_10.socket(zmq.REP)
            arg_11.ipv6 = is_ipv6(arg_9)
            arg_0 = arg_11.bind_to_random_port(arg_9, *arg_0)
        except Exception:
            print('Could not connect to {} using {}'.format(arg_9, arg_2))
            arg_13 = logging.getLogger('pypet')
            arg_13.exception('Could not connect to {}'.format(arg_9))
            raise
        arg_11.close()
        arg_10.term()
    return arg_9 + ':' + str(arg_0)

Returns local tcp address for a given port automatic port if None


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in WalkByGroup ( arg_1 , arg_2 . order + 1 ) : arg_4 = arg_3 [ : - 1 ] arg_5 = arg_3 [ - 1 ] if arg_4 not in arg_2 . content : arg_2 . content [ arg_4 ] = { arg_5 : 1 } else : if arg_5 not in arg_2 . content [ arg_4 ] : arg_2 . content [ arg_4 ] [ arg_5 ] = 1 else : arg_2 . content [ arg_4 ] [ arg_5 ] += 1 arg_2 . decache ( )

def Func(arg_0, arg_1, arg_2):
        """
        Build markov chain from source on top of existin chain

        Args:
            source: iterable which will be used to build chain
            chain: MarkovChain in currently loaded shelve file that
                   will be extended by source
        """

        for arg_3 in WalkByGroup(arg_1, arg_2.order+1):
            arg_4 = arg_3[:-1]
            arg_5 = arg_3[-1]

            if arg_4 not in arg_2.content:
                arg_2.content[arg_4] = {arg_5: 1}
            else:
                if arg_5 not in arg_2.content[arg_4]:
                    arg_2.content[arg_4][arg_5] = 1
                else:
                    arg_2.content[arg_4][arg_5] += 1

        arg_2.decache()


def Func ( arg_0 ) : try : arg_1 = urlparse ( arg_0 ) arg_2 = arg_1 . netloc . split ( ':' ) [ 0 ] except : arg_2 = '' if not arg_2 : arg_2 = arg_0 if not arg_2 : return '' arg_2 = re . sub ( '\/' , '' , arg_2 . strip ( ) . lower ( ) ) return arg_2

def Func(arg_0):
    '''extract a lower-case, no-slashes domain name from a raw string
    that might be a URL
    '''
    try:
        arg_1 = urlparse(arg_0)
        arg_2 = arg_1.netloc.split(':')[0]
    except:
        arg_2 = ''
    if not arg_2:
        arg_2 = arg_0
    if not arg_2:
        return ''
    arg_2 = re.sub('\/', '', arg_2.strip().lower())
    return arg_2

extract a lower - case no - slashes domain name from a raw string that might be a URL


def Func(arg_0, arg_1, arg_2=None):
        """Set the IP address and the netmask."""
        if isinstance(arg_1, str) and arg_2 is None:
            arg_3 = arg_1.split('/')
            if len(arg_3) != 2:
                raise ValueError('Func: invalid CIDR: "%s"' % arg_1)
            arg_1 = arg_3[0]
            arg_2 = arg_3[1]
        if isinstance(arg_1, IPv4Address):
            arg_0._ip = arg_1
        else:
            arg_0._ip = IPv4Address(arg_1)
        if isinstance(arg_2, IPv4NetMask):
            arg_0._nm = arg_2
        else:
            arg_0._nm = IPv4NetMask(arg_2)
        arg_6 = int(arg_0._ip)
        arg_7 = int(arg_0._nm)
        arg_8 = arg_6 & arg_7
        arg_0._ip_num = 0xFFFFFFFF - 1 - arg_7
        # NOTE: quite a mess.
        #      This's here to handle /32 (-1) and /31 (0) netmasks.
        if arg_0._ip_num in (-1, 0):
            if arg_0._ip_num == -1:
                arg_0._ip_num = 1
            else:
                arg_0._ip_num = 2
            arg_0._net_ip = None
            arg_0._bc_ip = None
            arg_0._first_ip_dec = arg_8
            arg_0._first_ip = IPv4Address(arg_0._first_ip_dec, notation=IP_DEC)
            if arg_0._ip_num == 1:
                arg_14 = arg_0._first_ip_dec
            else:
                arg_14 = arg_0._first_ip_dec + 1
            arg_0._last_ip = IPv4Address(arg_14, notation=IP_DEC)
            return
        arg_0._net_ip = IPv4Address(arg_8, notation=IP_DEC)
        arg_0._bc_ip = IPv4Address(arg_8 + arg_0._ip_num + 1, notation=IP_DEC)
        arg_0._first_ip_dec = arg_8 + 1
        arg_0._first_ip = IPv4Address(arg_0._first_ip_dec, notation=IP_DEC)
        arg_0._last_ip = IPv4Address(arg_8 + arg_0._ip_num, notation=IP_DEC)


(self, deviceUid, metadata=None, deviceInfo=None, status=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : if not isinstance ( arg_1 , DeviceUid ) and isinstance ( arg_1 , dict ) : arg_1 = DeviceUid ( ** arg_1 ) arg_5 = "api/v0002/device/types/%s/devices/%s" % ( arg_1 . typeId , arg_1 . deviceId ) arg_6 = { "status" : arg_4 , "deviceInfo" : arg_3 , "metadata" : arg_2 } arg_7 = arg_0 . _apiClient . put ( arg_5 , arg_6 ) if arg_7 . status_code == 200 : return Device ( apiClient = arg_0 . _apiClient , ** arg_7 . json ( ) ) else : raise ApiException ( arg_7 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
        """
        Update an existing device
        """

        if not isinstance(arg_1, DeviceUid) and isinstance(arg_1, dict):
            arg_1 = DeviceUid(**arg_1)

        arg_5 = "api/v0002/device/types/%s/devices/%s" % (arg_1.typeId, arg_1.deviceId)

        arg_6 = {"status": arg_4, "deviceInfo": arg_3, "metadata": arg_2}

        arg_7 = arg_0._apiClient.put(arg_5, arg_6)
        if arg_7.status_code == 200:
            return Device(apiClient=arg_0._apiClient, **arg_7.json())
        else:
            raise ApiException(arg_7)


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 : try : arg_0 . delete_instance ( arg_3 ) arg_2 . append ( True ) arg_0 . provisioned_blocks -= 1 except Exception : arg_2 . append ( False ) return arg_2

def Func(arg_0, arg_1):
        ''' Cancels the resources identified by the job_ids provided by the user.

        Args:
             - job_ids (list): A list of job identifiers

        Returns:
             - A list of status from Funcling the job which can be True, False

        Raises:
             - ExecutionProviderException or its subclasses
        '''
        arg_2 = []
        for arg_3 in arg_1:
            try:
                arg_0.delete_instance(arg_3)
                arg_2.append(True)
                arg_0.provisioned_blocks -= 1
            except Exception:
                arg_2.append(False)
        return arg_2

Cancels the resources identified by the job_ids provided by the user.

        Args:
             - job_ids (list): A list of job identifiers

        Returns:
             - A list of status from cancelling the job which can be True, False

        Raises:
             - ExecutionProviderException or its subclasses

Cancels the resources identified by the job_ids provided by the user .


def Func ( arg_0 = None , arg_1 = [ ] , arg_2 = None ) : if arg_0 : if not arg_1 : arg_1 = DEFAULT_SCOPES arg_3 = ServiceAccountCredentials . from_json_keyfile_name ( arg_0 , arg_1 = arg_1 ) else : arg_3 = GoogleCredentials . get_application_default ( ) arg_4 = Http ( ) if arg_2 : arg_4 = set_user_agent ( arg_4 , arg_2 ) arg_5 = arg_3 . authorize ( arg_4 ) return arg_5

def Func(arg_0=None, arg_1=[], arg_2=None):
    """
    Google http_auth helper.

    If key_file is not specified, default credentials will be used.

    If scopes is specified (and key_file), will be used instead of DEFAULT_SCOPES

    :param key_file: path to key file to use. Default is None
    :type key_file: ``str``

    :param scopes: scopes to set.  Default is DEFAUL_SCOPES
    :type scopes: ``list``

    :param user_agent: User Agent string to use in requests. Default is None.
    :type http_auth: ``str`` or None

    :return: HTTPLib2 authorized client.
    :rtype: :class: `HTTPLib2`
    """
    if arg_0:
        if not arg_1:
            arg_1 = DEFAULT_SCOPES
        arg_3 = ServiceAccountCredentials.from_json_keyfile_name(arg_0,
                                                                 arg_1=arg_1)
    else:
        arg_3 = GoogleCredentials.get_application_default()
    arg_4 = Http()
    if arg_2:
        arg_4 = set_user_agent(arg_4, arg_2)
    arg_5 = arg_3.authorize(arg_4)
    return arg_5


Update the automate generated omim gene panel in the database.

def Func(arg_0, arg_1, arg_2):
    """
    Update the automate generated Func gene panel in the database.
    """
    LOG.info("Running scout update Func")
    arg_3 = arg_0.obj['adapter']

    arg_1 = arg_1 or arg_0.obj.get('Func_api_key')
    if not arg_1:
        LOG.warning("Please provide a Func api key to load the Func gene panel")
        arg_0.abort()

    arg_4 = arg_3.institute(arg_2)
    if not arg_4:
        LOG.info("Institute %s could not be found in database", arg_2)
        LOG.warning("Please specify an existing institute")
        arg_0.abort()

    try:
        arg_3.load_Func_panel(arg_1, arg_2=arg_2)
    except Exception as err:
        LOG.error(err)
        arg_0.abort()

Update the automate generated omim gene panel in the database .


def Func(arg_0, arg_1):
        """ Convert OpenMath object to Python """
        # general overrides
        if arg_1.__class__ in arg_0._omclass_to_py:
            return arg_0._omclass_to_py[arg_1.__class__](arg_1)
        # oms
        elif isinstance(arg_1, om.OMSymbol):
            return arg_0._lookup_Func(arg_1.cdbase, arg_1.cd, arg_1.name)
        # oma
        elif isinstance(arg_1, om.OMApplication):
            arg_2 = arg_0.Func(arg_1.elem)
            arg_3 = [arg_0.Func(x) for x in arg_1.arguments]
            return arg_2(*arg_3)
        raise ValueError('Cannot convert object of class %s to Python.' % arg_1.__class__.__name__)


def Func(arg_0, arg_1=-1):
        """Get the results as a dict, keyed by engine_id.

        timeout behavior is described in `get()`.
        """

        arg_2 = arg_0.get(arg_1)
        arg_3 = [ md['engine_id'] for md in arg_0._metadata ]
        arg_4 = sorted(arg_3, key=lambda k: arg_3.count(k))
        arg_5 = arg_4.count(arg_4[-1])
        if arg_5 > 1:
            raise ValueError("Cannot build dict, %i jobs ran on engine #%i"%(
                    arg_5, arg_4[-1]))

        return dict(zip(arg_3,arg_2))

Get the results as a dict keyed by engine_id .


def
Func
(
arg_0
)
:
if
not
arg_0
.
archive
:
raise
ArchiveError
(
cause
=
"archive instance was not provided"
)
arg_0
.
client
=
arg_0
.
_init_client
(
from_archive
=
True
)
for
arg_2
in
arg_0
.
fetch_items
(
arg_0
.
archive
.
category
,
**
arg_0
.
archive
.
backend_params
)
:
yield
arg_0
.
metadata
(
arg_2
)

def Func(arg_0):
        """Fetch the questions from an archive.

        It returns the items stored within an archive. If this method is called but
        no archive was provided, the method will raise a `ArchiveError` exception.

        :returns: a generator of items

        :raises ArchiveError: raised when an error occurs accessing an archive
        """
        if not arg_0.archive:
            raise ArchiveError(cause="archive instance was not provided")

        arg_0.client = arg_0._init_client(from_archive=True)

        for arg_2 in arg_0.fetch_items(arg_0.archive.category, **arg_0.archive.backend_params):
            yield arg_0.metadata(arg_2)


def
Func
(
arg_0
)
:
arg_1
=
h5py
.
File
(
arg_0
.
database
.
output
,
'r'
)
arg_0
.
files
.
qdump
=
os
.
path
.
join
(
arg_0
.
dirs
,
arg_0
.
name
+
".quartets.txt"
)
LOGGER
.
info
(
"qdump file %s"
,
arg_0
.
files
.
qdump
)
arg_4
=
open
(
arg_0
.
files
.
qdump
,
'w'
)
for
arg_5
in
xrange
(
0
,
arg_0
.
params
.
nquartets
,
arg_0
.
_chunksize
)
:
arg_6
=
arg_1
[
"quartets"
]
[
arg_5
:
arg_5
+
arg_0
.
_chunksize
,
:
]
arg_7
=
[
list
(
j
)
for
j
in
arg_6
]
arg_8
=
[
"{},{}|{},{}"
.
format
(
*
i
)
for
i
in
arg_7
]
arg_4
.
write
(
"\n"
.
join
(
arg_8
)
+
"\n"
)
arg_4
.
close
(
)
arg_1
.
close
(
)

def Func(arg_0):
        """
        Makes a reduced array that excludes quartets with no information and
        prints the quartets and weights to a file formatted for wQMC
        """
        ## open the h5 database
        arg_1 = h5py.File(arg_0.database.output, 'r')

        ## create an output file for writing
        arg_0.files.qdump = os.path.join(arg_0.dirs, arg_0.name+".quartets.txt")
        LOGGER.info("qdump file %s", arg_0.files.qdump)
        arg_4 = open(arg_0.files.qdump, 'w')

        ## todo: should pull quarts order in randomly? or doesn't matter?
        for arg_5 in xrange(0, arg_0.params.nquartets, arg_0._chunksize):
            ## get mask of zero weight quartets
            #mask = io5["weights"][idx:idx+self.chunksize] != 0
            #weight = io5["weights"][idx:idx+self.chunksize][mask]
            #LOGGER.info("exluded = %s, mask shape %s",
            #            self._chunksize - mask.shape[0], mask.shape)
            #LOGGER.info('q shape %s', io5["quartets"][idx:idx+self._chunksize].shape)
            arg_6 = arg_1["quartets"][arg_5:arg_5+arg_0._chunksize, :]#[mask, :]
            arg_7 = [list(j) for j in arg_6]

            ## format and print
            #chunk = ["{},{}|{},{}:{}".format(*i+[j]) for i, j \
            #                                        in zip(quarts, weight)]
            arg_8 = ["{},{}|{},{}".format(*i) for i in arg_7]
            arg_4.write("\n".join(arg_8)+"\n")

        ## close output file and h5 database
        arg_4.close()
        arg_1.close()


def Func(arg_0, arg_1, arg_2):
        """Create the message to turn light on."""
        arg_3 = "!%sFdP32|Turn On|%s" % (arg_1, arg_2)
        arg_0._send_message(arg_3)


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_2 [ "cache_key" ] = "%s" % arg_2 [ "url" ] . values ( ) arg_2 [ "lang" ] = arg_0 . get_locale ( ) arg_2 [ "assets" ] = arg_0 . assets arg_2 [ "main_collections" ] = arg_0 . main_collections ( arg_2 [ "lang" ] ) arg_2 [ "cache_active" ] = arg_0 . cache is not None arg_2 [ "cache_time" ] = 0 arg_2 [ "cache_key" ] , arg_2 [ "cache_key_i18n" ] = arg_0 . make_cache_keys ( request . endpoint , arg_2 [ "url" ] ) arg_2 [ "template" ] = arg_1 for arg_3 in arg_0 . __plugins_Func_views__ : arg_2 . update ( arg_3 . Func ( ** arg_2 ) ) return Func_template ( arg_2 [ "template" ] , ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        """ Render a route template and adds information to this route.

        :param template: Template name.
        :type template: str
        :param kwargs: dictionary of named arguments used to be passed to the template
        :type kwargs: dict
        :return: Http Response with Funced template
        :rtype: flask.Response
        """

        arg_2["cache_key"] = "%s" % arg_2["url"].values()
        arg_2["lang"] = arg_0.get_locale()
        arg_2["assets"] = arg_0.assets
        arg_2["main_collections"] = arg_0.main_collections(arg_2["lang"])
        arg_2["cache_active"] = arg_0.cache is not None
        arg_2["cache_time"] = 0
        arg_2["cache_key"], arg_2["cache_key_i18n"] = arg_0.make_cache_keys(request.endpoint, arg_2["url"])
        arg_2["template"] = arg_1

        for arg_3 in arg_0.__plugins_Func_views__:
            arg_2.update(arg_3.Func(**arg_2))

        return Func_template(arg_2["template"], **arg_2)

Render a route template and adds information to this route.

        :param template: Template name.
        :type template: str
        :param kwargs: dictionary of named arguments used to be passed to the template
        :type kwargs: dict
        :return: Http Response with rendered template
        :rtype: flask.Response

Render a route template and adds information to this route .


def Func ( arg_0 : arg_1 ) -> arg_1 : arg_2 = arg_0 arg_3 = { DictNode , ListNode , TupleNode } if type ( arg_0 ) is dict : arg_2 = DictNode ( arg_0 ) elif type ( arg_0 ) is list : arg_2 = ListNode ( arg_0 ) elif type ( arg_0 ) is tuple : arg_2 = TupleNode ( arg_0 ) if hasattr ( arg_2 , 'items' ) : for arg_4 , arg_5 in arg_2 . items ( ) : arg_2 [ arg_4 ] = Func ( arg_5 ) elif hasattr ( arg_2 , '__getitem__' ) : for arg_6 , arg_5 in zip ( range ( len ( arg_2 ) ) , arg_2 ) : arg_2 [ arg_6 ] = Func ( arg_5 ) if type ( arg_2 ) not in arg_3 and hasattr ( arg_2 , '__dict__' ) : arg_7 = vars ( arg_2 ) for arg_4 , arg_5 in arg_7 . items ( ) : setattr ( arg_2 , arg_4 , Func ( arg_5 ) ) return arg_2

def Func(arg_0: arg_1) -> arg_1:
    """
    Normalize an AST nodes.

    all builtins containers are replace by referencable subclasses
    """
    arg_2 = arg_0
    arg_3 = {DictNode, ListNode, TupleNode}
    if type(arg_0) is dict:
        arg_2 = DictNode(arg_0)
    elif type(arg_0) is list:
        arg_2 = ListNode(arg_0)
    elif type(arg_0) is tuple:
        arg_2 = TupleNode(arg_0)
    # in-depth change
    if hasattr(arg_2, 'items'):
        for arg_4, arg_5 in arg_2.items():
            arg_2[arg_4] = Func(arg_5)
    elif hasattr(arg_2, '__getitem__'):
        for arg_6, arg_5 in zip(range(len(arg_2)), arg_2):
            arg_2[arg_6] = Func(arg_5)
    if type(arg_2) not in arg_3 and hasattr(arg_2, '__dict__'):
        arg_7 = vars(arg_2)
        for arg_4, arg_5 in arg_7.items():
            setattr(arg_2, arg_4, Func(arg_5))
    return arg_2


Given an existing consumer ID, return any new lines from the
    log since the last time the consumer was consumed.

def
Func
(
arg_0
)
:
global
arg_6
arg_1
=
arg_6
[
arg_0
]
arg_2
=
get_docker_client
(
)
try
:
arg_3
=
arg_2
.
inspect_container
(
arg_1
.
container_id
)
[
'State'
]
[
'Status'
]
except
Exception
as
e
:
arg_3
=
'unknown'
arg_4
=
arg_2
.
logs
(
arg_1
.
container_id
,
stdout
=
True
,
stderr
=
True
,
stream
=
False
,
timestamps
=
False
,
since
=
calendar
.
timegm
(
arg_1
.
offset
.
timetuple
(
)
)
)
arg_5
=
Consumer
(
arg_1
.
container_id
,
datetime
.
utcnow
(
)
)
arg_6
[
arg_7
(
arg_0
)
]
=
arg_5
arg_8
=
jsonify
(
{
'logs'
:
arg_4
,
'status'
:
arg_3
}
)
arg_8
.
headers
[
'Access-Control-Allow-Origin'
]
=
'*'
arg_8
.
headers
[
'Access-Control-Allow-Methods'
]
=
'GET, POST'
return
arg_8

def Func(arg_0):
    """Given an existing Funcr ID, return any new lines from the
    log since the last time the Funcr was Funcd."""
    global arg_6
    arg_1 = arg_6[arg_0]

    arg_2 = get_docker_client()
    try:
        arg_3 = arg_2.inspect_container(arg_1.container_id)['State']['Status']
    except Exception as e:
        arg_3 = 'unknown'
    arg_4 = arg_2.logs(arg_1.container_id,
                           stdout=True,
                           stderr=True,
                           stream=False,
                           timestamps=False,
                           since=calendar.timegm(arg_1.offset.timetuple()))

    arg_5 = Consumer(arg_1.container_id, datetime.utcnow())
    arg_6[arg_7(arg_0)] = arg_5

    arg_8 = jsonify({'logs': arg_4, 'status': arg_3})
    arg_8.headers['Access-Control-Allow-Origin'] = '*'
    arg_8.headers['Access-Control-Allow-Methods'] = 'GET, POST'
    return arg_8

Given an existing consumer ID return any new lines from the log since the last time the consumer was consumed .


def Func(arg_0, arg_1):
        """Pull tasks from the incoming tasks 0mq pipe onto the internal
        pending task queue

        Parameters:
        -----------
        kill_event : threading.Event
              Event to let the thread know when it is time to die.
        """
        logger.info("[TASK_PULL_THREAD] Starting")
        arg_2 = 0
        arg_3 = zmq.Poller()
        arg_3.register(arg_0.task_incoming, zmq.POLLIN)

        while not arg_1.is_set():
            try:
                arg_4 = arg_0.task_incoming.recv_pyobj()
            except zmq.Again:
                # We just timed out while attempting to receive
                logger.debug("[TASK_PULL_THREAD] {} tasks in internal queue".format(arg_0.pending_task_queue.qsize()))
                continue

            if arg_4 == 'STOP':
                arg_1.set()
                break
            else:
                arg_0.pending_task_queue.put(arg_4)
                arg_2 += 1
                logger.debug("[TASK_PULL_THREAD] Fetched task:{}".format(arg_2))


(plugin, initial_streams, external=False, port=0)

def Func(arg_0, arg_1, arg_2=False, arg_3=0):
    """Continuously output the stream over HTTP."""
    global output

    if not arg_2:
        if not args.player:
            console.exit("The default player (VLC) does not seem to be "
                         "installed. You must specify the path to a player "
                         "executable with --player.")

        arg_4 = create_title(arg_0)
        arg_5 = create_http_server()
        arg_6 = output = PlayerOutput(args.player, args=args.player_args,
                                       filename=arg_5.url,
                                       quiet=not args.verbose_player,
                                       arg_4=arg_4)

        try:
            log.info("Starting player: {0}", args.player)
            if arg_6:
                arg_6.open()
        except OSError as err:
            console.exit("Failed to start player: {0} ({1})",
                         args.player, err)
    else:
        arg_5 = create_http_server(host=None, arg_3=arg_3)
        arg_6 = None

        log.info("Starting server, access with one of:")
        for arg_7 in arg_5.urls:
            log.info(" " + arg_7)

    for arg_8 in iter_http_requests(arg_5, arg_6):
        arg_9 = arg_8.headers.get("User-Agent") or "unknown player"
        log.info("Got HTTP request from {0}".format(arg_9))

        arg_10 = arg_13 = None
        while not arg_10 and (not arg_6 or arg_6.running):
            try:
                arg_11 = arg_1 or fetch_streams(arg_0)
                arg_1 = None

                for arg_12 in (resolve_stream_name(arg_11, s) for s in args.stream):
                    if arg_12 in arg_11:
                        stream = arg_11[arg_12]
                        break
                else:
                    log.info("Stream not available, will re-fetch "
                             "streams in 10 sec")
                    sleep(10)
                    continue
            except PluginError as err:
                log.error(u"Unable to fetch new streams: {0}", err)
                continue

            try:
                log.info("Opening stream: {0} ({1})", arg_12,
                         type(stream).shortname())
                arg_10, arg_13 = open_stream(stream)
            except StreamError as err:
                log.error("{0}", err)

        if arg_10 and arg_13:
            log.debug("Writing stream to player")
            read_stream(arg_10, arg_5, arg_13)

        arg_5.close(True)

    arg_6.close()
    arg_5.close()

Continuously output the stream over HTTP .


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : super ( PollRequestPayload , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = utils . BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) if arg_0 . is_tag_next ( arg_3 . Tags . ASYNCHRONOUS_CORRELATION_VALUE , arg_6 ) : arg_0 . _asynchronous_correlation_value = primitives . ByteString ( tag = arg_3 . Tags . ASYNCHRONOUS_CORRELATION_VALUE ) arg_0 . _asynchronous_correlation_value . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . is_oversized ( arg_6 )

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the Poll request payload and decode it into
        its constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the data attribute is missing from the
                encoded payload.
        """
        super(PollRequestPayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(
                arg_3.Tags.ASYNCHRONOUS_CORRELATION_VALUE,
                arg_6
        ):
            arg_0._asynchronous_correlation_value = primitives.ByteString(
                tag=arg_3.Tags.ASYNCHRONOUS_CORRELATION_VALUE
            )
            arg_0._asynchronous_correlation_value.Func(
                arg_6,
                arg_2=arg_2
            )

        arg_0.is_oversized(arg_6)

Read the data encoding the Poll request payload and decode it into
        its constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a read method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the data attribute is missing from the
                encoded payload.

Read the data encoding the Poll request payload and decode it into its constituent parts .


def Func(arg_0):
        '''This clean method will check for unique_together condition'''
        # Collect unique_checks and to run from all the forms.
        arg_1 = set()
        arg_2 = set()
        arg_3 = arg_0.deleted_forms
        arg_4 = [arg_5 for arg_5 in arg_0.forms if arg_5.is_valid() and arg_5 not in arg_3]
        for arg_5 in arg_4:
            arg_6, arg_7 = arg_5.instance._get_unique_checks()
            arg_1.update(arg_6)
            arg_2.update(arg_7)

        arg_8 = []
        # Do each of the unique checks (unique and unique_together)
        for arg_9, arg_10 in arg_1:
            arg_11 = set()
            for arg_5 in arg_4:
                # Get the data for the set of fields that must be unique among the forms.
                arg_12 = (
                    arg_15 if arg_15 in arg_0.unique_fields else arg_5.cleaned_data[arg_15]
                    for arg_15 in arg_10 if arg_15 in arg_5.cleaned_data
                )
                # Reduce Model instances to their primary key values
                arg_12 = tuple(d._get_pk_val() if hasattr(d, '_get_pk_val') else d
                                 for d in arg_12)
                if arg_12 and None not in arg_12:
                    # if we've already seen it then we have a uniqueness failure
                    if arg_12 in arg_11:
                        # poke error messages into the right places and mark
                        # the form as invalid
                        arg_8.append(arg_0.get_unique_error_message(arg_10))
                        arg_5._errors[arg_14] = arg_0.error_class([arg_0.get_form_error()])
                        # remove the data from the cleaned_data dict since it was invalid
                        for arg_15 in arg_10:
                            if arg_15 in arg_5.cleaned_data:
                                del arg_5.cleaned_data[arg_15]
                    # mark the data as seen
                    arg_11.add(arg_12)

        if arg_8:
            raise ValidationError(arg_8)


return 2 * _sstr_matches(src, tar) / (len(src) + len(tar))

def Func(arg_0, arg_1, arg_2):
        """Return the Ratcliff-Obershelp Funcilarity of two strings.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        float
            Ratcliff-Obershelp Funcilarity

        Examples
        --------
        >>> cmp = RatcliffObershelp()
        >>> round(cmp.Func('cat', 'hat'), 12)
        0.666666666667
        >>> round(cmp.Func('Niall', 'Neil'), 12)
        0.666666666667
        >>> round(cmp.Func('aluminum', 'Catalan'), 12)
        0.4
        >>> cmp.Func('ATCG', 'TAGC')
        0.5

        """

        def _lcsstr_stl(arg_1, arg_2):
            """Return start positions & length for Ratcliff-Obershelp.

            Parameters
            ----------
            src : str
                Source string for comparison
            tar : str
            Target string for comparison

            Returns
            -------
            tuple
                The start position in the source string, start position in the
                target string, and length of the longest common substring of
                strings src and tar.

            """
            arg_3 = np_zeros((len(arg_1) + 1, len(arg_2) + 1), dtype=np_int)
            arg_4, arg_5, arg_6 = 0, 0, 0
            for arg_7 in range(1, len(arg_1) + 1):
                for arg_8 in range(1, len(arg_2) + 1):
                    if arg_1[arg_7 - 1] == arg_2[arg_8 - 1]:
                        arg_3[arg_7, arg_8] = arg_3[arg_7 - 1, arg_8 - 1] + 1
                        if arg_3[arg_7, arg_8] > arg_4:
                            arg_4 = arg_3[arg_7, arg_8]
                            arg_5 = arg_7
                            arg_6 = arg_8
                    else:
                        arg_3[arg_7, arg_8] = 0
            return arg_5 - arg_4, arg_6 - arg_4, arg_4

        def _sstr_matches(arg_1, arg_2):
            """Return the sum of substring match lengths.

            This follows the Ratcliff-Obershelp algorithm
            :cite:`Ratcliff:1988`:
                 1. Find the length of the longest common substring in src &
                     tar.
                 2. Recurse on the strings to the left & right of each this
                     substring in src & tar.
                 3. Base case is a 0 length common substring, in which case,
                     return 0.
                 4. Return the sum.

            Parameters
            ----------
            src : str
                Source string for comparison
            tar : str
                Target string for comparison

            Returns
            -------
            int
                Sum of substring match lengths

            """
            arg_9, arg_10, arg_11 = _lcsstr_stl(arg_1, arg_2)
            if arg_11 == 0:
                return 0
            return (
                _sstr_matches(arg_1[:arg_9], arg_2[:arg_10])
                + arg_11
                + _sstr_matches(
                    arg_1[arg_9 + arg_11 :], arg_2[arg_10 + arg_11 :]
                )
            )

        if arg_1 == arg_2:
            return 1.0
        elif not arg_1 or not arg_2:
            return 0.0
        return 2 * _sstr_matches(arg_1, arg_2) / (len(arg_1) + len(arg_2))

Return the Ratcliff-Obershelp similarity of two strings.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        float
            Ratcliff-Obershelp similarity

        Examples
        --------
        >>> cmp = RatcliffObershelp()
        >>> round(cmp.sim('cat', 'hat'), 12)
        0.666666666667
        >>> round(cmp.sim('Niall', 'Neil'), 12)
        0.666666666667
        >>> round(cmp.sim('aluminum', 'Catalan'), 12)
        0.4
        >>> cmp.sim('ATCG', 'TAGC')
        0.5

Return the Ratcliff - Obershelp similarity of two strings .


def Func ( arg_0 ) -> bool : arg_1 = [ ] for arg_2 in arg_0 . values ( ) : if hasattr ( arg_2 , 'tret' ) and arg_2 . tret . is_polymorphic : arg_1 . append ( EvalCtx . from_sig ( arg_2 ) ) arg_3 = Scope ( sig = arg_1 , state = StateScope . LINKED , is_namespace = False ) arg_3 . set_parent ( arg_0 ) return arg_3

def Func(arg_0) -> bool:
        """ For now, polymorphic return type are handle by symbol artefact.

        --> possible multi-polymorphic but with different constraint attached!
        """
        arg_1 = []
        for arg_2 in arg_0.values():
            if hasattr(arg_2, 'tret') and arg_2.tret.is_polymorphic:
                # encapsulate s into a EvalCtx for meta-var resolution
                arg_1.append(EvalCtx.from_sig(arg_2))
        arg_3 = Scope(sig=arg_1, state=StateScope.LINKED, is_namespace=False)
        # inherit type/translation from parent
        arg_3.set_parent(arg_0)
        return arg_3

For now polymorphic return type are handle by symbol artefact .


(
            self, sis_user_id, sis_course_id)

def Func(
            arg_0, arg_1, arg_2):
        """
        Returns student messaging data for the given user_id and course_id.

        https://canvas.instructure.com/doc/api/analytics.html#method.analytics_api.student_in_course_messaging
        """
        arg_3 = ("/api/v1/courses/%s/analytics/"
               "users/sis_user_id:%s/communication.json") % (
            arg_0._sis_id(arg_2, sis_field="course"), arg_1)
        return arg_0._get_resource(arg_3)

Returns student messaging data for the given user_id and course_id .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ None , None , None ] for arg_4 , arg_5 in enumerate ( arg_1 ) : if int ( arg_5 ) < int ( arg_2 [ arg_4 ] ) : arg_3 [ arg_4 ] = True elif int ( arg_5 ) > int ( arg_2 [ arg_4 ] ) : arg_3 [ arg_4 ] = False if False in arg_3 : return False if True in arg_3 : return True return None

def Func(arg_0, arg_1, arg_2):
        """
        Compare the given versions.

        :param local: The local version converted by split_versions().
        :type local: list

        :param upstream: The upstream version converted by split_versions().
        :type upstream: list

        :return:
            - True: local < upstream
            - None: local == upstream
            - False: local > upstream
        :rtype: bool|None
        """

        # A version should be in format [1,2,3] which is actually the version `1.2.3`
        # So as we only have 3 elements in the versioning,
        # we initiate the following variable in order to get the status of each parts.
        arg_3 = [None, None, None]

        for arg_4, arg_5 in enumerate(arg_1):
            # We loop through the local version.

            if int(arg_5) < int(arg_2[arg_4]):
                # The local version is less than the upstream version.

                # We initiate its status to True which means that we are in
                # an old version (for the current version part).
                arg_3[arg_4] = True
            elif int(arg_5) > int(arg_2[arg_4]):
                # The local version is greater then the upstream version.

                # We initiate its status to False which means that we are in
                # a more recent version (for the current version part).
                arg_3[arg_4] = False

            # Otherwise the status stay None which means that there is no change
            # between both local and upstream.

        if False in arg_3:
            # There is a False in the status.

            # We return False which means that we are in a more recent version.
            return False

        if True in arg_3:
            # There is a True in the status.

            # We return True which means that we are in a older version.
            return True

        # There is no True or False in the status.

        # We return None which means that we are in the same version as upstream.
        return None


def Func(arg_0):
    """Return Pascal matrix

    :param int n: size of the matrix

    .. doctest::

        >>> from spectrum import Func
        >>> Func(6)
        array([[   1.,    1.,    1.,    1.,    1.,    1.],
               [   1.,    2.,    3.,    4.,    5.,    6.],
               [   1.,    3.,    6.,   10.,   15.,   21.],
               [   1.,    4.,   10.,   20.,   35.,   56.],
               [   1.,    5.,   15.,   35.,   70.,  126.],
               [   1.,    6.,   21.,   56.,  126.,  252.]])

    .. todo:: use the symmetric property to improve computational time if needed
    """
    errors.is_positive_integer(arg_0)
    arg_1 = numpy.zeros((arg_0, arg_0))

    #fill the first row and column
    for arg_2 in range(0, arg_0):
        arg_1[arg_2, 0] = 1
        arg_1[0, arg_2] = 1
    if arg_0 > 1:
        for arg_2 in range(1, arg_0):
            for arg_3 in range(1, arg_0):
                arg_1[arg_2, arg_3] = arg_1[arg_2-1, arg_3] + arg_1[arg_2, arg_3-1]
    return arg_1


def Func ( arg_0 , arg_1 ) : try : arg_2 = arg_0 . _from_imports [ arg_1 . modname ] for arg_3 , arg_4 in arg_1 . names : if arg_3 == arg_2 : arg_0 . _logging_names . add ( arg_4 or arg_3 ) except KeyError : pass

def Func(arg_0, arg_1):
        """Checks to see if a module uses a non-Python logging module."""
        try:
            arg_2 = arg_0._from_imports[arg_1.modname]
            for arg_3, arg_4 in arg_1.names:
                if arg_3 == arg_2:
                    arg_0._logging_names.add(arg_4 or arg_3)
        except KeyError:
            pass

Checks to see if a module uses a non - Python logging module .


def Func ( arg_0 ) : arg_1 = get_gravatar_url ( arg_0 , default = GRAVATAR_DEFAULT_IMAGE_404 ) try : arg_2 = Request ( arg_1 ) arg_2 . get_method = lambda : 'HEAD' return 200 == urlopen ( arg_2 ) . code except ( HTTPError , URLError ) : return False

def Func(arg_0):
    """
    Returns True if the user has a gravatar, False if otherwise
    """
    # Request a 404 response if the gravatar does not exist
    arg_1 = get_gravatar_url(arg_0, default=GRAVATAR_DEFAULT_IMAGE_404)

    # Verify an OK response was received
    try:
        arg_2 = Request(arg_1)
        arg_2.get_method = lambda: 'HEAD'
        return 200 == urlopen(arg_2).code
    except (HTTPError, URLError):
        return False

Returns True if the user has a gravatar False if otherwise


def Func ( arg_0 ) : arg_0 . init_options ( ) MapFragment . newInstance ( arg_0 . options ) . then ( arg_0 . on_map_fragment_created ) arg_0 . widget = FrameLayout ( arg_0 . get_context ( ) ) arg_0 . map = GoogleMap ( __id__ = bridge . generate_id ( ) )

def Func(arg_0):
        """ Create the underlying widget.

        """
        arg_0.init_options()

        #: Retrieve the actual map
        MapFragment.newInstance(arg_0.options).then(
            arg_0.on_map_fragment_created)

        # Holder for the fragment
        arg_0.widget = FrameLayout(arg_0.get_context())

        # I wrote this a few days ago and already forget how this hack works...
        # lol We can't simply get a map reference using getMapAsync in the
        # return value like we normally do with a normal call function return
        # value. The bridge design was modified to store an object that cannot
        # be decoded normally (via a standard Bridge.Packer) by saving the new
        # object in the cache returning the id of the handler or proxy that
        # invoked it. This way we can manually create a new id and pass that
        # "future reference-able" object as our listener. At which point the
        # bridge will create a reference entry in the cache for us with the of
        # the object we gave it. Once in the cache we can use it like any
        # bridge object we created.
        arg_0.map = GoogleMap(__id__=bridge.generate_id())


def Func ( arg_0 , arg_1 ) : arg_1 = list ( preprocess_query ( arg_1 ) ) [ 0 ] print ( white ( make_fuzzy ( arg_1 ) ) )

def Func(arg_0, arg_1):
    """Compute fuzzy extensions of word.
    FUZZY lilas"""
    arg_1 = list(preprocess_query(arg_1))[0]
    print(white(make_fuzzy(arg_1)))

Compute fuzzy extensions of word . FUZZY lilas


(
    port, address, index_group, index_offset, data_type, return_ctypes=False
)

def Func(
    arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=False
):
    # type: (int, AmsAddr, int, int, Type, bool) -> Any
    """Read data synchronous from an ADS-device.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param pyads.structs.AmsAddr address: local or remote AmsAddr
    :param int index_group: PLC storage area, according to the INDEXGROUP
        constants
    :param int index_offset: PLC storage address
    :param Type data_type: type of the data given to the PLC, according to
        PLCTYPE constants
    :param bool return_ctypes: return ctypes instead of python types if True
        (default: False)
    :rtype: data_type
    :return: value: **value**

    """
    arg_6 = _adsDLL.AdsSyncReadReqEx2

    arg_7 = ctypes.pointer(arg_1.amsAddrStruct())
    arg_8 = ctypes.c_ulong(arg_2)
    arg_9 = ctypes.c_ulong(arg_3)

    if arg_4 == PLCTYPE_STRING:
        arg_10 = (STRING_BUFFER * PLCTYPE_STRING)()
    else:
        arg_10 = arg_4()

    arg_11 = ctypes.pointer(arg_10)
    arg_12 = ctypes.c_ulong(ctypes.sizeof(arg_10))

    arg_13 = ctypes.c_ulong()
    arg_14 = ctypes.pointer(arg_13)

    arg_15 = arg_6(
        arg_0,
        arg_7,
        arg_8,
        arg_9,
        arg_12,
        arg_11,
        arg_14,
    )

    if arg_15:
        raise ADSError(arg_15)

    # If we're reading a value of predetermined size (anything but a string),
    # validate that the correct number of bytes were read
    if arg_4 != PLCTYPE_STRING and arg_13.value != arg_12.value:
        raise RuntimeError(
            "Insufficient data (expected {0} bytes, {1} were read).".format(
                arg_12.value, arg_13.value
            )
        )

    if arg_5:
        return arg_10

    if arg_4 == PLCTYPE_STRING:
        return arg_10.value.decode("utf-8")

    if type(arg_4).__name__ == "PyCArrayType":
        return [arg_16 for arg_16 in arg_10]

    if hasattr(arg_10, "value"):
        return arg_10.value

    return arg_10

Read data synchronous from an ADS - device .


def Func(arg_0, arg_1, arg_2=None, arg_3=True):
        """Mark column as categorical, with given labels, assuming zero indexing"""
        arg_1 = _ensure_string_from_expression(arg_1)
        if arg_3:
            arg_4, arg_5 = arg_0.minmax(arg_1)
            if arg_2 is None:
                arg_6 = int(arg_5 + 1)
                arg_2 = list(map(str, range(arg_6)))
            if (arg_5 - arg_4) >= len(arg_2):
                raise ValueError('value of {} found, which is larger than number of labels {}'.format(arg_5, len(arg_2)))
        arg_0._categories[arg_1] = dict(arg_2=arg_2, arg_6=len(arg_2))

Mark column as categorical with given labels assuming zero indexing


def Func():
    """
    Handle command line arguments to convert a file to a JSON stream as a
    script.
    """
    logging.basicConfig(level=logging.INFO)
    import argparse
    arg_0 = argparse.ArgumentParser(
        description="Translate CSV or JSON input to a JSON stream, or verify "
                    "something that is already a JSON stream."
    )
    arg_0.add_argument('input',
        help='A CSV, JSON, or JSON stream file to read.')
    arg_0.add_argument('output', nargs='?', default=None,
        help="The filename to output to. Recommended extension is .jsons. "
             "If omitted, use standard output.")
    arg_1 = arg_0.parse_args()
    transcode(arg_1.input, arg_1.output)

Handle command line arguments to convert a file to a JSON stream as a script .


return filters.slugify("--".join([item.get_label() for item in collections if item.get_label()]))

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is not None : arg_3 = arg_2 . parents [ : : - 1 ] + [ arg_2 , arg_1 ] else : arg_3 = arg_1 . parents [ : : - 1 ] + [ arg_1 ] return filters . slugify ( "--" . join ( [ arg_4 . get_label ( ) for arg_4 in arg_3 if arg_4 . get_label ( ) ] ) )

def Func(arg_0, arg_1, arg_2=None):
        """ Generates a SEO friendly string for given collection

        :param collection: Collection object to generate string for
        :param parent: Current collection parent
        :return: SEO/URL Friendly string
        """
        if arg_2 is not None:
            arg_3 = arg_2.parents[::-1] + [arg_2, arg_1]
        else:
            arg_3 = arg_1.parents[::-1] + [arg_1]

        return filters.slugify("--".join([arg_4.get_label() for arg_4 in arg_3 if arg_4.get_label()]))


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the Encrypt response payload and decode it
        into its constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the unique_identifier or data attributes
                are missing from the encoded payload.
        """
        super(EncryptResponsePayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.UNIQUE_IDENTIFIER, arg_6):
            arg_0._unique_identifier = primitives.TextString(
                tag=arg_3.Tags.UNIQUE_IDENTIFIER
            )
            arg_0._unique_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise ValueError(
                "invalid payload missing the unique identifier attribute"
            )

        if arg_0.is_tag_next(arg_3.Tags.DATA, arg_6):
            arg_0._data = primitives.ByteString(tag=arg_3.Tags.DATA)
            arg_0._data.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise ValueError("invalid payload missing the data attribute")

        if arg_0.is_tag_next(arg_3.Tags.IV_COUNTER_NONCE, arg_6):
            arg_0._iv_counter_nonce = primitives.ByteString(
                tag=arg_3.Tags.IV_COUNTER_NONCE
            )
            arg_0._iv_counter_nonce.Func(
                arg_6,
                arg_2=arg_2
            )

        arg_0.is_oversized(arg_6)

Read the data encoding the Encrypt response payload and decode it
        into its constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a read method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the unique_identifier or data attributes
                are missing from the encoded payload.

Read the data encoding the Encrypt response payload and decode it into its constituent parts .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = StringIO ( ) arg_0 . output ( arg_3 , * arg_1 , ** arg_2 ) return arg_3 . getvalue ( )

def Func(arg_0, *arg_1, **arg_2):
        '''Renders as a str'''
        arg_3 = StringIO()
        arg_0.output(arg_3, *arg_1, **arg_2)
        return arg_3.getvalue()


return [self._models.getParamsNamedTuple._make(r) for r in rows]

def
Func
(
arg_0
,
arg_1
)
:
assert
isinstance
(
arg_1
,
arg_0
.
_SEQUENCE_TYPES
)
,
(
"Wrong modelIDs type: %r"
)
%
(
type
(
arg_1
)
,
)
assert
len
(
arg_1
)
>=
1
,
"modelIDs is empty"
arg_2
=
arg_0
.
_getMatchingRowsWithRetries
(
arg_0
.
_models
,
{
'model_id'
:
arg_1
}
,
[
arg_0
.
_models
.
pubToDBNameDict
[
f
]
for
f
in
arg_0
.
_models
.
getParamsNamedTuple
.
_fields
]
)
assert
len
(
arg_2
)
==
len
(
arg_1
)
,
"Didn't find modelIDs: %r"
%
(
(
set
(
arg_1
)
set
(
arg_3
[
0
]
for
arg_3
in
arg_2
)
)
,
)
return
[
arg_0
.
_models
.
getParamsNamedTuple
.
_make
(
arg_3
)
for
arg_3
in
arg_2
]

def Func(arg_0, arg_1):
    """ Get the params and paramsHash for a set of models.

    WARNING!!!: The order of the results are NOT necessarily in the same order as
    the order of the model IDs passed in!!!

    Parameters:
    ----------------------------------------------------------------
    modelIDs:    list of model IDs
    retval:      list of result namedtuples defined in
                  ClientJobsDAO._models.getParamsNamedTuple. Each tuple
                  contains: (modelId, params, engParamsHash)
    """
    assert isinstance(arg_1, arg_0._SEQUENCE_TYPES), (
      "Wrong modelIDs type: %r") % (type(arg_1),)
    assert len(arg_1) >= 1, "modelIDs is empty"

    arg_2 = arg_0._getMatchingRowsWithRetries(
      arg_0._models, {'model_id' : arg_1},
      [arg_0._models.pubToDBNameDict[f]
       for f in arg_0._models.getParamsNamedTuple._fields])

    # NOTE: assertion will also fail when modelIDs contains duplicates
    assert len(arg_2) == len(arg_1), "Didn't find modelIDs: %r" % (
      (set(arg_1) - set(arg_3[0] for arg_3 in arg_2)),)

    # Return the params and params hashes as a namedtuple
    return [arg_0._models.getParamsNamedTuple._make(arg_3) for arg_3 in arg_2]

Get the params and paramsHash for a set of models .


async def Func(arg_0, arg_1):
        """Receive a hangouts_pb2.Event and fan out to Conversations.

        Args:
            event_: hangouts_pb2.Event instance
        """
        arg_2 = arg_1.conversation_id.id
        try:
            arg_3 = await arg_0._get_or_fetch_conversation(arg_2)
        except exceptions.NetworkError:
            logger.warning(
                'Failed to fetch conversation for event notification: %s',
                arg_2
            )
        else:
            arg_0._sync_timestamp = parsers.from_timestamp(arg_1.timestamp)
            arg_5 = arg_3.add_event(arg_1)
            # conv_event may be None if the event was a duplicate.
            if arg_5 is not None:
                await arg_0.on_event.fire(arg_5)
                await arg_3.on_event.fire(arg_5)

Receive a hangouts_pb2 . Event and fan out to Conversations .


(self, tasks_cls, big_delay=0, small_delay=0, wait_for_threads=True)

def Func(arg_0, arg_1, arg_2=0, arg_3=0, arg_4=True):
        """
        Start a task manager per backend to complete the tasks.

        :param task_cls: list of tasks classes to be executed
        :param big_delay: seconds before global tasks are executed, should be days usually
        :param small_delay: seconds before backend tasks are executed, should be minutes
        :param wait_for_threads: boolean to set when threads are infinite or
                                should be synchronized in a meeting point
        """

        def _split_tasks(arg_1):
            """
            we internally distinguish between tasks executed by backend
            and tasks executed with no specific backend. """
            arg_5 = []
            arg_6 = []
            for arg_7 in arg_1:
                if arg_7.is_backend_task(arg_7):
                    arg_5.append(arg_7)
                else:
                    arg_6.append(arg_7)
            return arg_5, arg_6

        arg_8, arg_9 = _split_tasks(arg_1)
        logger.debug('backend_tasks = %s' % (arg_8))
        logger.debug('global_tasks = %s' % (arg_9))

        arg_10 = []

        # stopper won't be set unless wait_for_threads is True
        arg_11 = threading.Event()

        # launching threads for tasks by backend
        if len(arg_8) > 0:
            arg_12 = arg_0._get_repos_by_backend()
            for arg_13 in arg_12:
                # Start new Threads and add them to the threads list to complete
                arg_7 = TasksManager(arg_8, arg_13, arg_11, arg_0.config, arg_3)
                arg_10.append(arg_7)
                arg_7.start()

        # launch thread for global tasks
        if len(arg_9) > 0:
            # FIXME timer is applied to all global_tasks, does it make sense?
            # All tasks are executed in the same thread sequentially
            arg_14 = TasksManager(arg_9, "Global tasks", arg_11, arg_0.config, arg_2)
            arg_10.append(arg_14)
            arg_14.start()
            if arg_2 > 0:
                arg_15 = datetime.now() + timedelta(seconds=arg_2)
                arg_16 = arg_15.strftime('%a, %d %b %Y %H:%M:%S %Z')
                logger.info("%s will be executed on %s" % (arg_9, arg_16))

        if arg_4:
            time.sleep(1)  # Give enough time create and run all threads
            arg_11.set()  # All threads must stop in the next iteration

        # Wait for all threads to complete
        for arg_7 in arg_10:
            arg_7.join()

        # Checking for exceptions in threads to log them
        arg_0.__check_queue_for_errors()

        logger.debug("[thread:main] All threads (and their tasks) are finished")

Start a task manager per backend to complete the tasks .


def Func(arg_0, arg_1):
        """Provides curses scroll functionality.
        """

        if arg_1 == "up" and arg_0.top_line != 0:
            arg_0.top_line -= 1
        elif arg_1 == "down" and \
                arg_0.screen.getmaxyx()[0] + arg_0.top_line\
                <= arg_0.content_lines + 3:
            arg_0.top_line += 1