def Func(arg_0, arg_1, arg_2):
    """
    sends fastq files to cutadapt
    """
    ## choose cutadapt function based on datatype
    arg_3 = time.time()
    arg_4 = " processing reads      | {} | s2 |"
    arg_5 = 0
    arg_6 = {}

    ## sort subsamples so that the biggest files get submitted first
    arg_1.sort(key=lambda x: x.stats.reads_raw, reverse=True)
    LOGGER.info([arg_7.stats.reads_raw for arg_7 in arg_1])

    ## send samples to cutadapt filtering
    if "pair" in arg_0.paramsdict["datatype"]:
        for arg_8 in arg_1:
            arg_6[arg_8.name] = arg_2.apply(cutadaptit_pairs, *(arg_0, arg_8))
    else:
        for arg_8 in arg_1:
            arg_6[arg_8.name] = arg_2.apply(cutadaptit_single, *(arg_0, arg_8))

    ## wait for all to finish
    while 1:
        arg_5 = sum([arg_7.ready() for arg_7 in arg_6.values()])
        arg_10 = datetime.timedelta(seconds=int(time.time()-arg_3))
        progressbar(len(arg_6), arg_5, arg_4.format(arg_10), spacer=arg_0._spacer)
        time.sleep(0.1)
        if arg_5 == len(arg_6):
            print("")
            break

    ## collect results, report failures, and store stats. async = sample.name
    for arg_11 in arg_6:
        if arg_6[arg_11].successful():
            arg_12 = arg_6[arg_11].result()

            ## if single cleanup is easy
            if "pair" not in arg_0.paramsdict["datatype"]:
                parse_single_results(arg_0, arg_0.samples[arg_11], arg_12)
            else:
                parse_pair_results(arg_0, arg_0.samples[arg_11], arg_12)
        else:
            print("  found an error in step2; see ipyrad_log.txt")
            LOGGER.error("error in Func(): %s", arg_6[arg_11].exception())


(cplist,
                           outpkl,
                           color_mag1=['gaiamag','sdssg'],
                           color_mag2=['kmag','kmag'],
                           yaxis_mag=['gaia_absmag','rpmj'])

def Func ( arg_0 , arg_1 , arg_2 = [ 'gaiamag' , 'sdssg' ] , arg_3 = [ 'kmag' , 'kmag' ] , arg_4 = [ 'gaia_absmag' , 'rpmj' ] ) : arg_5 = [ ] arg_6 = [ ] arg_7 = [ ] for arg_8 in arg_0 : arg_9 = _read_checkplot_picklefile ( arg_8 ) arg_5 . append ( arg_9 [ 'objectid' ] ) arg_10 = [ ] arg_11 = [ ] for arg_12 , arg_13 , arg_14 in zip ( arg_2 , arg_3 , arg_4 ) : if ( arg_14 in arg_9 [ 'objectinfo' ] and arg_9 [ 'objectinfo' ] [ arg_14 ] is not None ) : arg_10 . append ( arg_9 [ 'objectinfo' ] [ arg_14 ] ) else : arg_10 . append ( np . nan ) if ( arg_12 in arg_9 [ 'objectinfo' ] and arg_9 [ 'objectinfo' ] [ arg_12 ] is not None and arg_13 in arg_9 [ 'objectinfo' ] and arg_9 [ 'objectinfo' ] [ arg_13 ] is not None ) : arg_11 . append ( arg_9 [ 'objectinfo' ] [ arg_12 ] - arg_9 [ 'objectinfo' ] [ arg_13 ] ) else : arg_11 . append ( np . nan ) arg_6 . append ( arg_10 ) arg_7 . append ( arg_11 ) arg_5 = np . array ( arg_5 ) arg_6 = np . array ( arg_6 ) arg_7 = np . array ( arg_7 ) arg_15 = { 'objectids' : arg_5 , 'mags' : arg_6 , 'colors' : arg_7 , 'color_mag1' : arg_2 , 'color_mag2' : arg_3 , 'yaxis_mag' : arg_4 } with open ( arg_1 , 'wb' ) as outfd : pickle . dump ( arg_15 , outfd , pickle . HIGHEST_PROTOCOL ) plt . close ( 'all' ) return arg_15

def Func(arg_0,
                           arg_1,
                           arg_2=['gaiamag','sdssg'],
                           arg_3=['kmag','kmag'],
                           arg_4=['gaia_absmag','rpmj']):
    '''This makes color-mag diagrams for all checkplot pickles in the provided
    list.

    Can make an arbitrary number of CMDs given lists of x-axis colors and y-axis
    mags to use.

    Parameters
    ----------

    cplist : list of str
        This is the list of checkplot pickles to process.

    outpkl : str
        The filename of the output pickle that will contain the color-mag
        information for all objects in the checkplots specified in `cplist`.

    color_mag1 : list of str
        This a list of the keys in each checkplot's `objectinfo` dict that will
        be used as color_1 in the equation::

                x-axis color = color_mag1 - color_mag2

    color_mag2 : list of str
        This a list of the keys in each checkplot's `objectinfo` dict that will
        be used as color_2 in the equation::

                x-axis color = color_mag1 - color_mag2

    yaxis_mag : list of str
        This is a list of the keys in each checkplot's `objectinfo` dict that
        will be used as the (absolute) magnitude y-axis of the color-mag
        diagrams.

    Returns
    -------

    str
        The path to the generated CMD pickle file for the collection of objects
        in the input checkplot list.

    Notes
    -----

    This can make many CMDs in one go. For example, the default kwargs for
    `color_mag`, `color_mag2`, and `yaxis_mag` result in two CMDs generated and
    written to the output pickle file:

    - CMD1 -> gaiamag - kmag on the x-axis vs gaia_absmag on the y-axis
    - CMD2 -> sdssg - kmag on the x-axis vs rpmj (J reduced PM) on the y-axis

    '''

    # first, we'll collect all of the info
    arg_5 = []
    arg_6 = []
    arg_7 = []

    for arg_8 in arg_0:

        arg_9 = _read_checkplot_picklefile(arg_8)
        arg_5.append(arg_9['objectid'])

        arg_10 = []
        arg_11 = []

        for arg_12, arg_13, arg_14 in zip(arg_2, arg_3, arg_4):

            if (arg_14 in arg_9['objectinfo'] and
                arg_9['objectinfo'][arg_14] is not None):
                arg_10.append(arg_9['objectinfo'][arg_14])
            else:
                arg_10.append(np.nan)

            if (arg_12 in arg_9['objectinfo'] and
                arg_9['objectinfo'][arg_12] is not None and
                arg_13 in arg_9['objectinfo'] and
                arg_9['objectinfo'][arg_13] is not None):
                arg_11.append(arg_9['objectinfo'][arg_12] -
                                     arg_9['objectinfo'][arg_13])
            else:
                arg_11.append(np.nan)

        arg_6.append(arg_10)
        arg_7.append(arg_11)

    # convert these to arrays
    arg_5 = np.array(arg_5)
    arg_6 = np.array(arg_6)
    arg_7 = np.array(arg_7)

    # prepare the outdict
    arg_15 = {'objectids':arg_5,
               'mags':arg_6,
               'colors':arg_7,
               'color_mag1':arg_2,
               'color_mag2':arg_3,
               'yaxis_mag':arg_4}

    # save the pickled figure and dict for fast retrieval later
    with open(arg_1,'wb') as outfd:
        pickle.dump(arg_15, outfd, pickle.HIGHEST_PROTOCOL)

    plt.close('all')

    return arg_15

This makes color - mag diagrams for all checkplot pickles in the provided list .


async def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . kwargs . get ( arg_0 . param , 0 ) + 1 if arg_0 . fill_gaps : if arg_1 [ - 1 ] [ 'id' ] != arg_2 : arg_3 = arg_1 [ - 1 ] [ 'id' ] - 1 arg_4 = with_max_id ( arg_0 . request ( ** arg_0 . kwargs , arg_3 = arg_3 ) ) async for arg_5 in arg_4 : arg_1 . extend ( arg_5 ) if arg_1 [ - 1 ] [ 'id' ] == arg_0 . last_id : arg_1 = arg_1 [ : - 1 ] if not arg_1 and not arg_0 . force : raise StopAsyncIteration await arg_0 . set_param ( arg_1 )

async def Func(arg_0, arg_1):
        """
        Try to fill the gaps and strip last tweet from the response
        if its id is that of the first tweet of the last response

        Parameters
        ----------
        data : list
            The response data
        """
        arg_2 = arg_0.kwargs.get(arg_0.param, 0) + 1

        if arg_0.fill_gaps:
            if arg_1[-1]['id'] != arg_2:
                arg_3 = arg_1[-1]['id'] - 1
                arg_4 = with_max_id(arg_0.request(**arg_0.kwargs,
                                                     arg_3=arg_3))

                async for arg_5 in arg_4:
                    arg_1.extend(arg_5)

            if arg_1[-1]['id'] == arg_0.last_id:
                arg_1 = arg_1[:-1]

        if not arg_1 and not arg_0.force:
            raise StopAsyncIteration

        await arg_0.set_param(arg_1)


Call native SetWindowText if control has a valid native handle.

def Func ( arg_0 , arg_1 : arg_2 ) -> bool : arg_3 = arg_0 . NativeWindowHandle if arg_3 : return Func ( arg_3 , arg_1 ) return False

def Func(arg_0, arg_1: arg_2) -> bool:
        """
        Call native Func if control has a valid native handle.
        """
        arg_3 = arg_0.NativeWindowHandle
        if arg_3:
            return Func(arg_3, arg_1)
        return False

Call native SetWindowText if control has a valid native handle .


def Func ( arg_0 ) : try : arg_0 . gd_client = gdata . docs . client . DocsClient ( ) arg_0 . gd_client . ClientLogin ( arg_0 . email , arg_0 . password , arg_0 . source ) except RequestError as e : raise PODocsError ( e )

def Func(arg_0):
        """
        Login into Google Docs with user authentication info.
        """
        try:
            arg_0.gd_client = gdata.docs.client.DocsClient()
            arg_0.gd_client.ClientLogin(arg_0.email, arg_0.password, arg_0.source)
        except RequestError as e:
            raise PODocsError(e)

Login into Google Docs with user authentication info .


def Func(arg_0, arg_1, arg_2, **arg_3):
    """Confirm email address."""
    arg_4 = int(arg_0.pid_value)

    arg_5 = request.view_args['token']

    # Validate token
    arg_6 = EmailConfirmationSerializer.compat_validate_token(arg_5)
    if arg_6 is None:
        flash(_("Invalid Funcation link."), category='danger')
        return redirect(url_for("invenio_records_ui.recid", pid_value=arg_4))

    # Validate request exists.
    arg_7 = AccessRequest.query.get(arg_6['id'])
    if not arg_7:
        abort(404)

    # Confirm email address.
    if arg_7.status != RequestStatus.EMAIL_VALIDATION:
        abort(404)

    arg_7.Func_email()
    db.session.commit()
    flash(_("Email validated and access request submitted."), category='info')

    return redirect(url_for("invenio_records_ui.recid", pid_value=arg_4))


def Func ( arg_0 , arg_1 ) : arg_2 = [ ( arg_1 . start , arg_1 . string_position ) ] for arg_3 in range ( arg_0 . re . groups ) : arg_4 = 2 * arg_3 if arg_4 + 1 < len ( arg_1 . marks ) and arg_1 . marks [ arg_4 ] is not None and arg_1 . marks [ arg_4 + 1 ] is not None : arg_2 . append ( ( arg_1 . marks [ arg_4 ] , arg_1 . marks [ arg_4 + 1 ] ) ) else : arg_2 . append ( ( - 1 , - 1 ) ) return tuple ( arg_2 )

def Func(arg_0, arg_1):
        """Creates a tuple of index pairs representing matched groups."""
        arg_2 = [(arg_1.start, arg_1.string_position)]
        for arg_3 in range(arg_0.re.groups):
            arg_4 = 2 * arg_3
            if arg_4 + 1 < len(arg_1.marks) \
                                    and arg_1.marks[arg_4] is not None \
                                    and arg_1.marks[arg_4 + 1] is not None:
                arg_2.append((arg_1.marks[arg_4], arg_1.marks[arg_4 + 1]))
            else:
                arg_2.append((-1, -1))
        return tuple(arg_2)

Creates a tuple of index pairs representing matched groups .


(params, w_name, scope_name, inputs, layers, weights, names)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
print
(
'Converting hardtanh (clip) ...'
)
def
target_layer
(
arg_7
,
arg_8
=
arg_9
(
arg_0
[
'max_val'
]
)
,
arg_10
=
arg_9
(
arg_0
[
'min_val'
]
)
)
:
return
tf
.
minimum
(
arg_8
,
tf
.
maximum
(
arg_10
,
arg_7
)
)
arg_11
=
keras
.
layers
.
Lambda
(
target_layer
)
arg_4
[
arg_2
]
=
arg_11
(
arg_4
[
arg_3
[
0
]
]
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
    """
    Convert hardtanh layer.

    Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """
    print('Converting hardtanh (clip) ...')

    def target_layer(arg_7, arg_8=arg_9(arg_0['max_val']), arg_10=arg_9(arg_0['min_val'])):
        return tf.minimum(arg_8, tf.maximum(arg_10, arg_7))

    arg_11 = keras.layers.Lambda(target_layer)
    arg_4[arg_2] = arg_11(arg_4[arg_3[0]])


def Func ( arg_0 , arg_1 = False ) : if arg_1 : return [ arg_0 . all_variables [ arg_2 ] for arg_2 in sorted ( arg_0 . all_variables ) ] else : return [ arg_0 . variables [ arg_2 ] for arg_2 in sorted ( arg_0 . variables ) ]

def Func(arg_0, arg_1=False):
        """
        Returns the TensorFlow variables used by the baseline.

        Returns:
            List of variables
        """
        if arg_1:
            return [arg_0.all_variables[arg_2] for arg_2 in sorted(arg_0.all_variables)]
        else:
            return [arg_0.variables[arg_2] for arg_2 in sorted(arg_0.variables)]

Returns the TensorFlow variables used by the baseline .


def Func ( arg_0 ) : arg_0 . _api_path_cache = None for arg_2 in arg_0 . api_providers : if six . get_method_self ( arg_2 . Func , ) is not None : arg_2 . Func ( )

def Func(arg_0):
        """Clear out cache for api_path_map."""
        arg_0._api_path_cache = None
        for arg_2 in arg_0.api_providers:
            if six.get_method_self(
                arg_2.Func,
            ) is not None:
                arg_2.Func()


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = PSF . from_fits_with_scale ( arg_1 , arg_2 , arg_3 ) arg_4 [ : , : ] = np . divide ( arg_4 , np . sum ( arg_4 ) ) return arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
        """Loads a PSF from fits and renormalizes it

        Parameters
        ----------
        pixel_scale
        file_path: String
            The path to the file containing the PSF
        hdu : int
            The HDU the PSF is stored in the .fits file.

        Returns
        -------
        psf: PSF
            A renormalized PSF instance
        """
        arg_4 = PSF.from_fits_with_scale(arg_1, arg_2, arg_3)
        arg_4[:, :] = np.divide(arg_4, np.sum(arg_4))
        return arg_4


def Func ( arg_0 ) : for arg_1 , arg_2 , arg_3 in os . walk ( arg_0 ) : for arg_4 in arg_3 : yield op . join ( arg_1 , arg_4 )

def Func(arg_0):
    """
    Generator that loops through all absolute paths of the files within folder

    Parameters
    ----------
    folder: str
    Root folder start point for recursive search.

    Yields
    ------
    fpath: str
    Absolute path of one file in the folders
    """
    for arg_1, arg_2, arg_3 in os.walk(arg_0):
        for arg_4 in arg_3:
            yield op.join(arg_1, arg_4)


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_0 . _read ( arg_0 [ arg_1 , ... ] , ** arg_2 ) arg_3 = np . rollaxis ( arg_3 . astype ( np . float32 ) , 0 , 3 ) arg_4 = arg_3 . flatten ( ) if 0 in arg_3 : arg_5 = np . ma . masked_values ( arg_3 , 0 ) . compressed ( ) arg_6 , arg_7 = np . histogram ( arg_5 , 256 ) else : arg_6 , arg_7 = np . histogram ( arg_4 , 256 ) arg_8 = ( arg_7 [ : - 1 ] + arg_7 [ 1 : ] ) / 2.0 arg_9 = arg_6 . cumsum ( ) arg_9 = arg_9 / float ( arg_9 [ - 1 ] ) arg_10 = np . interp ( arg_4 , arg_8 , arg_9 ) . reshape ( arg_3 . shape ) if 'stretch' in arg_2 or 'gamma' in arg_2 : return arg_0 . _histogram_stretch ( arg_10 , ** arg_2 ) else : return arg_10

def Func(arg_0, arg_1, **arg_2):
        ''' Equalize and the histogram and normalize value range
            Equalization is on all three bands, not per-band'''
        arg_3 = arg_0._read(arg_0[arg_1,...], **arg_2)
        arg_3 = np.rollaxis(arg_3.astype(np.float32), 0, 3)
        arg_4 = arg_3.flatten()
        if 0 in arg_3:
            arg_5 = np.ma.masked_values(arg_3, 0).compressed()
            arg_6, arg_7 = np.histogram(arg_5, 256)
        else:
            arg_6, arg_7 = np.histogram(arg_4, 256)
        arg_8 = (arg_7[:-1] + arg_7[1:]) / 2.0
        arg_9 = arg_6.cumsum()
        arg_9 = arg_9 / float(arg_9[-1])
        arg_10 = np.interp(arg_4, arg_8, arg_9).reshape(arg_3.shape)
        if 'stretch' in arg_2 or 'gamma' in arg_2:
            return arg_0._histogram_stretch(arg_10, **arg_2)
        else:
            return arg_10

Equalize and the histogram and normalize value range Equalization is on all three bands not per - band


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _kernel_manager . session . session arg_3 = arg_1 [ 'parent_header' ] if not arg_3 : return True else : return arg_3 . get ( 'session' ) == arg_2

def Func(arg_0, arg_1):
        """ Returns whether a reply from the kernel originated from a request
            from this frontend.
        """
        arg_2 = arg_0._kernel_manager.session.session
        arg_3 = arg_1['parent_header']
        if not arg_3:
            # if the message has no parent, assume it is meant for all frontends
            return True
        else:
            return arg_3.get('session') == arg_2

Returns whether a reply from the kernel originated from a request from this frontend .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
server
arg_2
=
request
.
values
.
get
(
'scope'
)
or
''
arg_3
=
arg_2
.
split
(
)
arg_4
=
dict
(
client_id
=
request
.
values
.
get
(
'client_id'
)
,
arg_5
=
request
.
values
.
get
(
'redirect_uri'
,
)
,
response_type
=
request
.
values
.
get
(
'response_type'
,
)
,
arg_11
=
request
.
values
.
get
(
'state'
,
)
)
log
.
debug
(
'Fetched credentials from request %r.'
,
arg_4
)
arg_5
=
arg_4
.
get
(
'redirect_uri'
)
log
.
debug
(
'Found redirect_uri %s.'
,
arg_5
)
arg_6
,
arg_7
,
arg_8
,
arg_9
=
extract_params
(
)
try
:
arg_10
=
arg_1
.
create_authorization_response
(
arg_6
,
arg_7
,
arg_8
,
arg_9
,
arg_3
,
arg_4
)
log
.
debug
(
'Authorization successful.'
)
return
create_response
(
*
arg_10
)
except
oauth2
.
FatalClientError
as
arg_12
:
log
.
debug
(
'Fatal client error %r'
,
arg_12
,
exc_info
=
True
)
return
arg_0
.
_on_exception
(
arg_12
,
arg_12
.
in_uri
(
arg_0
.
error_uri
)
)
except
oauth2
.
OAuth2Error
as
arg_12
:
log
.
debug
(
'OAuth2Error: %r'
,
arg_12
,
exc_info
=
True
)
arg_11
=
request
.
values
.
get
(
'state'
)
if
arg_11
and
not
arg_12
.
state
:
arg_12
.
state
=
arg_11
return
arg_0
.
_on_exception
(
arg_12
,
arg_12
.
in_uri
(
arg_5
or
arg_0
.
error_uri
)
)
except
Exception
as
arg_12
:
log
.
exception
(
arg_12
)
return
arg_0
.
_on_exception
(
arg_12
,
add_params_to_uri
(
arg_0
.
error_uri
,
{
'error'
:
str
(
arg_12
)
}
)
)

def Func(arg_0):
        """When consumer confirm the authorization."""
        arg_1 = arg_0.server
        arg_2 = request.values.get('scope') or ''
        arg_3 = arg_2.split()
        arg_4 = dict(
            client_id=request.values.get('client_id'),
            arg_5=request.values.get('redirect_uri', None),
            response_type=request.values.get('response_type', None),
            arg_11=request.values.get('state', None)
        )
        log.debug('Fetched credentials from request %r.', arg_4)
        arg_5 = arg_4.get('redirect_uri')
        log.debug('Found redirect_uri %s.', arg_5)

        arg_6, arg_7, arg_8, arg_9 = extract_params()
        try:
            arg_10 = arg_1.create_authorization_response(
                arg_6, arg_7, arg_8, arg_9, arg_3, arg_4)
            log.debug('Authorization successful.')
            return create_response(*arg_10)
        except oauth2.FatalClientError as arg_12:
            log.debug('Fatal client error %r', arg_12, exc_info=True)
            return arg_0._on_exception(arg_12, arg_12.in_uri(arg_0.error_uri))
        except oauth2.OAuth2Error as arg_12:
            log.debug('OAuth2Error: %r', arg_12, exc_info=True)

            # on auth error, we should preserve state if it's present according to RFC 6749
            arg_11 = request.values.get('state')
            if arg_11 and not arg_12.state:
                arg_12.state = arg_11  # set e.state so e.in_uri() can add the state query parameter to redirect uri
            return arg_0._on_exception(arg_12, arg_12.in_uri(arg_5 or arg_0.error_uri))
        except Exception as arg_12:
            log.exception(arg_12)
            return arg_0._on_exception(arg_12, add_params_to_uri(
                arg_0.error_uri, {'error': str(arg_12)}
            ))

When consumer confirm the authorization .


return ticket_category not in [cat.id for cat in categories]

def Func ( arg_0 ) : arg_1 = user_for_context ( arg_0 ) if hasattr ( arg_1 , "attendee" ) and arg_1 . attendee . completed_registration : return None arg_2 = settings . TICKET_PRODUCT_CATEGORY arg_3 = available_categories ( arg_0 ) return arg_2 not in [ arg_4 . id for arg_4 in arg_3 ]

def Func(arg_0):
    ''' If the current user is unregistered, returns True if there are no
    products in the TICKET_PRODUCT_CATEGORY that are available to that user.

    If there *are* products available, the return False.

    If the current user *is* registered, then return None (it's not a
    pertinent question for people who already have a ticket).

    '''

    arg_1 = user_for_context(arg_0)
    if hasattr(arg_1, "attendee") and arg_1.attendee.completed_registration:
        # This user has completed registration, and so we don't need to answer
        # whether they have sold out yet.

        # TODO: what if a user has got to the review phase?
        # currently that user will hit the review page, click "Check out and
        # pay", and that will fail. Probably good enough for now.

        return None

    arg_2 = settings.TICKET_PRODUCT_CATEGORY
    arg_3 = available_categories(arg_0)

    return arg_2 not in [arg_4.id for arg_4 in arg_3]

If the current user is unregistered returns True if there are no products in the TICKET_PRODUCT_CATEGORY that are available to that user .


def Func ( arg_0 : arg_1 [ arg_2 ] ) -> Dict [ arg_2 , pd . DataFrame ] : arg_0 = list ( sorted ( arg_0 ) ) arg_3 = OrderedDict ( ) for arg_4 in KEGG_RELATIONS : arg_3 [ arg_4 ] = pd . DataFrame ( 0 , index = arg_0 , columns = arg_0 ) return arg_3

def Func(arg_0: arg_1[arg_2]) -> Dict[arg_2, pd.DataFrame]:
    """Build an adjacency matrix for each KEGG relationship and return in a dictionary.

    :param nodes: A set of HGNC gene symbols
    :return: Dictionary of adjacency matrix for each relationship
    """
    arg_0 = list(sorted(arg_0))

    # Create sheets of the excel in the given order
    arg_3 = OrderedDict()
    for arg_4 in KEGG_RELATIONS:
        arg_3[arg_4] = pd.DataFrame(0, index=arg_0, columns=arg_0)

    return arg_3

Build an adjacency matrix for each KEGG relationship and return in a dictionary .


(
    num_results,
    current_state,
    previous_kernel_results=None,
    kernel=None,
    num_burnin_steps=0,
    num_steps_between_results=0,
    trace_fn=lambda current_state, kernel_results: kernel_results,
    return_final_kernel_results=False,
    parallel_iterations=10,
    name=None,
)

def Func(
    arg_0,
    arg_1,
    arg_2=None,
    arg_3=None,
    arg_4=0,
    arg_5=0,
    arg_6=lambda arg_1, arg_7: arg_7,
    arg_8=False,
    arg_9=10,
    arg_10=None,
):
  """Implements Markov chain Monte Carlo via repeated `TransitionKernel` steps.

  This function samples from an Markov chain at `current_state` and whose
  stationary distribution is governed by the supplied `TransitionKernel`
  instance (`kernel`).

  This function can sample from multiple chains, in parallel. (Whether or not
  there are multiple chains is dictated by the `kernel`.)

  The `current_state` can be represented as a single `Tensor` or a `list` of
  `Tensors` which collectively represent the current state.

  Since MCMC states are correlated, it is sometimes desirable to produce
  additional intermediate states, and then discard them, ending up with a set of
  states with decreased autocorrelation.  See [Owen (2017)][1]. Such "thinning"
  is made possible by setting `num_steps_between_results > 0`. The chain then
  takes `num_steps_between_results` extra steps between the steps that make it
  into the results. The extra steps are never materialized (in calls to
  `sess.run`), and thus do not increase memory requirements.

  Warning: when setting a `seed` in the `kernel`, ensure that `Func`'s
  `parallel_iterations=1`, otherwise results will not be reproducible.

  In addition to returning the chain state, this function supports tracing of
  auxiliary variables used by the kernel. The traced values are selected by
  specifying `trace_fn`. By default, all kernel results are traced but in the
  future the default will be changed to no results being traced, so plan
  accordingly. See below for some examples of this feature.

  Args:
    num_results: Integer number of Markov chain draws.
    current_state: `Tensor` or Python `list` of `Tensor`s representing the
      current state(s) of the Markov chain(s).
    previous_kernel_results: A `Tensor` or a nested collection of `Tensor`s
      representing internal calculations made within the previous call to this
      function (or as returned by `bootstrap_results`).
    kernel: An instance of `tfp.mcmc.TransitionKernel` which implements one step
      of the Markov chain.
    num_burnin_steps: Integer number of chain steps to take before starting to
      collect results.
      Default value: 0 (i.e., no burn-in).
    num_steps_between_results: Integer number of chain steps between collecting
      a result. Only one out of every `num_steps_between_samples + 1` steps is
      included in the returned results.  The number of returned chain states is
      still equal to `num_results`.  Default value: 0 (i.e., no thinning).
    trace_fn: A callable that takes in the current chain state and the previous
      kernel results and return a `Tensor` or a nested collection of `Tensor`s
      that is then traced along with the chain state.
    return_final_kernel_results: If `True`, then the final kernel results are
      returned alongside the chain state and the trace specified by the
      `trace_fn`.
    parallel_iterations: The number of iterations allowed to run in parallel. It
      must be a positive integer. See `tf.while_loop` for more details.
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., "mcmc_Func").

  Returns:
    checkpointable_states_and_trace: if `return_final_kernel_results` is
      `True`. The return value is an instance of
      `CheckpointableStatesAndTrace`.
    all_states: if `return_final_kernel_results` is `False` and `trace_fn` is
      `None`. The return value is a `Tensor` or Python list of `Tensor`s
      representing the state(s) of the Markov chain(s) at each result step. Has
      same shape as input `current_state` but with a prepended
      `num_results`-size dimension.
    states_and_trace: if `return_final_kernel_results` is `False` and
      `trace_fn` is not `None`. The return value is an instance of
      `StatesAndTrace`.

  #### Examples

  ##### Sample from a diagonal-variance Gaussian.

  I.e.,

  ```none
  for i=1..n:
    x[i] ~ MultivariateNormal(loc=0, scale=diag(true_stddev))  # likelihood
  ```

  ```python
  import tensorflow as tf
  import tensorflow_probability as tfp
  tfd = tfp.distributions

  dims = 10
  true_stddev = np.sqrt(np.linspace(1., 3., dims))
  likelihood = tfd.MultivariateNormalDiag(loc=0., scale_diag=true_stddev)

  states = tfp.mcmc.Func(
      num_results=1000,
      num_burnin_steps=500,
      current_state=tf.zeros(dims),
      kernel=tfp.mcmc.HamiltonianMonteCarlo(
        target_log_prob_fn=likelihood.log_prob,
        step_size=0.5,
        num_leapfrog_steps=2),
      trace_fn=None)

  sample_mean = tf.reduce_mean(states, axis=0)
  # ==> approx all zeros

  sample_stddev = tf.sqrt(tf.reduce_mean(
      tf.squared_difference(states, sample_mean),
      axis=0))
  # ==> approx equal true_stddev
  ```

  ##### Sampling from factor-analysis posteriors with known factors.

  I.e.,

  ```none
  # prior
  w ~ MultivariateNormal(loc=0, scale=eye(d))
  for i=1..n:
    # likelihood
    x[i] ~ Normal(loc=w^T F[i], scale=1)
  ```

  where `F` denotes factors.

  ```python
  import tensorflow as tf
  import tensorflow_probability as tfp
  tfd = tfp.distributions

  # Specify model.
  def make_prior(dims):
    return tfd.MultivariateNormalDiag(
        loc=tf.zeros(dims))

  def make_likelihood(weights, factors):
    return tfd.MultivariateNormalDiag(
        loc=tf.matmul(weights, factors, adjoint_b=True))

  def joint_log_prob(num_weights, factors, x, w):
    return (make_prior(num_weights).log_prob(w) +
            make_likelihood(w, factors).log_prob(x))

  def unnormalized_log_posterior(w):
    # Posterior is proportional to: `p(W, X=x | factors)`.
    return joint_log_prob(num_weights, factors, x, w)

  # Setup data.
  num_weights = 10 # == d
  num_factors = 40 # == n
  num_chains = 100

  weights = make_prior(num_weights).sample(1)
  factors = tf.random_normal([num_factors, num_weights])
  x = make_likelihood(weights, factors).sample()

  # Sample from Hamiltonian Monte Carlo Markov Chain.

  # Get `num_results` samples from `num_chains` independent chains.
  chains_states, kernels_results = tfp.mcmc.Func(
      num_results=1000,
      num_burnin_steps=500,
      current_state=tf.zeros([num_chains, num_weights], name='init_weights'),
      kernel=tfp.mcmc.HamiltonianMonteCarlo(
        target_log_prob_fn=unnormalized_log_posterior,
        step_size=0.1,
        num_leapfrog_steps=2))

  # Compute sample stats.
  sample_mean = tf.reduce_mean(chains_states, axis=[0, 1])
  # ==> approx equal to weights

  sample_var = tf.reduce_mean(
      tf.squared_difference(chains_states, sample_mean),
      axis=[0, 1])
  # ==> less than 1
  ```

  ##### Custom tracing functions.

  ```python
  import tensorflow as tf
  import tensorflow_probability as tfp
  tfd = tfp.distributions

  likelihood = tfd.Normal(loc=0., scale=1.)

  def Func(trace_fn):
    return tfp.mcmc.Func(
      num_results=1000,
      num_burnin_steps=500,
      current_state=0.,
      kernel=tfp.mcmc.HamiltonianMonteCarlo(
        target_log_prob_fn=likelihood.log_prob,
        step_size=0.5,
        num_leapfrog_steps=2),
      trace_fn=trace_fn)

  def trace_log_accept_ratio(states, previous_kernel_results):
    return previous_kernel_results.log_accept_ratio

  def trace_everything(states, previous_kernel_results):
    return previous_kernel_results

  _, log_accept_ratio = Func(trace_fn=trace_log_accept_ratio)
  _, kernel_results = Func(trace_fn=trace_everything)

  acceptance_prob = tf.exp(tf.minimum(log_accept_ratio_, 0.))
  # Equivalent to, but more efficient than:
  acceptance_prob = tf.exp(tf.minimum(kernel_results.log_accept_ratio_, 0.))
  ```

  #### References

  [1]: Art B. Owen. Statistically efficient thinning of a Markov chain sampler.
       _Technical Report_, 2017.
       http://statweb.stanford.edu/~owen/reports/bestthinning.pdf
  """
  if not arg_3.is_calibrated:
    warnings.warn("supplied `TransitionKernel` is not calibrated. Markov "
                  "chain may not converge to intended target distribution.")
  with tf.compat.v1.name_scope(
      arg_10, "mcmc_Func",
      [arg_0, arg_4, arg_5]):
    arg_0 = tf.convert_to_tensor(
        value=arg_0, dtype=tf.int32, arg_10="num_results")
    arg_4 = tf.convert_to_tensor(
        value=arg_4, dtype=tf.int32, arg_10="num_burnin_steps")
    arg_5 = tf.convert_to_tensor(
        value=arg_5,
        dtype=tf.int32,
        arg_10="num_steps_between_results")
    arg_1 = tf.nest.map_structure(
        lambda x: tf.convert_to_tensor(value=x, arg_10="current_state"),
        arg_1)
    if arg_2 is None:
      arg_2 = arg_3.bootstrap_results(arg_1)

    if arg_6 is None:
      # It simplifies the logic to use a dummy function here.
      arg_6 = lambda *args: ()
      arg_11 = True
    else:
      arg_11 = False
    if arg_6 is Func.__defaults__[4]:
      warnings.warn("Tracing all kernel results by default is deprecated. Set "
                    "the `trace_fn` argument to None (the future default "
                    "value) or an explicit callback that traces the values "
                    "you are interested in.")

    def _trace_scan_fn(arg_12, arg_13):
      arg_14, arg_15 = mcmc_util.smart_for_loop(
          loop_num_iter=arg_13,
          body_fn=arg_3.one_step,
          initial_loop_vars=list(arg_12),
          arg_9=arg_9)
      return arg_14, arg_15

    (arg_16, arg_17), (arg_18, arg_19) = mcmc_util.trace_scan(
        loop_fn=_trace_scan_fn,
        initial_state=(arg_1, arg_2),
        elems=tf.one_hot(
            indices=0,
            depth=arg_0,
            on_value=1 + arg_4,
            off_value=1 + arg_5,
            dtype=tf.int32),
        # pylint: disable=g-long-lambda
        arg_6=lambda arg_12: (arg_12[0],
                                            arg_6(*arg_12)),
        # pylint: enable=g-long-lambda
        arg_9=arg_9)

    if arg_8:
      return CheckpointableStatesAndTrace(
          arg_18=arg_18,
          arg_19=arg_19,
          arg_17=arg_17)
    else:
      if arg_11:
        return arg_18
      else:
        return StatesAndTrace(arg_18=arg_18, arg_19=arg_19)

Implements Markov chain Monte Carlo via repeated `TransitionKernel` steps.

  This function samples from an Markov chain at `current_state` and whose
  stationary distribution is governed by the supplied `TransitionKernel`
  instance (`kernel`).

  This function can sample from multiple chains, in parallel. (Whether or not
  there are multiple chains is dictated by the `kernel`.)

  The `current_state` can be represented as a single `Tensor` or a `list` of
  `Tensors` which collectively represent the current state.

  Since MCMC states are correlated, it is sometimes desirable to produce
  additional intermediate states, and then discard them, ending up with a set of
  states with decreased autocorrelation.  See [Owen (2017)][1]. Such "thinning"
  is made possible by setting `num_steps_between_results > 0`. The chain then
  takes `num_steps_between_results` extra steps between the steps that make it
  into the results. The extra steps are never materialized (in calls to
  `sess.run`), and thus do not increase memory requirements.

  Warning: when setting a `seed` in the `kernel`, ensure that `sample_chain`'s
  `parallel_iterations=1`, otherwise results will not be reproducible.

  In addition to returning the chain state, this function supports tracing of
  auxiliary variables used by the kernel. The traced values are selected by
  specifying `trace_fn`. By default, all kernel results are traced but in the
  future the default will be changed to no results being traced, so plan
  accordingly. See below for some examples of this feature.

  Args:
    num_results: Integer number of Markov chain draws.
    current_state: `Tensor` or Python `list` of `Tensor`s representing the
      current state(s) of the Markov chain(s).
    previous_kernel_results: A `Tensor` or a nested collection of `Tensor`s
      representing internal calculations made within the previous call to this
      function (or as returned by `bootstrap_results`).
    kernel: An instance of `tfp.mcmc.TransitionKernel` which implements one step
      of the Markov chain.
    num_burnin_steps: Integer number of chain steps to take before starting to
      collect results.
      Default value: 0 (i.e., no burn-in).
    num_steps_between_results: Integer number of chain steps between collecting
      a result. Only one out of every `num_steps_between_samples + 1` steps is
      included in the returned results.  The number of returned chain states is
      still equal to `num_results`.  Default value: 0 (i.e., no thinning).
    trace_fn: A callable that takes in the current chain state and the previous
      kernel results and return a `Tensor` or a nested collection of `Tensor`s
      that is then traced along with the chain state.
    return_final_kernel_results: If `True`, then the final kernel results are
      returned alongside the chain state and the trace specified by the
      `trace_fn`.
    parallel_iterations: The number of iterations allowed to run in parallel. It
      must be a positive integer. See `tf.while_loop` for more details.
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., "mcmc_sample_chain").

  Returns:
    checkpointable_states_and_trace: if `return_final_kernel_results` is
      `True`. The return value is an instance of
      `CheckpointableStatesAndTrace`.
    all_states: if `return_final_kernel_results` is `False` and `trace_fn` is
      `None`. The return value is a `Tensor` or Python list of `Tensor`s
      representing the state(s) of the Markov chain(s) at each result step. Has
      same shape as input `current_state` but with a prepended
      `num_results`-size dimension.
    states_and_trace: if `return_final_kernel_results` is `False` and
      `trace_fn` is not `None`. The return value is an instance of
      `StatesAndTrace`.

  #### Examples

  ##### Sample from a diagonal-variance Gaussian.

  I.e.,

  ```none
  for i=1..n:
    x[i] ~ MultivariateNormal(loc=0, scale=diag(true_stddev))  # likelihood
  ```

  ```python
  import tensorflow as tf
  import tensorflow_probability as tfp
  tfd = tfp.distributions

  dims = 10
  true_stddev = np.sqrt(np.linspace(1., 3., dims))
  likelihood = tfd.MultivariateNormalDiag(loc=0., scale_diag=true_stddev)

  states = tfp.mcmc.sample_chain(
      num_results=1000,
      num_burnin_steps=500,
      current_state=tf.zeros(dims),
      kernel=tfp.mcmc.HamiltonianMonteCarlo(
        target_log_prob_fn=likelihood.log_prob,
        step_size=0.5,
        num_leapfrog_steps=2),
      trace_fn=None)

  sample_mean = tf.reduce_mean(states, axis=0)
  # ==> approx all zeros

  sample_stddev = tf.sqrt(tf.reduce_mean(
      tf.squared_difference(states, sample_mean),
      axis=0))
  # ==> approx equal true_stddev
  ```

  ##### Sampling from factor-analysis posteriors with known factors.

  I.e.,

  ```none
  # prior
  w ~ MultivariateNormal(loc=0, scale=eye(d))
  for i=1..n:
    # likelihood
    x[i] ~ Normal(loc=w^T F[i], scale=1)
  ```

  where `F` denotes factors.

  ```python
  import tensorflow as tf
  import tensorflow_probability as tfp
  tfd = tfp.distributions

  # Specify model.
  def make_prior(dims):
    return tfd.MultivariateNormalDiag(
        loc=tf.zeros(dims))

  def make_likelihood(weights, factors):
    return tfd.MultivariateNormalDiag(
        loc=tf.matmul(weights, factors, adjoint_b=True))

  def joint_log_prob(num_weights, factors, x, w):
    return (make_prior(num_weights).log_prob(w) +
            make_likelihood(w, factors).log_prob(x))

  def unnormalized_log_posterior(w):
    # Posterior is proportional to: `p(W, X=x | factors)`.
    return joint_log_prob(num_weights, factors, x, w)

  # Setup data.
  num_weights = 10 # == d
  num_factors = 40 # == n
  num_chains = 100

  weights = make_prior(num_weights).sample(1)
  factors = tf.random_normal([num_factors, num_weights])
  x = make_likelihood(weights, factors).sample()

  # Sample from Hamiltonian Monte Carlo Markov Chain.

  # Get `num_results` samples from `num_chains` independent chains.
  chains_states, kernels_results = tfp.mcmc.sample_chain(
      num_results=1000,
      num_burnin_steps=500,
      current_state=tf.zeros([num_chains, num_weights], name='init_weights'),
      kernel=tfp.mcmc.HamiltonianMonteCarlo(
        target_log_prob_fn=unnormalized_log_posterior,
        step_size=0.1,
        num_leapfrog_steps=2))

  # Compute sample stats.
  sample_mean = tf.reduce_mean(chains_states, axis=[0, 1])
  # ==> approx equal to weights

  sample_var = tf.reduce_mean(
      tf.squared_difference(chains_states, sample_mean),
      axis=[0, 1])
  # ==> less than 1
  ```

  ##### Custom tracing functions.

  ```python
  import tensorflow as tf
  import tensorflow_probability as tfp
  tfd = tfp.distributions

  likelihood = tfd.Normal(loc=0., scale=1.)

  def sample_chain(trace_fn):
    return tfp.mcmc.sample_chain(
      num_results=1000,
      num_burnin_steps=500,
      current_state=0.,
      kernel=tfp.mcmc.HamiltonianMonteCarlo(
        target_log_prob_fn=likelihood.log_prob,
        step_size=0.5,
        num_leapfrog_steps=2),
      trace_fn=trace_fn)

  def trace_log_accept_ratio(states, previous_kernel_results):
    return previous_kernel_results.log_accept_ratio

  def trace_everything(states, previous_kernel_results):
    return previous_kernel_results

  _, log_accept_ratio = sample_chain(trace_fn=trace_log_accept_ratio)
  _, kernel_results = sample_chain(trace_fn=trace_everything)

  acceptance_prob = tf.exp(tf.minimum(log_accept_ratio_, 0.))
  # Equivalent to, but more efficient than:
  acceptance_prob = tf.exp(tf.minimum(kernel_results.log_accept_ratio_, 0.))
  ```

  #### References

  [1]: Art B. Owen. Statistically efficient thinning of a Markov chain sampler.
       _Technical Report_, 2017.
       http://statweb.stanford.edu/~owen/reports/bestthinning.pdf

Implements Markov chain Monte Carlo via repeated TransitionKernel steps .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is not None and arg_0 . response is not None : arg_0 . response [ 'Content-Type' ] = arg_0 . media_types [ 0 ] arg_0 . response . write ( arg_1 ) return arg_1

def Func(arg_0, arg_1=None):
        """
        Transforms the object into an acceptable format for transmission.

        @throws ValueError
            To indicate this Funcr does not support the encoding of the
            specified object.
        """
        if arg_1 is not None and arg_0.response is not None:
            # Set the content type.
            arg_0.response['Content-Type'] = arg_0.media_types[0]

            # Write the encoded and prepared data to the response.
            arg_0.response.write(arg_1)

        # Return the Funcd data.
        # This has normally been transformed by a base class.
        return arg_1

Transforms the object into an acceptable format for transmission.

        @throws ValueError
            To indicate this serializer does not support the encoding of the
            specified object.

Transforms the object into an acceptable format for transmission .


(parser, name, default=False, help=None)

def Func(arg_0, arg_1, arg_2=False, arg_3=None):
    """Add a boolean flag to argparse parser.

    Parameters
    ----------
    parser: argparse.Parser
        parser to add the flag to
    name: str
        --<name> will enable the flag, while --no-<name> will disable it
    default: bool or None
        default value of the flag
    help: str
        help string for the flag
    """
    arg_4 = arg_1.replace('-', '_')
    arg_0.add_argument("--" + arg_1, action="store_true", arg_2=arg_2, arg_4=arg_4, arg_3=arg_3)
    arg_0.add_argument("--no-" + arg_1, action="store_false", arg_4=arg_4)


def Func ( arg_0 ) : arg_1 = arg_0 . _backend . Func ( ) if arg_1 == numbers . EMPTY_KEY : return None return arg_1

def Func(arg_0):
        """
        Returns private spend key. None if wallet is view-only.

        :rtype: str or None
        """
        arg_1 = arg_0._backend.Func()
        if arg_1 == numbers.EMPTY_KEY:
            return None
        return arg_1

Returns private spend key . None if wallet is view - only .


def Func ( arg_0 , arg_1 ) : arg_0 . _unknownConnections . add ( arg_1 ) arg_2 = arg_0 . _syncObj . encryptor if arg_2 : arg_1 . encryptor = arg_2 arg_1 . setOnMessageReceivedCallback ( functools . partial ( arg_0 . _onIncomingMessageReceived , arg_1 ) ) arg_1 . setOnDisconnectedCallback ( functools . partial ( arg_0 . _onDisconnected , arg_1 ) )

def Func(arg_0, arg_1):
        """
        Callback for connections initiated by the other side

        :param conn: connection object
        :type conn: TcpConnection
        """

        arg_0._unknownConnections.add(arg_1)
        arg_2 = arg_0._syncObj.encryptor
        if arg_2:
            arg_1.encryptor = arg_2
        arg_1.setOnMessageReceivedCallback(functools.partial(arg_0._onIncomingMessageReceived, arg_1))
        arg_1.setOnDisconnectedCallback(functools.partial(arg_0._onDisconnected, arg_1))


def Func ( arg_0 ) : assert os . path . exists ( arg_0 ) arg_1 = 0 ( arg_2 , arg_3 ) = os . path . splitext ( arg_0 ) while True : arg_4 = "%s.%d%s" % ( arg_2 , arg_1 , arg_3 ) arg_1 += 1 if not os . path . exists ( arg_4 ) : break shutil . copyfile ( arg_0 , arg_4 ) return arg_4

def Func(arg_0):
  """Back up a file

  Parameters:
  ----------------------------------------------------------------------
  retval:         Filepath of the back-up
  """
  assert os.path.exists(arg_0)

  arg_1 = 0
  (arg_2, arg_3) = os.path.splitext(arg_0)
  while True:
    arg_4 = "%s.%d%s" % (arg_2, arg_1, arg_3)
    arg_1 += 1
    if not os.path.exists(arg_4):
      break
  shutil.copyfile(arg_0, arg_4)

  return arg_4


def Func ( arg_0 , arg_1 ) : if arg_1 : if arg_0 . ignored : arg_0 . ignored = arg_1 + arg_0 . ignored else : arg_0 . ignored = arg_1 arg_0 . consumed += len ( arg_1 )

def Func(arg_0, arg_1):
    """Add ignored text to the node. This will add the length of the ignored text to the node's
    consumed property.
    """
    if arg_1:
      if arg_0.ignored:
        arg_0.ignored = arg_1 + arg_0.ignored
      else:
        arg_0.ignored = arg_1

    arg_0.consumed += len(arg_1)

Add ignored text to the node . This will add the length of the ignored text to the node s consumed property .


Calls vsearch for clustering. cov varies by data type, values were chosen
    based on experience, but could be edited by users

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Calls vsearch for Funcing. cov varies by data type, values were chosen
    based on experience, but could be edited by users
    """

    ## get the dereplicated reads
    if "reference" in arg_0.paramsdict["assembly_method"]:
        arg_4 = os.path.join(arg_0.dirs.edits, arg_1.name+"-refmap_derep.fastq")
        ## In the event all reads for all samples map successfully then Funcing
        ## the unmapped reads makes no sense, so just bail out.
        if not os.stat(arg_4).st_size:
            ## In this case you do have to create empty, dummy vsearch output
            ## files so building_Funcs will not fail.
            arg_5 = os.path.join(arg_0.dirs.clusts, arg_1.name+".utemp")
            arg_6 = os.path.join(arg_0.dirs.clusts, arg_1.name+".utemp.sort")
            arg_7 = os.path.join(arg_0.dirs.clusts, arg_1.name+".htemp")
            for arg_8 in [arg_5, arg_6, arg_7]:
                open(arg_8, 'a').close()
            return
    else:
        arg_4 = os.path.join(arg_0.dirs.edits, arg_1.name+"_derep.fastq")

    ## create handles for the outfiles
    arg_5 = os.path.join(arg_0.dirs.clusts, arg_1.name+".utemp")
    arg_9 = os.path.join(arg_0.dirs.clusts, arg_1.name+".htemp")

    ## If derep file doesn't exist then bail out
    if not os.path.isfile(arg_4):
        LOGGER.warn("Bad derephandle - {}".format(arg_4))
        raise IPyradError("Input file for Funcing doesn't exist - {}"\
                        .format(arg_4))

    ## testing one sample fail
    #if sample.name == "1C_0":
    #    x

    ## datatype specific optimization
    ## minsl: the percentage of the seed that must be matched
    ##    smaller values for RAD/ddRAD where we might want to combine, say 50bp
    ##    reads and 100bp reads in the same analysis.
    ## query_cov: the percentage of the query sequence that must match seed
    ##    smaller values are needed for gbs where only the tips might overlap
    ##    larger values for pairgbs where they should overlap near completely
    ##    small minsl and high query cov allows trimmed reads to match to untrim
    ##    seed for rad/ddrad/pairddrad.
    arg_10 = "plus"
    arg_11 = 0.75
    arg_12 = 0.5
    if arg_0.paramsdict["datatype"] in ["gbs", "2brad"]:
        arg_10 = "both"
        arg_11 = 0.5
        arg_12 = 0.5
    elif arg_0.paramsdict["datatype"] == 'pairgbs':
        arg_10 = "both"
        arg_11 = 0.75
        arg_12 = 0.75

    ## If this value is not null (which is the default) then override query cov
    if arg_0._hackersonly["query_cov"]:
        arg_11 = str(arg_0._hackersonly["query_cov"])
        assert float(arg_11) <= 1, "query_cov must be <= 1.0"

    ## get call string
    arg_13 = [ipyrad.bins.vsearch,
           "-Func_smallmem", arg_4,
           "-strand", arg_10,
           "-query_cov", str(arg_11),
           "-id", str(arg_0.paramsdict["clust_threshold"]),
           "-minsl", str(arg_12),
           "-userout", arg_5,
           "-userfields", "query+target+id+gaps+qstrand+qcov",
           "-maxaccepts", "1",
           "-maxrejects", "0",
           "-threads", str(arg_2),
           "-notmatched", arg_9,
           "-fasta_width", "0",
           "-fastq_qmax", "100",
           "-fulldp",
           "-usersort"]

    ## not sure what the benefit of this option is exactly, needs testing,
    ## might improve indel detection on left side, but we don't want to enforce
    ## aligning on left side if not necessarily, since quality trimmed reads
    ## might lose bases on left side in step2 and no longer align.
    #if data.paramsdict["datatype"] in ["rad", "ddrad", "pairddrad"]:
    #    cmd += ["-leftjust"]

    ## run vsearch
    LOGGER.debug("%s", arg_13)
    arg_14 = sps.Popen(arg_13, stderr=sps.STDOUT, stdout=sps.PIPE, close_fds=True)

    ## This is long running so we wrap it to make sure we can kill it
    try:
        arg_15 = arg_14.communicate()[0]
    except KeyboardInterrupt:
        arg_14.kill()
        raise KeyboardInterrupt

    ## check for errors
    if arg_14.returncode:
        LOGGER.error("error %s: %s", arg_13, arg_15)
        raise IPyradWarningExit("cmd {}: {}".format(arg_13, arg_15))

Calls vsearch for clustering . cov varies by data type values were chosen based on experience but could be edited by users


def Func(arg_0):
        """
        Re-draws the text by calculating its position.

        Currently, the text will always be centered on the position of the label.
        """
        # Convenience variables
        arg_1,arg_2 = arg_0.size
        arg_3,arg_4 = arg_0.pos

        # Label position
        arg_0._label.font_name = arg_0.font_name
        arg_0._label.font_size = arg_0.font_size
        arg_0._label.font_color = arg_0.font_color

        arg_0._label.x = int(arg_3+arg_1/2.)
        arg_0._label.y = int(arg_4+arg_2/2.)
        arg_0._label.width = arg_0.size[0]
        arg_0._label.height = arg_0.size[1]
        arg_0._label._update()

Re - draws the text by calculating its position . Currently the text will always be centered on the position of the label .


(vec, trace_systems, dimensions, reverse=True)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : if arg_3 : arg_2 = arg_2 [ : : - 1 ] arg_1 = len ( arg_2 ) - 1 - np . array ( arg_1 ) arg_4 = arg_0 . reshape ( arg_2 ) arg_4 = np . tensordot ( arg_4 , arg_4 . conj ( ) , axes = ( arg_1 , arg_1 ) ) arg_5 = int ( np . sqrt ( np . product ( arg_4 . shape ) ) ) return arg_4 . reshape ( arg_5 , arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3=True):
    """
    Partial trace over subsystems of multi-partite vector.

    Args:
        vec (vector_like): complex vector N
        trace_systems (list(int)): a list of subsystems (starting from 0) to
                                  trace over.
        dimensions (list(int)): a list of the dimensions of the subsystems.
                                If this is not set it will assume all
                                subsystems are qubits.
        reverse (bool): ordering of systems in operator.
            If True system-0 is the right most system in tensor product.
            If False system-0 is the left most system in tensor product.

    Returns:
        ndarray: A density matrix with the appropriate subsystems traced over.
    """

    # trace sys positions
    if arg_3:
        arg_2 = arg_2[::-1]
        arg_1 = len(arg_2) - 1 - np.array(arg_1)

    arg_4 = arg_0.reshape(arg_2)
    arg_4 = np.tensordot(arg_4, arg_4.conj(), axes=(arg_1, arg_1))
    arg_5 = int(np.sqrt(np.product(arg_4.shape)))

    return arg_4.reshape(arg_5, arg_5)

Partial trace over subsystems of multi - partite vector .


def Func ( arg_0 ) : arg_1 = arg_0 . _meta arg_2 = { } for arg_3 in arg_1 . concrete_fields : if arg_3 . attname in arg_0 . morango_fields_not_to_Func : continue if arg_3 . attname in arg_0 . _morango_internal_fields_not_to_Func : continue if arg_3 . attname in getattr ( arg_0 , '_internal_mptt_fields_not_to_Func' , '_internal_fields_not_to_Func' ) : continue if hasattr ( arg_3 , 'value_from_object_json_compatible' ) : arg_2 [ arg_3 . attname ] = arg_3 . value_from_object_json_compatible ( arg_0 ) else : arg_2 [ arg_3 . attname ] = arg_3 . value_from_object ( arg_0 ) return arg_2

def Func(arg_0):
        """All concrete fields of the ``SyncableModel`` subclass, except for those specifically blacklisted, are returned in a dict."""
        # NOTE: code adapted from https://github.com/django/django/blob/master/django/forms/models.py#L75
        arg_1 = arg_0._meta

        arg_2 = {}
        for arg_3 in arg_1.concrete_fields:
            if arg_3.attname in arg_0.morango_fields_not_to_Func:
                continue
            if arg_3.attname in arg_0._morango_internal_fields_not_to_Func:
                continue
            # case if model is morango mptt
            if arg_3.attname in getattr(arg_0, '_internal_mptt_fields_not_to_Func', '_internal_fields_not_to_Func'):
                continue
            if hasattr(arg_3, 'value_from_object_json_compatible'):
                arg_2[arg_3.attname] = arg_3.value_from_object_json_compatible(arg_0)
            else:
                arg_2[arg_3.attname] = arg_3.value_from_object(arg_0)
        return arg_2

All concrete fields of the SyncableModel subclass except for those specifically blacklisted are returned in a dict .


return dict([(k, v[0] if not isinstance(v, str) and len(v) == 1 else v)
                 for k, v in list(dict_.items())])

def Func ( arg_0 ) : return dict ( [ ( arg_1 , arg_2 [ 0 ] if not isinstance ( arg_2 , str ) and len ( arg_2 ) == 1 else arg_2 ) for arg_1 , arg_2 in list ( arg_0 . items ( ) ) ] )

def Func(arg_0):
    """
    Replaces all values that are single-item iterables with the value of its
    index 0.

    :param dict dict_:
        Dictionary to normalize.

    :returns:
        Normalized dictionary.

    """

    return dict([(arg_1, arg_2[0] if not isinstance(arg_2, str) and len(arg_2) == 1 else arg_2)
                 for arg_1, arg_2 in list(arg_0.items())])

Replaces all values that are single - item iterables with the value of its index 0 .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . require_http_allowed_method ( arg_1 ) arg_3 = getattr ( arg_0 , arg_1 . method . lower ( ) , None ) if arg_3 is None : raise http . exceptions . NotImplemented ( ) return arg_3 ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """Processes every request.

        Directs control flow to the appropriate HTTP/1.1 method.
        """
        # Ensure that we're allowed to use this HTTP method.
        arg_0.require_http_allowed_method(arg_1)

        # Retrieve the function corresponding to this HTTP method.
        arg_3 = getattr(arg_0, arg_1.method.lower(), None)
        if arg_3 is None:
            # Server is not capable of supporting it.
            raise http.exceptions.NotImplemented()

        # Delegate to the determined function to process the request.
        return arg_3(arg_1, arg_2)


(self, id, eligible=None, ineligible=None)

return self.request(id, "eligibility", json=payload, method="post").json()

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_4 = { } if arg_2 is not None and arg_3 is not None : raise nomad . api . exceptions . InvalidParameters if arg_2 is None and arg_3 is None : raise nomad . api . exceptions . InvalidParameters if arg_2 is not None and arg_2 : arg_4 = { "Eligibility" : "eligible" , "NodeID" : arg_1 } elif arg_2 is not None and not arg_2 : arg_4 = { "Eligibility" : "ineligible" , "NodeID" : arg_1 } elif arg_3 is not None : arg_4 = { "Eligibility" : "ineligible" , "NodeID" : arg_1 } elif arg_3 is not None and not arg_3 : arg_4 = { "Eligibility" : "eligible" , "NodeID" : arg_1 } return arg_0 . request ( arg_1 , "eligibility" , json = arg_4 , method = "post" ) . json ( )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """ Toggle the eligibility of the node.

           https://www.nomadproject.io/docs/http/node.html

            arguments:
              - id (str uuid): node id
              - eligible (bool): Set to True to mark node eligible
              - ineligible (bool): Set to True to mark node ineligible
            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_4 = {}

        if arg_2 is not None and arg_3 is not None:
            raise nomad.api.exceptions.InvalidParameters
        if arg_2 is None and arg_3 is None:
            raise nomad.api.exceptions.InvalidParameters

        if arg_2 is not None and arg_2:
            arg_4 = {"Eligibility": "eligible", "NodeID": arg_1}
        elif arg_2 is not None and not arg_2:
            arg_4 = {"Eligibility": "ineligible", "NodeID": arg_1}
        elif arg_3 is not None:
            arg_4 = {"Eligibility": "ineligible", "NodeID": arg_1}
        elif arg_3 is not None and not arg_3:
            arg_4 = {"Eligibility": "eligible", "NodeID": arg_1}

        return arg_0.request(arg_1, "eligibility", json=arg_4, method="post").json()


def Func ( arg_0 ) : import pandas as pd return pd . Series ( arg_0 ) . dt . dayofyear . values

def Func(arg_0):
    """The ordinal day of the year.

    :returns: an expression containing the ordinal day of the year.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.dayofyear
    Expression = Func(date)
    Length: 3 dtype: int64 (expression)
    -----------------------------------
    0  285
    1   42
    2  316
    """
    import pandas as pd
    return pd.Series(arg_0).dt.dayofyear.values

The ordinal day of the year.

    :returns: an expression containing the ordinal day of the year.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.dayofyear
    Expression = dt_dayofyear(date)
    Length: 3 dtype: int64 (expression)
    -----------------------------------
    0  285
    1   42
    2  316


def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . shape if arg_2 < 2 : return 0 arg_3 = np . var ( arg_0 , axis = 1 , ddof = 1 ) arg_4 = - 0.5 * arg_1 * arg_2 * np . log ( 2. * np . pi ) - 0.5 * ( arg_2 - 1. ) * np . sum ( arg_3 ) return arg_4

def Func(arg_0):
    '''Return the average log-likelihood of data under a standard normal
    '''

    arg_1, arg_2 = arg_0.shape

    if arg_2 < 2:
        return 0

    arg_3 = np.var(arg_0, axis=1, ddof=1)

    arg_4 = -0.5 * arg_1 * arg_2 * np.log(2. * np.pi) - 0.5 * (arg_2 - 1.) * np.sum(arg_3)
    return arg_4

Return the average log - likelihood of data under a standard normal


def Func(arg_0, arg_1):
  '''
  Template slave config file
  '''
  arg_2 = "%s/standalone/templates/slave.template.hcl" % arg_0["config_path"]
  arg_3 = "%s/standalone/resources/slave.hcl" % arg_0["config_path"]
  arg_4 = ['"%s"' % master for master in arg_1]
  template_file(arg_2, arg_3,
                {"<nomad_masters:master_port>": ", ".join(arg_4)})


def Func ( arg_0 , arg_1 , ** arg_2 ) : try : arg_0 . assert_title ( arg_1 , ** arg_2 ) return True except ExpectationNotMet : return False

def Func(arg_0, arg_1, **arg_2):
        """
        Checks if the page has the given title.

        Args:
            title (str | RegexObject): The string or regex that the title should match.
            **kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.

        Returns:
            bool: Whether it matches.
        """

        try:
            arg_0.assert_title(arg_1, **arg_2)
            return True
        except ExpectationNotMet:
            return False

Checks if the page has the given title .


(self, name, type_name, validators, desc=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """Add type information for a parameter by name.

        Args:
            name (str): The name of the parameter we wish to annotate
            type_name (str): The name of the parameter's type
            validators (list): A list of either strings or n tuples that each
                specify a validator defined for type_name.  If a string is passed,
                the validator is invoked with no extra arguments.  If a tuple is
                passed, the validator will be invoked with the extra arguments.
            desc (str): Optional parameter description.
        """

        if arg_1 in arg_0.annotated_params:
            raise TypeSystemError("Annotation specified multiple times for the same parameter", param=arg_1)

        if arg_1 not in arg_0.arg_names and arg_1 != arg_0.varargs and arg_1 != arg_0.kwargs:
            raise TypeSystemError("Annotation specified for unknown parameter", param=arg_1)

        arg_5 = ParameterInfo(arg_2, arg_3, arg_4)
        arg_0.annotated_params[arg_1] = arg_5

Add type information for a parameter by name .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_1
[
'type'
]
==
'bridge'
and
arg_2
<
2
:
arg_3
=
' '
.
join
(
arg_1
.
pop
(
'bridge_members'
)
)
if
arg_3
:
arg_1
[
'ifname'
]
=
arg_3
else
:
arg_1
[
'bridge_empty'
]
=
True
del
arg_1
[
'ifname'
]
elif
arg_1
[
'type'
]
==
'bridge'
and
arg_2
>=
2
:
if
'br-'
not
in
arg_1
[
'ifname'
]
:
arg_1
[
'ifname'
]
=
'br-{ifname}'
.
format
(
**
arg_1
)
for
arg_4
in
[
'type'
,
'bridge_members'
,
'stp'
,
'gateway'
]
:
if
arg_4
in
arg_1
:
del
arg_1
[
arg_4
]
elif
arg_1
[
'type'
]
!=
'bridge'
:
del
arg_1
[
'type'
]
return
arg_1

def Func(arg_0, arg_1, arg_2):
        """
        converts NetJSON bridge to
        UCI intermediate data structure
        """
        # ensure type "bridge" is only given to one logical interface
        if arg_1['type'] == 'bridge' and arg_2 < 2:
            arg_3 = ' '.join(arg_1.pop('bridge_members'))
            # put bridge members in ifname attribute
            if arg_3:
                arg_1['ifname'] = arg_3
            # if no members, this is an empty bridge
            else:
                arg_1['bridge_empty'] = True
                del arg_1['ifname']
        # bridge has already been defined
        # but we need to add more references to it
        elif arg_1['type'] == 'bridge' and arg_2 >= 2:
            # openwrt adds "br-" prefix to bridge interfaces
            # we need to take this into account when referring
            # to these physical names
            if 'br-' not in arg_1['ifname']:
                arg_1['ifname'] = 'br-{ifname}'.format(**arg_1)
            # do not repeat bridge attributes (they have already been processed)
            for arg_4 in ['type', 'bridge_members', 'stp', 'gateway']:
                if arg_4 in arg_1:
                    del arg_1[arg_4]
        elif arg_1['type'] != 'bridge':
            del arg_1['type']
        return arg_1


def Func(arg_0, **arg_1):
        """
        Calculates Normalized Difference Vegetation Index using NIR and Red of an image.

        Returns: numpy array with Func values
        """
        arg_2 = arg_0._read(arg_0[arg_0._Func_bands,...]).astype(np.float32)
        return (arg_2[0,:,:] - arg_2[1,:,:]) / (arg_2[0,:,:] + arg_2[1,:,:])

Calculates Normalized Difference Vegetation Index using NIR and Red of an image.

        Returns: numpy array with ndvi values

Calculates Normalized Difference Vegetation Index using NIR and Red of an image .


(self, user_token, pin, skip_validation=False)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : if not arg_3 : validate_pin ( arg_2 ) arg_4 = _request ( 'PUT' , url = arg_0 . url_v1 ( '/user/pins/' + arg_2 [ 'id' ] ) , user_agent = arg_0 . user_agent , arg_1 = arg_1 , json = arg_2 , ) _raise_for_status ( arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3=False):
        """
        Send a user pin.

        :param str user_token: The token of the user.
        :param dict pin: The pin.
        :param bool skip_validation: Whether to skip the validation.
        :raises pypebbleapi.schemas.DocumentError: If the validation process failed.
        :raises `requests.exceptions.HTTPError`: If an HTTP error occurred.
        """
        if not arg_3:
            validate_pin(arg_2)

        arg_4 = _request('PUT',
            url=arg_0.url_v1('/user/pins/' + arg_2['id']),
            user_agent=arg_0.user_agent,
            arg_1=arg_1,
            json=arg_2,
        )
        _raise_for_status(arg_4)


def Func ( arg_0 , arg_1 , ** arg_2 ) : if not isinstance ( arg_1 , Node ) : arg_3 = str ( arg_1 ) if arg_3 in arg_0 . nodes : arg_4 = arg_0 . nodes [ arg_0 . nodes . index ( arg_3 ) ] else : if arg_0 . default_node is not None : arg_4 = arg_0 . default_node . clone_traits ( copy = "deep" ) arg_4 . ID = arg_3 else : arg_4 = Node ( arg_3 ) arg_0 . nodes . append ( arg_4 ) else : arg_4 = arg_1 if arg_4 in arg_0 . nodes : arg_4 = arg_0 . nodes [ arg_0 . nodes . index ( arg_1 ) ] else : arg_0 . nodes . append ( arg_4 ) arg_4 . set ( ** arg_2 ) return arg_4

def Func(arg_0, arg_1, **arg_2):
        """ Adds a node to the graph.
        """
        if not isinstance(arg_1, Node):
            arg_3 = str( arg_1 )
            if arg_3 in arg_0.nodes:
                arg_4 = arg_0.nodes[ arg_0.nodes.index(arg_3) ]
            else:
                if arg_0.default_node is not None:
                    arg_4 = arg_0.default_node.clone_traits(copy="deep")
                    arg_4.ID = arg_3
                else:
                    arg_4 = Node(arg_3)
                arg_0.nodes.append( arg_4 )
        else:
            arg_4 = arg_1
            if arg_4 in arg_0.nodes:
                arg_4 = arg_0.nodes[ arg_0.nodes.index(arg_1) ]
            else:
                arg_0.nodes.append( arg_4 )

        arg_4.set( **arg_2 )

        return arg_4


(
        src, requirements=None, local_package=None,
        config_file='config.yaml', profile_name=None,
        preserve_vpc=False
)

def Func(
        arg_0, arg_1=None, arg_2=None,
        arg_3='config.yaml', arg_4=None,
        arg_5=False
):
    """Deploys a new function to AWS Lambda.

    :param str src:
        The path to your Lambda ready project (folder must contain a valid
        config.yaml and handler module (e.g.: service.py).
    :param str local_package:
        The path to a local package with should be included in the Func as
        well (and/or is not available on PyPi)
    """
    # Load and parse the config file.
    arg_6 = os.path.join(arg_0, arg_3)
    arg_7 = read_cfg(arg_6, arg_4)

    # Copy all the pip dependencies required to run your code into a temporary
    # folder then add the handler file in the root of this directory.
    # Zip the contents of this folder into a single file and output to the dist
    # directory.
    arg_8 = build(
        arg_0, arg_3=arg_3,
        arg_1=arg_1,
        arg_2=arg_2,
    )

    arg_9 = get_function_config(arg_7)
    if arg_9:
        update_function(arg_7, arg_8, arg_9, arg_5=arg_5)
    else:
        create_function(arg_7, arg_8)

Deploys a new function to AWS Lambda.

    :param str src:
        The path to your Lambda ready project (folder must contain a valid
        config.yaml and handler module (e.g.: service.py).
    :param str local_package:
        The path to a local package with should be included in the deploy as
        well (and/or is not available on PyPi)


def Func ( arg_0 : arg_1 ) -> NodePredicate : def data_contains_key ( arg_2 : arg_3 , arg_4 : arg_5 ) -> bool : return arg_0 in arg_4 return data_contains_key

def Func(arg_0: arg_1) -> NodePredicate:  # noqa: D202
    """Build a filter that passes only on nodes that have the given key in their data dictionary.

    :param key: A key for the node's data dictionary
    """

    def data_contains_key(arg_2: arg_3, arg_4: arg_5) -> bool:
        """Pass only for a node that contains the enclosed key in its data dictionary.

        :return: If the node contains the enclosed key in its data dictionary
        """
        return arg_0 in arg_4

    return data_contains_key

Build a filter that passes only on nodes that have the given key in their data dictionary .


(self, x, y, limits, mode="replace", name="default")

def Func(arg_0, arg_1, arg_2, arg_3, arg_4="replace", arg_5="default"):
        """Select a 2d rectangular box in the space given by x and y, bounds by limits.

        Example:

        >>> df.select_box('x', 'y', [(0, 10), (0, 1)])

        :param x: expression for the x space
        :param y: expression fo the y space
        :param limits: sequence of shape [(x1, x2), (y1, y2)]
        :param mode:
        """
        arg_0.select_box([arg_1, arg_2], arg_3, arg_4=arg_4, arg_5=arg_5)

Select a 2d rectangular box in the space given by x and y bounds by limits .


(socket, flags=0, capture=(lambda msgs: None))

def Func(arg_0, arg_1=0, arg_2=(lambda arg_3: None)):
    """Receives header, payload, and topics through a ZeroMQ socket.

    :param socket: a zmq socket.
    :param flags: zmq flags to receive messages.
    :param capture: a function to capture received messages.

    """
    arg_3 = eintr_retry_zmq(arg_0.Func_multipart, arg_1)
    arg_2(arg_3)
    return parse(arg_3)

Receives header payload and topics through a ZeroMQ socket .


return columns, math.ceil(sum_column_widths) + 4

def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . ops : arg_3 = 0 for arg_4 in arg_2 : arg_5 = 0 for arg_6 in arg_4 . op . params : arg_7 = re . sub ( r'[-+]?\d*\.\d{2,}|\d{2,}' , _truncate_float , str ( arg_6 ) ) arg_5 += len ( arg_7 ) arg_3 = max ( arg_5 , arg_3 ) arg_1 . append ( arg_3 ) arg_8 = 2 arg_8 += len ( arg_0 . ops ) arg_9 = sum ( 1 + v / 3 for v in arg_1 ) return arg_8 , math . ceil ( arg_9 ) + 4

def Func(arg_0):
        """Get depth information for the circuit.

        Returns:
            int: number of columns in the circuit
            int: total size of columns in the circuit
        """

        arg_1 = []

        for arg_2 in arg_0.ops:

            # store the max width for the layer
            arg_3 = 0

            for arg_4 in arg_2:

                # update current op width
                arg_5 = 0

                # the wide gates
                for arg_6 in arg_4.op.params:
                    arg_7 = re.sub(r'[-+]?\d*\.\d{2,}|\d{2,}',
                                     _truncate_float, str(arg_6))
                    arg_5 += len(arg_7)

                # the width of the column is the max of all the gates in the column
                arg_3 = max(arg_5, arg_3)

            arg_1.append(arg_3)

        # wires in the beginning and end
        arg_8 = 2
        # each layer is one column
        arg_8 += len(arg_0.ops)

        # every 3 characters is roughly one extra 'unit' of width in the cell
        # the gate name is 1 extra 'unit'
        # the qubit/cbit labels plus initial states is 2 more
        # the wires poking out at the ends is 2 more
        arg_9 = sum(1 + v / 3 for v in arg_1)

        # could be a fraction so ceil
        return arg_8, math.ceil(arg_9) + 4


return self.request("parse", json={"JobHCL": hcl, "Canonicalize": canonicalize}, method="post", allow_redirects=True).json()

def Func ( arg_0 , arg_1 , arg_2 = False ) : return arg_0 . request ( "Func" , json = { "JobHCL" : arg_1 , "Canonicalize" : arg_2 } , method = "post" , allow_redirects = True ) . json ( )

def Func(arg_0, arg_1, arg_2=False):
        """ Parse a HCL Job file. Returns a dict with the JSON formatted job.
            This API endpoint is only supported from Nomad version 0.8.3.

            https://www.nomadproject.io/api/jobs.html#Func-job

            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        return arg_0.request("Func", json={"JobHCL": arg_1, "Canonicalize": arg_2}, method="post", allow_redirects=True).json()

Parse a HCL Job file. Returns a dict with the JSON formatted job.
            This API endpoint is only supported from Nomad version 0.8.3.

            https://www.nomadproject.io/api/jobs.html#parse-job

            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException

Parse a HCL Job file . Returns a dict with the JSON formatted job . This API endpoint is only supported from Nomad version 0 . 8 . 3 .


def Func(arg_0):
        """
        Performs a demonstration update by calling the demo optimization operation.
        Note that the batch data does not have to be fetched from the demo memory as this is now part of
        the TensorFlow operation of the demo update.
        """
        arg_1 = arg_0.demo_optimization_output

        arg_0.monitored_session.run(arg_1=arg_1)

Performs a demonstration update by calling the demo optimization operation . Note that the batch data does not have to be fetched from the demo memory as this is now part of the TensorFlow operation of the demo update .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = arg_0 . filename for arg_2 in list ( arg_0 . metadata_blocks ) : if isinstance ( arg_2 , VCFLACDict ) : arg_0 . metadata_blocks . remove ( arg_2 ) arg_0 . tags = None arg_0 . save ( ) break

def Func(arg_0, arg_1=None):
        """Remove Vorbis comments from a file.

        If no filename is given, the one most recently loaded is used.
        """
        if arg_1 is None:
            arg_1 = arg_0.filename
        for arg_2 in list(arg_0.metadata_blocks):
            if isinstance(arg_2, VCFLACDict):
                arg_0.metadata_blocks.remove(arg_2)
                arg_0.tags = None
                arg_0.save()
                break


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_1 : arg_4 = arg_3 . annotation if arg_4 is not Parameter . empty : yield arg_2 , arg_0 . _make_param_matcher ( arg_4 , arg_3 . kind )

def Func(arg_0, arg_1):
        '''
        For every parameter, create a matcher if the parameter has an
        annotation.
        '''
        for arg_2, arg_3 in arg_1:
            arg_4 = arg_3.annotation
            if arg_4 is not Parameter.empty:
                yield arg_2, arg_0._make_param_matcher(arg_4, arg_3.kind)

For every parameter create a matcher if the parameter has an annotation .


def Func(arg_0,arg_1,arg_2,arg_3=2):
        """
        Transforms the given texture coordinates using the internal texture coordinates.

        Currently, the dimensionality of the input texture coordinates must always be 2 and the output is 3-dimensional with the last coordinate always being zero.

        The given texture coordinates are fitted to the internal texture coordinates. Note that values higher than 1 or lower than 0 may result in unexpected visual glitches.

        The length of the given texture coordinates should be divisible by the dimensionality.
        """
        assert arg_3==2 # TODO

        arg_4 = []

        arg_5 = arg_0.tex_coords
        arg_6,arg_7 = arg_5[0],arg_5[1]
        arg_8,arg_9 = arg_5[6],arg_5[7]

        arg_10,arg_11 = arg_8-arg_6, arg_9-arg_7

        arg_12 = iter(arg_2)
        for arg_13,arg_14 in zip(arg_12,arg_12): # Based on http://stackoverflow.com/a/5389547/3490549
            arg_15 = arg_6+(arg_10*arg_13)
            arg_16 = arg_7+(arg_11*arg_14)
            arg_4.extend((arg_15,arg_16,0))

        return arg_4

Transforms the given texture coordinates using the internal texture coordinates . Currently the dimensionality of the input texture coordinates must always be 2 and the output is 3 - dimensional with the last coordinate always being zero . The given texture coordinates are fitted to the internal texture coordinates . Note that values higher than 1 or lower than 0 may result in unexpected visual glitches . The length of the given texture coordinates should be divisible by the dimensionality .


return [
        fmt.format(**info)
        for fmt in (
            '{field}_{widget}_{name}',
            '{field}_{name}',
            '{widget}_{name}',
            '{field}_{widget}',
            '{name}',
            '{widget}',
            '{field}',
        )
    ]

def Func ( arg_0 ) : arg_1 = { 'widget' : arg_0 . field . widget . __class__ . __name__ , 'field' : arg_0 . field . __class__ . __name__ , 'name' : arg_0 . name , } return [ arg_2 . format ( ** arg_1 ) for arg_2 in ( '{field}_{widget}_{name}' , '{field}_{name}' , '{widget}_{name}' , '{field}_{widget}' , '{name}' , '{widget}' , '{field}' , ) ]

def Func(arg_0):
    '''Return a list of widget names for the provided field.'''
    # Auto-detect
    arg_1 = {
        'widget': arg_0.field.widget.__class__.__name__,
        'field': arg_0.field.__class__.__name__,
        'name': arg_0.name,
    }

    return [
        arg_2.format(**arg_1)
        for arg_2 in (
            '{field}_{widget}_{name}',
            '{field}_{name}',
            '{widget}_{name}',
            '{field}_{widget}',
            '{name}',
            '{widget}',
            '{field}',
        )
    ]

Return a list of widget names for the provided field .


def Func ( arg_0 ) : if isinstance ( arg_0 , dict ) : arg_0 = dict ( arg_0 ) for arg_1 , arg_2 in arg_0 . iteritems ( ) : arg_0 [ arg_1 ] = Func ( arg_2 ) elif isinstance ( arg_0 , ( list , tuple ) ) : arg_0 = [ Func ( o ) for o in arg_0 ] elif isinstance ( arg_0 , datetime ) : arg_0 = arg_0 . strftime ( ISO8601 ) return arg_0

def Func(arg_0):
    """squash datetime objects into ISO8601 strings"""
    if isinstance(arg_0, dict):
        arg_0 = dict(arg_0) # don't clobber
        for arg_1,arg_2 in arg_0.iteritems():
            arg_0[arg_1] = Func(arg_2)
    elif isinstance(arg_0, (list, tuple)):
        arg_0 = [ Func(o) for o in arg_0 ]
    elif isinstance(arg_0, datetime):
        arg_0 = arg_0.strftime(ISO8601)
    return arg_0


(self, x, y, z, vx=None, vy=None, vz=None, vwhat=None, limits=None, grid=None, what="count(*)", shape=128, selection=[None, True], f=None,
               vcount_limits=None,
               smooth_pre=None, smooth_post=None, grid_limits=None, normalize="normalize", colormap="afmhot",
               figure_key=None, fig=None,
               lighting=True, level=[0.1, 0.5, 0.9], opacity=[0.01, 0.05, 0.1], level_width=0.1,
               show=True, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None, arg_6=None, arg_7=None, arg_8=None, arg_9=None, arg_10="count(*)", arg_11=128, arg_12=[None, True], arg_13=None,
               arg_14=None,
               arg_15=None, arg_16=None, arg_17=None, arg_18="normalize", arg_19="afmhot",
               arg_20=None, arg_21=None,
               arg_22=True, arg_23=[0.1, 0.5, 0.9], arg_24=[0.01, 0.05, 0.1], arg_25=0.1,
               arg_26=True, **arg_27):
        """Use at own risk, requires ipyvolume"""
        import vaex.ext.ipyvolume
        # vaex.ext.ipyvolume.
        arg_28 = vaex.ext.ipyvolume.PlotDefault
        Func = arg_28(df=arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, arg_6=arg_6,
                     arg_9=arg_9, arg_11=arg_11, arg_8=arg_8, arg_10=arg_10,
                     arg_13=arg_13, arg_20=arg_20, arg_21=arg_21,
                     arg_12=arg_12, arg_15=arg_15, arg_16=arg_16,
                     arg_17=arg_17, arg_14=arg_14, arg_18=arg_18, arg_19=arg_19, **arg_27)
        if arg_26:
            Func.show()
        return Func


def
Func
(
arg_0
,
arg_1
=
1e-6
,
arg_2
=
False
)
:
LOGGER
.
debug
(
"Formatting medium."
)
arg_3
=
pd
.
Series
(
)
for
arg_4
in
arg_0
:
arg_5
=
len
(
arg_4
.
reactants
)
==
1
arg_6
=
arg_4
.
flux
if
abs
(
arg_6
)
<
arg_1
:
continue
if
arg_5
:
arg_3
[
arg_4
.
id
]
=
arg_6
elif
not
arg_5
:
arg_3
[
arg_4
.
id
]
=
arg_6
if
not
arg_2
:
arg_3
=
arg_3
[
arg_3
>
0
]
return
arg_3

def Func(arg_0, arg_1=1e-6, arg_2=False):
    """Convert a solution to medium.

    Arguments
    ---------
    exchanges : list of cobra.reaction
        The exchange reactions to consider.
    tolerance : positive double
        The absolute tolerance for fluxes. Fluxes with an absolute value
        smaller than this number will be ignored.
    exports : bool
        Whether to return export fluxes as well.

    Returns
    -------
    pandas.Series
        The "medium", meaning all active import fluxes in the solution.
    """
    LOGGER.debug("Formatting medium.")
    arg_3 = pd.Series()
    for arg_4 in arg_0:
        arg_5 = len(arg_4.reactants) == 1
        arg_6 = arg_4.flux
        if abs(arg_6) < arg_1:
            continue
        if arg_5:
            arg_3[arg_4.id] = -arg_6
        elif not arg_5:
            arg_3[arg_4.id] = arg_6
    if not arg_2:
        arg_3 = arg_3[arg_3 > 0]

    return arg_3


def
Func
(
arg_0
)
:
arg_0
.
meta
.
resolved_path
=
arg_0
.
find_data
(
arg_0
.
meta
.
path
)
if
not
arg_0
.
meta
.
resolved_path
:
raise
ImproperlyConfigured
(
"Data file '{}' not found"
.
format
(
arg_0
.
meta
.
path
)
)
print
(
"Loading:"
,
arg_0
.
meta
.
path
)
with
open
(
arg_0
.
meta
.
resolved_path
,
'r'
)
as
fd
:
return
fd
.
read
(
)

def Func(arg_0):
        """Load a file in text mode"""
        arg_0.meta.resolved_path = arg_0.find_data(arg_0.meta.path)

        if not arg_0.meta.resolved_path:
            raise ImproperlyConfigured("Data file '{}' not found".format(arg_0.meta.path))

        print("Loading:", arg_0.meta.path)

        with open(arg_0.meta.resolved_path, 'r') as fd:
            return fd.read()


def
Func
(
arg_0
,
arg_1
)
:
if
not
issubclass
(
arg_1
,
BaseProvider
)
:
raise
TypeError
(
'%s is not a subclass of BaseProvider'
%
arg_1
.
__name__
)
if
arg_1
in
arg_0
.
_Funced_providers
:
raise
AlreadyRegistered
(
'%s is already Funced'
%
arg_1
.
__name__
)
if
issubclass
(
arg_1
,
DjangoProvider
)
:
signals
.
post_save
.
connect
(
arg_0
.
invalidate_stored_oembeds
,
sender
=
arg_1
.
_meta
.
model
)
arg_0
.
_Funced_providers
.
append
(
arg_1
)
arg_0
.
invalidate_providers
(
)

def Func(arg_0, arg_1):
        """
        Registers a provider with the site.
        """
        if not issubclass(arg_1, BaseProvider):
            raise TypeError('%s is not a subclass of BaseProvider' % arg_1.__name__)

        if arg_1 in arg_0._Funced_providers:
            raise AlreadyRegistered('%s is already Funced' % arg_1.__name__)

        if issubclass(arg_1, DjangoProvider):
            # set up signal handler for cache invalidation
            signals.post_save.connect(
                arg_0.invalidate_stored_oembeds,
                sender=arg_1._meta.model
            )

        # don't build the regex yet - if not all urlconfs have been loaded
        # and processed at this point, the DjangoProvider instances will fail
        # when attempting to reverse urlpatterns that haven't been created.
        # Rather, the regex-list will be populated once, on-demand.
        arg_0._Funced_providers.append(arg_1)

        # flag for re-population
        arg_0.invalidate_providers()


return Manhattan().dist(src, tar, qval, alphabet)

def Func ( arg_0 , arg_1 , arg_2 = 2 , arg_3 = None ) : return Manhattan ( ) . dist ( arg_0 , arg_1 , arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2=2, arg_3=None):
    """Return the normalized Manhattan distance between two strings.

    This is a wrapper for :py:meth:`Manhattan.dist`.

    Parameters
    ----------
    src : str
        Source string (or QGrams/Counter objects) for comparison
    tar : str
        Target string (or QGrams/Counter objects) for comparison
    qval : int
        The length of each q-gram; 0 for non-q-gram version
    alphabet : collection or int
        The values or size of the alphabet

    Returns
    -------
    float
        The normalized Manhattan distance

    Examples
    --------
    >>> Func('cat', 'hat')
    0.5
    >>> round(Func('Niall', 'Neil'), 12)
    0.636363636364
    >>> round(Func('Colin', 'Cuilen'), 12)
    0.692307692308
    >>> Func('ATCG', 'TAGC')
    1.0

    """
    return Manhattan().dist(arg_0, arg_1, arg_2, arg_3)

Return the normalized Manhattan distance between two strings.

    This is a wrapper for :py:meth:`Manhattan.dist`.

    Parameters
    ----------
    src : str
        Source string (or QGrams/Counter objects) for comparison
    tar : str
        Target string (or QGrams/Counter objects) for comparison
    qval : int
        The length of each q-gram; 0 for non-q-gram version
    alphabet : collection or int
        The values or size of the alphabet

    Returns
    -------
    float
        The normalized Manhattan distance

    Examples
    --------
    >>> dist_manhattan('cat', 'hat')
    0.5
    >>> round(dist_manhattan('Niall', 'Neil'), 12)
    0.636363636364
    >>> round(dist_manhattan('Colin', 'Cuilen'), 12)
    0.692307692308
    >>> dist_manhattan('ATCG', 'TAGC')
    1.0

Return the normalized Manhattan distance between two strings .


(self, year=None, month=None, day=None, hour=None,
                minute=None, second=None, microsecond=None, tzinfo=True)

return datetime.__new__(type(self),
                                year, month, day, hour, minute, second,
                                microsecond, tzinfo)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = True ) : if arg_1 is None : arg_1 = arg_0 . year if arg_2 is None : arg_2 = arg_0 . month if arg_3 is None : arg_3 = arg_0 . day if arg_4 is None : arg_4 = arg_0 . hour if arg_5 is None : arg_5 = arg_0 . minute if arg_6 is None : arg_6 = arg_0 . second if arg_7 is None : arg_7 = arg_0 . microsecond if arg_8 is True : arg_8 = arg_0 . tzinfo return datetime . __new__ ( type ( arg_0 ) , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None,
                arg_5=None, arg_6=None, arg_7=None, arg_8=True):
        """Return a new datetime with new values for the specified fields."""
        if arg_1 is None:
            arg_1 = arg_0.year
        if arg_2 is None:
            arg_2 = arg_0.month
        if arg_3 is None:
            arg_3 = arg_0.day
        if arg_4 is None:
            arg_4 = arg_0.hour
        if arg_5 is None:
            arg_5 = arg_0.minute
        if arg_6 is None:
            arg_6 = arg_0.second
        if arg_7 is None:
            arg_7 = arg_0.microsecond
        if arg_8 is True:
            arg_8 = arg_0.tzinfo
        return datetime.__new__(type(arg_0),
                                arg_1, arg_2, arg_3, arg_4, arg_5, arg_6,
                                arg_7, arg_8)

Return a new datetime with new values for the specified fields .


return the average of part of the current sweep.

def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
,
arg_3
=
False
)
:
if
arg_3
:
arg_0
.
setsweep
(
arg_3
)
if
arg_2
is
or
arg_2
>
arg_0
.
sweepLength
:
arg_2
=
arg_0
.
sweepLength
arg_0
.
log
.
debug
(
"resetting t2 to [%f]"
,
arg_2
)
arg_1
=
max
(
arg_1
,
0
)
if
arg_1
>
arg_2
:
arg_0
.
log
.
error
(
"t1 cannot be larger than t2"
)
return
False
arg_4
,
arg_5
=
int
(
arg_1
*
arg_0
.
pointsPerSec
)
,
int
(
arg_2
*
arg_0
.
pointsPerSec
)
if
arg_4
==
arg_5
:
return
np
.
return
np
.
Func
(
arg_0
.
sweepY
[
arg_4
:
arg_5
]
)

def Func(arg_0,arg_1=0,arg_2=None,arg_3=False):
        """return the Func of part of the current sweep."""
        if arg_3:
            arg_0.setsweep(arg_3)
        if arg_2 is None or arg_2>arg_0.sweepLength:
            arg_2=arg_0.sweepLength
            arg_0.log.debug("resetting t2 to [%f]",arg_2)
        arg_1=max(arg_1,0)
        if arg_1>arg_2:
            arg_0.log.error("t1 cannot be larger than t2")
            return False
        arg_4,arg_5=int(arg_1*arg_0.pointsPerSec),int(arg_2*arg_0.pointsPerSec)
        if arg_4==arg_5:
            return np.nan
        return np.Func(arg_0.sweepY[arg_4:arg_5])

return the average of part of the current sweep .


(self, record_predicate,
                        code=RECORD_PREDICATE_FALSE,
                        message=MESSAGES[RECORD_PREDICATE_FALSE],
                        modulus=1)

def Func(arg_0, arg_1,
                        arg_2=arg_3,
                        arg_4=arg_5[arg_3],
                        arg_6=1):
        """
        Add a record predicate function.

        N.B., everything you can do with record predicates can also be done with
        record check functions, whether you use one or the other is a matter of
        style.

        Arguments
        ---------

        `record_predicate` - a function that accepts a single argument (a record
        as a dictionary of values indexed by field name) and returns False if
        the value is not valid

        `code` - problem code to report if a record is not valid, defaults to
        `RECORD_PREDICATE_FALSE`

        `message` - problem message to report if a record is not valid

        `modulus` - apply the check to every nth record, defaults to 1 (check
        every record)

        """

        assert callable(arg_1), 'record predicate must be a callable function'

        arg_7 = arg_1, arg_2, arg_4, arg_6
        arg_0._record_predicates.append(arg_7)


def Func(arg_0, arg_1=0, arg_2=None):
    """
    Removes any stored records within the range from start to
    end. Noninclusive of end.

    parameters
    ------------
    start - integer representing the ROWID of the start of the deletion range,
    end - integer representing the ROWID of the end of the deletion range,
      if None, it will default to end.
    """
    arg_3 = numpy.array(
      arg_0._knnclassifier.getParameter('categoryRecencyList'))

    if arg_2 is None:
      arg_2 = arg_3.max() + 1

    arg_4 = numpy.logical_and(arg_3 >= arg_1,
                                       arg_3 < arg_2)
    arg_5 = arg_3[arg_4]

    arg_6 = arg_0._knnclassifier._knn._numPatterns
    arg_0._knnclassifier._knn.removeIds(arg_5.tolist())
    assert arg_0._knnclassifier._knn._numPatterns == arg_6 - len(arg_5)

Removes any stored records within the range from start to end . Noninclusive of end .


(self, from_date=None, to_date=None, branches=None, encoding='utf-8')

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4='utf-8'):
        """Read the commit Func from the repository.

        The method returns the Git Func of the repository using the
        following options:

            git Func --raw --numstat --pretty=fuller --decorate=full
                --all --reverse --topo-order --parents -M -C -c
                --remotes=origin

        When `from_date` is given, it gets the commits equal or older
        than that date. This date is given in a datetime object.

        The list of branches is a list of strings, with the names of the
        branches to fetch. If the list of branches is empty, no commit
        is fetched. If the list of branches is None, all commits
        for all branches will be fetched.

        :param from_date: fetch commits newer than a specific
            date (inclusive)
        :param branches: names of branches to fetch from (default: None)
        :param encoding: encode the Func using this format

        :returns: a generator where each item is a line from the Func

        :raises EmptyRepositoryError: when the repository is empty and
            the action cannot be performed
        :raises RepositoryError: when an error occurs fetching the Func
        """
        if arg_0.is_empty():
            Funcger.warning("Git %s repository is empty; unable to get the Func",
                           arg_0.uri)
            raise EmptyRepositoryError(repository=arg_0.uri)

        arg_5 = ['git', 'Func', '--reverse', '--topo-order']
        arg_5.extend(arg_0.GIT_PRETTY_OUTPUT_OPTS)

        if arg_1:
            arg_6 = arg_1.strftime("%Y-%m-%d %H:%M:%S %z")
            arg_5.append('--since=' + arg_6)

        if arg_2:
            arg_6 = arg_2.strftime("%Y-%m-%d %H:%M:%S %z")
            arg_5.append('--until=' + arg_6)

        if arg_3 is None:
            arg_5.extend(['--branches', '--tags', '--remotes=origin'])
        elif len(arg_3) == 0:
            arg_5.append('--max-count=0')
        else:
            arg_3 = ['refs/heads/' + branch for branch in arg_3]
            arg_5.extend(arg_3)

        for arg_7 in arg_0._exec_nb(arg_5, cwd=arg_0.dirpath, env=arg_0.gitenv):
            yield arg_7

        Funcger.debug("Git Func fetched from %s repository (%s)",
                     arg_0.uri, arg_0.dirpath)

Read the commit log from the repository.

        The method returns the Git log of the repository using the
        following options:

            git log --raw --numstat --pretty=fuller --decorate=full
                --all --reverse --topo-order --parents -M -C -c
                --remotes=origin

        When `from_date` is given, it gets the commits equal or older
        than that date. This date is given in a datetime object.

        The list of branches is a list of strings, with the names of the
        branches to fetch. If the list of branches is empty, no commit
        is fetched. If the list of branches is None, all commits
        for all branches will be fetched.

        :param from_date: fetch commits newer than a specific
            date (inclusive)
        :param branches: names of branches to fetch from (default: None)
        :param encoding: encode the log using this format

        :returns: a generator where each item is a line from the log

        :raises EmptyRepositoryError: when the repository is empty and
            the action cannot be performed
        :raises RepositoryError: when an error occurs fetching the log

Read the commit log from the repository .


def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def wrapper ( * arg_1 , ** arg_2 ) : arg_3 = arg_0 ( * arg_1 , ** arg_2 ) if isinstance ( arg_3 , tuple ) : arg_4 , arg_5 = arg_3 else : arg_4 , arg_5 = 200 , arg_3 return Response ( json . dumps ( arg_5 ) , status = arg_4 , mimetype = 'application/json' ) return wrapper

def Func(arg_0):
    """JSON decorator."""

    @functools.wraps(arg_0)
    def wrapper(*arg_1, **arg_2):
        arg_3 = arg_0(*arg_1, **arg_2)
        if isinstance(arg_3, tuple):
            arg_4, arg_5 = arg_3
        else:
            arg_4, arg_5 = 200, arg_3
        return Response(json.dumps(arg_5), status=arg_4, mimetype='application/json')

    return wrapper


def Func(arg_0, arg_1):
    """
    Delete the stored checkpoint for the specified modelID. This function is
    called if the current model is now the best model, making the old model's
    checkpoint obsolete

    Parameters:
    -----------------------------------------------------------------------
    modelID:      The modelID for the checkpoint to delete. This is NOT the
                  unique checkpointID
    """

    arg_2 = \
        arg_0._jobsDAO.modelsGetFields(arg_1, ['modelCheckpointId'])[0]

    if arg_2 is None:
      return

    try:
      shutil.rmtree(os.path.join(arg_0._experimentDir, str(arg_0._modelCheckpointGUID)))
    except:
      arg_0._logger.warn("Failed to delete model checkpoint %s. "\
                        "Assuming that another worker has already deleted it",
                        arg_2)
      return

    arg_0._jobsDAO.modelSetFields(arg_1,
                                 {'modelCheckpointId':None},
                                 ignoreUnchanged=True)
    return

Delete the stored checkpoint for the specified modelID . This function is called if the current model is now the best model making the old model s checkpoint obsolete


def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
0
)
:
arg_2
=
int
(
arg_2
)
arg_0
.
init
(
)
arg_3
,
arg_4
=
arg_0
.
get_component_funcs
(
arg_1
=
arg_1
)
print
(
'\n%i changes found for host %s.\n'
%
(
len
(
arg_3
)
,
arg_0
.
genv
.
host_string
)
)
if
arg_3
and
arg_4
:
if
arg_0
.
verbose
:
print
(
'These components have changed:\n'
)
for
arg_5
in
sorted
(
arg_3
)
:
print
(
(
' '
*
4
)
+
arg_5
)
print
(
'Deployment plan for host %s:\n'
%
arg_0
.
genv
.
host_string
)
for
arg_6
,
arg_7
in
arg_4
:
print
(
success_str
(
(
' '
*
4
)
+
arg_6
)
)
if
arg_3
:
print
(
)
if
arg_2
and
arg_0
.
genv
.
host_string
==
arg_0
.
genv
.
hosts
[
1
]
:
if
arg_3
:
if
not
raw_input
(
'Begin deployment? [yn] '
)
.
strip
(
)
.
lower
(
)
.
startswith
(
'y'
)
:
sys
.
exit
(
0
)
else
:
sys
.
exit
(
0
)

def Func(arg_0, arg_1=None, arg_2=0):
        """
        Inspects differences between the last deployment and the current code state.
        """

        arg_2 = int(arg_2)

        arg_0.init()

        arg_3, arg_4 = arg_0.get_component_funcs(arg_1=arg_1)

        print('\n%i changes found for host %s.\n' % (len(arg_3), arg_0.genv.host_string))
        if arg_3 and arg_4:
            if arg_0.verbose:
                print('These components have changed:\n')
                for arg_5 in sorted(arg_3):
                    print((' '*4)+arg_5)
            print('Deployment plan for host %s:\n' % arg_0.genv.host_string)
            for arg_6, arg_7 in arg_4:
                print(success_str((' '*4)+arg_6))
        if arg_3:
            print()

        if arg_2 and arg_0.genv.host_string == arg_0.genv.hosts[-1]:
            if arg_3:
                if not raw_input('Begin deployment? [yn] ').strip().lower().startswith('y'):
                    sys.exit(0)
            else:
                sys.exit(0)

Inspects differences between the last deployment and the current code state .