def Func ( arg_0 , arg_1 ) : arg_2 = super ( FrontendWidget , arg_0 ) . Func ( arg_1 ) for arg_3 in arg_2 . actions ( ) : if arg_3 . shortcut ( ) . matches ( QtGui . QKeySequence . Paste ) == QtGui . QKeySequence . ExactMatch : arg_2 . insertAction ( arg_3 , arg_0 . _copy_raw_action ) break return arg_2

def Func(arg_0, arg_1):
        """ Reimplemented to add an action for raw copy.
        """
        arg_2 = super(FrontendWidget, arg_0).Func(arg_1)
        for arg_3 in arg_2.actions():
            if arg_3.shortcut().matches(QtGui.QKeySequence.Paste) == \
                    QtGui.QKeySequence.ExactMatch:
                arg_2.insertAction(arg_3, arg_0._copy_raw_action)
                break
        return arg_2

Reimplemented to add an action for raw copy .


def Func(arg_0, arg_1):
        """
        Increments by 1.

        Adds 1 to the destination operand, while preserving the state of the
        CF flag. The destination operand can be a register or a memory location.
        This instruction allows a loop counter to be updated without disturbing
        the CF flag. (Use a ADD instruction with an immediate operand of 1 to
        perform an increment operation that does updates the CF flag.)::

                DEST  =  DEST +1;

        :param cpu: current CPU.
        :param dest: destination operand.
        """
        arg_2 = arg_1.read()
        arg_3 = arg_1.write(arg_2 + 1)
        arg_3 &= (1 << arg_1.size) - 1
        arg_4 = 1 << (arg_1.size - 1)
        arg_0.AF = ((arg_2 ^ 1) ^ arg_3) & 0x10 != 0
        arg_0.ZF = arg_3 == 0
        arg_0.SF = (arg_3 & arg_4) != 0
        arg_0.OF = arg_3 == arg_4
        arg_0.PF = arg_0._calculate_parity_flag(arg_3)


(self, token, community_id, producer_display_name,
                        metric_name, producer_revision, submit_time, value,
                        **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3,
                        arg_4, arg_5, arg_6, arg_7,
                        **arg_8):
        """
        Create a new scalar data point.

        :param token: A valid token for the user in question.
        :type token: string
        :param community_id: The id of the community that owns the producer.
        :type community_id: int | long
        :param producer_display_name: The display name of the producer.
        :type producer_display_name: string
        :param metric_name: The metric name that identifies which trend this
            point belongs to.
        :type metric_name: string
        :param producer_revision: The repository revision of the producer that
            produced this value.
        :type producer_revision: int | long | string
        :param submit_time: The submit timestamp. Must be parsable with PHP
            strtotime().
        :type submit_time: string
        :param value: The value of the scalar.
        :type value: float
        :param config_item_id: (optional) If this value pertains to a specific
            configuration item, pass its id here.
        :type config_item_id: int | long
        :param test_dataset_id: (optional) If this value pertains to a
            specific test dataset, pass its id here.
        :type test_dataset_id: int | long
        :param truth_dataset_id: (optional) If this value pertains to a
            specific ground truth dataset, pass its id here.
        :type truth_dataset_id: int | long
        :param silent: (optional) If true, do not perform threshold-based email
            notifications for this scalar.
        :type silent: bool
        :param unofficial: (optional) If true, creates an unofficial scalar
            visible only to the user performing the submission.
        :type unofficial: bool
        :param build_results_url: (optional) A URL for linking to build results
            for this submission.
        :type build_results_url: string
        :param branch: (optional) The branch name in the source repository for
            this submission.
        :type branch: string
        :param submission_id: (optional) The id of the submission.
        :type submission_id: int | long
        :param submission_uuid: (optional) The uuid of the submission. If one
            does not exist, it will be created.
        :type submission_uuid: string
        :type branch: string
        :param params: (optional) Any key/value pairs that should be displayed
            with this scalar result.
        :type params: dict
        :param extra_urls: (optional) Other URL's that should be displayed with
            with this scalar result. Each element of the list should be a dict
            with the following keys: label, text, href
        :type extra_urls: list[dict]
        :param unit: (optional) The unit of the scalar value.
        :type unit: string
        :param reproduction_command: (optional) The command to reproduce this
            scalar.
        :type reproduction_command: string
        :returns: The scalar object that was created.
        :rtype: dict
        """
        arg_9 = dict()
        arg_9['token'] = arg_1
        arg_9['communityId'] = arg_2
        arg_9['producerDisplayName'] = arg_3
        arg_9['metricName'] = arg_4
        arg_9['producerRevision'] = arg_5
        arg_9['submitTime'] = arg_6
        arg_9['value'] = arg_7
        arg_10 = [
            'config_item_id', 'test_dataset_id', 'truth_dataset_id', 'silent',
            'unofficial', 'build_results_url', 'branch', 'extra_urls',
            'params', 'submission_id', 'submission_uuid', 'unit',
            'reproduction_command'
        ]
        for arg_11 in arg_10:
            if arg_11 in arg_8:
                if arg_11 == 'config_item_id':
                    arg_9['configItemId'] = arg_8[arg_11]
                elif arg_11 == 'test_dataset_id':
                    arg_9['testDatasetId'] = arg_8[arg_11]
                elif arg_11 == 'truth_dataset_id':
                    arg_9['truthDatasetId'] = arg_8[arg_11]
                elif arg_11 == 'build_results_url':
                    arg_9['buildResultsUrl'] = arg_8[arg_11]
                elif arg_11 == 'extra_urls':
                    arg_9['extraUrls'] = json.dumps(arg_8[arg_11])
                elif arg_11 == 'params':
                    arg_9[arg_11] = json.dumps(arg_8[arg_11])
                elif arg_11 == 'silent':
                    if arg_8[arg_11]:
                        arg_9[arg_11] = arg_8[arg_11]
                elif arg_11 == 'unofficial':
                    if arg_8[arg_11]:
                        arg_9[arg_11] = arg_8[arg_11]
                elif arg_11 == 'submission_id':
                    arg_9['submissionId'] = arg_8[arg_11]
                elif arg_11 == 'submission_uuid':
                    arg_9['submissionUuid'] = arg_8[arg_11]
                elif arg_11 == 'unit':
                    arg_9['unit'] = arg_8[arg_11]
                elif arg_11 == 'reproduction_command':
                    arg_9['reproductionCommand'] = arg_8[arg_11]
                else:
                    arg_9[arg_11] = arg_8[arg_11]
        arg_12 = arg_0.request('midas.tracker.scalar.add', arg_9)
        return arg_12


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . assert_package_exists ( ) if not arg_0 . package_vers_set : arg_0 . package_vers_set = True arg_1 . package . version = arg_2 return True else : raise CardinalityError ( 'Package::Version' )

def Func(arg_0, arg_1, arg_2):
        """Sets package version, if not already set.
        version - Any string.
        Raises CardinalityError if already has a version.
        Raises OrderError if no package previously defined.
        """
        arg_0.assert_package_exists()
        if not arg_0.package_vers_set:
            arg_0.package_vers_set = True
            arg_1.package.version = arg_2
            return True
        else:
            raise CardinalityError('Package::Version')

Sets package version if not already set . version - Any string . Raises CardinalityError if already has a version . Raises OrderError if no package previously defined .


return super(Video, self).delete(*args, **kwargs)

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = Api ( ) arg_3 . authenticate ( ) arg_3 . Func_video ( arg_0 . video_id ) return super ( Video , arg_0 ) . Func ( * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        """
        Deletes the video from youtube

        Raises:
            OperationError
        """
        arg_3 = Api()

        # Authentication is required for deletion
        arg_3.authenticate()

        # Send API request, raises OperationError on unsuccessful deletion
        arg_3.Func_video(arg_0.video_id)

        # Call the super method
        return super(Video, arg_0).Func(*arg_1, **arg_2)


def
Func
(
arg_0
)
:
arg_1
=
LatexCommand
(
'setDocAbstract'
,
{
'name'
:
'abstract'
,
'required'
:
True
,
'bracket'
:
'{'
}
)
try
:
arg_2
=
next
(
arg_1
.
parse
(
arg_0
.
_tex
)
)
except
StopIteration
:
arg_0
.
_logger
.
warning
(
'lsstdoc has no abstract'
)
arg_0
.
_abstract
=
return
try
:
arg_4
=
arg_2
[
'abstract'
]
except
KeyError
:
arg_0
.
_logger
.
warning
(
'lsstdoc has no abstract'
)
arg_0
.
_abstract
=
return
arg_4
=
arg_4
.
strip
(
)
arg_0
.
_abstract
=
arg_4

def Func(arg_0):
        """Parse the abstract from the TeX source.

        Sets the ``_abstract`` attribute.
        """
        arg_1 = LatexCommand(
            'setDocAbstract',
            {'name': 'abstract', 'required': True, 'bracket': '{'})
        try:
            arg_2 = next(arg_1.parse(arg_0._tex))
        except StopIteration:
            arg_0._logger.warning('lsstdoc has no abstract')
            arg_0._abstract = None
            return

        try:
            arg_4 = arg_2['abstract']
        except KeyError:
            arg_0._logger.warning('lsstdoc has no abstract')
            arg_0._abstract = None
            return

        arg_4 = arg_4.strip()
        arg_0._abstract = arg_4

Parse the abstract from the TeX source .


(img,
             angle,
             center=None,
             scale=1.0,
             border_value=0,
             auto_bound=False)

def Func(arg_0,
             arg_1,
             arg_2=None,
             arg_3=1.0,
             arg_4=0,
             arg_5=False):
    """Rotate an image.

    Args:
        img (ndarray): Image to be rotated.
        angle (float): Rotation angle in degrees, positive values mean
            clockwise rotation.
        center (tuple): Center of the rotation in the source image, by default
            it is the center of the image.
        scale (float): Isotropic scale factor.
        border_value (int): Border value.
        auto_bound (bool): Whether to adjust the image size to cover the whole
            rotated image.

    Returns:
        ndarray: The rotated image.
    """
    if arg_2 is not None and arg_5:
        raise ValueError('`auto_bound` conflicts with `center`')
    arg_6, arg_7 = arg_0.shape[:2]
    if arg_2 is None:
        arg_2 = ((arg_7 - 1) * 0.5, (arg_6 - 1) * 0.5)
    assert isinstance(arg_2, tuple)

    arg_8 = cv2.getRotationMatrix2D(arg_2, -arg_1, arg_3)
    if arg_5:
        arg_9 = np.abs(arg_8[0, 0])
        arg_10 = np.abs(arg_8[0, 1])
        arg_11 = arg_6 * arg_10 + arg_7 * arg_9
        arg_12 = arg_6 * arg_9 + arg_7 * arg_10
        arg_8[0, 2] += (arg_11 - arg_7) * 0.5
        arg_8[1, 2] += (arg_12 - arg_6) * 0.5
        arg_7 = int(np.round(arg_11))
        arg_6 = int(np.round(arg_12))
    arg_13 = cv2.warpAffine(arg_0, arg_8, (arg_7, arg_6), borderValue=arg_4)
    return arg_13


return ''.join(random.SystemRandom().choice(ALPHABET)
                   for _ in range(length))

def Func ( arg_0 = arg_1 ) : return '' . join ( random . SystemRandom ( ) . choice ( ALPHABET ) for arg_2 in range ( arg_0 ) )

def Func(arg_0=arg_1):
    """
    Generate a random string of the specified length.

    The returned string is composed of an alphabet that shouldn't include any
    characters that are easily mistakeable for one another (I, 1, O, 0), and
    hopefully won't accidentally contain any English-language curse words.
    """
    return ''.join(random.SystemRandom().choice(ALPHABET)
                   for arg_2 in range(arg_0))

Generate a random string of the specified length .


def Func ( arg_0 ) : import arg_1 if arg_0 . startswith ( 'module://' ) : arg_1 . rcParams [ 'backend' ] = arg_0 else : arg_1 . use ( arg_0 ) arg_1 . interactive ( True ) import arg_1 . pylab as arg_3 arg_3 . show . _needmain = False arg_3 . draw_if_interactive = flag_calls ( arg_3 . draw_if_interactive )

def Func(arg_0):
    """Activate the given backend and set interactive to True."""

    import arg_1
    if arg_0.startswith('module://'):
        # Work around bug in matplotlib: matplotlib.use converts the
        # backend_id to lowercase even if a module name is specified!
        arg_1.rcParams['backend'] = arg_0
    else:
        arg_1.use(arg_0)
    arg_1.interactive(True)

    # This must be imported last in the matplotlib series, after
    # backend/interactivity choices have been made
    import arg_1.pylab as arg_3

    # XXX For now leave this commented out, but depending on discussions with
    # mpl-dev, we may be able to allow interactive switching...
    #import matplotlib.pyplot
    #matplotlib.pyplot.switch_backend(backend)

    arg_3.show._needmain = False
    # We need to detect at runtime whether show() is called by the user.
    # For this, we wrap it into a decorator which adds a 'called' flag.
    arg_3.draw_if_interactive = flag_calls(arg_3.draw_if_interactive)

Activate the given backend and set interactive to True .


def
Func
(
arg_0
=
,
arg_1
=
)
:
def
expand_path
(
arg_2
)
:
return
os
.
path
.
abspath
(
os
.
path
.
expanduser
(
os
.
path
.
expandvars
(
arg_2
)
)
)
if
arg_0
is
:
arg_0
=
"CIJ"
if
arg_1
is
:
arg_1
=
[
"ROOT"
,
"ENVS"
,
"TESTPLANS"
,
"TESTCASES"
,
"TESTSUITES"
,
"MODULES"
,
"HOOKS"
,
"TEMPLATES"
]
arg_3
=
{
v
:
os
.
environ
.
get
(
"_"
.
join
(
[
arg_0
,
v
]
)
)
for
v
in
arg_1
}
for
arg_4
in
(
e
for
e
in
arg_3
.
keys
(
)
if
e
[
:
len
(
arg_0
)
]
in
arg_1
and
arg_3
[
e
]
)
:
arg_3
[
arg_4
]
=
expand_path
(
arg_3
[
arg_4
]
)
if
not
os
.
path
.
exists
(
arg_3
[
arg_4
]
)
:
err
(
"%s_%s: %r, does not exist"
%
(
arg_0
,
arg_4
,
arg_3
[
arg_4
]
)
)
return
arg_3

def Func(arg_0=None, arg_1=None):
    """Construct dict of paths from environment variables'"""

    def expand_path(arg_2):
        """Expands variables in 'path' and turns it into absolute path"""

        return os.path.abspath(os.path.expanduser(os.path.expandvars(arg_2)))

    if arg_0 is None:
        arg_0 = "CIJ"
    if arg_1 is None:
        arg_1 = [
            "ROOT", "ENVS", "TESTPLANS", "TESTCASES", "TESTSUITES", "MODULES",
            "HOOKS", "TEMPLATES"
        ]

    arg_3 = {v: os.environ.get("_".join([arg_0, v])) for v in arg_1}

    for arg_4 in (e for e in arg_3.keys() if e[:len(arg_0)] in arg_1 and arg_3[e]):
        arg_3[arg_4] = expand_path(arg_3[arg_4])
        if not os.path.exists(arg_3[arg_4]):
            err("%s_%s: %r, does not exist" % (arg_0, arg_4, arg_3[arg_4]))

    return arg_3


def Func(arg_0, arg_1):
        """
            Enqueue state.
            Save state on storage, assigns an id to it, then add it to the
            priority queue
        """
        # save the state to secondary storage
        arg_2 = arg_0._workspace.save_state(arg_1)
        arg_0.put(arg_2)
        arg_0._publish('did_Func_state', arg_2, arg_1)
        return arg_2

Enqueue state . Save state on storage assigns an id to it then add it to the priority queue


def Func ( arg_0 , arg_1 ) : if not arg_1 . is_method ( ) : return arg_2 = arg_1 . parent . frame ( ) for arg_3 in arg_1 . nodes_of_class ( astroid . Call ) : if node_frame_class ( arg_3 ) != node_frame_class ( arg_1 ) : continue arg_4 = arg_3 . func if not isinstance ( arg_4 , astroid . Attribute ) : continue arg_5 = arg_4 . expr if not ( isinstance ( arg_5 , astroid . Call ) and isinstance ( arg_5 . func , astroid . Name ) and arg_5 . func . name == "super" ) : continue if not arg_2 . newstyle and has_known_bases ( arg_2 ) : continue else : if not arg_5 . args : if sys . version_info [ 0 ] == 3 : continue else : arg_0 . add_message ( "missing-super-argument" , arg_1 = arg_5 ) continue arg_6 = arg_5 . args [ 0 ] if ( isinstance ( arg_6 , astroid . Call ) and isinstance ( arg_6 . func , astroid . Name ) and arg_6 . func . name == "type" ) : arg_0 . add_message ( "bad-super-call" , arg_1 = arg_5 , args = ( "type" , ) ) continue if ( len ( arg_5 . args ) >= 2 and isinstance ( arg_5 . args [ 1 ] , astroid . Name ) and arg_5 . args [ 1 ] . name == "self" and isinstance ( arg_6 , astroid . Attribute ) and arg_6 . attrname == "__class__" ) : arg_0 . add_message ( "bad-super-call" , arg_1 = arg_5 , args = ( "self.__class__" , ) ) continue try : arg_7 = arg_5 . args and next ( arg_5 . args [ 0 ] . infer ( ) , None ) except astroid . InferenceError : continue if arg_2 is not arg_7 : arg_8 = None if arg_7 : arg_8 = arg_7 . name elif arg_5 . args and hasattr ( arg_5 . args [ 0 ] , "name" ) : arg_8 = arg_5 . args [ 0 ] . name if arg_8 : arg_0 . add_message ( "bad-super-call" , arg_1 = arg_5 , args = ( arg_8 , ) )

def Func(arg_0, arg_1):
        """check use of super"""
        # ignore actual functions or method within a new style class
        if not arg_1.is_method():
            return
        arg_2 = arg_1.parent.frame()
        for arg_3 in arg_1.nodes_of_class(astroid.Call):
            if node_frame_class(arg_3) != node_frame_class(arg_1):
                # Don't look down in other scopes.
                continue

            arg_4 = arg_3.func
            if not isinstance(arg_4, astroid.Attribute):
                continue

            arg_5 = arg_4.expr
            # skip the test if using super
            if not (
                isinstance(arg_5, astroid.Call)
                and isinstance(arg_5.func, astroid.Name)
                and arg_5.func.name == "super"
            ):
                continue

            if not arg_2.newstyle and has_known_bases(arg_2):
                # super should not be used on an old style class
                continue
            else:
                # super first arg should be the class
                if not arg_5.args:
                    if sys.version_info[0] == 3:
                        # unless Python 3
                        continue
                    else:
                        arg_0.add_message("missing-super-argument", arg_1=arg_5)
                        continue

                # calling super(type(self), self) can lead to recursion loop
                # in derived classes
                arg_6 = arg_5.args[0]
                if (
                    isinstance(arg_6, astroid.Call)
                    and isinstance(arg_6.func, astroid.Name)
                    and arg_6.func.name == "type"
                ):
                    arg_0.add_message("bad-super-call", arg_1=arg_5, args=("type",))
                    continue

                # calling super(self.__class__, self) can lead to recursion loop
                # in derived classes
                if (
                    len(arg_5.args) >= 2
                    and isinstance(arg_5.args[1], astroid.Name)
                    and arg_5.args[1].name == "self"
                    and isinstance(arg_6, astroid.Attribute)
                    and arg_6.attrname == "__class__"
                ):
                    arg_0.add_message(
                        "bad-super-call", arg_1=arg_5, args=("self.__class__",)
                    )
                    continue

                try:
                    arg_7 = arg_5.args and next(arg_5.args[0].infer(), None)
                except astroid.InferenceError:
                    continue

                if arg_2 is not arg_7:
                    arg_8 = None
                    # if supcls is not Uninferable, then supcls was infered
                    # and use its name. Otherwise, try to look
                    # for call.args[0].name
                    if arg_7:
                        arg_8 = arg_7.name
                    elif arg_5.args and hasattr(arg_5.args[0], "name"):
                        arg_8 = arg_5.args[0].name
                    if arg_8:
                        arg_0.add_message("bad-super-call", arg_1=arg_5, args=(arg_8,))


Move this object to the bottom of the ordered stack.

def Func ( arg_0 ) : arg_1 = arg_0 . get_ordering_queryset ( ) . aggregate ( Max ( 'order' ) ) . get ( 'order__max' ) arg_0 . to ( arg_1 )

def Func(arg_0):
        """
        Move this object to the Func of the ordered stack.
        """
        arg_1 = arg_0.get_ordering_queryset().aggregate(Max('order')).get('order__max')
        arg_0.to(arg_1)

Move this object to the bottom of the ordered stack .


(key_name,
            value_name,
            jsonify,
            no_decrypt,
            stash,
            passphrase,
            backend)

def Func(arg_0,
            arg_1,
            arg_2,
            arg_3,
            arg_4,
            arg_5,
            arg_6):
    """Retrieve a key from the stash

    \b
    `KEY_NAME` is the name of the key to retrieve
    `VALUE_NAME` is a single value to retrieve e.g. if the value
     of the key `test` is `a=b,b=c`, `ghost get test a`a will return
     `b`
    """
    if arg_1 and arg_3:
        sys.exit('VALUE_NAME cannot be used in conjuction with --no-decrypt')

    arg_4 = _get_stash(arg_6, arg_4, arg_5, quiet=arg_2 or arg_1)

    try:
        arg_7 = arg_4.get(arg_0=arg_0, decrypt=not arg_3)
    except GhostError as ex:
        sys.exit(ex)

    if not arg_7:
        sys.exit('Key `{0}` not found'.format(arg_0))
    if arg_1:
        arg_7 = arg_7['value'].get(arg_1)
        if not arg_7:
            sys.exit(
                'Value name `{0}` could not be found under key `{1}`'.format(
                    arg_1, arg_0))

    if arg_2 or arg_1:
        click.echo(
            json.dumps(arg_7, indent=4, sort_keys=False).strip('"'),
            nl=True)
    else:
        click.echo('Retrieving key...')
        click.echo('\n' + _prettify_dict(arg_7))


def Func(arg_0, arg_1, arg_2, arg_3):
        '''Creates an instance of a class defined in this document.
           This method sets the context of the object to the current context.'''
        arg_4 = arg_1(arg_0, *arg_2, **arg_3)
        return arg_4

Creates an instance of a class defined in this document . This method sets the context of the object to the current context .


def
Func
(
arg_0
)
:
from
catkin_pkg
.
topological_order
import
_PackageDecorator
from
catkin_pkg
.
topological_order
import
_sort_decorated_packages
arg_1
=
{
}
for
arg_2
,
arg_3
in
arg_0
.
items
(
)
:
arg_1
[
arg_3
.
name
]
=
_PackageDecorator
(
arg_3
,
arg_2
)
for
arg_5
in
arg_1
.
values
(
)
:
arg_5
.
depends_for_topological_order
=
set
(
[
]
)
arg_7
=
arg_5
.
package
.
build_depends
+
arg_5
.
package
.
buildtool_depends
+
arg_5
.
package
.
run_depends
+
arg_5
.
package
.
test_depends
arg_8
=
set
(
[
d
.
name
for
d
in
arg_7
if
d
.
name
in
arg_1
.
keys
(
)
]
)
for
arg_4
in
arg_8
:
if
arg_4
in
arg_5
.
depends_for_topological_order
:
continue
arg_1
[
arg_4
]
.
_add_recursive_run_depends
(
arg_1
,
arg_5
.
depends_for_topological_order
)
arg_9
=
_sort_decorated_packages
(
arg_1
)
for
arg_10
,
arg_11
in
arg_9
:
if
arg_10
is
:
raise
RuntimeError
(
'Circular dependency in: %s'
%
arg_11
)
return
arg_9

def Func(arg_0):
    """
    Order packages topologically.

    First returning packages which have message generators and then
    the rest based on all direct depends and indirect recursive run_depends.

    :param packages: A dict mapping relative paths to ``Package`` objects ``dict``
    :returns: A list of tuples containing the relative path and a ``Package`` object, ``list``
    """
    from catkin_pkg.topological_order import _PackageDecorator
    from catkin_pkg.topological_order import _sort_decorated_packages

    arg_1 = {}
    for arg_2, arg_3 in arg_0.items():
        arg_1[arg_3.name] = _PackageDecorator(arg_3, arg_2)

    # calculate transitive dependencies
    for arg_5 in arg_1.values():
        arg_5.depends_for_topological_order = set([])
        arg_7 = \
            arg_5.package.build_depends + arg_5.package.buildtool_depends + \
            arg_5.package.run_depends + arg_5.package.test_depends
        # skip external dependencies, meaning names that are not known packages
        arg_8 = set([
            d.name for d in arg_7 if d.name in arg_1.keys()])
        for arg_4 in arg_8:
            if arg_4 in arg_5.depends_for_topological_order:
                # avoid function call to improve performance
                # check within the loop since the set changes every cycle
                continue
            arg_1[arg_4]._add_recursive_run_depends(
                arg_1, arg_5.depends_for_topological_order)

    arg_9 = _sort_decorated_packages(arg_1)
    for arg_10, arg_11 in arg_9:
        if arg_10 is None:
            raise RuntimeError('Circular dependency in: %s' % arg_11)
    return arg_9


def Func ( arg_0 ) : if "/by_tag/" not in arg_0 . path : raise DAVError ( HTTP_FORBIDDEN ) arg_1 , arg_2 , arg_3 = util . save_split ( arg_0 . path . strip ( "/" ) , "/" , 2 ) assert arg_1 == "by_tag" assert arg_2 in arg_0 . data [ "tags" ] arg_0 . data [ "tags" ] . remove ( arg_2 ) return True

def Func(arg_0):
        """Change semantic of DELETE to remove resource tags."""
        # DELETE is only supported for the '/by_tag/' collection
        if "/by_tag/" not in arg_0.path:
            raise DAVError(HTTP_FORBIDDEN)
        # path must be '/by_tag/<tag>/<resname>'
        arg_1, arg_2, arg_3 = util.save_split(arg_0.path.strip("/"), "/", 2)
        assert arg_1 == "by_tag"
        assert arg_2 in arg_0.data["tags"]
        arg_0.data["tags"].remove(arg_2)
        return True

Change semantic of DELETE to remove resource tags .


(data: List[Tuple[int, int]], y_axis_label: str = 'y', x_axis_label: str = 'x')

return json.dumps([
        [x_axis_label] + list(years),
        [y_axis_label] + list(counter)
    ])

def Func ( arg_0 : arg_1 [ arg_2 [ arg_3 , arg_3 ] ] , arg_4 : arg_5 = 'y' , arg_6 : arg_5 = 'x' ) -> arg_5 : arg_7 , arg_8 = zip ( * arg_0 ) arg_7 = [ datetime . date ( year , 1 , 1 ) . isoformat ( ) for year in arg_7 ] return json . dumps ( [ [ arg_6 ] + list ( arg_7 ) , [ arg_4 ] + list ( arg_8 ) ] )

def Func(arg_0: arg_1[arg_2[arg_3, arg_3]], arg_4: arg_5 = 'y', arg_6: arg_5 = 'x') -> arg_5:
    """Prepare C3 JSON string dump for a time series.

    :param data: A list of tuples [(year, count)]
    :param y_axis_label: The Y axis label
    :param x_axis_label: X axis internal label. Should be left as default 'x')
    """
    arg_7, arg_8 = zip(*arg_0)

    arg_7 = [
        datetime.date(year, 1, 1).isoformat()
        for year in arg_7
    ]

    return json.dumps([
        [arg_6] + list(arg_7),
        [arg_4] + list(arg_8)
    ])

Prepare C3 JSON string dump for a time series .


def Func ( arg_0 , arg_1 = 51 ) : arg_2 = arg_0 . cutoff . values arg_3 = min ( arg_2 ) arg_4 = max ( arg_2 ) arg_5 = ( arg_4 - arg_3 ) * 0.05 arg_6 = np . linspace ( arg_3 - arg_5 , arg_4 + arg_5 , arg_1 , dtype = np . float32 ) arg_7 = find_nearest_matches ( np . float32 ( arg_0 . cutoff . values ) , arg_6 ) arg_8 = arg_0 . iloc [ arg_7 ] . copy ( ) arg_8 . cutoff = arg_6 arg_8 . reset_index ( inplace = True , drop = True ) return arg_8

def Func(arg_0, arg_1=51):
    """ Create artificial cutoff sample points from given range of cutoff
    values in df, number of sample points is 'num_cut_offs' """

    arg_2 = arg_0.cutoff.values
    arg_3 = min(arg_2)
    arg_4 = max(arg_2)
    # extend max_ and min_ by 5 % of full range
    arg_5 = (arg_4 - arg_3) * 0.05
    arg_6 = np.linspace(arg_3 - arg_5, arg_4 + arg_5, arg_1, dtype=np.float32)

    # find best matching row index for each sampled cut off:
    arg_7 = find_nearest_matches(np.float32(arg_0.cutoff.values), arg_6)

    # create sub dataframe:
    arg_8 = arg_0.iloc[arg_7].copy()
    arg_8.cutoff = arg_6
    # remove 'old' index from input df:
    arg_8.reset_index(inplace=True, drop=True)

    return arg_8

Create artificial cutoff sample points from given range of cutoff values in df number of sample points is num_cut_offs


def Func(arg_0, arg_1):
        """
        Transmit content metadata creation to integrated channel.
        """
        for arg_2 in chunks(arg_1, arg_0.enterprise_configuration.transmission_chunk_size):
            arg_3 = arg_0._serialize_items(list(arg_2.values()))
            try:
                arg_0.client.create_content_metadata(arg_3)
            except ClientError as exc:
                LOGGER.error(
                    'Failed to update [%s] content metadata items for integrated channel [%s] [%s]',
                    len(arg_2),
                    arg_0.enterprise_configuration.enterprise_customer.name,
                    arg_0.enterprise_configuration.channel_code,
                )
                LOGGER.error(exc)
            else:
                arg_0._create_transmissions(arg_2)

Transmit content metadata creation to integrated channel .


def Func ( arg_0 , arg_1 , arg_2 , * arg_3 , ** arg_4 ) : arg_5 = partial ( arg_2 , * arg_3 , ** arg_4 ) arg_0 . insert ( arg_1 , arg_5 )

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        '''
        insert func with given arguments and keywords.
        '''
        arg_5 = partial(arg_2, *arg_3, **arg_4)
        arg_0.insert(arg_1, arg_5)

insert func with given arguments and keywords .


load_targets will load the services with smb signing disabled and if ldap is enabled the services with the ldap port open.

def Func ( arg_0 ) : arg_1 = [ ] if arg_0 . ldap : arg_1 = arg_0 . search . get_services ( ports = [ 389 ] , up = True ) arg_0 . ldap_strings = [ "ldap://{}" . format ( service . address ) for service in arg_1 ] arg_0 . services = arg_0 . search . get_services ( tags = [ 'smb_signing_disabled' ] ) arg_0 . ips = [ str ( service . address ) for service in arg_0 . services ]

def Func(arg_0):
        """
            Func will load the services with smb signing disabled and if ldap is enabled the services with the ldap port open.
        """
        arg_1 = []
        if arg_0.ldap:
            arg_1 = arg_0.search.get_services(ports=[389], up=True)

        arg_0.ldap_strings = ["ldap://{}".format(service.address) for service in arg_1]
        arg_0.services = arg_0.search.get_services(tags=['smb_signing_disabled'])
        arg_0.ips = [str(service.address) for service in arg_0.services]

load_targets will load the services with smb signing disabled and if ldap is enabled the services with the ldap port open .


return {
        exc.namespace
        for _, exc, _ in graph.warnings
        if isinstance(exc, UndefinedNamespaceWarning)
    }

def Func ( arg_0 : arg_1 ) -> Set [ str ] : return { arg_3 . namespace for arg_2 , arg_3 , arg_2 in arg_0 . warnings if isinstance ( arg_3 , UndefinedNamespaceWarning ) }

def Func(arg_0: arg_1) -> Set[str]:
    """Get all namespaces that are used in the BEL graph aren't actually defined."""
    return {
        arg_3.namespace
        for arg_2, arg_3, arg_2 in arg_0.warnings
        if isinstance(arg_3, UndefinedNamespaceWarning)
    }

Get all namespaces that are used in the BEL graph aren t actually defined .


def Func(arg_0):
        """Return real, effective and saved user ids."""
        arg_1, arg_2, arg_3 = _psutil_bsd.Func(arg_0.pid)
        return nt_uids(arg_1, arg_2, arg_3)

Return real effective and saved user ids .


def Func(arg_0, arg_1):
        """Prepare field for serialization."""
        if DJANGO_VERSION > (1, 9):
            arg_2 = arg_0.value_from_object(arg_1)
        else:
            arg_2 = arg_0._get_val_from_obj(arg_1)
        return arg_0.get_prep_value(arg_2)


return (
        parentUri
        and childUri
        and (childUri.rstrip("/") + "/").startswith(parentUri.rstrip("/") + "/")
    )

def Func ( arg_0 , arg_1 ) : return ( arg_0 and arg_1 and ( arg_1 . rstrip ( "/" ) + "/" ) . startswith ( arg_0 . rstrip ( "/" ) + "/" ) )

def Func(arg_0, arg_1):
    """Return True, if childUri is a child of parentUri or maps to the same resource.

    Similar to <util.is_child_uri>_ ,  but this method also returns True, if parent
    equals child. ('/a/b' is considered identical with '/a/b/').
    """
    return (
        arg_0
        and arg_1
        and (arg_1.rstrip("/") + "/").startswith(arg_0.rstrip("/") + "/")
    )

Return True if childUri is a child of parentUri or maps to the same resource .


(I, colors, vmin=None, vmax=None, axis=-1)

return np.clip(normalized, 0, 1).dot(colors)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = - 1 ) : arg_5 = len ( arg_0 . shape ) arg_6 = list ( range ( arg_5 ) ) arg_7 = list ( arg_6 ) arg_7 . remove ( ( arg_4 + arg_5 ) % arg_5 ) arg_7 = tuple ( arg_7 ) if arg_2 is None : arg_2 = np . nanmin ( arg_0 , arg_4 = arg_7 ) if arg_3 is None : arg_3 = np . nanmax ( arg_0 , arg_4 = arg_7 ) arg_8 = ( arg_0 - arg_2 ) / ( arg_3 - arg_2 ) return np . clip ( arg_8 , 0 , 1 ) . dot ( arg_1 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=-1):
    """Similar to monochrome, but now do it for multiple colors

    Example
    >>> I = np.arange(32.).reshape(4,4,2)
    >>> colors = [(0, 0, 1), (0, 1, 0)] # red and green
    >>> rgb = vx.image.Func(I, colors) # shape is (4,4,3)

    :param I: ndarray of any shape (3d will result in a 2d image)
    :param colors: sequence of [(r,g,b), ...] values
    :param vmin: normalization minimum for I, or np.nanmin(I) when None
    :param vmax: normalization maximum for I, or np.nanmax(I) when None
    :param axis: axis which to sum over, by default the last
    :return:
    """
    arg_5 = len(arg_0.shape)
    arg_6 = list(range(arg_5))
    arg_7 = list(arg_6)
    arg_7.remove((arg_4 + arg_5) % arg_5)
    arg_7 = tuple(arg_7)

    if arg_2 is None:
        arg_2 = np.nanmin(arg_0, arg_4=arg_7)
    if arg_3 is None:
        arg_3 = np.nanmax(arg_0, arg_4=arg_7)
    arg_8 = (arg_0 - arg_2) / (arg_3 - arg_2)
    return np.clip(arg_8, 0, 1).dot(arg_1)

Similar to monochrome, but now do it for multiple colors

    Example
    >>> I = np.arange(32.).reshape(4,4,2)
    >>> colors = [(0, 0, 1), (0, 1, 0)] # red and green
    >>> rgb = vx.image.polychrome(I, colors) # shape is (4,4,3)

    :param I: ndarray of any shape (3d will result in a 2d image)
    :param colors: sequence of [(r,g,b), ...] values
    :param vmin: normalization minimum for I, or np.nanmin(I) when None
    :param vmax: normalization maximum for I, or np.nanmax(I) when None
    :param axis: axis which to sum over, by default the last
    :return:

Similar to monochrome but now do it for multiple colors


def Func ( arg_0 ) : with h5py . File ( arg_0 . database . input , 'a' ) as io5 : arg_1 = io5 [ "quartets" ] arg_2 = itertools . combinations ( xrange ( len ( arg_0 . samples ) ) , 4 ) arg_3 = 0 while arg_3 < arg_0 . params . nquartets : arg_4 = np . array ( list ( itertools . islice ( arg_2 , arg_0 . _chunksize ) ) ) arg_5 = min ( arg_0 . params . nquartets , arg_4 . shape [ 0 ] + arg_3 ) arg_1 [ arg_3 : arg_5 ] = arg_4 [ : arg_5 - arg_3 ] arg_3 += arg_0 . _chunksize print ( min ( arg_3 , arg_0 . params . nquartets ) )

def Func(arg_0):
    """
    Populate array with all possible quartets. This allows us to
    sample from the total, and also to continue from a checkpoint
    """

    with h5py.File(arg_0.database.input, 'a') as io5:
        arg_1 = io5["quartets"]

        ## generator for all quartet sets
        arg_2 = itertools.combinations(xrange(len(arg_0.samples)), 4)
        arg_3 = 0
        while arg_3 < arg_0.params.nquartets:
            ## sample a chunk of the next ordered N set of quartets
            arg_4 = np.array(list(itertools.islice(arg_2, arg_0._chunksize)))
            arg_5 = min(arg_0.params.nquartets, arg_4.shape[0]+arg_3)
            arg_1[arg_3:arg_5] = arg_4[:arg_5-arg_3]
            arg_3 += arg_0._chunksize

            ## send progress update to stdout on engine
            print(min(arg_3, arg_0.params.nquartets))

Populate array with all possible quartets . This allows us to sample from the total and also to continue from a checkpoint


(model,
                    filename,
                    map_location=None,
                    strict=False,
                    logger=None)

def Func(arg_0,
                    arg_1,
                    arg_2=None,
                    arg_3=False,
                    arg_4=None):
    """Load checkpoint from a file or URI.

    Args:
        model (Module): Module to load checkpoint.
        filename (str): Either a filepath or URL or modelzoo://xxxxxxx.
        map_location (str): Same as :func:`torch.load`.
        strict (bool): Whether to allow different params for the model and
            checkpoint.
        logger (:mod:`logging.Logger` or None): The logger for error message.

    Returns:
        dict or OrderedDict: The loaded checkpoint.
    """
    # load checkpoint from modelzoo or file or url
    if arg_1.startswith('modelzoo://'):
        import torchvision
        arg_5 = dict()
        for arg_6, arg_7, arg_8 in pkgutil.walk_packages(
                torchvision.models.__path__):
            if not arg_8:
                arg_9 = import_module('torchvision.models.{}'.format(arg_7))
                arg_10 = getattr(arg_9, 'model_urls')
                arg_5.update(arg_10)
        arg_11 = arg_1[11:]
        arg_12 = model_zoo.load_url(arg_5[arg_11])
    elif arg_1.startswith('open-mmlab://'):
        arg_11 = arg_1[13:]
        arg_12 = model_zoo.load_url(open_mmlab_model_urls[arg_11])
    elif arg_1.startswith(('http://', 'https://')):
        arg_12 = model_zoo.load_url(arg_1)
    else:
        if not osp.isfile(arg_1):
            raise IOError('{} is not a checkpoint file'.format(arg_1))
        arg_12 = torch.load(arg_1, arg_2=arg_2)
    # get state_dict from checkpoint
    if isinstance(arg_12, OrderedDict):
        arg_13 = arg_12
    elif isinstance(arg_12, dict) and 'state_dict' in arg_12:
        arg_13 = arg_12['state_dict']
    else:
        raise RuntimeError(
            'No state_dict found in checkpoint file {}'.format(arg_1))
    # strip prefix of state_dict
    if list(arg_13.keys())[0].startswith('module.'):
        arg_13 = {k[7:]: v for k, v in arg_12['state_dict'].items()}
    # load state_dict
    if hasattr(arg_0, 'module'):
        load_state_dict(arg_0.module, arg_13, arg_3, arg_4)
    else:
        load_state_dict(arg_0, arg_13, arg_3, arg_4)
    return arg_12


def Func ( arg_0 ) : arg_1 = [ ] arg_2 = arg_0 . getaddress ( ) while arg_2 : arg_1 += arg_2 arg_2 = arg_0 . getaddress ( ) return arg_1

def Func(arg_0):
        """Parse all addresses.

        Returns a list containing all of the addresses.
        """
        arg_1 = []
        arg_2 = arg_0.getaddress()
        while arg_2:
            arg_1 += arg_2
            arg_2 = arg_0.getaddress()
        return arg_1


return sum(l.weight * l(outputs) for l in self.losses) + \
            sum(r.weight * r.loss(self.layers, outputs) for r in regs)

def Func ( arg_0 , ** arg_1 ) : arg_2 = regularizers . from_kwargs ( arg_0 , ** arg_1 ) arg_3 , arg_4 = arg_0 . build_graph ( arg_2 ) return sum ( arg_5 . weight * arg_5 ( arg_3 ) for arg_5 in arg_0 . Funces ) + sum ( arg_6 . weight * arg_6 . Func ( arg_0 . layers , arg_3 ) for arg_6 in arg_2 )

def Func(arg_0, **arg_1):
        '''Return a variable representing the regularized Func for this network.

        The regularized Func includes both the :ref:`Func computation <Funces>`
        for the network as well as any :ref:`regularizers <regularizers>` that
        are in place.

        Keyword arguments are passed directly to
        :func:`theanets.regularizers.from_kwargs`.

        Returns
        -------
        Func : Theano expression
            A Theano expression representing the Func of this network.
        '''
        arg_2 = regularizers.from_kwargs(arg_0, **arg_1)
        arg_3, arg_4 = arg_0.build_graph(arg_2)
        return sum(arg_5.weight * arg_5(arg_3) for arg_5 in arg_0.Funces) + \
            sum(arg_6.weight * arg_6.Func(arg_0.layers, arg_3) for arg_6 in arg_2)

Return a variable representing the regularized loss for this network.

        The regularized loss includes both the :ref:`loss computation <losses>`
        for the network as well as any :ref:`regularizers <regularizers>` that
        are in place.

        Keyword arguments are passed directly to
        :func:`theanets.regularizers.from_kwargs`.

        Returns
        -------
        loss : Theano expression
            A Theano expression representing the loss of this network.

Return a variable representing the regularized loss for this network .


def Func ( arg_0 , arg_1 ) : arg_2 = libaio . io_event ( ) try : libaio . io_Func ( arg_0 . _ctx , byref ( arg_1 . _iocb ) , byref ( arg_2 ) ) except OSError as exc : if exc . errno == errno . EINPROGRESS : return None raise return arg_0 . _eventToPython ( arg_2 )

def Func(arg_0, arg_1):
        """
        Cancel an IO block.

        block (AIOBlock)
            The IO block to Func.

        Returns Funcled block's event data (see getEvents), or None if the
        kernel returned EINPROGRESS. In the latter case, event completion will
        happen on a later getEvents call.
        """
        arg_2 = libaio.io_event()
        try:
            # pylint: disable=protected-access
            libaio.io_Func(arg_0._ctx, byref(arg_1._iocb), byref(arg_2))
            # pylint: enable=protected-access
        except OSError as exc:
            if exc.errno == errno.EINPROGRESS:
                return None
            raise
        return arg_0._eventToPython(arg_2)

Cancel an IO block.

        block (AIOBlock)
            The IO block to cancel.

        Returns cancelled block's event data (see getEvents), or None if the
        kernel returned EINPROGRESS. In the latter case, event completion will
        happen on a later getEvents call.


def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . client . certificates ( arg_2 ) . courses ( arg_1 ) . get ( )

def Func(arg_0, arg_1, arg_2):
        """
        Retrieve the certificate for the given username for the given course_id.

        Args:
        * ``course_id`` (str): The string value of the course's unique identifier
        * ``username`` (str): The username ID identifying the user for which to retrieve the certificate

        Raises:

        HttpNotFoundError if no certificate found for the given user+course.

        Returns:

        a dict containing:

        * ``username``: A string representation of an user's username passed in the request.
        * ``course_id``: A string representation of a Course ID.
        * ``certificate_type``: A string representation of the certificate type.
        * ``created_date`: Datetime the certificate was created (tz-aware).
        * ``status``: A string representation of the certificate status.
        * ``is_passing``: True if the certificate has a passing status, False if not.
        * ``download_url``: A string representation of the certificate url.
        * ``grade``: A string representation of a float for the user's course grade.

        """
        return arg_0.client.certificates(arg_2).courses(arg_1).get()

Retrieve the certificate for the given username for the given course_id .


(self, node, recursive=False, max_depth=float('inf'),
                    with_links=True, in_search=False, predicate=None)

def Func(arg_0, arg_1, arg_2=False, arg_3=arg_4('inf'),
                    arg_5=True, arg_6=False, arg_7=None):
        """Returns an iterator over nodes hanging below a given start node.

        :param node:

            Start node

        :param recursive:

            Whether recursively also iterate over the children of the start node's children

        :param max_depth:

            Maximum depth to search for

        :param in_search:

            if it is used during get search and if detailed info should be returned

        :param with_links:

            If links should be considered

        :param predicate:

            A predicate to filter nodes

        :return: Iterator

        """
        def _run_predicate(arg_8, arg_9):
            arg_10 = arg_8.v_run_branch
            return arg_10 == 'trajectory' or arg_10 in arg_9

        if arg_3 is None:
            arg_3 = arg_4('inf')

        if arg_7 is None:
            arg_7 = lambda arg_8: True
        elif isinstance(arg_7, (tuple, list)):
            # Create a predicate from a list of run names or run indices
            arg_11 = arg_7
            arg_9 = set()
            for arg_12 in arg_11:
                if arg_12 == -1:
                    arg_9.add(arg_0._root_instance.f_wildcard('$', -1))
                elif isinstance(arg_12, int):
                    arg_9.add(arg_0._root_instance.f_idx_to_run(arg_12))
                else:
                    arg_9.add(arg_12)
            arg_7 = lambda arg_8: _run_predicate(arg_8, arg_9)

        if arg_2:
            return NaturalNamingInterface._recursive_traversal_bfs(arg_1,
                                            arg_0._root_instance._linked_by,
                                            arg_3, arg_5,
                                            arg_6, arg_7)
        else:
            arg_13 = (arg_8 for arg_8 in arg_0._make_child_iterator(arg_1, arg_5) if
                        arg_7(arg_8[2]))
            if arg_6:
                return arg_13 # Here we return tuples: (depth, name, object)
            else:
                return (arg_8[2] for arg_8 in arg_13)

Returns an iterator over nodes hanging below a given start node .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_2 = plt . gca ( ) arg_3 = timeseries . perf_stats_bootstrap ( arg_0 , arg_1 , return_stats = False ) arg_3 = arg_3 . drop ( 'Kurtosis' , axis = 'columns' ) sns . boxplot ( data = arg_3 , orient = 'h' , arg_2 = arg_2 ) return arg_2

def Func(arg_0, arg_1, arg_2=None):
    """
    Create box plot of some performance metrics of the strategy.
    The width of the box whiskers is determined by a bootstrap.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    factor_returns : pd.Series
        Daily noncumulative returns of the benchmark factor to which betas are
        computed. Usually a benchmark such as market returns.
         - This is in the same style as returns.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.

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

    if arg_2 is None:
        arg_2 = plt.gca()

    arg_3 = timeseries.perf_stats_bootstrap(arg_0,
                                                       arg_1,
                                                       return_stats=False)
    arg_3 = arg_3.drop('Kurtosis', axis='columns')

    sns.boxplot(data=arg_3, orient='h', arg_2=arg_2)

    return arg_2

Create box plot of some performance metrics of the strategy . The width of the box whiskers is determined by a bootstrap .


def Func(arg_0, arg_1, arg_2):
        """Adds a chunk of tasks to the job

        Retry chunk if body exceeds the maximum request size and retry tasks
        if failed due to server errors.

        :param results_queue: Queue to place the return value of the request
        :type results_queue: collections.deque
        :param chunk_tasks_to_add: Chunk of at most 100 tasks with retry details
        :type chunk_tasks_to_add: list[~TrackedCloudTask]
        """

        try:
            arg_3 = arg_0._original_add_collection(
                arg_0._client,
                arg_0._job_id,
                arg_2,
                arg_0._task_add_collection_options,
                arg_0._custom_headers,
                arg_0._raw)
        except BatchErrorException as e:
            # In case of a chunk exceeding the MaxMessageSize split chunk in half
            # and resubmit smaller chunk requests
            # TODO: Replace string with constant variable once available in SDK
            if e.error.code == "RequestBodyTooLarge":  # pylint: disable=no-member
                # In this case the task is misbehaved and will not be able to be added due to:
                #   1) The task exceeding the max message size
                #   2) A single cell of the task exceeds the per-cell limit, or
                #   3) Sum of all cells exceeds max row limit
                if len(arg_2) == 1:
                    arg_4 = arg_2.pop()
                    arg_0.errors.appendleft(e)
                    _LOGGER.error("Failed to add task with ID %s due to the body"
                                  " exceeding the maximum request size", arg_4.id)
                else:
                    # Assumption: Tasks are relatively close in size therefore if one batch exceeds size limit
                    # we should decrease the initial task collection size to avoid repeating the error
                    # Midpoint is lower bounded by 1 due to above base case
                    arg_5 = int(len(arg_2) / 2)
                    # Restrict one thread at a time to do this compare and set,
                    # therefore forcing max_tasks_per_request to be strictly decreasing
                    with arg_0._max_tasks_lock:
                        if arg_5 < arg_0._max_tasks_per_request:
                            arg_0._max_tasks_per_request = arg_5
                            _LOGGER.info("Amount of tasks per request reduced from %s to %s due to the"
                                         " request body being too large", str(arg_0._max_tasks_per_request),
                                         str(arg_5))

                    # Not the most efficient solution for all cases, but the goal of this is to handle this
                    # exception and have it work in all cases where tasks are well behaved
                    # Behavior retries as a smaller chunk and
                    # appends extra tasks to queue to be picked up by another thread .
                    arg_0.tasks_to_add.extendleft(arg_2[arg_5:])
                    arg_0.Func(arg_1, arg_2[:arg_5])
            # Retry server side errors
            elif 500 <= e.response.status_code <= 599:
                arg_0.tasks_to_add.extendleft(arg_2)
            else:
                # Re-add to pending queue as unknown status / don't have result
                arg_0.tasks_to_add.extendleft(arg_2)
                # Unknown State - don't know if tasks failed to add or were successful
                arg_0.errors.appendleft(e)
        except Exception as e:  # pylint: disable=broad-except
            # Re-add to pending queue as unknown status / don't have result
            arg_0.tasks_to_add.extendleft(arg_2)
            # Unknown State - don't know if tasks failed to add or were successful
            arg_0.errors.appendleft(e)
        else:
            try:
                arg_3 = arg_3.output
            except AttributeError:
                pass

            for arg_7 in arg_3.value:  # pylint: disable=no-member
                if arg_7.status == TaskAddStatus.server_error:
                    # Server error will be retried
                    with arg_0._pending_queue_lock:
                        for arg_8 in arg_2:
                            if arg_8.id == arg_7.task_id:
                                arg_0.tasks_to_add.appendleft(arg_8)
                elif (arg_7.status == TaskAddStatus.client_error
                        and not arg_7.error.code == "TaskExists"):
                    # Client error will be recorded unless Task already exists
                    arg_0.failure_tasks.appendleft(arg_7)
                else:
                    arg_1.appendleft(arg_7)


def Func ( arg_0 , arg_1 : "Namespace" ) : arg_0 . _refers . swap ( Namespace . __Func , arg_1 . interns )

def Func(arg_0, arg_1: "Namespace"):
        """Refer all the Vars in the other namespace."""
        arg_0._refers.swap(Namespace.__Func, arg_1.interns)

Refer all the Vars in the other namespace .


def Func(arg_0, arg_1, arg_2):
        """Modify an existing lock's timeout.

        token:
            Valid lock token.
        timeout:
            Suggested lifetime in seconds (-1 for infinite).
            The real expiration time may be shorter than requested!
        Returns:
            Lock dictionary.
            Raises ValueError, if token is invalid.
        """
        assert arg_1 in arg_0._dict, "Lock must exist"
        assert arg_2 == -1 or arg_2 > 0
        if arg_2 < 0 or arg_2 > LockStorageDict.LOCK_TIME_OUT_MAX:
            arg_2 = LockStorageDict.LOCK_TIME_OUT_MAX

        arg_0._lock.acquire_write()
        try:
            # Note: shelve dictionary returns copies, so we must reassign
            # values:
            arg_3 = arg_0._dict[arg_1]
            arg_3["timeout"] = arg_2
            arg_3["expire"] = time.time() + arg_2
            arg_0._dict[arg_1] = arg_3
            arg_0._flush()
        finally:
            arg_0._lock.release()
        return arg_3


(self, command, blocksize, tasks_per_node, job_name="parsl.auto")

def Func(arg_0, arg_1, arg_2, arg_3, arg_4="parsl.auto"):
        ''' The Func method takes the command string to be executed upon
        instantiation of a resource most often to start a pilot.

        Args :
             - command (str) : The bash command string to be executed.
             - blocksize (int) : Blocksize to be requested
             - tasks_per_node (int) : command invocations to be launched per node

        KWargs:
             - job_name (str) : Human friendly name to be assigned to the job request

        Returns:
             - A job identifier, this could be an integer, string etc

        Raises:
             - ExecutionProviderException or its subclasses
        '''
        arg_5 = arg_0.launcher(arg_1,
                                    arg_3,
                                    1)

        arg_6, arg_7 = arg_0.create_instance(arg_1=arg_5)
        arg_0.provisioned_blocks += 1
        arg_0.resources[arg_7] = {"job_id": arg_7, "status": translate_table[arg_6['status']]}
        return arg_7

The submit method takes the command string to be executed upon
        instantiation of a resource most often to start a pilot.

        Args :
             - command (str) : The bash command string to be executed.
             - blocksize (int) : Blocksize to be requested
             - tasks_per_node (int) : command invocations to be launched per node

        KWargs:
             - job_name (str) : Human friendly name to be assigned to the job request

        Returns:
             - A job identifier, this could be an integer, string etc

        Raises:
             - ExecutionProviderException or its subclasses

The submit method takes the command string to be executed upon instantiation of a resource most often to start a pilot .


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_2_0):
        """
        Read the data stream and decode the Attributes structure into its
        parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a Func method.
            kmip_version (enum): A KMIPVersion enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 2.0.

        Raises:
            AttributeNotSupported: Raised if an unsupported attribute is
                encountered while decoding.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the Attributes object.
        """
        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            raise exceptions.VersionNotSupported(
                "KMIP {} does not support the Attributes object.".format(
                    arg_2.value
                )
            )

        super(Attributes, arg_0).Func(arg_1, arg_2=arg_2)
        arg_6 = BytearrayStream(arg_1.Func(arg_0.length))

        while True:
            if len(arg_6) < 3:
                break
            arg_7 = struct.unpack('!I', b'\x00' + arg_6.peek(3))[0]
            if arg_3.is_enum_value(arg_3.Tags, arg_7):
                arg_7 = arg_3.Tags(arg_7)
                if not arg_3.is_attribute(arg_7, arg_2=arg_2):
                    raise exceptions.AttributeNotSupported(
                        "Attribute {} is not supported by KMIP {}.".format(
                            arg_7.name,
                            arg_2.value
                        )
                    )
                arg_8 = arg_0._factory.create_attribute_value_by_enum(arg_7, None)
                arg_8.Func(arg_6, arg_2=arg_2)
                arg_0._attributes.append(arg_8)
            else:
                break

        arg_0.is_oversized(arg_6)

Read the data stream and decode the Attributes structure into its
        parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a read method.
            kmip_version (enum): A KMIPVersion enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 2.0.

        Raises:
            AttributeNotSupported: Raised if an unsupported attribute is
                encountered while decoding.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the Attributes object.

Read the data stream and decode the Attributes structure into its parts .


def Func ( arg_0 , arg_1 ) : arg_2 = os . path . join ( arg_0 . dirs . edits , arg_1 . name + "-tmp-umap1.fastq" ) arg_3 = os . path . join ( arg_0 . dirs . edits , arg_1 . name + "-tmp-umap2.fastq" ) arg_4 = os . path . join ( arg_0 . dirs . refmapping , arg_1 . name + "-unmapped.bam" ) arg_5 = os . path . join ( arg_0 . dirs . refmapping , arg_1 . name + ".sam" ) arg_6 = os . path . join ( arg_0 . dirs . edits , arg_1 . name + "-split1.fastq" ) arg_7 = os . path . join ( arg_0 . dirs . edits , arg_1 . name + "-split2.fastq" ) arg_8 = os . path . join ( arg_0 . dirs . edits , arg_1 . name + "-refmap_derep.fastq" ) for arg_9 in [ arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 ] : try : os . remove ( arg_9 ) except : pass

def Func(arg_0, arg_1):
    """
    Clean up a bunch of loose files.
    """
    arg_2 = os.path.join(arg_0.dirs.edits, arg_1.name+"-tmp-umap1.fastq")
    arg_3 = os.path.join(arg_0.dirs.edits, arg_1.name+"-tmp-umap2.fastq")
    arg_4 = os.path.join(arg_0.dirs.refmapping, arg_1.name+"-unmapped.bam")
    arg_5 = os.path.join(arg_0.dirs.refmapping, arg_1.name+".sam")
    arg_6 = os.path.join(arg_0.dirs.edits, arg_1.name+"-split1.fastq")
    arg_7 = os.path.join(arg_0.dirs.edits, arg_1.name+"-split2.fastq")
    arg_8 = os.path.join(arg_0.dirs.edits, arg_1.name+"-refmap_derep.fastq")
    for arg_9 in [arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8]:
        try:
            os.remove(arg_9)
        except:
            pass


def Func ( arg_0 : arg_1 ) -> Callable [ ... , arg_1 ] : def Funced ( * arg_2 , ** arg_3 ) : return arg_0 return Funced

def Func(arg_0: arg_1) -> Callable[..., arg_1]:
    """Produce a function that always returns a supplied value.

    Args:
        x: Any object.

    Returns:
        A function that accepts any number of positional and keyword arguments, discards them, and returns ``x``.
    """

    def Funced(*arg_2, **arg_3):
        return arg_0

    return Funced

Produce a function that always returns a supplied value .


def Func ( arg_0 = 20 ) : arg_1 , arg_2 = np . polynomial . hermite . hermgauss ( arg_0 * 2 ) arg_1 = arg_1 [ arg_0 : ] arg_2 = arg_2 [ arg_0 : ] * np . exp ( arg_1 * arg_1 ) return arg_1 , arg_2

def Func(arg_0=20):
    """Returns Hermite-Gauss quadrature points for even functions"""
    arg_1, arg_2 = np.polynomial.hermite.hermgauss(arg_0*2)
    arg_1 = arg_1[arg_0:]
    arg_2 = arg_2[arg_0:] * np.exp(arg_1*arg_1)
    return arg_1, arg_2

Returns Hermite - Gauss quadrature points for even functions


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
arg_3
==
0
:
return
StringIO
(
)
arg_4
=
with
open
(
arg_1
,
'rb'
)
as
f
:
f
.
seek
(
arg_2
)
arg_4
=
f
.
read
(
arg_3
)
if
not
arg_4
:
raise
Failure
(
'Unable to read data from source: %s'
%
arg_1
)
return
StringIO
(
arg_4
)

def Func(arg_0, arg_1, arg_2, arg_3):
    '''Read local file chunk'''
    if arg_3==0:
        return StringIO()
    arg_4 = None
    with open(arg_1, 'rb') as f:
      f.seek(arg_2)
      arg_4 = f.read(arg_3)
    if not arg_4:
      raise Failure('Unable to read data from source: %s' % arg_1)
    return StringIO(arg_4)


def Func(arg_0, arg_1, arg_2, arg_3):
        """ Genius idea by Alexey Lavrenyuk """
        logger.debug("Original JMX: %s", os.path.realpath(arg_1))
        with open(arg_1, 'r') as src_jmx:
            arg_4 = src_jmx.readlines()

        try:
            # In new Jmeter version (3.2 as example) WorkBench's plugin checkbox enabled by default
            # It totally crashes Yandex tank injection and raises XML Parse Exception
            arg_5 = arg_4.pop(-1)
            if "WorkBenchGui" in arg_4[-5]:
                logger.info("WorkBench checkbox enabled...bypassing")
                arg_6 = 6
            else:
                arg_6 = 2
            while arg_6 > 0:
                arg_5 = arg_4.pop(-1) + arg_5
                arg_6 -= 1
            logger.debug("Closing statement: %s", arg_5)
        except Exception as exc:
            raise RuntimeError("Failed to find the end of JMX XML: %s" % exc)

        arg_7 = resource_string(__name__, 'config/jmeter_var_template.xml')
        arg_8 = []
        for arg_9, arg_10 in arg_3.iteritems():
            arg_8.append(arg_7 % (arg_9, arg_9, arg_10))
        arg_11 = "\n".join(arg_8)

        if arg_0.jmeter_ver >= 2.13:
            arg_12 = '<connectTime>true</connectTime>'
        else:
            arg_12 = ''

        if arg_0.ext_log in ['errors', 'all']:
            arg_13 = {'errors': 'true', 'all': 'false'}
            arg_14 = 'jmeter_writer_ext.xml'
            arg_15 = {
                'jtl': arg_0.jtl_file,
                'udv': arg_11,
                'ext_log': arg_0.ext_log_file,
                'ext_level': arg_13[arg_0.ext_log],
                'save_connect': arg_12
            }
        else:
            arg_14 = 'jmeter_writer.xml'
            arg_15 = {
                'jtl': arg_0.jtl_file,
                'udv': arg_11,
                'save_connect': arg_12
            }

        arg_16 = resource_string(__name__, 'config/' + arg_14)

        try:
            arg_17 = arg_0.core.mkstemp(
                '.jmx', 'modified_', os.path.dirname(os.path.realpath(arg_1)))
        except OSError as exc:
            logger.debug("Can't create modified jmx near original: %s", exc)
            arg_17 = arg_0.core.mkstemp('.jmx', 'modified_')
        logger.debug("Modified JMX: %s", arg_17)
        with open(arg_17, "wb") as fh:
            fh.write(''.join(arg_4))
            fh.write(arg_16 % arg_15)
            fh.write(arg_5)
        return arg_17


def Func ( arg_0 ) : try : return nx . is_weakly_connected ( arg_0 . graph ) except nx . exception . NetworkXException : return False

def Func(arg_0):
        """
        Test if the graph is connected.

        Return True if connected, False otherwise
        """
        try:
            return nx.is_weakly_connected(arg_0.graph)
        except nx.exception.NetworkXException:
            return False


def Func ( arg_0 , arg_1 ) : del arg_1 with tf . compat . v1 . name_scope ( arg_0 . _name ) : return tfd . MultivariateNormalDiag ( arg_0 . loc , arg_0 . scale_diag )

def Func(arg_0, arg_1):
    """Runs the model to generate multivariate normal distribution.

    Args:
      inputs: Unused.

    Returns:
      A MultivariateNormalDiag distribution with event shape
      [dimensions], batch shape [], and sample shape [sample_shape,
      dimensions].
    """
    del arg_1  # unused
    with tf.compat.v1.name_scope(arg_0._name):
      return tfd.MultivariateNormalDiag(arg_0.loc, arg_0.scale_diag)

Runs the model to generate multivariate normal distribution .


def Func ( arg_0 ) : arg_1 = arg_0 . module arg_2 = arg_0 . subcommands if arg_2 : arg_3 = inspect . getdoc ( arg_1 ) Func = Parser ( description = arg_3 , arg_1 = arg_1 ) arg_5 = Func . add_subparsers ( ) for arg_6 , arg_7 in arg_2 . items ( ) : arg_6 = arg_6 . replace ( "_" , "-" ) arg_8 = inspect . getdoc ( arg_7 ) arg_9 = arg_5 . add_parser ( arg_6 , arg_7 = arg_7 , help = arg_8 ) else : Func = Parser ( arg_7 = arg_0 . callbacks [ arg_0 . function_name ] , arg_1 = arg_1 ) return Func

def Func(arg_0):
        """return the parser for the current name"""
        arg_1 = arg_0.module

        arg_2 = arg_0.subcommands
        if arg_2:
            arg_3 = inspect.getdoc(arg_1)
            Func = Parser(description=arg_3, arg_1=arg_1)
            arg_5 = Func.add_subparsers()

            for arg_6, arg_7 in arg_2.items():
                arg_6 = arg_6.replace("_", "-")
                arg_8 = inspect.getdoc(arg_7)
                arg_9 = arg_5.add_parser(
                    arg_6,
                    arg_7=arg_7,
                    help=arg_8
                )

        else:
            Func = Parser(arg_7=arg_0.callbacks[arg_0.function_name], arg_1=arg_1)

        return Func


def Func ( arg_0 ) : arg_1 = { "model_id" : "name" , "response_column" : "column_name" , "training_frame" : "name" , "validation_frame" : "name" } arg_2 = { } for arg_3 in arg_0 . parms : if arg_3 in arg_1 . keys ( ) : arg_2 [ arg_3 ] = arg_0 . parms [ arg_3 ] [ "actual_value" ] . get ( arg_1 [ arg_3 ] , None ) else : arg_2 [ arg_3 ] = arg_0 . parms [ arg_3 ] [ "actual_value" ] return arg_2

def Func(arg_0):
        """Dictionary of actual parameters of the model."""
        arg_1 = {"model_id": "name",
                            "response_column": "column_name",
                            "training_frame": "name",
                            "validation_frame": "name"}
        arg_2 = {}
        for arg_3 in arg_0.parms:
            if arg_3 in arg_1.keys():
                arg_2[arg_3] = arg_0.parms[arg_3]["actual_value"].get(arg_1[arg_3], None)
            else:
                arg_2[arg_3] = arg_0.parms[arg_3]["actual_value"]
        return arg_2

Dictionary of actual parameters of the model .


return  self._do_autopaginating_api_call(
            path='hostedzone',
            params={'maxitems': page_chunks},
            method='GET',
            parser_func=xml_parsers.list_hosted_zones_parser,
            next_marker_xpath="./{*}NextMarker",
            next_marker_param_name="marker",
        )

def Func ( arg_0 , arg_1 = 100 ) : return arg_0 . _do_autopaginating_api_call ( path = 'hostedzone' , params = { 'maxitems' : arg_1 } , method = 'GET' , parser_func = xml_parsers . Func_parser , next_marker_xpath = "./{*}NextMarker" , next_marker_param_name = "marker" , )

def Func(arg_0, arg_1=100):
        """
        List all hosted zones associated with this connection's account. Since
        this method returns a generator, you can pull as many or as few
        entries as you'd like, without having to query and receive every
        hosted zone you may have.

        :keyword int page_chunks: This API call is "paginated" behind-the-scenes
            in order to break up large result sets. This number determines
            the maximum number of
            :py:class:`HostedZone <route53.hosted_zone.HostedZone>`
            instances to retrieve per request. The default is fine for almost
            everyone.

        :rtype: generator
        :returns: A generator of :py:class:`HostedZone <route53.hosted_zone.HostedZone>`
            instances.
        """

        return  arg_0._do_autopaginating_api_call(
            path='hostedzone',
            params={'maxitems': arg_1},
            method='GET',
            parser_func=xml_parsers.Func_parser,
            next_marker_xpath="./{*}NextMarker",
            next_marker_param_name="marker",
        )

List all hosted zones associated with this connection s account . Since this method returns a generator you can pull as many or as few entries as you d like without having to query and receive every hosted zone you may have .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . Funcs ( ) : if arg_2 . node . name == arg_1 : return arg_2 raise KeyError ( arg_1 )

def Func(arg_0, arg_1):
        """return a class by its name, raise KeyError if not found
        """
        for arg_2 in arg_0.Funcs():
            if arg_2.node.name == arg_1:
                return arg_2
        raise KeyError(arg_1)

return a class by its name raise KeyError if not found


def Func(arg_0, arg_1, arg_2):
    """Renders the template and fires the signal"""
    arg_3 = arg_0.render(arg_1)
    templateFunced.send(arg_2, arg_0=arg_0, arg_1=arg_1)
    return arg_3


def Func(arg_0):
    """Parse a list of validator names or n-tuples, checking for errors.

    Returns:
        list((func_name, [args...])): A list of validator function names and a
            potentially empty list of optional parameters for each function.
    """

    arg_1 = []

    for arg_2 in arg_0:
        if isinstance(arg_2, str):
            arg_3 = []
        elif len(arg_2) > 1:
            arg_3 = arg_2[1:]
            arg_2 = arg_2[0]
        else:
            raise ValidationError("You must pass either an n-tuple or a string to define a validator", validator=arg_2)

        arg_4 = "validate_%s" % str(arg_2)
        arg_1.append((arg_4, arg_3))

    return arg_1

Parse a list of validator names or n - tuples checking for errors .


def
Func
(
arg_0
)
:
try
:
arg_1
=
initializers
.
load_tiff
(
arg_0
.
filename
)
arg_1
=
initializers
.
normalize
(
arg_1
,
invert
=
arg_0
.
invert
,
scale
=
arg_0
.
exposure
,
dtype
=
arg_0
.
float_precision
)
except
IOError
as
e
:
log
.
error
(
"Could not find image '%s'"
%
arg_0
.
filename
)
raise
e
return
arg_1

def Func(arg_0):
        """ Read the file and perform any transforms to get a loaded image """
        try:
            arg_1 = initializers.load_tiff(arg_0.filename)
            arg_1 = initializers.normalize(
                arg_1, invert=arg_0.invert, scale=arg_0.exposure,
                dtype=arg_0.float_precision
            )
        except IOError as e:
            log.error("Could not find image '%s'" % arg_0.filename)
            raise e

        return arg_1


def Func(arg_0, arg_1):
        """
        Begin processing a batch operations request.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "operations": array*
            [
                {
                    "method": string* (Must be one of "GET", "POST", "PUT", "PATCH", or "DELETE")
                    "path": string*,
                }
            ]
        }
        """
        if 'operations' not in arg_1:
            raise KeyError('The batch must have operations')
        for arg_2 in arg_1['operations']:
            if 'method' not in arg_2:
                raise KeyError('The batch operation must have a method')
            if arg_2['method'] not in ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']:
                raise ValueError('The batch operation method must be one of "GET", "POST", "PUT", "PATCH", '
                                 'or "DELETE", not {0}'.format(arg_2['method']))
            if 'path' not in arg_2:
                raise KeyError('The batch operation must have a path')
        return arg_0._mc_client._post(url=arg_0._build_path(), arg_1=arg_1)

Begin processing a batch operations request .


def Func(arg_0, arg_1):
        """This is how an instance is created when we read a
           MatlabObject from a MAT file.
        """
        arg_2 = OctaveUserClass.__new__(arg_0)
        arg_2._address = '%s_%s' % (arg_2._name, id(arg_2))
        arg_2._ref().push(arg_2._address, arg_1)
        return arg_2

This is how an instance is created when we read a MatlabObject from a MAT file .


(age, planetdist, coremass,
               mass='massjupiter',
               radius='radiusjupiter')

def Func(arg_0, arg_1, arg_2,
               arg_3='massjupiter',
               arg_4='radiusjupiter'):
    '''This function gets the Fortney mass-radius relation for planets.

    Parameters
    ----------

    age : float
        This should be one of: 0.3, 1.0, 4.5 [in Gyr].

    planetdist : float
        This should be one of: 0.02, 0.045, 0.1, 1.0, 9.5 [in AU]

    coremass : int
        This should be one of: 0, 10, 25, 50, 100 [in Mearth]

    mass : {'massjupiter','massearth'}
        Sets the mass units.

    radius : str
        Sets the radius units. Only 'radiusjupiter' is used for now.

    Returns
    -------

    dict
        A dict of the following form is returned::

            {'mass': an array containing the masses to plot),
             'radius': an array containing the radii to plot}

        These can be passed to a plotting routine to make mass-radius plot for
        the specified age, planet-star distance, and core-mass.

    '''

    arg_5 = {0.3:MASSESRADII_0_3GYR,
          1.0:MASSESRADII_1_0GYR,
          4.5:MASSESRADII_4_5GYR}

    if arg_0 not in arg_5:
        print('given age not in Fortney 2007, returning...')
        return

    Func = arg_5[arg_0]

    if (arg_1 in Func) and (arg_2 in Func[arg_1]):

        print('getting % Gyr M-R for planet dist %s AU, '
              'core mass %s Mearth...' % (arg_0, arg_1, arg_2))

        arg_7 = Func[arg_1][arg_2]

        arg_8 = {'mass':array(arg_7[arg_3]),
                   'radius':array(arg_7[arg_4])}

        return arg_8

This function gets the Fortney mass - radius relation for planets .


return self.get_data(
            "domains/%s/records/%s" % (self.domain, self.id),
            type=DELETE,
        )

def Func ( arg_0 ) : return arg_0 . get_data ( "domains/%s/records/%s" % ( arg_0 . domain , arg_0 . id ) , type = DELETE , )

def Func(arg_0):
        """
            Destroy the record
        """
        return arg_0.get_data(
            "domains/%s/records/%s" % (arg_0.domain, arg_0.id),
            type=DELETE,
        )


(cls, name, method: [str, Set, List], url=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
:
[
arg_3
,
arg_4
,
arg_5
]
,
arg_6
=
)
:
if
not
isinstance
(
arg_2
,
(
arg_3
,
list
,
set
,
tuple
)
)
:
raise
BaseException
(
'Invalid type of method: %s'
%
type
(
arg_2
)
.
__name__
)
if
isinstance
(
arg_2
,
arg_3
)
:
arg_2
=
{
arg_2
}
arg_0
.
_interface
[
arg_1
]
=
[
{
'method'
:
arg_2
,
'url'
:
arg_6
}
]

def Func(arg_0, arg_1, arg_2: [arg_3, arg_4, arg_5], arg_6=None):
        """ interface helper function"""
        if not isinstance(arg_2, (arg_3, list, set, tuple)):
            raise BaseException('Invalid type of method: %s' % type(arg_2).__name__)

        if isinstance(arg_2, arg_3):
            arg_2 = {arg_2}

        # TODO: check methods available
        arg_0._interface[arg_1] = [{'method': arg_2, 'url': arg_6}]


def Func(arg_0):
        """
        Convert an OpenSSL native context error failure into a Python
        exception.

        When a call to native OpenSSL X509_verify_cert fails, additional
        information about the failure can be obtained from the store context.
        """
        arg_1 = [
            _lib.X509_STORE_CTX_get_error(arg_0._store_ctx),
            _lib.X509_STORE_CTX_get_error_depth(arg_0._store_ctx),
            _native(_ffi.string(_lib.X509_verify_cert_error_string(
                _lib.X509_STORE_CTX_get_error(arg_0._store_ctx)))),
        ]
        # A context error should always be associated with a certificate, so we
        # expect this call to never return :class:`None`.
        arg_2 = _lib.X509_STORE_CTX_get_current_cert(arg_0._store_ctx)
        arg_3 = _lib.X509_dup(arg_2)
        arg_4 = X509._from_raw_x509_ptr(arg_3)
        return X509StoreContextError(arg_1, arg_4)

Convert an OpenSSL native context error failure into a Python exception .


def Func ( arg_0 , arg_1 ) : arg_2 = False for arg_3 in arg_0 . f_get_explored_parameters ( ) : if arg_3 in arg_1 : arg_2 = True break return arg_2

def Func(arg_0, arg_1):
    """Checks if one the parameters in `group_node` is explored.

    :param traj: Trajectory container
    :param group_node: Group node
    :return: `True` or `False`

    """
    arg_2 = False
    for arg_3 in arg_0.f_get_explored_parameters():
            if arg_3 in arg_1:
                arg_2 = True
                break

    return arg_2

Checks if one the parameters in group_node is explored .


def Func ( arg_0 , arg_1 , arg_2 = 'llnl' ) : arg_3 = ( '../github-data/' + arg_2 + '/' + arg_1 . name + '/commits' ) arg_4 = False if not os . path . exists ( arg_3 ) : arg_5 = arg_1 . iter_commits ( ) arg_4 = True else : arg_6 = os . listdir ( arg_3 ) arg_7 = str ( arg_6 [ - 1 ] [ : - 5 ] ) if arg_7 == str ( datetime . date . today ( ) ) : if len ( arg_6 ) > 2 : arg_7 = str ( arg_6 [ - 2 ] [ : - 5 ] ) else : arg_5 = arg_1 . iter_commits ( ) arg_4 = True if not arg_4 : arg_5 = arg_1 . iter_commits ( since = arg_7 ) for arg_8 in arg_5 : arg_0 . commits_json [ arg_1 . name ] . append ( arg_8 . to_json ( ) ) arg_9 = 0 for arg_8 in arg_1 . iter_commits ( ) : arg_9 += 1 return arg_9

def Func(arg_0, arg_1, arg_2='llnl'):
        """
        Retrieves the number of commits to a repo in the organization. If it is
        the first time getting commits for a repo, it will get all commits and
        save them to JSON. If there are previous commits saved, it will only get
        commits that have not been saved to disk since the last date of commits.
        """
        #JSON
        arg_3 = ('../github-data/' + arg_2 + '/' + arg_1.name + '/commits')
        arg_4 = False
        if not os.path.exists(arg_3): #no previous path, get all commits
            arg_5 = arg_1.iter_commits()
            arg_4 = True
        else:
            arg_6 = os.listdir(arg_3)
            arg_7 = str(arg_6[-1][:-5])
            if arg_7 == str(datetime.date.today()):
                #most recent date is actually today, get previous most recent date
                if len(arg_6) > 2:
                    arg_7 = str(arg_6[-2][:-5])
                else:
                    #This means there is only one file, today. Retrieve every commit
                    arg_5 = arg_1.iter_commits()
                    arg_4 = True
            if not arg_4:#there's a previous saved JSON that's not today
                arg_5 = arg_1.iter_commits(since=arg_7)
        for arg_8 in arg_5:
            arg_0.commits_json[arg_1.name].append(arg_8.to_json())
        #for csv
        arg_9 = 0
        for arg_8 in arg_1.iter_commits():
            arg_9 += 1
        return arg_9

Retrieves the number of commits to a repo in the organization . If it is the first time getting commits for a repo it will get all commits and save them to JSON . If there are previous commits saved it will only get commits that have not been saved to disk since the last date of commits .


return ''.join([indentation + i.strip() + newline
                    for i in sorted(imports.split(','))])

def
Func
(
arg_0
)
:
assert
'\\'
not
in
arg_0
assert
'('
not
in
arg_0
assert
')'
not
in
arg_0
assert
';'
not
in
arg_0
assert
'#'
not
in
arg_0
assert
not
arg_0
.
lstrip
(
)
.
startswith
(
'from'
)
arg_1
=
get_line_ending
(
arg_0
)
if
not
arg_1
:
return
arg_0
(
arg_2
,
arg_3
)
=
re
.
split
(
pattern
=
r'\bimport\b'
,
string
=
arg_0
,
maxsplit
=
1
)
arg_2
+=
'import '
assert
arg_1
return
''
.
join
(
[
arg_2
+
arg_4
.
strip
(
)
+
arg_1
for
arg_4
in
sorted
(
arg_3
.
split
(
','
)
)
]
)

def Func(arg_0):
    """Return line with imports on separate lines."""
    assert '\\' not in arg_0
    assert '(' not in arg_0
    assert ')' not in arg_0
    assert ';' not in arg_0
    assert '#' not in arg_0
    assert not arg_0.lstrip().startswith('from')

    arg_1 = get_line_ending(arg_0)
    if not arg_1:
        return arg_0

    (arg_2, arg_3) = re.split(pattern=r'\bimport\b',
                                      string=arg_0, maxsplit=1)

    arg_2 += 'import '
    assert arg_1

    return ''.join([arg_2 + arg_4.strip() + arg_1
                    for arg_4 in sorted(arg_3.split(','))])

Return line with imports on separate lines .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = BytesIO ( ) write_var_header ( arg_3 , arg_1 ) if not isinstance ( arg_2 , basestring ) and arg_1 [ 'dims' ] [ 0 ] > 1 : arg_2 = list ( chain . from_iterable ( izip ( * arg_2 ) ) ) write_elements ( arg_3 , arg_1 [ 'mtp' ] , arg_2 ) arg_4 = arg_3 . getvalue ( ) arg_3 . close ( ) write_var_data ( arg_0 , arg_4 )

def Func(arg_0, arg_1, arg_2):
    """Write the numeric array"""
    # make a memory file for writing array data
    arg_3 = BytesIO()

    # write matrix header to memory file
    write_var_header(arg_3, arg_1)

    if not isinstance(arg_2, basestring) and arg_1['dims'][0] > 1:
        # list array data in column major order
        arg_2 = list(chain.from_iterable(izip(*arg_2)))

    # write matrix data to memory file
    write_elements(arg_3, arg_1['mtp'], arg_2)

    # write the variable to disk file
    arg_4 = arg_3.getvalue()
    arg_3.close()
    write_var_data(arg_0, arg_4)


def Func ( arg_0 , arg_1 ) : if not arg_0 . important_sub_metrics : return False if arg_1 in arg_0 . important_sub_metrics : return True arg_2 = arg_1 . split ( '.' ) if arg_2 [ - 1 ] in arg_0 . important_sub_metrics : return True return False

def Func(arg_0, arg_1):
    """
    check whether the given sub metric is in important_sub_metrics list
    """
    if not arg_0.important_sub_metrics:
      return False
    if arg_1 in arg_0.important_sub_metrics:
      return True
    arg_2 = arg_1.split('.')
    if arg_2[-1] in arg_0.important_sub_metrics:
      return True
    return False


def
Func
(
arg_0
,
arg_1
)
:
if
(
arg_1
not
in
arg_0
.
transmissions
)
:
raise
NoMatchError
(
'no matches found'
)
else
:
arg_2
=
arg_0
.
transmissions
[
arg_1
]
return
sorted
(
(
(
arg_3
,
arg_4
)
for
arg_3
,
arg_4
in
arg_2
.
iteritems
(
)
if
arg_4
!=
0
)
,
reverse
=
True
)

def Func(arg_0, arg_1):
        """
        pass in a word string that you
        would like to see probable matches for.
        """
        if (arg_1 not in arg_0.transmissions):
            raise NoMatchError('no matches found')
        else:
            arg_2 = arg_0.transmissions[arg_1]
            # print out a sorted list of all non-zero trans
            return sorted(((arg_3, arg_4) for arg_3, arg_4 in arg_2.iteritems() if arg_4 != 0),
                                                                reverse=True)

pass in a word string that you would like to see probable matches for .


return any(
            col == 'deleted'
            for col in record.get('collections', [])
        )

def Func ( arg_0 , arg_1 = None ) : arg_1 = arg_1 or arg_0 . revisions [ - 1 ] [ 1 ] return any ( arg_2 == 'deleted' for arg_2 in arg_1 . get ( 'collections' , [ ] ) )

def Func(arg_0, arg_1=None):
        """Check if record is deleted."""
        arg_1 = arg_1 or arg_0.revisions[-1][1]
        return any(
            arg_2 == 'deleted'
            for arg_2 in arg_1.get('collections', [])
        )


def Func ( arg_0 ) -> list : arg_1 = [ control . Func ( ) for control in arg_0 . controls ] return arg_1

def Func(arg_0) -> list:
        """Returns list of MS Bot Framework compatible states of the
        RichMessage instance nested controls.

        Returns:
            ms_bf_controls: MS Bot Framework representation of RichMessage instance
                nested controls.
        """
        arg_1 = [control.Func() for control in arg_0.controls]
        return arg_1

Returns list of MS Bot Framework compatible states of the RichMessage instance nested controls .


def
Func
(
arg_0
)
:
try
:
try
:
arg_1
=
scoop
.
IS_ORIGIN
except
AttributeError
:
arg_1
=
True
if
not
arg_1
:
_configure_niceness
(
arg_0
)
_configure_logging
(
arg_0
)
return
_single_run
(
arg_0
)
except
Exception
:
scoop
.
logger
.
exception
(
'ERROR occurred during a single run!'
)
raise

def Func(arg_0):
    """Wrapper function for scoop, that does not configure logging"""
    try:
        try:
            arg_1 = scoop.IS_ORIGIN
        except AttributeError:
            # scoop is not properly started, i.e. with `python -m scoop...`
            # in this case scoop uses default `map` function, i.e.
            # the main process
            arg_1 = True
        if not arg_1:
            # configure logging and niceness if not the main process:
            _configure_niceness(arg_0)
            _configure_logging(arg_0)
        return _single_run(arg_0)
    except Exception:
        scoop.logger.exception('ERROR occurred during a single run!')
        raise

Wrapper function for scoop that does not configure logging


def Func ( arg_0 ) : arg_1 = arg_0 . param_dict [ arg_0 . lbl_theta ] arg_2 = np . array ( [ [ np . cos ( arg_1 ) , - np . sin ( arg_1 ) , 0 ] , [ np . sin ( arg_1 ) , np . cos ( arg_1 ) , 0 ] , [ 0 , 0 , 1 ] ] ) arg_3 = arg_0 . param_dict [ arg_0 . lbl_phi ] arg_4 = np . array ( [ [ np . cos ( arg_3 ) , 0 , np . sin ( arg_3 ) ] , [ 0 , 1 , 0 ] , [ - np . sin ( arg_3 ) , 0 , np . cos ( arg_3 ) ] ] ) return np . dot ( arg_4 , arg_2 )

def Func(arg_0):
        """
        Generate the composite rotation matrix that rotates the slab normal.

        The rotation is a rotation about the x-axis, followed by a rotation
        about the z-axis.
        """
        arg_1 = arg_0.param_dict[arg_0.lbl_theta]
        arg_2 = np.array([ [np.cos(arg_1),  -np.sin(arg_1), 0],
                        [np.sin(arg_1), np.cos(arg_1), 0],
                        [0, 0, 1]])

        arg_3 = arg_0.param_dict[arg_0.lbl_phi]
        arg_4 = np.array([ [np.cos(arg_3), 0, np.sin(arg_3)],
                        [0, 1, 0],
                        [-np.sin(arg_3), 0, np.cos(arg_3)]])
        return np.dot(arg_4, arg_2)

Generate the composite rotation matrix that rotates the slab normal .


return H2OFrame._expr(expr=ExprNode("distance", self, y, measure))._frame()

def Func ( arg_0 , arg_1 , arg_2 = None ) : assert_is_type ( arg_1 , H2OFrame ) if arg_2 is None : arg_2 = "l2" return H2OFrame . _expr ( expr = ExprNode ( "Func" , arg_0 , arg_1 , arg_2 ) ) . _frame ( )

def Func(arg_0, arg_1, arg_2=None):
        """
        Compute a pairwise Func measure between all rows of two numeric H2OFrames.

        :param H2OFrame y: Frame containing queries (small)
        :param str use: A string indicating what Func measure to use. Must be one of:

            - ``"l1"``:        Absolute Func (L1-norm, >=0)
            - ``"l2"``:        Euclidean Func (L2-norm, >=0)
            - ``"cosine"``:    Cosine similarity (-1...1)
            - ``"cosine_sq"``: Squared Cosine similarity (0...1)

        :examples:
          >>>
          >>> iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
          >>> references = iris_h2o[10:150,0:4
          >>> queries    = iris_h2o[0:10,0:4]
          >>> A = references.Func(queries, "l1")
          >>> B = references.Func(queries, "l2")
          >>> C = references.Func(queries, "cosine")
          >>> D = references.Func(queries, "cosine_sq")
          >>> E = queries.Func(references, "l1")
          >>> (E.transpose() == A).all()

        :returns: An H2OFrame of the matrix containing pairwise Func / similarity between the
            rows of this frame (N x p) and ``y`` (M x p), with dimensions (N x M).
        """
        assert_is_type(arg_1, H2OFrame)
        if arg_2 is None: arg_2 = "l2"
        return H2OFrame._expr(expr=ExprNode("Func", arg_0, arg_1, arg_2))._frame()

Compute a pairwise distance measure between all rows of two numeric H2OFrames.

        :param H2OFrame y: Frame containing queries (small)
        :param str use: A string indicating what distance measure to use. Must be one of:

            - ``"l1"``:        Absolute distance (L1-norm, >=0)
            - ``"l2"``:        Euclidean distance (L2-norm, >=0)
            - ``"cosine"``:    Cosine similarity (-1...1)
            - ``"cosine_sq"``: Squared Cosine similarity (0...1)

        :examples:
          >>>
          >>> iris_h2o = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris.csv"))
          >>> references = iris_h2o[10:150,0:4
          >>> queries    = iris_h2o[0:10,0:4]
          >>> A = references.distance(queries, "l1")
          >>> B = references.distance(queries, "l2")
          >>> C = references.distance(queries, "cosine")
          >>> D = references.distance(queries, "cosine_sq")
          >>> E = queries.distance(references, "l1")
          >>> (E.transpose() == A).all()

        :returns: An H2OFrame of the matrix containing pairwise distance / similarity between the
            rows of this frame (N x p) and ``y`` (M x p), with dimensions (N x M).

Compute a pairwise distance measure between all rows of two numeric H2OFrames .


def Func(arg_0):
    """
    Retrieves the contents of the specified file.

    This function performs simple caching so that the same file isn't read more
    than once per process.

    :param filepath: the file to read
    :type filepath: str
    :returns: str
    """

    with _FILE_CACHE_LOCK:
        if arg_0 not in arg_1:
            arg_1[arg_0] = _Func(arg_0)
    return arg_1[arg_0]

Retrieves the contents of the specified file .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _get_object_handle ( arg_1 , arg_2 ) arg_4 = [ ] if arg_3 . AXEnabled : arg_4 . append ( "enabled" ) if arg_3 . AXFocused : arg_4 . append ( "focused" ) else : try : if arg_3 . AXFocused : arg_4 . append ( "focusable" ) except : pass if re . match ( "AXCheckBox" , arg_3 . AXRole , re . M | re . U | re . L ) or re . match ( "AXRadioButton" , arg_3 . AXRole , re . M | re . U | re . L ) : if arg_3 . AXValue : arg_4 . append ( "checked" ) return arg_4

def Func(arg_0, arg_1, arg_2):
        """
        Get all states of given object

        @param window_name: Window name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string

        @return: list of string on success.
        @rtype: list
        """
        arg_3 = arg_0._get_object_handle(arg_1, arg_2)
        arg_4 = []
        if arg_3.AXEnabled:
            arg_4.append("enabled")
        if arg_3.AXFocused:
            arg_4.append("focused")
        else:
            try:
                if arg_3.AXFocused:
                    arg_4.append("focusable")
            except:
                pass
        if re.match("AXCheckBox", arg_3.AXRole, re.M | re.U | re.L) or \
                re.match("AXRadioButton", arg_3.AXRole,
                         re.M | re.U | re.L):
            if arg_3.AXValue:
                arg_4.append("checked")
        return arg_4


def Func(arg_0, arg_1, arg_2):
        """
        Gets the CRC32c checksum of an object in Google Cloud Storage.

        :param bucket_name: The Google cloud storage bucket where the blob_name is.
        :type bucket_name: str
        :param object_name: The name of the object to check in the Google cloud
            storage bucket_name.
        :type object_name: str
        """
        arg_0.log.info('Retrieving the crc32c checksum of '
                      'object_name: %s in bucket_name: %s', arg_2, arg_1)
        arg_3 = arg_0.get_conn()
        arg_4 = arg_3.get_bucket(arg_1=arg_1)
        arg_5 = arg_4.get_blob(blob_name=arg_2)
        arg_5.reload()
        arg_6 = arg_5.crc32c
        arg_0.log.info('The crc32c checksum of %s is %s', arg_2, arg_6)
        return arg_6

Gets the CRC32c checksum of an object in Google Cloud Storage .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if use_lxml : return etree . SubElement ( arg_0 , arg_1 , arg_2 = arg_2 ) return etree . SubElement ( arg_0 , arg_1 )

def Func(arg_0, arg_1, arg_2=None):
    """Wrapper for etree.SubElement, that takes care of unsupported nsmap option."""
    if use_lxml:
        return etree.SubElement(arg_0, arg_1, arg_2=arg_2)
    return etree.SubElement(arg_0, arg_1)

Wrapper for etree . SubElement that takes care of unsupported nsmap option .


Half-duplex SPI read.  If assert_ss is true, the SS line will be
        asserted low, the specified length of bytes will be clocked in the MISO
        line, and if deassert_ss is true the SS line will be put back high.
        Bytes which are read will be returned as a bytearray object.

(self, length, assert_ss=True, deassert_ss=True)

def Func(arg_0, arg_1, arg_2=True, arg_3=True):
        """Half-duplex SPI Func.  If assert_ss is true, the SS line will be
        asserted low, the specified length of bytes will be clocked in the MISO
        line, and if deassert_ss is true the SS line will be put back high.
        Bytes which are Func will be returned as a bytearray object.
        """
        if arg_0._miso is None:
            raise RuntimeError('Read attempted with no MISO pin specified.')
        if arg_2 and arg_0._ss is not None:
            arg_0._gpio.set_low(arg_0._ss)
        arg_4 = bytearray(arg_1)
        for arg_5 in range(arg_1):
            for arg_6 in range(8):
                # Flip clock off base.
                arg_0._gpio.output(arg_0._sclk, not arg_0._clock_base)
                # Handle Func on leading edge of clock.
                if arg_0._Func_leading:
                    if arg_0._gpio.is_high(arg_0._miso):
                        # Set bit to 1 at appropriate location.
                        arg_4[arg_5] |= arg_0._Func_shift(arg_0._mask, arg_6)
                    else:
                        # Set bit to 0 at appropriate location.
                        arg_4[arg_5] &= ~arg_0._Func_shift(arg_0._mask, arg_6)
                # Return clock to base.
                arg_0._gpio.output(arg_0._sclk, arg_0._clock_base)
                # Handle Func on trailing edge of clock.
                if not arg_0._Func_leading:
                    if arg_0._gpio.is_high(arg_0._miso):
                        # Set bit to 1 at appropriate location.
                        arg_4[arg_5] |= arg_0._Func_shift(arg_0._mask, arg_6)
                    else:
                        # Set bit to 0 at appropriate location.
                        arg_4[arg_5] &= ~arg_0._Func_shift(arg_0._mask, arg_6)
        if arg_3 and arg_0._ss is not None:
            arg_0._gpio.set_high(arg_0._ss)
        return arg_4

Half - duplex SPI read . If assert_ss is true the SS line will be asserted low the specified length of bytes will be clocked in the MISO line and if deassert_ss is true the SS line will be put back high . Bytes which are read will be returned as a bytearray object .


def
Func
(
arg_0
,
arg_1
=
1
)
:
sys
.
stderr
.
write
(
'ERROR: {}\n'
.
format
(
arg_0
)
)
sys
.
stderr
.
flush
(
)
sys
.
exit
(
arg_1
)

def Func(arg_0, arg_1=1):
    """Exit with error code and message."""
    sys.stderr.write('ERROR: {}\n'.format(arg_0))
    sys.stderr.flush()
    sys.exit(arg_1)


def Func ( arg_0 , arg_1 ) : try : arg_2 = int ( arg_1 ) except ValueError : return if not 0 <= arg_2 <= 127 : return return arg_0 . convert_codepoint ( arg_2 )

def Func(arg_0, arg_1):
        """This method fixes a bug in Python's SGMLParser."""
        try:
            arg_2 = int(arg_1)
        except ValueError:
            return
        if not 0 <= arg_2 <= 127 : # ASCII ends at 127, not 255
            return
        return arg_0.convert_codepoint(arg_2)

This method fixes a bug in Python s SGMLParser .


def Func ( arg_0 , arg_1 , arg_2 = None ) : with tf . compat . v1 . name_scope ( arg_2 , "Func" , [ arg_0 ] ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_2 = "logu" ) return 0.5 * ( arg_1 ( arg_0 ) + dual_csiszar_function ( arg_0 , arg_1 ) )

def Func(arg_0, arg_1, arg_2=None):
  """Symmetrizes a Csiszar-function in log-space.

  A Csiszar-function is a member of,

  ```none
  F = { f:R_+ to R : f convex }.
  ```

  The symmetrized Csiszar-function is defined as:

  ```none
  f_g(u) = 0.5 g(u) + 0.5 u g (1 / u)
  ```

  where `g` is some other Csiszar-function.

  We say the function is "symmetrized" because:

  ```none
  D_{f_g}[p, q] = D_{f_g}[q, p]
  ```

  for all `p << >> q` (i.e., `support(p) = support(q)`).

  There exists alternatives for symmetrizing a Csiszar-function. For example,

  ```none
  f_g(u) = max(f(u), f^*(u)),
  ```

  where `f^*` is the dual Csiszar-function, also implies a symmetric
  f-Divergence.

  Example:

  When either of the following functions are symmetrized, we obtain the
  Jensen-Shannon Csiszar-function, i.e.,

  ```none
  g(u) = -log(u) - (1 + u) log((1 + u) / 2) + u - 1
  h(u) = log(4) + 2 u log(u / (1 + u))
  ```

  implies,

  ```none
  f_g(u) = f_h(u) = u log(u) - (1 + u) log((1 + u) / 2)
         = jensen_shannon(log(u)).
  ```

  Warning: this function makes non-log-space calculations and may therefore be
  numerically unstable for `|logu| >> 0`.

  Args:
    logu: `float`-like `Tensor` representing `log(u)` from above.
    csiszar_function: Python `callable` representing a Csiszar-function over
      log-domain.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    symmetrized_g_of_u: `float`-like `Tensor` of the result of applying the
      symmetrization of `g` evaluated at `u = exp(logu)`.
  """

  with tf.compat.v1.name_scope(arg_2, "Func", [arg_0]):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_2="logu")
    return 0.5 * (arg_1(arg_0)
                  + dual_csiszar_function(arg_0, arg_1))

Symmetrizes a Csiszar - function in log - space .


def Func(arg_0, arg_1: arg_2.Price):
        """ Adds the price """
        from decimal import Decimal

        # check if the price already exists in db.
        arg_4 = arg_0.get_price_repository()
        arg_5 = (
            arg_4.query
            .filter(arg_2.Price.namespace == arg_1.namespace)
            .filter(arg_2.Price.symbol == arg_1.symbol)
            .filter(arg_2.Price.date == arg_1.date)
            .filter(arg_2.Price.time == arg_1.time)
            .first()
        )
        if arg_5:
            # Update existing price.
            arg_6 = Decimal(arg_1.value) / Decimal(arg_1.denom)
            arg_0.logger.info(f"Exists: {price}")
            if arg_1.currency != arg_5.currency:
                raise ValueError(
                    f"The currency is different for price {price}!")
            if arg_5.value != arg_1.value:
                arg_5.value = arg_1.value
                arg_0.logger.info(f"Updating to {new_value}.")
            if arg_5.denom != arg_1.denom:
                arg_5.denom = arg_1.denom
        else:
            # Insert new price
            arg_0.session.add(arg_1)
            arg_0.logger.info(f"Added {price}")