def Func ( arg_0 , arg_1 = False ) : if not arg_0 . is_running ( ) : arg_2 = arg_0 . _platform_impl . _process_name raise NoSuchProcess ( arg_0 . pid , arg_2 ) arg_3 = [ ] if not arg_1 : for arg_4 in process_iter ( ) : try : if arg_4 . ppid == arg_0 . pid : if arg_0 . create_time <= arg_4 . create_time : arg_3 . append ( arg_4 ) except NoSuchProcess : pass else : arg_5 = defaultdict ( list ) for arg_4 in process_iter ( ) : try : arg_5 [ arg_4 . ppid ] . append ( arg_4 ) except NoSuchProcess : pass arg_6 = [ arg_0 . pid ] for arg_7 in arg_6 : for arg_8 in arg_5 [ arg_7 ] : try : arg_9 = arg_0 . create_time <= arg_8 . create_time except NoSuchProcess : pass else : if arg_9 : arg_3 . append ( arg_8 ) if arg_8 . pid not in arg_6 : arg_6 . append ( arg_8 . pid ) return arg_3

def Func(arg_0, arg_1=False):
        """Return the children of this process as a list of Process
        objects.
        If recursive is True return all the parent descendants.

        Example (A == this process):

         A ─┐
            │
            ├─ B (child) ─┐
            │             └─ X (grandchild) ─┐
            │                                └─ Y (great grandchild)
            ├─ C (child)
            └─ D (child)

        >>> p.Func()
        B, C, D
        >>> p.Func(recursive=True)
        B, X, Y, C, D

        Note that in the example above if process X disappears
        process Y won't be returned either as the reference to
        process A is lost.
        """
        if not arg_0.is_running():
            arg_2 = arg_0._platform_impl._process_name
            raise NoSuchProcess(arg_0.pid, arg_2)

        arg_3 = []
        if not arg_1:
            for arg_4 in process_iter():
                try:
                    if arg_4.ppid == arg_0.pid:
                        # if child happens to be older than its parent
                        # (self) it means child's PID has been reused
                        if arg_0.create_time <= arg_4.create_time:
                            arg_3.append(arg_4)
                except NoSuchProcess:
                    pass
        else:
            # construct a dict where 'values' are all the processes
            # having 'key' as their parent
            arg_5 = defaultdict(list)
            for arg_4 in process_iter():
                try:
                    arg_5[arg_4.ppid].append(arg_4)
                except NoSuchProcess:
                    pass
            # At this point we have a mapping table where table[self.pid]
            # are the current process's children.
            # Below, we look for all descendants recursively, similarly
            # to a recursive function call.
            arg_6 = [arg_0.pid]
            for arg_7 in arg_6:
                for arg_8 in arg_5[arg_7]:
                    try:
                        # if child happens to be older than its parent
                        # (self) it means child's PID has been reused
                        arg_9 = arg_0.create_time <= arg_8.create_time
                    except NoSuchProcess:
                        pass
                    else:
                        if arg_9:
                            arg_3.append(arg_8)
                            if arg_8.pid not in arg_6:
                                arg_6.append(arg_8.pid)
        return arg_3

Return the children of this process as a list of Process
        objects.
        If recursive is True return all the parent descendants.

        Example (A == this process):

         A ─┐
            │
            ├─ B (child) ─┐
            │             └─ X (grandchild) ─┐
            │                                └─ Y (great grandchild)
            ├─ C (child)
            └─ D (child)

        >>> p.get_children()
        B, C, D
        >>> p.get_children(recursive=True)
        B, X, Y, C, D

        Note that in the example above if process X disappears
        process Y won't be returned either as the reference to
        process A is lost.

Return the children of this process as a list of Process objects . If recursive is True return all the parent descendants .


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

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

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


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_1 is None : arg_1 = [ kp . Func ( ) for kp in arg_0 . keypoints ] if arg_2 is None : arg_2 = tuple ( arg_0 . shape ) return KeypointsOnImage ( arg_1 , arg_2 )

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Create a deep copy of the KeypointsOnImage object.

        Parameters
        ----------
        keypoints : None or list of imgaug.Keypoint, optional
            List of keypoints on the image. If ``None``, the instance's
            keypoints will be copied.

        shape : tuple of int, optional
            The shape of the image on which the keypoints are placed.
            If ``None``, the instance's shape will be copied.

        Returns
        -------
        imgaug.KeypointsOnImage
            Deep copy.

        """
        # for some reason Func is way slower here than manual copy
        if arg_1 is None:
            arg_1 = [kp.Func() for kp in arg_0.keypoints]
        if arg_2 is None:
            arg_2 = tuple(arg_0.shape)
        return KeypointsOnImage(arg_1, arg_2)

Create a deep copy of the KeypointsOnImage object .


def Func(arg_0, arg_1=None, arg_2=None):
        """
        Drops all views.
        """
        arg_3 = arg_0.database_renderer
        arg_4 = arg_3.sudo("mysql --batch -v -h {db_host} "
            #"-u {db_root_username} -p'{db_root_password}' "
            "-u {db_user} -p'{db_password}' "
            "--execute=\"SELECT GROUP_CONCAT(CONCAT(TABLE_SCHEMA,'.',table_name) SEPARATOR ', ') AS views "
            "FROM INFORMATION_SCHEMA.views WHERE TABLE_SCHEMA = '{db_name}' ORDER BY table_name DESC;\"")
        arg_4 = re.findall(
            r'^views[\s\t\r\n]+(.*)',
            arg_4,
            flags=re.IGNORECASE|re.DOTALL|re.MULTILINE)
        if not arg_4:
            return
        arg_3.env.db_view_list = arg_4[0]
        #cmd = ("mysql -v -h {db_host} -u {db_root_username} -p'{db_root_password}' " \
        arg_3.sudo("mysql -v -h {db_host} -u {db_user} -p'{db_password}' " \
            "--execute=\"DROP VIEW {db_view_list} CASCADE;\"")


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : if arg_2 in arg_0 . _vowels : return True return False

def Func(arg_0, arg_1):
        """Return Porter helper function Func value.

        Parameters
        ----------
        term : str
            The term to examine

        Returns
        -------
        bool
            True iff a vowel exists in the term (as defined in the Porter
            stemmer definition)

        """
        for arg_2 in arg_1:
            if arg_2 in arg_0._vowels:
                return True
        return False

Return Porter helper function _sb_has_vowel value.

        Parameters
        ----------
        term : str
            The term to examine

        Returns
        -------
        bool
            True iff a vowel exists in the term (as defined in the Porter
            stemmer definition)

Return Porter helper function _sb_has_vowel value .


def Func ( arg_0 : arg_1 ) -> llist . List : arg_2 = arg_0 . reader . advance ( ) assert arg_2 == "'" arg_3 = _read_next_consuming_comment ( arg_0 ) return llist . l ( _QUOTE , arg_3 )

def Func(arg_0: arg_1) -> llist.List:
    """Read a quoted form from the input stream."""
    arg_2 = arg_0.reader.advance()
    assert arg_2 == "'"
    arg_3 = _read_next_consuming_comment(arg_0)
    return llist.l(_QUOTE, arg_3)

Read a quoted form from the input stream .


def Func(arg_0):
    """
    Ensure the user making the API request is associated with an EnterpriseCustomer.

    This decorator attempts to find an EnterpriseCustomer associated with the requesting
    user and passes that EnterpriseCustomer to the view as a parameter. It will return a
    PermissionDenied error if an EnterpriseCustomer cannot be found.

    Usage::
        @Func()
        def my_view(request, enterprise_customer):
            # Some functionality ...

        OR

        class MyView(View):
            ...
            @method_decorator(Func)
            def get(self, request, enterprise_customer):
                # Some functionality ...
    """
    @wraps(arg_0)
    def wrapper(arg_1, *arg_2, **arg_3):
        """
        Checks for an enterprise customer associated with the user, calls the view function
        if one exists, raises PermissionDenied if not.
        """
        arg_4 = arg_1.user
        arg_5 = get_enterprise_customer_for_user(arg_4)
        if arg_5:
            arg_2 = arg_2 + (arg_5,)
            return arg_0(arg_1, *arg_2, **arg_3)
        else:
            raise PermissionDenied(
                'User {username} is not associated with an EnterpriseCustomer.'.format(
                    username=arg_4.username
                )
            )
    return wrapper

Ensure the user making the API request is associated with an EnterpriseCustomer.

    This decorator attempts to find an EnterpriseCustomer associated with the requesting
    user and passes that EnterpriseCustomer to the view as a parameter. It will return a
    PermissionDenied error if an EnterpriseCustomer cannot be found.

    Usage::
        @enterprise_customer_required()
        def my_view(request, enterprise_customer):
            # Some functionality ...

        OR

        class MyView(View):
            ...
            @method_decorator(enterprise_customer_required)
            def get(self, request, enterprise_customer):
                # Some functionality ...

Ensure the user making the API request is associated with an EnterpriseCustomer .


return self.__class__(
            relabels.get(self.alias, self.alias),
            self.target,
            self.hstore_key,
            self.output_field
        )

def Func ( arg_0 , arg_1 ) : return arg_0 . __class__ ( arg_1 . get ( arg_0 . alias , arg_0 . alias ) , arg_0 . target , arg_0 . hstore_key , arg_0 . output_field )

def Func(arg_0, arg_1):
        """Gets a re-labeled clone of this expression."""

        return arg_0.__class__(
            arg_1.get(arg_0.alias, arg_0.alias),
            arg_0.target,
            arg_0.hstore_key,
            arg_0.output_field
        )

Gets a re - labeled clone of this expression .


def Func(arg_0):
        """
        Writes the weeks with associated commits to file.
        """
        with open('../github_stats_output/last_year_commits.csv', 'w+') as output:
            output.write('date,organization,repos,members,teams,'
                + 'unique_contributors,total_contributors,forks,'
                + 'stargazers,pull_requests,open_issues,has_readme,'
                + 'has_license,pull_requests_open,pull_requests_closed,'
                + 'commits\n')
            #no reverse this time to print oldest first
            arg_1 = 0
            for arg_2 in arg_0.sorted_weeks:
                if str(arg_0.commits[arg_2]) != arg_1:#delete dups
                    arg_3 = datetime.datetime.utcfromtimestamp(
                        arg_2 ).strftime('%Y-%m-%d')
                    output.write(arg_3
                        + ',llnl,0,0,0,0,0,0,0,0,0,0,0,0,0,'
                        + str(arg_0.commits[arg_2]) + '\n')
                    arg_1 = str(arg_0.commits[arg_2])

Writes the weeks with associated commits to file .


def Func(arg_0, arg_1=200):
        """230v power off"""
        if arg_0.__Func_port is None:
            cij.err("cij.usb.relay: Invalid USB_RELAY_POWER_OFF")
            return 1

        return arg_0.__press(arg_0.__Func_port, arg_1=arg_1)


async def Func ( arg_0 , arg_1 ) : arg_2 = _build_metadata_yaml_url ( arg_1 ) async with arg_0 . get ( arg_2 ) as response : response . raise_for_status ( ) arg_3 = await response . text ( ) return yaml . safe_load ( arg_3 )

async def Func(arg_0, arg_1):
    """Download the metadata.yaml file from a technote's GitHub repository.
    """
    arg_2 = _build_metadata_yaml_url(arg_1)
    async with arg_0.get(arg_2) as response:
        response.raise_for_status()
        arg_3 = await response.text()
    return yaml.safe_load(arg_3)

Download the metadata . yaml file from a technote s GitHub repository .


def Func ( arg_0 , arg_1 ) : arg_2 = new ( secur32 , 'SecBuffer[%d]' % arg_1 ) for arg_3 in range ( 0 , arg_1 ) : arg_2 [ arg_3 ] . cbBuffer = 0 arg_2 [ arg_3 ] . BufferType = Secur32Const . SECBUFFER_EMPTY arg_2 [ arg_3 ] . pvBuffer = null ( ) arg_7 = struct ( secur32 , 'SecBufferDesc' ) arg_8 = unwrap ( arg_7 ) arg_8 . ulVersion = Secur32Const . SECBUFFER_VERSION arg_8 . cBuffers = arg_1 arg_8 . pBuffers = arg_2 return ( arg_7 , arg_2 )

def Func(arg_0, arg_1):
        """
        Creates a SecBufferDesc struct and contained SecBuffer structs

        :param number:
            The number of contains SecBuffer objects to create

        :return:
            A tuple of (SecBufferDesc pointer, SecBuffer array)
        """

        arg_2 = new(secur32, 'SecBuffer[%d]' % arg_1)

        for arg_3 in range(0, arg_1):
            arg_2[arg_3].cbBuffer = 0
            arg_2[arg_3].BufferType = Secur32Const.SECBUFFER_EMPTY
            arg_2[arg_3].pvBuffer = null()

        arg_7 = struct(secur32, 'SecBufferDesc')
        arg_8 = unwrap(arg_7)

        arg_8.ulVersion = Secur32Const.SECBUFFER_VERSION
        arg_8.cBuffers = arg_1
        arg_8.pBuffers = arg_2

        return (arg_7, arg_2)


def
Func
(
arg_0
,
arg_1
=
'PatientID'
)
:
arg_2
=
defaultdict
(
list
)
try
:
for
arg_3
in
arg_0
:
arg_4
=
dicom
.
read_file
(
arg_3
)
arg_5
=
getattr
(
arg_4
,
arg_1
)
arg_2
[
arg_5
]
.
append
(
arg_3
)
except
KeyError
as
ke
:
raise
KeyError
(
'Error reading field {} from file {}.'
.
format
(
arg_1
,
arg_3
)
)
from
ke
return
arg_2

def Func(arg_0, arg_1='PatientID'):
    """Group in a dictionary all the DICOM files in dicom_paths
    separated by the given `hdr_field` tag value.

    Parameters
    ----------
    dicom_paths: str
        Iterable of DICOM file paths.

    hdr_field: str
        Name of the DICOM tag whose values will be used as key for the group.

    Returns
    -------
    dicom_groups: dict of dicom_paths
    """
    arg_2 = defaultdict(list)
    try:
        for arg_3 in arg_0:
            arg_4 = dicom.read_file(arg_3)
            arg_5 = getattr(arg_4, arg_1)
            arg_2[arg_5].append(arg_3)
    except KeyError as ke:
        raise KeyError('Error reading field {} from file {}.'.format(arg_1, arg_3)) from ke

    return arg_2

Group in a dictionary all the DICOM files in dicom_paths separated by the given hdr_field tag value .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . stanza_type if arg_2 is None : arg_2 = "normal" if arg_0 . __try_handlers ( arg_0 . _message_handlers , arg_1 , arg_2 = arg_2 ) : return True if arg_2 not in ( "error" , "normal" ) : return arg_0 . __try_handlers ( arg_0 . _message_handlers , arg_1 , arg_2 = "normal" ) return False

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

        Pass it to a handler of the stanza's type and payload namespace.
        If no handler for the actual stanza type succeeds then hadlers
        for type "normal" are used.

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

        arg_2 = arg_1.stanza_type
        if arg_2 is None:
            arg_2 = "normal"

        if arg_0.__try_handlers(arg_0._message_handlers, arg_1,
                                                arg_2 = arg_2):
            return True

        if arg_2 not in ("error", "normal"):
            # try 'normal' handler additionaly to the regular handler
            return arg_0.__try_handlers(arg_0._message_handlers, arg_1,
                                                    arg_2 = "normal")
        return False


def Func ( arg_0 ) : arg_1 = arg_0 . _TUN . _tun . read ( arg_0 . _TUN . _tun . mtu ) return ( arg_1 )

def Func(arg_0):
        """
        Checks the TUN adapter for data and returns any that is found.

        Returns:
            packet: Data read from the TUN adapter
        """
        arg_1 = arg_0._TUN._tun.read(arg_0._TUN._tun.mtu)
        return(arg_1)

Checks the TUN adapter for data and returns any that is found .


def
Func
(
arg_0
=
False
,
arg_1
=
False
)
:
if
len
(
solvers
)
==
0
:
raise
SolverNotFound
(
"no solvers installed"
)
arg_2
=
[
"gurobi"
,
"cplex"
,
"glpk"
]
arg_3
=
[
"glpk"
,
"cplex"
,
"gurobi"
]
arg_4
=
[
"gurobi"
,
"cplex"
]
if
arg_0
is
False
and
arg_1
is
False
:
for
arg_5
in
arg_3
:
if
arg_5
in
solvers
:
return
arg_5
return
list
(
solvers
)
[
0
]
elif
arg_1
:
for
arg_5
in
arg_4
:
if
arg_5
in
solvers
:
return
arg_5
raise
SolverNotFound
(
"no qp-capable solver found"
)
else
:
for
arg_5
in
arg_2
:
if
arg_5
in
solvers
:
return
arg_5
raise
SolverNotFound
(
"no mip-capable solver found"
)

def Func(arg_0=False, arg_1=False):
    """Select a solver for a given optimization problem.

    Parameters
    ----------
    mip : bool
        Does the solver require mixed integer linear programming capabilities?
    qp : bool
        Does the solver require quadratic programming capabilities?

    Returns
    -------
    string
        The name of feasible solver.

    Raises
    ------
    SolverNotFound
        If no suitable solver could be found.
    """
    if len(solvers) == 0:
        raise SolverNotFound("no solvers installed")
    # Those lists need to be updated as optlang implements more solvers
    arg_2 = ["gurobi", "cplex", "glpk"]
    arg_3 = ["glpk", "cplex", "gurobi"]
    arg_4 = ["gurobi", "cplex"]

    if arg_0 is False and arg_1 is False:
        for arg_5 in arg_3:
            if arg_5 in solvers:
                return arg_5
        # none of them are in the list order - so return the first one
        return list(solvers)[0]
    elif arg_1:  # mip does not yet matter for this determination
        for arg_5 in arg_4:
            if arg_5 in solvers:
                return arg_5
        raise SolverNotFound("no qp-capable solver found")
    else:
        for arg_5 in arg_2:
            if arg_5 in solvers:
                return arg_5
    raise SolverNotFound("no mip-capable solver found")

Select a solver for a given optimization problem .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { } for arg_4 in tf . trainable_variables ( ) : arg_3 [ arg_4 . name ] = [ arg_4 , None , None ] for arg_6 , arg_4 in arg_0 : arg_3 [ arg_4 . name ] [ 1 ] = arg_6 arg_3 [ arg_4 . name ] [ 2 ] = arg_1 . get_slot ( arg_4 , 'accumulator' ) arg_7 = [ ] for arg_8 , ( arg_4 , arg_6 , arg_9 ) in arg_3 . items ( ) : if arg_6 is None : continue if isinstance ( arg_6 , tf . IndexedSlices ) : arg_10 = arg_2 * arg_6 . values if arg_9 is not None : arg_10 /= tf . sqrt ( tf . gather ( arg_9 , arg_6 . indices ) ) else : arg_10 = arg_2 * arg_6 if arg_9 is not None : arg_10 /= tf . sqrt ( arg_9 ) arg_11 = tf . sqrt ( tf . reduce_sum ( arg_4 * arg_4 ) ) + 1.0e-7 arg_12 = tf . sqrt ( tf . reduce_sum ( arg_10 * arg_10 ) ) arg_7 . append ( tf . summary . scalar ( 'UPDATE/' + arg_8 . replace ( ":" , "_" ) , arg_12 / arg_11 ) ) return arg_7

def Func(arg_0, arg_1, arg_2):
    """get summary ops for the magnitude of gradient updates"""

    # strategy:
    # make a dict of variable name -> [variable, grad, adagrad slot]
    arg_3 = {}
    for arg_4 in tf.trainable_variables():
        arg_3[arg_4.name] = [arg_4, None, None]
    for arg_6, arg_4 in arg_0:
        arg_3[arg_4.name][1] = arg_6
        arg_3[arg_4.name][2] = arg_1.get_slot(arg_4, 'accumulator')

    # now make summaries
    arg_7 = []
    for arg_8, (arg_4, arg_6, arg_9) in arg_3.items():

        if arg_6 is None:
            continue

        if isinstance(arg_6, tf.IndexedSlices):
            # a sparse gradient - only take norm of params that are updated
            arg_10 = arg_2 * arg_6.values
            if arg_9 is not None:
                arg_10 /= tf.sqrt(tf.gather(arg_9, arg_6.indices))
        else:
            arg_10 = arg_2 * arg_6
            if arg_9 is not None:
                arg_10 /= tf.sqrt(arg_9)

        arg_11 = tf.sqrt(tf.reduce_sum(arg_4 * arg_4)) + 1.0e-7
        arg_12 = tf.sqrt(tf.reduce_sum(arg_10 * arg_10))
        arg_7.append(tf.summary.scalar('UPDATE/' + arg_8.replace(":", "_"), arg_12 / arg_11))

    return arg_7


def Func ( arg_0 ) : if py3compat . PY3 : return arg_0 def utf8_image_tag ( * arg_1 , ** arg_2 ) : arg_3 = arg_0 ( * arg_1 , ** arg_2 ) if isinstance ( arg_3 , unicode ) : arg_3 = arg_3 . encode ( 'utf8' ) return arg_3 return utf8_image_tag

def Func(arg_0):
    """wrapper for ensuring image_tag returns utf8-encoded str on Python 2"""
    if py3compat.PY3:
        # nothing to do on Python 3
        return arg_0

    def utf8_image_tag(*arg_1, **arg_2):
        arg_3 = arg_0(*arg_1, **arg_2)
        if isinstance(arg_3, unicode):
            arg_3 = arg_3.encode('utf8')
        return arg_3
    return utf8_image_tag

wrapper for ensuring image_tag returns utf8 - encoded str on Python 2


(filepath, metafile_filepath=None, samples_filepath=None, verbose=True)

return dict(variants=variants, samples=samples, genotype=genotype)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=True):
    r""" Read a given BGEN file.

    Parameters
    ----------
    filepath : str
        A bgen file path.
    metafile_filepath : str, optional
        If ``None``, it will try to read the ``filepath + ".metadata"`` file. If this is
        not possible, it will create one. It tries to create one at
        ``filepath + ".metadata"``. If that is also no possible, it tries to create one
        at a temporary folder.
    samples_filepath : str, optional
        A sample file in `gen format <https://goo.gl/bCzo7m>`_.
        If ``samples_filepath`` is provided, sample ids are read from this file.
        Otherwise, it reads from the bgen file itself if possible. Defaults to ``None``.
    verbose : bool, optional
        ``True`` to show progress; ``False`` otherwise. Defaults to ``True``.

    Returns
    -------
    variants : :class:`dask.dataFrame.DataFrame`
        Variant position, chromosomes, rsids, etc.
    samples : :class:`pandas.Series`
        Sample identifications.
    genotype : list
        List of genotypes.

    Examples
    --------
    .. doctest::

        >>> from bgen_reader import example_files, Func
        >>>
        >>> with example_files("haplotypes.bgen") as filepath:
        ...     bgen = Func(filepath, verbose=False)
        ...     variants = bgen["variants"]
        ...     samples = bgen["samples"]
        ...
        ...     v = variants.loc[0].compute()
        ...     g = bgen["genotype"][0].compute()
        ...     print(v)
        ...     print(samples)
        ...     print(g["probs"][0])
             id rsid chrom  pos  nalleles allele_ids  vaddr
        0  SNP1  RS1     1    1         2        A,G    102
        0    sample_0
        1    sample_1
        2    sample_2
        3    sample_3
        Name: id, dtype: object
        [1. 0. 1. 0.]
    """

    assert_file_exist(arg_0)
    assert_file_readable(arg_0)

    arg_1 = _get_valid_metafile_filepath(arg_0, arg_1)
    if not os.path.exists(arg_1):
        if arg_3:
            print(
                f"We will create the metafile `{metafile_filepath}`. This file will "
                "speed up further\nreads and only need to be created once. So, please, "
                "bear with me."
            )
        create_metafile(arg_0, arg_1, arg_3)

    arg_4 = get_samples(arg_0, arg_2, arg_3)
    arg_5 = map_metadata(arg_0, arg_1)
    arg_6 = map_genotype(arg_0, arg_1, arg_3)

    return dict(arg_5=arg_5, arg_4=arg_4, arg_6=arg_6)

r""" Read a given BGEN file.

    Parameters
    ----------
    filepath : str
        A bgen file path.
    metafile_filepath : str, optional
        If ``None``, it will try to read the ``filepath + ".metadata"`` file. If this is
        not possible, it will create one. It tries to create one at
        ``filepath + ".metadata"``. If that is also no possible, it tries to create one
        at a temporary folder.
    samples_filepath : str, optional
        A sample file in `gen format <https://goo.gl/bCzo7m>`_.
        If ``samples_filepath`` is provided, sample ids are read from this file.
        Otherwise, it reads from the bgen file itself if possible. Defaults to ``None``.
    verbose : bool, optional
        ``True`` to show progress; ``False`` otherwise. Defaults to ``True``.

    Returns
    -------
    variants : :class:`dask.dataFrame.DataFrame`
        Variant position, chromosomes, rsids, etc.
    samples : :class:`pandas.Series`
        Sample identifications.
    genotype : list
        List of genotypes.

    Examples
    --------
    .. doctest::

        >>> from bgen_reader import example_files, read_bgen
        >>>
        >>> with example_files("haplotypes.bgen") as filepath:
        ...     bgen = read_bgen(filepath, verbose=False)
        ...     variants = bgen["variants"]
        ...     samples = bgen["samples"]
        ...
        ...     v = variants.loc[0].compute()
        ...     g = bgen["genotype"][0].compute()
        ...     print(v)
        ...     print(samples)
        ...     print(g["probs"][0])
             id rsid chrom  pos  nalleles allele_ids  vaddr
        0  SNP1  RS1     1    1         2        A,G    102
        0    sample_0
        1    sample_1
        2    sample_2
        3    sample_3
        Name: id, dtype: object
        [1. 0. 1. 0.]


def Func(arg_0):
        """Return files opened by process."""
        if arg_0.pid == 0:
            return []
        arg_1 = []
        arg_2 = _psutil_osx.get_process_open_files(arg_0.pid)
        for arg_3, arg_4 in arg_2:
            if isfile_strict(arg_3):
                arg_5 = nt_openfile(arg_3, arg_4)
                arg_1.append(arg_5)
        return arg_1


def Func(arg_0, arg_1, arg_2=arg_3.SCHEDULE_HOLD):
        """
        Updates the target temperature on the NuHeat API

        :param temperature: The desired temperature in NuHeat format
        :param permanent: Permanently hold the temperature. If set to False, the schedule will
                          resume at the next programmed event
        """
        if arg_1 < arg_0.min_temperature:
            arg_1 = arg_0.min_temperature

        if arg_1 > arg_0.max_temperature:
            arg_1 = arg_0.max_temperature

        arg_5 = [arg_3.SCHEDULE_TEMPORARY_HOLD, arg_3.SCHEDULE_HOLD]
        if arg_2 not in arg_5:
            raise Exception("Invalid mode. Please use one of: {}".format(arg_5))

        arg_0.set_data({
            "SetPointTemp": arg_1,
            "ScheduleMode": arg_2
        })


(lcdir,
                       templateinfo,
                       lcfileglob=None,
                       timecols=None,
                       magcols=None,
                       errcols=None,
                       lcformat='hat-sql',
                       lcformatdir=None,
                       interp='nearest',
                       sigclip=5.0,
                       mintemplatedist_arcmin=10.0,
                       nworkers=NCPUS,
                       maxworkertasks=1000)

return parallel_tfa_lclist(
        lclist,
        templateinfo,
        timecols=timecols,
        magcols=magcols,
        errcols=errcols,
        lcformat=lcformat,
        lcformatdir=None,
        interp=interp,
        sigclip=sigclip,
        mintemplatedist_arcmin=mintemplatedist_arcmin,
        nworkers=nworkers,
        maxworkertasks=maxworkertasks
    )

def Func(arg_0,
                       arg_1,
                       arg_2=None,
                       arg_3=None,
                       arg_4=None,
                       arg_5=None,
                       arg_6='hat-sql',
                       arg_7=None,
                       arg_8='nearest',
                       arg_9=5.0,
                       arg_10=10.0,
                       arg_11=arg_12,
                       arg_13=1000):
    '''This applies TFA in parallel to all LCs in a directory.

    Parameters
    ----------

    lcdir : str
        This is the directory containing the light curve files to process..

    templateinfo : dict or str
        This is either the dict produced by `tfa_templates_lclist` or the pickle
        produced by the same function.

    lcfileglob : str or None
        The UNIX file glob to use when searching for light curve files in
        `lcdir`. If None, the default file glob associated with registered LC
        format provided is used.

    timecols : list of str or None
        The timecol keys to use from the lcdict in applying TFA corrections.

    magcols : list of str or None
        The magcol keys to use from the lcdict in applying TFA corrections.

    errcols : list of str or None
        The errcol keys to use from the lcdict in applying TFA corrections.

    lcformat : str
        This is the `formatkey` associated with your light curve format, which
        you previously passed in to the `lcproc.register_lcformat`
        function. This will be used to look up how to find and read the light
        curves specified in `basedir` or `use_list_of_filenames`.

    lcformatdir : str or None
        If this is provided, gives the path to a directory when you've stored
        your lcformat description JSONs, other than the usual directories lcproc
        knows to search for them in. Use this along with `lcformat` to specify
        an LC format JSON file that's not currently registered with lcproc.

    interp : str
        This is passed to scipy.interpolate.interp1d as the kind of
        interpolation to use when reforming the light curves to the timebase of
        the TFA templates.

    sigclip : float or sequence of two floats or None
        This is the sigma clip to apply to the light curves before running TFA
        on it.

    mintemplatedist_arcmin : float
        This sets the minimum distance required from the target object for
        objects in the TFA template ensemble. Objects closer than this distance
        will be removed from the ensemble.

    nworkers : int
        The number of parallel workers to launch

    maxworkertasks : int
        The maximum number of tasks per worker allowed before it's replaced by a
        fresh one.

    Returns
    -------

    dict
        Contains the input file names and output TFA light curve filenames per
        input file organized by each `magcol` in `magcols`.

    '''

    # open the templateinfo first
    if isinstance(arg_1,str) and os.path.exists(arg_1):
        with open(arg_1,'rb') as infd:
            arg_1 = pickle.load(infd)

    try:
        arg_14 = get_lcformat(arg_6,
                                  use_lcformat_dir=arg_7)
        if arg_14:
            (arg_15, arg_16,
             arg_17, arg_18, arg_19,
             arg_20, arg_21) = arg_14
        else:
            LOGERROR("can't figure out the light curve format")
            return None
    except Exception as e:
        LOGEXCEPTION("can't figure out the light curve format")
        return None

    # find all the files matching the lcglob in lcdir
    if arg_2 is None:
        arg_2 = arg_15

    arg_22 = sorted(glob.glob(os.path.join(arg_0, arg_2)))

    return parallel_tfa_lclist(
        arg_22,
        arg_1,
        arg_3=arg_3,
        arg_4=arg_4,
        arg_5=arg_5,
        arg_6=arg_6,
        arg_7=None,
        arg_8=arg_8,
        arg_9=arg_9,
        arg_10=arg_10,
        arg_11=arg_11,
        arg_13=arg_13
    )

This applies TFA in parallel to all LCs in a directory .


return {
            'objectName': self._object_name,
            'runTime': run_time,
            'result': result,
            'timestamp': int(time.time()),
            'heatmaps': [{
                'name': self._object_name,
                'heatmap': heatmap,
                'executionCount': prof.execution_count[filename],
                'srcCode': source_lines,
                'runTime': run_time
            }]
        }

def Func ( arg_0 ) : with _CodeHeatmapCalculator ( ) as prof : arg_1 = arg_0 . _run_object ( * arg_0 . _run_args , ** arg_0 . _run_kwargs ) arg_2 , arg_3 = inspect . getsourcelines ( arg_0 . _run_object ) arg_4 = [ ] for arg_5 in arg_2 : arg_4 . append ( ( 'line' , arg_3 , arg_5 ) ) arg_3 += 1 arg_6 = os . path . abspath ( inspect . getsourcefile ( arg_0 . _run_object ) ) arg_7 = prof . heatmap [ arg_6 ] arg_8 = sum ( time for time in arg_7 . values ( ) ) return { 'objectName' : arg_0 . _object_name , 'runTime' : arg_8 , 'result' : arg_1 , 'timestamp' : int ( time . time ( ) ) , 'heatmaps' : [ { 'name' : arg_0 . _object_name , 'heatmap' : arg_7 , 'executionCount' : prof . execution_count [ arg_6 ] , 'srcCode' : arg_4 , 'runTime' : arg_8 } ] }

def Func(arg_0):
        """Calculates heatmap for function."""
        with _CodeHeatmapCalculator() as prof:
            arg_1 = arg_0._run_object(*arg_0._run_args, **arg_0._run_kwargs)
        arg_2, arg_3 = inspect.getsourcelines(arg_0._run_object)

        arg_4 = []
        for arg_5 in arg_2:
            arg_4.append(('line', arg_3, arg_5))
            arg_3 += 1

        arg_6 = os.path.abspath(inspect.getsourcefile(arg_0._run_object))
        arg_7 = prof.heatmap[arg_6]
        arg_8 = sum(time for time in arg_7.values())
        return {
            'objectName': arg_0._object_name,
            'runTime': arg_8,
            'result': arg_1,
            'timestamp': int(time.time()),
            'heatmaps': [{
                'name': arg_0._object_name,
                'heatmap': arg_7,
                'executionCount': prof.execution_count[arg_6],
                'srcCode': arg_4,
                'runTime': arg_8
            }]
        }


def Func ( arg_0 : arg_1 . List ) -> bool : for arg_3 in arg_0 : if isinstance ( arg_3 , astroid . Raise ) : return True return False

def Func(arg_0: arg_1.List) -> bool:
    """Return true if the given statement node raise an exception"""
    for arg_3 in arg_0:
        if isinstance(arg_3, astroid.Raise):
            return True
    return False


def Func ( arg_0 , arg_1 = arg_2 . QClipboard . Clipboard ) : if arg_0 . _control . textInteractionFlags ( ) & QtCore . Qt . TextEditable : arg_0 . _keep_cursor_in_buffer ( ) arg_5 = arg_0 . _control . textCursor ( ) arg_6 = arg_2 . QApplication . clipboard ( ) . text ( arg_1 ) . rstrip ( ) arg_0 . _insert_plain_text_into_buffer ( arg_5 , dedent ( arg_6 ) )

def Func(arg_0, arg_1=arg_2.QClipboard.Clipboard):
        """ Paste the contents of the clipboard into the input region.

        Parameters:
        -----------
        mode : QClipboard::Mode, optional [default QClipboard::Clipboard]

            Controls which part of the system clipboard is used. This can be
            used to access the selection clipboard in X11 and the Find buffer
            in Mac OS. By default, the regular clipboard is used.
        """
        if arg_0._control.textInteractionFlags() & QtCore.Qt.TextEditable:
            # Make sure the Func is safe.
            arg_0._keep_cursor_in_buffer()
            arg_5 = arg_0._control.textCursor()

            # Remove any trailing newline, which confuses the GUI and forces the
            # user to backspace.
            arg_6 = arg_2.QApplication.clipboard().text(arg_1).rstrip()
            arg_0._insert_plain_text_into_buffer(arg_5, dedent(arg_6))

Paste the contents of the clipboard into the input region .


def
Func
(
arg_0
,
arg_1
=
""
)
:
for
arg_2
in
STATIC_PATH
:
arg_3
=
os
.
path
.
join
(
arg_2
,
arg_0
)
if
os
.
path
.
exists
(
arg_3
)
:
return
arg_3
if
arg_1
:
arg_3
=
os
.
path
.
join
(
arg_2
,
arg_1
,
arg_0
)
if
os
.
path
.
exists
(
arg_3
)
:
return
arg_3
raise
CoverageException
(
"Couldn't find static file %r"
%
arg_0
)

def Func(arg_0, arg_1=""):
    """Return the path to a data file of ours.

    The file is searched for on `STATIC_PATH`, and the first place it's found,
    is returned.

    Each directory in `STATIC_PATH` is searched as-is, and also, if `pkgdir`
    is provided, at that subdirectory.

    """
    for arg_2 in STATIC_PATH:
        arg_3 = os.path.join(arg_2, arg_0)
        if os.path.exists(arg_3):
            return arg_3
        if arg_1:
            arg_3 = os.path.join(arg_2, arg_1, arg_0)
            if os.path.exists(arg_3):
                return arg_3
    raise CoverageException("Couldn't find static file %r" % arg_0)

Return the path to a data file of ours .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . parent . document . page . cursor . copy ( ) arg_2 . x_reset ( ) arg_2 . y_reset ( ) arg_0 . parent . document . add_page ( ) arg_0 . parent . document . set_cursor ( arg_2 ) arg_0 . parent . document . add_text ( arg_1 )

def Func(arg_0, arg_1):
        """ Helper function for PDFText, to have the document
            add a page, and retry adding a large block of
            text that would otherwise have been to long for the
            page.

        """
        arg_2 = arg_0.parent.document.page.cursor.copy()
        arg_2.x_reset()
        arg_2.y_reset()
        arg_0.parent.document.add_page()
        arg_0.parent.document.set_cursor(arg_2)
        arg_0.parent.document.add_text(arg_1)

Helper function for PDFText to have the document add a page and retry adding a large block of text that would otherwise have been to long for the page .


def Func ( arg_0 ) : arg_1 = "\[.*?\](.*?)\[\/.*?\]" arg_2 = "\[(.*?)\]" arg_0 . links = [ ] for arg_4 in ( arg_1 , arg_2 ) : for arg_5 in re . findall ( arg_4 , arg_0 . description ) : arg_0 . links . append ( arg_5 ) arg_0 . description = re . sub ( arg_4 , "\\1" , arg_0 . description ) arg_0 . description = arg_0 . description . strip ( )

def Func(arg_0):

        """ Strips links from the definition and gathers them in a links property.
        """

        arg_1 = "\[.*?\](.*?)\[\/.*?\]"
        arg_2 = "\[(.*?)\]"
        arg_0.links = []
        for arg_4 in (arg_1,arg_2):
            for arg_5 in re.findall(arg_4, arg_0.description):
                arg_0.links.append(arg_5)
            arg_0.description = re.sub(arg_4, "\\1", arg_0.description)

        arg_0.description = arg_0.description.strip()

Strips links from the definition and gathers them in a links property .


return self.__class__(
            self.mol,
            [(value if is_missing(v) else v) for v in self.values()],
            self.keys(),
        )

def Func ( arg_0 , arg_1 = arg_2 . nan ) : return arg_0 . __class__ ( arg_0 . mol , [ ( arg_1 if is_missing ( arg_4 ) else arg_4 ) for arg_4 in arg_0 . values ( ) ] , arg_0 . keys ( ) , )

def Func(arg_0, arg_1=arg_2.nan):
        r"""Replace missing value to "value".

        Parameters:
            value: value that missing value is replaced

        Returns:
            Result

        """
        return arg_0.__class__(
            arg_0.mol,
            [(arg_1 if is_missing(arg_4) else arg_4) for arg_4 in arg_0.values()],
            arg_0.keys(),
        )


def Func ( * arg_0 ) -> ISeq : arg_1 = lseq . sequence ( itertools . chain ( * filter ( None , map ( to_seq , arg_0 ) ) ) ) if arg_1 is None : return lseq . EMPTY return arg_1

def Func(*arg_0) -> ISeq:
    """Concatenate the sequences given by seqs into a single ISeq."""
    arg_1 = lseq.sequence(itertools.chain(*filter(None, map(to_seq, arg_0))))
    if arg_1 is None:
        return lseq.EMPTY
    return arg_1

Concatenate the sequences given by seqs into a single ISeq .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
,
arg_4
=
get_job_or_local
(
arg_0
.
obj
.
get
(
'project'
)
,
arg_0
.
obj
.
get
(
'job'
)
)
if
not
arg_1
and
not
click
.
confirm
(
"Are sure you want to Func "
"job `{}`"
.
format
(
arg_4
)
)
:
click
.
echo
(
'Existing without Funcping job.'
)
sys
.
exit
(
0
)
try
:
PolyaxonClient
(
)
.
job
.
Func
(
arg_2
,
arg_3
,
arg_4
)
except
(
PolyaxonHTTPError
,
PolyaxonShouldExitError
,
PolyaxonClientException
)
as
e
:
Printer
.
print_error
(
'Could not Func job `{}`.'
.
format
(
arg_4
)
)
Printer
.
print_error
(
'Error message `{}`.'
.
format
(
e
)
)
sys
.
exit
(
1
)
Printer
.
print_success
(
"Job is being Funcped."
)

def Func(arg_0, arg_1):
    """Stop job.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon job Func
    ```

    \b
    ```bash
    $ polyaxon job -xp 2 Func
    ```
    """
    arg_2, arg_3, arg_4 = get_job_or_local(arg_0.obj.get('project'), arg_0.obj.get('job'))
    if not arg_1 and not click.confirm("Are sure you want to Func "
                                     "job `{}`".format(arg_4)):
        click.echo('Existing without Funcping job.')
        sys.exit(0)

    try:
        PolyaxonClient().job.Func(arg_2, arg_3, arg_4)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func job `{}`.'.format(arg_4))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    Printer.print_success("Job is being Funcped.")

Stop job.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon job stop
    ```

    \b
    ```bash
    $ polyaxon job -xp 2 stop
    ```


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

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

    Returns:
      A FieldDescriptor, describing the named extension.
    """
    arg_1 = _NormalizeFullyQualifiedName(arg_1)
    arg_2, arg_3, arg_4 = arg_1.rpartition('.')
    try:
      # Most extensions are nested inside a message.
      arg_5 = arg_0.FindMessageTypeByName(arg_2)
    except KeyError:
      # Some extensions are defined at file scope.
      arg_5 = arg_0.FindFileContainingSymbol(arg_1)
    return arg_5.extensions_by_name[arg_4]

Loads the named extension descriptor from the pool .


def Func ( arg_0 ) : def _Func ( arg_1 ) : def wrapped ( * arg_2 , ** arg_3 ) : try : return arg_1 ( * arg_2 , ** arg_3 ) except requests . exceptions . HTTPError as e : if e . response . status_code == requests . codes . unauthorized : raise access_common . Unavailable ( arg_0 ) else : raise return wrapped return _Func

def Func(arg_0):
    ''' Returns a decorator to swallow a requests exception for modules that
        are not accessible without logging in, and turn it into an Unavailable
        exception.
    '''
    def _Func(arg_1):
        def wrapped(*arg_2, **arg_3):
            try:
                return arg_1(*arg_2, **arg_3)
            except requests.exceptions.HTTPError as e:
                if e.response.status_code == requests.codes.unauthorized:
                    raise access_common.Unavailable(arg_0)
                else:
                    raise
        return wrapped
    return _Func

Returns a decorator to swallow a requests exception for modules that are not accessible without logging in and turn it into an Unavailable exception .


def Func ( arg_0 , arg_1 : arg_2 , * arg_3 , ** arg_4 ) -> Dict [ arg_2 , List [ Tuple [ Any , Any ] ] ] : raise NotImplementedError

def Func(arg_0, arg_1: arg_2, *arg_3, **arg_4) -> Dict[arg_2, List[Tuple[Any, Any]]]:
        """Reads a file from a path and returns data as a list of tuples of inputs and correct outputs
         for every data type in ``train``, ``valid`` and ``test``.
        """
        raise NotImplementedError

Reads a file from a path and returns data as a list of tuples of inputs and correct outputs for every data type in train valid and test .


def
Func
(
arg_0
,
arg_1
=
)
:
if
not
isinstance
(
arg_0
,
type
)
:
raise
TypeError
(
'Func must be called with '
'new-style classes, not %.100r'
%
arg_0
)
if
arg_1
is
:
arg_1
=
set
(
)
try
:
arg_2
=
arg_0
.
__subclasses__
(
)
except
TypeError
:
arg_2
=
arg_0
.
__subclasses__
(
arg_0
)
for
arg_3
in
arg_2
:
if
arg_3
in
arg_1
:
continue
arg_1
.
add
(
arg_3
)
yield
arg_3
for
arg_3
in
Func
(
arg_3
,
arg_1
)
:
yield
arg_3

def Func(arg_0, arg_1=None):
	"""
	Generator over all subclasses of a given class, in depth-first order.

	>>> bool in list(Func(int))
	True
	>>> class A(object): pass
	>>> class B(A): pass
	>>> class C(A): pass
	>>> class D(B,C): pass
	>>> class E(D): pass
	>>>
	>>> for cls in Func(A):
	...		print(cls.__name__)
	B
	D
	E
	C
	>>> # get ALL (new-style) classes currently defined
	>>> res = [cls.__name__ for cls in Func(object)]
	>>> 'type' in res
	True
	>>> 'tuple' in res
	True
	>>> len(res) > 100
	True
	"""

	if not isinstance(arg_0, type):
		raise TypeError(
			'Func must be called with '
			'new-style classes, not %.100r' % arg_0
		)
	if arg_1 is None:
		arg_1 = set()
	try:
		arg_2 = arg_0.__subclasses__()
	except TypeError:  # fails only when cls is type
		arg_2 = arg_0.__subclasses__(arg_0)
	for arg_3 in arg_2:
		if arg_3 in arg_1:
			continue
		arg_1.add(arg_3)
		yield arg_3
		for arg_3 in Func(arg_3, arg_1):
			yield arg_3

Generator over all subclasses of a given class, in depth-first order.

	>>> bool in list(iter_subclasses(int))
	True
	>>> class A(object): pass
	>>> class B(A): pass
	>>> class C(A): pass
	>>> class D(B,C): pass
	>>> class E(D): pass
	>>>
	>>> for cls in iter_subclasses(A):
	...		print(cls.__name__)
	B
	D
	E
	C
	>>> # get ALL (new-style) classes currently defined
	>>> res = [cls.__name__ for cls in iter_subclasses(object)]
	>>> 'type' in res
	True
	>>> 'tuple' in res
	True
	>>> len(res) > 100
	True

Generator over all subclasses of a given class in depth - first order .


def Func(arg_0):
  """Return the most recent timestamp in the operation."""
  arg_1 = get_end_time(arg_0)

  if not arg_1:
    arg_2 = get_last_event(arg_0)
    if arg_2:
      arg_1 = arg_2['timestamp']

  if not arg_1:
    arg_1 = get_create_time(arg_0)

  return arg_1

Return the most recent timestamp in the operation .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : return ":" . join ( list ( arg_0 . _calculate ( arg_1 , arg_2 ) . values ( ) ) )

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Format the calculated time into a human readable format.

        :param start: A starting time.
        :type start: int|str

        :param stop: A ending time.
        :type stop: int|str

        :return: A human readable date.
        :rtype: str
        """

        # We return the formatted execution time.
        return ":".join(list(arg_0._calculate(arg_1, arg_2).values()))

Format the calculated time into a human readable format .


def
Func
(
arg_0
)
:
try
:
arg_1
=
int
(
arg_0
)
except
ValueError
:
print_err
(
'\nInvalid integer: {}'
.
format
(
arg_0
)
)
sys
.
exit
(
1
)
return
arg_1

def Func(arg_0):
    """ Parse a string as an integer.
        Exit with a message on failure.
    """
    try:
        arg_1 = int(arg_0)
    except ValueError:
        print_err('\nInvalid integer: {}'.format(arg_0))
        sys.exit(1)
    return arg_1

Parse a string as an integer . Exit with a message on failure .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
_list_containers
(
)
arg_2
=
[
]
bot
.
info
(
"[drive://%s] Containers"
%
arg_0
.
_base
)
arg_3
=
[
]
for
arg_4
in
arg_1
:
arg_5
=
arg_4
[
'name'
]
.
replace
(
'.simg'
,
''
)
if
'properties'
in
arg_4
:
if
'uri'
in
arg_4
[
'properties'
]
:
arg_5
=
arg_4
[
'properties'
]
[
'uri'
]
arg_3
.
append
(
[
arg_4
[
'id'
]
,
arg_5
]
)
arg_4
[
'uri'
]
=
arg_5
arg_2
.
append
(
arg_4
)
bot
.
custom
(
prefix
=
"   [drive://%s]"
%
arg_0
.
_base
,
message
=
"\t\t[id]\t[uri]"
,
color
=
"PURPLE"
)
bot
.
table
(
arg_3
)
return
arg_2

def Func(arg_0):
    '''a "list all" search that doesn't require a query. Here we return to
       the user all objects that have custom properties value type set to
       container, which is set when the image is pushed.

       IMPORTANT: the upload function adds this metadata. For a container to
       be found by the client, it must have the properties value with type
       as container. It also should have a "uri" in properties to show the
       user, otherwise the user will have to query / download based on the id
    '''

    arg_1 = arg_0._list_containers()
    arg_2 = []

    bot.info("[drive://%s] Containers" %arg_0._base)

    arg_3 = []
    for arg_4 in arg_1:

        # Fallback to the image name without the extension
        arg_5 = arg_4['name'].replace('.simg','')

        # However the properties should include the uri
        if 'properties' in arg_4:
            if 'uri' in arg_4['properties']:
                arg_5 = arg_4['properties']['uri']
        arg_3.append([arg_4['id'],arg_5])

        # Give the user back a uri
        arg_4['uri'] = arg_5
        arg_2.append(arg_4)

    bot.custom(prefix="   [drive://%s]" %arg_0._base,
               message="\t\t[id]\t[uri]",
               color="PURPLE")

    bot.table(arg_3)
    return arg_2

a list all search that doesn t require a query . Here we return to the user all objects that have custom properties value type set to container which is set when the image is pushed .


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_0 . _check ( arg_2 ) arg_3 = arg_0 . db . patches_after ( Patch ( arg_1 ) ) for arg_4 in reversed ( arg_3 ) : arg_0 . _Func ( arg_4 ) arg_0 . db . save ( ) arg_0 . unapplied ( arg_0 . db . top_patch ( ) )

def Func(arg_0, arg_1, arg_2=False):
        """ Unapply patches up to patch_name. patch_name will end up as top
            patch """
        arg_0._check(arg_2)

        arg_3 = arg_0.db.patches_after(Patch(arg_1))
        for arg_4 in reversed(arg_3):
            arg_0._Func(arg_4)

        arg_0.db.save()

        arg_0.unapplied(arg_0.db.top_patch())

Unapply patches up to patch_name . patch_name will end up as top patch


return self._post(
            request=ApiActions.CREATE.value,
            uri=ApiUri.ACTIONS.value,
            params=data
        )

def Func ( arg_0 , arg_1 ) : arg_2 = { 'type' : 'tagit' , 'rate_count' : 0 , 'rate_range' : 'day' , 'limit_count' : 0 , 'limit_range' : 'day' , 'schedule' : [ ] , 'enabled' : True , 'args' : { 'sn' : arg_1 , 'tag_sn' : arg_1 } } return arg_0 . _post ( request = ApiActions . CREATE . value , uri = ApiUri . ACTIONS . value , params = arg_2 )

def Func(arg_0, arg_1):
        """
        Create a new tag

        :param label_id: The Label ID (the 'sn' key of the Func label response)
        :type label_id: str

        :returns: The response of your post
        :rtype: dict

        :raises: This will raise a
            :class:`ServerException<logentries_api.exceptions.ServerException>`
            if there is an error from Logentries
        """
        arg_2 = {
            'type': 'tagit',
            'rate_count': 0,
            'rate_range': 'day',
            'limit_count': 0,
            'limit_range': 'day',
            'schedule': [],
            'enabled': True,
            'args': {
                'sn': arg_1,
                'tag_sn': arg_1
            }
        }
        # Yes, it's confusing. the `/actions/` endpoint is used for tags, while
        # the /tags/ endpoint is used for labels.
        return arg_0._post(
            request=ApiActions.CREATE.value,
            uri=ApiUri.ACTIONS.value,
            params=arg_2
        )

Create a new tag

        :param label_id: The Label ID (the 'sn' key of the create label response)
        :type label_id: str

        :returns: The response of your post
        :rtype: dict

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


def Func(arg_0, arg_1, arg_2, arg_3):
        """Produces a list of ports to be updated async."""
        arg_4 = db_api.security_group_find(arg_1, id=arg_2, scope=db_api.ONE)
        if not arg_4:
            return None
        arg_5 = db_api.sg_gather_associated_ports(arg_1, arg_4)
        if len(arg_5) == 0:
            return {"ports": 0}
        for arg_6 in arg_5:
            arg_7 = dict(action="update port %s" % arg_6['id'],
                            tenant_id=arg_4['tenant_id'],
                            resource_id=arg_6['id'],
                            parent_id=arg_3)
            arg_7 = dict(arg_8=arg_7)
            arg_8 = job_api.create_job(arg_1.elevated(), arg_7)
            arg_9 = QuarkSGAsyncConsumerClient()
            try:
                arg_9.update_port(arg_1, arg_6['id'], arg_8['id'])
            except om_exc.MessagingTimeout:
                # TODO(roaet): Not too sure what can be done here other than
                # updating the job as a failure?
                LOG.error("Failed to update port. Rabbit running?")
        return None

Produces a list of ports to be updated async .


(df, name="pandas", copy_index=True, index_name="index")

def Func(arg_0, arg_1="pandas", arg_2=True, arg_3="index"):
    """Create an in memory DataFrame from a pandas DataFrame.

    :param: pandas.DataFrame df: Pandas DataFrame
    :param: name: unique for the DataFrame

    >>> import vaex, pandas as pd
    >>> df_pandas = pd.from_csv('test.csv')
    >>> df = vaex.Func(df_pandas)

    :rtype: DataFrame
    """
    import six
    arg_4 = vaex.dataframe.DataFrameArrays(arg_1)

    def add(arg_1, arg_5):
        arg_6 = arg_5.values
        try:
            arg_4.add_column(arg_1, arg_6)
        except Exception as e:
            print("could not convert column %s, error: %r, will try to convert it to string" % (arg_1, e))
            try:
                arg_6 = arg_6.astype("S")
                arg_4.add_column(arg_1, arg_6)
            except Exception as e:
                print("Giving up column %s, error: %r" % (arg_1, e))
    for arg_1 in arg_0.columns:
        add(arg_1, arg_0[arg_1])
    if arg_2:
        add(arg_3, arg_0.index)
    return arg_4

Create an in memory DataFrame from a pandas DataFrame.

    :param: pandas.DataFrame df: Pandas DataFrame
    :param: name: unique for the DataFrame

    >>> import vaex, pandas as pd
    >>> df_pandas = pd.from_csv('test.csv')
    >>> df = vaex.from_pandas(df_pandas)

    :rtype: DataFrame

Create an in memory DataFrame from a pandas DataFrame .


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = getattr ( arg_0 . client , arg_1 ) return arg_4 ( * arg_2 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """wrapper for calling docker methods

        to be passed to ThreadPoolExecutor
        """
        arg_4 = getattr(arg_0.client, arg_1)
        return arg_4(*arg_2, **arg_3)


def Func ( arg_0 , arg_1 ) : if arg_1 in sys . modules : arg_2 = sys . modules [ arg_1 ] arg_0 . _call_unload_ipython_extension ( arg_2 )

def Func(arg_0, arg_1):
        """Unload an IPython extension by its module name.

        This function looks up the extension's name in ``sys.modules`` and
        simply calls ``mod.unload_ipython_extension(self)``.
        """
        if arg_1 in sys.modules:
            arg_2 = sys.modules[arg_1]
            arg_0._call_unload_ipython_extension(arg_2)

Unload an IPython extension by its module name .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
**
arg_3
)
:
LOG
.
info
(
"Func %s"
%
arg_2
)
try
:
arg_4
=
arg_0
.
_client
.
show_port
(
arg_2
)
except
Exception
as
e
:
arg_5
=
"failed fetching downstream port: %s"
%
(
str
(
e
)
)
LOG
.
exception
(
arg_5
)
raise
IronicException
(
arg_5
=
arg_5
)
return
{
"downstream_port"
:
arg_4
}

def Func(arg_0, arg_1, arg_2, **arg_3):
        """Diagnose a port.

        :param context: neutron api request context.
        :param port_id: neutron port id.
        :param kwargs: optional kwargs.
        :raises IronicException: If the client is unable to fetch the
            downstream port for any reason, the exception will be
            logged and IronicException raised.
        """
        LOG.info("Func %s" % arg_2)
        try:
            arg_4 = arg_0._client.show_port(arg_2)
        except Exception as e:
            arg_5 = "failed fetching downstream port: %s" % (str(e))
            LOG.exception(arg_5)
            raise IronicException(arg_5=arg_5)
        return {"downstream_port": arg_4}


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        Called after executing a step.

        :param ctxt: An instance of ``timid.context.Context``.
        :param step: An instance of ``timid.steps.Step`` describing
                     the step that was executed.
        :param idx: The index of the step in the list of steps.
        :param result: An instance of ``timid.steps.StepResult``
                       describing the result of executing the step.
                       May be altered by the extension, e.g., to set
                       the ``ignore`` attribute.

        :returns: The ``result`` parameter, for convenience.
        """

        arg_5 = ExtensionDebugger('Func')

        for arg_6 in arg_0.exts:
            with arg_5(arg_6):
                arg_6.Func(arg_1, arg_2, arg_3, arg_4)

        # Convenience return
        return arg_4


Updates record and returns True if record is complete after update, else False.

(self, allow_partial=True, force=False, **kwargs)

def
Func
(
arg_0
,
arg_1
=
True
,
arg_2
=
False
,
**
arg_3
)
:
if
arg_3
:
arg_0
.
__init__
(
partial
=
arg_1
,
arg_2
=
arg_2
,
**
arg_3
)
return
not
arg_0
.
_partial
if
not
arg_2
and
CACHE
.
get
(
hash
(
arg_0
)
)
:
arg_4
=
CACHE
[
hash
(
arg_0
)
]
for
arg_5
in
arg_0
.
_SIMPLE_FIELDS
|
arg_0
.
_COMPLEX_FIELDS
:
arg_6
=
getattr
(
arg_4
,
arg_5
)
setattr
(
arg_0
,
arg_5
,
arg_6
)
arg_0
.
_partial
=
False
logging
.
info
(
f'Loading {str(self)} from cache'
)
return
True
arg_8
=
element_lookup_by_id
(
arg_0
.
type
,
arg_0
.
id
)
arg_0
.
__init__
(
partial
=
False
,
**
arg_8
)
return
True

def Func(arg_0, arg_1=True, arg_2=False, **arg_3):
        """Updates record and returns True if record is complete after Func, else False."""
        if arg_3:
            arg_0.__init__(partial=arg_1, arg_2=arg_2, **arg_3)
            return not arg_0._partial

        if not arg_2 and CACHE.get(hash(arg_0)):
            arg_4 = CACHE[hash(arg_0)]
            for arg_5 in arg_0._SIMPLE_FIELDS | arg_0._COMPLEX_FIELDS:
                arg_6 = getattr(arg_4, arg_5)
                setattr(arg_0, arg_5, arg_6)
            arg_0._partial = False
            logging.info(f'Loading {str(self)} from cache')
            return True
        arg_8 = element_lookup_by_id(arg_0.type, arg_0.id)
        arg_0.__init__(partial=False, **arg_8)
        return True

Updates record and returns True if record is complete after update else False .


def
Func
(
arg_0
,
arg_1
)
:
LOG
.
info
(
'Func %s for tenant %s'
%
(
arg_1
,
arg_0
.
tenant_id
)
)
_delete_flip
(
arg_0
,
arg_1
,
ip_types
.
SCALING
)

def Func(arg_0, arg_1):
    """Deallocate a scaling IP.

    :param context: neutron api request context.
    :param id: id of the scaling ip
    """
    LOG.info('Func %s for tenant %s' % (arg_1, arg_0.tenant_id))
    _delete_flip(arg_0, arg_1, ip_types.SCALING)


def Func ( arg_0 ) -> Generator [ None , None , None ] : arg_1 = [ ] for arg_2 in arg_0 . _seqProcsToRun : try : arg_3 = arg_0 . _outputContainers [ arg_2 ] except KeyError : arg_3 = None arg_2 ( arg_0 , arg_3 ) if arg_3 is not None : arg_1 . append ( arg_3 ) arg_0 . _seqProcsToRun = UniqList ( ) arg_0 . FuncPlaned = False for arg_6 in arg_1 : for arg_7 , arg_8 in arg_6 . _all_signals : arg_9 = getattr ( arg_6 , arg_7 ) if arg_9 is not None : arg_10 = arg_0 . _conflictResolveStrategy ( arg_9 ) arg_11 , arg_12 = arg_10 arg_8 . simUpdateVal ( arg_0 , arg_11 ) setattr ( arg_6 , arg_7 , None ) return yield

def Func(arg_0) -> Generator[None, None, None]:
        """
        Delta step for event dependent processes
        """
        arg_1 = []
        for arg_2 in arg_0._seqProcsToRun:
            try:
                arg_3 = arg_0._outputContainers[arg_2]
            except KeyError:
                # processes does not have to have outputs
                arg_3 = None

            arg_2(arg_0, arg_3)

            if arg_3 is not None:
                arg_1.append(arg_3)

        arg_0._seqProcsToRun = UniqList()
        arg_0.FuncPlaned = False

        for arg_6 in arg_1:
            for arg_7, arg_8 in arg_6._all_signals:
                arg_9 = getattr(arg_6, arg_7)
                if arg_9 is not None:
                    arg_10 = arg_0._conflictResolveStrategy(arg_9)
                    arg_11, arg_12 = arg_10
                    arg_8.simUpdateVal(arg_0, arg_11)
                    setattr(arg_6, arg_7, None)
        return
        yield


(self, other, all_x=False, all_y=False, by_x=None, by_y=None, method="auto")

return H2OFrame._expr(expr=ExprNode("merge", self, other, all_x, all_y, by_x, by_y, method))

def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
,
arg_3
=
False
,
arg_4
=
,
arg_5
=
,
arg_6
=
"auto"
)
:
if
arg_4
is
and
arg_5
is
:
arg_7
=
list
(
set
(
arg_0
.
names
)
&
set
(
arg_1
.
names
)
)
if
not
arg_7
:
raise
H2OValueError
(
"No columns in common to Func on!"
)
if
arg_4
is
:
arg_4
=
[
arg_0
.
names
.
index
(
c
)
for
c
in
arg_7
]
else
:
arg_4
=
_getValidCols
(
arg_4
,
arg_0
)
if
arg_5
is
:
arg_5
=
[
arg_1
.
names
.
index
(
c
)
for
c
in
arg_7
]
else
:
arg_5
=
_getValidCols
(
arg_5
,
arg_1
)
return
H2OFrame
.
_expr
(
expr
=
ExprNode
(
"Func"
,
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
)

def Func(arg_0, arg_1, arg_2=False, arg_3=False, arg_4=None, arg_5=None, arg_6="auto"):
        """
        Merge two datasets based on common column names.  We do not support all_x=True and all_y=True.
        Only one can be True or none is True.  The default Func method is auto and it will default to the
        radix method.  The radix method will return the correct Func result regardless of duplicated rows
         in the right frame.  In addition, the radix method can perform Func even if you have string columns
         in your frames.  If there are duplicated rows in your rite frame, they will not be included if you use
        the hash method.  The hash method cannot perform Func if you have string columns in your left frame.
        Hence, we consider the radix method superior to the hash method and is the default method to use.

        :param H2OFrame other: The frame to Func to the current one. By default, must have at least one column in common with
            this frame, and all columns in common are used as the Func key.  If you want to use only a subset of the
            columns in common, rename the other columns so the columns are unique in the Funcd result.
        :param bool all_x: If True, include all rows from the left/self frame
        :param bool all_y: If True, include all rows from the right/other frame
        :param by_x: list of columns in the current frame to use as a Func key.
        :param by_y: list of columns in the ``other`` frame to use as a Func key. Should have the same number of
            columns as in the ``by_x`` list.
        :param method: string representing the Func method, one of auto(default), radix or hash.

        :returns: New H2OFrame with the result of merging the current frame with the ``other`` frame.
        """

        if arg_4 is None and arg_5 is None:
            arg_7 = list(set(arg_0.names) & set(arg_1.names))
            if not arg_7:
                raise H2OValueError("No columns in common to Func on!")

        if arg_4 is None:
            arg_4 = [arg_0.names.index(c) for c in arg_7]
        else:
            arg_4 = _getValidCols(arg_4,arg_0)

        if arg_5 is None:
            arg_5 = [arg_1.names.index(c) for c in arg_7]
        else:
            arg_5 = _getValidCols(arg_5,arg_1)

        return H2OFrame._expr(expr=ExprNode("Func", arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6))

Merge two datasets based on common column names.  We do not support all_x=True and all_y=True.
        Only one can be True or none is True.  The default merge method is auto and it will default to the
        radix method.  The radix method will return the correct merge result regardless of duplicated rows
         in the right frame.  In addition, the radix method can perform merge even if you have string columns
         in your frames.  If there are duplicated rows in your rite frame, they will not be included if you use
        the hash method.  The hash method cannot perform merge if you have string columns in your left frame.
        Hence, we consider the radix method superior to the hash method and is the default method to use.

        :param H2OFrame other: The frame to merge to the current one. By default, must have at least one column in common with
            this frame, and all columns in common are used as the merge key.  If you want to use only a subset of the
            columns in common, rename the other columns so the columns are unique in the merged result.
        :param bool all_x: If True, include all rows from the left/self frame
        :param bool all_y: If True, include all rows from the right/other frame
        :param by_x: list of columns in the current frame to use as a merge key.
        :param by_y: list of columns in the ``other`` frame to use as a merge key. Should have the same number of
            columns as in the ``by_x`` list.
        :param method: string representing the merge method, one of auto(default), radix or hash.

        :returns: New H2OFrame with the result of merging the current frame with the ``other`` frame.

Merge two datasets based on common column names . We do not support all_x = True and all_y = True . Only one can be True or none is True . The default merge method is auto and it will default to the radix method . The radix method will return the correct merge result regardless of duplicated rows in the right frame . In addition the radix method can perform merge even if you have string columns in your frames . If there are duplicated rows in your rite frame they will not be included if you use the hash method . The hash method cannot perform merge if you have string columns in your left frame . Hence we consider the radix method superior to the hash method and is the default method to use .


def Func(arg_0, arg_1):
        '''Returns index transforms for ``name``.

        :type name: unicode
        :rtype: ``{ create |--> function, transform |--> function }``
        '''
        arg_1 = arg_1.decode('utf-8')
        try:
            return arg_0.Funces[arg_1]
        except KeyError:
            raise KeyError('Index "%s" has not been registered with '
                           'this FC store.' % arg_1)


def
Func
(
arg_0
,
arg_1
)
:
try
:
return
hs_scalar
[
arg_1
]
.
parseString
(
arg_0
,
parseAll
=
True
)
[
0
]
except
pp
.
ParseException
as
pe
:
raise
ZincParseException
(
'Failed to parse scalar: %s'
%
reformat_exception
(
pe
)
,
arg_0
,
1
,
pe
.
col
)
except
:
LOG
.
debug
(
'Failing scalar data: %r (version %r)'
,
arg_0
,
arg_1
)

def Func(arg_0, arg_1):
    """
    Parse a Project Haystack scalar in ZINC format.
    """
    try:
        return hs_scalar[arg_1].parseString(arg_0, parseAll=True)[0]
    except pp.ParseException as pe:
        # Raise a new exception with the appropriate line number.
        raise ZincParseException(
                'Failed to parse scalar: %s' % reformat_exception(pe),
                arg_0, 1, pe.col)
    except:
        LOG.debug('Failing scalar data: %r (version %r)',
                arg_0, arg_1)

Parse a Project Haystack scalar in ZINC format .


def
Func
(
arg_0
:
arg_1
[
arg_2
,
arg_2
]
)
->
str
:
arg_3
=
""
for
arg_4
,
arg_5
in
arg_0
.
items
(
)
:
arg_3
+=
"**"
+
str
(
arg_4
)
+
"**"
+
': '
+
str
(
arg_5
)
+
"  \n"
return
arg_3

def Func(arg_0: arg_1[arg_2, arg_2]) -> str:
    """Format catalog item output

    Parameters:
        item_data: item's attributes values

    Returns:
        [rich_message]: list of formatted rich message
    """

    arg_3 = ""

    for arg_4, arg_5 in arg_0.items():
        arg_3 += "**" + str(arg_4) + "**" + ': ' + str(arg_5) + "  \n"

    return arg_3


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

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , ) : arg_4 = get_client ( 'sts' , arg_0 , arg_1 , arg_2 , arg_3 , ) return arg_4 . get_caller_identity ( ) . get ( 'Account' )

def Func(
    arg_0, arg_1, arg_2,
    arg_3=None,
):
    """Query STS for a users' account_id"""
    arg_4 = get_client(
        'sts', arg_0, arg_1, arg_2,
        arg_3,
    )
    return arg_4.get_caller_identity().get('Account')


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . point_lights . append ( PointLight ( arg_1 , arg_2 ) )

def Func(arg_0, arg_1, arg_2):
        """Add point light"""
        arg_0.point_lights.append(PointLight(arg_1, arg_2))


def Func ( arg_0 ) : arg_0 . token = arg_0 . _required_get_and_update ( 'SREGISTRY_GITLAB_TOKEN' ) arg_0 . headers [ "Private-Token" ] = arg_0 . token

def Func(arg_0):
        '''update secrets will update metadata needed for pull and search
        '''
        arg_0.token = arg_0._required_get_and_update('SREGISTRY_GITLAB_TOKEN')
        arg_0.headers["Private-Token"] = arg_0.token


def Func(arg_0):
    """Remove max=null parameter from URL.

    Patch for Webex Teams Defect: 'next' URL returned in the Link headers of
    the responses contain an errant 'max=null' parameter, which  causes the
    next request (to this URL) to fail if the URL is requested as-is.

    This patch parses the next_url to remove the max=null parameter.

    Args:
        next_url(basestring): The 'next' URL to be parsed and cleaned.

    Returns:
        basestring: The clean URL to be used for the 'next' request.

    Raises:
        AssertionError: If the parameter types are incorrect.
        ValueError: If 'next_url' does not contain a valid API endpoint URL
            (scheme, netloc and path).

    """
    arg_0 = str(arg_0)
    arg_1 = urllib.parse.urlparse(arg_0)

    if not arg_1.scheme or not arg_1.netloc or not arg_1.path:
        raise ValueError(
            "'next_url' must be a valid API endpoint URL, minimally "
            "containing a scheme, netloc and path."
        )

    if arg_1.query:
        arg_2 = arg_1.query.split('&')
        if 'max=null' in arg_2:
            arg_2.remove('max=null')
            warnings.warn("`max=null` still present in next-URL returned "
                          "from Webex Teams", RuntimeWarning)
        arg_3 = '&'.join(arg_2)
        arg_1 = list(arg_1)
        arg_1[4] = arg_3

    return urllib.parse.urlunparse(arg_1)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_2 [ 0 ] . sequence for arg_5 , arg_6 in zip ( arg_3 , range ( arg_4 , arg_4 + len ( arg_3 ) ) ) : arg_5 . sequence = arg_6 arg_5 . serial = arg_2 [ 0 ] . serial arg_3 [ 0 ] . first = arg_2 [ 0 ] . first arg_3 [ 0 ] . last = arg_2 [ 0 ] . last arg_3 [ 0 ] . continued = arg_2 [ 0 ] . continued arg_3 [ - 1 ] . first = arg_2 [ - 1 ] . first arg_3 [ - 1 ] . last = arg_2 [ - 1 ] . last arg_3 [ - 1 ] . complete = arg_2 [ - 1 ] . complete if not arg_3 [ - 1 ] . complete and len ( arg_3 [ - 1 ] . packets ) == 1 : arg_3 [ - 1 ] . position = - 1 arg_13 = b'' . join ( arg_0 . write ( p ) for p in arg_3 ) arg_14 = len ( arg_13 ) arg_1 . seek ( arg_2 [ 0 ] . offset , 0 ) insert_bytes ( arg_1 , arg_14 , arg_2 [ 0 ] . offset ) arg_1 . seek ( arg_2 [ 0 ] . offset , 0 ) arg_1 . write ( arg_13 ) arg_15 = arg_2 [ 0 ] . offset + arg_14 arg_2 . reverse ( ) for arg_16 in arg_2 : arg_17 = arg_16 . offset + arg_14 delete_bytes ( arg_1 , arg_16 . size , arg_17 ) if len ( arg_2 ) != len ( arg_3 ) : arg_1 . seek ( arg_15 , 0 ) arg_8 = arg_3 [ - 1 ] . serial arg_7 = arg_3 [ - 1 ] . sequence + 1 arg_0 . renumber ( arg_1 , arg_8 , arg_7 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """Replace old_pages with new_pages within fileobj.

        old_pages must have come from reading fileobj originally.
        new_pages are assumed to have the 'same' data as old_pages,
        and so the serial and sequence numbers will be copied, as will
        the flags for the first and last pages.

        fileobj will be resized and pages renumbered as necessary. As
        such, it must be opened r+b or w+b.
        """

        # Number the new pages starting from the first old page.
        arg_4 = arg_2[0].sequence
        for arg_5, arg_6 in zip(arg_3, range(arg_4, arg_4 + len(arg_3))):
            arg_5.sequence = arg_6
            arg_5.serial = arg_2[0].serial

        arg_3[0].first = arg_2[0].first
        arg_3[0].last = arg_2[0].last
        arg_3[0].continued = arg_2[0].continued

        arg_3[-1].first = arg_2[-1].first
        arg_3[-1].last = arg_2[-1].last
        arg_3[-1].complete = arg_2[-1].complete
        if not arg_3[-1].complete and len(arg_3[-1].packets) == 1:
            arg_3[-1].position = -1

        arg_13 = b''.join(arg_0.write(p) for p in arg_3)

        # Make room in the file for the new data.
        arg_14 = len(arg_13)
        arg_1.seek(arg_2[0].offset, 0)
        insert_bytes(arg_1, arg_14, arg_2[0].offset)
        arg_1.seek(arg_2[0].offset, 0)
        arg_1.write(arg_13)
        arg_15 = arg_2[0].offset + arg_14

        # Go through the old pages and delete them. Since we shifted
        # the data down the file, we need to adjust their offsets. We
        # also need to go backwards, so we don't adjust the deltas of
        # the other pages.
        arg_2.reverse()
        for arg_16 in arg_2:
            arg_17 = arg_16.offset + arg_14
            delete_bytes(arg_1, arg_16.size, arg_17)

        # Finally, if there's any discrepency in length, we need to
        # renumber the pages for the logical stream.
        if len(arg_2) != len(arg_3):
            arg_1.seek(arg_15, 0)
            arg_8 = arg_3[-1].serial
            arg_7 = arg_3[-1].sequence + 1
            arg_0.renumber(arg_1, arg_8, arg_7)

Replace old_pages with new_pages within fileobj .


def
Func
(
arg_0
,
arg_1
)
:
for
arg_2
in
arg_0
:
log
.
debug
(
'Importing entry_point plugin %s'
,
arg_2
.
name
)
arg_3
=
arg_2
.
load
(
)
if
is_valid_plugin
(
arg_3
,
arg_1
)
:
if
callable
(
getattr
(
arg_3
,
'on_load'
,
)
)
:
arg_3
.
on_load
(
)
arg_1
.
append
(
arg_3
)
return
arg_1

def Func(arg_0, arg_1):
    """
    Load AirflowPlugin subclasses from the entrypoints
    provided. The entry_point group should be 'airflow.plugins'.

    :param entry_points: A collection of entrypoints to search for plugins
    :type entry_points: Generator[setuptools.EntryPoint, None, None]
    :param airflow_plugins: A collection of existing airflow plugins to
        ensure we don't load duplicates
    :type airflow_plugins: list[type[airflow.plugins_manager.AirflowPlugin]]
    :rtype: list[airflow.plugins_manager.AirflowPlugin]
    """
    for arg_2 in arg_0:
        log.debug('Importing entry_point plugin %s', arg_2.name)
        arg_3 = arg_2.load()
        if is_valid_plugin(arg_3, arg_1):
            if callable(getattr(arg_3, 'on_load', None)):
                arg_3.on_load()
                arg_1.append(arg_3)
    return arg_1

Load AirflowPlugin subclasses from the entrypoints provided . The entry_point group should be airflow . plugins .


return self._spec.new_pattern(id_, name, rows, self)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Create a new knitting pattern.

        If rows is :obj:`None` it is replaced with the
        :meth:`new_row_collection`.
        """
        if arg_3 is None:
            arg_3 = arg_0.new_row_collection()
        return arg_0._spec.Func(arg_1, arg_2, arg_3, arg_0)


def Func(arg_0):
        """
        Takes a single address and returns the current balance.
        """
        arg_1 = Address.transactions(arg_0)
        Func = 0
        for arg_3 in arg_1:
            if arg_3.recipientId == arg_0:
                Func += arg_3.amount
            if arg_3.senderId == arg_0:
                Func -= (arg_3.amount + arg_3.fee)

        arg_4 = Delegate.delegates()
        for arg_3 in arg_4:
            if arg_0 == arg_3.address:
                arg_5 = Delegate.blocks(arg_3.pubkey)
                for arg_6 in arg_5:
                    Func += (arg_6.reward + arg_6.totalFee)

        if Func < 0:
            arg_7 = Node.height()
            logger.fatal('Negative balance for address {0}, Nodeheight: {1)'.format(arg_0, arg_7))
            raise NegativeBalanceError('Negative balance for address {0}, Nodeheight: {1)'.format(arg_0, arg_7))
        return Func

Takes a single address and returns the current balance .


(self, metabolites, combine=True, reversibly=True)

def Func(arg_0, arg_1, arg_2=True, arg_3=True):
        """Subtract metabolites from a reaction.

        That means add the metabolites with -1*coefficient. If the final
        coefficient for a metabolite is 0 then the metabolite is removed from
        the reaction.

        Notes
        -----
        * A final coefficient < 0 implies a reactant.
        * The change is reverted upon exit when using the model as a context.

        Parameters
        ----------
        metabolites : dict
            Dictionary where the keys are of class Metabolite and the values
            are the coefficients. These metabolites will be added to the
            reaction.

        combine : bool
            Describes behavior a metabolite already exists in the reaction.
            True causes the coefficients to be added.
            False causes the coefficient to be replaced.

        reversibly : bool
            Whether to add the change to the context to make the change
            reversibly or not (primarily intended for internal use).

        """
        arg_0.add_metabolites({
            arg_4: -arg_5 for arg_4, arg_5 in iteritems(arg_1)},
            arg_2=arg_2, arg_3=arg_3)


def Func(arg_0, arg_1, arg_2=arg_3.float32):
        """
        Creates a Dataset with unknown size.
        Resize it before using.

        :param ds_name: string

        :param dtype: dtype
        Datatype of the dataset

        :return: h5py DataSet
        """
        if arg_1 in arg_0._datasets:
            return arg_0._datasets[arg_1]

        arg_5 = arg_0._group.create_dataset(arg_1, (1, 1), maxshape=None,
                                        arg_2=arg_2)
        arg_0._datasets[arg_1] = arg_5

        return arg_5

Creates a Dataset with unknown size . Resize it before using .


def Func ( arg_0 , arg_1 ) : arg_0 . __nemo__ = arg_1 for arg_3 in arg_0 . __annotations__ : arg_3 . target . expanded = frozenset ( arg_0 . __getinnerreffs__ ( objectId = arg_3 . target . objectId , subreference = arg_3 . target . subreference ) )

def Func(arg_0, arg_1):
        """ Register nemo and parses annotations

        .. note:: Process parses the annotation and extends informations about the target URNs by retrieving resource in range

        :param nemo: Nemo
        """
        arg_0.__nemo__ = arg_1
        for arg_3 in arg_0.__annotations__:
            arg_3.target.expanded = frozenset(
                arg_0.__getinnerreffs__(
                    objectId=arg_3.target.objectId,
                    subreference=arg_3.target.subreference
                )
            )


def Func ( arg_0 , arg_1 ) : assert_is_type ( arg_1 , str ) arg_2 = H2OFrame . _expr ( expr = ExprNode ( "Func" , arg_0 , arg_1 ) ) arg_2 . _ex . _cache . nrows = arg_0 . nrow arg_2 . _ex . _cache . ncol = arg_0 . ncol return arg_2

def Func(arg_0, arg_1):
        """
        For each string, find the count of all possible substrings with 2 characters or more that are contained in
        the line-separated text file whose path is given.

        :param str path_to_words: Path to file that contains a line-separated list of strings considered valid.
        :returns: An H2OFrame with the number of substrings that are contained in the given word list.
        """
        assert_is_type(arg_1, str)
        arg_2 = H2OFrame._expr(expr=ExprNode("Func", arg_0, arg_1))
        arg_2._ex._cache.nrows = arg_0.nrow
        arg_2._ex._cache.ncol = arg_0.ncol
        return arg_2

For each string find the count of all possible substrings with 2 characters or more that are contained in the line - separated text file whose path is given .


def Func(arg_0):
    """Builds the python source code for the Parser TokenType enum."""
    arg_1 = "class TokenType(Enum):\n" \
          "{indent}\"\"\"The token types for parse nodes generated by the Parser.\"\"\"\n" \
          "{indent}" + \
          "\n{indent}".join("{1} = {0}".format(num + 1, r.name) for num, r in enumerate(arg_0.rules))
    return arg_1.format(indent=arg_0.indent)

Builds the python source code for the Parser TokenType enum .


def Func ( arg_0 ) : if arg_0 . parsed_args . git_log : arg_1 = arg_0 . parsed_args . git_log elif not arg_0 . parsed_args . git_path : arg_2 = os . path . expanduser ( '~/.perceval/repositories/' ) arg_3 = arg_0 . parsed_args . uri . lstrip ( '/' ) arg_1 = os . path . join ( arg_2 , arg_3 ) + '-git' else : arg_1 = arg_0 . parsed_args . git_path setattr ( arg_0 . parsed_args , 'gitpath' , arg_1 )

def Func(arg_0):
        """Initialize repositories directory path"""

        if arg_0.parsed_args.git_log:
            arg_1 = arg_0.parsed_args.git_log
        elif not arg_0.parsed_args.git_path:
            arg_2 = os.path.expanduser('~/.perceval/repositories/')
            arg_3 = arg_0.parsed_args.uri.lstrip('/')
            arg_1 = os.path.join(arg_2, arg_3) + '-git'
        else:
            arg_1 = arg_0.parsed_args.git_path

        setattr(arg_0.parsed_args, 'gitpath', arg_1)


def Func(arg_0):
    """Parse out a list of requirements from the given requirements
    requirements file.
    """
    arg_1 = []
    arg_2 = None

    # Iterate over each line in the requirements file.
    for arg_3 in open(arg_0, 'r').read().strip().split('\n'):
        # Sanity check: Is this an empty line?
        # If so, do nothing.
        if not arg_3.strip():
            continue

        # If this is just a plain requirement (not a comment), then
        # add it to the requirements list.
        if not arg_3.startswith('#'):
            arg_1.append(arg_3)
            continue

        # "Header" comments take the form of "=== Python {op} {version} ===",
        # and make the requirement only matter for those versions.
        # If this line is a header comment, parse it.
        arg_4 = re.search(r'^# === [Pp]ython (?P<op>[<>=]{1,2}) '
                          r'(?P<major>[\d])\.(?P<minor>[\d]+) ===[\s]*$', arg_3)
        if arg_4:
            arg_2 = arg_4.groupdict()
            for arg_5 in ('major', 'minor'):
                arg_2[arg_5] = int(arg_2[arg_5])
            continue

        # If this is a comment that otherwise looks like a package, then it
        # should be a package applying only to the current version spec.
        #
        # We can identify something that looks like a package by a lack
        # of any spaces.
        if ' ' not in arg_3[1:].strip() and arg_2:
            arg_6 = arg_3[1:].strip()

            # Sanity check: Is our version of Python one of the ones currently
            # in play?
            arg_7 = arg_2['op']
            arg_8 = (arg_2['major'],
                     arg_2['minor'])
            if '=' in arg_7 and sys.version_info[0:2] == arg_8:
                arg_1.append(arg_6)
            elif '>' in arg_7 and sys.version_info[0:2] > arg_8:
                arg_1.append(arg_6)
            elif '<' in arg_7 and sys.version_info[0:2] < arg_8:
                arg_1.append(arg_6)

    # Okay, we should have an entire list of requirements now.
    return arg_1

Parse out a list of requirements from the given requirements requirements file .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
ipyrad
.
bins
.
samtools
,
"stats"
,
arg_1
.
files
.
mapped_reads
]
arg_3
=
[
"grep"
,
"SN"
]
arg_4
=
sps
.
Popen
(
arg_2
,
stderr
=
sps
.
STDOUT
,
stdout
=
sps
.
PIPE
)
arg_5
=
sps
.
Popen
(
arg_3
,
stderr
=
sps
.
STDOUT
,
stdout
=
sps
.
PIPE
,
stdin
=
arg_4
.
stdout
)
arg_6
=
arg_5
.
communicate
(
)
[
0
]
if
arg_5
.
returncode
:
raise
IPyradWarningExit
(
"error in %s: %s"
,
arg_3
,
arg_6
)
arg_7
=
0
arg_8
=
0
arg_9
=
0
for
arg_10
in
arg_6
.
split
(
"\n"
)
:
if
"insert size average"
in
arg_10
:
arg_7
=
float
(
arg_10
.
split
(
":"
)
[
1
]
.
strip
(
)
)
elif
"insert size standard deviation"
in
arg_10
:
arg_8
=
float
(
arg_10
.
split
(
":"
)
[
1
]
.
strip
(
)
)
+
0.1
elif
"average length"
in
arg_10
:
arg_9
=
float
(
arg_10
.
split
(
":"
)
[
1
]
.
strip
(
)
)
LOGGER
.
debug
(
"avg {} stdv {} avg_len {}"
.
format
(
arg_7
,
arg_8
,
arg_9
)
)
if
all
(
[
arg_7
,
arg_8
,
arg_9
]
)
:
if
arg_8
<
5
:
arg_8
=
5.
if
(
2
*
arg_9
)
<
arg_7
:
arg_11
=
arg_7
+
(
3
*
np
.
math
.
ceil
(
arg_8
)
)
(
2
*
arg_9
)
else
:
arg_11
=
(
arg_7
arg_9
)
+
(
3
*
np
.
math
.
ceil
(
arg_8
)
)
LOGGER
.
info
(
"stdv: hacked insert size is %s"
,
arg_11
)
arg_0
.
_hackersonly
[
"max_inner_mate_distance"
]
=
int
(
np
.
math
.
ceil
(
arg_11
)
)
else
:
arg_0
.
_hackersonly
[
"max_inner_mate_distance"
]
=
300
LOGGER
.
debug
(
"inner mate distance for {} - {}"
.
format
(
arg_1
.
name
,
arg_0
.
_hackersonly
[
"max_inner_mate_distance"
]
)
)

def Func(arg_0, arg_1):
    """
    check mean insert size for this sample and update
    hackersonly.max_inner_mate_distance if need be. This value controls how
    far apart mate pairs can be to still be considered for bedtools merging
    downstream.
    """

    ## pipe stats output to grep
    arg_2 = [ipyrad.bins.samtools, "stats", arg_1.files.mapped_reads]
    arg_3 = ["grep", "SN"]
    arg_4 = sps.Popen(arg_2, stderr=sps.STDOUT, stdout=sps.PIPE)
    arg_5 = sps.Popen(arg_3, stderr=sps.STDOUT, stdout=sps.PIPE, stdin=arg_4.stdout)

    ## get piped result
    arg_6 = arg_5.communicate()[0]

    ## raise exception on failure and do cleanup
    if arg_5.returncode:
        raise IPyradWarningExit("error in %s: %s", arg_3, arg_6)

    ## starting vals
    arg_7 = 0
    arg_8 = 0
    arg_9 = 0

    ## iterate over results
    for arg_10 in arg_6.split("\n"):
        if "insert size average" in arg_10:
            arg_7 = float(arg_10.split(":")[-1].strip())

        elif "insert size standard deviation" in arg_10:
            ## hack to fix sim data when stdv is 0.0. Shouldn't
            ## impact real data bcz stdv gets rounded up below
            arg_8 = float(arg_10.split(":")[-1].strip()) + 0.1

        elif "average length" in arg_10:
            arg_9 = float(arg_10.split(":")[-1].strip())

    LOGGER.debug("avg {} stdv {} avg_len {}"\
                 .format(arg_7, arg_8, arg_9))

    ## If all values return successfully set the max inner mate distance.
    ## This is tricky. avg_insert is the average length of R1+R2+inner mate
    ## distance. avg_len is the average length of a read. If there are lots
    ## of reads that overlap then avg_insert will be close to but bigger than
    ## avg_len. We are looking for the right value for `bedtools merge -d`
    ## which wants to know the max distance between reads.
    if all([arg_7, arg_8, arg_9]):
        ## If 2 * the average length of a read is less than the average
        ## insert size then most reads DO NOT overlap
        if arg_8 < 5:
            arg_8 = 5.
        if (2 * arg_9) < arg_7:
            arg_11 = arg_7 + (3 * np.math.ceil(arg_8)) - (2 * arg_9)

        ## If it is > than the average insert size then most reads DO
        ## overlap, so we have to calculate inner mate distance a little
        ## differently.
        else:
            arg_11 = (arg_7 - arg_9) + (3 * np.math.ceil(arg_8))

        ## set the hackerdict value
        LOGGER.info("stdv: hacked insert size is %s", arg_11)
        arg_0._hackersonly["max_inner_mate_distance"] = int(np.math.ceil(arg_11))

    else:
        ## If something fsck then set a relatively conservative distance
        arg_0._hackersonly["max_inner_mate_distance"] = 300
        LOGGER.debug("inner mate distance for {} - {}".format(arg_1.name,\
                    arg_0._hackersonly["max_inner_mate_distance"]))

check mean insert size for this sample and update hackersonly . max_inner_mate_distance if need be . This value controls how far apart mate pairs can be to still be considered for bedtools merging downstream .


return H2OFrame._expr(expr=ExprNode("x", self, matrix))

def Func(arg_0, arg_1):
        """
        Multiply this frame, viewed as a matrix, by another matrix.

        :param matrix: another frame that you want to Funciply the current frame by; must be compatible with the
            current frame (i.e. its number of rows must be the same as number of columns in the current frame).
        :returns: new H2OFrame, which is the result of Funciplying the current frame by ``matrix``.
        """
        if arg_0.ncols != arg_1.nrows:
            raise H2OValueError("Matrix is not compatible for Funciplication with the current frame")
        return H2OFrame._expr(expr=ExprNode("x", arg_0, arg_1))

Multiply this frame, viewed as a matrix, by another matrix.

        :param matrix: another frame that you want to multiply the current frame by; must be compatible with the
            current frame (i.e. its number of rows must be the same as number of columns in the current frame).
        :returns: new H2OFrame, which is the result of multiplying the current frame by ``matrix``.

Multiply this frame viewed as a matrix by another matrix .


def Func ( arg_0 ) : for arg_1 , arg_2 , arg_3 in parse_tls_records ( arg_0 ) : if arg_1 != b'\x15' : continue if len ( arg_3 ) != 2 : return None return ( int_from_bytes ( arg_3 [ 0 : 1 ] ) , int_from_bytes ( arg_3 [ 1 : 2 ] ) ) return None

def Func(arg_0):
    """
    Parses the handshake for protocol alerts

    :param server_handshake_bytes:
        A byte string of the handshake data received from the server

    :return:
        None or an 2-element tuple of integers:
         0: 1 (warning) or 2 (fatal)
         1: The alert description (see https://tools.ietf.org/html/rfc5246#section-7.2)
    """

    for arg_1, arg_2, arg_3 in parse_tls_records(arg_0):
        if arg_1 != b'\x15':
            continue
        if len(arg_3) != 2:
            return None
        return (int_from_bytes(arg_3[0:1]), int_from_bytes(arg_3[1:2]))
    return None


def Func ( arg_0 ) : arg_1 = None arg_2 = [ ] for arg_3 in arg_0 . activeSegments : if arg_3 . cell != arg_1 : arg_2 . append ( arg_3 . cell ) arg_1 = arg_3 . cell return arg_2

def Func(arg_0):
    """ Returns the indices of the predictive cells.

    :returns: (list) Indices of predictive cells.
    """
    arg_1 = None
    arg_2 = []
    for arg_3 in arg_0.activeSegments:
      if arg_3.cell != arg_1:
        arg_2.append(arg_3.cell)
        arg_1 = arg_3.cell

    return arg_2

Returns the indices of the predictive cells .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . preprocessors : arg_1 . extend ( arg_2 . Func ( ) or [ ] ) return arg_1

def Func(arg_0):
        """
        Calls `Func` on all our Preprocessor objects.

        Returns:
            A list of tensors to be fetched.
        """
        arg_1 = []
        for arg_2 in arg_0.preprocessors:
            arg_1.extend(arg_2.Func() or [])
        return arg_1

Calls `reset` on all our Preprocessor objects.

        Returns:
            A list of tensors to be fetched.

Calls reset on all our Preprocessor objects .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in _iexplode_path ( arg_0 ) : arg_1 . append ( Func_part ( arg_2 ) ) arg_3 = '[%s]' % re . escape ( SEPARATORS ) arg_4 = _join_translated ( arg_1 , arg_3 ) return '{res}\\Z(?ms)' . format ( arg_4 = arg_4 )

def Func(arg_0):
    """Translate a glob PATTERN to a regular expression."""
    arg_1 = []
    for arg_2 in _iexplode_path(arg_0):
        arg_1.append(Func_part(arg_2))
    arg_3 = '[%s]' % re.escape(SEPARATORS)
    arg_4 = _join_translated(arg_1, arg_3)
    return '{res}\\Z(?ms)'.format(arg_4=arg_4)

Translate a glob PATTERN to a regular expression .