(self, analytes=None, samples=None, ranges=False,
                    focus=None, outdir=None, filt=None, scale='log',
                    figsize=[10, 4], stats=False, stat='nanmean',
                    err='nanstd', subset='All_Analyses')

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
False
,
arg_4
=
,
arg_5
=
,
arg_6
=
,
arg_7
=
'log'
,
arg_8
=
[
10
,
4
]
,
arg_9
=
False
,
arg_10
=
'nanmean'
,
arg_11
=
'nanstd'
,
arg_12
=
'All_Analyses'
)
:
if
arg_4
is
:
arg_4
=
arg_0
.
focus_stage
if
arg_5
is
:
arg_5
=
arg_0
.
report_dir
+
'/'
+
arg_4
if
not
os
.
path
.
isdir
(
arg_5
)
:
os
.
mkdir
(
arg_5
)
if
arg_12
is
not
:
arg_2
=
arg_0
.
_get_samples
(
arg_12
)
elif
arg_2
is
:
arg_2
=
arg_0
.
subsets
[
'All_Analyses'
]
elif
isinstance
(
arg_2
,
str
)
:
arg_2
=
[
arg_2
]
with
arg_0
.
pbar
.
set
(
total
=
len
(
arg_2
)
,
desc
=
'Drawing Plots'
)
as
prog
:
for
arg_13
in
arg_2
:
arg_14
,
arg_15
=
arg_0
.
data
[
arg_13
]
.
tplot
(
arg_1
=
arg_1
,
arg_8
=
arg_8
,
arg_7
=
arg_7
,
arg_6
=
arg_6
,
arg_3
=
arg_3
,
arg_9
=
arg_9
,
arg_10
=
arg_10
,
arg_11
=
arg_11
,
focus_stage
=
arg_4
)
arg_14
.
savefig
(
arg_5
+
'/'
+
arg_13
+
'_traces.pdf'
)
plt
.
close
(
arg_14
)
prog
.
update
(
)
return

def Func(arg_0, arg_1=None, arg_2=None, arg_3=False,
                    arg_4=None, arg_5=None, arg_6=None, arg_7='log',
                    arg_8=[10, 4], arg_9=False, arg_10='nanmean',
                    arg_11='nanstd', arg_12='All_Analyses'):
        """
        Plot analytes as a function of time.

        Parameters
        ----------
        analytes : optional, array_like or str
            The analyte(s) to plot. Defaults to all analytes.
        samples: optional, array_like or str
            The sample(s) to plot. Defaults to all samples.
        ranges : bool
            Whether or not to show the signal/backgroudn regions
            identified by 'autorange'.
        focus : str
            The focus 'stage' of the analysis to plot. Can be
            'rawdata', 'despiked':, 'signal', 'background',
            'bkgsub', 'ratios' or 'calibrated'.
        outdir : str
            Path to a directory where you'd like the plots to be
            saved. Defaults to 'reports/[focus]' in your data directory.
        filt : str, dict or bool
            Either logical filter expression contained in a str,
            a dict of expressions specifying the filter string to
            use for each analyte or a boolean. Passed to `grab_filt`.
        scale : str
            If 'log', plots the data on a log scale.
        figsize : array_like
            Array of length 2 specifying figure [width, height] in
            inches.
        stats : bool
            Whether or not to overlay the mean and standard deviations
            for each trace.
        stat, err: str
            The names of the statistic and error components to plot.
            Deafaults to 'nanmean' and 'nanstd'.

        Returns
        -------
        None
        """
        if arg_4 is None:
            arg_4 = arg_0.focus_stage
        if arg_5 is None:
            arg_5 = arg_0.report_dir + '/' + arg_4
        if not os.path.isdir(arg_5):
            os.mkdir(arg_5)

        # if samples is not None:
        #     subset = self.make_subset(samples)

        if arg_12 is not None:
            arg_2 = arg_0._get_samples(arg_12)
        elif arg_2 is None:
            arg_2 = arg_0.subsets['All_Analyses']
        elif isinstance(arg_2, str):
            arg_2 = [arg_2]

        with arg_0.pbar.set(total=len(arg_2), desc='Drawing Plots') as prog:
            for arg_13 in arg_2:
                arg_14, arg_15 = arg_0.data[arg_13].tplot(arg_1=arg_1, arg_8=arg_8,
                                        arg_7=arg_7, arg_6=arg_6,
                                        arg_3=arg_3, arg_9=arg_9,
                                        arg_10=arg_10, arg_11=arg_11, focus_stage=arg_4)
                # ax = fig.axes[0]
                # for l, u in s.sigrng:
                #     ax.axvspan(l, u, color='r', alpha=0.1)
                # for l, u in s.bkgrng:
                #     ax.axvspan(l, u, color='k', alpha=0.1)
                arg_14.savefig(arg_5 + '/' + arg_13 + '_traces.pdf')
                # TODO: on older(?) computers raises
                # 'OSError: [Errno 24] Too many open files'
                plt.close(arg_14)
                prog.update()
        return


Returns an array of updates that have been sent from the buffer for an
      individual social media profile.

def Func ( arg_0 ) : arg_1 = [ ] arg_2 = PATHS [ 'GET_SENT' ] % arg_0 . profile_id arg_3 = arg_0 . api . get ( arg_2 = arg_2 ) for arg_4 in arg_3 [ 'updates' ] : arg_1 . append ( Update ( api = arg_0 . api , raw_response = arg_4 ) ) arg_0 . __Func = arg_1 return arg_0 . __Func

def Func(arg_0):
    '''
      Returns an array of updates that have been Func from the buffer for an
      individual social media profile.
    '''

    arg_1 = []
    arg_2 = PATHS['GET_SENT'] % arg_0.profile_id

    arg_3 = arg_0.api.get(arg_2=arg_2)
    for arg_4 in arg_3['updates']:
      arg_1.append(Update(api=arg_0.api, raw_response=arg_4))

    arg_0.__Func = arg_1

    return arg_0.__Func

Returns an array of updates that have been sent from the buffer for an individual social media profile .


def Func ( arg_0 ) : if arg_0 . _Func is None : arg_1 = arg_0 . affine . origin arg_2 = arg_1 [ 0 ] + arg_0 . ds . RasterXSize * arg_0 . affine . scale [ 0 ] arg_3 = arg_1 [ 1 ] + arg_0 . ds . RasterYSize * arg_0 . affine . scale [ 1 ] arg_0 . _Func = Envelope ( arg_1 [ 0 ] , arg_3 , arg_2 , arg_1 [ 1 ] ) return arg_0 . _Func

def Func(arg_0):
        """Returns the minimum bounding rectangle as a tuple of min X, min Y,
        max X, max Y.
        """
        if arg_0._Func is None:
            arg_1 = arg_0.affine.origin
            arg_2 = arg_1[0] + arg_0.ds.RasterXSize * arg_0.affine.scale[0]
            arg_3 = arg_1[1] + arg_0.ds.RasterYSize * arg_0.affine.scale[1]
            arg_0._Func = Envelope(arg_1[0], arg_3, arg_2, arg_1[1])
        return arg_0._Func

Returns the minimum bounding rectangle as a tuple of min X min Y max X max Y .


return dict((s, getattr(a_named_tuple, s)) for s in a_named_tuple._fields)

def Func ( arg_0 ) : return dict ( ( arg_1 , getattr ( arg_0 , arg_1 ) ) for arg_1 in arg_0 . _fields )

def Func(arg_0):
    """Transform a named tuple into a dictionary"""
    return dict((arg_1, getattr(arg_0, arg_1)) for arg_1 in arg_0._fields)


return returns.rolling(rolling_vol_window).std() \
        * np.sqrt(APPROX_BDAYS_PER_YEAR)

def Func ( arg_0 , arg_1 ) : return arg_0 . rolling ( arg_1 ) . std ( ) * np . sqrt ( APPROX_BDAYS_PER_YEAR )

def Func(arg_0, arg_1):
    """
    Determines the rolling volatility of a strategy.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    rolling_vol_window : int
        Length of rolling window, in days, over which to compute.

    Returns
    -------
    pd.Series
        Rolling volatility.
    """

    return arg_0.rolling(arg_1).std() \
        * np.sqrt(APPROX_BDAYS_PER_YEAR)

Determines the rolling volatility of a strategy .


(rec, tag, subfield_code, value,
                             subfield_position=None,
                             field_position_global=None,
                             field_position_local=None)

def Func(arg_0, arg_1, arg_2, arg_3,
                             arg_4=None,
                             arg_5=None,
                             arg_6=None):
    """Add subfield into specified position.

    Specify the subfield by tag, field number and optionally by subfield
    position.
    """
    arg_7 = record_get_subfields(
        arg_0, arg_1,
        arg_5=arg_5,
        arg_6=arg_6)

    if arg_4 is None:
        arg_7.append((arg_2, arg_3))
    else:
        arg_7.insert(arg_4, (arg_2, arg_3))


def Func ( arg_0 ) : arg_1 . token = verify_credentials ( ) arg_3 = arg_0 . split ( '/' ) if arg_3 [ - 1 ] == '' : arg_3 . pop ( ) if arg_0 . startswith ( '/users/' ) : arg_3 . pop ( 0 ) arg_3 . pop ( 0 ) arg_4 = arg_3 . pop ( 0 ) arg_5 , arg_6 = arg_4 . split ( '_' ) arg_7 = arg_3 . pop ( ) arg_8 = arg_1 . communicator . get_user_by_name ( arg_5 , arg_6 ) arg_9 = _descend_folder_for_id ( arg_3 , arg_8 [ 'folder_id' ] ) return _search_folder_for_item_or_folder ( arg_7 , arg_9 ) elif arg_0 . startswith ( '/communities/' ) : print ( arg_3 ) arg_3 . pop ( 0 ) arg_3 . pop ( 0 ) arg_10 = arg_3 . pop ( 0 ) arg_7 = arg_3 . pop ( ) arg_11 = arg_1 . communicator . get_community_by_name ( arg_10 ) arg_9 = _descend_folder_for_id ( arg_3 , arg_11 [ 'folder_id' ] ) return _search_folder_for_item_or_folder ( arg_7 , arg_9 ) else : return False , - 1

def Func(arg_0):
    """
    Get a folder id from a path on the server.

    Warning: This is NOT efficient at all.

    The schema for this path is:
    path := "/users/<name>/" | "/communities/<name>" , {<subfolder>/}
    name := <firstname> , "_" , <lastname>

    :param path: The virtual path on the server.
    :type path: string
    :returns: a tuple indicating True or False about whether the resource is an
        item and id of the resource i.e. (True, item_id) or (False, folder_id)
    :rtype: (bool, int | long)
    """
    arg_1.token = verify_credentials()

    arg_3 = arg_0.split('/')
    if arg_3[-1] == '':
        arg_3.pop()
    if arg_0.startswith('/users/'):
        arg_3.pop(0)  # remove '' before /
        arg_3.pop(0)  # remove 'users'
        arg_4 = arg_3.pop(0)  # remove '<firstname>_<lastname>'
        arg_5, arg_6 = arg_4.split('_')
        arg_7 = arg_3.pop()
        arg_8 = arg_1.communicator.get_user_by_name(arg_5, arg_6)
        arg_9 = _descend_folder_for_id(arg_3, arg_8['folder_id'])
        return _search_folder_for_item_or_folder(arg_7, arg_9)
    elif arg_0.startswith('/communities/'):
        print(arg_3)
        arg_3.pop(0)  # remove '' before /
        arg_3.pop(0)  # remove 'communities'
        arg_10 = arg_3.pop(0)  # remove '<community>'
        arg_7 = arg_3.pop()
        arg_11 = arg_1.communicator.get_community_by_name(arg_10)
        arg_9 = _descend_folder_for_id(arg_3,
                                                arg_11['folder_id'])
        return _search_folder_for_item_or_folder(arg_7, arg_9)
    else:
        return False, -1

Get a folder id from a path on the server .


return scaled_array.ScaledSquarePixelArray(array=self.array_2d_from_array_1d(array_1d),
                                                   pixel_scale=self.mask.pixel_scale,
                                                   origin=self.mask.origin)

def Func ( arg_0 , arg_1 ) : return scaled_array . ScaledSquarePixelArray ( array = arg_0 . array_2d_from_array_1d ( arg_1 ) , pixel_scale = arg_0 . mask . pixel_scale , origin = arg_0 . mask . origin )

def Func(arg_0, arg_1):
        """ Map a 1D array the same dimension as the grid to its original masked 2D array and return it as a scaled \
        array.

        Parameters
        -----------
        array_1d : ndarray
            The 1D array of which is mapped to a 2D scaled array.
        """
        return scaled_array.ScaledSquarePixelArray(array=arg_0.array_2d_from_array_1d(arg_1),
                                                   pixel_scale=arg_0.mask.pixel_scale,
                                                   origin=arg_0.mask.origin)

Map a 1D array the same dimension as the grid to its original masked 2D array and return it as a scaled \ array .


return [entry.key for entry in response.aggregations.domains.buckets]

def Func ( arg_0 ) : arg_1 = User . search ( ) arg_1 . aggs . bucket ( 'domains' , 'terms' , field = 'domain' , order = { '_count' : 'desc' } , size = 100 ) arg_2 = arg_1 . execute ( ) return [ arg_3 . key for arg_3 in arg_2 . aggregations . domains . buckets ]

def Func(arg_0):
        """
            Retrieves the domains of the users from elastic.
        """
        arg_1 = User.search()
        arg_1.aggs.bucket('domains', 'terms', field='domain', order={'_count': 'desc'}, size=100)
        arg_2 = arg_1.execute()
        return [arg_3.key for arg_3 in arg_2.aggregations.domains.buckets]

Retrieves the domains of the users from elastic .


return (
            session
            .query(TR)
            .filter(TR.dag_id == task_instance.dag_id,
                    TR.task_id == task_instance.task_id,
                    TR.execution_date == task_instance.execution_date,
                    TR.try_number == task_instance.try_number)
            .order_by(asc(TR.id))
            .all()
        )

def Func ( arg_0 , arg_1 ) : arg_2 = TaskReschedule return ( arg_1 . query ( arg_2 ) . filter ( arg_2 . dag_id == arg_0 . dag_id , arg_2 . task_id == arg_0 . task_id , arg_2 . execution_date == arg_0 . execution_date , arg_2 . try_number == arg_0 . try_number ) . order_by ( asc ( arg_2 . id ) ) . all ( ) )

def Func(arg_0, arg_1):
        """
        Returns all task reschedules for the task instance and try number,
        in ascending order.

        :param task_instance: the task instance to find task reschedules for
        :type task_instance: airflow.models.TaskInstance
        """
        arg_2 = TaskReschedule
        return (
            arg_1
            .query(arg_2)
            .filter(arg_2.dag_id == arg_0.dag_id,
                    arg_2.task_id == arg_0.task_id,
                    arg_2.execution_date == arg_0.execution_date,
                    arg_2.try_number == arg_0.try_number)
            .order_by(asc(arg_2.id))
            .all()
        )

Returns all task reschedules for the task instance and try number in ascending order .


def Func ( arg_0 , arg_1 ) : arg_0 . append_records ( [ dict ( time = arg_2 , duration = arg_3 , value = arg_4 , confidence = arg_5 ) for ( arg_2 , arg_3 , arg_4 , arg_5 ) in six . moves . zip ( arg_1 [ 'time' ] , arg_1 [ 'duration' ] , arg_1 [ 'value' ] , arg_1 [ 'confidence' ] ) ] )

def Func(arg_0, arg_1):
        '''Add observations from column-major storage.

        This is primarily used for deserializing densely packed data.

        Parameters
        ----------
        columns : dict of lists
            Keys must be `time, duration, value, confidence`,
            and each much be a list of equal length.

        '''
        arg_0.append_records([dict(time=arg_2, duration=arg_3, value=arg_4, confidence=arg_5)
                             for (arg_2, arg_3, arg_4, arg_5)
                             in six.moves.zip(arg_1['time'],
                                              arg_1['duration'],
                                              arg_1['value'],
                                              arg_1['confidence'])])

Add observations from column - major storage .


def Func(arg_0, arg_1=None):
        """
        Depth-first search.

        .. seealso::
           `Wikipedia DFS descritpion <http://en.wikipedia.org/wiki/Depth-first_search>`_

        :param root: first to start the search
        :return: list of nodes
        """

        if not arg_1:
            arg_1 = arg_0._root

        return arg_0._Func(arg_1)


(lcbasedir,
                          objectidlist,
                          aperture='TF1',
                          postfix='.gz',
                          sortby='rjd',
                          normalize=True,
                          outdir=None,
                          recursive=True,
                          nworkers=32,
                          maxworkertasks=1000)

return {x:y for (x,y) in zip(objectidlist, results)}

def Func ( arg_0 , arg_1 , arg_2 = 'TF1' , arg_3 = '.gz' , arg_4 = 'rjd' , arg_5 = True , arg_6 = None , arg_7 = True , arg_8 = 32 , arg_9 = 1000 ) : if not arg_6 : arg_6 = 'pklcs' if not os . path . exists ( arg_6 ) : os . mkdir ( arg_6 ) arg_10 = [ ( arg_0 , arg_13 , { 'aperture' : arg_2 , 'postfix' : arg_3 , 'sortby' : arg_4 , 'normalize' : arg_5 , 'outdir' : arg_6 , 'recursive' : arg_7 } ) for arg_13 in arg_1 ] arg_11 = mp . Pool ( arg_8 , maxtasksperchild = arg_9 ) arg_12 = arg_11 . map ( parallel_concat_worker , arg_10 ) arg_11 . close ( ) arg_11 . join ( ) return { arg_13 : arg_14 for ( arg_13 , arg_14 ) in zip ( arg_1 , arg_12 ) }

def Func(arg_0,
                          arg_1,
                          arg_2='TF1',
                          arg_3='.gz',
                          arg_4='rjd',
                          arg_5=True,
                          arg_6=None,
                          arg_7=True,
                          arg_8=32,
                          arg_9=1000):
    '''This concatenates all text LCs for the given objectidlist.

    '''

    if not arg_6:
        arg_6 = 'pklcs'

    if not os.path.exists(arg_6):
        os.mkdir(arg_6)

    arg_10 = [(arg_0, arg_13, {'aperture':arg_2,
                             'postfix':arg_3,
                             'sortby':arg_4,
                             'normalize':arg_5,
                             'outdir':arg_6,
                             'recursive':arg_7}) for arg_13 in arg_1]

    arg_11 = mp.Pool(arg_8, maxtasksperchild=arg_9)
    arg_12 = arg_11.map(parallel_concat_worker, arg_10)

    arg_11.close()
    arg_11.join()

    return {arg_13:arg_14 for (arg_13,arg_14) in zip(arg_1, arg_12)}

This concatenates all text LCs for the given objectidlist .


def Func ( arg_0 , arg_1 ) : assert_is_type ( arg_1 , str , int , [ str , int ] ) return GroupBy ( arg_0 , arg_1 )

def Func(arg_0, arg_1):
        """
        Return a new ``GroupBy`` object using this frame and the desired grouping columns.

        The returned groups are sorted by the natural group-by column sort.

        :param by: The columns to group on (either a single column name, or a list of column names, or
            a list of column indices).
        """
        assert_is_type(arg_1, str, int, [str, int])
        return GroupBy(arg_0, arg_1)

Return a new GroupBy object using this frame and the desired grouping columns .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = "\n" . join ( arg_5 ) arg_7 = m2r ( arg_6 ) arg_7 . replace ( "\r\n" , "\n" ) del arg_5 [ : ] arg_5 . extend ( arg_7 . split ( "\n" ) )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """Enable markdown syntax in docstrings"""

    arg_6 = "\n".join(arg_5)

    # ast = cm_parser.parse(markdown)
    # html = cm_renderer.render(ast)
    arg_7 = m2r(arg_6)

    arg_7.replace("\r\n", "\n")
    del arg_5[:]
    arg_5.extend(arg_7.split("\n"))


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_0
.
copy_expert
(
"COPY {table} TO STDOUT"
.
format
(
arg_1
=
arg_1
)
,
arg_2
)

def Func(arg_0, arg_1, arg_2):
        """
        Dumps a database table into a tab-delimited file
        """
        arg_0.copy_expert("COPY {table} TO STDOUT".format(arg_1=arg_1), arg_2)

Dumps a database table into a tab - delimited file


(self, service_name, thumbalgorithm, thumbprint)

return self._perform_get(
            '/' + self.subscription_id + '/services/hostedservices/' +
            _str(service_name) + '/certificates/' +
            _str(thumbalgorithm) + '-' + _str(thumbprint) + '',
            Certificate)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : _validate_not_none ( 'service_name' , arg_1 ) _validate_not_none ( 'thumbalgorithm' , arg_2 ) _validate_not_none ( 'thumbprint' , arg_3 ) return arg_0 . _perform_get ( '/' + arg_0 . subscription_id + '/services/hostedservices/' + _str ( arg_1 ) + '/certificates/' + _str ( arg_2 ) + '-' + _str ( arg_3 ) + '' , Certificate )

def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Returns the public data for the specified X.509 certificate associated
        with a hosted service.

        service_name:
            Name of the hosted service.
        thumbalgorithm:
            The algorithm for the certificate's thumbprint.
        thumbprint:
            The hexadecimal representation of the thumbprint.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('thumbalgorithm', arg_2)
        _validate_not_none('thumbprint', arg_3)
        return arg_0._perform_get(
            '/' + arg_0.subscription_id + '/services/hostedservices/' +
            _str(arg_1) + '/certificates/' +
            _str(arg_2) + '-' + _str(arg_3) + '',
            Certificate)

Returns the public data for the specified X . 509 certificate associated with a hosted service .


def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . increment_filename ( 'Untitled' ) arg_3 = arg_0 . Func_id ( arg_2 ) arg_4 = current . new_metadata ( arg_2 = arg_2 ) arg_5 = current . Func ( arg_4 = arg_4 ) with open ( arg_1 , 'w' ) as f : current . write ( arg_5 , f , u'json' ) return arg_3

def Func(arg_0):
        """Create a new notebook and return its notebook_id."""
        arg_1, arg_2 = arg_0.increment_filename('Untitled')
        arg_3 = arg_0.Func_id(arg_2)
        arg_4 = current.new_metadata(arg_2=arg_2)
        arg_5 = current.Func(arg_4=arg_4)
        with open(arg_1,'w') as f:
            current.write(arg_5, f, u'json')
        return arg_3

Create a new notebook and return its notebook_id .


(tw, keys, issue, legacy_matching=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
)
:
if
not
arg_2
[
'description'
]
:
raise
ValueError
(
'Issue %s has no description.'
%
arg_2
)
arg_4
=
set
(
[
]
)
if
arg_3
:
arg_5
=
arg_2
.
get_default_description
(
)
.
rsplit
(
'..'
,
1
)
[
0
]
arg_5
=
arg_5
.
split
(
"'"
)
[
0
]
arg_6
=
arg_0
.
filter_tasks
(
{
'description.startswith'
:
arg_5
,
'or'
:
[
(
'status'
,
'pending'
)
,
(
'status'
,
'waiting'
)
,
]
,
}
)
arg_4
=
arg_4
|
set
(
[
task
[
'uuid'
]
for
task
in
arg_6
]
)
for
arg_7
,
arg_8
in
six
.
iteritems
(
arg_1
)
:
if
any
(
[
arg_9
in
arg_2
for
arg_9
in
arg_8
]
)
:
arg_6
=
arg_0
.
filter_tasks
(
{
'and'
:
[
(
"%s.is"
%
arg_9
,
arg_2
[
arg_9
]
)
for
arg_9
in
arg_8
]
,
'or'
:
[
(
'status'
,
'pending'
)
,
(
'status'
,
'waiting'
)
,
]
,
}
)
arg_4
=
arg_4
|
set
(
[
task
[
'uuid'
]
for
task
in
arg_6
]
)
if
len
(
arg_4
)
==
1
:
return
arg_4
.
pop
(
)
if
len
(
arg_4
)
>
1
:
raise
MultipleMatches
(
"Issue %s matched multiple IDs: %s"
%
(
arg_2
[
'description'
]
,
arg_4
)
)
raise
NotFound
(
"No issue was found matching %s"
%
arg_2
)

def Func(arg_0, arg_1, arg_2, arg_3=False):
    """ For a given issue issue, find its local UUID.

    Assembles a list of task IDs existing in taskwarrior
    matching the supplied issue (`issue`) on the combination of any
    set of supplied unique identifiers (`keys`) or, optionally,
    the task's description field (should `legacy_matching` be `True`).

    :params:
    * `tw`: An instance of `taskw.TaskWarriorShellout`
    * `keys`: A list of lists of keys to use for uniquely identifying
      an issue.  To clarify the "list of lists" behavior, assume that
      there are two services, one having a single primary key field
      -- 'serviceAid' -- and another having a pair of fields composing
      its primary key -- 'serviceBproject' and 'serviceBnumber' --, the
      incoming data for this field would be::

        [
            ['serviceAid'],
            ['serviceBproject', 'serviceBnumber'],
        ]

    * `issue`: An instance of a subclass of `bugwarrior.services.Issue`.
    * `legacy_matching`: By default, this is disabled, and it allows
      the matching algorithm to -- in addition to searching by stored
      issue keys -- search using the task's description for a match.
      It is prone to error and should avoided if possible.

    :returns:
    * A single string UUID.

    :raises:
    * `bugwarrior.db.MultipleMatches`: if multiple matches were found.
    * `bugwarrior.db.NotFound`: if an issue was not found.

    """
    if not arg_2['description']:
        raise ValueError('Issue %s has no description.' % arg_2)

    arg_4 = set([])

    if arg_3:
        arg_5 = arg_2.get_default_description().rsplit('..', 1)[0]
        # Furthermore, we have to kill off any single quotes which break in
        # task-2.4.x, as much as it saddens me.
        arg_5 = arg_5.split("'")[0]
        arg_6 = arg_0.filter_tasks({
            'description.startswith': arg_5,
            'or': [
                ('status', 'pending'),
                ('status', 'waiting'),
            ],
        })
        arg_4 = arg_4 | set([
            task['uuid'] for task in arg_6
        ])

    for arg_7, arg_8 in six.iteritems(arg_1):
        if any([arg_9 in arg_2 for arg_9 in arg_8]):
            arg_6 = arg_0.filter_tasks({
                'and': [("%s.is" % arg_9, arg_2[arg_9]) for arg_9 in arg_8],
                'or': [
                    ('status', 'pending'),
                    ('status', 'waiting'),
                ],
            })
            arg_4 = arg_4 | set([
                task['uuid'] for task in arg_6
            ])

    if len(arg_4) == 1:
        return arg_4.pop()

    if len(arg_4) > 1:
        raise MultipleMatches(
            "Issue %s matched multiple IDs: %s" % (
                arg_2['description'],
                arg_4
            )
        )

    raise NotFound(
        "No issue was found matching %s" % arg_2
    )

For a given issue issue find its local UUID .


def Func ( arg_0 ) : arg_1 = tf_inspect . getfullargspec ( arg_0 ) arg_2 = arg_1 . args if tf_inspect . isclass ( arg_0 ) : arg_2 = arg_2 [ 1 : ] if arg_1 . defaults : arg_2 = arg_2 [ : - len ( arg_1 . defaults ) ] return tuple ( arg_2 )

def Func(arg_0):
  """Returns the distribution's required args."""
  arg_1 = tf_inspect.getfullargspec(arg_0)
  arg_2 = arg_1.args
  if tf_inspect.isclass(arg_0):
    arg_2 = arg_2[1:]  # Remove the `self` arg.
  if arg_1.defaults:
    # Remove the args which have defaults. By convention we only feed
    # *required args*. This means some distributions must always be wrapped
    # with a `lambda`, e.g., `lambda logits: tfd.Bernoulli(logits=logits)`
    # or `lambda probs: tfd.Bernoulli(probs=probs)`.
    arg_2 = arg_2[:-len(arg_1.defaults)]
  return tuple(arg_2)

Returns the distribution s required args .


def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = os . environ . get ( 'NEUROSYNTH_LOGLEVEL' , 'warn' ) if arg_0 is not None : logger . setLevel ( getattr ( logging , arg_0 . upper ( ) ) ) return logger . getEffectiveLevel ( )

def Func(arg_0=None):
    """Set neurosynth's logging level

    Args
      level : str
        Name of the logging level (warning, error, info, etc) known
        to logging module.  If no level provided, it would get that one
        from environment variable NEUROSYNTH_LOGLEVEL
    """
    if arg_0 is None:
        arg_0 = os.environ.get('NEUROSYNTH_LOGLEVEL', 'warn')
    if arg_0 is not None:
        logger.setLevel(getattr(logging, arg_0.upper()))
    return logger.getEffectiveLevel()


return {
        namespace: get_names_including_errors_by_namespace(graph, namespace)
        for namespace in get_namespaces(graph)
    }

def Func ( arg_0 : arg_1 ) -> Mapping [ str , Set [ str ] ] : return { arg_2 : Func_by_namespace ( arg_0 , arg_2 ) for arg_2 in get_namespaces ( arg_0 ) }

def Func(arg_0: arg_1) -> Mapping[str, Set[str]]:
    """Takes the names from the graph in a given namespace and the erroneous names from the same namespace and returns
    them together as a unioned set

    :return: The dict of the sets of all correct and incorrect names from the given namespace in the graph
    """
    return {
        arg_2: Func_by_namespace(arg_0, arg_2)
        for arg_2 in get_namespaces(arg_0)
    }


def Func ( arg_0 , arg_1 = True ) : arg_0 . _is_run = False arg_0 . f_set_crun ( None ) if arg_1 : arg_0 . f_store ( only_init = True )

def Func(arg_0, arg_1=True):
        """Final rollback initiated by the environment

        Restores the trajectory as root of the tree, and stores meta data to disk.
        This updates the trajectory's information about single runs, i.e. if they've been
        completed, when they were started, etc.

        """
        arg_0._is_run = False
        arg_0.f_set_crun(None)
        if arg_1:
            arg_0.f_store(only_init=True)


def Func ( arg_0 ) : arg_1 = arg_0 . conn . client . incr ( arg_0 . times_modified_key ) arg_0 . conn . client . pexpire ( arg_0 . times_modified_key , phonon . s_to_ms ( TTL ) )

def Func(arg_0):
        """
        Increments the number of times this resource has been modified by all
        processes.
        """
        arg_1 = arg_0.conn.client.incr(arg_0.times_modified_key)
        arg_0.conn.client.pexpire(arg_0.times_modified_key,
                                 phonon.s_to_ms(TTL))

Increments the number of times this resource has been modified by all processes .


def Func ( arg_0 ) : arg_1 = arg_0 . _model_json [ "output" ] [ "Func" ] if arg_1 is None : return None arg_2 = [ ] for arg_3 in arg_1 : arg_2 . append ( h2o . get_model ( arg_3 [ "name" ] ) ) return arg_2

def Func(arg_0):
        """
        Obtain a list of cross-validation models.

        :returns: list of H2OModel objects.
        """
        arg_1 = arg_0._model_json["output"]["Func"]
        if arg_1 is None: return None
        arg_2 = []
        for arg_3 in arg_1: arg_2.append(h2o.get_model(arg_3["name"]))
        return arg_2

Obtain a list of cross - validation models .


def Func ( arg_0 ) : if isinstance ( arg_0 , float ) : arg_0 = repr ( arg_0 ) elif arg_0 in ( None , '' ) : return None elif not isinstance ( arg_0 , six . string_types ) : if six . PY3 and isinstance ( arg_0 , bytes ) : arg_0 = arg_0 . decode ( 'latin-1' ) else : arg_0 = str ( arg_0 ) arg_1 = sorted ( set ( [ x for x in [ arg_2 . lower ( ) . strip ( string . punctuation ) for arg_2 in arg_0 . split ( ) ] if x ] ) ) if not isinstance ( arg_0 , str ) : return [ arg_2 . encode ( 'utf-8' ) for arg_2 in arg_1 ] return arg_1

def Func(arg_0):
    '''
    This is a basic full-text index keygen function. Words are lowercased, split
    by whitespace, and stripped of punctuation from both ends before an inverted
    index is created for term searching.
    '''
    if isinstance(arg_0, float):
        arg_0 = repr(arg_0)
    elif arg_0 in (None, ''):
        return None
    elif not isinstance(arg_0, six.string_types):
        if six.PY3 and isinstance(arg_0, bytes):
            arg_0 = arg_0.decode('latin-1')
        else:
            arg_0 = str(arg_0)
    arg_1 = sorted(set([x for x in [arg_2.lower().strip(string.punctuation) for arg_2 in arg_0.split()] if x]))
    if not isinstance(arg_0, str):  # unicode on py2k
        return [arg_2.encode('utf-8') for arg_2 in arg_1]
    return arg_1

This is a basic full - text index keygen function . Words are lowercased split by whitespace and stripped of punctuation from both ends before an inverted index is created for term searching .


(cls, resource: str, session: Optional[Session] = None)

def Func(arg_0, arg_1: arg_2, arg_3: arg_4[arg_5] = None) -> 'Action':
        """Store a "populate failed" event.

        :param resource: The normalized name of the resource to store

        Example:

        >>> from bio2bel.models import Action
        >>> Action.Func('hgnc')
        """
        arg_6 = arg_0.make_populate_failed(arg_1)
        _store_helper(arg_6, arg_3=arg_3)
        return arg_6

Store a "populate failed" event.

        :param resource: The normalized name of the resource to store

        Example:

        >>> from bio2bel.models import Action
        >>> Action.store_populate_failed('hgnc')


def Func ( arg_0 ) : from heronpy . streamlet . impl . Funcbolt import LogStreamlet arg_1 = LogStreamlet ( arg_0 ) arg_0 . _add_child ( arg_1 ) return

def Func(arg_0):
    """Logs all elements of this streamlet. This returns nothing
    """
    from heronpy.streamlet.impl.Funcbolt import LogStreamlet
    arg_1 = LogStreamlet(arg_0)
    arg_0._add_child(arg_1)
    return

Logs all elements of this streamlet . This returns nothing


def Func ( arg_0 : arg_1 , arg_2 : arg_3 ) : for arg_4 in get_pubmed_identifiers ( arg_0 ) : click . echo ( arg_4 , file = arg_2 )

def Func(arg_0: arg_1, arg_2: arg_3):
    """Output PubMed identifiers from a graph to a stream."""
    for arg_4 in get_pubmed_identifiers(arg_0):
        click.echo(arg_4, file=arg_2)

Output PubMed identifiers from a graph to a stream .


def Func(arg_0, arg_1, arg_2=1):
    r"""Perform gamma correction on an image.

    Also known as Power Law Transform. Intensities in RGB mode are adjusted
    based on the following equation:

    .. math::
        I_{\text{out}} = 255 \times \text{gain} \times \left(\frac{I_{\text{in}}}{255}\right)^{\gamma}

    See `Gamma Correction`_ for more details.

    .. _Gamma Correction: https://en.wikipedia.org/wiki/Gamma_correction

    Args:
        img (PIL Image): PIL Image to be adjusted.
        gamma (float): Non negative real number, same as :math:`\gamma` in the equation.
            gamma larger than 1 make the shadows darker,
            while gamma smaller than 1 make dark regions lighter.
        gain (float): The constant multiplier.
    """
    if not _is_pil_image(arg_0):
        raise TypeError('img should be PIL Image. Got {}'.format(type(arg_0)))

    if arg_1 < 0:
        raise ValueError('Gamma should be a non-negative real number')

    arg_3 = arg_0.mode
    arg_0 = arg_0.convert('RGB')

    arg_4 = [255 * arg_2 * pow(ele / 255., arg_1) for ele in range(256)] * 3
    arg_0 = arg_0.point(arg_4)  # use PIL's point-function to accelerate this part

    arg_0 = arg_0.convert(arg_3)
    return arg_0

r Perform gamma correction on an image .


def
Func
(
arg_0
)
:
logger
.
debug
(
"========================"
)
logger
.
debug
(
"Setting secondary inputs"
)
logger
.
debug
(
"========================"
)
arg_1
=
arg_0
.
processes
[
0
]
logger
.
debug
(
"Setting main raw inputs: "
"{}"
.
format
(
arg_0
.
main_raw_inputs
)
)
arg_1
.
set_raw_inputs
(
arg_0
.
main_raw_inputs
)
logger
.
debug
(
"Setting extra inputs: {}"
.
format
(
arg_0
.
extra_inputs
)
)
arg_1
.
set_extra_inputs
(
arg_0
.
extra_inputs
)

def Func(arg_0):
        """Sets the main raw inputs and secondary inputs on the init process

        This method will fetch the :class:`flowcraft.process.Init` process
        instance and sets the raw input (
        :func:`flowcraft.process.Init.set_raw_inputs`) for
        that process. This will handle the connection of the user parameters
        with channels that are then consumed in the pipeline.
        """

        logger.debug("========================")
        logger.debug("Setting secondary inputs")
        logger.debug("========================")

        # Get init process
        arg_1 = arg_0.processes[0]
        logger.debug("Setting main raw inputs: "
                     "{}".format(arg_0.main_raw_inputs))
        arg_1.set_raw_inputs(arg_0.main_raw_inputs)
        logger.debug("Setting extra inputs: {}".format(arg_0.extra_inputs))
        arg_1.set_extra_inputs(arg_0.extra_inputs)


return OrderedDict(
            [
                ("memo_key", PublicKey(kwargs["memo_key"], prefix=prefix)),
                ("voting_account", ObjectId(kwargs["voting_account"], "account")),
                ("num_witness", Uint16(kwargs["num_witness"])),
                ("num_committee", Uint16(kwargs["num_committee"])),
                ("votes", Array([VoteId(o) for o in kwargs["votes"]])),
                ("extensions", Set([])),
            ]
        )

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_2 . pop ( "prefix" , default_prefix ) arg_2 [ "votes" ] = list ( set ( arg_2 [ "votes" ] ) ) return OrderedDict ( [ ( "memo_key" , PublicKey ( arg_2 [ "memo_key" ] , arg_3 = arg_3 ) ) , ( "voting_account" , ObjectId ( arg_2 [ "voting_account" ] , "account" ) ) , ( "num_witness" , Uint16 ( arg_2 [ "num_witness" ] ) ) , ( "num_committee" , Uint16 ( arg_2 [ "num_committee" ] ) ) , ( "votes" , Array ( [ VoteId ( arg_4 ) for arg_4 in arg_2 [ "votes" ] ] ) ) , ( "extensions" , Set ( [ ] ) ) , ] )

def Func(arg_0, *arg_1, **arg_2):
        arg_3 = arg_2.pop("prefix", default_prefix)
        # remove dublicates
        arg_2["votes"] = list(set(arg_2["votes"]))
        """ This is an example how to sort votes prior to using them in the
            Object
        """
        # # Sort votes
        # kwargs["votes"] = sorted(
        #     kwargs["votes"],
        #     key=lambda x: float(x.split(":")[1]),
        # )
        return OrderedDict(
            [
                ("memo_key", PublicKey(arg_2["memo_key"], arg_3=arg_3)),
                ("voting_account", ObjectId(arg_2["voting_account"], "account")),
                ("num_witness", Uint16(arg_2["num_witness"])),
                ("num_committee", Uint16(arg_2["num_committee"])),
                ("votes", Array([VoteId(arg_4) for arg_4 in arg_2["votes"]])),
                ("extensions", Set([])),
            ]
        )


def Func ( arg_0 , arg_1 ) : arg_0 . bot . canvas . sink . trigger_fullscreen_action ( False ) print ( arg_0 . response_prompt , file = arg_0 . stdout )

def Func(arg_0, arg_1):
        """
        Un-fullscreen the current window
        """
        arg_0.bot.canvas.sink.trigger_fullscreen_action(False)
        print(arg_0.response_prompt, file=arg_0.stdout)


def
Func
(
arg_0
)
:
arg_1
=
""
if
isinstance
(
arg_0
,
dict
)
:
arg_2
=
context_name
(
arg_0
)
arg_1
=
"\n"
+
arg_2
+
"\n\n"
arg_3
=
inspect
.
getdoc
(
arg_0
)
if
arg_3
is
not
:
arg_3
=
inspect
.
cleandoc
(
arg_3
)
arg_1
+=
arg_3
+
'\n'
return
arg_1
arg_4
=
arg_0
.
metadata
.
signature
(
)
arg_3
=
inspect
.
getdoc
(
arg_0
)
if
arg_3
is
not
:
arg_3
=
inspect
.
cleandoc
(
arg_3
)
arg_1
+=
"\n"
+
arg_4
+
"\n\n"
if
arg_3
is
not
:
arg_1
+=
arg_3
+
'\n'
if
inspect
.
isclass
(
arg_0
)
:
arg_0
=
arg_0
.
__init__
if
arg_0
.
metadata
.
load_from_doc
:
return
arg_1
arg_1
+=
"\nArguments:\n"
for
arg_5
,
arg_6
in
arg_0
.
metadata
.
annotated_params
.
items
(
)
:
arg_7
=
arg_6
.
type_name
arg_8
=
""
if
arg_6
.
desc
is
not
:
arg_8
=
arg_6
.
desc
arg_1
+=
"  - %s (%s): %s\n"
%
(
arg_5
,
arg_7
,
arg_8
)
return
arg_1

def Func(arg_0):
    """Return usage information about a context or function.

    For contexts, just return the context name and its docstring
    For functions, return the function signature as well as its
    argument types.

    Args:
        func (callable): An annotated callable function

    Returns:
        str: The formatted help text
    """

    arg_1 = ""
    if isinstance(arg_0, dict):
        arg_2 = context_name(arg_0)

        arg_1 = "\n" + arg_2 + "\n\n"
        arg_3 = inspect.getdoc(arg_0)
        if arg_3 is not None:
            arg_3 = inspect.cleandoc(arg_3)
            arg_1 += arg_3 + '\n'

        return arg_1

    arg_4 = arg_0.metadata.signature()
    arg_3 = inspect.getdoc(arg_0)
    if arg_3 is not None:
        arg_3 = inspect.cleandoc(arg_3)

    arg_1 += "\n" + arg_4 + "\n\n"
    if arg_3 is not None:
        arg_1 += arg_3 + '\n'

    if inspect.isclass(arg_0):
        arg_0 = arg_0.__init__

    # If we derived the parameter annotations from a docstring,
    # don't insert a custom arguments section since it already
    # exists.
    if arg_0.metadata.load_from_doc:
        return arg_1

    arg_1 += "\nArguments:\n"
    for arg_5, arg_6 in arg_0.metadata.annotated_params.items():
        arg_7 = arg_6.type_name
        arg_8 = ""
        if arg_6.desc is not None:
            arg_8 = arg_6.desc

        arg_1 += "  - %s (%s): %s\n" % (arg_5, arg_7, arg_8)

    return arg_1

Return usage information about a context or function .


(groups_in, classifier, fun_desc='?', keep_uniques=False,
            *args, **kwargs)

def Func(arg_0, arg_1, arg_2='?', arg_3=False,
            *arg_4, **arg_5):
    """Subdivide groups of paths according to a function.

    :param groups_in: Grouped sets of paths.
    :type groups_in: :class:`~__builtins__.dict` of iterables

    :param classifier: Function to group a list of paths by some attribute.
    :type classifier: ``function(list, *args, **kwargs) -> str``

    :param fun_desc: Human-readable term for what the classifier operates on.
        (Used in log messages)
    :type fun_desc: :class:`~__builtins__.str`

    :param keep_uniques: If ``False``, discard groups with only one member.
    :type keep_uniques: :class:`~__builtins__.bool`

    :returns: A dict mapping classifier keys to groups of matches.
    :rtype: :class:`~__builtins__.dict`

    :attention: Grouping functions generally use a :class:`~__builtins__.set`
        ``groups`` as extra protection against accidentally counting a given
        file twice. (Complimentary to use of :func:`os.path.realpath` in
        :func:`~fastdupes.getPaths`)

    .. todo:: Find some way to bring back the file-by-file status text
    """
    arg_6, arg_7, arg_8 = {}, 0, len(arg_0)
    for arg_9, arg_10 in enumerate(arg_0.values()):
        out.write("Subdividing group %d of %d by %s... (%d files examined, %d "
                  "in current group)" % (
                      arg_9 + 1, arg_8, arg_2, arg_7, len(arg_10)
                  ))

        for arg_11, arg_12 in arg_1(arg_10, *arg_4, **arg_5).items():
            arg_6.setdefault(arg_11, set()).update(arg_12)
            arg_7 += len(arg_12)

    if not arg_3:
        # Return only the groups with more than one file.
        arg_6 = dict([(x, arg_6[x]) for x in arg_6 if len(arg_6[x]) > 1])

    out.write("Found %s sets of files with identical %s. (%d files examined)"
              % (len(arg_6), arg_2, arg_7), newline=True)
    return arg_6

Subdivide groups of paths according to a function .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
os
.
path
.
dirname
(
arg_0
)
if
os
.
path
.
isfile
(
arg_0
)
:
arg_3
=
_parse_file
(
arg_0
,
arg_2
)
elif
os
.
path
.
isdir
(
arg_0
)
:
arg_3
=
_parse_dir
(
arg_0
,
arg_2
)
else
:
_error
(
"Could not determine file type: %r"
,
arg_0
)
if
not
arg_3
:
_error
(
"No pyconfig calls."
)
if
arg_1
.
load_configs
:
arg_4
=
set
(
)
for
arg_5
in
arg_3
:
arg_4
.
add
(
arg_5
.
key
)
arg_6
=
pyconfig
.
Config
(
)
for
arg_7
,
arg_8
in
arg_6
.
settings
.
items
(
)
:
if
arg_7
in
arg_4
:
continue
arg_3
.
append
(
_PyconfigCall
(
'set'
,
arg_7
,
arg_8
,
[
]
*
4
)
)
_output
(
arg_3
,
arg_1
)

def Func(arg_0, arg_1):
    """
    Parse `filename` appropriately and then output calls according to the
    `args` specified.

    :param filename: A file or directory
    :param args: Command arguments
    :type filename: str

    """
    arg_2 = os.path.dirname(arg_0)
    if os.path.isfile(arg_0):
        arg_3 = _parse_file(arg_0, arg_2)
    elif os.path.isdir(arg_0):
        arg_3 = _parse_dir(arg_0, arg_2)
    else:
        # XXX(shakefu): This is an error of some sort, maybe symlinks?
        # Probably need some thorough testing
        _error("Could not determine file type: %r", arg_0)

    if not arg_3:
        # XXX(shakefu): Probably want to change this to not be an error and
        # just be a normal fail (e.g. command runs, no output).
        _error("No pyconfig calls.")

    if arg_1.load_configs:
        # We want to iterate over the configs and add any keys which haven't
        # already been found
        arg_4 = set()
        for arg_5 in arg_3:
            arg_4.add(arg_5.key)

        # Iterate the loaded keys and make _PyconfigCall instances
        arg_6 = pyconfig.Config()
        for arg_7, arg_8 in arg_6.settings.items():
            if arg_7 in arg_4:
                continue
            arg_3.append(_PyconfigCall('set', arg_7, arg_8, [None]*4))

    _output(arg_3, arg_1)

Parse filename appropriately and then output calls according to the args specified .


def Func(arg_0, arg_1):
        """
        Adds the subparsers to an argparse.ArgumentParser

        @param parser An argparse.ArgumentParser instance
        """
        arg_2 = getattr(arg_0, "subparser_group", None)
        if arg_2:
            arg_2.add_to_parser(arg_0)

        if not arg_0.subparsers:
            return

        arg_3 = arg_0.subparsers_args or arg_0.get_default_subparsers_args()
        arg_4 = arg_0.subparsers_kwargs or arg_0.get_default_subparsers_kwargs()
        arg_5 = arg_1.Func(*arg_3, **arg_4)

        for arg_6 in arg_0.subparsers:
            arg_6.add_to_parser(arg_5)

Adds the subparsers to an argparse . ArgumentParser


(est_file, ref_file, boundaries_id, labels_id, config,
                       bins=251, annotator_id=0)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                       arg_5=251, arg_6=0):
    """Computes the results by using the ground truth dataset identified by
    the annotator parameter.

    Return
    ------
    results : dict
        Dictionary of the results (see function compute_results).
    """
    if arg_4["hier"]:
        arg_7, arg_8, arg_9 = \
            msaf.io.read_hier_references(
                arg_1, annotation_id=arg_6,
                exclude_levels=["segment_salami_function"])
    else:
        arg_10 = jams.load(arg_1, validate=False)
        arg_11 = arg_10.search(namespace='segment_.*')[arg_6]
        arg_12, arg_8 = arg_11.to_interval_values()

    # Read estimations with correct configuration
    arg_13, arg_14 = io.read_estimations(arg_0, arg_2,
                                                arg_3, **arg_4)

    # Compute the results and return
    logging.info("Evaluating %s" % os.path.basename(arg_0))
    if arg_4["hier"]:
        # Hierarchical
        assert len(arg_13) == len(arg_14), "Same number of levels " \
            "are required in the boundaries and labels for the hierarchical " \
            "evaluation."
        arg_15 = []
        arg_14 = []

        # Sort based on how many segments per level
        arg_13 = sorted(arg_13, key=lambda level: len(level))

        for arg_16 in arg_13:
            arg_15.append(msaf.utils.intervals_to_times(arg_16))
            # Add fake labels (hierarchical eval does not use labels --yet--)
            arg_14.append(np.ones(len(arg_15[-1]) - 1) * -1)

        # Align the times
        utils.align_end_hierarchies(arg_15, arg_7, thres=1)

        # To intervals
        arg_17 = [utils.times_to_intervals(times) for times in arg_15]
        arg_18 = [utils.times_to_intervals(times) for times in arg_7]

        # Compute evaluations
        arg_19 = {}
        arg_19["t_recall10"], arg_19["t_precision10"], arg_19["t_measure10"] = \
            mir_eval.hierarchy.tmeasure(arg_18, arg_17, window=10)
        arg_19["t_recall15"], arg_19["t_precision15"], arg_19["t_measure15"] = \
            mir_eval.hierarchy.tmeasure(arg_18, arg_17, window=15)

        arg_19["track_id"] = os.path.basename(arg_0)[:-5]
        return arg_19
    else:
        # Flat
        return compute_results(arg_12, arg_13, arg_8, arg_14,
                               arg_5, arg_0)

Computes the results by using the ground truth dataset identified by the annotator parameter .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
QtGui
.
QFontMetrics
(
arg_1
)
arg_0
.
_control
.
setTabStopWidth
(
arg_0
.
tab_width
*
arg_2
.
width
(
' '
)
)
arg_0
.
_completion_widget
.
setFont
(
arg_1
)
arg_0
.
_control
.
document
(
)
.
setDefaultFont
(
arg_1
)
if
arg_0
.
_page_control
:
arg_0
.
_page_control
.
document
(
)
.
setDefaultFont
(
arg_1
)
arg_0
.
font_changed
.
emit
(
arg_1
)

def Func(arg_0, arg_1):
        """ Sets the base font for the ConsoleWidget to the specified QFont.
        """
        arg_2 = QtGui.QFontMetrics(arg_1)
        arg_0._control.setTabStopWidth(arg_0.tab_width * arg_2.width(' '))

        arg_0._completion_widget.setFont(arg_1)
        arg_0._control.document().setDefaultFont(arg_1)
        if arg_0._page_control:
            arg_0._page_control.document().setDefaultFont(arg_1)

        arg_0.font_changed.emit(arg_1)

Sets the base font for the ConsoleWidget to the specified QFont .


def Func(arg_0):
        """create a new frontend attached to the same kernel as the current tab"""
        arg_1 = arg_0.tab_widget.currentWidget()
        arg_2 = arg_0.tab_widget.indexOf(arg_1)
        arg_3 = arg_0.tab_widget.tabText(arg_2)
        arg_4 = arg_0.slave_frontend_factory(arg_1)
        if 'slave' in arg_3:
            # don't keep stacking slaves
            arg_5 = arg_3
        else:
            arg_5 = '(%s) slave' % arg_3
        arg_0.add_tab_with_frontend(arg_4,arg_5=arg_5)


(P, zs, vapor_pressure_eqns, fugacities=None, gammas=None)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
    '''Calculates bubble point for a given pressure

    Parameters
    ----------
    P : float
        Pressure, [Pa]
    zs : list[float]
        Overall mole fractions of all species, [-]
    vapor_pressure_eqns : list[functions]
        Temperature dependent function for each specie, Returns Psat, [Pa]
    fugacities : list[float], optional
        fugacities of each species, defaults to list of ones, [-]
    gammas : list[float], optional
        gammas of each species, defaults to list of ones, [-]

    Returns
    -------
    Tbubble : float, optional
        Temperature of bubble point at pressure `P`, [K]

    '''

    def bubble_P_error(arg_5):
        arg_6 = [VP(arg_5) for VP in arg_2]
        arg_7 = bubble_at_T(arg_1, arg_6, arg_3, arg_4)

        return arg_0 - arg_7

    arg_8 = newton(bubble_P_error, 300)

    return arg_8


def
Func
(
arg_0
,
arg_1
=
''
)
:
if
not
op
.
exists
(
arg_0
)
:
raise
IOError
(
'Folder {} not found.'
.
format
(
arg_0
)
)
arg_2
=
'dcm2nii {0} "{1}"'
.
format
(
arg_1
,
arg_0
)
log
.
info
(
arg_2
)
return
subprocess
.
check_call
(
arg_2
,
shell
=
True
)

def Func(arg_0, arg_1=''):
    """Converts all DICOM files within `work_dir` into one or more
    NifTi files by calling dcm2nii on this folder.

    Parameters
    ----------
    work_dir: str
        Path to the folder that contain the DICOM files

    arguments: str
        String containing all the flag arguments for `dcm2nii` CLI.

    Returns
    -------
    sys_code: int
        dcm2nii execution return code
    """
    if not op.exists(arg_0):
        raise IOError('Folder {} not found.'.format(arg_0))

    arg_2 = 'dcm2nii {0} "{1}"'.format(arg_1, arg_0)
    log.info(arg_2)
    return subprocess.check_call(arg_2, shell=True)

Converts all DICOM files within work_dir into one or more NifTi files by calling dcm2nii on this folder .


(graph: BELGraph, annotation: str = 'Subgraph')

def Func ( arg_0 : arg_1 , arg_2 : arg_3 = 'Subgraph' ) -> Mapping [ arg_3 , Set [ BaseEntity ] ] : arg_4 = defaultdict ( set ) for arg_5 , arg_6 , arg_7 in arg_0 . edges ( data = True ) : if not edge_has_annotation ( arg_7 , arg_2 ) : continue arg_4 [ arg_7 [ ANNOTATIONS ] [ arg_2 ] ] . add ( arg_5 ) arg_4 [ arg_7 [ ANNOTATIONS ] [ arg_2 ] ] . add ( arg_6 ) return dict ( arg_4 )

def Func(arg_0: arg_1, arg_2: arg_3 = 'Subgraph') -> Mapping[arg_3, Set[BaseEntity]]:
    """Group the nodes occurring in edges by the given annotation."""
    arg_4 = defaultdict(set)

    for arg_5, arg_6, arg_7 in arg_0.edges(data=True):
        if not edge_has_annotation(arg_7, arg_2):
            continue

        arg_4[arg_7[ANNOTATIONS][arg_2]].add(arg_5)
        arg_4[arg_7[ANNOTATIONS][arg_2]].add(arg_6)

    return dict(arg_4)

Group the nodes occurring in edges by the given annotation .


(self, path, n_procs=4, read_ahead=None, cyclic=False, block_size=None, ordered=False)

return Streamer.Queue(cbuf, stop, block_size)

def Func ( arg_0 , arg_1 , arg_2 = 4 , arg_3 = None , arg_4 = False , arg_5 = None , arg_6 = False ) : arg_7 = arg_0 . __get_batch ( arg_1 , arg_5 ) arg_5 = arg_7 . shape [ 0 ] if arg_3 is None : arg_3 = 2 * arg_2 + 1 arg_8 = SharedCircBuf ( arg_3 , arg_7 ) arg_9 = multiprocessing . Event ( ) arg_10 = Barrier ( arg_2 ) arg_11 = GuardSynchronizer ( ) if arg_6 else None arg_12 = [ ] for arg_13 in range ( arg_2 ) : arg_14 = multiprocessing . Process ( target = _Streamer__read_process , args = ( arg_0 , arg_1 , arg_5 , arg_8 , arg_9 , arg_10 , arg_4 , arg_13 * arg_5 , arg_2 * arg_5 , arg_11 ) ) arg_14 . daemon = True arg_14 . start ( ) arg_12 . append ( arg_14 ) if not arg_4 : def monitor ( ) : for arg_16 in arg_12 : arg_16 . join ( ) arg_8 . close ( ) arg_17 = threading . Thread ( target = monitor ) arg_17 . daemon = True arg_17 . start ( ) return Streamer . Queue ( arg_8 , arg_9 , arg_5 )

def Func(arg_0, arg_1, arg_2=4, arg_3=None, arg_4=False, arg_5=None, arg_6=False):
        """
        Get a queue that allows direct access to the internal buffer. If the dataset to be read is chunked, the
        block_size should be a multiple of the chunk size to maximise performance. In this case it is best to leave it
        to the default. When cyclic=False, and block_size does not divide the dataset evenly, the remainder elements
        will not be returned by the queue. When cyclic=True, the remainder elements will be part of a block that wraps
        around the end and includes element from the beginning of the dataset. By default, blocks are returned in the
        order in which they become available. The ordered option will force blocks to be returned in on-disk order.

        :param path: The HDF5 path to the dataset that should be read.
        :param n_procs: The number of background processes used to read the datset in parallel.
        :param read_ahead: The number of blocks to allocate in the internal buffer.
        :param cyclic: True if the queue should wrap at the end of the dataset.
        :param block_size: The size along the outer dimension of the blocks to be read. Defaults to a multiple of
            the chunk size, or to a 128KB sized block if the dataset is not chunked.
        :param ordered: Force the reader return data in on-disk order. May result in performance penalty.
        :return: A queue object that allows access to the internal buffer.
        """
        # Get a block_size length of elements from the dataset to serve as a template for creating the buffer.
        # If block_size=None, then get_batch calculates an appropriate block size.
        arg_7 = arg_0.__get_batch(arg_1, arg_5)
        arg_5 = arg_7.shape[0]

        if arg_3 is None:
            # 2x No. of processes for writing, 1 extra for reading.
            arg_3 = 2*arg_2 + 1

        arg_8 = SharedCircBuf(arg_3, arg_7)
        arg_9 = multiprocessing.Event()
        arg_10 = Barrier(arg_2)

        # If ordering has been requested, create a synchronizer.
        arg_11 = GuardSynchronizer() if arg_6 else None

        arg_12 = []
        for arg_13 in range(arg_2):
            # Each process is offset in the dataset by i*block_size
            # The skip length is set to n_procs*block_size so that no block is read by 2 processes.
            arg_14 = multiprocessing.Process(target=_Streamer__read_process, args=(
                arg_0, arg_1, arg_5, arg_8, arg_9, arg_10, arg_4,
                arg_13 * arg_5, arg_2 * arg_5, arg_11
            ))
            arg_14.daemon = True
            arg_14.start()
            arg_12.append(arg_14)

        # If the queue is not cyclic, then the cessation of reading data needs to be monitored.
        if not arg_4:

            # This closure defines a background thread that waits until all processes have finished.
            # At this point, all data from the dataset has been read, and the buffer is closed.
            def monitor():
                for arg_16 in arg_12:
                    arg_16.join()
                arg_8.close()

            arg_17 = threading.Thread(target=monitor)
            arg_17.daemon = True
            arg_17.start()

        return Streamer.Queue(arg_8, arg_9, arg_5)

Get a queue that allows direct access to the internal buffer . If the dataset to be read is chunked the block_size should be a multiple of the chunk size to maximise performance . In this case it is best to leave it to the default . When cyclic = False and block_size does not divide the dataset evenly the remainder elements will not be returned by the queue . When cyclic = True the remainder elements will be part of a block that wraps around the end and includes element from the beginning of the dataset . By default blocks are returned in the order in which they become available . The ordered option will force blocks to be returned in on - disk order .


def Func(arg_0, arg_1):
        """
        Create a Func instance of a game. Note, a mode MUST be provided and MUST be of
        type GameMode.

        :param mode: <required>

        """
        arg_2 = DigitWord(wordtype=arg_1.digit_type)
        arg_2.random(arg_1.digits)

        arg_0._key = str(uuid.uuid4())
        arg_0._status = ""
        arg_0._ttl = 3600
        arg_0._answer = arg_2
        arg_0._mode = arg_1
        arg_0._guesses_remaining = arg_1.guesses_allowed
        arg_0._guesses_made = 0

Create a new instance of a game. Note, a mode MUST be provided and MUST be of
        type GameMode.

        :param mode: <required>

Create a new instance of a game . Note a mode MUST be provided and MUST be of type GameMode .


return self._authenticated_request \
            .to_endpoint('file/{}/content/secure_link/'.format(file_id)) \
            .return_body() \
            .get()['signed_url']

def
Func
(
arg_0
,
arg_1
)
:
if
not
is_valid_uuid
(
arg_1
)
:
raise
StorageArgumentException
(
'Invalid UUID for file_id: {0}'
.
format
(
arg_1
)
)
return
arg_0
.
_authenticated_request
.
to_endpoint
(
'file/{}/content/secure_link/'
.
format
(
arg_1
)
)
.
return_body
(
)
.
get
(
)
[
'signed_url'
]

def Func(arg_0, arg_1):
        '''Get a signed unauthenticated URL.

        It can be used to download the file content without the need for a
        token. The signed URL expires after 5 seconds.

        Args:
            file_id (str): The UUID of the file to get the link for.

        Returns:
            The signed url as a string

        Raises:
            StorageArgumentException: Invalid arguments
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes
        '''
        if not is_valid_uuid(arg_1):
            raise StorageArgumentException(
                'Invalid UUID for file_id: {0}'.format(arg_1))

        return arg_0._authenticated_request \
            .to_endpoint('file/{}/content/secure_link/'.format(arg_1)) \
            .return_body() \
            .get()['signed_url']


(self, store_id, customer_id, **queryparams)

return self._mc_client._get(url=self._build_path(store_id, 'customers', customer_id), **queryparams)

def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Get information about a specific customer.

        :param store_id: The store id.
        :type store_id: :py:class:`str`
        :param customer_id: The id for the customer of a store.
        :type customer_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        arg_0.store_id = arg_1
        arg_0.customer_id = arg_2
        return arg_0._mc_client._Func(url=arg_0._build_path(arg_1, 'customers', arg_2), **arg_3)

Get information about a specific customer .


def Func(arg_0):
        """
        Set all the size class masses and H20_mass in the package to zero
        and the solid_density to 1.0
        """

        arg_0.solid_density = 1.0
        arg_0.H2O_mass = 0.0
        arg_0.size_class_masses = arg_0.size_class_masses * 0.0

Set all the size class masses and H20_mass in the package to zero and the solid_density to 1 . 0


def Func(arg_0, arg_1):
    """
    Returns the offset_front_id which corresponds to the offset front which occurs
    first entirely after the given onset sample_idx.
    """
    # get all the offset_front_ids
    arg_2 = [i for i in np.unique(arg_1) if i != 0]

    arg_3 = -1
    arg_4 = sys.maxsize
    for arg_5 in arg_2:
        # get all that offset front's indexes
        arg_6 = _get_front_idxs_from_id(arg_1, arg_5)

        # get the sample indexes
        arg_7 = [s for _f, s in arg_6]

        # if each sample index is greater than onset_sample_idx, keep this offset front if it is the best one so far
        arg_8 = min(arg_7)
        if arg_8 > arg_0 and arg_8 < arg_4:
            arg_4 = arg_8
            arg_3 = arg_5

    assert arg_3 > 1 or arg_3 == -1
    return arg_3

Returns the offset_front_id which corresponds to the offset front which occurs first entirely after the given onset sample_idx .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Get item of chunk meta table"""
        arg_5 = arg_0.envs["NUM_CHK"]
        arg_6 = arg_0.envs["NUM_PU"]
        arg_7 = arg_2 * arg_6 * arg_5 + arg_3 * arg_5 + arg_4
        return arg_1[arg_7]


(self, min_time=0, max_time=ts_2100, recursive=True)

def Func ( arg_0 , arg_1 = 0 , arg_2 = arg_3 , arg_4 = True ) : def filters ( arg_5 ) : return arg_1 <= arg_5 . atime <= arg_2 return arg_0 . select_file ( filters , arg_4 )

def Func(arg_0, arg_1=0, arg_2=arg_3, arg_4=True):
        """
        Select file path by access time.

        :param min_time: lower bound timestamp
        :param max_time: upper bound timestamp

        **中文文档**

        选择所有 :attr:`pathlib_mate.pathlib2.Path.atime` 在一定范围内的文件。
        """

        def filters(arg_5): return arg_1 <= arg_5.atime <= arg_2

        return arg_0.select_file(filters, arg_4)


return Node.create(name=name, length=length, descendants=descendants, **kw)

def
Func
(
arg_0
,
arg_1
=
False
,
**
arg_2
)
:
if
arg_1
:
arg_0
=
COMMENT
.
sub
(
''
,
arg_0
)
arg_0
=
arg_0
.
strip
(
)
arg_3
=
arg_0
.
split
(
')'
)
if
len
(
arg_3
)
==
1
:
arg_4
,
arg_5
=
[
]
,
arg_0
else
:
if
not
arg_3
[
0
]
.
startswith
(
'('
)
:
raise
ValueError
(
'unmatched braces %s'
%
arg_3
[
0
]
[
:
100
]
)
arg_4
=
list
(
_parse_siblings
(
')'
.
join
(
arg_3
[
:
1
]
)
[
1
:
]
,
**
arg_2
)
)
arg_5
=
arg_3
[
1
]
arg_6
,
arg_7
=
_parse_name_and_length
(
arg_5
)
return
Node
.
create
(
arg_6
=
arg_6
,
arg_7
=
arg_7
,
arg_4
=
arg_4
,
**
arg_2
)

def Func(arg_0, arg_1=False, **arg_2):
    """
    Parse a Newick formatted string into a `Node` object.

    :param s: Newick formatted string to parse.
    :param strip_comments: Flag signaling whether to strip comments enclosed in square \
    brackets.
    :param kw: Keyword arguments are passed through to `Node.create`.
    :return: `Node` instance.
    """
    if arg_1:
        arg_0 = COMMENT.sub('', arg_0)
    arg_0 = arg_0.strip()
    arg_3 = arg_0.split(')')
    if len(arg_3) == 1:
        arg_4, arg_5 = [], arg_0
    else:
        if not arg_3[0].startswith('('):
            raise ValueError('unmatched braces %s' % arg_3[0][:100])
        arg_4 = list(_parse_siblings(')'.join(arg_3[:-1])[1:], **arg_2))
        arg_5 = arg_3[-1]
    arg_6, arg_7 = _parse_name_and_length(arg_5)
    return Node.create(arg_6=arg_6, arg_7=arg_7, arg_4=arg_4, **arg_2)

Parse a Newick formatted string into a Node object .


def Func(arg_0, arg_1):
    """Nicely format a list of line numbers.

    Format a list of line numbers for printing by coalescing groups of lines as
    long as the lines represent consecutive statements.  This will coalesce
    even if there are gaps between statements.

    For example, if `statements` is [1,2,3,4,5,10,11,12,13,14] and
    `lines` is [1,2,5,10,11,13,14] then the result will be "1-2, 5-11, 13-14".

    """
    arg_2 = []
    arg_3 = 0
    arg_4 = 0
    arg_5 = None
    arg_0 = sorted(arg_0)
    arg_1 = sorted(arg_1)
    while arg_3 < len(arg_0) and arg_4 < len(arg_1):
        if arg_0[arg_3] == arg_1[arg_4]:
            if arg_5 == None:
                arg_5 = arg_1[arg_4]
            arg_6 = arg_1[arg_4]
            arg_4 += 1
        elif arg_5:
            arg_2.append((arg_5, arg_6))
            arg_5 = None
        arg_3 += 1
    if arg_5:
        arg_2.append((arg_5, arg_6))
    arg_7 = ', '.join(map(nice_pair, arg_2))
    return arg_7


Keeps all user supplied options the same, but resets counters etc.

def Func(arg_0, arg_1=None):
        """
        Keeps all user supplied options the same, but Funcs counters etc.
        """
        arg_0._num_iter = 0
        arg_0._inner_run_counter = 0
        arg_0._J_update_counter = arg_0.update_J_frequency
        arg_0._fresh_JTJ = False
        arg_0._has_run = False
        if arg_1 is not None:
            arg_0.damping = np.array(arg_1).astype('float')
        arg_0._set_err_paramvals()

Keeps all user supplied options the same but resets counters etc .


def Func ( arg_0 ) : arg_0 . connect ( arg_0 . host , arg_0 . port ) if arg_0 . user : arg_0 . starttls ( ) arg_0 . login ( arg_0 . user , arg_0 . password )

def Func(arg_0):
        """ connects and optionally authenticates a connection."""
        arg_0.connect(arg_0.host, arg_0.port)
        if arg_0.user:
            arg_0.starttls()
            arg_0.login(arg_0.user, arg_0.password)

connects and optionally authenticates a connection .


def
Func
(
arg_0
)
:
if
'owner'
not
in
arg_0
:
raise
ConfigError
(
"A case has to have a owner"
)
if
'family'
not
in
arg_0
:
raise
ConfigError
(
"A case has to have a 'family'"
)
arg_1
=
parse_individuals
(
arg_0
[
'samples'
]
)
arg_2
=
{
'owner'
:
arg_0
[
'owner'
]
,
'collaborators'
:
[
arg_0
[
'owner'
]
]
,
'case_id'
:
arg_0
[
'family'
]
,
'display_name'
:
arg_0
.
get
(
'family_name'
,
arg_0
[
'family'
]
)
,
'genome_build'
:
arg_0
.
get
(
'human_genome_build'
)
,
'rank_model_version'
:
arg_0
.
get
(
'rank_model_version'
)
,
'rank_score_threshold'
:
arg_0
.
get
(
'rank_score_threshold'
,
0
)
,
'analysis_date'
:
arg_0
[
'analysis_date'
]
,
'individuals'
:
arg_1
,
'vcf_files'
:
{
'vcf_snv'
:
arg_0
.
get
(
'vcf_snv'
)
,
'vcf_sv'
:
arg_0
.
get
(
'vcf_sv'
)
,
'vcf_str'
:
arg_0
.
get
(
'vcf_str'
)
,
'vcf_cancer'
:
arg_0
.
get
(
'vcf_cancer'
)
,
'vcf_snv_research'
:
arg_0
.
get
(
'vcf_snv_research'
)
,
'vcf_sv_research'
:
arg_0
.
get
(
'vcf_sv_research'
)
,
'vcf_cancer_research'
:
arg_0
.
get
(
'vcf_cancer_research'
)
,
}
,
'default_panels'
:
arg_0
.
get
(
'default_gene_panels'
,
[
]
)
,
'gene_panels'
:
arg_0
.
get
(
'gene_panels'
,
[
]
)
,
'assignee'
:
arg_0
.
get
(
'assignee'
)
,
'peddy_ped'
:
arg_0
.
get
(
'peddy_ped'
)
,
'peddy_sex'
:
arg_0
.
get
(
'peddy_sex'
)
,
'peddy_check'
:
arg_0
.
get
(
'peddy_check'
)
,
'delivery_report'
:
arg_0
.
get
(
'delivery_report'
)
,
'multiqc'
:
arg_0
.
get
(
'multiqc'
)
,
'track'
:
arg_0
.
get
(
'track'
,
'rare'
)
,
}
if
'madeline'
in
arg_0
:
arg_3
=
Path
(
arg_0
[
'madeline'
]
)
if
not
arg_3
.
exists
(
)
:
raise
ValueError
(
"madeline path not found: {}"
.
format
(
arg_3
)
)
with
arg_3
.
open
(
'r'
)
as
in_handle
:
arg_2
[
'madeline_info'
]
=
in_handle
.
read
(
)
if
(
arg_2
[
'vcf_files'
]
[
'vcf_cancer'
]
or
arg_2
[
'vcf_files'
]
[
'vcf_cancer_research'
]
)
:
arg_2
[
'track'
]
=
'cancer'
return
arg_2

def Func(arg_0):
    """Parse case information from config or PED files.

    Args:
        config (dict): case config with detailed information

    Returns:
        dict: parsed case data
    """
    if 'owner' not in arg_0:
        raise ConfigError("A case has to have a owner")

    if 'family' not in arg_0:
        raise ConfigError("A case has to have a 'family'")

    arg_1 = parse_individuals(arg_0['samples'])
    arg_2 = {
        'owner': arg_0['owner'],
        'collaborators': [arg_0['owner']],
        'case_id': arg_0['family'],
        'display_name': arg_0.get('family_name', arg_0['family']),
        'genome_build': arg_0.get('human_genome_build'),
        'rank_model_version': arg_0.get('rank_model_version'),
        'rank_score_threshold': arg_0.get('rank_score_threshold', 0),
        'analysis_date': arg_0['analysis_date'],
        'individuals': arg_1,
        'vcf_files': {
            'vcf_snv': arg_0.get('vcf_snv'),
            'vcf_sv': arg_0.get('vcf_sv'),
            'vcf_str': arg_0.get('vcf_str'),
            'vcf_cancer': arg_0.get('vcf_cancer'),
            'vcf_snv_research': arg_0.get('vcf_snv_research'),
            'vcf_sv_research': arg_0.get('vcf_sv_research'),
            'vcf_cancer_research': arg_0.get('vcf_cancer_research'),
        },
        'default_panels': arg_0.get('default_gene_panels', []),
        'gene_panels': arg_0.get('gene_panels', []),
        'assignee': arg_0.get('assignee'),
        'peddy_ped': arg_0.get('peddy_ped'),
        'peddy_sex': arg_0.get('peddy_sex'),
        'peddy_check': arg_0.get('peddy_check'),
        'delivery_report': arg_0.get('delivery_report'),
        'multiqc': arg_0.get('multiqc'),
        'track': arg_0.get('track', 'rare'),
    }

    # add the pedigree figure, this is a xml file which is dumped in the db
    if 'madeline' in arg_0:
        arg_3 = Path(arg_0['madeline'])
        if not arg_3.exists():
            raise ValueError("madeline path not found: {}".format(arg_3))
        with arg_3.open('r') as in_handle:
            arg_2['madeline_info'] = in_handle.read()

    if (arg_2['vcf_files']['vcf_cancer'] or arg_2['vcf_files']['vcf_cancer_research']):
        arg_2['track'] = 'cancer'

    return arg_2

Parse case information from config or PED files .


def Func ( arg_0 , arg_1 ) : arg_2 = int ( math . ceil ( arg_0 / float ( arg_1 ) ) ) arg_3 = [ 0 ] * arg_2 for arg_4 in range ( arg_0 ) : arg_3 [ arg_4 % arg_2 ] += 1 return arg_3

def Func(arg_0, arg_1):
	"""
	Given the total number of items, determine the number of items that
	can be added to each bin with a limit on the bin size.

	So if you want to partition 11 items into groups of 3, you'll want
	three of three and one of two.

	>>> Func(11, 3)
	[3, 3, 3, 2]

	But if you only have ten items, you'll have two groups of three and
	two of two.

	>>> Func(10, 3)
	[3, 3, 2, 2]
	"""
	arg_2 = int(math.ceil(arg_0 / float(arg_1)))
	arg_3 = [0] * arg_2
	for arg_4 in range(arg_0):
		arg_3[arg_4 % arg_2] += 1
	return arg_3

Given the total number of items, determine the number of items that
	can be added to each bin with a limit on the bin size.

	So if you want to partition 11 items into groups of 3, you'll want
	three of three and one of two.

	>>> partition_items(11, 3)
	[3, 3, 3, 2]

	But if you only have ten items, you'll have two groups of three and
	two of two.

	>>> partition_items(10, 3)
	[3, 3, 2, 2]

Given the total number of items determine the number of items that can be added to each bin with a limit on the bin size .


def Func(arg_0, arg_1, arg_2, arg_3):
        """ Simple replacement for numpy Func"""
        if arg_3 == 1: return [arg_1]
        arg_4 = [0.0] * arg_3
        arg_5 = arg_3 - 1
        arg_6 = 1.0 / arg_5
        for arg_7 in range(arg_3):
            arg_4[arg_7] = arg_6 * (arg_1*(arg_5 - arg_7) + arg_2*arg_7)
        return arg_4


def Func ( arg_0 , arg_1 = 10 ) : arg_2 , arg_3 = arg_0 . keys ( ) , arg_0 . values ( ) arg_4 = zip ( arg_3 , arg_2 ) arg_4 . sort ( reverse = True ) for ( arg_5 , arg_6 ) in arg_4 [ : arg_1 ] : print ( arg_6 , arg_5 )

def Func(arg_0, arg_1=10):
    """Print the n most common words and counts in the freqs dict."""

    arg_2, arg_3 = arg_0.keys(), arg_0.values()
    arg_4 = zip(arg_3, arg_2)
    arg_4.sort(reverse=True)
    for (arg_5, arg_6) in arg_4[:arg_1]:
        print(arg_6, arg_5)

Print the n most common words and counts in the freqs dict .


(self, images, save=None, round=4, names=None, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = 4 , arg_4 = None , ** arg_5 ) : if isinstance ( arg_1 , string_types ) : arg_1 = [ arg_1 ] if isinstance ( arg_1 , list ) : arg_6 = imageutils . load_imgs ( arg_1 , arg_0 . masker ) else : arg_6 = arg_1 arg_7 = { 'pearson' : arg_0 . _pearson_correlation , 'dot' : arg_0 . _dot_product , 'roi' : arg_0 . _roi_association } arg_8 = np . around ( arg_7 [ arg_0 . method ] ( arg_6 , ** arg_5 ) , arg_3 ) if arg_4 is None : if type ( arg_1 ) . __module__ == np . __name__ : arg_4 = [ 'image_%d' % i for i in range ( arg_1 . shape [ 1 ] ) ] elif arg_0 . method == 'roi' : arg_4 = [ 'cluster_%d' % i for i in range ( arg_8 . shape [ 1 ] ) ] else : arg_4 = arg_1 arg_8 = pd . DataFrame ( arg_8 , columns = arg_4 , index = arg_0 . feature_names ) if arg_2 is not None : arg_8 . to_csv ( arg_2 , index_label = 'Feature' ) return arg_8

def Func(arg_0, arg_1, arg_2=None, arg_3=4, arg_4=None, **arg_5):
        """ Decodes a set of images.

        Args:
          images: The images to Func. Can be:
            - A single String specifying the filename of the image to Func
            - A list of filenames
            - A single NumPy array containing the image data
          save: Optional filename to save results to. If None (default), returns
            all results as an array.
          round: Optional integer indicating number of decimals to round result
            to. Defaults to 4.
          names: Optional list of names corresponding to the images in filenames.
            If passed, must be of same length and in same order as filenames.
            By default, the columns in the output will be named using the image
            filenames.

        Returns:
          An n_features x n_files numpy array, where each feature is a row and
          each image is a column. The meaning of the values depends on the
          decoding method used. """

        if isinstance(arg_1, string_types):
            arg_1 = [arg_1]

        if isinstance(arg_1, list):
            arg_6 = imageutils.load_imgs(arg_1, arg_0.masker)
        else:
            arg_6 = arg_1

        arg_7 = {
            'pearson': arg_0._pearson_correlation,
            'dot': arg_0._dot_product,
            'roi': arg_0._roi_association
        }

        arg_8 = np.around(
            arg_7[arg_0.method](arg_6, **arg_5), arg_3)

        # if save is not None:

        if arg_4 is None:
            if type(arg_1).__module__ == np.__name__:
                arg_4 = ['image_%d' % i for i in range(arg_1.shape[1])]
            elif arg_0.method == 'roi':
                arg_4 = ['cluster_%d' % i for i in range(arg_8.shape[1])]
            else:
                arg_4 = arg_1

        arg_8 = pd.DataFrame(arg_8, columns=arg_4, index=arg_0.feature_names)

        if arg_2 is not None:
            arg_8.to_csv(arg_2, index_label='Feature')
        return arg_8

Decodes a set of images.

        Args:
          images: The images to decode. Can be:
            - A single String specifying the filename of the image to decode
            - A list of filenames
            - A single NumPy array containing the image data
          save: Optional filename to save results to. If None (default), returns
            all results as an array.
          round: Optional integer indicating number of decimals to round result
            to. Defaults to 4.
          names: Optional list of names corresponding to the images in filenames.
            If passed, must be of same length and in same order as filenames.
            By default, the columns in the output will be named using the image
            filenames.

        Returns:
          An n_features x n_files numpy array, where each feature is a row and
          each image is a column. The meaning of the values depends on the
          decoding method used.


def Func ( arg_0 , arg_1 ) : arg_2 = object . __new__ ( arg_0 ) super ( PreviousValueModel , arg_2 ) . __init__ ( arg_1 = arg_1 . modelBase ) arg_2 . _logger = opf_utils . initLogger ( arg_2 ) if len ( arg_1 . predictedField ) : arg_2 . _predictedField = arg_1 . predictedField else : arg_2 . _predictedField = None arg_2 . _fieldNames = list ( arg_1 . fieldNames ) arg_2 . _fieldTypes = list ( arg_1 . fieldTypes ) arg_2 . _predictionSteps = list ( arg_1 . predictionSteps ) return arg_2

def Func(arg_0, arg_1):
    """Deserialize via capnp

    :param proto: capnp PreviousValueModelProto message Funcer

    :returns: new instance of PreviousValueModel deserialized from the given
              proto
    """
    arg_2 = object.__new__(arg_0)
    super(PreviousValueModel, arg_2).__init__(arg_1=arg_1.modelBase)

    arg_2._logger = opf_utils.initLogger(arg_2)
    if len(arg_1.predictedField):
      arg_2._predictedField = arg_1.predictedField
    else:
      arg_2._predictedField = None
    arg_2._fieldNames = list(arg_1.fieldNames)
    arg_2._fieldTypes = list(arg_1.fieldTypes)
    arg_2._predictionSteps = list(arg_1.predictionSteps)

    return arg_2

Deserialize via capnp

    :param proto: capnp PreviousValueModelProto message reader

    :returns: new instance of PreviousValueModel deserialized from the given
              proto


def Func ( arg_0 , * arg_1 ) : Func = [ ] for arg_3 in arg_0 . _multi_graph . nodes ( ) : if arg_3 . type == 'op' and arg_3 . op . name in arg_1 : Func . append ( arg_3 ) return Func

def Func(arg_0, *arg_1):
        """Get the set of "op" nodes with the given name."""
        Func = []
        for arg_3 in arg_0._multi_graph.nodes():
            if arg_3.type == 'op' and arg_3.op.name in arg_1:
                Func.append(arg_3)
        return Func

Get the set of op nodes with the given name .


def Func(arg_0):
    """
    Validate that a particular image size.
    """
    arg_1 = get_app_config()
    arg_2 = arg_1.valid_max_image_size * 1024
    if arg_1 and not arg_0.size <= arg_2:
        raise ValidationError(
            _("The logo image file size must be less than or equal to %s KB.") % arg_1.valid_max_image_size)


def Func ( arg_0 , arg_1 ) : arg_2 = False arg_3 = True while not arg_2 : for arg_4 in range ( 6 , 0 , - 1 ) : if arg_1 [ - arg_4 : ] in arg_0 . _rule_table [ arg_4 ] : accept = False if len ( arg_0 . _rule_table [ arg_4 ] [ arg_1 [ - arg_4 : ] ] ) < 4 : for rule in arg_0 . _rule_table [ arg_4 ] [ arg_1 [ - arg_4 : ] ] : ( arg_1 , accept , arg_3 , arg_2 , ) = arg_0 . _apply_rule ( arg_1 , rule , arg_3 , arg_2 ) if accept : break else : rule = arg_0 . _rule_table [ arg_4 ] [ arg_1 [ - arg_4 : ] ] ( arg_1 , accept , arg_3 , arg_2 ) = arg_0 . _apply_rule ( arg_1 , rule , arg_3 , arg_2 ) if accept : break else : break return arg_1

def Func(arg_0, arg_1):
        """Return Paice-Husk Func.

        Parameters
        ----------
        word : str
            The word to Func

        Returns
        -------
        str
            Word Func

        Examples
        --------
        >>> stmr = PaiceHusk()
        >>> stmr.Func('assumption')
        'assum'
        >>> stmr.Func('verifiable')
        'ver'
        >>> stmr.Func('fancies')
        'fant'
        >>> stmr.Func('fanciful')
        'fancy'
        >>> stmr.Func('torment')
        'tor'

        """
        arg_2 = False
        arg_3 = True
        while not arg_2:
            for arg_4 in range(6, 0, -1):
                if arg_1[-arg_4:] in arg_0._rule_table[arg_4]:
                    accept = False
                    if len(arg_0._rule_table[arg_4][arg_1[-arg_4:]]) < 4:
                        for rule in arg_0._rule_table[arg_4][arg_1[-arg_4:]]:
                            (
                                arg_1,
                                accept,
                                arg_3,
                                arg_2,
                            ) = arg_0._apply_rule(arg_1, rule, arg_3, arg_2)
                            if accept:
                                break
                    else:
                        rule = arg_0._rule_table[arg_4][arg_1[-arg_4:]]
                        (arg_1, accept, arg_3, arg_2) = arg_0._apply_rule(
                            arg_1, rule, arg_3, arg_2
                        )

                    if accept:
                        break
            else:
                break

        return arg_1

Return Paice-Husk stem.

        Parameters
        ----------
        word : str
            The word to stem

        Returns
        -------
        str
            Word stem

        Examples
        --------
        >>> stmr = PaiceHusk()
        >>> stmr.stem('assumption')
        'assum'
        >>> stmr.stem('verifiable')
        'ver'
        >>> stmr.stem('fancies')
        'fant'
        >>> stmr.stem('fanciful')
        'fancy'
        >>> stmr.stem('torment')
        'tor'


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
verboseRead
(
BoolCode
(
'UNCMPR'
,
description
=
'Is Func?'
)
)
if
arg_1
:
arg_0
.
verboseRead
(
FillerAlphabet
(
streamPos
=
arg_0
.
stream
.
pos
)
)
print
(
'Uncompressed data:'
)
arg_0
.
output
+=
arg_0
.
stream
.
readBytes
(
arg_0
.
MLEN
)
print
(
outputFormatter
(
arg_0
.
output
[
arg_0
.
MLEN
:
]
)
)
return
arg_1

def Func(arg_0):
        """If true, handle Func data
        """
        arg_1 = arg_0.verboseRead(
            BoolCode('UNCMPR', description='Is Func?'))
        if arg_1:
            arg_0.verboseRead(FillerAlphabet(streamPos=arg_0.stream.pos))
            print('Uncompressed data:')
            arg_0.output += arg_0.stream.readBytes(arg_0.MLEN)
            print(outputFormatter(arg_0.output[-arg_0.MLEN:]))
        return arg_1


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _validate ( arg_2 ) arg_3 = [ ] arg_4 = time . time ( ) for arg_5 in arg_2 . experiments : arg_3 . append ( arg_0 . run_experiment ( arg_5 ) ) arg_6 = time . time ( ) arg_7 = { 'backend_name' : arg_0 . name ( ) , 'backend_version' : arg_0 . _configuration . backend_version , 'qobj_id' : arg_2 . qobj_id , 'job_id' : arg_1 , 'results' : arg_3 , 'status' : 'COMPLETED' , 'success' : True , 'time_taken' : ( arg_6 - arg_4 ) , 'header' : arg_2 . header . as_dict ( ) } return Result . from_dict ( arg_7 )

def Func(arg_0, arg_1, arg_2):
        """Run experiments in qobj.

        Args:
            job_id (str): unique id for the job.
            qobj (Qobj): job description

        Returns:
            Result: Result object
        """
        arg_0._validate(arg_2)
        arg_3 = []
        arg_4 = time.time()
        for arg_5 in arg_2.experiments:
            arg_3.append(arg_0.run_experiment(arg_5))
        arg_6 = time.time()
        arg_7 = {'backend_name': arg_0.name(),
                  'backend_version': arg_0._configuration.backend_version,
                  'qobj_id': arg_2.qobj_id,
                  'job_id': arg_1,
                  'results': arg_3,
                  'status': 'COMPLETED',
                  'success': True,
                  'time_taken': (arg_6 - arg_4),
                  'header': arg_2.header.as_dict()}

        return Result.from_dict(arg_7)


def Func(arg_0, **arg_1):
        """
        Get a list of recommended movies for a movie.

        Args:
            language: (optional) ISO 639-1 code.
            page: (optional) Minimum value of 1.  Expected value is an integer.

        Returns:
            A dict representation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_id_path('Func')

        arg_3 = arg_0._GET(arg_2, arg_1)
        arg_0._set_attrs_to_values(arg_3)
        return arg_3

Get a list of recommended movies for a movie .


def Func ( arg_0 , * arg_1 ) : from ubelt import util_path arg_2 = get_app_config_dir ( arg_0 , * arg_1 ) util_path . ensuredir ( arg_2 ) return arg_2

def Func(arg_0, *arg_1):
    """
    Calls `get_app_config_dir` but ensures the directory exists.

    Args:
        appname (str): the name of the application
        *args: any other subdirectories may be specified

    SeeAlso:
        get_app_config_dir

    Example:
        >>> import ubelt as ub
        >>> dpath = ub.Func('ubelt')
        >>> assert exists(dpath)
    """
    from ubelt import util_path
    arg_2 = get_app_config_dir(arg_0, *arg_1)
    util_path.ensuredir(arg_2)
    return arg_2

Calls `get_app_config_dir` but ensures the directory exists.

    Args:
        appname (str): the name of the application
        *args: any other subdirectories may be specified

    SeeAlso:
        get_app_config_dir

    Example:
        >>> import ubelt as ub
        >>> dpath = ub.ensure_app_config_dir('ubelt')
        >>> assert exists(dpath)

Calls get_app_config_dir but ensures the directory exists .


(self, validity_check=True, no_neighbors=False, **kwargs)

def Func ( arg_0 , arg_1 = True , arg_2 = False , ** arg_3 ) : if arg_2 : raise NotImplementedError ( ) return arg_0 . _from_cache ( arg_1 = arg_1 )

def Func(arg_0, arg_1=True, arg_2=False, **arg_3):
        """
        Read data from process output.

        Parameters
        ----------
        validity_check : bool
            run geometry validity check (default: True)
        no_neighbors : bool
            don't include neighbor tiles if there is a pixelbuffer (default:
            False)

        Returns
        -------
        features : list
            GeoJSON-like list of features
        """
        if arg_2:
            raise NotImplementedError()
        return arg_0._from_cache(arg_1=arg_1)


def Func ( arg_0 , arg_1 ) : if not arg_1 . initialized : return arg_2 = arg_0 . _request_graph ( arg_1 . ui . control ) if arg_2 is None : return arg_3 = len ( arg_2 . nodes ) arg_4 = [ v . ID for v in arg_2 . nodes ] if arg_3 == 0 : arg_5 = Node ( ID = make_unique_name ( "node" , arg_4 ) ) arg_6 = make_unique_name ( "node" , arg_4 + [ arg_5 . ID ] ) arg_7 = Node ( ID = arg_6 ) elif arg_3 == 1 : arg_5 = arg_2 . nodes [ 0 ] arg_7 = Node ( ID = make_unique_name ( "node" , arg_4 ) ) else : arg_5 = arg_2 . nodes [ 0 ] arg_7 = arg_2 . nodes [ 1 ] arg_8 = Edge ( arg_5 , arg_7 , _nodes = arg_2 . nodes ) arg_9 = arg_8 . edit_traits ( parent = arg_1 . ui . control , kind = "livemodal" ) if arg_9 . result : arg_2 . edges . append ( arg_8 )

def Func(arg_0, arg_1):
        """ Handles adding an Edge to the graph.
        """
        if not arg_1.initialized:
            return

        arg_2 = arg_0._request_graph(arg_1.ui.control)

        if arg_2 is None:
            return

        arg_3 = len(arg_2.nodes)
        arg_4 = [v.ID for v in arg_2.nodes]

        if arg_3 == 0:
            arg_5 = Node(ID=make_unique_name("node", arg_4))
            arg_6 = make_unique_name("node", arg_4 + [arg_5.ID])
            arg_7 = Node(ID=arg_6)
        elif arg_3 == 1:
            arg_5 = arg_2.nodes[0]
            arg_7 = Node(ID=make_unique_name("node", arg_4))
        else:
            arg_5 = arg_2.nodes[0]
            arg_7 = arg_2.nodes[1]

        arg_8 = Edge(arg_5, arg_7, _nodes=arg_2.nodes)

        arg_9 = arg_8.edit_traits(parent=arg_1.ui.control, kind="livemodal")

        if arg_9.result:
            arg_2.edges.append(arg_8)


(mdict, nlocus, dirs, mcmc_burnin, mcmc_ngen, mcmc_sample_freq)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
arg_6
=
max
(
[
len
(
arg_9
)
for
arg_9
in
arg_0
]
)
arg_7
=
"{:<"
+
str
(
arg_6
+
1
)
+
"} {}\n"
arg_8
=
""
for
arg_9
in
arg_0
.
items
(
)
:
arg_8
+=
arg_7
.
format
(
arg_9
[
0
]
,
arg_9
[
1
]
)
arg_10
=
os
.
path
.
join
(
arg_2
,
"{}.nex"
.
format
(
arg_1
)
)
with
open
(
arg_10
,
'w'
)
as
outnex
:
outnex
.
write
(
NEXBLOCK
.
format
(
**
{
"ntax"
:
len
(
arg_0
)
,
"nchar"
:
len
(
arg_0
.
values
(
)
[
0
]
)
,
"matrix"
:
arg_8
,
"ngen"
:
arg_4
,
"sfreq"
:
arg_5
,
"burnin"
:
arg_3
,
}
)
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """
    function that takes a dictionary mapping names to
    sequences, and a locus number, and writes it as a NEXUS
    file with a mrbayes analysis block.
    """
    ## create matrix as a string
    arg_6 = max([len(arg_9) for arg_9 in arg_0])
    arg_7 = "{:<" + str(arg_6+1) + "} {}\n"
    arg_8 = ""
    for arg_9 in arg_0.items():
        arg_8 += arg_7.format(arg_9[0], arg_9[1])

    ## write nexus block
    arg_10 = os.path.join(arg_2, "{}.nex".format(arg_1))
    with open(arg_10, 'w') as outnex:
        outnex.write(NEXBLOCK.format(**{
            "ntax": len(arg_0),
            "nchar": len(arg_0.values()[0]),
            "matrix": arg_8,
            "ngen": arg_4,
            "sfreq": arg_5,
            "burnin": arg_3,
            }))

function that takes a dictionary mapping names to sequences and a locus number and writes it as a NEXUS file with a mrbayes analysis block .


def Func ( arg_0 , arg_1 = None ) : arg_2 = encode_xml ( arg_0 , arg_1 ) return etree . tostring ( arg_2 )

def Func(arg_0, arg_1=None):
    """ Encodes an OpenMath element into a string.

    :param obj: Object to encode as string.
    :type obj: OMAny

    :rtype: bytes
    """

    arg_2 = encode_xml(arg_0, arg_1)
    return etree.tostring(arg_2)

Encodes an OpenMath element into a string .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 : if hasattr ( arg_3 , '_update_callbacks' ) : for arg_4 in arg_3 . traverse ( lambda x : x ) : arg_4 . comm = arg_0 . server_comm for arg_6 in arg_4 . callbacks : for arg_7 in arg_6 . callbacks : arg_7 . code = arg_7 . code . replace ( arg_3 . id , arg_0 . plot_id ) arg_3 = arg_3 . state arg_2 . append ( arg_3 ) return arg_2

def Func(arg_0, arg_1):
    """
    Temporary fix to patch HoloViews plot comms
    """
    arg_2 = []
    for arg_3 in arg_1:
        if hasattr(arg_3, '_update_callbacks'):
            for arg_4 in arg_3.traverse(lambda x: x):
                arg_4.comm = arg_0.server_comm
                for arg_6 in arg_4.callbacks:
                    for arg_7 in arg_6.callbacks:
                        arg_7.code = arg_7.code.replace(arg_3.id, arg_0.plot_id)
            arg_3 = arg_3.state
        arg_2.append(arg_3)
    return arg_2


def
Func
(
arg_0
)
:
try
:
arg_1
=
varint
.
encode
(
NAME_TABLE
[
arg_0
]
)
except
KeyError
:
raise
ValueError
(
'{} multicodec is not supported.'
.
format
(
arg_0
)
)
return
arg_1

def Func(arg_0):
    """
    Returns prefix for a given multicodec

    :param str multicodec: multicodec codec name
    :return: the prefix for the given multicodec
    :rtype: byte
    :raises ValueError: if an invalid multicodec name is provided
    """
    try:
        arg_1 = varint.encode(NAME_TABLE[arg_0])
    except KeyError:
        raise ValueError('{} multicodec is not supported.'.format(arg_0))
    return arg_1


(self, projection_matrix=None, camera_matrix=None, time=0)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=0):
        """
        Draw all the nodes in the scene

        :param projection_matrix: projection matrix (bytes)
        :param camera_matrix: camera_matrix (bytes)
        :param time: The current time
        """
        arg_1 = arg_1.astype('f4').tobytes()
        arg_2 = arg_2.astype('f4').tobytes()

        for arg_4 in arg_0.root_nodes:
            arg_4.Func(
                arg_1=arg_1,
                arg_2=arg_2,
                arg_3=arg_3,
            )

        arg_0.ctx.clear_samplers(0, 4)


(lcbasedir,
                      objectid,
                      aperture='TF1',
                      postfix='.gz',
                      sortby='rjd',
                      normalize=True,
                      outdir=None,
                      recursive=True)

def Func ( arg_0 , arg_1 , arg_2 = 'TF1' , arg_3 = '.gz' , arg_4 = 'rjd' , arg_5 = True , arg_6 = None , arg_7 = True ) : arg_8 = concatenate_textlcs_for_objectid ( arg_0 , arg_1 , arg_2 = arg_2 , arg_4 = arg_4 , arg_5 = arg_5 , arg_7 = arg_7 ) if not arg_6 : arg_6 = 'pklcs' if not os . path . exists ( arg_6 ) : os . mkdir ( arg_6 ) arg_9 = os . path . join ( arg_6 , '%s-%s-pklc.pkl' % ( arg_8 [ 'objectid' ] , arg_2 ) ) arg_10 = lcdict_to_pickle ( arg_8 , outfile = arg_9 ) return arg_10

def Func(arg_0,
                      arg_1,
                      arg_2='TF1',
                      arg_3='.gz',
                      arg_4='rjd',
                      arg_5=True,
                      arg_6=None,
                      arg_7=True):
    '''This concatenates all text LCs for the given object and writes to a pklc.

    Basically a rollup for the concatenate_textlcs_for_objectid and
    lcdict_to_pickle functions.

    '''

    arg_8 = concatenate_textlcs_for_objectid(arg_0,
                                                 arg_1,
                                                 arg_2=arg_2,
                                                 arg_4=arg_4,
                                                 arg_5=arg_5,
                                                 arg_7=arg_7)

    if not arg_6:
        arg_6 = 'pklcs'

    if not os.path.exists(arg_6):
        os.mkdir(arg_6)

    arg_9 = os.path.join(arg_6, '%s-%s-pklc.pkl' % (arg_8['objectid'],
                                                        arg_2))
    arg_10 = lcdict_to_pickle(arg_8, outfile=arg_9)
    return arg_10

This concatenates all text LCs for the given object and writes to a pklc .


(times: np.ndarray, amp: complex, period: float, phase: float = 0)

return amp*(2*(2*np.floor(x) - np.floor(2*x)) + 1).astype(np.complex_)

def Func(arg_0: arg_1.ndarray, arg_3: arg_4, arg_5: arg_6, arg_7: arg_6 = 0) -> arg_1.ndarray:
    """Continuous Func wave.

    Args:
        times: Times to output wave for.
        amp: Pulse amplitude. Wave range is [-amp, amp].
        period: Pulse period, units of dt.
        phase: Pulse phase.
    """
    arg_8 = arg_0/arg_5+arg_7/arg_1.pi
    return arg_3*(2*(2*arg_1.floor(arg_8) - arg_1.floor(2*arg_8)) + 1).astype(arg_1.complex_)

Continuous square wave.

    Args:
        times: Times to output wave for.
        amp: Pulse amplitude. Wave range is [-amp, amp].
        period: Pulse period, units of dt.
        phase: Pulse phase.


return {'volume': int(nad_status[0][-2:], 16),
                'power': nad_status[1][-2:] == '01',
                'muted': nad_status[2][-2:] == '01',
                'source': self.SOURCES_REVERSED[nad_status[3][-2:]]}

def Func ( arg_0 ) : arg_1 = arg_0 . _send ( arg_0 . POLL_VOLUME + arg_0 . POLL_POWER + arg_0 . POLL_MUTED + arg_0 . POLL_SOURCE , read_reply = True ) if arg_1 is None : return arg_2 = 10 arg_3 = [ arg_1 [ i : i + arg_2 ] for i in range ( 0 , len ( arg_1 ) , arg_2 ) ] return { 'volume' : int ( arg_3 [ 0 ] [ - 2 : ] , 16 ) , 'power' : arg_3 [ 1 ] [ - 2 : ] == '01' , 'muted' : arg_3 [ 2 ] [ - 2 : ] == '01' , 'source' : arg_0 . SOURCES_REVERSED [ arg_3 [ 3 ] [ - 2 : ] ] }

def Func(arg_0):
        """
        Return the Func of the device.

        Returns a dictionary with keys 'volume' (int 0-200) , 'power' (bool),
         'muted' (bool) and 'source' (str).
        """
        arg_1 = arg_0._send(arg_0.POLL_VOLUME +
                               arg_0.POLL_POWER +
                               arg_0.POLL_MUTED +
                               arg_0.POLL_SOURCE, read_reply=True)
        if arg_1 is None:
            return

        # split reply into parts of 10 characters
        arg_2 = 10
        arg_3 = [arg_1[i:i + arg_2]
                      for i in range(0, len(arg_1), arg_2)]

        return {'volume': int(arg_3[0][-2:], 16),
                'power': arg_3[1][-2:] == '01',
                'muted': arg_3[2][-2:] == '01',
                'source': arg_0.SOURCES_REVERSED[arg_3[3][-2:]]}

Return the status of the device.

        Returns a dictionary with keys 'volume' (int 0-200) , 'power' (bool),
         'muted' (bool) and 'source' (str).


(self,
                   frame_dir,
                   file_start=0,
                   filename_tmpl='{:06d}.jpg',
                   start=0,
                   max_num=0,
                   show_progress=True)

def Func(arg_0,
                   arg_1,
                   arg_2=0,
                   arg_3='{:06d}.jpg',
                   arg_4=0,
                   arg_5=0,
                   arg_6=True):
        """Convert a video to frame images

        Args:
            frame_dir (str): Output directory to store all the frame images.
            file_start (int): Filenames will start from the specified number.
            filename_tmpl (str): Filename template with the index as the
                placeholder.
            start (int): The starting frame index.
            max_num (int): Maximum number of frames to be written.
            show_progress (bool): Whether to show a progress bar.
        """
        mkdir_or_exist(arg_1)
        if arg_5 == 0:
            arg_7 = arg_0.frame_cnt - arg_4
        else:
            arg_7 = min(arg_0.frame_cnt - arg_4, arg_5)
        if arg_7 <= 0:
            raise ValueError('start must be less than total frame number')
        if arg_4 > 0:
            arg_0._set_real_position(arg_4)

        def write_frame(arg_8):
            arg_9 = arg_0.read()
            arg_10 = osp.join(arg_1, arg_3.format(arg_8))
            cv2.imwrite(arg_10, arg_9)

        if arg_6:
            track_progress(write_frame, range(arg_2,
                                              arg_2 + arg_7))
        else:
            for arg_11 in range(arg_7):
                arg_9 = arg_0.read()
                if arg_9 is None:
                    break
                arg_10 = osp.join(arg_1,
                                    arg_3.format(arg_11 + arg_2))
                cv2.imwrite(arg_10, arg_9)


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = { } for arg_4 , arg_5 in arg_1 . iteritems ( ) : if isinstance ( arg_5 , dict ) : arg_3 [ arg_4 ] = CompositeFilter ( arg_5 ) else : arg_3 [ arg_4 ] = lambda o : o == arg_5 for arg_6 in arg_0 . _records . itervalues ( ) : if arg_0 . Func_one ( arg_6 , arg_3 ) : arg_2 . append ( copy ( arg_6 ) ) return arg_2

def Func(arg_0, arg_1):
        """Find all the matches for a check dict."""
        arg_2 = []
        arg_3 = {}
        for arg_4,arg_5 in arg_1.iteritems():
            if isinstance(arg_5, dict):
                arg_3[arg_4] = CompositeFilter(arg_5)
            else:
                arg_3[arg_4] = lambda o: o==arg_5

        for arg_6 in arg_0._records.itervalues():
            if arg_0.Func_one(arg_6, arg_3):
                arg_2.append(copy(arg_6))
        return arg_2


return dt if dt.tzinfo else dt.replace(tzinfo=timezone.utc)

def Func ( arg_0 ) : return arg_0 if arg_0 . tzinfo else arg_0 . replace ( tzinfo = timezone . utc )

def Func(arg_0):
    """Appends tzinfo and assumes UTC, if datetime object has no tzinfo already."""
    return arg_0 if arg_0.tzinfo else arg_0.replace(tzinfo=timezone.utc)

Appends tzinfo and assumes UTC if datetime object has no tzinfo already .


def Func ( arg_0 , arg_1 ) : if arg_1 not in arg_0 . _Func : arg_0 . _Func . append ( arg_1 )

def Func(arg_0, arg_1):
        """Exempt a view function from being checked permission

        :param resource: The view function Func from checking.
        """
        if arg_1 not in arg_0._Func:
            arg_0._Func.append(arg_1)

Exempt a view function from being checked permission

        :param resource: The view function exempt from checking.