(self, x, y, z=None, grid=None, shape=256, limits=None, what="count(*)", figsize=None,
                    f="identity", figure_key=None, fig=None, axes=None, xlabel=None, ylabel=None, title=None,
                    show=True, selection=[None, True], colormap="afmhot", grid_limits=None, normalize="normalize",
                    grid_before=None,
                    what_kwargs={}, type="default",
                    scales=None, tool_select=False, bq_cleanup=True,
                    backend="bqplot",
                    **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=256, arg_6=None, arg_7="count(*)", arg_8=None,
                    arg_9="identity", arg_10=None, arg_11=None, arg_12=None, arg_13=None, arg_14=None, arg_15=None,
                    arg_16=True, arg_17=[None, True], arg_18="afmhot", arg_19=None, arg_20="normalize",
                    arg_21=None,
                    arg_22={}, arg_23="default",
                    arg_24=None, arg_25=False, arg_26=True,
                    arg_27="bqplot",
                    **arg_28):
        """Viz 1d, 2d or 3d in a Jupyter notebook

        .. note::
            This API is not fully settled and may change in the future

        Example:

        >>> df.Func(df.x, df.y, backend='bqplot')
        >>> df.Func(df.pickup_longitude, df.pickup_latitude, backend='ipyleaflet')

        :param backend: Widget backend to use: 'bqplot', 'ipyleaflet', 'ipyvolume', 'matplotlib'

        """
        import vaex.jupyter.plot
        arg_27 = vaex.jupyter.plot.create_backend(arg_27)
        arg_29 = vaex.jupyter.plot.get_type(arg_23)
        arg_1 = _ensure_strings_from_expressions(arg_1)
        arg_2 = _ensure_strings_from_expressions(arg_2)
        arg_3 = _ensure_strings_from_expressions(arg_3)
        for arg_30 in 'vx vy vz'.split():
            if arg_30 in arg_28:
                arg_28[arg_30] = _ensure_strings_from_expressions(arg_28[arg_30])
        arg_31 = arg_29(arg_27=arg_27, dataset=arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, arg_6=arg_6, arg_7=arg_7,
                     arg_9=arg_9, arg_10=arg_10, arg_11=arg_11,
                     arg_17=arg_17, arg_21=arg_21,
                     arg_19=arg_19, arg_20=arg_20, arg_18=arg_18, arg_22=arg_22, **arg_28)
        if arg_16:
            arg_31.show()
        return arg_31

Viz 1d, 2d or 3d in a Jupyter notebook

        .. note::
            This API is not fully settled and may change in the future

        Example:

        >>> df.plot_widget(df.x, df.y, backend='bqplot')
        >>> df.plot_widget(df.pickup_longitude, df.pickup_latitude, backend='ipyleaflet')

        :param backend: Widget backend to use: 'bqplot', 'ipyleaflet', 'ipyvolume', 'matplotlib'


(graph: BELGraph, edges=None, color: Optional[str]=None)

def Func ( arg_0 : arg_1 , arg_2 = None , arg_3 : arg_4 [ arg_5 ] = None ) -> None : arg_3 = arg_3 or EDGE_HIGHLIGHT_DEFAULT_COLOR for arg_6 , arg_7 , arg_8 , arg_9 in arg_2 if arg_2 is not None else arg_0 . edges ( keys = True , data = True ) : arg_0 [ arg_6 ] [ arg_7 ] [ arg_8 ] [ arg_10 ] = arg_3

def Func(arg_0: arg_1, arg_2=None, arg_3: arg_4[arg_5]=None) -> None:
    """Adds a highlight tag to the given edges.

    :param graph: A BEL graph
    :param edges: The edges (4-tuples of u, v, k, d) to add a highlight tag on
    :type edges: iter[tuple]
    :param str color: The color to highlight (use something that works with CSS)
    """
    arg_3 = arg_3 or EDGE_HIGHLIGHT_DEFAULT_COLOR
    for arg_6, arg_7, arg_8, arg_9 in arg_2 if arg_2 is not None else arg_0.edges(keys=True, data=True):
        arg_0[arg_6][arg_7][arg_8][arg_10] = arg_3

Adds a highlight tag to the given edges .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , dict ) : if arg_0 . unique_state : arg_1 [ 'states' ] = dict ( arg_9 = arg_1 [ 'states' ] ) if arg_0 . unique_action : arg_1 [ 'actions' ] = dict ( arg_11 = arg_1 [ 'actions' ] ) arg_0 . model . import_demo_experience ( ** arg_1 ) else : if arg_0 . unique_state : arg_2 = dict ( arg_9 = list ( ) ) else : arg_2 = { arg_8 : list ( ) for arg_8 in arg_1 [ 0 ] [ 'states' ] } arg_3 = { arg_8 : list ( ) for arg_8 in arg_1 [ 0 ] [ 'internals' ] } if arg_0 . unique_action : arg_4 = dict ( arg_11 = list ( ) ) else : arg_4 = { arg_8 : list ( ) for arg_8 in arg_1 [ 0 ] [ 'actions' ] } arg_5 = list ( ) arg_6 = list ( ) for arg_7 in arg_1 : if arg_0 . unique_state : arg_2 [ 'state' ] . append ( arg_7 [ 'states' ] ) else : for arg_8 , arg_9 in arg_2 . items ( ) : arg_9 . append ( arg_7 [ 'states' ] [ arg_8 ] ) for arg_8 , arg_10 in arg_3 . items ( ) : arg_10 . append ( arg_7 [ 'internals' ] [ arg_8 ] ) if arg_0 . unique_action : arg_4 [ 'action' ] . append ( arg_7 [ 'actions' ] ) else : for arg_8 , arg_11 in arg_4 . items ( ) : arg_11 . append ( arg_7 [ 'actions' ] [ arg_8 ] ) arg_5 . append ( arg_7 [ 'terminal' ] ) arg_6 . append ( arg_7 [ 'reward' ] ) arg_0 . model . import_demo_experience ( arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 )

def Func(arg_0, arg_1):
        """
        Imports demonstrations, i.e. expert observations. Note that for large numbers of observations,
        set_demonstrations is more appropriate, which directly sets memory contents to an array an expects
        a different layout.

        Args:
            demonstrations: List of observation dicts
        """
        if isinstance(arg_1, dict):
            if arg_0.unique_state:
                arg_1['states'] = dict(arg_9=arg_1['states'])
            if arg_0.unique_action:
                arg_1['actions'] = dict(arg_11=arg_1['actions'])

            arg_0.model.import_demo_experience(**arg_1)

        else:
            if arg_0.unique_state:
                arg_2 = dict(arg_9=list())
            else:
                arg_2 = {arg_8: list() for arg_8 in arg_1[0]['states']}
            arg_3 = {arg_8: list() for arg_8 in arg_1[0]['internals']}
            if arg_0.unique_action:
                arg_4 = dict(arg_11=list())
            else:
                arg_4 = {arg_8: list() for arg_8 in arg_1[0]['actions']}
            arg_5 = list()
            arg_6 = list()

            for arg_7 in arg_1:
                if arg_0.unique_state:
                    arg_2['state'].append(arg_7['states'])
                else:
                    for arg_8, arg_9 in arg_2.items():
                        arg_9.append(arg_7['states'][arg_8])
                for arg_8, arg_10 in arg_3.items():
                    arg_10.append(arg_7['internals'][arg_8])
                if arg_0.unique_action:
                    arg_4['action'].append(arg_7['actions'])
                else:
                    for arg_8, arg_11 in arg_4.items():
                        arg_11.append(arg_7['actions'][arg_8])
                arg_5.append(arg_7['terminal'])
                arg_6.append(arg_7['reward'])

            arg_0.model.import_demo_experience(
                arg_2=arg_2,
                arg_3=arg_3,
                arg_4=arg_4,
                arg_5=arg_5,
                arg_6=arg_6
            )

Imports demonstrations i . e . expert observations . Note that for large numbers of observations set_demonstrations is more appropriate which directly sets memory contents to an array an expects a different layout .


def Func(arg_0):
        """Generate the body that will be used in the refresh request."""
        arg_1 = urllib.parse.urlencode({
            'grant_type': 'refresh_token',
            'client_id': arg_0.client_id,
            'client_secret': arg_0.client_secret,
            'refresh_token': arg_0.refresh_token,
        })
        return arg_1

Generate the body that will be used in the refresh request .


def Func ( arg_0 ) : arg_1 = request . _methodview . search_class ( ) arg_1 = arg_1 . get_record ( str ( arg_0 . id ) ) return arg_1 . count ( ) == 1

def Func(arg_0):
    """Check if a given record is indexed.

    :param record: A record object.
    :returns: If the record is indexed returns `True`, otherwise `False`.
    """
    arg_1 = request._methodview.search_class()
    arg_1 = arg_1.get_record(str(arg_0.id))
    return arg_1.count() == 1


def Func(arg_0, arg_1):
        """Dump the ocntent into the `file` in binary mode.
        """
        if arg_0.__text_is_expected:
            arg_1 = TextWrapper(arg_1, arg_0.__encoding)
        arg_0.__dump_to_file(arg_1)

Dump the ocntent into the file in binary mode .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_3 = math . radians ( arg_3 ) - ( math . pi / 2 ) arg_4 = arg_0 + arg_2 * math . cos ( arg_3 ) if arg_4 < arg_0 : arg_4 = math . ceil ( arg_4 ) else : arg_4 = math . floor ( arg_4 ) arg_5 = arg_1 + arg_2 * math . sin ( arg_3 ) if arg_5 < arg_1 : arg_5 = math . ceil ( arg_5 ) else : arg_5 = math . floor ( arg_5 ) return ( int ( arg_4 ) , int ( arg_5 ) )

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Calculates the coordinates of a point on a circle given the center point,
    radius, and angle.
    """
    arg_3 = math.radians(arg_3) - (math.pi / 2)
    arg_4 = arg_0 + arg_2 * math.cos(arg_3)
    if arg_4 < arg_0:
        arg_4 = math.ceil(arg_4)
    else:
        arg_4 = math.floor(arg_4)

    arg_5 = arg_1 + arg_2 * math.sin(arg_3)

    if arg_5 < arg_1:
        arg_5 = math.ceil(arg_5)
    else:
        arg_5 = math.floor(arg_5)

    return (int(arg_4), int(arg_5))

Calculates the coordinates of a point on a circle given the center point radius and angle .


def Func ( arg_0 , arg_1 ) : if ( arg_1 [ 0 ] > arg_0 . size [ 0 ] ) and ( arg_1 [ 1 ] > arg_0 . size [ 1 ] ) : raise ImageSizeError ( arg_0 . size , arg_1 )

def Func(arg_0, arg_1):
    """Check that the image's size superior to `size`"""
    if (arg_1[0] > arg_0.size[0]) and (arg_1[1] > arg_0.size[1]):
        raise ImageSizeError(arg_0.size, arg_1)

Check that the image s size superior to size


return self.sys_sigprocmask(cpu, how, newset, oldset)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Wrapper for sys_sigprocmask"""
        return arg_0.sys_sigprocmask(arg_1, arg_2, arg_3, arg_4)


(text, char_limit, sentence_filter=None, debug=False)

return [sents[i] for i in sent_indices], debug_info

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False ) : arg_4 = { } arg_5 = list ( tools . sent_splitter_ja ( arg_0 ) ) arg_6 = [ arg_9 . encode ( 'utf-8' ) for s in arg_5 for arg_9 in tools . word_segmenter_ja ( s ) ] arg_7 = collections . Counter ( ) for arg_8 in arg_6 : for arg_9 in arg_8 : arg_7 [ arg_9 ] += 1.0 if arg_2 is not None : arg_10 = [ arg_20 for arg_20 , s in enumerate ( arg_5 ) if arg_2 ( s ) ] arg_5 = [ arg_5 [ arg_20 ] for arg_20 in arg_10 ] arg_6 = [ arg_6 [ arg_20 ] for arg_20 in arg_10 ] arg_11 = [ str ( arg_20 ) for arg_20 in range ( len ( arg_5 ) ) ] arg_12 = dict ( ( arg_14 , len ( s ) ) for arg_14 , s in zip ( arg_11 , arg_5 ) ) arg_13 = dict ( ) for arg_14 , arg_8 in zip ( arg_11 , arg_6 ) : arg_13 [ arg_14 ] = collections . defaultdict ( lambda : 0 ) for arg_9 in arg_8 : arg_13 [ arg_14 ] [ arg_9 ] = 1 arg_15 = pulp . LpProblem ( 'Func' , pulp . LpMaximize ) arg_16 = pulp . LpVariable . dicts ( 'sents' , arg_11 , 0 , 1 , pulp . LpBinary ) arg_17 = pulp . LpVariable . dicts ( 'words' , arg_7 . keys ( ) , 0 , 1 , pulp . LpBinary ) arg_15 += pulp . lpSum ( [ arg_7 [ arg_9 ] * arg_17 [ arg_9 ] for arg_9 in arg_7 ] ) arg_15 += pulp . lpSum ( [ arg_12 [ arg_14 ] * arg_16 [ arg_14 ] for arg_14 in arg_11 ] ) <= arg_1 , 'lengthRequirement' for arg_9 in arg_7 : arg_15 += pulp . lpSum ( [ arg_13 [ arg_14 ] [ arg_9 ] * arg_16 [ arg_14 ] for arg_14 in arg_11 ] ) >= arg_17 [ arg_9 ] , 'z:{}' . format ( arg_9 ) arg_15 . solve ( ) arg_18 = [ ] for arg_19 in arg_15 . variables ( ) : if arg_19 . name . startswith ( 'sents' ) and arg_19 . varValue == 1 : arg_18 . append ( int ( arg_19 . name . split ( '_' ) [ - 1 ] ) ) return [ arg_5 [ arg_20 ] for arg_20 in arg_18 ] , arg_4

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
    '''
    select sentences in terms of maximum coverage problem

    Args:
      text: text to be Funcd (unicode string)
      char_limit: summary length (the number of characters)

    Returns:
      list of extracted sentences

    Reference:
      Hiroya Takamura, Manabu Okumura.
      Text summarization model based on maximum coverage problem and its
      variant. (section 3)
      http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.222.6945
    '''
    arg_4 = {}

    arg_5 = list(tools.sent_splitter_ja(arg_0))
    arg_6 = [
        # pulp variables should be utf-8 encoded
        arg_9.encode('utf-8') for s in arg_5 for arg_9 in tools.word_segmenter_ja(s)
    ]

    arg_7 = collections.Counter()
    for arg_8 in arg_6:
        for arg_9 in arg_8:
            arg_7[arg_9] += 1.0

    if arg_2 is not None:
        arg_10 = [arg_20 for arg_20, s in enumerate(arg_5) if arg_2(s)]
        arg_5 = [arg_5[arg_20] for arg_20 in arg_10]
        arg_6 = [arg_6[arg_20] for arg_20 in arg_10]

    arg_11 = [str(arg_20) for arg_20 in range(len(arg_5))]  # sentence id
    arg_12 = dict((arg_14, len(s)) for arg_14, s in zip(arg_11, arg_5))  # c

    arg_13 = dict()  # a
    for arg_14, arg_8 in zip(arg_11, arg_6):
        arg_13[arg_14] = collections.defaultdict(lambda: 0)
        for arg_9 in arg_8:
            arg_13[arg_14][arg_9] = 1

    arg_15 = pulp.LpProblem('Func', pulp.LpMaximize)

    # x
    arg_16 = pulp.LpVariable.dicts('sents', arg_11, 0, 1, pulp.LpBinary)
    # z
    arg_17 = pulp.LpVariable.dicts('words', arg_7.keys(), 0, 1, pulp.LpBinary)

    # first, set objective function: sum(w*z)
    arg_15 += pulp.lpSum([arg_7[arg_9] * arg_17[arg_9] for arg_9 in arg_7])

    # next, add constraints
    # limit summary length: sum(c*x) <= K
    arg_15 += pulp.lpSum(
        [arg_12[arg_14] * arg_16[arg_14] for arg_14 in arg_11]
    ) <= arg_1, 'lengthRequirement'
    # for each term, sum(a*x) <= z
    for arg_9 in arg_7:
        arg_15 += pulp.lpSum(
            [arg_13[arg_14][arg_9] * arg_16[arg_14] for arg_14 in arg_11]
        ) >= arg_17[arg_9], 'z:{}'.format(arg_9)

    arg_15.solve()
    # print("Status:", pulp.LpStatus[prob.status])

    arg_18 = []
    for arg_19 in arg_15.variables():
        # print v.name, "=", v.varValue
        if arg_19.name.startswith('sents') and arg_19.varValue == 1:
            arg_18.append(int(arg_19.name.split('_')[-1]))

    return [arg_5[arg_20] for arg_20 in arg_18], arg_4

select sentences in terms of maximum coverage problem

    Args:
      text: text to be summarized (unicode string)
      char_limit: summary length (the number of characters)

    Returns:
      list of extracted sentences

    Reference:
      Hiroya Takamura, Manabu Okumura.
      Text summarization model based on maximum coverage problem and its
      variant. (section 3)
      http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.222.6945


async def Func ( arg_0 ) -> List [ PlaylistTrack ] : if isinstance ( arg_0 . _tracks , PartialTracks ) : return await arg_0 . _tracks . build ( ) arg_1 = [ ] arg_2 = 0 while len ( arg_0 . tracks ) < arg_0 . total_tracks : arg_3 = await arg_0 . __client . http . get_playlist_tracks ( arg_0 . owner . id , arg_0 . id , limit = 50 , arg_2 = arg_2 ) arg_1 += [ PlaylistTrack ( arg_0 . __client , arg_4 ) for arg_4 in arg_3 [ 'items' ] ] arg_2 += 50 arg_0 . total_tracks = len ( arg_0 . _tracks ) return list ( arg_0 . _tracks )

async def Func(arg_0) -> List[PlaylistTrack]:
        """Get all playlist tracks from the playlist.

        Returns
        -------
        tracks : List[PlaylistTrack]
            The playlists tracks.
        """
        if isinstance(arg_0._tracks, PartialTracks):
            return await arg_0._tracks.build()

        arg_1 = []
        arg_2 = 0
        while len(arg_0.tracks) < arg_0.total_tracks:
            arg_3 = await arg_0.__client.http.get_playlist_tracks(arg_0.owner.id, arg_0.id, limit=50, arg_2=arg_2)

            arg_1 += [PlaylistTrack(arg_0.__client, arg_4) for arg_4 in arg_3['items']]
            arg_2 += 50

        arg_0.total_tracks = len(arg_0._tracks)
        return list(arg_0._tracks)

Get all playlist tracks from the playlist .


def Func ( arg_0 ) : arg_0 . tree . root . dist2root = 0.0 for arg_4 in arg_0 . tree . get_nonterminals ( order = 'preorder' ) : for arg_5 in arg_4 . clades : if not hasattr ( arg_5 , 'mutation_length' ) : arg_5 . mutation_length = arg_5 . branch_length arg_5 . dist2root = arg_5 . up . dist2root + arg_5 . mutation_length

def Func(arg_0):
        """
        For each node in the tree, set its root-to-node distance as dist2root
        attribute
        """
        arg_0.tree.root.dist2root = 0.0
        for arg_4 in arg_0.tree.get_nonterminals(order='preorder'): # parents first
            for arg_5 in arg_4.clades:
                if not hasattr(arg_5, 'mutation_length'):
                    arg_5.mutation_length=arg_5.branch_length
                arg_5.dist2root = arg_5.up.dist2root + arg_5.mutation_length

For each node in the tree set its root - to - node distance as dist2root attribute


(
    client, profile_name, aws_access_key_id, aws_secret_access_key,
    region=None,
)

def Func(
    arg_0, arg_1, arg_2, arg_3,
    arg_4=None,
):
    """Shortcut for getting an initialized instance of the boto3 client."""

    boto3.setup_default_session(
        arg_1=arg_1,
        arg_2=arg_2,
        arg_3=arg_3,
        region_name=arg_4,
    )
    return boto3.client(arg_0)

Shortcut for getting an initialized instance of the boto3 client .


def Func ( arg_0 ) : arg_1 = VcfRecord . _EMPTY_SET if arg_0 . sample_tag_values : arg_2 = list ( arg_0 . sample_tag_values . keys ( ) ) [ 0 ] arg_1 = set ( arg_0 . sample_tag_values [ arg_2 ] . keys ( ) ) return arg_1

def Func(arg_0):
        """Returns set of format tags."""
        arg_1 = VcfRecord._EMPTY_SET
        if arg_0.sample_tag_values:
            arg_2 = list(arg_0.sample_tag_values.keys())[0]
            arg_1 = set(arg_0.sample_tag_values[arg_2].keys())
        return arg_1


def Func(arg_0):
    '''Looks up a string which may represent a mixture in the database of
    thermo to determine the key by which the composition of that mixture can
    be obtained in the dictionary `_MixtureDict`.

    Parameters
    ----------
    ID : str
        A string or 1-element list containing the name which may represent a
        mixture.

    Returns
    -------
    key : str
        Key for access to the data on the mixture in `_MixtureDict`.

    Notes
    -----
    White space, '-', and upper case letters are removed in the search.

    Examples
    --------
    >>> Func('R512A')
    'R512A'
    >>> Func([u'air'])
    'Air'
    '''
    if type(arg_0) == list:
        if len(arg_0) == 1:
            arg_0 = arg_0[0]
        else:
            raise Exception('If the input is a list, the list must contain only one item.')
    arg_0 = arg_0.lower().strip()
    arg_1 = arg_0.replace(' ', '')
    arg_2 = arg_0.replace('-', '')
    for arg_3 in [arg_0, arg_1, arg_2]:
        if arg_3 in _MixtureDictLookup:
            return _MixtureDictLookup[arg_3]
    raise Exception('Mixture name not recognized')

Looks up a string which may represent a mixture in the database of
    thermo to determine the key by which the composition of that mixture can
    be obtained in the dictionary `_MixtureDict`.

    Parameters
    ----------
    ID : str
        A string or 1-element list containing the name which may represent a
        mixture.

    Returns
    -------
    key : str
        Key for access to the data on the mixture in `_MixtureDict`.

    Notes
    -----
    White space, '-', and upper case letters are removed in the search.

    Examples
    --------
    >>> mixture_from_any('R512A')
    'R512A'
    >>> mixture_from_any([u'air'])
    'Air'

Looks up a string which may represent a mixture in the database of thermo to determine the key by which the composition of that mixture can be obtained in the dictionary _MixtureDict .


def Func(arg_0, arg_1: arg_2) -> Any:
        """
        Loads a resource or return existing one

        :param meta: The resource description
        """
        arg_0._check_meta(arg_1)
        arg_0.resolve_Funcer(arg_1)
        return arg_1.Funcer_cls(arg_1).Func()


return self._nn_interface._add_generic(self, type_name=DERIVED_PARAMETER_GROUP,
                                               group_type_name=DERIVED_PARAMETER_GROUP,
                                               args=args, kwargs=kwargs)

def Func(arg_0, *arg_1, **arg_2):
        """Adds an empty derived parameter group under the current node.

        Adds the full name of the current node as prefix to the name of the group.
        If current node is a single run (root) adds the prefix `'derived_parameters.runs.run_08%d%'`
        to the full name where `'08%d'` is replaced by the index of the current run.

        The `name` can also contain subgroups separated via colons, for example:
        `name=subgroup1.subgroup2.subgroup3`. These other parent groups will be automatically
        be created.

        """

        return arg_0._nn_interface._add_generic(arg_0, type_name=DERIVED_PARAMETER_GROUP,
                                               group_type_name=DERIVED_PARAMETER_GROUP,
                                               arg_1=arg_1, arg_2=arg_2)

Adds an empty derived parameter group under the current node .


def Func(arg_0):
        """
        Returns the number of connected subscribers.

        :rtype:  int
        :returns: The number of subscribers.
        """
        arg_1 = arg_0.hard_subscribers and len(arg_0.hard_subscribers) or 0
        arg_2 = arg_0.weak_subscribers and len(arg_0.weak_subscribers) or 0
        return arg_1 + arg_2

Returns the number of connected subscribers .


def Func ( arg_0 , arg_1 ) : arg_2 = ':' if arg_1 . group ( 1 ) is None else '' return arg_0 . renderer . eol_literal_marker ( arg_2 )

def Func(arg_0, arg_1):
        """Pass through rest link."""
        arg_2 = ':' if arg_1.group(1) is None else ''
        return arg_0.renderer.eol_literal_marker(arg_2)


def Func(arg_0):
        """Create a multiplexed stream connection.

        Connect to the AMP server's multiplexed factory using the
        identifier (defined by this class' factory). When done, stores
        the connection reference and causes buffered data to be sent.

        """
        log.msg("Creating multiplexed AMP connection...")
        arg_1 = arg_0.factory.remoteFactoryIdentifier
        arg_2 = arg_0._callRemote(Connect, factory=arg_1)
        arg_2.addCallback(arg_0._multiplexedConnectionMade)

Create a multiplexed stream connection .


def Func ( arg_0 , arg_1 = None ) : if isinstance ( arg_0 , text_type ) and arg_1 is not None and len ( arg_0 ) > arg_1 : return arg_0 [ : arg_1 ] return arg_0

def Func(arg_0, arg_1=None):
    """Truncate string values."""
    if isinstance(arg_0, text_type) and arg_1 is not None and len(arg_0) > arg_1:
        return arg_0[:arg_1]
    return arg_0


def Func ( arg_0 ) : arg_1 = { bool : models . BooleanField , int : models . IntegerField , float : models . FloatField , datetime : models . DateTimeField , } . get ( type ( arg_0 . default ) , models . TextField ) ( ) update_field_from_proxy ( arg_1 , arg_0 ) return arg_1

def Func(arg_0):
    """Returns a field object instance for a given PrefProxy object.

    :param PrefProxy pref_proxy:

    :rtype: models.Field

    """
    arg_1 = {
        bool: models.BooleanField,
        int:  models.IntegerField,
        float: models.FloatField,
        datetime: models.DateTimeField,

    }.get(type(arg_0.default), models.TextField)()

    update_field_from_proxy(arg_1, arg_0)

    return arg_1

Returns a field object instance for a given PrefProxy object .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_0
.
get_Func_status
(
arg_1
,
arg_2
)
!=
u'0'
:
return
arg_3
=
arg_0
.
url
(
'sd/{}/{}/setPropagate/1/'
.
format
(
arg_1
,
arg_2
)
)
arg_4
=
arg_0
.
remote_utils
.
get_url
(
arg_3
)
if
arg_4
.
status_code
is
not
200
:
raise
RemoteDataUploadError
(
'Propagate fail: {}'
.
format
(
arg_4
.
text
)
)
return
True

def Func(arg_0, arg_1, arg_2):
        """
        Kick off the Func function on the remote server.

        Arguments:
            token (str): The token to Func
            channel (str): The channel to Func

        Returns:
            boolean: Success
        """
        if arg_0.get_Func_status(arg_1, arg_2) != u'0':
            return
        arg_3 = arg_0.url('sd/{}/{}/setPropagate/1/'.format(arg_1, arg_2))
        arg_4 = arg_0.remote_utils.get_url(arg_3)
        if arg_4.status_code is not 200:
            raise RemoteDataUploadError('Propagate fail: {}'.format(arg_4.text))
        return True

Kick off the propagate function on the remote server.

        Arguments:
            token (str): The token to propagate
            channel (str): The channel to propagate

        Returns:
            boolean: Success

Kick off the propagate function on the remote server .


def
Func
(
arg_0
,
arg_1
=
''
)
:
arg_2
=
arg_0
.
local_renderer
with
arg_0
.
settings
(
hide
(
'running'
)
)
:
arg_3
=
arg_2
.
local
(
'vagrant ssh-config %s'
%
arg_1
,
capture
=
True
)
arg_4
=
{
}
for
arg_5
in
arg_3
.
splitlines
(
)
[
1
:
]
:
arg_6
,
arg_7
=
arg_5
.
strip
(
)
.
split
(
' '
,
2
)
arg_4
[
arg_6
]
=
arg_7
return
arg_4

def Func(arg_0, arg_1=''):
        """
        Get the SSH parameters for connecting to a vagrant VM.
        """
        arg_2 = arg_0.local_renderer
        with arg_0.settings(hide('running')):
            arg_3 = arg_2.local('vagrant ssh-config %s' % arg_1, capture=True)

        arg_4 = {}
        for arg_5 in arg_3.splitlines()[1:]:
            arg_6, arg_7 = arg_5.strip().split(' ', 2)
            arg_4[arg_6] = arg_7
        return arg_4

Get the SSH parameters for connecting to a vagrant VM .


def Func ( arg_0 , arg_1 ) : arg_2 = 0 arg_3 = int ( ( arg_1 . stats . clusters_total // arg_0 . cpus ) + ( arg_1 . stats . clusters_total % arg_0 . cpus ) ) arg_4 = [ ] with gzip . open ( arg_1 . files . clusters , 'rb' ) as clusters : arg_5 = itertools . izip ( * [ iter ( clusters ) ] * 2 ) arg_6 = 0 while not arg_6 : arg_6 , arg_7 = clustdealer ( arg_5 , arg_3 ) arg_8 = os . path . join ( arg_0 . dirs . clusts , "tmp_" + str ( arg_1 . name ) + "." + str ( arg_2 * arg_3 ) ) if arg_7 : arg_4 . append ( ( arg_3 , arg_8 ) ) with open ( arg_8 , 'wb' ) as outchunk : outchunk . write ( "//\n//\n" . join ( arg_7 ) + "//\n//\n" ) arg_2 += 1 return arg_4

def Func(arg_0, arg_1):
    """ split job into bits and pass to the client """

    ## counter for split job submission
    arg_2 = 0

    ## set optim size for chunks in N clusters. The first few chunks take longer
    ## because they contain larger clusters, so we create 4X as many chunks as
    ## processors so that they are split more evenly.
    arg_3 = int((arg_1.stats.clusters_total // arg_0.cpus) + \
                (arg_1.stats.clusters_total % arg_0.cpus))

    ## break up the file into smaller tmp files for each engine
    ## chunking by cluster is a bit trickier than chunking by N lines
    arg_4 = []

    ## open to clusters
    with gzip.open(arg_1.files.clusters, 'rb') as clusters:
        ## create iterator to sample 2 lines at a time
        arg_5 = itertools.izip(*[iter(clusters)]*2)

        ## Use iterator to sample til end of cluster
        arg_6 = 0
        while not arg_6:
            ## grab optim clusters and write to file.
            arg_6, arg_7 = clustdealer(arg_5, arg_3)
            arg_8 = os.path.join(arg_0.dirs.clusts,
                                    "tmp_"+str(arg_1.name)+"."+str(arg_2*arg_3))
            if arg_7:
                arg_4.append((arg_3, arg_8))
                with open(arg_8, 'wb') as outchunk:
                    outchunk.write("//\n//\n".join(arg_7)+"//\n//\n")
                arg_2 += 1

    return arg_4


def Func ( arg_0 ) : def load_subconfig ( arg_1 , arg_2 = None ) : from IPython . core . profiledir import ProfileDir , ProfileDirError if arg_2 is not None : try : arg_3 = ProfileDir . find_profile_dir_by_name ( get_ipython_dir ( ) , arg_2 , ) except ProfileDirError : return arg_4 = arg_3 . location else : arg_4 = arg_0 . path arg_5 = PyFileConfigLoader ( arg_1 , arg_4 ) try : arg_6 = arg_5 . load_config ( ) except ConfigFileNotFound : pass else : arg_0 . config . _merge ( arg_6 ) def get_config ( ) : return arg_0 . config arg_7 = dict ( load_subconfig = load_subconfig , get_config = get_config ) arg_8 = sys . getfilesystemencoding ( ) or 'ascii' arg_9 = arg_0 . full_filename . encode ( arg_8 ) py3compat . execfile ( arg_9 , arg_7 )

def Func(arg_0):
        """Load the config file into self.config, with recursive loading."""
        # This closure is made available in the namespace that is used
        # to exec the config file.  It allows users to call
        # load_subconfig('myconfig.py') to load config files recursively.
        # It needs to be a closure because it has references to self.path
        # and self.config.  The sub-config is loaded with the same path
        # as the parent, but it uses an empty config which is then merged
        # with the parents.

        # If a profile is specified, the config file will be loaded
        # from that profile

        def load_subconfig(arg_1, arg_2=None):
            # import here to prevent circular imports
            from IPython.core.profiledir import ProfileDir, ProfileDirError
            if arg_2 is not None:
                try:
                    arg_3 = ProfileDir.find_profile_dir_by_name(
                            get_ipython_dir(),
                            arg_2,
                    )
                except ProfileDirError:
                    return
                arg_4 = arg_3.location
            else:
                arg_4 = arg_0.path
            arg_5 = PyFileConfigLoader(arg_1, arg_4)
            try:
                arg_6 = arg_5.load_config()
            except ConfigFileNotFound:
                # Pass silently if the sub config is not there. This happens
                # when a user s using a profile, but not the default config.
                pass
            else:
                arg_0.config._merge(arg_6)

        # Again, this needs to be a closure and should be used in config
        # files to get the config being loaded.
        def get_config():
            return arg_0.config

        arg_7 = dict(load_subconfig=load_subconfig, get_config=get_config)
        arg_8 = sys.getfilesystemencoding() or 'ascii'
        arg_9 = arg_0.full_filename.encode(arg_8)
        py3compat.execfile(arg_9, arg_7)

Load the config file into self . config with recursive loading .


def Func(arg_0, arg_1):
    """Returns a Pattern that matches exactly n repetitions of Pattern p.
    """
    arg_2 = P()
    while arg_1 >= 1:
        if arg_1 % 2:
            arg_2 = arg_2 + arg_0
        arg_0 = arg_0 + arg_0
        arg_1 = arg_1 // 2
    return arg_2

Returns a Pattern that matches exactly n repetitions of Pattern p .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , ( list , tuple ) ) : arg_1 = "," . join ( Func ( arg_0 , item ) for item in arg_1 ) elif isinstance ( arg_1 , dict ) : arg_1 = "," . join ( "%s:%s" % ( k , v ) for k , v in arg_1 . items ( ) ) elif hasattr ( arg_1 , "match" ) : arg_1 = arg_1 . pattern elif arg_0 . get ( "type" ) == "yn" : arg_1 = "yes" if arg_1 else "no" elif isinstance ( arg_1 , str ) and arg_1 . isspace ( ) : arg_1 = "'%s'" % arg_1 return arg_1

def Func(arg_0, arg_1):
    """return the user input's value from a 'compiled' value"""
    if isinstance(arg_1, (list, tuple)):
        arg_1 = ",".join(Func(arg_0, item) for item in arg_1)
    elif isinstance(arg_1, dict):
        arg_1 = ",".join("%s:%s" % (k, v) for k, v in arg_1.items())
    elif hasattr(arg_1, "match"):  # optdict.get('type') == 'regexp'
        # compiled regexp
        arg_1 = arg_1.pattern
    elif arg_0.get("type") == "yn":
        arg_1 = "yes" if arg_1 else "no"
    elif isinstance(arg_1, str) and arg_1.isspace():
        arg_1 = "'%s'" % arg_1
    return arg_1

return the user input s value from a compiled value


(self, bins, repeats, base_buffer_size, max_buffer_size=0)

return (buffer_repeats, zeros(buffer_size, numpy.complex64))

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=0):
        """Create buffer for reading samples"""
        arg_5 = arg_1 * arg_2
        arg_6 = 1
        arg_7 = math.ceil(arg_5 / arg_3) * arg_3

        if not arg_4:
            # Max buffer size about 100 MB
            arg_4 = (100 * 1024**2) / 8

        if arg_4 > 0:
            arg_4 = math.ceil(arg_4 / arg_3) * arg_3
            if arg_7 > arg_4:
                logger.warning('Required buffer size ({}) will be shrinked to max_buffer_size ({})!'.format(
                    arg_7, arg_4
                ))
                arg_6 = math.ceil(arg_7 / arg_4)
                arg_7 = arg_4

        logger.info('repeats: {}'.format(arg_2))
        logger.info('samples: {} (time: {:.5f} s)'.format(arg_5, arg_5 / arg_0.device.sample_rate))
        if arg_4 > 0:
            logger.info('max_buffer_size (samples): {} (repeats: {:.2f}, time: {:.5f} s)'.format(
                arg_4, arg_4 / arg_1, arg_4 / arg_0.device.sample_rate
            ))
        else:
            logger.info('max_buffer_size (samples): UNLIMITED')
        logger.info('buffer_size (samples): {} (repeats: {:.2f}, time: {:.5f} s)'.format(
            arg_7, arg_7 / arg_1, arg_7 / arg_0.device.sample_rate
        ))
        logger.info('buffer_repeats: {}'.format(arg_6))

        return (arg_6, zeros(arg_7, numpy.complex64))


return unvec(self._vecB.value, (self.X.shape[1], self.A.shape[0]))

def Func ( arg_0 ) : return unvec ( arg_0 . _vecFunc . value , ( arg_0 . X . shape [ 1 ] , arg_0 . A . shape [ 0 ] ) )

def Func(arg_0):
        """
        Effect-sizes parameter, Func.
        """
        return unvec(arg_0._vecFunc.value, (arg_0.X.shape[1], arg_0.A.shape[0]))


def Func(arg_0, arg_1):
        """Execute gerrit command"""

        if arg_0.from_archive:
            arg_2 = arg_0.Func_from_archive(arg_1)
        else:
            arg_2 = arg_0.Func_from_remote(arg_1)

        return arg_2


def Func(arg_0, arg_1):
        """
        Calculate the enthalpy flow rate of the stream at the specified
        temperature.

        :param T: Temperature. [°C]

        :returns: Enthalpy flow rate. [kWh/h]
        """

        if arg_0.isCoal:
            return arg_0.Func_coal(arg_1)

        arg_2 = 0.0
        for arg_3 in arg_0.material.compounds:
            arg_4 = arg_0.material.get_compound_index(arg_3)
            arg_5 = thermo.H(arg_3, arg_1, arg_0._compound_mfrs[arg_4])
            arg_2 = arg_2 + arg_5
        return arg_2

Calculate the enthalpy flow rate of the stream at the specified temperature .


def Func(arg_0,arg_1,arg_2,arg_3, arg_4=0):
    """State-space representation to zero-pole-gain representation.

    :param A: ndarray State-space representation of linear system.
    :param B: ndarray State-space representation of linear system.
    :param C: ndarray State-space representation of linear system.
    :param D: ndarray State-space representation of linear system.
    :param int input: optional For multiple-input systems, the input to use.

    :return:
        * z, p : sequence  Zeros and poles.
        * k : float System gain.

    .. note:: wrapper of scipy function Func
    """
    import scipy.signal
    arg_5, arg_6, arg_7 = scipy.signal.Func(arg_0, arg_1, arg_2, arg_3, arg_4=arg_4)
    return arg_5, arg_6, arg_7

State-space representation to zero-pole-gain representation.

    :param A: ndarray State-space representation of linear system.
    :param B: ndarray State-space representation of linear system.
    :param C: ndarray State-space representation of linear system.
    :param D: ndarray State-space representation of linear system.
    :param int input: optional For multiple-input systems, the input to use.

    :return:
        * z, p : sequence  Zeros and poles.
        * k : float System gain.

    .. note:: wrapper of scipy function ss2zpk

State - space representation to zero - pole - gain representation .


(graph: BELGraph, nodes: List[BaseEntity])

return unnormalized_sum / (number_nodes * (number_nodes - 1.0))

def Func ( arg_0 : arg_1 , arg_2 : arg_3 [ arg_4 ] ) -> float : arg_2 = list ( arg_2 ) arg_5 = len ( arg_2 ) if arg_5 <= 1 : return 0.0 arg_6 = sum ( u in arg_0 [ v ] for u , v in itt . product ( arg_2 , repeat = 2 ) if v in arg_0 and u != v ) return arg_6 / ( arg_5 * ( arg_5 - 1.0 ) )

def Func(arg_0: arg_1, arg_2: arg_3[arg_4]) -> float:
    """Calculate the node neighbor score for a given list of nodes.

    -  Doesn't consider self loops

    .. math::

         \frac{\sum_i^n N_G[i]}{n*(n-1)}
    """
    arg_2 = list(arg_2)
    arg_5 = len(arg_2)

    if arg_5 <= 1:
        # log.debug('')
        return 0.0

    arg_6 = sum(
        u in arg_0[v]
        for u, v in itt.product(arg_2, repeat=2)
        if v in arg_0 and u != v
    )

    return arg_6 / (arg_5 * (arg_5 - 1.0))

Calculate the node neighbor score for a given list of nodes . - Doesn t consider self loops


def Func(arg_0, arg_1, arg_2=0):
        """
        Retrieves a single location by ID.

        :param      location_id: The unique ID of the location.
        :type       location_id: ``str``

        """
        arg_3 = arg_0._perform_request('/locations/%s?depth=%s' % (arg_1, arg_2))
        return arg_3


return [
        (ELEM_KEYS.get(k, k), ELEM_VALS.get(ELEM_KEYS.get(k, k), dict()).get(v, v))
        for k, v in kwargs.items()
        if (k in list(ELEM_KEYS.keys()) + list(ELEM_KEYS.values()))
        and (k not in PRSV_COLS)
    ]

def Func ( ** arg_0 ) -> list : return [ ( ELEM_KEYS . get ( arg_1 , arg_1 ) , ELEM_VALS . get ( ELEM_KEYS . get ( arg_1 , arg_1 ) , dict ( ) ) . get ( arg_2 , arg_2 ) ) for arg_1 , arg_2 in arg_0 . items ( ) if ( arg_1 in list ( ELEM_KEYS . keys ( ) ) + list ( ELEM_KEYS . values ( ) ) ) and ( arg_1 not in PRSV_COLS ) ]

def Func(**arg_0) -> list:
    """
    Bloomberg overrides for elements

    Args:
        **kwargs: overrides

    Returns:
        list of tuples

    Examples:
        >>> Func(PerAdj='A', Per='W')
        [('periodicityAdjustment', 'ACTUAL'), ('periodicitySelection', 'WEEKLY')]
        >>> Func(Days='A', Fill='B')
        [('nonTradingDayFillOption', 'ALL_CALENDAR_DAYS'), ('nonTradingDayFillMethod', 'NIL_VALUE')]
        >>> Func(CshAdjNormal=False, CshAdjAbnormal=True)
        [('adjustmentNormal', False), ('adjustmentAbnormal', True)]
        >>> Func(Per='W', Quote='Average', start_date='2018-01-10')
        [('periodicitySelection', 'WEEKLY'), ('overrideOption', 'OVERRIDE_OPTION_GPA')]
        >>> Func(QuoteType='Y')
        [('pricingOption', 'PRICING_OPTION_YIELD')]
        >>> Func(QuoteType='Y', cache=True)
        [('pricingOption', 'PRICING_OPTION_YIELD')]
    """
    return [
        (ELEM_KEYS.get(arg_1, arg_1), ELEM_VALS.get(ELEM_KEYS.get(arg_1, arg_1), dict()).get(arg_2, arg_2))
        for arg_1, arg_2 in arg_0.items()
        if (arg_1 in list(ELEM_KEYS.keys()) + list(ELEM_KEYS.values()))
        and (arg_1 not in PRSV_COLS)
    ]

Bloomberg overrides for elements

    Args:
        **kwargs: overrides

    Returns:
        list of tuples

    Examples:
        >>> proc_elms(PerAdj='A', Per='W')
        [('periodicityAdjustment', 'ACTUAL'), ('periodicitySelection', 'WEEKLY')]
        >>> proc_elms(Days='A', Fill='B')
        [('nonTradingDayFillOption', 'ALL_CALENDAR_DAYS'), ('nonTradingDayFillMethod', 'NIL_VALUE')]
        >>> proc_elms(CshAdjNormal=False, CshAdjAbnormal=True)
        [('adjustmentNormal', False), ('adjustmentAbnormal', True)]
        >>> proc_elms(Per='W', Quote='Average', start_date='2018-01-10')
        [('periodicitySelection', 'WEEKLY'), ('overrideOption', 'OVERRIDE_OPTION_GPA')]
        >>> proc_elms(QuoteType='Y')
        [('pricingOption', 'PRICING_OPTION_YIELD')]
        >>> proc_elms(QuoteType='Y', cache=True)
        [('pricingOption', 'PRICING_OPTION_YIELD')]


Apply crz from ctl to tgt with angle theta.

return self.append(CrzGate(theta), [ctl, tgt], [])

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : return arg_0 . append ( CrzGate ( arg_1 ) , [ arg_2 , arg_3 ] , [ ] )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Apply Func from ctl to tgt with angle theta."""
    return arg_0.append(CrzGate(arg_1), [arg_2, arg_3], [])

Apply crz from ctl to tgt with angle theta .


return _ETreeXmlToObject.convert_response_to_feeds(
            response, _convert_etree_element_to_subscription)

def Func(arg_0, arg_1):
        '''
        Retrieves the subscriptions in the specified topic.

        topic_name:
            Name of the topic.
        '''
        _validate_not_none('topic_name', arg_1)
        arg_2 = HTTPRequest()
        arg_2.method = 'GET'
        arg_2.host = arg_0._get_host()
        arg_2.path = '/' + _str(arg_1) + '/subscriptions/'
        arg_2.path, arg_2.query = arg_0._httpclient._update_request_uri_query(arg_2)  # pylint: disable=protected-access
        arg_2.headers = arg_0._update_service_bus_header(arg_2)
        arg_8 = arg_0._perform_request(arg_2)

        return _ETreeXmlToObject.convert_response_to_feeds(
            arg_8, _convert_etree_element_to_subscription)

Retrieves the subscriptions in the specified topic .


(graph: BELGraph, key: Optional[str] = None)

return filter_nodes(graph, [node_is_upstream_leaf, data_missing_key_builder(key)])

def Func ( arg_0 : arg_1 , arg_2 : arg_3 [ arg_4 ] = None ) -> Iterable [ BaseEntity ] : if arg_2 is None : arg_2 = WEIGHT return filter_nodes ( arg_0 , [ node_is_upstream_leaf , data_missing_key_builder ( arg_2 ) ] )

def Func(arg_0: arg_1, arg_2: arg_3[arg_4] = None) -> Iterable[BaseEntity]:
    """Get nodes with no incoming edges, one outgoing edge, and without the given key in its data dictionary.

    .. seealso :: :func:`data_does_not_contain_key_builder`

    :param graph: A BEL graph
    :param key: The key in the node data dictionary representing the experimental data. Defaults to
     :data:`pybel_tools.constants.WEIGHT`.
    :return: An iterable over leaves (nodes with an in-degree of 0) that don't have the given annotation
    """
    if arg_2 is None:
        arg_2 = WEIGHT

    return filter_nodes(arg_0, [node_is_upstream_leaf, data_missing_key_builder(arg_2)])

Get nodes with no incoming edges one outgoing edge and without the given key in its data dictionary .


def Func ( arg_0 , arg_1 ) : arg_2 = requests . get ( API_ENDPOINT_OBS % ( arg_0 ) , params = { 'token' : arg_1 } ) if arg_2 . status_code == 200 and arg_2 . json ( ) [ 'status' ] == "ok" : return parse_observation_response ( arg_2 . json ( ) [ 'data' ] ) else : return { }

def Func(arg_0, arg_1):
    """Request station data for a specific station identified by code.

    A language parameter can also be specified to translate location
    information (default: "en")
    """
    arg_2 = requests.get(
        API_ENDPOINT_OBS % (arg_0),
        params={
            'token': arg_1
        })

    if arg_2.status_code == 200 and arg_2.json()['status'] == "ok":
        return parse_observation_response(arg_2.json()['data'])
    else:
        return {}

Request station data for a specific station identified by code .


def Func ( arg_0 , arg_1 ) : if not is_win32 : arg_1 = shlex . split ( arg_1 ) [ 0 ] arg_1 = os . path . basename ( arg_1 . lower ( ) ) for arg_2 , arg_3 in SUPPORTED_PLAYERS . items ( ) : for arg_4 in arg_3 : if arg_1 . startswith ( arg_4 ) : return arg_2

def Func(arg_0, arg_1):
        """
        Check if the current player supports adding a title

        :param cmd: command to test
        :return: name of the player|None
        """
        if not is_win32:
            # under a POSIX system use shlex to find the actual command
            # under windows this is not an issue because executables end in .exe
            arg_1 = shlex.split(arg_1)[0]

        arg_1 = os.path.basename(arg_1.lower())
        for arg_2, arg_3 in SUPPORTED_PLAYERS.items():
            for arg_4 in arg_3:
                if arg_1.startswith(arg_4):
                    return arg_2


def Func(arg_0, arg_1=None):
        """render one or all of my tracebacks to a list of lines"""
        arg_2 = []
        if arg_1 is None:
            for (arg_3,arg_4,arg_5,arg_6) in arg_0.elist:
                arg_2.append(arg_0._get_engine_str(arg_6))
                arg_2.extend((arg_5 or 'No traceback available').splitlines())
                arg_2.append('')
        else:
            try:
                arg_3,arg_4,arg_5,arg_6 = arg_0.elist[arg_1]
            except:
                raise IndexError("an exception with index %i does not exist"%arg_1)
            else:
                arg_2.append(arg_0._get_engine_str(arg_6))
                arg_2.extend((arg_5 or 'No traceback available').splitlines())

        return arg_2


def Func(arg_0, arg_1):
    """
    Gets a list of DICOM file absolute paths and returns a list of lists of
    DICOM file paths. Each group contains a set of DICOM files that have
    exactly the same headers.

    Parameters
    ----------
    dicom_file_paths: list of str
        List or set of DICOM file paths

    header_fields: list of str
        List of header field names to check on the comparisons of the DICOM files.

    Returns
    -------
    dict of DicomFileSets
        The key is one filepath representing the group (the first found).
    """
    arg_2 = SimpleDicomFileDistance(field_weights=arg_1)

    arg_3 = arg_0.copy()

    arg_4 = DefaultOrderedDict(DicomFileSet)

    while len(arg_3) > 0:
        arg_5 = arg_3.pop()
        arg_6 = [arg_5]

        arg_2.set_dicom_file1(arg_5)
        arg_7 = len(arg_3)-1
        while arg_7 >= 0:
            arg_8 = arg_3[arg_7]
            arg_2.set_dicom_file2(arg_8)

            if arg_2.transform():
                arg_6.append(arg_8)
                arg_3.pop(arg_7)

            arg_7 -= 1
        arg_4[arg_5].from_set(arg_6, check_if_dicoms=False)

    return arg_4

Gets a list of DICOM file absolute paths and returns a list of lists of DICOM file paths . Each group contains a set of DICOM files that have exactly the same headers .


(svg_file_path, pdf_file_path, dpi=150, command_binpath=None, support_unicode=False)

return inkscape_export(svg_file_path, pdf_file_path, export_flag="-A",
                           dpi=dpi, inkscape_binpath=command_binpath)

def Func(arg_0, arg_1, arg_2=150, arg_3=None, arg_4=False):
    """ Transform SVG file to PDF file
    """

    if arg_4:
        return rsvg_export(arg_0, arg_1, arg_2=arg_2, rsvg_binpath=arg_3)

    return inkscape_export(arg_0, arg_1, export_flag="-A",
                           arg_2=arg_2, inkscape_binpath=arg_3)


(self, filename, grp_wise=False, reorder='as-is', notes=None)

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = 'as-is' , arg_4 = None ) : arg_5 = arg_0 . probability . sum ( axis = APM . Axis . READ ) if arg_2 : arg_6 = arg_0 . probability . gname arg_5 = arg_5 * arg_0 . grp_conv_mat else : arg_6 = arg_0 . probability . lname arg_7 = arg_5 . sum ( axis = 0 ) if arg_3 == 'decreasing' : arg_8 = np . argsort ( arg_7 . flatten ( ) ) arg_8 = arg_8 [ : : - 1 ] elif arg_3 == 'increasing' : arg_8 = np . argsort ( arg_7 . flatten ( ) ) elif arg_3 == 'as-is' : arg_8 = np . arange ( len ( arg_6 ) ) arg_9 = np . vstack ( ( arg_5 , arg_7 ) ) arg_10 = open ( arg_1 , 'w' ) arg_10 . write ( "locus\t" + "\t" . join ( arg_0 . probability . hname ) + "\ttotal" ) if arg_4 is not None : arg_10 . write ( "\tnotes" ) arg_10 . write ( "\n" ) for arg_11 in arg_8 : arg_12 = arg_6 [ arg_11 ] arg_10 . write ( "\t" . join ( [ arg_12 ] + map ( str , arg_9 [ : , arg_11 ] . ravel ( ) ) ) ) if arg_4 is not None : arg_10 . write ( "\t%s" % arg_4 [ arg_12 ] ) arg_10 . write ( "\n" ) arg_10 . close ( )

def Func(arg_0, arg_1, arg_2=False, arg_3='as-is', arg_4=None):
        """
        Exports expected read counts

        :param filename: File name for output
        :param grp_wise: whether the report is at isoform level or gene level
        :param reorder: whether the report should be either 'decreasing' or 'increasing' order or just 'as-is'
        :return: Nothing but the method writes a file
        """
        arg_5 = arg_0.probability.sum(axis=APM.Axis.READ)
        if arg_2:
            arg_6 = arg_0.probability.gname
            arg_5 = arg_5 * arg_0.grp_conv_mat
        else:
            arg_6 = arg_0.probability.lname
        arg_7 = arg_5.sum(axis=0)
        if arg_3 == 'decreasing':
            arg_8 = np.argsort(arg_7.flatten())
            arg_8 = arg_8[::-1]
        elif arg_3 == 'increasing':
            arg_8 = np.argsort(arg_7.flatten())
        elif arg_3 == 'as-is':
            arg_8 = np.arange(len(arg_6))  # report in the original locus order
        arg_9 = np.vstack((arg_5, arg_7))
        arg_10 = open(arg_1, 'w')
        arg_10.write("locus\t" + "\t".join(arg_0.probability.hname) + "\ttotal")
        if arg_4 is not None:
            arg_10.write("\tnotes")
        arg_10.write("\n")
        for arg_11 in arg_8:
            arg_12 = arg_6[arg_11]
            arg_10.write("\t".join([arg_12] + map(str, arg_9[:, arg_11].ravel())))
            if arg_4 is not None:
                arg_10.write("\t%s" % arg_4[arg_12])
            arg_10.write("\n")
        arg_10.close()


def Func(arg_0):
  """Creates an iterator that returns ModelInfo elements for the given modelIDs

  WARNING:      The order of ModelInfo elements returned by the iterator
                may not match the order of the given modelIDs

  Parameters:
  ----------------------------------------------------------------------
  modelIDs:       A sequence of model identifiers (e.g., as returned by
                  _HyperSearchJob.queryModelIDs()).
  retval:         Iterator that returns ModelInfo elements for the given
                  modelIDs (NOTE:possibly in a different order)
  """

  class ModelInfoIterator(object):
    """ModelInfo iterator implementation class
    """

    # Maximum number of ModelInfo elements to load into cache whenever
    # cache empties
    arg_1 = 1000

    arg_2=False

    def __init__(arg_3, arg_0):
      """
      Parameters:
      ----------------------------------------------------------------------
      modelIDs:     a sequence of Nupic model identifiers for which this
                    iterator will return _NupicModelInfo instances.
                    NOTE: The returned instances are NOT guaranteed to be in
                    the same order as the IDs in modelIDs sequence.
      retval:       nothing
      """
      # Make our own copy in case caller changes model id list during iteration
      arg_3.__modelIDs = tuple(arg_0)

      if arg_3.debug:
        _emit(Verbosity.DEBUG,
              "MODELITERATOR: __init__; numModelIDs=%s" % len(arg_3.__modelIDs))

      arg_3.__nextIndex = 0
      arg_3.__modelCache = collections.deque()
      return

    def __iter__(arg_3):
      """Iterator Protocol function

      Parameters:
      ----------------------------------------------------------------------
      retval:         self
      """
      return arg_3

    def next(arg_3):
      """Iterator Protocol function

      Parameters:
      ----------------------------------------------------------------------
      retval:       A _NupicModelInfo instance or raises StopIteration to
                    signal end of iteration.
      """
      return arg_3.__getNext()

    def __getNext(arg_3):
      """Implementation of the next() Iterator Protocol function.

      When the modelInfo cache becomes empty, queries Nupic and fills the cache
      with the next set of NupicModelInfo instances.

      Parameters:
      ----------------------------------------------------------------------
      retval:       A _NupicModelInfo instance or raises StopIteration to
                    signal end of iteration.
      """

      if arg_3.debug:
        _emit(Verbosity.DEBUG,
              "MODELITERATOR: __getNext(); modelCacheLen=%s" % (
                  len(arg_3.__modelCache)))

      if not arg_3.__modelCache:
        arg_3.__fillCache()

      if not arg_3.__modelCache:
        raise StopIteration()

      return arg_3.__modelCache.popleft()

    def __fillCache(arg_3):
      """Queries Nupic and fills an empty modelInfo cache with the next set of
      _NupicModelInfo instances

      Parameters:
      ----------------------------------------------------------------------
      retval:       nothing
      """
      assert (not arg_3.__modelCache)

      # Assemble a list of model IDs to look up
      arg_7 = len(arg_3.__modelIDs) if arg_3.__modelIDs else 0

      if arg_3.__nextIndex >= arg_7:
        return

      arg_8 = arg_3.__nextIndex + arg_3.__CACHE_LIMIT
      if arg_8 > arg_7:
        arg_8 = arg_7

      arg_9 = arg_3.__modelIDs[arg_3.__nextIndex:arg_8]

      arg_3.__nextIndex += (arg_8 - arg_3.__nextIndex)

      # Query Nupic for model info of all models in the look-up list
      # NOTE: the order of results may not be the same as lookupIDs
      arg_10 = _clientJobsDB().modelsInfo(arg_9)
      assert len(arg_10) == len(arg_9), \
            "modelsInfo returned %s elements; expected %s." % \
            (len(arg_10), len(arg_9))

      # Create _NupicModelInfo instances and add them to cache
      for arg_11 in arg_10:
        arg_12 = _NupicModelInfo(arg_11=arg_11)
        arg_3.__modelCache.append(arg_12)

      assert len(arg_3.__modelCache) == len(arg_9), \
             "Added %s elements to modelCache; expected %s." % \
             (len(arg_3.__modelCache), len(arg_9))

      if arg_3.debug:
        _emit(Verbosity.DEBUG,
              "MODELITERATOR: Leaving __fillCache(); modelCacheLen=%s" % \
                (len(arg_3.__modelCache),))

  return ModelInfoIterator(arg_0)


An interface for get requests that handles errors more gracefully to
        prevent data loss

def
Func
(
arg_0
,
*
arg_1
,
**
arg_2
)
:
try
:
arg_3
=
arg_0
.
session
.
Func
if
arg_0
.
session
else
requests
.
Func
arg_4
=
arg_3
(
*
arg_1
,
**
arg_2
)
arg_4
.
raise_for_status
(
)
arg_0
.
failed_last
=
False
return
arg_4
except
requests
.
exceptions
.
RequestException
as
e
:
arg_0
.
log_error
(
e
)
for
arg_6
in
range
(
1
,
arg_0
.
num_retries
)
:
arg_7
=
arg_0
.
retry_rate
*
arg_6
arg_0
.
log_function
(
"Retrying in %s seconds"
%
arg_7
)
arg_0
.
_sleep
(
arg_7
)
try
:
arg_4
=
requests
.
Func
(
*
arg_1
,
**
arg_2
)
arg_4
.
raise_for_status
(
)
arg_0
.
log_function
(
"New request successful"
)
return
arg_4
except
requests
.
exceptions
.
RequestException
:
arg_0
.
log_function
(
"New request failed"
)
if
not
arg_0
.
failed_last
:
arg_0
.
failed_last
=
True
raise
ApiError
(
e
)
else
:
raise
FatalApiError
(
e
)

def Func(arg_0, *arg_1, **arg_2):

        """
        An interface for Func requests that handles errors more gracefully to
        prevent data loss
        """

        try:
            arg_3 = arg_0.session.Func if arg_0.session else requests.Func
            arg_4 = arg_3(*arg_1, **arg_2)
            arg_4.raise_for_status()
            arg_0.failed_last = False
            return arg_4

        except requests.exceptions.RequestException as e:
            arg_0.log_error(e)
            for arg_6 in range(1, arg_0.num_retries):
                arg_7 = arg_0.retry_rate * arg_6
                arg_0.log_function("Retrying in %s seconds" % arg_7)
                arg_0._sleep(arg_7)
                try:
                    arg_4 = requests.Func(*arg_1, **arg_2)
                    arg_4.raise_for_status()
                    arg_0.log_function("New request successful")
                    return arg_4
                except requests.exceptions.RequestException:
                    arg_0.log_function("New request failed")

            # Allows for the api to ignore one potentially bad request
            if not arg_0.failed_last:
                arg_0.failed_last = True
                raise ApiError(e)
            else:
                raise FatalApiError(e)


(self, msg_list, content=True, copy=True)

def Func(arg_0, arg_1, arg_2=True, arg_3=True):
        """Unserialize a msg_list to a nested message dict.

        This is roughly the inverse of serialize. The serialize/Func
        methods work with full message lists, whereas pack/unpack work with
        the individual message parts in the message list.

        Parameters:
        -----------
        msg_list : list of bytes or Message objects
            The list of message parts of the form [HMAC,p_header,p_parent,
            p_content,buffer1,buffer2,...].
        content : bool (True)
            Whether to unpack the content dict (True), or leave it packed
            (False).
        copy : bool (True)
            Whether to return the bytes (True), or the non-copying Message
            object in each place (False).

        Returns
        -------
        msg : dict
            The nested message dict with top-level keys [header, parent_header,
            content, buffers].
        """
        arg_4 = 4
        arg_5 = {}
        if not arg_3:
            for arg_6 in range(arg_4):
                arg_1[arg_6] = arg_1[arg_6].bytes
        if arg_0.auth is not None:
            arg_7 = arg_1[0]
            if not arg_7:
                raise ValueError("Unsigned Message")
            if arg_7 in arg_0.digest_history:
                raise ValueError("Duplicate Signature: %r"%arg_7)
            arg_0.digest_history.add(arg_7)
            arg_8 = arg_0.sign(arg_1[1:4])
            if not arg_7 == arg_8:
                raise ValueError("Invalid Signature: %r"%arg_7)
        if not len(arg_1) >= arg_4:
            raise TypeError("malformed message, must have at least %i elements"%arg_4)
        arg_9 = arg_0.unpack(arg_1[1])
        arg_5['header'] = arg_9
        arg_5['msg_id'] = arg_9['msg_id']
        arg_5['msg_type'] = arg_9['msg_type']
        arg_5['parent_header'] = arg_0.unpack(arg_1[2])
        if arg_2:
            arg_5['content'] = arg_0.unpack(arg_1[3])
        else:
            arg_5['content'] = arg_1[3]

        arg_5['buffers'] = arg_1[4:]
        return arg_5

Unserialize a msg_list to a nested message dict.

        This is roughly the inverse of serialize. The serialize/unserialize
        methods work with full message lists, whereas pack/unpack work with
        the individual message parts in the message list.

        Parameters:
        -----------
        msg_list : list of bytes or Message objects
            The list of message parts of the form [HMAC,p_header,p_parent,
            p_content,buffer1,buffer2,...].
        content : bool (True)
            Whether to unpack the content dict (True), or leave it packed
            (False).
        copy : bool (True)
            Whether to return the bytes (True), or the non-copying Message
            object in each place (False).

        Returns
        -------
        msg : dict
            The nested message dict with top-level keys [header, parent_header,
            content, buffers].

Unserialize a msg_list to a nested message dict .


def Func(arg_0,arg_1 = 'fb_exact'):
    """
    CD sled position control case study of Chapter 18.

    The function returns the closed-loop and open-loop
    system function for a CD/DVD sled position control
    system. The loop amplifier gain is the only variable
    that may be changed. The returned system function can
    however be changed.

    Parameters
    ----------
    Ka : loop amplifier gain, start with 50.
    out_type : 'open_loop' for open loop system function
    out_type : 'fb_approx' for closed-loop approximation
    out_type : 'fb_exact' for closed-loop exact

    Returns
    -------
    b : numerator coefficient ndarray
    a : denominator coefficient ndarray

    Notes
    -----
    With the exception of the loop amplifier gain, all
    other parameters are hard-coded from Case Study example.

    Examples
    --------
    >>> b,a = Func(Ka,'fb_approx')
    >>> b,a = Func(Ka,'fb_exact')
    """
    arg_2 = 10/(2*np.pi)
    # Load b and a ndarrays with the coefficients
    if arg_1.lower() == 'open_loop':
        arg_3 = np.array([arg_0*4000*arg_2])
        arg_4 = np.array([1,1275,31250,0])
    elif arg_1.lower() == 'fb_approx':
        arg_3 = np.array([3.2*arg_0*arg_2])
        arg_4 = np.array([1, 25, 3.2*arg_0*arg_2])
    elif arg_1.lower() == 'fb_exact':
        arg_3 = np.array([4000*arg_0*arg_2])
        arg_4 = np.array([1, 1250+25, 25*1250, 4000*arg_0*arg_2])
    else:
        raise ValueError('out_type must be: open_loop, fb_approx, or fc_exact')
    return arg_3, arg_4

CD sled position control case study of Chapter 18.

    The function returns the closed-loop and open-loop
    system function for a CD/DVD sled position control
    system. The loop amplifier gain is the only variable
    that may be changed. The returned system function can
    however be changed.

    Parameters
    ----------
    Ka : loop amplifier gain, start with 50.
    out_type : 'open_loop' for open loop system function
    out_type : 'fb_approx' for closed-loop approximation
    out_type : 'fb_exact' for closed-loop exact

    Returns
    -------
    b : numerator coefficient ndarray
    a : denominator coefficient ndarray

    Notes
    -----
    With the exception of the loop amplifier gain, all
    other parameters are hard-coded from Case Study example.

    Examples
    --------
    >>> b,a = position_CD(Ka,'fb_approx')
    >>> b,a = position_CD(Ka,'fb_exact')

CD sled position control case study of Chapter 18 .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . _get_path ( arg_2 ) if not os . path . exists ( os . path . dirname ( arg_4 ) ) : os . makedirs ( os . path . dirname ( arg_4 ) , arg_0 . permission | 0o111 ) arg_5 = open ( arg_4 , 'wb' ) arg_1 . seek ( 0 ) arg_6 = arg_1 . read ( 1048576 ) while arg_6 : arg_5 . write ( arg_6 ) arg_6 = arg_1 . read ( 1048576 ) arg_5 . close ( ) if arg_0 . filesize_field : setattr ( arg_3 , arg_0 . filesize_field , os . path . getsize ( arg_4 ) ) return arg_2

def Func(arg_0, arg_1, arg_2, arg_3):
        """Saves the specified file to the local file system."""

        arg_4 = arg_0._get_path(arg_2)
        if not os.path.exists(os.path.dirname(arg_4)):
            os.makedirs(os.path.dirname(arg_4), arg_0.permission | 0o111)

        arg_5 = open(arg_4, 'wb')

        # Thanks to:
        # http://stackoverflow.com/a/3253276/2066849
        arg_1.seek(0)
        arg_6 = arg_1.read(1048576)
        while arg_6:
            arg_5.write(arg_6)
            arg_6 = arg_1.read(1048576)

        arg_5.close()

        if arg_0.filesize_field:
            setattr(arg_3, arg_0.filesize_field, os.path.getsize(arg_4))

        return arg_2

Saves the specified file to the local file system .


return self.__try_handlers(self._presence_handlers, stanza, stanza_type)

def Func(arg_0, arg_1):
        """Process presence stanza.

        Pass it to a handler of the stanza's type and payload namespace.

        :Parameters:
            - `stanza`: presence stanza to be handled
        """

        arg_2 = arg_1.stanza_type
        return arg_0.__try_handlers(arg_0._presence_handlers, arg_1, arg_2)


def Func(arg_0, arg_1):
  """Helper to broadcast a tensor using a list of target tensors."""
  arg_2 = arg_0
  for arg_3 in arg_1:
    arg_2 += tf.zeros_like(arg_3)
  return arg_2

Helper to broadcast a tensor using a list of target tensors .


def Func(arg_0):
    r"""
    Convert number to string guaranteeing result is not in scientific notation.

    :param number: Number to convert
    :type  number: integer or float

    :rtype: string

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for peng.functions.Func

    :raises: RuntimeError (Argument \`number\` is not valid)

    .. [[[end]]]
    """
    arg_1, arg_2 = to_scientific_tuple(arg_0)
    if not arg_2:
        return str(arg_0)
    arg_3 = "." in arg_1
    arg_1 = arg_1.replace(".", "")
    if arg_2 < 0:
        return "0." + "0" * (-arg_2 - 1) + arg_1
    if not arg_3:
        return arg_1 + "0" * arg_2 + (".0" if isinstance(arg_0, float) else "")
    arg_4 = len(arg_1) - 1
    if arg_4 < arg_2:
        return (arg_1 + "0" * (arg_2 - arg_4)).rstrip(".")
    return arg_1

r"""
    Convert number to string guaranteeing result is not in scientific notation.

    :param number: Number to convert
    :type  number: integer or float

    :rtype: string

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for peng.functions.no_exp

    :raises: RuntimeError (Argument \`number\` is not valid)

    .. [[[end]]]

r Convert number to string guaranteeing result is not in scientific notation .


def Func ( arg_0 ) : arg_1 = arg_0 try : arg_1 = re . search ( ".*NODE_([0-9]*)_.*" , arg_0 ) . group ( 1 ) except AttributeError : pass try : arg_1 = re . search ( ".*Contig_([0-9]*)_.*" , arg_0 ) . group ( 1 ) except AttributeError : pass return arg_1

def Func(arg_0):
        """Tries to retrieve contig id. Returns the original string if it
        is unable to retrieve the id.

        Parameters
        ----------
        contig_str : str
            Full contig string (fasta header)

        Returns
        -------
        str
            Contig id
        """

        arg_1 = arg_0

        try:
            arg_1 = re.search(".*NODE_([0-9]*)_.*", arg_0).group(1)
        except AttributeError:
            pass

        try:
            arg_1 = re.search(".*Contig_([0-9]*)_.*", arg_0).group(1)
        except AttributeError:
            pass

        return arg_1

Tries to retrieve contig id . Returns the original string if it is unable to retrieve the id .


(job, mode, vcf_id, ref_fasta, ref_fai, ref_dict)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """
    Isolates a particular variant type from a VCF file using GATK SelectVariants

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str mode: variant type (i.e. SNP or INDEL)
    :param str vcf_id: FileStoreID for input VCF file
    :param str ref_fasta: FileStoreID for reference genome fasta
    :param str ref_fai: FileStoreID for reference genome index file
    :param str ref_dict: FileStoreID for reference genome sequence dictionary file
    :return: FileStoreID for filtered VCF
    :rtype: str
    """
    arg_0.fileStore.logToMaster('Running GATK SelectVariants to select %ss' % arg_1)

    arg_6 = {'genome.fa': arg_3,
              'genome.fa.fai': arg_4,
              'genome.dict': arg_5,
              'input.vcf': arg_2}

    arg_7 = arg_0.fileStore.getLocalTempDir()
    for arg_8, arg_9 in arg_6.iteritems():
        arg_0.fileStore.readGlobalFile(arg_9, os.path.join(arg_7, arg_8))

    arg_10 = ['-T', 'SelectVariants',
               '-R', 'genome.fa',
               '-V', 'input.vcf',
               '-o', 'output.vcf',
               '-selectType', arg_1]

    arg_11 = ['--rm', 'log-driver', 'none',
                         '-e', 'JAVA_OPTS=-Djava.io.tmpdir=/data/ -Xmx{}'.format(arg_0.memory)]
    dockerCall(arg_0=arg_0, workDir=arg_7,
               parameters=arg_10,
               tool='quay.io/ucsc_cgl/gatk:3.5--dba6dae49156168a909c43330350c6161dc7ecc2',
               dockerParameters=arg_11)

    return arg_0.fileStore.writeGlobalFile(os.path.join(arg_7, 'output.vcf'))


return self.waitFor(timeout, 'AXValueChanged', callback=callback,
                            args=(retelem,))

def Func ( arg_0 , arg_1 = 10 ) : arg_2 = AXCallbacks . returnElemCallback arg_3 = None return arg_0 . waitFor ( arg_1 , 'AXValueChanged' , arg_2 = arg_2 , args = ( arg_3 , ) )

def Func(arg_0, arg_1=10):
        """Convenience method to wait for value attribute of given element to
        change.

        Some types of elements (e.g. menu items) have their titles change,
        so this will not work for those.  This seems to work best if you set
        the notification at the application level.

        Returns: Element or None
        """
        # Want to identify that the element whose value changes matches this
        # object's.  Unique identifiers considered include role and position
        # This seems to work best if you set the notification at the application
        # level
        arg_2 = AXCallbacks.returnElemCallback
        arg_3 = None
        return arg_0.waitFor(arg_1, 'AXValueChanged', arg_2=arg_2,
                            args=(arg_3,))

Convenience method to wait for value attribute of given element to change .


def Func ( ** arg_0 ) : try : arg_1 = _pybossa_req ( 'get' , 'project' , params = arg_0 ) if type ( arg_1 ) . __name__ == 'list' : return [ Project ( arg_2 ) for arg_2 in arg_1 ] else : return arg_1 except : raise

def Func(**arg_0):
    """Return a list with matching project arguments.

    :param kwargs: PYBOSSA Project members
    :rtype: list
    :returns: A list of projects that match the kwargs

    """
    try:
        arg_1 = _pybossa_req('get', 'project', params=arg_0)
        if type(arg_1).__name__ == 'list':
            return [Project(arg_2) for arg_2 in arg_1]
        else:
            return arg_1
    except:  # pragma: no cover
        raise

Return a list with matching project arguments .


return self.request(path, method, call_params)

def Func ( arg_0 , arg_1 ) : arg_2 = '/' + arg_0 . api_version + '/ConferenceMute/' arg_3 = 'POST' return arg_0 . request ( arg_2 , arg_3 , arg_1 )

def Func(arg_0, arg_1):
        """REST Conference Mute helper
        """
        arg_2 = '/' + arg_0.api_version + '/ConferenceMute/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


return (keyspace in cluster_metadata.keyspaces and
                table in cluster_metadata.keyspaces[keyspace].tables)

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . keyspace if '.' in arg_1 : arg_2 , arg_1 = arg_1 . split ( '.' , 1 ) arg_3 = arg_0 . get_conn ( ) . cluster . metadata return ( arg_2 in arg_3 . keyspaces and arg_1 in arg_3 . keyspaces [ arg_2 ] . tables )

def Func(arg_0, arg_1):
        """
        Checks if a table exists in Cassandra

        :param table: Target Cassandra table.
                      Use dot notation to target a specific keyspace.
        :type table: str
        """
        arg_2 = arg_0.keyspace
        if '.' in arg_1:
            arg_2, arg_1 = arg_1.split('.', 1)
        arg_3 = arg_0.get_conn().cluster.metadata
        return (arg_2 in arg_3.keyspaces and
                arg_1 in arg_3.keyspaces[arg_2].tables)


def
Func
(
arg_0
)
:
with
arg_0
.
_db_conn
(
)
as
conn
:
for
arg_1
in
arg_0
.
_tables
:
conn
.
execute
(
'DROP TABLE IF EXISTS %s'
%
arg_1
)
return
arg_0

def Func(arg_0):
        """ Destroy the SQLStepQueue tables in the database """
        with arg_0._db_conn() as conn:
            for arg_1 in arg_0._tables:
                conn.execute('DROP TABLE IF EXISTS %s' % arg_1)
        return arg_0


def
Func
(
arg_0
)
:
arg_1
=
{
"_what"
:
"OBJECT"
,
"_schema_id"
:
{
"_class_name"
:
"queue"
}
}
logger
.
debug
(
"Message content -> {0}"
.
format
(
arg_1
)
)
return
arg_1
,
arg_0
.
query_properties

def Func(arg_0):
        """Create message content and properties to list all queues with QMFv2

        :returns: Tuple containing content and query properties
        """
        arg_1 = {"_what": "OBJECT",
                   "_schema_id": {"_class_name": "queue"}}
        logger.debug("Message content -> {0}".format(arg_1))

        return arg_1, arg_0.query_properties


def
Func
(
arg_0
)
:
arg_1
=
os
.
path
.
join
(
arg_0
.
temp_path
,
GDOCS_TRANS_CSV
)
arg_2
=
os
.
path
.
join
(
arg_0
.
temp_path
,
GDOCS_META_CSV
)
arg_3
=
os
.
path
.
join
(
arg_0
.
temp_path
,
LOCAL_TRANS_CSV
)
arg_4
=
os
.
path
.
join
(
arg_0
.
temp_path
,
LOCAL_META_CSV
)
try
:
arg_5
=
arg_0
.
_download_csv_from_gdocs
(
arg_1
,
arg_2
)
except
PODocsError
as
e
:
if
'Sheet 1 not found'
in
str
(
e
)
or
'Conversion failed unexpectedly'
in
str
(
e
)
:
arg_0
.
upload
(
)
else
:
raise
PODocsError
(
e
)
else
:
arg_0
.
_merge_local_and_gdoc
(
arg_5
,
arg_3
,
arg_4
,
arg_1
,
arg_2
)
try
:
csv_to_po
(
arg_3
,
arg_4
,
arg_0
.
locale_root
,
arg_0
.
po_files_path
,
arg_0
.
header
)
except
IOError
as
e
:
raise
PODocsError
(
e
)
arg_0
.
_clear_temp
(
)

def Func(arg_0):
        """
        Synchronize local po files with translations on GDocs Spreadsheet.
        Downloads two csv files, merges them and converts into po files
        structure. If new msgids appeared in po files, this method creates
        new ods with appended content and sends it to GDocs.
        """
        arg_1 = os.path.join(arg_0.temp_path, GDOCS_TRANS_CSV)
        arg_2 = os.path.join(arg_0.temp_path, GDOCS_META_CSV)
        arg_3 = os.path.join(arg_0.temp_path, LOCAL_TRANS_CSV)
        arg_4 = os.path.join(arg_0.temp_path, LOCAL_META_CSV)

        try:
            arg_5 = arg_0._download_csv_from_gdocs(arg_1,
                                                  arg_2)
        except PODocsError as e:
            if 'Sheet 1 not found' in str(e) \
                    or 'Conversion failed unexpectedly' in str(e):
                arg_0.upload()
            else:
                raise PODocsError(e)
        else:
            arg_0._merge_local_and_gdoc(arg_5, arg_3, arg_4,
                                       arg_1, arg_2)

            try:
                csv_to_po(arg_3, arg_4,
                          arg_0.locale_root, arg_0.po_files_path, arg_0.header)
            except IOError as e:
                raise PODocsError(e)

        arg_0._clear_temp()

Synchronize local po files with translations on GDocs Spreadsheet . Downloads two csv files merges them and converts into po files structure . If new msgids appeared in po files this method creates new ods with appended content and sends it to GDocs .


def Func ( arg_0 ) : arg_1 = logging . FileHandler ( arg_0 . path , delay = True ) if arg_0 . _format : arg_1 . setFormatter ( logging . Formatter ( arg_0 . _format ) ) if type ( arg_0 . _formatter ) == str : if arg_0 . _env and arg_0 . _env . config . logging . dict_config . formatters [ arg_0 . _formatter ] : arg_2 = arg_0 . _env . config . logging . dict_config . formatters [ arg_0 . _formatter ] . to_dict ( ) arg_1 . setFormatter ( logging . Formatter ( ** arg_2 ) ) elif type ( arg_0 . _formatter ) == dict : arg_1 . setFormatter ( logging . Formatter ( ** arg_0 . _formatter ) ) if len ( arg_0 . _loggers ) : for arg_3 in arg_0 . _loggers : logging . getLogger ( arg_3 ) . addHandler ( arg_1 ) else : logging . getLogger ( ) . addHandler ( arg_1 )

def Func(arg_0):
        """
        Configure the Python logging module for this file.
        """
        # build a file handler for this file
        arg_1 = logging.FileHandler(arg_0.path, delay=True)

        # if we got a format string, create a formatter with it
        if arg_0._format:
            arg_1.setFormatter(logging.Formatter(arg_0._format))

        # if we got a string for the formatter, assume it's the name of a
        # formatter in the environment's config
        if type(arg_0._formatter) == str:
            if arg_0._env and arg_0._env.config.logging.dict_config.formatters[arg_0._formatter]:
                arg_2 = arg_0._env.config.logging.dict_config.formatters[arg_0._formatter].to_dict()
                arg_1.setFormatter(logging.Formatter(**arg_2))
        elif type(arg_0._formatter) == dict:
            # if it's a dict it must be the actual formatter params
            arg_1.setFormatter(logging.Formatter(**arg_0._formatter))

        # add the file handler to whatever loggers were specified
        if len(arg_0._loggers):
            for arg_3 in arg_0._loggers:
                logging.getLogger(arg_3).addHandler(arg_1)
        else:
            # none specified, just add it to the root logger
            logging.getLogger().addHandler(arg_1)

Configure the Python logging module for this file .


def Func ( arg_0 ) : if not arg_0 . show_y_labels : return arg_1 = arg_0 . get_y_labels ( ) arg_2 = len ( arg_1 ) arg_1 = enumerate ( iter ( arg_1 ) ) arg_3 = int ( not arg_0 . step_include_first_y_label ) arg_1 = itertools . islice ( arg_1 , arg_3 , None , arg_0 . step_y_labels ) list ( map ( arg_0 . draw_y_label , arg_1 ) ) arg_0 . draw_y_guidelines ( arg_0 . field_height ( ) , arg_2 )

def Func(arg_0):
		"Draw the Y axis labels"
		if not arg_0.show_y_labels:
			# do nothing
			return

		arg_1 = arg_0.get_y_labels()
		arg_2 = len(arg_1)

		arg_1 = enumerate(iter(arg_1))
		arg_3 = int(not arg_0.step_include_first_y_label)
		arg_1 = itertools.islice(arg_1, arg_3, None, arg_0.step_y_labels)
		list(map(arg_0.draw_y_label, arg_1))
		arg_0.draw_y_guidelines(arg_0.field_height(), arg_2)


return True if a == 0xF3 and b == 0x42 and c == 0x00 else False

def Func(arg_0, arg_1):
        """Set only the Fan power.

        :param power: Fan power value as an integer between 0-255.

        :type power: int

        :rtype: boolean

        :Example:

        >>> alpha.Func(255)
        True
        """
        # Check to make sure the value is a single byte
        if arg_1 > 255:
            raise ValueError("The fan power should be a single byte (0-255).")

        # Send the command byte and wait 10 ms
        arg_2 = arg_0.cnxn.xfer([0x42])[0]
        sleep(10e-3)

        # Send the next two bytes
        arg_3 = arg_0.cnxn.xfer([0x00])[0]
        arg_4 = arg_0.cnxn.xfer([arg_1])[0]

        sleep(0.1)

        return True if arg_2 == 0xF3 and arg_3 == 0x42 and arg_4 == 0x00 else False

Set only the Fan power.

        :param power: Fan power value as an integer between 0-255.

        :type power: int

        :rtype: boolean

        :Example:

        >>> alpha.set_fan_power(255)
        True


(self, filename, patch_name=None, ignore=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
False
)
:
arg_4
=
File
(
arg_1
)
if
arg_2
:
arg_5
=
Patch
(
arg_2
)
else
:
arg_5
=
arg_0
.
db
.
top_patch
(
)
if
not
arg_5
:
raise
NoAppliedPatch
(
arg_0
.
db
)
arg_6
=
arg_0
.
_file_in_patch
(
arg_1
,
arg_5
,
arg_3
)
if
arg_6
:
return
arg_0
.
_file_in_next_patches
(
arg_1
,
arg_5
)
if
arg_4
.
is_link
(
)
:
raise
QuiltError
(
"Cannot add symbolic link %s"
%
arg_1
)
arg_0
.
_backup_file
(
arg_4
,
arg_5
)
if
arg_4
.
exists
(
)
:
os
.
chmod
(
arg_1
,
arg_4
.
get_mode
(
)
|
stat
.
S_IWUSR
|
stat
.
S_IRUSR
)
arg_0
.
file_added
(
arg_4
,
arg_5
)

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
        """ Add file to the patch with patch_name.
        If patch_name is None or empty the topmost patch will be used.
        Adding an already added patch will raise an QuiltError if ignore is
        False.
        """
        arg_4 = File(arg_1)

        if arg_2:
            arg_5 = Patch(arg_2)
        else:
            arg_5 = arg_0.db.top_patch()
            if not arg_5:
                raise NoAppliedPatch(arg_0.db)

        arg_6 = arg_0._file_in_patch(arg_1, arg_5, arg_3)
        if arg_6:
            return

        arg_0._file_in_next_patches(arg_1, arg_5)

        if arg_4.is_link():
            raise QuiltError("Cannot add symbolic link %s" % arg_1)

        arg_0._backup_file(arg_4, arg_5)

        if arg_4.exists():
            # be sure user can write original file
            os.chmod(arg_1, arg_4.get_mode() | stat.S_IWUSR | stat.S_IRUSR)

        arg_0.file_added(arg_4, arg_5)

Add file to the patch with patch_name . If patch_name is None or empty the topmost patch will be used . Adding an already added patch will raise an QuiltError if ignore is False .


def Func ( arg_0 , arg_1 ) : from gtfspy . import_gtfs import import_gtfs arg_2 = sqlite3 . connect ( ":memory:" ) import_gtfs ( arg_1 , arg_2 , preserve_connection = True , print_progress = False ) return arg_0 ( arg_2 )

def Func(arg_0, arg_1):
        """
        Instantiate a GTFS object by computing

        Parameters
        ----------
        gtfs_directory: str
            path to the directory for importing the database
        """
        # this import is here to avoid circular imports (which turned out to be a problem)
        from gtfspy.import_gtfs import import_gtfs
        arg_2 = sqlite3.connect(":memory:")
        import_gtfs(arg_1,
                    arg_2,
                    preserve_connection=True,
                    print_progress=False)
        return arg_0(arg_2)


def Func ( arg_0 ) : arg_0 . _dict = { v . id : k for k , v in enumerate ( arg_0 ) }

def Func(arg_0):
        """rebuild the _dict index"""
        arg_0._dict = {v.id: k for k, v in enumerate(arg_0)}


def Func(arg_0, arg_1, arg_2):

        """ Inserts a point on the path at the mouse location.

        We first need to check if the mouse location is on the path.
        Inserting point is time intensive and experimental.

        """

        try:
            arg_3 = _ctx.ximport("bezier")
        except:
            from nodebox.graphics import arg_3

        # Do a number of checks distributed along the path.
        # Keep the one closest to the actual mouse location.
        # Ten checks works fast but leads to imprecision in sharp corners
        # and curves closely located next to each other.
        # I prefer the slower but more stable approach.
        arg_4 = 100
        arg_5 = None
        arg_6 = float("inf")
        arg_7 = float("inf")
        for arg_8 in range(arg_4):
            arg_9 = float(arg_8)/arg_4
            arg_10 = arg_0.path.point(arg_9)
            arg_11 = abs(arg_10.x-arg_1)
            arg_12 = abs(arg_10.y-arg_2)
            if arg_11+arg_12 <= arg_6+arg_7:
                arg_6 = arg_11
                arg_7 = arg_12
                arg_5 = arg_9

        # Next, scan the area around the approximation.
        # If the closest point is located at 0.2 on the path,
        # we need to scan between 0.1 and 0.3 for a better
        # approximation. If 1.5 was the best guess, scan
        # 1.40, 1.41 ... 1.59 and so on.
        # Each decimal precision takes 20 iterations.
        arg_13 = [3,4]
        for arg_14 in arg_13:
            arg_14 = 1.0/pow(10,arg_14)

            for arg_8 in range(20):
                arg_9 = arg_5-arg_14 + float(arg_8)*arg_14*0.1
                if arg_9 < 0.0: arg_9 = 1.0+arg_9
                if arg_9 > 1.0: arg_9 = arg_9-1.0
                arg_10 = arg_0.path.point(arg_9)
                arg_11 = abs(arg_10.x-arg_1)
                arg_12 = abs(arg_10.y-arg_2)
                if arg_11 <= arg_6 and arg_12 <= arg_7:
                    arg_6 = arg_11
                    arg_7 = arg_12
                    arg_15 = arg_9

            arg_5 = arg_15

        # Update the points list with the inserted point.
        arg_16 = arg_3.Func(arg_0.path, arg_15)
        arg_8, arg_9, arg_10 = arg_3._locate(arg_0.path, arg_15)
        arg_8 += 1
        arg_10 = PathElement()
        arg_10.cmd = arg_16[arg_8].cmd
        arg_10.x = arg_16[arg_8].x
        arg_10.y = arg_16[arg_8].y
        arg_10.ctrl1 = Point(arg_16[arg_8].ctrl1.x, arg_16[arg_8].ctrl1.y)
        arg_10.ctrl2 = Point(arg_16[arg_8].ctrl2.x, arg_16[arg_8].ctrl2.y)
        arg_10.freehand = False
        arg_0._points.insert(arg_8, arg_10)
        arg_0._points[arg_8-1].ctrl1 = Point(arg_16[arg_8-1].ctrl1.x, arg_16[arg_8-1].ctrl1.y)
        arg_0._points[arg_8+1].ctrl1 = Point(arg_16[arg_8+1].ctrl1.x, arg_16[arg_8+1].ctrl1.y)
        arg_0._points[arg_8+1].ctrl2 = Point(arg_16[arg_8+1].ctrl2.x, arg_16[arg_8+1].ctrl2.y)

Inserts a point on the path at the mouse location . We first need to check if the mouse location is on the path . Inserting point is time intensive and experimental .


def Func(arg_0, arg_1):  # pylint: disable=arguments-differ
        """
        Validate that at least one of the user identifier fields has been passed in.
        """
        arg_2 = arg_1.get('lms_user_id')
        arg_3 = arg_1.get('tpa_user_id')
        arg_4 = arg_1.get('user_email')
        if not arg_2 and not arg_3 and not arg_4:
            raise serializers.ValidationError(
                'At least one of the following fields must be specified and map to an EnterpriseCustomerUser: '
                'lms_user_id, tpa_user_id, user_email'
            )

        return arg_1

Validate that at least one of the user identifier fields has been passed in .


def Func ( arg_0 , arg_1 ) : arg_2 = { 'isc' : TIMESCALE__ISC , 'usgs_isc' : TIMESCALE__USGS_ISC , 'dnag' : TIMESCALE__DNAG , } return arg_0 . from_csv ( text = arg_2 [ arg_1 . lower ( ) ] )

def Func(arg_0, arg_1):
        """
        Generate a default timescale legend. No arguments.

        Returns:
            Legend: The timescale stored in `defaults.py`.
        """
        arg_2 = {
                 'isc': TIMESCALE__ISC,
                 'usgs_isc': TIMESCALE__USGS_ISC,
                 'dnag': TIMESCALE__DNAG,
                 }
        return arg_0.from_csv(text=arg_2[arg_1.lower()])

Generate a default timescale legend . No arguments .


(self, key, func=None, split_val=None, as_boolean=False,
		exception_default=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = False , arg_5 = None ) : try : if arg_4 : return arg_0 . config . getboolean ( arg_1 [ 0 ] , arg_1 [ 1 ] ) arg_6 = arg_0 . config . get ( arg_1 [ 0 ] , arg_1 [ 1 ] ) if arg_3 is not None : arg_6 = arg_6 . split ( arg_3 ) if arg_2 is not None : return arg_2 ( arg_6 ) return arg_6 except ( KeyError , configparser . NoSectionError , configparser . NoOptionError ) as e : if arg_5 is not None : return arg_5 raise KeyError ( e )

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=False,
		arg_5=None):
		"""
		Helper method to get a value from the config
		"""
		try:
			if arg_4:
				return arg_0.config.getboolean(arg_1[0], arg_1[1])
			arg_6 = arg_0.config.get(arg_1[0], arg_1[1])
			if arg_3 is not None:
				arg_6 = arg_6.split(arg_3)
			if arg_2 is not None:
				return arg_2(arg_6)
			return arg_6
		except (KeyError, configparser.NoSectionError, configparser.NoOptionError) as e:
			if arg_5 is not None:
				return arg_5
			raise KeyError(e)


def
Func
(
arg_0
,
arg_1
=
"00000000"
)
:
arg_2
=
False
arg_0
.
setContext
(
"Func"
)
try
:
arg_0
.
clearCmdMsg
(
)
if
len
(
arg_1
)
!=
8
:
arg_0
.
writeCmdMsg
(
"Invalid password length."
)
arg_0
.
setContext
(
""
)
return
arg_2
if
not
arg_0
.
request
(
)
:
arg_0
.
writeCmdMsg
(
"Bad read CRC on setting"
)
else
:
if
not
arg_0
.
serialCmdPwdAuth
(
arg_1
)
:
arg_0
.
writeCmdMsg
(
"Password failure"
)
else
:
arg_3
=
""
arg_4
=
40
len
(
arg_0
.
m_lcd_items
)
for
arg_5
in
arg_0
.
m_lcd_items
:
arg_6
=
binascii
.
hexlify
(
str
(
arg_5
)
.
zfill
(
2
)
)
arg_3
+=
arg_6
for
arg_7
in
range
(
0
,
arg_4
)
:
arg_6
=
binascii
.
hexlify
(
str
(
0
)
.
zfill
(
2
)
)
arg_3
+=
arg_6
arg_8
=
"015731023030443228"
+
arg_3
+
"2903"
arg_8
+=
arg_0
.
calc_crc16
(
arg_8
[
2
:
]
.
decode
(
"hex"
)
)
arg_0
.
m_serial_port
.
write
(
arg_8
.
decode
(
"hex"
)
)
if
arg_0
.
m_serial_port
.
getResponse
(
arg_0
.
getContext
(
)
)
.
encode
(
"hex"
)
==
"06"
:
arg_0
.
writeCmdMsg
(
"Success: 06 returned."
)
arg_2
=
True
arg_0
.
serialPostEnd
(
)
except
:
ekm_log
(
traceback
.
format_exc
(
sys
.
exc_info
(
)
)
)
arg_0
.
setContext
(
""
)
return
arg_2

def Func(arg_0, arg_1="00000000"):
        """ Serial call to set LCD using meter object bufer.

        Used with :func:`~ekmmeters.V4Meter.addLcdItem`.

        Args:
            password (str): Optional password

        Returns:
            bool: True on completion and ACK.
        """
        arg_2 = False
        arg_0.setContext("Func")
        try:
            arg_0.clearCmdMsg()

            if len(arg_1) != 8:
                arg_0.writeCmdMsg("Invalid password length.")
                arg_0.setContext("")
                return arg_2

            if not arg_0.request():
                arg_0.writeCmdMsg("Bad read CRC on setting")
            else:
                if not arg_0.serialCmdPwdAuth(arg_1):
                    arg_0.writeCmdMsg("Password failure")
                else:
                    arg_3 = ""

                    arg_4 = 40 - len(arg_0.m_lcd_items)

                    for arg_5 in arg_0.m_lcd_items:
                        arg_6 = binascii.hexlify(str(arg_5).zfill(2))
                        arg_3 += arg_6

                    for arg_7 in range(0, arg_4):
                        arg_6 = binascii.hexlify(str(0).zfill(2))
                        arg_3 += arg_6

                    arg_8 = "015731023030443228" + arg_3 + "2903"
                    arg_8 += arg_0.calc_crc16(arg_8[2:].decode("hex"))
                    arg_0.m_serial_port.write(arg_8.decode("hex"))
                    if arg_0.m_serial_port.getResponse(arg_0.getContext()).encode("hex") == "06":
                        arg_0.writeCmdMsg("Success: 06 returned.")
                        arg_2 = True
            arg_0.serialPostEnd()
        except:
            ekm_log(traceback.format_exc(sys.exc_info()))

        arg_0.setContext("")
        return arg_2

Serial call to set LCD using meter object bufer .


Creates a overview of the hosts per range.

def
Func
(
)
:
arg_0
=
RangeSearch
(
)
arg_1
=
arg_0
.
get_ranges
(
)
if
arg_1
:
arg_2
=
[
]
arg_3
=
{
}
for
arg_4
in
arg_1
:
arg_2
.
append
(
{
'mask'
:
arg_4
.
range
}
)
arg_3
[
arg_4
.
range
]
=
arg_4
.
tags
arg_6
=
Host
.
search
(
)
arg_6
=
arg_6
.
filter
(
'term'
,
status
=
'up'
)
arg_6
.
aggs
.
bucket
(
'hosts'
,
'ip_range'
,
field
=
'address'
,
arg_1
=
arg_2
)
arg_7
=
arg_6
.
execute
(
)
print_line
(
"{0:<18} {1:<6} {2}"
.
format
(
"Range"
,
"Count"
,
"Tags"
)
)
print_line
(
"-"
*
60
)
for
arg_8
in
arg_7
.
aggregations
.
hosts
.
buckets
:
print_line
(
"{0:<18} {1:<6} {2}"
.
format
(
arg_8
.
key
,
arg_8
.
doc_count
,
arg_3
[
arg_8
.
key
]
)
)
else
:
print_error
(
"No ranges defined."
)

def Func():
    """
        Creates a Func of the hosts per range.
    """
    arg_0 = RangeSearch()
    arg_1 = arg_0.get_ranges()
    if arg_1:
        arg_2 = []
        arg_3 = {}
        for arg_4 in arg_1:
            arg_2.append({'mask': arg_4.range})
            arg_3[arg_4.range] = arg_4.tags
        arg_6 = Host.search()
        arg_6 = arg_6.filter('term', status='up')
        arg_6.aggs.bucket('hosts', 'ip_range', field='address', arg_1=arg_2)
        arg_7 = arg_6.execute()
        print_line("{0:<18} {1:<6} {2}".format("Range", "Count", "Tags"))
        print_line("-" * 60)
        for arg_8 in arg_7.aggregations.hosts.buckets:
            print_line("{0:<18} {1:<6} {2}".format(arg_8.key, arg_8.doc_count, arg_3[arg_8.key]))
    else:
        print_error("No ranges defined.")

Creates a overview of the hosts per range .


def Func(arg_0, arg_1):
    """ get span distance for each locus in original seqarray """
    ## start at 0, finds change at 1-index of map file
    arg_2 = 1
    arg_1 = np.zeros((arg_0[-1, 0], 2), np.uint64)
    ## read through marr and record when locus id changes
    for arg_3 in xrange(1, arg_0.shape[0]):
        arg_4 = arg_0[arg_3, 0]
        if arg_4 != arg_2:
            arg_5 = arg_3 + 1
            arg_1[arg_4-2, 1] = arg_3
            arg_1[arg_4-1, 0] = arg_3
            arg_2 = arg_4
    arg_1[-1, 1] = arg_0[-1, -1]
    return arg_1


def Func ( arg_0 ) : try : arg_1 = arg_0 . get_argument ( constants . PARAM_COMPONENT ) return arg_1 except tornado . web . MissingArgumentError as e : raise Exception ( e . log_message )

def Func(arg_0):
    """
    Helper function to get component argument.
    Raises exception if argument is missing.
    Returns the component argument.
    """
    try:
      arg_1 = arg_0.get_argument(constants.PARAM_COMPONENT)
      return arg_1
    except tornado.web.MissingArgumentError as e:
      raise Exception(e.log_message)

Helper function to get component argument . Raises exception if argument is missing . Returns the component argument .


return datastructures.ContentType(content_type, content_subtype,
                                      dict(parameters),
                                      content_suffix)

def Func ( arg_0 , arg_1 = True ) : arg_2 = _remove_comments ( arg_0 ) . split ( ';' ) arg_0 , arg_3 = arg_2 . pop ( 0 ) . split ( '/' ) if '+' in arg_3 : arg_3 , arg_4 = arg_3 . split ( '+' ) else : arg_4 = None arg_5 = _parse_parameter_list ( arg_2 , arg_1 = arg_1 ) return datastructures . ContentType ( arg_0 , arg_3 , dict ( arg_5 ) , arg_4 )

def Func(arg_0, arg_1=True):
    """Parse a content type like header.

    :param str content_type: the string to parse as a content type
    :param bool normalize_parameter_values:
        setting this to ``False`` will enable strict RFC2045 compliance
        in which content parameter values are case preserving.
    :return: a :class:`~ietfparse.datastructures.ContentType` instance

    """
    arg_2 = _remove_comments(arg_0).split(';')
    arg_0, arg_3 = arg_2.pop(0).split('/')
    if '+' in arg_3:
        arg_3, arg_4 = arg_3.split('+')
    else:
        arg_4 = None
    arg_5 = _parse_parameter_list(
        arg_2, arg_1=arg_1)

    return datastructures.ContentType(arg_0, arg_3,
                                      dict(arg_5),
                                      arg_4)


def Func(arg_0, arg_1):
    """Adds a new source to the computation DAG"""

    arg_2 = None
    if callable(arg_1):
      arg_2 = SupplierStreamlet(arg_1)
    elif isinstance(arg_1, Generator):
      arg_2 = GeneratorStreamlet(arg_1)
    else:
      raise RuntimeError("Builder's new source has to be either a Generator or a function")

    arg_0._sources.append(arg_2)
    return arg_2


def Func(arg_0):
        """make the global evaluation report"""
        # check with at least check 1 statements (usually 0 when there is a
        # syntax error preventing pylint from further processing)
        arg_1 = config.load_results(arg_0.file_state.base_name)
        if arg_0.stats["statement"] == 0:
            return

        # get a global note for the code
        arg_2 = arg_0.config.evaluation
        try:
            arg_3 = eval(arg_2, {}, arg_0.stats)  # pylint: disable=eval-used
        except Exception as ex:
            arg_4 = "An exception occurred while rating: %s" % ex
        else:
            arg_0.stats["global_note"] = arg_3
            arg_4 = "Your code has been rated at %.2f/10" % arg_3
            arg_6 = arg_1.get("global_note")
            if arg_6 is not None:
                arg_4 += " (previous run: %.2f/10, %+.2f)" % (arg_6, arg_3 - arg_6)

        if arg_0.config.score:
            arg_7 = report_nodes.EvaluationSection(arg_4)
            arg_0.reporter.display_reports(arg_7)


(graph, directed=False, reversed=False, stochastic=False, heuristic=None)

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

    """ An edge weight map indexed by node id's.

    A dictionary indexed by node id1's in which each value is a
    dictionary of connected node id2's linking to the edge weight.
    If directed, edges go from id1 to id2, but not the other way.
    If stochastic, all the weights for the neighbors of a given node sum to 1.
    A heuristic can be a function that takes two node id's and returns
    and additional cost for movement between the two nodes.

    """

    arg_5 = {}
    for arg_6 in arg_0.nodes:
        arg_5[arg_6.id] = {}

    for arg_8 in arg_0.edges:

        arg_9 = arg_8.node1.id
        arg_10 = arg_8.node2.id
        if arg_2:
            arg_9, arg_10 = arg_10, arg_9

        #if not v.has_key(id1): v[id1] = {}
        #if not v.has_key(id2): v[id2] = {}
        arg_5[arg_9][arg_10] = 1.0 - arg_8.weight*0.5

        if arg_4:
            arg_5[arg_9][arg_10] += arg_4(arg_9, arg_10)

        if not arg_1:
            arg_5[arg_10][arg_9] = arg_5[arg_9][arg_10]

    if arg_3:
        for arg_9 in arg_5:
            arg_11 = sum(arg_5[arg_9].values())
            for arg_10 in arg_5[arg_9]:
                arg_5[arg_9][arg_10] /= arg_11

    return arg_5

An edge weight map indexed by node id s . A dictionary indexed by node id1 s in which each value is a dictionary of connected node id2 s linking to the edge weight . If directed edges go from id1 to id2 but not the other way . If stochastic all the weights for the neighbors of a given node sum to 1 . A heuristic can be a function that takes two node id s and returns and additional cost for movement between the two nodes .


def
Func
(
arg_0
)
:
if
not
arg_0
:
raise
IncompleteData
(
arg_0
)
if
arg_0
[
0
]
!=
131
:
raise
ValueError
(
"unknown protocol version: %r"
%
arg_0
[
0
]
)
if
arg_0
[
1
:
2
]
==
b'P'
:
if
len
(
arg_0
)
<
16
:
raise
IncompleteData
(
arg_0
)
arg_1
=
decompressobj
(
)
arg_2
=
arg_1
.
decompress
(
arg_0
[
6
:
]
)
+
arg_1
.
flush
(
)
arg_3
,
=
_int4_unpack
(
arg_0
[
2
:
6
]
)
if
len
(
arg_2
)
!=
arg_3
:
raise
ValueError
(
"invalid compressed tag, "
"%d bytes but got %d"
%
(
arg_3
,
len
(
arg_2
)
)
)
arg_4
,
arg_5
=
Func_term
(
arg_2
)
return
arg_4
,
arg_1
.
unused_data
return
Func_term
(
arg_0
[
1
:
]
)

def Func(arg_0):
    """Decode Erlang external term."""
    if not arg_0:
        raise IncompleteData(arg_0)
    if arg_0[0] != 131:
        raise ValueError("unknown protocol version: %r" % arg_0[0])
    if arg_0[1:2] == b'P':
        # compressed term
        if len(arg_0) < 16:
            raise IncompleteData(arg_0)
        arg_1 = decompressobj()
        arg_2 = arg_1.decompress(arg_0[6:]) + arg_1.flush()
        arg_3, = _int4_unpack(arg_0[2:6])
        if len(arg_2) != arg_3:
            raise ValueError(
                "invalid compressed tag, "
                "%d bytes but got %d" % (arg_3, len(arg_2)))
        # tail data returned by Func_term() can be simple ignored
        arg_4, arg_5 = Func_term(arg_2)
        return arg_4, arg_1.unused_data
    return Func_term(arg_0[1:])