def Func(arg_0):
  """Validate a changeset is compatible with Amazon's API spec.

  Args: changeset: lxml.etree.Element (<ChangeResourceRecordSetsRequest>)
  Returns: [ errors ] list of error strings or []."""
  arg_1 = []
  arg_2 = arg_0.findall('.//{%s}Change' % R53_XMLNS)
  arg_3 = len(arg_2)
  if arg_3 == 0:
    arg_1.append('changeset must have at least one <Change> element')
  if arg_3 > 100:
    arg_1.append('changeset has %d <Change> elements: max is 100' % arg_3)
  arg_4 = arg_0.findall('.//{%s}ResourceRecord' % R53_XMLNS)
  arg_5 = len(arg_4)
  if arg_5 > 1000:
    arg_1.append('changeset has %d ResourceRecord elements: max is 1000' % arg_5)
  arg_6 = arg_0.findall('.//{%s}Value' % R53_XMLNS)
  arg_7 = 0
  for arg_8 in arg_6:
    arg_7 += len(arg_8.text)
  if arg_7 > 10000:
    arg_1.append('changeset has %d chars in <Value> text: max is 10000' % arg_7)
  return arg_1

Validate a changeset is compatible with Amazon s API spec .


(source_stash_path,
                  source_passphrase,
                  source_backend,
                  destination_stash_path,
                  destination_passphrase,
                  destination_backend)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
click
.
echo
(
'Migrating all keys from {0} to {1}...'
.
format
(
arg_0
,
arg_3
)
)
try
:
migrate
(
src_path
=
arg_0
,
src_passphrase
=
arg_1
,
src_backend
=
arg_2
,
dst_path
=
arg_3
,
dst_passphrase
=
arg_4
,
dst_backend
=
arg_5
)
except
GhostError
as
ex
:
sys
.
exit
(
ex
)
click
.
echo
(
'Migration complete!'
)

def Func(arg_0,
                  arg_1,
                  arg_2,
                  arg_3,
                  arg_4,
                  arg_5):
    """Migrate all keys from a source stash to a destination stash.

    `SOURCE_STASH_PATH` and `DESTINATION_STASH_PATH` are the paths
    to the stashs you wish to perform the migration on.
    """
    click.echo('Migrating all keys from {0} to {1}...'.format(
        arg_0, arg_3))

    try:
        migrate(
            src_path=arg_0,
            src_passphrase=arg_1,
            src_backend=arg_2,
            dst_path=arg_3,
            dst_passphrase=arg_4,
            dst_backend=arg_5)
    except GhostError as ex:
        sys.exit(ex)
    click.echo('Migration complete!')

Migrate all keys from a source stash to a destination stash .


def Func ( arg_0 , arg_1 , arg_2 ) : assert isinstance ( arg_1 , peewee . Query ) assert isinstance ( arg_2 , dict )

def Func(arg_0, arg_1, arg_2):
        """
        Apply user specified filters to query
        """
        assert isinstance(arg_1, peewee.Query)
        assert isinstance(arg_2, dict)


return pd.rolling_mean(df, window=sur, min_periods=rep * sur)

def Func(arg_0, arg_1=8, arg_2=0.75):
    """
    Calcule de moyennes glissantes

    Paramètres:
    df: DataFrame de mesures sur lequel appliqué le calcul
    sur: (int, par défaut 8) Nombre d'observations sur lequel s'appuiera le
    calcul
    rep: (float, défaut 0.75) Taux de réprésentativité en dessous duquel le
    calcul renverra NaN

    Retourne:
    Un DataFrame des moyennes glissantes calculées
    """
    return pd.rolling_mean(arg_0, window=arg_1, min_periods=arg_2 * arg_1)


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_0
.
proc
.
curframe
:
arg_0
.
errmsg
(
"No line number information available."
)
return
if
len
(
arg_1
)
==
3
:
arg_2
=
arg_0
.
lineinfo
(
arg_1
[
2
]
)
if
arg_2
[
0
]
:
arg_3
,
arg_4
,
arg_5
=
arg_2
if
not
os
.
path
.
isfile
(
arg_4
)
:
arg_4
=
Mclifns
.
search_file
(
arg_4
,
arg_0
.
core
.
search_path
,
arg_0
.
main_dirname
)
arg_0
.
msg
(
'Line %s of "%s" <%s>'
%
(
arg_5
,
arg_4
,
arg_3
)
)
return
arg_4
=
arg_0
.
core
.
canonic_filename
(
arg_0
.
proc
.
curframe
)
if
not
os
.
path
.
isfile
(
arg_4
)
:
arg_4
=
Mclifns
.
search_file
(
arg_4
,
arg_0
.
core
.
search_path
,
arg_0
.
main_dirname
)
pass
arg_4
=
arg_0
.
core
.
canonic_filename
(
arg_0
.
proc
.
curframe
)
arg_6
=
'Line %d of \"%s\"'
%
(
inspect
.
getlineno
(
arg_0
.
proc
.
curframe
)
,
arg_0
.
core
.
filename
(
arg_4
)
)
arg_7
=
(
'at instruction %d'
%
arg_0
.
proc
.
curframe
.
f_lasti
)
if
arg_0
.
proc
.
event
:
arg_7
+=
', %s event'
%
arg_0
.
proc
.
event
pass
arg_0
.
msg
(
Mmisc
.
wrapped_lines
(
arg_6
,
arg_7
,
arg_0
.
settings
[
'width'
]
)
)
return
False

def Func(arg_0, arg_1):
        """Current line number in source file"""
        # info line identifier
        if not arg_0.proc.curframe:
            arg_0.errmsg("No line number information available.")
            return
        if len(arg_1) == 3:
            # lineinfo returns (item, file, lineno) or (None,)
            arg_2 = arg_0.lineinfo(arg_1[2])
            if arg_2[0]:
                arg_3, arg_4, arg_5 = arg_2
                if not os.path.isfile(arg_4):
                    arg_4 = Mclifns.search_file(arg_4,
                                                   arg_0.core.search_path,
                                                   arg_0.main_dirname)
                arg_0.msg('Line %s of "%s" <%s>' %
                         (arg_5, arg_4, arg_3))
            return
        arg_4=arg_0.core.canonic_filename(arg_0.proc.curframe)
        if not os.path.isfile(arg_4):
            arg_4 = Mclifns.search_file(arg_4, arg_0.core.search_path,
                                           arg_0.main_dirname)
            pass

        arg_4 = arg_0.core.canonic_filename(arg_0.proc.curframe)
        arg_6 = 'Line %d of \"%s\"'  % (inspect.getlineno(arg_0.proc.curframe),
                                       arg_0.core.filename(arg_4))
        arg_7 = ('at instruction %d' % arg_0.proc.curframe.f_lasti)
        if arg_0.proc.event:
            arg_7 += ', %s event' % arg_0.proc.event
            pass
        arg_0.msg(Mmisc.wrapped_lines(arg_6, arg_7, arg_0.settings['width']))
        return False


(
        self, value: str, include_private_vars: bool = True
    )

return map(
            lambda entry: f"{entry[0].name}",
            filter(is_match, [(s, v) for s, v in self.interns]),
        )

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_4 = True ) -> Iterable [ arg_2 ] : if arg_3 : arg_5 = Namespace . __completion_matcher ( arg_1 ) else : arg_6 = Namespace . __completion_matcher ( arg_1 ) def arg_5 ( arg_7 : arg_8 [ arg_9 . Symbol , arg_11 ] ) -> arg_4 : return arg_6 ( arg_7 ) and not arg_7 [ 1 ] . is_private return map ( lambda arg_7 : f"{entry[0].name}" , filter ( arg_5 , [ ( arg_12 , arg_13 ) for arg_12 , arg_13 in arg_0 . interns ] ) , )

def Func(
        arg_0, arg_1: arg_2, arg_3: arg_4 = True
    ) -> Iterable[arg_2]:
        """Return an iterable of possible completions matching the given
        prefix from the list of interned Vars."""
        if arg_3:
            arg_5 = Namespace.__completion_matcher(arg_1)
        else:
            arg_6 = Namespace.__completion_matcher(arg_1)

            def arg_5(arg_7: arg_8[arg_9.Symbol, arg_11]) -> arg_4:
                return arg_6(arg_7) and not arg_7[1].is_private

        return map(
            lambda arg_7: f"{entry[0].name}",
            filter(arg_5, [(arg_12, arg_13) for arg_12, arg_13 in arg_0.interns]),
        )

Return an iterable of possible completions matching the given prefix from the list of interned Vars .


def Func ( arg_0 ) : arg_1 = arg_0 . get_data ( "sizes/" ) arg_2 = list ( ) for arg_3 in arg_1 [ 'sizes' ] : arg_4 = Size ( ** arg_3 ) arg_4 . token = arg_0 . token arg_2 . append ( arg_4 ) return arg_2

def Func(arg_0):
        """
            This function returns a list of Size object.
        """
        arg_1 = arg_0.get_data("sizes/")
        arg_2 = list()
        for arg_3 in arg_1['sizes']:
            arg_4 = Size(**arg_3)
            arg_4.token = arg_0.token
            arg_2.append(arg_4)
        return arg_2

This function returns a list of Size object .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . apply_to ( arg_1 ) if arg_0 . unit in [ DAYS , WEEKS , MONTHS , YEARS ] : arg_4 = datetime ( arg_3 . year , arg_3 . month , arg_3 . day ) arg_3 = arg_2 . localize ( arg_4 ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """We make sure that after truncating we use the correct timezone,
        even if we 'jump' over a daylight saving time switch.

        I.e. if we apply "@d" to `Sun Oct 30 04:30:00 CET 2016` (1477798200)
        we want to have `Sun Oct 30 00:00:00 CEST 2016` (1477778400)
        but not `Sun Oct 30 00:00:00 CET 2016` (1477782000)
        """
        arg_3 = arg_0.apply_to(arg_1)
        if arg_0.unit in [DAYS, WEEKS, MONTHS, YEARS]:
            arg_4 = datetime(arg_3.year, arg_3.month, arg_3.day)
            arg_3 = arg_2.localize(arg_4)
        return arg_3

We make sure that after truncating we use the correct timezone even if we jump over a daylight saving time switch .


def
Func
(
arg_0
)
:
arg_1
=
" \t"
if
hasattr
(
arg_0
,
'__Func__'
)
:
arg_2
=
arg_0
.
__Func__
.
lstrip
(
" \n\t"
)
if
"\n"
in
arg_2
:
arg_3
=
arg_2
.
index
(
"\n"
)
return
arg_2
[
:
arg_3
]
.
rstrip
(
arg_1
)
elif
arg_2
:
return
arg_2
.
rstrip
(
arg_1
)
return
""

def Func(arg_0):
    """
        Find the message shown when someone calls the help command

    Parameters
    ----------
    func : function
        the function

    Returns
    -------
    str
        The help message for this command
    """
    arg_1 = " \t"

    if hasattr(arg_0, '__Func__'):
        arg_2 = arg_0.__Func__.lstrip(" \n\t")
        if "\n" in arg_2:
            arg_3 = arg_2.index("\n")
            return arg_2[:arg_3].rstrip(arg_1)
        elif arg_2:
            return arg_2.rstrip(arg_1)

    return ""


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = 0 with open ( arg_1 , 'w' ) as out : if arg_0 . endswith ( ".gz" ) : arg_4 = gzip . open ( arg_0 , 'rb' ) else : arg_4 = open ( arg_0 , 'rb' ) arg_5 = itertools . izip ( * [ iter ( arg_4 ) ] * 4 ) arg_6 = [ ] while 1 : try : arg_7 = arg_5 . next ( ) except StopIteration : break if arg_2 : arg_8 = arg_7 [ 1 ] . strip ( ) [ : : - 1 ] else : arg_8 = arg_7 [ 1 ] . strip ( ) arg_6 . append ( "" . join ( [ arg_7 [ 0 ] , arg_8 + "\n" , arg_7 [ 2 ] , "B" * len ( arg_8 ) ] ) ) arg_3 += 1 if not arg_3 % 1000 : out . write ( "\n" . join ( arg_6 ) + "\n" ) arg_6 = [ ] if arg_6 : out . write ( "\n" . join ( arg_6 ) ) out . close ( ) arg_4 . close ( )

def Func(arg_0, arg_1, arg_2=False):
    """ option to change orientation of reads and sets Qscore to B """

    arg_3 = 0
    with open(arg_1, 'w') as out:
        ## read in paired end read files 4 lines at a time
        if arg_0.endswith(".gz"):
            arg_4 = gzip.open(arg_0, 'rb')
        else:
            arg_4 = open(arg_0, 'rb')
        arg_5 = itertools.izip(*[iter(arg_4)]*4)

        ## a list to store until writing
        arg_6 = []

        while 1:
            try:
                arg_7 = arg_5.next()
            except StopIteration:
                break
            if arg_2:
                arg_8 = arg_7[1].strip()[::-1]
            else:
                arg_8 = arg_7[1].strip()
            arg_6.append("".join([
                arg_7[0],
                arg_8+"\n",
                arg_7[2],
                "B"*len(arg_8)
            ]))

            ## write to disk
            arg_3 += 1
            if not arg_3 % 1000:
                out.write("\n".join(arg_6)+"\n")
                arg_6 = []
        if arg_6:
            out.write("\n".join(arg_6))

    out.close()
    arg_4.close()


(script, iterations=3, viewpoint=(0, 0, 0), selected=False)

def Func(arg_0, arg_1=3, arg_2=(0, 0, 0), arg_3=False):
    """ A laplacian smooth that is constrained to move vertices only along the
        view direction.

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        iterations (int): The number of times that the whole algorithm (normal
            smoothing + vertex fitting) is iterated.
        viewpoint (vector tuple or list): The position of the view point that
            is used to get the constraint direction.
        selected (bool): If selected the filter is performed only on the
            selected faces

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    arg_4 = ''.join([
        '  <filter name="Depth Smooth">\n',
        '    <Param name="stepSmoothNum" ',
        'value="{:d}" '.format(arg_1),
        'description="Smoothing steps" ',
        'type="RichInt" ',
        '/>\n',
        '    <Param name="viewPoint" ',
        'x="{}" '.format(arg_2[0]),
        'y="{}" '.format(arg_2[1]),
        'z="{}" '.format(arg_2[2]),
        'description="Smoothing steps" ',
        'type="RichPoint3f" ',
        '/>\n',
        '    <Param name="Selected" ',
        'value="{}" '.format(str(arg_3).lower()),
        'description="Affect only selected faces" ',
        'type="RichBool" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(arg_0, arg_4)
    return None

A laplacian smooth that is constrained to move vertices only along the view direction .


def Func ( arg_0 , arg_1 , ** arg_2 ) : if arg_1 . user : arg_3 , arg_4 = SystemWideEnterpriseRole . objects . get_or_create ( name = ENTERPRISE_LEARNER_ROLE ) try : SystemWideEnterpriseUserRoleAssignment . objects . get ( user = arg_1 . user , role = arg_3 ) . delete ( ) except SystemWideEnterpriseUserRoleAssignment . DoesNotExist : pass

def Func(arg_0, arg_1, **arg_2):     # pylint: disable=unused-argument
    """
    Delete the associated enterprise learner role assignment record when deleting an EnterpriseCustomerUser record.
    """
    if arg_1.user:
        arg_3, arg_4 = SystemWideEnterpriseRole.objects.get_or_create(name=ENTERPRISE_LEARNER_ROLE)
        try:
            SystemWideEnterpriseUserRoleAssignment.objects.get(
                user=arg_1.user,
                role=arg_3
            ).delete()
        except SystemWideEnterpriseUserRoleAssignment.DoesNotExist:
            # Do nothing if no role assignment is present for the enterprise customer user.
            pass

Delete the associated enterprise learner role assignment record when deleting an EnterpriseCustomerUser record .


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
arg_0
.
gbdx_connection
.
post
(
arg_0
.
workflows_url
,
json
=
arg_1
)
try
:
arg_2
.
raise_for_status
(
)
except
:
print
(
"GBDX API Status Code: %s"
%
arg_2
.
status_code
)
print
(
"GBDX API Response: %s"
%
arg_2
.
text
)
arg_2
.
raise_for_status
(
)
arg_3
=
arg_2
.
json
(
)
[
'id'
]
return
arg_3
except
TypeError
:
arg_0
.
logger
.
debug
(
'Workflow not Funced!'
)

def Func(arg_0, arg_1):
        """Launches GBDX workflow.

        Args:
            workflow (dict): Dictionary specifying workflow tasks.

        Returns:
            Workflow id (str).
        """

        # hit workflow api
        try:
            arg_2 = arg_0.gbdx_connection.post(arg_0.workflows_url, json=arg_1)
            try:
                arg_2.raise_for_status()
            except:
                print("GBDX API Status Code: %s" % arg_2.status_code)
                print("GBDX API Response: %s" % arg_2.text)
                arg_2.raise_for_status()
            arg_3 = arg_2.json()['id']
            return arg_3
        except TypeError:
            arg_0.logger.debug('Workflow not Funced!')


(
            self, vault_name, location, custom_headers=None, raw=False, polling=True, **operation_config)

return LROPoller(self._client, raw_result, get_long_running_output, polling_method)

def Func(
            arg_0, arg_1, arg_2, arg_3=None, arg_4=False, arg_5=True, **arg_6):
        """Permanently deletes the specified vault. aka Purges the deleted Azure
        key vault.

        :param vault_name: The name of the soft-deleted vault.
        :type vault_name: str
        :param location: The location of the soft-deleted vault.
        :type location: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of LROPoller that returns None or
         ClientRawResponse<None> if raw==True
        :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        arg_7 = arg_0._Func_initial(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=True,
            **arg_6
        )

        def get_long_running_output(arg_8):
            if arg_4:
                arg_9 = ClientRawResponse(None, arg_8)
                return arg_9

        arg_10 = arg_6.get(
            'long_running_operation_timeout',
            arg_0.config.long_running_operation_timeout)
        if arg_5 is True: arg_11 = ARMPolling(arg_10, **arg_6)
        elif arg_5 is False: arg_11 = NoPolling()
        else: arg_11 = arg_5
        return LROPoller(arg_0._client, arg_7, get_long_running_output, arg_11)

Permanently deletes the specified vault . aka Purges the deleted Azure key vault .


def Func ( ) : try : pkg_resources . get_distribution ( 'invenio-files-rest' ) from invenio_files_rest . app import Flask as FlaskBase except pkg_resources . DistributionNotFound : from flask import Flask as FlaskBase class Request ( TrustedHostsMixin , FlaskBase . request_class ) : pass class Flask ( FlaskBase ) : arg_0 = Request return Flask

def Func():
    """Create Flask application class.

    Invenio-Files-REST needs to patch the Werkzeug form parsing in order to
    support streaming large file uploads. This is done by subclassing the Flask
    application class.
    """
    try:
        pkg_resources.get_distribution('invenio-files-rest')
        from invenio_files_rest.app import Flask as FlaskBase
    except pkg_resources.DistributionNotFound:
        from flask import Flask as FlaskBase

    # Add Host header validation via APP_ALLOWED_HOSTS configuration variable.
    class Request(TrustedHostsMixin, FlaskBase.request_class):
        pass

    class Flask(FlaskBase):
        arg_0 = Request

    return Flask


def Func():
    """Parse arguments and print generated documentation to stdout."""
    arg_0 = argparse.ArgumentParser()
    arg_0.add_argument('protofilepath')
    arg_1 = arg_0.parse_args()

    arg_2 = compile_protofile(arg_1.protofilepath)
    with open(arg_2, 'rb') as proto_file:
        # pylint: disable=no-member
        arg_3 = descriptor_pb2.FileDescriptorSet.FromString(
            proto_file.read()
        )
        # pylint: enable=no-member

    for arg_4 in arg_3.file:
        # Build dict of location tuples
        arg_5 = {}
        for arg_6 in arg_4.source_code_info.location:
            arg_5[arg_7(arg_6.path)] = arg_6
        # Add comment to top
        print(make_comment('This file was automatically generated from {} and '
                           'should not be edited directly.'
                           .format(arg_1.protofilepath)))
        # Generate documentation
        for arg_9, arg_10 in enumerate(arg_4.message_type):
            generate_message_doc(arg_10, arg_5, (4, arg_9))
        for arg_9, arg_11 in enumerate(arg_4.enum_type):
            generate_enum_doc(arg_11, arg_5, (5, arg_9))

Parse arguments and print generated documentation to stdout .


def Func(arg_0, arg_1, arg_2):
        """Handle the Func tag.

        Call the handler's 'stream_Func' methods with
        an empty root element if it is top level.

        For lower level tags use :etree:`ElementTree.TreeBuilder` to collect
        them.
        """
        if arg_0._level == 0:
            arg_0._root = ElementTree.Element(arg_1, arg_2)
            arg_0._handler.stream_Func(arg_0._root)
        if arg_0._level < 2:
            arg_0._builder = ElementTree.TreeBuilder()
        arg_0._level += 1
        return arg_0._builder.Func(arg_1, arg_2)

Handle the start tag.

        Call the handler's 'stream_start' methods with
        an empty root element if it is top level.

        For lower level tags use :etree:`ElementTree.TreeBuilder` to collect
        them.


(self, url='', headers={}, repo_name='')

def Func ( arg_0 , arg_1 = '' , arg_2 = { } , arg_3 = '' ) : arg_4 = ( arg_1 + '/releases' ) arg_5 = requests . get ( arg_4 , arg_2 = arg_2 ) arg_0 . releases_json [ arg_3 ] = arg_5 . json ( )

def Func(arg_0, arg_1='', arg_2={}, arg_3=''):
        """
        Retrieves the releases for the given repo in JSON.
        """
        arg_4 = (arg_1 + '/releases')
        arg_5 = requests.get(arg_4, arg_2=arg_2)
        arg_0.releases_json[arg_3] = arg_5.json()

Retrieves the releases for the given repo in JSON .


def Func(arg_0, arg_1=arg_2['min_size']):
    """Sort a file into a group based on on-disk size.

    :param paths: See :func:`fastdupes.groupify`

    :param min_size: Files smaller than this size (in bytes) will be ignored.
    :type min_size: :class:`__builtins__.int`

    :returns: See :func:`fastdupes.groupify`

    .. todo:: Rework the calling of :func:`~os.stat` to minimize the number of
        calls. It's a fairly significant percentage of the time taken according
        to the profiler.
    """
    arg_3 = _stat(arg_0)
    if stat.S_ISLNK(arg_3.st_mode):
        return  # Skip symlinks.

    if arg_3.st_size < arg_1:
        return  # Skip files below the size limit

    return arg_3.st_size

Sort a file into a group based on on - disk size .


def Func ( arg_0 , arg_1 , arg_2 ) : from sregistry . Func import get_client arg_3 = get_client ( quiet = arg_0 . quiet ) for arg_4 in arg_0 . query : if arg_4 in [ '' , '*' ] : arg_4 = None arg_3 . ls ( arg_4 = arg_4 )

def Func(arg_0,arg_1,arg_2):
    '''the list command corresponds with listing images for an external
       resource. This is different from listing images that are local to the
       database, which should be done with "images"
    '''
    from sregistry.Func import get_client
    arg_3 = get_client(quiet=arg_0.quiet)

    for arg_4 in arg_0.query:
        if arg_4 in ['','*']:
            arg_4 = None

        arg_3.ls(arg_4=arg_4)

the list command corresponds with listing images for an external resource . This is different from listing images that are local to the database which should be done with images


def
Func
(
arg_0
=
[
]
)
:
def
decorator
(
arg_1
)
:
arg_2
=
[
]
if
not
callable
(
arg_0
)
:
arg_2
=
arg_0
@
wraps
(
arg_1
)
def
wrapper
(
*
arg_3
,
**
arg_4
)
:
arg_5
=
arg_3
[
0
]
if
arg_5
.
method
!=
'POST'
:
logger
.
error
(
'POST required for this url'
)
raise
Http404
(
'only POST allowed for this url'
)
arg_6
=
[
]
for
arg_7
in
arg_2
:
if
arg_7
not
in
arg_5
.
POST
:
arg_6
.
append
(
arg_7
)
if
arg_6
:
arg_8
=
'Expected fields missing in POST: %s'
%
arg_6
logger
.
error
(
arg_8
)
raise
Http404
(
arg_8
)
return
arg_1
(
*
arg_3
,
**
arg_4
)
return
wrapper
if
callable
(
arg_0
)
:
return
decorator
(
arg_0
)
return
decorator

def Func(arg_0=[]):
    """View decorator that enforces that the method was called using POST.
    This decorator can be called with or without parameters.  As it is
    expected to wrap a view, the first argument of the method being wrapped is
    expected to be a ``request`` object.

    .. code-block:: python

        @Func
        def some_view(request):
            pass

        @Func(['firstname', 'lastname'])
        def some_view(request):
            pass

    The optional parameter contains a single list which specifies the names of
    the expected fields in the POST dictionary.  The list is not exclusive,
    you can pass in fields that are not checked by the decorator.

    :param options:
        List of the names of expected POST keys.
    """
    def decorator(arg_1):
        # handle wrapping or wrapping with arguments; if no arguments (and no
        # calling parenthesis) then method_or_options will be a list,
        # otherwise it will be the wrapped function
        arg_2 = []
        if not callable(arg_0):
            # not callable means wrapping with arguments
            arg_2 = arg_0

        @wraps(arg_1)
        def wrapper(*arg_3, **arg_4):
            arg_5 = arg_3[0]
            if arg_5.method != 'POST':
                logger.error('POST required for this url')
                raise Http404('only POST allowed for this url')

            arg_6 = []
            for arg_7 in arg_2:
                if arg_7 not in arg_5.POST:
                    arg_6.append(arg_7)

            if arg_6:
                arg_8 = 'Expected fields missing in POST: %s' % arg_6
                logger.error(arg_8)
                raise Http404(arg_8)

            # everything verified, run the view
            return arg_1(*arg_3, **arg_4)
        return wrapper

    if callable(arg_0):
        # callable means decorated method without options, call our decorator
        return decorator(arg_0)
    return decorator

View decorator that enforces that the method was called using POST.
    This decorator can be called with or without parameters.  As it is
    expected to wrap a view, the first argument of the method being wrapped is
    expected to be a ``request`` object.

    .. code-block:: python

        @post_required
        def some_view(request):
            pass

        @post_required(['firstname', 'lastname'])
        def some_view(request):
            pass

    The optional parameter contains a single list which specifies the names of
    the expected fields in the POST dictionary.  The list is not exclusive,
    you can pass in fields that are not checked by the decorator.

    :param options:
        List of the names of expected POST keys.

View decorator that enforces that the method was called using POST . This decorator can be called with or without parameters . As it is expected to wrap a view the first argument of the method being wrapped is expected to be a request object .


def Func ( arg_0 ) : arg_1 = arg_0 . ebs . describe_application_versions ( application_name = arg_0 . app_name ) return arg_1 [ 'DescribeApplicationVersionsResponse' ] [ 'DescribeApplicationVersionsResult' ] [ 'ApplicationVersions' ]

def Func(arg_0):
        """
        Returns the versions available
        """
        arg_1 = arg_0.ebs.describe_application_versions(application_name=arg_0.app_name)
        return arg_1['DescribeApplicationVersionsResponse']['DescribeApplicationVersionsResult']['ApplicationVersions']


def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Presets parameter value before a parameter is added.

        Can be called before parameters are added to the Trajectory in order to change the
        values that are stored into the parameter on creation.

        After creation of a parameter, the instance of the parameter is called
        with `param.f_set(*args,**kwargs)` with `*args`, and `**kwargs` provided by the user
        with `Func`.

        Before an experiment is carried out it is checked if all parameters that were
        marked were also preset.

        :param param_name:

            The full name (!) of the parameter that is to be changed after its creation.

        :param args:

            Arguments that will be used for changing the parameter's data

        :param kwargs:

            Keyword arguments that will be used for changing the parameter's data

        Example:

        >>> traj.Func('groupA.param1', data=44)
        >>> traj.f_add_parameter('groupA.param1', data=11)
        >>> traj.parameters.groupA.param1
        44

        """

        if not arg_1.startswith('parameters.'):
            arg_1 = 'parameters.' + arg_1

        arg_0._preset(arg_1, arg_2, arg_3)

Presets parameter value before a parameter is added.

        Can be called before parameters are added to the Trajectory in order to change the
        values that are stored into the parameter on creation.

        After creation of a parameter, the instance of the parameter is called
        with `param.f_set(*args,**kwargs)` with `*args`, and `**kwargs` provided by the user
        with `f_preset_parameter`.

        Before an experiment is carried out it is checked if all parameters that were
        marked were also preset.

        :param param_name:

            The full name (!) of the parameter that is to be changed after its creation.

        :param args:

            Arguments that will be used for changing the parameter's data

        :param kwargs:

            Keyword arguments that will be used for changing the parameter's data

        Example:

        >>> traj.f_preset_parameter('groupA.param1', data=44)
        >>> traj.f_add_parameter('groupA.param1', data=11)
        >>> traj.parameters.groupA.param1
        44

Presets parameter value before a parameter is added .


def Func ( arg_0 ) : if arg_0 . sender is None : raise MissingSignatureError ( ) class HashSerializable ( rlp . Serializable ) : arg_1 = [ ( field , sedes ) for field , sedes in arg_0 . fields if field not in ( 'v' , 'r' , 's' ) ] + [ ( '_sender' , binary ) ] arg_2 = None return sha3 ( rlp . encode ( arg_0 , HashSerializable ) )

def Func(arg_0):
        "signatures are non deterministic"
        if arg_0.sender is None:
            raise MissingSignatureError()

        class HashSerializable(rlp.Serializable):
            arg_1 = [(field, sedes) for field, sedes in arg_0.fields
                      if field not in ('v', 'r', 's')] + [('_sender', binary)]
            arg_2 = None
        return sha3(rlp.encode(arg_0, HashSerializable))


def Func ( arg_0 , arg_1 ) : if arg_0 . font . font_size == arg_1 : pass else : arg_0 . font . _set_size ( arg_1 )

def Func(arg_0, arg_1):
        """Convenience method for just changing font size."""
        if arg_0.font.font_size == arg_1:
            pass
        else:
            arg_0.font._set_size(arg_1)

Convenience method for just changing font size .


def Func(arg_0):
    """
    Config option name value validator decorator.
    """
    # Name error template
    arg_1 = 'configuration option "{}" is not supported'

    @functools.wraps(arg_0)
    def validator(arg_2, arg_3, *arg_4):
        if arg_3 not in arg_2.allowed_opts:
            raise ValueError(arg_1.format(arg_3))
        return arg_0(arg_2, arg_3, *arg_4)
    return validator

Config option name value validator decorator .


def
Func
(
arg_0
)
:
_AssertIsLocal
(
arg_0
)
try
:
if
IsLink
(
arg_0
)
:
DeleteLink
(
arg_0
)
elif
IsFile
(
arg_0
)
:
os
.
remove
(
arg_0
)
elif
IsDir
(
arg_0
)
:
from
.
_exceptions
import
FileOnlyActionError
raise
FileOnlyActionError
(
arg_0
)
except
Exception
as
e
:
reraise
(
e
,
'While executing filesystem.Func(%s)'
%
(
arg_0
)
)

def Func(arg_0):
    '''
    Deletes the given local filename.

    .. note:: If file doesn't exist this method has no effect.

    :param unicode target_filename:
        A local filename

    :raises NotImplementedForRemotePathError:
        If trying to delete a non-local path

    :raises FileOnlyActionError:
        Raised when filename refers to a directory.
    '''
    _AssertIsLocal(arg_0)

    try:
        if IsLink(arg_0):
            DeleteLink(arg_0)
        elif IsFile(arg_0):
            os.remove(arg_0)
        elif IsDir(arg_0):
            from ._exceptions import FileOnlyActionError
            raise FileOnlyActionError(arg_0)
    except Exception as e:
        reraise(e, 'While executing filesystem.Func(%s)' % (arg_0))


return _verify(certificate_or_public_key, signature, data, hash_algorithm)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Verifies an RSASSA-PKCS-v1.5 signature.

    When the hash_algorithm is "raw", the operation is identical to RSA
    public key decryption. That is: the data is not hashed and no ASN.1
    structure with an algorithm identifier of the hash algorithm is placed in
    the encrypted byte string.

    :param certificate_or_public_key:
        A Certificate or PublicKey instance to verify the signature with

    :param signature:
        A byte string of the signature to verify

    :param data:
        A byte string of the data the signature is for

    :param hash_algorithm:
        A unicode string of "md5", "sha1", "sha256", "sha384", "sha512" or "raw"

    :raises:
        oscrypto.errors.SignatureError - when the signature is determined to be invalid
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library
    """

    if arg_0.algorithm != 'rsa':
        raise ValueError('The key specified is not an RSA public key')

    return _verify(arg_0, arg_1, arg_2, arg_3)

Verifies an RSASSA - PKCS - v1 . 5 signature .


def Func(arg_0, arg_1):
        """
        Do not overwrite this method. Instead implement `on_...` methods for the
        registered typenames to handle incomming packets.
        """

        arg_0._unprocessed_data.enqueue(arg_1)

        while True:
            if len(arg_0._unprocessed_data) < arg_0._header.size:
                return # not yet enough data

            arg_2 = arg_0._unprocessed_data.peek(arg_0._header.size)
            arg_3, arg_4 = arg_0._header.unpack(arg_2)
            arg_5 = arg_0._header.size + arg_3

            if len(arg_0._unprocessed_data) < arg_5:
                return # not yet enough data

            arg_0._unprocessed_data.drop(arg_0._header.size)
            arg_6 = arg_0._unprocessed_data.dequeue(arg_3)

            arg_0._start_receive = None

            arg_8 = arg_0._type_register.get(arg_4, None)
            if arg_8 is None:
                arg_0.on_unregistered_type(arg_4, arg_6)
            else:
                arg_0.packet_received(arg_8, arg_6)

Do not overwrite this method . Instead implement on_ ... methods for the registered typenames to handle incomming packets .


return (
        Affine(pixel_size, 0, left, 0, -pixel_size, top),
        Shape(
            width=int(round((right - left) / pixel_size, 0)),
            height=int(round((top - bottom) / pixel_size, 0)),
        )
    )

def
Func
(
arg_0
)
:
if
not
arg_0
:
raise
TypeError
(
"no tiles provided"
)
arg_1
=
arg_0
[
0
]
.
pixel_x_size
arg_2
,
arg_3
,
arg_4
,
arg_5
=
(
min
(
[
t
.
left
for
t
in
arg_0
]
)
,
min
(
[
t
.
bottom
for
t
in
arg_0
]
)
,
max
(
[
t
.
right
for
t
in
arg_0
]
)
,
max
(
[
t
.
top
for
t
in
arg_0
]
)
,
)
return
(
Affine
(
arg_1
,
0
,
arg_2
,
0
,
arg_1
,
arg_5
)
,
Shape
(
width
=
int
(
round
(
(
arg_4
arg_2
)
/
arg_1
,
0
)
)
,
height
=
int
(
round
(
(
arg_5
arg_3
)
/
arg_1
,
0
)
)
,
)
)

def Func(arg_0):
    """
    Return Affine and shape of combined tiles.

    Parameters
    ----------
    tiles : iterable
        an iterable containing BufferedTiles

    Returns
    -------
    Affine, Shape
    """
    if not arg_0:
        raise TypeError("no tiles provided")
    arg_1 = arg_0[0].pixel_x_size
    arg_2, arg_3, arg_4, arg_5 = (
        min([t.left for t in arg_0]),
        min([t.bottom for t in arg_0]),
        max([t.right for t in arg_0]),
        max([t.top for t in arg_0]),
    )
    return (
        Affine(arg_1, 0, arg_2, 0, -arg_1, arg_5),
        Shape(
            width=int(round((arg_4 - arg_2) / arg_1, 0)),
            height=int(round((arg_5 - arg_3) / arg_1, 0)),
        )
    )

Return Affine and shape of combined tiles .


def Func(arg_0, arg_1, arg_2):
        """
        Retrieve the grade 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 grade.

        Raises:

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

        Returns:

        a dict containing:

        * ``username``: A string representation of a user's username passed in the request.
        * ``course_key``: A string representation of a Course ID.
        * ``passed``: Boolean representing whether the course has been passed according the course's grading policy.
        * ``percent``: A float representing the overall grade for the course
        * ``letter_grade``: A letter grade as defined in grading_policy (e.g. 'A' 'B' 'C' for 6.002x) or None

        """
        arg_3 = arg_0.client.courses(arg_1).get(arg_2=arg_2)
        for arg_4 in arg_3:
            if arg_4.get('username') == arg_2:
                return arg_4

        raise HttpNotFoundError('No grade record found for course={}, username={}'.format(arg_1, arg_2))

Retrieve the grade for the given username for the given course_id .


def Func(arg_0, arg_1, arg_2=True):
        """ Solidity source code snippet related to `asm_pos` evm bytecode offset.
            If runtime is False, initialization bytecode source map is used
        """
        arg_3 = arg_0.get_srcmap(arg_2)

        try:
            arg_4, arg_5, arg_6, arg_6 = arg_3[arg_1]
        except KeyError:
            #asm_offset pointing outside the known bytecode
            return ''

        arg_7 = ''
        arg_8 = arg_0.source_code[:arg_4].count('\n') + 1
        arg_9 = arg_0.source_code[arg_4:arg_4 + arg_5]
        for arg_10 in arg_9.split('\n'):
            arg_7 += '    %s  %s\n' % (arg_8, arg_10)
            arg_8 += 1
        return arg_7

Solidity source code snippet related to asm_pos evm bytecode offset . If runtime is False initialization bytecode source map is used


(self,pattern,ns_table,ns_search=[],
                ignore_case=False,show_all=False)

def Func(arg_0,arg_1,arg_2,arg_3=[],
                arg_4=False,arg_5=False):
        """Search namespaces with wildcards for objects.

        Arguments:

        - pattern: string containing shell-like wildcards to use in namespace
        searches and optionally a type specification to narrow the search to
        objects of that type.

        - ns_table: dict of name->namespaces for search.

        Optional arguments:

          - ns_search: list of namespace names to include in search.

          - ignore_case(False): make the search case-insensitive.

          - show_all(False): show all names, including those starting with
          underscores.
        """
        #print 'ps pattern:<%r>' % pattern # dbg

        # defaults
        arg_6 = 'all'
        arg_7 = ''

        arg_8 = arg_1.split()
        arg_9  =  len(arg_8)
        if arg_9 == 1:
            # Only filter pattern given
            arg_7 = arg_8[0]
        elif arg_9 == 2:
            # Both filter and type specified
            arg_7,arg_6 = arg_8
        else:
            raise ValueError('invalid argument string for Func: <%s>' %
                             arg_1)

        # filter search namespaces
        for arg_10 in arg_3:
            if arg_10 not in arg_2:
                raise ValueError('invalid namespace <%s>. Valid names: %s' %
                                 (arg_10,arg_2.keys()))

        #print 'type_pattern:',type_pattern # dbg
        arg_11, arg_12 = set(), set()
        for arg_13 in arg_3:
            arg_14 = arg_2[arg_13]
            # Normally, locals and globals are the same, so we just check one.
            if id(arg_14) in arg_12:
                continue
            arg_12.add(id(arg_14))
            arg_15 = list_namespace(arg_14, arg_6, arg_7,
                                    arg_4=arg_4, arg_5=arg_5)
            arg_11.update(arg_15)

        page.page('\n'.join(sorted(arg_11)))

Search namespaces with wildcards for objects .


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

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

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

        Parameters
        ----------
        palette : callable ``f(x)``
            palette to use
        x : array_like
            Continuous values to scale
        na_value : object
            Value to use for missing values.

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

        return arg_6

Map values to a discrete palette

        Parameters
        ----------
        palette : callable ``f(x)``
            palette to use
        x : array_like
            Continuous values to scale
        na_value : object
            Value to use for missing values.

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


def Func ( arg_0 ) : arg_1 = os . listdir ( arg_0 ) if '__common__' in arg_1 : arg_1 . remove ( '__common__' ) return arg_1

def Func(arg_0):
    """Returns available themes list."""
    arg_1 = os.listdir(arg_0)
    if '__common__' in arg_1:
        arg_1.remove('__common__')
    return arg_1


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . encoders . append ( ( arg_1 , arg_2 , arg_0 . width ) ) for arg_3 in arg_2 . getDescription ( ) : arg_0 . description . append ( ( arg_3 [ 0 ] , arg_3 [ 1 ] + arg_0 . width ) ) arg_0 . width += arg_2 . getWidth ( )

def Func(arg_0, arg_1, arg_2):
    """
    Adds one encoder.

    :param name: (string) name of encoder, should be unique
    :param encoder: (:class:`.Encoder`) the encoder to add
    """
    arg_0.encoders.append((arg_1, arg_2, arg_0.width))
    for arg_3 in arg_2.getDescription():
      arg_0.description.append((arg_3[0], arg_3[1] + arg_0.width))
    arg_0.width += arg_2.getWidth()


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = tf . keras . Sequential ( ) for arg_4 in arg_2 : arg_3 . add ( tf . keras . layers . Dense ( arg_4 , arg_0 = arg_0 , kernel_initializer = tf . compat . v1 . glorot_normal_initializer ( ) ) ) arg_3 . add ( tf . keras . layers . Dense ( arg_1 , arg_0 = tf . nn . softplus , kernel_initializer = tf . compat . v1 . glorot_normal_initializer ( ) ) ) def lda_variational ( arg_5 ) : arg_6 = _clip_dirichlet_parameters ( arg_3 ( arg_5 ) ) return ed . Dirichlet ( arg_6 = arg_6 , name = "topics_posterior" ) return lda_variational

def Func(arg_0, arg_1, arg_2):
  """Creates the variational distribution for LDA.

  Args:
    activation: Activation function to use.
    num_topics: The number of topics.
    layer_sizes: The number of hidden units per layer in the encoder.

  Returns:
    lda_variational: A function that takes a bag-of-words Tensor as
      input and returns a distribution over topics.
  """
  arg_3 = tf.keras.Sequential()
  for arg_4 in arg_2:
    arg_3.add(
        tf.keras.layers.Dense(
            arg_4,
            arg_0=arg_0,
            kernel_initializer=tf.compat.v1.glorot_normal_initializer()))
  arg_3.add(
      tf.keras.layers.Dense(
          arg_1,
          arg_0=tf.nn.softplus,
          kernel_initializer=tf.compat.v1.glorot_normal_initializer()))

  def lda_variational(arg_5):
    arg_6 = _clip_dirichlet_parameters(arg_3(arg_5))
    return ed.Dirichlet(arg_6=arg_6, name="topics_posterior")

  return lda_variational

Creates the variational distribution for LDA .


(self, spatialOutput, temporalOutput, output)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . encoder . getEncoderList ( ) arg_5 = arg_0 . encoder . getDecoderOutputFieldTypes ( ) for arg_6 , ( arg_7 , arg_8 ) in enumerate ( zip ( arg_4 , arg_5 ) ) : arg_9 = arg_1 [ arg_6 ] arg_10 = arg_2 [ arg_6 ] if arg_8 != FieldMetaType . integer and arg_8 != FieldMetaType . float : arg_9 = arg_7 . getScalars ( arg_9 ) [ 0 ] arg_10 = arg_7 . getScalars ( arg_10 ) [ 0 ] assert isinstance ( arg_9 , ( float , int ) ) assert isinstance ( arg_10 , ( float , int ) ) arg_3 [ 'spatialTopDownOut' ] [ arg_6 ] = arg_9 arg_3 [ 'temporalTopDownOut' ] [ arg_6 ] = arg_10

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Converts all of the non-numeric fields from spatialOutput and temporalOutput
    into their scalar equivalents and records them in the output dictionary.

    :param spatialOutput: The results of topDownCompute() for the spatial input.
    :param temporalOutput: The results of topDownCompute() for the temporal
      input.
    :param output: The main dictionary of outputs passed to compute(). It is
      expected to have keys 'spatialTopDownOut' and 'temporalTopDownOut' that
      are mapped to numpy arrays.
    """
    arg_4 = arg_0.encoder.getEncoderList()
    arg_5 = arg_0.encoder.getDecoderOutputFieldTypes()
    for arg_6, (arg_7, arg_8) in enumerate(zip(arg_4, arg_5)):
      arg_9 = arg_1[arg_6]
      arg_10 = arg_2[arg_6]

      if arg_8 != FieldMetaType.integer and arg_8 != FieldMetaType.float:
        # TODO: Make sure that this doesn't modify any state
        arg_9 = arg_7.getScalars(arg_9)[0]
        arg_10 = arg_7.getScalars(arg_10)[0]

      assert isinstance(arg_9, (float, int))
      assert isinstance(arg_10, (float, int))
      arg_3['spatialTopDownOut'][arg_6] = arg_9
      arg_3['temporalTopDownOut'][arg_6] = arg_10

Converts all of the non - numeric fields from spatialOutput and temporalOutput into their scalar equivalents and records them in the output dictionary .


def Func(arg_0, arg_1):
    """
    Load the passed in assembly and create a branch. Copy it
    to a new assembly, and also write out the appropriate params.txt
    """

    ## Get the current assembly
    arg_2 = getassembly(arg_0, arg_1)

    ## get arguments to branch command
    arg_3 = arg_0.branch

    ## get new name, trim off .txt if it was accidentally added
    arg_4 = arg_3[0]
    if arg_4.endswith(".txt"):
        arg_4 = arg_4[:-4]

    ## look for subsamples
    if len(arg_3) > 1:
        ## Branching and subsampling at step 6 is a bad idea, it messes up
        ## indexing into the hdf5 cluster file. Warn against this.
        if any([arg_5.stats.state == 6 for arg_5 in arg_2.samples.values()]):
            pass
            ## TODODODODODO
            #print("wat")

        ## are we removing or keeping listed samples?
        arg_6 = arg_3[1:]

        ## drop the matching samples
        if arg_3[1] == "-":
            ## check drop names
            arg_7 = [arg_8 for arg_8 in arg_6[1:] if arg_8 not in arg_2.samples.keys()]
            if any(arg_7):
                raise IPyradWarningExit("\
                    \n  Failed: unrecognized names requested, check spelling:\n  {}"\
                    .format("\n  ".join([arg_8 for arg_8 in arg_7])))
            print("  dropping {} samples".format(len(arg_6)-1))
            arg_6 = list(set(arg_2.samples.keys()) - set(arg_6))

        ## If the arg after the new param name is a file that exists
        if os.path.exists(arg_3[1]):
            arg_9 = arg_2.branch(arg_4, infile=arg_3[1])
        else:
            arg_9 = arg_2.branch(arg_4, arg_6)

    ## keeping all samples
    else:
        arg_9 = arg_2.branch(arg_4, None)

    print("  creating a new branch called '{}' with {} Samples".\
             format(arg_9.name, len(arg_9.samples)))

    print("  writing new params file to {}"\
            .format("params-"+arg_9.name+".txt\n"))
    arg_9.write_params("params-"+arg_9.name+".txt", force=arg_0.force)

Load the passed in assembly and create a branch . Copy it to a new assembly and also write out the appropriate params . txt


(self, topologyName, callback, isWatching)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_0
.
get_packing_plan_path
(
arg_1
)
if
arg_3
:
LOG
.
info
(
"Adding data watch for path: "
+
arg_4
)
@
arg_0
.
client
.
DataWatch
(
arg_4
)
def
watch_packing_plan
(
arg_5
,
arg_6
)
:
if
arg_5
:
arg_7
=
PackingPlan
(
)
arg_7
.
ParseFromString
(
arg_5
)
arg_2
(
arg_7
)
else
:
arg_2
(
)
return
arg_3

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Helper function to get packing_plan with
    a callback. The future watch is placed
    only if isWatching is True.
    """
    arg_4 = arg_0.get_packing_plan_path(arg_1)
    if arg_3:
      LOG.info("Adding data watch for path: " + arg_4)

    # pylint: disable=unused-argument,unused-variable
    @arg_0.client.DataWatch(arg_4)
    def watch_packing_plan(arg_5, arg_6):
      """ watch the packing plan for updates """
      if arg_5:
        arg_7 = PackingPlan()
        arg_7.ParseFromString(arg_5)
        arg_2(arg_7)
      else:
        arg_2(None)

      # Returning False will result in no future watches
      # being triggered. If isWatching is True, then
      # the future watches will be triggered.
      return arg_3

Helper function to get packing_plan with a callback . The future watch is placed only if isWatching is True .


(
        self, modnode, importnode, importedmodnode, importedasname
    )

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if not arg_0 . linter . is_message_enabled ( "relative-import" ) : return None if arg_3 . file is None : return False if arg_1 is arg_3 : return False if arg_1 . absolute_import_activated ( ) or getattr ( arg_2 , "level" , None ) : return False if arg_3 . name != arg_4 : arg_0 . add_message ( "relative-import" , args = ( arg_4 , arg_3 . name ) , node = arg_2 , ) return None return None

def Func(
        arg_0, arg_1, arg_2, arg_3, arg_4
    ):
        """check relative import. node is either an Import or From node, modname
        the imported module name.
        """
        if not arg_0.linter.is_message_enabled("relative-import"):
            return None
        if arg_3.file is None:
            return False  # built-in module
        if arg_1 is arg_3:
            return False  # module importing itself
        if arg_1.absolute_import_activated() or getattr(arg_2, "level", None):
            return False
        if arg_3.name != arg_4:
            # this must be a relative import...
            arg_0.add_message(
                "relative-import",
                args=(arg_4, arg_3.name),
                node=arg_2,
            )
            return None
        return None

check relative import . node is either an Import or From node modname the imported module name .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_1 is None : return None , None arg_4 = librosa . util . utils . sync ( arg_0 . _framesync_features . T , arg_1 , arg_3 = arg_3 ) . T arg_5 = np . copy ( arg_2 ) if arg_5 . shape [ 0 ] != arg_4 . shape [ 0 ] : arg_5 = np . concatenate ( ( arg_5 , [ arg_0 . _framesync_times [ - 1 ] ] ) ) return arg_4 , arg_5

def Func(arg_0, arg_1, arg_2, arg_3):
        """Make the features beat-synchronous.

        Parameters
        ----------
        beat_frames: np.array
            The frame indeces of the beat positions.
        beat_times: np.array
            The time points of the beat positions (in seconds).
        pad: boolean
            If `True`, `beat_frames` is padded to span the full range.

        Returns
        -------
        beatsync_feats: np.array
            The beat-synchronized features.
            `None` if the beat_frames was `None`.
        beatsync_times: np.array
            The beat-synchronized times.
            `None` if the beat_frames was `None`.
        """
        if arg_1 is None:
            return None, None

        # Make beat synchronous
        arg_4 = librosa.util.utils.sync(arg_0._framesync_features.T,
                                                 arg_1, arg_3=arg_3).T

        # Assign times (and add last time if padded)
        arg_5 = np.copy(arg_2)
        if arg_5.shape[0] != arg_4.shape[0]:
            arg_5 = np.concatenate((arg_5,
                                             [arg_0._framesync_times[-1]]))
        return arg_4, arg_5


def Func ( arg_0 , arg_1 = 0.1 ) : arg_2 = [ 1 - arg_1 , arg_1 ] arg_3 = np . random . choice ( [ True , False ] , arg_0 . shape [ 0 ] , arg_0 = arg_2 ) arg_4 = np . random . randn ( arg_3 . sum ( ) , 3 ) return arg_0 [ arg_3 ] + arg_4

def Func(arg_0, arg_1=0.1):
    """randomly deletes particles and adds 1-px noise for a realistic
    initial featuring guess"""
    arg_2 = [1-arg_1, arg_1]
    arg_3 = np.random.choice([True, False], arg_0.shape[0], arg_0=arg_2)
    arg_4 = np.random.randn(arg_3.sum(), 3)
    return arg_0[arg_3] + arg_4

randomly deletes particles and adds 1 - px noise for a realistic initial featuring guess


def Func ( arg_0 , arg_1 ) : try : arg_0 . error ( arg_1 . get_error ( ) ) except ProtocolError : from . . error import StanzaErrorNode arg_0 . error ( StanzaErrorNode ( "undefined-condition" ) )

def Func(arg_0,arg_1):
        """Handle disco error response.

        :Parameters:
            - `stanza`: the stanza received.
        :Types:
            - `stanza`: `pyxmpp.stanza.Stanza`"""
        try:
            arg_0.error(arg_1.get_error())
        except ProtocolError:
            from ..error import StanzaErrorNode
            arg_0.error(StanzaErrorNode("undefined-condition"))


def Func ( arg_0 , arg_1 = None ) : arg_1 = arg_0 . state if arg_1 is None else arg_1 arg_2 = arg_1 arg_3 = 0 if arg_0 . distance_matrix : for arg_4 in range ( len ( arg_2 ) ) : arg_3 += arg_0 . distance_matrix [ "{},{}" . format ( arg_2 [ arg_4 - 1 ] , arg_2 [ arg_4 ] ) ] else : for arg_4 in range ( len ( arg_2 ) ) : arg_3 += distance ( arg_0 . cities [ arg_2 [ arg_4 - 1 ] ] , arg_0 . cities [ arg_2 [ arg_4 ] ] ) return arg_3

def Func(arg_0, arg_1=None):
        """Calculates the length of the route."""
        arg_1 = arg_0.state if arg_1 is None else arg_1
        arg_2 = arg_1
        arg_3 = 0
        if arg_0.distance_matrix:
            for arg_4 in range(len(arg_2)):
                arg_3 += arg_0.distance_matrix["{},{}".format(arg_2[arg_4-1], arg_2[arg_4])]
        else:
            for arg_4 in range(len(arg_2)):
                arg_3 += distance(arg_0.cities[arg_2[arg_4-1]], arg_0.cities[arg_2[arg_4]])
        return arg_3


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the Authentication struct and decode it into
        its constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.
        """
        super(Authentication, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        arg_7 = []
        while arg_0.is_tag_next(arg_3.Tags.CREDENTIAL, arg_6):
            arg_8 = objects.Credential()
            arg_8.Func(arg_6, arg_2=arg_2)
            arg_7.append(arg_8)
        if len(arg_7) == 0:
            raise ValueError("Authentication encoding missing credentials.")
        arg_0._credentials = arg_7

        arg_0.is_oversized(arg_6)

Read the data encoding the Authentication struct and decode it into
        its constituent parts.

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

Read the data encoding the Authentication struct and decode it into its constituent parts .


def Func ( arg_0 , arg_1 ) : arg_1 = posixpath . normpath ( arg_1 ) for arg_2 in _os_alt_seps : if arg_2 in arg_1 : raise NotFound ( ) if os . path . isabs ( arg_1 ) or arg_1 == '..' or arg_1 . startswith ( '../' ) : raise NotFound ( ) return os . path . join ( arg_0 , arg_1 )

def Func(arg_0, arg_1):
    """Safely join `directory` and `filename`.

    Example usage::

        @app.route('/wiki/<path:filename>')
        def wiki_page(filename):
            filename = Func(app.config['WIKI_FOLDER'], filename)
            with open(filename, 'rb') as fd:
                content = fd.read() # Read and process the file content...

    :param directory: the base directory.
    :param filename: the untrusted filename relative to that directory.
    :raises: :class:`~werkzeug.exceptions.NotFound` if the resulting path
             would fall out of `directory`.
    """
    arg_1 = posixpath.normpath(arg_1)
    for arg_2 in _os_alt_seps:
        if arg_2 in arg_1:
            raise NotFound()
    if os.path.isabs(arg_1) or \
       arg_1 == '..' or \
       arg_1.startswith('../'):
        raise NotFound()
    return os.path.join(arg_0, arg_1)

Safely join `directory` and `filename`.

    Example usage::

        @app.route('/wiki/<path:filename>')
        def wiki_page(filename):
            filename = safe_join(app.config['WIKI_FOLDER'], filename)
            with open(filename, 'rb') as fd:
                content = fd.read() # Read and process the file content...

    :param directory: the base directory.
    :param filename: the untrusted filename relative to that directory.
    :raises: :class:`~werkzeug.exceptions.NotFound` if the resulting path
             would fall out of `directory`.


def Func(arg_0, arg_1, arg_2):
        """
            Func measurement data.

        :param info: HeaderInfo
        :param values: A collection of values received from the Outstation (various data types are possible).
        """
        arg_3 = {
            opendnp3.ICollectionIndexedBinary: VisitorIndexedBinary,
            opendnp3.ICollectionIndexedDoubleBitBinary: VisitorIndexedDoubleBitBinary,
            opendnp3.ICollectionIndexedCounter: VisitorIndexedCounter,
            opendnp3.ICollectionIndexedFrozenCounter: VisitorIndexedFrozenCounter,
            opendnp3.ICollectionIndexedAnalog: VisitorIndexedAnalog,
            opendnp3.ICollectionIndexedBinaryOutputStatus: VisitorIndexedBinaryOutputStatus,
            opendnp3.ICollectionIndexedAnalogOutputStatus: VisitorIndexedAnalogOutputStatus,
            opendnp3.ICollectionIndexedTimeAndInterval: VisitorIndexedTimeAndInterval
        }
        arg_4 = arg_3[type(arg_2)]
        arg_5 = arg_4()
        arg_2.Foreach(arg_5)
        for arg_6, arg_7 in arg_5.index_and_value:
            arg_8 = 'SOEHandler.Func {0}\theaderIndex={1}\tdata_type={2}\tindex={3}\tvalue={4}'
            _log.debug(arg_8.format(arg_1.gv, arg_1.headerIndex, type(arg_2).__name__, arg_6, arg_7))

Process measurement data.

        :param info: HeaderInfo
        :param values: A collection of values received from the Outstation (various data types are possible).


def Func(arg_0, arg_1, arg_2):
        """
        Compares and exchanges.

        Compares the value in the AL, AX, EAX or RAX register (depending on the
        size of the operand) with the first operand (destination operand). If
        the two values are equal, the second operand (source operand) is loaded
        into the destination operand. Otherwise, the destination operand is
        loaded into the AL, AX, EAX or RAX register.

        The ZF flag is set if the values in the destination operand and
        register AL, AX, or EAX are equal; otherwise it is cleared. The CF, PF,
        AF, SF, and OF flags are set according to the results of the comparison
        operation::

        (* accumulator  =  AL, AX, EAX or RAX,  depending on whether *)
        (* a byte, word, a doubleword or a 64bit comparison is being performed*)
        IF accumulator  ==  DEST
        THEN
            ZF  =  1
            DEST  =  SRC
        ELSE
            ZF  =  0
            accumulator  =  DEST
        FI;

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: source operand.
        """
        arg_3 = arg_1.size
        arg_4 = {8: 'AL', 16: 'AX', 32: 'EAX', 64: 'RAX'}[arg_3]
        arg_5 = arg_0.read_register(arg_4)
        arg_6 = arg_2.read()
        arg_7 = arg_1.read()

        arg_0.write_register(arg_4, arg_7)
        arg_1.write(Operators.ITEBV(arg_3, arg_5 == arg_7, arg_6, arg_7))

        # Affected Flags o..szapc
        arg_0._calculate_CMP_flags(arg_3, arg_5 - arg_7, arg_5, arg_7)


Strongly inspired from idlelib.ColorDelegator.make_pat

return "|".join([instance, decorator, kw, kw_namespace, builtin,
                     word_operators, builtin_fct, comment,
                     ufstring1, ufstring2, ufstring3, ufstring4, string,
                     number, any("SYNC", [r"\n"])])

Strongly inspired from idlelib . ColorDelegator . make_pat


def Func():  # pragma: no cover
    """
    Print a friendly message.
    """

    arg_0 = int(choice(str(int(time()))))

    if not CONFIGURATION["quiet"] and arg_0 % 3 == 0:
        print("\n" + Fore.GREEN + Style.BRIGHT + "Thanks for using PyFunceble!")
        print(
            Fore.YELLOW
            + Style.BRIGHT
            + "Share your experience on "
            + Fore.CYAN
            + "Twitter"
            + Fore.YELLOW
            + " with "
            + Fore.CYAN
            + "#PyFunceble"
            + Fore.YELLOW
            + "!"
        )
        print(
            Fore.GREEN
            + Style.BRIGHT
            + "Have a feedback, an issue or an improvement idea ?"
        )
        print(
            Fore.YELLOW
            + Style.BRIGHT
            + "Let us know on "
            + Fore.CYAN
            + "GitHub"
            + Fore.YELLOW
            + "!"
        )


def Func ( arg_0 ) : if arg_0 . markup and arg_0 . markup_lines : arg_1 = arg_0 . markup_lines if len ( arg_1 ) > 0 and not string . strip ( arg_1 [ - 1 ] ) : arg_0 . markup_lines = arg_1 [ : - 1 ] arg_3 = DocMarkup ( arg_0 . markup , arg_0 . markup_lines ) arg_0 . markups . append ( arg_3 ) arg_0 . markup = None arg_0 . markup_lines = [ ]

def  Func( arg_0 ):
        """add a new markup section"""
        if arg_0.markup and arg_0.markup_lines:

            # get rid of last line of markup if it's empty
            arg_1 = arg_0.markup_lines
            if len( arg_1 ) > 0 and not string.strip( arg_1[-1] ):
                arg_0.markup_lines = arg_1[:-1]

            arg_3 = DocMarkup( arg_0.markup, arg_0.markup_lines )

            arg_0.markups.append( arg_3 )

            arg_0.markup       = None
            arg_0.markup_lines = []


(self, traj_node, branch_name,
                               store_data=pypetconstants.STORE_DATA,
                               with_links=True,
                               recursive=False,
                               max_depth=None,
                               hdf5_group=None)

def Func(arg_0, arg_1, arg_2,
                               arg_3=arg_4.STORE_DATA,
                               arg_6=True,
                               arg_7=False,
                               arg_8=None,
                               arg_9=None):
        """Stores data starting from a node along a branch and starts recursively loading
        all data at end of branch.

        :param traj_node: The node where storing starts

        :param branch_name:

            A branch along which storing progresses. Colon Notation is used:
            'group1.group2.group3' loads 'group1', then 'group2', then 'group3', and then finally
            recursively all children and children's children below 'group3'.

        :param store_data: How data should be stored

        :param with_links: If links should be stored

        :param recursive:

            If the rest of the tree should be recursively stored

        :param max_depth:

            Maximum depth to store

        :param hdf5_group:

            HDF5 node in the file corresponding to `traj_node`

        """
        if arg_3 == arg_4.STORE_NOTHING:
            return

        if arg_8 is None:
            arg_8 = float('inf')

        if arg_9 is None:
            # Get parent hdf5 node
            arg_10 = arg_1.v_full_name
            arg_11 = arg_10.replace('.', '/')
            try:
                if arg_10 == '':
                    arg_9 = arg_0._trajectory_group
                else:
                    arg_9 = arg_0._hdf5file.get_node( where=arg_0._trajectory_group,
                                                         arg_15=arg_11)
            except pt.NoSuchNodeError:
                arg_0._logger.debug('Cannot store `%s` the parental hdf5 node with path `%s` does '
                                     'not exist on disk.' %
                                     (arg_1.v_name, arg_11))

                if arg_1.v_is_leaf:
                    arg_0._logger.error('Cannot store `%s` the parental hdf5 '
                                       'node with path `%s` does '
                                       'not exist on disk! The child '
                                       'you want to store is a leaf node,'
                                       'that cannot be stored without '
                                       'the parental node existing on '
                                       'disk.' % (arg_1.v_name, arg_11))
                    raise
                else:
                    arg_0._logger.debug('I will try to store the path from trajectory root to '
                                         'the child now.')

                    arg_0.Func(arg_1._nn_interface._root_instance,
                                                arg_1.v_full_name + '.' + arg_2,
                                                arg_3=arg_3, arg_6=arg_6,
                                                arg_7=arg_7,
                                                arg_8=arg_8 + arg_1.v_depth,
                                                arg_9=arg_0._trajectory_group)
                    return

        arg_12 = 1

        arg_13 = arg_2.split('.')

        arg_14 = arg_13.pop()

        for arg_15 in arg_13:
            if arg_12 > arg_8:
                return
            # Store along a branch
            arg_0._tree_store_nodes_dfs(arg_1, arg_15, arg_3=arg_3, arg_6=arg_6,
                                   arg_7=False, arg_8=arg_8,
                                   arg_12=arg_12, parent_hdf5_group=arg_9)
            arg_12 += 1

            arg_1 = arg_1._children[arg_15]

            arg_9 = getattr(arg_9, arg_15)

        # Store final group and recursively everything below it
        if arg_12 <= arg_8:
            arg_0._tree_store_nodes_dfs(arg_1, arg_14, arg_3=arg_3,
                               arg_6=arg_6, arg_7=arg_7,
                               arg_8=arg_8, arg_12=arg_12,
                               parent_hdf5_group=arg_9)

Stores data starting from a node along a branch and starts recursively loading all data at end of branch .


def Func ( arg_0 ) : arg_0 . sky_file = os . path . abspath ( os . path . join ( os . path . join ( arg_0 . input_path , 'sky_files' ) , 'sky_' + arg_0 . sky_state + '_z' + str ( arg_0 . sky_zenith ) + '_a' + str ( arg_0 . sky_azimuth ) + '_' + str ( arg_0 . num_bands ) + '_' + arg_0 . ds_code ) )

def Func(arg_0):
        """Does nothing currently.  May not need this method"""
        arg_0.sky_file = os.path.abspath(os.path.join(os.path.join(arg_0.input_path, 'sky_files'),
                                                     'sky_' + arg_0.sky_state + '_z' + str(
                                                         arg_0.sky_zenith) + '_a' + str(
                                                         arg_0.sky_azimuth) + '_' + str(
                                                         arg_0.num_bands) + '_' + arg_0.ds_code))

Does nothing currently . May not need this method


def Func ( arg_0 , arg_1 , arg_2 ) : log . debug ( '----------------------------------' ) log . debug ( 'remote_transactions_received' , count = len ( arg_2 ) , remote_id = arg_1 ) def _add_txs ( ) : for arg_3 in arg_2 : arg_0 . add_transaction ( arg_3 , origin = arg_1 ) gevent . spawn ( _add_txs )

def Func(arg_0, arg_1, arg_2):
        "receives rlp.decoded serialized"
        log.debug('----------------------------------')
        log.debug('remote_transactions_received', count=len(arg_2), remote_id=arg_1)

        def _add_txs():
            for arg_3 in arg_2:
                arg_0.add_transaction(arg_3, origin=arg_1)
        gevent.spawn(_add_txs)


return ', '.join(
        '%s=%s' % (key, value) for key, value in sorted(values.items()))

def
Func
(
arg_0
,
arg_1
)
:
return
', '
.
join
(
'%s=%s'
%
(
arg_2
,
arg_3
)
for
arg_2
,
arg_3
in
sorted
(
arg_1
.
items
(
)
)
)

def Func(arg_0, arg_1):
    """Returns a string of comma-delimited key=value pairs."""
    return ', '.join(
        '%s=%s' % (arg_2, arg_3) for arg_2, arg_3 in sorted(arg_1.items()))

Returns a string of comma - delimited key = value pairs .


def Func ( arg_0 : arg_1 [ arg_2 ] , arg_3 : arg_1 [ arg_2 ] ) -> float : arg_4 , arg_5 = set ( arg_0 ) , set ( arg_3 ) arg_6 = arg_4 | arg_5 if not arg_6 : return 0.0 return len ( arg_4 & arg_5 ) / len ( arg_6 )

def Func(arg_0: arg_1[arg_2], arg_3: arg_1[arg_2]) -> float:
    """Calculate the tanimoto set similarity."""
    arg_4, arg_5 = set(arg_0), set(arg_3)
    arg_6 = arg_4 | arg_5

    if not arg_6:
        return 0.0

    return len(arg_4 & arg_5) / len(arg_6)


def Func(arg_0, arg_1):
    """D and A emission rates for two populations.
    """
    arg_2, arg_3 = [], []
    for arg_4, arg_5 in zip(arg_0, arg_1):
        arg_6, arg_7 = em_rates_from_E_DA(arg_4, arg_5)
        arg_2.append(arg_6)
        arg_3.append(arg_7)
    return arg_2, arg_3

D and A emission rates for two populations .


return math.factorial(len(nums) - 1) * rolling_sum

def Func(arg_0):
    r"""Return logarithmic mean.

    The logarithmic mean of an arbitrarily long series is defined by
    http://www.survo.fi/papers/logmean.pdf
    as:
    :math:`L(x_1, x_2, ..., x_n) =
    (n-1)! \sum\limits_{i=1}^n \frac{x_i}
    {\prod\limits_{\substack{j = 1\\j \ne i}}^n
    ln \frac{x_i}{x_j}}`

    Cf. https://en.wikipedia.org/wiki/Logarithmic_mean

    Parameters
    ----------
    nums : list
        A series of numbers

    Returns
    -------
    float
        The logarithmic mean of nums

    Raises
    ------
    AttributeError
        No two values in the nums list may be equal

    Examples
    --------
    >>> Func([1, 2, 3, 4])
    2.2724242417489258
    >>> Func([1, 2])
    1.4426950408889634

    """
    if len(arg_0) != len(set(arg_0)):
        raise AttributeError('No two values in the nums list may be equal')
    arg_1 = 0
    for arg_2 in range(len(arg_0)):
        arg_3 = 1
        for arg_4 in range(len(arg_0)):
            if arg_2 != arg_4:
                arg_3 *= math.log(arg_0[arg_2] / arg_0[arg_4])
        arg_1 += arg_0[arg_2] / arg_3
    return math.factorial(len(arg_0) - 1) * arg_1

r"""Return logarithmic mean.

    The logarithmic mean of an arbitrarily long series is defined by
    http://www.survo.fi/papers/logmean.pdf
    as:
    :math:`L(x_1, x_2, ..., x_n) =
    (n-1)! \sum\limits_{i=1}^n \frac{x_i}
    {\prod\limits_{\substack{j = 1\\j \ne i}}^n
    ln \frac{x_i}{x_j}}`

    Cf. https://en.wikipedia.org/wiki/Logarithmic_mean

    Parameters
    ----------
    nums : list
        A series of numbers

    Returns
    -------
    float
        The logarithmic mean of nums

    Raises
    ------
    AttributeError
        No two values in the nums list may be equal

    Examples
    --------
    >>> lmean([1, 2, 3, 4])
    2.2724242417489258
    >>> lmean([1, 2])
    1.4426950408889634


def
Func
(
arg_0
)
:
jocker_lgr
.
debug
(
'config file is: {0}'
.
format
(
arg_0
)
)
try
:
jocker_lgr
.
debug
(
'importing config...'
)
with
open
(
arg_0
,
'r'
)
as
c
:
return
yaml
.
safe_load
(
c
.
read
(
)
)
except
IOError
as
ex
:
jocker_lgr
.
error
(
str
(
ex
)
)
raise
RuntimeError
(
'cannot access config file'
)
except
yaml
.
parser
.
ParserError
as
ex
:
jocker_lgr
.
error
(
'invalid yaml file: {0}'
.
format
(
ex
)
)
raise
RuntimeError
(
'invalid yaml file'
)

def Func(arg_0):
    """returns a configuration object

    :param string config_file: path to config file
    """
    # get config file path
    jocker_lgr.debug('config file is: {0}'.format(arg_0))
    # append to path for importing
    try:
        jocker_lgr.debug('importing config...')
        with open(arg_0, 'r') as c:
            return yaml.safe_load(c.read())
    except IOError as ex:
        jocker_lgr.error(str(ex))
        raise RuntimeError('cannot access config file')
    except yaml.parser.ParserError as ex:
        jocker_lgr.error('invalid yaml file: {0}'.format(ex))
        raise RuntimeError('invalid yaml file')


def Func ( arg_0 , arg_1 = None ) : if arg_1 : return arg_0 . api . processor . get ( name = arg_1 ) [ 'objects' ] else : return arg_0 . api . processor . get ( ) [ 'objects' ]

def Func(arg_0, arg_1=None):
        """Return a list of Processor objects.

        :param project_id: ObjectId of Genesis project
        :type project_id: string
        :rtype: list of Processor objects

        """
        if arg_1:
            return arg_0.api.processor.get(name=arg_1)['objects']
        else:
            return arg_0.api.processor.get()['objects']


return iter(data.keys(**kwargs)) if IS_PY3 else data.iterkeys(**kwargs)

def Func ( arg_0 , ** arg_1 ) : return iter ( arg_0 . keys ( ** arg_1 ) ) if IS_PY3 else arg_0 . Func ( ** arg_1 )

def Func(arg_0, **arg_1):
    """Iterate over dict keys."""
    return iter(arg_0.keys(**arg_1)) if IS_PY3 else arg_0.Func(**arg_1)


def Func ( arg_0 ) : for arg_1 in arg_0 . child_parsers ( ) : for arg_2 , arg_3 in arg_1 . _bytes_lines ( ) : yield arg_3

def Func(arg_0):
        """Find the statements in `self.code`.

        Produce a sequence of line numbers that start statements.  Recurses
        into all code objects reachable from `self.code`.

        """
        for arg_1 in arg_0.child_parsers():
            # Get all of the lineno information from this code.
            for arg_2, arg_3 in arg_1._bytes_lines():
                yield arg_3


def Func(arg_0, arg_1):
        """
        A simple checker, that connections are coming in descending order of departure time
        and that no departure time has been "skipped".

        Parameters
        ----------
        dep_time

        Returns
        -------
        None
        """
        assert arg_1 <= arg_0._min_dep_time, "Labels should be entered in decreasing order of departure time."
        arg_2 = arg_0.dep_times_to_index[arg_1]
        if arg_0._min_dep_time < float('inf'):
            arg_3 = arg_0.dep_times_to_index[arg_0._min_dep_time]
            assert arg_3 == arg_2 or (arg_3 == arg_2 - 1), \
                "dep times should be ordered sequentially"
        else:
            assert arg_2 is 0, "first dep_time index should be zero (ensuring that all connections are properly handled)"
        arg_0._min_dep_time = arg_1

A simple checker that connections are coming in descending order of departure time and that no departure time has been skipped .


(obj, from_date, with_json=True, latest_only=False, **kwargs)

return dict(name=obj.name,
                description=obj.description,
                website=obj.website,
                user_id=obj.user_id,
                client_id=obj.client_id,
                client_secret=obj.client_secret,
                is_confidential=obj.is_confidential,
                is_internal=obj.is_internal,
                _redirect_uris=obj._redirect_uris,
                _default_scopes=obj._default_scopes)

def Func(arg_0, arg_1, arg_2=True, arg_3=False, **arg_4):
    """Dump the oauth2server Client."""
    return dict(name=arg_0.name,
                description=arg_0.description,
                website=arg_0.website,
                user_id=arg_0.user_id,
                client_id=arg_0.client_id,
                client_secret=arg_0.client_secret,
                is_confidential=arg_0.is_confidential,
                is_internal=arg_0.is_internal,
                _redirect_uris=arg_0._redirect_uris,
                _default_scopes=arg_0._default_scopes)


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_2 . extend ( arg_1 . subgraphs ) arg_2 . extend ( arg_1 . clusters ) arg_2 . extend ( arg_1 . nodes ) arg_2 . extend ( arg_1 . edges ) return arg_2

def Func ( arg_0, arg_1 ):
        """ Gets the object's children.
        """
        arg_2 = []
        arg_2.extend( arg_1.subgraphs )
        arg_2.extend( arg_1.clusters )
        arg_2.extend( arg_1.nodes )
        arg_2.extend( arg_1.edges )
        return arg_2


(self, bucket_name, source_objects, destination_object)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Composes a list of existing object into a new object in the same storage bucket_name

        Currently it only supports up to 32 objects that can be concatenated
        in a single operation

        https://cloud.google.com/storage/docs/json_api/v1/objects/Func

        :param bucket_name: The name of the bucket containing the source objects.
            This is also the same bucket to store the Funcd destination object.
        :type bucket_name: str
        :param source_objects: The list of source objects that will be Funcd
            into a single object.
        :type source_objects: list
        :param destination_object: The path of the object if given.
        :type destination_object: str
        """

        if not arg_2 or not len(arg_2):
            raise ValueError('source_objects cannot be empty.')

        if not arg_1 or not arg_3:
            raise ValueError('bucket_name and destination_object cannot be empty.')

        arg_0.log.info("Composing %s to %s in the bucket %s",
                      arg_2, arg_3, arg_1)
        arg_4 = arg_0.get_conn()
        arg_5 = arg_4.get_bucket(arg_1)
        arg_6 = arg_5.blob(arg_3)
        arg_6.Func(
            sources=[
                arg_5.blob(blob_name=arg_7) for arg_7 in arg_2
            ])

        arg_0.log.info("Completed successfully.")

Composes a list of existing object into a new object in the same storage bucket_name

        Currently it only supports up to 32 objects that can be concatenated
        in a single operation

        https://cloud.google.com/storage/docs/json_api/v1/objects/compose

        :param bucket_name: The name of the bucket containing the source objects.
            This is also the same bucket to store the composed destination object.
        :type bucket_name: str
        :param source_objects: The list of source objects that will be composed
            into a single object.
        :type source_objects: list
        :param destination_object: The path of the object if given.
        :type destination_object: str


Call plugins in a chain, where the result of each plugin call is
        sent to the next plugin as input. The final output result is returned.

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = None arg_4 = [ a for ( arg_4 , a ) in zip ( getattr ( arg_0 . method , 'static_args' , [ ] ) , arg_1 ) if arg_4 ] for arg_5 , arg_6 in arg_0 . plugins : arg_3 = arg_6 ( * arg_1 , ** arg_2 ) arg_1 = arg_4 [ : ] arg_1 . append ( arg_3 ) return arg_3

def Func(arg_0, *arg_1, **arg_2):
        """Call plugins in a Func, where the result of each plugin call is
        sent to the next plugin as input. The final output result is returned.
        """
        arg_3 = None
        # extract the static arguments (if any) from arg so they can
        # be passed to each plugin call in the Func
        arg_4 = [a for (arg_4, a)
                  in zip(getattr(arg_0.method, 'static_args', []), arg_1)
                  if arg_4]
        for arg_5, arg_6 in arg_0.plugins:
            arg_3 = arg_6(*arg_1, **arg_2)
            arg_1 = arg_4[:]
            arg_1.append(arg_3)
        return arg_3

Call plugins in a chain where the result of each plugin call is sent to the next plugin as input . The final output result is returned .


def Func ( arg_0 , Func ) : if Func == arg_0 . node1 : return arg_0 . node2 elif Func == arg_0 . node2 : return arg_0 . node1 else : return None

def Func(arg_0, Func):
        """
        Return the other node
        """

        if Func == arg_0.node1:
            return arg_0.node2
        elif Func == arg_0.node2:
            return arg_0.node1
        else:
            return None


def Func ( arg_0 , arg_1 ) : arg_2 = [ arg_0 < 0 , arg_0 >= 0 ] arg_3 = [ np . sum ( arg_1 < arg_0 . reshape ( len ( arg_0 ) , 1 ) , axis = 1 ) / np . sum ( arg_1 < 0 , axis = 1 ) , np . sum ( arg_1 >= arg_0 . reshape ( len ( arg_0 ) , 1 ) , axis = 1 ) / np . sum ( arg_1 >= 0 , axis = 1 ) ] arg_4 = np . select ( arg_2 , arg_3 ) return arg_4

def Func(arg_0, arg_1):
    """Compute nominal p-value.

    From article (PNAS):
    estimate nominal p-value for S from esnull by using the positive
    or negative portion of the distribution corresponding to the sign
    of the observed ES(S).
    """

    # to speed up, using numpy function to compute pval in parallel.
    arg_2 = [ arg_0 < 0, arg_0 >=0]
    arg_3 = [np.sum(arg_1 < arg_0.reshape(len(arg_0),1), axis=1)/ np.sum(arg_1 < 0, axis=1),
                  np.sum(arg_1 >= arg_0.reshape(len(arg_0),1), axis=1)/ np.sum(arg_1 >= 0, axis=1)]
    arg_4 = np.select(arg_2, arg_3)

    return arg_4


return sum2diag(dot(ddot(Q0, self.v0 * S0), Q0.T), self.v1)

def Func(arg_0):
        r"""Covariance of the prior.

        Returns
        -------
        :class:`numpy.ndarray`
            :math:`v_0 \mathrm K + v_1 \mathrm I`.
        """
        from numpy_sugar.linalg import ddot, sum2diag

        arg_1 = arg_0._QS[0][0]
        arg_2 = arg_0._QS[1]
        return sum2diag(dot(ddot(arg_1, arg_0.v0 * arg_2), arg_1.T), arg_0.v1)


def Func ( arg_0 , arg_1 , arg_2 = { } ) : arg_3 = SECTIONS_API . format ( arg_1 ) + "/enrollments" arg_4 = [ ] for arg_5 in arg_0 . _get_paged_resource ( arg_3 , arg_2 = arg_2 ) : arg_4 . append ( CanvasEnrollment ( data = arg_5 ) ) return arg_4

def Func(arg_0, arg_1, arg_2={}):
        """
        Return a list of all enrollments for the passed section_id.

        https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.index
        """
        arg_3 = SECTIONS_API.format(arg_1) + "/enrollments"

        arg_4 = []
        for arg_5 in arg_0._get_paged_resource(arg_3, arg_2=arg_2):
            arg_4.append(CanvasEnrollment(data=arg_5))

        return arg_4

Return a list of all enrollments for the passed section_id .


return {
        name.lower(): name
        for name in r['Values']
    }

def Func ( ) -> Mapping [ str , str ] : arg_0 = get_bel_resource ( NIFT ) return { arg_1 . lower ( ) : arg_1 for arg_1 in arg_0 [ 'Values' ] }

def Func() -> Mapping[str, str]:
    """Extract the list of NIFT names from the BEL resource and builds a dictionary mapping from the lowercased version
    to the uppercase version.
    """
    arg_0 = get_bel_resource(NIFT)
    return {
        arg_1.lower(): arg_1
        for arg_1 in arg_0['Values']
    }

Extract the list of NIFT names from the BEL resource and builds a dictionary mapping from the lowercased version to the uppercase version .


return hmac.new(
            self._secret, request.data, hashlib.sha1).hexdigest() if self._secret else None

def Func ( arg_0 ) : return hmac . new ( arg_0 . _secret , request . data , hashlib . sha1 ) . hexdigest ( ) if arg_0 . _secret else None

def Func(arg_0):
        """Return message digest if a secret key was provided"""

        return hmac.new(
            arg_0._secret, request.data, hashlib.sha1).hexdigest() if arg_0._secret else None


def Func ( arg_0 ) : arg_1 = { } for arg_2 in six . iterkeys ( Task . FIELDS ) : arg_3 = '%s_template' % arg_2 if arg_3 in arg_0 . config : arg_1 [ arg_2 ] = arg_0 . config . get ( arg_3 ) return arg_1

def Func(arg_0):
        """ Get any defined templates for configuration values.

        Users can override the value of any Taskwarrior field using
        this feature on a per-key basis.  The key should be the name of
        the field to you would like to configure the value of, followed
        by '_template', and the value should be a Jinja template
        generating the field's value.  As context variables, all fields
        on the taskwarrior record are available.

        For example, to prefix the returned
        project name for tickets returned by a service with 'workproject_',
        you could add an entry reading:

            project_template = workproject_{{project}}

        Or, if you'd simply like to override the returned project name
        for all tickets incoming from a specific service, you could add
        an entry like:

            project_template = myprojectname

        The above would cause all issues to recieve a project name
        of 'myprojectname', regardless of what the project name of the
        generated issue was.

        """
        arg_1 = {}
        for arg_2 in six.iterkeys(Task.FIELDS):
            arg_3 = '%s_template' % arg_2
            if arg_3 in arg_0.config:
                arg_1[arg_2] = arg_0.config.get(arg_3)
        return arg_1

Get any defined templates for configuration values .


def Func ( arg_0 , arg_1 , arg_2 = False ) : if arg_1 in arg_0 . Funcs : return arg_0 . Funcs [ arg_1 ] else : if arg_2 : arg_0 . Funcs [ arg_1 ] = arg_0 . connection . Func ( Func_factory = psycopg2 . extras . DictCursor ) else : arg_0 . Funcs [ arg_1 ] = arg_0 . connection . Func ( ) return arg_0 . Funcs [ arg_1 ]

def Func(arg_0, arg_1, arg_2=False):
        '''This gets or creates a DB Func for the current DB connection.

        Parameters
        ----------

        handle : str
            The name of the Func to look up in the existing list or if it
            doesn't exist, the name to be used for a new Func to be returned.

        dictFunc : bool
            If True, returns a Func where each returned row can be addressed
            as a dictionary by column name.

        Returns
        -------

        psycopg2.Cursor instance

        '''

        if arg_1 in arg_0.Funcs:

            return arg_0.Funcs[arg_1]

        else:
            if arg_2:
                arg_0.Funcs[arg_1] = arg_0.connection.Func(
                    Func_factory=psycopg2.extras.DictCursor
                )
            else:
                arg_0.Funcs[arg_1] = arg_0.connection.Func()

            return arg_0.Funcs[arg_1]

This gets or creates a DB cursor for the current DB connection.

        Parameters
        ----------

        handle : str
            The name of the cursor to look up in the existing list or if it
            doesn't exist, the name to be used for a new cursor to be returned.

        dictcursor : bool
            If True, returns a cursor where each returned row can be addressed
            as a dictionary by column name.

        Returns
        -------

        psycopg2.Cursor instance

This gets or creates a DB cursor for the current DB connection .


def
Func
(
arg_0
,
arg_1
=
5
)
:
assert
len
(
arg_0
)
>
0
,
"No metrics found"
arg_2
=
PrettyTable
(
[
"Metric"
,
"mean"
,
"standard deviation"
,
"min"
,
"max"
,
"sum"
,
]
)
for
arg_3
in
arg_0
:
arg_2
.
add_row
(
[
arg_3
.
prettyPrintTitle
(
)
]
+
arg_3
.
getStats
(
)
)
return
arg_2
.
get_string
(
)
.
encode
(
"utf-8"
)

def Func(arg_0, arg_1=5):
    """
    Returns pretty-printed table of metrics.

    @param metrics (list) Traces to print in table
    @param sigFigs (int)  Number of significant figures to print

    @return (string) Pretty-printed table of metrics.
    """
    assert len(arg_0) > 0, "No metrics found"
    arg_2 = PrettyTable(["Metric", "mean", "standard deviation",
                         "min", "max", "sum", ])

    for arg_3 in arg_0:
      arg_2.add_row([arg_3.prettyPrintTitle()] + arg_3.getStats())

    return arg_2.get_string().encode("utf-8")

Returns pretty - printed table of metrics .


def Func ( arg_0 , arg_1 ) : _check_cols ( arg_0 , [ arg_1 ] ) if 'O' in arg_0 [ arg_1 ] or pd . np . issubdtype ( arg_0 [ arg_1 ] . dtype , str ) : return [ arg_2 . lower ( ) for arg_2 in arg_0 [ pd . notnull ( arg_0 ) ] [ arg_1 ] if not pd . isnull ( arg_2 ) ] else : return [ arg_2 for arg_2 in arg_0 [ pd . notnull ( arg_0 ) ] [ arg_1 ] if not pd . isnull ( arg_2 ) ]

def Func(arg_0, arg_1):
    """ Return a list of not null values from the `col_name` column of `df`."""
    _check_cols(arg_0, [arg_1])

    if 'O' in arg_0[arg_1] or pd.np.issubdtype(arg_0[arg_1].dtype, str): # if the column is of strings
        return [arg_2.lower() for arg_2 in arg_0[pd.notnull(arg_0)][arg_1] if not pd.isnull(arg_2)]
    else:
        return [arg_2 for arg_2 in arg_0[pd.notnull(arg_0)][arg_1] if not pd.isnull(arg_2)]

Return a list of not null values from the col_name column of df .


def Func ( arg_0 , arg_1 ) : arg_2 = Service . search ( ) arg_2 = arg_2 . filter ( "term" , address = arg_1 . address ) arg_2 = arg_2 . filter ( "term" , protocol = arg_1 . protocol ) arg_2 = arg_2 . filter ( "term" , port = arg_1 . port ) arg_2 = arg_2 . filter ( "term" , state = arg_1 . state ) if arg_2 . count ( ) : arg_3 = arg_2 [ 0 ] . execute ( ) [ 0 ] return arg_3 . meta . id else : return None

def Func(arg_0, arg_1):
        """
            Searches elasticsearch for objects with the same address, protocol, port and state.
        """
        arg_2 = Service.search()
        arg_2 = arg_2.filter("term", address=arg_1.address)
        arg_2 = arg_2.filter("term", protocol=arg_1.protocol)
        arg_2 = arg_2.filter("term", port=arg_1.port)
        arg_2 = arg_2.filter("term", state=arg_1.state)
        if arg_2.count():
            arg_3 = arg_2[0].execute()[0]
            return arg_3.meta.id
        else:
            return None

Searches elasticsearch for objects with the same address protocol port and state .


Helper method for fetchone, which returns the next row from a buffer.
        If the buffer is empty, attempts to paginate through the result set for
        the next page, and load it into the buffer.

def Func ( arg_0 ) : if not arg_0 . job_id : return None if len ( arg_0 . buffer ) == 0 : if arg_0 . all_pages_loaded : return None arg_1 = ( arg_0 . service . jobs ( ) . getQueryResults ( projectId = arg_0 . project_id , jobId = arg_0 . job_id , pageToken = arg_0 . page_token ) . execute ( num_retries = arg_0 . num_retries ) ) if 'rows' in arg_1 and arg_1 [ 'rows' ] : arg_0 . page_token = arg_1 . get ( 'pageToken' ) arg_3 = arg_1 [ 'schema' ] [ 'fields' ] arg_4 = [ field [ 'type' ] for field in arg_3 ] arg_5 = arg_1 [ 'rows' ] for arg_6 in arg_5 : arg_7 = ( [ _bq_cast ( vs [ 'v' ] , arg_4 [ idx ] ) for idx , vs in enumerate ( arg_6 [ 'f' ] ) ] ) arg_0 . buffer . append ( arg_7 ) if not arg_0 . page_token : arg_0 . all_pages_loaded = True else : arg_0 . page_token = None arg_0 . job_id = None arg_0 . page_token = None return None return arg_0 . buffer . pop ( 0 )

def Func(arg_0):
        """
        Helper method for fetchone, which returns the Func row from a buffer.
        If the buffer is empty, attempts to paginate through the result set for
        the Func page, and load it into the buffer.
        """
        if not arg_0.job_id:
            return None

        if len(arg_0.buffer) == 0:
            if arg_0.all_pages_loaded:
                return None

            arg_1 = (arg_0.service.jobs().getQueryResults(
                projectId=arg_0.project_id,
                jobId=arg_0.job_id,
                pageToken=arg_0.page_token).execute(num_retries=arg_0.num_retries))

            if 'rows' in arg_1 and arg_1['rows']:
                arg_0.page_token = arg_1.get('pageToken')
                arg_3 = arg_1['schema']['fields']
                arg_4 = [field['type'] for field in arg_3]
                arg_5 = arg_1['rows']

                for arg_6 in arg_5:
                    arg_7 = ([
                        _bq_cast(vs['v'], arg_4[idx])
                        for idx, vs in enumerate(arg_6['f'])
                    ])
                    arg_0.buffer.append(arg_7)

                if not arg_0.page_token:
                    arg_0.all_pages_loaded = True

            else:
                # Reset all state since we've exhausted the results.
                arg_0.page_token = None
                arg_0.job_id = None
                arg_0.page_token = None
                return None

        return arg_0.buffer.pop(0)

Helper method for fetchone which returns the next row from a buffer . If the buffer is empty attempts to paginate through the result set for the next page and load it into the buffer .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
is
:
if
arg_0
.
xmlnode
.
hasProp
(
"action"
)
:
arg_0
.
xmlnode
.
unsetProp
(
"action"
)
return
if
arg_1
not
in
(
"remove"
,
"update"
)
:
raise
ValueError
(
"Action must be 'update' or 'remove'"
)
arg_1
=
unicode
(
arg_1
)
arg_0
.
xmlnode
.
setProp
(
"action"
,
arg_1
.
encode
(
"utf-8"
)
)

def Func(arg_0,arg_1):
        """Set the action of the item.

        :Parameters:
            - `action`: the new action or `None`.
        :Types:
            - `action`: `unicode`
        """
        if arg_1 is None:
            if arg_0.xmlnode.hasProp("action"):
                arg_0.xmlnode.unsetProp("action")
            return
        if arg_1 not in ("remove","update"):
            raise ValueError("Action must be 'update' or 'remove'")
        arg_1 = unicode(arg_1)
        arg_0.xmlnode.setProp("action", arg_1.encode("utf-8"))


def Func(arg_0, arg_1, arg_2=0.5):
        '''Reduce noise in the audio signal by profiling and filtering.
        This effect is moderately effective at removing consistent
        background noise such as hiss or hum.

        Parameters
        ----------
        profile_path : str
            Path to a noise profile file.
            This file can be generated using the `noiseprof` effect.
        amount : float, default=0.5
            How much noise should be removed is specified by amount. Should
            be between 0 and 1.  Higher numbers will remove more noise but
            present a greater likelihood  of  removing wanted  components  of
            the  audio  signal.

        See Also
        --------
        noiseprof

        '''

        if not os.path.exists(arg_1):
            raise IOError(
                "profile_path {} does not exist.".format(arg_1))

        if not is_number(arg_2) or arg_2 < 0 or arg_2 > 1:
            raise ValueError("amount must be a number between 0 and 1.")

        arg_3 = [
            'Func',
            arg_1,
            '{:f}'.format(arg_2)
        ]
        arg_0.effects.extend(arg_3)
        arg_0.effects_log.append('Func')

        return arg_0

Reduce noise in the audio signal by profiling and filtering . This effect is moderately effective at removing consistent background noise such as hiss or hum .


def Func(arg_0, arg_1, arg_2):
        """Handle an error gracefully.  May be overridden.

        The default is to _logger.info a traceback and continue.

        """
        arg_3 = sys.exc_info()
        arg_4 = arg_3[1]
        # Suppress stack trace when client aborts connection disgracefully:
        # 10053: Software caused connection abort
        # 10054: Connection reset by peer
        if arg_4.args[0] in (10053, 10054):
            _logger.error("*** Caught socket.error: {}".format(arg_4))
            return
        # This is what BaseHTTPServer.HTTPServer.Func does, but with
        # added thread ID and using stderr
        _logger.error("-" * 40, file=sys.stderr)
        _logger.error(
            "<{}> Exception happened during processing of request from {}".format(
                threading.currentThread().ident, arg_2
            )
        )
        _logger.error(arg_2, file=sys.stderr)
        traceback.print_exc()
        _logger.error("-" * 40, file=sys.stderr)
        _logger.error(arg_1, file=sys.stderr)

Handle an error gracefully . May be overridden .


def Func(arg_0, **arg_1):
        """Return a Func."""
        # This is a fairly standard way to set up some defaults
        # while letting the caller override them.
        arg_2 = {}
        if arg_0.ppoi_field:
            arg_2['form_class'] = SizedImageCenterpointClickDjangoAdminField
        if arg_1.get('widget') is AdminFileWidget:
            # Ensuring default admin widget is skipped (in favor of using
            # SizedImageCenterpointClickDjangoAdminField's default widget as
            # the default widget choice for use in the admin).
            # This is for two reasons:
            # 1. To prevent 'typical' admin users (those who want to use
            #    the PPOI 'click' widget by default) from having to
            #    specify a Func_overrides for each ModelAdmin class
            #    used by each model that has a VersatileImageField.
            # 2. If a VersatileImageField does not have a ppoi_field specified
            #    it will 'fall back' to a ClearableFileInput anyways.
            # If admin users do, in fact, want to force use of the
            # AdminFileWidget they can simply subclass AdminFileWidget and
            # specify it in their ModelAdmin.Func_overrides (though,
            # if that's the case, why are they using VersatileImageField in
            # the first place?)
            del arg_1['widget']
        arg_2.update(arg_1)
        return super(VersatileImageField, arg_0).Func(**arg_2)


(context, institute_id, sanger_recipient, coverage_cutoff, frequency_cutoff,
              display_name, remove_sanger)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
arg_7
=
arg_0
.
obj
[
'adapter'
]
LOG
.
info
(
"Running scout update Func"
)
try
:
arg_7
.
update_Func
(
internal_id
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
arg_5
=
arg_5
,
arg_6
=
arg_6
,
)
except
Exception
as
err
:
LOG
.
warning
(
err
)
arg_0
.
abort
(
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
              arg_5, arg_6):
    """
    Update an Func
    """
    arg_7 = arg_0.obj['adapter']
    LOG.info("Running scout update Func")

    try:
        arg_7.update_Func(
            internal_id=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=arg_6,
            )
    except Exception as err:
        LOG.warning(err)
        arg_0.abort()


(input, noise=0.1, doForeground=True, doBackground=True)

def Func ( arg_0 , arg_1 = 0.1 , arg_2 = True , arg_3 = True ) : if arg_2 and arg_3 : return numpy . abs ( arg_0 - ( numpy . random . random ( arg_0 . shape ) < arg_1 ) ) else : if arg_2 : return numpy . logical_and ( arg_0 , numpy . random . random ( arg_0 . shape ) > arg_1 ) if arg_3 : return numpy . logical_or ( arg_0 , numpy . random . random ( arg_0 . shape ) < arg_1 ) return arg_0

def Func(arg_0, arg_1=0.1, arg_2=True, arg_3=True):
  """
  Add noise to the given input.

  Parameters:
  -----------------------------------------------
  input:         the input to add noise to
  noise:         how much noise to add
  doForeground:  If true, turn off some of the 1 bits in the input
  doBackground:  If true, turn on some of the 0 bits in the input

  """
  if arg_2 and arg_3:
    return numpy.abs(arg_0 -  (numpy.random.random(arg_0.shape) < arg_1))
  else:
    if arg_2:
      return numpy.logical_and(arg_0, numpy.random.random(arg_0.shape) > arg_1)
    if arg_3:
      return numpy.logical_or(arg_0, numpy.random.random(arg_0.shape) < arg_1)
  return arg_0