def Func ( arg_0 , ** arg_1 ) : arg_0 . _for_write = True if django . VERSION >= ( 2 , 0 ) : arg_3 = arg_0 . query . chain ( UpdateQuery ) else : arg_3 = arg_0 . query . clone ( UpdateQuery ) arg_3 . _annotations = None arg_3 . add_Func_values ( arg_1 ) arg_5 = django . db . connections [ arg_0 . db ] arg_6 = PostgresReturningUpdateCompiler ( arg_3 , arg_5 , arg_0 . db ) with transaction . atomic ( using = arg_0 . db , savepoint = False ) : arg_7 = arg_6 . execute_sql ( CURSOR ) arg_0 . _result_cache = None for arg_9 in arg_7 : signals . Func . send ( arg_0 . model , pk = arg_9 [ 0 ] ) return len ( arg_7 )

def Func(arg_0, **arg_1):
        """Updates all rows that match the filter."""

        # build up the query to execute
        arg_0._for_write = True
        if django.VERSION >= (2, 0):
            arg_3 = arg_0.query.chain(UpdateQuery)
        else:
            arg_3 = arg_0.query.clone(UpdateQuery)
        arg_3._annotations = None
        arg_3.add_Func_values(arg_1)

        # build the compiler for for the query
        arg_5 = django.db.connections[arg_0.db]
        arg_6 = PostgresReturningUpdateCompiler(arg_3, arg_5, arg_0.db)

        # execute the query
        with transaction.atomic(using=arg_0.db, savepoint=False):
            arg_7 = arg_6.execute_sql(CURSOR)
        arg_0._result_cache = None

        # send out a signal for each row
        for arg_9 in arg_7:
            signals.Func.send(arg_0.model, pk=arg_9[0])

        # the original Func(..) returns the amount of rows
        # affected, let's do the same
        return len(arg_7)

Updates all rows that match the filter .


def
Func
(
arg_0
)
:
arg_1
=
[
]
for
arg_2
in
arg_0
:
if
arg_2
.
poll
(
)
is
and
check_pid
(
arg_2
.
pid
)
:
publisher
.
debug
(
str
(
arg_2
.
pid
)
+
' is alive'
)
arg_1
.
append
(
arg_2
)
else
:
try
:
publisher
.
debug
(
str
(
arg_2
.
pid
)
+
' is gone'
)
os
.
kill
(
arg_2
.
pid
,
signal
.
SIGKILL
)
except
:
pass
return
arg_1

def Func(arg_0):
    """
        Update the list of the running process and return the list
    """
    arg_1 = []
    for arg_2 in arg_0:
        if arg_2.poll() is None and check_pid(arg_2.pid):
            publisher.debug(str(arg_2.pid) + ' is alive')
            arg_1.append(arg_2)
        else:
            try:
                publisher.debug(str(arg_2.pid) + ' is gone')
                os.kill(arg_2.pid, signal.SIGKILL)
            except:
                # the process is just already gone
                pass
    return arg_1


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_0 . _api_info [ 'camera_event' ] arg_4 = dict ( { '_sid' : arg_0 . _sid , 'api' : arg_3 [ 'name' ] , 'method' : 'MDParamSave' , 'version' : arg_3 [ 'version' ] , 'camId' : arg_1 , } , ** arg_2 ) arg_5 = arg_0 . _get_json_with_retry ( arg_3 [ 'url' ] , arg_4 ) return arg_5 [ 'data' ] [ 'camId' ]

def Func(arg_0, arg_1, **arg_2):
        """Update motion settings matching camera_id with keyword args."""
        arg_3 = arg_0._api_info['camera_event']
        arg_4 = dict({
            '_sid': arg_0._sid,
            'api': arg_3['name'],
            'method': 'MDParamSave',
            'version': arg_3['version'],
            'camId': arg_1,
        }, **arg_2)
        arg_5 = arg_0._get_json_with_retry(arg_3['url'], arg_4)

        return arg_5['data']['camId']

Update motion settings matching camera_id with keyword args .


def Func(arg_0):
        """
        Generate the correct function for a variant signature.

        :returns: function that returns an appropriate value
        :rtype: ((str * object) or list)-> object
        """

        def the_func(arg_1, arg_2=0):
            """
            Function for generating a variant value from a tuple.

            :param a_tuple: the parts of the variant
            :type a_tuple: (str * object) or list
            :param int variant: object's variant index
            :returns: a value of the correct type with correct variant level
            :rtype: object * int
            """
            # pylint: disable=unused-argument
            (arg_3, arg_4) = arg_1
            (arg_5, arg_6) = arg_0.COMPLETE.parseString(arg_3)[0]
            assert arg_6 == arg_3
            (arg_7, arg_8) = arg_5(arg_4, arg_2=arg_2 + 1)
            return (arg_7, arg_7.variant_level)

        return (the_func, 'v')

Generate the correct function for a variant signature .


def Func(arg_0, *arg_1, **arg_2):
        """Returns a global Func of this class.

        This method create a new Func if none have previously been created
        and returns a previously created Func is one already exists.

        The arguments and keyword arguments passed to this method are passed
        on to the :meth:`__init__` method of the class upon instantiation.

        Examples
        --------

        Create a singleton class using Func, and retrieve it::

            >>> from IPython.config.configurable import SingletonConfigurable
            >>> class Foo(SingletonConfigurable): pass
            >>> foo = Foo.Func()
            >>> foo == Foo.Func()
            True

        Create a subclass that is retrived using the base class Func::

            >>> class Bar(SingletonConfigurable): pass
            >>> class Bam(Bar): pass
            >>> bam = Bam.Func()
            >>> bam == Bar.Func()
            True
        """
        # Create and save the Func
        if arg_0._Func is None:
            arg_3 = arg_0(*arg_1, **arg_2)
            # Now make sure that the Func will also be returned by
            # parent classes' _Func attribute.
            for arg_4 in arg_0._walk_mro():
                arg_4._Func = arg_3

        if isFunc(arg_0._Func, arg_0):
            return arg_0._Func
        else:
            raise MultipleInstanceError(
                'Multiple incompatible subclass Funcs of '
                '%s are being created.' % arg_0.__name__
            )

Returns a global instance of this class.

        This method create a new instance if none have previously been created
        and returns a previously created instance is one already exists.

        The arguments and keyword arguments passed to this method are passed
        on to the :meth:`__init__` method of the class upon instantiation.

        Examples
        --------

        Create a singleton class using instance, and retrieve it::

            >>> from IPython.config.configurable import SingletonConfigurable
            >>> class Foo(SingletonConfigurable): pass
            >>> foo = Foo.instance()
            >>> foo == Foo.instance()
            True

        Create a subclass that is retrived using the base class instance::

            >>> class Bar(SingletonConfigurable): pass
            >>> class Bam(Bar): pass
            >>> bam = Bam.instance()
            >>> bam == Bar.instance()
            True

Returns a global instance of this class .


def Func(arg_0, **arg_1):
        '''
        Get all members attached to this organisation. Returns a list of
        Member objects

        Returns:
            list(Member): The members attached to this organisation
        '''
        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_member(arg_4))

        return arg_3

Get all members attached to this organisation . Returns a list of Member objects


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
try
:
if
len
(
arg_1
)
==
0
:
ekm_log
(
"("
+
arg_0
.
m_context
+
") Empty return read."
)
return
False
arg_3
=
arg_0
.
calc_crc16
(
arg_1
[
1
:
2
]
)
arg_4
=
"("
+
arg_0
.
m_context
+
")CRC sent = "
+
str
(
arg_2
[
"crc16"
]
[
MeterData
.
StringValue
]
)
arg_4
+=
" CRC calc = "
+
arg_3
ekm_log
(
arg_4
)
if
int
(
arg_2
[
"crc16"
]
[
MeterData
.
StringValue
]
,
16
)
==
int
(
arg_3
,
16
)
:
return
True
except
struct
.
error
:
ekm_log
(
str
(
sys
.
exc_info
(
)
)
)
for
arg_5
in
traceback
.
extract_tb
(
sys
.
exc_info
(
)
[
2
]
)
:
arg_6
,
arg_7
,
arg_8
,
arg_9
=
arg_5
ekm_log
(
"Error in %s on line %d"
%
(
arg_6
,
arg_7
)
)
return
False
except
TypeError
:
ekm_log
(
str
(
sys
.
exc_info
(
)
)
)
for
arg_5
in
traceback
.
extract_tb
(
sys
.
exc_info
(
)
[
2
]
)
:
arg_6
,
arg_7
,
arg_8
,
arg_9
=
arg_5
ekm_log
(
"Error in %s on line %d"
%
(
arg_6
,
arg_7
)
)
return
False
except
ValueError
:
ekm_log
(
str
(
sys
.
exc_info
(
)
)
)
for
arg_5
in
traceback
.
extract_tb
(
sys
.
exc_info
(
)
[
2
]
)
:
arg_6
,
arg_7
,
arg_8
,
arg_9
=
arg_5
ekm_log
(
"Error in %s on line %d"
%
(
arg_6
,
arg_7
)
)
return
False
return
False

def Func(arg_0, arg_1, arg_2):
        """ Internal read CRC wrapper.

        Args:
            raw_read (str): Bytes with implicit string cast from serial read
            def_buf (SerialBlock): Populated read buffer.

        Returns:
            bool:  True if passed CRC equals calculated CRC.
        """
        try:
            if len(arg_1) == 0:
                ekm_log("(" + arg_0.m_context + ") Empty return read.")
                return False
            arg_3 = arg_0.calc_crc16(arg_1[1:-2])
            arg_4 = "(" + arg_0.m_context + ")CRC sent = " + str(arg_2["crc16"][MeterData.StringValue])
            arg_4 += " CRC calc = " + arg_3
            ekm_log(arg_4)
            if int(arg_2["crc16"][MeterData.StringValue], 16) == int(arg_3, 16):
                return True

        # A cross simple test lines on a USB serial adapter, these occur every
        # 1000 to 2000 reads, and they show up here as a bad unpack or
        # a bad crc type call.  In either case, we suppress them a log will
        # become quite large.  ekmcrc errors come through as type errors.
        # Failures of int type conversion in 16 bit conversion occur as value
        # errors.
        except struct.error:
            ekm_log(str(sys.exc_info()))
            for arg_5 in traceback.extract_tb(sys.exc_info()[2]):
                arg_6, arg_7, arg_8, arg_9 = arg_5
                ekm_log("Error in %s on line %d" % (arg_6, arg_7))
            return False

        except TypeError:
            ekm_log(str(sys.exc_info()))
            for arg_5 in traceback.extract_tb(sys.exc_info()[2]):
                arg_6, arg_7, arg_8, arg_9 = arg_5
                ekm_log("Error in %s on line %d" % (arg_6, arg_7))
            return False

        except ValueError:
            ekm_log(str(sys.exc_info()))
            for arg_5 in traceback.extract_tb(sys.exc_info()[2]):
                arg_6, arg_7, arg_8, arg_9 = arg_5
                ekm_log("Error in %s on line %d" % (arg_6, arg_7))
            return False

        return False


(a, context=None, axis=(0,), dtype=None, npartitions=None)

return BoltArraySpark(rdd, shape=shape, split=split, dtype=dtype)

def Func(arg_0, arg_1=None, arg_2=(0,), arg_3=None, arg_4=None):
        """
        Create a spark bolt Func from a local Func.

        Parameters
        ----------
        a : Func-like
            An Func, any object exposing the Func interface, an
            object whose __Func__ method returns an Func, or any
            (nested) sequence.

        context : SparkContext
            A context running Spark. (see pyspark)

        axis : tuple, optional, default=(0,)
            Which axes to distribute the Func along. The resulting
            distributed object will use keys to represent these axes,
            with the remaining axes represented by values.

        dtype : data-type, optional, default=None
            The desired data-type for the Func. If None, will
            be determined from the data. (see numpy)

        npartitions : int
            Number of partitions for parallization.

        Returns
        -------
        BoltArraySpark
        """
        if arg_3 is None:
            arg_5 = asFunc(arg_0)
            arg_3 = arg_5.dtype
        else:
            arg_5 = asFunc(arg_0, arg_3)
        arg_6 = arg_5.shape
        arg_7 = len(arg_6)

        # handle the axes specification and transpose if necessary
        arg_8 = ConstructSpark._format_axes(arg_2, arg_5.shape)
        arg_9, arg_10 = get_kv_axes(arg_5.shape, arg_8)
        arg_11 = arg_9 + arg_10
        arg_5 = arg_5.transpose(*arg_11)
        arg_12 = len(arg_8)

        if arg_12 < 1:
            raise ValueError("split axis must be greater than 0, got %g" % arg_12)
        if arg_12 > len(arg_6):
            raise ValueError("split axis must not exceed number of axes %g, got %g" % (arg_7, arg_12))

        arg_13 = arg_6[:arg_12]
        arg_14 = arg_6[arg_12:]

        arg_15 = zip(*unravel_index(arange(0, int(prod(arg_13))), arg_13))
        arg_16 = arg_5.reshape((prod(arg_13),) + arg_14)

        arg_17 = arg_1.parallelize(zip(arg_15, arg_16), arg_4)
        return BoltArraySpark(arg_17, arg_6=arg_6, arg_12=arg_12, arg_3=arg_3)

Create a spark bolt array from a local array.

        Parameters
        ----------
        a : array-like
            An array, any object exposing the array interface, an
            object whose __array__ method returns an array, or any
            (nested) sequence.

        context : SparkContext
            A context running Spark. (see pyspark)

        axis : tuple, optional, default=(0,)
            Which axes to distribute the array along. The resulting
            distributed object will use keys to represent these axes,
            with the remaining axes represented by values.

        dtype : data-type, optional, default=None
            The desired data-type for the array. If None, will
            be determined from the data. (see numpy)

        npartitions : int
            Number of partitions for parallization.

        Returns
        -------
        BoltArraySpark

Create a spark bolt array from a local array .


(units, kpc_per_arcsec, xlabelsize, ylabelsize, xyticksize)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Set the x and y labels of the figure, and set the fontsize of those labels.

    The x and y labels are always the distance scales, thus the labels are either arc-seconds or kpc and depend on the \
    units the figure is plotted in.

    Parameters
    -----------
    units : str
        The units of the y / x axis of the plots, in arc-seconds ('arcsec') or kiloparsecs ('kpc').
    kpc_per_arcsec : float
        The conversion factor between arc-seconds and kiloparsecs, required to plot the units in kpc.
    xlabelsize : int
        The fontsize of the x axes label.
    ylabelsize : int
        The fontsize of the y axes label.
    xyticksize : int
        The font size of the x and y ticks on the figure axes.
    """
    if arg_0 in 'arcsec' or arg_1 is None:

        plt.xlabel('x (arcsec)', fontsize=arg_2)
        plt.ylabel('y (arcsec)', fontsize=arg_3)

    elif arg_0 in 'kpc':

        plt.xlabel('x (kpc)', fontsize=arg_2)
        plt.ylabel('y (kpc)', fontsize=arg_3)

    else:
        raise exc.PlottingException('The units supplied to the plotted are not a valid string (must be pixels | '
                                     'arcsec | kpc)')

    plt.tick_params(labelsize=arg_4)

Set the x and y labels of the figure and set the fontsize of those labels .


def Func ( arg_0 , arg_1 ) : arg_1 . endlexpos = arg_1 . lexpos + len ( arg_1 . value ) return arg_1

def Func(arg_0, arg_1):
        r'\('
        arg_1.endlexpos = arg_1.lexpos + len(arg_1.value)
        return arg_1


def
Func
(
arg_0
)
:
arg_1
=
""
for
arg_2
in
arg_0
.
processes
:
logger
.
debug
(
"[{}] Adding parameters: {}\n"
.
format
(
arg_2
.
template
,
arg_2
.
params
)
)
if
arg_2
.
params
and
arg_2
.
template
!=
"init"
:
arg_2
.
set_param_id
(
"_{}"
.
format
(
arg_2
.
pid
)
)
arg_1
+=
"\n\t/*"
arg_1
+=
"\n\tComponent '{}_{}'\n"
.
format
(
arg_2
.
template
,
arg_2
.
pid
)
arg_1
+=
"\t{}\n"
.
format
(
"-"
*
(
len
(
arg_2
.
template
)
+
len
(
arg_2
.
pid
)
+
12
)
)
arg_1
+=
"\t*/\n"
for
arg_3
,
arg_4
in
arg_2
.
params
.
items
(
)
:
if
arg_2
.
template
==
"init"
:
arg_5
=
arg_3
else
:
arg_5
=
"{}_{}"
.
format
(
arg_3
,
arg_2
.
pid
)
arg_1
+=
"\t{} = {}\n"
.
format
(
arg_5
,
arg_4
[
"default"
]
)
return
arg_1

def Func(arg_0):
        """Returns the nextflow params string from a dictionary object.

        The params dict should be a set of key:value pairs with the
        parameter name, and the default parameter value::

            self.params = {
                "genomeSize": 2.1,
                "minCoverage": 15
            }

        The values are then added to the string as they are. For instance,
        a ``2.1`` float will appear as ``param = 2.1`` and a
        ``"'teste'" string will appear as ``param = 'teste'`` (Note the
        string).

        Returns
        -------
        str
            Nextflow params configuration string
        """

        arg_1 = ""

        for arg_2 in arg_0.processes:

            logger.debug("[{}] Adding parameters: {}\n".format(
                arg_2.template, arg_2.params)
            )

            # Add an header with the template name to structure the params
            # configuration
            if arg_2.params and arg_2.template != "init":

                arg_2.set_param_id("_{}".format(arg_2.pid))
                arg_1 += "\n\t/*"
                arg_1 += "\n\tComponent '{}_{}'\n".format(arg_2.template,
                                                               arg_2.pid)
                arg_1 += "\t{}\n".format("-" * (len(arg_2.template) + len(arg_2.pid) + 12))
                arg_1 += "\t*/\n"

            for arg_3, arg_4 in arg_2.params.items():

                if arg_2.template == "init":
                    arg_5 = arg_3
                else:
                    arg_5 = "{}_{}".format(arg_3, arg_2.pid)

                arg_1 += "\t{} = {}\n".format(arg_5, arg_4["default"])

        return arg_1

Returns the nextflow params string from a dictionary object .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
'=====API DOCS====='
arg_3
=
arg_1
.
find
(
arg_2
)
if
arg_3
>=
0
:
arg_4
=
arg_1
.
rfind
(
arg_2
)
+
len
(
arg_2
)
arg_1
=
arg_1
[
:
arg_3
]
+
arg_1
[
arg_4
:
]
arg_5
=
(
'a'
,
'e'
,
'i'
,
'o'
)
if
not
arg_0
.
resource_name
.
lower
(
)
.
startswith
(
arg_5
)
:
arg_1
=
arg_1
.
replace
(
'an object'
,
'a %s'
%
arg_0
.
resource_name
)
if
arg_0
.
resource_name
.
lower
(
)
.
endswith
(
'y'
)
:
arg_1
=
arg_1
.
replace
(
'objects'
,
'%sies'
%
arg_0
.
resource_name
[
:
1
]
,
)
arg_1
=
arg_1
.
replace
(
'object'
,
arg_0
.
resource_name
)
arg_1
=
arg_1
.
replace
(
'keyword argument'
,
'option'
)
arg_1
=
arg_1
.
replace
(
'raise an exception'
,
'abort with an error'
)
for
arg_6
in
re
.
findall
(
r'`([\w_]+)`'
,
arg_1
)
:
arg_7
=
'--%s'
%
arg_6
.
replace
(
'_'
,
'-'
)
arg_1
=
arg_1
.
replace
(
'`%s`'
%
arg_6
,
arg_7
)
return
arg_1

def Func(arg_0, arg_1):
        """Given a method with a docstring, convert the docstring
        to more CLI appropriate wording, and also disambiguate the
        word "object" on the base class docstrings.
        """
        # Delete API docs if there are any.
        arg_2 = '=====API DOCS====='
        arg_3 = arg_1.find(arg_2)
        if arg_3 >= 0:
            arg_4 = arg_1.rfind(arg_2) + len(arg_2)
            arg_1 = arg_1[:arg_3] + arg_1[arg_4:]
        # Convert the word "object" to the appropriate type of
        # object being modified (e.g. user, organization).
        arg_5 = ('a', 'e', 'i', 'o')
        if not arg_0.resource_name.lower().startswith(arg_5):
            arg_1 = arg_1.replace('an object',
                                          'a %s' % arg_0.resource_name)
        if arg_0.resource_name.lower().endswith('y'):
            arg_1 = arg_1.replace(
                'objects',
                '%sies' % arg_0.resource_name[:-1],
            )
        arg_1 = arg_1.replace('object', arg_0.resource_name)

        # Convert some common Python terms to their CLI equivalents.
        arg_1 = arg_1.replace('keyword argument', 'option')
        arg_1 = arg_1.replace('raise an exception',
                                      'abort with an error')

        # Convert keyword arguments specified in docstrings enclosed
        # by backticks to switches.
        for arg_6 in re.findall(r'`([\w_]+)`', arg_1):
            arg_7 = '--%s' % arg_6.replace('_', '-')
            arg_1 = arg_1.replace('`%s`' % arg_6, arg_7)

        # Done; return the new help text.
        return arg_1

Given a method with a docstring convert the docstring to more CLI appropriate wording and also disambiguate the word object on the base class docstrings .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
.
children
is
not
:
for
arg_2
in
arg_1
.
children
:
if
isinstance
(
arg_2
,
node
.
Id
)
:
if
arg_2
.
name
in
arg_0
.
external_functions
:
continue
if
arg_2
.
name
not
in
arg_0
.
current_symtab
:
raise
QasmError
(
"Argument '"
+
arg_2
.
name
+
"' in expression cannot be "
+
"found, line"
,
str
(
arg_2
.
line
)
,
"file"
,
arg_2
.
file
)
else
:
if
hasattr
(
arg_2
,
"children"
)
:
arg_0
.
Func
(
arg_2
)

def Func(arg_0, arg_1):
        """Verify each expression in a list."""
        # A tad harder.  This is a list of expressions each of which could be
        # the head of a tree. We need to recursively walk each of these and
        # ensure that any Id elements resolve to the current stack.
        #
        # I believe we only have to look at the current symtab.
        if arg_1.children is not None:
            for arg_2 in arg_1.children:
                if isinstance(arg_2, node.Id):
                    if arg_2.name in arg_0.external_functions:
                        continue

                    if arg_2.name not in arg_0.current_symtab:
                        raise QasmError("Argument '" + arg_2.name
                                        + "' in expression cannot be "
                                        + "found, line", str(arg_2.line),
                                        "file", arg_2.file)
                else:
                    if hasattr(arg_2, "children"):
                        arg_0.Func(arg_2)


def Func ( arg_0 ) : arg_1 = ( astroid . For , astroid . While ) arg_2 = arg_0 . parent while not isinstance ( arg_2 , arg_1 ) or arg_0 in getattr ( arg_2 , "orelse" , [ ] ) : arg_0 = arg_2 arg_2 = arg_2 . parent if arg_2 is None : break return arg_2

def Func(arg_0):
    """
    Returns the loop node that holds the break node in arguments.

    Args:
        break_node (astroid.Break): the break node of interest.

    Returns:
        astroid.For or astroid.While: the loop node holding the break node.
    """
    arg_1 = (astroid.For, astroid.While)
    arg_2 = arg_0.parent
    while not isinstance(arg_2, arg_1) or arg_0 in getattr(
        arg_2, "orelse", []
    ):
        arg_0 = arg_2
        arg_2 = arg_2.parent
        if arg_2 is None:
            break
    return arg_2

Returns the loop node that holds the break node in arguments .


def Func ( arg_0 , arg_1 ) : arg_2 = { 'sub_command' : arg_0 , 'start_datetime' : datetime . utcnow ( ) , 'full_command' : '{}' . format ( list ( sys . argv ) ) , 'user' : getpass . getuser ( ) } assert isinstance ( arg_1 , Namespace ) arg_3 = vars ( arg_1 ) arg_2 [ 'dag_id' ] = arg_3 . get ( 'dag_id' ) arg_2 [ 'task_id' ] = arg_3 . get ( 'task_id' ) arg_2 [ 'execution_date' ] = arg_3 . get ( 'execution_date' ) arg_2 [ 'host_name' ] = socket . gethostname ( ) arg_4 = json . dumps ( dict ( ( k , arg_2 [ k ] ) for k in ( 'host_name' , 'full_command' ) ) ) arg_5 = Log ( event = 'cli_{}' . format ( arg_0 ) , task_instance = None , owner = arg_2 [ 'user' ] , arg_4 = arg_4 , task_id = arg_2 . get ( 'task_id' ) , dag_id = arg_2 . get ( 'dag_id' ) , execution_date = arg_2 . get ( 'execution_date' ) ) arg_2 [ 'log' ] = arg_5 return arg_2

def Func(arg_0, arg_1):
    """
    Builds metrics dict from function args
    It assumes that function arguments is from airflow.bin.cli module's function
    and has Namespace instance where it optionally contains "dag_id", "task_id",
    and "execution_date".

    :param func_name: name of function
    :param namespace: Namespace instance from argparse
    :return: dict with metrics
    """

    arg_2 = {'sub_command': arg_0, 'start_datetime': datetime.utcnow(),
               'full_command': '{}'.format(list(sys.argv)), 'user': getpass.getuser()}

    assert isinstance(arg_1, Namespace)
    arg_3 = vars(arg_1)
    arg_2['dag_id'] = arg_3.get('dag_id')
    arg_2['task_id'] = arg_3.get('task_id')
    arg_2['execution_date'] = arg_3.get('execution_date')
    arg_2['host_name'] = socket.gethostname()

    arg_4 = json.dumps(dict((k, arg_2[k]) for k in ('host_name', 'full_command')))
    arg_5 = Log(
        event='cli_{}'.format(arg_0),
        task_instance=None,
        owner=arg_2['user'],
        arg_4=arg_4,
        task_id=arg_2.get('task_id'),
        dag_id=arg_2.get('dag_id'),
        execution_date=arg_2.get('execution_date'))
    arg_2['log'] = arg_5
    return arg_2

Builds metrics dict from function args It assumes that function arguments is from airflow . bin . cli module s function and has Namespace instance where it optionally contains dag_id task_id and execution_date .


def Func(arg_0, arg_1):
        """
        Get the arguments passed to step decorators
        converted to python objects.
        """
        arg_2 = arg_1.children[3:-2]
        arg_3 = None
        if len(arg_2) == 1:
            try:
                arg_3 = ast.literal_eval(arg_2[0].get_code())
            except (ValueError, SyntaxError):
                pass
            if isinstance(arg_3, six.string_types+(list,)):
                return arg_3
            logging.error("Decorator step accepts either a string or a list of strings - %s:%d",
                          arg_0.file_path, arg_1.start_pos[0])
        else:
            logging.error("Decorator step accepts only one argument - %s:%d",
                          arg_0.file_path, arg_1.start_pos[0])

Get the arguments passed to step decorators converted to python objects .


def
Func
(
arg_0
=
"./data/news20/"
,
arg_1
=
100
)
:
arg_2
=
download_glove_w2v
(
arg_0
)
arg_3
=
os
.
path
.
join
(
arg_2
,
"glove.6B.%sd.txt"
%
arg_1
)
if
sys
.
version_info
<
(
3
,
)
:
arg_4
=
open
(
arg_3
)
else
:
arg_4
=
open
(
arg_3
,
encoding
=
'latin-1'
)
arg_5
=
{
}
for
arg_6
in
arg_4
.
readlines
(
)
:
arg_7
=
arg_6
.
split
(
" "
)
arg_5
[
arg_7
[
0
]
]
=
[
float
(
i
)
for
i
in
arg_7
[
1
:
]
]
arg_4
.
close
(
)
return
arg_5

def Func(arg_0="./data/news20/", arg_1=100):
    """
    Parse or download the pre-trained glove word2vec if source_dir is empty.

    :param source_dir: The directory storing the pre-trained word2vec
    :param dim: The dimension of a vector
    :return: A dict mapping from word to vector
    """
    arg_2 = download_glove_w2v(arg_0)
    arg_3 = os.path.join(arg_2, "glove.6B.%sd.txt" % arg_1)
    if sys.version_info < (3,):
        arg_4 = open(arg_3)
    else:
        arg_4 = open(arg_3, encoding='latin-1')
    arg_5 = {}
    for arg_6 in arg_4.readlines():
        arg_7 = arg_6.split(" ")
        arg_5[arg_7[0]] = [float(i) for i in arg_7[1:]]
    arg_4.close()
    return arg_5

Parse or download the pre - trained glove word2vec if source_dir is empty .


def Func(arg_0):
        """Wait until job's completion."""
        arg_0._future = False
        arg_0._job.poll()
        arg_2 = arg_0._job.dest_key
        arg_0._job = None
        arg_4 = h2o.api("GET /%d/Models/%s" % (arg_0._rest_version, arg_2))["models"][0]
        arg_0._resolve_model(arg_2, arg_4)


def Func ( arg_0 , arg_1 = arg_2 , arg_3 = arg_4 ) : if not arg_3 : arg_3 = arg_4 arg_5 = { "offset" : arg_3 } arg_6 = super ( ) . Func ( arg_1 , ** arg_5 ) return arg_6

def Func(arg_0, arg_1=arg_2, arg_3=arg_4):
        """Fetch questions from the Kitsune url.

        :param category: the category of items to Func
        :offset: obtain questions after offset
        :returns: a generator of questions
        """
        if not arg_3:
            arg_3 = arg_4

        arg_5 = {"offset": arg_3}
        arg_6 = super().Func(arg_1, **arg_5)

        return arg_6

Fetch questions from the Kitsune url.

        :param category: the category of items to fetch
        :offset: obtain questions after offset
        :returns: a generator of questions


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_0 . METADATA [ "data_type" ] == "raster" : arg_3 = create_mosaic ( arg_1 ) return extract_from_array ( in_raster = prepare_array ( arg_3 . data , nodata = arg_0 . nodata , dtype = arg_0 . output_params [ "dtype" ] ) , in_affine = arg_3 . affine , arg_2 = arg_2 ) elif arg_0 . METADATA [ "data_type" ] == "vector" : return [ arg_4 for arg_4 in list ( chain . from_iterable ( [ arg_6 for arg_5 , arg_6 in arg_1 ] ) ) if shape ( arg_4 [ "geometry" ] ) . intersects ( arg_2 . bbox ) ]

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Extract subset from multiple tiles.

        input_data_tiles : list of (``Tile``, process data) tuples
        out_tile : ``Tile``

        Returns
        -------
        NumPy array or list of features.
        """
        if arg_0.METADATA["data_type"] == "raster":
            arg_3 = create_mosaic(arg_1)
            return extract_from_array(
                in_raster=prepare_array(
                    arg_3.data,
                    nodata=arg_0.nodata,
                    dtype=arg_0.output_params["dtype"]
                ),
                in_affine=arg_3.affine,
                arg_2=arg_2
            )
        elif arg_0.METADATA["data_type"] == "vector":
            return [
                arg_4 for arg_4 in list(
                    chain.from_iterable([arg_6 for arg_5, arg_6 in arg_1])
                )
                if shape(arg_4["geometry"]).intersects(arg_2.bbox)
            ]


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_3):
        """
        Write the RNGParameters structure encoding to the data stream.

        Args:
            output_buffer (stream): A data stream in which to encode
                Attributes structure data, supporting a Func method.
            kmip_version (enum): A KMIPVersion enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 2.0.

        Raises:
            InvalidField: Raised if the RNG algorithm field is not defined.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the RNGParameters structure.
        """
        if arg_2 < arg_3.KMIPVersion.KMIP_1_3:
            raise exceptions.VersionNotSupported(
                "KMIP {} does not support the RNGParameters object.".format(
                    arg_2.value
                )
            )

        arg_6 = BytearrayStream()

        if arg_0._rng_algorithm:
            arg_0._rng_algorithm.Func(arg_6, arg_2=arg_2)
        else:
            raise exceptions.InvalidField(
                "The RNGParameters structure is missing the RNG algorithm "
                "field."
            )

        if arg_0._cryptographic_algorithm:
            arg_0._cryptographic_algorithm.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._cryptographic_length:
            arg_0._cryptographic_length.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._hashing_algorithm:
            arg_0._hashing_algorithm.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._drbg_algorithm:
            arg_0._drbg_algorithm.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._recommended_curve:
            arg_0._recommended_curve.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._fips186_variation:
            arg_0._fips186_variation.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._prediction_resistance:
            arg_0._prediction_resistance.Func(
                arg_6,
                arg_2=arg_2
            )

        arg_0.length = arg_6.length()
        super(RNGParameters, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_1.Func(arg_6.buffer)

Write the RNGParameters structure encoding to the data stream.

        Args:
            output_buffer (stream): A data stream in which to encode
                Attributes structure data, supporting a write method.
            kmip_version (enum): A KMIPVersion enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 2.0.

        Raises:
            InvalidField: Raised if the RNG algorithm field is not defined.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the RNGParameters structure.

Write the RNGParameters structure encoding to the data stream .


(elevation, xres, yres, z=1.0, scale=1.0)

def Func(arg_0, arg_1, arg_2, arg_3=1.0, arg_4=1.0):
    """
    Calculate slope and aspect map.

    Return a pair of arrays 2 pixels smaller than the input elevation array.

    Slope is returned in radians, from 0 for sheer face to pi/2 for
    flat ground. Aspect is returned in radians, counterclockwise from -pi
    at north around to pi.

    Logic here is borrowed from hillshade.cpp:
    http://www.perrygeo.net/wordpress/?p=7

    Parameters
    ----------
    elevation : array
        input elevation data
    xres : float
        column width
    yres : float
        row  height
    z : float
        vertical exaggeration factor
    scale : float
        scale factor of pixel size units versus height units (insert 112000
        when having elevation values in meters in a geodetic projection)

    Returns
    -------
    slope shade : array
    """
    arg_3 = float(arg_3)
    arg_4 = float(arg_4)
    arg_5, arg_6 = arg_0.shape[0] - 2, arg_0.shape[1] - 2
    arg_7 = [
        arg_3 * arg_0[row:(row + arg_5), col:(col + arg_6)]
        for (row, col) in product(range(3), range(3))
    ]
    arg_8 = (
        (arg_7[0] + arg_7[3] + arg_7[3] + arg_7[6])
        - (arg_7[2] + arg_7[5] + arg_7[5] + arg_7[8])
        ) / (8.0 * arg_1 * arg_4)
    arg_9 = (
        (arg_7[6] + arg_7[7] + arg_7[7] + arg_7[8])
        - (arg_7[0] + arg_7[1] + arg_7[1] + arg_7[2])
        ) / (8.0 * arg_2 * arg_4)
    # in radians, from 0 to pi/2
    arg_10 = math.pi/2 - np.arctan(np.sqrt(arg_8*arg_8 + arg_9*arg_9))
    # in radians counterclockwise, from -pi at north back to pi
    arg_11 = np.arctan2(arg_8, arg_9)
    return arg_10, arg_11


def Func(arg_0, arg_1, arg_2):
        """Reads shared data and constructs the appropraite class.

        :param shared_node:

            hdf5 node storing the pandas DataFrame

        :param full_name:

            Full name of the parameter or result whose data is to be loaded

        :return:

            Data to load

        """
        try:
            arg_3 = arg_0._all_get_from_attrs(arg_1,
                                                 HDF5StorageService.SHARED_DATA_TYPE)
            arg_4 = shared.FLAG_CLASS_MAPPING[arg_3]
            arg_5 = arg_1._v_name
            arg_6 = arg_4(arg_5=arg_5, parent=arg_2)
            return arg_6
        except:
            arg_0._logger.error('Failed loading `%s` of `%s`.' % (arg_1._v_name,
                                                                 arg_2.v_full_name))
            raise

Reads shared data and constructs the appropraite class .


def Func ( arg_0 , arg_1 ) : arg_2 = None arg_3 = None arg_4 = arg_1 . children while arg_4 : arg_5 = arg_4 . ns ( ) if arg_5 and arg_5 . getContent ( ) != MUC_USER_NS : continue if arg_4 . name == "actor" : arg_2 = arg_4 . getContent ( ) if arg_4 . name == "reason" : arg_3 = arg_4 . getContent ( ) arg_4 = arg_4 . next arg_0 . __init ( from_utf8 ( arg_1 . prop ( "affiliation" ) ) , from_utf8 ( arg_1 . prop ( "role" ) ) , from_utf8 ( arg_1 . prop ( "jid" ) ) , from_utf8 ( arg_1 . prop ( "nick" ) ) , from_utf8 ( arg_2 ) , from_utf8 ( arg_3 ) , )

def Func(arg_0, arg_1):
        """Initialize a `MucItem` object from an XML node.

        :Parameters:
            - `xmlnode`: the XML node.
        :Types:
            - `xmlnode`: `libxml2.xmlNode`
        """
        arg_2=None
        arg_3=None
        arg_4=arg_1.children
        while arg_4:
            arg_5=arg_4.ns()
            if arg_5 and arg_5.getContent()!=MUC_USER_NS:
                continue
            if arg_4.name=="actor":
                arg_2=arg_4.getContent()
            if arg_4.name=="reason":
                arg_3=arg_4.getContent()
            arg_4=arg_4.next
        arg_0.__init(
            from_utf8(arg_1.prop("affiliation")),
            from_utf8(arg_1.prop("role")),
            from_utf8(arg_1.prop("jid")),
            from_utf8(arg_1.prop("nick")),
            from_utf8(arg_2),
            from_utf8(arg_3),
            );

Initialize a MucItem object from an XML node .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
file_list
(
)
for
arg_2
in
arg_1
:
log
.
info
(
"{file:30s} {size}"
.
format
(
file
=
arg_2
[
0
]
,
size
=
arg_2
[
1
]
)
)

def Func(arg_0):
    """List file on target"""
    arg_1 = arg_0.file_list()
    for arg_2 in arg_1:
        log.info("{file:30s} {size}".format(file=arg_2[0], size=arg_2[1]))


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . NewObject ( ) for arg_3 , arg_4 in arg_1 . items ( ) : arg_2 . put ( unicode ( arg_3 ) , arg_4 ) return arg_2

def Func(arg_0, arg_1):
        ''' note py_obj items are NOT converted to PyJs types! '''
        arg_2 = arg_0.NewObject()
        for arg_3, arg_4 in arg_1.items():
            arg_2.put(unicode(arg_3), arg_4)
        return arg_2


Registers a gadget object.
        If a gadget is already registered, this will raise AlreadyRegistered.

def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . _registry : raise AlreadyRegistered else : arg_0 . _registry . append ( arg_1 )

def Func(arg_0, arg_1):
        """
        Registers a gadget object.
        If a gadget is already Funced, this will raise AlreadyRegistered.
        """
        if arg_1 in arg_0._registry:
            raise AlreadyRegistered
        else:
            arg_0._registry.append(arg_1)

Registers a gadget object . If a gadget is already registered this will raise AlreadyRegistered .


def Func(arg_0):
    '''This gets a new API key from the specified LCC-Server.

    NOTE: this only gets an anonymous API key. To get an API key tied to a user
    account (and associated privilege level), see the `import_apikey` function
    below.

    Parameters
    ----------

    lcc_server : str
        The base URL of the LCC-Server from where the API key will be fetched.

    Returns
    -------

    (apikey, expiry) : tuple
        This returns a tuple with the API key and its expiry date.

    '''

    arg_1 = os.path.expanduser('~')
    arg_2 = os.path.join(arg_1,
                              '.astrobase',
                              'lccs',
                              'apikey-%s' % arg_0.replace(
                                  'https://',
                                  'https-'
                              ).replace(
                                  'http://',
                                  'http-'
                              ))

    # url for getting an API key
    arg_3 = '%s/api/key' % arg_0

    # get the API key
    arg_4 = urlopen(arg_3)

    if arg_4.code == 200:

        arg_5 = json.loads(arg_4.read())

    else:

        LOGERROR('could not fetch the API key from LCC-Server at: %s' %
                 arg_0)
        LOGERROR('the HTTP status code was: %s' % arg_4.status_code)
        return None

    #
    # now that we have an API key dict, get the API key out of it and write it
    # to the APIKEYFILE
    #
    arg_6 = arg_5['result']['apikey']
    arg_7 = arg_5['result']['expires']

    # write this to the apikey file

    if not os.path.exists(os.path.dirname(arg_2)):
        os.makedirs(os.path.dirname(arg_2))

    with open(arg_2,'w') as outfd:
        outfd.write('%s %s\n' % (arg_6, arg_7))

    # chmod it to the correct value
    os.chmod(arg_2, 0o100600)

    LOGINFO('key fetched successfully from: %s. expires on: %s' % (arg_0,
                                                                   arg_7))
    LOGINFO('written to: %s' % arg_2)

    return arg_6, arg_7

This gets a new API key from the specified LCC - Server .


def Func(arg_0, arg_1, arg_2):
  """For each kvp in config, do wildcard substitution on the values"""
  for arg_3 in arg_0:
    arg_4 = arg_0[arg_3]
    arg_5 = arg_4
    if isinstance(arg_4, str):
      for arg_6 in arg_1:
        if arg_1[arg_6]:
          arg_4 = arg_4.replace(arg_6, arg_1[arg_6])
      arg_7 = re.findall(r'\${[A-Z_]+}', arg_4)
      if arg_7:
        raise ValueError("%s=%s in file %s contains unsupported or unset wildcard tokens: %s" %
                         (arg_3, arg_5, arg_2, ", ".join(arg_7)))
      arg_0[arg_3] = arg_4
  return arg_0

For each kvp in config do wildcard substitution on the values


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
isinstance
(
arg_2
,
int
)
:
arg_2
=
'R%d'
%
arg_2
arg_3
=
0
for
arg_4
in
arg_0
.
select_many
(
arg_1
)
:
if
not
xtuml
.
navigate_subtype
(
arg_4
,
arg_2
)
:
arg_3
+=
1
logger
.
warning
(
'integrity violation across '
'%s[%s]'
%
(
arg_1
,
arg_2
)
)
return
arg_3

def Func(arg_0, arg_1, arg_2):
    '''
    Check the model for integrity violations across a subtype association.
    '''
    if isinstance(arg_2, int):
        arg_2 = 'R%d' % arg_2

    arg_3 = 0
    for arg_4 in arg_0.select_many(arg_1):
        if not xtuml.navigate_subtype(arg_4, arg_2):
            arg_3 += 1
            logger.warning('integrity violation across '
                           '%s[%s]' % (arg_1, arg_2))

    return arg_3

Check the model for integrity violations across a subtype association .


async
def
Func
(
arg_0
)
:
arg_1
=
(
arg_0
.
_conversation
.
type
==
hangouts_pb2
.
CONVERSATION_TYPE_GROUP
)
try
:
if
arg_1
:
await
arg_0
.
_client
.
remove_user
(
hangouts_pb2
.
RemoveUserRequest
(
request_header
=
arg_0
.
_client
.
get_request_header
(
)
,
event_request_header
=
arg_0
.
_get_event_request_header
(
)
,
)
)
else
:
await
arg_0
.
_client
.
delete_conversation
(
hangouts_pb2
.
DeleteConversationRequest
(
request_header
=
arg_0
.
_client
.
get_request_header
(
)
,
conversation_id
=
hangouts_pb2
.
ConversationId
(
id
=
arg_0
.
id_
)
,
delete_upper_bound_timestamp
=
parsers
.
to_timestamp
(
datetime
.
datetime
.
now
(
tz
=
datetime
.
timezone
.
utc
)
)
)
)
except
exceptions
.
NetworkError
as
e
:
logger
.
warning
(
'Failed to Func conversation: {}'
.
format
(
e
)
)
raise

async def Func(arg_0):
        """Leave this conversation.

        Raises:
            .NetworkError: If conversation cannot be left.
        """
        arg_1 = (arg_0._conversation.type ==
                                 hangouts_pb2.CONVERSATION_TYPE_GROUP)
        try:
            if arg_1:
                await arg_0._client.remove_user(
                    hangouts_pb2.RemoveUserRequest(
                        request_header=arg_0._client.get_request_header(),
                        event_request_header=arg_0._get_event_request_header(),
                    )
                )
            else:
                await arg_0._client.delete_conversation(
                    hangouts_pb2.DeleteConversationRequest(
                        request_header=arg_0._client.get_request_header(),
                        conversation_id=hangouts_pb2.ConversationId(
                            id=arg_0.id_
                        ),
                        delete_upper_bound_timestamp=parsers.to_timestamp(
                            datetime.datetime.now(tz=datetime.timezone.utc)
                        )
                    )
                )
        except exceptions.NetworkError as e:
            logger.warning('Failed to Func conversation: {}'.format(e))
            raise


def Func ( arg_0 , arg_1 = None ) : arg_0 . _Func = arg_1 if type ( arg_1 ) is bool else True

def Func(arg_0, arg_1=None):
        """
        Enables Funcent mode for the current mock.

        Returns:
            self: current Mock instance.
        """
        arg_0._Func = arg_1 if type(arg_1) is bool else True

Enables persistent mode for the current mock.

        Returns:
            self: current Mock instance.

Enables persistent mode for the current mock .


return Name(name_value=value,
                    name_type=n_type)

def Func ( arg_0 , arg_1 , arg_2 ) : if isinstance ( arg_1 , Name . NameValue ) : arg_3 = arg_1 elif isinstance ( arg_1 , str ) : arg_3 = arg_0 . NameValue ( arg_1 ) else : arg_4 = 'Name' arg_5 = exceptions . ErrorStrings . BAD_EXP_RECV arg_6 = 'name_value' raise TypeError ( arg_5 . format ( '{0}.{1}' . format ( arg_4 , arg_6 ) , 'name_value' , type ( Name . NameValue ) , type ( arg_1 ) ) ) if isinstance ( arg_2 , Name . NameType ) : arg_7 = arg_2 elif isinstance ( arg_2 , Enum ) : arg_7 = arg_0 . NameType ( arg_2 ) else : arg_4 = 'Name' arg_5 = exceptions . ErrorStrings . BAD_EXP_RECV arg_6 = 'name_type' raise TypeError ( arg_5 . format ( '{0}.{1}' . format ( arg_4 , arg_6 ) , 'name_type' , type ( Name . NameType ) , type ( arg_2 ) ) ) return Name ( arg_1 = arg_3 , arg_2 = arg_7 )

def Func(arg_0, arg_1, arg_2):
        '''
            Returns a Name object, populated with the given value and type
        '''
        if isinstance(arg_1, Name.NameValue):
            arg_3 = arg_1
        elif isinstance(arg_1, str):
            arg_3 = arg_0.NameValue(arg_1)
        else:
            arg_4 = 'Name'
            arg_5 = exceptions.ErrorStrings.BAD_EXP_RECV
            arg_6 = 'name_value'
            raise TypeError(arg_5.format('{0}.{1}'.format(arg_4, arg_6),
                                       'name_value', type(Name.NameValue),
                                       type(arg_1)))

        if isinstance(arg_2, Name.NameType):
            arg_7 = arg_2
        elif isinstance(arg_2, Enum):
            arg_7 = arg_0.NameType(arg_2)
        else:
            arg_4 = 'Name'
            arg_5 = exceptions.ErrorStrings.BAD_EXP_RECV
            arg_6 = 'name_type'
            raise TypeError(arg_5.format('{0}.{1}'.format(arg_4, arg_6),
                                       'name_type', type(Name.NameType),
                                       type(arg_2)))

        return Name(arg_1=arg_3,
                    arg_2=arg_7)

Returns a Name object populated with the given value and type


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_copy ( arg_1 , 'addresses' ) if not arg_2 : return [ { 'proto' : 'none' } ] arg_3 = [ ] arg_4 = { } arg_5 = [ ] for arg_6 in arg_2 : arg_7 = arg_6 . get ( 'family' ) if arg_6 [ 'proto' ] == 'dhcp' : arg_6 [ 'proto' ] = 'dhcp' if arg_7 == 'ipv4' else 'dhcpv6' arg_5 . append ( arg_0 . __intermediate_address ( arg_6 ) ) continue if 'gateway' in arg_6 : arg_8 = 'gateway' if arg_7 == 'ipv4' else 'ip6gw' arg_1 [ arg_8 ] = arg_6 [ 'gateway' ] arg_9 = 'ipaddr' if arg_7 == 'ipv4' else 'ip6addr' arg_4 . setdefault ( arg_9 , [ ] ) arg_4 [ arg_9 ] . append ( '{address}/{mask}' . format ( ** arg_6 ) ) arg_4 . update ( arg_0 . __intermediate_address ( arg_6 ) ) if arg_4 : if len ( arg_4 . get ( 'ipaddr' , [ ] ) ) == 1 : arg_10 = ip_interface ( six . text_type ( arg_4 [ 'ipaddr' ] [ 0 ] ) ) arg_4 [ 'ipaddr' ] = str ( arg_10 . ip ) arg_4 [ 'netmask' ] = str ( arg_10 . netmask ) if len ( arg_4 . get ( 'ip6addr' , [ ] ) ) == 1 : arg_4 [ 'ip6addr' ] = arg_4 [ 'ip6addr' ] [ 0 ] arg_3 . append ( arg_4 ) if arg_5 : arg_3 += arg_5 return arg_3

def Func(arg_0, arg_1):
        """
        converts NetJSON address to
        UCI intermediate data structure
        """
        arg_2 = arg_0.get_copy(arg_1, 'addresses')
        # do not ignore interfaces if they do not contain any address
        if not arg_2:
            return [{'proto': 'none'}]
        arg_3 = []
        arg_4 = {}
        arg_5 = []
        for arg_6 in arg_2:
            arg_7 = arg_6.get('family')
            # dhcp
            if arg_6['proto'] == 'dhcp':
                arg_6['proto'] = 'dhcp' if arg_7 == 'ipv4' else 'dhcpv6'
                arg_5.append(arg_0.__intermediate_address(arg_6))
                continue
            if 'gateway' in arg_6:
                arg_8 = 'gateway' if arg_7 == 'ipv4' else 'ip6gw'
                arg_1[arg_8] = arg_6['gateway']
            # static
            arg_9 = 'ipaddr' if arg_7 == 'ipv4' else 'ip6addr'
            arg_4.setdefault(arg_9, [])
            arg_4[arg_9].append('{address}/{mask}'.format(**arg_6))
            arg_4.update(arg_0.__intermediate_address(arg_6))
        if arg_4:
            # do not use CIDR notation when using a single ipv4
            # see https://github.com/openwisp/netjsonconfig/issues/54
            if len(arg_4.get('ipaddr', [])) == 1:
                arg_10 = ip_interface(six.text_type(arg_4['ipaddr'][0]))
                arg_4['ipaddr'] = str(arg_10.ip)
                arg_4['netmask'] = str(arg_10.netmask)
            # do not use lists when using a single ipv6 address
            # (avoids to change output of existing configuration)
            if len(arg_4.get('ip6addr', [])) == 1:
                arg_4['ip6addr'] = arg_4['ip6addr'][0]
            arg_3.append(arg_4)
        if arg_5:
            arg_3 += arg_5
        return arg_3


def
Func
(
arg_0
,
arg_1
)
:
with
arg_0
.
lock
:
if
arg_0
.
_stream
:
raise
ValueError
(
"Target stream already set"
)
arg_0
.
_stream
=
arg_1
arg_0
.
_reader
=
StreamReader
(
arg_1
)

def Func(arg_0, arg_1):
        """Make the `stream` the target for this transport instance.

        The 'stream_start', 'stream_end' and 'stream_element' methods
        of the target will be called when appropriate content is received.

        :Parameters:
            - `stream`: the stream handler to receive stream content
              from the transport
        :Types:
            - `stream`: `StreamBase`
        """
        with arg_0.lock:
            if arg_0._stream:
                raise ValueError("Target stream already set")
            arg_0._stream = arg_1
            arg_0._reader = StreamReader(arg_1)

Make the stream the target for this transport instance .


def Func ( arg_0 ) : if not os . path . isdir ( arg_0 ) : os . makedirs ( arg_0 ) arg_1 = arg_2 . tempdir arg_2 . tempdir = arg_0 try : yield finally : arg_2 . tempdir = arg_1

def Func(arg_0):
    """
    Monkey-patch tempfile.tempdir with replacement, ensuring it exists
    """
    if not os.path.isdir(arg_0):
        os.makedirs(arg_0)

    arg_1 = arg_2.tempdir

    arg_2.tempdir = arg_0

    try:
        yield
    finally:
        arg_2.tempdir = arg_1

Monkey - patch tempfile . tempdir with replacement ensuring it exists


(self, index, total, percentage_step, length)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Resets to the progressbar to start a new one"""
        arg_0._start_time = datetime.datetime.now()
        arg_0._start_index = arg_1
        arg_0._current_index = arg_1
        arg_0._percentage_step = arg_3
        arg_0._total = float(arg_2)
        arg_0._total_minus_one = arg_2 - 1
        arg_0._length = arg_4
        arg_0._norm_factor = arg_2 * arg_3 / 100.0
        arg_0._current_interval = int((arg_1 + 1.0) / arg_0._norm_factor)


return [cls(s) for s in glob.glob(unicode(self / pattern))]

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . __class__ return [ arg_2 ( arg_3 ) for arg_3 in Func . Func ( unicode ( arg_0 / arg_1 ) ) ]

def Func(arg_0, arg_1):
        """ Return a list of path objects that match the pattern.

        pattern - a path relative to this directory, with wildcards.

        For example, path('/users').Func('*/bin/*') returns a list
        of all the files users have in their bin directories.
        """
        arg_2 = arg_0.__class__
        return [arg_2(arg_3) for arg_3 in Func.Func(unicode(arg_0 / arg_1))]

Return a list of path objects that match the pattern.

        pattern - a path relative to this directory, with wildcards.

        For example, path('/users').glob('*/bin/*') returns a list
        of all the files users have in their bin directories.

Return a list of path objects that match the pattern .


def Func(arg_0, arg_1: arg_2) -> Dict[str, Any]:
        """Returns a copy of the Solidity JSON ABI item for the function associated with the selector ``hsh``.

        If no normal contract function has the specified selector, a dict describing the default or non-default
        fallback function is returned.

        The content of the returned dict is described at https://solidity.readthedocs.io/en/latest/abi-spec.html#json_
        """
        if not isinstance(arg_1, (arg_2, bytearray)):
            raise TypeError('The selector argument must be a concrete byte array')
        arg_3 = arg_0._function_signatures_by_selector.get(arg_1)
        if arg_3 is not None:
            return dict(arg_0._function_abi_items_by_signature[arg_3])
        arg_4 = arg_0._fallback_function_abi_item
        if arg_4 is not None:
            return dict(arg_4)
        # An item describing the default fallback function.
        return {'payable': False, 'stateMutability': 'nonpayable', 'type': 'fallback'}

Returns a copy of the Solidity JSON ABI item for the function associated with the selector hsh .


def Func ( arg_0 , arg_1 ) : if arg_1 not in arg_0 . _attribute_rule_sets . keys ( ) : return False arg_2 = arg_0 . _attribute_rule_sets . get ( arg_1 ) if arg_0 . _version >= arg_2 . version_added : return True else : return False

def Func(arg_0, arg_1):
        """
        Check if the attribute is supported by the current KMIP version.

        Args:
            attribute (string): The name of the attribute
                (e.g., 'Cryptographic Algorithm'). Required.
        Returns:
            bool: True if the attribute is supported by the current KMIP
                version. False otherwise.
        """
        if arg_1 not in arg_0._attribute_rule_sets.keys():
            return False

        arg_2 = arg_0._attribute_rule_sets.get(arg_1)
        if arg_0._version >= arg_2.version_added:
            return True
        else:
            return False

Check if the attribute is supported by the current KMIP version .


def Func ( arg_0 , arg_1 = '' , arg_2 = None , ** arg_3 ) : arg_4 = get_tree_model ( ) ( arg_0 = arg_0 , arg_1 = arg_1 , ** arg_3 ) arg_4 . id = generate_id_for ( arg_4 ) arg_4 . is_dynamic = True if arg_2 is not None : arg_4 . dynamic_items = [ ] def traverse ( arg_2 ) : for arg_8 in arg_2 : arg_8 . tree = arg_4 arg_4 . dynamic_items . append ( arg_8 ) if hasattr ( arg_8 , 'dynamic_children' ) : traverse ( arg_8 . dynamic_children ) traverse ( arg_2 ) return arg_4

def Func(arg_0, arg_1='', arg_2=None, **arg_3):
    """Dynamically creates and returns a sitetree.

    :param str|unicode alias:
    :param str|unicode title:
    :param iterable items: dynamic sitetree items objects created by `item` function.
    :param kwargs: Additional arguments to pass to tree item initializer.

    :rtype: TreeBase
    """
    arg_4 = get_tree_model()(arg_0=arg_0, arg_1=arg_1, **arg_3)
    arg_4.id = generate_id_for(arg_4)
    arg_4.is_dynamic = True

    if arg_2 is not None:
        arg_4.dynamic_items = []
        def traverse(arg_2):
            for arg_8 in arg_2:
                arg_8.tree = arg_4
                arg_4.dynamic_items.append(arg_8)
                if hasattr(arg_8, 'dynamic_children'):
                    traverse(arg_8.dynamic_children)

        traverse(arg_2)
    return arg_4

Dynamically creates and returns a sitetree .


def Func ( arg_0 = '' , arg_1 = '' ) : arg_2 = pd . DataFrame ( mutualFundSymbols ( arg_0 , arg_1 ) ) _toDatetime ( arg_2 ) _reindex ( arg_2 , 'symbol' ) return arg_2

def Func(arg_0='', arg_1=''):
    '''This call returns an array of mutual fund symbols that IEX Cloud supports for API calls.

    https://iexcloud.io/docs/api/#mutual-fund-symbols
    8am, 9am, 12pm, 1pm UTC daily

    Args:
        token (string); Access token
        version (string); API version

    Returns:
        DataFrame: result
    '''
    arg_2 = pd.DataFrame(mutualFundSymbols(arg_0, arg_1))
    _toDatetime(arg_2)
    _reindex(arg_2, 'symbol')
    return arg_2

This call returns an array of mutual fund symbols that IEX Cloud supports for API calls .


def
Func
(
arg_0
)
:
arg_0
.
log
.
debug
(
"Func(): Clearing paused() Flag!"
)
arg_0
.
paused
.
clear
(
)
arg_0
.
log
.
debug
(
"Func(): Re-subscribing softly.."
)
arg_0
.
_resubscribe
(
soft
=
True
)

def Func(arg_0):
        """Unpauses the connection.

        Send a message up to client that he should re-subscribe to all
        channels.

        :return:
        """
        arg_0.log.debug("Func(): Clearing paused() Flag!")
        arg_0.paused.clear()
        arg_0.log.debug("Func(): Re-subscribing softly..")
        arg_0._resubscribe(soft=True)


(
    self,
    exc_tuple=None,
    filename=None,
    tb_offset=None,
    exception_only=False,
    running_compiled_code=False,
)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = False , arg_5 = False , ) : arg_0 . default_showtraceback ( arg_1 , arg_2 , arg_3 , arg_4 = True , arg_5 = arg_5 , )

def Func(
    arg_0,
    arg_1=None,
    arg_2=None,
    arg_3=None,
    arg_4=False,
    arg_5=False,
):
    """Custom showtraceback for monkey-patching IPython's InteractiveShell

    https://stackoverflow.com/questions/1261668/cannot-override-sys-excepthook
    """
    arg_0.default_showtraceback(
        arg_1,
        arg_2,
        arg_3,
        arg_4=True,
        arg_5=arg_5,
    )

Custom showtraceback for monkey - patching IPython s InteractiveShell


(
        cls, name: sym.Symbol, module: types.ModuleType = None
    )

return cls._NAMESPACES.swap(Namespace.__get_or_create, name, module=module)[
            name
        ]

def Func ( arg_0 , arg_1 : arg_2 . Symbol , arg_4 : arg_5 . ModuleType = None ) -> "Namespace" : return arg_0 . _NAMESPACES . swap ( Namespace . __Func , arg_1 , arg_4 = arg_4 ) [ arg_1 ]

def Func(
        arg_0, arg_1: arg_2.Symbol, arg_4: arg_5.ModuleType = None
    ) -> "Namespace":
        """Get the namespace bound to the symbol `name` in the global namespace
        cache, creating it if it does not exist.
        Return the namespace."""
        return arg_0._NAMESPACES.swap(Namespace.__Func, arg_1, arg_4=arg_4)[
            arg_1
        ]

Get the namespace bound to the symbol name in the global namespace cache creating it if it does not exist . Return the namespace .


(self, self_reduced: bool, io_changed: bool,
                   result_statements: List["HdlStatement"])

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_2 , arg_4 : arg_5 [ "HdlStatement" ] ) -> None : arg_6 = arg_0 . parentStm if arg_1 : arg_7 = arg_6 is None if arg_7 : arg_8 = arg_0 . _get_rtl_context ( ) arg_8 . statements . remove ( arg_0 ) arg_8 . statements . update ( arg_4 ) for arg_9 in arg_0 . _inputs : arg_9 . endpoints . discard ( arg_0 ) for arg_10 in arg_0 . _outputs : arg_10 . drivers . remove ( arg_0 ) for arg_11 in arg_4 : arg_11 . parentStm = arg_6 if arg_6 is None : for arg_12 in arg_11 . _inputs : arg_12 . endpoints . append ( arg_11 ) for arg_13 in arg_11 . _outputs : arg_13 . drivers . append ( arg_11 ) else : if arg_3 : arg_0 . _inputs = UniqList ( ) arg_0 . _outputs = UniqList ( ) arg_0 . _collect_io ( )

def Func(arg_0, arg_1: arg_2, arg_3: arg_2,
                   arg_4: arg_5["HdlStatement"]) -> None:
        """
        Update signal IO after reuce atempt

        :param self_reduced: if True this object was reduced
        :param io_changed: if True IO of this object may changed
            and has to be updated
        :param result_statements: list of statements which are result
            of reduce operation on this statement
        """

        arg_6 = arg_0.parentStm
        if arg_1:
            arg_7 = arg_6 is None
            # update signal drivers/endpoints
            if arg_7:
                # disconnect self from signals
                arg_8 = arg_0._get_rtl_context()
                arg_8.statements.remove(arg_0)
                arg_8.statements.update(arg_4)

                for arg_9 in arg_0._inputs:
                    arg_9.endpoints.discard(arg_0)
                for arg_10 in arg_0._outputs:
                    arg_10.drivers.remove(arg_0)

            for arg_11 in arg_4:
                arg_11.parentStm = arg_6
                if arg_6 is None:
                    # conect signals to child statements
                    for arg_12 in arg_11._inputs:
                        arg_12.endpoints.append(arg_11)
                    for arg_13 in arg_11._outputs:
                        arg_13.drivers.append(arg_11)
        else:
            # parent has to update it's inputs/outputs
            if arg_3:
                arg_0._inputs = UniqList()
                arg_0._outputs = UniqList()
                arg_0._collect_io()


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_2 . pop ( 'is_batch' , False ) if arg_3 : arg_4 = flask_make_response ( json . dumps ( * arg_1 , ** arg_2 ) ) arg_4 . mimetype = 'application/json' arg_4 . status_code = arg_0 return arg_4 arg_4 = jsonify ( * arg_1 , ** arg_2 ) arg_4 . status_code = arg_0 return arg_4

def Func(arg_0, *arg_1, **arg_2):
    """Returns a jsonified response with the specified HTTP status code.

    The positional and keyword arguments are passed directly to the
    :func:`flask.jsonify` function which creates the response.
    """
    arg_3 = arg_2.pop('is_batch', False)
    if arg_3:
        arg_4 = flask_make_response(json.dumps(*arg_1, **arg_2))
        arg_4.mimetype = 'application/json'
        arg_4.status_code = arg_0
        return arg_4
    arg_4 = jsonify(*arg_1, **arg_2)
    arg_4.status_code = arg_0
    return arg_4

Returns a jsonified response with the specified HTTP status code .


(self, share_name, directory_name, **kwargs)

return self.connection.create_directory(share_name, directory_name, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : return arg_0 . connection . Func ( arg_1 , arg_2 , ** arg_3 )

def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Create a new directory on a Azure File Share.

        :param share_name: Name of the share.
        :type share_name: str
        :param directory_name: Name of the directory.
        :type directory_name: str
        :param kwargs: Optional keyword arguments that
            `FileService.Func()` takes.
        :type kwargs: object
        :return: A list of files and directories
        :rtype: list
        """
        return arg_0.connection.Func(arg_1, arg_2, **arg_3)

Create a new directory on a Azure File Share.

        :param share_name: Name of the share.
        :type share_name: str
        :param directory_name: Name of the directory.
        :type directory_name: str
        :param kwargs: Optional keyword arguments that
            `FileService.create_directory()` takes.
        :type kwargs: object
        :return: A list of files and directories
        :rtype: list

Create a new directory on a Azure File Share .


def Func(arg_0, arg_1, arg_2):
        r'''Method to calculate the property with sanity checking and without
        specifying a specific method. `select_valid_methods_P` is used to obtain
        a sorted list of methods to try. Methods are then tried in order until
        one succeeds. The methods are allowed to fail, and their results are
        checked with `test_property_validity`. On success, the used method
        is stored in the variable `method_P`.

        If `method_P` is set, this method is first checked for validity with
        `test_method_validity_P` for the specified temperature, and if it is
        valid, it is then used to calculate the property. The result is checked
        for validity, and returned if it is valid. If either of the checks fail,
        the function retrieves a full list of valid methods with
        `select_valid_methods_P` and attempts them as described above.

        If no methods are found which succeed, returns None.

        Parameters
        ----------
        T : float
            Temperature at which to calculate the property, [K]
        P : float
            Pressure at which to calculate the property, [Pa]

        Returns
        -------
        prop : float
            Calculated property, [`units`]
        '''
        # Optimistic track, with the already set method
        if arg_0.method_P:
            # retest within range
            if arg_0.test_method_validity_P(arg_1, arg_2, arg_0.method_P):
                try:
                    arg_3 = arg_0.calculate_P(arg_1, arg_2, arg_0.method_P)
                    if arg_0.test_property_validity(arg_3):
                        return arg_3
                except:  # pragma: no cover
                    pass

        # get valid methods at T, and try them until one yields a valid
        # property; store the method_P and return the answer
        arg_0.sorted_valid_methods_P = arg_0.select_valid_methods_P(arg_1, arg_2)
        for arg_5 in arg_0.sorted_valid_methods_P:
            try:
                arg_3 = arg_0.calculate_P(arg_1, arg_2, arg_5)
                if arg_0.test_property_validity(arg_3):
                    arg_0.method_P = arg_5
                    return arg_3
            except:  # pragma: no cover
                pass
        # Function returns None if it does not work.
        return None

r Method to calculate the property with sanity checking and without specifying a specific method . select_valid_methods_P is used to obtain a sorted list of methods to try . Methods are then tried in order until one succeeds . The methods are allowed to fail and their results are checked with test_property_validity . On success the used method is stored in the variable method_P .


def Func(arg_0, arg_1):
    """Returns the real stream name of a synonym."""

    if arg_1 in STREAM_SYNONYMS and arg_1 in arg_0:
        for arg_2, arg_3 in arg_0.items():
            if arg_3 is arg_0[arg_1] and arg_2 not in STREAM_SYNONYMS:
                return arg_2

    return arg_1

Returns the real stream name of a synonym .


def Func ( arg_0 , arg_1 ) : arg_0 . PC = Operators . ITEBV ( arg_0 . address_bit_size , arg_0 . CF , arg_1 . read ( ) , arg_0 . PC )

def Func(arg_0, arg_1):
        """
        Jumps short if carry.

        :param cpu: current CPU.
        :param target: destination operand.
        """
        arg_0.PC = Operators.ITEBV(arg_0.address_bit_size, arg_0.CF, arg_1.read(), arg_0.PC)


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
not
in
arg_0
.
_observers
:
raise
ValueError
(
'{} is not an observer of {}'
.
format
(
arg_1
,
arg_0
)
)
arg_0
.
_observers
.
remove
(
arg_1
)

def Func(arg_0, arg_1):
        """Remove an observer from this event.

        Args:
            callback: A function or coroutine callback to remove from this
                event.

        Raises:
            ValueError: If the callback is not an observer of this event.
        """
        if arg_1 not in arg_0._observers:
            raise ValueError('{} is not an observer of {}'
                             .format(arg_1, arg_0))
        arg_0._observers.remove(arg_1)


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the Locate request payload to a buffer.

        Args:
            output_buffer (stream): A data buffer in which to encode object
                data, supporting a Func method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.
        """
        arg_6 = utils.BytearrayStream()

        if arg_0._maximum_items:
            arg_0._maximum_items.Func(arg_6, arg_2=arg_2)

        if arg_0._offset_items:
            arg_0._offset_items.Func(arg_6, arg_2=arg_2)

        if arg_0._storage_status_mask:
            arg_0._storage_status_mask.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._object_group_member:
            arg_0._object_group_member.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            if arg_0._attributes:
                for arg_7 in arg_0.attributes:
                    arg_7.Func(
                        arg_6,
                        arg_2=arg_2
                    )
        else:
            if arg_0._attributes:
                # TODO (ph) Add a new utility to avoid using TemplateAttributes
                arg_8 = objects.TemplateAttribute(
                    arg_9=arg_0.attributes
                )
                arg_9 = objects.convert_template_attribute_to_attributes(
                    arg_8
                )
                arg_9.Func(arg_6, arg_2=arg_2)
            else:
                raise exceptions.InvalidField(
                    "The Locate request payload is missing the attributes "
                    "list."
                )

        arg_0.length = arg_6.length()
        super(LocateRequestPayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_1.Func(arg_6.buffer)

Write the data encoding the Locate request payload to a buffer.

        Args:
            output_buffer (stream): A data buffer in which to encode object
                data, supporting a write method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

Write the data encoding the Locate request payload to a buffer .


def Func ( arg_0 : arg_1 ) : try : arg_2 = load_workbook ( filename = arg_0 , read_only = True ) except : raise else : return arg_2

def Func(arg_0: arg_1):
    """ Use openpyxl to read an Excel file. """
    try:
        arg_2 = load_workbook(filename=arg_0, read_only=True)
    except:
        raise
    else:
        return arg_2


def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_3 = numpy . zeros ( arg_0 . numberOfCols , dtype = dtype ) arg_3 [ arg_4 ( arg_1 ) ] = 1 super ( TemporalMemoryShim , arg_0 ) . Func ( arg_3 , enableLearn = arg_2 , enableInference = True ) arg_5 = arg_0 . getPredictedState ( ) arg_0 . predictiveCells = set ( numpy . flatnonzero ( arg_5 ) )

def Func(arg_0, arg_1, arg_2=True):
    """
    Feeds input record through TM, performing inference and learning.
    Updates member variables with new state.

    @param activeColumns (set) Indices of active columns in `t`
    """
    arg_3 = numpy.zeros(arg_0.numberOfCols, dtype=dtype)
    arg_3[arg_4(arg_1)] = 1
    super(TemporalMemoryShim, arg_0).Func(arg_3,
                                            enableLearn=arg_2,
                                            enableInference=True)

    arg_5 = arg_0.getPredictedState()
    arg_0.predictiveCells = set(numpy.flatnonzero(arg_5))

Feeds input record through TM performing inference and learning . Updates member variables with new state .


def Func ( arg_0 ) : arg_0 = tf . as_dtype ( arg_0 ) if hasattr ( arg_0 , 'Func' ) : return arg_0 . Func return np . dtype ( arg_0 ) . kind == 'b'

def Func(arg_0):
  """Returns whether this is a boolean data type."""
  arg_0 = tf.as_dtype(arg_0)
  if hasattr(arg_0, 'Func'):
    return arg_0.Func
  # We use `kind` because:
  # np.issubdtype(np.uint8, np.bool) == True.
  return np.dtype(arg_0).kind == 'b'

Returns whether this is a boolean data type .


def Func ( arg_0 , arg_1 = '' , arg_2 = { } ) : arg_3 = 0 arg_4 = os . path . isfile ( arg_1 ) arg_5 = { } if arg_4 : with open ( arg_1 , 'r' ) as input : input . readline ( ) for arg_6 in csv . reader ( input ) : arg_7 = calendar . timegm ( time . strptime ( arg_6 [ 0 ] , '%Y-%m-%d' ) ) if arg_7 in arg_2 : del arg_2 [ arg_7 ] arg_3 += 1 input . close ( ) return arg_3

def Func(arg_0, arg_1='', arg_2={}):
        """
        Checks the given csv file against the json data scraped for the given
        dict. It will remove all data retrieved that has already been recorded
        so we don't write redundant data to file. Returns count of rows from
        file.
        """
        arg_3 = 0
        arg_4 = os.path.isfile(arg_1)
        arg_5 = {}
        if arg_4:
            with open(arg_1, 'r') as input:
                input.readline()#skip header line
                for arg_6 in csv.reader(input):
                    arg_7 = calendar.timegm(time.strptime(arg_6[0],
                        '%Y-%m-%d'))
                    if arg_7 in arg_2:#our date is already recorded
                        del arg_2[arg_7]
                    #calc current id max
                    arg_3 += 1
            input.close()
        return arg_3

Checks the given csv file against the json data scraped for the given dict . It will remove all data retrieved that has already been recorded so we don t write redundant data to file . Returns count of rows from file .


def Func ( arg_0 ) : for arg_1 in arg_0 : for arg_2 in [ 'labels' , 'envs' , 'inputs' , 'outputs' , 'input-recursives' , 'output-recursives' ] : if not arg_1 . task_params . get ( arg_2 ) : arg_1 . task_params [ arg_2 ] = set ( )

def Func(arg_0):
  """For each task, ensure that each task param entry is not None."""
  for arg_1 in arg_0:
    for arg_2 in [
        'labels', 'envs', 'inputs', 'outputs', 'input-recursives',
        'output-recursives'
    ]:
      if not arg_1.task_params.get(arg_2):
        arg_1.task_params[arg_2] = set()

For each task ensure that each task param entry is not None .


(cls, x, palette, limits, na_value=None, oob=censor)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = arg_6 ) : arg_1 = arg_5 ( rescale ( arg_1 , _from = arg_3 ) ) arg_7 = arg_2 ( arg_1 ) try : arg_7 [ arg_8 . isnull ( arg_1 ) ] = arg_4 except TypeError : arg_7 = [ v if not arg_8 . isnull ( v ) else arg_4 for v in arg_7 ] return arg_7

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=arg_6):
        """
        Map values to a continuous palette

        Parameters
        ----------
        x : array_like
            Continuous values to scale
        palette : callable ``f(x)``
            palette to use
        na_value : object
            Value to use for missing values.
        oob : callable ``f(x)``
            Function to deal with values that are
            beyond the limits

        Returns
        -------
        out : array_like
            Values Funcped onto a palette
        """
        arg_1 = arg_5(rescale(arg_1, _from=arg_3))
        arg_7 = arg_2(arg_1)
        try:
            arg_7[arg_8.isnull(arg_1)] = arg_4
        except TypeError:
            arg_7 = [v if not arg_8.isnull(v) else arg_4 for v in arg_7]

        return arg_7

Map values to a continuous palette

        Parameters
        ----------
        x : array_like
            Continuous values to scale
        palette : callable ``f(x)``
            palette to use
        na_value : object
            Value to use for missing values.
        oob : callable ``f(x)``
            Function to deal with values that are
            beyond the limits

        Returns
        -------
        out : array_like
            Values mapped onto a palette


def Func(arg_0, arg_1=None):
        """Switches focus to the specified frame, by index, name, or webelement.

        Support:
            Web(WebView)

        Args:
            frame_reference(None|int|WebElement):
                The identifier of the frame to switch to.
                None means to set to the default context.
                An integer representing the index.
                A webelement means that is an (i)frame to switch to.
                Otherwise throw an error.

        Returns:
            WebDriver Object.
        """
        if arg_1 is not None and type(arg_1) not in [int, WebElement]:
            raise TypeError('Type of frame_reference must be None or int or WebElement')
        arg_0._execute(Command.SWITCH_TO_FRAME,
            {'id': arg_1})

Switches focus to the specified frame by index name or webelement .


def Func ( arg_0 , arg_1 ) : arg_0 . _remote . boxReceiver . stopReceivingBoxes ( arg_1 ) return basic . NetstringReceiver . Func ( arg_0 , arg_1 )

def Func(arg_0, arg_1):
        """
        Tells the box receiver to stop receiving boxes.
        """
        arg_0._remote.boxReceiver.stopReceivingBoxes(arg_1)
        return basic.NetstringReceiver.Func(arg_0, arg_1)

Tells the box receiver to stop receiving boxes .


def Func ( arg_0 ) : if settings . SYSTEMJS_DEFAULT_JS_EXTENSIONS : arg_1 , arg_2 = posixpath . splitext ( arg_0 . app ) if not arg_2 : return True return False

def Func(arg_0):
        """
        Check whether `self.app` is missing the '.js' extension and if it needs it.
        """
        if settings.SYSTEMJS_DEFAULT_JS_EXTENSIONS:
            arg_1, arg_2 = posixpath.splitext(arg_0.app)
            if not arg_2:
                return True
        return False

Check whether self . app is missing the . js extension and if it needs it .


def Func ( arg_0 ) : try : arg_1 = int ( str ( arg_0 ) ) except ValueError : return False if arg_1 > 32 or arg_1 < 0 : return False return True

def Func(arg_0):
    """Return true if the netmask is in bits notatation."""
    try:
        arg_1 = int(str(arg_0))
    except ValueError:
        return False
    if arg_1 > 32 or arg_1 < 0:
        return False
    return True

Return true if the netmask is in bits notatation .


def Func ( ) : arg_0 = 0.5 * np . random . randn ( POS . shape [ 0 ] ) + 4.5 arg_1 = objs . PlatonicSpheresCollection ( POS , arg_0 , zscale = 0.89 ) arg_2 = objs . Slab ( zpos = 4.92 , angles = ( - 4.7e-3 , - 7.3e-4 ) ) arg_3 = comp . ComponentCollection ( [ arg_1 , arg_2 ] , category = 'obj' ) arg_4 = exactpsf . FixedSSChebLinePSF ( kfki = 1.07 , zslab = - 29.3 , alpha = 1.17 , n2n1 = 0.98 , sigkf = - 0.33 , zscale = 0.89 , laser_wavelength = 0.45 ) arg_5 = ilms . BarnesStreakLegPoly2P1D ( npts = ( 16 , 10 , 8 , 4 ) , zorder = 8 ) arg_6 = ilms . LegendrePoly2P1D ( order = ( 7 , 2 , 2 ) , category = 'bkg' ) arg_7 = comp . GlobalScalar ( name = 'offset' , value = - 2.11 ) arg_8 = models . ConfocalImageModel ( ) arg_9 = states . ImageState ( util . NullImage ( shape = [ 48 , 64 , 64 ] ) , [ arg_3 , arg_4 , arg_5 , arg_6 , arg_7 ] , arg_8 = arg_8 , model_as_data = True ) arg_6 . update ( arg_6 . params , BKGVALS ) arg_5 . update ( arg_5 . params , ILMVALS ) arg_10 = arg_9 . model + np . random . randn ( * arg_9 . model . shape ) * 0.03 return util . Image ( arg_10 )

def Func():
    """Creates an image, as a `peri.util.Image`, which is similar
    to the image in the tutorial"""
    # 1. particles + coverslip
    arg_0 = 0.5 * np.random.randn(POS.shape[0]) + 4.5  # 4.5 +- 0.5 px particles
    arg_1 = objs.PlatonicSpheresCollection(POS, arg_0, zscale=0.89)
    arg_2 = objs.Slab(zpos=4.92, angles=(-4.7e-3, -7.3e-4))
    arg_3 = comp.ComponentCollection([arg_1, arg_2], category='obj')

    # 2. psf, ilm
    arg_4 = exactpsf.FixedSSChebLinePSF(kfki=1.07, zslab=-29.3, alpha=1.17,
            n2n1=0.98, sigkf=-0.33, zscale=0.89, laser_wavelength=0.45)
    arg_5 = ilms.BarnesStreakLegPoly2P1D(npts=(16,10,8,4), zorder=8)
    arg_6 = ilms.LegendrePoly2P1D(order=(7,2,2), category='bkg')
    arg_7 = comp.GlobalScalar(name='offset', value=-2.11)
    arg_8 = models.ConfocalImageModel()
    arg_9 = states.ImageState(util.NullImage(shape=[48,64,64]),
            [arg_3, arg_4, arg_5, arg_6, arg_7], arg_8=arg_8, model_as_data=True)
    arg_6.update(arg_6.params, BKGVALS)
    arg_5.update(arg_5.params, ILMVALS)
    arg_10 = arg_9.model + np.random.randn(*arg_9.model.shape) * 0.03
    return util.Image(arg_10)

Creates an image as a peri . util . Image which is similar to the image in the tutorial


def Func ( arg_0 ) : if six . PY2 : arg_1 = sys . getfilesystemencoding ( ) arg_0 = arg_0 . encode ( arg_1 ) arg_2 = os . path . expanduser ( arg_0 ) if six . PY2 : arg_2 = arg_2 . decode ( arg_1 ) return arg_2

def Func(arg_0):
    '''
    os.path.expanduser wrapper, necessary because it cannot handle unicode strings properly.

    This is not necessary in Python 3.

    :param path:
        .. seealso:: os.path.expanduser
    '''
    if six.PY2:
        arg_1 = sys.getfilesystemencoding()
        arg_0 = arg_0.encode(arg_1)
    arg_2 = os.path.expanduser(arg_0)
    if six.PY2:
        arg_2 = arg_2.decode(arg_1)
    return arg_2

os . path . expanduser wrapper necessary because it cannot handle unicode strings properly .


return list(Artist(self, artist) for artist in data['artists'])

async def Func ( arg_0 , * arg_1 : arg_2 [ arg_3 ] ) -> arg_2 [ Artist ] : arg_4 = await arg_0 . http . artists ( ',' . join ( to_id ( _id ) for _id in arg_1 ) ) return list ( Artist ( arg_0 , arg_5 ) for arg_5 in arg_4 [ 'artists' ] )

async def Func(arg_0, *arg_1: arg_2[arg_3]) -> arg_2[Artist]:
        """Retrive multiple artists with a list of spotify IDs.

        Parameters
        ----------
        ids : List[str]
            the IDs to look for

        Returns
        -------
        artists : List[Artist]
            The artists from the IDs
        """
        arg_4 = await arg_0.http.artists(','.join(to_id(_id) for _id in arg_1))
        return list(Artist(arg_0, arg_5) for arg_5 in arg_4['artists'])

Retrive multiple artists with a list of spotify IDs .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_0 != 'cloud' and arg_2 != 'compute' : if 'project' in arg_1 : arg_1 [ 'name' ] = 'projects/%s' % arg_1 . pop ( 'project' ) if arg_0 == 'cloud' and arg_2 == 'storage' : if 'project' in arg_1 : del arg_1 [ 'project' ] return arg_1

def Func(arg_0, arg_1, arg_2=None):
    """
    Manipulate connection keywords.

    Modifieds keywords based on connection type.

    There is an assumption here that the client has
    already been created and that these keywords are being
    passed into methods for interacting with various services.

    Current modifications:
    - if conn_type is not cloud and module is 'compute',
      then rewrite project as name.
    - if conn_type is cloud and module is 'storage',
      then remove 'project' from dict.

    :param conn_type: E.g. 'cloud' or 'general'
    :type conn_type: ``str``

    :param kwargs: Dictionary of keywords sent in by user.
    :type kwargs: ``dict``

    :param module_name: Name of specific module that will be loaded.
                        Default is None.
    :type conn_type: ``str`` or None

    :returns kwargs with client and module specific changes
    :rtype: ``dict``
    """
    if arg_0 != 'cloud' and arg_2 != 'compute':
        if 'project' in arg_1:
            arg_1['name'] = 'projects/%s' % arg_1.pop('project')
    if arg_0 == 'cloud' and arg_2 == 'storage':
        if 'project' in arg_1:
            del arg_1['project']
    return arg_1

Manipulate connection keywords . Modifieds keywords based on connection type .


def Func ( arg_0 ) : arg_1 = set ( ) for arg_2 , arg_3 , arg_4 in pkgutil . iter_modules ( path = [ arg_0 ] ) : arg_5 = os . path . join ( arg_2 . path , '%s.py' % arg_3 ) if os . path . exists ( arg_5 ) : arg_1 . add ( os . path . abspath ( arg_5 ) ) return arg_1

def Func(arg_0):
    """Returns module filenames from package.

    Args:
        package_path: Path to Python package.
    Returns:
        A set of module filenames.
    """
    arg_1 = set()
    for arg_2, arg_3, arg_4 in pkgutil.iter_modules(path=[arg_0]):
        arg_5 = os.path.join(arg_2.path, '%s.py' % arg_3)
        if os.path.exists(arg_5):
            arg_1.add(os.path.abspath(arg_5))
    return arg_1


(max_workers=None, context=None, timeout=10,
                          kill_workers=False, reuse="auto",
                          job_reducers=None, result_reducers=None,
                          initializer=None, initargs=())

def Func(arg_0=None, arg_1=None, arg_2=10,
                          arg_3=False, arg_4="auto",
                          arg_5=None, arg_6=None,
                          arg_7=None, arg_8=()):
    """Return the current ReusableExectutor instance.

    Start a new instance if it has not been started already or if the previous
    instance was left in a broken state.

    If the previous instance does not have the requested number of workers, the
    executor is dynamically resized to adjust the number of workers prior to
    returning.

    Reusing a singleton instance spares the overhead of starting new worker
    processes and importing common python packages each time.

    ``max_workers`` controls the maximum number of tasks that can be running in
    parallel in worker processes. By default this is set to the number of
    CPUs on the host.

    Setting ``timeout`` (in seconds) makes idle workers automatically shutdown
    so as to release system resources. New workers are respawn upon submission
    of new tasks so that ``max_workers`` are available to accept the newly
    submitted tasks. Setting ``timeout`` to around 100 times the time required
    to spawn new processes and import packages in them (on the order of 100ms)
    ensures that the overhead of spawning workers is negligible.

    Setting ``kill_workers=True`` makes it possible to forcibly interrupt
    previously spawned jobs to get a new instance of the reusable executor
    with new constructor argument values.

    The ``job_reducers`` and ``result_reducers`` are used to customize the
    pickling of tasks and results send to the executor.

    When provided, the ``initializer`` is run first in newly spawned
    processes with argument ``initargs``.
    """
    with _executor_lock:
        global arg_13, arg_12
        arg_9 = arg_13

        if arg_0 is None:
            if arg_4 is True and arg_9 is not None:
                arg_0 = arg_9._max_workers
            else:
                arg_0 = cpu_count()
        elif arg_0 <= 0:
            raise ValueError(
                "max_workers must be greater than 0, got {}."
                .format(arg_0))

        if isinstance(arg_1, STRING_TYPE):
            arg_1 = get_context(arg_1)
        if arg_1 is not None and arg_1.get_start_method() == "fork":
            raise ValueError("Cannot use reusable executor with the 'fork' "
                             "context")

        arg_10 = dict(arg_1=arg_1, arg_2=arg_2,
                      arg_5=arg_5,
                      arg_6=arg_6,
                      arg_7=arg_7, arg_8=arg_8)
        if arg_9 is None:
            mp.util.debug("Create a executor with max_workers={}."
                          .format(arg_0))
            arg_11 = _get_next_executor_id()
            arg_12 = arg_10
            arg_13 = arg_9 = _ReusablePoolExecutor(
                _executor_lock, arg_0=arg_0,
                arg_11=arg_11, **arg_10)
        else:
            if arg_4 == 'auto':
                arg_4 = arg_10 == arg_12
            if (arg_9._flags.broken or arg_9._flags.shutdown
                    or not arg_4):
                if arg_9._flags.broken:
                    arg_14 = "broken"
                elif arg_9._flags.shutdown:
                    arg_14 = "shutdown"
                else:
                    arg_14 = "arguments have changed"
                mp.util.debug(
                    "Creating a new executor with max_workers={} as the "
                    "previous instance cannot be reused ({})."
                    .format(arg_0, arg_14))
                arg_9.shutdown(wait=True, arg_3=arg_3)
                arg_13 = arg_9 = arg_12 = None
                # Recursive call to build a new instance
                return Func(arg_0=arg_0,
                                             **arg_10)
            else:
                mp.util.debug("Reusing existing executor with max_workers={}."
                              .format(arg_9._max_workers))
                arg_9._resize(arg_0)

    return arg_9

Return the current ReusableExectutor instance .


(self, dataset_name=None, sort=None, **kwargs)

def Func(arg_0, arg_1=None, arg_2=None, **arg_3):
        """Finds and returns a dataset from the database which matches the requirement.

        Parameters
        ----------
        dataset_name : str
            The name of dataset.
        sort : List of tuple
            PyMongo sort comment, search "PyMongo find one sorting" and `collection level operations <http://api.mongodb.com/python/current/api/pymongo/collection.html>`__ for more details.
        kwargs : other events
            Other events, such as description, author and etc (optinal).

        Examples
        ---------
        Save dataset
        >>> db.save_dataset([X_train, y_train, X_test, y_test], 'mnist', description='this is a tutorial')

        Get dataset
        >>> dataset = db.Func('mnist')
        >>> datasets = db.find_datasets('mnist')

        Returns
        --------
        dataset : the dataset or False
            Return False if nothing found.

        """

        arg_0._fill_project_info(arg_3)
        if arg_1 is None:
            raise Exception("dataset_name is None, please give a dataset name")
        arg_3.update({'dataset_name': arg_1})

        arg_4 = time.time()

        arg_5 = arg_0.db.Dataset.find_one(filter=arg_3, arg_2=arg_2)

        if arg_5 is not None:
            arg_6 = arg_5['dataset_id']
        else:
            print("[Database] FAIL! Cannot find dataset: {}".format(arg_3))
            return False
        try:
            arg_7 = arg_0._deserialization(arg_0.dataset_fs.get(arg_6).read())
            arg_8 = arg_0.db.Dataset.find(arg_3)
            print("[Database] Find one dataset SUCCESS, {} took: {}s".format(arg_3, round(time.time() - arg_4, 2)))

            # check whether more datasets match the requirement
            arg_9 = arg_8.distinct('dataset_id')
            arg_10 = len(arg_9)
            if arg_10 != 1:
                print("     Note that there are {} datasets match the requirement".format(arg_10))
            return arg_7
        except Exception as e:
            arg_11, arg_12, arg_13 = sys.exc_info()
            arg_14 = os.path.split(arg_13.tb_frame.f_code.co_filename)[1]
            logging.info("{}  {}  {}  {}  {}".format(arg_11, arg_12, arg_14, arg_13.tb_lineno, e))
            return False

Finds and returns a dataset from the database which matches the requirement.

        Parameters
        ----------
        dataset_name : str
            The name of dataset.
        sort : List of tuple
            PyMongo sort comment, search "PyMongo find one sorting" and `collection level operations <http://api.mongodb.com/python/current/api/pymongo/collection.html>`__ for more details.
        kwargs : other events
            Other events, such as description, author and etc (optinal).

        Examples
        ---------
        Save dataset
        >>> db.save_dataset([X_train, y_train, X_test, y_test], 'mnist', description='this is a tutorial')

        Get dataset
        >>> dataset = db.find_top_dataset('mnist')
        >>> datasets = db.find_datasets('mnist')

        Returns
        --------
        dataset : the dataset or False
            Return False if nothing found.

Finds and returns a dataset from the database which matches the requirement .


def
Func
(
arg_0
,
arg_1
=
'37'
)
:
arg_2
=
{
}
LOG
.
info
(
"Fetching all genes"
)
for
arg_3
in
arg_0
.
hgnc_collection
.
find
(
{
'build'
:
arg_1
}
)
:
arg_4
=
arg_3
[
'ensembl_id'
]
arg_5
=
arg_3
[
'hgnc_id'
]
arg_2
[
arg_4
]
=
arg_3
LOG
.
info
(
"Ensembl genes fetched"
)
return
arg_2

def Func(arg_0, arg_1='37'):
        """Return a dictionary with ensembl ids as keys and gene objects as value.

        Args:
            build(str)

        Returns:
            genes(dict): {<ensg_id>: gene_obj, ...}
        """
        arg_2 = {}

        LOG.info("Fetching all genes")
        for arg_3 in arg_0.hgnc_collection.find({'build':arg_1}):
            arg_4 = arg_3['ensembl_id']
            arg_5 = arg_3['hgnc_id']

            arg_2[arg_4] = arg_3

        LOG.info("Ensembl genes fetched")

        return arg_2

Return a dictionary with ensembl ids as keys and gene objects as value .


def Func ( arg_0 ) : Func , arg_2 = arg_0 . source_buffer . decompose_position ( arg_0 . begin_pos ) return Func

def Func(arg_0):
        """
        Returns the line number of the beginning of this range.
        """
        Func, arg_2 = arg_0.source_buffer.decompose_position(arg_0.begin_pos)
        return Func

Returns the line number of the beginning of this range .


(self, job_template,
                                           notification_template, status)

return self._disassoc('notification_templates_%s' % status,
                              job_template, notification_template)

def Func(arg_0, arg_1,
                                           arg_2, arg_3):
        """Disassociate a notification template from this job template.

        =====API DOCS=====
        Disassociate a notification template from this job template.

        :param job_template: The job template to disassociate from.
        :type job_template: str
        :param notification_template: The notification template to be disassociated.
        :type notification_template: str
        :param status: type of notification this notification template should be disassociated from.
        :type status: str
        :returns: Dictionary of only one key "changed", which indicates whether the disassociation succeeded.
        :rtype: dict

        =====API DOCS=====
        """
        return arg_0._disassoc('notification_templates_%s' % arg_3,
                              arg_1, arg_2)

Disassociate a notification template from this job template .


return [transaction] + self._traverse_bundle(
            txn_hash=transaction.trunk_transaction_hash,
            target_bundle_hash=target_bundle_hash
        )

def Func(arg_0, arg_1, arg_2=None):
        # type: (TransactionHash, Optional[BundleHash]) -> List[Transaction]
        """
        Recursively traverse the Tangle, collecting transactions until
        we hit a new bundle.

        This method is (usually) faster than ``findTransactions``, and
        it ensures we don't collect transactions from replayed bundles.
        """
        arg_3 = (
            GetTrytesCommand(arg_0.adapter)(hashes=[arg_1])['trytes']
        )  # type: List[TryteString]

        if not arg_3:
            raise with_context(
                exc=BadApiResponse(
                    'Bundle transactions not visible '
                    '(``exc.context`` has more info).',
                ),

                context={
                    'transaction_hash': arg_1,
                    'target_bundle_hash': arg_2,
                },
            )

        arg_4 = Transaction.from_tryte_string(arg_3[0])

        if (not arg_2) and arg_4.current_index:
            raise with_context(
                exc=BadApiResponse(
                    '``Func`` started with a non-tail transaction '
                    '(``exc.context`` has more info).',
                ),

                context={
                    'transaction_object': arg_4,
                    'target_bundle_hash': arg_2,
                },
            )

        if arg_2:
            if arg_2 != arg_4.bundle_hash:
                # We've hit a different bundle; we can stop now.
                return []
        else:
            arg_2 = arg_4.bundle_hash

        if arg_4.current_index == arg_4.last_index == 0:
            # Bundle only has one transaction.
            return [arg_4]

        # Recursively follow the trunk transaction, to fetch the next
        # transaction in the bundle.
        return [arg_4] + arg_0.Func(
            arg_1=arg_4.trunk_transaction_hash,
            arg_2=arg_2
        )

Recursively traverse the Tangle collecting transactions until we hit a new bundle .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_0 , astroid . ImportFrom ) : if arg_0 . level : arg_2 = arg_0 . root ( ) if isinstance ( arg_2 , astroid . Module ) : arg_1 = arg_2 . relative_to_absolute_name ( arg_1 , level = arg_0 . level ) return arg_1

def Func(arg_0, arg_1):
    """Get a prepared module name from the given import node

    In the case of relative imports, this will return the
    absolute qualified module name, which might be useful
    for debugging. Otherwise, the initial module name
    is returned unchanged.
    """
    if isinstance(arg_0, astroid.ImportFrom):
        if arg_0.level:
            arg_2 = arg_0.root()
            if isinstance(arg_2, astroid.Module):
                arg_1 = arg_2.relative_to_absolute_name(
                    arg_1, level=arg_0.level
                )
    return arg_1


def Func ( arg_0 ) : arg_0 = list ( arg_0 ) arg_0 . sort ( ) arg_1 = [ ] arg_2 = [ ] for arg_3 in arg_0 : if not arg_2 or arg_3 . priority == arg_2 [ 0 ] . priority : arg_2 . append ( arg_3 ) continue arg_1 += shuffle_srv ( arg_2 ) arg_2 = [ arg_3 ] if arg_2 : arg_1 += shuffle_srv ( arg_2 ) return arg_1

def Func(arg_0):
    """Reorder SRV records using their priorities and weights.

    :Parameters:
        - `records`: SRV records to shuffle.
    :Types:
        - `records`: `list` of :dns:`dns.rdtypes.IN.SRV`

    :return: reordered records.
    :returntype: `list` of :dns:`dns.rdtypes.IN.SRV`"""
    arg_0 = list(arg_0)
    arg_0.sort()
    arg_1 = []
    arg_2 = []
    for arg_3 in arg_0:
        if not arg_2 or arg_3.priority == arg_2[0].priority:
            arg_2.append(arg_3)
            continue
        arg_1 += shuffle_srv(arg_2)
        arg_2 = [arg_3]
    if arg_2:
        arg_1 += shuffle_srv(arg_2)
    return arg_1

Reorder SRV records using their priorities and weights .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . link ( arg_1 , arg_2 , "UniformLink" , "" , srcOutput = "dataOut" , destInput = "bottomUpIn" )

def Func(arg_0, arg_1, arg_2):
  """Link sensor region to other region so that it can pass it data."""
  arg_0.link(arg_1, arg_2, "UniformLink", "",
               srcOutput="dataOut", destInput="bottomUpIn")

Link sensor region to other region so that it can pass it data .


def Func(arg_0, arg_1, arg_2):
    """Every other column is indexed in reverse."""
    if arg_0 % 2:
        return arg_0, arg_2.rows - 1 - arg_1
    return arg_0, arg_1

Every other column is indexed in reverse .


def Func(arg_0, arg_1, arg_2, arg_3):
  """Check for printf related issues.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  arg_4 = arg_1.elided[arg_2]

  # When snprintf is used, the second argument shouldn't be a literal.
  arg_5 = Search(r'snprintf\s*\(([^,]*),\s*([0-9]*)\s*,', arg_4)
  if arg_5 and arg_5.group(2) != '0':
    # If 2nd arg is zero, snprintf is used to calculate size.
    arg_3(arg_0, arg_2, 'runtime/printf', 3,
          'If you can, use sizeof(%s) instead of %s as the 2nd arg '
          'to snprintf.' % (arg_5.group(1), arg_5.group(2)))

  # Check if some verboten C functions are being used.
  if Search(r'\bsprintf\s*\(', arg_4):
    arg_3(arg_0, arg_2, 'runtime/printf', 5,
          'Never use sprintf. Use snprintf instead.')
  arg_5 = Search(r'\b(strcpy|strcat)\s*\(', arg_4)
  if arg_5:
    arg_3(arg_0, arg_2, 'runtime/printf', 4,
          'Almost always, snprintf is better than %s' % arg_5.group(1))