def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 : arg_3 = os . path . dirname ( arg_2 ) arg_4 = os . path . basename ( arg_2 ) arg_5 = arg_0 . quilt_patches + Directory ( arg_3 ) arg_5 . create ( ) else : arg_4 = os . path . basename ( arg_1 ) arg_5 = arg_0 . quilt_patches arg_6 = File ( arg_1 ) arg_7 = arg_5 + File ( arg_4 ) arg_6 . copy ( arg_7 ) arg_0 . _Funces ( [ arg_4 ] )

def Func(arg_0, arg_1, arg_2=None):
        """ Import patch into the patch queue
        The patch is inserted as the next unapplied patch.
        """
        if arg_2:
            arg_3 = os.path.dirname(arg_2)
            arg_4 = os.path.basename(arg_2)
            arg_5 = arg_0.quilt_patches + Directory(arg_3)
            arg_5.create()
        else:
            arg_4 = os.path.basename(arg_1)
            arg_5 = arg_0.quilt_patches

        arg_6 = File(arg_1)
        arg_7 = arg_5 + File(arg_4)
        arg_6.copy(arg_7)
        arg_0._Funces([arg_4])

Import patch into the patch queue The patch is inserted as the next unapplied patch .


return (
            'error',
            _(
                'The following learners could not be enrolled in {enrolled_in}: {user_list}'
            ).format(
                enrolled_in=enrolled_in,
                user_list=', '.join(failed_emails),
            )
        )

def Func(arg_0, arg_1, arg_2):
        """
        Create message for the users who were not able to be enrolled in a course or program.

        Args:
            users: An iterable of users who were not successfully enrolled
            enrolled_in (str): A string identifier for the course or program with which enrollment was attempted

        Returns:
        tuple: A 2-tuple containing a message type and message text
        """
        arg_3 = [user.email for user in arg_1]
        return (
            'error',
            _(
                'The following learners could not be enrolled in {enrolled_in}: {user_list}'
            ).format(
                arg_2=arg_2,
                user_list=', '.join(arg_3),
            )
        )

Create message for the users who were not able to be enrolled in a course or program .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 [ 0 ] arg_4 = arg_2 [ 1 : ] arg_5 = 0 arg_6 = len ( arg_3 ) while arg_5 <= arg_6 : arg_0 . ui . column1_label . setText ( arg_3 [ 0 ] . strip ( '\"' ) ) arg_0 . ui . column2_label . setText ( arg_3 [ 1 ] . strip ( '\"' ) ) arg_0 . ui . column3_label . setText ( arg_3 [ 2 ] . strip ( '\"' ) ) arg_0 . ui . column4_label . setText ( arg_3 [ 3 ] . strip ( '\"' ) ) arg_0 . ui . column5_label . setText ( arg_3 [ 4 ] . strip ( '\"' ) ) arg_0 . ui . column6_label . setText ( arg_3 [ 5 ] . strip ( '\"' ) ) arg_0 . ui . column7_label . setText ( arg_3 [ 6 ] . strip ( '\"' ) ) arg_0 . ui . column8_label . setText ( arg_3 [ 7 ] . strip ( '\"' ) ) arg_5 += 1 arg_7 = 0 while arg_7 < len ( arg_4 ) : if arg_7 == arg_1 : arg_0 . ui . column1_result . setText ( arg_4 [ arg_7 ] [ 0 ] ) arg_0 . ui . column2_result . setText ( arg_4 [ arg_7 ] [ 1 ] ) arg_0 . ui . column3_result . setText ( arg_4 [ arg_7 ] [ 2 ] ) arg_0 . ui . column4_result . setText ( arg_4 [ arg_7 ] [ 3 ] ) arg_0 . ui . column5_result . setText ( arg_4 [ arg_7 ] [ 4 ] ) arg_0 . ui . column6_result . setText ( arg_4 [ arg_7 ] [ 5 ] ) arg_0 . ui . column7_result . setText ( arg_4 [ arg_7 ] [ 6 ] ) arg_0 . ui . column8_result . setText ( arg_4 [ arg_7 ] [ 7 ] ) arg_7 += 1

def Func(arg_0, arg_1, arg_2):
        """
        This function displays information about curves.
        Inputs ; num_curve ; The index of the curve's line that we have to display.
                 information ; The array which contains the information, of all curves to display.
        """
        """In this function, the best would to create labels each time we need to create one,
        following the number of labels in label_information.
        #self.essai = QtGui.QLabel(self.ui.tab)
        #self.essai.setGeometry(PyQt4.QtCore.QRect(870,650,111,16))
        #self.essai.setText("ESSAI")
        """

        arg_3 = arg_2[0]
        arg_4 = arg_2[1:]

        arg_5 = 0  # Iterator on all labels of label_information
        arg_6 = len(arg_3)
        while arg_5 <= arg_6:
            arg_0.ui.column1_label.setText(arg_3[0].strip('\"'))
            arg_0.ui.column2_label.setText(arg_3[1].strip('\"'))
            arg_0.ui.column3_label.setText(arg_3[2].strip('\"'))
            arg_0.ui.column4_label.setText(arg_3[3].strip('\"'))
            arg_0.ui.column5_label.setText(arg_3[4].strip('\"'))
            arg_0.ui.column6_label.setText(arg_3[5].strip('\"'))
            arg_0.ui.column7_label.setText(arg_3[6].strip('\"'))
            arg_0.ui.column8_label.setText(arg_3[7].strip('\"'))
            arg_5 += 1

        arg_7 = 0  # Iterator on each line of data_information.
        while arg_7 < len(arg_4):
            if arg_7 == arg_1:
                arg_0.ui.column1_result.setText(arg_4[arg_7][0])
                arg_0.ui.column2_result.setText(arg_4[arg_7][1])
                arg_0.ui.column3_result.setText(arg_4[arg_7][2])
                arg_0.ui.column4_result.setText(arg_4[arg_7][3])
                arg_0.ui.column5_result.setText(arg_4[arg_7][4])
                arg_0.ui.column6_result.setText(arg_4[arg_7][5])
                arg_0.ui.column7_result.setText(arg_4[arg_7][6])
                arg_0.ui.column8_result.setText(arg_4[arg_7][7])
            arg_7 += 1

This function displays information about curves . Inputs ; num_curve ; The index of the curve s line that we have to display . information ; The array which contains the information of all curves to display .


(cls, url, timeout=30, interval=0.3,
                             until_ready=False, store=None, filename=None)

return ffu.wait(timeout=timeout, interval=interval,
                        until_ready=until_ready)

def Func(arg_0, arg_1, arg_2=30, arg_3=0.3,
                             arg_4=False, arg_5=None, arg_6=None):
        """Uploads file from given url and returns ``File`` instance.

        Args:
            - url (str): URL of file to upload to
            - store (Optional[bool]): Should the file be automatically stored
                upon upload. Defaults to None.
                - False - do not store file
                - True - store file (can result in error if autostore
                               is disabled for project)
                - None - use project settings
            - filename (Optional[str]): Name of the uploaded file. If this not
                specified the filename will be obtained from response headers
                or source URL. Defaults to None.
            - timeout (Optional[int]): seconds to wait for successful upload.
                Defaults to 30.
            - interval (Optional[float]): interval between upload status checks.
                Defaults to 0.3.
            - until_ready (Optional[bool]): should we wait until file is
                available via CDN. Defaults to False.

        Returns:
            ``File`` instance

        Raises:
            ``TimeoutError`` if file wasn't uploaded in time

        """
        arg_7 = arg_0.upload_from_url(arg_1, arg_5, arg_6)
        return arg_7.wait(arg_2=arg_2, arg_3=arg_3,
                        arg_4=arg_4)

Uploads file from given url and returns File instance .


def Func ( arg_0 ) : arg_1 = None if arg_0 . id : arg_1 = arg_0 . id elif arg_0 . fingerprint is not None : arg_1 = arg_0 . fingerprint arg_2 = arg_0 . get_data ( "account/keys/%s" % arg_1 , type = GET ) arg_3 = arg_2 [ 'ssh_key' ] for arg_4 in arg_3 . keys ( ) : setattr ( arg_0 , arg_4 , arg_3 [ arg_4 ] ) arg_0 . id = arg_3 [ 'id' ]

def Func(arg_0):
        """
            Load the SSHKey object from DigitalOcean.

            Requires either self.id or self.fingerprint to be set.
        """
        arg_1 = None
        if arg_0.id:
            arg_1 = arg_0.id
        elif arg_0.fingerprint is not None:
            arg_1 = arg_0.fingerprint

        arg_2 = arg_0.get_data("account/keys/%s" % arg_1, type=GET)

        arg_3 = arg_2['ssh_key']

        # Setting the attribute values
        for arg_4 in arg_3.keys():
            setattr(arg_0, arg_4, arg_3[arg_4])
        arg_0.id = arg_3['id']

Load the SSHKey object from DigitalOcean .


def Func ( arg_0 , arg_1 ) : arg_2 = super ( PostgresDbWriter , arg_0 ) . Func ( arg_1 ) for arg_3 in arg_2 : arg_0 . execute ( arg_3 )

def Func(arg_0, arg_1):
        """Send DDL to create the specified `table` triggers

        :Parameters:
          - `table`: an instance of a :py:class:`mysql2pgsql.lib.mysql_reader.MysqlReader.Table` object that represents the table to read/write.

        Returns None
        """
        arg_2 = super(PostgresDbWriter, arg_0).Func(arg_1)
        for arg_3 in arg_2:
            arg_0.execute(arg_3)

Send DDL to create the specified table triggers


def
Func
(
arg_0
)
:
arg_1
=
os
.
path
.
join
(
arg_0
.
workspace
,
'profiling.bin'
)
try
:
return
pstats
.
Stats
(
arg_1
)
except
Exception
as
e
:
logger
.
debug
(
f'Failed to get profiling stats: {e}'
)
return

def Func(arg_0):
        """
        Returns a pstat.Stats instance with profiling results if `run` was called with `should_profile=True`.
        Otherwise, returns `None`.
        """
        arg_1 = os.path.join(arg_0.workspace, 'profiling.bin')
        try:
            return pstats.Stats(arg_1)
        except Exception as e:
            logger.debug(f'Failed to get profiling stats: {e}')
            return None

Returns a pstat . Stats instance with profiling results if run was called with should_profile = True . Otherwise returns None .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
_get_templates
(
)
arg_3
=
[
]
arg_4
=
[
x
for
x
in
arg_2
[
'data'
]
if
arg_1
in
x
[
'name'
]
]
if
len
(
arg_4
)
>
0
:
for
arg_5
in
arg_4
:
arg_6
=
arg_0
.
_get
(
arg_5
[
'id'
]
)
arg_3
.
append
(
arg_6
)
return
arg_3
bot
.
info
(
'No matches found for %s'
%
arg_1
)

def Func(arg_0, arg_1):
    '''load a particular template based on a name. We look for a name IN data,
       so the query name can be a partial string of the full name.

       Parameters
       ==========
       name: the name of a template to look up
    '''
    arg_2 = arg_0._get_templates()
    arg_3 = []

    # The user wants to retrieve a particular configuration
    arg_4 = [x for x in arg_2['data'] if arg_1 in x['name']]
    if len(arg_4) > 0:
        for arg_5 in arg_4:
            arg_6 = arg_0._get(arg_5['id'])
            arg_3.append(arg_6)
        return arg_3

    bot.info('No matches found for %s' %arg_1)

load a particular template based on a name . We look for a name IN data so the query name can be a partial string of the full name .


return map.get(name, None) or map.get(get_ext(name) or None, None)

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . items return arg_2 . get ( arg_1 , None ) or arg_2 . get ( get_ext ( arg_1 ) or None , None )

def Func(arg_0, arg_1):
		"""
		Get the correct content type for a given name
		"""
		arg_2 = arg_0.items
		# first search the overrides (by name)
		# then fall back to the defaults (by extension)
		# finally, return None if unmatched
		return arg_2.get(arg_1, None) or arg_2.get(get_ext(arg_1) or None, None)


(self, key_name, plaintext, authenticated_data=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = arg_0 . get_conn ( ) . projects ( ) . locations ( ) . keyRings ( ) . cryptoKeys ( ) arg_5 = { 'plaintext' : _b64encode ( arg_2 ) } if arg_3 : arg_5 [ 'additionalAuthenticatedData' ] = _b64encode ( arg_3 ) arg_6 = arg_4 . Func ( name = arg_1 , arg_5 = arg_5 ) arg_7 = arg_6 . execute ( num_retries = arg_0 . num_retries ) arg_8 = arg_7 [ 'ciphertext' ] return arg_8

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Encrypts a plaintext message using Google Cloud KMS.

        :param key_name: The Resource Name for the key (or key version)
                         to be used for encyption. Of the form
                         ``projects/*/locations/*/keyRings/*/cryptoKeys/**``
        :type key_name: str
        :param plaintext: The message to be Funced.
        :type plaintext: bytes
        :param authenticated_data: Optional additional authenticated data that
                                   must also be provided to decrypt the message.
        :type authenticated_data: bytes
        :return: The base 64 encoded ciphertext of the original message.
        :rtype: str
        """
        arg_4 = arg_0.get_conn().projects().locations().keyRings().cryptoKeys()
        arg_5 = {'plaintext': _b64encode(arg_2)}
        if arg_3:
            arg_5['additionalAuthenticatedData'] = _b64encode(arg_3)

        arg_6 = arg_4.Func(name=arg_1, arg_5=arg_5)
        arg_7 = arg_6.execute(num_retries=arg_0.num_retries)

        arg_8 = arg_7['ciphertext']
        return arg_8

Encrypts a plaintext message using Google Cloud KMS.

        :param key_name: The Resource Name for the key (or key version)
                         to be used for encyption. Of the form
                         ``projects/*/locations/*/keyRings/*/cryptoKeys/**``
        :type key_name: str
        :param plaintext: The message to be encrypted.
        :type plaintext: bytes
        :param authenticated_data: Optional additional authenticated data that
                                   must also be provided to decrypt the message.
        :type authenticated_data: bytes
        :return: The base 64 encoded ciphertext of the original message.
        :rtype: str

Encrypts a plaintext message using Google Cloud KMS .


def Func ( arg_0 , arg_1 , arg_2 = None ) : return arg_0 . interpret ( parser . expr ( arg_1 ) . totuple ( 1 ) [ 1 ] )

def Func(arg_0, arg_1, arg_2=None):
        """
        Evaluate a PEP 426 environment marker on CPython 2.4+.
        Return a boolean indicating the marker result in this environment.
        Raise SyntaxError if marker is invalid.

        This implementation uses the 'parser' module, which is not implemented
        on
        Jython and has been superseded by the 'ast' module in Python 2.6 and
        later.
        """
        return arg_0.interpret(parser.expr(arg_1).totuple(1)[1])

Evaluate a PEP 426 environment marker on CPython 2 . 4 + . Return a boolean indicating the marker result in this environment . Raise SyntaxError if marker is invalid .


def Func ( arg_0 ) : arg_1 = dict ( ) for ( arg_2 , arg_3 ) in arg_0 [ 'varStates' ] . iteritems ( ) : arg_1 [ arg_2 ] = arg_3 [ 'position' ] return arg_1

def Func(arg_0):
    """Return the position of a particle given its state dict.

    Parameters:
    --------------------------------------------------------------
    retval:     dict() of particle position, keys are the variable names,
                  values are their positions
    """
    arg_1 = dict()
    for (arg_2, arg_3) in arg_0['varStates'].iteritems():
      arg_1[arg_2] = arg_3['position']

    return arg_1

Return the position of a particle given its state dict .


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_1
:
raise
ValueError
(
"Category is required in DiscoIdentity"
)
arg_1
=
unicode
(
arg_1
)
arg_0
.
xmlnode
.
setProp
(
"category"
,
arg_1
.
encode
(
"utf-8"
)
)

def Func(arg_0, arg_1):
        """Set the category of the item.

        :Parameters:
            - `category`: the new category.
        :Types:
            - `category`: `unicode` """
        if not arg_1:
            raise ValueError("Category is required in DiscoIdentity")
        arg_1 = unicode(arg_1)
        arg_0.xmlnode.setProp("category", arg_1.encode("utf-8"))


def Func ( arg_0 ) : arg_1 = glob . glob ( os . path . join ( arg_0 . tmpdir , "*.fa" ) ) arg_2 = glob . glob ( os . path . join ( arg_0 . tmpdir , "*.npy" ) ) for arg_3 in arg_1 + arg_2 : if os . path . exists ( arg_3 ) : os . remove ( arg_3 ) arg_4 = [ os . path . join ( arg_0 . dirs . across , arg_0 . name + ".utemp" ) , os . path . join ( arg_0 . dirs . across , arg_0 . name + ".htemp" ) , os . path . join ( arg_0 . dirs . across , arg_0 . name + "_catcons.tmp" ) , os . path . join ( arg_0 . dirs . across , arg_0 . name + "_cathaps.tmp" ) , os . path . join ( arg_0 . dirs . across , arg_0 . name + "_catshuf.tmp" ) , os . path . join ( arg_0 . dirs . across , arg_0 . name + "_catsort.tmp" ) , os . path . join ( arg_0 . dirs . across , arg_0 . name + ".tmparrs.h5" ) , os . path . join ( arg_0 . dirs . across , arg_0 . name + ".tmp.indels.hdf5" ) , ] for arg_5 in arg_4 : if os . path . exists ( arg_5 ) : os . remove ( arg_5 ) arg_6 = glob . glob ( os . path . join ( arg_0 . dirs . across , '*.tmp.h5' ) ) for arg_7 in arg_6 : if os . path . exists ( arg_7 ) : os . remove ( arg_7 )

def Func(arg_0):
    """
    Function to remove older files. This is called either in substep 1 or after
    the final substep so that tempfiles are retained for restarting interrupted
    jobs until we're sure they're no longer needed.
    """

    ## remove align-related tmp files
    arg_1 = glob.glob(os.path.join(arg_0.tmpdir, "*.fa"))
    arg_2 = glob.glob(os.path.join(arg_0.tmpdir, "*.npy"))
    for arg_3 in arg_1 + arg_2:
        if os.path.exists(arg_3):
            os.remove(arg_3)

    ## remove cluster related files
    arg_4 = [
        os.path.join(arg_0.dirs.across, arg_0.name+".utemp"),
        os.path.join(arg_0.dirs.across, arg_0.name+".htemp"),
        os.path.join(arg_0.dirs.across, arg_0.name+"_catcons.tmp"),
        os.path.join(arg_0.dirs.across, arg_0.name+"_cathaps.tmp"),
        os.path.join(arg_0.dirs.across, arg_0.name+"_catshuf.tmp"),
        os.path.join(arg_0.dirs.across, arg_0.name+"_catsort.tmp"),
        os.path.join(arg_0.dirs.across, arg_0.name+".tmparrs.h5"),
        os.path.join(arg_0.dirs.across, arg_0.name+".tmp.indels.hdf5"),
        ]
    for arg_5 in arg_4:
        if os.path.exists(arg_5):
            os.remove(arg_5)

    ## remove singlecat related h5 files
    arg_6 = glob.glob(os.path.join(arg_0.dirs.across, '*.tmp.h5'))
    for arg_7 in arg_6:
        if os.path.exists(arg_7):
            os.remove(arg_7)

Function to remove older files . This is called either in substep 1 or after the final substep so that tempfiles are retained for restarting interrupted jobs until we re sure they re no longer needed .


return cached_download('http://fate.ffmpeg.org/fate-suite/' + name,
                           os.path.join('fate-suite', name.replace('/', os.path.sep)))

def Func ( arg_0 ) : return cached_download ( 'http://Func.ffmpeg.org/Func-suite/' + arg_0 , os . path . join ( 'Func-suite' , arg_0 . replace ( '/' , os . path . sep ) ) )

def Func(arg_0):
    """Download and return a path to a sample from the FFmpeg test suite.

    Data is handled by :func:`cached_download`.

    See the `FFmpeg Automated Test Environment <https://www.ffmpeg.org/Func.html>`_

    """
    return cached_download('http://Func.ffmpeg.org/Func-suite/' + arg_0,
                           os.path.join('Func-suite', arg_0.replace('/', os.path.sep)))

Download and return a path to a sample from the FFmpeg test suite.

    Data is handled by :func:`cached_download`.

    See the `FFmpeg Automated Test Environment <https://www.ffmpeg.org/fate.html>`_

Download and return a path to a sample from the FFmpeg test suite .


(absent_err, present_err, absent_d, present_d,
                          im_change_frac=0.2, min_derr=0.1)

return (absent_err - present_err) >= err_cutoff

def Func(arg_0, arg_1, arg_2, arg_3,
                          arg_4=0.2, arg_5=0.1):
    """
    Checks whether or not adding a particle should be present.

    Parameters
    ----------
    absent_err : Float
        The state error without the particle.
    present_err : Float
        The state error with the particle.
    absent_d : numpy.ndarray
        The state residuals without the particle.
    present_d : numpy.ndarray
        The state residuals with the particle.
    im_change_frac : Float, optional
        How good the change in error needs to be relative to the change in
        the residuals. Default is 0.2; i.e. return False if the error does
        not decrease by 0.2 x the change in the residuals.
    min_derr : Float, optional
        The minimal improvement in error. Default is 0.1

    Returns
    -------
    Bool
        True if the errors is better with the particle present.
    """
    arg_6 = np.ravel(arg_3 - arg_2)
    arg_7 = np.dot(arg_6, arg_6)
    arg_8 = max([arg_4 * arg_7, arg_5])
    return (arg_0 - arg_1) >= arg_8

Checks whether or not adding a particle should be present .


def Func(arg_0):
        """Resets the builder's state in order to build new packages."""
        # FIXME: this state does not make sense
        arg_0.package_set = False
        arg_0.package_vers_set = False
        arg_0.package_file_name_set = False
        arg_0.package_supplier_set = False
        arg_0.package_originator_set = False
        arg_0.package_down_location_set = False
        arg_0.package_home_set = False
        arg_0.package_verif_set = False
        arg_0.package_chk_sum_set = False
        arg_0.package_source_info_set = False
        arg_0.package_conc_lics_set = False
        arg_0.package_license_declared_set = False
        arg_0.package_license_comment_set = False
        arg_0.package_cr_text_set = False
        arg_0.package_summary_set = False
        arg_0.package_desc_set = False

Resets the builder s state in order to build new packages .


def Func ( arg_0 , arg_1 : arg_2 ) : with open ( arg_1 , 'w' ) as f : f . write ( arg_0 . to_dot ( ) )

def Func(arg_0, arg_1: arg_2):
        """
        write a '.dot' file.
        """
        with open(arg_1, 'w') as f:
            f.write(arg_0.to_dot())


def Func(arg_0):
    """When removing an object, other objects with references to the current
    object should remove those references. This function identifies objects
    with forward references to the current object, then removes those
    references.

    :param obj: Object to which forward references should be removed

    """
    for arg_1, arg_2 in arg_0._backrefs_flat:

        # Unpack stack
        arg_3, arg_4, arg_5 = arg_1

        # Get parent info
        arg_6 = arg_0._collections[arg_4]
        arg_7 = arg_6._pk_to_storage(arg_2)
        arg_8 = arg_6.load(arg_7)
        if arg_8 is None:
            continue

        # Remove forward references
        if arg_8._fields[arg_5]._list:
            getattr(arg_8, arg_5).remove(arg_0)
        else:
            arg_9 = arg_8._fields[arg_5]
            setattr(arg_8, arg_5, arg_9._gen_default())

        # Save
        arg_8.save()

When removing an object other objects with references to the current object should remove those references . This function identifies objects with forward references to the current object then removes those references .


def Func(arg_0, arg_1=None):
    """Call inkscape CLI with arguments and returns its return value.

    Parameters
    ----------
    args_string: list of str

    inkscape_binpath: str

    Returns
    -------
    return_value
        Inkscape command CLI call return value.
    """
    log.debug('Looking for the binary file for inkscape.')

    if arg_1 is None:
        arg_1 = get_inkscape_binpath()

    if arg_1 is None or not os.path.exists(arg_1):
        raise IOError(
            'Inkscape binary has not been found. Please check configuration.'
        )

    return call_command(arg_1, arg_0)

Call inkscape CLI with arguments and returns its return value .


def Func ( arg_0 ) : arg_1 = { } for arg_2 , arg_3 in arg_0 . config [ "workspaces" ] . items ( ) : arg_1 [ arg_2 ] = dict ( { "name" : arg_2 } , ** arg_3 ) return arg_1

def Func(arg_0):
        """List all available workspaces."""
        arg_1 = {}

        for arg_2, arg_3 in arg_0.config["workspaces"].items():
            arg_1[arg_2] = dict({"name": arg_2}, **arg_3)

        return arg_1


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : import fnmatch arg_4 = 'inv' in arg_3 and arg_3 . pop ( 'inv' ) arg_5 = re . compile ( fnmatch . translate ( arg_1 ) , * arg_2 , ** arg_3 ) if not arg_4 : for arg_6 in arg_0 : if arg_5 . match ( arg_6 ) : yield arg_6 else : for arg_6 in arg_0 : if not arg_5 . match ( arg_6 ) : yield arg_6

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """Func pipe greps data passed from previous generator
    according to given regular expression.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param pattern: The Func string which used to filter data.
    :type pattern: str|unicode|re pattern object
    :param inv: If true, invert the match condition.
    :type inv: boolean
    :returns: generator
    """
    import fnmatch

    arg_4 = 'inv' in arg_3 and arg_3.pop('inv')
    arg_5 = re.compile(fnmatch.translate(arg_1), *arg_2, **arg_3)

    if not arg_4:
        for arg_6 in arg_0:
            if arg_5.match(arg_6):
                yield arg_6
    else:
        for arg_6 in arg_0:
            if not arg_5.match(arg_6):
                yield arg_6

wildcard pipe greps data passed from previous generator
    according to given regular expression.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param pattern: The wildcard string which used to filter data.
    :type pattern: str|unicode|re pattern object
    :param inv: If true, invert the match condition.
    :type inv: boolean
    :returns: generator

wildcard pipe greps data passed from previous generator according to given regular expression .


def
Func
(
arg_0
,
**
arg_1
)
:
arg_0
.
_fill_project_info
(
arg_1
)
arg_0
.
db
.
TrainLog
.
delete_many
(
arg_1
)
logging
.
info
(
"[Database] Delete TrainLog SUCCESS"
)

def Func(arg_0, **arg_1):
        """Deletes training log.

        Parameters
        -----------
        kwargs : logging information
            Find items to delete, leave it empty to delete all log.

        Examples
        ---------
        Save training log
        >>> db.save_training_log(accuracy=0.33)
        >>> db.save_training_log(accuracy=0.44)

        Delete logs that match the requirement
        >>> db.Func(accuracy=0.33)

        Delete all logs
        >>> db.Func()
        """
        arg_0._fill_project_info(arg_1)
        arg_0.db.TrainLog.delete_many(arg_1)
        logging.info("[Database] Delete TrainLog SUCCESS")

Deletes training log.

        Parameters
        -----------
        kwargs : logging information
            Find items to delete, leave it empty to delete all log.

        Examples
        ---------
        Save training log
        >>> db.save_training_log(accuracy=0.33)
        >>> db.save_training_log(accuracy=0.44)

        Delete logs that match the requirement
        >>> db.delete_training_log(accuracy=0.33)

        Delete all logs
        >>> db.delete_training_log()


def Func ( arg_0 : arg_1 [ arg_2 [ arg_3 , arg_4 ] ] ) -> Mapping [ arg_3 , Set [ arg_4 ] ] : arg_5 = defaultdict ( set ) for arg_6 , arg_7 in arg_0 : arg_5 [ arg_6 ] . add ( arg_7 ) return dict ( arg_5 )

def Func(arg_0: arg_1[arg_2[arg_3, arg_4]]) -> Mapping[arg_3, Set[arg_4]]:
    """Make a dict that accumulates the values for each key in an iterator of doubles."""
    arg_5 = defaultdict(set)
    for arg_6, arg_7 in arg_0:
        arg_5[arg_6].add(arg_7)
    return dict(arg_5)

Make a dict that accumulates the values for each key in an iterator of doubles .


def Func(arg_0, arg_1, arg_2=None):
        r'''Sets `a`, `S1`, `S2` and `Tc` for a specific component before the
        pure-species EOS's `a_alpha_and_derivatives` method is called. Both are
        called by `GCEOSMIX.a_alpha_and_derivatives` for every component.'''
        arg_0.a, arg_0.Tc, arg_0.S1, arg_0.S2  = arg_0.ais[arg_1], arg_0.Tcs[arg_1], arg_0.S1s[arg_1], arg_0.S2s[arg_1]

r Sets a S1 S2 and Tc for a specific component before the pure - species EOS s a_alpha_and_derivatives method is called . Both are called by GCEOSMIX . a_alpha_and_derivatives for every component .


def Func ( arg_0 , arg_1 , Func ) : arg_0 . obj = arg_0 . obj or { } arg_0 . obj [ 'project' ] = arg_1 arg_0 . obj [ 'job' ] = Func

def Func(arg_0, arg_1, Func):  # pylint:disable=redefined-outer-name
    """Commands for jobs."""
    arg_0.obj = arg_0.obj or {}
    arg_0.obj['project'] = arg_1
    arg_0.obj['job'] = Func


(rho, figsize=None, slider=False, show_legend=False)

"""    <script>        requirejs.config({            paths: {                qVisualization: "https://qvisualization.mybluemix.net/q-visualizations"            }        });        require(["qVisualization"], function(qVisualizations) {            qVisualizations.plotState("paulivec_$divNumber",                                      "paulivec",                                      $executions,                                      $options);        });    </script>    """

def Func(arg_0, arg_1=None, arg_2=False, arg_3=False):
    """ Create a paulivec representation.

        Graphical representation of the input array.

        Args:
            rho (array): State vector or density matrix.
            figsize (tuple): Figure size in pixels.
            slider (bool): activate slider
            show_legend (bool): show legend of graph content
    """

    # HTML
    arg_4 = Template("""

    """)

    # JavaScript
    arg_5 = Template("""

    """)
    arg_0 = _validate_input_state(arg_0)
    # set default figure size if none given
    if arg_1 is None:
        arg_1 = (7, 5)

    arg_6 = {'width': arg_1[0], 'height': arg_1[1],
               'slider': int(arg_2), 'show_legend': int(arg_3)}

    # Process data and execute
    arg_7 = str(time.time())
    arg_7 = re.sub('[.]', '', arg_7)

    arg_8 = []
    arg_9 = process_data(arg_0)
    arg_8.append(dict(
        data=arg_9
    ))

    arg_10 = arg_4.substitute({
        'divNumber': arg_7
    })

    arg_11 = arg_5.substitute({
        'divNumber': arg_7,
        'executions': arg_8,
        'options': arg_6
    })

    display(HTML(arg_10 + arg_11))


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = tf . concat ( [ tf . shape ( input = arg_1 ) [ : - arg_2 - 1 ] , tf . shape ( input = arg_1 ) [ tf . rank ( arg_1 ) - arg_2 : ] ] , axis = 0 ) arg_0 *= tf . ones ( arg_3 , dtype = arg_0 . dtype ) arg_0 = tf . expand_dims ( arg_0 , axis = - arg_2 - 1 ) arg_1 *= tf . ones_like ( arg_0 , dtype = arg_1 . dtype ) return arg_0 , arg_1

def Func(arg_0, arg_1, arg_2):
  """Broadcasts the event or samples."""
  # This is the shape of self.samples, without the samples axis, i.e. the shape
  # of the result of a call to dist.sample(). This way we can broadcast it with
  # event to get a properly-sized event, then add the singleton dim back at
  # -event_ndims - 1.
  arg_3 = tf.concat(
      [tf.shape(input=arg_1)[:-arg_2 - 1],
       tf.shape(input=arg_1)[tf.rank(arg_1) - arg_2:]],
      axis=0)
  arg_0 *= tf.ones(arg_3, dtype=arg_0.dtype)
  arg_0 = tf.expand_dims(arg_0, axis=-arg_2 - 1)
  arg_1 *= tf.ones_like(arg_0, dtype=arg_1.dtype)

  return arg_0, arg_1


def Func(arg_0, arg_1):
        """Register a transformer instance."""
        if arg_1 not in arg_0._transformers:
            arg_0._transformers.append(arg_1)
            arg_0.sort_transformers()


(self, name, region, size, image, ssh_keys=None,
               backups=None, ipv6=None, private_networking=None, wait=True)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
=
,
arg_6
=
,
arg_7
=
,
arg_8
=
,
arg_9
=
True
)
:
if
arg_5
and
not
isinstance
(
arg_5
,
(
list
,
tuple
)
)
:
raise
TypeError
(
"ssh_keys must be a list"
)
arg_10
=
arg_0
.
post
(
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
arg_5
=
arg_5
,
arg_8
=
arg_8
,
arg_6
=
arg_6
,
arg_7
=
arg_7
)
arg_11
=
arg_0
.
get
(
arg_10
[
arg_0
.
singular
]
[
'id'
]
)
if
arg_9
:
arg_11
.
wait
(
)
arg_11
=
arg_0
.
get
(
arg_10
[
arg_0
.
singular
]
[
'id'
]
)
return
arg_11

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=None,
               arg_6=None, arg_7=None, arg_8=None, arg_9=True):
        """
        Create a new droplet

        Parameters
        ----------
        name: str
            Name of new droplet
        region: str
            slug for region (e.g., sfo1, nyc1)
        size: str
            slug for droplet size (e.g., 512mb, 1024mb)
        image: int or str
            image id (e.g., 12352) or slug (e.g., 'ubuntu-14-04-x64')
        ssh_keys: list, optional
            default SSH keys to be added on creation
            this is highly recommended for ssh access
        backups: bool, optional
            whether automated backups should be enabled for the Droplet.
            Automated backups can only be enabled when the Droplet is Funcd.
        ipv6: bool, optional
            whether IPv6 is enabled on the Droplet
        private_networking: bool, optional
            whether private networking is enabled for the Droplet. Private
            networking is currently only available in certain regions
        wait: bool, default True
            if True then block until creation is complete
        """
        if arg_5 and not isinstance(arg_5, (list, tuple)):
            raise TypeError("ssh_keys must be a list")
        arg_10 = arg_0.post(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4,
                         arg_5=arg_5,
                         arg_8=arg_8,
                         arg_6=arg_6, arg_7=arg_7)
        arg_11 = arg_0.get(arg_10[arg_0.singular]['id'])
        if arg_9:
            arg_11.wait()
        # HACK sometimes the IP address doesn't return correctly
        arg_11 = arg_0.get(arg_10[arg_0.singular]['id'])
        return arg_11

Create a new droplet

        Parameters
        ----------
        name: str
            Name of new droplet
        region: str
            slug for region (e.g., sfo1, nyc1)
        size: str
            slug for droplet size (e.g., 512mb, 1024mb)
        image: int or str
            image id (e.g., 12352) or slug (e.g., 'ubuntu-14-04-x64')
        ssh_keys: list, optional
            default SSH keys to be added on creation
            this is highly recommended for ssh access
        backups: bool, optional
            whether automated backups should be enabled for the Droplet.
            Automated backups can only be enabled when the Droplet is created.
        ipv6: bool, optional
            whether IPv6 is enabled on the Droplet
        private_networking: bool, optional
            whether private networking is enabled for the Droplet. Private
            networking is currently only available in certain regions
        wait: bool, default True
            if True then block until creation is complete


def Func(arg_0, arg_1, arg_2, arg_3):
        """Saves the specified file to the configured S3 bucket."""

        arg_4 = S3Connection(arg_0.access_key_id, arg_0.access_key_secret)
        arg_5 = arg_4.get_bucket(arg_0.bucket_name)

        arg_6 = arg_0._get_s3_path(arg_2)
        arg_7 = arg_5.new_key(arg_6)
        arg_7.set_contents_from_string(arg_1.getvalue())
        arg_7.set_acl(arg_0.acl)

        if arg_0.filesize_field:
            setattr(arg_3, arg_0.filesize_field, arg_7.size)

        return arg_2

Saves the specified file to the configured S3 bucket .


def
Func
(
arg_0
,
arg_1
=
'r'
)
:
if
not
op
.
exists
(
arg_0
)
:
raise
IOError
(
'Could not find file {}.'
.
format
(
arg_0
)
)
try
:
arg_2
=
h5py
.
File
(
arg_0
,
arg_1
=
arg_1
)
except
:
raise
else
:
return
arg_2

def Func(arg_0, arg_1='r'):
    """ Return the h5py.File given its file path.

    Parameters
    ----------
    file_path: string
        HDF5 file path

    mode: string
        r   Readonly, file must exist
        r+  Read/write, file must exist
        w   Create file, truncate if exists
        w-  Create file, fail if exists
        a   Read/write if exists, create otherwise (default)

    Returns
    -------
    h5file: h5py.File
    """
    if not op.exists(arg_0):
        raise IOError('Could not find file {}.'.format(arg_0))

    try:
        arg_2 = h5py.File(arg_0, arg_1=arg_1)
    except:
        raise
    else:
        return arg_2

Return the h5py . File given its file path .


def Func ( arg_0 : arg_1 . FunctionDef ) -> bool : arg_3 = ( "functools.singledispatch" , "singledispatch.singledispatch" , ) if not isinstance ( arg_0 , arg_1 . FunctionDef ) : return False arg_4 = arg_0 . decorators . nodes if arg_0 . decorators else [ ] for arg_5 in arg_4 : if not isinstance ( arg_5 , arg_1 . Call ) : continue arg_6 = arg_5 . func if not isinstance ( arg_6 , arg_1 . Attribute ) or arg_6 . attrname != "register" : continue try : arg_7 = next ( arg_6 . expr . infer ( ) ) except arg_1 . InferenceError : continue if isinstance ( arg_7 , arg_1 . FunctionDef ) : return decorated_with ( arg_7 , arg_3 ) return False

def Func(arg_0: arg_1.FunctionDef) -> bool:
    """Check if the given function node is a singledispatch function."""

    arg_3 = (
        "functools.singledispatch",
        "singledispatch.singledispatch",
    )

    if not isinstance(arg_0, arg_1.FunctionDef):
        return False

    arg_4 = arg_0.decorators.nodes if arg_0.decorators else []
    for arg_5 in arg_4:
        # func.register are function calls
        if not isinstance(arg_5, arg_1.Call):
            continue

        arg_6 = arg_5.func
        if not isinstance(arg_6, arg_1.Attribute) or arg_6.attrname != "register":
            continue

        try:
            arg_7 = next(arg_6.expr.infer())
        except arg_1.InferenceError:
            continue

        if isinstance(arg_7, arg_1.FunctionDef):
            # pylint: disable=redundant-keyword-arg; some flow inference goes wrong here
            return decorated_with(arg_7, arg_3)

    return False

Check if the given function node is a singledispatch function .


def
Func
(
arg_0
)
:
if
arg_0
.
_current_token
.
value
!=
'@'
:
return
False
,
arg_1
=
arg_0
.
_current_location
(
)
arg_0
.
_advance_one_token
(
)
arg_2
=
arg_0
.
_parse_selector
(
allow_periods_in_scope
=
True
)
arg_3
=
False
if
arg_0
.
_current_token
.
value
==
'('
:
arg_3
=
True
arg_0
.
_advance
(
)
if
arg_0
.
_current_token
.
value
!=
')'
:
arg_0
.
_raise_syntax_error
(
"Expected ')'."
)
arg_0
.
_advance_one_token
(
)
arg_0
.
_skip_whitespace_and_comments
(
)
with
utils
.
try_with_location
(
arg_1
)
:
arg_4
=
arg_0
.
_delegate
.
configurable_reference
(
arg_2
,
arg_3
)
return
True
,
arg_4

def Func(arg_0):
    """Try to parse a configurable reference (@[scope/name/]fn_name[()])."""
    if arg_0._current_token.value != '@':
      return False, None

    arg_1 = arg_0._current_location()
    arg_0._advance_one_token()
    arg_2 = arg_0._parse_selector(allow_periods_in_scope=True)

    arg_3 = False
    if arg_0._current_token.value == '(':
      arg_3 = True
      arg_0._advance()
      if arg_0._current_token.value != ')':
        arg_0._raise_syntax_error("Expected ')'.")
      arg_0._advance_one_token()
    arg_0._skip_whitespace_and_comments()

    with utils.try_with_location(arg_1):
      arg_4 = arg_0._delegate.configurable_reference(arg_2, arg_3)

    return True, arg_4


def Func ( arg_0 , arg_1 , arg_2 ) : setup_logging ( ) if arg_1 : with open ( os . path . expanduser ( arg_1 ) , "w" ) as f : f . write ( str ( os . getpid ( ) ) ) if not arg_0 : arg_0 = os . getcwd ( ) sys . path . insert ( 0 , arg_0 ) arg_2 = import_queue ( arg_2 ) import psq arg_3 = psq . Worker ( arg_2 = arg_2 ) arg_3 . listen ( )

def Func(arg_0, arg_1, arg_2):
    """
    Standalone PSQ worker.

    The queue argument must be the full importable path to a psq.Queue
    instance.

    Example usage:

        psqworker config.q

        psqworker --path /opt/app queues.fast

    """
    setup_logging()

    if arg_1:
        with open(os.path.expanduser(arg_1), "w") as f:
            f.write(str(os.getpid()))

    if not arg_0:
        arg_0 = os.getcwd()

    sys.path.insert(0, arg_0)

    arg_2 = import_queue(arg_2)

    import psq

    arg_3 = psq.Worker(arg_2=arg_2)

    arg_3.listen()


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . raw ( ) for arg_3 in range ( len ( arg_2 ) ) : arg_2 [ arg_3 ] [ "t" ] += arg_1 return arg_0

def Func(arg_0, arg_1):
        """Shifts all timestamps in the datapoint array by the given number of seconds.
        It is the same as the 'Func' pipescript transform.

        Warning: The shift is performed in-place! This means that it modifies the underlying array::

            d = DatapointArray([{"t":56,"d":1}])
            d.Func(20)
            print(d) # [{"t":76,"d":1}]
        """
        arg_2 = arg_0.raw()
        for arg_3 in range(len(arg_2)):
            arg_2[arg_3]["t"] += arg_1
        return arg_0

Shifts all timestamps in the datapoint array by the given number of seconds.
        It is the same as the 'tshift' pipescript transform.

        Warning: The shift is performed in-place! This means that it modifies the underlying array::

            d = DatapointArray([{"t":56,"d":1}])
            d.tshift(20)
            print(d) # [{"t":76,"d":1}]

Shifts all timestamps in the datapoint array by the given number of seconds . It is the same as the tshift pipescript transform .


def Func(arg_0, arg_1, arg_2):
    """ Cumulative distribution function for the traingle distribution """
    arg_3 = (arg_0+arg_2)**2/(2*arg_2**2)*(0 > arg_0)*(arg_0>-arg_2)
    arg_4 = 1*(arg_0>0)-(arg_2-arg_0)**2/(2*arg_2**2)*(0<arg_0)*(arg_0<arg_2)
    return (1-np.clip(arg_3+arg_4, 0, 1))


def Func ( arg_0 ) : if len ( arg_0 . timer_tasks ) == 0 : return sys . maxsize else : arg_1 = arg_0 . timer_tasks [ 0 ] [ 0 ] - time . time ( ) return arg_1

def Func(arg_0):
    """Get the next timeout from now

    This should be used from do_wait().
    :returns (float) next_timeout, or 10.0 if there are no timer events
    """
    if len(arg_0.timer_tasks) == 0:
      return sys.maxsize
    else:
      arg_1 = arg_0.timer_tasks[0][0] - time.time()
      return arg_1


def Func ( arg_0 ) : for arg_1 in glob . glob ( arg_0 . frameglob ) : os . unlink ( arg_1 )

def Func(arg_0):
        """Delete all frames."""
        for arg_1 in glob.glob(arg_0.frameglob):
            os.unlink(arg_1)


(self, radius : dim.Length, unit_mass='angular',
                                                   critical_surface_density=None)

return list(map(lambda galaxy: galaxy.mass_within_circle_in_units(
                        radius=radius, unit_mass=unit_mass, kpc_per_arcsec=self.kpc_per_arcsec,
                        critical_surface_density=critical_surface_density),
                        self.galaxies))

def Func ( arg_0 , arg_1 : arg_2 . Length , arg_4 = 'angular' , arg_5 = None ) : return list ( map ( lambda galaxy : galaxy . mass_within_circle_in_units ( arg_1 = arg_1 , arg_4 = arg_4 , kpc_per_arcsec = arg_0 . kpc_per_arcsec , arg_5 = arg_5 ) , arg_0 . galaxies ) )

def Func(arg_0, arg_1 : arg_2.Length, arg_4='angular',
                                                   arg_5=None):
        """Compute the total mass of all galaxies in this plane within a circle of specified radius.

        See *galaxy.angular_mass_within_circle* and *mass_profiles.angular_mass_within_circle* for details
        of how this is performed.

        Parameters
        ----------
        radius : float
            The radius of the circle to compute the dimensionless mass within.
        units_mass : str
            The units the mass is returned in (angular | solMass).
        critical_surface_density : float
            The critical surface mass density of the strong lens configuration, which converts mass from angulalr \
            units to physical units (e.g. solar masses).
        """
        return list(map(lambda galaxy: galaxy.mass_within_circle_in_units(
                        arg_1=arg_1, arg_4=arg_4, kpc_per_arcsec=arg_0.kpc_per_arcsec,
                        arg_5=arg_5),
                        arg_0.galaxies))

Compute the total mass of all galaxies in this plane within a circle of specified radius .


def Func(arg_0, arg_1=None):
        """Read and cache the file as a numpy array.

        Store every *stride* line of data; if ``None`` then the class default is used.

        The array is returned with column-first indexing, i.e. for a data file with
        columns X Y1 Y2 Y3 ... the array a will be a[0] = X, a[1] = Y1, ... .
        """
        if arg_1 is None:
            arg_1 = arg_0.stride
        arg_0.corrupted_lineno = []
        arg_3  = 0  # count rows of data
        # cannot use numpy.loadtxt() because xvg can have two types of 'comment' lines
        with utilities.openany(arg_0.real_filename) as xvg:
            arg_4 = []
            arg_5 = None
            for arg_6,arg_7 in enumerate(xvg):
                arg_7 = arg_7.strip()
                if len(arg_7) == 0:
                    continue
                if "label" in arg_7 and "xaxis" in arg_7:
                        arg_0.xaxis = arg_7.split('"')[-2]
                if "label" in arg_7 and "yaxis" in arg_7:
                        arg_0.yaxis = arg_7.split('"')[-2]
                if arg_7.startswith("@ legend"):
                                        if not "legend" in arg_0.metadata: arg_0.metadata["legend"] = []
                                        arg_0.metadata["legend"].append(arg_7.split("legend ")[-1])
                if arg_7.startswith("@ s") and "subtitle" not in arg_7:
                                        arg_11 = arg_7.split("legend ")[-1].replace('"','').strip()
                                        arg_0.names.append(arg_11)
                if arg_7.startswith(('#', '@')) :
                                        continue
                if arg_7.startswith('&'):
                    raise NotImplementedError('{0!s}: Multi-data not supported, only simple NXY format.'.format(arg_0.real_filename))
                # Func line as floats
                try:
                    arg_12 = [float(el) for el in arg_7.split()]
                except:
                    if arg_0.permissive:
                        arg_0.logger.warn("%s: SKIPPING unparsable line %d: %r",
                                         arg_0.real_filename, arg_6+1, arg_7)
                        arg_0.corrupted_lineno.append(arg_6+1)
                        continue
                    arg_0.logger.error("%s: Cannot Func line %d: %r",
                                      arg_0.real_filename, arg_6+1, arg_7)
                    raise
                # check for same number of columns as in previous step
                if arg_5 is not None and len(arg_12) != arg_5:
                    if arg_0.permissive:
                        arg_0.logger.warn("%s: SKIPPING line %d with wrong number of columns: %r",
                                         arg_0.real_filename, arg_6+1, arg_7)
                        arg_0.corrupted_lineno.append(arg_6+1)
                        continue
                    arg_13 = "{0!s}: Wrong number of columns in line {1:d}: {2!r}".format(arg_0.real_filename, arg_6+1, arg_7)
                    arg_0.logger.error(arg_13)
                    raise IOError(errno.ENODATA, arg_13, arg_0.real_filename)
                # finally: a good line
                if arg_3 % arg_1 == 0:
                    arg_5 = len(arg_12)
                    arg_4.append(arg_12)
                arg_3 += 1
        try:
            arg_0.__array = numpy.array(arg_4).transpose()    # cache result
        except:
            arg_0.logger.error("%s: Failed reading XVG file, possibly data corrupted. "
                              "Check the last line of the file...", arg_0.real_filename)
            raise
        finally:
            del arg_4

Read and cache the file as a numpy array .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 [ 'content' ] . get ( 'user_expressions' ) if not arg_2 : return for arg_3 in arg_2 : if arg_3 in arg_0 . _callback_dict : arg_0 . _callback_dict . pop ( arg_3 ) ( arg_2 [ arg_3 ] )

def Func(arg_0, arg_1):
        """Execute `callback` corresponding to `msg` reply, after ``_silent_exec_callback``

        Parameters
        ----------
        msg : raw message send by the kernel containing an `user_expressions`
                and having a 'silent_exec_callback' kind.

        Notes
        -----
        This function will look for a `callback` associated with the
        corresponding message id. Association has been made by
        `_silent_exec_callback`. `callback` is then called with the `repr()`
        of the value of corresponding `user_expressions` as argument.
        `callback` is then removed from the known list so that any message
        coming again with the same id won't trigger it.

        """

        arg_2 = arg_1['content'].get('user_expressions')
        if not arg_2:
            return
        for arg_3 in arg_2:
            if arg_3 in arg_0._callback_dict:
                arg_0._callback_dict.pop(arg_3)(arg_2[arg_3])

Execute callback corresponding to msg reply after _silent_exec_callback


def Func ( arg_0 ) : arg_1 = [ 'Func' ] arg_0 . effects . extend ( arg_1 ) arg_0 . effects_log . append ( 'Func' ) return arg_0

def Func(arg_0):
        '''Reverse the audio completely
        '''
        arg_1 = ['Func']
        arg_0.effects.extend(arg_1)
        arg_0.effects_log.append('Func')

        return arg_0


def Func ( arg_0 , arg_1 = False ) : arg_2 = cv2 . cvtColor ( arg_0 , cv2 . COLOR_BGR2GRAY ) if arg_1 : arg_2 = arg_2 [ ... , None ] return arg_2

def Func(arg_0, arg_1=False):
    """Convert a BGR image to grayscale image.

    Args:
        img (ndarray): The input image.
        keepdim (bool): If False (by default), then return the grayscale image
            with 2 dims, otherwise 3 dims.

    Returns:
        ndarray: The converted grayscale image.
    """
    arg_2 = cv2.cvtColor(arg_0, cv2.COLOR_BGR2GRAY)
    if arg_1:
        arg_2 = arg_2[..., None]
    return arg_2

Convert a BGR image to grayscale image .


(parent: ScheduleComponent, time: int, child: ScheduleComponent,
           name: str = None)

return union(parent, (time, child), name=name)

def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_1,
           arg_5: arg_6 = None) -> Schedule:
    """Return a new schedule with the `child` schedule Funced into the `parent` at `start_time`.

    Args:
        parent: Schedule to be Funced into
        time: Time to be Funced defined with respect to `parent`
        child: Schedule to Func
        name: Name of the new schedule. Defaults to name of parent
    """
    return union(arg_0, (arg_2, arg_4), arg_5=arg_5)

Return a new schedule with the `child` schedule inserted into the `parent` at `start_time`.

    Args:
        parent: Schedule to be inserted into
        time: Time to be inserted defined with respect to `parent`
        child: Schedule to insert
        name: Name of the new schedule. Defaults to name of parent

Return a new schedule with the child schedule inserted into the parent at start_time .


return self.make_response(obj=record.files, pid=pid, record=record)

def Func(arg_0, arg_1, arg_2):
        """Get files.

        Permission required: `read_permission_factory`.

        :param pid: Pid object (from url).
        :param record: Record object resolved from the pid.
        :returns: The files.
        """
        return arg_0.make_response(obj=arg_2.files, arg_1=arg_1, arg_2=arg_2)


def Func(arg_0):
    """
    Gets the codec used for prefix the multicodec prefixed data

    :param bytes bytes_: multicodec prefixed data bytes
    :return: name of the multicodec used to prefix
    :rtype: str
    """
    arg_1 = extract_prefix(arg_0)
    try:
        return CODE_TABLE[arg_1]
    except KeyError:
        raise ValueError('Prefix {} not present in the lookup table'.format(arg_1))


return [containers[name] for name in sorted_names]

def Func ( arg_0 ) : if not isinstance ( arg_0 , collections . Mapping ) : arg_0 = dict ( ( c . name , c ) for c in arg_0 ) arg_1 = dict ( ( arg_3 , set ( c . links . keys ( ) ) ) for arg_3 , c in arg_0 . items ( ) ) arg_2 = _resolve ( arg_1 ) return [ arg_0 [ arg_3 ] for arg_3 in arg_2 ]

def Func(arg_0):
    """Sort a dictionary or list of containers into dependency order

    Returns a sequence
    """
    if not isinstance(arg_0, collections.Mapping):
        arg_0 = dict((c.name, c) for c in arg_0)

    arg_1 = dict((arg_3, set(c.links.keys()))
                           for arg_3, c in arg_0.items())
    arg_2 = _resolve(arg_1)
    return [arg_0[arg_3] for arg_3 in arg_2]


def
Func
(
arg_0
,
arg_1
)
:
if
not
_is_pil_image
(
arg_0
)
:
raise
TypeError
(
'img should be PIL Image. Got {}'
.
format
(
type
(
arg_0
)
)
)
arg_2
=
ImageEnhance
.
Brightness
(
arg_0
)
arg_0
=
arg_2
.
enhance
(
arg_1
)
return
arg_0

def Func(arg_0, arg_1):
    """Adjust brightness of an Image.

    Args:
        img (PIL Image): PIL Image to be adjusted.
        brightness_factor (float):  How much to adjust the brightness. Can be
            any non negative number. 0 gives a black image, 1 gives the
            original image while 2 increases the brightness by a factor of 2.

    Returns:
        PIL Image: Brightness adjusted image.
    """
    if not _is_pil_image(arg_0):
        raise TypeError('img should be PIL Image. Got {}'.format(type(arg_0)))

    arg_2 = ImageEnhance.Brightness(arg_0)
    arg_0 = arg_2.enhance(arg_1)
    return arg_0


async def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . get ( "text" ) arg_4 = await arg_0 . decode_json ( arg_3 ) arg_5 = { "stream" : arg_2 , "payload" : arg_4 } await arg_0 . send_json ( arg_5 )

async def Func(arg_0, arg_1, arg_2):
        """
        Capture downstream websocket.send messages from the upstream applications.
        """
        arg_3 = arg_1.get("text")
        # todo what to do on binary!
        arg_4 = await arg_0.decode_json(arg_3)
        arg_5 = {
            "stream": arg_2,
            "payload": arg_4
        }
        await arg_0.send_json(arg_5)

Capture downstream websocket . send messages from the upstream applications .


return np.random.rand(1) * np.random.randn(points, 1) \
        + random.sample([2, -2], 1)

def Func ( arg_0 ) : return np . random . rand ( 1 ) * np . random . randn ( arg_0 , 1 ) + random . sample ( [ 2 , - 2 ] , 1 )

def Func(arg_0):
    """Init a noise variable."""
    return np.random.rand(1) * np.random.randn(arg_0, 1) \
        + random.sample([2, -2], 1)


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = arg_0 . load_value ( arg_1 , arg_2 = arg_2 ) yield io . BytesIO ( arg_3 ) if arg_2 else io . StringIO ( arg_3 )

def Func(arg_0, arg_1, arg_2=False):
        """
        Return a managed file-like object from which the calling code can read
        previously-serialized data.

        :param key:
        :return: A managed stream-like object
        """
        arg_3 = arg_0.load_value(arg_1, arg_2=arg_2)
        yield io.BytesIO(arg_3) if arg_2 else io.StringIO(arg_3)

Return a managed file - like object from which the calling code can read previously - serialized data .


def Func(arg_0, arg_1):
        """
        A helper method used to Func a symbol name into a memory address when
        injecting hooks for analysis.

        :param symbol: function name to be Funcd
        :type symbol: string

        :param line: if more functions present, optional line number can be included
        :type line: int or None
        """

        with open(arg_0.binary_path, 'rb') as f:

            arg_2 = ELFFile(f)

            # iterate over sections and identify symbol table section
            for arg_3 in arg_2.iter_sections():
                if not isinstance(arg_3, SymbolTableSection):
                    continue

                # get list of symbols by name
                arg_4 = arg_3.get_symbol_by_name(arg_1)
                if not arg_4:
                    continue

                # return first indexed memory address for the symbol,
                return arg_4[0].entry['st_value']

            raise ValueError(f"The {self.binary_path} ELFfile does not contain symbol {symbol}")

A helper method used to resolve a symbol name into a memory address when
        injecting hooks for analysis.

        :param symbol: function name to be resolved
        :type symbol: string

        :param line: if more functions present, optional line number can be included
        :type line: int or None

A helper method used to resolve a symbol name into a memory address when injecting hooks for analysis .


def Func(arg_0, arg_1):
        """
        Append to object, if object is list.
        """
        if arg_0.meta_type == 'dict':
            raise AssertionError('Cannot Func to object of `dict` base type!')
        if arg_0.meta_type == 'list':
            arg_0._list.Func(arg_1)
        return


def Func(arg_0):
    """
    Decodes a PackBit encoded data.
    """
    arg_0 = bytearray(arg_0) # <- python 2/3 compatibility fix
    arg_1 = bytearray()
    arg_2 = 0
    while arg_2 < len(arg_0):
        arg_3 = arg_0[arg_2]
        if arg_3 > 127:
            arg_3 -= 256
        arg_2 += 1

        if 0 <= arg_3 <= 127:
            arg_1.extend(arg_0[arg_2:arg_2+arg_3+1])
            arg_2 += arg_3+1
        elif arg_3 == -128:
            pass
        else:
            arg_1.extend([arg_0[arg_2]] * (1 - arg_3))
            arg_2 += 1

    return bytes(arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _world_state [ arg_1 ] [ 'storage' ] arg_3 = [ ] arg_4 = arg_2 . array while not isinstance ( arg_4 , ArrayVariable ) : arg_3 . append ( ( arg_4 . index , arg_4 . value ) ) arg_4 = arg_4 . array return arg_3

def Func(arg_0, arg_1):
        """
        Gets all items in an account storage

        :param address: account address
        :return: all items in account storage. items are tuple of (index, value). value can be symbolic
        :rtype: list[(storage_index, storage_value)]
        """
        arg_2 = arg_0._world_state[arg_1]['storage']
        arg_3 = []
        arg_4 = arg_2.array
        while not isinstance(arg_4, ArrayVariable):
            arg_3.append((arg_4.index, arg_4.value))
            arg_4 = arg_4.array
        return arg_3


def Func(arg_0, arg_1=True):
  # type: (Union[ModuleType, Text], bool) -> Dict[Text, 'CommandMeta']
  """
  Automatically discover commands in the specified package.

  :param package:
    Package path or reference.

  :param recursively:
    If True, will descend recursively into sub-packages.

  :return:
    All commands discovered in the specified package, indexed by
    command name (note: not class name).
  """
  # http://stackoverflow.com/a/25562415/
  if isinstance(arg_0, string_types):
    arg_0 = import_module(arg_0) # type: ModuleType

  arg_2 = {}

  for arg_3, arg_4, arg_5 in walk_packages(arg_0.__path__, arg_0.__name__ + '.'):
    # Loading the module is good enough; the CommandMeta metaclass will
    # ensure that any commands in the module get registered.

    # Prefix in name module move to function "walk_packages" for fix
    # conflict with names importing packages
    # Bug https://github.com/iotaledger/iota.lib.py/issues/63
    arg_6 = import_module(arg_4)

    # Index any command classes that we find.
    for (arg_3, arg_7) in get_members(arg_6):
      if is_class(arg_7) and isinstance(arg_7, CommandMeta):
        arg_8 = getattr(arg_7, 'command')
        if arg_8:
          arg_2[arg_8] = arg_7

    if arg_1 and arg_5:
      arg_2.update(Func(arg_6))

  return arg_2

Automatically discover commands in the specified package .


def Func(arg_0, arg_1, arg_2):
    """The pprint for classes and types."""
    if arg_0.__module__ in ('__builtin__', 'exceptions'):
        arg_3 = arg_0.__name__
    else:
        arg_3 = arg_0.__module__ + '.' + arg_0.__name__
    arg_1.text(arg_3)


(self, terminal, reward, discount=None, final_reward=0.0, horizon=0)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = 0.0 , arg_5 = 0 ) : if arg_3 is None : arg_3 = arg_0 . discount def cumulate ( arg_6 , arg_7 ) : arg_8 , arg_9 , arg_10 , arg_11 = arg_7 return tf . where ( condition = arg_9 , x = arg_8 , y = tf . where ( condition = arg_10 , x = ( arg_8 + arg_6 * arg_3 - arg_11 ) , y = ( arg_8 + arg_6 * arg_3 ) ) ) def len_ ( arg_6 , arg_12 ) : return tf . where ( condition = arg_12 , x = tf . ones ( shape = ( ) , dtype = tf . int32 ) , y = arg_6 + 1 ) arg_2 = tf . reverse ( tensor = arg_2 , axis = ( 0 , ) ) arg_1 = tf . reverse ( tensor = arg_1 , axis = ( 0 , ) ) arg_13 = tf . scan ( fn = len_ , elems = arg_1 , initializer = 0 ) arg_14 = tf . greater ( arg_13 , tf . fill ( dims = tf . shape ( arg_13 ) , value = arg_5 ) ) if arg_5 > 0 : arg_15 = tf . map_fn ( lambda x : ( arg_3 ** arg_5 ) * x , arg_2 , dtype = tf . float32 ) arg_15 = tf . concat ( [ np . zeros ( shape = ( arg_5 , ) ) , arg_15 ] , axis = 0 ) arg_15 = tf . slice ( arg_15 , begin = ( 0 , ) , size = tf . shape ( arg_2 ) ) else : arg_15 = tf . zeros ( shape = tf . shape ( arg_2 ) ) arg_2 = tf . scan ( fn = cumulate , elems = ( arg_2 , arg_1 , arg_14 , arg_15 ) , initializer = arg_4 if arg_5 != 1 else 0.0 ) return tf . reverse ( tensor = arg_2 , axis = ( 0 , ) )

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=0.0, arg_5=0):
        """
        Creates and returns the TensorFlow operations for calculating the sequence of discounted cumulative rewards
        for a given sequence of single rewards.

        Example:
        single rewards = 2.0 1.0 0.0 0.5 1.0 -1.0
        terminal = False, False, False, False True False
        gamma = 0.95
        final_reward = 100.0 (only matters for last episode (r=-1.0) as this episode has no terminal signal)
        horizon=3
        output = 2.95 1.45 1.38 1.45 1.0 94.0

        Args:
            terminal: Tensor (bool) holding the is-terminal sequence. This sequence may contain more than one
                True value. If its very last element is False (not terminating), the given `final_reward` value
                is assumed to follow the last value in the single rewards sequence (see below).
            reward: Tensor (float) holding the sequence of single rewards. If the last element of `terminal` is False,
                an assumed last reward of the value of `final_reward` will be used.
            discount (float): The discount factor (gamma). By default, take the Model's discount factor.
            final_reward (float): Reward value to use if last episode in sequence does not terminate (terminal sequence
                ends with False). This value will be ignored if horizon == 1 or discount == 0.0.
            horizon (int): The length of the horizon (e.g. for n-step cumulative rewards in continuous tasks
                without terminal signals). Use 0 (default) for an infinite horizon. Note that horizon=1 leads to the
                exact same results as a discount factor of 0.0.

        Returns:
            Discounted cumulative reward tensor with the same shape as `reward`.
        """

        # By default -> take Model's gamma value
        if arg_3 is None:
            arg_3 = arg_0.discount

        # Accumulates discounted (n-step) reward (start new if terminal)
        def cumulate(arg_6, arg_7):
            arg_8, arg_9, arg_10, arg_11 = arg_7
            return tf.where(
                # If terminal, start new cumulation.
                condition=arg_9,
                x=arg_8,
                y=tf.where(
                    # If we are above the horizon length (H) -> subtract discounted value from H steps back.
                    condition=arg_10,
                    x=(arg_8 + arg_6 * arg_3 - arg_11),
                    y=(arg_8 + arg_6 * arg_3)
                )
            )

        # Accumulates length of episodes (starts new if terminal)
        def len_(arg_6, arg_12):
            return tf.where(
                condition=arg_12,
                # Start counting from 1 after is-terminal signal
                x=tf.ones(shape=(), dtype=tf.int32),
                # Otherwise, increase length by 1
                y=arg_6 + 1
            )

        # Reverse, since reward cumulation is calculated right-to-left, but tf.scan only works left-to-right.
        arg_2 = tf.reverse(tensor=arg_2, axis=(0,))
        # e.g. -1.0 1.0 0.5 0.0 1.0 2.0
        arg_1 = tf.reverse(tensor=arg_1, axis=(0,))
        # e.g. F T F F F F

        # Store the steps until end of the episode(s) determined by the input terminal signals (True starts new count).
        arg_13 = tf.scan(fn=len_, elems=arg_1, initializer=0)
        # e.g. 1 1 2 3 4 5
        arg_14 = tf.greater(arg_13, tf.fill(dims=tf.shape(arg_13), value=arg_5))
        # e.g. F F F F T T

        # Calculate the horizon-subtraction value for each step.
        if arg_5 > 0:
            arg_15 = tf.map_fn(lambda x: (arg_3 ** arg_5) * x, arg_2, dtype=tf.float32)
            # Shift right by size of horizon (fill rest with 0.0).
            arg_15 = tf.concat([np.zeros(shape=(arg_5,)), arg_15], axis=0)
            arg_15 = tf.slice(arg_15, begin=(0,), size=tf.shape(arg_2))
            # e.g. 0.0, 0.0, 0.0, -1.0*g^3, 1.0*g^3, 0.5*g^3
        # all 0.0 if infinite horizon (special case: horizon=0)
        else:
            arg_15 = tf.zeros(shape=tf.shape(arg_2))

        # Now do the scan, each time summing up the previous step (discounted by gamma) and
        # subtracting the respective `horizon_subtraction`.
        arg_2 = tf.scan(
            fn=cumulate,
            elems=(arg_2, arg_1, arg_14, arg_15),
            initializer=arg_4 if arg_5 != 1 else 0.0
        )
        # Re-reverse again to match input sequences.
        return tf.reverse(tensor=arg_2, axis=(0,))

Creates and returns the TensorFlow operations for calculating the sequence of discounted cumulative rewards for a given sequence of single rewards .


def Func(arg_0):
        """
        Converts the credentials to a percent encoded string to be stored for
        later use.

        :returns:
            :class:`string`

        """

        if arg_0.provider_id is None:
            raise ConfigError(
                'To Func credentials you need to specify a '
                'unique integer under the "id" key in the config '
                'for each provider!')

        # Get the provider type specific items.
        arg_1 = arg_0.provider_type_class().to_tuple(arg_0)

        # Provider ID and provider type ID are always the first two items.
        arg_2 = (arg_0.provider_id, arg_0.provider_type_id) + arg_1

        # Make sure that all items are strings.
        arg_3 = [str(i) for i in arg_2]

        # Concatenate by newline.
        arg_4 = '\n'.join(arg_3)

        # Percent encode.
        return parse.quote(arg_4, '')

Converts the credentials to a percent encoded string to be stored for later use .


def
Func
(
arg_0
)
:
for
arg_1
in
[
'bucket_name'
,
's3'
]
:
if
not
hasattr
(
arg_0
,
arg_1
)
:
bot
.
exit
(
'client is missing attribute %s'
%
(
arg_1
)
)
arg_0
.
bucket
=
for
arg_2
in
arg_0
.
s3
.
buckets
.
all
(
)
:
if
arg_2
.
name
==
arg_0
.
bucket_name
:
arg_0
.
bucket
=
arg_2
if
arg_0
.
bucket
is
:
arg_0
.
bucket
=
arg_0
.
s3
.
create_bucket
(
Bucket
=
arg_0
.
bucket_name
)
bot
.
info
(
'Created bucket %s'
%
arg_0
.
bucket
.
name
)
return
arg_0
.
bucket

def Func(arg_0):
        '''given a bucket name and a client that is initialized, get or
           create the bucket.
        '''
        for arg_1 in ['bucket_name', 's3']:
            if not hasattr(arg_0, arg_1):
                bot.exit('client is missing attribute %s' %(arg_1))

        # See if the bucket is already existing
        arg_0.bucket = None
        for arg_2 in arg_0.s3.buckets.all():
            if arg_2.name == arg_0.bucket_name:
                arg_0.bucket = arg_2

        # If the bucket doesn't exist, create it
        if arg_0.bucket is None:
            arg_0.bucket = arg_0.s3.create_bucket(Bucket=arg_0.bucket_name)
            bot.info('Created bucket %s' % arg_0.bucket.name )

        return arg_0.bucket

given a bucket name and a client that is initialized get or create the bucket .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , QuantumCircuit ) : arg_1 = arg_1 . to_instruction ( ) arg_2 = Operator ( np . eye ( 2 ** 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 an Operator."""
        # Convert circuit to an instruction
        if isinstance(arg_1, QuantumCircuit):
            arg_1 = arg_1.to_instruction()
        # Initialize an identity operator of the correct size of the circuit
        arg_2 = Operator(np.eye(2 ** arg_1.num_qubits))
        arg_2._append_instruction(arg_1)
        return arg_2

Convert a QuantumCircuit or Instruction to an Operator .


def Func ( arg_0 , arg_1 ) : arg_1 . write ( Operators . ITEBV ( arg_1 . size , arg_0 . PF == False , 1 , 0 ) )

def Func(arg_0, arg_1):
        """
        Sets byte if parity odd.

        :param cpu: current CPU.
        :param dest: destination operand.
        """
        arg_1.write(Operators.ITEBV(arg_1.size, arg_0.PF == False, 1, 0))


def Func(arg_0):
    """
    Given an X.509 certificate, extract and return the client identity.
    """
    arg_1 = get_common_names_from_certificate(arg_0)

    if len(arg_1) > 0:
        if len(arg_1) > 1:
            raise exceptions.PermissionDenied(
                "Multiple client identities found."
            )
        return arg_1[0]
    else:
        raise exceptions.PermissionDenied(
            "The certificate does not define any subject common names. "
            "Client identity unavailable."
        )

Given an X . 509 certificate extract and return the client identity .


def Func(arg_0):
  """
  Decorator for functions that require anomaly models.
  """
  @wraps(arg_0)
  def _decorator(arg_1, *arg_2, **arg_3):
    if not arg_1.getInferenceType() == InferenceType.TemporalAnomaly:
      raise RuntimeError("Method required a TemporalAnomaly model.")
    if arg_1._getAnomalyClassifier() is None:
      raise RuntimeError("Model does not support this command. Model must"
          "be an active anomalyDetector model.")
    return arg_0(arg_1, *arg_2, **arg_3)
  return _decorator

Decorator for functions that require anomaly models .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_0 : arg_4 = [ ] arg_5 = arg_3 . get ( 'position' ) arg_6 = '>' . join ( [ arg_3 . get ( 'reference' ) , arg_3 . get ( 'alternative' ) ] ) arg_4 . append ( arg_5 ) arg_4 . append ( arg_6 ) arg_4 . append ( str ( arg_5 ) + arg_6 ) arg_7 = [ ] arg_8 = [ ] for arg_9 in arg_3 . get ( 'genes' ) : arg_7 . append ( arg_9 . get ( 'hgnc_symbol' , '' ) ) for arg_10 in arg_9 . get ( 'transcripts' ) : if arg_10 . get ( 'is_canonical' ) and arg_10 . get ( 'protein_sequence_name' ) : arg_8 . append ( urllib . parse . unquote ( arg_10 . get ( 'protein_sequence_name' ) ) ) arg_4 . append ( ',' . join ( arg_8 ) ) arg_4 . append ( ',' . join ( arg_7 ) ) arg_11 = '' arg_12 = '' for arg_13 in arg_3 [ 'samples' ] : if arg_13 . get ( 'sample_id' ) == arg_1 : arg_11 = arg_13 [ 'allele_depths' ] [ 0 ] arg_12 = arg_13 [ 'allele_depths' ] [ 1 ] arg_4 . append ( arg_11 ) arg_4 . append ( arg_12 ) arg_2 . append ( arg_4 ) return arg_2

def Func(arg_0, arg_1):
    """Export mitochondrial variants for a case to create a MT excel report

    Args:
        variants(list): all MT variants for a case, sorted by position
        sample_id(str) : the id of a sample within the case

    Returns:
        document_lines(list): list of lines to include in the document
    """
    arg_2 = []
    for arg_3 in arg_0:
        arg_4 = []
        arg_5 = arg_3.get('position')
        arg_6 = '>'.join([arg_3.get('reference'),arg_3.get('alternative')])
        arg_4.append(arg_5)
        arg_4.append(arg_6)
        arg_4.append(str(arg_5)+arg_6)
        arg_7 = []
        arg_8 = []
        for arg_9 in arg_3.get('genes'):
            arg_7.append(arg_9.get('hgnc_symbol',''))
            for arg_10 in arg_9.get('transcripts'):
                if arg_10.get('is_canonical') and arg_10.get('protein_sequence_name'):
                    arg_8.append(urllib.parse.unquote(arg_10.get('protein_sequence_name')))
        arg_4.append(','.join(arg_8))
        arg_4.append(','.join(arg_7))
        arg_11 = ''
        arg_12 = ''
        for arg_13 in arg_3['samples']:
            if arg_13.get('sample_id') == arg_1:
                arg_11 = arg_13['allele_depths'][0]
                arg_12 = arg_13['allele_depths'][1]
        arg_4.append(arg_11)
        arg_4.append(arg_12)
        arg_2.append(arg_4)
    return arg_2


(self, fieldNames=None, datemap=None, time_format=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        '''
        Output all fields using the fieldNames list. for fields in the list datemap indicates the field must
        be date
        '''

        arg_4 = arg_0.printCursor(arg_0._cursor, arg_1, arg_2, arg_3)

Output all fields using the fieldNames list . for fields in the list datemap indicates the field must be date


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = np . count_nonzero ( arg_0 ) arg_4 = np . count_nonzero ( arg_1 ) arg_5 = min ( arg_3 , arg_4 ) Func = 0 if arg_5 > 0 : Func = float ( np . dot ( arg_0 , arg_1 ) ) / float ( arg_5 ) return Func

def Func(arg_0, arg_1, arg_2):
  """
  Computes the percentage of overlap between vectors x1 and x2.

  @param x1   (array) binary vector
  @param x2   (array) binary vector
  @param size (int)   length of binary vectors

  @return percentOverlap (float) percentage overlap between x1 and x2
  """
  arg_3 = np.count_nonzero(arg_0)
  arg_4 = np.count_nonzero(arg_1)
  arg_5 = min(arg_3, arg_4)
  Func = 0
  if arg_5 > 0:
    Func = float(np.dot(arg_0, arg_1))/float(arg_5)
  return Func

Computes the percentage of overlap between vectors x1 and x2 .


def Func ( arg_0 , arg_1 , ** arg_2 ) : for arg_3 in arg_0 . g . nodes ( ) : arg_4 = ( arg_3 , arg_3 ) if arg_0 . g . is_edge ( arg_4 ) and arg_0 . g . ep ( arg_4 , 'edge_type' ) == arg_1 : arg_5 = arg_0 . g . edge_index [ arg_4 ] arg_0 . g . set_vp ( arg_3 , 'vertex_fill_color' , arg_0 . colors [ 'vertex_highlight' ] ) arg_0 . g . set_vp ( arg_3 , 'vertex_color' , arg_0 . edge2queue [ arg_5 ] . colors [ 'vertex_color' ] ) else : arg_0 . g . set_vp ( arg_3 , 'vertex_fill_color' , arg_0 . colors [ 'vertex_inactive' ] ) arg_0 . g . set_vp ( arg_3 , 'vertex_color' , [ 0 , 0 , 0 , 0.9 ] ) for arg_4 in arg_0 . g . edges ( ) : if arg_0 . g . ep ( arg_4 , 'edge_type' ) == arg_1 : arg_0 . g . set_ep ( arg_4 , 'edge_color' , arg_0 . colors [ 'edge_active' ] ) else : arg_0 . g . set_ep ( arg_4 , 'edge_color' , arg_0 . colors [ 'edge_inactive' ] ) arg_0 . draw ( update_colors = False , ** arg_2 ) arg_0 . _update_all_colors ( )

def Func(arg_0, arg_1, **arg_2):
        """Draws the network, highlighting queues of a certain type.

        The colored vertices represent self loops of type ``edge_type``.
        Dark edges represent queues of type ``edge_type``.

        Parameters
        ----------
        edge_type : int
            The type of vertices and edges to be shown.
        **kwargs
            Any additional parameters to pass to :meth:`.draw`, and
            :meth:`.QueueNetworkDiGraph.draw_graph`

        Notes
        -----
        The colors are defined by the class attribute ``colors``. The
        relevant colors are ``vertex_active``, ``vertex_inactive``,
        ``vertex_highlight``, ``edge_active``, and ``edge_inactive``.

        Examples
        --------
        The following code highlights all edges with edge type ``2``.
        If the edge is a loop then the vertex is highlighted as well.
        In this case all edges with edge type ``2`` happen to be loops.

        >>> import queueing_tool as qt
        >>> g = qt.generate_pagerank_graph(100, seed=13)
        >>> net = qt.QueueNetwork(g, seed=13)
        >>> fname = 'edge_type_2.png'
        >>> net.Func(2, fname=fname) # doctest: +SKIP

        .. figure:: edge_type_2-1.png
           :align: center
        """
        for arg_3 in arg_0.g.nodes():
            arg_4 = (arg_3, arg_3)
            if arg_0.g.is_edge(arg_4) and arg_0.g.ep(arg_4, 'edge_type') == arg_1:
                arg_5 = arg_0.g.edge_index[arg_4]
                arg_0.g.set_vp(arg_3, 'vertex_fill_color', arg_0.colors['vertex_highlight'])
                arg_0.g.set_vp(arg_3, 'vertex_color', arg_0.edge2queue[arg_5].colors['vertex_color'])
            else:
                arg_0.g.set_vp(arg_3, 'vertex_fill_color', arg_0.colors['vertex_inactive'])
                arg_0.g.set_vp(arg_3, 'vertex_color', [0, 0, 0, 0.9])

        for arg_4 in arg_0.g.edges():
            if arg_0.g.ep(arg_4, 'edge_type') == arg_1:
                arg_0.g.set_ep(arg_4, 'edge_color', arg_0.colors['edge_active'])
            else:
                arg_0.g.set_ep(arg_4, 'edge_color', arg_0.colors['edge_inactive'])

        arg_0.draw(update_colors=False, **arg_2)
        arg_0._update_all_colors()

Draws the network, highlighting queues of a certain type.

        The colored vertices represent self loops of type ``edge_type``.
        Dark edges represent queues of type ``edge_type``.

        Parameters
        ----------
        edge_type : int
            The type of vertices and edges to be shown.
        **kwargs
            Any additional parameters to pass to :meth:`.draw`, and
            :meth:`.QueueNetworkDiGraph.draw_graph`

        Notes
        -----
        The colors are defined by the class attribute ``colors``. The
        relevant colors are ``vertex_active``, ``vertex_inactive``,
        ``vertex_highlight``, ``edge_active``, and ``edge_inactive``.

        Examples
        --------
        The following code highlights all edges with edge type ``2``.
        If the edge is a loop then the vertex is highlighted as well.
        In this case all edges with edge type ``2`` happen to be loops.

        >>> import queueing_tool as qt
        >>> g = qt.generate_pagerank_graph(100, seed=13)
        >>> net = qt.QueueNetwork(g, seed=13)
        >>> fname = 'edge_type_2.png'
        >>> net.show_type(2, fname=fname) # doctest: +SKIP

        .. figure:: edge_type_2-1.png
           :align: center

Draws the network highlighting queues of a certain type .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
)
:
if
arg_2
[
'type'
]
==
'hmac'
:
return
arg_1
+
arg_0
.
_hmac_generate
(
arg_1
,
arg_2
,
arg_3
)
elif
arg_2
[
'type'
]
==
'aes'
:
return
arg_0
.
_aes_encrypt
(
arg_1
,
arg_2
,
arg_3
)
elif
arg_2
[
'type'
]
==
'no-serialization'
:
return
arg_1
elif
arg_2
[
'type'
]
==
'json'
:
return
json
.
dumps
(
arg_1
)
elif
arg_2
[
'type'
]
==
'no-compression'
:
return
arg_1
elif
arg_2
[
'type'
]
==
'gzip'
:
return
arg_0
.
_zlib_compress
(
arg_1
,
arg_2
)
else
:
raise
Exception
(
'Algorithm not supported: %s'
%
arg_2
[
'type'
]
)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        '''Encode data with specific algorithm'''

        if arg_2['type'] == 'hmac':
            return arg_1 + arg_0._hmac_generate(arg_1, arg_2, arg_3)
        elif arg_2['type'] == 'aes':
            return arg_0._aes_encrypt(arg_1, arg_2, arg_3)
        elif arg_2['type'] == 'no-serialization':
            return arg_1
        elif arg_2['type'] == 'json':
            return json.dumps(arg_1)
        elif arg_2['type'] == 'no-compression':
            return arg_1
        elif arg_2['type'] == 'gzip':
            return arg_0._zlib_compress(arg_1, arg_2)
        else:
            raise Exception('Algorithm not supported: %s' % arg_2['type'])


return self.noise_factor * (noise_map * contributions) ** self.noise_power

def Func(arg_0, arg_1, arg_2):
        """Compute a scaled galaxy hyper noise-map from a baseline noise-map.

        This uses the galaxy contribution map and the *noise_factor* and *noise_power* hyper-parameters.

        Parameters
        -----------
        noise_map : ndarray
            The observed noise-map (before scaling).
        contributions : ndarray
            The galaxy contribution map.
        """
        return arg_0.noise_factor * (arg_1 * arg_2) ** arg_0.noise_power

Compute a scaled galaxy hyper noise - map from a baseline noise - map .


def Func ( arg_0 ) : arg_1 = [ 0 ] * len ( arg_0 . material . elements ) for arg_2 in arg_0 . material . compounds : arg_3 = arg_0 . get_compound_mass ( arg_2 ) arg_4 = [ arg_3 * x for x in emf ( arg_2 , arg_0 . material . elements ) ] arg_1 = [ v + arg_4 [ ix ] for ix , v in enumerate ( arg_1 ) ] return arg_1

def Func(arg_0):
        """
        Get the masses of elements in the package.

        :returns: [kg] An array of element masses. The sequence of the elements
          in the result corresponds with the sequence of elements in the
          element list of the material.
        """

        arg_1 = [0] * len(arg_0.material.elements)
        for arg_2 in arg_0.material.compounds:
            arg_3 = arg_0.get_compound_mass(arg_2)
            arg_4 = [arg_3 * x for x in emf(arg_2, arg_0.material.elements)]
            arg_1 = [v+arg_4[ix] for ix, v in enumerate(arg_1)]

        return arg_1

Get the masses of elements in the package .


def Func ( arg_0 = None , arg_1 = None ) : arg_2 = NotebookNode ( ) if arg_0 is not None : arg_2 . name = unicode ( arg_0 ) if arg_1 is None : arg_2 . cells = [ ] else : arg_2 . cells = list ( arg_1 ) return arg_2

def Func(arg_0=None, arg_1=None):
    """Create a worksheet by name with with a list of cells."""
    arg_2 = NotebookNode()
    if arg_0 is not None:
        arg_2.name = unicode(arg_0)
    if arg_1 is None:
        arg_2.cells = []
    else:
        arg_2.cells = list(arg_1)
    return arg_2

Create a worksheet by name with with a list of cells .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . assert_package_exists ( ) if not arg_0 . package_summary_set : arg_0 . package_summary_set = True arg_1 . package . summary = arg_2 else : raise CardinalityError ( 'Package::Summary' )

def Func(arg_0, arg_1, arg_2):
        """Set's the package summary.
        Raises CardinalityError if summary already set.
        Raises OrderError if no package previously defined.
        """
        arg_0.assert_package_exists()
        if not arg_0.package_summary_set:
            arg_0.package_summary_set = True
            arg_1.package.summary = arg_2
        else:
            raise CardinalityError('Package::Summary')

Set s the package summary . Raises CardinalityError if summary already set . Raises OrderError if no package previously defined .


return fmt.format(date=datetime.utcnow().isoformat(),
                      imports=self._get_imports(),
                      token_type_enum=self._get_token_type_enum(),
                      class_definition=self._get_class_definition())

def Func(arg_0):
    """Returns the python source code for the generated parser."""
    arg_1 = """\"\"\"This parser was generated by pyebnf on {date}.\"\"\"
    from enum import Enum

    from pyebnf import parser_base as PB
    from pyebnf.primitive import alternation, concatenation, exclusion, one_or_more
    from pyebnf.primitive import option, repeated, repetition, terminal, zero_or_more
    {imports}

    {token_type_enum}

    {class_definition}
    """

    arg_1 = arg_0._clean_fmt(arg_1)

    return arg_1.format(date=datetime.utcnow().isoformat(),
                      imports=arg_0._get_imports(),
                      token_type_enum=arg_0._get_token_type_enum(),
                      class_definition=arg_0._get_class_definition())

Returns the python source code for the generated parser .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = coordinatesFromIndex ( arg_0 , arg_2 ) arg_4 = [ ] for arg_5 , arg_6 in enumerate ( arg_2 ) : arg_7 = max ( 0 , arg_3 [ arg_5 ] - arg_1 ) arg_8 = min ( arg_6 - 1 , arg_3 [ arg_5 ] + arg_1 ) arg_4 . append ( xrange ( arg_7 , arg_8 + 1 ) ) arg_9 = numpy . array ( list ( itertools . product ( * arg_4 ) ) ) return numpy . ravel_multi_index ( arg_9 . T , arg_2 )

def Func(arg_0, arg_1, arg_2):
  """
  Get the points in the Func of a point.

  A point's Func is the n-dimensional hypercube with sides ranging
  [center - radius, center + radius], inclusive. For example, if there are two
  dimensions and the radius is 3, the Func is 6x6. Neighborhoods are
  truncated when they are near an edge.

  This is designed to be fast. In C++ it's fastest to iterate through neighbors
  one by one, calculating them on-demand rather than creating a list of them.
  But in Python it's faster to build up the whole list in batch via a few calls
  to C code rather than calculating them on-demand with lots of calls to Python
  code.

  :param centerIndex: (int) The index of the point. The coordinates are
         expressed as a single index by using the dimensions as a mixed radix
         definition. For example, in dimensions 42x10, the point [1, 4] is index
         1*420 + 4*10 = 460.

  :param radius: (int) The radius of this Func about the
         ``centerIndex``.

  :param dimensions: (indexable sequence) The dimensions of the world outside
         this Func.

  :returns: (numpy array) The points in the Func, including
            ``centerIndex``.
  """
  arg_3 = coordinatesFromIndex(arg_0, arg_2)

  arg_4 = []
  for arg_5, arg_6 in enumerate(arg_2):
    arg_7 = max(0, arg_3[arg_5] - arg_1)
    arg_8 = min(arg_6 - 1, arg_3[arg_5] + arg_1)
    arg_4.append(xrange(arg_7, arg_8 + 1))

  arg_9 = numpy.array(list(itertools.product(*arg_4)))
  return numpy.ravel_multi_index(arg_9.T, arg_2)

Get the points in the neighborhood of a point.

  A point's neighborhood is the n-dimensional hypercube with sides ranging
  [center - radius, center + radius], inclusive. For example, if there are two
  dimensions and the radius is 3, the neighborhood is 6x6. Neighborhoods are
  truncated when they are near an edge.

  This is designed to be fast. In C++ it's fastest to iterate through neighbors
  one by one, calculating them on-demand rather than creating a list of them.
  But in Python it's faster to build up the whole list in batch via a few calls
  to C code rather than calculating them on-demand with lots of calls to Python
  code.

  :param centerIndex: (int) The index of the point. The coordinates are
         expressed as a single index by using the dimensions as a mixed radix
         definition. For example, in dimensions 42x10, the point [1, 4] is index
         1*420 + 4*10 = 460.

  :param radius: (int) The radius of this neighborhood about the
         ``centerIndex``.

  :param dimensions: (indexable sequence) The dimensions of the world outside
         this neighborhood.

  :returns: (numpy array) The points in the neighborhood, including
            ``centerIndex``.

Get the points in the neighborhood of a point .


def Func(arg_0, arg_1):
    """
    Build the list structure and return the root list
    """
    # Need to keep track of all incomplete nested lists.
    arg_2 = {}

    # Need to keep track of the current indentation level.
    arg_3 = -1

    # Need to keep track of the current list id.
    arg_4 = -1

    # Need to keep track of list that new li tags should be added too.
    arg_5 = None

    # Store the first list created (the root list) for the return value.
    arg_6 = None
    arg_7 = []
    arg_8 = []

    def _build_li(arg_8):
        arg_9 = '
'.join(t for t in arg_8 if t is not None)
        return etree.XML('
%s
' % arg_9)

    def _build_non_li_content(arg_10, arg_1):
        arg_11 = get_namespace(arg_10, 'w')
        if arg_10.tag == '%stbl' % arg_11:
            arg_12, arg_7 = build_table(arg_10, arg_1)
            return etree.tostring(arg_12), arg_7
        elif arg_10.tag == '%sp' % arg_11:
            return get_element_content(arg_10, arg_1), [arg_10]
        if has_text(arg_10):
            raise UnintendedTag('Did not expect %s' % arg_10.tag)

    def _merge_lists(arg_13, arg_3, arg_2, arg_5):
        for arg_14 in reversed(range(arg_13, arg_3)):
            # Any list that is more indented that ilvl needs to
            # be merged to the list before it.
            if arg_14 not in arg_2:
                continue
            if arg_2[arg_14] is not arg_5:
                if arg_2[arg_14] is arg_5:
                    continue
                arg_2[arg_14][-1].append(arg_5)
                arg_5 = arg_2[arg_14]

        # Clean up finished nested lists.
        for arg_15 in list(arg_2):
            if arg_15 > arg_13:
                del arg_2[arg_15]
        return arg_5

    for arg_16 in arg_0:
        arg_11 = get_namespace(arg_16, 'w')
        if not is_li(arg_16, arg_1):
            # Get the content and visited nodes
            arg_12, arg_17 = _build_non_li_content(
                arg_16,
                arg_1,
            )
            arg_8.append(arg_12)
            arg_7.extend(arg_17)
            continue
        if arg_8:
            arg_18 = _build_li(arg_8)
            arg_8 = []
            arg_5.append(arg_18)
        # Get the data needed to build the current list item
        arg_8.append(get_element_content(
            arg_16,
            arg_1,
        ))
        arg_13 = get_ilvl(arg_16, arg_11)
        arg_19 = get_numId(arg_16, arg_11)
        arg_20 = get_ordered_list_type(arg_1, arg_19, arg_13)

        # If the ilvl is greater than the current_ilvl or the list id is
        # changing then we have the first li tag in a nested list. We need to
        # create a new list object and update all of our variables for keeping
        # track.
        if (arg_13 > arg_3) or (arg_19 != arg_4):
            # Only create a new list
            arg_2[arg_13] = create_list(arg_20)
            arg_5 = arg_2[arg_13]
            arg_3 = arg_13
            arg_4 = arg_19
        # Both cases above are not True then we need to close all lists greater
        # than ilvl and then remove them from the ol_dict
        else:
            # Merge any nested lists that need to be merged.
            arg_5 = _merge_lists(
                arg_13=arg_13,
                arg_3=arg_3,
                arg_2=arg_2,
                arg_5=arg_5,
            )

        # Set the root list after the first list is created.
        if arg_6 is None:
            arg_6 = arg_5

        # Set the current list.
        if arg_13 in arg_2:
            arg_5 = arg_2[arg_13]
        else:
            # In some instances the ilvl is not in the ol_dict, if that is the
            # case, create it here (not sure how this happens but it has
            # before.) Only do this if the current_ol is not the root_ol,
            # otherwise etree will crash.

            if arg_5 is not arg_6:

                # Merge the current_ol into the root_ol. _merge_lists is not
                # equipped to handle this situation since the only way to get
                # into this block of code is to have mangled ilvls.
                arg_6[-1].append(arg_5)

                # Reset the current_ol
                arg_5 = create_list(arg_20)

        # Create the li element.
        arg_7.extend(list(arg_16.iter()))

    # If a list item is the last thing in a document, then you will need to add
    # it here. Should probably figure out how to get the above logic to deal
    # with it.
    if arg_8:
        arg_18 = _build_li(arg_8)
        arg_8 = []
        arg_5.append(arg_18)

    # Merge up any nested lists that have not been merged.
    arg_5 = _merge_lists(
        arg_13=0,
        arg_3=arg_3,
        arg_2=arg_2,
        arg_5=arg_5,
    )

    return arg_6, arg_7


(self, inventory_source, monitor=False, wait=False,
               timeout=None, **kwargs)

return {
            'id': inventory_update_id,
            'status': 'ok'
        }

def Func(arg_0, arg_1, arg_2=False, arg_3=False,
               arg_4=None, **arg_5):
        """Update the given inventory source.

        =====API DOCS=====
        Update the given inventory source.

        :param inventory_source: Primary key or name of the inventory source to be Funcd.
        :type inventory_source: str
        :param monitor: Flag that if set, immediately calls ``monitor`` on the newly launched inventory Func
                        rather than exiting with a success.
        :type monitor: bool
        :param wait: Flag that if set, monitor the status of the inventory Func, but do not print while it is
                     in progress.
        :type wait: bool
        :param timeout: If provided with ``monitor`` flag set, this attempt will time out after the given number
                        of seconds.
        :type timeout: int
        :param `**kwargs`: Fields used to override underlyingl inventory source fields when creating and launching
                           an inventory Func.
        :returns: Result of subsequent ``monitor`` call if ``monitor`` flag is on; Result of subsequent ``wait``
                  call if ``wait`` flag is on; dictionary of "status" if none of the two flags are on.
        :rtype: dict
        :raises tower_cli.exceptions.BadRequest: When the inventory source cannot be Funcd.

        =====API DOCS=====
        """

        # Establish that we are able to Func this inventory source
        # at all.
        debug.log('Asking whether the inventory source can be Funcd.', header='details')
        arg_6 = client.get('%s%d/Func/' % (arg_0.endpoint, arg_1))
        if not arg_6.json()['can_Func']:
            raise exc.BadRequest('Tower says it cannot run an Func against this inventory source.')

        # Run the Func.
        debug.log('Updating the inventory source.', header='details')
        arg_6 = client.post('%s%d/Func/' % (arg_0.endpoint, arg_1), data={})
        arg_7 = arg_6.json()['inventory_Func']

        # If we were told to monitor the project Func's status, do so.
        if arg_2 or arg_3:
            if arg_2:
                arg_8 = arg_0.monitor(arg_7, parent_pk=arg_1, arg_4=arg_4)
            elif arg_3:
                arg_8 = arg_0.wait(arg_7, parent_pk=arg_1, arg_4=arg_4)
            arg_9 = client.get('/inventory_sources/%d/' % arg_8['inventory_source']).json()['inventory']
            arg_8['inventory'] = int(arg_9)
            return arg_8

        # Done.
        return {
            'id': arg_7,
            'status': 'ok'
        }

Update the given inventory source.

        =====API DOCS=====
        Update the given inventory source.

        :param inventory_source: Primary key or name of the inventory source to be updated.
        :type inventory_source: str
        :param monitor: Flag that if set, immediately calls ``monitor`` on the newly launched inventory update
                        rather than exiting with a success.
        :type monitor: bool
        :param wait: Flag that if set, monitor the status of the inventory update, but do not print while it is
                     in progress.
        :type wait: bool
        :param timeout: If provided with ``monitor`` flag set, this attempt will time out after the given number
                        of seconds.
        :type timeout: int
        :param `**kwargs`: Fields used to override underlyingl inventory source fields when creating and launching
                           an inventory update.
        :returns: Result of subsequent ``monitor`` call if ``monitor`` flag is on; Result of subsequent ``wait``
                  call if ``wait`` flag is on; dictionary of "status" if none of the two flags are on.
        :rtype: dict
        :raises tower_cli.exceptions.BadRequest: When the inventory source cannot be updated.

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


def Func(arg_0):
        """Update the Server information and list of API Roots"""
        arg_1 = arg_0.__raw = arg_0._conn.get(arg_0.url)
        arg_0._populate_fields(**arg_1)
        arg_0._loaded = True


def Func(arg_0, arg_1=None):
        """Render the rel=canonical, rel=prev and rel=next links to a Markup object for injection into a template"""
        arg_2 = arg_0.render_prev_next_links(arg_1=arg_1)

        if arg_0.total_pages == 1:
            arg_2 += arg_0.render_canonical_link(arg_1=arg_1)

        return arg_2

Render the rel = canonical rel = prev and rel = next links to a Markup object for injection into a template


(data: pd.DataFrame, ticker: str, dt, typ='TRADE')

def Func(arg_0: arg_1.DataFrame, arg_3: arg_4, arg_5, arg_6='TRADE'):
    """
    Check whether data is done for the day and save

    Args:
        data: data
        ticker: ticker
        dt: date
        typ: [TRADE, BID, ASK, BID_BEST, ASK_BEST, BEST_BID, BEST_ASK]

    Examples:
        >>> os.environ['BBG_ROOT'] = 'xbbg/tests/data'
        >>> sample = pd.read_parquet('xbbg/tests/data/aapl.parq')
        >>> Func(sample, 'AAPL US Equity', '2018-11-02')
        >>> # Invalid exchange
        >>> Func(sample, 'AAPL XX Equity', '2018-11-02')
        >>> # Invalid empty data
        >>> Func(pd.DataFrame(), 'AAPL US Equity', '2018-11-02')
        >>> # Invalid date - too close
        >>> cur_dt = utils.cur_time()
        >>> Func(sample, 'AAPL US Equity', cur_dt)
    """
    arg_7 = arg_1.Timestamp(arg_5).strftime('%Y-%m-%d')
    arg_8 = logs.get_logger(Func, level='debug')
    arg_9 = f'{ticker} / {cur_dt} / {typ}'
    arg_10 = hist_file(arg_3=arg_3, arg_5=arg_5, arg_6=arg_6)
    if not arg_10: return

    if arg_0.empty:
        arg_8.warning(f'data is empty for {info} ...')
        return

    arg_11 = const.exch_info(arg_3=arg_3)
    if arg_11.empty: return

    arg_12 = arg_1.Timestamp(
        const.market_timing(arg_3=arg_3, arg_5=arg_5, timing='FINISHED')
    ).tz_localize(arg_11.tz)
    arg_13 = arg_1.Timestamp('now', tz=arg_11.tz) - arg_1.Timedelta('1H')

    if arg_12 > arg_13:
        arg_8.debug(f'skip saving cause market close ({end_time}) < now - 1H ({now}) ...')
        return

    arg_8.info(f'saving data to {data_file} ...')
    files.create_folder(arg_10, is_file=True)
    arg_0.to_parquet(arg_10)

Check whether data is done for the day and save

    Args:
        data: data
        ticker: ticker
        dt: date
        typ: [TRADE, BID, ASK, BID_BEST, ASK_BEST, BEST_BID, BEST_ASK]

    Examples:
        >>> os.environ['BBG_ROOT'] = 'xbbg/tests/data'
        >>> sample = pd.read_parquet('xbbg/tests/data/aapl.parq')
        >>> save_intraday(sample, 'AAPL US Equity', '2018-11-02')
        >>> # Invalid exchange
        >>> save_intraday(sample, 'AAPL XX Equity', '2018-11-02')
        >>> # Invalid empty data
        >>> save_intraday(pd.DataFrame(), 'AAPL US Equity', '2018-11-02')
        >>> # Invalid date - too close
        >>> cur_dt = utils.cur_time()
        >>> save_intraday(sample, 'AAPL US Equity', cur_dt)


def
Func
(
arg_0
)
:
for
arg_1
,
arg_2
in
sorted
(
iteritems
(
arg_0
.
errors_by_category
)
)
:
arg_0
.
PrintInfo
(
'Category \'%s\' errors found: %d\n'
%
(
arg_1
,
arg_2
)
)
if
arg_0
.
error_count
>
0
:
arg_0
.
PrintInfo
(
'Total errors found: %d\n'
%
arg_0
.
error_count
)

def Func(arg_0):
    """Print a summary of errors by category, and the total."""
    for arg_1, arg_2 in sorted(iteritems(arg_0.errors_by_category)):
      arg_0.PrintInfo('Category \'%s\' errors found: %d\n' %
                       (arg_1, arg_2))
    if arg_0.error_count > 0:
      arg_0.PrintInfo('Total errors found: %d\n' % arg_0.error_count)

Print a summary of errors by category and the total .