(positions, market_data,
                                max_bar_consumption=0.2,
                                capital_base=1e6,
                                mean_volume_window=5)

def Func ( arg_0 , arg_1 , arg_2 = 0.2 , arg_3 = 1e6 , arg_4 = 5 ) : arg_5 = arg_1 [ 'volume' ] * arg_1 [ 'price' ] arg_6 = arg_5 . rolling ( window = arg_4 , center = False ) . mean ( ) . shift ( ) arg_6 = arg_6 . replace ( 0 , np . nan ) arg_7 = pos . get_percent_alloc ( arg_0 ) arg_7 = arg_7 . drop ( 'cash' , axis = 1 ) arg_8 = ( arg_7 * arg_3 ) / ( arg_2 * arg_6 ) return arg_8 . iloc [ arg_4 : ]

def Func(arg_0, arg_1,
                                arg_2=0.2,
                                arg_3=1e6,
                                arg_4=5):
    """
    Compute the number of days that would have been required
    to fully liquidate each position on each day based on the
    trailing n day mean daily bar volume and a limit on the proportion
    of a daily bar that we are allowed to consume.

    This analysis uses portfolio allocations and a provided capital base
    rather than the dollar values in the positions DataFrame to remove the
    effect of compounding on days to liquidate. In other words, this function
    assumes that the net liquidation portfolio value will always remain
    constant at capital_base.

    Parameters
    ----------
    positions: pd.DataFrame
        Contains daily position values including cash
        - See full explanation in tears.create_full_tear_sheet
    market_data : pd.Panel
        Panel with items axis of 'price' and 'volume' DataFrames.
        The major and minor axes should match those of the
        the passed positions DataFrame (same dates and symbols).
    max_bar_consumption : float
        Max proportion of a daily bar that can be consumed in the
        process of liquidating a position.
    capital_base : integer
        Capital base multiplied by portfolio allocation to compute
        position value that needs liquidating.
    mean_volume_window : float
        Trailing window to use in mean volume calculation.

    Returns
    -------
    days_to_liquidate : pd.DataFrame
        Number of days required to fully liquidate daily positions.
        Datetime index, symbols as columns.
    """

    arg_5 = arg_1['volume'] * arg_1['price']
    arg_6 = arg_5.rolling(window=arg_4,
                              center=False).mean().shift()
    arg_6 = arg_6.replace(0, np.nan)

    arg_7 = pos.get_percent_alloc(arg_0)
    arg_7 = arg_7.drop('cash', axis=1)

    arg_8 = (arg_7 * arg_3) / \
        (arg_2 * arg_6)

    return arg_8.iloc[arg_4:]

Compute the number of days that would have been required to fully liquidate each position on each day based on the trailing n day mean daily bar volume and a limit on the proportion of a daily bar that we are allowed to consume .


return ({attr: getattr(si, attr)
                for attr in non_magic_attr})

def Func ( arg_0 , arg_1 : arg_2 ) -> Dict : arg_3 = ( [ arg_4 for arg_4 in dir ( arg_1 ) if not arg_4 . startswith ( '_' ) or arg_4 . __eq__ ( 'e_tag' ) ] ) return ( { arg_4 : getattr ( arg_1 , arg_4 ) for arg_4 in arg_3 } )

def Func(arg_0, arg_1: arg_2) -> Dict:
        """Return the dict of a StoreItem.

        This eliminates non_magic attributes and the e_tag.

        :param si:
        :return dict:
        """
        # read the content
        arg_3 = ([arg_4 for arg_4 in dir(arg_1)
                          if not arg_4.startswith('_') or arg_4.__eq__('e_tag')])
        # loop through attributes and write and return a dict
        return ({arg_4: getattr(arg_1, arg_4)
                for arg_4 in arg_3})


def Func(arg_0, arg_1, arg_2=True):
    """remove genes entirely from the model

    This will also simplify all gene_reaction_rules with this
    gene inactivated."""
    arg_3 = {arg_0.genes.get_by_id(str(i)) for i in arg_1}
    arg_4 = {i.id for i in arg_3}
    arg_5 = _GeneRemover(arg_4)
    arg_6 = get_compiled_gene_reaction_rules(arg_0)
    arg_7 = []
    for arg_8, arg_9 in iteritems(arg_6):
        if arg_8.gene_reaction_rule is None or \
                len(arg_8.gene_reaction_rule) == 0:
            continue
        # reactions to remove
        if arg_2 and not eval_gpr(arg_9, arg_4):
            arg_7.append(arg_8)
        else:
            # if the reaction is not removed, remove the gene
            # from its gpr
            arg_5.visit(arg_9)
            arg_10 = ast2str(arg_9)
            if arg_10 != arg_8.gene_reaction_rule:
                arg_8.gene_reaction_rule = arg_10
    for arg_12 in arg_3:
        arg_0.genes.remove(arg_12)
        # remove reference to the gene in all groups
        arg_13 = arg_0.get_associated_groups(arg_12)
        for arg_14 in arg_13:
            arg_14.remove_members(arg_12)
    arg_0.remove_reactions(arg_7)


def Func ( arg_0 ) : while arg_0 . km . sub_channel . msg_ready ( ) : arg_1 = arg_0 . km . sub_channel . get_msg ( ) arg_2 = arg_1 [ 'header' ] [ 'msg_type' ] arg_3 = arg_1 [ "parent_header" ] if ( not arg_3 ) or arg_0 . session_id == arg_3 [ 'session' ] : if arg_2 == 'status' : if arg_1 [ "content" ] [ "execution_state" ] == "busy" : pass elif arg_2 == 'stream' : if arg_1 [ "content" ] [ "name" ] == "stdout" : print ( arg_1 [ "content" ] [ "data" ] , file = io . stdout , end = "" ) io . stdout . flush ( ) elif arg_1 [ "content" ] [ "name" ] == "stderr" : print ( arg_1 [ "content" ] [ "data" ] , file = io . stderr , end = "" ) io . stderr . flush ( ) elif arg_2 == 'pyout' : arg_0 . execution_count = int ( arg_1 [ "content" ] [ "execution_count" ] ) arg_5 = arg_1 [ "content" ] [ "data" ] arg_6 = arg_0 . displayhook arg_6 . start_displayhook ( ) arg_6 . write_output_prompt ( ) arg_6 . write_format_data ( arg_5 ) arg_6 . log_output ( arg_5 ) arg_6 . finish_displayhook ( )

def Func(arg_0):
        """ Method to procces subscribe channel's messages

           This method reads a message and processes the content in different
           outputs like stdout, stderr, pyout and status

           Arguments:
           sub_msg:  message receive from kernel in the sub socket channel
                     capture by kernel manager.
        """
        while arg_0.km.sub_channel.msg_ready():
            arg_1 = arg_0.km.sub_channel.get_msg()
            arg_2 = arg_1['header']['msg_type']
            arg_3 = arg_1["parent_header"]
            if (not arg_3) or arg_0.session_id == arg_3['session']:
                if arg_2 == 'status' :
                    if arg_1["content"]["execution_state"] == "busy" :
                        pass

                elif arg_2 == 'stream' :
                    if arg_1["content"]["name"] == "stdout":
                        print(arg_1["content"]["data"], file=io.stdout, end="")
                        io.stdout.flush()
                    elif arg_1["content"]["name"] == "stderr" :
                        print(arg_1["content"]["data"], file=io.stderr, end="")
                        io.stderr.flush()

                elif arg_2 == 'pyout':
                    arg_0.execution_count = int(arg_1["content"]["execution_count"])
                    arg_5 = arg_1["content"]["data"]
                    # taken from DisplayHook.__call__:
                    arg_6 = arg_0.displayhook
                    arg_6.start_displayhook()
                    arg_6.write_output_prompt()
                    arg_6.write_format_data(arg_5)
                    arg_6.log_output(arg_5)
                    arg_6.finish_displayhook()

Method to procces subscribe channel s messages


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
get_doc
(
)
arg_2
=
arg_1
(
'table#game_info'
)
arg_3
=
sportsref
.
utils
.
parse_info_table
(
arg_2
)
if
'Won Toss'
in
arg_3
:
pass
else
:
return

def Func(arg_0):
        """Gets information relating to the opening coin toss.

        Keys are:
        * wonToss - contains the ID of the team that won the toss
        * deferred - bool whether the team that won the toss deferred it

        :returns: Dictionary of coin toss-related info.
        """
        arg_1 = arg_0.get_doc()
        arg_2 = arg_1('table#game_info')
        arg_3 = sportsref.utils.parse_info_table(arg_2)
        if 'Won Toss' in arg_3:
            # TODO: finish coinToss function
            pass
        else:
            return None

Gets information relating to the opening coin toss .


def Func ( arg_0 ) : arg_0 . copy ( ) if arg_0 . can_Func ( ) : arg_0 . _control . textCursor ( ) . removeSelectedText ( )

def Func(arg_0):
        """ Copy the currently selected text to the clipboard and delete it
            if it's inside the input buffer.
        """
        arg_0.copy()
        if arg_0.can_Func():
            arg_0._control.textCursor().removeSelectedText()

Copy the currently selected text to the clipboard and delete it if it s inside the input buffer .


def Func ( arg_0 , arg_1 ) : arg_2 = np . zeros ( arg_1 . shape , dtype = np . uint32 ) for arg_3 in xrange ( arg_1 . shape [ 0 ] ) : arg_4 = np . where ( arg_0 [ arg_3 , : ] ) [ 0 ] if np . any ( arg_4 ) : arg_5 = np . arange ( arg_1 . shape [ 1 ] ) arg_6 = np . ones ( arg_5 . shape [ 0 ] , dtype = np . bool_ ) for arg_7 in arg_4 : arg_6 [ arg_7 ] = False arg_8 = arg_5 [ arg_6 == 1 ] arg_2 [ arg_3 ] [ arg_8 ] = arg_1 [ arg_3 , : arg_8 . shape [ 0 ] ] else : arg_2 [ arg_3 ] = arg_1 [ arg_3 ] return arg_2

def Func(arg_0, arg_1):
    """
    inserts indels into the catg array
    """
    ## return copy with indels inserted
    arg_2 = np.zeros(arg_1.shape, dtype=np.uint32)

    ## iterate over loci and make extensions for indels
    for arg_3 in xrange(arg_1.shape[0]):
        ## get indels indices
        arg_4 = np.where(arg_0[arg_3, :])[0]
        if np.any(arg_4):
            ## which new (empty) rows will be added
            arg_5 = np.arange(arg_1.shape[1])
            arg_6 = np.ones(arg_5.shape[0], dtype=np.bool_)
            for arg_7 in arg_4:
                arg_6[arg_7] = False
            arg_8 = arg_5[arg_6 == 1]

            ## fill in new data into all other spots
            arg_2[arg_3][arg_8] = arg_1[arg_3, :arg_8.shape[0]]
        else:
            arg_2[arg_3] = arg_1[arg_3]
    return arg_2


(username, password, hpo_ids, p_value_treshold=1)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 1 ) : try : arg_4 = query_phenomizer . query ( arg_0 , arg_1 , * arg_2 ) arg_5 = [ result for result in arg_4 if result [ 'p_value' ] <= arg_3 ] return arg_5 except SystemExit : return None

def Func(arg_0, arg_1, arg_2, arg_3=1):
    """Return the list of HGNC symbols that match annotated HPO terms.

    Args:
        username (str): username to use for phenomizer connection
        password (str): password to use for phenomizer connection

    Returns:
        query_result: a generator of dictionaries on the form
        {
            'p_value': float,
            'disease_source': str,
            'disease_nr': int,
            'gene_symbols': list(str),
            'description': str,
            'raw_line': str
        }
    """
    # skip querying Phenomizer unless at least one HPO terms exists
    try:
        arg_4 = query_phenomizer.query(arg_0, arg_1, *arg_2)
        arg_5 = [result for result in arg_4
                    if result['p_value'] <= arg_3]
        return arg_5
    except SystemExit:
        return None

Return the list of HGNC symbols that match annotated HPO terms .


(obj,
          key=None,
          salt='django.core.signing',
          serializer=JSONSerializer,
          compress=False)

def Func ( arg_0 , arg_1 = None , arg_2 = 'django.core.signing' , arg_3 = arg_4 , arg_5 = False ) : arg_6 = arg_3 ( ) . Func ( arg_0 ) arg_7 = False if arg_5 : arg_8 = zlib . compress ( arg_6 ) if len ( arg_8 ) < ( len ( arg_6 ) - 1 ) : arg_6 = arg_8 arg_7 = True arg_9 = b64_encode ( arg_6 ) if arg_7 : arg_9 = b'.' + arg_9 return TimestampSigner ( arg_1 , arg_2 = arg_2 ) . sign ( arg_9 )

def Func(arg_0,
          arg_1=None,
          arg_2='django.core.signing',
          arg_3=arg_4,
          arg_5=False):
    """
    Returns URL-safe, sha1 signed base64 compressed JSON string. If key is
    None, settings.SECRET_KEY is used instead.

    If compress is True (not the default) checks if compressing using zlib can
    save some space. Prepends a '.' to signify compression. This is included
    in the signature, to protect against zip bombs.

    Salt can be used to namespace the hash, so that a signed string is
    only valid for a given namespace. Leaving this at the default
    value or re-using a salt value across different parts of your
    application without good cause is a security risk.

    The serializer is expected to return a bytestring.
    """
    arg_6 = arg_3().Func(arg_0)

    # Flag for if it's been compressed or not
    arg_7 = False

    if arg_5:
        # Avoid zlib dependency unless compress is being used
        arg_8 = zlib.compress(arg_6)
        if len(arg_8) < (len(arg_6) - 1):
            arg_6 = arg_8
            arg_7 = True
    arg_9 = b64_encode(arg_6)
    if arg_7:
        arg_9 = b'.' + arg_9
    return TimestampSigner(arg_1, arg_2=arg_2).sign(arg_9)

Returns URL - safe sha1 signed base64 compressed JSON string . If key is None settings . SECRET_KEY is used instead .


def Func(arg_0, arg_1, arg_2):
        '''
        Build the URI for the API call.
        '''
        arg_3 = 'https://api.trello.com/1' + arg_0.clean_path(arg_1)
        arg_3 += '?' + urlencode(arg_2)

        return arg_3


def Func ( arg_0 ) : arg_1 = 0 for arg_2 , arg_3 , arg_3 in arg_0 . data : if arg_2 . name not in [ 'barrier' , 'snapshot' ] : arg_1 += 1 return arg_1

def Func(arg_0):
        """Returns total number of gate operations in circuit.

        Returns:
            int: Total number of gate operations.
        """
        arg_1 = 0
        for arg_2, arg_3, arg_3 in arg_0.data:
            if arg_2.name not in ['barrier', 'snapshot']:
                arg_1 += 1
        return arg_1

Returns total number of gate operations in circuit .


def
Func
(
arg_0
,
arg_1
=
True
)
:
if
arg_1
and
not
is_oct
(
arg_0
)
:
raise
ValueError
(
'Func: invalid IP: "%s"'
%
arg_0
)
if
isinstance
(
arg_0
,
int
)
:
arg_0
=
oct
(
arg_0
)
return
int
(
str
(
arg_0
)
,
8
)

def Func(arg_0, arg_1=True):
    """Octal to decimal conversion."""
    if arg_1 and not is_oct(arg_0):
        raise ValueError('Func: invalid IP: "%s"' % arg_0)
    if isinstance(arg_0, int):
        arg_0 = oct(arg_0)
    return int(str(arg_0), 8)


def Func ( arg_0 ) : arg_1 = StringIO ( arg_0 ) arg_2 = Image . open ( arg_1 ) return arg_2

def Func(arg_0):
    """
    Convert string datas into a Pillow Image object
    """
    arg_1 = StringIO(arg_0)
    arg_2 = Image.open(arg_1)
    return arg_2


def Func(arg_0, arg_1=False):
        """
        Resolve the polytomies on the tree.

        The function scans the tree, resolves polytomies if present,
        and re-optimizes the tree with new topology. Note that polytomies are only
        resolved if that would result in higher likelihood. Sometimes, stretching
        two or more branches that carry several mutations is less costly than
        an additional branch with zero mutations (long branches are not stiff,
        short branches are).

        Parameters
        ----------
         merge_compressed : bool
            If True, keep compressed branches as polytomies. If False,
            return a strictly binary tree.

        Returns
        --------
         poly_found : int
            The number of polytomies found

        """
        arg_0.logger("TreeTime.Func: resolving multiple mergers...",1)
        arg_2=0

        for arg_3 in arg_0.tree.find_clades():
            if len(arg_3.clades) > 2:
                arg_4 = len(arg_3.clades)
                arg_0._poly(arg_3, arg_1)
                arg_2+=arg_4 - len(arg_3.clades)

        arg_5 = [arg_3 for arg_3 in arg_0.tree.find_clades() if len(arg_3.clades)==1 and arg_3.up is not None]
        for arg_6 in arg_5:
            arg_0.logger('TreeTime.Func: remove obsolete node '+arg_6.name,4)
            if arg_6.up is not None:
                arg_0.tree.collapse(arg_6)

        if arg_2:
            arg_0.logger('TreeTime.Func: introduces %d new nodes'%arg_2,3)
        else:
            arg_0.logger('TreeTime.Func: No more polytomies to resolve',3)
        return arg_2


def Func(arg_0):
        """
        Calculate performance model cycles from cache stats.

        calculate_cache_access() needs to have been execute before.
        """
        arg_1 = arg_0.kernel.datatypes_size[arg_0.kernel.datatype]
        arg_2 = float(arg_0.machine['cacheline size']) // arg_1
        arg_3 = (sympy.Integer(arg_0.machine['cacheline size']) /
                                    sympy.Integer(arg_0.kernel.bytes_per_iteration))
        arg_0.results['iterations per cacheline'] = arg_3
        arg_5 = float(arg_0.machine['cacheline size'])

        arg_6, arg_7 = (arg_0.predictor.get_loads(), arg_0.predictor.get_stores())

        for arg_8, arg_9 in list(enumerate(arg_0.machine['memory hierarchy']))[1:]:
            arg_10, arg_11 = arg_9['non-overlap upstream throughput']

            if type(arg_10) is str and arg_10 == 'full socket memory bandwidth':
                # Memory transfer
                # we use bandwidth to calculate cycles and then add panalty cycles (if given)

                # choose bw according to cache level and problem
                # first, compile stream counts at current cache level
                # write-allocate is allready resolved in cache predictor
                arg_12 = arg_6[arg_8]
                arg_13 = arg_7[arg_8]
                # second, try to find best fitting kernel (closest to stream seen stream counts):
                arg_14 = 1
                arg_15, arg_16 = arg_0.machine.get_bandwidth(
                    arg_8, arg_12, arg_13, arg_14)

                # calculate cycles
                if arg_11 == 'half-duplex':
                    arg_17 = float(arg_6[arg_8] + arg_7[arg_8]) * \
                             float(arg_2) * float(arg_1) * \
                             float(arg_0.machine['clock']) / float(arg_15)
                else:  # full-duplex
                    raise NotImplementedError(
                        "full-duplex mode is not (yet) supported for memory transfers.")
                # add penalty cycles for each read stream
                if 'penalty cycles per read stream' in arg_9:
                    arg_17 += arg_7[arg_8] * \
                              arg_9['penalty cycles per read stream']

                arg_0.results.update({
                    'memory bandwidth kernel': arg_16,
                    'memory bandwidth': arg_15})
            else:
                # since throughput is given in B/cy, and we need CL/cy:
                arg_10 = float(arg_10) / arg_5
                # only cache cycles count
                if arg_11 == 'half-duplex':
                    arg_17 = (arg_6[arg_8] + arg_7[arg_8]) / float(arg_10)
                elif arg_11 == 'full-duplex':
                    arg_17 = max(arg_6[arg_8] / float(arg_10),
                                 arg_7[arg_8] / float(arg_10))
                else:
                    raise ValueError("Duplexness of cache throughput may only be 'half-duplex'"
                                     "or 'full-duplex', found {} in {}.".format(
                        arg_11, arg_9['name']))

            arg_0.results['cycles'].append((arg_9['level'], arg_17))

            arg_0.results[arg_9['level']] = arg_17

        return arg_0.results

Calculate performance model cycles from cache stats .


def Func ( arg_0 , arg_1 ) : if not arg_1 : commands . add ( arg_0 . provider . ui , arg_0 . provider . repo , arg_0 . localHgPath )

def Func(arg_0, arg_1):
        """Called when PUT has finished writing.

        See DAVResource.Func()
        """
        if not arg_1:
            commands.add(arg_0.provider.ui, arg_0.provider.repo, arg_0.localHgPath)

Called when PUT has finished writing.

        See DAVResource.end_write()


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _render_template ( 'uninstall.sh' , arg_1 ) arg_0 . config . setdefault ( 'files' , [ ] ) arg_0 . _add_unique_file ( { "path" : "/uninstall.sh" , "contents" : arg_2 , "mode" : "755" } )

def Func(arg_0, arg_1):
        """
        generates uninstall.sh and adds it to included files
        """
        arg_2 = arg_0._render_template('uninstall.sh', arg_1)
        arg_0.config.setdefault('files', [])  # file list might be empty
        # add uninstall.sh to list of included files
        arg_0._add_unique_file({
            "path": "/uninstall.sh",
            "contents": arg_2,
            "mode": "755"
        })

generates uninstall . sh and adds it to included files


def Func ( arg_0 , arg_1 ) : if DEBUG : print "down!" if ( not arg_1 . ControlDown ( ) and not arg_1 . ShiftDown ( ) ) or arg_1 . AltDown ( ) : for arg_2 in arg_0 . selection : if arg_2 . sel_marker : arg_2 . sel_marker . show ( False ) arg_2 . sel_marker . destroy ( ) arg_2 . sel_marker = None arg_0 . selection = [ ] arg_5 = arg_1 . GetEventObject ( ) if arg_5 . Parent is None or arg_1 . AltDown ( ) : if not arg_1 . AltDown ( ) : arg_1 . Skip ( ) arg_0 . current = arg_5 arg_0 . overlay = wx . Overlay ( ) arg_0 . pos = arg_1 . GetPosition ( ) arg_0 . parent . wx_obj . CaptureMouse ( ) else : arg_2 = arg_5 . obj arg_0 . overlay = None if DEBUG : print arg_5 arg_9 , arg_10 = arg_5 . ScreenToClient ( arg_5 . GetPositionTuple ( ) ) arg_11 , arg_12 = arg_5 . ScreenToClient ( wx . GetMousePosition ( ) ) arg_0 . pos = arg_5 . ScreenToClient ( wx . GetMousePosition ( ) ) arg_0 . start = ( arg_9 - arg_11 , arg_10 - arg_12 ) arg_0 . current = arg_5 if DEBUG : print "capture..." if not isinstance ( arg_5 , wx . Notebook ) : arg_0 . parent . wx_obj . CaptureMouse ( ) arg_0 . select ( arg_2 , keep_selection = True )

def Func(arg_0, arg_1):
        "Get the selected object and store start position"
        if DEBUG: print "down!"
        if (not arg_1.ControlDown() and not arg_1.ShiftDown()) or arg_1.AltDown():
            for arg_2 in arg_0.selection:
                # clear marker
                if arg_2.sel_marker:
                    arg_2.sel_marker.show(False)
                    arg_2.sel_marker.destroy()
                    arg_2.sel_marker = None
            arg_0.selection = []  # clear previous selection

        arg_5 = arg_1.GetEventObject()

        if arg_5.Parent is None or arg_1.AltDown():
            if not arg_1.AltDown():
                arg_1.Skip()
            # start the rubberband effect (multiple selection using the mouse)
            arg_0.current = arg_5
            arg_0.overlay = wx.Overlay()
            arg_0.pos = arg_1.GetPosition()
            arg_0.parent.wx_obj.CaptureMouse()
            #if self.inspector and hasattr(wx_obj, "obj"):
            #    self.inspector.inspect(wx_obj.obj)  # inspect top level window
            #self.dclick = False
        else:
            # create the selection marker and assign it to the control
            arg_2 = arg_5.obj
            arg_0.overlay = None
            if DEBUG: print arg_5
            arg_9, arg_10 = arg_5.ScreenToClient(arg_5.GetPositionTuple())
            arg_11, arg_12 = arg_5.ScreenToClient(wx.GetMousePosition())
            arg_0.pos = arg_5.ScreenToClient(wx.GetMousePosition())
            arg_0.start = (arg_9 - arg_11, arg_10 - arg_12)
            arg_0.current = arg_5
            if DEBUG: print "capture..."
            # do not capture on TextCtrl, it will fail (blocking) at least in gtk
            # do not capture on wx.Notebook to allow selecting the tabs
            if not isinstance(arg_5, wx.Notebook):
                arg_0.parent.wx_obj.CaptureMouse()
            arg_0.select(arg_2, keep_selection=True)


def Func ( ) : try : from invenio . bibdocfile import BibRecDocs , BibDoc except ImportError : from invenio . legacy . bibdocfile . api import BibRecDocs , BibDoc return BibRecDocs , BibDoc

def Func():
    """Import BibDocFile."""
    try:
        from invenio.bibdocfile import BibRecDocs, BibDoc
    except ImportError:
        from invenio.legacy.bibdocfile.api import BibRecDocs, BibDoc
    return BibRecDocs, BibDoc


(expected: Union[str, bytes],
                  actual: Union[str, bytes])

def Func(arg_0: arg_1[arg_2, arg_3],
                  arg_4: arg_1[arg_2, arg_3]) -> bool:
    """
    Compares the given tokens.

    :param expected: The expected token.
    :type expected: Union[str, bytes]
    :param actual: The actual token.
    :type actual: Union[str, bytes]
    :return: Do the tokens match?
    :rtype: bool
    """
    arg_0 = util.to_bytes(arg_0)
    arg_4 = util.to_bytes(arg_4)
    arg_5, arg_6 = arg_0.rsplit(b'.', 1)
    arg_5, arg_7 = arg_4.rsplit(b'.', 1)
    arg_8 = util.b64_decode(arg_6)
    arg_9 = util.b64_decode(arg_7)
    return compare_signature(arg_8, arg_9)


def
Func
(
arg_0
)
:
with
arg_0
.
lock
:
logger
.
debug
(
"Func()"
)
if
arg_0
.
_eof
or
arg_0
.
_socket
is
:
return
if
arg_0
.
_state
==
"tls-handshake"
:
while
True
:
logger
.
debug
(
"tls handshake read..."
)
arg_0
.
_continue_tls_handshake
(
)
logger
.
debug
(
"  state: {0}"
.
format
(
arg_0
.
_tls_state
)
)
if
arg_0
.
_tls_state
!=
"want_read"
:
break
elif
arg_0
.
_tls_state
==
"connected"
:
while
arg_0
.
_socket
and
not
arg_0
.
_eof
:
logger
.
debug
(
"tls socket read..."
)
try
:
arg_1
=
arg_0
.
_socket
.
read
(
4096
)
except
ssl
.
SSLError
,
err
:
if
err
.
args
[
0
]
==
ssl
.
SSL_ERROR_WANT_READ
:
break
elif
err
.
args
[
0
]
==
ssl
.
SSL_ERROR_WANT_WRITE
:
break
else
:
raise
except
socket
.
error
,
err
:
if
err
.
args
[
0
]
==
errno
.
EINTR
:
continue
elif
err
.
args
[
0
]
in
BLOCKING_ERRORS
:
break
elif
err
.
args
[
0
]
==
errno
.
ECONNRESET
:
logger
.
warning
(
"Connection reset by peer"
)
arg_1
=
else
:
raise
arg_0
.
_feed_reader
(
arg_1
)
else
:
while
arg_0
.
_socket
and
not
arg_0
.
_eof
:
logger
.
debug
(
"raw socket read..."
)
try
:
arg_1
=
arg_0
.
_socket
.
recv
(
4096
)
except
socket
.
error
,
err
:
if
err
.
args
[
0
]
==
errno
.
EINTR
:
continue
elif
err
.
args
[
0
]
in
BLOCKING_ERRORS
:
break
elif
err
.
args
[
0
]
==
errno
.
ECONNRESET
:
logger
.
warning
(
"Connection reset by peer"
)
arg_1
=
else
:
raise
arg_0
.
_feed_reader
(
arg_1
)

def Func(arg_0):
        """
        Handle the 'channel readable' state. E.g. read from a socket.
        """
        with arg_0.lock:
            logger.debug("Func()")
            if arg_0._eof or arg_0._socket is None:
                return
            if arg_0._state == "tls-handshake":
                while True:
                    logger.debug("tls handshake read...")
                    arg_0._continue_tls_handshake()
                    logger.debug("  state: {0}".format(arg_0._tls_state))
                    if arg_0._tls_state != "want_read":
                        break
            elif arg_0._tls_state == "connected":
                while arg_0._socket and not arg_0._eof:
                    logger.debug("tls socket read...")
                    try:
                        arg_1 = arg_0._socket.read(4096)
                    except ssl.SSLError, err:
                        if err.args[0] == ssl.SSL_ERROR_WANT_READ:
                            break
                        elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
                            break
                        else:
                            raise
                    except socket.error, err:
                        if err.args[0] == errno.EINTR:
                            continue
                        elif err.args[0] in BLOCKING_ERRORS:
                            break
                        elif err.args[0] == errno.ECONNRESET:
                            logger.warning("Connection reset by peer")
                            arg_1 = None
                        else:
                            raise
                    arg_0._feed_reader(arg_1)
            else:
                while arg_0._socket and not arg_0._eof:
                    logger.debug("raw socket read...")
                    try:
                        arg_1 = arg_0._socket.recv(4096)
                    except socket.error, err:
                        if err.args[0] == errno.EINTR:
                            continue
                        elif err.args[0] in BLOCKING_ERRORS:
                            break
                        elif err.args[0] == errno.ECONNRESET:
                            logger.warning("Connection reset by peer")
                            arg_1 = None
                        else:
                            raise
                    arg_0._feed_reader(arg_1)

Handle the channel readable state . E . g . read from a socket .


return ';\n'.join([tree.newick for tree in trees]) + ';'

def Func ( arg_0 ) : if isinstance ( arg_0 , Node ) : arg_0 = [ arg_0 ] return ';\n' . join ( [ arg_1 . newick for arg_1 in arg_0 ] ) + ';'

def Func(arg_0):
    """
    Serialize a list of trees in Newick format.

    :param trees: List of Node objects or a single Node object.
    :return: Newick formatted string.
    """
    if isinstance(arg_0, Node):
        arg_0 = [arg_0]
    return ';\n'.join([arg_1.newick for arg_1 in arg_0]) + ';'

Serialize a list of trees in Newick format .


def Func ( arg_0 , arg_1 ) : arg_2 = { NM_DOT : _dot_to_dec , NM_HEX : _hex_to_dec , NM_BIN : _bin_to_dec , NM_OCT : _oct_to_dec , NM_DEC : _dec_to_dec_long } try : arg_3 = arg_2 [ arg_1 ] ( arg_0 , check = True ) except ValueError : return False if arg_3 in _NETMASKS_VALUES : return True return False

def Func(arg_0, arg_1):
    """Function internally used to check if the given netmask
    is of the specified notation."""
    # Convert to decimal, and check if it's in the list of valid netmasks.
    arg_2 = {
        NM_DOT: _dot_to_dec,
        NM_HEX: _hex_to_dec,
        NM_BIN: _bin_to_dec,
        NM_OCT: _oct_to_dec,
        NM_DEC: _dec_to_dec_long}
    try:
        arg_3 = arg_2[arg_1](arg_0, check=True)
    except ValueError:
        return False
    if arg_3 in _NETMASKS_VALUES:
        return True
    return False

Function internally used to check if the given netmask is of the specified notation .


def Func ( arg_0 ) : if arg_0 . _config_Func is None : ensure_ida_loaded ( ) return DirectoryIDASettings ( arg_0 . _plugin_name , Func = arg_0 . _config_Func )

def Func(arg_0):
        """
        Fetch the IDASettings instance for the curren plugin with Func scope.

        rtype: IDASettingsInterface
        """
        if arg_0._config_Func is None:
            ensure_ida_loaded()
        return DirectoryIDASettings(arg_0._plugin_name, Func=arg_0._config_Func)

Fetch the IDASettings instance for the curren plugin with directory scope.

        rtype: IDASettingsInterface

Fetch the IDASettings instance for the curren plugin with directory scope .


def
Func
(
arg_0
)
:
LOG
.
debug
(
"'%s' inheriting data from '%s'"
%
(
arg_0
.
get_name
(
)
,
arg_0
.
parent
.
get_name
(
)
)
,
extra
=
dict
(
data
=
arg_0
.
parent
.
data
)
)
arg_0
.
set_data
(
**
arg_0
.
parent
.
data
)

def Func(arg_0):
        """
        Inherits the data from the parent.
        """
        LOG.debug("'%s' inheriting data from '%s'" % (arg_0.get_name(),
                                                      arg_0.parent.get_name()),
                  extra=dict(data=arg_0.parent.data))
        arg_0.set_data(**arg_0.parent.data)


def
Func
(
arg_0
)
:
import
shutil
import
zipfile
if
arg_0
.
_check_exists
(
)
:
return
makedir_exist_ok
(
arg_0
.
raw_folder
)
makedir_exist_ok
(
arg_0
.
processed_folder
)
arg_1
=
arg_0
.
url
.
rpartition
(
'/'
)
[
2
]
arg_2
=
os
.
path
.
join
(
arg_0
.
raw_folder
,
arg_1
)
Func_url
(
arg_0
.
url
,
root
=
arg_0
.
raw_folder
,
arg_1
=
arg_1
,
md5
=
)
print
(
'Extracting zip archive'
)
with
zipfile
.
ZipFile
(
arg_2
)
as
zip_f
:
zip_f
.
extractall
(
arg_0
.
raw_folder
)
os
.
unlink
(
arg_2
)
arg_3
=
os
.
path
.
join
(
arg_0
.
raw_folder
,
'gzip'
)
for
arg_4
in
os
.
listdir
(
arg_3
)
:
if
arg_4
.
endswith
(
'.gz'
)
:
arg_0
.
extract_gzip
(
gzip_path
=
os
.
path
.
join
(
arg_3
,
arg_4
)
)
for
arg_5
in
arg_0
.
splits
:
print
(
'Processing '
+
arg_5
)
arg_6
=
(
read_image_file
(
os
.
path
.
join
(
arg_3
,
'emnist-{}-train-images-idx3-ubyte'
.
format
(
arg_5
)
)
)
,
read_label_file
(
os
.
path
.
join
(
arg_3
,
'emnist-{}-train-labels-idx1-ubyte'
.
format
(
arg_5
)
)
)
)
arg_7
=
(
read_image_file
(
os
.
path
.
join
(
arg_3
,
'emnist-{}-test-images-idx3-ubyte'
.
format
(
arg_5
)
)
)
,
read_label_file
(
os
.
path
.
join
(
arg_3
,
'emnist-{}-test-labels-idx1-ubyte'
.
format
(
arg_5
)
)
)
)
with
open
(
os
.
path
.
join
(
arg_0
.
processed_folder
,
arg_0
.
_training_file
(
arg_5
)
)
,
'wb'
)
as
f
:
torch
.
save
(
arg_6
,
f
)
with
open
(
os
.
path
.
join
(
arg_0
.
processed_folder
,
arg_0
.
_test_file
(
arg_5
)
)
,
'wb'
)
as
f
:
torch
.
save
(
arg_7
,
f
)
shutil
.
rmtree
(
arg_3
)
print
(
'Done!'
)

def Func(arg_0):
        """Download the EMNIST data if it doesn't exist in processed_folder already."""
        import shutil
        import zipfile

        if arg_0._check_exists():
            return

        makedir_exist_ok(arg_0.raw_folder)
        makedir_exist_ok(arg_0.processed_folder)

        # Func files
        arg_1 = arg_0.url.rpartition('/')[2]
        arg_2 = os.path.join(arg_0.raw_folder, arg_1)
        Func_url(arg_0.url, root=arg_0.raw_folder, arg_1=arg_1, md5=None)

        print('Extracting zip archive')
        with zipfile.ZipFile(arg_2) as zip_f:
            zip_f.extractall(arg_0.raw_folder)
        os.unlink(arg_2)
        arg_3 = os.path.join(arg_0.raw_folder, 'gzip')
        for arg_4 in os.listdir(arg_3):
            if arg_4.endswith('.gz'):
                arg_0.extract_gzip(gzip_path=os.path.join(arg_3, arg_4))

        # process and save as torch files
        for arg_5 in arg_0.splits:
            print('Processing ' + arg_5)
            arg_6 = (
                read_image_file(os.path.join(arg_3, 'emnist-{}-train-images-idx3-ubyte'.format(arg_5))),
                read_label_file(os.path.join(arg_3, 'emnist-{}-train-labels-idx1-ubyte'.format(arg_5)))
            )
            arg_7 = (
                read_image_file(os.path.join(arg_3, 'emnist-{}-test-images-idx3-ubyte'.format(arg_5))),
                read_label_file(os.path.join(arg_3, 'emnist-{}-test-labels-idx1-ubyte'.format(arg_5)))
            )
            with open(os.path.join(arg_0.processed_folder, arg_0._training_file(arg_5)), 'wb') as f:
                torch.save(arg_6, f)
            with open(os.path.join(arg_0.processed_folder, arg_0._test_file(arg_5)), 'wb') as f:
                torch.save(arg_7, f)
        shutil.rmtree(arg_3)

        print('Done!')

Download the EMNIST data if it doesn t exist in processed_folder already .


def Func ( arg_0 ) : arg_1 = uuid . uuid4 ( ) . hex arg_2 = os . path . join ( arg_0 . dirpath , arg_1 [ 0 : 2 ] ) arg_3 = arg_1 [ 2 : ] + arg_0 . STORAGE_EXT arg_4 = os . path . join ( arg_2 , arg_3 ) if not os . path . exists ( arg_2 ) : os . makedirs ( arg_2 ) try : arg_5 = Archive . create ( arg_4 ) except ArchiveError as e : raise ArchiveManagerError ( cause = str ( e ) ) return arg_5

def Func(arg_0):
        """Create a new archive.

        The method creates in the filesystem a brand new archive with
        a random SHA1 as its name. The first byte of the hashcode will
        be the name of the subdirectory; the remaining bytes, the
        archive name.

        :returns: a new `Archive` object

        :raises ArchiveManagerError: when an error occurs creating the
            new archive
        """
        arg_1 = uuid.uuid4().hex
        arg_2 = os.path.join(arg_0.dirpath, arg_1[0:2])
        arg_3 = arg_1[2:] + arg_0.STORAGE_EXT
        arg_4 = os.path.join(arg_2, arg_3)

        if not os.path.exists(arg_2):
            os.makedirs(arg_2)

        try:
            arg_5 = Archive.create(arg_4)
        except ArchiveError as e:
            raise ArchiveManagerError(cause=str(e))

        return arg_5


def Func(arg_0, arg_1, arg_2=0):
        """Write the specified value to this characteristic."""
        arg_3 = NSData.dataWithBytes_length_(arg_1, len(arg_1))
        arg_0._device._peripheral.writeValue_forCharacteristic_type_(arg_3,
            arg_0._characteristic,
            arg_2)

Write the specified value to this characteristic .


def Func ( arg_0 , arg_1 ) : if arg_0 . weak_subscribers is not None : with arg_0 . lock : arg_2 = arg_0 . _weakly_connected_index ( arg_1 ) if arg_2 is not None : arg_0 . weak_subscribers . pop ( arg_2 ) [ 0 ] if arg_0 . hard_subscribers is not None : try : arg_2 = arg_0 . _hard_callbacks ( ) . index ( arg_1 ) except ValueError : pass else : arg_0 . hard_subscribers . pop ( arg_2 )

def Func(arg_0, arg_1):
        """
        Disconnects the signal from the given function.

        :type  callback: object
        :param callback: The callback function.
        """
        if arg_0.weak_subscribers is not None:
            with arg_0.lock:
                arg_2 = arg_0._weakly_connected_index(arg_1)
                if arg_2 is not None:
                    arg_0.weak_subscribers.pop(arg_2)[0]
        if arg_0.hard_subscribers is not None:
            try:
                arg_2 = arg_0._hard_callbacks().index(arg_1)
            except ValueError:
                pass
            else:
                arg_0.hard_subscribers.pop(arg_2)

Disconnects the signal from the given function .


def
Func
(
arg_0
,
arg_1
=
True
)
:
if
arg_1
and
not
is_bin
(
arg_0
)
:
raise
ValueError
(
'Func: invalid IP: "%s"'
%
arg_0
)
if
isinstance
(
arg_0
,
int
)
:
arg_0
=
str
(
arg_0
)
return
int
(
str
(
arg_0
)
,
2
)

def Func(arg_0, arg_1=True):
    """Binary to decimal conversion."""
    if arg_1 and not is_bin(arg_0):
        raise ValueError('Func: invalid IP: "%s"' % arg_0)
    if isinstance(arg_0, int):
        arg_0 = str(arg_0)
    return int(str(arg_0), 2)


def Func ( arg_0 , Func ) : _set_params ( arg_0 . ode_obj , 'FMax' , Func , arg_0 . ADOF + arg_0 . LDOF )

def Func(arg_0, Func):
        '''Set the maximum forces for this object's degrees of freedom.

        Parameters
        ----------
        max_forces : float or sequence of float
            A maximum force value to set on all degrees of freedom, or a list
            containing one such value for each degree of freedom.
        '''
        _set_params(arg_0.ode_obj, 'FMax', Func, arg_0.ADOF + arg_0.LDOF)

Set the maximum forces for this object s degrees of freedom .


def Func(arg_0, arg_1):
    """Loads the named descriptor from the pool.

    Args:
      full_name: The full name of the descriptor to load.

    Returns:
      The descriptor for the named type.
    """

    arg_1 = _NormalizeFullyQualifiedName(arg_1)
    if arg_1 not in arg_0._descriptors:
      arg_0.FindFileContainingSymbol(arg_1)
    return arg_0._descriptors[arg_1]

Loads the named descriptor from the pool .


(self, task_id, backend, category, backend_args,
            archiving_cfg=None, scheduling_cfg=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
            arg_5=None, arg_6=None):
        """Add a task to the registry.

        This method Funcs task using `task_id` as identifier. If a task
        with the same identifier already exists on the registry, a
        `AlreadyExistsError` exception will be raised.

        :param task_id: identifier of the task to Func
        :param backend: backend used to fetch data from the repository
        :param category: category of the items to fetch
        :param backend_args: dictionary of arguments required to run the backend
        :param archiving_cfg: archiving config for the task, if needed
        :param scheduling_cfg: scheduling config for the task, if needed

        :returns: the new task Funced to the registry

        :raises AlreadyExistsError: raised when the given task identifier
            exists on the registry
        """
        arg_0._rwlock.writer_acquire()

        if arg_1 in arg_0._tasks:
            arg_0._rwlock.writer_release()
            raise AlreadyExistsError(element=str(arg_1))

        arg_7 = Task(arg_1, arg_2, arg_3, arg_4,
                    arg_5=arg_5,
                    arg_6=arg_6)
        arg_0._tasks[arg_1] = arg_7

        arg_0._rwlock.writer_release()

        logger.debug("Task %s Funced to the registry", str(arg_1))

        return arg_7

Add a task to the registry.

        This method adds task using `task_id` as identifier. If a task
        with the same identifier already exists on the registry, a
        `AlreadyExistsError` exception will be raised.

        :param task_id: identifier of the task to add
        :param backend: backend used to fetch data from the repository
        :param category: category of the items to fetch
        :param backend_args: dictionary of arguments required to run the backend
        :param archiving_cfg: archiving config for the task, if needed
        :param scheduling_cfg: scheduling config for the task, if needed

        :returns: the new task added to the registry

        :raises AlreadyExistsError: raised when the given task identifier
            exists on the registry


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . selection : if arg_2 : if DEBUG : print "deleting" , arg_2 . name arg_2 . destroy ( ) arg_0 . selection = [ ] arg_0 . inspector . load_object ( )

def Func(arg_0, arg_1):
        "Func all of the selected objects"
        # get the selected objects (if any)
        for arg_2 in arg_0.selection:
            if arg_2:
                if DEBUG: print "deleting", arg_2.name
                arg_2.destroy()
        arg_0.selection = []                         # clean selection
        arg_0.inspector.load_object()


def Func ( arg_0 : arg_1 ) -> List [ Tuple [ int , int ] ] : return create_timeline ( count_citation_years ( arg_0 ) )

def Func(arg_0: arg_1) -> List[Tuple[int, int]]:
    """Create a citation timeline counter from the graph."""
    return create_timeline(count_citation_years(arg_0))

Create a citation timeline counter from the graph .


return self._perform_delete(
            self._get_path('services/serviceBus/Namespaces', name),
            None)

def Func ( arg_0 , arg_1 ) : _validate_not_none ( 'name' , arg_1 ) return arg_0 . _perform_delete ( arg_0 . _get_path ( 'services/serviceBus/Namespaces' , arg_1 ) , None )

def Func(arg_0, arg_1):
        '''
        Delete a service bus namespace.

        name:
            Name of the service bus namespace to delete.
        '''
        _validate_not_none('name', arg_1)

        return arg_0._perform_delete(
            arg_0._get_path('services/serviceBus/Namespaces', arg_1),
            None)


return ''.join( [INDEXED_REDIS_PREFIX, self.keyName, ':idx:', indexedField, ':', val] )

def Func ( arg_0 , arg_1 , arg_2 ) : if hasattr ( arg_1 , 'toIndex' ) : arg_2 = arg_1 . toIndex ( arg_2 ) else : arg_2 = arg_0 . fields [ arg_1 ] . toIndex ( arg_2 ) return '' . join ( [ INDEXED_REDIS_PREFIX , arg_0 . keyName , ':idx:' , arg_1 , ':' , arg_2 ] )

def Func(arg_0, arg_1, arg_2):
		'''
			Func - Returns the key name that would hold the indexes on a value
			Internal - does not validate that indexedFields is actually indexed. Trusts you. Don't let it down.

			@param indexedField - string of field name
			@param val - Value of field

			@return - Key name string, potentially hashed.
		'''
		# If provided an IRField, use the toIndex from that (to support compat_ methods
		if hasattr(arg_1, 'toIndex'):
			arg_2 = arg_1.toIndex(arg_2)
		else:
		# Otherwise, look up the indexed field from the model
			arg_2 = arg_0.fields[arg_1].toIndex(arg_2)

		return ''.join( [INDEXED_REDIS_PREFIX, arg_0.keyName, ':idx:', arg_1, ':', arg_2] )

_get_key_for_index - Returns the key name that would hold the indexes on a value
			Internal - does not validate that indexedFields is actually indexed. Trusts you. Don't let it down.

			@param indexedField - string of field name
			@param val - Value of field

			@return - Key name string, potentially hashed.

_get_key_for_index - Returns the key name that would hold the indexes on a value Internal - does not validate that indexedFields is actually indexed . Trusts you . Don t let it down .


def Func(arg_0, arg_1=False):
    """
    This function will create the VM directory where a repo will be mounted, if it
    doesn't exist.  If wait_for_server is set, it will wait up to 10 seconds for
    the nfs server to start, by retrying mounts that fail with 'Connection Refused'.

    If wait_for_server is not set, it will attempt to run the mount command once
    """
    check_call_on_vm('sudo mkdir -p {}'.format(arg_0.vm_path))
    if arg_1:
        for arg_2 in range(0,10):
            try:
                _run_mount_command(arg_0)
                return
            except CalledProcessError as e:
                if 'Connection refused' in e.output:
                    logging.info('Failed to mount repo; waiting for nfsd to restart')
                    time.sleep(1)
                else:
                    logging.info(e.output)
                    raise e
        log_to_client('Failed to mount repo {}'.format(arg_0.short_name))
        raise RuntimeError('Unable to mount repo with NFS')
    else:
        _run_mount_command(arg_0)

This function will create the VM directory where a repo will be mounted if it doesn t exist . If wait_for_server is set it will wait up to 10 seconds for the nfs server to start by retrying mounts that fail with Connection Refused .


def
Func
(
arg_0
)
:
arg_1
=
[
]
arg_2
=
0
for
arg_3
in
arg_0
:
if
len
(
arg_3
)
>
0
:
if
(
arg_2
>
0
)
and
not
(
arg_3
[
0
]
in
",.:;!?-\"'"
)
:
arg_1
.
append
(
" "
)
arg_1
.
append
(
arg_3
)
arg_2
+=
1
return
""
.
join
(
arg_1
)

def Func (arg_0):
    """
    construct a sentence text, with proper spacing
    """
    arg_1 = []
    arg_2 = 0

    for arg_3 in arg_0:
        if len(arg_3) > 0:
            if (arg_2 > 0) and not (arg_3[0] in ",.:;!?-\"'"):
                arg_1.append(" ")

            arg_1.append(arg_3)

        arg_2 += 1

    return "".join(arg_1)

construct a sentence text with proper spacing


(self,
               name,
               query,
               scope_count,
               scope_unit,
               increase_positive,
               percentage_change,
               trigger_config,
               logs,
               alert_reports)

return self._api_post(
            url=tag_url,
            data=json.dumps(tag_data, sort_keys=True),
        )

def Func(arg_0,
               arg_1,
               arg_2,
               arg_3,
               arg_4,
               arg_5,
               arg_6,
               arg_7,
               arg_8,
               arg_9):
        """
        Create an anomaly alert. This call makes 2 requests, one to Func a
        "scheduled_query", and another to Func the alert.

        :param name: The name for the alert
        :type name: str

        :param query: The `LEQL`_ query to use for detecting anomalies. Must
            result in a numerical value, so it should look something like
            ``where(...) calculate(COUNT)``
        :type query: str

        :param scope_count: How many ``scope_unit`` s to inspect for detecting
            an anomaly
        :type scope_count: int

        :param scope_unit: How far to look back in detecting an anomaly. Must
            be one of "hour", "day", or "week"
        :type scope_unit: str

        :param increase_positive: Detect a positive increase for the anomaly. A
            value of ``False`` results in detecting a decrease for the anomaly.
        :type increase_positive: bool

        :param percentage_change: The percentage of change to detect. Must be a
            number between 0 and 100 (inclusive).
        :type percentage_change: int

        :param trigger_config: A AlertTriggerConfig describing how far back to
            look back to compare to the anomaly scope.
        :type trigger_config: :class:`AlertTriggerConfig<logentries_api.special_alerts.AlertTriggerConfig>`

        :param logs: A list of log UUID's. (The 'key' key of a log)
        :type logs: list of str

        :param alert_reports: A list of AlertReportConfig to send alerts to
        :type alert_reports: list of
            :class:`AlertReportConfig<logentries_api.special_alerts.AlertReportConfig>`

        :return: The API response of the alert creation
        :rtype: dict

        :raises: This will raise a
            :class:`ServerException <logentries_api.exceptions.ServerException>`
            if there is an error from Logentries

        .. _Leql: https://blog.logentries.com/2015/06/introducing-leql/

        """
        arg_10 = '{pos}{change}'.format(
            pos='+' if arg_5 else '-',
            arg_10=str(arg_6)
        )

        arg_11 = arg_0._Func_scheduled_query(
            arg_2=arg_2,
            arg_10=arg_10,
            arg_4=arg_4,
            arg_3=arg_3,
        )

        arg_12 = arg_11.get('scheduled_query', {}).get('id')

        arg_13 = {
            'tag': {
                'actions': [
                    alert_report.to_dict()
                    for alert_report
                    in arg_9
                ],
                'name': arg_1,
                'scheduled_query_id': arg_12,
                'sources': [
                    {'id': log}
                    for log
                    in arg_8
                ],
                'sub_type': 'AnomalyAlert',
                'type': 'AlertNotify'
            }
        }
        arg_13['tag'].update(arg_7.to_dict())

        arg_14 = 'https://logentries.com/rest/{account_id}/api/tags'.format(
            account_id=arg_0.account_id
        )

        return arg_0._api_post(
            url=arg_14,
            data=json.dumps(arg_13, sort_keys=True),
        )

Create an anomaly alert. This call makes 2 requests, one to create a
        "scheduled_query", and another to create the alert.

        :param name: The name for the alert
        :type name: str

        :param query: The `LEQL`_ query to use for detecting anomalies. Must
            result in a numerical value, so it should look something like
            ``where(...) calculate(COUNT)``
        :type query: str

        :param scope_count: How many ``scope_unit`` s to inspect for detecting
            an anomaly
        :type scope_count: int

        :param scope_unit: How far to look back in detecting an anomaly. Must
            be one of "hour", "day", or "week"
        :type scope_unit: str

        :param increase_positive: Detect a positive increase for the anomaly. A
            value of ``False`` results in detecting a decrease for the anomaly.
        :type increase_positive: bool

        :param percentage_change: The percentage of change to detect. Must be a
            number between 0 and 100 (inclusive).
        :type percentage_change: int

        :param trigger_config: A AlertTriggerConfig describing how far back to
            look back to compare to the anomaly scope.
        :type trigger_config: :class:`AlertTriggerConfig<logentries_api.special_alerts.AlertTriggerConfig>`

        :param logs: A list of log UUID's. (The 'key' key of a log)
        :type logs: list of str

        :param alert_reports: A list of AlertReportConfig to send alerts to
        :type alert_reports: list of
            :class:`AlertReportConfig<logentries_api.special_alerts.AlertReportConfig>`

        :return: The API response of the alert creation
        :rtype: dict

        :raises: This will raise a
            :class:`ServerException <logentries_api.exceptions.ServerException>`
            if there is an error from Logentries

        .. _Leql: https://blog.logentries.com/2015/06/introducing-leql/

Create an anomaly alert . This call makes 2 requests one to create a scheduled_query and another to create the alert .


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

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

    Renders Javascript code to track page visits.  You must supply
    your Matomo domain (plus optional URI path), and tracked site ID
    in the ``MATOMO_DOMAIN_PATH`` and the ``MATOMO_SITE_ID`` setting.

    Custom variables can be passed in the ``Func_vars`` context
    variable.  It is an iterable of custom variables as tuples like:
    ``(index, name, value[, scope])`` where scope may be ``'page'``
    (default) or ``'visit'``.  Index should be an integer and the
    other parameters should be strings.
    """
    arg_2 = arg_1.split_contents()
    if len(arg_2) > 1:
        raise TemplateSyntaxError("'%s' takes no arguments" % arg_2[0])
    return MatomoNode()

Matomo tracking template tag.

    Renders Javascript code to track page visits.  You must supply
    your Matomo domain (plus optional URI path), and tracked site ID
    in the ``MATOMO_DOMAIN_PATH`` and the ``MATOMO_SITE_ID`` setting.

    Custom variables can be passed in the ``matomo_vars`` context
    variable.  It is an iterable of custom variables as tuples like:
    ``(index, name, value[, scope])`` where scope may be ``'page'``
    (default) or ``'visit'``.  Index should be an integer and the
    other parameters should be strings.


(filename, clean_lines, linenum,
                            function_state, error)

def Func(arg_0, arg_1, arg_2,
                            arg_3, arg_4):
  """Reports for long function bodies.

  For an overview why this is done, see:
  https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions

  Uses a simplistic algorithm assuming other style guidelines
  (especially spacing) are followed.
  Only checks unindented functions, so class members are unchecked.
  Trivial bodies are unchecked, so constructors with huge initializer lists
  may be missed.
  Blank/comment lines are not counted so as to avoid encouraging the removal
  of vertical space and comments just to get through a lint check.
  NOLINT *on the last line of a function* disables this check.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    function_state: Current function name and lines in body so far.
    error: The function to call with any errors found.
  """
  arg_5 = arg_1.lines
  arg_6 = arg_5[arg_2]
  arg_7 = ''

  arg_8 = False
  arg_9 = r'(\w(\w|::|\*|\&|\s)*)\('  # decls * & space::name( ...
  arg_10 = Match(arg_9, arg_6)
  if arg_10:
    # If the name is all caps and underscores, figure it's a macro and
    # ignore it, unless it's TEST or TEST_F.
    arg_11 = arg_10.group(1).split()[-1]
    if arg_11 == 'TEST' or arg_11 == 'TEST_F' or (
        not Match(r'[A-Z_]+$', arg_11)):
      arg_8 = True

  if arg_8:
    arg_12 = False
    for arg_13 in range(arg_2, arg_1.NumLines()):
      arg_14 = arg_5[arg_13]
      arg_7 += ' ' + arg_14.lstrip()
      if Search(r'(;|})', arg_14):  # Declarations and trivial functions
        arg_12 = True
        break                              # ... ignore
      elif Search(r'{', arg_14):
        arg_12 = True
        arg_15 = Search(r'((\w|:)*)\(', arg_6).group(1)
        if Match(r'TEST', arg_15):    # Handle TEST... macros
          arg_16 = Search(r'(\(.*\))', arg_7)
          if arg_16:             # Ignore bad syntax
            arg_15 += arg_16.group(1)
        else:
          arg_15 += '()'
        arg_3.Begin(arg_15)
        break
    if not arg_12:
      # No body for the function (or evidence of a non-function) was found.
      arg_4(arg_0, arg_2, 'readability/fn_size', 5,
            'Lint failed to find start of function body.')
  elif Match(r'^\}\s*$', arg_6):  # function end
    arg_3.Check(arg_4, arg_0, arg_2)
    arg_3.End()
  elif not Match(r'^\s*$', arg_6):
    arg_3.Count()


(rt, from_date, with_json=True, latest_only=False, **kwargs)

return dict(id_remote_account=rt.id_remote_account,
                token_type=rt.token_type,
                access_token=rt.access_token,
                secret=rt.secret)

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = False , ** arg_4 ) : return dict ( id_remote_account = arg_0 . id_remote_account , token_type = arg_0 . token_type , access_token = arg_0 . access_token , secret = arg_0 . secret )

def Func(arg_0, arg_1, arg_2=True, arg_3=False, **arg_4):
    """Dump the remote tokens as a list of dictionaries.

    :param ra: Remote toekn to be Funced.
    :type ra: `invenio_oauthclient.models.RemoteToken [Invenio2.x]`
    :returns: Remote tokens serialized to dictionary.
    :rtype: dict
    """
    return dict(id_remote_account=arg_0.id_remote_account,
                token_type=arg_0.token_type,
                access_token=arg_0.access_token,
                secret=arg_0.secret)

Dump the remote tokens as a list of dictionaries.

    :param ra: Remote toekn to be dumped.
    :type ra: `invenio_oauthclient.models.RemoteToken [Invenio2.x]`
    :returns: Remote tokens serialized to dictionary.
    :rtype: dict

Dump the remote tokens as a list of dictionaries .


(target_log_prob, x_initial, step_size=0.01,
                          max_doublings=30, seed=None, name=None)

def Func(arg_0, arg_1, arg_2=0.01,
                          arg_3=30, arg_4=None, arg_5=None):
  """For a given x position in each Markov chain, returns the next x.

  Applies the one dimensional slice sampling algorithm as defined in Neal (2003)
  to an input tensor x of shape (num_chains,) where num_chains is the number of
  simulataneous Markov chains, and returns the next tensor x of shape
  (num_chains,) when these chains are evolved by the slice sampling algorithm.

  Args:
    target_log_prob: Callable accepting a tensor like `x_initial` and returning
      a tensor containing the log density at that point of the same shape.
    x_initial: A tensor of any shape. The initial positions of the chains. This
      function assumes that all the dimensions of `x_initial` are batch
      dimensions (i.e. the event shape is `[]`).
    step_size: A tensor of shape and dtype compatible with `x_initial`. The min
      interval size in the doubling algorithm.
    max_doublings: Scalar tensor of dtype `tf.int32`. The maximum number of
      doublings to try to find the slice bounds.
    seed: (Optional) positive int. The random seed. If None, no seed is set.
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'find_slice_bounds').

  Returns:
    retval: A tensor of the same shape and dtype as `x_initial`. The next state
      of the Markov chain.
    next_target_log_prob: The target log density evaluated at `retval`.
    bounds_satisfied: A tensor of bool dtype and shape batch dimensions.
    upper_bounds: Tensor of the same shape and dtype as `x_initial`. The upper
      bounds for the slice found.
    lower_bounds: Tensor of the same shape and dtype as `x_initial`. The lower
      bounds for the slice found.
  """
  with tf.compat.v1.name_scope(arg_5, 'Func',
                               [arg_1, arg_2, arg_3]):
    arg_1 = tf.convert_to_tensor(value=arg_1)
    # Obtain the input dtype of the array.
    arg_6 = arg_1.dtype.base_dtype
    # Select the height of the slice. Tensor of shape x_initial.shape.
    arg_7 = arg_0(arg_1) - tf.random.gamma(
        tf.shape(input=arg_1), alpha=1, arg_6=arg_6, arg_4=arg_4)
    # Given the above x and slice heights, compute the bounds of the slice for
    # each chain.
    arg_8, arg_9, arg_10 = slice_bounds_by_doubling(
        arg_1, arg_0, arg_7, arg_3, arg_2,
        arg_4=arg_4)
    arg_11 = _sample_with_shrinkage(arg_1, arg_0=arg_0,
                                    arg_7=arg_7,
                                    arg_2=arg_2,
                                    arg_9=arg_9,
                                    arg_8=arg_8, arg_4=arg_4)
    return (arg_11, arg_0(arg_11), arg_10,
            arg_8, arg_9)

For a given x position in each Markov chain returns the next x .


(self, server_name, name, service_objective_id,
                        edition=None, collation_name=None,
                        max_size_bytes=None)

return self._perform_post(
            self._get_databases_path(server_name),
            _SqlManagementXmlSerializer.create_database_to_xml(
                name, service_objective_id, edition, collation_name,
                max_size_bytes
            )
        )

def Func(arg_0, arg_1, arg_2, arg_3,
                        arg_4=None, arg_5=None,
                        arg_6=None):
        '''
        Creates a new Azure SQL Database.

        server_name:
            Name of the server to contain the new database.
        name:
            Required. The name for the new database. See Naming Requirements
            in Azure SQL Database General Guidelines and Limitations and
            Database Identifiers for more information.
        service_objective_id:
            Required. The GUID corresponding to the performance level for
            Edition. See List Service Level Objectives for current values.
        edition:
            Optional. The Service Tier (Edition) for the new database. If
            omitted, the default is Web. Valid values are Web, Business,
            Basic, Standard, and Premium. See Azure SQL Database Service Tiers
            (Editions) and Web and Business Edition Sunset FAQ for more
            information.
        collation_name:
            Optional. The database collation. This can be any collation
            supported by SQL. If omitted, the default collation is used. See
            SQL Server Collation Support in Azure SQL Database General
            Guidelines and Limitations for more information.
        max_size_bytes:
            Optional. Sets the maximum size, in bytes, for the database. This
            value must be within the range of allowed values for Edition. If
            omitted, the default value for the edition is used. See Azure SQL
            Database Service Tiers (Editions) for current maximum databases
            sizes. Convert MB or GB values to bytes.
            1 MB = 1048576 bytes. 1 GB = 1073741824 bytes.
        '''
        _validate_not_none('server_name', arg_1)
        _validate_not_none('name', arg_2)
        _validate_not_none('service_objective_id', arg_3)
        return arg_0._perform_post(
            arg_0._get_databases_path(arg_1),
            _SqlManagementXmlSerializer.Func_to_xml(
                arg_2, arg_3, arg_4, arg_5,
                arg_6
            )
        )


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_5 . path [ 0 ] arg_0 . coverage . start ( ) arg_4 = True try : try : if arg_1 . module : arg_5 . path [ 0 ] = '' arg_0 . run_python_module ( arg_2 [ 0 ] , arg_2 ) else : arg_7 = arg_2 [ 0 ] arg_5 . path [ 0 ] = os . path . abspath ( os . path . dirname ( arg_7 ) ) arg_0 . run_python_file ( arg_7 , arg_2 ) except NoSource : arg_4 = False raise finally : arg_0 . coverage . stop ( ) if arg_4 : arg_0 . coverage . save ( ) arg_5 . path [ 0 ] = arg_3

def Func(arg_0, arg_1, arg_2):
        """Implementation of 'coverage run'."""

        # Set the first path element properly.
        arg_3 = arg_5.path[0]

        # Run the script.
        arg_0.coverage.start()
        arg_4 = True
        try:
            try:
                if arg_1.module:
                    arg_5.path[0] = ''
                    arg_0.run_python_module(arg_2[0], arg_2)
                else:
                    arg_7 = arg_2[0]
                    arg_5.path[0] = os.path.abspath(os.path.dirname(arg_7))
                    arg_0.run_python_file(arg_7, arg_2)
            except NoSource:
                arg_4 = False
                raise
        finally:
            arg_0.coverage.stop()
            if arg_4:
                arg_0.coverage.save()

            # Restore the old path
            arg_5.path[0] = arg_3


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
logging
.
debug
(
"ConnectorDB:WS: Connection Error"
)
if
arg_0
.
status
==
"connecting"
:
arg_0
.
status
=
"errored"
arg_0
.
ws_openlock
.
release
(
)

def Func(arg_0, arg_1, arg_2):
        """Called when there is an error in the websocket"""
        logging.debug("ConnectorDB:WS: Connection Error")

        if arg_0.status == "connecting":
            arg_0.status = "errored"
            arg_0.ws_openlock.release()


(self, dataset_id, name=None, description=None, public=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
)
:
arg_5
=
{
"public"
:
_convert_bool_to_public_value
(
arg_4
)
}
if
arg_2
:
arg_5
[
"name"
]
=
arg_2
if
arg_3
:
arg_5
[
"description"
]
=
arg_3
arg_6
=
{
"dataset"
:
arg_5
}
arg_7
=
"Failed to update dataset {}"
.
format
(
arg_1
)
arg_8
=
arg_0
.
_get_success_json
(
arg_0
.
_post_json
(
routes
.
Func
(
arg_1
)
,
arg_5
=
arg_6
,
arg_7
=
arg_7
)
)
return
_dataset_from_response_dict
(
arg_8
)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
        """
        Update a data set.

        :param dataset_id: The ID of the dataset to update
        :type dataset_id: int
        :param name: name of the dataset
        :type name: str
        :param description: description for the dataset
        :type description: str
        :param public: A boolean indicating whether or not the dataset should
            be public.
        :type public: bool
        :return: The updated dataset.
        :rtype: :class:`Dataset`
        """
        arg_5 = {
            "public": _convert_bool_to_public_value(arg_4)
        }

        if arg_2:
            arg_5["name"] = arg_2
        if arg_3:
            arg_5["description"] = arg_3

        arg_6 = {"dataset": arg_5}
        arg_7 = "Failed to update dataset {}".format(arg_1)
        arg_8 = arg_0._get_success_json(arg_0._post_json(routes.Func(arg_1), arg_5=arg_6, arg_7=arg_7))

        return _dataset_from_response_dict(arg_8)


return a module by its name, raise KeyError if not found

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . Funcs ( ) : if arg_2 . node . name == arg_1 : return arg_2 raise KeyError ( arg_1 )

def Func(arg_0, arg_1):
        """return a Func by its name, raise KeyError if not found
        """
        for arg_2 in arg_0.Funcs():
            if arg_2.node.name == arg_1:
                return arg_2
        raise KeyError(arg_1)

return a module by its name raise KeyError if not found


def Func(arg_0):
    '''Input file list validation function. Checks that object is a list and
    contains valid filepaths that can be processed by SoX.

    Parameters
    ----------
    input_filepath_list : list
        A list of filepaths.

    '''
    if not isinstance(arg_0, list):
        raise TypeError("input_filepath_list must be a list.")
    elif len(arg_0) < 2:
        raise ValueError("input_filepath_list must have at least 2 files.")

    for arg_1 in arg_0:
        validate_input_file(arg_1)

Input file list validation function . Checks that object is a list and contains valid filepaths that can be processed by SoX .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Add a new array to the DAF file.

        The summary will be initialized with the `name` and `values`,
        and will have its start word and end word fields set to point to
        where the `array` of floats has been appended to the file.

        """
        arg_4 = arg_0.file
        arg_5 = arg_0.summary_control_struct

        arg_6 = arg_0.bward
        arg_7 = bytearray(arg_0.read_record(arg_6))
        arg_8, arg_9, arg_10 = arg_5.unpack(arg_7[:24])

        if arg_10 < arg_0.summaries_per_record:
            arg_11 = arg_6
            arg_12 = arg_11 + 1
            arg_7[:24] = arg_5.pack(arg_8, arg_9, arg_10 + 1)
            arg_0.write_record(arg_11, arg_7)
        else:
            arg_11 = ((arg_0.free - 1) * 8 + 1023) // 1024 + 1
            arg_12 = arg_11 + 1
            arg_13 = arg_11 + 2

            arg_10 = 0
            arg_7[:24] = arg_5.pack(arg_11, arg_9, arg_10)
            arg_0.write_record(arg_6, arg_7)

            arg_14 = arg_5.pack(0, arg_6, 1).ljust(1024, b'\0')
            arg_15 = b'\0' * 1024
            arg_0.write_record(arg_11, arg_14)
            arg_0.write_record(arg_12, arg_15)

            arg_0.bward = arg_11
            arg_0.free = (arg_13 - 1) * 1024 // 8 + 1

        arg_18 = arg_0.free
        arg_4.seek((arg_18 - 1) * 8)
        arg_3 = numpy_array(arg_3)  # TODO: force correct endian
        arg_4.write(arg_3.view())
        arg_19 = arg_4.tell() // 8

        arg_0.free = arg_19 + 1
        arg_0.write_file_record()

        arg_2 = arg_2[:arg_0.nd + arg_0.ni - 2] + (arg_18, arg_19)

        arg_20 = 1024 * (arg_11 - 1)
        arg_21 = int(arg_10) * arg_0.summary_step
        arg_4.seek(arg_20 + arg_5.size + arg_21)
        arg_4.write(arg_0.summary_struct.pack(*arg_2))
        arg_4.seek(arg_20 + 1024 + arg_21)
        arg_4.write(arg_1[:arg_0.summary_length].ljust(arg_0.summary_step, b' '))


def Func(arg_0, arg_1="dict"):
    """Initialize an empty JSON file."""
    arg_1 = {} if arg_1.lower() == "dict" else []
    # The file will need to be created if it doesn't exist
    if not os.path.exists(arg_0):  # The file doesn't exist
        # Raise exception if the directory that should contain the file doesn't
        # exist
        arg_2 = os.path.dirname(arg_0)
        if arg_2 and not os.path.exists(arg_2):
            raise IOError(
                ("Could not initialize empty JSON file in non-existant "
                 "directory '{}'").format(os.path.dirname(arg_0))
            )
        # Write an empty file there
        with open(arg_0, "w") as f:
            json.dump(arg_1, f)
        return True
    elif os.path.getsize(arg_0) == 0:  # The file is empty
        with open(arg_0, "w") as f:
            json.dump(arg_1, f)
    else:  # The file exists and contains content
        return False


(self, datacenter_id, server_id, volume_id)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
'{ "id": "'
+
arg_3
+
'" }'
arg_5
=
arg_0
.
_perform_request
(
url
=
'/datacenters/%s/servers/%s/volumes'
%
(
arg_1
,
arg_2
)
,
method
=
'POST'
,
arg_4
=
arg_4
)
return
arg_5

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Attaches a volume to a server.

        :param      datacenter_id: The unique ID of the data center.
        :type       datacenter_id: ``str``

        :param      server_id: The unique ID of the server.
        :type       server_id: ``str``

        :param      volume_id: The unique ID of the volume.
        :type       volume_id: ``str``

        """
        arg_4 = '{ "id": "' + arg_3 + '" }'

        arg_5 = arg_0._perform_request(
            url='/datacenters/%s/servers/%s/volumes' % (
                arg_1,
                arg_2),
            method='POST',
            arg_4=arg_4)

        return arg_5


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
subFuncr
.
add_Funcr
(
"show"
,
help
=
"Show workspace details"
,
description
=
"Show workspace details."
)
arg_2
=
arg_1
.
add_mutually_exclusive_group
(
required
=
True
)
arg_2
.
add_argument
(
'--all'
,
action
=
'store_true'
,
help
=
"All workspaces"
)
arg_2
.
add_argument
(
'name'
,
type
=
str
,
help
=
"Workspace name"
,
nargs
=
'?'
)

def Func(arg_0):
        """Parse show subcommand."""
        arg_1 = arg_0.subFuncr.add_Funcr(
            "show",
            help="Show workspace details",
            description="Show workspace details.")

        arg_2 = arg_1.add_mutually_exclusive_group(required=True)
        arg_2.add_argument('--all', action='store_true', help="All workspaces")
        arg_2.add_argument('name', type=str, help="Workspace name", nargs='?')


(self, thread_id, agent, environment, deterministic=False,
                    max_episode_timesteps=-1, episode_finished=None, testing=False, sleep=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=False,
                    arg_5=-1, arg_6=None, arg_7=False, arg_8=None):
        """
        The target function for a thread, runs an agent and environment until signaled to stop.
        Adds rewards to shared episode rewards list.

        Args:
            thread_id (int): The ID of the thread that's running this target function.
            agent (Agent): The Agent object that this particular thread uses.
            environment (Environment): The Environment object that this particular thread uses.
            max_episode_timesteps (int): Max. number of timesteps per episode. Use -1 or 0 for non-limited episodes.
            episode_finished (callable): Function called after each episode that takes an episode summary spec and
                returns False, if this single run should terminate after this episode.
                Can be used e.g. to set a particular mean reward threshold.
        """

        # figure out whether we are using the deprecated way of "episode_finished" reporting
        arg_9 = False
        if arg_6 is not None and len(getargspec(arg_6).args) == 1:
            arg_9 = True

        arg_10 = 0
        # Run this single worker (episode loop) as long as global count thresholds have not been reached.
        while not arg_0.should_stop:
            arg_11 = arg_3.reset()
            arg_2.reset()
            arg_0.global_timestep, arg_0.global_episode = arg_2.timestep, arg_2.episode
            arg_14 = 0

            # Time step (within episode) loop
            arg_15 = 0
            arg_16 = time.time()
            while True:
                arg_17, arg_18, arg_19 = arg_2.act(arg_19=arg_11, arg_4=arg_4, buffered=False)
                arg_20 = 0
                for arg_21 in xrange(arg_0.repeat_actions):
                    arg_11, arg_22, arg_23 = arg_3.execute(arg_17=arg_17)
                    arg_20 += arg_23
                    if arg_22:
                        break

                if not arg_7:
                    # agent.observe(reward=reward, terminal=terminal)
                    # Insert everything at once.
                    arg_2.atomic_observe(
                        arg_19=arg_11,
                        actions=arg_17,
                        arg_18=arg_18,
                        arg_20=arg_20,
                        arg_22=arg_22
                    )

                if arg_8 is not None:
                    time.sleep(arg_8)

                arg_15 += 1
                arg_14 += arg_20

                if arg_22 or arg_15 == arg_5:
                    break

                # Abort the episode (discard its results) when global says so.
                if arg_0.should_stop:
                    return

            arg_0.global_timestep += arg_15

            # Avoid race condition where order in episode_rewards won't match order in episode_timesteps.
            arg_0.episode_list_lock.acquire()
            arg_0.episode_rewards.append(arg_14)
            arg_0.episode_timesteps.append(arg_15)
            arg_0.episode_times.append(time.time() - arg_16)
            arg_0.episode_list_lock.release()

            if arg_6 is not None:
                # old way of calling episode_finished
                if arg_9:
                    arg_24 = {
                        "thread_id": arg_1,
                        "episode": arg_10,
                        "timestep": arg_15,
                        "episode_reward": arg_14
                    }
                    if not arg_6(arg_24):
                        return
                # New way with BasicRunner (self) and thread-id.
                elif not arg_6(arg_0, arg_1):
                    return

            arg_10 += 1

The target function for a thread runs an agent and environment until signaled to stop . Adds rewards to shared episode rewards list .


def Func ( arg_0 , arg_1 ) : arg_1 [ 'institute' ] = arg_0 . institute ( arg_1 [ 'institute' ] ) arg_2 = "{}({})" . format ( arg_1 [ 'display_name' ] , arg_1 [ 'version' ] ) arg_1 [ 'name_and_version' ] = arg_2 return dict ( panel = arg_1 )

def Func(arg_0, arg_1):
    """Preprocess a panel of genes."""
    arg_1['institute'] = arg_0.institute(arg_1['institute'])
    arg_2 = "{}({})".format(arg_1['display_name'], arg_1['version'])
    arg_1['name_and_version'] = arg_2

    return dict(panel=arg_1)


def Func(arg_0, arg_1=None, *arg_2, **arg_3):
        """
            Searches the elasticsearch instance to retrieve the requested documents.
        """
        Func = arg_0.create_search(*arg_2, **arg_3)
        try:
            if arg_1:
                arg_5 = Func[0:arg_1]
            else:
                arg_2, arg_6 = arg_0.core_parser.parse_known_args()
                if arg_2.number:
                    arg_5 = Func[0:arg_2.number]
                else:
                    arg_5 = Func.scan()

            return [arg_7 for arg_7 in arg_5]
        except NotFoundError:
            print_error("The index was not found, have you initialized the index?")
            return []
        except (ConnectionError, TransportError):
            print_error("Cannot connect to elasticsearch")
            return []

Searches the elasticsearch instance to retrieve the requested documents .


(
            self, resource_group_name, virtual_wan_name, vpn_sites=None, output_blob_sas_url=None, custom_headers=None, raw=False, polling=True, **operation_config)

return LROPoller(self._client, raw_result, get_long_running_output, polling_method)

def Func(
            arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None, arg_6=False, arg_7=True, **arg_8):
        """Gives the sas-url to Func the configurations for vpn-sites in a
        resource group.

        :param resource_group_name: The resource group name.
        :type resource_group_name: str
        :param virtual_wan_name: The name of the VirtualWAN for which
         configuration of all vpn-sites is needed.
        :type virtual_wan_name: str
        :param vpn_sites: List of resource-ids of the vpn-sites for which
         config is to be Funced.
        :type vpn_sites:
         list[~azure.mgmt.network.v2018_04_01.models.SubResource]
        :param output_blob_sas_url: The sas-url to Func the configurations
         for vpn-sites
        :type output_blob_sas_url: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of LROPoller that returns None or
         ClientRawResponse<None> if raw==True
        :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
        :raises:
         :class:`ErrorException<azure.mgmt.network.v2018_04_01.models.ErrorException>`
        """
        arg_9 = arg_0._Func_initial(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=True,
            **arg_8
        )

        def get_long_running_output(arg_10):
            if arg_6:
                arg_11 = ClientRawResponse(None, arg_10)
                return arg_11

        arg_12 = arg_8.get(
            'long_running_operation_timeout',
            arg_0.config.long_running_operation_timeout)
        if arg_7 is True: arg_13 = ARMPolling(arg_12, **arg_8)
        elif arg_7 is False: arg_13 = NoPolling()
        else: arg_13 = arg_7
        return LROPoller(arg_0._client, arg_9, get_long_running_output, arg_13)

Gives the sas-url to download the configurations for vpn-sites in a
        resource group.

        :param resource_group_name: The resource group name.
        :type resource_group_name: str
        :param virtual_wan_name: The name of the VirtualWAN for which
         configuration of all vpn-sites is needed.
        :type virtual_wan_name: str
        :param vpn_sites: List of resource-ids of the vpn-sites for which
         config is to be downloaded.
        :type vpn_sites:
         list[~azure.mgmt.network.v2018_04_01.models.SubResource]
        :param output_blob_sas_url: The sas-url to download the configurations
         for vpn-sites
        :type output_blob_sas_url: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of LROPoller that returns None or
         ClientRawResponse<None> if raw==True
        :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
        :raises:
         :class:`ErrorException<azure.mgmt.network.v2018_04_01.models.ErrorException>`

Gives the sas - url to download the configurations for vpn - sites in a resource group .


def
Func
(
arg_0
)
:
if
isinstance
(
arg_0
,
(
int
,
long
)
)
:
return
str
(
arg_0
)
if
isinstance
(
arg_0
,
tuple
)
:
arg_1
=
str
(
arg_0
[
0
]
)
+
"-"
if
len
(
arg_0
)
>
1
:
arg_1
+=
str
(
arg_0
[
1
]
)
return
arg_1
raise
ValueError
(
"Must be an integer or tuple"
)

def Func(arg_0):
    """Unparse a range argument.

    Args:
        obj: An article range. There are a number of valid formats; an integer
            specifying a single article or a tuple specifying an article range.
            If the range doesn't give a start article then all articles up to
            the specified last article are included. If the range doesn't
            specify a last article then all articles from the first specified
            article up to the current last article for the group are included.

    Returns:
        The range as a string that can be used by an NNTP command.

    Note: Sample valid formats.
        4678
        (,5234)
        (4245,)
        (4245, 5234)
    """
    if isinstance(arg_0, (int, long)):
        return str(arg_0)

    if isinstance(arg_0, tuple):
        arg_1 = str(arg_0[0]) + "-"
        if len(arg_0) > 1:
            arg_1 += str(arg_0[1])
        return arg_1

    raise ValueError("Must be an integer or tuple")


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
[
'+++\n'
,
'date = "{}"\n'
.
format
(
date
.
today
(
)
.
isoformat
(
)
)
,
'title = "{}"\n'
.
format
(
arg_1
)
,
'author = "The COBRApy Team"\n'
,
'release = "{}"\n'
.
format
(
arg_2
)
,
'+++\n'
,
'\n'
]
with
open
(
arg_0
,
"r"
)
as
file_h
:
arg_4
=
insert_break
(
file_h
.
readlines
(
)
)
arg_3
.
extend
(
arg_4
)
with
open
(
arg_0
,
"w"
)
as
file_h
:
file_h
.
writelines
(
arg_3
)

def Func(arg_0, arg_1, arg_2):
    """
    Build the markdown release notes for Hugo.

    Inserts the required TOML header with specific values and adds a break
    for long release notes.

    Parameters
    ----------
    filename : str, path
        The release notes file.
    tag : str
        The tag, following semantic versioning, of the current release.
    bump : {"major", "minor", "patch", "alpha", "beta"}
        The type of release.

    """
    arg_3 = [
        '+++\n',
        'date = "{}"\n'.format(date.today().isoformat()),
        'title = "{}"\n'.format(arg_1),
        'author = "The COBRApy Team"\n',
        'release = "{}"\n'.format(arg_2),
        '+++\n',
        '\n'
    ]
    with open(arg_0, "r") as file_h:
        arg_4 = insert_break(file_h.readlines())
    arg_3.extend(arg_4)
    with open(arg_0, "w") as file_h:
        file_h.writelines(arg_3)

Build the markdown release notes for Hugo .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , QuantumCircuit ) : arg_1 = arg_1 . to_instruction ( ) arg_2 = SuperOp ( np . eye ( 4 ** arg_1 . num_qubits ) ) arg_2 . _append_instruction ( arg_1 ) return arg_2

def Func(arg_0, arg_1):
        """Convert a QuantumCircuit or Instruction to a SuperOp."""
        # Convert circuit to an instruction
        if isinstance(arg_1, QuantumCircuit):
            arg_1 = arg_1.to_instruction()
        # Initialize an identity superoperator of the correct size
        # of the circuit
        arg_2 = SuperOp(np.eye(4 ** arg_1.num_qubits))
        arg_2._append_instruction(arg_1)
        return arg_2

Convert a QuantumCircuit or Instruction to a SuperOp .


def
Func
(
arg_0
,
arg_1
=
False
)
:
arg_0
.
operation_costs
=
dict
(
)
arg_0
.
operation_costs
[
""
]
=
{
c
:
1.0
for
c
in
list
(
arg_0
.
alphabet
)
+
[
' '
]
}
for
arg_3
in
arg_0
.
alphabet
:
arg_4
=
{
c
:
1.0
for
c
in
arg_0
.
alphabet
}
arg_4
[
arg_3
]
=
0.0
arg_4
[
""
]
=
1.0
if
arg_1
:
arg_4
[
" "
]
=
1.0
arg_0
.
operation_costs
[
arg_3
]
=
arg_4
for
arg_3
,
arg_5
in
itertools
.
permutations
(
arg_0
.
alphabet
,
2
)
:
arg_0
.
operation_costs
[
arg_3
+
arg_5
]
=
{
arg_5
+
arg_3
:
1.0
}
if
arg_1
:
arg_0
.
operation_costs
[
" "
]
=
{
c
:
1.0
for
c
in
arg_0
.
alphabet
}
arg_0
.
operation_costs
[
" "
]
[
""
]
=
1.0

def Func(arg_0, arg_1=False):
        """
        sets 1.0 cost for every replacement, insertion, deletion and transposition
        """
        arg_0.operation_costs = dict()
        arg_0.operation_costs[""] = {c: 1.0 for c in list(arg_0.alphabet) + [' ']}
        for arg_3 in arg_0.alphabet:
            arg_4 = {c: 1.0 for c in arg_0.alphabet}
            arg_4[arg_3] = 0.0
            arg_4[""] = 1.0
            if arg_1:
                arg_4[" "] = 1.0
            arg_0.operation_costs[arg_3] = arg_4
        # транспозиции
        for arg_3, arg_5 in itertools.permutations(arg_0.alphabet, 2):
            arg_0.operation_costs[arg_3 + arg_5] = {arg_5 + arg_3: 1.0}
        # пробелы
        if arg_1:
            arg_0.operation_costs[" "] = {c: 1.0 for c in arg_0.alphabet}
            arg_0.operation_costs[" "][""] = 1.0

sets 1 . 0 cost for every replacement insertion deletion and transposition


def Func(arg_0):
        """ A parameter derived from Sersic index which ensures that effective radius contains 50% of the profile's
        total integrated light.
        """
        return (2 * arg_0.sersic_index) - (1. / 3.) + (4. / (405. * arg_0.sersic_index)) + (
                46. / (25515. * arg_0.sersic_index ** 2)) + (131. / (1148175. * arg_0.sersic_index ** 3)) - (
                       2194697. / (30690717750. * arg_0.sersic_index ** 4))

A parameter derived from Sersic index which ensures that effective radius contains 50% of the profile s total integrated light .


def Func ( arg_0 , arg_1 ) : try : arg_0 . _clients . remove ( id ( arg_1 ) ) except ValueError : pass if len ( arg_0 . _clients ) < 1 : arg_0 . close ( )

def Func(arg_0, arg_1):
        # type: (object) -> None
        """Remove the client from the users of the socket.

        If there are no more clients for the socket, it
        will close automatically.
        """

        try:
            arg_0._clients.remove(id(arg_1))
        except ValueError:
            pass

        if len(arg_0._clients) < 1:
            arg_0.close()

Remove the client from the users of the socket .


(job_descriptor, provider_name, input_providers,
                                 output_providers, logging_providers)

def Func(arg_0, arg_1, arg_2,
                                 arg_3, arg_4):
  """Validate that arguments passed to submit_job have valid file providers.

  This utility function takes resources and task data args from `submit_job`
  in the base provider. This function will fail with a value error if any of the
  parameters are not valid. See the following example;

  >>> job_resources = type('', (object,),
  ...    {"logging": job_model.LoggingParam('gs://logtemp', job_model.P_GCS)})()
  >>> job_params={'inputs': set(), 'outputs': set(), 'mounts': set()}
  >>> task_descriptors = [
  ...     job_model.TaskDescriptor(None, {
  ...       'inputs': {
  ...           job_model.FileParam('IN', uri='gs://in/*',
  ...                               file_provider=job_model.P_GCS)},
  ...       'outputs': set()}, None),
  ...     job_model.TaskDescriptor(None, {
  ...       'inputs': set(),
  ...       'outputs': {
  ...           job_model.FileParam('OUT', uri='gs://out/*',
  ...                               file_provider=job_model.P_GCS)}}, None)]
  ...
  >>> Func(job_model.JobDescriptor(None, job_params,
  ...                              job_resources, task_descriptors),
  ...                              provider_name='MYPROVIDER',
  ...                              input_providers=[job_model.P_GCS],
  ...                              output_providers=[job_model.P_GCS],
  ...                              logging_providers=[job_model.P_GCS])
  ...
  >>> Func(job_model.JobDescriptor(None, job_params,
  ...                              job_resources, task_descriptors),
  ...                              provider_name='MYPROVIDER',
  ...                              input_providers=[job_model.P_GCS],
  ...                              output_providers=[job_model.P_LOCAL],
  ...                              logging_providers=[job_model.P_GCS])
  Traceback (most recent call last):
       ...
  ValueError: Unsupported output path (gs://out/*) for provider 'MYPROVIDER'.

  Args:
    job_descriptor: instance of job_model.JobDescriptor.
    provider_name: (str) the name of the execution provider.
    input_providers: (string collection) whitelist of file providers for input.
    output_providers: (string collection) whitelist of providers for output.
    logging_providers: (string collection) whitelist of providers for logging.

  Raises:
    ValueError: if any file providers do not match the whitelists.
  """
  arg_5 = arg_0.job_resources
  arg_6 = arg_0.job_params
  arg_7 = arg_0.task_descriptors

  # Validate logging file provider.
  _validate_providers([arg_5.logging], 'logging', arg_4,
                      arg_1)

  # Validate job input and output file providers
  _validate_providers(arg_6['inputs'], 'input', arg_2,
                      arg_1)
  _validate_providers(arg_6['outputs'], 'output', arg_3,
                      arg_1)

  # Validate input and output file providers.
  for arg_8 in arg_7:
    _validate_providers(arg_8.task_params['inputs'], 'input',
                        arg_2, arg_1)
    _validate_providers(arg_8.task_params['outputs'], 'output',
                        arg_3, arg_1)

Validate that arguments passed to submit_job have valid file providers.

  This utility function takes resources and task data args from `submit_job`
  in the base provider. This function will fail with a value error if any of the
  parameters are not valid. See the following example;

  >>> job_resources = type('', (object,),
  ...    {"logging": job_model.LoggingParam('gs://logtemp', job_model.P_GCS)})()
  >>> job_params={'inputs': set(), 'outputs': set(), 'mounts': set()}
  >>> task_descriptors = [
  ...     job_model.TaskDescriptor(None, {
  ...       'inputs': {
  ...           job_model.FileParam('IN', uri='gs://in/*',
  ...                               file_provider=job_model.P_GCS)},
  ...       'outputs': set()}, None),
  ...     job_model.TaskDescriptor(None, {
  ...       'inputs': set(),
  ...       'outputs': {
  ...           job_model.FileParam('OUT', uri='gs://out/*',
  ...                               file_provider=job_model.P_GCS)}}, None)]
  ...
  >>> validate_submit_args_or_fail(job_model.JobDescriptor(None, job_params,
  ...                              job_resources, task_descriptors),
  ...                              provider_name='MYPROVIDER',
  ...                              input_providers=[job_model.P_GCS],
  ...                              output_providers=[job_model.P_GCS],
  ...                              logging_providers=[job_model.P_GCS])
  ...
  >>> validate_submit_args_or_fail(job_model.JobDescriptor(None, job_params,
  ...                              job_resources, task_descriptors),
  ...                              provider_name='MYPROVIDER',
  ...                              input_providers=[job_model.P_GCS],
  ...                              output_providers=[job_model.P_LOCAL],
  ...                              logging_providers=[job_model.P_GCS])
  Traceback (most recent call last):
       ...
  ValueError: Unsupported output path (gs://out/*) for provider 'MYPROVIDER'.

  Args:
    job_descriptor: instance of job_model.JobDescriptor.
    provider_name: (str) the name of the execution provider.
    input_providers: (string collection) whitelist of file providers for input.
    output_providers: (string collection) whitelist of providers for output.
    logging_providers: (string collection) whitelist of providers for logging.

  Raises:
    ValueError: if any file providers do not match the whitelists.

Validate that arguments passed to submit_job have valid file providers .


(self,
                               wildcard_key, bucket_name=None, delimiter='')

return self.get_wildcard_key(wildcard_key=wildcard_key,
                                     bucket_name=bucket_name,
                                     delimiter=delimiter) is not None

def Func(arg_0,
                               arg_1, arg_2=None, arg_3=''):
        """
        Checks that a key matching a wildcard expression exists in a bucket

        :param wildcard_key: the path to the key
        :type wildcard_key: str
        :param bucket_name: the name of the bucket
        :type bucket_name: str
        :param delimiter: the delimiter marks key hierarchy
        :type delimiter: str
        """
        return arg_0.get_wildcard_key(arg_1=arg_1,
                                     arg_2=arg_2,
                                     arg_3=arg_3) is not None


def Func ( arg_0 , arg_1 ) : if len ( arg_1 ) == 1 : arg_0 . pretty_print ( arg_0 . s3handler ( ) . list_buckets ( ) ) return arg_0 . validate ( 'cmd|s3' , arg_1 ) arg_0 . pretty_print ( arg_0 . s3handler ( ) . s3walk ( arg_1 [ 1 ] ) )

def Func(arg_0, arg_1):
    '''Handler for ls command'''
    if len(arg_1) == 1:
      arg_0.pretty_print(arg_0.s3handler().list_buckets())
      return

    arg_0.validate('cmd|s3', arg_1)
    arg_0.pretty_print(arg_0.s3handler().s3walk(arg_1[1]))


def Func ( arg_0 ) : arg_1 = GodotDataParser ( ) arg_2 = arg_1 . parse_dot_data ( arg_0 . dot_code ) if arg_2 is not None : arg_0 . model = arg_2

def Func(arg_0):
        """ Parses the dot_code string and replaces the existing model.
        """
        arg_1 = GodotDataParser()
        arg_2  = arg_1.parse_dot_data(arg_0.dot_code)
        if arg_2 is not None:
            arg_0.model = arg_2

Parses the dot_code string and replaces the existing model .


def Func(arg_0, arg_1):
    """Update sent packet metrics"""
    arg_0.update_count(arg_0.SENT_PKT_COUNT)
    arg_0.update_count(arg_0.SENT_PKT_SIZE, incr_by=arg_1)


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_1 . Func ( ) if not py3compat . PY3 and not isinstance ( arg_3 , unicode ) : arg_3 = py3compat . str_to_unicode ( arg_3 ) return arg_0 . Funcs ( arg_3 , ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        """Read a notebook from a file like object"""
        arg_3 = arg_1.Func()
        if not py3compat.PY3 and not isinstance(arg_3, unicode):
            arg_3 = py3compat.str_to_unicode(arg_3)
        return arg_0.Funcs(arg_3, **arg_2)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
0
)
:
if
not
scipy
.
sparse
.
isspmatrix
(
arg_0
)
:
return
np
.
roll
(
arg_0
,
arg_1
,
arg_2
=
arg_2
)
if
arg_2
not
in
[
0
,
1
,
1
]
:
raise
ParameterError
(
'axis must be one of (0, 1, -1)'
)
arg_1
=
np
.
mod
(
arg_1
,
arg_0
.
shape
[
arg_2
]
)
if
arg_1
==
0
:
return
arg_0
.
copy
(
)
arg_3
=
arg_0
.
format
if
arg_2
==
0
:
arg_0
=
arg_0
.
tocsc
(
)
elif
arg_2
in
(
1
,
1
)
:
arg_0
=
arg_0
.
tocsr
(
)
arg_4
=
scipy
.
sparse
.
lil_matrix
(
arg_0
.
shape
,
dtype
=
arg_0
.
dtype
)
arg_5
=
[
slice
(
)
]
*
arg_0
.
ndim
arg_6
=
[
slice
(
)
]
*
arg_4
.
ndim
arg_5
[
arg_2
]
=
slice
(
0
,
arg_1
)
arg_6
[
arg_2
]
=
slice
(
arg_1
,
)
arg_4
[
arg_7
(
arg_6
)
]
=
arg_0
[
arg_7
(
arg_5
)
]
arg_6
[
arg_2
]
=
slice
(
0
,
arg_1
)
arg_5
[
arg_2
]
=
slice
(
arg_1
,
)
arg_4
[
arg_7
(
arg_6
)
]
=
arg_0
[
arg_7
(
arg_5
)
]
return
arg_4
.
asformat
(
arg_3
)

def Func(arg_0, arg_1, arg_2=0):
    '''Sparse matrix roll

    This operation is equivalent to ``numpy.roll``, but operates on sparse matrices.

    Parameters
    ----------
    x : scipy.sparse.spmatrix or np.ndarray
        The sparse matrix input

    shift : int
        The number of positions to roll the specified axis

    axis : (0, 1, -1)
        The axis along which to roll.

    Returns
    -------
    x_rolled : same type as `x`
        The rolled matrix, with the same format as `x`

    See Also
    --------
    numpy.roll

    Examples
    --------
    >>> # Generate a random sparse binary matrix
    >>> X = scipy.sparse.lil_matrix(np.random.randint(0, 2, size=(5,5)))
    >>> X_roll = Func(X, 2, axis=0)  # Roll by 2 on the first axis
    >>> X_dense_r = Func(X.toarray(), 2, axis=0)  # Equivalent dense roll
    >>> np.allclose(X_roll, X_dense_r.toarray())
    True
    '''
    if not scipy.sparse.isspmatrix(arg_0):
        return np.roll(arg_0, arg_1, arg_2=arg_2)

    # shift-mod-length lets us have shift > x.shape[axis]
    if arg_2 not in [0, 1, -1]:
        raise ParameterError('axis must be one of (0, 1, -1)')

    arg_1 = np.mod(arg_1, arg_0.shape[arg_2])

    if arg_1 == 0:
        return arg_0.copy()

    arg_3 = arg_0.format
    if arg_2 == 0:
        arg_0 = arg_0.tocsc()
    elif arg_2 in (-1, 1):
        arg_0 = arg_0.tocsr()

    # lil matrix to start
    arg_4 = scipy.sparse.lil_matrix(arg_0.shape, dtype=arg_0.dtype)

    arg_5 = [slice(None)] * arg_0.ndim
    arg_6 = [slice(None)] * arg_4.ndim

    arg_5[arg_2] = slice(0, -arg_1)
    arg_6[arg_2] = slice(arg_1, None)
    arg_4[arg_7(arg_6)] = arg_0[arg_7(arg_5)]

    arg_6[arg_2] = slice(0, arg_1)
    arg_5[arg_2] = slice(-arg_1, None)
    arg_4[arg_7(arg_6)] = arg_0[arg_7(arg_5)]

    return arg_4.asformat(arg_3)

Sparse matrix roll

    This operation is equivalent to ``numpy.roll``, but operates on sparse matrices.

    Parameters
    ----------
    x : scipy.sparse.spmatrix or np.ndarray
        The sparse matrix input

    shift : int
        The number of positions to roll the specified axis

    axis : (0, 1, -1)
        The axis along which to roll.

    Returns
    -------
    x_rolled : same type as `x`
        The rolled matrix, with the same format as `x`

    See Also
    --------
    numpy.roll

    Examples
    --------
    >>> # Generate a random sparse binary matrix
    >>> X = scipy.sparse.lil_matrix(np.random.randint(0, 2, size=(5,5)))
    >>> X_roll = roll_sparse(X, 2, axis=0)  # Roll by 2 on the first axis
    >>> X_dense_r = roll_sparse(X.toarray(), 2, axis=0)  # Equivalent dense roll
    >>> np.allclose(X_roll, X_dense_r.toarray())
    True


def Func(arg_0):
        """
        Retrieves the number of members of the organization.
        """
        print 'Getting members.'
        arg_1 = 0
        for arg_2 in arg_0.org_retrieved.iter_members():
            arg_0.members_json[arg_2.id] = arg_2.to_json()
            arg_1 += 1
        return arg_1

Retrieves the number of members of the organization .