(self, key, value, timeout = None, timeout_callback = None)

def Func(arg_0, arg_1, arg_2, arg_3 = None, arg_4 = None):
        """Set item of the dictionary.

        :Parameters:
            - `key`: the key.
            - `value`: the object to store.
            - `timeout`: timeout value for the object (in seconds from now).
            - `timeout_callback`: function to be called when the item expires.
              The callback should accept none, one (the key) or two (the key
              and the value) arguments.
        :Types:
            - `key`: any hashable value
            - `value`: any python object
            - `timeout`: `int`
            - `timeout_callback`: callable
        """
        with arg_0._lock:
            logger.debug("expdict.__setitem__({0!r}, {1!r}, {2!r}, {3!r})"
                            .format(arg_1, arg_2, arg_3, arg_4))
            if not arg_3:
                arg_3 = arg_0._default_timeout
            arg_0._timeouts[arg_1] = (time.time() + arg_3, arg_4)
            return dict.__setitem__(arg_0, arg_1, arg_2)


(self, id, healthy_allocations=list(), unhealthy_allocations=list())

return self.request("allocation-health", id, json=allocations, method="post").json()

def Func ( arg_0 , arg_1 , arg_2 = arg_3 ( ) , arg_4 = arg_3 ( ) ) : arg_5 = { "HealthyAllocationIDs" : arg_2 , "UnHealthyAllocationIDs" : arg_4 , "DeploymentID" : arg_1 } return arg_0 . request ( "allocation-health" , arg_1 , json = arg_5 , method = "post" ) . json ( )

def Func(arg_0, arg_1, arg_2=arg_3(), arg_4=arg_3()):
        """ This endpoint is used to set the health of an allocation that is in the deployment manually. In some use
            cases, automatic detection of allocation health may not be desired. As such those task groups can be marked
            with an upgrade policy that uses health_check = "manual". Those allocations must have their health marked
            manually using this endpoint. Marking an allocation as healthy will allow the rolling upgrade to proceed.
            Marking it as failed will cause the deployment to fail.

           https://www.nomadproject.io/docs/http/deployments.html

            arguments:
              - id
              - healthy_allocations, Specifies the set of allocation that should be marked as healthy.
              - unhealthy_allocations,  Specifies the set of allocation that should be marked as unhealthy.
            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_5 = {"HealthyAllocationIDs": arg_2,
                       "UnHealthyAllocationIDs": arg_4,
                       "DeploymentID": arg_1}
        return arg_0.request("allocation-health", arg_1, json=arg_5, method="post").json()

This endpoint is used to set the health of an allocation that is in the deployment manually . In some use cases automatic detection of allocation health may not be desired . As such those task groups can be marked with an upgrade policy that uses health_check = manual . Those allocations must have their health marked manually using this endpoint . Marking an allocation as healthy will allow the rolling upgrade to proceed . Marking it as failed will cause the deployment to fail .


(self, context, context_id, external_tool_id)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Delete the external tool identified by external_tool_id.

        context is either COURSES_API or ACCOUNTS_API.
        context_id is the course_id or account_id, depending on context

        https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.destroy
        """
        arg_4 = arg_1.format(arg_2) + "/external_tools/{}".format(
            arg_3)
        arg_5 = arg_0._delete_resource(arg_4)
        return True

Delete the external tool identified by external_tool_id .


(self, start=0, end=1e100, states=None, max_force=20)

def Func(arg_0, arg_1=0, arg_2=1e100, arg_3=None, arg_4=20):
        '''Follow a set of marker data, yielding kinematic joint angles.

        Parameters
        ----------
        start : int, optional
            Start following marker data after this frame. Defaults to 0.
        end : int, optional
            Stop following marker data after this frame. Defaults to the end of
            the marker data.
        states : list of body states, optional
            If given, set the states of the skeleton bodies to these values
            before starting to follow the marker data.
        max_force : float, optional
            Allow each degree of freedom in the skeleton to exert at most this
            force when attempting to maintain its equilibrium position. This
            defaults to 20N. Set this value higher to simulate a stiff skeleton
            while following marker data.

        Returns
        -------
        angles : sequence of angle frames
            Returns a generator of joint angle data for the skeleton. One set of
            joint angles will be generated for each frame of marker data between
            `start` and `end`.
        '''
        arg_5 = None
        if arg_4 > 0:
            arg_0.skeleton.enable_motors(arg_4)
            arg_5 = np.zeros(arg_0.skeleton.num_dofs)
        for arg_6 in arg_0.follow_markers(arg_1, arg_2, arg_3):
            if arg_5 is not None:
                arg_0.skeleton.set_target_angles(arg_5)
            yield arg_0.skeleton.joint_angles

Follow a set of marker data yielding kinematic joint angles .


def Func ( arg_0 ) : if not arg_0 : return [ ] arg_1 = [ ] while len ( arg_0 ) > 1 : arg_2 = 0 for arg_3 in arg_0 : arg_2 += arg_3 . weight + 0.1 arg_4 = random . random ( ) * arg_2 arg_2 = 0 for arg_3 in arg_0 : arg_2 += arg_3 . weight + 0.1 if arg_4 < arg_2 : arg_0 . remove ( arg_3 ) arg_1 . append ( arg_3 ) break arg_1 . append ( arg_0 [ 0 ] ) return arg_1

def Func(arg_0):
    """Randomly reorder SRV records using their weights.

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

    :return: reordered records.
    :returntype: `list` of :dns:`dns.rdtypes.IN.SRV`"""
    if not arg_0:
        return []
    arg_1 = []
    while len(arg_0) > 1:
        arg_2 = 0
        for arg_3 in arg_0:
            arg_2 += arg_3.weight + 0.1
        arg_4 = random.random() * arg_2
        arg_2 = 0
        for arg_3 in arg_0:
            arg_2 += arg_3.weight + 0.1
            if arg_4 < arg_2:
                arg_0.remove(arg_3)
                arg_1.append(arg_3)
                break
    arg_1.append(arg_0[0])
    return arg_1

Randomly reorder SRV records using their weights .


(self, seed, index, count, security_level, checksum)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = AddressGenerator ( arg_1 , arg_4 , arg_5 ) if arg_3 is None : for arg_7 in arg_6 . create_iterator ( start = arg_2 ) : arg_8 = FindTransactionsCommand ( arg_0 . adapter ) ( addresses = [ arg_7 . address ] , ) if not arg_8 . get ( 'hashes' ) : return [ arg_7 ] return arg_6 . get_addresses ( start = arg_2 , arg_3 = arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        # type: (Seed, int, Optional[int], int, bool) -> List[Address]
        """
        Find addresses matching the command parameters.
        """
        arg_6 = AddressGenerator(arg_1, arg_4, arg_5)

        if arg_3 is None:
            # Connect to Tangle and find the first address without any
            # transactions.
            for arg_7 in arg_6.create_iterator(start=arg_2):
                # We use addy.address here because FindTransactions does
                # not work on an address with a checksum
                arg_8 = FindTransactionsCommand(arg_0.adapter)(
                    addresses=[arg_7.address],
                )

                if not arg_8.get('hashes'):
                    return [arg_7]

        return arg_6.get_addresses(start=arg_2, arg_3=arg_3)

Find addresses matching the command parameters .


def Func ( arg_0 ) : if isinstance ( arg_0 , float ) : return datetime . utcfromtimestamp ( arg_0 ) . strftime ( timeFormat ) if isinstance ( arg_0 , datetime ) : return arg_0 . strftime ( timeFormat )

def Func(arg_0):
    """ Properly Format Time for permlinks
    """
    if isinstance(arg_0, float):
        return datetime.utcfromtimestamp(arg_0).strftime(timeFormat)
    if isinstance(arg_0, datetime):
        return arg_0.strftime(timeFormat)


def Func(arg_0):
        """
        Registers the up and down handlers.

        Also registers a scheduled function every 60th of a second, causing pyglet to redraw your window with 60fps.
        """
        # Crouch/fly down
        arg_0.peng.keybinds.add(arg_0.peng.cfg["controls.controls.crouch"],"peng3d:actor.%s.player.controls.crouch"%arg_0.actor.uuid,arg_0.on_crouch_down,False)
        # Jump/fly up
        arg_0.peng.keybinds.add(arg_0.peng.cfg["controls.controls.jump"],"peng3d:actor.%s.player.controls.jump"%arg_0.actor.uuid,arg_0.on_jump_down,False)
        pyglet.clock.schedule_interval(arg_0.update,1.0/60)

Registers the up and down handlers . Also registers a scheduled function every 60th of a second causing pyglet to redraw your window with 60fps .


def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
)
:
def
list_methods
(
)
:
arg_3
=
[
]
if
arg_0
in
_OntarioExposureLimits
:
arg_3
.
append
(
ONTARIO
)
arg_3
.
append
(
)
return
arg_3
if
arg_1
:
return
list_methods
(
)
if
not
arg_2
:
arg_2
=
list_methods
(
)
[
0
]
if
arg_2
==
ONTARIO
:
arg_4
=
(
_OntarioExposureLimits
[
arg_0
]
[
"Func"
]
)
elif
arg_2
==
:
arg_4
=
else
:
raise
Exception
(
'Failure in in function'
)
return
arg_4

def Func(arg_0, arg_1=False, arg_2=None):  # pragma: no cover
    '''This function handles the retrieval of whether or not a chemical can
    be absorbed through the skin, relevant to chemical safety calculations.

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

    >>> Func('108-94-1')
    True
    >>> Func('1395-21-7')
    False
    >>> Func('7572-29-4', AvailableMethods=True)
    ['Ontario Limits', 'None']
    '''
    def list_methods():
        arg_3 = []
        if arg_0 in _OntarioExposureLimits:
            arg_3.append(ONTARIO)
        arg_3.append(NONE)
        return arg_3
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]

    if arg_2 == ONTARIO:
        arg_4 = (_OntarioExposureLimits[arg_0]["Func"])
    elif arg_2 == NONE:
        arg_4 = None
    else:
        raise Exception('Failure in in function')
    return arg_4

This function handles the retrieval of whether or not a chemical can
    be absorbed through the skin, relevant to chemical safety calculations.

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

    >>> Skin('108-94-1')
    True
    >>> Skin('1395-21-7')
    False
    >>> Skin('7572-29-4', AvailableMethods=True)
    ['Ontario Limits', 'None']

This function handles the retrieval of whether or not a chemical can be absorbed through the skin relevant to chemical safety calculations .


def Func(arg_0):
    """Given a single spinn3r feed entry, produce a single StreamItem.

    Returns 'None' if a complete item can't be constructed.

    """
    # get standard metadata, assuming it's present...
    if not hasattr(arg_0, 'permalink_entry'):
        return None
    arg_1 = arg_0.permalink_entry

    # ...and create a streamitem...
    arg_2 = streamcorpus.make_stream_item(
        arg_1.date_found[:-1] + '.0Z',
        arg_1.canonical_link.href.encode('utf8'))
    if not arg_2.stream_time:
        logger.debug('failed to generate stream_time from {0!r}'
                     .format(arg_1.date_found))
        return None
    if not arg_2.abs_url:
        logger.debug('failed to generate abs_url from {0!r}'
                     .format(arg_1.canonical_link.href))
        return None

    # ...filling in the actual data
    arg_2.body = _make_content_item(
        arg_1.content,
        alternate_data=arg_0.feed_entry.content.data)
    if not arg_2.body:
        return None
    if not arg_2.body.raw:
        return None

    if arg_1.content_extract.data:
        arg_2.other_content['extract'] = _make_content_item(arg_1.content_extract)
    arg_2.other_content['title'] = streamcorpus.ContentItem(
        raw=arg_1.title.encode('utf8'),
        media_type=arg_1.content_extract.mime_type,
        encoding='UTF-8')
    arg_2.other_content['feed_entry_title'] = streamcorpus.ContentItem(
        raw=arg_0.feed_entry.title.encode('utf8'),
        media_type=arg_0.feed_entry.content.mime_type,
        encoding='UTF-8')
    if arg_0.feed_entry.content.data:
        arg_2.other_content['feed_entry'] = _make_content_item(
            arg_0.feed_entry.content)
    arg_2.source_metadata['lang'] = arg_1.lang[0].code
    arg_2.source_metadata['author'] = json.dumps(
        dict(
            name=arg_1.author[0].name,
            email=arg_1.author[0].email,
            link=arg_1.author[0].link[0].href,
        )
    )
    arg_2.source = arg_0.source.publisher_type
    return arg_2

Given a single spinn3r feed entry produce a single StreamItem .


def Func ( arg_0 ) : for arg_1 in filter ( lambda n : len ( n . arg_name ) , arg_0 . child_list ) : arg_0 . data [ "bound_args" ] . arguments [ arg_1 . arg_name ] = arg_1 . partial ( ) arg_0 . updated = True

def Func(arg_0):
        """Replace child nodes on original function call with their partials"""

        for arg_1 in filter(lambda n: len(n.arg_name), arg_0.child_list):
            arg_0.data["bound_args"].arguments[arg_1.arg_name] = arg_1.partial()
        arg_0.updated = True


(qr_img, icon_img=None, factor=4, icon_box=None, static_dir=None)

def Func ( arg_0 , arg_1 = None , arg_2 = 4 , arg_3 = None , arg_4 = None ) : arg_5 , arg_6 = arg_0 . size arg_7 = int ( arg_5 ) / int ( arg_2 ) arg_8 = int ( arg_6 ) / int ( arg_2 ) try : arg_9 = os . path . join ( arg_1 ) if arg_4 : arg_9 = os . path . join ( arg_4 , arg_1 ) if arg_1 . split ( "://" ) [ 0 ] in [ "http" , "https" , "ftp" ] : arg_9 = BytesIO ( urlopen ( arg_1 ) . read ( ) ) arg_10 = Image . open ( arg_9 ) except : return arg_0 arg_11 , arg_12 = arg_10 . size arg_11 = arg_7 if arg_11 > arg_7 else arg_11 arg_12 = arg_8 if arg_12 > arg_8 else arg_12 arg_10 = arg_10 . resize ( ( int ( arg_11 ) , int ( arg_12 ) ) , Image . ANTIALIAS ) arg_10 = arg_10 . convert ( "RGBA" ) arg_13 = int ( ( arg_5 - arg_11 ) / 2 ) arg_14 = int ( ( arg_6 - arg_12 ) / 2 ) arg_3 = ( int ( arg_3 [ 0 ] ) , int ( arg_3 [ 1 ] ) ) if arg_3 else ( arg_13 , arg_14 ) arg_0 . paste ( im = arg_10 , box = arg_3 , mask = arg_10 ) return arg_0

def Func(arg_0, arg_1=None, arg_2=4, arg_3=None, arg_4=None):
        """Inserts a small icon to QR Code image"""
        arg_5, arg_6 = arg_0.size
        arg_7 = int(arg_5) / int(arg_2)
        arg_8 = int(arg_6) / int(arg_2)

        try:
            # load icon from current dir
            arg_9 = os.path.join(arg_1)
            if arg_4:
                # load icon from app's static dir
                arg_9 = os.path.join(arg_4, arg_1)
            if arg_1.split("://")[0] in ["http", "https", "ftp"]:
                arg_9 = BytesIO(urlopen(arg_1).read())  # download icon
            arg_10 = Image.open(arg_9)
        except:
            return arg_0

        arg_11, arg_12 = arg_10.size
        arg_11 = arg_7 if arg_11 > arg_7 else arg_11
        arg_12 = arg_8 if arg_12 > arg_8 else arg_12
        arg_10 = arg_10.resize((int(arg_11), int(arg_12)), Image.ANTIALIAS)
        arg_10 = arg_10.convert("RGBA")

        arg_13 = int((arg_5 - arg_11) / 2)
        arg_14 = int((arg_6 - arg_12) / 2)
        arg_3 = (int(arg_3[0]), int(arg_3[1])) if arg_3 else (arg_13, arg_14)
        arg_0.paste(im=arg_10, box=arg_3, mask=arg_10)
        return arg_0


def Func ( arg_0 , arg_1 ) : with CommandSuperGroup ( __name__ , arg_0 , 'rcctl.custom_cluster#{}' ) as super_group : with super_group . group ( 'cluster' ) as group : group . command ( 'select' , 'select' ) with CommandSuperGroup ( __name__ , arg_0 , 'rcctl.custom_reliablecollections#{}' , client_factory = client_create ) as super_group : with super_group . group ( 'dictionary' ) as group : group . command ( 'query' , 'query_reliabledictionary' ) group . command ( 'execute' , 'execute_reliabledictionary' ) group . command ( 'schema' , 'get_reliabledictionary_schema' ) group . command ( 'list' , 'get_reliabledictionary_list' ) group . command ( 'type-schema' , 'get_reliabledictionary_type_schema' ) with ArgumentsContext ( arg_0 , 'dictionary' ) as ac : ac . argument ( 'application_name' , options_list = [ '--application-name' , '-a' ] ) ac . argument ( 'service_name' , options_list = [ '--service-name' , '-s' ] ) ac . argument ( 'dictionary_name' , options_list = [ '--dictionary-name' , '-d' ] ) ac . argument ( 'output_file' , options_list = [ '--output-file' , '-out' ] ) ac . argument ( 'input_file' , options_list = [ '--input-file' , '-in' ] ) ac . argument ( 'query_string' , options_list = [ '--query-string' , '-q' ] ) ac . argument ( 'type_name' , options_list = [ '--type-name' , '-t' ] ) return OrderedDict ( arg_0 . command_table )

def Func(arg_0, arg_1): #pylint: disable=too-many-statements
        """Load all Service Fabric commands"""

        # Need an empty client for the select and upload operations
        with CommandSuperGroup(__name__, arg_0,
                               'rcctl.custom_cluster#{}') as super_group:
            with super_group.group('cluster') as group:
                group.command('select', 'select')

        with CommandSuperGroup(__name__, arg_0, 'rcctl.custom_reliablecollections#{}',
                               client_factory=client_create) as super_group:
            with super_group.group('dictionary') as group:
                group.command('query', 'query_reliabledictionary')
                group.command('execute', 'execute_reliabledictionary')
                group.command('schema', 'get_reliabledictionary_schema')
                group.command('list', 'get_reliabledictionary_list')
                group.command('type-schema', 'get_reliabledictionary_type_schema')

        with ArgumentsContext(arg_0, 'dictionary') as ac:
            ac.argument('application_name', options_list=['--application-name', '-a'])
            ac.argument('service_name', options_list=['--service-name', '-s'])
            ac.argument('dictionary_name', options_list=['--dictionary-name', '-d'])
            ac.argument('output_file', options_list=['--output-file', '-out'])
            ac.argument('input_file', options_list=['--input-file', '-in'])
            ac.argument('query_string', options_list=['--query-string', '-q'])
            ac.argument('type_name', options_list=['--type-name', '-t'])

        return OrderedDict(arg_0.command_table)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
arg_3
.
KMIPVersion
.
KMIP_1_0
)
:
try
:
arg_1
.
write
(
pack
(
'!Q'
,
arg_0
.
value
)
)
except
Exception
:
arg_0
.
logger
.
error
(
"Error writing boolean value to buffer"
)
raise

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the value of the Boolean object to the output stream.

        Args:
            ostream (Stream): A buffer to contain the encoded bytes of the
                value of a Boolean object. Usually a BytearrayStream object.
                Required.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.
        """
        try:
            arg_1.write(pack('!Q', arg_0.value))
        except Exception:
            arg_0.logger.error("Error writing boolean value to buffer")
            raise

Write the value of the Boolean object to the output stream .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Sets the beam moments directly.

        Parameters
        ----------
        sx : float
            Beam moment where :math:`\\text{sx}^2 = \\langle x^2 \\rangle`.
        sxp : float
            Beam moment where :math:`\\text{sxp}^2 = \\langle x'^2 \\rangle`.
        sxxp : float
            Beam moment where :math:`\\text{sxxp} = \\langle x x' \\rangle`.
        """
        arg_0._sx   = arg_1
        arg_0._sxp  = arg_2
        arg_0._sxxp = arg_3
        arg_7 = _np.sqrt(arg_1**2 * arg_2**2 - arg_3**2)
        arg_0._store_emit(arg_7=arg_7)


(func, func_file="metrics.py", func_name=None, class_name=None, source_provider=None)

"""# Generated codeimport water.udf.CMetricFunc as MetricFunc# User given metric function as a class implementing# 3 methods defined by interface CMetricFunc{}# Generated user metric which satisfies the interface# of Java MetricFuncclass {}Wrapper({}, MetricFunc, object):    pass"""

def Func(arg_0, arg_1="metrics.py", arg_2=None, arg_3=None, arg_4=None):
    """
    Upload given metrics function into H2O cluster.

    The metrics can have different representation:
      - class: needs to implement map(pred, act, weight, offset, model), reduce(l, r) and metric(l) methods
      - string: the same as in class case, but the class is given as a string

    :param func:  metric representation: string, class
    :param func_file:  internal name of file to save given metrics representation
    :param func_name:  name for h2o key under which the given metric is saved
    :param class_name: name of class wrapping the metrics function (when supplied as string)
    :param source_provider: a function which provides a source code for given function
    :return: reference to uploaded metrics function

    :examples:
        >>> class CustomMaeFunc:
        >>>     def map(self, pred, act, w, o, model):
        >>>         return [abs(act[0] - pred[0]), 1]
        >>>
        >>>     def reduce(self, l, r):
        >>>         return [l[0] + r[0], l[1] + r[1]]
        >>>
        >>>     def metric(self, l):
        >>>         return l[0] / l[1]
        >>>
        >>>
        >>> h2o.Func(CustomMaeFunc, func_name="mae")
        >>>
        >>> custom_func_str = '''class CustomMaeFunc:
        >>>     def map(self, pred, act, w, o, model):
        >>>         return [abs(act[0] - pred[0]), 1]
        >>>
        >>>     def reduce(self, l, r):
        >>>         return [l[0] + r[0], l[1] + r[1]]
        >>>
        >>>     def metric(self, l):
        >>>         return l[0] / l[1]'''
        >>>
        >>>
        >>> h2o.Func(custom_func_str, class_name="CustomMaeFunc", func_name="mae")
    """
    import tempfile
    import inspect

    # Use default source provider
    if not arg_4:
        arg_4 = _default_source_provider

    # The template wraps given metrics representation
    arg_5 = """# Generated code
import water.udf.CMetricFunc as MetricFunc

# User given metric function as a class implementing
# 3 methods defined by interface CMetricFunc
{}

# Generated user metric which satisfies the interface
# of Java MetricFunc
class {}Wrapper({}, MetricFunc, object):
    pass

"""

    assert_satisfies(arg_0, inspect.isclass(arg_0) or isinstance(arg_0, str),
                     "The argument func needs to be string or class !")
    assert_satisfies(arg_1, arg_1 is not None,
                     "The argument func_file is missing!")
    assert_satisfies(arg_1, arg_1.endswith('.py'),
                     "The argument func_file needs to end with '.py'")
    arg_6 = None
    arg_7 = None
    arg_8 = arg_1[:-3]
    if isinstance(arg_0, str):
        assert_satisfies(arg_3, arg_3 is not None,
                         "The argument class_name is missing! " +
                         "It needs to reference the class in given string!")
        arg_6 = arg_5.format(arg_0, arg_3, arg_3)
        arg_7 = "metrics_{}".format(arg_3)
        arg_3 = "{}.{}Wrapper".format(arg_8, arg_3)
    else:
        assert_satisfies(arg_0, inspect.isclass(arg_0), "The parameter `func` should be str or class")
        for arg_9 in ['map', 'reduce', 'metric']:
            assert_satisfies(arg_0, arg_9 in arg_0.__dict__, "The class `func` needs to define method `{}`".format(arg_9))

        assert_satisfies(arg_3, arg_3 is None,
                         "If class is specified then class_name parameter needs to be None")

        arg_3 = "{}.{}Wrapper".format(arg_8, arg_0.__name__)
        arg_7 = "metrics_{}".format(arg_0.__name__)
        arg_6 = arg_5.format(arg_4(arg_0), arg_0.__name__, arg_0.__name__)

    # If the func name is not given, use whatever we can derived from given definition
    if not arg_2:
        arg_2 = arg_7
    # Saved into jar file
    arg_10 = tempfile.mkdtemp(prefix="h2o-func")
    arg_11 = _create_zip_file("{}/func.jar".format(arg_10), (arg_1, arg_6))
    # Upload into K/V
    arg_12 = _put_key(arg_11, arg_12=arg_2)
    # Reference
    return "python:{}={}".format(arg_12, arg_3)

Upload given metrics function into H2O cluster.

    The metrics can have different representation:
      - class: needs to implement map(pred, act, weight, offset, model), reduce(l, r) and metric(l) methods
      - string: the same as in class case, but the class is given as a string

    :param func:  metric representation: string, class
    :param func_file:  internal name of file to save given metrics representation
    :param func_name:  name for h2o key under which the given metric is saved
    :param class_name: name of class wrapping the metrics function (when supplied as string)
    :param source_provider: a function which provides a source code for given function
    :return: reference to uploaded metrics function

    :examples:
        >>> class CustomMaeFunc:
        >>>     def map(self, pred, act, w, o, model):
        >>>         return [abs(act[0] - pred[0]), 1]
        >>>
        >>>     def reduce(self, l, r):
        >>>         return [l[0] + r[0], l[1] + r[1]]
        >>>
        >>>     def metric(self, l):
        >>>         return l[0] / l[1]
        >>>
        >>>
        >>> h2o.upload_custom_metric(CustomMaeFunc, func_name="mae")
        >>>
        >>> custom_func_str = '''class CustomMaeFunc:
        >>>     def map(self, pred, act, w, o, model):
        >>>         return [abs(act[0] - pred[0]), 1]
        >>>
        >>>     def reduce(self, l, r):
        >>>         return [l[0] + r[0], l[1] + r[1]]
        >>>
        >>>     def metric(self, l):
        >>>         return l[0] / l[1]'''
        >>>
        >>>
        >>> h2o.upload_custom_metric(custom_func_str, class_name="CustomMaeFunc", func_name="mae")

Upload given metrics function into H2O cluster .


def Func ( arg_0 ) : if arg_0 . is_root ( ) : return [ ] arg_1 = set ( [ ] ) arg_0 . _depth_ascend ( arg_0 , arg_1 , True ) try : arg_1 . remove ( arg_0 ) except KeyError : pass return list ( arg_1 )

def Func(arg_0):
        """Returns a list of the ancestors of this node but does not pass the
        root node, even if the root has parents due to cycles."""
        if arg_0.is_root():
            return []

        arg_1 = set([])
        arg_0._depth_ascend(arg_0, arg_1, True)
        try:
            arg_1.remove(arg_0)
        except KeyError:
            # we weren't ancestor of ourself, that's ok
            pass

        return list(arg_1)

Returns a list of the ancestors of this node but does not pass the root node even if the root has parents due to cycles .


def Func(arg_0):
    """
    Load crs object from esri code, via spatialreference.org.
    Parses based on the proj4 representation.

    Arguments:

    - *code*: The ESRI code as an integer.

    Returns:

    - A CS instance of the indicated type.
    """
    # must go online (or look up local table) to get crs details
    arg_0 = str(arg_0)
    arg_1 = utils.crscode_to_string("esri", arg_0, "proj4")
    arg_2 = from_proj4(arg_1)
    return arg_2

Load crs object from esri code via spatialreference . org . Parses based on the proj4 representation .


(string, encoding='utf-8', strings_only=False, errors='strict')

def
Func
(
arg_0
,
arg_1
=
'utf-8'
,
arg_2
=
False
,
arg_3
=
'strict'
)
:
if
isinstance
(
arg_0
,
str
)
:
return
arg_0
if
arg_2
and
is_protected_type
(
arg_0
)
:
return
arg_0
try
:
if
not
isinstance
(
arg_0
,
str
)
:
if
hasattr
(
arg_0
,
'__unicode__'
)
:
arg_0
=
arg_0
.
__unicode__
(
)
else
:
try
:
arg_0
=
str
(
arg_0
,
arg_1
,
arg_3
)
except
UnicodeEncodeError
:
if
not
isinstance
(
arg_0
,
Exception
)
:
raise
arg_0
=
' '
.
join
(
[
Func
(
arg
,
arg_1
,
arg_2
,
arg_3
)
for
arg
in
arg_0
]
)
elif
not
isinstance
(
arg_0
,
str
)
:
arg_0
=
arg_0
.
decode
(
arg_1
,
arg_3
)
except
UnicodeDecodeError
as
ex
:
if
not
isinstance
(
arg_0
,
Exception
)
:
raise
DjangoUnicodeDecodeError
(
arg_0
,
*
ex
.
args
)
else
:
arg_0
=
' '
.
join
(
[
Func
(
arg
,
arg_1
,
arg_2
,
arg_3
)
for
arg
in
arg_0
]
)
return
arg_0

def Func(arg_0, arg_1='utf-8', arg_2=False, arg_3='strict'):
    """
    Similar to smart_unicode, except that lazy instances are resolved to
    strings, rather than kept as lazy objects.

    If strings_only is True, don't convert (some) non-string-like objects.
    """
    # Handle the common case first, saves 30-40% in performance when s
    # is an instance of unicode. This function gets called often in that
    # setting.
    if isinstance(arg_0, str):
        return arg_0
    if arg_2 and is_protected_type(arg_0):
        return arg_0
    try:
        if not isinstance(arg_0, str):
            if hasattr(arg_0, '__unicode__'):
                arg_0 = arg_0.__unicode__()
            else:
                try:
                    arg_0 = str(arg_0, arg_1, arg_3)
                except UnicodeEncodeError:
                    if not isinstance(arg_0, Exception):
                        raise
                    # If we get to here, the caller has passed in an Exception
                    # subclass populated with non-ASCII data without special
                    # handling to display as a string. We need to handle this
                    # without raising a further exception. We do an
                    # approximation to what the Exception's standard str()
                    # output should be.
                    arg_0 = ' '.join([Func(arg, arg_1,
                                                     arg_2,
                                                     arg_3) for arg in arg_0])
        elif not isinstance(arg_0, str):
            # Note: We use .decode() here, instead of unicode(s, encoding,
            # errors), so that if s is a SafeString, it ends up being a
            # SafeUnicode at the end.
            arg_0 = arg_0.decode(arg_1, arg_3)
    except UnicodeDecodeError as ex:
        if not isinstance(arg_0, Exception):
            raise DjangoUnicodeDecodeError(arg_0, *ex.args)
        else:
            # If we get to here, the caller has passed in an Exception
            # subclass populated with non-ASCII bytestring data without a
            # working unicode method. Try to handle this without raising a
            # further exception by individually forcing the exception args
            # to unicode.
            arg_0 = ' '.join([Func(arg, arg_1, arg_2,
                                             arg_3) for arg in arg_0])
    return arg_0

Similar to smart_unicode except that lazy instances are resolved to strings rather than kept as lazy objects .


(to_colorspace, from_colorspace="RGB", children=None, name=None, deterministic=False,
                 random_state=None)

return WithColorspace(to_colorspace, from_colorspace, children, name, deterministic, random_state)

def Func ( arg_0 , arg_1 = "RGB" , arg_2 = None , arg_3 = None , arg_4 = False , arg_5 = None ) : return WithColorspace ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 )

def Func(arg_0, arg_1="RGB", arg_2=None, arg_3=None, arg_4=False,
                 arg_5=None):
    """Convert images to another colorspace."""
    return WithColorspace(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5)


def Func(arg_0, arg_1, arg_2=None):  # pylint: disable=invalid-name,unused-argument
        """
        Retrieve the list of courses contained within the catalog linked to this enterprise.

        Only courses with active course runs are returned. A course run is considered active if it is currently
        open for enrollment, or will open in the future.
        """
        arg_3 = arg_0.get_object()
        arg_0.check_object_permissions(arg_1, arg_3)
        arg_0.ensure_data_exists(
            arg_1,
            arg_3.catalog,
            error_message="No catalog is associated with Enterprise {enterprise_name} from endpoint '{path}'.".format(
                enterprise_name=arg_3.name,
                path=arg_1.get_full_path()
            )
        )

        # We have handled potential error cases and are now ready to call out to the Catalog API.
        arg_4 = CourseCatalogApiClient(arg_1.user, arg_3.site)
        Func = arg_4.get_paginated_catalog_courses(arg_3.catalog, arg_1.GET)

        # An empty response means that there was a problem fetching data from Catalog API, since
        # a Catalog with no courses has a non empty response indicating that there are no courses.
        arg_0.ensure_data_exists(
            arg_1,
            Func,
            error_message=(
                "Unable to fetch API response for catalog courses for "
                "Enterprise {enterprise_name} from endpoint '{path}'.".format(
                    enterprise_name=arg_3.name,
                    path=arg_1.get_full_path()
                )
            )
        )

        arg_6 = serializers.EnterpriseCatalogCoursesReadOnlySerializer(Func)

        # Add enterprise related context for the courses.
        arg_6.update_enterprise_courses(arg_3, catalog_id=arg_3.catalog)
        return get_paginated_response(arg_6.data, arg_1)

Retrieve the list of courses contained within the catalog linked to this enterprise .


def Func(arg_0, arg_1):
        """Hack in a data directory"""
        arg_2 = list(arg_0.DATA_DIRS)
        arg_2.append(arg_1)
        arg_0.DATA_DIRS = arg_2


def Func(arg_0, arg_1):
        """
        Filter tags according between_tags option.

        :param list(dict) all_tags: Pre-filtered tags.
        :rtype: list(dict)
        :return: Filtered tags.
        """

        arg_2 = [t["name"] for t in arg_1]
        arg_3 = []
        for arg_4 in arg_0.options.between_tags:
            try:
                arg_5 = arg_2.index(arg_4)
            except ValueError:
                raise ChangelogGeneratorError(
                    "ERROR: can't find tag {0}, specified with "
                    "--between-tags option.".format(arg_4))
            arg_3.append(arg_1[arg_5])

        arg_3 = arg_0.sort_tags_by_date(arg_3)

        if len(arg_3) == 1:
            # if option --between-tags was only 1 tag given, duplicate it
            # to generate the changelog only for that one tag.
            arg_3.append(arg_3[0])

        arg_6 = arg_0.get_time_of_tag(arg_3[1])
        arg_7 = arg_0.get_time_of_tag(arg_3[0])

        for arg_4 in arg_1:
            if arg_6 < arg_0.get_time_of_tag(arg_4) < arg_7:
                arg_3.append(arg_4)
        if arg_6 == arg_7:
            arg_3.pop(0)
        return arg_3

Filter tags according between_tags option .


return Interval(min(self.start, i.start), max(self.end, i.end))

def Func ( arg_0 , arg_1 ) : return Interval ( min ( arg_0 . start , arg_1 . start ) , max ( arg_0 . end , arg_1 . end ) )

def Func(arg_0, arg_1):
        '''Like union, but ignores whether the two intervals intersect or not'''
        return Interval(min(arg_0.start, arg_1.start), max(arg_0.end, arg_1.end))

Like union but ignores whether the two intervals intersect or not


def
Func
(
arg_0
,
arg_1
)
:
LOGGER
.
info
(
"inside Func"
)
if
arg_0
.
paramsdict
[
"assembly_method"
]
!=
"reference"
:
arg_2
=
os
.
path
.
join
(
arg_0
.
dirs
.
clusts
,
arg_1
.
name
+
".clust.gz"
)
with
iter
(
gzip
.
open
(
arg_2
,
'rb'
)
)
as
arg_5
:
arg_3
=
sum
(
1
for
i
in
arg_5
if
"//"
in
i
)
//
2
arg_4
=
(
arg_3
//
20
)
+
(
arg_3
%
20
)
LOGGER
.
info
(
"optim for align chunks: %s"
,
arg_4
)
arg_5
=
gzip
.
open
(
arg_2
,
'rb'
)
arg_6
=
iter
(
arg_5
.
read
(
)
.
strip
(
)
.
split
(
"//\n//\n"
)
)
arg_7
=
arg_4
//
10
for
arg_8
in
range
(
10
)
:
arg_9
=
arg_4
+
(
arg_8
*
arg_7
)
arg_10
=
arg_3
arg_9
if
arg_8
==
9
:
arg_11
=
list
(
itertools
.
islice
(
arg_6
,
int
(
1e9
)
)
)
else
:
arg_11
=
list
(
itertools
.
islice
(
arg_6
,
arg_9
)
)
arg_3
=
arg_10
arg_12
=
os
.
path
.
join
(
arg_0
.
tmpdir
,
arg_1
.
name
+
"_chunk_{}.ali"
.
format
(
arg_8
)
)
with
open
(
arg_12
,
'wb'
)
as
out
:
out
.
write
(
"//\n//\n"
.
join
(
arg_11
)
)
arg_5
.
close
(
)

def Func(arg_0, arg_1):
    """
    Splits the muscle alignment into chunks. Each chunk is run on a separate
    computing core. Because the largest clusters are at the beginning of the
    clusters file, assigning equal clusters to each file would put all of the
    large cluster, that take longer to align, near the top. So instead we
    randomly distribute the clusters among the files. If assembly method is
    reference then this step is just a placeholder and nothing happens.
    """
    ## log our location for debugging
    LOGGER.info("inside Func")

    ## only chunk up denovo data, refdata has its own chunking method which
    ## makes equal size chunks, instead of uneven chunks like in denovo
    if arg_0.paramsdict["assembly_method"] != "reference":
        ## get the number of clusters
        arg_2 = os.path.join(arg_0.dirs.clusts, arg_1.name+".clust.gz")
        with iter(gzip.open(arg_2, 'rb')) as arg_5:
            arg_3 = sum(1 for i in arg_5 if "//" in i) // 2
            #tclust = clustio.read().count("//")//2
            arg_4 = (arg_3//20) + (arg_3%20)
            LOGGER.info("optim for align chunks: %s", arg_4)

        ## write optim clusters to each tmp file
        arg_5 = gzip.open(arg_2, 'rb')
        arg_6 = iter(arg_5.read().strip().split("//\n//\n"))

        ## splitting loci so first file is smaller and last file is bigger
        arg_7 = arg_4 // 10
        for arg_8 in range(10):
            ## how big is this chunk?
            arg_9 = arg_4 + (arg_8 * arg_7)
            arg_10 = arg_3-arg_9
            if arg_8 == 9:
                ## grab everything left
                arg_11 = list(itertools.islice(arg_6, int(1e9)))
            else:
                ## grab next chunks-worth of data
                arg_11 = list(itertools.islice(arg_6, arg_9))
                arg_3 = arg_10

            ## write the chunk to file
            arg_12 = os.path.join(arg_0.tmpdir, arg_1.name+"_chunk_{}.ali".format(arg_8))
            with open(arg_12, 'wb') as out:
                out.write("//\n//\n".join(arg_11))

        ## write the chunk to file
        #grabchunk = list(itertools.islice(inclusts, left))
        #if grabchunk:
        #    tmpfile = os.path.join(data.tmpdir, sample.name+"_chunk_9.ali")
        #    with open(tmpfile, 'a') as out:
        #        out.write("\n//\n//\n".join(grabchunk))
        arg_5.close()

Splits the muscle alignment into chunks . Each chunk is run on a separate computing core . Because the largest clusters are at the beginning of the clusters file assigning equal clusters to each file would put all of the large cluster that take longer to align near the top . So instead we randomly distribute the clusters among the files . If assembly method is reference then this step is just a placeholder and nothing happens .


def Func ( arg_0 , arg_1 ) : try : arg_2 = arg_1 . data [ 'token' ] except KeyError : return try : arg_3 = AuthToken . objects . get ( arg_2 = arg_2 ) except AuthToken . DoesNotExist : return return ( arg_3 . user , arg_3 )

def Func(arg_0, arg_1):
        """
        Authenticate a user from a token form field

        Errors thrown here will be swallowed by django-rest-framework, and it
        expects us to return None if authentication fails.
        """
        try:
            arg_2 = arg_1.data['token']
        except KeyError:
            return

        try:
            arg_3 = AuthToken.objects.get(arg_2=arg_2)
        except AuthToken.DoesNotExist:
            return

        return (arg_3.user, arg_3)


def Func(arg_0):
        """Stop scheduling tasks because an engine has been unregistered
        from a pure ZMQ scheduler.
        """
        arg_0._task_socket.close()
        arg_0._task_socket = None
        arg_2 = "An engine has been unregistered, and we are using pure " +\
              "ZMQ task scheduling.  Task farming will be disabled."
        if arg_0.outstanding:
            arg_2 += " If you were running tasks when this happened, " +\
                   "some `outstanding` msg_ids may never resolve."
        warnings.warn(arg_2, RuntimeWarning)

Stop scheduling tasks because an engine has been unregistered from a pure ZMQ scheduler .


def Func(arg_0, arg_1):
    """
    Returns the front ID found in `front` at the given `index`.

    :param front:               An onset or offset front array of shape [nfrequencies, nsamples]
    :index:                     A tuple of the form (frequency index, sample index)
    :returns:                   The ID of the front or -1 if not found in `front` and the item at `onsets_or_offsets[index]`
                                is not a 1.
    """
    arg_2, arg_3 = arg_1
    arg_4 = arg_0[arg_2, arg_3]
    if arg_4 == 0:
        return -1
    else:
        return arg_4

Returns the front ID found in front at the given index .


def Func(arg_0) -> Generator[None, None, None]:
        """
        Perform delta step by writing stacked values to signals
        """
        arg_1 = arg_0._valuesToApply
        arg_0._applyValPlaned = False

        # log if there are items to log
        arg_3 = arg_0.config.logApplyingValues
        if arg_1 and arg_3:
            arg_3(arg_0, arg_1)
        arg_0._valuesToApply = []

        # apply values to signals, values can overwrite each other
        # but each signal should be driven by only one process and
        # it should resolve value collision
        arg_5 = arg_0._seqProcsToRun.append
        for arg_6, arg_7, arg_8, arg_9 in arg_1:
            if arg_8:
                # now=0 and this was process initialization or async reg
                arg_5(arg_9)
            else:
                # regular combinational process
                arg_6.simUpdateVal(arg_0, arg_7)

        arg_0._runCombProcesses()

        # processes triggered from simUpdateVal can add new values
        if arg_0._valuesToApply and not arg_0._applyValPlaned:
            arg_0._scheduleApplyValues()

        return
        yield


def Func(arg_0):
    """Restores the database from a snapshot"""
    arg_1 = get_app()

    if not arg_0:
        arg_2 = arg_1.get_latest_snapshot()
        if not arg_2:
            click.echo(
                "Couldn't find any snapshots for project %s" %
                load_config()['project_name']
            )
            sys.exit(1)
    else:
        arg_2 = arg_1.get_snapshot(arg_0)
        if not arg_2:
            click.echo(
                "Couldn't find snapshot with name %s.\n"
                "You can list snapshots with 'stellar list'" % arg_0
            )
            sys.exit(1)

    # Check if slaves are ready
    if not arg_2.slaves_ready:
        if arg_1.is_copy_process_running(arg_2):
            sys.stdout.write(
                'Waiting for background process(%s) to finish' %
                arg_2.worker_pid
            )
            sys.stdout.flush()
            while not arg_2.slaves_ready:
                sys.stdout.write('.')
                sys.stdout.flush()
                sleep(1)
                arg_1.db.session.refresh(arg_2)
            click.echo('')
        else:
            click.echo('Background process missing, doing slow Func.')
            arg_1.inline_slave_copy(arg_2)

    arg_1.Func(arg_2)
    click.echo('Restore complete.')


def Func ( arg_0 ) : arg_1 , arg_2 = TYPE_INFO_RE . match ( arg_0 ) . groups ( ) if arg_1 in ( 'list' , 'array' ) : if arg_2 is not None : arg_2 = arg_2 . strip ( ) if not arg_2 : arg_2 = 'str' arg_3 = TYPE_INFO_RE . match ( arg_2 ) if arg_3 : arg_2 = arg_3 . group ( 1 ) . lower ( ) return [ PARAM_TYPE_MAP . setdefault ( arg_2 , string_types ) ] return PARAM_TYPE_MAP . setdefault ( arg_1 , string_types )

def Func(arg_0):
    """
    Perform param type mapping
    This requires a bit of logic since this isn't standardized.
    If a type doesn't map, assume str
    """
    arg_1, arg_2 = TYPE_INFO_RE.match(arg_0).groups()

    if arg_1 in ('list', 'array'):
        # Handle no sub-type: "required list"
        if arg_2 is not None:
            arg_2 = arg_2.strip()

        if not arg_2:
            arg_2 = 'str'

        # Handle list of pairs: "optional list<pair<callsign, path>>"
        arg_3 = TYPE_INFO_RE.match(arg_2)
        if arg_3:
            arg_2 = arg_3.group(1).lower()

        return [PARAM_TYPE_MAP.setdefault(arg_2, string_types)]

    return PARAM_TYPE_MAP.setdefault(arg_1, string_types)

Perform param type mapping This requires a bit of logic since this isn t standardized . If a type doesn t map assume str


(self, handler_list, stanza, stanza_type = None)

def Func(arg_0, arg_1, arg_2, arg_3 = None):
        """ Search the handler list for handlers matching
        given stanza type and payload namespace. Run the
        handlers found ordering them by priority until
        the first one which returns `True`.

        :Parameters:
            - `handler_list`: list of available handlers
            - `stanza`: the stanza to handle
            - `stanza_type`: stanza type override (value of its "type"
              attribute)

        :return: result of the last handler or `False` if no
            handler was found.
        """
        # pylint: disable=W0212
        if arg_3 is None:
            arg_3 = arg_2.stanza_type
        arg_4 = arg_2.get_all_payload()
        arg_5 = [p.__class__ for p in arg_4]
        arg_6 = [(p.__class__, p.handler_key) for p in arg_4]
        for arg_7 in arg_1:
            arg_8 = arg_7._pyxmpp_stanza_handled[1]
            arg_9 = arg_7._pyxmpp_payload_class_handled
            arg_10 = arg_7._pyxmpp_payload_key
            if arg_8 != arg_3:
                continue
            if arg_9:
                if arg_10 is None and arg_9 not in arg_5:
                    continue
                if arg_10 and (arg_9, arg_10) not in arg_6:
                    continue
            arg_11 = arg_7(arg_2)
            if arg_0._process_handler_result(arg_11):
                return True
        return False

Search the handler list for handlers matching given stanza type and payload namespace . Run the handlers found ordering them by priority until the first one which returns True .


return response['Snapshot'] if response['Snapshot'] else None

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get_conn ( ) . Func ( SnapshotIdentifier = arg_1 , ClusterIdentifier = arg_2 , ) return arg_3 [ 'Snapshot' ] if arg_3 [ 'Snapshot' ] else None

def Func(arg_0, arg_1, arg_2):
        """
        Creates a snapshot of a cluster

        :param snapshot_identifier: unique identifier for a snapshot of a cluster
        :type snapshot_identifier: str
        :param cluster_identifier: unique identifier of a cluster
        :type cluster_identifier: str
        """
        arg_3 = arg_0.get_conn().Func(
            SnapshotIdentifier=arg_1,
            ClusterIdentifier=arg_2,
        )
        return arg_3['Snapshot'] if arg_3['Snapshot'] else None


def Func(arg_0, arg_1):
        """ Sets the style to the specified Pygments style.
        """
        if isinstance(arg_1, basestring):
            arg_1 = get_style_by_name(arg_1)
        arg_0._style = arg_1
        arg_0._clear_caches()

Sets the style to the specified Pygments style .


def Func():
    """
    Automatically includes all submodules and role selectors
    in the top-level fabfile using spooky-scary black magic.

    This allows us to avoid manually declaring imports for every module, e.g.

        import burlap.pip
        import burlap.vm
        import burlap...

    which has the added benefit of allowing us to manually call the commands
    without typing "burlap".

    This is soley for convenience. If not needed, it can be disabled
    by specifying the environment variable:

        export BURLAP_POPULATE_STACK=0
    """
    arg_0 = inspect.stack()
    arg_1 = None
    for arg_2, arg_3, arg_4, arg_5, arg_5, arg_5 in arg_0:
        if 'fabfile.py' in arg_3:
            arg_1 = arg_2
            break
    if not arg_1:
        return
    try:
        arg_6 = arg_1.f_locals
        for arg_7, arg_8 in sub_modules.items():
            arg_6[arg_7] = arg_8
        for arg_9, arg_10 in role_commands.items():
            assert arg_9 not in sub_modules, \
                ('The role %s conflicts with a built-in submodule. '
                 'Please choose a different name.') % (arg_9)
            arg_6[arg_9] = arg_10
        arg_6['common'] = common

        # Put all debug commands into the global namespace.

#         for _debug_name in debug.debug.get_tasks():
#             print('_debug_name:', _debug_name)

        arg_6['shell'] = shell#debug.debug.shell

        # Put all virtual satchels in the global namespace so Fabric can find them.
        for arg_11 in common.post_import_modules:
            exec("import %s" % arg_11) # pylint: disable=exec-used
            arg_6[arg_11] = locals()[arg_11]

    finally:
        del arg_0

Automatically includes all submodules and role selectors in the top - level fabfile using spooky - scary black magic .


(times, mags, errs, period,
                         knotfraction=0.01,
                         maxknots=30,
                         sigclip=30.0,
                         plotfit=False,
                         ignoreinitfail=False,
                         magsarefluxes=False,
                         verbose=True)

def Func(arg_0, arg_1, arg_2, arg_3,
                         arg_4=0.01,
                         arg_5=30,
                         arg_6=30.0,
                         arg_7=False,
                         arg_8=False,
                         arg_9=False,
                         arg_10=True):

    '''This fits a univariate cubic spline to the phased light curve.

    This fit may be better than the Fourier fit for sharply variable objects,
    like EBs, so can be used to distinguish them from other types of variables.

    Parameters
    ----------

    times,mags,errs : np.array
        The input mag/flux time-series to fit a spline to.

    period : float
        The period to use for the spline fit.

    knotfraction : float
        The knot fraction is the number of internal knots to use for the
        spline. A value of 0.01 (or 1%) of the total number of non-nan
        observations appears to work quite well, without over-fitting. maxknots
        controls the maximum number of knots that will be allowed.

    maxknots : int
        The maximum number of knots that will be used even if `knotfraction`
        gives a value to use larger than `maxknots`. This helps dealing with
        over-fitting to short time-scale variations.

    sigclip : float or int or sequence of two floats/ints or None
        If a single float or int, a symmetric sigma-clip will be performed using
        the number provided as the sigma-multiplier to cut out from the input
        time-series.

        If a list of two ints/floats is provided, the function will perform an
        'asymmetric' sigma-clip. The first element in this list is the sigma
        value to use for fainter flux/mag values; the second element in this
        list is the sigma value to use for brighter flux/mag values. For
        example, `sigclip=[10., 3.]`, will sigclip out greater than 10-sigma
        dimmings and greater than 3-sigma brightenings. Here the meaning of
        "dimming" and "brightening" is set by *physics* (not the magnitude
        system), which is why the `magsarefluxes` kwarg must be correctly set.

        If `sigclip` is None, no sigma-clipping will be performed, and the
        time-series (with non-finite elems removed) will be passed through to
        the output.

    magsarefluxes : bool
        If True, will treat the input values of `mags` as fluxes for purposes of
        plotting the fit and sig-clipping.

    plotfit : str or False
        If this is a string, this function will make a plot for the fit to the
        mag/flux time-series and writes the plot to the path specified here.

    ignoreinitfail : bool
        If this is True, ignores the initial failure to find a set of optimized
        Fourier parameters using the global optimization function and proceeds
        to do a least-squares fit anyway.

    verbose : bool
        If True, will indicate progress and warn of any problems.

    Returns
    -------

    dict
        This function returns a dict containing the model fit parameters, the
        minimized chi-sq value and the reduced chi-sq value. The form of this
        dict is mostly standardized across all functions in this module::

            {
                'fittype':'spline',
                'fitinfo':{
                    'nknots': the number of knots used for the fit
                    'fitmags': the model fit mags,
                    'fitepoch': the epoch of minimum light for the fit,
                },
                'fitchisq': the minimized value of the fit's chi-sq,
                'fitredchisq':the reduced chi-sq value,
                'fitplotfile': the output fit plot if fitplot is not None,
                'magseries':{
                    'times':input times in phase order of the model,
                    'phase':the phases of the model mags,
                    'mags':input mags/fluxes in the phase order of the model,
                    'errs':errs in the phase order of the model,
                    'magsarefluxes':input value of magsarefluxes kwarg
                }
            }

    '''

    # this is required to fit the spline correctly
    if arg_2 is None:
        arg_2 = npfull_like(arg_1, 0.005)

    # sigclip the magnitude time series
    arg_11, arg_12, arg_13 = sigclip_magseries(arg_0, arg_1, arg_2,
                                             arg_6=arg_6,
                                             arg_9=arg_9)
    # get rid of zero errs
    arg_14 = npnonzero(arg_13)
    arg_11, arg_12, arg_13 = arg_11[arg_14], arg_12[arg_14], arg_13[arg_14]

    # phase the mag series
    arg_15, arg_16, arg_17, arg_18, arg_19 = (
        get_phased_quantities(arg_11, arg_12, arg_13, arg_3)
    )

    # now figure out the number of knots up to max knots (=100)
    arg_20 = len(arg_15)
    arg_21 = int(npfloor(arg_4*arg_20))
    arg_21 = arg_5 if arg_21 > arg_5 else arg_21
    arg_22 = nplinspace(arg_15[0] + 0.01,
                             arg_15[-1] - 0.01,
                             num=arg_21)

    # NOTE: newer scipy needs x to be strictly increasing. this means we should
    # filter out anything that doesn't have np.diff(phase) > 0.0
    # FIXME: this needs to be tested
    arg_23 = npdiff(arg_15) > 0.0
    arg_24 = npconcatenate((nparray([True]), arg_23))
    arg_15, arg_16, arg_17 = (arg_15[arg_24],
                           arg_16[arg_24],
                           arg_17[arg_24])

    # generate and fit the spline
    arg_25 = LSQUnivariateSpline(arg_15, arg_16, t=arg_22, w=1.0/arg_17)

    # calculate the spline fit to the actual phases, the chisq and red-chisq
    arg_26 = arg_25(arg_15)

    arg_27 = npsum(
        ((arg_26 - arg_16)*(arg_26 - arg_16)) / (arg_17*arg_17)
    )

    arg_28 = arg_27/(len(arg_16) - arg_21 - 1)

    if arg_10:
        LOGINFO(
            'spline fit done. nknots = %s,  '
            'chisq = %.5f, reduced chisq = %.5f' %
            (arg_21, arg_27, arg_28)
        )

    # figure out the time of light curve minimum (i.e. the fit epoch)
    # this is when the fit mag is maximum (i.e. the faintest)
    # or if magsarefluxes = True, then this is when fit flux is minimum
    if not arg_9:
        arg_29 = npwhere(arg_26 == npmax(arg_26))
    else:
        arg_29 = npwhere(arg_26 == npmin(arg_26))
    if len(arg_29[0]) > 1:
        arg_29 = (arg_29[0][0],)
    arg_30 = arg_18[arg_29]

    # assemble the returndict
    arg_31 = {
        'fittype':'spline',
        'fitinfo':{
            'nknots':arg_21,
            'fitmags':arg_26,
            'fitepoch':arg_30
        },
        'fitchisq':arg_27,
        'fitredchisq':arg_28,
        'fitplotfile':None,
        'magseries':{
            'times':arg_18,
            'phase':arg_15,
            'mags':arg_16,
            'errs':arg_17,
            'magsarefluxes':arg_9
        },
    }

    # make the fit plot if required
    if arg_7 and isinstance(arg_7, str):

        make_fit_plot(arg_15, arg_16, arg_17, arg_26,
                      arg_3, arg_19, arg_30,
                      arg_7,
                      arg_9=arg_9)

        arg_31['fitplotfile'] = arg_7

    return arg_31

This fits a univariate cubic spline to the phased light curve .


return and_(
        files.c.name == name,
        files.c.user_id == user_id,
        files.c.parent_name == directory,
    )

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = split_api_filepath ( arg_1 ) return and_ ( files . c . name == arg_3 , files . c . user_id == arg_0 , files . c . parent_name == arg_2 , )

def Func(arg_0, arg_1):
    """
    Return a WHERE clause matching the given API path and user_id.
    """
    arg_2, arg_3 = split_api_filepath(arg_1)
    return and_(
        files.c.name == arg_3,
        files.c.user_id == arg_0,
        files.c.parent_name == arg_2,
    )

Return a WHERE clause matching the given API path and user_id .


def
Func
(
arg_0
,
arg_1
=
True
)
:
if
six
.
PY2
:
if
arg_0
.
endswith
(
'.pyc'
)
:
arg_0
=
arg_0
[
:
1
]
arg_2
=
abspath
(
expanduser
(
arg_0
)
)
if
arg_1
:
if
not
exists
(
arg_2
)
:
if
not
exists
(
arg_0
)
:
raise
ValueError
(
'modpath={} does not exist'
.
format
(
arg_0
)
)
raise
ValueError
(
'modpath={} is not a module'
.
format
(
arg_0
)
)
if
isdir
(
arg_2
)
and
not
exists
(
join
(
arg_0
,
'__init__.py'
)
)
:
raise
ValueError
(
'modpath={} is not a module'
.
format
(
arg_0
)
)
arg_3
,
arg_4
=
split
(
arg_2
)
arg_5
=
[
arg_4
]
arg_6
=
arg_3
while
exists
(
join
(
arg_6
,
'__init__.py'
)
)
:
arg_6
,
arg_7
=
split
(
arg_6
)
arg_5
.
append
(
arg_7
)
arg_8
=
arg_5
[
:
:
1
]
arg_9
=
os
.
path
.
sep
.
join
(
arg_8
)
return
arg_6
,
arg_9

def Func(arg_0, arg_1=True):
    """
    Splits the modpath into the dir that must be in PYTHONPATH for the module
    to be imported and the modulepath relative to this directory.

    Args:
        modpath (str): module filepath
        check (bool): if False, does not raise an error if modpath is a
            directory and does not contain an `__init__.py` file.

    Returns:
        tuple: (directory, rel_modpath)

    Raises:
        ValueError: if modpath does not exist or is not a package

    Example:
        >>> from xdoctest import static_analysis
        >>> modpath = static_analysis.__file__.replace('.pyc', '.py')
        >>> modpath = abspath(modpath)
        >>> dpath, rel_modpath = Func(modpath)
        >>> recon = join(dpath, rel_modpath)
        >>> assert recon == modpath
        >>> assert rel_modpath == join('xdoctest', 'static_analysis.py')
    """
    if six.PY2:
        if arg_0.endswith('.pyc'):
            arg_0 = arg_0[:-1]
    arg_2 = abspath(expanduser(arg_0))
    if arg_1:
        if not exists(arg_2):
            if not exists(arg_0):
                raise ValueError('modpath={} does not exist'.format(arg_0))
            raise ValueError('modpath={} is not a module'.format(arg_0))
        if isdir(arg_2) and not exists(join(arg_0, '__init__.py')):
            # dirs without inits are not modules
            raise ValueError('modpath={} is not a module'.format(arg_0))
    arg_3, arg_4 = split(arg_2)
    arg_5 = [arg_4]
    # Recurse down directories until we are out of the package
    arg_6 = arg_3
    while exists(join(arg_6, '__init__.py')):
        arg_6, arg_7 = split(arg_6)
        arg_5.append(arg_7)
    arg_8 = arg_5[::-1]
    arg_9 = os.path.sep.join(arg_8)
    return arg_6, arg_9

Splits the modpath into the dir that must be in PYTHONPATH for the module
    to be imported and the modulepath relative to this directory.

    Args:
        modpath (str): module filepath
        check (bool): if False, does not raise an error if modpath is a
            directory and does not contain an `__init__.py` file.

    Returns:
        tuple: (directory, rel_modpath)

    Raises:
        ValueError: if modpath does not exist or is not a package

    Example:
        >>> from xdoctest import static_analysis
        >>> modpath = static_analysis.__file__.replace('.pyc', '.py')
        >>> modpath = abspath(modpath)
        >>> dpath, rel_modpath = split_modpath(modpath)
        >>> recon = join(dpath, rel_modpath)
        >>> assert recon == modpath
        >>> assert rel_modpath == join('xdoctest', 'static_analysis.py')

Splits the modpath into the dir that must be in PYTHONPATH for the module to be imported and the modulepath relative to this directory .


def Func(arg_0):
        """
        Start connection and initialize session services
        """

        # flush event queue in defensive way
        arg_1 = _get_logger(arg_0.debug)
        arg_2 = arg_0._session.Func()
        if arg_2:
            arg_3 = arg_0._session.nextEvent()
            arg_4 = _EVENT_DICT[arg_3.eventType()]
            arg_1.info('Event Type: {!r}'.format(arg_4))
            for arg_5 in arg_3:
                arg_1.info('Message Received:\n{}'.format(arg_5))
            if arg_3.eventType() != blpapi.Event.SESSION_STATUS:
                raise RuntimeError('Expected a "SESSION_STATUS" event but '
                                   'received a {!r}'.format(arg_4))
            arg_3 = arg_0._session.nextEvent()
            arg_4 = _EVENT_DICT[arg_3.eventType()]
            arg_1.info('Event Type: {!r}'.format(arg_4))
            for arg_5 in arg_3:
                arg_1.info('Message Received:\n{}'.format(arg_5))
            if arg_3.eventType() != blpapi.Event.SESSION_STATUS:
                raise RuntimeError('Expected a "SESSION_STATUS" event but '
                                   'received a {!r}'.format(arg_4))
        else:
            arg_3 = arg_0._session.nextEvent(arg_0.timeout)
            if arg_3.eventType() == blpapi.Event.SESSION_STATUS:
                for arg_5 in arg_3:
                    arg_1.warning('Message Received:\n{}'.format(arg_5))
                raise ConnectionError('Could not Func blpapi.Session')
        arg_0._init_services()
        return arg_0


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
"C {},,,,{},\r\n"
.
format
(
arg_0
.
_zid
,
arg_1
)
arg_3
=
arg_0
.
_hub
.
send_command
(
arg_2
)
_LOGGER
.
debug
(
"Set brightness %s: %s"
,
repr
(
arg_2
)
,
arg_3
)
return
arg_3

def Func(arg_0, arg_1):
        """Set brightness of bulb."""
        arg_2 = "C {},,,,{},\r\n".format(arg_0._zid, arg_1)
        arg_3 = arg_0._hub.send_command(arg_2)
        _LOGGER.debug("Set brightness %s: %s", repr(arg_2), arg_3)
        return arg_3


(topics_words, alpha, vocabulary,
                       topics_to_print=10, words_per_topic=10)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
10
,
arg_4
=
10
)
:
arg_1
=
np
.
squeeze
(
arg_1
,
axis
=
0
)
arg_5
=
np
.
argsort
(
arg_1
,
kind
=
"mergesort"
)
arg_6
=
np
.
argsort
(
arg_0
,
axis
=
1
)
arg_7
=
[
]
for
arg_8
in
arg_5
[
:
arg_3
]
:
arg_9
=
[
"index={} alpha={:.2f}"
.
format
(
arg_8
,
arg_1
[
arg_8
]
)
]
arg_9
+=
[
arg_2
[
arg_10
]
for
arg_10
in
arg_6
[
arg_8
,
:
arg_4
]
]
arg_7
.
append
(
" "
.
join
(
arg_9
)
)
return
np
.
array
(
arg_7
)

def Func(arg_0, arg_1, arg_2,
                       arg_3=10, arg_4=10):
  """Returns the summary of the learned topics.

  Arguments:
    topics_words: KxV tensor with topics as rows and words as columns.
    alpha: 1xK tensor of prior Dirichlet concentrations for the
        topics.
    vocabulary: A mapping of word's integer index to the corresponding string.
    topics_to_print: The number of topics with highest prior weight to
        summarize.
    words_per_topic: Number of wodrs per topic to return.

  Returns:
    summary: A np.array with strings.
  """
  arg_1 = np.squeeze(arg_1, axis=0)
  # Use a stable sorting algorithm so that when alpha is fixed
  # we always get the same topics.
  arg_5 = np.argsort(-arg_1, kind="mergesort")
  arg_6 = np.argsort(-arg_0, axis=1)

  arg_7 = []
  for arg_8 in arg_5[:arg_3]:
    arg_9 = ["index={} alpha={:.2f}".format(arg_8, arg_1[arg_8])]
    arg_9 += [arg_2[arg_10] for arg_10 in arg_6[arg_8, :arg_4]]
    arg_7.append(" ".join(arg_9))

  return np.array(arg_7)

Returns the summary of the learned topics .


def Func ( arg_0 ) : try : arg_1 = getattr ( arg_0 , '_decoding_cache' ) except Exception : arg_1 = arg_0 . _decoding_cache = { } arg_2 = arg_0 . pc if isinstance ( arg_2 , Constant ) : arg_2 = arg_2 . value if arg_2 in arg_1 : return arg_1 [ arg_2 ] def getcode ( ) : arg_3 = arg_0 . bytecode for arg_4 in range ( arg_2 , len ( arg_3 ) ) : yield simplify ( arg_3 [ arg_4 ] ) . value while True : yield 0 Func = EVMAsm . disassemble_one ( getcode ( ) , arg_2 = arg_2 , fork = DEFAULT_FORK ) arg_1 [ arg_2 ] = Func return Func

def Func(arg_0):
        """
        Current instruction pointed by self.pc
        """
        # FIXME check if pc points to invalid instruction
        # if self.pc >= len(self.bytecode):
        #    return InvalidOpcode('Code out of range')
        # if self.pc in self.invalid:
        #    raise InvalidOpcode('Opcode inside a PUSH immediate')
        try:
            arg_1 = getattr(arg_0, '_decoding_cache')
        except Exception:
            arg_1 = arg_0._decoding_cache = {}

        arg_2 = arg_0.pc
        if isinstance(arg_2, Constant):
            arg_2 = arg_2.value

        if arg_2 in arg_1:
            return arg_1[arg_2]

        def getcode():
            arg_3 = arg_0.bytecode
            for arg_4 in range(arg_2, len(arg_3)):
                yield simplify(arg_3[arg_4]).value
            while True:
                yield 0
        Func = EVMAsm.disassemble_one(getcode(), arg_2=arg_2, fork=DEFAULT_FORK)
        arg_1[arg_2] = Func
        return Func

Current instruction pointed by self . pc


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . urlopen ( ) . fp while 1 : try : arg_1 . Func ( arg_2 . next ( ) ) except StopIteration : return

def Func(arg_0, arg_1):
        """
        Writes out PNG image data in chunks to file pointer fp

        fp must support w or wb
        """
        arg_2 = arg_0.urlopen().fp
        while 1:
            try:
                arg_1.Func(arg_2.next())
            except StopIteration:
                return


def Func(arg_0, arg_1):
        """visit an astroid.Import node

        resolve module dependencies
        """
        arg_2 = arg_1.root().file
        for arg_3 in arg_1.names:
            arg_4 = modutils.is_relative(arg_3[0], arg_2)
            arg_0._imported_module(arg_1, arg_3[0], arg_4)


(self, datacenter_id,
                                loadbalancer_id, nic_id)

def Func(arg_0, arg_1,
                                arg_2, arg_3):
        """
        Removes a NIC from the load balancer.

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

        :param      loadbalancer_id: The unique ID of the load balancer.
        :type       loadbalancer_id: ``str``

        :param      nic_id: The unique ID of the NIC.
        :type       nic_id: ``str``

        """
        arg_4 = arg_0._perform_request(
            url='/datacenters/%s/loadbalancers/%s/balancednics/%s' % (
                arg_1,
                arg_2,
                arg_3),
            method='DELETE')

        return arg_4


def Func(arg_0):
    """
    This method increases the permanence values of synapses of columns whose
    activity level has been too low. Such columns are identified by having an
    overlap duty cycle that drops too much below those of their peers. The
    permanence values for such columns are increased.
    """
    arg_1 = numpy.where(arg_0._overlapDutyCycles
                                < arg_0._minOverlapDutyCycles)[0]
    for arg_2 in arg_1:
      arg_3 = arg_0._permanences[arg_2].astype(realDType)
      arg_4 = numpy.where(arg_0._potentialPools[arg_2] > 0)[0]
      arg_3[arg_4] += arg_0._synPermBelowStimulusInc
      arg_0._updatePermanencesForColumn(arg_3, arg_2, raisePerm=False)

This method increases the permanence values of synapses of columns whose activity level has been too low . Such columns are identified by having an overlap duty cycle that drops too much below those of their peers . The permanence values for such columns are increased .


def Func ( arg_0 ) : for arg_1 in arg_0 . _children : arg_0 . _children [ arg_1 ] . Func ( ) if arg_0 . _Func : arg_0 . remove ( True )

def Func(arg_0):
        """
        Clean up children and remove the directory.

        Directory will only be removed if the Func flag is set.
        """
        for arg_1 in arg_0._children:
            arg_0._children[arg_1].Func()

        if arg_0._Func:
            arg_0.remove(True)

Clean up children and remove the directory.

        Directory will only be removed if the cleanup flag is set.

Clean up children and remove the directory .


def Func(arg_0):
        """
        Returns a list of locations.

        http://dev.wheniwork.com/#listing-locations
        """
        arg_1 = "/2/locations"

        arg_2 = arg_0._get_resource(arg_1)
        arg_3 = []
        for arg_4 in arg_2['locations']:
            arg_3.append(arg_0.location_from_json(arg_4))

        return arg_3


def Func(arg_0, arg_1):
        """Update the internal line and column buffers after a new character
        is added.

        The column number is set to 0, so the first character on the next line
        is column number 1."""
        if newline_chars.match(arg_1):
            arg_0._col.append(0)
            arg_0._line.append(arg_0._line[-1] + 1)
        else:
            arg_0._col.append(arg_0._col[-1] + 1)
            arg_0._line.append(arg_0._line[-1])

Update the internal line and column buffers after a new character is added .


def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def delegator ( arg_1 , * arg_2 , ** arg_3 ) : if arg_1 . Func : arg_4 = getattr ( arg_1 , 'inst' , None ) if arg_4 is not None : arg_5 = ( arg_1 . delegator_prefix or '' ) + arg_0 . __name__ arg_6 = getattr ( arg_4 , arg_5 , None ) if arg_6 is not None : return arg_6 ( * arg_2 , ** arg_3 ) return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) return delegator

def Func(arg_0):
    '''This decorator wraps descriptor methods with a new method that tries
    to delegate to a function of the same name defined on the owner instance
    for convenience for dispatcher clients.
    '''
    @functools.wraps(arg_0)
    def delegator(arg_1, *arg_2, **arg_3):
        if arg_1.Func:
            # Try to dispatch to the instance's implementation.
            arg_4 = getattr(arg_1, 'inst', None)
            if arg_4 is not None:
                arg_5 = (arg_1.delegator_prefix or '') + arg_0.__name__
                arg_6 = getattr(arg_4, arg_5, None)
                if arg_6 is not None:
                    return arg_6(*arg_2, **arg_3)

        # Otherwise run the decorated func.
        return arg_0(arg_1, *arg_2, **arg_3)

    return delegator

This decorator wraps descriptor methods with a new method that tries to delegate to a function of the same name defined on the owner instance for convenience for dispatcher clients .


def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = get_app_wx ( ) if hasattr ( arg_0 , '_in_event_loop' ) : return arg_0 . _in_event_loop else : return arg_0 . IsMainLoopRunning ( )

def Func(arg_0=None):
    """Is the wx event loop running."""
    if arg_0 is None:
        arg_0 = get_app_wx()
    if hasattr(arg_0, '_in_event_loop'):
        return arg_0._in_event_loop
    else:
        return arg_0.IsMainLoopRunning()


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : return arg_1 * np . exp ( - arg_0 / arg_2 ) + arg_3

def Func(arg_0, arg_1, arg_2, arg_3):
    """Function used to fit the exponential decay."""
    # pylint: disable=invalid-name
    return arg_1 * np.exp(-arg_0 / arg_2) + arg_3

Function used to fit the exponential decay .


(thing, query, from_date, file_prefix, chunk_size, limit, thing_flags)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
    """Dump data from Invenio legacy."""
    init_app_context()

    arg_3 = arg_3 if arg_3 else '{0}_Func'.format(arg_0)

    arg_7 = dict((f.strip('-').replace('-', '_'), True) for f in arg_6)

    try:
        arg_8 = collect_things_entry_points()[arg_0]
    except KeyError:
        click.Abort(
            '{0} is not in the list of available things to migrate: '
            '{1}'.format(arg_0, collect_things_entry_points()))

    click.echo("Querying {0}...".format(arg_0))
    arg_9, arg_10 = arg_8.get(arg_1, arg_2, arg_5=arg_5, **arg_7)

    arg_11 = 0  # Progress bar counter
    click.echo("Dumping {0}...".format(arg_0))
    with click.progressbar(length=arg_9) as bar:
        for arg_12, arg_13 in enumerate(grouper(arg_10, arg_4)):
            with open('{0}_{1}.json'.format(arg_3, arg_12), 'w') as fp:
                fp.write("[\n")
                for arg_14 in arg_13:
                    try:
                        json.Func(
                            arg_8.Func(arg_14, arg_2, **arg_7),
                            fp,
                            default=set_serializer
                        )
                        fp.write(",")
                    except Exception as e:
                        click.secho("Failed Func {0} {1} ({2})".format(
                            arg_0, arg_14, e.message), fg='red')
                    arg_11 += 1
                    bar.update(arg_11)

                # Strip trailing comma.
                fp.seek(fp.tell()-1)
                fp.write("\n]")


def Func(arg_0, arg_1, arg_2, arg_3):
        """Configure any additional default transport zone bindings."""
        arg_4 = CONF.NVP.default_tz

        # If there is no default tz specified it's pointless to try
        # and add any additional default tz bindings.
        if not arg_4:
            LOG.warn("additional_default_tz_types specified, "
                     "but no default_tz. Skipping "
                     "Func().")
            return

        # This should never be called without a neutron network uuid,
        # we require it to bind some segment allocations.
        if not arg_3:
            LOG.warn("neutron network_id not specified, skipping "
                     "Func()")
            return

        for arg_5 in CONF.NVP.additional_default_tz_types:
            if arg_5 in TZ_BINDINGS:
                arg_6 = TZ_BINDINGS[arg_5]
                arg_6.add(arg_1, arg_2, arg_4, arg_3)
            else:
                LOG.warn("Unknown default tz type %s" % (arg_5))

Configure any additional default transport zone bindings .


(self, name, label, location, description=None)

return self._perform_post(
            '/' + self.subscription_id + '/affinitygroups',
            _XmlSerializer.create_affinity_group_to_xml(name,
                                                        label,
                                                        description,
                                                        location))

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        '''
        Creates a new affinity group for the specified subscription.

        name:
            A name for the affinity group that is unique to the subscription.
        label:
            A name for the affinity group. The name can be up to 100 characters
            in length.
        location:
            The data center location where the affinity group will be created.
            To list available locations, use the list_location function.
        description:
            A description for the affinity group. The description can be up to
            1024 characters in length.
        '''
        _validate_not_none('name', arg_1)
        _validate_not_none('label', arg_2)
        _validate_not_none('location', arg_3)
        return arg_0._perform_post(
            '/' + arg_0.subscription_id + '/affinitygroups',
            _XmlSerializer.Func_to_xml(arg_1,
                                                        arg_2,
                                                        arg_4,
                                                        arg_3))

Creates a new affinity group for the specified subscription .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . vocabulary_ arg_3 = _make_int_array ( ) arg_4 = _make_int_array ( ) arg_4 . append ( 0 ) for arg_5 in arg_1 : for arg_6 in arg_5 : try : arg_3 . append ( arg_2 [ arg_6 ] ) except KeyError : continue arg_4 . append ( len ( arg_3 ) ) arg_3 = frombuffer_empty ( arg_3 , dtype = np . intc ) arg_4 = np . frombuffer ( arg_4 , dtype = np . intc ) arg_7 = np . ones ( len ( arg_3 ) ) arg_8 = sp . csr_matrix ( ( arg_7 , arg_3 , arg_4 ) , shape = ( len ( arg_4 ) - 1 , len ( arg_2 ) ) , dtype = arg_0 . dtype ) arg_8 . sum_duplicates ( ) if arg_0 . binary : arg_8 . data . fill ( 1 ) return arg_8

def Func(arg_0, arg_1):
        """Create sparse feature matrix, and vocabulary where fixed_vocab=False
        """
        arg_2 = arg_0.vocabulary_
        arg_3 = _make_int_array()
        arg_4 = _make_int_array()
        arg_4.append(0)
        for arg_5 in arg_1:
            for arg_6 in arg_5:
                try:
                    arg_3.append(arg_2[arg_6])
                except KeyError:
                    # Ignore out-of-vocabulary items for fixed_vocab=True
                    continue
            arg_4.append(len(arg_3))

        arg_3 = frombuffer_empty(arg_3, dtype=np.intc)
        arg_4 = np.frombuffer(arg_4, dtype=np.intc)
        arg_7 = np.ones(len(arg_3))

        arg_8 = sp.csr_matrix((arg_7, arg_3, arg_4),
                          shape=(len(arg_4) - 1, len(arg_2)),
                          dtype=arg_0.dtype)
        arg_8.sum_duplicates()

        if arg_0.binary:
            arg_8.data.fill(1)

        return arg_8

Create sparse feature matrix and vocabulary where fixed_vocab = False


def Func(arg_0):
        """
        List of Func of this slack team
        """
        if not arg_0._Func:
            arg_0._Func = arg_0._call_api('Func.list')['members']
        return arg_0._Func


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] if not arg_0 . options . add_issues_wo_labels : for arg_3 in arg_1 : if not arg_3 [ 'labels' ] : arg_2 . append ( arg_3 ) return arg_2

def Func(arg_0, arg_1):
        """
        Filter all issues that don't have a label.

        :rtype: list(dict)
        :return: Issues without labels.
        """

        arg_2 = []
        if not arg_0.options.add_issues_wo_labels:
            for arg_3 in arg_1:
                if not arg_3['labels']:
                    arg_2.append(arg_3)
        return arg_2

Filter all issues that don t have a label .


def Func(arg_0,arg_1):
		'''It will download file specified by url using requests module'''
		arg_2=arg_1.split('/')[-1]

		if os.path.exists(os.path.join(os.getcwd(),arg_2)):
			print 'File already exists'
			return
		#print 'Downloading file %s '%file_name
		#print 'Downloading from %s'%url

		try:
			arg_3=requests.get(arg_1,stream=True,timeout=200)
		except requests.exceptions.SSLError:
			try:
				arg_4=requests.get(arg_1,stream=True,verify=False,timeout=200)
			except requests.exceptions.RequestException as e:
				print e
				quit()
		except requests.exceptions.RequestException as e:
				print e
				quit()
		arg_5 = 1024
		arg_6 = int(arg_3.headers['Content-Length'])
		arg_7 = arg_6/arg_5

		arg_8 = arg_3.iter_content(arg_5 = arg_5)
		arg_9 = tqdm(iterable = arg_8,total = arg_7,unit = 'KB',
			leave = False
			)
		with open(arg_2,'wb') as f:
			for arg_10 in arg_9:
				f.write(arg_10)

		#total_size=float(r.headers['Content-Length'])/(1024*1024)
		'''print 'Total size of file to be downloaded %.2f MB '%total_size
		total_downloaded_size=0.0
		with open(file_name,'wb') as f:
			for chunk in r.iter_content(chunk_size=1*1024*1024):
				if chunk:
					size_of_chunk=float(len(chunk))/(1024*1024)
					total_downloaded_size+=size_of_chunk
					print '{0:.0%} Downloaded'.format(total_downloaded_size/total_size)
					f.write(chunk)'''

		print 'Downloaded file %s '%arg_2


def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
'us-west1-a'
)
:
arg_3
=
[
]
arg_4
=
arg_0
.
_get_instances
(
arg_1
,
arg_2
)
for
arg_5
in
arg_4
[
'items'
]
:
arg_3
.
append
(
[
arg_5
[
'name'
]
,
arg_5
[
'status'
]
]
)
bot
.
info
(
"[google-compute] Found %s instances"
%
(
len
(
arg_3
)
)
)
bot
.
table
(
arg_3
)
bot
.
newline
(
)

def Func(arg_0, arg_1=None, arg_2='us-west1-a'):
    '''list builders, or instances for the project. They should start with
       sregistry-builder

       Parameters
       ==========
       project: specify a project, will default to environment first
       zone: the zone to use, defaults to us-west1-a if environment not set

    '''
    arg_3 = []
    arg_4 = arg_0._get_instances(arg_1, arg_2)

    for arg_5 in arg_4['items']:
        arg_3.append([arg_5['name'], arg_5['status']])

    bot.info("[google-compute] Found %s instances" %(len(arg_3)))
    bot.table(arg_3)
    bot.newline()

list builders or instances for the project . They should start with sregistry - builder


return (path + args).encode('ascii', 'ignore')

def Func ( * arg_0 , ** arg_1 ) : arg_2 = request . path arg_0 = str ( hash ( frozenset ( request . args . items ( ) ) ) ) return ( arg_2 + arg_0 ) . encode ( 'ascii' , 'ignore' )

def Func(*arg_0, **arg_1):
    """
    Used by cache to get a unique key per URL
    """
    arg_2 = request.path
    arg_0 = str(hash(frozenset(request.args.items())))
    return (arg_2 + arg_0).encode('ascii', 'ignore')


def Func(arg_0, arg_1, arg_2):
    """
    Task to send content metadata to each linked integrated channel.

    Arguments:
        username (str): The username of the User to be used for making API requests to retrieve content metadata.
        channel_code (str): Capitalized identifier for the integrated channel.
        channel_pk (str): Primary key for identifying integrated channel.

    """
    arg_3 = time.time()
    arg_4 = User.objects.get(arg_0=arg_0)
    arg_5 = INTEGRATED_CHANNEL_CHOICES[arg_1].objects.get(pk=arg_2)
    LOGGER.info('Transmitting content metadata to integrated channel using configuration: [%s]', arg_5)
    try:
        arg_5.Func(arg_4)
    except Exception:  # pylint: disable=broad-except
        LOGGER.exception(
            'Transmission of content metadata failed for user [%s] and for integrated '
            'channel with code [%s] and id [%s].', arg_0, arg_1, arg_2
        )
    arg_6 = time.time() - arg_3
    LOGGER.info(
        'Content metadata transmission task for integrated channel configuration [%s] took [%s] seconds',
        arg_5,
        arg_6
    )

Task to send content metadata to each linked integrated channel .


def Func ( arg_0 , arg_1 ) : if os . path . getsize ( arg_0 ) > arg_1 : return False else : return True

def Func(arg_0, arg_1):
    """
    Checks file sizes for host
    """
    if os.path.getsize(arg_0) > arg_1:
        return False
    else:
        return True


def Func(arg_0, arg_1="barplot", **arg_2):
        """
        Produce the scree plot.

        Library ``matplotlib`` is required for this function.

        :param str type: either ``"barplot"`` or ``"lines"``.
        """
        # check for matplotlib. exit if absent.
        arg_3 = arg_2.pop("server")
        if arg_2:
            raise ValueError("Unknown arguments %s to Func()" % ", ".join(arg_2.keys()))
        try:
            import matplotlib
            if arg_3: matplotlib.use('Agg', warn=False)
            import matplotlib.pyplot as plt
        except ImportError:
            print("matplotlib is required for this function!")
            return

        arg_4 = [s ** 2 for s in arg_0._model_json['output']['importance'].cell_values[0][1:]]
        plt.xlabel('Components')
        plt.ylabel('Variances')
        plt.title('Scree Plot')
        plt.xticks(list(range(1, len(arg_4) + 1)))
        if arg_1 == "barplot":
            plt.bar(list(range(1, len(arg_4) + 1)), arg_4)
        elif arg_1 == "lines":
            plt.plot(list(range(1, len(arg_4) + 1)), arg_4, 'b--')
        if not arg_3: plt.show()


def Func(arg_0: arg_1) -> IMeta:
    """Read metadata and apply that to the next object in the
    input stream."""
    arg_2 = arg_0.reader.advance()
    assert arg_2 == "^"
    arg_3 = _read_next_consuming_comment(arg_0)

    arg_4: Optional[lmap.Map[LispForm, LispForm]] = None
    if isinstance(arg_3, symbol.Symbol):
        arg_4 = lmap.map({keyword.keyword("tag"): arg_3})
    elif isinstance(arg_3, keyword.Keyword):
        arg_4 = lmap.map({arg_3: True})
    elif isinstance(arg_3, lmap.Map):
        arg_4 = arg_3
    else:
        raise SyntaxError(
            f"Expected symbol, keyword, or map for metadata, not {type(meta)}"
        )

    arg_5 = _read_next_consuming_comment(arg_0)
    try:
        return arg_5.with_meta(arg_4)  # type: ignore
    except AttributeError:
        raise SyntaxError(
            f"Can not attach metadata to object of type {type(obj_with_meta)}"
        )

Read metadata and apply that to the next object in the input stream .


return _get_files(file_patterns, pjoin(HERE, root))

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = [ '*' ] return _get_files ( arg_1 , pjoin ( HERE , arg_0 ) )

def Func(arg_0, arg_1=None):
    """Expand file patterns to a list of `package_data` paths.

    Parameters
    -----------
    root: str
        The relative path to the package root from `HERE`.
    file_patterns: list or str, optional
        A list of glob patterns for the data file locations.
        The globs can be recursive if they include a `**`.
        They should be relative paths from the root or
        absolute paths.  If not given, all files will be used.

    Note:
    Files in `node_modules` are ignored.
    """
    if arg_1 is None:
        arg_1 = ['*']
    return _get_files(arg_1, pjoin(HERE, arg_0))

Expand file patterns to a list of package_data paths .


def Func(arg_0, arg_1, arg_2=None):
        """
        Receive data on the connection.

        :param bufsiz: The maximum number of bytes to read
        :param flags: (optional) The only supported flag is ``MSG_PEEK``,
            all other flags are ignored.
        :return: The string read from the Connection
        """
        arg_3 = _no_zero_allocator("char[]", arg_1)
        if arg_2 is not None and arg_2 & socket.MSG_PEEK:
            arg_4 = _lib.SSL_peek(arg_0._ssl, arg_3, arg_1)
        else:
            arg_4 = _lib.SSL_read(arg_0._ssl, arg_3, arg_1)
        arg_0._raise_ssl_error(arg_0._ssl, arg_4)
        return _ffi.buffer(arg_3, arg_4)[:]


def
Func
(
arg_0
)
:
arg_1
=
callBigDlFunc
(
arg_0
.
bigdl_type
,
"getWeights"
,
arg_0
.
value
)
if
arg_1
is
not
:
return
[
arg_2
.
to_ndarray
(
)
for
arg_2
in
arg_1
]
else
:
print
(
"The layer does not have weight/bias"
)
return

def Func(arg_0):
        """
        Get weights for this layer

        :return: list of numpy arrays which represent weight and bias
        """
        arg_1 = callBigDlFunc(arg_0.bigdl_type,
                              "getWeights", arg_0.value)
        if arg_1 is not None:
            return [arg_2.to_ndarray() for arg_2 in arg_1]
        else:
            print("The layer does not have weight/bias")
            return None


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
local_renderer
with
arg_0
.
settings
(
warn_only
=
True
)
:
arg_1
.
sudo
(
'pkill -9 -f celery'
)
arg_1
.
sudo
(
'rm -f /tmp/celery*.pid'
)

def Func(arg_0):
        """
        Forcibly terminates all Celery processes.
        """
        arg_1 = arg_0.local_renderer
        with arg_0.settings(warn_only=True):
            arg_1.sudo('pkill -9 -f celery')
        arg_1.sudo('rm -f /tmp/celery*.pid')

Forcibly terminates all Celery processes .


def
Func
(
arg_0
)
:
if
os
.
path
.
exists
(
arg_0
)
:
return
False
else
:
open
(
arg_0
,
'a+b'
)
.
close
(
)
logger
.
info
(
'Credential file {0} created'
.
format
(
arg_0
)
)
return
True

def Func(arg_0):
    """Creates the an empty file if it does not already exist.

    Returns:
        True if the file was created, False otherwise.
    """
    if os.path.exists(arg_0):
        return False
    else:
        # Equivalent to "touch".
        open(arg_0, 'a+b').close()
        logger.info('Credential file {0} created'.format(arg_0))
        return True

Creates the an empty file if it does not already exist .


def Func(arg_0, arg_1):
    """Allocate or reallocate a scaling IP.

    :param context: neutron api request context.
    :param content: dictionary describing the scaling ip, with keys
        as listed in the RESOURCE_ATTRIBUTE_MAP object in
        neutron/api/v2/attributes.py.  All keys will be populated.

    :returns: Dictionary containing details for the new scaling IP.  If values
        are declared in the fields parameter, then only those keys will be
        present.
    """
    LOG.info('Func for tenant %s and body %s',
             arg_0.tenant_id, arg_1)
    arg_2 = arg_1.get('scaling_network_id')
    arg_3 = arg_1.get('scaling_ip_address')
    arg_4 = arg_1.get('ports', [])

    arg_5 = _get_network(arg_0, arg_2)
    arg_6 = {}
    for arg_7 in arg_4:
        arg_8 = _get_port(arg_0, arg_7['port_id'])
        arg_9 = _get_fixed_ip(arg_0, arg_7.get('fixed_ip_address'),
                                 arg_8)
        arg_6[arg_8.id] = {"port": arg_8, "fixed_ip": arg_9}
    arg_11 = _allocate_ip(arg_0, arg_5, None, arg_3, ip_types.SCALING)
    _create_flip(arg_0, arg_11, arg_6)
    return v._make_scaling_ip_dict(arg_11)


def Func ( arg_0 , arg_1 ) : arg_0 . clear ( ) arg_0 . add_node ( arg_1 , root = True ) for arg_2 , arg_3 in arg_0 . get_links ( arg_1 ) : arg_0 . add_edge ( arg_1 , arg_3 , weight = arg_2 ) if len ( arg_0 ) > arg_0 . max : break for arg_2 , arg_3 , arg_4 in arg_0 . get_cluster ( arg_1 ) : for arg_5 in arg_4 : arg_0 . add_edge ( arg_5 , arg_3 , weight = arg_2 ) arg_0 . add_edge ( arg_1 , arg_5 , weight = arg_2 ) if len ( arg_0 ) > arg_0 . max : break if arg_0 . event . clicked : g . add_node ( arg_0 . event . clicked )

def Func(arg_0, arg_1):

        """ Rebuilds the graph around the given node id.
        """

        arg_0.clear()

        # Root node.
        arg_0.add_node(arg_1, root=True)

        # Directly connected nodes have priority.
        for arg_2, arg_3 in arg_0.get_links(arg_1):
            arg_0.add_edge(arg_1, arg_3, weight=arg_2)
            if len(arg_0) > arg_0.max:
                break

        # Now get all the other nodes in the cluster.
        for arg_2, arg_3, arg_4 in arg_0.get_cluster(arg_1):
            for arg_5 in arg_4:
                arg_0.add_edge(arg_5, arg_3, weight=arg_2)
                arg_0.add_edge(arg_1, arg_5, weight=arg_2)
            #if len(links) == 0:
            #    self.add_edge(id, id2)
            if len(arg_0) > arg_0.max:
                break

        # Provide a backlink to the previous root.
        if arg_0.event.clicked:
            g.add_node(arg_0.event.clicked)

Rebuilds the graph around the given node id .


(self, tmaster, component_name, instances=[], callback=None)

def Func(arg_0, arg_1, arg_2, arg_3=[], arg_4=None):
    """
    Get the summary of exceptions for component_name and list of instances.
    Empty instance list will fetch all exceptions.
    """
    if not arg_1 or not arg_1.host or not arg_1.stats_port:
      return
    arg_5 = tmaster_pb2.ExceptionLogRequest()
    arg_5.component_name = arg_2
    if len(arg_3) > 0:
      arg_5.instances.extend(arg_3)
    arg_6 = arg_5.SerializeToString()
    arg_7 = str(arg_1.stats_port)
    arg_8 = arg_1.host
    arg_9 = "http://{0}:{1}/exceptionsummary".format(arg_8, arg_7)
    Log.debug("Creating request object.")
    arg_10 = tornado.httpclient.HTTPRequest(arg_9,
                                             body=arg_6,
                                             method='POST',
                                             request_timeout=5)
    Log.debug('Making HTTP call to fetch exceptionsummary url: %s', arg_9)
    try:
      arg_11 = tornado.httpclient.AsyncHTTPClient()
      arg_12 = yield arg_11.fetch(arg_10)
      Log.debug("HTTP call complete.")
    except tornado.httpclient.HTTPError as e:
      raise Exception(str(e))

    # Check the response code - error if it is in 400s or 500s
    arg_13 = arg_12.code
    if arg_13 >= 400:
      arg_14 = "Error in getting exceptions from Tmaster, code: " + arg_13
      Log.error(arg_14)
      raise tornado.gen.Return({
          "message": arg_14
      })

    # Parse the response from tmaster.
    arg_15 = tmaster_pb2.ExceptionLogResponse()
    arg_15.ParseFromString(arg_12.body)

    if arg_15.status.status == common_pb2.NOTOK:
      if arg_15.status.HasField("message"):
        raise tornado.gen.Return({
            "message": arg_15.status.message
        })

    # Send response
    arg_16 = []
    for arg_17 in arg_15.exceptions:
      arg_16.append({'class_name': arg_17.stacktrace,
                  'lasttime': arg_17.lasttime,
                  'firsttime': arg_17.firsttime,
                  'count': str(arg_17.count)})
    raise tornado.gen.Return(arg_16)

Get the summary of exceptions for component_name and list of instances . Empty instance list will fetch all exceptions .


return smtplib.SMTP_SSL(
            self.server, self.port, context=ssl.create_default_context()
        )

def Func ( arg_0 ) : return smtplib . SMTP_SSL ( arg_0 . server , arg_0 . port , context = ssl . create_default_context ( ) )

def Func(arg_0):
        """Get an SMTP session with SSL."""
        return smtplib.SMTP_SSL(
            arg_0.server, arg_0.port, context=ssl.create_default_context()
        )


def Func ( arg_0 , arg_1 = None ) : def getter ( arg_2 ) : return _Func ( arg_2 , arg_0 , arg_1 ) return transform ( getter )

def Func(arg_0, arg_1=None):
    """Get a named attribute from an object.

    When a default argument is given, it is returned when the attribute
    doesn't exist.
    """
    def getter(arg_2):
        return _Func(arg_2, arg_0, arg_1)

    return transform(getter)


def Func ( arg_0 , arg_1 ) : class arg_5 ( type ( arg_0 ) ) : arg_2 = type ( arg_0 ) . __module__ def __init__ ( arg_3 ) : pass def __getattr__ ( arg_3 , arg_4 ) : return getattr ( arg_0 , arg_4 ) def __str__ ( arg_3 ) : return str ( arg_0 ) + arg_1 arg_5 . __name__ = type ( arg_0 ) . __name__ arg_7 = arg_5 ( ) if six . PY3 : arg_5 . __qualname__ = type ( arg_0 ) . __qualname__ six . raise_from ( arg_7 . with_traceback ( arg_0 . __traceback__ ) , None ) else : six . reraise ( arg_7 , None , sys . exc_info ( ) [ 2 ] )

def Func(arg_0, arg_1):
  """Reraises `exception`, appending `message` to its string representation."""

  class arg_5(type(arg_0)):
    """Acts as a proxy for an exception with an augmented message."""
    arg_2 = type(arg_0).__module__

    def __init__(arg_3):
      pass

    def __getattr__(arg_3, arg_4):
      return getattr(arg_0, arg_4)

    def __str__(arg_3):
      return str(arg_0) + arg_1

  arg_5.__name__ = type(arg_0).__name__

  arg_7 = arg_5()
  if six.PY3:
    arg_5.__qualname__ = type(arg_0).__qualname__
    six.raise_from(arg_7.with_traceback(arg_0.__traceback__), None)
  else:
    six.reraise(arg_7, None, sys.exc_info()[2])

Reraises exception appending message to its string representation .


def Func(arg_0: arg_1) -> G1Uncompressed:
    """
    Recovers x and y coordinates from the compressed point.
    """
    # b_flag == 1 indicates the infinity point
    arg_2 = (arg_0 % POW_2_383) // POW_2_382
    if arg_2 == 1:
        return Z1
    arg_3 = arg_0 % POW_2_381

    # Try solving y coordinate from the equation Y^2 = X^3 + b
    # using quadratic residue
    arg_4 = pow((arg_3**3 + b.n) % q, (q + 1) // 4, q)

    if pow(arg_4, 2, q) != (arg_3**3 + b.n) % q:
        raise ValueError(
            "The given point is not on G1: y**2 = x**3 + b"
        )
    # Choose the y whose leftmost bit is equal to the a_flag
    arg_5 = (arg_0 % POW_2_382) // POW_2_381
    if (arg_4 * 2) // q != arg_5:
        arg_4 = q - arg_4
    return (FQ(arg_3), FQ(arg_4), FQ(1))

Recovers x and y coordinates from the compressed point .


def
Func
(
arg_0
)
:
arg_1
=
[
arg_0
.
additional_config
,
arg_0
.
app_config
]
+
[
t
.
getConfig
(
)
for
t
in
arg_0
.
hierarchy
]
arg_2
=
[
_mirrorStructure
(
arg_0
.
additional_config
,
'command-line config'
)
,
_mirrorStructure
(
arg_0
.
app_config
,
'application\'s config.json'
)
,
]
+
[
_mirrorStructure
(
t
.
getConfig
(
)
,
t
.
getName
(
)
)
for
t
in
arg_0
.
hierarchy
]
arg_0
.
config
=
_mergeDictionaries
(
*
arg_1
)
arg_0
.
config_blame
=
_mergeDictionaries
(
*
arg_2
)

def Func(arg_0):
        ''' load the configuration information from the target hierarchy '''
        arg_1 = [arg_0.additional_config, arg_0.app_config] + [t.getConfig() for t in arg_0.hierarchy]
        # create an identical set of dictionaries, but with the names of the
        # sources in place of the values. When these are merged they will show
        # where each merged property came from:
        arg_2 = [
            _mirrorStructure(arg_0.additional_config, 'command-line config'),
            _mirrorStructure(arg_0.app_config, 'application\'s config.json'),
        ] + [
            _mirrorStructure(t.getConfig(), t.getName()) for t in arg_0.hierarchy
        ]

        arg_0.config = _mergeDictionaries(*arg_1)
        arg_0.config_blame = _mergeDictionaries(*arg_2)