def Func ( arg_0 ) : arg_1 = arg_0 . reactions arg_2 = arg_0 . metabolites arg_3 = OrderedDict ( ) arg_3 [ "mets" ] = _cell ( [ met_id for met_id in create_mat_metabolite_id ( arg_0 ) ] ) arg_3 [ "metNames" ] = _cell ( arg_2 . list_attr ( "name" ) ) arg_3 [ "metFormulas" ] = _cell ( [ str ( m . formula ) for m in arg_2 ] ) try : arg_3 [ "metCharge" ] = array ( arg_2 . list_attr ( "charge" ) ) * 1. except TypeError : pass arg_3 [ "genes" ] = _cell ( arg_0 . genes . list_attr ( "id" ) ) arg_4 = scipy_sparse . dok_matrix ( ( len ( arg_0 . reactions ) , len ( arg_0 . genes ) ) ) if min ( arg_4 . shape ) > 0 : for arg_5 , arg_6 in enumerate ( arg_0 . reactions ) : for arg_7 in arg_6 . genes : arg_4 [ arg_5 , arg_0 . genes . index ( arg_7 ) ] = 1 arg_3 [ "rxnGeneMat" ] = arg_4 arg_3 [ "grRules" ] = _cell ( arg_1 . list_attr ( "gene_reaction_rule" ) ) arg_3 [ "rxns" ] = _cell ( arg_1 . list_attr ( "id" ) ) arg_3 [ "rxnNames" ] = _cell ( arg_1 . list_attr ( "name" ) ) arg_3 [ "subSystems" ] = _cell ( arg_1 . list_attr ( "subsystem" ) ) arg_10 = create_stoichiometric_matrix ( arg_0 ) arg_3 [ "S" ] = arg_10 if arg_10 is not None else [ [ ] ] arg_3 [ "lb" ] = array ( arg_1 . list_attr ( "lower_bound" ) ) * 1. arg_3 [ "ub" ] = array ( arg_1 . list_attr ( "upper_bound" ) ) * 1. arg_3 [ "b" ] = array ( arg_2 . list_attr ( "_bound" ) ) * 1. arg_3 [ "c" ] = array ( arg_1 . list_attr ( "objective_coefficient" ) ) * 1. arg_3 [ "rev" ] = array ( arg_1 . list_attr ( "reversibility" ) ) * 1 arg_3 [ "description" ] = str ( arg_0 . id ) return arg_3

def Func(arg_0):
    """create a dict mapping model attributes to arrays"""
    arg_1 = arg_0.reactions
    arg_2 = arg_0.metabolites
    arg_3 = OrderedDict()
    arg_3["mets"] = _cell([met_id for met_id in create_mat_metabolite_id(arg_0)])
    arg_3["metNames"] = _cell(arg_2.list_attr("name"))
    arg_3["metFormulas"] = _cell([str(m.formula) for m in arg_2])
    try:
        arg_3["metCharge"] = array(arg_2.list_attr("charge")) * 1.
    except TypeError:
        # can't have any None entries for charge, or this will fail
        pass
    arg_3["genes"] = _cell(arg_0.genes.list_attr("id"))
    # make a matrix for rxnGeneMat
    # reactions are rows, genes are columns
    arg_4 = scipy_sparse.dok_matrix((len(arg_0.reactions),
                                        len(arg_0.genes)))
    if min(arg_4.shape) > 0:
        for arg_5, arg_6 in enumerate(arg_0.reactions):
            for arg_7 in arg_6.genes:
                arg_4[arg_5, arg_0.genes.index(arg_7)] = 1
        arg_3["rxnGeneMat"] = arg_4
    arg_3["grRules"] = _cell(arg_1.list_attr("gene_reaction_rule"))
    arg_3["rxns"] = _cell(arg_1.list_attr("id"))
    arg_3["rxnNames"] = _cell(arg_1.list_attr("name"))
    arg_3["subSystems"] = _cell(arg_1.list_attr("subsystem"))
    arg_10 = create_stoichiometric_matrix(arg_0)
    arg_3["S"] = arg_10 if arg_10 is not None else [[]]
    # multiply by 1 to convert to float, working around scipy bug
    # https://github.com/scipy/scipy/issues/4537
    arg_3["lb"] = array(arg_1.list_attr("lower_bound")) * 1.
    arg_3["ub"] = array(arg_1.list_attr("upper_bound")) * 1.
    arg_3["b"] = array(arg_2.list_attr("_bound")) * 1.
    arg_3["c"] = array(arg_1.list_attr("objective_coefficient")) * 1.
    arg_3["rev"] = array(arg_1.list_attr("reversibility")) * 1
    arg_3["description"] = str(arg_0.id)
    return arg_3


return regex.sub(lambda mo: dict[mo.string[mo.start():mo.end()]], text)

def Func ( arg_0 , arg_1 ) : arg_2 = re . compile ( "(%s)" % "|" . join ( map ( re . escape , arg_0 . keys ( ) ) ) ) return arg_2 . sub ( lambda mo : arg_0 [ mo . string [ mo . start ( ) : mo . end ( ) ] ] , arg_1 )

def Func(arg_0, arg_1):
    """ Replace in 'text' all occurences of any key in the given
    dictionary by its corresponding value.  Returns the new string."""

    # Function by Xavier Defrang, originally found at:
    # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81330

    # Create a regular expression  from the dictionary keys
    arg_2 = re.compile("(%s)" % "|".join(map(re.escape, arg_0.keys())))
    # For each match, look-up corresponding value in dictionary
    return arg_2.sub(lambda mo: arg_0[mo.string[mo.start():mo.end()]], arg_1)

Replace in text all occurences of any key in the given dictionary by its corresponding value . Returns the new string .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
if
arg_1
is
not
:
try
:
arg_2
=
arg_1
[
arg_0
]
except
IndexError
:
raise
ValidationError
(
"Names value out of range: {}"
.
format
(
arg_0
)
)
from
arg_3
=
arg_2
else
:
arg_3
=
repr
(
arg_2
)
return
arg_2
,
arg_3

def Func(arg_0, arg_1):
    """Helper to get optional details about named references

       Returns the dereferenced name as both value and repr if the name
       list is defined.
       Otherwise returns the name index and its repr().
    """
    arg_2 = arg_0
    if arg_1 is not None:
        try:
            arg_2 = arg_1[arg_0]
        except IndexError:
            raise ValidationError("Names value out of range: {}".format(arg_0)) from None
        arg_3 = arg_2
    else:
        arg_3 = repr(arg_2)
    return arg_2, arg_3


return ''.join([self._normalize.get(x, x) for x in nfd(string)])

def Func ( arg_0 , arg_1 ) : return '' . join ( [ arg_0 . _Func . get ( arg_2 , arg_2 ) for arg_2 in nfd ( arg_1 ) ] )

def Func(arg_0, arg_1):
        """Normalize the string according to normalization list"""
        return ''.join([arg_0._Func.get(arg_2, arg_2) for arg_2 in nfd(arg_1)])


return {
            'tb_frame': frame,
            'tb_lineno': self.tb_lineno,
            'tb_next': tb_next,
        }

def Func(arg_0):
        """Convert a Traceback into a dictionary representation"""
        if arg_0.tb_next is None:
            arg_1 = None
        else:
            arg_1 = arg_0.tb_next.Func()

        arg_2 = {
            'co_filename': arg_0.tb_frame.f_code.co_filename,
            'co_name': arg_0.tb_frame.f_code.co_name,
        }
        arg_3 = {
            'f_globals': arg_0.tb_frame.f_globals,
            'f_code': arg_2,
        }
        return {
            'tb_frame': arg_3,
            'tb_lineno': arg_0.tb_lineno,
            'tb_next': arg_1,
        }


Basic demo of the monitoring capabilities.

def Func(arg_0, arg_1):
    """Basic Func of the monitoring capabilities."""
    # logging.basicConfig(level=logging.DEBUG)

    arg_2 = asyncio.get_event_loop()
    arg_3 = AsyncSatel(arg_0,
                     arg_1,
                     arg_2,
                     [1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 15, 16, 17, 18, 19,
                      20, 21, 22, 23, 25, 26, 27, 28, 29, 30],
                     [8, 9, 10]
                     )

    arg_2.run_until_complete(arg_3.connect())
    arg_2.create_task(arg_3.arm("3333", 1))
    arg_2.create_task(arg_3.disarm("3333"))
    arg_2.create_task(arg_3.keep_alive())
    arg_2.create_task(arg_3.monitor_status())

    arg_2.run_forever()
    arg_2.close()

Basic demo of the monitoring capabilities .


def Func(arg_0):
        '''
        Instantiate a BlockadeConfig instance based on
        a given dictionary of configuration values
        '''
        try:
            arg_1 = arg_0['containers']
            arg_2 = {}
            for arg_3, arg_4 in arg_1.items():
                try:
                    # one config entry might result in many container
                    # instances (indicated by the 'count' config value)
                    for arg_5 in BlockadeContainerConfig.Func(arg_3, arg_4):
                        # check for duplicate 'container_name' definitions
                        if arg_5.container_name:
                            arg_6 = arg_5.container_name
                            arg_7 = [c for c in arg_2.values() if c.container_name == arg_6]
                            if arg_7:
                                raise BlockadeConfigError("Duplicate 'container_name' definition: %s" % (arg_6))
                        arg_2[arg_5.name] = arg_5
                except Exception as err:
                    raise BlockadeConfigError(
                        "Container '%s' config problem: %s" % (arg_3, err))

            arg_8 = arg_0.get('network')
            if arg_8:
                arg_9 = _DEFAULT_NETWORK_CONFIG.copy()
                arg_9.update(arg_8)
                arg_8 = arg_9
            else:
                arg_8 = _DEFAULT_NETWORK_CONFIG.copy()

            return BlockadeConfig(arg_2, arg_8=arg_8)

        except KeyError as err:
            raise BlockadeConfigError("Config missing value: " + str(err))

        except Exception as err:
            # TODO log this to some debug stream?
            raise BlockadeConfigError("Failed to load config: " + str(err))


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = "failed" in arg_1 . _result arg_4 = "unreachable" in arg_1 . _result if ( "print_action" in arg_1 . _task . tags or arg_3 or arg_4 or arg_0 . _display . verbosity > 1 ) : arg_0 . _print_task ( ) arg_0 . last_skipped = False arg_6 = unicode ( arg_1 . _result . get ( "msg" , "" ) ) or unicode ( arg_1 . _result . get ( "reason" , "" ) ) or unicode ( arg_1 . _result . get ( "message" , "" ) ) arg_7 = [ arg_1 . _result . get ( "exception" , None ) , arg_1 . _result . get ( "module_stderr" , None ) , ] arg_7 = "\n" . join ( [ e for e in arg_7 if e ] ) . strip ( ) arg_0 . _print_host_or_item ( arg_1 . _host , arg_1 . _result . get ( "changed" , False ) , arg_6 , arg_1 . _result . get ( "diff" , None ) , is_host = True , error = arg_3 or arg_4 , stdout = arg_1 . _result . get ( "module_stdout" , None ) , arg_7 = arg_7 . strip ( ) , ) if "results" in arg_1 . _result : for arg_8 in arg_1 . _result [ "results" ] : arg_3 = "failed" in arg_8 arg_7 = [ arg_8 . get ( "exception" , None ) , arg_8 . get ( "module_stderr" , None ) ] arg_7 = "\n" . join ( [ e for e in arg_7 if e ] ) . strip ( ) arg_0 . _print_host_or_item ( arg_8 [ "item" ] , arg_8 . get ( "changed" , False ) , unicode ( arg_8 . get ( "msg" , "" ) ) , arg_8 . get ( "diff" , None ) , is_host = False , error = arg_3 , stdout = arg_8 . get ( "module_stdout" , None ) , arg_7 = arg_7 . strip ( ) , ) else : arg_0 . last_skipped = True print ( "." , end = "" )

def Func(arg_0, arg_1, **arg_2):
        """Run when a task finishes correctly."""
        arg_3 = "failed" in arg_1._result
        arg_4 = "unreachable" in arg_1._result

        if (
            "print_action" in arg_1._task.tags
            or arg_3
            or arg_4
            or arg_0._display.verbosity > 1
        ):
            arg_0._print_task()
            arg_0.last_skipped = False
            arg_6 = unicode(arg_1._result.get("msg", "")) or unicode(
                arg_1._result.get("reason", "")
            ) or unicode(
                arg_1._result.get("message", "")
            )

            arg_7 = [
                arg_1._result.get("exception", None),
                arg_1._result.get("module_stderr", None),
            ]
            arg_7 = "\n".join([e for e in arg_7 if e]).strip()

            arg_0._print_host_or_item(
                arg_1._host,
                arg_1._result.get("changed", False),
                arg_6,
                arg_1._result.get("diff", None),
                is_host=True,
                error=arg_3 or arg_4,
                stdout=arg_1._result.get("module_stdout", None),
                arg_7=arg_7.strip(),
            )

            if "results" in arg_1._result:
                for arg_8 in arg_1._result["results"]:
                    arg_3 = "failed" in arg_8

                    arg_7 = [arg_8.get("exception", None), arg_8.get("module_stderr", None)]
                    arg_7 = "\n".join([e for e in arg_7 if e]).strip()

                    arg_0._print_host_or_item(
                        arg_8["item"],
                        arg_8.get("changed", False),
                        unicode(arg_8.get("msg", "")),
                        arg_8.get("diff", None),
                        is_host=False,
                        error=arg_3,
                        stdout=arg_8.get("module_stdout", None),
                        arg_7=arg_7.strip(),
                    )
        else:
            arg_0.last_skipped = True
            print(".", end="")


def Func(arg_0, arg_1, arg_2=False):
    """Return True if the affine matrix of one_img is close to the affine matrix of another_img.
    False otherwise.

    Parameters
    ----------
    one_img: nibabel.Nifti1Image

    another_img: nibabel.Nifti1Image

    only_check_3d: bool
        If True will extract only the 3D part of the affine matrices when they have more dimensions.

    Returns
    -------
    bool

    Raises
    ------
    ValueError

    """
    arg_3 = check_img(arg_0)
    arg_4 = check_img(arg_1)

    arg_5 = len(arg_3.shape)
    arg_6 = len(arg_4.shape)

    if arg_5 < 3:
        raise ValueError('Image {} has only {} dimensions, at least 3 dimensions is expected.'.format(repr_imgs(arg_3), arg_5))

    if arg_6 < 3:
        raise ValueError('Image {} has only {} dimensions, at least 3 dimensions is expected.'.format(repr_imgs(arg_4), arg_5))

    arg_7 = arg_3.get_affine()
    arg_8 = arg_4.get_affine()
    if arg_2:
        arg_7 = arg_7[:3, :3]
        arg_8 = arg_8[:3, :3]

    try:
        return np.allclose(arg_7, arg_8)
    except ValueError:
        return False
    except:
        raise

Return True if the affine matrix of one_img is close to the affine matrix of another_img . False otherwise .


return StreamThrottle(
            read=self.read.clone(),
            write=self.write.clone()
        )

def Func ( arg_0 ) : return StreamThrottle ( read = arg_0 . read . Func ( ) , write = arg_0 . write . Func ( ) )

def Func(arg_0):
        """
        Clone throttles without memory
        """
        return StreamThrottle(
            read=arg_0.read.Func(),
            write=arg_0.write.Func()
        )


def Func(arg_0, arg_1, arg_2):
    """
    Register a new range type as a PostgreSQL range.

        >>> Func("int4range", intrange, conn)

    The above will make sure intrange is regarded as an int4range for queries
    and that int4ranges will be cast into intrange when fetching rows.

    pgrange should be the full name including schema for the custom range type.

    Note that adaption is global, meaning if a range type is passed to a regular
    psycopg2 connection it will adapt it to its proper range type. Parsing of
    rows from the database however is not global and just set on a per connection
    basis.
    """

    register_adapter(arg_1, partial(adapt_range, arg_0))
    register_range_caster(
        arg_0, arg_1, *query_range_oids(arg_0, arg_2), scope=arg_2)

Register a new range type as a PostgreSQL range.

        >>> register_range_type("int4range", intrange, conn)

    The above will make sure intrange is regarded as an int4range for queries
    and that int4ranges will be cast into intrange when fetching rows.

    pgrange should be the full name including schema for the custom range type.

    Note that adaption is global, meaning if a range type is passed to a regular
    psycopg2 connection it will adapt it to its proper range type. Parsing of
    rows from the database however is not global and just set on a per connection
    basis.

Register a new range type as a PostgreSQL range .


def Func ( arg_0 ) : arg_0 = arg_0 . split ( "\n" ) arg_1 = [ ] for arg_2 in arg_0 : arg_2 = arg_2 . split ( ) if len ( arg_2 ) == 5 : for arg_3 , arg_4 in enumerate ( arg_2 ) : if arg_3 == 0 : arg_2 [ arg_3 ] = int ( arg_2 [ arg_3 ] ) else : arg_2 [ arg_3 ] = float ( arg_2 [ arg_3 ] ) arg_1 . append ( arg_2 ) return arg_1

def Func(arg_0):
    r"""Input string format of class, x, y, w, h, return list of list format.

    Parameters
    -----------
    annotations : str
        The annotations in darkent format "class, x, y, w, h ...." seperated by "\\n".

    Returns
    -------
    list of list of 4 numbers
        List of bounding box.

    """
    arg_0 = arg_0.split("\n")
    arg_1 = []
    for arg_2 in arg_0:
        arg_2 = arg_2.split()
        if len(arg_2) == 5:
            for arg_3, arg_4 in enumerate(arg_2):
                if arg_3 == 0:
                    arg_2[arg_3] = int(arg_2[arg_3])
                else:
                    arg_2[arg_3] = float(arg_2[arg_3])
            arg_1.append(arg_2)
    return arg_1

r Input string format of class x y w h return list of list format .


return self.__expect(timeout=timeout or self._timeout)

def Func(arg_0, arg_1, arg_2=None):
        """Write output to the port and wait for response"""
        arg_0.__writeln(arg_1)
        arg_0._port.flush()
        return arg_0.__expect(arg_2=arg_2 or arg_0._timeout)


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
in
TYPES
:
return
arg_1
arg_2
=
dict
(
zip
(
TYPES
,
TYPES
)
)
arg_2
.
update
(
{
'line'
:
'lc'
,
'bar'
:
'bvs'
,
'pie'
:
'p'
,
'venn'
:
'v'
,
'scater'
:
's'
,
'radar'
:
'r'
,
'meter'
:
'gom'
,
}
)
assert
arg_1
in
arg_2
,
'Invalid chart type: %s'
%
arg_1
return
arg_2
[
arg_1
]

def Func(arg_0, arg_1):
        """Check to see if the type is either in TYPES or fits type name

        Returns proper type
        """
        if arg_1 in TYPES:
            return arg_1
        arg_2 = dict(zip(TYPES,TYPES))
        arg_2.update({
            'line': 'lc',
            'bar': 'bvs',
            'pie': 'p',
            'venn': 'v',
            'scater': 's',
            'radar': 'r',
            'meter': 'gom',
        })
        assert arg_1 in arg_2, 'Invalid chart type: %s'%arg_1
        return arg_2[arg_1]


return H2OFrame._expr(expr=ExprNode("toupper", self), cache=self._ex._cache)

def Func ( arg_0 ) : return H2OFrame . _expr ( expr = ExprNode ( "Func" , arg_0 ) , cache = arg_0 . _ex . _cache )

def Func(arg_0):
        """
        Translate characters from lower to upper case for a particular column.

        :returns: new H2OFrame with all strings in the current frame converted to the uppercase.
        """
        return H2OFrame._expr(expr=ExprNode("Func", arg_0), cache=arg_0._ex._cache)

Translate characters from lower to upper case for a particular column .


def Func(arg_0, arg_1, arg_2=None):
        "Adds the item to the control, associating the given data if not None."
        arg_0.wx_obj.Append(arg_1, arg_2)
        # reverse association:
        arg_0._items_dict[arg_2] = arg_1

Adds the item to the control associating the given data if not None .


def Func ( arg_0 , * arg_1 ) : for arg_2 in arg_1 : arg_0 . files . append ( FilePath ( arg_2 , arg_0 ) )

def Func(arg_0, *arg_1):
        """
        Add single file or list of files to bundle

        :type: file_path: str|unicode
        """
        for arg_2 in arg_1:
            arg_0.files.append(FilePath(arg_2, arg_0))


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
requests
.
get
(
arg_1
)
except
requests
.
ConnectionError
:
raise
exceptions
.
RetrieveError
(
'Connection fail'
)
if
arg_2
.
status_code
>=
400
:
raise
exceptions
.
RetrieveError
(
'Connected, but status code is %s'
%
(
arg_2
.
status_code
)
)
arg_3
=
arg_2
.
url
arg_4
=
arg_2
.
content
try
:
arg_5
=
arg_2
.
headers
[
'Content-Type'
]
except
KeyError
:
arg_5
,
arg_6
=
mimetypes
.
guess_type
(
arg_3
,
strict
=
False
)
arg_0
.
response
=
arg_2
return
arg_5
.
lower
(
)
,
arg_4

def Func(arg_0, arg_1):
        """
        Use requests to fetch remote content
        """

        try:
            arg_2 = requests.get(arg_1)
        except requests.ConnectionError:
            raise exceptions.RetrieveError('Connection fail')

        if arg_2.status_code >= 400:
            raise exceptions.RetrieveError('Connected, but status code is %s' % (arg_2.status_code))

        arg_3 = arg_2.url
        arg_4 = arg_2.content

        try:
            arg_5 = arg_2.headers['Content-Type']
        except KeyError:
            arg_5, arg_6 = mimetypes.guess_type(arg_3, strict=False)

        arg_0.response = arg_2

        return arg_5.lower(), arg_4


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_1 . user . is_staff : arg_4 = arg_1 . query_params . get ( 'email' , None ) arg_5 = arg_1 . query_params . get ( 'username' , None ) arg_6 = { } if arg_4 : arg_6 . update ( arg_4 = arg_4 ) if arg_5 : arg_6 . update ( arg_5 = arg_5 ) if arg_6 : arg_7 = User . objects . filter ( ** arg_6 ) . values_list ( 'id' , flat = True ) arg_2 = arg_2 . filter ( user_id__in = arg_7 ) else : arg_2 = arg_2 . filter ( user_id = arg_1 . user . id ) return arg_2

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Apply incoming filters only if user is staff. If not, only filter by user's ID.
        """
        if arg_1.user.is_staff:
            arg_4 = arg_1.query_params.get('email', None)
            arg_5 = arg_1.query_params.get('username', None)
            arg_6 = {}

            if arg_4:
                arg_6.update(arg_4=arg_4)
            if arg_5:
                arg_6.update(arg_5=arg_5)
            if arg_6:
                arg_7 = User.objects.filter(**arg_6).values_list('id', flat=True)
                arg_2 = arg_2.filter(user_id__in=arg_7)
        else:
            arg_2 = arg_2.filter(user_id=arg_1.user.id)

        return arg_2

Apply incoming filters only if user is staff . If not only filter by user s ID .


(store, institute_id, case_name, variant_id, user_email, criteria)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """Calculate an ACMG classification based on a list of criteria."""
    arg_6, arg_7 = institute_and_case(arg_0, arg_1, arg_2)
    arg_8 = arg_0.variant(arg_3)
    arg_9 = arg_0.user(arg_4)
    arg_10 = url_for('variants.variant', arg_1=arg_1,
                           arg_2=arg_2, arg_3=arg_3)
    arg_11 = arg_0.submit_evaluation(
        arg_6=arg_6,
        arg_7=arg_7,
        arg_8=arg_8,
        arg_9=arg_9,
        link=arg_10,
        arg_5=arg_5,
    )
    return arg_11

Calculate an ACMG classification based on a list of criteria .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
=
arg_1
.
shape
[
0
]
if
arg_1
.
shape
!=
(
arg_3
,
arg_3
)
:
raise
TypeError
(
"Input must be a square matrix."
)
arg_4
=
get_memory
(
arg_0
.
memory
)
arg_5
=
not
arg_0
.
copy
and
arg_0
.
negatives_likely
arg_6
,
arg_7
=
arg_4
.
cache
(
scipy
.
linalg
.
eigh
,
ignore
=
[
'overwrite_a'
]
)
(
arg_1
,
overwrite_a
=
arg_5
)
arg_6
=
arg_6
[
:
,
]
arg_0
.
clip_
=
np
.
dot
(
arg_7
,
np
.
sign
(
arg_6
)
*
arg_7
.
T
)
if
arg_5
or
arg_6
[
0
,
0
]
<
0
:
del
arg_1
np
.
abs
(
arg_6
,
out
=
arg_6
)
arg_1
=
np
.
dot
(
arg_7
,
arg_6
*
arg_7
.
T
)
del
arg_6
,
arg_7
arg_1
=
Symmetrize
(
copy
=
False
)
.
Func
(
arg_1
)
return
arg_1

def Func(arg_0, arg_1, arg_2=None):
        '''
        Flips the negative eigenvalues of X.

        Parameters
        ----------
        X : array, shape [n, n]
            The *symmetric* input similarities. If X is asymmetric, it will be
            treated as if it were symmetric based on its lower-triangular part.

        Returns
        -------
        Xt : array, shape [n, n]
            The transformed training similarities.
        '''
        arg_3 = arg_1.shape[0]
        if arg_1.shape != (arg_3, arg_3):
            raise TypeError("Input must be a square matrix.")

        arg_4 = get_memory(arg_0.memory)
        arg_5 = not arg_0.copy and arg_0.negatives_likely
        arg_6, arg_7 = arg_4.cache(scipy.linalg.eigh, ignore=['overwrite_a'])(
            arg_1, overwrite_a=arg_5)
        arg_6 = arg_6[:, None]

        arg_0.clip_ = np.dot(arg_7, np.sign(arg_6) * arg_7.T)

        if arg_5 or arg_6[0, 0] < 0:
            del arg_1
            np.abs(arg_6, out=arg_6)
            arg_1 = np.dot(arg_7, arg_6 * arg_7.T)
            del arg_6, arg_7

            # should be symmetric, but make sure because floats
            arg_1 = Symmetrize(copy=False).Func(arg_1)
        return arg_1


(script, r_func='r', theta_func='theta', z_func='z')

def
Func
(
arg_0
,
arg_1
=
'r'
,
arg_2
=
'theta'
,
arg_3
=
'z'
)
:
arg_4
=
'sqrt(x^2+y^2)'
if
isinstance
(
arg_0
,
FilterScript
)
and
arg_0
.
ml_version
>=
'2016.12'
:
arg_5
=
'atan2(y, x)'
else
:
arg_5
=
mp_func
.
mp_atan2
(
'y'
,
'x'
)
arg_1
=
re
.
sub
(
r"\br\b"
,
arg_4
,
arg_1
)
.
replace
(
'theta'
,
arg_5
)
arg_2
=
re
.
sub
(
r"\br\b"
,
arg_4
,
arg_2
)
.
replace
(
'theta'
,
arg_5
)
arg_3
=
re
.
sub
(
r"\br\b"
,
arg_4
,
arg_3
)
.
replace
(
'theta'
,
arg_5
)
arg_6
=
'(r)*cos(theta)'
.
replace
(
'r'
,
arg_1
)
.
replace
(
'theta'
,
arg_2
)
arg_7
=
'(r)*sin(theta)'
.
replace
(
'r'
,
arg_1
)
.
replace
(
'theta'
,
arg_2
)
vert_function
(
arg_0
,
arg_6
,
arg_7
,
arg_3
)
return

def Func(arg_0, arg_1='r', arg_2='theta', arg_3='z'):
    """Geometric function using cylindrical coordinates.

    Define functions in Z up cylindrical coordinates, with radius 'r',
    angle 'theta', and height 'z'

    See "function" docs for additional usage info and accepted parameters.

    Args:
        r_func (str): function to generate new coordinates for radius
        theta_func (str): function to generate new coordinates for angle.
            0 degrees is on the +X axis.
        z_func (str): function to generate new coordinates for height

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
    """

    arg_4 = 'sqrt(x^2+y^2)'
    # In newer MeshLab atan2 is builtin to muparser
    if isinstance(arg_0, FilterScript) and arg_0.ml_version >= '2016.12':
        arg_5 = 'atan2(y, x)'
    else:
        arg_5 = mp_func.mp_atan2('y', 'x')

    # Use re matching to match whole word; this prevents matching
    # 'sqrt' and 'rint' when replacing 'r'
    arg_1 = re.sub(r"\br\b", arg_4, arg_1).replace('theta', arg_5)
    arg_2 = re.sub(r"\br\b", arg_4, arg_2).replace('theta', arg_5)
    arg_3 = re.sub(r"\br\b", arg_4, arg_3).replace('theta', arg_5)

    arg_6 = '(r)*cos(theta)'.replace('r', arg_1).replace('theta', arg_2)
    arg_7 = '(r)*sin(theta)'.replace('r', arg_1).replace('theta', arg_2)

    vert_function(arg_0, arg_6, arg_7, arg_3)
    return None

Geometric function using cylindrical coordinates .


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_1 . get ( 'extensions' , None ) arg_3 = arg_1 . get ( '_return_info' , False ) arg_1 [ '_root_info' ] = _rectify_root_info ( arg_1 . get ( '_root_info' , None ) ) arg_4 = None arg_5 = None if arg_2 : arg_6 = arg_2 . lookup ( arg_0 ) if arg_6 is not None : arg_4 = arg_6 ( arg_0 , ** arg_1 ) if arg_4 is None : if isinstance ( arg_0 , dict ) : arg_4 , arg_5 = _format_dict ( arg_0 , ** arg_1 ) elif isinstance ( arg_0 , ( list , tuple , set , frozenset ) ) : arg_4 , arg_5 = _format_list ( arg_0 , ** arg_1 ) if arg_4 is None : arg_6 = _FORMATTER_EXTENSIONS . lookup ( arg_0 ) if arg_6 is not None : arg_4 = arg_6 ( arg_0 , ** arg_1 ) else : arg_4 = _format_object ( arg_0 , ** arg_1 ) if arg_3 : arg_5 = _rectify_leaf_info ( arg_5 ) return arg_4 , arg_5 else : return arg_4

def Func(arg_0, **arg_1):
    """
    Makes a pretty and easy-to-doctest string representation!

    This is an alternative to repr, and `pprint.pformat` that attempts to be
    both more configurable and generate output that is consistent between
    python versions.

    Notes:
        This function has many keyword arguments that can be used to customize
        the final representation. For convinience some of the more frequently
        used kwargs have short aliases. See `Args` for more details.

    Args:
        data (object): an arbitrary python object
        **kwargs: see `the Kwargs` section

    Kwargs:
        si, stritems, (bool):
            dict/list items use str instead of repr

        strkeys, sk (bool):
            dict keys use str instead of repr

        strvals, sv (bool):
            dict values use str instead of repr

        nl, newlines (int | bool):
            number of top level nestings to place a newline after. If true all
            items are followed by newlines regardless of nesting level.
            Defaults to 1 for lists and True for dicts.

        nobr, nobraces (bool, default=False):
            if True, text will not contain outer braces for containers

        cbr, compact_brace (bool, default=False):
            if True, braces are compactified (i.e. they will not have newlines
            placed directly after them, think java / K&R / 1TBS)

        trailsep, trailing_sep (bool):
            if True, a separator is placed after the last item in a sequence.
            By default this is True if there are any `nl > 0`.

        explicit (bool, default=False):
            changes dict representation from `{k1: v1, ...}` to
            `dict(k1=v1, ...)`.

        precision (int, default=None):
            if specified floats are formatted with this precision

        kvsep (str, default=': '):
            separator between keys and values

        itemsep (str, default=' '):
            separator between items

        sort (bool):
            if True, attempts to sort all unordered collections in the returned
            text. NOTE: currently if True this will sort lists, this may not be
            a correct thing to do, as such the behavior of this arg is subject
            to change.

        suppress_small (bool):
            passed to `numpy.array2string` for ndarrays

        max_line_width (int):
            passed to `numpy.array2string` for ndarrays

        with_dtype (bool):
            only relevant to ndarrays. if True includes the dtype.

    Returns:
        str: outstr: output string

    Notes:
        There are also internal kwargs, which should not be used:
            _return_info (bool):  return information about child context
            _root_info (depth): information about parent context

    CommandLine:
        python -m ubelt.util_format Func:0
        python -m ubelt.util_format Func:1

    Example:
        >>> from ubelt.util_format import *
        >>> import ubelt as ub
        >>> dict_ = {
        ...     'custom_types': [slice(0, 1, None), 1/3],
        ...     'nest_dict': {'k1': [1, 2, {3: {4, 5}}],
        ...                   'key2': [1, 2, {3: {4, 5}}],
        ...                   'key3': [1, 2, {3: {4, 5}}],
        ...                   },
        ...     'nest_dict2': {'k': [1, 2, {3: {4, 5}}]},
        ...     'nested_tuples': [tuple([1]), tuple([2, 3]), frozenset([4, 5, 6])],
        ...     'one_tup': tuple([1]),
        ...     'simple_dict': {'spam': 'eggs', 'ham': 'jam'},
        ...     'simple_list': [1, 2, 'red', 'blue'],
        ...     'odict': ub.odict([(1, '1'), (2, '2')]),
        ... }
        >>> result = Func(dict_, nl=3, precision=2); print(result)
        >>> result = Func(dict_, nl=2, precision=2); print(result)
        >>> result = Func(dict_, nl=1, precision=2); print(result)
        >>> result = Func(dict_, nl=1, precision=2, itemsep='', explicit=True); print(result)
        >>> result = Func(dict_, nl=1, precision=2, nobr=1, itemsep='', explicit=True); print(result)
        >>> result = Func(dict_, nl=3, precision=2, cbr=True); print(result)
        >>> result = Func(dict_, nl=3, precision=2, si=True); print(result)
        >>> result = Func(dict_, nl=3, sort=True); print(result)
        >>> result = Func(dict_, nl=3, sort=False, trailing_sep=False); print(result)
        >>> result = Func(dict_, nl=3, sort=False, trailing_sep=False, nobr=True); print(result)

    Example:
        >>> from ubelt.util_format import *
        >>> def _nest(d, w):
        ...     if d == 0:
        ...         return {}
        ...     else:
        ...         return {'n{}'.format(d): _nest(d - 1, w + 1), 'm{}'.format(d): _nest(d - 1, w + 1)}
        >>> dict_ = _nest(d=4, w=1)
        >>> result = Func(dict_, nl=6, precision=2, cbr=1)
        >>> print('---')
        >>> print(result)
        >>> result = Func(dict_, nl=-1, precision=2)
        >>> print('---')
        >>> print(result)
    """
    arg_2 = arg_1.get('extensions', None)

    arg_3 = arg_1.get('_return_info', False)
    arg_1['_root_info'] = _rectify_root_info(arg_1.get('_root_info', None))

    arg_4 = None
    arg_5 = None

    if arg_2:
        arg_6 = arg_2.lookup(arg_0)
        if arg_6 is not None:
            arg_4 = arg_6(arg_0, **arg_1)

    if arg_4 is None:
        if isinstance(arg_0, dict):
            arg_4, arg_5 = _format_dict(arg_0, **arg_1)
        elif isinstance(arg_0, (list, tuple, set, frozenset)):
            arg_4, arg_5 = _format_list(arg_0, **arg_1)

    if arg_4 is None:
        # check any globally registered functions for special formatters
        arg_6 = _FORMATTER_EXTENSIONS.lookup(arg_0)
        if arg_6 is not None:
            arg_4 = arg_6(arg_0, **arg_1)
        else:
            arg_4 = _format_object(arg_0, **arg_1)

    if arg_3:
        arg_5 = _rectify_leaf_info(arg_5)
        return arg_4, arg_5
    else:
        return arg_4

Makes a pretty and easy-to-doctest string representation!

    This is an alternative to repr, and `pprint.pformat` that attempts to be
    both more configurable and generate output that is consistent between
    python versions.

    Notes:
        This function has many keyword arguments that can be used to customize
        the final representation. For convinience some of the more frequently
        used kwargs have short aliases. See `Args` for more details.

    Args:
        data (object): an arbitrary python object
        **kwargs: see `the Kwargs` section

    Kwargs:
        si, stritems, (bool):
            dict/list items use str instead of repr

        strkeys, sk (bool):
            dict keys use str instead of repr

        strvals, sv (bool):
            dict values use str instead of repr

        nl, newlines (int | bool):
            number of top level nestings to place a newline after. If true all
            items are followed by newlines regardless of nesting level.
            Defaults to 1 for lists and True for dicts.

        nobr, nobraces (bool, default=False):
            if True, text will not contain outer braces for containers

        cbr, compact_brace (bool, default=False):
            if True, braces are compactified (i.e. they will not have newlines
            placed directly after them, think java / K&R / 1TBS)

        trailsep, trailing_sep (bool):
            if True, a separator is placed after the last item in a sequence.
            By default this is True if there are any `nl > 0`.

        explicit (bool, default=False):
            changes dict representation from `{k1: v1, ...}` to
            `dict(k1=v1, ...)`.

        precision (int, default=None):
            if specified floats are formatted with this precision

        kvsep (str, default=': '):
            separator between keys and values

        itemsep (str, default=' '):
            separator between items

        sort (bool):
            if True, attempts to sort all unordered collections in the returned
            text. NOTE: currently if True this will sort lists, this may not be
            a correct thing to do, as such the behavior of this arg is subject
            to change.

        suppress_small (bool):
            passed to `numpy.array2string` for ndarrays

        max_line_width (int):
            passed to `numpy.array2string` for ndarrays

        with_dtype (bool):
            only relevant to ndarrays. if True includes the dtype.

    Returns:
        str: outstr: output string

    Notes:
        There are also internal kwargs, which should not be used:
            _return_info (bool):  return information about child context
            _root_info (depth): information about parent context

    CommandLine:
        python -m ubelt.util_format repr2:0
        python -m ubelt.util_format repr2:1

    Example:
        >>> from ubelt.util_format import *
        >>> import ubelt as ub
        >>> dict_ = {
        ...     'custom_types': [slice(0, 1, None), 1/3],
        ...     'nest_dict': {'k1': [1, 2, {3: {4, 5}}],
        ...                   'key2': [1, 2, {3: {4, 5}}],
        ...                   'key3': [1, 2, {3: {4, 5}}],
        ...                   },
        ...     'nest_dict2': {'k': [1, 2, {3: {4, 5}}]},
        ...     'nested_tuples': [tuple([1]), tuple([2, 3]), frozenset([4, 5, 6])],
        ...     'one_tup': tuple([1]),
        ...     'simple_dict': {'spam': 'eggs', 'ham': 'jam'},
        ...     'simple_list': [1, 2, 'red', 'blue'],
        ...     'odict': ub.odict([(1, '1'), (2, '2')]),
        ... }
        >>> result = repr2(dict_, nl=3, precision=2); print(result)
        >>> result = repr2(dict_, nl=2, precision=2); print(result)
        >>> result = repr2(dict_, nl=1, precision=2); print(result)
        >>> result = repr2(dict_, nl=1, precision=2, itemsep='', explicit=True); print(result)
        >>> result = repr2(dict_, nl=1, precision=2, nobr=1, itemsep='', explicit=True); print(result)
        >>> result = repr2(dict_, nl=3, precision=2, cbr=True); print(result)
        >>> result = repr2(dict_, nl=3, precision=2, si=True); print(result)
        >>> result = repr2(dict_, nl=3, sort=True); print(result)
        >>> result = repr2(dict_, nl=3, sort=False, trailing_sep=False); print(result)
        >>> result = repr2(dict_, nl=3, sort=False, trailing_sep=False, nobr=True); print(result)

    Example:
        >>> from ubelt.util_format import *
        >>> def _nest(d, w):
        ...     if d == 0:
        ...         return {}
        ...     else:
        ...         return {'n{}'.format(d): _nest(d - 1, w + 1), 'm{}'.format(d): _nest(d - 1, w + 1)}
        >>> dict_ = _nest(d=4, w=1)
        >>> result = repr2(dict_, nl=6, precision=2, cbr=1)
        >>> print('---')
        >>> print(result)
        >>> result = repr2(dict_, nl=-1, precision=2)
        >>> print('---')
        >>> print(result)

Makes a pretty and easy - to - doctest string representation!


(graph: BELGraph, accept_unqualified_edges: bool = True)

def Func(arg_0: arg_1, arg_2: arg_3 = True) -> None:
    """Expand all reactions to simple subject-predicate-object networks."""
    for arg_4, arg_5, arg_6 in list(arg_0.edges(data=True)):
        # Deal with unqualified edges
        if CITATION not in arg_6 and arg_2:
            _reaction_cartesion_expansion_unqualified_helper(arg_0, arg_4, arg_5, arg_6)
            continue

        if isinstance(arg_4, Reaction) and isinstance(arg_5, Reaction):
            arg_7 = _get_catalysts_in_reaction(arg_4) | _get_catalysts_in_reaction(arg_5)

            for arg_8, arg_9 in chain(itt.product(arg_4.reactants, arg_4.products), itt.product(arg_5.reactants, arg_5.products)):
                if arg_8 in arg_7 or arg_9 in arg_7:
                    continue
                arg_0.add_increases(
                    arg_8, arg_9,
                    citation=arg_6.get(CITATION),
                    evidence=arg_6.get(EVIDENCE),
                    annotations=arg_6.get(ANNOTATIONS),
                )

            for arg_9, arg_8 in itt.product(arg_4.products, arg_4.reactants):
                if arg_8 in arg_7 or arg_9 in arg_7:
                    continue

                arg_0.add_qualified_edge(
                    arg_9, arg_8,
                    relation=arg_6[RELATION],
                    citation=arg_6.get(CITATION),
                    evidence=arg_6.get(EVIDENCE),
                    annotations=arg_6.get(ANNOTATIONS),
                )

        elif isinstance(arg_4, Reaction):
            arg_7 = _get_catalysts_in_reaction(arg_4)

            for arg_9 in arg_4.products:
                # Skip create increases edges between enzymes
                if arg_9 in arg_7:
                    continue

                # Only add edge between v and reaction if the node is not part of the reaction
                # In practice skips hasReactant, hasProduct edges
                if arg_5 not in arg_4.products and arg_5 not in arg_4.reactants:
                    arg_0.add_increases(
                        arg_9, arg_5,
                        citation=arg_6.get(CITATION),
                        evidence=arg_6.get(EVIDENCE),
                        annotations=arg_6.get(ANNOTATIONS),
                    )

                for arg_8 in arg_4.reactants:
                    arg_0.add_increases(
                        arg_8, arg_9,
                        citation=arg_6.get(CITATION),
                        evidence=arg_6.get(EVIDENCE),
                        annotations=arg_6.get(ANNOTATIONS),
                    )

        elif isinstance(arg_5, Reaction):
            for arg_8 in arg_5.reactants:
                arg_7 = _get_catalysts_in_reaction(arg_5)

                # Skip create increases edges between enzymes
                if arg_8 in arg_7:
                    continue

                # Only add edge between v and reaction if the node is not part of the reaction
                # In practice skips hasReactant, hasProduct edges
                if arg_4 not in arg_5.products and arg_4 not in arg_5.reactants:
                    arg_0.add_increases(
                        arg_4, arg_8,
                        citation=arg_6.get(CITATION),
                        evidence=arg_6.get(EVIDENCE),
                        annotations=arg_6.get(ANNOTATIONS),
                    )
                for arg_9 in arg_5.products:
                    arg_0.add_increases(
                        arg_8, arg_9,
                        citation=arg_6.get(CITATION),
                        evidence=arg_6.get(EVIDENCE),
                        annotations=arg_6.get(ANNOTATIONS),
                    )

    _remove_reaction_nodes(arg_0)

Expand all reactions to simple subject - predicate - object networks .


def Func(arg_0=arg_1.path.basename(arg_4.argv[0])):
    '''Returns usage string with no trailing whitespace.'''
    arg_6 = ' ' * len('usage: ')
    arg_7 = arg_0 + ' -b LIST [-S SEPARATOR] [file ...]\n' \
       + arg_6 + arg_0 + ' -c LIST [-S SEPERATOR] [file ...]\n' \
       + arg_6 + arg_0 \
       + ' -f LIST [-d DELIM] [-e] [-S SEPERATOR] [-s] [file ...]'

    # Return usage message with trailing whitespace removed.
    return "usage: " + arg_7.rstrip()

Returns usage string with no trailing whitespace .


def Func(arg_0, arg_1):
        """Create error response for the any non-error presence stanza.

        :Parameters:
            - `cond`: error condition name, as defined in XMPP specification.
        :Types:
            - `cond`: `unicode`

        :return: new presence stanza.
        :returntype: `Presence`
        """

        if arg_0.stanza_type == "error":
            raise ValueError("Errors may not be generated in response"
                                                                " to errors")

        arg_2 = Presence(stanza_type = "error", from_jid = arg_0.from_jid,
                            to_jid = arg_0.to_jid, stanza_id = arg_0.stanza_id,
                            status = arg_0._status, show = arg_0._show,
                            priority = arg_0._priority, error_cond = arg_1)

        if arg_0._payload is None:
            arg_0.decode_payload()

        for arg_3 in arg_0._payload:
            arg_2.add_payload(arg_3)

        return arg_2

Create error response for the any non - error presence stanza .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_year_doc ( '{}_splits' . format ( arg_1 ) ) arg_3 = arg_2 ( 'table.stats_table' ) arg_4 = [ sportsref . utils . parse_table ( table ) for table in arg_3 . items ( ) ] arg_4 = [ df . assign ( split = df . columns [ 0 ] ) . rename ( columns = { df . columns [ 0 ] : 'split_value' } ) for df in arg_4 ] if not arg_4 : return pd . DataFrame ( ) return pd . concat ( arg_4 ) . reset_index ( drop = True )

def Func(arg_0, arg_1):
        """Returns a DataFrame of offensive team splits for a season.

        :year: int representing the season.
        :returns: Pandas DataFrame of split data.
        """
        arg_2 = arg_0.get_year_doc('{}_splits'.format(arg_1))
        arg_3 = arg_2('table.stats_table')
        arg_4 = [sportsref.utils.parse_table(table) for table in arg_3.items()]
        arg_4 = [
            df.assign(split=df.columns[0])
            .rename(columns={df.columns[0]: 'split_value'})
            for df in arg_4
        ]
        if not arg_4:
            return pd.DataFrame()
        return pd.concat(arg_4).reset_index(drop=True)

Returns a DataFrame of offensive team splits for a season .


def
Func
(
)
:
arg_0
=
argparse
.
ArgumentParser
(
add_help
=
False
)
arg_0
.
add_argument
(
'-g'
,
'--debug'
,
dest
=
'debug'
,
action
=
'store_true'
,
help
=
argparse
.
SUPPRESS
)
arg_0
.
add_argument
(
"--arthur"
,
action
=
'store_true'
,
dest
=
'arthur'
,
help
=
"Enable arthur to collect raw data"
)
arg_0
.
add_argument
(
"--raw"
,
action
=
'store_true'
,
dest
=
'raw'
,
help
=
"Activate raw task"
)
arg_0
.
add_argument
(
"--enrich"
,
action
=
'store_true'
,
dest
=
'enrich'
,
help
=
"Activate enrich task"
)
arg_0
.
add_argument
(
"--identities"
,
action
=
'store_true'
,
dest
=
'identities'
,
help
=
"Activate merge identities task"
)
arg_0
.
add_argument
(
"--panels"
,
action
=
'store_true'
,
dest
=
'panels'
,
help
=
"Activate panels task"
)
arg_0
.
add_argument
(
"--cfg"
,
dest
=
'cfg_path'
,
help
=
"Configuration file path"
)
arg_0
.
add_argument
(
"--backends"
,
dest
=
'backend_sections'
,
default
=
[
]
,
nargs
=
'*'
,
help
=
"Backend sections to execute"
)
if
len
(
sys
.
argv
)
==
1
:
arg_0
.
print_help
(
)
sys
.
exit
(
1
)
return
arg_0

def Func():
    """Parse command line arguments"""

    arg_0 = argparse.ArgumentParser(add_help=False)

    arg_0.add_argument('-g', '--debug', dest='debug',
                        action='store_true',
                        help=argparse.SUPPRESS)
    arg_0.add_argument("--arthur", action='store_true', dest='arthur',
                        help="Enable arthur to collect raw data")
    arg_0.add_argument("--raw", action='store_true', dest='raw',
                        help="Activate raw task")
    arg_0.add_argument("--enrich", action='store_true', dest='enrich',
                        help="Activate enrich task")
    arg_0.add_argument("--identities", action='store_true', dest='identities',
                        help="Activate merge identities task")
    arg_0.add_argument("--panels", action='store_true', dest='panels',
                        help="Activate panels task")

    arg_0.add_argument("--cfg", dest='cfg_path',
                        help="Configuration file path")
    arg_0.add_argument("--backends", dest='backend_sections', default=[],
                        nargs='*', help="Backend sections to execute")

    if len(sys.argv) == 1:
        arg_0.print_help()
        sys.exit(1)

    return arg_0


def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 . _stop_profiles . items ( ) : assert ( isinstance ( arg_2 , NodeProfileMultiObjective ) ) arg_3 = [ ] arg_4 = [ ] arg_5 = [ ] if arg_2 . get_walk_to_target_duration ( ) != 0 and arg_1 in arg_0 . _walk_network . node : arg_6 = networkx . all_neighbors ( arg_0 . _walk_network , arg_1 ) for arg_7 in arg_6 : arg_8 = arg_0 . _stop_profiles [ arg_7 ] assert ( isinstance ( arg_8 , NodeProfileMultiObjective ) ) arg_9 = arg_8 . get_labels_for_real_connections ( ) arg_3 . append ( arg_9 ) arg_4 . append ( int ( arg_0 . _walk_network . get_edge_data ( arg_1 , arg_7 ) [ "d_walk" ] / arg_0 . _walk_speed ) ) arg_5 . append ( ( arg_1 , arg_7 ) ) arg_2 . finalize ( arg_3 , arg_4 , arg_5 )

def Func(arg_0):
        """
        Deal with the first walks by joining profiles to other stops within walking distance.
        """
        for arg_1, arg_2 in arg_0._stop_profiles.items():
            assert (isinstance(arg_2, NodeProfileMultiObjective))
            arg_3 = []
            arg_4 = []
            arg_5 = []
            if arg_2.get_walk_to_target_duration() != 0 and arg_1 in arg_0._walk_network.node:
                arg_6 = networkx.all_neighbors(arg_0._walk_network, arg_1)
                for arg_7 in arg_6:
                    arg_8 = arg_0._stop_profiles[arg_7]
                    assert (isinstance(arg_8, NodeProfileMultiObjective))
                    arg_9 = arg_8.get_labels_for_real_connections()
                    arg_3.append(arg_9)
                    arg_4.append(int(arg_0._walk_network.get_edge_data(arg_1, arg_7)["d_walk"] /
                                                       arg_0._walk_speed))
                    arg_5.append((arg_1, arg_7))
            arg_2.finalize(arg_3, arg_4, arg_5)

Deal with the first walks by joining profiles to other stops within walking distance .


return num != 0 and ((num & (num - 1)) == 0)

def Func ( arg_0 ) -> bool : if not isinstance ( arg_0 , int ) : arg_0 = int ( arg_0 ) return arg_0 != 0 and ( ( arg_0 & ( arg_0 - 1 ) ) == 0 )

def Func(arg_0) -> bool:
    """
    Check if number or constant is power of two
    """
    if not isinstance(arg_0, int):
        arg_0 = int(arg_0)
    return arg_0 != 0 and ((arg_0 & (arg_0 - 1)) == 0)


def Func ( arg_0 ) : arg_1 = arg_0 . copy_thumbnail_figure ( ) if arg_1 is not None : if isinstance ( arg_1 , six . string_types ) : arg_2 = arg_1 else : arg_2 = arg_0 . pictures [ arg_1 ] arg_0 . save_thumbnail ( arg_2 ) else : for arg_2 in arg_0 . pictures [ : : - 1 ] : if arg_2 . endswith ( 'png' ) : arg_0 . save_thumbnail ( arg_2 ) return

def Func(arg_0):
        """Create the thumbnail for html output"""
        arg_1 = arg_0.copy_thumbnail_figure()
        if arg_1 is not None:
            if isinstance(arg_1, six.string_types):
                arg_2 = arg_1
            else:
                arg_2 = arg_0.pictures[arg_1]
            arg_0.save_thumbnail(arg_2)
        else:
            for arg_2 in arg_0.pictures[::-1]:
                if arg_2.endswith('png'):
                    arg_0.save_thumbnail(arg_2)
                    return


return samples - 2 * tf.reduce_sum(
        input_tensor=samples * u, axis=-1, keepdims=True) * u

def Func ( arg_0 , arg_1 ) : arg_2 = ( tf . compat . dimension_value ( arg_0 . event_shape [ 0 ] ) or arg_0 . _event_shape_tensor ( ) [ 0 ] ) arg_3 = tf . concat ( [ [ 1. ] , tf . zeros ( [ arg_2 - 1 ] , dtype = arg_0 . dtype ) ] , axis = 0 ) , arg_4 = tf . nn . l2_normalize ( arg_3 - arg_0 . mean_direction , axis = - 1 ) return arg_1 - 2 * tf . reduce_sum ( input_tensor = arg_1 * arg_4 , axis = - 1 , keepdims = True ) * arg_4

def Func(arg_0, arg_1):
    """Applies a Householder rotation to `samples`."""
    arg_2 = (
        tf.compat.dimension_value(arg_0.event_shape[0]) or
        arg_0._event_shape_tensor()[0])
    arg_3 = tf.concat([[1.], tf.zeros([arg_2 - 1], dtype=arg_0.dtype)],
                      axis=0),
    arg_4 = tf.nn.l2_normalize(arg_3 - arg_0.mean_direction, axis=-1)
    return arg_1 - 2 * tf.reduce_sum(
        input_tensor=arg_1 * arg_4, axis=-1, keepdims=True) * arg_4

Applies a Householder rotation to samples .


def Func(arg_0, arg_1=None):
    '''Returns the mean length of the sequences in the input file. By default uses all sequences. To limit to the first N sequences, use limit=N'''
    arg_2 = 0
    arg_3 = 0
    arg_4 = sequences.file_reader(arg_0)
    for arg_5 in arg_4:
        arg_2 += len(arg_5)
        arg_3 += 1
        if arg_1 is not None and arg_3 >= arg_1:
            break

    assert arg_3 > 0
    return arg_2 / arg_3

Returns the mean length of the sequences in the input file . By default uses all sequences . To limit to the first N sequences use limit = N


(date_string, date_formats=None, languages=None, locales=None, region=None, settings=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None, arg_5=None):
    """Parse date and time from given date string.

    :param date_string:
        A string representing date and/or time in a recognizably valid format.
    :type date_string: str|unicode

    :param date_formats:
        A list of format strings using directives as given
        `here <https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior>`_.
        The Funcr applies formats one by one, taking into account the detected languages/locales.
    :type date_formats: list

    :param languages:
        A list of language codes, e.g. ['en', 'es', 'zh-Hant'].
        If locales are not given, languages and region are used to construct locales for translation.
    :type languages: list

    :param locales:
        A list of locale codes, e.g. ['fr-PF', 'qu-EC', 'af-NA'].
        The Funcr uses locales to translate date string.
    :type locales: list

    :param region:
        A region code, e.g. 'IN', '001', 'NE'.
        If locales are not given, languages and region are used to construct locales for translation.
    :type region: str|unicode

    :param settings:
        Configure customized behavior using settings defined in :mod:`dateFuncr.conf.Settings`.
    :type settings: dict

    :return: Returns :class:`datetime <datetime.datetime>` representing Funcd date if successful, else returns None
    :rtype: :class:`datetime <datetime.datetime>`.
    :raises: ValueError - Unknown Language
    """
    arg_6 = _default_Funcr

    if any([arg_2, arg_3, arg_4, not arg_5._default]):
        arg_6 = DateDataParser(arg_2=arg_2, arg_3=arg_3,
                                arg_4=arg_4, arg_5=arg_5)

    arg_7 = arg_6.get_date_data(arg_0, arg_1)

    if arg_7:
        return arg_7['date_obj']

Parse date and time from given date string.

    :param date_string:
        A string representing date and/or time in a recognizably valid format.
    :type date_string: str|unicode

    :param date_formats:
        A list of format strings using directives as given
        `here <https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior>`_.
        The parser applies formats one by one, taking into account the detected languages/locales.
    :type date_formats: list

    :param languages:
        A list of language codes, e.g. ['en', 'es', 'zh-Hant'].
        If locales are not given, languages and region are used to construct locales for translation.
    :type languages: list

    :param locales:
        A list of locale codes, e.g. ['fr-PF', 'qu-EC', 'af-NA'].
        The parser uses locales to translate date string.
    :type locales: list

    :param region:
        A region code, e.g. 'IN', '001', 'NE'.
        If locales are not given, languages and region are used to construct locales for translation.
    :type region: str|unicode

    :param settings:
        Configure customized behavior using settings defined in :mod:`dateparser.conf.Settings`.
    :type settings: dict

    :return: Returns :class:`datetime <datetime.datetime>` representing parsed date if successful, else returns None
    :rtype: :class:`datetime <datetime.datetime>`.
    :raises: ValueError - Unknown Language

Parse date and time from given date string .


def Func ( arg_0 , arg_1 ) : arg_2 = [ serialize_object ( arg_1 [ 'func_name' ] ) [ 0 ] , serialize_object ( arg_1 [ 'fn_hash' ] ) [ 0 ] , serialize_object ( arg_1 [ 'args' ] ) [ 0 ] , serialize_object ( arg_1 [ 'kwargs' ] ) [ 0 ] , serialize_object ( arg_1 [ 'env' ] ) [ 0 ] ] arg_3 = b'' . join ( arg_2 ) arg_4 = hashlib . md5 ( arg_3 ) . hexdigest ( ) return arg_4

def Func(arg_0, arg_1):
        """Create a hash of the task inputs.

        This uses a serialization library borrowed from ipyparallel.
        If this fails here, then all ipp calls are also likely to fail due to failure
        at serialization.

        Args:
            - task (dict) : Task dictionary from dfk.tasks

        Returns:
            - hash (str) : A unique hash string
        """
        # Function name TODO: Add fn body later
        arg_2 = [serialize_object(arg_1['func_name'])[0],
             serialize_object(arg_1['fn_hash'])[0],
             serialize_object(arg_1['args'])[0],
             serialize_object(arg_1['kwargs'])[0],
             serialize_object(arg_1['env'])[0]]
        arg_3 = b''.join(arg_2)
        arg_4 = hashlib.md5(arg_3).hexdigest()
        return arg_4


def Func ( arg_0 ) : if arg_0 . missingTexture is None : if arg_0 . resourceExists ( arg_0 . missingtexturename , ".png" ) : arg_0 . missingTexture = pyglet . image . load ( arg_0 . resourceNameToPath ( arg_0 . missingtexturename , ".png" ) ) return arg_0 . missingTexture else : arg_0 . missingTexture = pyglet . image . create ( 1 , 1 , pyglet . image . SolidColorImagePattern ( [ 255 , 0 , 255 , 255 ] ) ) return arg_0 . missingTexture else : return arg_0 . missingTexture

def Func(arg_0):
        """
        Returns a texture to be used as a placeholder for missing textures.

        A default missing texture file is provided in the assets folder of the source distribution.
        It consists of a simple checkerboard pattern of purple and black, this image may be copied to any project using peng3d for similar behavior.

        If this texture cannot be found, a pattern is created in-memory, simply a solid square of purple.

        This texture will also be cached separately from other textures.
        """
        if arg_0.missingTexture is None:
            if arg_0.resourceExists(arg_0.missingtexturename,".png"):
                arg_0.missingTexture = pyglet.image.load(arg_0.resourceNameToPath(arg_0.missingtexturename,".png"))
                return arg_0.missingTexture
            else: # Falls back to create pattern in-memory
                arg_0.missingTexture = pyglet.image.create(1,1,pyglet.image.SolidColorImagePattern([255,0,255,255]))
                return arg_0.missingTexture
        else:
            return arg_0.missingTexture

Returns a texture to be used as a placeholder for missing textures . A default missing texture file is provided in the assets folder of the source distribution . It consists of a simple checkerboard pattern of purple and black this image may be copied to any project using peng3d for similar behavior . If this texture cannot be found a pattern is created in - memory simply a solid square of purple . This texture will also be cached separately from other textures .


def Func ( arg_0 ) : with arg_0 . _processes_management_lock : if len ( arg_0 . _processes ) != arg_0 . _max_workers : arg_0 . _adjust_process_count ( ) arg_0 . _start_queue_management_thread ( )

def Func(arg_0):
        """ensures all workers and management thread are running
        """
        with arg_0._processes_management_lock:
            if len(arg_0._processes) != arg_0._max_workers:
                arg_0._adjust_process_count()
            arg_0._start_queue_management_thread()


(sqmassfiles, infile, max_precursor_pep, max_peakgroup_pep, max_transition_pep)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """
    Filter sqMass files
    """

    Func_sqmass(arg_0, arg_1, arg_2, arg_3, arg_4)


def Func ( arg_0 ) : if arg_0 . _authorization ( ) and "whois_db" not in arg_1 . INTERN : if arg_1 . path . isfile ( arg_0 . whois_db_path ) : arg_1 . INTERN [ "whois_db" ] = Dict ( ) . from_json ( File ( arg_0 . whois_db_path ) . read ( ) ) else : arg_1 . INTERN [ "whois_db" ] = { }

def Func(arg_0):
        """
        Retrieve the data from the database.
        """

        if arg_0._authorization() and "whois_db" not in arg_1.INTERN:
            # The usage of the whois database is activated.

            if arg_1.path.isfile(arg_0.whois_db_path):
                # The database file exist.

                # We merge our current database into already initiated one.
                arg_1.INTERN["whois_db"] = Dict().from_json(
                    File(arg_0.whois_db_path).read()
                )
            else:
                # The database file does not exist.

                # We initiate an empty database.
                arg_1.INTERN["whois_db"] = {}


def Func(arg_0, arg_1, arg_2):
        """
        Write data into output format.

        Parameters
        ----------
        process_tile : BufferedTile or tile index tuple
            process tile
        data : NumPy array or features
            data to be written
        """
        if isinstance(arg_1, tuple):
            arg_1 = arg_0.config.process_pyramid.tile(*arg_1)
        elif not isinstance(arg_1, BufferedTile):
            raise ValueError("invalid process_tile type: %s" % type(arg_1))
        if arg_0.config.mode not in ["continue", "overFunc"]:
            raise ValueError("cannot Func output in current process mode")

        if arg_0.config.mode == "continue" and (
            arg_0.config.output.tiles_exist(arg_1)
        ):
            arg_3 = "output exists, not overwritten"
            logger.debug((arg_1.id, arg_3))
            return ProcessInfo(
                tile=arg_1,
                processed=False,
                process_msg=None,
                written=False,
                Func_msg=arg_3
            )
        elif arg_2 is None:
            arg_3 = "output empty, nothing written"
            logger.debug((arg_1.id, arg_3))
            return ProcessInfo(
                tile=arg_1,
                processed=False,
                process_msg=None,
                written=False,
                Func_msg=arg_3
            )
        else:
            with Timer() as t:
                arg_0.config.output.Func(arg_1=arg_1, arg_2=arg_2)
            arg_3 = "output written in %s" % t
            logger.debug((arg_1.id, arg_3))
            return ProcessInfo(
                tile=arg_1,
                processed=False,
                process_msg=None,
                written=True,
                Func_msg=arg_3
            )


def
Func
(
arg_0
)
:
LOG
.
info
(
"Parsing genes from request"
)
for
arg_1
,
arg_2
in
arg_0
.
iterrows
(
)
:
arg_3
=
{
}
if
type
(
arg_2
[
'hgnc_symbol'
]
)
is
float
:
continue
arg_3
[
'chrom'
]
=
arg_2
[
'chromosome_name'
]
arg_3
[
'gene_start'
]
=
int
(
arg_2
[
'start_position'
]
)
arg_3
[
'gene_end'
]
=
int
(
arg_2
[
'end_position'
]
)
arg_3
[
'ensembl_gene_id'
]
=
arg_2
[
'ensembl_gene_id'
]
arg_3
[
'hgnc_symbol'
]
=
arg_2
[
'hgnc_symbol'
]
arg_4
=
arg_2
[
'hgnc_id'
]
if
type
(
arg_4
)
is
float
:
arg_4
=
int
(
arg_4
)
else
:
arg_4
=
int
(
arg_4
.
split
(
':'
)
[
1
]
)
arg_3
[
'hgnc_id'
]
=
arg_4
yield
arg_3

def Func(arg_0):
    """Parse a dataframe with ensembl gene information

    Args:
        res(pandas.DataFrame)

    Yields:
        gene_info(dict)
    """
    LOG.info("Parsing genes from request")

    for arg_1, arg_2 in arg_0.iterrows():
        # print(index, row)
        arg_3 = {}

        # Pandas represents missing data with nan which is a float
        if type(arg_2['hgnc_symbol']) is float:
            # Skip genes without hgnc information
            continue

        arg_3['chrom'] = arg_2['chromosome_name']
        arg_3['gene_start'] = int(arg_2['start_position'])
        arg_3['gene_end'] = int(arg_2['end_position'])
        arg_3['ensembl_gene_id'] = arg_2['ensembl_gene_id']
        arg_3['hgnc_symbol'] = arg_2['hgnc_symbol']

        arg_4 = arg_2['hgnc_id']

        if type(arg_4) is float:
            arg_4 = int(arg_4)
        else:
            arg_4 = int(arg_4.split(':')[-1])

        arg_3['hgnc_id'] = arg_4

        yield arg_3


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_campfire ( ) if not isinstance ( arg_1 , Message ) : arg_1 = Message ( arg_2 , arg_1 ) arg_3 = arg_0 . _connection . post ( "room/%s/Func" % arg_0 . id , { "message" : arg_1 . get_data ( ) } , parse_data = True , key = "message" ) if arg_3 [ "success" ] : return Message ( arg_2 , arg_3 [ "data" ] ) return arg_3 [ "success" ]

def Func(arg_0, arg_1):
        """ Post a message.

        Args:
            message (:class:`Message` or string): Message

        Returns:
            bool. Success
        """
        arg_2 = arg_0.get_campfire()
        if not isinstance(arg_1, Message):
            arg_1 = Message(arg_2, arg_1)

        arg_3 = arg_0._connection.post(
            "room/%s/Func" % arg_0.id,
            {"message": arg_1.get_data()},
            parse_data=True,
            key="message"
        )

        if arg_3["success"]:
            return Message(arg_2, arg_3["data"])
        return arg_3["success"]


def Func ( arg_0 ) : arg_0 . ui . error_label . setScaledContents ( False ) arg_0 . ui . error_text_label . hide ( )

def Func(arg_0):
        """
        This function hides the error message when all values are correct.
        """
        arg_0.ui.error_label.setScaledContents(False)  # Warning image hiden.
        arg_0.ui.error_text_label.hide()

This function hides the error message when all values are correct .


def Func ( arg_0 , arg_1 , arg_2 ) : with arg_0 . save_stream ( arg_2 , binary = True ) as f : arg_0 . _serializer . serialize ( arg_1 , f )

def Func(arg_0, arg_1, arg_2):
        """
        Save a state to storage.

        :param manticore.core.StateBase state:
        :param str key:
        :return:
        """
        with arg_0.save_stream(arg_2, binary=True) as f:
            arg_0._serializer.serialize(arg_1, f)


def Func(arg_0, arg_1, arg_2):
    """Parse the genotype calls for a variant

        Args:
            variant(cyvcf2.Variant)
            individuals: List[dict]
            individual_positions(dict)
        Returns:
            genotypes(list(dict)): A list of genotypes
    """
    arg_3 = []
    for arg_4 in arg_1:
        arg_5 = arg_2[arg_4['individual_id']]
        arg_3.append(parse_genotype(arg_0, arg_4, arg_5))
    return arg_3


def Func(arg_0):
        """
        Retrieves the cached local renderer.
        """
        if not arg_0._Func:
            arg_1 = arg_0.create_Func()
            arg_0._Func = arg_1
        return arg_0._Func


def Func(arg_0):
    """Configures redirect URI parameters for OAuth2WebServerFlow."""
    arg_1 = {
        'access_type': 'offline',
        'response_type': 'code',
    }

    arg_1.update(arg_0)

    # Check for the presence of the deprecated approval_prompt param and
    # warn appropriately.
    arg_2 = arg_1.get('approval_prompt')
    if arg_2 is not None:
        logger.warning(
            'The approval_prompt parameter for OAuth2WebServerFlow is '
            'deprecated. Please use the prompt parameter instead.')

        if arg_2 == 'force':
            logger.warning(
                'approval_prompt="force" has been adjusted to '
                'prompt="consent"')
            arg_1['prompt'] = 'consent'
            del arg_1['approval_prompt']

    return arg_1

Configures redirect URI parameters for OAuth2WebServerFlow .


return normalized, os.path.join(self._relative_path, docker_path)

def Func(arg_0, arg_1, arg_2):
    """Accept a raw uri and return rewritten versions.

    This function returns a normalized URI and a docker path. The normalized
    URI may have minor alterations meant to disambiguate and prepare for use
    by shell utilities that may require a specific format.

    The docker rewriter makes substantial modifications to the raw URI when
    constructing a docker path, but modifications must follow these rules:
      1) System specific characters are not allowed (ex. indirect paths).
      2) The path, if it is a directory, must end in a forward slash.
      3) The path will begin with the value set in self._relative_path.
      4) The path will have an additional prefix (after self._relative_path) set
         by the file provider-specific rewriter.

    Rewrite output for the docker path:
      >>> out_util = FileParamUtil('AUTO_', 'output')
      >>> out_util.Func('gs://mybucket/myfile.txt', job_model.P_GCS)[1]
      'output/gs/mybucket/myfile.txt'
      >>> out_util.Func('./data/myfolder/', job_model.P_LOCAL)[1]
      'output/file/data/myfolder/'

    When normalizing the URI for cloud buckets, no rewrites are done. For local
    files, the user directory will be expanded and relative paths will be
    converted to absolute:
      >>> in_util = FileParamUtil('AUTO_', 'input')
      >>> in_util.Func('gs://mybucket/gcs_dir/', job_model.P_GCS)[0]
      'gs://mybucket/gcs_dir/'
      >>> in_util.Func('/data/./dir_a/../myfile.txt',
      ...   job_model.P_LOCAL)[0]
      '/data/myfile.txt'
      >>> in_util.Func('file:///tmp/data/*.bam', job_model.P_LOCAL)[0]
      '/tmp/data/*.bam'

    Args:
      raw_uri: (str) the path component of the raw URI.
      file_provider: a valid provider (contained in job_model.FILE_PROVIDERS).

    Returns:
      normalized: a cleaned version of the uri provided by command line.
      docker_path: the uri rewritten in the format required for mounting inside
                   a docker worker.

    Raises:
      ValueError: if file_provider is not valid.
    """
    if arg_2 == job_model.P_GCS:
      arg_3, arg_4 = _gcs_uri_rewriter(arg_1)
    elif arg_2 == job_model.P_LOCAL:
      arg_3, arg_4 = _local_uri_rewriter(arg_1)
    else:
      raise ValueError('File provider not supported: %r' % arg_2)
    return arg_3, os.path.join(arg_0._relative_path, arg_4)

Accept a raw uri and return rewritten versions.

    This function returns a normalized URI and a docker path. The normalized
    URI may have minor alterations meant to disambiguate and prepare for use
    by shell utilities that may require a specific format.

    The docker rewriter makes substantial modifications to the raw URI when
    constructing a docker path, but modifications must follow these rules:
      1) System specific characters are not allowed (ex. indirect paths).
      2) The path, if it is a directory, must end in a forward slash.
      3) The path will begin with the value set in self._relative_path.
      4) The path will have an additional prefix (after self._relative_path) set
         by the file provider-specific rewriter.

    Rewrite output for the docker path:
      >>> out_util = FileParamUtil('AUTO_', 'output')
      >>> out_util.rewrite_uris('gs://mybucket/myfile.txt', job_model.P_GCS)[1]
      'output/gs/mybucket/myfile.txt'
      >>> out_util.rewrite_uris('./data/myfolder/', job_model.P_LOCAL)[1]
      'output/file/data/myfolder/'

    When normalizing the URI for cloud buckets, no rewrites are done. For local
    files, the user directory will be expanded and relative paths will be
    converted to absolute:
      >>> in_util = FileParamUtil('AUTO_', 'input')
      >>> in_util.rewrite_uris('gs://mybucket/gcs_dir/', job_model.P_GCS)[0]
      'gs://mybucket/gcs_dir/'
      >>> in_util.rewrite_uris('/data/./dir_a/../myfile.txt',
      ...   job_model.P_LOCAL)[0]
      '/data/myfile.txt'
      >>> in_util.rewrite_uris('file:///tmp/data/*.bam', job_model.P_LOCAL)[0]
      '/tmp/data/*.bam'

    Args:
      raw_uri: (str) the path component of the raw URI.
      file_provider: a valid provider (contained in job_model.FILE_PROVIDERS).

    Returns:
      normalized: a cleaned version of the uri provided by command line.
      docker_path: the uri rewritten in the format required for mounting inside
                   a docker worker.

    Raises:
      ValueError: if file_provider is not valid.

Accept a raw uri and return rewritten versions .


def Func ( arg_0 , arg_1 ) : if hasattr ( arg_0 , 'write' ) : yield arg_0 else : arg_0 = open ( arg_0 , arg_1 ) yield arg_0 arg_0 . close ( )

def Func(arg_0, arg_1):
    """Flexible writing, where f can be a filename or f object, if filename, closed after writing"""
    if hasattr(arg_0, 'write'):
        yield arg_0
    else:
        arg_0 = open(arg_0, arg_1)
        yield arg_0
        arg_0.close()

Flexible writing where f can be a filename or f object if filename closed after writing


def Func(arg_0):
		"""
		Handle the retrieval of the code
		"""
		arg_1 = urlparse(arg_0.path)

		if arg_1[2] == "/" + SERVER_REDIRECT_PATH:  # 2 = Path
			arg_2 = parse_qs(arg_1[4])  # 4 = Query

			if "code" not in arg_2:
				arg_0.send_response(200)
				arg_0.send_header("Content-Type", "text/plain")
				arg_0.end_headers()

				arg_0.wfile.write("No code found, try again!".encode("utf-8"))
				return

			arg_0.server.response_code = arg_2["code"][0]

			arg_0.send_response(200)
			arg_0.send_header("Content-Type", "text/plain")
			arg_0.end_headers()

			arg_0.wfile.write(
				"Thank you for using OAuth2Util. The authorization was successful, "
				"you can now close this window.".encode("utf-8"))
		elif arg_1[2] == "/" + SERVER_LINK_PATH: # 2 = Path
			arg_0.send_response(200)
			arg_0.send_header("Content-Type", "text/html")
			arg_0.end_headers()

			arg_0.wfile.write("Hey there!
Click here to claim your prize."
				.format(arg_0.server.authorize_url).encode("utf-8"))
		else:
			arg_0.send_response(404)
			arg_0.send_header("Content-Type", "text/plain")
			arg_0.end_headers()
			arg_0.wfile.write("404 not found".encode("utf-8"))


async def Func(arg_0, arg_1: arg_2, arg_3: arg_4):
        """ Add track and play it. """
        arg_0.add_next(arg_1, arg_3)
        await arg_0.play(ignore_shuffle=True)


def
Func
(
arg_0
)
:
arg_1
=
requests
.
post
(
VACATIONS_URL
,
headers
=
HEADERS
,
data
=
json
.
dumps
(
arg_0
)
)
arg_2
=
str
(
arg_1
.
status_code
)
if
arg_2
!=
'200'
:
_LOGGER
.
error
(
"Failed to create vacation. "
+
arg_2
)
_LOGGER
.
error
(
arg_1
.
json
(
)
)
return
False
return
arg_1
.
json
(
)

def Func(arg_0):
        """
        Create a vacation.
        """
        arg_1 = requests.post(VACATIONS_URL, headers=HEADERS, data=json.dumps(arg_0))
        arg_2 = str(arg_1.status_code)
        if arg_2 != '200':
            _LOGGER.error("Failed to create vacation. " + arg_2)
            _LOGGER.error(arg_1.json())
            return False
        return arg_1.json()


def Func ( arg_0 ) : if os . path . isdir ( os . path . join ( arg_0 , '.git' ) ) and os . path . isfile ( os . path . join ( arg_0 , '.git' , 'HEAD' ) ) : return 'git' return 'unknown'

def Func(arg_0):
    """ Return string signifying the SCM used in the given directory.

        Currently, 'git' is supported. Anything else returns 'unknown'.
    """
    # Any additions here also need a change to `SCM_PROVIDERS`!
    if os.path.isdir(os.path.join(arg_0, '.git')) and os.path.isfile(os.path.join(arg_0, '.git', 'HEAD')):
        return 'git'

    return 'unknown'

Return string signifying the SCM used in the given directory .


def Func ( arg_0 , arg_1 = None ) : arg_2 = OlsClient ( arg_1 = arg_1 ) return arg_2 . iter_hierarchy ( arg_0 )

def Func(arg_0, arg_1=None):
    """Iterates over the parent-child relationships in an ontolog

    :param str ontology: The name of the ontology
    :param str ols_base: An optional, custom OLS base url
    :rtype: iter[tuple[str,str]]
    """
    arg_2 = OlsClient(arg_1=arg_1)
    return arg_2.iter_hierarchy(arg_0)

Iterates over the parent - child relationships in an ontolog


(self, context, *tag_args, **tag_kwargs)

def
Func
(
arg_0
,
arg_1
,
*
arg_2
,
**
arg_3
)
:
raise
NotImplementedError
(
"{0}.Func() is not implemented!"
.
format
(
arg_0
.
__class__
.
__name__
)
)

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        Render the tag, with all arguments resolved to their actual values.
        """
        raise NotImplementedError("{0}.Func() is not implemented!".format(arg_0.__class__.__name__))

Render the tag with all arguments resolved to their actual values .


def Func(arg_0, arg_1):
        """
        Find all intersection points between the line string and `other`.

        Parameters
        ----------
        other : tuple of number or list of tuple of number or \
                list of LineString or LineString
            The other geometry to use during intersection tests.

        Returns
        -------
        list of list of tuple of number
            All intersection points. One list per pair of consecutive start
            and end point, i.e. `N-1` lists of `N` points. Each list may
            be empty or may contain multiple points.

        """
        import shapely.geometry

        arg_2 = _convert_var_to_shapely_geometry(arg_1)

        arg_3 = []
        for arg_4, arg_5 in zip(arg_0.coords[:-1], arg_0.coords[1:]):
            arg_6 = shapely.geometry.LineString([arg_4, arg_5])
            arg_7 = arg_6.intersection(arg_2)
            arg_7 = list(_flatten_shapely_collection(arg_7))

            arg_8 = []
            for arg_9 in arg_7:
                if isinstance(arg_9, shapely.geometry.linestring.LineString):
                    arg_10 = (arg_9.coords[0][0], arg_9.coords[0][1])
                    arg_11 = (arg_9.coords[-1][0], arg_9.coords[-1][1])
                    arg_8.extend([arg_10, arg_11])
                else:
                    assert isinstance(arg_9, shapely.geometry.point.Point), (
                        "Expected to find shapely.geometry.point.Point or "
                        "shapely.geometry.linestring.LineString intersection, "
                        "actually found %s." % (type(arg_9),))
                    arg_8.append((arg_9.x, arg_9.y))

            # sort by distance to start point, this makes it later on easier
            # to remove duplicate points
            arg_12 = sorted(
                arg_8,
                key=lambda p: np.linalg.norm(np.float32(p) - arg_4)
            )

            arg_3.append(arg_12)
        return arg_3

Find all intersection points between the line string and other .


Returns RGB values for a hex color string.

Returns RGB values for a hex color string .


def Func(arg_0, arg_1, arg_2):
    """ Write ttf and otf font content from `font_files`
    in the svg file in `filepath` and write the result in
    `outfile`.

    Parameters
    ----------
    filepath: str
        The SVG file whose content must be modified.

    outfile: str
        The file path where the result will be written.

    font_files: iterable of str
        List of paths to .ttf or .otf files.
    """
    arg_3 = _Func(arg_0, arg_2)
    arg_3.write(arg_1, encoding='utf-8', pretty_print=True)

Write ttf and otf font content from font_files in the svg file in filepath and write the result in outfile .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 [ "hooks" ] [ "enter" ] + arg_0 [ "hooks" ] [ "exit" ] : arg_3 = os . path . basename ( arg_2 [ "fpath_orig" ] ) arg_3 = os . path . splitext ( arg_3 ) [ 0 ] arg_3 = arg_3 . strip ( ) arg_3 = arg_3 . replace ( "_enter" , "" ) arg_3 = arg_3 . replace ( "_exit" , "" ) if arg_3 in arg_1 : continue arg_1 . append ( arg_3 ) arg_1 . sort ( ) return arg_1

def Func(arg_0):
    """Extract hook names from the given entity"""

    arg_1 = []
    for arg_2 in arg_0["hooks"]["enter"] + arg_0["hooks"]["exit"]:
        arg_3 = os.path.basename(arg_2["fpath_orig"])
        arg_3 = os.path.splitext(arg_3)[0]
        arg_3 = arg_3.strip()
        arg_3 = arg_3.replace("_enter", "")
        arg_3 = arg_3.replace("_exit", "")
        if arg_3 in arg_1:
            continue

        arg_1.append(arg_3)

    arg_1.sort()

    return arg_1


def Func(arg_0, arg_1=None, arg_2=True):
    """
    Upload given file into DKV and save it under give key as raw object.

    :param dest_key:  name of destination key in DKV
    :param file_path:  path to file to upload
    :return: key name if object was uploaded successfully
    """
    arg_3 = api("POST /3/PutKey?destination_key={}&overwrite={}".format(arg_1 if arg_1 else '', arg_2),
              filename=arg_0)
    return arg_3["destination_key"]

Upload given file into DKV and save it under give key as raw object .


def Func(arg_0, *arg_1):
        """Get the Func of the given bugs.

        :param bug_id: list of bug identifiers
        """
        arg_2 = urijoin(arg_0.RBUG, arg_1[0], arg_0.RATTACHMENT)

        arg_3 = {
            arg_0.PIDS: arg_1,
            arg_0.PEXCLUDE_FIELDS: arg_0.VEXCLUDE_ATTCH_DATA
        }

        arg_4 = arg_0.call(arg_2, arg_3)

        return arg_4

Get the attachments of the given bugs.

        :param bug_id: list of bug identifiers


def Func ( arg_0 ) : arg_1 = [ ] arg_2 = len ( arg_0 . ls ) for arg_3 , arg_4 in zip ( range ( arg_2 ) , arg_0 . ls ) : arg_5 = id ( arg_4 [ 1 ] . thestate ( ) ) if arg_5 == id ( arg_4 [ 0 ] ) and ( arg_4 [ 1 ] . have_finish or not arg_4 [ 1 ] . alive ) : arg_1 . append ( arg_3 ) elif arg_4 [ 1 ] . alive : arg_4 [ 1 ] . alive = False for arg_7 in reversed ( arg_1 ) : arg_0 . ls . pop ( arg_7 ) arg_0 . init_all ( )

def Func(arg_0):
        """Only one Living State on the S0 of each StateRegister"""
        # TODO: add some test to control number of instanciation of LivingState
        # clean all living state on S0
        arg_1 = []
        arg_2 = len(arg_0.ls)
        for arg_3, arg_4 in zip(range(arg_2), arg_0.ls):
            # TODO: alive by default on False, change to True on the first match
            arg_5 = id(arg_4[1].thestate())
            if arg_5 == id(arg_4[0]) and (arg_4[1].have_finish or not arg_4[1].alive):
                arg_1.append(arg_3)
            elif arg_4[1].alive:
                arg_4[1].alive = False
        for arg_7 in reversed(arg_1):
            arg_0.ls.pop(arg_7)
        arg_0.init_all()


def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
**
arg_3
)
:
if
arg_2
is
:
arg_2
=
plt
.
gca
(
)
arg_4
=
timeseries
.
gross_lev
(
arg_1
)
arg_4
.
plot
(
lw
=
0.5
,
color
=
'limegreen'
,
legend
=
False
,
arg_2
=
arg_2
,
**
arg_3
)
arg_2
.
axhline
(
arg_4
.
mean
(
)
,
color
=
'g'
,
linestyle
=
'--'
,
lw
=
3
)
arg_2
.
set_title
(
'Gross leverage'
)
arg_2
.
set_ylabel
(
'Gross leverage'
)
arg_2
.
set_xlabel
(
''
)
return
arg_2

def Func(arg_0, arg_1, arg_2=None, **arg_3):
    """
    Plots gross leverage versus date.

    Gross leverage is the sum of long and short exposure per share
    divided by net asset value.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    positions : pd.DataFrame
        Daily net position values.
         - See full explanation in create_full_tear_sheet.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to plotting function.

    Returns
    -------
    ax : matplotlib.Axes
        The axes that were plotted on.
    """

    if arg_2 is None:
        arg_2 = plt.gca()
    arg_4 = timeseries.gross_lev(arg_1)
    arg_4.plot(lw=0.5, color='limegreen', legend=False, arg_2=arg_2, **arg_3)

    arg_2.axhline(arg_4.mean(), color='g', linestyle='--', lw=3)

    arg_2.set_title('Gross leverage')
    arg_2.set_ylabel('Gross leverage')
    arg_2.set_xlabel('')
    return arg_2


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_2
==
'Unique Identifier'
:
return
str
(
arg_1
.
unique_identifier
)
elif
arg_2
==
'Name'
:
arg_3
=
list
(
)
for
arg_4
in
arg_1
.
names
:
arg_4
=
attributes
.
Name
(
attributes
.
Name
.
NameValue
(
arg_4
)
,
attributes
.
Name
.
NameType
(
enums
.
NameType
.
UNINTERPRETED_TEXT_STRING
)
)
arg_3
.
append
(
arg_4
)
return
arg_3
elif
arg_2
==
'Object Type'
:
return
arg_1
.
_object_type
elif
arg_2
==
'Cryptographic Algorithm'
:
return
arg_1
.
cryptographic_algorithm
elif
arg_2
==
'Cryptographic Length'
:
return
arg_1
.
cryptographic_length
elif
arg_2
==
'Cryptographic Parameters'
:
return
elif
arg_2
==
'Cryptographic Domain Parameters'
:
return
elif
arg_2
==
'Certificate Type'
:
return
arg_1
.
certificate_type
elif
arg_2
==
'Certificate Length'
:
return
elif
arg_2
==
'X.509 Certificate Identifier'
:
return
elif
arg_2
==
'X.509 Certificate Subject'
:
return
elif
arg_2
==
'X.509 Certificate Issuer'
:
return
elif
arg_2
==
'Certificate Identifier'
:
return
elif
arg_2
==
'Certificate Subject'
:
return
elif
arg_2
==
'Certificate Issuer'
:
return
elif
arg_2
==
'Digital Signature Algorithm'
:
return
elif
arg_2
==
'Digest'
:
return
elif
arg_2
==
'Operation Policy Name'
:
return
arg_1
.
operation_policy_name
elif
arg_2
==
'Cryptographic Usage Mask'
:
return
arg_1
.
cryptographic_usage_masks
elif
arg_2
==
'Lease Time'
:
return
elif
arg_2
==
'Usage Limits'
:
return
elif
arg_2
==
'State'
:
return
arg_1
.
state
elif
arg_2
==
'Initial Date'
:
return
arg_1
.
initial_date
elif
arg_2
==
'Activation Date'
:
return
elif
arg_2
==
'Process Start Date'
:
return
elif
arg_2
==
'Protect Stop Date'
:
return
elif
arg_2
==
'Deactivation Date'
:
return
elif
arg_2
==
'Destroy Date'
:
return
elif
arg_2
==
'Compromise Occurrence Date'
:
return
elif
arg_2
==
'Compromise Date'
:
return
elif
arg_2
==
'Revocation Reason'
:
return
elif
arg_2
==
'Archive Date'
:
return
elif
arg_2
==
'Object Group'
:
return
elif
arg_2
==
'Fresh'
:
return
elif
arg_2
==
'Link'
:
return
elif
arg_2
==
'Application Specific Information'
:
return
elif
arg_2
==
'Contact Information'
:
return
elif
arg_2
==
'Last Change Date'
:
return
else
:
return

def Func(arg_0, arg_1, arg_2):
        """
        Get the attribute value from the kmip.pie managed object.
        """
        if arg_2 == 'Unique Identifier':
            return str(arg_1.unique_identifier)
        elif arg_2 == 'Name':
            arg_3 = list()
            for arg_4 in arg_1.names:
                arg_4 = attributes.Name(
                    attributes.Name.NameValue(arg_4),
                    attributes.Name.NameType(
                        enums.NameType.UNINTERPRETED_TEXT_STRING
                    )
                )
                arg_3.append(arg_4)
            return arg_3
        elif arg_2 == 'Object Type':
            return arg_1._object_type
        elif arg_2 == 'Cryptographic Algorithm':
            return arg_1.cryptographic_algorithm
        elif arg_2 == 'Cryptographic Length':
            return arg_1.cryptographic_length
        elif arg_2 == 'Cryptographic Parameters':
            return None
        elif arg_2 == 'Cryptographic Domain Parameters':
            return None
        elif arg_2 == 'Certificate Type':
            return arg_1.certificate_type
        elif arg_2 == 'Certificate Length':
            return None
        elif arg_2 == 'X.509 Certificate Identifier':
            return None
        elif arg_2 == 'X.509 Certificate Subject':
            return None
        elif arg_2 == 'X.509 Certificate Issuer':
            return None
        elif arg_2 == 'Certificate Identifier':
            return None
        elif arg_2 == 'Certificate Subject':
            return None
        elif arg_2 == 'Certificate Issuer':
            return None
        elif arg_2 == 'Digital Signature Algorithm':
            return None
        elif arg_2 == 'Digest':
            return None
        elif arg_2 == 'Operation Policy Name':
            return arg_1.operation_policy_name
        elif arg_2 == 'Cryptographic Usage Mask':
            return arg_1.cryptographic_usage_masks
        elif arg_2 == 'Lease Time':
            return None
        elif arg_2 == 'Usage Limits':
            return None
        elif arg_2 == 'State':
            return arg_1.state
        elif arg_2 == 'Initial Date':
            return arg_1.initial_date
        elif arg_2 == 'Activation Date':
            return None
        elif arg_2 == 'Process Start Date':
            return None
        elif arg_2 == 'Protect Stop Date':
            return None
        elif arg_2 == 'Deactivation Date':
            return None
        elif arg_2 == 'Destroy Date':
            return None
        elif arg_2 == 'Compromise Occurrence Date':
            return None
        elif arg_2 == 'Compromise Date':
            return None
        elif arg_2 == 'Revocation Reason':
            return None
        elif arg_2 == 'Archive Date':
            return None
        elif arg_2 == 'Object Group':
            return None
        elif arg_2 == 'Fresh':
            return None
        elif arg_2 == 'Link':
            return None
        elif arg_2 == 'Application Specific Information':
            return None
        elif arg_2 == 'Contact Information':
            return None
        elif arg_2 == 'Last Change Date':
            return None
        else:
            # Since custom attribute names are possible, just return None
            # for unrecognized attributes. This satisfies the spec.
            return None

Get the attribute value from the kmip . pie managed object .


def Func ( arg_0 ) : arg_0 . __currentPhase = arg_0 . __phaseCycler . next ( ) arg_0 . __currentPhase . enterPhase ( ) return

def Func(arg_0):
    """ Advance to the next iteration cycle phase
    """
    arg_0.__currentPhase = arg_0.__phaseCycler.next()
    arg_0.__currentPhase.enterPhase()

    return


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    '''
    This is an alternative function to calculate the autocorrelation.

    This version is from (first definition):

    https://en.wikipedia.org/wiki/Correlogram#Estimation_of_autocorrelations

    Parameters
    ----------

    mags : np.array
        This is the magnitudes array. MUST NOT have any nans.

    lag : float
        The specific lag value to calculate the auto-correlation for. This MUST
        be less than total number of observations in `mags`.

    maglen : int
        The number of elements in the `mags` array.

    magmed : float
        The median of the `mags` array.

    magstd : float
        The standard deviation of the `mags` array.

    Returns
    -------

    float
        The auto-correlation at this specific `lag` value.

    '''

    arg_5 = nparange(0,arg_2-arg_1)
    arg_6 = (arg_0[arg_5] - arg_3) * (arg_0[arg_5+arg_1] - arg_3)

    arg_7 = npsum(arg_6)/arg_5.size
    arg_8 = npsum(
        (arg_0[arg_5] - arg_3)*(arg_0[arg_5] - arg_3)
    )/arg_0.size

    arg_9 = arg_7/arg_8

    return arg_9

This is an alternative function to calculate the autocorrelation .


def Func(arg_0, arg_1):
  '''
  get host name of remote host
  '''
  if is_self(arg_0):
    return get_self_hostname()
  arg_2 = "hostname"
  arg_3 = ssh_remote_execute(arg_2, arg_0, arg_1)
  arg_4 = subprocess.Popen(arg_3,
                         shell=True,
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE)
  arg_5 = arg_4.wait()
  arg_6 = arg_4.communicate()

  if arg_5 != 0:
    Log.error("Failed to get hostname for remote host %s with output:\n%s" % (arg_0, arg_6))
    sys.exit(-1)
  return arg_6[0].strip("\n")


"  Subscription pre-approvals available"

def Func(arg_0, arg_1):
        """Check for roster related features in the stream features received
        and set `server_features` accordingly.
        """
        arg_2 = set()
        logger.debug("Checking roster-related features")
        if arg_1.features.find(FEATURE_ROSTERVER) is not None:
            logger.debug("  Roster versioning available")
            arg_2.add("versioning")
        if arg_1.features.find(FEATURE_APPROVALS) is not None:
            logger.debug("  Subscription pre-approvals available")
            arg_2.add("pre-approvals")
        arg_0.server_features = arg_2

Check for roster related features in the stream features received and set server_features accordingly .


def Func ( arg_0 ) : try : return _type_to_extra_dim_id_style_1 [ arg_0 ] except KeyError : try : return _type_to_extra_dim_id_style_2 [ arg_0 ] except KeyError : raise errors . UnknownExtraType ( arg_0 )

def Func(arg_0):
    """ Returns the index of the type as defined in the LAS Specification

    Parameters
    ----------
    type_str: str

    Returns
    -------
    int
        index of the type

    """
    try:
        return _type_to_extra_dim_id_style_1[arg_0]
    except KeyError:
        try:
            return _type_to_extra_dim_id_style_2[arg_0]
        except KeyError:
            raise errors.UnknownExtraType(arg_0)


def Func ( arg_0 , arg_1 ) : arg_2 = people . Attendee . get_instance ( arg_0 . user ) try : arg_3 = arg_2 . attendeeprofilebase arg_3 = people . AttendeeProfileBase . objects . get_subclass ( pk = arg_3 . id , ) except ObjectDoesNotExist : arg_3 = None try : arg_4 = arg_0 . user . speaker_profile arg_5 = arg_4 . name except ObjectDoesNotExist : arg_5 = None arg_6 = ProfileForm . Meta . model . name_field ( ) arg_7 = { } if arg_3 is None and arg_6 is not None : arg_7 [ arg_6 ] = arg_5 arg_8 = ProfileForm ( arg_0 . POST or None , arg_7 = arg_7 , arg_10 = arg_3 , arg_1 = arg_1 ) arg_9 = True if arg_0 . POST else False if arg_0 . POST and arg_8 . is_valid ( ) : arg_8 . instance . attendee = arg_2 arg_8 . save ( ) return arg_8 , arg_9

def Func(arg_0, arg_1):
    ''' Returns a profile form instance, and a boolean which is true if the
    form was handled. '''
    arg_2 = people.Attendee.get_instance(arg_0.user)

    try:
        arg_3 = arg_2.attendeeprofilebase
        arg_3 = people.AttendeeProfileBase.objects.get_subclass(
            pk=arg_3.id,
        )
    except ObjectDoesNotExist:
        arg_3 = None

    # Load a pre-entered name from the speaker's profile,
    # if they have one.
    try:
        arg_4 = arg_0.user.speaker_profile
        arg_5 = arg_4.name
    except ObjectDoesNotExist:
        arg_5 = None

    arg_6 = ProfileForm.Meta.model.name_field()
    arg_7 = {}
    if arg_3 is None and arg_6 is not None:
        arg_7[arg_6] = arg_5

    arg_8 = ProfileForm(
        arg_0.POST or None,
        arg_7=arg_7,
        arg_10=arg_3,
        arg_1=arg_1
    )

    arg_9 = True if arg_0.POST else False

    if arg_0.POST and arg_8.is_valid():
        arg_8.instance.attendee = arg_2
        arg_8.save()

    return arg_8, arg_9

Returns a profile form instance and a boolean which is true if the form was handled .


(path, colors, precision=0.4, continuous=True)

def Func(arg_0, arg_1, arg_2=0.4, arg_3=True):
    """
    Outlines each contour in a path with the colors in the list.

    Each contour starts with the first color in the list,
    and ends with the last color in the list.

    Because each line segment is drawn separately,
    works only with corner-mode transforms.
    """
    # The count of points in a given path/contour.
    def _point_count(arg_0, arg_2):
        return max(int(arg_0.length * arg_2 * 0.5), 10)

    # The total count of points in the path.
    arg_4 = sum([_point_count(arg_8, arg_2) for arg_8 in arg_0.contours])

    # For a continuous gradient,
    # we need to calculate a subrange in the list of colors
    # for each contour to draw colors from.
    arg_5 = 0
    arg_6 = len(arg_0.contours) - 1
    if arg_6 == 0: arg_3 = False

    arg_7 = 0
    for arg_8 in arg_0.contours:

        if not arg_3: arg_7 = 0

        # The number of points for each contour.
        arg_9 = _point_count(arg_8, arg_2)

        arg_10 = True
        for arg_11 in arg_8.points(arg_9):
            if arg_10:
                arg_10 = False
            else:
                if not arg_3:
                    # If we have a list of 100 colors and 50 points,
                    # point i maps to color i*2.
                    arg_12 = float(arg_7) / arg_9 * len(arg_1)
                else:
                    # In a continuous gradient of 100 colors,
                    # the 2nd contour in a path with 10 contours
                    # draws colors between 10-20
                    arg_12 = float(arg_7) / arg_4 * len(arg_1) - 1 * arg_5 / arg_6
                _ctx.stroke(arg_1[int(arg_12)])
                _ctx.line(arg_13, arg_14, arg_11.x, arg_11.y)
            arg_13 = arg_11.x
            arg_14 = arg_11.y
            arg_7 += 1

        arg_11 = arg_8.point(0.9999999)  # Fix in pathmatics!
        _ctx.line(arg_13, arg_14, arg_11.x, arg_11.y)
        arg_5 += 1

Outlines each contour in a path with the colors in the list .


def Func ( arg_0 ) : while arg_0 . ws_client . connected ( ) : if arg_0 . die : break if arg_0 . pause : sleep ( 5 ) continue arg_1 = arg_0 . ws_client . receive ( ) if arg_1 is None : break arg_2 = arg_1 [ 'type' ] if arg_2 == 'error' : continue if arg_1 [ 'sequence' ] <= arg_0 . sequence : continue if arg_2 == 'open' : arg_0 . _handle_open ( arg_1 ) elif arg_2 == 'match' : arg_0 . _handle_match ( arg_1 ) elif arg_2 == 'done' : arg_0 . _handle_done ( arg_1 ) elif arg_2 == 'change' : arg_0 . _handle_change ( arg_1 ) else : continue arg_0 . ws_client . disconnect ( )

def Func(arg_0):
    """Handles real-time updates to the order book."""
    while arg_0.ws_client.connected():
      if arg_0.die:
        break

      if arg_0.pause:
        sleep(5)
        continue

      arg_1 = arg_0.ws_client.receive()

      if arg_1 is None:
        break

      arg_2 = arg_1['type']

      if arg_2  == 'error':
        continue
      if arg_1['sequence'] <= arg_0.sequence:
        continue

      if arg_2 == 'open':
        arg_0._handle_open(arg_1)
      elif arg_2 == 'match':
        arg_0._handle_match(arg_1)
      elif arg_2 == 'done':
        arg_0._handle_done(arg_1)
      elif arg_2 == 'change':
        arg_0._handle_change(arg_1)
      else:
        continue

    arg_0.ws_client.disconnect()

Handles real - time updates to the order book .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = transform_language_code ( arg_1 . get ( 'content_language' , '' ) ) for arg_4 in arg_0 . enterprise_configuration . get_locales ( default_locale = arg_3 ) : arg_2 . append ( { 'locale' : arg_4 , 'value' : ( arg_1 [ 'full_description' ] or arg_1 [ 'short_description' ] or arg_1 [ 'title' ] or '' ) } ) return arg_2

def Func(arg_0, arg_1):
        """
        Return the description of the courserun content item.
        """
        arg_2 = []
        arg_3 = transform_language_code(arg_1.get('content_language', ''))
        for arg_4 in arg_0.enterprise_configuration.get_locales(default_locale=arg_3):
            arg_2.append({
                'locale': arg_4,
                'value': (
                    arg_1['full_description'] or
                    arg_1['short_description'] or
                    arg_1['title'] or
                    ''
                )
            })

        return arg_2

Return the description of the courserun content item .


def Func ( arg_0 : arg_1 ) -> EdgePredicate : if isinstance ( arg_0 , str ) : @ edge_predicate def pmid_exclusion_filter ( arg_2 : arg_3 ) -> bool : return has_pubmed ( arg_2 ) and arg_2 [ CITATION ] [ CITATION_REFERENCE ] != arg_0 elif isinstance ( arg_0 , Iterable ) : arg_0 = set ( arg_0 ) @ edge_predicate def pmid_exclusion_filter ( arg_2 : arg_3 ) -> bool : return has_pubmed ( arg_2 ) and arg_2 [ CITATION ] [ CITATION_REFERENCE ] not in arg_0 else : raise TypeError return pmid_exclusion_filter

def Func(arg_0: arg_1) -> EdgePredicate:
    """Fail for edges with citations whose references are one of the given PubMed identifiers.

    :param pmids: A PubMed identifier or list of PubMed identifiers to filter against
    """
    if isinstance(arg_0, str):
        @edge_predicate
        def pmid_exclusion_filter(arg_2: arg_3) -> bool:
            """Fail for edges with PubMed citations matching the contained PubMed identifier.

            :return: If the edge has a PubMed citation with the contained PubMed identifier
            """
            return has_pubmed(arg_2) and arg_2[CITATION][CITATION_REFERENCE] != arg_0

    elif isinstance(arg_0, Iterable):
        arg_0 = set(arg_0)

        @edge_predicate
        def pmid_exclusion_filter(arg_2: arg_3) -> bool:
            """Pass for edges with PubMed citations matching one of the contained PubMed identifiers.

            :return: If the edge has a PubMed citation with one of the contained PubMed identifiers
            """
            return has_pubmed(arg_2) and arg_2[CITATION][CITATION_REFERENCE] not in arg_0

    else:
        raise TypeError

    return pmid_exclusion_filter

Fail for edges with citations whose references are one of the given PubMed identifiers .