def Func(arg_0, arg_1):
        """ Serial call to read schedule tariffs buffer

        Args:
            tableset (int): :class:`~ekmmeters.ReadSchedules` buffer to return.

        Returns:
            bool: True on completion and ACK.
        """
        arg_0.setContext("Func")
        try:
            arg_2 = binascii.hexlify(str(arg_1).zfill(1))
            arg_3 = "01523102303037" + arg_2 + "282903"

            arg_0.request(False)
            arg_4 = arg_0.calc_crc16(arg_3[2:].decode("hex"))
            arg_3 += arg_4
            arg_0.m_serial_port.write(arg_3.decode("hex"))
            arg_5 = arg_0.m_serial_port.getResponse(arg_0.getContext())
            arg_0.serialPostEnd()
            arg_6 = arg_0.calc_crc16(arg_5[1:-2])

            if arg_1 == ReadSchedules.Schedules_1_To_4:
                arg_7 = arg_0.unpackStruct(arg_5, arg_0.m_schd_1_to_4)
                arg_0.convertData(arg_7, arg_0.m_schd_1_to_4, arg_0.m_kwh_precision)
                if str(arg_6) == str(arg_0.m_schd_1_to_4["crc16"][MeterData.StringValue]):
                    ekm_log("Schedules 1 to 4 CRC success (06 return")
                    arg_0.setContext("")
                    return True

            elif arg_1 == ReadSchedules.Schedules_5_To_6:
                arg_7 = arg_0.unpackStruct(arg_5, arg_0.m_schd_5_to_6)
                arg_0.convertData(arg_7, arg_0.m_schd_5_to_6, arg_0.m_kwh_precision)
                if str(arg_6) == str(arg_0.m_schd_5_to_6["crc16"][MeterData.StringValue]):
                    ekm_log("Schedules 5 to 8 CRC success (06 return)")
                    arg_0.setContext("")
                    return True
        except:
            ekm_log(traceback.format_exc(sys.exc_info()))

        arg_0.setContext("")
        return False


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . sender or arg_1 arg_3 = arg_0 . reply_to or '' for arg_4 in [ arg_0 . subject , arg_2 , arg_3 ] + arg_0 . recipients : for arg_5 in '\r\n' : if arg_5 in arg_4 : return True return False

def Func(arg_0, arg_1=None):
        """Checks for bad headers i.e. newlines in subject, sender or recipients.
        """

        arg_2 = arg_0.sender or arg_1
        arg_3 = arg_0.reply_to or ''
        for arg_4 in [arg_0.subject, arg_2, arg_3] + arg_0.recipients:
            for arg_5 in '\r\n':
                if arg_5 in arg_4:
                    return True
        return False

Checks for bad headers i . e . newlines in subject sender or recipients .


def Func ( arg_0 ) : arg_1 = arg_0 . GET . get ( 'return_url' , None ) if not arg_1 : arg_1 = arg_0 . META . get ( 'HTTP_REFERER' , '/' ) arg_2 = arg_0 . GET . getlist ( 'scopes' , django_util . oauth2_settings . scopes ) if django_util . oauth2_settings . storage_model : if not arg_0 . user . is_authenticated ( ) : return redirect ( '{0}?next={1}' . format ( settings . LOGIN_URL , parse . quote ( arg_0 . get_full_path ( ) ) ) ) else : arg_3 = django_util . UserOAuth2 ( arg_0 , arg_2 , arg_1 ) if arg_3 . has_credentials ( ) : return redirect ( arg_1 ) arg_4 = _make_flow ( arg_0 = arg_0 , arg_2 = arg_2 , arg_1 = arg_1 ) arg_5 = arg_4 . step1_get_authorize_url ( ) return shortcuts . redirect ( arg_5 )

def Func(arg_0):
    """ View to start the OAuth2 Authorization flow.

     This view starts the OAuth2 authorization flow. If scopes is passed in
     as a  GET URL parameter, it will authorize those scopes, otherwise the
     default scopes specified in settings. The return_url can also be
     specified as a GET parameter, otherwise the referer header will be
     checked, and if that isn't found it will return to the root path.

    Args:
       request: The Django request object.

    Returns:
         A redirect to Google OAuth2 Authorization.
    """
    arg_1 = arg_0.GET.get('return_url', None)
    if not arg_1:
        arg_1 = arg_0.META.get('HTTP_REFERER', '/')

    arg_2 = arg_0.GET.getlist('scopes', django_util.oauth2_settings.scopes)
    # Model storage (but not session storage) requires a logged in user
    if django_util.oauth2_settings.storage_model:
        if not arg_0.user.is_authenticated():
            return redirect('{0}?next={1}'.format(
                settings.LOGIN_URL, parse.quote(arg_0.get_full_path())))
        # This checks for the case where we ended up here because of a logged
        # out user but we had credentials for it in the first place
        else:
            arg_3 = django_util.UserOAuth2(arg_0, arg_2, arg_1)
            if arg_3.has_credentials():
                return redirect(arg_1)

    arg_4 = _make_flow(arg_0=arg_0, arg_2=arg_2, arg_1=arg_1)
    arg_5 = arg_4.step1_get_authorize_url()
    return shortcuts.redirect(arg_5)

View to start the OAuth2 Authorization flow .


def Func(arg_0):
        """Login to enedis."""
        arg_1 = {
            'IDToken1': arg_0.username,
            'IDToken2': arg_0.password,
            'SunQueryParamsString': base64.b64encode(b'realm=particuliers'),
            'encoded': 'true',
            'gx_charset': 'UTF-8'
        }

        try:
            arg_0._session.post(LOGIN_URL,
                               arg_1=arg_1,
                               allow_redirects=False,
                               timeout=arg_0._timeout)
        except OSError:
            raise PyLinkyError("Can not submit login form")
        if 'iPlanetDirectoryPro' not in arg_0._session.cookies:
            raise PyLinkyError("Login error: Please check your username/password.")
        return True


(self, batch_size, batch_num, fluxes=True)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : for arg_4 in range ( arg_2 ) : yield arg_0 . sample ( arg_1 , arg_3 = arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3=True):
        """Create a Func generator.

        This is useful to generate n Funces of m samples each.

        Parameters
        ----------
        Func_size : int
            The number of samples contained in each Func (m).
        Func_num : int
            The number of Funces in the generator (n).
        fluxes : boolean
            Whether to return fluxes or the internal solver variables. If set
            to False will return a variable for each forward and backward flux
            as well as all additional variables you might have defined in the
            model.

        Yields
        ------
        pandas.DataFrame
            A DataFrame with dimensions (Func_size x n_r) containing
            a valid flux sample for a total of n_r reactions (or variables if
            fluxes=False) in each row.

        """

        for arg_4 in range(arg_2):
            yield arg_0.sample(arg_1, arg_3=arg_3)

Create a batch generator.

        This is useful to generate n batches of m samples each.

        Parameters
        ----------
        batch_size : int
            The number of samples contained in each batch (m).
        batch_num : int
            The number of batches in the generator (n).
        fluxes : boolean
            Whether to return fluxes or the internal solver variables. If set
            to False will return a variable for each forward and backward flux
            as well as all additional variables you might have defined in the
            model.

        Yields
        ------
        pandas.DataFrame
            A DataFrame with dimensions (batch_size x n_r) containing
            a valid flux sample for a total of n_r reactions (or variables if
            fluxes=False) in each row.


def
Func
(
arg_0
)
:
try
:
if
h2o
.
connection
(
)
.
local_server
and
not
h2o
.
connection
(
)
.
local_server
.
Func
(
)
:
return
False
h2o
.
api
(
"GET /"
)
return
True
except
(
H2OConnectionError
,
H2OServerError
)
:
return
False

def Func(arg_0):
        """
        Determine if the H2O cluster is running or not.

        :returns: True if the cluster is up; False otherwise
        """
        try:
            if h2o.connection().local_server and not h2o.connection().local_server.Func(): return False
            h2o.api("GET /")
            return True
        except (H2OConnectionError, H2OServerError):
            return False

Determine if the H2O cluster is running or not .


def Func(arg_0):
    """
    Initialize this Sphinx extension
    """
    arg_0.Func_extension('sphinx.ext.todo')
    arg_0.Func_extension('sphinx.ext.mathjax')

    arg_0.Func_extension("sphinx.ext.intersphinx")
    arg_0.config.intersphinx_mapping.update({
        'https://docs.python.org/': None
        })
    arg_0.config.intersphinx_mapping.update({
        sage_doc_url + arg_1 + "/": None
        for arg_1 in sage_documents
        })
    arg_0.config.intersphinx_mapping.update({
        sage_doc_url + "reference/" + arg_2: None
        for arg_2 in sage_modules
        })

    arg_0.Func_extension("sphinx.ext.extlinks")
    arg_0.config.extlinks.update({
        'python': ('https://docs.python.org/release/'+pythonversion+'/%s', ''),
        # Sage trac ticket shortcuts. For example, :trac:`7549` .
        'trac': ('https://trac.sagemath.org/%s', 'trac ticket #'),
        'wikipedia': ('https://en.wikipedia.org/wiki/%s', 'Wikipedia article '),
        'arxiv': ('http://arxiv.org/abs/%s', 'Arxiv '),
        'oeis': ('https://oeis.org/%s', 'OEIS sequence '),
        'doi': ('https://dx.doi.org/%s', 'doi:'),
        'pari': ('http://pari.math.u-bordeaux.fr/dochtml/help/%s', 'pari:'),
        'mathscinet': ('http://www.ams.org/mathscinet-getitem?mr=%s', 'MathSciNet ')
        })

    arg_0.config.html_theme = 'sage'


def Func ( arg_0 , arg_1 = None ) : if arg_1 : return arg_0 . transactionbuilder_class ( arg_1 , blockchain_instance = arg_0 ) . Func ( ) else : return arg_0 . txbuffer . Func ( )

def Func(arg_0, arg_1=None):
        """ Broadcast a transaction to the Blockchain

            :param tx tx: Signed transaction to Func
        """
        if arg_1:
            # If tx is provided, we Func the tx
            return arg_0.transactionbuilder_class(
                arg_1, blockchain_instance=arg_0
            ).Func()
        else:
            return arg_0.txbuffer.Func()

Broadcast a transaction to the Blockchain

            :param tx tx: Signed transaction to broadcast


def Func ( arg_0 ) : arg_1 = arg_0 . conn . indices . get_mapping ( index = arg_0 . index , doc_type = arg_0 . type ) return arg_1 [ arg_0 . index ] [ 'mappings' ] [ arg_0 . type ] [ 'properties' ]

def Func(arg_0):
        'Retrieve the field types. Useful for debugging.'
        arg_1 = arg_0.conn.indices.get_mapping(
            index=arg_0.index, doc_type=arg_0.type)
        return arg_1[arg_0.index]['mappings'][arg_0.type]['properties']

Retrieve the field types . Useful for debugging .


return self.orient_directed_graph(data, dag, alg=alg)

def Func(arg_0, arg_1, arg_2, arg_3='HC'):
        """Orient the undirected graph using GNN and apply CGNN to improve the graph.

        Args:
            data (pandas.DataFrame): Observational data on which causal
               discovery has to be performed.
            umg (nx.Graph): Graph that provides the skeleton, on which the GNN
               then the CGNN algorithm will be applied.
            alg (str): Exploration heuristic to use, among ["HC", "HCr",
               "tabu", "EHC"]
        Returns:
            networkx.DiGraph: Solution given by CGNN.

        .. note::
           GNN (``cdt.causality.pairwise.GNN``) is first used to orient the
           undirected graph and output a DAG before applying CGNN.
        """
        warnings.warn("The pairwise GNN model is computed on each edge of the UMG "
                      "to initialize the model and start CGNN with a DAG")
        arg_4 = GNN(nh=arg_0.nh, lr=arg_0.lr)

        arg_5 = arg_4.orient_graph(arg_1, arg_2, nb_runs=arg_0.nb_runs, nb_max_runs=arg_0.nb_runs,
                              nb_jobs=arg_0.nb_jobs, train_epochs=arg_0.train_epochs,
                              test_epochs=arg_0.test_epochs, verbose=arg_0.verbose, gpu=arg_0.gpu)  # Pairwise method
        # print(nx.adj_matrix(og).todense().shape)
        # print(list(og.edges()))
        arg_6 = dagify_min_edge(arg_5)
        # print(nx.adj_matrix(dag).todense().shape)

        return arg_0.orient_directed_graph(arg_1, arg_6, arg_3=arg_3)

Orient the undirected graph using GNN and apply CGNN to improve the graph .


(token_indices=None,
                    token_embedding_matrix=None,
                    n_tokens=None,
                    token_embedding_dim=None,
                    name: str = None,
                    trainable=True)

def Func(arg_0=None,
                    arg_1=None,
                    arg_2=None,
                    arg_3=None,
                    arg_4: arg_5 = None,
                    arg_6=True):
    """ Token embedding layer. Create matrix of for token embeddings.
        Can be initialized with given matrix (for example pre-trained
        with word2ve algorithm

    Args:
        token_indices: token indices tensor of type tf.int32
        token_embedding_matrix: matrix of embeddings with dimensionality
            [n_tokens, embeddings_dimension]
        n_tokens: total number of unique tokens
        token_embedding_dim: dimensionality of embeddings, typical 100..300
        name: embedding matrix name (variable name)
        trainable: whether to set the matrix trainable or not

    Returns:
        embedded_tokens: tf tensor of size [B, T, E], where B - batch size
            T - number of tokens, E - token_embedding_dim
    """
    if arg_1 is not None:
        arg_7 = arg_1
        if arg_6:
            Warning('Matrix of embeddings is passed to the Func, '
                    'possibly there is a pre-trained embedding matrix. '
                    'Embeddings paramenters are set to Trainable!')
    else:
        arg_7 = np.random.randn(arg_2, arg_3).astype(np.float32) / np.sqrt(arg_3)
    arg_8 = tf.Variable(arg_7, arg_4=arg_4, arg_6=arg_6)
    arg_9 = tf.nn.embedding_lookup(arg_8, arg_0)
    return arg_9

Token embedding layer . Create matrix of for token embeddings . Can be initialized with given matrix ( for example pre - trained with word2ve algorithm


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
uplink
:
arg_0
.
uplink
.
Func
(
arg_1
)
else
:
raise
NoRouteError
(
"No route for stanza"
)

def Func(arg_0, arg_1):
        """Send a stanza somwhere.

        The default implementation Funcs it via the `uplink` if it is defined
        or raises the `NoRouteError`.

        :Parameters:
            - `stanza`: the stanza to Func.
        :Types:
            - `stanza`: `pyxmpp.stanza.Stanza`"""
        if arg_0.uplink:
            arg_0.uplink.Func(arg_1)
        else:
            raise NoRouteError("No route for stanza")

Send a stanza somwhere.

        The default implementation sends it via the `uplink` if it is defined
        or raises the `NoRouteError`.

        :Parameters:
            - `stanza`: the stanza to send.
        :Types:
            - `stanza`: `pyxmpp.stanza.Stanza`


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
inspect
.
getdoc
(
arg_1
)
arg_3
=
""
arg_3
+=
"\n"
arg_3
+=
annotate
.
context_name
(
arg_1
)
+
"\n"
if
arg_2
is
not
:
arg_2
=
inspect
.
cleandoc
(
arg_2
)
arg_3
+=
arg_2
+
"\n"
arg_3
+=
"\nDefined Functions:\n"
arg_4
=
False
if
isinstance
(
arg_1
,
dict
)
:
arg_5
=
arg_1
.
keys
(
)
arg_4
=
True
else
:
arg_5
=
utils
.
find_all
(
arg_1
)
for
arg_6
in
sorted
(
arg_5
)
:
arg_7
=
if
arg_4
:
arg_7
=
arg_6
arg_6
=
arg_0
.
find_function
(
arg_1
,
arg_6
)
if
isinstance
(
arg_6
,
dict
)
:
if
arg_4
:
arg_3
+=
" - "
+
arg_7
+
'\n'
else
:
arg_3
+=
" - "
+
arg_6
.
metadata
.
name
+
'\n'
else
:
arg_3
+=
" - "
+
arg_6
.
metadata
.
signature
(
name
=
arg_7
)
+
'\n'
if
annotate
.
short_description
(
arg_6
)
!=
""
:
arg_3
+=
"   "
+
annotate
.
short_description
(
arg_6
)
+
'\n'
arg_3
+=
"\nBuiltin Functions\n"
for
arg_8
in
sorted
(
arg_0
.
builtins
.
keys
(
)
)
:
arg_3
+=
' - '
+
arg_8
+
'\n'
arg_3
+=
'\n'
return
arg_3

def Func(arg_0, arg_1):
        """Return a listing of all of the functions in this context including builtins.

        Args:
            context (object): The context to print a directory for.

        Returns:
            str
        """

        arg_2 = inspect.getdoc(arg_1)

        arg_3 = ""
        arg_3 += "\n"

        arg_3 += annotate.context_name(arg_1) + "\n"

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

        arg_3 += "\nDefined Functions:\n"
        arg_4 = False

        if isinstance(arg_1, dict):
            arg_5 = arg_1.keys()
            arg_4 = True
        else:
            arg_5 = utils.find_all(arg_1)

        for arg_6 in sorted(arg_5):
            arg_7 = None
            if arg_4:
                arg_7 = arg_6

            arg_6 = arg_0.find_function(arg_1, arg_6)

            if isinstance(arg_6, dict):
                if arg_4:
                    arg_3 += " - " + arg_7 + '\n'
                else:
                    arg_3 += " - " + arg_6.metadata.name + '\n'
            else:
                arg_3 += " - " + arg_6.metadata.signature(name=arg_7) + '\n'

            if annotate.short_description(arg_6) != "":
                arg_3 += "   " + annotate.short_description(arg_6) + '\n'

        arg_3 += "\nBuiltin Functions\n"
        for arg_8 in sorted(arg_0.builtins.keys()):
            arg_3 += ' - ' + arg_8 + '\n'

        arg_3 += '\n'
        return arg_3

Return a listing of all of the functions in this context including builtins .


def
Func
(
arg_0
,
arg_1
=
,
**
arg_2
)
:
if
arg_2
.
pop
(
'include_debug_header'
,
True
)
:
debug
.
log
(
'Getting the record.'
,
header
=
'details'
)
arg_3
=
arg_0
.
read
(
arg_1
=
arg_1
,
fail_on_no_results
=
True
,
fail_on_multiple_results
=
True
,
**
arg_2
)
return
arg_3
[
'results'
]
[
0
]

def Func(arg_0, arg_1=None, **arg_2):
        """Return one and exactly one object.

        Lookups may be through a primary key, specified as a positional argument, and/or through filters specified
        through keyword arguments.

        If the number of results does not equal one, raise an exception.

        =====API DOCS=====
        Retrieve one and exactly one object.

        :param pk: Primary key of the resource to be read. Tower CLI will only attempt to read *that* object
                   if ``pk`` is provided (not ``None``).
        :type pk: int
        :param `**kwargs`: Keyword arguments used to look up resource object to retrieve if ``pk`` is not provided.
        :returns: loaded JSON of the retrieved resource object.
        :rtype: dict

        =====API DOCS=====
        """
        if arg_2.pop('include_debug_header', True):
            debug.log('Getting the record.', header='details')
        arg_3 = arg_0.read(arg_1=arg_1, fail_on_no_results=True, fail_on_multiple_results=True, **arg_2)
        return arg_3['results'][0]


return (line and _re_def.match(line) and op_at_frame(frame)=='LOAD_CONST'
            and stmt_contains_opcode(frame.f_code, frame.f_lineno,
                                          'MAKE_FUNCTION'))

def Func(arg_0, arg_1):
    """Return True if we are looking at a def statement"""
    # Should really also check that operand of 'LOAD_CONST' is a code object
    return (arg_0 and _re_def.match(arg_0) and op_at_frame(arg_1)=='LOAD_CONST'
            and stmt_contains_opcode(arg_1.f_code, arg_1.f_lineno,
                                          'MAKE_FUNCTION'))


def Func ( arg_0 , arg_1 , arg_2 = 3 ) : for arg_3 , arg_4 in enumerate ( arg_0 . bodies ) : if arg_4 . name == arg_1 : return list ( range ( arg_3 * arg_2 , ( arg_3 + 1 ) * arg_2 ) ) return [ ]

def Func(arg_0, arg_1, arg_2=3):
        '''Get a list of the indices for a specific body.

        Parameters
        ----------
        name : str
            The name of the body to look up.
        step : int, optional
            The number of numbers for each body. Defaults to 3, should be set
            to 4 for body rotation (since quaternions have 4 values).

        Returns
        -------
        list of int :
            A list of the index values for quantities related to the named body.
        '''
        for arg_3, arg_4 in enumerate(arg_0.bodies):
            if arg_4.name == arg_1:
                return list(range(arg_3 * arg_2, (arg_3 + 1) * arg_2))
        return []

Get a list of the indices for a specific body .


def Func ( arg_0 ) : arg_1 = argparse . ArgumentParser ( description = arg_0 . common . help , prefix_chars = '-+' ) arg_0 . _add_options_to_parser ( arg_0 . _opt_bare , arg_1 ) arg_1 . set_defaults ( ** arg_0 . common . defaults ) if arg_0 . bare is not None : arg_1 . set_defaults ( ** arg_0 . bare . defaults ) arg_2 = arg_1 . add_subparsers ( dest = 'loam_sub_name' ) for arg_3 , arg_4 in arg_0 . subcmds . items ( ) : arg_5 = { 'prefix_chars' : '+-' , 'help' : arg_4 . help } arg_6 = arg_2 . add_parser ( arg_3 , ** arg_5 ) arg_0 . _add_options_to_parser ( arg_0 . _opt_cmds [ arg_3 ] , arg_6 ) arg_6 . set_defaults ( ** arg_4 . defaults ) return arg_1

def Func(arg_0):
        """Build command line argument parser.

        Returns:
            :class:`argparse.ArgumentParser`: the command line argument parser.
            You probably won't need to use it directly. To parse command line
            arguments and update the :class:`ConfigurationManager` instance
            accordingly, use the :meth:`parse_args` method.
        """
        arg_1 = argparse.ArgumentParser(description=arg_0.common.help,
                                              prefix_chars='-+')

        arg_0._add_options_to_parser(arg_0._opt_bare, arg_1)
        arg_1.set_defaults(**arg_0.common.defaults)
        if arg_0.bare is not None:
            arg_1.set_defaults(**arg_0.bare.defaults)

        arg_2 = arg_1.add_subparsers(dest='loam_sub_name')
        for arg_3, arg_4 in arg_0.subcmds.items():
            arg_5 = {'prefix_chars': '+-', 'help': arg_4.help}
            arg_6 = arg_2.add_parser(arg_3, **arg_5)
            arg_0._add_options_to_parser(arg_0._opt_cmds[arg_3], arg_6)
            arg_6.set_defaults(**arg_4.defaults)

        return arg_1


def Func ( ) : arg_0 = os . environ . get ( "COVERAGE_PROCESS_START" ) if arg_0 : arg_1 = coverage ( config_file = arg_0 , auto_data = True ) arg_1 . start ( ) arg_1 . _warn_no_data = False arg_1 . _warn_unimported_source = False

def Func():
    """Call this at Python startup to perhaps measure coverage.

    If the environment variable COVERAGE_PROCESS_START is defined, coverage
    measurement is started.  The value of the variable is the config file
    to use.

    There are two ways to configure your Python installation to invoke this
    function when Python starts:

    #. Create or append to sitecustomize.py to add these lines::

        import coverage
        coverage.Func()

    #. Create a .pth file in your Python installation containing::

        import coverage; coverage.Func()

    """
    arg_0 = os.environ.get("COVERAGE_PROCESS_START")
    if arg_0:
        arg_1 = coverage(config_file=arg_0, auto_data=True)
        arg_1.start()
        arg_1._warn_no_data = False
        arg_1._warn_unimported_source = False

Call this at Python startup to perhaps measure coverage.

    If the environment variable COVERAGE_PROCESS_START is defined, coverage
    measurement is started.  The value of the variable is the config file
    to use.

    There are two ways to configure your Python installation to invoke this
    function when Python starts:

    #. Create or append to sitecustomize.py to add these lines::

        import coverage
        coverage.process_startup()

    #. Create a .pth file in your Python installation containing::

        import coverage; coverage.process_startup()

Call this at Python startup to perhaps measure coverage .


def Func(arg_0, arg_1=None):
        '''Returns all active bets'''
        arg_2 = urljoin(
            arg_0.settings['bets_url'],
            'bets?state=fresh,active,accept_end&page=1&page_size=100')

        if arg_1 is not None:
            arg_2 += '&kava_project_id={}'.format(arg_1)

        arg_3 = []
        arg_4 = True
        while arg_4:
            arg_5 = arg_0._req(arg_2)
            arg_3.extend(arg_5['bets']['results'])
            arg_2 = arg_5['bets'].get('next')
            arg_4 = bool(arg_2)

        return arg_3


def Func ( arg_0 ) : with open ( arg_0 , "rU" ) as f : return md5 ( py3compat . str_to_bytes ( f . read ( ) ) ) . hexdigest ( )

def Func(arg_0):
    """Make an MD5 hash of a file, ignoring any differences in line
    ending characters."""
    with open(arg_0, "rU") as f:
        return md5(py3compat.str_to_bytes(f.read())).hexdigest()

Make an MD5 hash of a file ignoring any differences in line ending characters .


def
Func
(
arg_0
)
:
if
arg_0
not
in
__NAMESPACE__
:
raise
NamespaceError
(
'Unknown namespace: {:s}'
.
format
(
arg_0
)
)
if
'enum'
not
in
__NAMESPACE__
[
arg_0
]
[
'value'
]
:
raise
NamespaceError
(
'Namespace {:s} is not enumerated'
.
format
(
arg_0
)
)
return
copy
.
copy
(
__NAMESPACE__
[
arg_0
]
[
'value'
]
[
'enum'
]
)

def Func(arg_0):
    '''Return the allowed Func for an enumerated namespace.

    Parameters
    ----------
    ns_key : str
        Namespace key identifier

    Returns
    -------
    Func : list

    Raises
    ------
    NamespaceError
        If `ns_key` is not found, or does not have enumerated Func

    Examples
    --------
    >>> jams.schema.Func('tag_gtzan')
    ['blues', 'classical', 'country', 'disco', 'hip-hop', 'jazz',
     'metal', 'pop', 'reggae', 'rock']
    '''

    if arg_0 not in __NAMESPACE__:
        raise NamespaceError('Unknown namespace: {:s}'.format(arg_0))

    if 'enum' not in __NAMESPACE__[arg_0]['value']:
        raise NamespaceError('Namespace {:s} is not enumerated'.format(arg_0))

    return copy.copy(__NAMESPACE__[arg_0]['value']['enum'])

Return the allowed values for an enumerated namespace.

    Parameters
    ----------
    ns_key : str
        Namespace key identifier

    Returns
    -------
    values : list

    Raises
    ------
    NamespaceError
        If `ns_key` is not found, or does not have enumerated values

    Examples
    --------
    >>> jams.schema.values('tag_gtzan')
    ['blues', 'classical', 'country', 'disco', 'hip-hop', 'jazz',
     'metal', 'pop', 'reggae', 'rock']

Return the allowed values for an enumerated namespace .


def Func ( arg_0 ) : try : arg_1 = _pybossa_req ( 'put' , 'category' , arg_0 . id , payload = arg_0 . data ) if arg_1 . get ( 'id' ) : return Category ( arg_1 ) else : return arg_1 except : raise

def Func(arg_0):
    """Update a Category instance.

    :param category: PYBOSSA Category
    :type category: PYBOSSA Category
    :returns: True -- the response status code

    """
    try:
        arg_1 = _pybossa_req('put', 'category',
                           arg_0.id, payload=arg_0.data)
        if arg_1.get('id'):
            return Category(arg_1)
        else:
            return arg_1
    except:  # pragma: no cover
        raise


x
        Make a set of points for `this` label

(self, ts, data, label, prefix, gun_stats)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = list ( ) arg_6 . extend ( ( arg_0 . __make_points ( arg_4 + "overall_quantiles" , { "label" : arg_3 } , arg_1 , arg_0 . __make_quantile_fields ( arg_2 ) ) , arg_0 . __make_points ( arg_4 + "overall_meta" , { "label" : arg_3 } , arg_1 , arg_0 . __make_overall_meta_fields ( arg_2 , arg_5 ) ) , arg_0 . __make_points ( arg_4 + "net_codes" , { "label" : arg_3 } , arg_1 , arg_0 . __make_netcodes_fields ( arg_2 ) ) , arg_0 . __make_points ( arg_4 + "proto_codes" , { "label" : arg_3 } , arg_1 , arg_0 . __make_protocodes_fields ( arg_2 ) ) ) ) if arg_0 . histograms : for arg_7 , arg_8 in zip ( arg_2 [ "interval_real" ] [ "hist" ] [ "bins" ] , arg_2 [ "interval_real" ] [ "hist" ] [ "data" ] ) : arg_6 . append ( arg_0 . __make_points ( arg_4 + "histograms" , { "label" : arg_3 } , arg_1 , { "bin" : arg_7 , "count" : arg_8 } ) ) return arg_6

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """x
        Make a set of points for `this` label

        overall_quantiles, overall_meta, net_codes, proto_codes, histograms
        """
        arg_6 = list()

        arg_6.extend(
            (
                # overall quantiles for label
                arg_0.__make_points(
                    arg_4 + "overall_quantiles",
                    {"label": arg_3},
                    arg_1,
                    arg_0.__make_quantile_fields(arg_2)
                ),
                # overall meta (gun status) for label
                arg_0.__make_points(
                    arg_4 + "overall_meta",
                    {"label": arg_3},
                    arg_1,
                    arg_0.__make_overall_meta_fields(arg_2, arg_5)
                ),
                # net codes for label
                arg_0.__make_points(
                    arg_4 + "net_codes",
                    {"label": arg_3},
                    arg_1,
                    arg_0.__make_netcodes_fields(arg_2)
                ),
                # proto codes for label
                arg_0.__make_points(
                    arg_4 + "proto_codes",
                    {"label": arg_3},
                    arg_1,
                    arg_0.__make_protocodes_fields(arg_2)
                )
            )
        )
        # histograms, one row for each bin
        if arg_0.histograms:
            for arg_7, arg_8 in zip(arg_2["interval_real"]["hist"]["bins"],
                                   arg_2["interval_real"]["hist"]["data"]):
                arg_6.append(
                    arg_0.__make_points(
                        arg_4 + "histograms",
                        {"label": arg_3},
                        arg_1,
                        {"bin": arg_7, "count": arg_8}
                    )
                )
        return arg_6


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = { 'validation' : { '$exists' : True } } if arg_1 : arg_3 [ 'institute_id' ] = arg_1 if arg_2 : arg_3 [ 'case_id' ] = arg_2 return arg_0 . variant_collection . find ( arg_3 )

def Func(arg_0, arg_1=None, arg_2=None):
        """Return all variants with sanger information

        Args:
            institute_id(str)
            case_id(str)

        Returns:
            res(pymongo.Cursor): A Cursor with all variants with sanger activity
        """
        arg_3 = {'validation': {'$exists': True}}
        if arg_1:
            arg_3['institute_id'] = arg_1
        if arg_2:
            arg_3['case_id'] = arg_2

        return arg_0.variant_collection.find(arg_3)


def Func ( arg_0 , arg_1 : arg_2 [ arg_3 ] = None ) -> arg_2 [ 'WikiText' ] : arg_4 = arg_0 . ancestors ( arg_1 ) if arg_4 : return arg_4 [ 0 ] return None

def Func(arg_0, arg_1: arg_2[arg_3] = None) -> arg_2['WikiText']:
        """Return the Func node of the current object.

        :param type_: the type of the desired Func object.
            Currently the following types are supported: {Template,
            ParserFunction, WikiLink, Comment, Parameter, ExtensionTag}.
            The default is None and means the first Func, of any type above.
        :return: Func WikiText object or None if no Func with the desired
            `type_` is found.
        """
        arg_4 = arg_0.ancestors(arg_1)
        if arg_4:
            return arg_4[0]
        return None

Return the parent node of the current object.

        :param type_: the type of the desired parent object.
            Currently the following types are supported: {Template,
            ParserFunction, WikiLink, Comment, Parameter, ExtensionTag}.
            The default is None and means the first parent, of any type above.
        :return: parent WikiText object or None if no parent with the desired
            `type_` is found.

Return the parent node of the current object .


def Func ( arg_0 , arg_1 = None ) : arg_2 = ffi . new ( 'OM_uint32[1]' ) if arg_1 : arg_3 = ffi . new ( 'gss_buffer_desc[1]' ) arg_3 [ 0 ] . length = len ( arg_1 ) arg_5 = ffi . new ( 'char[]' , arg_1 ) arg_3 [ 0 ] . value = arg_5 else : arg_3 = ffi . cast ( 'gss_buffer_t' , C . GSS_C_NO_BUFFER ) if isinstance ( arg_0 . _desired_mech , OID ) : arg_7 = ffi . addressof ( arg_0 . _desired_mech . _oid ) else : arg_7 = ffi . cast ( 'gss_OID' , C . GSS_C_NO_OID ) arg_8 = ffi . new ( 'gss_OID[1]' ) arg_9 = ffi . new ( 'gss_buffer_desc[1]' ) arg_10 = ffi . new ( 'OM_uint32[1]' ) arg_11 = ffi . new ( 'OM_uint32[1]' ) if arg_0 . _cred_object is not None : arg_12 = arg_0 . _cred_object . _cred [ 0 ] else : arg_12 = ffi . cast ( 'gss_cred_id_t' , C . GSS_C_NO_CREDENTIAL ) arg_13 = C . gss_init_sec_context ( arg_2 , arg_12 , arg_0 . _ctx , arg_0 . peer_name . _name [ 0 ] , arg_7 , arg_0 . _req_flags , arg_0 . _time_req , arg_0 . _channel_bindings , arg_3 , arg_8 , arg_9 , arg_10 , arg_11 ) try : if arg_9 [ 0 ] . length != 0 : arg_14 = _buf_to_str ( arg_9 [ 0 ] ) else : arg_14 = None if GSS_ERROR ( arg_13 ) : if arg_2 [ 0 ] and arg_8 [ 0 ] : raise _exception_for_status ( arg_13 , arg_2 [ 0 ] , arg_8 [ 0 ] , arg_14 ) else : raise _exception_for_status ( arg_13 , arg_2 [ 0 ] , None , arg_14 ) arg_0 . established = not ( arg_13 & C . GSS_S_CONTINUE_NEEDED ) arg_0 . flags = arg_10 [ 0 ] if arg_8 [ 0 ] : arg_0 . mech_type = OID ( arg_8 [ 0 ] [ 0 ] ) return arg_14 except : if arg_0 . _ctx [ 0 ] : C . gss_delete_sec_context ( arg_2 , arg_0 . _ctx , ffi . cast ( 'gss_buffer_t' , C . GSS_C_NO_BUFFER ) ) arg_0 . _reset_flags ( ) raise finally : if arg_9 [ 0 ] . length != 0 : C . gss_release_buffer ( arg_2 , arg_9 )

def Func(arg_0, arg_1=None):
        """Performs a Func to establish the context as an initiator.

        This method should be called in a loop and fed input tokens from the acceptor, and its
        output tokens should be sent to the acceptor, until this context's :attr:`established`
        attribute is True.

        :param input_token: The input token from the acceptor (omit this param or pass None on
            the first call).
        :type input_token: bytes
        :returns: either a byte string with the next token to send to the acceptor,
            or None if there is no further token to send to the acceptor.
        :raises: :exc:`~gssapi.error.GSSException` if there is an error establishing the context.
        """

        arg_2 = ffi.new('OM_uint32[1]')

        if arg_1:
            arg_3 = ffi.new('gss_buffer_desc[1]')
            arg_3[0].length = len(arg_1)
            arg_5 = ffi.new('char[]', arg_1)
            arg_3[0].value = arg_5
        else:
            arg_3 = ffi.cast('gss_buffer_t', C.GSS_C_NO_BUFFER)

        if isinstance(arg_0._desired_mech, OID):
            arg_7 = ffi.addressof(arg_0._desired_mech._oid)
        else:
            arg_7 = ffi.cast('gss_OID', C.GSS_C_NO_OID)

        arg_8 = ffi.new('gss_OID[1]')
        arg_9 = ffi.new('gss_buffer_desc[1]')
        arg_10 = ffi.new('OM_uint32[1]')
        arg_11 = ffi.new('OM_uint32[1]')

        if arg_0._cred_object is not None:
            arg_12 = arg_0._cred_object._cred[0]
        else:
            arg_12 = ffi.cast('gss_cred_id_t', C.GSS_C_NO_CREDENTIAL)

        arg_13 = C.gss_init_sec_context(
            arg_2,
            arg_12,
            arg_0._ctx,
            arg_0.peer_name._name[0],
            arg_7,
            arg_0._req_flags,
            arg_0._time_req,
            arg_0._channel_bindings,
            arg_3,
            arg_8,
            arg_9,
            arg_10,
            arg_11
        )
        try:
            if arg_9[0].length != 0:
                arg_14 = _buf_to_str(arg_9[0])
            else:
                arg_14 = None

            if GSS_ERROR(arg_13):
                if arg_2[0] and arg_8[0]:
                    raise _exception_for_status(arg_13, arg_2[0], arg_8[0], arg_14)
                else:
                    raise _exception_for_status(arg_13, arg_2[0], None, arg_14)

            arg_0.established = not (arg_13 & C.GSS_S_CONTINUE_NEEDED)
            arg_0.flags = arg_10[0]

            if arg_8[0]:
                arg_0.mech_type = OID(arg_8[0][0])

            return arg_14
        except:
            if arg_0._ctx[0]:
                C.gss_delete_sec_context(
                    arg_2,
                    arg_0._ctx,
                    ffi.cast('gss_buffer_t', C.GSS_C_NO_BUFFER)
                )
                arg_0._reset_flags()
            raise
        finally:
            if arg_9[0].length != 0:
                C.gss_release_buffer(arg_2, arg_9)

Performs a step to establish the context as an initiator.

        This method should be called in a loop and fed input tokens from the acceptor, and its
        output tokens should be sent to the acceptor, until this context's :attr:`established`
        attribute is True.

        :param input_token: The input token from the acceptor (omit this param or pass None on
            the first call).
        :type input_token: bytes
        :returns: either a byte string with the next token to send to the acceptor,
            or None if there is no further token to send to the acceptor.
        :raises: :exc:`~gssapi.error.GSSException` if there is an error establishing the context.

Performs a step to establish the context as an initiator .


def Func(arg_0, arg_1, arg_2=None):
    """Creates a DSMR asyncio protocol."""

    if arg_0 == '2.2':
        arg_3 = telegram_specifications.V2_2
        arg_4 = SERIAL_SETTINGS_V2_2
    elif arg_0 == '4':
        arg_3 = telegram_specifications.V4
        arg_4 = SERIAL_SETTINGS_V4
    elif arg_0 == '5':
        arg_3 = telegram_specifications.V5
        arg_4 = SERIAL_SETTINGS_V5
    else:
        raise NotImplementedError("No telegram parser found for version: %s",
                                  arg_0)

    arg_5 = partial(DSMRProtocol, arg_2, TelegramParser(arg_3),
                       arg_1=arg_1)

    return arg_5, arg_4


def Func ( arg_0 ) : if arg_0 . endTriggerType . lower ( ) == "epoch" : return MaxEpoch ( arg_0 . endTriggerNum ) else : return MaxIteration ( arg_0 . endTriggerNum )

def Func(arg_0):
    """
    When to end the optimization based on input option.
    """
    if arg_0.endTriggerType.lower() == "epoch":
        return MaxEpoch(arg_0.endTriggerNum)
    else:
        return MaxIteration(arg_0.endTriggerNum)

When to end the optimization based on input option .


def Func ( arg_0 , arg_1 ) : with zipfile . ZipFile ( arg_1 , mode = 'w' , compression = zipfile . ZIP_DEFLATED ) as zfile : for arg_2 , arg_3 in arg_0 . _buffers . items ( ) : arg_4 = io . BytesIO ( arg_3 . getvalue ( ) . encode ( 'utf-8' ) ) zfile . writestr ( '{}.txt' . format ( arg_2 ) , arg_4 . getbuffer ( ) ) for arg_2 , arg_5 in arg_0 . _files . items ( ) : zfile . write ( arg_5 , arcname = arg_2 )

def Func(arg_0, arg_1):
        """Write the GTFS feed in the given file."""
        with zipfile.ZipFile(arg_1, mode='w', compression=zipfile.ZIP_DEFLATED) as zfile:
            for arg_2, arg_3 in arg_0._buffers.items():
                arg_4 = io.BytesIO(arg_3.getvalue().encode('utf-8'))
                zfile.writestr('{}.txt'.format(arg_2),
                               arg_4.getbuffer())
            for arg_2, arg_5 in arg_0._files.items():
                zfile.write(arg_5, arcname=arg_2)


def Func ( arg_0 , arg_1 ) : arg_0 . write ( struct . pack ( 'b3xI' , etypes [ 'miMATRIX' ] [ 'n' ] , len ( arg_1 ) ) ) arg_0 . write ( arg_1 )

def Func(arg_0, arg_1):
    """Write variable data to file"""
    # write array data elements (size info)
    arg_0.write(struct.pack('b3xI', etypes['miMATRIX']['n'], len(arg_1)))

    # write the data
    arg_0.write(arg_1)


(T=298.15, P=101325, MW=None, AvailableMethods=False, Method=None, CASRN='')

def
Func
(
arg_0
=
298.15
,
arg_1
=
101325
,
arg_2
=
,
arg_3
=
False
,
arg_4
=
,
arg_5
=
''
)
:
def
list_methods
(
)
:
arg_6
=
[
]
if
arg_5
in
CRCFunc_data
.
index
:
arg_6
.
append
(
'CRC, at melting point'
)
arg_6
.
append
(
'None'
)
return
arg_6
if
arg_3
:
return
list_methods
(
)
if
not
arg_4
:
arg_4
=
list_methods
(
)
[
0
]
if
arg_4
==
'CRC, at melting point'
:
arg_7
=
CRCFunc_data
.
at
[
arg_5
,
'Func'
]
elif
arg_4
==
'None'
or
not
arg_2
:
arg_7
=
else
:
raise
Exception
(
'Failure in in function'
)
arg_7
=
property_molar_to_mass
(
arg_7
,
arg_2
)
return
arg_7

def Func(arg_0=298.15, arg_1=101325, arg_2=None, arg_3=False, arg_4=None, arg_5=''):  # pragma: no cover
    '''This function handles the calculation of a chemical's enthalpy of fusion.
    Generally this, is used by the chemical class, as all parameters are passed.
    Calling the function directly works okay.

    Enthalpy of fusion is a weak function of pressure, and its effects are
    neglected.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.

    '''
    def list_methods():
        arg_6 = []
        if arg_5 in CRCFunc_data.index:
            arg_6.append('CRC, at melting point')
        arg_6.append('None')
        return arg_6
    if arg_3:
        return list_methods()
    if not arg_4:
        arg_4 = list_methods()[0]
    # This is the calculate, given the method section
    if arg_4 == 'CRC, at melting point':
        arg_7 = CRCFunc_data.at[arg_5, 'Func']
    elif arg_4 == 'None' or not arg_2:
        arg_7 = None
    else:
        raise Exception('Failure in in function')
    arg_7 = property_molar_to_mass(arg_7, arg_2)
    return arg_7

This function handles the calculation of a chemical s enthalpy of fusion . Generally this is used by the chemical class as all parameters are passed . Calling the function directly works okay .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if not arg_2 : arg_2 = arg_0 . get_default_prefix ( ) arg_0 . deriveDigest ( arg_2 ) arg_0 . privkeys = [ ] for arg_4 in arg_1 : if arg_4 not in arg_0 . privkeys : arg_0 . privkeys . append ( arg_4 ) arg_5 = [ ] for arg_6 in arg_0 . privkeys : arg_7 = Func_message ( arg_0 . message , arg_6 ) arg_5 . append ( Signature ( arg_7 ) ) arg_0 . data [ "Funcatures" ] = Array ( arg_5 ) return arg_0

def Func(arg_0, arg_1, arg_2=None):
        """ Sign the transaction with the provided private keys.

            :param array wifkeys: Array of wif keys
            :param str chain: identifier for the chain

        """
        if not arg_2:
            arg_2 = arg_0.get_default_prefix()
        arg_0.deriveDigest(arg_2)

        # Get Unique private keys
        arg_0.privkeys = []
        for arg_4 in arg_1:
            if arg_4 not in arg_0.privkeys:
                arg_0.privkeys.append(arg_4)

        # Sign the message with every private key given!
        arg_5 = []
        for arg_6 in arg_0.privkeys:
            arg_7 = Func_message(arg_0.message, arg_6)
            arg_5.append(Signature(arg_7))

        arg_0.data["Funcatures"] = Array(arg_5)
        return arg_0

Sign the transaction with the provided private keys .


(response, return_type, resp_type, item_type)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_1 ( ) arg_5 = ETree . fromstring ( arg_0 . body ) arg_6 = [ ] for arg_7 in arg_5 . findall ( arg_2 ) : for arg_8 in arg_7 . findall ( arg_2 [ : - 1 ] ) : arg_6 . append ( _ETreeXmlToObject . fill_instance_element ( arg_8 , arg_3 ) ) for arg_9 , arg_10 in vars ( arg_4 ) . items ( ) : if arg_9 == arg_2 . lower ( ) : continue arg_10 = _ETreeXmlToObject . fill_data_member ( arg_5 , arg_9 , arg_10 ) if arg_10 is not None : setattr ( arg_4 , arg_9 , arg_10 ) setattr ( arg_4 , arg_2 . lower ( ) , arg_6 ) return arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
        """resp_body is the XML we received
        resp_type is a string, such as Containers,
        return_type is the type we're constructing, such as ContainerEnumResults
        item_type is the type object of the item to be created, such as Container

        This function then returns a ContainerEnumResults object with the
        containers member populated with the results.
        """

        # parsing something like:
        # <EnumerationResults ... >
        #   <Queues>
        #       <Queue>
        #           <Something />
        #           <SomethingElse />
        #       </Queue>
        #   </Queues>
        # </EnumerationResults>
        arg_4 = arg_1()
        arg_5 = ETree.fromstring(arg_0.body)

        arg_6 = []

        for arg_7 in arg_5.findall(arg_2):
            for arg_8 in arg_7.findall(arg_2[:-1]):
                arg_6.append(_ETreeXmlToObject.fill_instance_element(arg_8, arg_3))

        for arg_9, arg_10 in vars(arg_4).items():
            # queues, Queues, this is the list its self which we populated
            # above
            if arg_9 == arg_2.lower():
                # the list its self.
                continue
            arg_10 = _ETreeXmlToObject.fill_data_member(arg_5, arg_9, arg_10)
            if arg_10 is not None:
                setattr(arg_4, arg_9, arg_10)

        setattr(arg_4, arg_2.lower(), arg_6)
        return arg_4

resp_body is the XML we received resp_type is a string such as Containers return_type is the type we re constructing such as ContainerEnumResults item_type is the type object of the item to be created such as Container


return np.multiply(self.sub_grid_fraction, sub_array_1d.reshape(-1, self.sub_grid_length).sum(axis=1))

def Func ( arg_0 , arg_1 ) : return np . multiply ( arg_0 . sub_grid_fraction , arg_1 . reshape ( - 1 , arg_0 . sub_grid_length ) . sum ( axis = 1 ) )

def Func(arg_0, arg_1):
        """For an input sub-gridded array, map its hyper-values from the sub-gridded values to a 1D regular grid of \
        values by summing each set of each set of sub-pixels values and dividing by the total number of sub-pixels.

        Parameters
        -----------
        sub_array_1d : ndarray
            A 1D sub-gridded array of values (e.g. the intensities, surface-densities, potential) which is mapped to
            a 1d regular array.
        """
        return np.multiply(arg_0.sub_grid_fraction, arg_1.reshape(-1, arg_0.sub_grid_length).sum(axis=1))

For an input sub - gridded array map its hyper - values from the sub - gridded values to a 1D regular grid of \ values by summing each set of each set of sub - pixels values and dividing by the total number of sub - pixels .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = json . dumps ( arg_0 . _Func_dict ( arg_2 ) ) arg_4 = arg_0 . _perform_request ( url = '/datacenters/%s/servers' % ( arg_1 ) , method = 'POST' , arg_3 = arg_3 ) return arg_4

def Func(arg_0, arg_1, arg_2):
        """
        Creates a server within the data center.

        :param      datacenter_id: The unique ID of the data center.
        :type       datacenter_id: ``str``

        :param      server: A dict of the server to be created.
        :type       server: ``dict``

        """

        arg_3 = json.dumps(arg_0._Func_dict(arg_2))

        arg_4 = arg_0._perform_request(
            url='/datacenters/%s/servers' % (arg_1),
            method='POST',
            arg_3=arg_3)

        return arg_4

Creates a server within the data center .


def Func ( arg_0 , arg_1 = None ) : arg_2 = np . clip ( arg_0 . particle_field , 0 , 1 ) arg_3 = np . zeros ( arg_0 . _image . shape ) for arg_4 in range ( 4 ) : arg_3 [ : , : , : , arg_4 ] = arg_0 . part_col [ arg_4 ] arg_0 . field = np . zeros ( arg_0 . _image . shape ) for arg_4 in range ( 4 ) : arg_0 . field [ : , : , : , arg_4 ] = arg_2 * arg_3 [ : , : , : , arg_4 ] + ( 1 - arg_2 ) * arg_0 . _image [ : , : , : , arg_4 ]

def Func(arg_0, arg_1=None):
        """updates self.field"""
        arg_2 = np.clip(arg_0.particle_field, 0, 1)
        arg_3 = np.zeros(arg_0._image.shape)
        for arg_4 in range(4): arg_3[:,:,:,arg_4] = arg_0.part_col[arg_4]
        arg_0.field = np.zeros(arg_0._image.shape)
        for arg_4 in range(4):
            arg_0.field[:,:,:,arg_4] = arg_2*arg_3[:,:,:,arg_4] + (1-arg_2) * arg_0._image[:,:,:,arg_4]


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 . getheader ( "link" , "" ) . split ( "," ) : try : ( arg_3 , arg_4 ) = arg_2 . split ( ";" ) if "next" in arg_4 : return arg_3 . lstrip ( "<" ) . rstrip ( ">" ) except Exception : return

def Func(arg_0, arg_1):
        """
        return url path to next page of paginated data
        """
        for arg_2 in arg_1.getheader("link", "").split(","):
            try:
                (arg_3, arg_4) = arg_2.split(";")
                if "next" in arg_4:
                    return arg_3.lstrip("<").rstrip(">")
            except Exception:
                return


def Func ( arg_0 ) : if isinstance ( arg_0 , ( str , unicode ) ) : arg_1 = shlex . shlex ( arg_0 . encode ( 'utf-8' ) ) arg_1 . whitespace = '|' arg_1 . whitespace_split = True arg_0 = [ ] while True : arg_4 = arg_1 . get_token ( ) if arg_4 : arg_0 . append ( arg_4 ) else : break arg_0 = list ( map ( shlex . split , arg_0 ) ) return arg_0

def Func(arg_0):
    """Parses command strings and returns a Popen-ready list."""

    # Prepare arguments.
    if isinstance(arg_0, (str, unicode)):
        arg_1 = shlex.shlex(arg_0.encode('utf-8'))
        arg_1.whitespace = '|'
        arg_1.whitespace_split = True
        arg_0 = []

        while True:
            arg_4 = arg_1.get_token()
            if arg_4:
                arg_0.append(arg_4)
            else:
                break

        arg_0 = list(map(shlex.split, arg_0))

    return arg_0

Parses command strings and returns a Popen - ready list .


def Func ( arg_0 ) : arg_1 = arg_0 . conn . pipeline ( ) arg_1 . lrange ( Q_STORAGE_ITEMS , 0 , - 1 ) arg_1 . ltrim ( Q_STORAGE_ITEMS , 1 , 0 ) Func = arg_1 . execute ( ) [ 0 ] for arg_3 in Func : arg_3 = pickle . loads ( arg_3 ) yield arg_3

def Func(arg_0):
        """Get the items fetched by the jobs."""

        # Get and remove queued items in an atomic transaction
        arg_1 = arg_0.conn.pipeline()
        arg_1.lrange(Q_STORAGE_ITEMS, 0, -1)
        arg_1.ltrim(Q_STORAGE_ITEMS, 1, 0)
        Func = arg_1.execute()[0]

        for arg_3 in Func:
            arg_3 = pickle.loads(arg_3)
            yield arg_3


(self, disk_name, has_operating_system=None, label=None, media_link=None,
                    name=None, os=None)

return self._perform_put(self._get_disk_path(disk_name),
                                 _XmlSerializer.disk_to_xml(
                                     label,
                                     None,
                                     None,
                                     None))

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None,
                    arg_5=None, arg_6=None):
        '''
        Updates an existing disk in your image repository.

        disk_name:
            The name of the disk to update.
        has_operating_system:
            Deprecated.
        label:
            Specifies the description of the disk.
        media_link:
            Deprecated.
        name:
            Deprecated.
        os:
            Deprecated.
        '''
        _validate_not_none('disk_name', arg_1)
        _validate_not_none('label', arg_3)
        return arg_0._perform_put(arg_0._get_disk_path(arg_1),
                                 _XmlSerializer.disk_to_xml(
                                     arg_3,
                                     None,
                                     None,
                                     None))

Updates an existing disk in your image repository .


(
        image, plot_origin=True, mask=None, extract_array_from_mask=False, zoom_around_mask=False,
        should_plot_border=False, positions=None, as_subplot=False,
        units='arcsec', kpc_per_arcsec=None, figsize=(7, 7), aspect='square',
        cmap='jet', norm='linear', norm_min=None, norm_max=None, linthresh=0.05, linscale=0.01,
        cb_ticksize=10, cb_fraction=0.047, cb_pad=0.01, cb_tick_values=None, cb_tick_labels=None,
        title='Image', titlesize=16, xlabelsize=16, ylabelsize=16, xyticksize=16,
        mask_pointsize=10, position_pointsize=30, grid_pointsize=1,
        output_path=None, output_format='show', output_filename='image')

def Func(
        arg_0, arg_1=True, arg_2=None, arg_3=False, arg_4=False,
        arg_5=False, arg_6=None, arg_7=False,
        arg_8='arcsec', arg_9=None, arg_10=(7, 7), arg_11='square',
        arg_12='jet', arg_13='linear', arg_14=None, arg_15=None, arg_16=0.05, arg_17=0.01,
        arg_18=10, arg_19=0.047, arg_20=0.01, arg_21=None, arg_22=None,
        arg_23='Image', arg_24=16, arg_25=16, arg_26=16, arg_27=16,
        arg_28=10, arg_29=30, arg_30=1,
        arg_31=None, arg_32='show', arg_33='image'):
    """Plot the observed image of the ccd data.

    Set *autolens.data.array.plotters.array_plotters* for a description of all input parameters not described below.

    Parameters
    -----------
    image : ScaledSquarePixelArray
        The image of the data.
    plot_origin : True
        If true, the origin of the data's coordinate system is plotted as a 'x'.
    image_plane_pix_grid : ndarray or data.array.grid_stacks.PixGrid
        If an adaptive pixelization whose pixels are formed by tracing pixels from the data, this plots those pixels \
        over the immage.
    """
    arg_34 = get_origin(array=arg_0, arg_1=arg_1)

    array_plotters.plot_array(
        array=arg_0, arg_34=arg_34, arg_2=arg_2, arg_3=arg_3,
        arg_4=arg_4,
        arg_5=arg_5, arg_6=arg_6, arg_7=arg_7,
        arg_8=arg_8, arg_9=arg_9, arg_10=arg_10, arg_11=arg_11,
        arg_12=arg_12, arg_13=arg_13, arg_14=arg_14, arg_15=arg_15, arg_16=arg_16, arg_17=arg_17,
        arg_18=arg_18, arg_19=arg_19, arg_20=arg_20,
        arg_21=arg_21, arg_22=arg_22,
        arg_23=arg_23, arg_24=arg_24, arg_25=arg_25, arg_26=arg_26, arg_27=arg_27,
        arg_28=arg_28, arg_29=arg_29, arg_30=arg_30,
        arg_31=arg_31, arg_32=arg_32, arg_33=arg_33)

Plot the observed image of the ccd data .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . split ( "." ) arg_3 = arg_2 . pop ( 0 ) return arg_0 . models [ arg_3 ] . Func ( "." . join ( arg_2 ) )

def Func(arg_0, arg_1):
        """Retrieve an object by its absolute name."""

        arg_2 = arg_1.split(".")

        arg_3 = arg_2.pop(0)
        return arg_0.models[arg_3].Func(".".join(arg_2))

Retrieve an object by its absolute name .


def Func(arg_0):
    """
    Given an input string, part of speech tags the string, then generates a list of
    ngrams that appear in the string.
    Used to define grammatically correct part of speech tag sequences.
    Returns a list of part of speech tag sequences.
    """
    arg_1 = nltk.word_tokenize(arg_0)
    arg_2 = nltk.pos_tag(arg_1)
    arg_3 = [tag[1] for tag in arg_2]
    arg_4 = ngrams(arg_3, 2, 4)
    arg_5 = f7(arg_4)
    return arg_5

Given an input string part of speech tags the string then generates a list of ngrams that appear in the string . Used to define grammatically correct part of speech tag sequences . Returns a list of part of speech tag sequences .


(times, mags, errs,
                       fsv, fdv, fkv, xcc, ycc, bgv, bge,
                       epdsmooth_windowsize=21,
                       epdsmooth_sigclip=3.0,
                       epdsmooth_func=smooth_magseries_signal_medfilt,
                       epdsmooth_extraparams=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
,
arg_8
,
arg_9
,
arg_10
=
21
,
arg_11
=
3.0
,
arg_12
=
arg_13
,
arg_14
=
)
:
arg_15
=
np
.
isfinite
(
arg_1
)
arg_16
=
np
.
median
(
arg_1
[
arg_15
]
)
arg_17
=
np
.
nanstd
(
arg_1
)
if
arg_11
:
arg_18
=
abs
(
arg_1
arg_16
)
<
arg_11
*
arg_17
arg_19
=
arg_15
&
arg_18
else
:
arg_19
=
arg_15
arg_20
=
arg_1
[
arg_19
]
arg_21
=
len
(
arg_20
)
if
isinstance
(
arg_14
,
dict
)
:
arg_22
=
arg_12
(
arg_20
,
arg_10
,
**
arg_14
)
else
:
arg_22
=
arg_12
(
arg_20
,
arg_10
)
arg_23
=
np
.
c_
[
arg_3
[
arg_19
]
**
2.0
,
arg_3
[
arg_19
]
,
arg_4
[
arg_19
]
**
2.0
,
arg_4
[
arg_19
]
,
arg_5
[
arg_19
]
**
2.0
,
arg_5
[
arg_19
]
,
np
.
ones
(
arg_21
)
,
arg_3
[
arg_19
]
*
arg_4
[
arg_19
]
,
arg_3
[
arg_19
]
*
arg_5
[
arg_19
]
,
arg_4
[
arg_19
]
*
arg_5
[
arg_19
]
,
np
.
sin
(
2
*
np
.
pi
*
arg_6
[
arg_19
]
)
,
np
.
cos
(
2
*
np
.
pi
*
arg_6
[
arg_19
]
)
,
np
.
sin
(
2
*
np
.
pi
*
arg_7
[
arg_19
]
)
,
np
.
cos
(
2
*
np
.
pi
*
arg_7
[
arg_19
]
)
,
np
.
sin
(
4
*
np
.
pi
*
arg_6
[
arg_19
]
)
,
np
.
cos
(
4
*
np
.
pi
*
arg_6
[
arg_19
]
)
,
np
.
sin
(
4
*
np
.
pi
*
arg_7
[
arg_19
]
)
,
np
.
cos
(
4
*
np
.
pi
*
arg_7
[
arg_19
]
)
,
arg_8
[
arg_19
]
,
arg_9
[
arg_19
]
]
try
:
arg_24
,
arg_25
,
arg_26
,
arg_27
=
lstsq
(
arg_23
,
arg_22
,
rcond
=
)
if
DEBUG
:
print
(
'coeffs = %s, residuals = %s'
%
(
arg_24
,
arg_25
)
)
arg_28
=
{
'times'
:
arg_0
,
'mags'
:
(
arg_16
+
_old_epd_diffmags
(
arg_24
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
,
arg_8
,
arg_9
,
arg_1
)
)
,
'errs'
:
arg_2
,
'fitcoeffs'
:
arg_24
,
'residuals'
:
arg_25
}
return
arg_28
except
Exception
as
e
:
LOGEXCEPTION
(
'EPD solution did not converge'
)
arg_28
=
{
'times'
:
arg_0
,
'mags'
:
np
.
full_like
(
arg_1
,
np
.
)
,
'errs'
:
arg_2
,
'fitcoeffs'
:
arg_24
,
'residuals'
:
arg_25
}
return
arg_28

def Func(arg_0, arg_1, arg_2,
                       arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9,
                       arg_10=21,
                       arg_11=3.0,
                       arg_12=arg_13,
                       arg_14=None):
    '''
    Detrends a magnitude series given in mag using accompanying values of S in
    fsv, D in fdv, K in fkv, x coords in xcc, y coords in ycc, background in
    bgv, and background error in bge. smooth is used to set a smoothing
    parameter for the fit function. Does EPD voodoo.

    '''

    # find all the finite values of the magsnitude
    arg_15 = np.isfinite(arg_1)

    # calculate median and stdev
    arg_16 = np.median(arg_1[arg_15])
    arg_17 = np.nanstd(arg_1)

    # if we're supposed to sigma clip, do so
    if arg_11:
        arg_18 = abs(arg_1 - arg_16) < arg_11*arg_17
        arg_19 = arg_15 & arg_18
    else:
        arg_19 = arg_15

    arg_20 = arg_1[arg_19]
    arg_21 = len(arg_20)

    # smooth the signal
    if isinstance(arg_14, dict):
        arg_22 = arg_12(arg_20,
                                      arg_10,
                                      **arg_14)
    else:
        arg_22 = arg_12(arg_20, arg_10)

    # make the linear equation matrix
    arg_23 = np.c_[arg_3[arg_19]**2.0,
                      arg_3[arg_19],
                      arg_4[arg_19]**2.0,
                      arg_4[arg_19],
                      arg_5[arg_19]**2.0,
                      arg_5[arg_19],
                      np.ones(arg_21),
                      arg_3[arg_19]*arg_4[arg_19],
                      arg_3[arg_19]*arg_5[arg_19],
                      arg_4[arg_19]*arg_5[arg_19],
                      np.sin(2*np.pi*arg_6[arg_19]),
                      np.cos(2*np.pi*arg_6[arg_19]),
                      np.sin(2*np.pi*arg_7[arg_19]),
                      np.cos(2*np.pi*arg_7[arg_19]),
                      np.sin(4*np.pi*arg_6[arg_19]),
                      np.cos(4*np.pi*arg_6[arg_19]),
                      np.sin(4*np.pi*arg_7[arg_19]),
                      np.cos(4*np.pi*arg_7[arg_19]),
                      arg_8[arg_19],
                      arg_9[arg_19]]

    # solve the matrix equation [epdmatrix] . [x] = [smoothedmags]
    # return the EPD differential magss if the solution succeeds
    try:

        arg_24, arg_25, arg_26, arg_27 = lstsq(arg_23, arg_22,
                                                   rcond=None)

        if DEBUG:
            print('coeffs = %s, residuals = %s' % (arg_24, arg_25))

        arg_28 = {'times':arg_0,
                   'mags':(arg_16 +
                           _old_epd_diffmags(arg_24, arg_3, arg_4,
                                             arg_5, arg_6, arg_7, arg_8, arg_9, arg_1)),
                   'errs':arg_2,
                   'fitcoeffs':arg_24,
                   'residuals':arg_25}

        return arg_28

    # if the solution fails, return nothing
    except Exception as e:

        LOGEXCEPTION('EPD solution did not converge')

        arg_28 = {'times':arg_0,
                   'mags':np.full_like(arg_1, np.nan),
                   'errs':arg_2,
                   'fitcoeffs':arg_24,
                   'residuals':arg_25}

        return arg_28

Detrends a magnitude series given in mag using accompanying values of S in fsv D in fdv K in fkv x coords in xcc y coords in ycc background in bgv and background error in bge . smooth is used to set a smoothing parameter for the fit function . Does EPD voodoo .


return Case(
        *(When(**{field: member, 'then': i})
          for i, member in enumerate(members)),
        default=len(members),
        output_field=IntegerField())

def Func ( arg_0 , arg_1 ) : arg_1 = list ( arg_1 ) return Case ( * ( When ( ** { arg_0 : arg_3 , 'then' : arg_2 } ) for arg_2 , arg_3 in enumerate ( arg_1 ) ) , default = len ( arg_1 ) , output_field = IntegerField ( ) )

def Func(arg_0, arg_1):
    """
    Make an annotation value that can be used to sort by an enum field.

    ``field``
        The name of an EnumChoiceField.

    ``members``
        An iterable of Enum members in the order to sort by.

    Use like:

    .. code-block:: python

        desired_order = [MyEnum.bar, MyEnum.baz, MyEnum.foo]
        ChoiceModel.objects\\
            .annotate(my_order=Func('choice', desired_order))\\
            .order_by('my_order')

    As Enums are iterable, ``members`` can be the Enum itself
    if the default ordering is desired:

    .. code-block:: python

        ChoiceModel.objects\\
            .annotate(my_order=Func('choice', MyEnum))\\
            .order_by('my_order')

    .. warning:: On Python 2, Enums may not have a consistent order,
        depending upon how they were defined.
        You can set an explicit order using ``__order__`` to fix this.
        See the ``enum34`` docs for more information.

    Any enum members not present in the list of members
    will be sorted to the end of the results.

    """
    arg_1 = list(arg_1)

    return Case(
        *(When(**{arg_0: arg_3, 'then': arg_2})
          for arg_2, arg_3 in enumerate(arg_1)),
        default=len(arg_1),
        output_field=IntegerField())

Make an annotation value that can be used to sort by an enum field.

    ``field``
        The name of an EnumChoiceField.

    ``members``
        An iterable of Enum members in the order to sort by.

    Use like:

    .. code-block:: python

        desired_order = [MyEnum.bar, MyEnum.baz, MyEnum.foo]
        ChoiceModel.objects\\
            .annotate(my_order=order_enum('choice', desired_order))\\
            .order_by('my_order')

    As Enums are iterable, ``members`` can be the Enum itself
    if the default ordering is desired:

    .. code-block:: python

        ChoiceModel.objects\\
            .annotate(my_order=order_enum('choice', MyEnum))\\
            .order_by('my_order')

    .. warning:: On Python 2, Enums may not have a consistent order,
        depending upon how they were defined.
        You can set an explicit order using ``__order__`` to fix this.
        See the ``enum34`` docs for more information.

    Any enum members not present in the list of members
    will be sorted to the end of the results.

Make an annotation value that can be used to sort by an enum field .


(context, case_id, report_path,
                    update)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_0
.
obj
[
'adapter'
]
try
:
load_Func
(
arg_4
=
arg_4
,
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
)
LOG
.
info
(
"saved report to case!"
)
except
Exception
as
e
:
LOG
.
error
(
e
)
arg_0
.
abort
(
)

def Func(arg_0, arg_1, arg_2,
                    arg_3):
    """Add delivery report to an existing case."""

    arg_4 = arg_0.obj['adapter']

    try:
        load_Func(arg_4=arg_4, arg_1=arg_1,
                             arg_2=arg_2, arg_3=arg_3)
        LOG.info("saved report to case!")
    except Exception as e:
        LOG.error(e)
        arg_0.abort()

Add delivery report to an existing case .


def Func ( arg_0 ) : if arg_0 . _started : arg_0 . stop ( ) if arg_0 . auto_data : arg_0 . save ( )

def Func(arg_0):
        """Clean up on process shutdown."""
        if arg_0._started:
            arg_0.stop()
        if arg_0.auto_data:
            arg_0.save()


def
Func
(
arg_0
)
:
try
:
arg_1
=
dict
(
individual_id
=
arg_0
[
'individual_id'
]
)
log
.
info
(
"Building Individual with id:{0}"
.
format
(
arg_0
[
'individual_id'
]
)
)
except
KeyError
as
err
:
raise
PedigreeError
(
"Individual is missing individual_id"
)
arg_1
[
'display_name'
]
=
arg_0
.
get
(
'display_name'
,
arg_1
[
'individual_id'
]
)
arg_2
=
arg_0
.
get
(
'sex'
,
'unknown'
)
try
:
int
(
arg_2
)
arg_1
[
'sex'
]
=
str
(
arg_2
)
except
ValueError
as
err
:
try
:
arg_1
[
'sex'
]
=
REV_SEX_MAP
[
arg_2
]
except
KeyError
as
err
:
raise
(
PedigreeError
(
"Unknown sex: %s"
%
arg_2
)
)
arg_3
=
arg_0
.
get
(
'phenotype'
,
'unknown'
)
try
:
arg_4
=
REV_PHENOTYPE_MAP
[
arg_3
]
if
arg_4
==
9
:
arg_4
=
0
arg_1
[
'phenotype'
]
=
arg_4
except
KeyError
as
err
:
raise
(
PedigreeError
(
"Unknown phenotype: %s"
%
arg_3
)
)
arg_1
[
'father'
]
=
arg_0
.
get
(
'father'
)
arg_1
[
'mother'
]
=
arg_0
.
get
(
'mother'
)
arg_1
[
'capture_kits'
]
=
arg_0
.
get
(
'capture_kits'
,
[
]
)
arg_1
[
'bam_file'
]
=
arg_0
.
get
(
'bam_file'
)
arg_1
[
'mt_bam'
]
=
arg_0
.
get
(
'mt_bam'
)
arg_1
[
'vcf2cytosure'
]
=
arg_0
.
get
(
'vcf2cytosure'
)
arg_1
[
'confirmed_sex'
]
=
arg_0
.
get
(
'confirmed_sex'
)
arg_1
[
'confirmed_parent'
]
=
arg_0
.
get
(
'confirmed_parent'
)
arg_1
[
'predicted_ancestry'
]
=
arg_0
.
get
(
'predicted_ancestry'
)
arg_5
=
arg_0
.
get
(
'analysis_type'
,
'unknown'
)
if
not
arg_5
in
ANALYSIS_TYPES
:
raise
PedigreeError
(
"Analysis type %s not allowed"
,
arg_5
)
arg_1
[
'analysis_type'
]
=
arg_5
if
'tmb'
in
arg_0
:
arg_1
[
'tmb'
]
=
arg_0
[
'tmb'
]
if
'msi'
in
arg_0
:
arg_1
[
'msi'
]
=
arg_0
[
'msi'
]
if
'tumor_purity'
in
arg_0
:
arg_1
[
'tumor_purity'
]
=
arg_0
[
'tumor_purity'
]
if
'tumor_type'
in
arg_0
:
arg_1
[
'tumor_type'
]
=
arg_0
[
'tumor_type'
]
return
arg_1

def Func(arg_0):
    """Build a Individual object

        Args:
            ind (dict): A dictionary with individual information

        Returns:
            ind_obj (dict): A Individual object

        dict(
            individual_id = str, # required
            display_name = str,
            sex = str,
            phenotype = int,
            father = str, # Individual id of father
            mother = str, # Individual id of mother
            capture_kits = list, # List of names of capture kits
            bam_file = str, # Path to bam file
            vcf2cytosure = str, # Path to CGH file
            analysis_type = str, # choices=ANALYSIS_TYPES
        )

    """

    try:
        arg_1 = dict(
            individual_id=arg_0['individual_id']
        )
        log.info("Building Individual with id:{0}".format(arg_0['individual_id']))
    except KeyError as err:
        raise PedigreeError("Individual is missing individual_id")

    arg_1['display_name'] = arg_0.get('display_name', arg_1['individual_id'])

    arg_2 = arg_0.get('sex', 'unknown')
    # Convert sex to .ped
    try:
        # Check if sex is coded as an integer
        int(arg_2)
        arg_1['sex'] = str(arg_2)
    except ValueError as err:
        try:
            # Sex are numbers in the database
            arg_1['sex'] = REV_SEX_MAP[arg_2]
        except KeyError as err:
            raise(PedigreeError("Unknown sex: %s" % arg_2))

    arg_3 = arg_0.get('phenotype', 'unknown')
    # Make the phenotype integers
    try:
        arg_4 = REV_PHENOTYPE_MAP[arg_3]
        if arg_4 == -9:
            arg_4 = 0
        arg_1['phenotype'] = arg_4
    except KeyError as err:
        raise(PedigreeError("Unknown phenotype: %s" % arg_3))

    arg_1['father'] = arg_0.get('father')
    arg_1['mother'] = arg_0.get('mother')
    arg_1['capture_kits'] = arg_0.get('capture_kits', [])
    arg_1['bam_file'] = arg_0.get('bam_file')
    arg_1['mt_bam'] = arg_0.get('mt_bam')
    arg_1['vcf2cytosure'] = arg_0.get('vcf2cytosure')
    arg_1['confirmed_sex'] = arg_0.get('confirmed_sex')
    arg_1['confirmed_parent'] = arg_0.get('confirmed_parent')
    arg_1['predicted_ancestry'] = arg_0.get('predicted_ancestry')

    # Check if the analysis type is ok
    # Can be anyone of ('wgs', 'wes', 'mixed', 'unknown')
    arg_5 = arg_0.get('analysis_type', 'unknown')
    if not arg_5 in ANALYSIS_TYPES:
        raise PedigreeError("Analysis type %s not allowed", arg_5)
    arg_1['analysis_type'] = arg_5

    if 'tmb' in arg_0:
        arg_1['tmb'] = arg_0['tmb']

    if 'msi' in arg_0:
        arg_1['msi'] = arg_0['msi']

    if 'tumor_purity' in arg_0:
        arg_1['tumor_purity'] = arg_0['tumor_purity']

    if 'tumor_type' in arg_0:
        arg_1['tumor_type'] = arg_0['tumor_type']

    return arg_1


(
    span_id,
    parent_span_id,
    trace_id,
    span_name,
    annotations,
    binary_annotations,
    timestamp_s,
    duration_s,
)

def Func(
    arg_0,
    arg_1,
    arg_2,
    arg_3,
    arg_4,
    arg_5,
    arg_6,
    arg_7,
):
    """Takes a bunch of span attributes and returns a thriftpy2 representation
    of the span. Timestamps passed in are in seconds, they're converted to
    microseconds before thrift encoding.
    """
    # Check if trace_id is 128-bit. If so, record trace_id_high separately.
    arg_8 = len(arg_2)
    arg_9 = None
    if arg_8 > 16:
        assert arg_8 == 32
        arg_2, arg_9 = arg_2[16:], arg_2[:16]

    if arg_9:
        arg_9 = unsigned_hex_to_signed_int(arg_9)

    arg_10 = {
        'trace_id': unsigned_hex_to_signed_int(arg_2),
        'name': arg_3,
        'id': unsigned_hex_to_signed_int(arg_0),
        'annotations': arg_4,
        'binary_annotations': arg_5,
        'timestamp': int(arg_6 * 1000000) if arg_6 else None,
        'duration': int(arg_7 * 1000000) if arg_7 else None,
        'trace_id_high': arg_9,
    }
    if arg_1:
        arg_10['parent_id'] = unsigned_hex_to_signed_int(arg_1)
    return zipkin_core.Span(**arg_10)

Takes a bunch of span attributes and returns a thriftpy2 representation of the span . Timestamps passed in are in seconds they re converted to microseconds before thrift encoding .


def Func ( arg_0 , arg_1 ) : from . api import get_active_env arg_2 = get_active_env ( ) if not arg_2 : raise ResolveError arg_3 = arg_2 . get_module ( arg_1 ) if not arg_3 : raise ResolveError return arg_3

def Func(arg_0, arg_1):
    '''Resolves modules in currently active environment.'''

    from .api import get_active_env

    arg_2 = get_active_env()
    if not arg_2:
        raise ResolveError

    arg_3 = arg_2.get_module(arg_1)
    if not arg_3:
        raise ResolveError

    return arg_3

Resolves modules in currently active environment .


def Func ( arg_0 ) : arg_1 = arg_0 . getpeercert ( binary_form = True ) if arg_1 : return x509 . load_der_x509_certificate ( arg_1 , backends . default_backend ( ) ) return None

def Func(arg_0):
    """
    Extract an X.509 certificate from a socket connection.
    """
    arg_1 = arg_0.getpeercert(binary_form=True)
    if arg_1:
        return x509.load_der_x509_certificate(
            arg_1,
            backends.default_backend()
        )
    return None

Extract an X . 509 certificate from a socket connection .


def Func(arg_0):
        """Returns the GitLab argument parser."""

        arg_1 = BackendCommandArgumentParser(arg_0.BACKEND.CATEGORIES,
                                              from_date=True,
                                              token_auth=True,
                                              archive=True)

        # GitLab options
        arg_2 = arg_1.parser.add_argument_group('GitLab arguments')
        arg_2.add_argument('--enterprise-url', dest='base_url',
                           help="Base URL for GitLab Enterprise instance")
        arg_2.add_argument('--sleep-for-rate', dest='sleep_for_rate',
                           action='store_true',
                           help="sleep for getting more rate")
        arg_2.add_argument('--min-rate-to-sleep', dest='min_rate_to_sleep',
                           default=MIN_RATE_LIMIT, type=int,
                           help="sleep until reset when the rate limit \
                               reaches this value")
        arg_2.add_argument('--blacklist-ids', dest='blacklist_ids',
                           nargs='*', type=int,
                           help="Ids of items that must not be retrieved.")

        # Generic client options
        arg_2.add_argument('--max-retries', dest='max_retries',
                           default=MAX_RETRIES, type=int,
                           help="number of API call retries")
        arg_2.add_argument('--sleep-time', dest='sleep_time',
                           default=DEFAULT_SLEEP_TIME, type=int,
                           help="sleeping time between API call retries")

        # Positional arguments
        arg_1.parser.add_argument('owner',
                                   help="GitLab owner")
        arg_1.parser.add_argument('repository',
                                   help="GitLab repository")

        return arg_1


Returns bounds that encompass the intersection of the two.
            If there is no overlap between the two, None is returned.

return Bounds(mx, my,
            min(self.x+self.width, b.x+b.width) - mx,
            min(self.y+self.height, b.y+b.height) - my)

def Func ( arg_0 , arg_1 ) : if not arg_0 . intersects ( arg_1 ) : return None arg_2 , arg_3 = max ( arg_0 . x , arg_1 . x ) , max ( arg_0 . y , arg_1 . y ) return Bounds ( arg_2 , arg_3 , min ( arg_0 . x + arg_0 . width , arg_1 . x + arg_1 . width ) - arg_2 , min ( arg_0 . y + arg_0 . height , arg_1 . y + arg_1 . height ) - arg_3 )

def Func(arg_0, arg_1):
        """ Returns bounds that encompass the Func of the two.
            If there is no overlap between the two, None is returned.
        """
        if not arg_0.intersects(arg_1):
            return None
        arg_2, arg_3 = max(arg_0.x, arg_1.x), max(arg_0.y, arg_1.y)
        return Bounds(arg_2, arg_3,
            min(arg_0.x+arg_0.width, arg_1.x+arg_1.width) - arg_2,
            min(arg_0.y+arg_0.height, arg_1.y+arg_1.height) - arg_3)

Returns bounds that encompass the intersection of the two . If there is no overlap between the two None is returned .


def Func(arg_0, arg_1):
        """triggered when an import statement is seen"""
        arg_0._check_reimport(arg_1)
        arg_0._check_import_as_rename(arg_1)

        arg_2 = arg_1.root()
        arg_3 = [arg_4 for arg_4, _ in arg_1.names]
        if len(arg_3) >= 2:
            arg_0.add_message("multiple-imports", args=", ".join(arg_3), arg_1=arg_1)

        for arg_4 in arg_3:
            arg_0._check_deprecated_module(arg_1, arg_4)
            arg_0._check_preferred_module(arg_1, arg_4)
            arg_5 = arg_0._get_imported_module(arg_1, arg_4)
            if isinstance(arg_1.parent, astroid.Module):
                # Allow imports nested
                arg_0._check_position(arg_1)
            if isinstance(arg_1.scope(), astroid.Module):
                arg_0._record_import(arg_1, arg_5)

            if arg_5 is None:
                continue

            arg_0._check_relative_import(arg_2, arg_1, arg_5, arg_4)
            arg_0._add_imported_module(arg_1, arg_5.name)


(self, dataset='hsapiens_gene_ensembl', attributes=[],
              filters={}, filename=None)

def Func ( arg_0 , arg_1 = 'hsapiens_gene_ensembl' , arg_2 = [ ] , arg_3 = { } , arg_4 = None ) : if not arg_2 : arg_2 = [ 'ensembl_gene_id' , 'external_gene_name' , 'entrezgene' , 'go_id' ] arg_0 . new_Func ( ) arg_0 . add_dataset_to_xml ( arg_1 ) for arg_5 in arg_2 : arg_0 . add_attribute_to_xml ( arg_5 ) if arg_3 : for arg_6 , arg_7 in arg_3 . items ( ) : if isinstance ( arg_7 , list ) : arg_7 = "," . join ( arg_7 ) arg_0 . add_filter_to_xml ( arg_6 , arg_7 ) arg_8 = arg_0 . get_xml ( ) arg_9 = super ( Biomart , arg_0 ) . Func ( arg_8 ) arg_10 = pd . read_csv ( StringIO ( arg_9 ) , header = None , sep = "\t" , names = arg_2 , index_col = None ) if arg_4 is None : mkdirs ( DEFAULT_CACHE_PATH ) arg_4 = os . path . join ( DEFAULT_CACHE_PATH , "{}.background.genes.txt" . format ( arg_1 ) ) arg_10 . to_csv ( arg_4 , sep = "\t" , index = False ) return arg_10

def Func(arg_0, arg_1='hsapiens_gene_ensembl', arg_2=[],
              arg_3={}, arg_4=None):
        """mapping ids using BioMart.

        :param dataset: str, default: 'hsapiens_gene_ensembl'
        :param attributes: str, list, tuple
        :param filters: dict, {'filter name': list(filter value)}
        :param host: www.ensembl.org, asia.ensembl.org, useast.ensembl.org
        :return: a dataframe contains all attributes you selected.

        **Note**: it will take a couple of minutes to get the results.
        A xml template for Funcing biomart. (see https://gist.github.com/keithshep/7776579)

        exampleTaxonomy = "mmusculus_gene_ensembl"
        exampleGene = "ENSMUSG00000086981,ENSMUSG00000086982,ENSMUSG00000086983"
        urlTemplate = \
        '''http://ensembl.org/biomart/martservice?Func=''' \
        '''<?xml version="1.0" encoding="UTF-8"?>''' \
        '''<!DOCTYPE Query>''' \
        '''<Query virtualSchemaName="default" formatter="CSV" header="0" uniqueRows="0" count="" datasetConfigVersion="0.6">''' \
        '''<Dataset name="%s" interface="default"><Filter name="ensembl_gene_id" value="%s"/>''' \
        '''<Attribute name="ensembl_gene_id"/><Attribute name="ensembl_transcript_id"/>''' \
        '''<Attribute name="transcript_start"/><Attribute name="transcript_end"/>''' \
        '''<Attribute name="exon_chrom_start"/><Attribute name="exon_chrom_end"/>''' \
        '''</Dataset>''' \
        '''</Query>'''

        exampleURL = urlTemplate % (exampleTaxonomy, exampleGene)
        req = requests.get(exampleURL, stream=True)

        """
        if not arg_2:
            arg_2 = ['ensembl_gene_id', 'external_gene_name', 'entrezgene', 'go_id']
        # i=0
        # while (self.host is None) and (i < 3):
        #     self.host = self.ghosts[i]
        #     i +=1
        arg_0.new_Func()
        # 'mmusculus_gene_ensembl'
        arg_0.add_dataset_to_xml(arg_1)
        for arg_5 in arg_2:
            arg_0.add_attribute_to_xml(arg_5)
        # add filters
        if arg_3:
            for arg_6, arg_7 in arg_3.items():
                if isinstance(arg_7, list): arg_7 = ",".join(arg_7)
                arg_0.add_filter_to_xml(arg_6, arg_7)

        arg_8 = arg_0.get_xml()
        arg_9 = super(Biomart, arg_0).Func(arg_8)
        arg_10 = pd.read_csv(StringIO(arg_9), header=None, sep="\t",
                         names=arg_2, index_col=None)
        # save file to cache path.
        if arg_4 is None:
            mkdirs(DEFAULT_CACHE_PATH)
            arg_4 = os.path.join(DEFAULT_CACHE_PATH, "{}.background.genes.txt".format(arg_1))
        arg_10.to_csv(arg_4, sep="\t", index=False)

        return arg_10

mapping ids using BioMart.

        :param dataset: str, default: 'hsapiens_gene_ensembl'
        :param attributes: str, list, tuple
        :param filters: dict, {'filter name': list(filter value)}
        :param host: www.ensembl.org, asia.ensembl.org, useast.ensembl.org
        :return: a dataframe contains all attributes you selected.

        **Note**: it will take a couple of minutes to get the results.
        A xml template for querying biomart. (see https://gist.github.com/keithshep/7776579)

        exampleTaxonomy = "mmusculus_gene_ensembl"
        exampleGene = "ENSMUSG00000086981,ENSMUSG00000086982,ENSMUSG00000086983"
        urlTemplate = \
        '''http://ensembl.org/biomart/martservice?query=''' \
        '''<?xml version="1.0" encoding="UTF-8"?>''' \
        '''<!DOCTYPE Query>''' \
        '''<Query virtualSchemaName="default" formatter="CSV" header="0" uniqueRows="0" count="" datasetConfigVersion="0.6">''' \
        '''<Dataset name="%s" interface="default"><Filter name="ensembl_gene_id" value="%s"/>''' \
        '''<Attribute name="ensembl_gene_id"/><Attribute name="ensembl_transcript_id"/>''' \
        '''<Attribute name="transcript_start"/><Attribute name="transcript_end"/>''' \
        '''<Attribute name="exon_chrom_start"/><Attribute name="exon_chrom_end"/>''' \
        '''</Dataset>''' \
        '''</Query>'''

        exampleURL = urlTemplate % (exampleTaxonomy, exampleGene)
        req = requests.get(exampleURL, stream=True)


return self.create_report(ReportType.UNUSED_COURSES, account_id,
                                  term_id)

def Func ( arg_0 , arg_1 , arg_2 = None ) : return arg_0 . create_report ( ReportType . UNUSED_COURSES , arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2=None):
        """
        Convenience method for create_report, for creating an unused courses
        report.
        """
        return arg_0.create_report(ReportType.UNUSED_COURSES, arg_1,
                                  arg_2)

Convenience method for create_report for creating an unused courses report .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
arg_2
[
'content'
]
arg_4
=
sorted
(
set
(
arg_3
[
'msg_ids'
]
)
)
arg_5
=
arg_3
.
get
(
'status_only'
,
False
)
arg_6
=
[
]
arg_7
=
[
]
arg_3
=
dict
(
status
=
'ok'
)
arg_3
[
'pending'
]
=
arg_6
arg_3
[
'completed'
]
=
arg_7
arg_8
=
[
]
if
not
arg_5
:
try
:
arg_9
=
arg_0
.
db
.
find_records
(
dict
(
arg_12
=
{
'$in'
:
arg_4
}
)
)
arg_10
=
{
}
for
arg_11
in
arg_9
:
arg_10
[
arg_11
[
'msg_id'
]
]
=
arg_11
except
Exception
:
arg_3
=
error
.
wrap_exception
(
)
arg_0
.
session
.
send
(
arg_0
.
query
,
"result_reply"
,
arg_3
=
arg_3
,
parent
=
arg_2
,
ident
=
arg_1
)
return
else
:
arg_10
=
{
}
for
arg_12
in
arg_4
:
if
arg_12
in
arg_0
.
pending
:
arg_6
.
append
(
arg_12
)
elif
arg_12
in
arg_0
.
all_completed
:
arg_7
.
append
(
arg_12
)
if
not
arg_5
:
arg_13
,
arg_14
=
arg_0
.
_extract_record
(
arg_10
[
arg_12
]
)
arg_3
[
arg_12
]
=
arg_13
arg_8
.
extend
(
arg_14
)
elif
arg_12
in
arg_10
:
if
arg_11
[
'completed'
]
:
arg_7
.
append
(
arg_12
)
arg_13
,
arg_14
=
arg_0
.
_extract_record
(
arg_10
[
arg_12
]
)
arg_3
[
arg_12
]
=
arg_13
arg_8
.
extend
(
arg_14
)
else
:
arg_6
.
append
(
arg_12
)
else
:
try
:
raise
KeyError
(
'No such message: '
+
arg_12
)
except
:
arg_3
=
error
.
wrap_exception
(
)
break
arg_0
.
session
.
send
(
arg_0
.
query
,
"result_reply"
,
arg_3
=
arg_3
,
parent
=
arg_2
,
ident
=
arg_1
,
arg_8
=
arg_8
)

def Func(arg_0, arg_1, arg_2):
        """Get the result of 1 or more messages."""
        arg_3 = arg_2['content']
        arg_4 = sorted(set(arg_3['msg_ids']))
        arg_5 = arg_3.get('status_only', False)
        arg_6 = []
        arg_7 = []
        arg_3 = dict(status='ok')
        arg_3['pending'] = arg_6
        arg_3['completed'] = arg_7
        arg_8 = []
        if not arg_5:
            try:
                arg_9 = arg_0.db.find_records(dict(arg_12={'$in':arg_4}))
                # turn match list into dict, for faster lookup
                arg_10 = {}
                for arg_11 in arg_9:
                    arg_10[arg_11['msg_id']] = arg_11
            except Exception:
                arg_3 = error.wrap_exception()
                arg_0.session.send(arg_0.query, "result_reply", arg_3=arg_3,
                                                    parent=arg_2, ident=arg_1)
                return
        else:
            arg_10 = {}
        for arg_12 in arg_4:
            if arg_12 in arg_0.pending:
                arg_6.append(arg_12)
            elif arg_12 in arg_0.all_completed:
                arg_7.append(arg_12)
                if not arg_5:
                    arg_13,arg_14 = arg_0._extract_record(arg_10[arg_12])
                    arg_3[arg_12] = arg_13
                    arg_8.extend(arg_14)
            elif arg_12 in arg_10:
                if arg_11['completed']:
                    arg_7.append(arg_12)
                    arg_13,arg_14 = arg_0._extract_record(arg_10[arg_12])
                    arg_3[arg_12] = arg_13
                    arg_8.extend(arg_14)
                else:
                    arg_6.append(arg_12)
            else:
                try:
                    raise KeyError('No such message: '+arg_12)
                except:
                    arg_3 = error.wrap_exception()
                break
        arg_0.session.send(arg_0.query, "result_reply", arg_3=arg_3,
                                            parent=arg_2, ident=arg_1,
                                            arg_8=arg_8)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
isinstance
(
arg_1
,
dict
)
:
for
arg_3
,
arg_4
in
arg_1
.
items
(
)
:
if
arg_4
is
arg_2
:
return
" (via its %r key)"
%
arg_3
for
arg_3
in
dir
(
arg_1
)
+
[
'__dict__'
]
:
if
getattr
(
arg_1
,
arg_3
,
)
is
arg_2
:
return
" (via its %r attribute)"
%
arg_3
return
""

def Func(arg_0, arg_1, arg_2):
        """Return the dict key or attribute name of obj which refers to
        referent."""
        if isinstance(arg_1, dict):
            for arg_3, arg_4 in arg_1.items():
                if arg_4 is arg_2:
                    return " (via its %r key)" % arg_3

        for arg_3 in dir(arg_1) + ['__dict__']:
            if getattr(arg_1, arg_3, None) is arg_2:
                return " (via its %r attribute)" % arg_3
        return ""

Return the dict key or attribute name of obj which refers to referent .


def Func(arg_0, arg_1):
        """Return true if the given address in amongst the usable addresses,
        or if the given CIDR is contained in this one."""
        if not isinstance(arg_1, (IPv4Address, CIDR)):
            if str(arg_1).find('/') == -1:
                arg_1 = IPv4Address(arg_1)
            else:
                # Support for CIDR strings/objects, an idea of Nicola Novello.
                arg_1 = CIDR(arg_1)
        if isinstance(arg_1, IPv4Address):
            if arg_1 < arg_0._first_ip or arg_1 > arg_0._last_ip:
                return False
        elif isinstance(arg_1, CIDR):
            # NOTE: manage /31 networks; 127.0.0.1/31 is considered to
            #       be included in 127.0.0.1/8.
            if arg_1._nm._ip_dec == 0xFFFFFFFE \
                    and arg_0._nm._ip_dec != 0xFFFFFFFE:
                arg_2 = arg_0._net_ip._ip_dec
                arg_3 = arg_0._bc_ip._ip_dec
            else:
                arg_2 = arg_0._first_ip._ip_dec
                arg_3 = arg_0._last_ip._ip_dec
            if arg_1._first_ip._ip_dec < arg_2 or \
                    arg_1._last_ip._ip_dec > arg_3:
                return False
        return True

Return true if the given address in amongst the usable addresses or if the given CIDR is contained in this one .


def Func(arg_0):
        """ Compose the launch command and call the scale_out

        This should be implemented in the child classes to take care of
        executor specific oddities.
        """
        arg_1 = "--debug" if arg_0.worker_debug else ""
        arg_2 = "" if arg_0.max_workers == float('inf') else "--max_workers={}".format(arg_0.max_workers)

        arg_3 = "{}/{}".format(arg_0.run_dir, arg_0.label)
        if arg_0.worker_logdir_root is not None:
            arg_3 = "{}/{}".format(arg_0.worker_logdir_root, arg_0.label)

        arg_4 = arg_0.launch_cmd.format(debug=arg_1,
                                       prefetch_capacity=arg_0.prefetch_capacity,
                                       task_url=arg_0.worker_task_url,
                                       result_url=arg_0.worker_result_url,
                                       cores_per_worker=arg_0.cores_per_worker,
                                       arg_2=arg_2,
                                       nodes_per_block=arg_0.provider.nodes_per_block,
                                       heartbeat_period=arg_0.heartbeat_period,
                                       heartbeat_threshold=arg_0.heartbeat_threshold,
                                       poll_period=arg_0.poll_period,
                                       logdir=arg_3)
        arg_0.launch_cmd = arg_4
        logger.debug("Launch command: {}".format(arg_0.launch_cmd))

        arg_0._scaling_enabled = arg_0.provider.scaling_enabled
        logger.debug("Starting HighThroughputExecutor with provider:\n%s", arg_0.provider)
        if hasattr(arg_0.provider, 'init_blocks'):
            try:
                arg_0.scale_out(blocks=arg_0.provider.init_blocks)
            except Exception as e:
                logger.error("Scaling out failed: {}".format(e))
                raise e


return self._get_success_json(self._get(
            'v1/data_views/' + data_view_id, None, failure_message=failure_message))['data']['data_view']

def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
"Dataview Func failed"
return
arg_0
.
_Func_success_json
(
arg_0
.
_Func
(
'v1/data_views/'
+
arg_1
,
,
arg_2
=
arg_2
)
)
[
'data'
]
[
'data_view'
]

def Func(arg_0, arg_1):
        """
        Gets basic information about a view

        :param data_view_id: Identifier of the data view
        :return: Metadata about the view as JSON
        """

        arg_2 = "Dataview Func failed"
        return arg_0._Func_success_json(arg_0._Func(
            'v1/data_views/' + arg_1, None, arg_2=arg_2))['data']['data_view']


def Func(arg_0, *arg_1, **arg_2):
        """
        Creates a new LoadBalancer.

        Note: Every argument and parameter given to this method will be
        assigned to the object.

        Args:
            name (str): The Load Balancer's name
            region (str): The slug identifier for a DigitalOcean region
            algorithm (str, optional): The load balancing algorithm to be
                used. Currently, it must be either "round_robin" or
                "least_connections"
            forwarding_rules (obj:`list`): A list of `ForwrdingRules` objects
            health_check (obj, optional): A `HealthCheck` object
            sticky_sessions (obj, optional): A `StickySessions` object
            redirect_http_to_https (bool, optional): A boolean indicating
                whether HTTP requests to the Load Balancer should be
                redirected to HTTPS
            droplet_ids (obj:`list` of `int`): A list of IDs representing
                Droplets to be added to the Load Balancer (mutually
                exclusive with 'tag')
            tag (str): A string representing a DigitalOcean Droplet tag
                (mutually exclusive with 'droplet_ids')
        """
        arg_3 = [rule.__dict__ for rule in arg_0.forwarding_rules]

        arg_4 = {'name': arg_0.name, 'region': arg_0.region,
                  'forwarding_rules': arg_3,
                  'redirect_http_to_https': arg_0.redirect_http_to_https}

        if arg_0.droplet_ids and arg_0.tag:
            raise ValueError('droplet_ids and tag are mutually exclusive args')
        elif arg_0.tag:
            arg_4['tag'] = arg_0.tag
        else:
            arg_4['droplet_ids'] = arg_0.droplet_ids

        if arg_0.algorithm:
            arg_4['algorithm'] = arg_0.algorithm
        if arg_0.health_check:
            arg_4['health_check'] = arg_0.health_check.__dict__
        if arg_0.sticky_sessions:
            arg_4['sticky_sessions'] = arg_0.sticky_sessions.__dict__

        arg_5 = arg_0.get_data('load_balancers/', type=POST, arg_4=arg_4)

        if arg_5:
            arg_0.id = arg_5['load_balancer']['id']
            arg_0.ip = arg_5['load_balancer']['ip']
            arg_0.algorithm = arg_5['load_balancer']['algorithm']
            arg_0.health_check = HealthCheck(
                **arg_5['load_balancer']['health_check'])
            arg_0.sticky_sessions = StickySesions(
                **arg_5['load_balancer']['sticky_sessions'])
            arg_0.droplet_ids = arg_5['load_balancer']['droplet_ids']
            arg_0.status = arg_5['load_balancer']['status']
            arg_0.Funcd_at = arg_5['load_balancer']['Funcd_at']

        return arg_0


def Func():
    """
    Find and return the location of package.json.
    """
    arg_0 = settings.SYSTEMJS_PACKAGE_JSON_DIR
    if not arg_0:
        raise ImproperlyConfigured(
            "Could not locate 'package.json'. Set SYSTEMJS_PACKAGE_JSON_DIR "
            "to the directory that holds 'package.json'."
        )
    arg_1 = os.path.join(arg_0, 'package.json')
    if not os.path.isfile(arg_1):
        raise ImproperlyConfigured("'package.json' does not exist, tried looking in %s" % arg_1)
    return arg_1

Find and return the location of package . json .


def Func ( ) : if not 'user_id' in session : return None arg_0 = User . query . filter ( User . id == session [ 'user_id' ] ) . first ( ) if not arg_0 : signout_user ( ) return None return arg_0

def Func():
    """Get current user."""
    if not 'user_id' in session:
        return None
    arg_0 = User.query.filter(User.id == session['user_id']).first()
    if not arg_0:
        signout_user()
        return None
    return arg_0


def Func ( arg_0 , arg_1 ) : arg_2 = re . compile ( arg_1 , re . IGNORECASE | re . DOTALL ) for arg_3 in arg_0 . contacts . values ( ) : arg_4 = arg_3 . print_vcard ( ) if arg_2 . search ( arg_4 ) is not None : yield arg_3 else : arg_5 = re . sub ( "[^a-zA-Z0-9\n]" , "" , arg_4 ) if arg_2 . search ( arg_5 ) is not None and len ( re . sub ( "\D" , "" , arg_1 ) ) >= 3 : yield arg_3

def Func(arg_0, arg_1):
        """Search in all fields for contacts matching query.

        :param query: the query to search for
        :type query: str
        :yields: all found contacts
        :rtype: generator(carddav_object.CarddavObject)

        """
        arg_2 = re.compile(arg_1, re.IGNORECASE | re.DOTALL)
        for arg_3 in arg_0.contacts.values():
            # search in all contact fields
            arg_4 = arg_3.print_vcard()
            if arg_2.search(arg_4) is not None:
                yield arg_3
            else:
                # find phone numbers with special chars like /
                arg_5 = re.sub("[^a-zA-Z0-9\n]", "",
                                               arg_4)
                if arg_2.search(arg_5) is not None \
                        and len(re.sub("\D", "", arg_1)) >= 3:
                    yield arg_3

Search in all fields for contacts matching query .


(self, resource, default=DEFAULT_VALUE_SAFEGUARD, **kwargs)

def Func(arg_0, arg_1, arg_2=arg_3, **arg_4):
        """
        Load data from API client.

        Arguments:
            resource(string): type of resource to load
            default(any): value to return if API query returned empty result. Sensible values: [], {}, None etc.

        Returns:
            dict: Deserialized response from Course Catalog API

        """
        arg_5 = arg_2 if arg_2 != arg_0.DEFAULT_VALUE_SAFEGUARD else {}
        try:
            return get_edx_api_data(
                api_config=CatalogIntegration.current(),
                arg_1=arg_1,
                api=arg_0.client,
                **arg_4
            ) or arg_5
        except (SlumberBaseException, ConnectionError, Timeout) as exc:
            LOGGER.exception(
                'Failed to load data from resource [%s] with kwargs [%s] due to: [%s]',
                arg_1, arg_4, str(exc)
            )
            return arg_5


def Func(arg_0, **arg_1):
        '''
        Get the lists attached to this board. Returns a list of List objects.

        Returns:
            list(List): The lists attached to this board
        '''
        arg_2 = arg_0.Func_json(arg_0.base_uri, arg_1=arg_1)

        arg_3 = []
        for arg_4 in arg_2:
            arg_3.append(arg_0.create_list(arg_4))

        return arg_3

Get the lists attached to this board . Returns a list of List objects .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Instantiate a complex type."""

        if arg_2 not in arg_0.type_factories:
            raise ArgumentError("unknown complex base type specified", passed_type=arg_1, arg_4=arg_2)

        arg_4 = arg_0.type_factories[arg_2]

        #Make sure all of the subtypes are valid
        for arg_5 in arg_3:
            try:
                arg_0.get_type(arg_5)
            except KeyValueException as exc:
                raise ArgumentError("could not instantiate subtype for complex type", passed_type=arg_1, arg_5=arg_5, error=exc)

        arg_6 = arg_4.Build(*arg_3, type_system=arg_0)
        arg_0.inject_type(arg_1, arg_6)


def Func ( arg_0 , arg_1 ) : arg_2 = tuple ( arg_0 ) arg_3 = tuple ( arg_1 ) arg_4 = random . sample ( arg_2 , 2 ) arg_5 = random . sample ( arg_3 , 2 ) return tuple ( arg_4 + arg_5 )

def Func(arg_0, arg_1):
    """ random sampler for equal_splits func"""
    arg_2 = tuple(arg_0)
    arg_3 = tuple(arg_1)
    arg_4 = random.sample(arg_2, 2)
    arg_5 = random.sample(arg_3, 2)
    return tuple(arg_4+arg_5)


def Func ( arg_0 , arg_1 = False ) : for arg_2 in arg_0 . _loop_stack : if arg_1 : yield { 'index' : arg_2 [ 0 ] , 'start' : arg_0 . subs_consts ( arg_2 [ 1 ] ) , 'stop' : arg_0 . subs_consts ( arg_2 [ 2 ] ) , 'increment' : arg_0 . subs_consts ( arg_2 [ 3 ] ) } else : yield { 'index' : arg_2 [ 0 ] , 'start' : arg_2 [ 1 ] , 'stop' : arg_2 [ 2 ] , 'increment' : arg_2 [ 3 ] }

def Func(arg_0, arg_1=False):
        """Yield loop stack dictionaries in order from outer to inner."""
        for arg_2 in arg_0._loop_stack:
            if arg_1:
                yield {'index': arg_2[0],
                       'start': arg_0.subs_consts(arg_2[1]),
                       'stop': arg_0.subs_consts(arg_2[2]),
                       'increment': arg_0.subs_consts(arg_2[3])}
            else:
                yield {'index': arg_2[0], 'start': arg_2[1], 'stop': arg_2[2], 'increment': arg_2[3]}

Yield loop stack dictionaries in order from outer to inner .


def Func ( arg_0 , arg_1 , arg_2 = { } ) : arg_3 = SECTIONS_API . format ( arg_1 ) return CanvasSection ( data = arg_0 . _get_resource ( arg_3 , arg_2 = arg_2 ) )

def Func(arg_0, arg_1, arg_2={}):
        """
        Return section resource for given canvas section id.

        https://canvas.instructure.com/doc/api/sections.html#method.sections.show
        """
        arg_3 = SECTIONS_API.format(arg_1)
        return CanvasSection(data=arg_0._get_resource(arg_3, arg_2=arg_2))

Return section resource for given canvas section id .