def Func(arg_0, arg_1=None, arg_2=None):
    """
    This creates an SQS queue.

    Parameters
    ----------

    queue_name : str
        The name of the queue to create.

    options : dict or None
        A dict of options indicate extra attributes the queue should have.
        See the SQS docs for details. If None, no custom attributes will be
        attached to the queue.

    client : boto3.Client or None
        If None, this function will instantiate a new `boto3.Client` object to
        use in its operations. Alternatively, pass in an existing `boto3.Client`
        instance to re-use it here.

    Returns
    -------

    dict
        This returns a dict of the form::

            {'url': SQS URL of the queue,
             'name': name of the queue}

    """

    if not arg_2:
        arg_2 = boto3.client('sqs')

    try:

        if isinstance(arg_1, dict):
            arg_3 = arg_2.create_queue(QueueName=arg_0, Attributes=arg_1)
        else:
            arg_3 = arg_2.create_queue(QueueName=arg_0)

        if arg_3 is not None:
            return {'url':arg_3['QueueUrl'],
                    'name':arg_0}
        else:
            LOGERROR('could not create the specified queue: %s with options: %s'
                     % (arg_0, arg_1))
            return None

    except Exception as e:
        LOGEXCEPTION('could not create the specified queue: %s with options: %s'
                     % (arg_0, arg_1))
        return None


(course, tid=None, pastebin=False, review=False)

def Func ( arg_0 , arg_1 = None , arg_2 = False , arg_3 = False ) : if arg_1 is not None : return Func_exercise ( Exercise . byid ( arg_1 ) , arg_2 = arg_2 , request_review = arg_3 ) else : arg_4 = Exercise . get_selected ( ) if not arg_4 : raise NoExerciseSelected ( ) return Func_exercise ( arg_4 , arg_2 = arg_2 , request_review = arg_3 )

def Func(arg_0, arg_1=None, arg_2=False, arg_3=False):
    """
    Submit the selected exercise to the server.
    """
    if arg_1 is not None:
        return Func_exercise(Exercise.byid(arg_1),
                               arg_2=arg_2,
                               request_review=arg_3)
    else:
        arg_4 = Exercise.get_selected()
        if not arg_4:
            raise NoExerciseSelected()
        return Func_exercise(arg_4, arg_2=arg_2, request_review=arg_3)

Submit the selected exercise to the server .


(self, request, enterprise_uuid, program_uuid)

return self.get_enterprise_program_enrollment_page(request, enterprise_customer, program_details)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Show Program Landing page for the Enterprise's Program.

        Render the Enterprise's Program Enrollment page for a specific program.
        The Enterprise and Program are both selected by their respective UUIDs.

        Unauthenticated learners will be redirected to enterprise-linked SSO.

        A 404 will be raised if any of the following conditions are met:
            * No enterprise customer UUID query parameter ``enterprise_uuid`` found in request.
            * No enterprise customer found against the enterprise customer
                uuid ``enterprise_uuid`` in the request kwargs.
            * No Program can be found given ``program_uuid`` either at all or associated with
                the Enterprise..
        """
        verify_edx_resources()

        arg_4 = Func_enterprise_customer_or_404(arg_2)
        arg_5 = Func_global_context(arg_1, arg_4)
        arg_6, arg_7 = arg_0.Func_program_details(arg_1, arg_3, arg_4)
        if arg_7:
            return render(
                arg_1,
                ENTERPRISE_GENERAL_ERROR_PAGE,
                context=arg_5,
                status=404,
            )
        if arg_6['certificate_eligible_for_program']:
            # The user is already enrolled in the program, so redirect to the program's dashboard.
            return redirect(LMS_PROGRAMS_DASHBOARD_URL.format(uuid=arg_3))

        # Check to see if access to any of the course runs in the program are restricted for this user.
        arg_8 = []
        for arg_9 in arg_6['courses']:
            for arg_10 in arg_9['course_runs']:
                arg_8.append(arg_10['key'])
        arg_11 = EmbargoApiClient.redirect_if_blocked(arg_8, arg_1.user, Func_ip(arg_1), arg_1.path)
        if arg_11:
            return redirect(arg_11)

        return arg_0.Func_enterprise_program_enrollment_page(arg_1, arg_4, arg_6)

Show Program Landing page for the Enterprise s Program .


async def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = [ ] for arg_4 in arg_1 : if arg_4 . startswith ( ( 'Q.' , 'T.' , 'A.' , 'AM.' , ) ) : arg_3 . append ( arg_4 ) else : arg_2 . append ( arg_4 ) if len ( arg_2 ) > 0 : await arg_0 . _ensure_ws ( ) await arg_0 . _ws . send ( json . dumps ( { 'action' : 'listen' , 'data' : { 'streams' : arg_2 , } } ) ) if len ( arg_3 ) > 0 : await arg_0 . _ensure_nats ( ) await arg_0 . polygon . Func ( arg_3 )

async def Func(arg_0, arg_1):
        '''Start subscribing channels.
        If the necessary connection isn't open yet, it opens now.
        '''
        arg_2 = []
        arg_3 = []
        for arg_4 in arg_1:
            if arg_4.startswith(('Q.', 'T.', 'A.', 'AM.',)):
                arg_3.append(arg_4)
            else:
                arg_2.append(arg_4)

        if len(arg_2) > 0:
            await arg_0._ensure_ws()
            await arg_0._ws.send(json.dumps({
                'action': 'listen',
                'data': {
                    'streams': arg_2,
                }
            }))

        if len(arg_3) > 0:
            await arg_0._ensure_nats()
            await arg_0.polygon.Func(arg_3)

Start subscribing channels . If the necessary connection isn t open yet it opens now .


def Func(arg_0, arg_1: arg_2) -> arg_2:
        """Processes Alexa requests from skill server and returns responses to Alexa.

        Args:
            request: Dict with Alexa request payload and metadata.
        Returns:
            result: Alexa formatted or error response.
        """
        arg_3: bytes = arg_1['request_body']
        arg_4: str = arg_1['signature_chain_url']
        arg_5: str = arg_1['signature']
        arg_6: arg_2 = arg_1['alexa_request']

        if not arg_0._verify_request(arg_4, arg_5, arg_3):
            return {'error': 'failed certificate/signature check'}

        arg_7 = arg_6['request']['timestamp']
        arg_8 = datetime.strptime(arg_7, '%Y-%m-%dT%H:%M:%SZ')
        arg_9 = datetime.utcnow()

        arg_10 = arg_9 - arg_8 if arg_9 >= arg_8 else arg_8 - arg_9

        if abs(arg_10.seconds) > REQUEST_TIMESTAMP_TOLERANCE_SECS:
            log.error(f'Failed timestamp check for request: {request_body.decode("utf-8", "replace")}')
            return {'error': 'failed request timestamp check'}

        arg_11 = arg_6['session']['user']['userId']

        if arg_11 not in arg_0.conversations.keys():
            if arg_0.config['multi_instance']:
                arg_12 = arg_0._init_agent()
                log.info('New conversation instance level agent initiated')
            else:
                arg_12 = arg_0.agent

            arg_0.conversations[arg_11] = \
                Conversation(config=arg_0.config,
                             agent=arg_12,
                             arg_11=arg_11,
                             self_destruct_callback=lambda: arg_0._del_conversation(arg_11))

            log.info(f'Created new conversation, key: {conversation_key}')

        arg_14 = arg_0.conversations[arg_11]
        arg_15 = arg_14.handle_request(arg_6)

        return arg_15

Processes Alexa requests from skill server and returns responses to Alexa .


(self,
        force=False,
        ipyclient=None,
        name_fields=30,
        name_separator="_",
        dry_run=False)

def Func(arg_0,
        arg_1=False,
        arg_2=None,
        arg_3=30,
        arg_4="_",
        arg_5=False):
        """
        Download the accessions into a the designated workdir.

        Parameters
        ----------
        force: (bool)
            If force=True then existing files with the same name
            will be overwritten.

        ipyclient: (ipyparallel.Client)
            If provided, work will be distributed across a parallel
            client, otherwise download will be Func on a single core.

        name_fields: (int, str):
            Provide the index of the name fields to be used as a prefix
            for fastq output files. The default is 30, which is the
            SampleName field. Use sra.fetch_fields to see all available
            fields and their indices. A likely alternative is 1 (Run).
            If multiple are listed then they will be joined by a "_"
            character. For example (29,30) would yield something like:
            latin-name_sample-name (e.g., mus_musculus-NR10123).

        dry_Func: (bool)
            If True then a table of file names that _would_ be downloaded
            will be shown, but the actual files will note be downloaded.
        """

        ## temporarily set directory for tmpfiles used by fastq-dump
        ## if this fails then just skip it.
        try:
            ## ensure output directory, also used as tmpdir
            if not os.path.exists(arg_0.workdir):
                os.makedirs(arg_0.workdir)

            ## get original directory for sra files
            ## probably /home/ncbi/public/sra by default.
            arg_0._set_vdbconfig_path()

            ## register ipyclient for cleanup
            if arg_2:
                arg_0._ipcluster["pids"] = {}
                for arg_7 in arg_2.ids:
                    arg_8 = arg_2[arg_7]
                    if not arg_8.outstanding:
                        arg_9 = arg_8.apply(os.getpid).get()
                        arg_0._ipcluster["pids"][arg_7] = arg_9

            ## submit jobs to engines or local
            arg_0._submit_jobs(
                arg_1=arg_1,
                arg_2=arg_2,
                arg_3=arg_3,
                arg_4=arg_4,
                arg_5=arg_5,
                )

        except IPyradWarningExit as inst:
            print(inst)
        ## exceptions to catch, cleanup and handle ipyclient interrupts
        except KeyboardInterrupt:
            print("keyboard interrupt...")
        except Exception as inst:
            print("Exception in Func() - {}".format(inst))
        finally:
            ## reset working sra path
            arg_0._restore_vdbconfig_path()

            ## if it made a new sra directory then it should be empty when
            ## we are finished if all .sra files were removed. If so, then
            ## let's also remove the dir. if not empty, leave it.
            arg_10 = os.path.join(arg_0.workdir, "sra")
            if os.path.exists(arg_10) and (not os.listdir(arg_10)):
                shutil.rmtree(arg_10)
            else:
                ## print warning
                try:
                    print(FAILED_DOWNLOAD.format(os.listdir(arg_10)))
                except OSError as inst:
                    ## If sra dir doesn't even exist something very bad is broken.
                    raise IPyradWarningExit("Download failed. Exiting.")
                ## remove fastq file matching to cached sra file
                for arg_11 in os.listdir(arg_10):
                    arg_12 = arg_11.split(".")[0]
                    arg_13 = os.path.join(arg_0.workdir, "*_{}*.gz".format(arg_12))
                    arg_14 = glob.glob(arg_13)[0]
                    if os.path.exists(arg_14):
                        os.remove(arg_14)
                ## remove cache of sra files
                shutil.rmtree(arg_10)

            ## cleanup ipcluster shutdown
            if arg_2:
                ## send SIGINT (2) to all engines still Funcning tasks
                try:
                    arg_2.abort()
                    time.sleep(0.5)
                    for arg_15, arg_9 in arg_0._ipcluster["pids"].items():
                        if arg_2.queue_status()[arg_15]["tasks"]:
                            os.kill(arg_9, 2)
                        time.sleep(0.1)
                except ipp.NoEnginesRegistered:
                    pass
                ## clean memory space
                if not arg_2.outstanding:
                    arg_2.purge_everything()
                ## uh oh, kill everything, something bad happened
                else:
                    arg_2.shutdown(hub=True, block=False)
                    arg_2.close()
                    print("\nwarning: ipcluster shutdown and must be restarted")

Download the accessions into a the designated workdir.

        Parameters
        ----------
        force: (bool)
            If force=True then existing files with the same name
            will be overwritten.

        ipyclient: (ipyparallel.Client)
            If provided, work will be distributed across a parallel
            client, otherwise download will be run on a single core.

        name_fields: (int, str):
            Provide the index of the name fields to be used as a prefix
            for fastq output files. The default is 30, which is the
            SampleName field. Use sra.fetch_fields to see all available
            fields and their indices. A likely alternative is 1 (Run).
            If multiple are listed then they will be joined by a "_"
            character. For example (29,30) would yield something like:
            latin-name_sample-name (e.g., mus_musculus-NR10123).

        dry_run: (bool)
            If True then a table of file names that _would_ be downloaded
            will be shown, but the actual files will note be downloaded.

Download the accessions into a the designated workdir .


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_0
.
isopen
:
arg_2
=
logging
.
getLogger
(
__name__
)
arg_2
.
warning
(
'the drop box is not open'
)
return
arg_3
=
[
]
for
arg_4
in
arg_1
:
try
:
arg_5
=
arg_4
[
'task'
]
arg_6
=
arg_4
.
get
(
'args'
,
(
)
)
arg_7
=
arg_4
.
get
(
'kwargs'
,
{
}
)
arg_8
=
TaskPackage
(
arg_5
=
arg_5
,
arg_6
=
arg_6
,
arg_7
=
arg_7
)
except
TypeError
:
arg_8
=
TaskPackage
(
arg_5
=
arg_4
,
arg_6
=
(
)
,
arg_7
=
{
}
)
arg_3
.
append
(
arg_8
)
return
arg_0
.
dropbox
.
Func
(
arg_3
)

def Func(arg_0, arg_1):
        """put a list of tasks and their arguments

        This method can be used to put multiple tasks at once. Calling
        this method once with multiple tasks can be much faster than
        calling `put()` multiple times.

        Parameters
        ----------
        task_args_kwargs_list : list

            A list of lists with three items that can be parameters of
            `put()`, i.e., `task`, `args`, `kwargs`.

        Returns
        -------
        list
            A list of task IDs.

        """
        if not arg_0.isopen:
            arg_2 = logging.getLogger(__name__)
            arg_2.warning('the drop box is not open')
            return

        arg_3 = [ ]
        for arg_4 in arg_1:
            try:
                arg_5 = arg_4['task']
                arg_6 = arg_4.get('args', ())
                arg_7 = arg_4.get('kwargs', {})
                arg_8 = TaskPackage(arg_5=arg_5, arg_6=arg_6, arg_7=arg_7)
            except TypeError:
                arg_8 = TaskPackage(arg_5=arg_4, arg_6=(), arg_7={})
            arg_3.append(arg_8)
        return arg_0.dropbox.Func(arg_3)


Override of clean method to perform additional validation

def Func(arg_0):
        """
        Override of Func method to perform additional validation
        """
        arg_1 = super(EnterpriseCustomerReportingConfigAdminForm, arg_0).Func()
        arg_2 = arg_1.get('enterprise_customer')

        # Check that any selected catalogs are tied to the selected enterprise.
        arg_3 = [
            '{} ({})'.format(catalog.title, catalog.uuid)
            for catalog in arg_1.get('enterprise_customer_catalogs')
            if catalog.enterprise_customer != arg_2
        ]

        if arg_3:
            arg_4 = _(
                'These catalogs for reporting do not match enterprise'
                'customer {enterprise_customer}: {invalid_catalogs}',
            ).format(
                enterprise_customer=arg_2,
                arg_3=arg_3,
            )
            arg_0.add_error('enterprise_customer_catalogs', arg_4)


(self,
                         code=HEADER_CHECK_FAILED,
                         message=MESSAGES[HEADER_CHECK_FAILED])

def Func(arg_0,
                         arg_1=arg_2,
                         arg_3=arg_4[arg_2]):
        """
        Add a header check, i.e., check whether the header record is consistent
        with the expected field names.

        Arguments
        ---------

        `code` - problem code to report if the header record is not valid,
        defaults to `HEADER_CHECK_FAILED`

        `message` - problem message to report if a value is not valid

        """

        arg_5 = arg_1, arg_3
        arg_0._header_checks.append(arg_5)

Add a header check i . e . check whether the header record is consistent with the expected field names .


def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . _connections : return defer . succeed ( arg_1 ) else : arg_2 = arg_0 . _connect ( arg_1 , exact_peer = False ) def connected ( arg_3 ) : return arg_3 . peer arg_2 . addCallback ( connected ) return arg_2

def Func(arg_0, arg_1):
        """
        Ensures that we have an open connection to the given peer.

        Returns the peer id. This should be equal to the given one, but
        it might not if the given peer was, say, the IP and the peer
        actually identifies itself with a host name. The returned peer
        is the real one that should be used. This can be handy if we aren't
        100% sure of the peer's identity.
        """
        if arg_1 in arg_0._connections:
            return defer.succeed(arg_1)
        else:
            arg_2 = arg_0._connect(arg_1, exact_peer=False)
            def connected(arg_3):
                return arg_3.peer
            arg_2.addCallback(connected)
            return arg_2

Ensures that we have an open connection to the given peer . Returns the peer id . This should be equal to the given one but it might not if the given peer was say the IP and the peer actually identifies itself with a host name . The returned peer is the real one that should be used . This can be handy if we aren t 100% sure of the peer s identity .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_year_doc ( arg_1 ) arg_3 = arg_2 ( 'table#games' ) arg_4 = sportsref . utils . parse_table ( arg_3 ) if arg_4 . empty : return np . array ( [ ] ) return arg_4 . boxscore_id . values

def Func(arg_0, arg_1):
        """Gets list of BoxScore objects corresponding to the box scores from
        that year.

        :year: The year for which we want the Func; defaults to current
        year.
        :returns: np.array of strings representing boxscore IDs.
        """
        arg_2 = arg_0.get_year_doc(arg_1)
        arg_3 = arg_2('table#games')
        arg_4 = sportsref.utils.parse_table(arg_3)
        if arg_4.empty:
            return np.array([])
        return arg_4.boxscore_id.values

Gets list of BoxScore objects corresponding to the box scores from
        that year.

        :year: The year for which we want the boxscores; defaults to current
        year.
        :returns: np.array of strings representing boxscore IDs.

Gets list of BoxScore objects corresponding to the box scores from that year .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = [ ] for arg_4 in range ( 0 , arg_0 ) : if arg_4 % arg_1 == 0 : if len ( arg_3 ) > 0 : arg_2 . append ( arg_3 ) arg_3 = [ arg_4 ] else : arg_3 . append ( arg_4 ) if len ( arg_3 ) > 0 : arg_2 . append ( arg_3 ) return arg_2

def Func(arg_0, arg_1):
        """ Split sentences in groups, given a specific group length.

        Args:
            total_nb_sentences (int): Total available sentences.
            group_length (int): Limit of length for each group.

        Returns:
            list: Contains groups (lists) of sentences.
        """
        arg_2 = []
        arg_3 = []

        for arg_4 in range(0, arg_0):
            if arg_4 % arg_1 == 0:
                if len(arg_3) > 0:
                    arg_2.append(arg_3)
                arg_3 = [arg_4]
            else:
                arg_3.append(arg_4)

        if len(arg_3) > 0:
            arg_2.append(arg_3)

        return arg_2

Split sentences in groups given a specific group length .


def Func ( arg_0 , arg_1 , arg_2 ) : if '_addanother' in arg_1 . POST : return HttpResponseRedirect ( '../item_add/' ) elif '_save' in arg_1 . POST : return HttpResponseRedirect ( '../' ) elif '_continue' in arg_1 . POST : return arg_2 return HttpResponseRedirect ( '' )

def Func(arg_0, arg_1, arg_2):
        """Generic redirect for item editor."""

        if '_addanother' in arg_1.POST:
            return HttpResponseRedirect('../item_add/')

        elif '_save' in arg_1.POST:
            return HttpResponseRedirect('../')

        elif '_continue' in arg_1.POST:
            return arg_2

        return HttpResponseRedirect('')


def Func(arg_0):
    """
    Cleans the temporary fastq files. If they are symlinks, the link
    source is removed

    Parameters
    ----------
    fastq : list
        List of fastq files.
    """

    for arg_1 in arg_0:
        # Get real path of fastq files, following symlinks
        arg_2 = os.path.realpath(arg_1)
        logger.debug("Removing temporary fastq file path: {}".format(arg_2))
        if re.match(".*/work/.{2}/.{30}/.*", arg_2):
            os.remove(arg_2)

Cleans the temporary fastq files . If they are symlinks the link source is removed


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
{
'responses'
:
{
'default'
:
{
'description'
:
'UNDOCUMENTED RESPONSE'
}
}
,
}
arg_4
=
arg_2
.
get
(
'renderer'
,
''
)
if
"json"
in
arg_4
:
arg_5
=
[
'application/json'
]
elif
arg_4
==
'xml'
:
arg_5
=
[
'text/xml'
]
else
:
arg_5
=
if
arg_5
:
arg_3
.
setdefault
(
'produces'
,
arg_5
)
arg_6
=
arg_2
.
get
(
'content_type'
)
if
arg_6
is
not
:
arg_6
=
to_list
(
arg_6
)
arg_6
=
[
x
for
x
in
arg_6
if
not
callable
(
x
)
]
arg_3
[
'consumes'
]
=
arg_6
arg_7
=
arg_0
.
_is_colander_schema
(
arg_2
)
if
arg_7
:
arg_8
=
arg_0
.
_extract_transform_colander_schema
(
arg_2
)
arg_9
=
arg_0
.
parameters
.
from_schema
(
arg_8
)
else
:
arg_9
=
if
arg_9
:
arg_3
[
'parameters'
]
=
arg_9
if
isinstance
(
arg_1
,
six
.
string_types
)
:
if
'klass'
in
arg_2
:
arg_10
=
arg_2
[
'klass'
]
arg_11
=
getattr
(
arg_10
,
arg_1
.
lower
(
)
)
arg_12
=
trim
(
arg_11
.
__doc__
)
else
:
arg_12
=
str
(
trim
(
arg_1
.
__doc__
)
)
if
arg_12
and
arg_0
.
summary_docstrings
:
arg_3
[
'summary'
]
=
arg_12
if
'response_schemas'
in
arg_2
:
arg_3
[
'responses'
]
=
arg_0
.
responses
.
from_schema_mapping
(
arg_2
[
'response_schemas'
]
)
if
'tags'
in
arg_2
:
arg_3
[
'tags'
]
=
arg_2
[
'tags'
]
if
'operation_id'
in
arg_2
:
arg_3
[
'operationId'
]
=
arg_2
[
'operation_id'
]
if
'api_security'
in
arg_2
:
arg_3
[
'security'
]
=
arg_2
[
'api_security'
]
return
arg_3

def Func(arg_0, arg_1, arg_2):
        """
        Extract swagger operation details from colander view definitions.

        :param view:
            View to extract information from.
        :param args:
            Arguments from the view decorator.

        :rtype: dict
        :returns: Operation definition.
        """

        arg_3 = {
            'responses': {
                'default': {
                    'description': 'UNDOCUMENTED RESPONSE'
                }
            },
        }

        # If 'produces' are not defined in the view, try get from renderers
        arg_4 = arg_2.get('renderer', '')

        if "json" in arg_4:  # allows for "json" or "simplejson"
            arg_5 = ['application/json']
        elif arg_4 == 'xml':
            arg_5 = ['text/xml']
        else:
            arg_5 = None

        if arg_5:
            arg_3.setdefault('produces', arg_5)

        # Get explicit accepted content-types
        arg_6 = arg_2.get('content_type')

        if arg_6 is not None:
            # convert to a list, if it's not yet one
            arg_6 = to_list(arg_6)

            # It is possible to add callables for content_type, so we have to
            # to filter those out, since we cannot evaluate those here.
            arg_6 = [x for x in arg_6 if not callable(x)]
            arg_3['consumes'] = arg_6

        # Get parameters from view schema
        arg_7 = arg_0._is_colander_schema(arg_2)
        if arg_7:
            arg_8 = arg_0._extract_transform_colander_schema(arg_2)
            arg_9 = arg_0.parameters.from_schema(arg_8)
        else:
            # Bail out for now
            arg_9 = None
        if arg_9:
            arg_3['parameters'] = arg_9

        # Get summary from docstring
        if isinstance(arg_1, six.string_types):
            if 'klass' in arg_2:
                arg_10 = arg_2['klass']
                arg_11 = getattr(arg_10, arg_1.lower())
                arg_12 = trim(arg_11.__doc__)
        else:
            arg_12 = str(trim(arg_1.__doc__))

        if arg_12 and arg_0.summary_docstrings:
            arg_3['summary'] = arg_12

        # Get response definitions
        if 'response_schemas' in arg_2:
            arg_3['responses'] = arg_0.responses.from_schema_mapping(arg_2['response_schemas'])

        # Get response tags
        if 'tags' in arg_2:
            arg_3['tags'] = arg_2['tags']

        # Get response operationId
        if 'operation_id' in arg_2:
            arg_3['operationId'] = arg_2['operation_id']

        # Get security policies
        if 'api_security' in arg_2:
            arg_3['security'] = arg_2['api_security']

        return arg_3

Extract swagger operation details from colander view definitions .


pass in a list of options, promt the user to select one, and return the selected option or None

def
Func
(
arg_0
=
)
:
if
not
arg_0
:
return
arg_1
=
len
(
str
(
len
(
arg_0
)
)
)
for
arg_2
,
arg_3
in
enumerate
(
arg_0
)
:
arg_5
.
stdout
.
write
(
'{:{width}}) {}\n'
.
format
(
arg_2
+
1
,
arg_3
,
arg_1
=
arg_1
)
)
arg_5
.
stdout
.
write
(
'{:>{width}} '
.
format
(
'#?'
,
arg_1
=
arg_1
+
1
)
)
arg_5
.
stdout
.
flush
(
)
if
arg_5
.
stdin
.
isatty
(
)
:
try
:
arg_4
=
raw_input
(
)
.
strip
(
)
except
(
EOFError
,
KeyboardInterrupt
)
:
arg_4
=
''
else
:
arg_5
.
stdin
=
open
(
"/dev/tty"
)
try
:
arg_4
=
''
while
True
:
arg_4
+=
arg_5
.
stdin
.
read
(
1
)
if
arg_4
.
endswith
(
'\n'
)
:
break
except
(
EOFError
,
KeyboardInterrupt
)
:
arg_5
.
stdout
.
flush
(
)
pass
try
:
arg_4
=
int
(
arg_4
)
1
except
ValueError
:
return
if
arg_4
<
0
or
arg_4
>=
len
(
arg_0
)
:
return
return
arg_0
[
arg_4
]

def Func(arg_0=None):
    """ pass in a list of options, promt the user to Func one, and return the Funced option or None """
    if not arg_0:
        return None
    arg_1 = len(str(len(arg_0)))
    for arg_2,arg_3 in enumerate(arg_0):
        arg_5.stdout.write('{:{width}}) {}\n'.format(arg_2+1,arg_3, arg_1=arg_1))

    arg_5.stdout.write('{:>{width}} '.format('#?', arg_1=arg_1+1))
    arg_5.stdout.flush()
    if arg_5.stdin.isatty():
        # regular prompt
        try:
            arg_4 = raw_input().strip()
        except (EOFError, KeyboardInterrupt):
            # handle ctrl-d, ctrl-c
            arg_4 = ''
    else:
        # try connecting to current tty, when using pipes
        arg_5.stdin = open("/dev/tty")
        try:
            arg_4 = ''
            while True:
                arg_4 += arg_5.stdin.read(1)
                if arg_4.endswith('\n'):
                    break
        except (EOFError, KeyboardInterrupt):
            arg_5.stdout.flush()
            pass
    try:
        arg_4 = int(arg_4) - 1
    except ValueError:
        return None
    if arg_4 < 0 or arg_4 >= len(arg_0):
        return None
    return arg_0[arg_4]

pass in a list of options promt the user to select one and return the selected option or None


(self, synthesisedUnit: Unit, until: float, extraProcesses=[])

def Func(arg_0, arg_1: arg_2, arg_3: arg_4, arg_5=[]):
        """
        Run simulation for Unit instance
        """
        arg_6 = arg_0.config.beforeSim
        if arg_6 is not None:
            arg_6(arg_0, arg_1)

        arg_7 = arg_0.add_process
        for arg_8 in arg_5:
            arg_7(arg_8(arg_0))

        arg_0._initUnitSignals(arg_1)
        arg_0.run(arg_3)


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Generate message authentication code.

        Args:
            algorithm(CryptographicAlgorithm): An enumeration specifying the
                algorithm for which the MAC operation will use.
            key(bytes): secret key used in the MAC operation
            data(bytes): The data to be MACed.

        Returns:
            bytes: The MACed data

        Raises:
            InvalidField: Raised when the algorithm is unsupported or the
                length is incompatible with the algorithm.
            CryptographicFailure: Raised when the key generation process
                fails.

        Example:
            >>> engine = CryptographyEngine()
            >>> Func_data = engine.Func(
            ...     CryptographicAlgorithm.HMAC-SHA256, b'\x01\x02\x03\x04',
            ...     b'\x05\x06\x07\x08')
        """

        arg_4 = None

        if arg_1 in arg_0._hash_algorithms.keys():
            arg_0.logger.info(
                "Generating a hash-based message authentication code using "
                "{0}".format(arg_1.name)
            )
            arg_5 = arg_0._hash_algorithms.get(arg_1)
            try:
                arg_6 = hFunc.HMAC(arg_2, arg_5(), backend=default_backend())
                arg_6.update(arg_3)
                arg_4 = arg_6.finalize()
            except Exception as e:
                arg_0.logger.exception(e)
                raise exceptions.CryptographicFailure(
                    "An error occurred while computing an HMAC. "
                    "See the server log for more information."
                )
        elif arg_1 in arg_0._symmetric_key_algorithms.keys():
            arg_0.logger.info(
                "Generating a cipher-based message authentication code using "
                "{0}".format(arg_1.name)
            )
            arg_7 = arg_0._symmetric_key_algorithms.get(arg_1)
            try:
                # ARC4 and IDEA algorithms will raise exception as CMAC
                # requires block ciphers
                arg_8 = cFunc.CMAC(arg_7(arg_2), backend=default_backend())
                arg_8.update(arg_3)
                arg_4 = arg_8.finalize()
            except Exception as e:
                raise exceptions.CryptographicFailure(
                    "An error occurred while computing a CMAC. "
                    "See the server log for more information."
                )
        else:
            raise exceptions.InvalidField(
                "The cryptographic algorithm ({0}) is not a supported "
                "for a MAC operation.".format(arg_1)
            )
        return arg_4

Generate message authentication code.

        Args:
            algorithm(CryptographicAlgorithm): An enumeration specifying the
                algorithm for which the MAC operation will use.
            key(bytes): secret key used in the MAC operation
            data(bytes): The data to be MACed.

        Returns:
            bytes: The MACed data

        Raises:
            InvalidField: Raised when the algorithm is unsupported or the
                length is incompatible with the algorithm.
            CryptographicFailure: Raised when the key generation process
                fails.

        Example:
            >>> engine = CryptographyEngine()
            >>> mac_data = engine.mac(
            ...     CryptographicAlgorithm.HMAC-SHA256, b'\x01\x02\x03\x04',
            ...     b'\x05\x06\x07\x08')


(src, tar, min_ss_len=None, left_ext=None, right_ext=None)

return Baystat().dist(src, tar, min_ss_len, left_ext, right_ext)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : return Baystat ( ) . dist ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
    """Return the Baystat distance.

    This is a wrapper for :py:meth:`Baystat.dist`.

    Parameters
    ----------
    src : str
        Source string for comparison
    tar : str
        Target string for comparison
    min_ss_len : int
        Minimum substring length to be considered
    left_ext : int
        Left-side extension length
    right_ext : int
        Right-side extension length

    Returns
    -------
    float
        The Baystat distance

    Examples
    --------
    >>> round(Func('cat', 'hat'), 12)
    0.333333333333
    >>> Func('Niall', 'Neil')
    0.6
    >>> round(Func('Colin', 'Cuilen'), 12)
    0.833333333333
    >>> Func('ATCG', 'TAGC')
    1.0

    """
    return Baystat().dist(arg_0, arg_1, arg_2, arg_3, arg_4)

Return the Baystat distance.

    This is a wrapper for :py:meth:`Baystat.dist`.

    Parameters
    ----------
    src : str
        Source string for comparison
    tar : str
        Target string for comparison
    min_ss_len : int
        Minimum substring length to be considered
    left_ext : int
        Left-side extension length
    right_ext : int
        Right-side extension length

    Returns
    -------
    float
        The Baystat distance

    Examples
    --------
    >>> round(dist_baystat('cat', 'hat'), 12)
    0.333333333333
    >>> dist_baystat('Niall', 'Neil')
    0.6
    >>> round(dist_baystat('Colin', 'Cuilen'), 12)
    0.833333333333
    >>> dist_baystat('ATCG', 'TAGC')
    1.0


return list(zip_longest(*[iter(iterable)] * n, fillvalue=fillvalue))

def Func ( arg_0 , arg_1 , arg_2 = None ) : return list ( zip_longest ( * [ iter ( arg_0 ) ] * arg_1 , arg_2 = arg_2 ) )

def Func(arg_0, arg_1, arg_2=None):
    """Group iterable by n elements.

    >>> for t in Func('abcdefg', 3, fillvalue='x'):
    ...     print(''.join(t))
    abc
    def
    gxx
    """
    return list(zip_longest(*[iter(arg_0)] * arg_1, arg_2=arg_2))

Group iterable by n elements.

    >>> for t in grouper('abcdefg', 3, fillvalue='x'):
    ...     print(''.join(t))
    abc
    def
    gxx


def Func(arg_0, arg_1, arg_2='AGB'):
    """
     - Value of purchases and sales divided
    by either the actual gross book or the portfolio value
    for the time step.

    Parameters
    ----------
    positions : pd.DataFrame
        Contains daily position values including cash.
        - See full explanation in tears.create_full_tear_sheet
    transactions : pd.DataFrame
        Prices and amounts of executed trades. One row per trade.
        - See full explanation in tears.create_full_tear_sheet
    denominator : str, optional
        Either 'AGB' or 'portfolio_value', default AGB.
        - AGB (Actual gross book) is the gross market
        value (GMV) of the specific algo being analyzed.
        Swapping out an entire portfolio of stocks for
        another will yield 200% turnover, not 100%, since
        transactions are being made for both sides.
        - We use average of the previous and the current end-of-period
        AGB to avoid singularities when trading only into or
        out of an entire book in one trading period.
        - portfolio_value is the total value of the algo's
        positions end-of-period, including cash.

    Returns
    -------
    turnover_rate : pd.Series
        timeseries of portfolio turnover rates.
    """

    arg_3 = get_txn_vol(arg_1)
    arg_4 = arg_3.txn_volume

    if arg_2 == 'AGB':
        # Actual gross book is the same thing as the algo's GMV
        # We want our denom to be avg(AGB previous, AGB current)
        arg_5 = arg_0.drop('cash', axis=1).abs().sum(axis=1)
        arg_6 = arg_5.rolling(2).mean()

        # Since the first value of pd.rolling returns NaN, we
        # set our "day 0" AGB to 0.
        arg_6.iloc[0] = arg_5.iloc[0] / 2
    elif arg_2 == 'portfolio_value':
        arg_6 = arg_0.sum(axis=1)
    else:
        raise ValueError(
            "Unexpected value for denominator '{}'. The "
            "denominator parameter must be either 'AGB'"
            " or 'portfolio_value'.".format(arg_2)
        )

    arg_6.index = arg_6.index.normalize()
    arg_9 = arg_4.div(arg_6, axis='index')
    arg_9 = arg_9.fillna(0)
    return arg_9

- Value of purchases and sales divided by either the actual gross book or the portfolio value for the time step .


def Func(arg_0, arg_1, arg_2):
        """
        Writes data to the zip file and adds it to the manifest dictionary

        :param filename: The zip file name

        :param data: the data
        """
        arg_0.manifest[arg_1] = md5hash(arg_2)
        arg_0.package_zip.writestr(arg_1, arg_2)


def Func ( arg_0 , arg_1 ) : arg_2 = ( arg_0 >= arg_1 ) arg_3 = arg_2 . sum ( ) if arg_3 < 2 : return 0 arg_4 = arg_0 [ arg_2 ] arg_5 = 1.0 + float ( arg_3 ) * ( sum ( log ( arg_4 / ( float ( arg_1 ) - 0.5 ) ) ) ) ** - 1 return arg_5

def Func(arg_0, arg_1):
    """
    Equation B.17 of Clauset et al 2009

    The Maximum Likelihood Estimator of the "scaling parameter" alpha in the
    discrete case is similar to that in the continuous case
    """
    # boolean indices of positive data
    arg_2 = (arg_0>=arg_1)
    arg_3 = arg_2.sum()
    if arg_3 < 2:
        return 0
    arg_4 = arg_0[arg_2]
    arg_5 = 1.0 + float(arg_3) * (sum(log(arg_4/(float(arg_1)-0.5))))**-1
    return arg_5


(self, lockID, callback=None, sync=False, timeout=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=False, arg_4=None):
        """
        Release previously-acquired lock.

        :param lockID:  unique lock identifier.
        :type lockID: str
        :param sync: True - to wait until lock is Funcd or failed to Func.
        :type sync: bool
        :param callback: if sync is False - callback will be called with operation result.
        :type callback: func(opResult, error)
        :param timeout: max operation time (default - unlimited)
        :type timeout: float
        """
        arg_0.__lockImpl.Func(arg_1, arg_0.__selfID, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)

Release previously-acquired lock.

        :param lockID:  unique lock identifier.
        :type lockID: str
        :param sync: True - to wait until lock is released or failed to release.
        :type sync: bool
        :param callback: if sync is False - callback will be called with operation result.
        :type callback: func(opResult, error)
        :param timeout: max operation time (default - unlimited)
        :type timeout: float


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
arg_0
.
charset
or
'utf-8'
arg_3
=
arg_0
.
attachments
or
[
]
if
len
(
arg_3
)
==
0
and
not
arg_0
.
html
:
arg_4
=
arg_0
.
_mimetext
(
arg_0
.
body
)
elif
len
(
arg_3
)
>
0
and
not
arg_0
.
html
:
arg_4
=
MIMEMultipart
(
)
arg_4
.
attach
(
arg_0
.
_mimetext
(
arg_0
.
body
)
)
else
:
arg_4
=
MIMEMultipart
(
)
arg_5
=
MIMEMultipart
(
'alternative'
)
arg_5
.
attach
(
arg_0
.
_mimetext
(
arg_0
.
body
,
'plain'
)
)
arg_5
.
attach
(
arg_0
.
_mimetext
(
arg_0
.
html
,
'html'
)
)
arg_4
.
attach
(
arg_5
)
if
arg_0
.
charset
:
arg_4
[
'Subject'
]
=
Header
(
arg_0
.
subject
,
arg_2
)
else
:
arg_4
[
'Subject'
]
=
arg_0
.
subject
arg_6
=
arg_0
.
sender
or
arg_1
if
arg_6
is
not
:
arg_4
[
'From'
]
=
sanitize_address
(
arg_6
,
arg_2
)
arg_4
[
'To'
]
=
', '
.
join
(
list
(
set
(
sanitize_addresses
(
arg_0
.
recipients
,
arg_2
)
)
)
)
arg_4
[
'Date'
]
=
formatdate
(
arg_0
.
date
,
localtime
=
True
)
arg_4
[
'Message-ID'
]
=
arg_0
.
msgId
if
arg_0
.
cc
:
arg_4
[
'Cc'
]
=
', '
.
join
(
list
(
set
(
sanitize_addresses
(
arg_0
.
cc
,
arg_2
)
)
)
)
if
arg_0
.
reply_to
:
arg_4
[
'Reply-To'
]
=
sanitize_address
(
arg_0
.
reply_to
,
arg_2
)
if
arg_0
.
extra_headers
:
for
arg_7
,
arg_8
in
arg_0
.
extra_headers
.
items
(
)
:
arg_4
[
arg_7
]
=
arg_8
for
arg_9
in
arg_3
:
arg_10
=
MIMEBase
(
*
arg_9
.
content_type
.
split
(
'/'
)
)
arg_10
.
set_payload
(
arg_9
.
data
)
encode_base64
(
arg_10
)
try
:
arg_9
.
filename
and
arg_9
.
filename
.
encode
(
'ascii'
)
except
UnicodeEncodeError
:
arg_11
=
arg_9
.
filename
if
not
PY3
:
arg_11
=
arg_11
.
encode
(
'utf8'
)
arg_10
.
add_header
(
'Content-Disposition'
,
arg_9
.
disposition
,
arg_11
=
(
'UTF8'
,
''
,
arg_11
)
)
else
:
arg_10
.
add_header
(
'Content-Disposition'
,
'%s;filename=%s'
%
(
arg_9
.
disposition
,
arg_9
.
filename
)
)
for
arg_12
,
arg_13
in
arg_9
.
headers
:
arg_10
.
add_header
(
arg_12
,
arg_13
)
arg_4
.
attach
(
arg_10
)
return
arg_4
.
Func
(
)

def Func(arg_0, arg_1=None):
        """Creates the email"""

        arg_2 = arg_0.charset or 'utf-8'

        arg_3 = arg_0.attachments or []

        if len(arg_3) == 0 and not arg_0.html:
            # No html content and zero attachments means plain text
            arg_4 = arg_0._mimetext(arg_0.body)
        elif len(arg_3) > 0 and not arg_0.html:
            # No html and at least one attachment means multipart
            arg_4 = MIMEMultipart()
            arg_4.attach(arg_0._mimetext(arg_0.body))
        else:
            # Anything else
            arg_4 = MIMEMultipart()
            arg_5 = MIMEMultipart('alternative')
            arg_5.attach(arg_0._mimetext(arg_0.body, 'plain'))
            arg_5.attach(arg_0._mimetext(arg_0.html, 'html'))
            arg_4.attach(arg_5)

        if arg_0.charset:
            arg_4['Subject'] = Header(arg_0.subject, arg_2)
        else:
            arg_4['Subject'] = arg_0.subject

        arg_6 = arg_0.sender or arg_1
        if arg_6 is not None:
            arg_4['From'] = sanitize_address(arg_6, arg_2)
        arg_4['To'] = ', '.join(list(set(sanitize_addresses(arg_0.recipients, arg_2))))

        arg_4['Date'] = formatdate(arg_0.date, localtime=True)
        # see RFC 5322 section 3.6.4.
        arg_4['Message-ID'] = arg_0.msgId

        if arg_0.cc:
            arg_4['Cc'] = ', '.join(list(set(sanitize_addresses(arg_0.cc, arg_2))))

        if arg_0.reply_to:
            arg_4['Reply-To'] = sanitize_address(arg_0.reply_to, arg_2)

        if arg_0.extra_headers:
            for arg_7, arg_8 in arg_0.extra_headers.items():
                arg_4[arg_7] = arg_8

        for arg_9 in arg_3:
            arg_10 = MIMEBase(*arg_9.content_type.split('/'))
            arg_10.set_payload(arg_9.data)
            encode_base64(arg_10)

            try:
                arg_9.filename and arg_9.filename.encode('ascii')
            except UnicodeEncodeError:
                arg_11 = arg_9.filename
                if not PY3:
                    arg_11 = arg_11.encode('utf8')
                arg_10.add_header('Content-Disposition', arg_9.disposition,
                            arg_11=('UTF8', '', arg_11))
            else:
                arg_10.add_header('Content-Disposition', '%s;filename=%s' %
                             (arg_9.disposition, arg_9.filename))

            for arg_12, arg_13 in arg_9.headers:
                arg_10.add_header(arg_12, arg_13)

            arg_4.attach(arg_10)

        return arg_4.Func()


(config: Union[str, Path, dict], batch_size: int = 1, file_path: Optional[str] = None)

def Func(arg_0: arg_1[arg_2, arg_3, arg_4], arg_5: arg_6 = 1, arg_7: arg_8[arg_2] = None) -> None:
    """Make a prediction with the component described in corresponding configuration file."""
    if arg_7 is None or arg_7 == '-':
        if sys.stdin.isatty():
            raise RuntimeError('To process data from terminal please use interact mode')
        arg_9 = sys.stdin
    else:
        arg_9 = open(arg_7, encoding='utf8')

    arg_10: Chainer = build_model(arg_0)

    arg_11 = len(arg_10.in_x)
    while True:
        arg_12 = list((l.strip() for l in islice(arg_9, arg_5 * arg_11)))

        if not arg_12:
            break

        arg_13 = []
        for arg_14 in range(arg_11):
            arg_13.append(arg_12[arg_14::arg_11])

        arg_15 = arg_10(*arg_13)
        if len(arg_10.out_params) == 1:
            arg_15 = [arg_15]
        for arg_15 in zip(*arg_15):
            arg_15 = json.dumps(arg_15, ensure_ascii=False)
            print(arg_15, flush=True)

    if arg_9 is not sys.stdin:
        arg_9.close()

Make a prediction with the component described in corresponding configuration file .


return self._lik.sample(multivariate_normal(m, K, random_state), random_state)

def Func ( arg_0 , arg_1 = None ) : from numpy_sugar import epsilon from numpy_sugar . linalg import sum2diag from numpy_sugar . random import multivariate_normal if arg_1 is None : arg_1 = RandomState ( ) arg_2 = arg_0 . _mean . value ( ) arg_3 = arg_0 . _cov . value ( ) . copy ( ) sum2diag ( arg_3 , + epsilon . small , out = arg_3 ) return arg_0 . _lik . Func ( multivariate_normal ( arg_2 , arg_3 , arg_1 ) , arg_1 )

def Func(arg_0, arg_1=None):
        r"""Sample from the specified distribution.

        Parameters
        ----------
        random_state : random_state
            Set the initial random state.

        Returns
        -------
        numpy.ndarray
            Sample.
        """
        from numpy_sugar import epsilon
        from numpy_sugar.linalg import sum2diag
        from numpy_sugar.random import multivariate_normal

        if arg_1 is None:
            arg_1 = RandomState()

        arg_2 = arg_0._mean.value()
        arg_3 = arg_0._cov.value().copy()

        sum2diag(arg_3, +epsilon.small, out=arg_3)

        return arg_0._lik.Func(multivariate_normal(arg_2, arg_3, arg_1), arg_1)

r Sample from the specified distribution .


def Func ( arg_0 , arg_1 , arg_2 ) : if isinstance ( arg_2 , Subgraph ) : arg_1 . subgraphs . append ( arg_2 ) elif isinstance ( arg_2 , Cluster ) : arg_1 . clusters . append ( arg_2 ) elif isinstance ( arg_2 , Node ) : arg_1 . nodes . append ( arg_2 ) elif isinstance ( arg_2 , Edge ) : arg_1 . edges . append ( arg_2 ) else : pass

def Func ( arg_0, arg_1, arg_2 ):
        """ Appends a child to the object's children.
        """
        if isinstance( arg_2, Subgraph ):
            arg_1.subgraphs.append( arg_2 )

        elif isinstance( arg_2, Cluster ):
            arg_1.clusters.append( arg_2 )

        elif isinstance( arg_2, Node ):
            arg_1.nodes.append( arg_2 )

        elif isinstance( arg_2, Edge ):
            arg_1.edges.append( arg_2 )

        else:
            pass

Appends a child to the object s children .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
ws
.
closed
:
return
try
:
safe_call
(
arg_0
.
logger
.
debug
,
'< %s %r'
,
arg_0
,
arg_1
)
for
arg_2
in
arg_0
.
ddp_frames_from_message
(
arg_1
)
:
arg_0
.
process_ddp
(
arg_2
)
signals
.
request_finished
.
send
(
sender
=
arg_0
.
__class__
)
except
geventwebsocket
.
WebSocketError
:
arg_0
.
ws
.
close
(
)

def Func(arg_0, arg_1):
        """Process a message received from remote."""
        if arg_0.ws.closed:
            return None
        try:
            safe_call(arg_0.logger.debug, '< %s %r', arg_0, arg_1)

            # process individual messages
            for arg_2 in arg_0.ddp_frames_from_message(arg_1):
                arg_0.process_ddp(arg_2)
                # emit request_finished signal to close DB connections
                signals.request_finished.send(sender=arg_0.__class__)
        except geventwebsocket.WebSocketError:
            arg_0.ws.close()

Process a message received from remote .


def Func(arg_0, arg_1):
    '''Handler for del command'''
    arg_0.validate('cmd|s3', arg_1)
    arg_2 = arg_1[1]
    arg_0.s3handler().del_files(arg_2)


def Func ( arg_0 , arg_1 = None ) : arg_0 . _calculate_averages ( ) arg_2 = base_Func ( arg_0 . tree . root . Q , arg_1 ) arg_2 [ 'r_val' ] = arg_0 . explained_variance ( ) return arg_2

def Func(arg_0, arg_1=None):
        """regress tip values against branch values

        Parameters
        ----------
        slope : None, optional
            if given, the slope isn't optimized

        Returns
        -------
        dict
            Func parameters
        """
        arg_0._calculate_averages()

        arg_2 = base_Func(arg_0.tree.root.Q, arg_1)
        arg_2['r_val'] = arg_0.explained_variance()

        return arg_2

regress tip values against branch values

        Parameters
        ----------
        slope : None, optional
            if given, the slope isn't optimized

        Returns
        -------
        dict
            regression parameters


def Func(arg_0, arg_1):
        '''
        Take 'doc' and create a new doc using only keys from the 'fields' list.
        Supports referencing fields using dotted notation "a.b.c" so we can parse
        nested fields the way MongoDB does. The nested field class is a hack. It should
        be a sub-class of dict.
        '''

        if arg_1 is None or len(arg_1) == 0:
            return arg_0

        arg_2 = Nested_Dict({})
        arg_3 = Nested_Dict(arg_0)

        for arg_4 in arg_1:
            if arg_3.has_key(arg_4):
                # print( "doc: %s" % doc )
                # print( "i: %s" %i )
                arg_2.set_value(arg_4, arg_3.get_value(arg_4))
        return arg_2.dict_value()

Take doc and create a new doc using only keys from the fields list . Supports referencing fields using dotted notation a . b . c so we can parse nested fields the way MongoDB does . The nested field class is a hack . It should be a sub - class of dict .


(annotation, sr=22050, duration=None, **kwargs)

def Func(arg_0, arg_1=22050, arg_2=None, **arg_3):
    '''Sonify a jams annotation through mir_eval

    Parameters
    ----------
    annotation : jams.Annotation
        The annotation to Func

    sr = : positive number
        The sampling rate of the output waveform

    duration : float (optional)
        Optional length (in seconds) of the output waveform

    kwargs
        Additional keyword arguments to mir_eval.Func functions

    Returns
    -------
    y_sonified : np.ndarray
        The waveform of the sonified annotation

    Raises
    ------
    NamespaceError
        If the annotation has an un-sonifiable namespace
    '''

    arg_4 = None

    if arg_2 is None:
        arg_2 = arg_0.duration

    if arg_2 is not None:
        arg_4 = int(arg_2 * arg_1)

    # If the annotation can be directly sonified, try that first
    if arg_0.namespace in SONIFY_MAPPING:
        arg_5 = coerce_annotation(arg_0, arg_0.namespace)
        return SONIFY_MAPPING[arg_0.namespace](arg_5,
                                                    arg_1=arg_1,
                                                    arg_4=arg_4,
                                                    **arg_3)

    for arg_6, arg_7 in six.iteritems(SONIFY_MAPPING):
        try:
            arg_5 = coerce_annotation(arg_0, arg_6)
            return arg_7(arg_5, arg_1=arg_1, arg_4=arg_4, **arg_3)
        except NamespaceError:
            pass

    raise NamespaceError('Unable to Func annotation of namespace="{:s}"'
                         .format(arg_0.namespace))

Sonify a jams annotation through mir_eval

    Parameters
    ----------
    annotation : jams.Annotation
        The annotation to sonify

    sr = : positive number
        The sampling rate of the output waveform

    duration : float (optional)
        Optional length (in seconds) of the output waveform

    kwargs
        Additional keyword arguments to mir_eval.sonify functions

    Returns
    -------
    y_sonified : np.ndarray
        The waveform of the sonified annotation

    Raises
    ------
    NamespaceError
        If the annotation has an un-sonifiable namespace


def
Func
(
arg_0
)
:
_LOGGER
.
info
(
"Config finish"
)
if
not
arg_0
.
config_started
:
return
True
arg_1
,
arg_2
=
arg_0
.
_make_request
(
SERVICE_DEVICE_CONFIG
,
"ConfigurationFinished"
,
{
"NewStatus"
:
"ChangesApplied"
}
)
arg_0
.
config_started
=
not
arg_1
return
arg_1

def Func(arg_0):
        """
        End of a configuration session.
        Tells the router we're done managing admin functionality.
        """
        _LOGGER.info("Config finish")
        if not arg_0.config_started:
            return True

        arg_1, arg_2 = arg_0._make_request(
            SERVICE_DEVICE_CONFIG, "ConfigurationFinished", {"NewStatus": "ChangesApplied"})

        arg_0.config_started = not arg_1
        return arg_1

End of a configuration session . Tells the router we re done managing admin functionality .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get ( '/assets/{}' . format ( arg_1 ) ) return Asset ( arg_2 )

def Func(arg_0, arg_1):
        '''Get an asset'''
        arg_2 = arg_0.get('/assets/{}'.format(arg_1))
        return Asset(arg_2)


def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
True
)
:
arg_3
=
[
]
if
arg_2
:
arg_4
=
arg_0
.
get_translated_data
(
)
else
:
arg_4
=
arg_0
.
data
for
arg_5
in
arg_4
:
arg_3
.
append
(
arg_4
[
arg_5
]
)
if
arg_1
:
arg_3
=
json
.
dumps
(
arg_3
,
indent
=
2
,
separators
=
(
','
,
': '
)
)
else
:
arg_3
=
json
.
dumps
(
arg_3
)
return
arg_3

def Func(arg_0, arg_1=False, arg_2=True):
        """
        Get the data in JSON form
        """
        arg_3 = []
        if arg_2:
            arg_4 = arg_0.get_translated_data()
        else:
            arg_4 = arg_0.data
        for arg_5 in arg_4:
            arg_3.append(arg_4[arg_5])
        if arg_1:
            arg_3 = json.dumps(arg_3, indent=2, separators=(',',': '))
        else:
            arg_3 = json.dumps(arg_3)
        return arg_3


def Func ( arg_0 , arg_1 = { } ) : arg_1 [ 'has_view_permission' ] = arg_0 . mongoadmin . has_view_permission ( arg_0 . request ) arg_1 [ 'has_edit_permission' ] = arg_0 . mongoadmin . has_edit_permission ( arg_0 . request ) arg_1 [ 'has_add_permission' ] = arg_0 . mongoadmin . has_add_permission ( arg_0 . request ) arg_1 [ 'has_delete_permission' ] = arg_0 . mongoadmin . has_delete_permission ( arg_0 . request ) return arg_1

def Func(arg_0, arg_1={}):
        """ Provides permissions for mongoadmin for use in the context"""

        arg_1['has_view_permission'] = arg_0.mongoadmin.has_view_permission(arg_0.request)
        arg_1['has_edit_permission'] = arg_0.mongoadmin.has_edit_permission(arg_0.request)
        arg_1['has_add_permission'] = arg_0.mongoadmin.has_add_permission(arg_0.request)
        arg_1['has_delete_permission'] = arg_0.mongoadmin.has_delete_permission(arg_0.request)
        return arg_1


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
get
(
'type'
)
if
arg_1
not
in
FIELDS_NAME_MAP
:
raise
ValueError
(
_
(
'not support this field: {}'
)
.
format
(
arg_1
)
)
arg_2
=
FIELDS_NAME_MAP
.
get
(
arg_1
)
arg_3
=
dict
(
arg_0
)
arg_3
.
pop
(
'type'
)
return
arg_2
.
from_dict
(
arg_3
)

def Func(arg_0):
    """
    Create a field by field info dict.
    """
    arg_1 = arg_0.get('type')
    if arg_1 not in FIELDS_NAME_MAP:
        raise ValueError(_('not support this field: {}').format(arg_1))
    arg_2 = FIELDS_NAME_MAP.get(arg_1)
    arg_3 = dict(arg_0)
    arg_3.pop('type')
    return arg_2.from_dict(arg_3)


def Func ( arg_0 , arg_1 ) : arg_0 . _is_coordinate ( arg_1 ) if arg_0 . y > arg_1 . y : return True else : return False

def Func(arg_0, arg_1):
        """Comparison for y coordinate"""
        arg_0._is_coordinate(arg_1)
        if arg_0.y > arg_1.y:
            return True
        else:
            return False


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
arg_0
.
connected
(
arg_1
)
:
raise
PasswordDeleteError
(
"Cancelled by user"
)
if
not
arg_0
.
iface
.
hasEntry
(
arg_0
.
handle
,
arg_1
,
arg_2
,
arg_0
.
appid
)
:
raise
PasswordDeleteError
(
"Password not found"
)
arg_0
.
iface
.
removeEntry
(
arg_0
.
handle
,
arg_1
,
arg_2
,
arg_0
.
appid
)

def Func(arg_0, arg_1, arg_2):
        """Delete the password for the username of the service.
        """
        if not arg_0.connected(arg_1):
            # the user pressed "cancel" when prompted to unlock their keyring.
            raise PasswordDeleteError("Cancelled by user")
        if not arg_0.iface.hasEntry(arg_0.handle, arg_1, arg_2, arg_0.appid):
            raise PasswordDeleteError("Password not found")
        arg_0.iface.removeEntry(arg_0.handle, arg_1, arg_2, arg_0.appid)

Delete the password for the username of the service .


def Func(arg_0, arg_1, arg_2=None):
        """Helper method for print_full_documentation.

        Also used by doc/exts/pylint_extensions.py.
        """
        if not arg_2:
            arg_2 = sys.stdout

        arg_3 = arg_1.get("doc")
        arg_4 = arg_1.get("module")
        arg_5 = arg_1.get("msgs")
        arg_6 = arg_1.get("options")
        arg_7 = arg_1.get("reports")

        arg_8 = "%s checker" % (arg_0.replace("_", " ").title())

        if arg_4:
            # Provide anchor to link against
            print(".. _%s:\n" % arg_4, file=arg_2)
        print(arg_8, file=arg_2)
        print("~" * len(arg_8), file=arg_2)
        print("", file=arg_2)
        if arg_4:
            print("This checker is provided by ``%s``." % arg_4, file=arg_2)
        print("Verbatim name of the checker is ``%s``." % arg_0, file=arg_2)
        print("", file=arg_2)
        if arg_3:
            # Provide anchor to link against
            arg_9 = "{} Documentation".format(arg_8)
            print(arg_9, file=arg_2)
            print("^" * len(arg_9), file=arg_2)
            print(cleandoc(arg_3), file=arg_2)
            print("", file=arg_2)
        if arg_6:
            arg_9 = "{} Options".format(arg_8)
            print(arg_9, file=arg_2)
            print("^" * len(arg_9), file=arg_2)
            _rest_format_section(arg_2, None, arg_6)
            print("", file=arg_2)
        if arg_5:
            arg_9 = "{} Messages".format(arg_8)
            print(arg_9, file=arg_2)
            print("^" * len(arg_9), file=arg_2)
            for arg_10, arg_11 in sorted(
                arg_5.items(), key=lambda kv: (_MSG_ORDER.index(kv[0][0]), kv[1])
            ):
                arg_11 = build_message_definition(arg_0, arg_10, arg_11)
                print(arg_11.format_help(checkerref=False), file=arg_2)
            print("", file=arg_2)
        if arg_7:
            arg_9 = "{} Reports".format(arg_8)
            print(arg_9, file=arg_2)
            print("^" * len(arg_9), file=arg_2)
            for arg_12 in arg_7:
                print(":%s: %s" % arg_12[:2], file=arg_2)
            print("", file=arg_2)
        print("", file=arg_2)

Helper method for print_full_documentation .


def Func(arg_0, arg_1):
    """Convert schemas to be compatible with storage schemas.

    Foreign keys related operations.

    Args:
        mapping (dict): mapping between resource name and table name
        schemas (list): schemas

    Raises:
        ValueError: if there is no resource
            for some foreign key in given mapping

    Returns:
        list: converted schemas

    """
    arg_1 = deepcopy(arg_1)
    for arg_2 in arg_1:
        for arg_3 in arg_2.get('foreignKeys', []):
            arg_4 = arg_3['reference']['resource']
            if arg_4 != 'self':
                if arg_4 not in arg_0:
                    arg_5 = 'Not resource "%s" for foreign key "%s"'
                    arg_5 = arg_5 % (arg_4, arg_3)
                    raise ValueError(arg_5)
                arg_3['reference']['resource'] = arg_0[arg_4]
    return arg_1

Convert schemas to be compatible with storage schemas .


(iloc, pnames, snppad, edg, aseqs, asnps, smask, samplecov, locuscov, start)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
,
arg_8
,
arg_9
)
:
LOGGER
.
info
(
"edges in Func %s"
,
arg_3
)
arg_10
=
arg_4
[
arg_0
,
:
,
arg_3
[
0
]
:
arg_3
[
1
]
+
1
]
arg_11
=
arg_5
[
arg_0
,
arg_3
[
0
]
:
arg_3
[
1
]
+
1
,
]
arg_12
=
arg_4
[
arg_0
,
:
,
arg_3
[
2
]
:
arg_3
[
3
]
+
1
]
arg_13
=
arg_5
[
arg_0
,
arg_3
[
2
]
:
arg_3
[
3
]
+
1
,
]
arg_14
=
np
.
all
(
arg_10
==
"N"
,
axis
=
1
)
arg_15
=
arg_14
+
arg_6
LOGGER
.
info
(
"nsidx %s, nalln %s, smask %s"
,
arg_15
,
arg_14
,
arg_6
)
arg_7
=
arg_7
+
np
.
invert
(
arg_15
)
.
astype
(
np
.
int32
)
LOGGER
.
info
(
"samplecov %s"
,
arg_7
)
arg_16
=
np
.
sum
(
np
.
invert
(
arg_15
)
.
astype
(
np
.
int32
)
)
LOGGER
.
info
(
"idx %s"
,
arg_16
)
arg_8
[
arg_16
]
+=
1
arg_10
=
arg_10
[
~
arg_15
,
]
arg_12
=
arg_12
[
~
arg_15
,
]
arg_17
=
arg_1
[
~
arg_15
]
arg_18
=
"\n"
.
join
(
[
name
+
s1
.
tostring
(
)
+
"nnnn"
+
s2
.
tostring
(
)
for
name
,
s1
,
s2
in
zip
(
arg_17
,
arg_10
,
arg_12
)
]
)
arg_19
=
[
"-"
if
arg_11
[
i
,
0
]
else
"*"
if
arg_11
[
i
,
1
]
else
" "
for
i
in
range
(
len
(
arg_11
)
)
]
arg_20
=
[
"-"
if
arg_13
[
i
,
0
]
else
"*"
if
arg_13
[
i
,
1
]
else
" "
for
i
in
range
(
len
(
arg_13
)
)
]
arg_18
+=
"\n"
+
arg_2
+
""
.
join
(
arg_19
)
+
"    "
+
""
.
join
(
arg_20
)
+
"|{}|"
.
format
(
arg_0
+
arg_9
)
return
arg_18
,
arg_7
,
arg_8

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9):
    """ enters funcs for pairs """

    ## snps was created using only the selected samples.
    LOGGER.info("edges in Func %s", arg_3)
    arg_10 = arg_4[arg_0, :, arg_3[0]:arg_3[1]+1]
    arg_11 = arg_5[arg_0, arg_3[0]:arg_3[1]+1, ]

    ## the 2nd read edges are +5 for the spacer
    arg_12 = arg_4[arg_0, :, arg_3[2]:arg_3[3]+1]
    arg_13 = arg_5[arg_0, arg_3[2]:arg_3[3]+1, ]

    ## remove rows with all Ns, seq has only selected samples
    arg_14 = np.all(arg_10 == "N", axis=1)

    ## make mask of removed rows and excluded samples. Use the inverse
    ## of this to save the coverage for samples
    arg_15 = arg_14 + arg_6
    LOGGER.info("nsidx %s, nalln %s, smask %s", arg_15, arg_14, arg_6)
    arg_7 = arg_7 + np.invert(arg_15).astype(np.int32)
    LOGGER.info("samplecov %s", arg_7)
    arg_16 = np.sum(np.invert(arg_15).astype(np.int32))
    LOGGER.info("idx %s", arg_16)
    arg_8[arg_16] += 1

    ## select the remaining names in order
    arg_10 = arg_10[~arg_15, ]
    arg_12 = arg_12[~arg_15, ]
    arg_17 = arg_1[~arg_15]

    ## save string for printing, excluding names not in samples
    arg_18 = "\n".join(\
        [name + s1.tostring()+"nnnn"+s2.tostring() for name, s1, s2 in \
         zip(arg_17, arg_10, arg_12)])

    #LOGGER.info("s1 %s", s1.tostring())
    #LOGGER.info("s2 %s", s2.tostring())

    ## get snp string and add to store
    arg_19 = ["-" if arg_11[i, 0] else \
                 "*" if arg_11[i, 1] else \
                 " " for i in range(len(arg_11))]
    arg_20 = ["-" if arg_13[i, 0] else \
                 "*" if arg_13[i, 1] else \
                 " " for i in range(len(arg_13))]

    #npis = str(snpstring1+snpstring2).count("*")
    #nvars = str(snpstring1+snpstring2).count("-") + npis
    arg_18 += "\n" + arg_2 + "".join(arg_19)+\
              "    "+"".join(arg_20)+"|{}|".format(arg_0+arg_9)
              #"|LOCID={},DBID={},NVAR={},NPIS={}|"\
              #.format(1+iloc+start, iloc, nvars, npis)

    return arg_18, arg_7, arg_8


(cls, cfgfile, nick, twtfile, twturl, disclose_identity, add_news)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : arg_7 = os . path . dirname ( arg_1 ) if not os . path . exists ( arg_7 ) : os . makedirs ( arg_7 ) arg_8 = configparser . ConfigParser ( ) arg_8 . add_section ( "twtxt" ) arg_8 . set ( "twtxt" , "nick" , arg_2 ) arg_8 . set ( "twtxt" , "twtfile" , arg_3 ) arg_8 . set ( "twtxt" , "twturl" , arg_4 ) arg_8 . set ( "twtxt" , "disclose_identity" , str ( arg_5 ) ) arg_8 . set ( "twtxt" , "character_limit" , "140" ) arg_8 . set ( "twtxt" , "character_warning" , "140" ) arg_8 . add_section ( "following" ) if arg_6 : arg_8 . set ( "following" , "twtxt" , "https://buckket.org/twtxt_news.txt" ) arg_9 = arg_0 ( arg_1 , arg_8 ) arg_9 . write_config ( ) return arg_9

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
        """Create a new config file at the default location.

        :param str cfgfile: path to the config file
        :param str nick: nickname to use for own tweets
        :param str twtfile: path to the local twtxt file
        :param str twturl: URL to the remote twtxt file
        :param bool disclose_identity: if true the users id will be disclosed
        :param bool add_news: if true follow twtxt news feed
        """
        arg_7 = os.path.dirname(arg_1)
        if not os.path.exists(arg_7):
            os.makedirs(arg_7)

        arg_8 = configparser.ConfigParser()

        arg_8.add_section("twtxt")
        arg_8.set("twtxt", "nick", arg_2)
        arg_8.set("twtxt", "twtfile", arg_3)
        arg_8.set("twtxt", "twturl", arg_4)
        arg_8.set("twtxt", "disclose_identity", str(arg_5))
        arg_8.set("twtxt", "character_limit", "140")
        arg_8.set("twtxt", "character_warning", "140")

        arg_8.add_section("following")
        if arg_6:
            arg_8.set("following", "twtxt", "https://buckket.org/twtxt_news.txt")

        arg_9 = arg_0(arg_1, arg_8)
        arg_9.write_config()
        return arg_9

Create a new config file at the default location .


def Func(arg_0, arg_1='utf-8'):
    """Helper to read the contents of the given file or path into a string with the given encoding.
    Encoding defaults to 'utf-8', other useful encodings are 'ascii' and 'latin-1'."""

    try:
        arg_2 = arg_0.read()
    except AttributeError:
        try:
            with open(arg_0, 'r') as fp:
                arg_2 = fp.read()
        except TypeError:
            raise ValueError('val must be file or path, but was type <%s>' % type(arg_0).__name__)
        except OSError:
            if not isinstance(arg_0, str_types):
                raise ValueError('val must be file or path, but was type <%s>' % type(arg_0).__name__)
            raise

    if sys.version_info[0] == 3 and type(arg_2) is bytes:
        # in PY3 force decoding of bytes to target encoding
        return arg_2.decode(arg_1, 'replace')
    elif sys.version_info[0] == 2 and arg_1 == 'ascii':
        # in PY2 force encoding back to ascii
        return arg_2.encode('ascii', 'replace')
    else:
        # in all other cases, try to decode to target encoding
        try:
            return arg_2.decode(arg_1, 'replace')
        except AttributeError:
            pass
    # if all else fails, just return the contents "as is"
    return arg_2

Helper to read the contents of the given file or path into a string with the given encoding . Encoding defaults to utf - 8 other useful encodings are ascii and latin - 1 .


def Func ( arg_0 ) : if arg_0 . tzinfo is None or arg_0 . tzinfo . utcoffset ( arg_0 ) is None : arg_1 = pytz . utc . localize ( arg_0 ) else : arg_1 = arg_0 . astimezone ( pytz . utc ) arg_2 = arg_1 . strftime ( "%Y-%m-%dT%H:%M:%S" ) arg_3 = arg_1 . strftime ( "%f" ) arg_4 = getattr ( arg_0 , "precision" , None ) if arg_4 == "second" : pass elif arg_4 == "millisecond" : arg_2 = arg_2 + "." + arg_3 [ : 3 ] elif arg_1 . microsecond > 0 : arg_2 = arg_2 + "." + arg_3 . rstrip ( "0" ) return arg_2 + "Z"

def Func(arg_0):
    """Convert a datetime object into a valid STIX timestamp string.

    1. Convert to timezone-aware
    2. Convert to UTC
    3. Format in ISO format
    4. Ensure correct precision
       a. Add subsecond value if non-zero and precision not defined
    5. Add "Z"

    """

    if arg_0.tzinfo is None or arg_0.tzinfo.utcoffset(arg_0) is None:
        # dttm is timezone-naive; assume UTC
        arg_1 = pytz.utc.localize(arg_0)
    else:
        arg_1 = arg_0.astimezone(pytz.utc)
    arg_2 = arg_1.strftime("%Y-%m-%dT%H:%M:%S")
    arg_3 = arg_1.strftime("%f")
    arg_4 = getattr(arg_0, "precision", None)
    if arg_4 == "second":
        pass  # Already precise to the second
    elif arg_4 == "millisecond":
        arg_2 = arg_2 + "." + arg_3[:3]
    elif arg_1.microsecond > 0:
        arg_2 = arg_2 + "." + arg_3.rstrip("0")
    return arg_2 + "Z"

Convert a datetime object into a valid STIX timestamp string .


(cls, address_book, filename, supported_private_objects,
            localize_dates)

return cls(address_book, filename, supported_private_objects, None,
                localize_dates)

def Func(arg_0, arg_1, arg_2, arg_3,
            arg_4):
        """
        Use this if you want to create a new contact from an existing .vcf
        file.
        """
        return arg_0(arg_1, arg_2, arg_3, None,
                arg_4)

Use this if you want to create a new contact from an existing . vcf file .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
read_pkg_info
(
arg_1
)
arg_2
.
replace_header
(
'Metadata-Version'
,
'2.0'
)
arg_3
=
os
.
path
.
join
(
arg_0
,
'requires.txt'
)
if
os
.
path
.
exists
(
arg_3
)
:
arg_4
=
open
(
arg_3
)
.
read
(
)
for
arg_5
,
arg_6
in
pkg_resources
.
split_sections
(
arg_4
)
:
arg_7
=
''
if
arg_5
and
':'
in
arg_5
:
arg_5
,
arg_7
=
arg_5
.
split
(
':'
,
1
)
if
arg_5
:
arg_2
[
'Provides-Extra'
]
=
arg_5
if
arg_7
:
arg_7
+=
" and "
arg_7
+=
'extra == %s'
%
repr
(
arg_5
)
if
arg_7
:
arg_7
=
'; '
+
arg_7
for
arg_8
in
convert_requirements
(
arg_6
)
:
arg_2
[
'Requires-Dist'
]
=
arg_8
+
arg_7
arg_9
=
arg_2
[
'Description'
]
if
arg_9
:
arg_2
.
set_payload
(
dedent_description
(
arg_2
)
)
del
arg_2
[
'Description'
]
return
arg_2

def Func(arg_0, arg_1):
    """
    Convert .egg-info directory with PKG-INFO to the Metadata 1.3 aka
    old-draft Metadata 2.0 format.
    """
    arg_2 = read_pkg_info(arg_1)
    arg_2.replace_header('Metadata-Version', '2.0')
    arg_3 = os.path.join(arg_0, 'requires.txt')
    if os.path.exists(arg_3):
        arg_4 = open(arg_3).read()
        for arg_5, arg_6 in pkg_resources.split_sections(arg_4):
            arg_7 = ''
            if arg_5 and ':' in arg_5: # setuptools extra:condition syntax
                arg_5, arg_7 = arg_5.split(':', 1)
            if arg_5:
                arg_2['Provides-Extra'] = arg_5
                if arg_7:
                    arg_7 += " and "
                arg_7 += 'extra == %s' % repr(arg_5)
            if arg_7:
                arg_7 = '; ' + arg_7
            for arg_8 in convert_requirements(arg_6):
                arg_2['Requires-Dist'] = arg_8 + arg_7

    arg_9 = arg_2['Description']
    if arg_9:
        arg_2.set_payload(dedent_description(arg_2))
        del arg_2['Description']

    return arg_2

Convert . egg - info directory with PKG - INFO to the Metadata 1 . 3 aka old - draft Metadata 2 . 0 format .


return self._get_stats_table('shooting', kind=kind, summary=summary)

def Func ( arg_0 , arg_1 = 'R' , arg_2 = False ) : return arg_0 . _get_stats_table ( 'shooting' , arg_1 = arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1='R', arg_2=False):
        """Returns a DataFrame of shooting stats."""
        return arg_0._get_stats_table('shooting', arg_1=arg_1, arg_2=arg_2)


(
            self, resource_group_name, node_name, session, pssession, 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, arg_4, arg_5=None, arg_6=False, arg_7=True, **arg_8):
        """Updates a running PowerShell command with more data.

        :param resource_group_name: The resource group name uniquely
         identifies the resource group within the user subscriptionId.
        :type resource_group_name: str
        :param node_name: The node name (256 characters maximum).
        :type node_name: str
        :param session: The sessionId from the user.
        :type session: str
        :param pssession: The PowerShell sessionId from the user.
        :type pssession: 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
         PowerShellCommandResults or
         ClientRawResponse<PowerShellCommandResults> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.servermanager.models.PowerShellCommandResults]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.servermanager.models.PowerShellCommandResults]]
        :raises:
         :class:`ErrorException<azure.mgmt.servermanager.models.ErrorException>`
        """
        arg_9 = arg_0._Func_initial(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=True,
            **arg_8
        )

        def get_long_running_output(arg_10):
            arg_11 = arg_0._deserialize('PowerShellCommandResults', arg_10)

            if arg_6:
                arg_12 = ClientRawResponse(arg_11, arg_10)
                return arg_12

            return arg_11

        arg_13 = arg_8.get(
            'long_running_operation_timeout',
            arg_0.config.long_running_operation_timeout)
        if arg_7 is True: arg_14 = ARMPolling(arg_13, **arg_8)
        elif arg_7 is False: arg_14 = NoPolling()
        else: arg_14 = arg_7
        return LROPoller(arg_0._client, arg_9, get_long_running_output, arg_14)

Updates a running PowerShell command with more data .


(socket, header, payload, topics=(), flags=0)

return eintr_retry_zmq(socket.send_multipart, msgs, flags)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = ( ) , arg_4 = 0 ) : arg_5 = [ ] arg_5 . extend ( arg_3 ) arg_5 . append ( SEAM ) arg_5 . extend ( arg_1 ) arg_5 . append ( arg_2 ) return eintr_retry_zmq ( arg_0 . Func_multipart , arg_5 , arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3=(), arg_4=0):
    """Sends header, payload, and topics through a ZeroMQ socket.

    :param socket: a zmq socket.
    :param header: a list of byte strings which represent a message header.
    :param payload: the serialized byte string of a payload.
    :param topics: a chain of topics.
    :param flags: zmq flags to Func messages.

    """
    arg_5 = []
    arg_5.extend(arg_3)
    arg_5.append(SEAM)
    arg_5.extend(arg_1)
    arg_5.append(arg_2)
    return eintr_retry_zmq(arg_0.Func_multipart, arg_5, arg_4)

Sends header, payload, and topics through a ZeroMQ socket.

    :param socket: a zmq socket.
    :param header: a list of byte strings which represent a message header.
    :param payload: the serialized byte string of a payload.
    :param topics: a chain of topics.
    :param flags: zmq flags to send messages.

Sends header payload and topics through a ZeroMQ socket .


def Func ( * arg_0 ) : def _wrap ( arg_1 ) : @ functools . wraps ( arg_1 ) def wrapper ( arg_2 , * arg_3 , ** arg_4 ) : with contextlib . ExitStack ( ) as stack : for arg_5 in arg_0 : stack . enter_context ( getattr ( arg_2 , arg_5 ) ) return arg_1 ( arg_2 , * arg_3 , ** arg_4 ) return wrapper return _wrap

def Func(*arg_0):
    '''
    like `with_objattr` but enter context one by one.
    '''

    def _wrap(arg_1):

        @functools.wraps(arg_1)
        def wrapper(arg_2, *arg_3, **arg_4):
            with contextlib.ExitStack() as stack:
                for arg_5 in arg_0:
                    stack.enter_context(getattr(arg_2, arg_5))
                return arg_1(arg_2, *arg_3, **arg_4)

        return wrapper

    return _wrap

like with_objattr but enter context one by one .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_0 : if arg_1 : return True if arg_2 : if arg_3 : return True if len ( arg_2 ) >= 2 : return True if len ( arg_3 ) >= 2 : return True if arg_1 : if len ( arg_1 ) >= 2 : return True if arg_2 : if len ( arg_2 ) >= 3 : return True elif len ( arg_2 ) >= 2 : if len ( arg_3 ) >= 2 : return True elif len ( arg_3 ) >= 4 : return True return False

def Func(arg_0, arg_1, arg_2, arg_3):
    """Check if the criterias for Pathogenic is fullfilled

    The following are descriptions of Pathogenic clasification from ACMG paper:

    Pathogenic
      (i) 1 Very strong (PVS1) AND
        (a) ≥1 Strong (PS1–PS4) OR
        (b) ≥2 Moderate (PM1–PM6) OR
        (c) 1 Moderate (PM1–PM6) and 1 supporting (PP1–PP5) OR
        (d) ≥2 Supporting (PP1–PP5)
      (ii) ≥2 Strong (PS1–PS4) OR
      (iii) 1 Strong (PS1–PS4) AND
        (a)≥3 Moderate (PM1–PM6) OR
        (b)2 Moderate (PM1–PM6) AND ≥2 Supporting (PP1–PP5) OR
        (c)1 Moderate (PM1–PM6) AND ≥4 supporting (PP1–PP5)

    Args:
        pvs(bool): Pathogenic Very Strong
        ps_terms(list(str)): Pathogenic Strong terms
        pm_terms(list(str)): Pathogenic Moderate terms
        pp_terms(list(str)): Pathogenic Supporting terms

    Returns:
        bool: if classification indicates Pathogenic level
    """
    if arg_0:
        # Pathogenic (i)(a):
        if arg_1:
            return True
        if arg_2:
            # Pathogenic (i)(c):
            if arg_3:
                return True
            # Pathogenic (i)(b):
            if len(arg_2) >= 2:
                return True
        # Pathogenic (i)(d):
        if len(arg_3) >= 2:
            return True
    if arg_1:
        # Pathogenic (ii):
        if len(arg_1) >= 2:
            return True
        # Pathogenic (iii)(a):
        if arg_2:
            if len(arg_2) >= 3:
                return True
            elif len(arg_2) >= 2:
                if len(arg_3) >= 2:
                    return True
            elif len(arg_3) >= 4:
                return True
    return False


def Func(arg_0):
    """Declaration of routing"""
    arg_1 = arg_0.add_route
    arg_1('get-content', '/contents/{ident_hash}')
    arg_1('get-resource', '/resources/{hash}')

    # User actions API
    arg_1('license-request', '/contents/{uuid}/licensors')
    arg_1('roles-request', '/contents/{uuid}/roles')
    arg_1('acl-request', '/contents/{uuid}/permissions')

    # Publishing API
    arg_1('publications', '/publications')
    arg_1('get-publication', '/publications/{id}')
    arg_1('publication-license-acceptance',
              '/publications/{id}/license-acceptances/{uid}')
    arg_1('publication-role-acceptance',
              '/publications/{id}/role-acceptances/{uid}')
    # TODO (8-May-12017) Remove because the term collate is being phased out.
    arg_1('collate-content', '/contents/{ident_hash}/collate-content')
    arg_1('bake-content', '/contents/{ident_hash}/baked')

    # Moderation routes
    arg_1('moderation', '/moderations')
    arg_1('moderate', '/moderations/{id}')
    arg_1('moderation-rss', '/feeds/moderations.rss')

    # API Key routes
    arg_1('api-keys', '/api-keys')
    arg_1('api-key', '/api-keys/{id}')


def Func(arg_0, arg_1):
    """
    Decorator for methods accepting old_path and new_path.
    """
    def _wrapper(arg_2, arg_3, arg_4, *arg_5, **arg_6):
        arg_7, arg_8, arg_9 = _resolve_path(
            arg_3, arg_2.managers
        )
        arg_10, arg_11, arg_12 = _resolve_path(
            arg_4, arg_2.managers,
        )
        if arg_8 is not arg_11:
            # TODO: Consider supporting this via get+delete+save.
            raise HTTPError(
                400,
                "Can't move files between backends ({old} -> {new})".format(
                    old=arg_3,
                    new=arg_4,
                )
            )
        assert arg_10 == arg_7
        arg_13 = getattr(arg_11, arg_0)(
            arg_9,
            arg_12,
            *arg_5,
            **arg_6
        )
        if arg_1 and arg_10:
            return _apply_prefix(arg_10, arg_13)
        else:
            return arg_13
    return _wrapper

Decorator for methods accepting old_path and new_path .


(self, input_suffix, output_suffix, lane)

def Func(arg_0, arg_1, arg_2, arg_3):
        """Sets the main channel names based on the provide input and
        output channel suffixes. This is performed when connecting processes.

        Parameters
        ----------
        input_suffix : str
            Suffix added to the input channel. Should be based on the lane
            and an arbitrary unique id
        output_suffix : str
            Suffix added to the output channel. Should be based on the lane
            and an arbitrary unique id
        lane : int
            Sets the lane of the process.
        """

        arg_0.input_channel = "{}_in_{}".format(arg_0.template, arg_1)
        arg_0.output_channel = "{}_out_{}".format(arg_0.template, arg_2)
        arg_0.lane = arg_3

Sets the main channel names based on the provide input and output channel suffixes . This is performed when connecting processes .


def Func(arg_0='/tmp/tensorflow', arg_1=6006):
    """Open Tensorboard.

    Parameters
    ----------
    log_dir : str
        Directory where your tensorboard logs are saved
    port : int
        TensorBoard port you want to open, 6006 is tensorboard default

    """
    arg_2 = "[TL] Open tensorboard, go to localhost:" + str(arg_1) + " to access"
    arg_3 = " not yet supported by this function (tl.ops.open_tb)"

    if not tl.files.exists_or_mkdir(arg_0, verbose=False):
        tl.logging.info("[TL] Log reportory was created at %s" % arg_0)

    if _platform == "linux" or _platform == "linux2":
        raise NotImplementedError()
    elif _platform == "darwin":
        tl.logging.info('OS X: %s' % arg_2)
        subprocess.Popen(
            sys.prefix + " | python -m tensorflow.tensorboard --logdir=" + arg_0 + " --port=" + str(arg_1), shell=True
        )  # open tensorboard in localhost:6006/ or whatever port you chose
    elif _platform == "win32":
        raise NotImplementedError("this function is not supported on the Windows platform")
    else:
        tl.logging.info(_platform + arg_3)


def Func ( arg_0 ) : @ wrapt . decorator def wrapper ( arg_1 , arg_2 , arg_3 , arg_4 ) : if not isinstance ( arg_3 [ arg_0 ] , list ) : arg_3 = list ( arg_3 ) arg_3 [ arg_0 ] = [ arg_3 [ arg_0 ] ] arg_3 = tuple ( arg_3 ) return arg_1 ( * arg_3 , ** arg_4 ) return wrapper

def Func(arg_0):
	"""Cast the positional argument at given position into a list if not already a list."""

	@wrapt.decorator
	def wrapper(arg_1, arg_2, arg_3, arg_4):
		if not isinstance(arg_3[arg_0], list):
			arg_3 = list(arg_3)
			arg_3[arg_0] = [arg_3[arg_0]]
			arg_3 = tuple(arg_3)

		return arg_1(*arg_3, **arg_4)

	return wrapper

Cast the positional argument at given position into a list if not already a list .


def Func ( arg_0 ) : arg_0 . onFunc ( ) arg_0 . _extensions = { } arg_0 . _disable_forum_observation ( ) arg_0 . _world = None arg_0 . _id = None

def Func(arg_0):
        """
        Clear all the internal data the token needed while it was part of
        the world.

        Note that this method doesn't actually remove the token from the
        world.  That's what World._remove_token() does.  This method is just
        responsible for setting the internal state of the token being removed.
        """
        arg_0.onFunc()
        arg_0._extensions = {}
        arg_0._disable_forum_observation()
        arg_0._world = None
        arg_0._id = None

Clear all the internal data the token needed while it was part of the world .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_1 . lookup ( arg_1 . name ) if not _is_builtin ( arg_2 ) : return if arg_1 . name not in arg_0 . _bad_builtins : return if node_ignores_exception ( arg_1 ) or isinstance ( find_try_except_wrapper_node ( arg_1 ) , astroid . ExceptHandler ) : return arg_4 = arg_1 . name . lower ( ) + "-builtin" arg_0 . add_message ( arg_4 , arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """Detect when a "bad" built-in is referenced."""
        arg_2, arg_3 = arg_1.lookup(arg_1.name)
        if not _is_builtin(arg_2):
            return
        if arg_1.name not in arg_0._bad_builtins:
            return
        if node_ignores_exception(arg_1) or isinstance(
            find_try_except_wrapper_node(arg_1), astroid.ExceptHandler
        ):
            return

        arg_4 = arg_1.name.lower() + "-builtin"
        arg_0.add_message(arg_4, arg_1=arg_1)

Detect when a bad built - in is referenced .


def Func ( arg_0 , arg_1 ) : if arg_0 . Funcs == 16 : if arg_1 >= 8 : return arg_0 . csi ( 'bold' ) + arg_0 . csi ( 'setaf' , arg_1 - 8 ) else : return arg_0 . csi ( 'sgr0' ) + arg_0 . csi ( 'setaf' , arg_1 ) else : return arg_0 . csi ( 'setaf' , arg_1 )

def Func(arg_0, arg_1):
        """Get the escape sequence for indexed Func ``index``.

        The ``index`` is a Func index in the 256 Func space. The Func space
        consists of:

        * 0x00-0x0f: default EGA Funcs
        * 0x10-0xe7: 6x6x6 RGB cubes
        * 0xe8-0xff: gray scale ramp
        """
        if arg_0.Funcs == 16:
            if arg_1 >= 8:
                return arg_0.csi('bold') + arg_0.csi('setaf', arg_1 - 8)
            else:
                return arg_0.csi('sgr0') + arg_0.csi('setaf', arg_1)
        else:
            return arg_0.csi('setaf', arg_1)

Get the escape sequence for indexed color ``index``.

        The ``index`` is a color index in the 256 color space. The color space
        consists of:

        * 0x00-0x0f: default EGA colors
        * 0x10-0xe7: 6x6x6 RGB cubes
        * 0xe8-0xff: gray scale ramp

Get the escape sequence for indexed color index .


def Func ( arg_0 , arg_1 ) : arg_2 = Message ( to_jid = arg_0 . room_jid . bare ( ) , stanza_type = "groupchat" , arg_1 = arg_1 ) arg_0 . manager . stream . send ( arg_2 )

def Func(arg_0,arg_1):
        """
        Send a message to the room.

        :Parameters:
            - `body`: the message body.
        :Types:
            - `body`: `unicode`
        """
        arg_2=Message(to_jid=arg_0.room_jid.bare(),stanza_type="groupchat",arg_1=arg_1)
        arg_0.manager.stream.send(arg_2)


(self, ontology, iri, size=None, sleep=None)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
        """Iterates over the labels for the descendants of a given term

        :param str ontology: The name of the ontology
        :param str iri: The IRI of a term
        :param int size: The size of each page. Defaults to 500, which is the maximum allowed by the EBI.
        :param int sleep: The amount of time to sleep between pages. Defaults to 0 seconds.
        :rtype: iter[str]
        """
        for arg_5 in _help_iterate_labels(arg_0.iter_descendants(arg_1, arg_2, arg_3=arg_3, arg_4=arg_4)):
            yield arg_5


(graph: BELGraph, annotation: str = 'Subgraph')

def Func ( arg_0 : arg_1 , arg_2 : arg_3 = 'Subgraph' ) -> Counter [ int ] : return count_dict_values ( group_nodes_by_annotation ( arg_0 , arg_2 ) )

def Func(arg_0: arg_1, arg_2: arg_3 = 'Subgraph') -> Counter[int]:
    """Count the number of nodes in each subgraph induced by an annotation.

    :param annotation: The annotation to group by and compare. Defaults to 'Subgraph'
    :return: A dictionary from {annotation value: number of nodes}
    """
    return count_dict_values(group_nodes_by_annotation(arg_0, arg_2))

Count the number of nodes in each subgraph induced by an annotation .


def Func(arg_0):
        """Call the timeout handlers due.

        :Return: (next_event_timeout, sources_handled) tuple.
            next_event_timeout is number of seconds until the next timeout
            event, sources_handled is number of handlers called.
        """
        arg_1 = 0
        arg_2 = time.time()
        arg_3 = None
        while arg_0._timeout_handlers:
            arg_3, arg_4 = arg_0._timeout_handlers[0]
            if arg_3 <= arg_2:
                # pylint: disable-msg=W0212
                logger.debug("About to call a timeout handler: {0!r}"
                                                        .format(arg_4))
                arg_0._timeout_handlers = arg_0._timeout_handlers[1:]
                arg_6 = arg_4()
                logger.debug(" handler result: {0!r}".format(arg_6))
                arg_7 = arg_4._pyxmpp_recurring
                if arg_7:
                    logger.debug(" recurring, restarting in {0} s"
                                        .format(arg_4._pyxmpp_timeout))
                    arg_0._timeout_handlers.append(
                                    (arg_2 + arg_4._pyxmpp_timeout, arg_4))
                    arg_0._timeout_handlers.sort(key = lambda x: x[0])
                elif arg_7 is None and arg_6 is not None:
                    logger.debug(" auto-recurring, restarting in {0} s"
                                                            .format(arg_6))
                    arg_0._timeout_handlers.append((arg_2 + arg_6, arg_4))
                    arg_0._timeout_handlers.sort(key = lambda x: x[0])
                arg_1 += 1
            else:
                break
            if arg_0.check_events():
                return 0, arg_1
        if arg_0._timeout_handlers and arg_3:
            arg_8 = arg_3 - arg_2
        else:
            arg_8 = None
        return arg_8, arg_1


def Func(arg_0):
        """Update the status of the job lists.

        This method moves finished jobs to one of two lists:
          - self.completed: jobs which completed successfully
          - self.dead: jobs which finished but died.

        It also copies those jobs to corresponding _report lists.  These lists
        are used to report jobs completed/dead since the last update, and are
        then cleared by the reporting function after each call."""

        # Status codes
        arg_1, arg_2, arg_3 = arg_0._s_running, arg_0._s_completed, arg_0._s_dead
        # State lists, use the actual lists b/c the public names are properties
        # that call this very function on access
        arg_4, arg_5, arg_6 = arg_0._running, arg_0._completed, arg_0._dead

        # Now, update all state lists
        for arg_7, arg_8 in enumerate(arg_4):
            arg_9 = arg_8.stat_code
            if arg_9 == arg_1:
                continue
            elif arg_9 == arg_2:
                arg_5.append(arg_8)
                arg_0._comp_report.append(arg_8)
                arg_4[arg_7] = False
            elif arg_9 == arg_3:
                arg_6.append(arg_8)
                arg_0._dead_report.append(arg_8)
                arg_4[arg_7] = False
        # Remove dead/completed jobs from running list
        arg_4[:] = filter(None, arg_4)


def
Func
(
arg_0
,
arg_1
=
'up'
)
:
if
arg_0
.
rank
==
1
:
return
''
arg_2
=
ContentType
.
objects
.
get_for_model
(
arg_0
)
arg_3
=
reverse
(
'awl-rankedmodel-move'
,
args
=
(
arg_2
.
id
,
arg_0
.
id
,
arg_0
.
rank
1
)
)
return
'%s'
%
(
arg_3
,
arg_1
)

def Func(arg_0, arg_1='up'):
    """Returns a link to a view that moves the passed in object up in rank.

    :param obj:
        Object to move
    :param link_text:
        Text to display in the link.  Defaults to "up"
    :returns:
        HTML link code to view for moving the object
    """
    if arg_0.rank == 1:
        return ''

    arg_2 = ContentType.objects.get_for_model(arg_0)
    arg_3 = reverse('awl-rankedmodel-move', args=(arg_2.id, arg_0.id,
        arg_0.rank - 1))

    return '%s' % (arg_3, arg_1)

Returns a link to a view that moves the passed in object up in rank .


(filename, clean_lines, linenum, nesting_state, error)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
  """Checks for horizontal spacing near commas.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    nesting_state: A NestingState instance which maintains information about
                   the current stack of nested blocks being parsed.
    error: The function to call with any errors found.
  """
  arg_5 = arg_1.elided[arg_2]

  # Except after an opening paren, or after another opening brace (in case of
  # an initializer list, for instance), you should have spaces before your
  # braces when they are delimiting blocks, classes, namespaces etc.
  # And since you should never have braces at the beginning of a line,
  # this is an easy test.  Except that braces used for initialization don't
  # follow the same rule; we often don't want spaces before those.
  arg_6 = Match(r'^(.*[^ ({>]){', arg_5)

  if arg_6:
    # Try a bit harder to check for brace initialization.  This
    # happens in one of the following forms:
    #   Constructor() : initializer_list_{} { ... }
    #   Constructor{}.MemberFunction()
    #   Type variable{};
    #   FunctionCall(type{}, ...);
    #   LastArgument(..., type{});
    #   LOG(INFO) << type{} << " ...";
    #   map_of_type[{...}] = ...;
    #   ternary = expr ? new type{} : nullptr;
    #   OuterTemplate<InnerTemplateConstructor<Type>{}>
    #
    # We check for the character following the closing brace, and
    # silence the warning if it's one of those listed above, i.e.
    # "{.;,)<>]:".
    #
    # To account for nested initializer list, we allow any number of
    # closing braces up to "{;,)<".  We can't simply silence the
    # warning on first sight of closing brace, because that would
    # cause false negatives for things that are not initializer lists.
    #   Silence this:         But not this:
    #     Outer{                if (...) {
    #       Inner{...}            if (...){  // Missing space before {
    #     };                    }
    #
    # There is a false negative with this approach if people inserted
    # spurious semicolons, e.g. "if (cond){};", but we will catch the
    # spurious semicolon with a separate check.
    arg_7 = arg_6.group(1)
    (arg_8, arg_9, arg_10) = CloseExpression(
        arg_1, arg_2, len(arg_6.group(1)))
    arg_11 = ''
    if arg_10 > -1:
      arg_11 = arg_8[arg_10:]
    for arg_12 in xrange(arg_9 + 1,
                         min(arg_9 + 3, arg_1.NumLines() - 1)):
      arg_11 += arg_1.elided[arg_12]
    # We also suppress warnings for `uint64_t{expression}` etc., as the style
    # guide recommends brace initialization for integral types to avoid
    # overflow/truncation.
    if (not Match(r'^[\s}]*[{.;,)<>\]:]', arg_11)
        and not _IsType(arg_1, arg_3, arg_7)):
      arg_4(arg_0, arg_2, 'whitespace/braces', 5,
            'Missing space before {')

  # Make sure '} else {' has spaces.
  if Search(r'}else', arg_5):
    arg_4(arg_0, arg_2, 'whitespace/braces', 5,
          'Missing space before else')

  # You shouldn't have a space before a semicolon at the end of the line.
  # There's a special case for "for" since the style guide allows space before
  # the semicolon there.
  if Search(r':\s*;\s*$', arg_5):
    arg_4(arg_0, arg_2, 'whitespace/semicolon', 5,
          'Semicolon defining empty statement. Use {} instead.')
  elif Search(r'^\s*;\s*$', arg_5):
    arg_4(arg_0, arg_2, 'whitespace/semicolon', 5,
          'Line contains only semicolon. If this should be an empty statement, '
          'use {} instead.')
  elif (Search(r'\s+;\s*$', arg_5) and
        not Search(r'\bfor\b', arg_5)):
    arg_4(arg_0, arg_2, 'whitespace/semicolon', 5,
          'Extra space before last semicolon. If this should be an empty '
          'statement, use {} instead.')

Checks for horizontal spacing near commas .


def Func(arg_0):
        """        Read phantom tool specific options        """
        arg_0.threads = arg_0.cfg["threads"] or str(int(multiprocessing.cpu_count() / 2) + 1)
        arg_0.phantom_modules_path = arg_0.cfg["phantom_modules_path"]
        arg_0.additional_libs = ' '.join(arg_0.cfg["additional_libs"])
        arg_0.answ_log_level = arg_0.cfg["writelog"]
        if arg_0.answ_log_level.lower() in ['0', 'false']:
            arg_0.answ_log_level = 'none'
        elif arg_0.answ_log_level.lower() in ['1', 'true']:
            arg_0.answ_log_level = 'all'
        arg_0.timeout = parse_duration(arg_0.cfg["timeout"])
        if arg_0.timeout > 120000:
            logger.warning(
                "You've set timeout over 2 minutes."
                " Are you a functional tester?")
        arg_0.answ_log = arg_0.core.mkstemp(".log", "answ_")
        arg_0.core.add_artifact_file(arg_0.answ_log)
        arg_0.core.add_artifact_file(arg_0.phout_file)
        arg_0.core.add_artifact_file(arg_0.stat_log)
        arg_0.phantom_log = arg_0.core.mkstemp(".log", "phantom_")
        arg_0.core.add_artifact_file(arg_0.phantom_log)

        arg_8 = StreamConfig(
            arg_0.core,
            len(arg_0.streams), arg_0.phout_file, arg_0.answ_log,
            arg_0.answ_log_level, arg_0.timeout, arg_0.cfg, True)
        arg_0.streams.append(arg_8)

        for arg_9 in arg_0.multi():
            arg_0.streams.append(
                StreamConfig(
                    arg_0.core,
                    len(arg_0.streams), arg_0.phout_file, arg_0.answ_log,
                    arg_0.answ_log_level, arg_0.timeout, arg_9))

        for arg_10 in arg_0.streams:
            arg_10.Func()

        if any(arg_10.ssl for arg_10 in arg_0.streams):
            arg_0.additional_libs += ' ssl io_benchmark_method_stream_transport_ssl'


(module, title, title_api_section, toc=True, maxdepth=0)

def Func(arg_0, arg_1, arg_2, arg_3=True, arg_4=0):
    """
    Generate markdown document from module, including API section.
    """
    arg_5 = arg_0.__doc__

    arg_6 = doctrim(arg_5)
    arg_7 = arg_6.split('\n')

    arg_8 = find_sections(arg_7)
    if arg_8:
        arg_9 = min(n for n,t in arg_8) - 1
    else:
        arg_9 = 1

    arg_10 = []
    arg_11 = []
    if arg_2 and arg_0.__all__:
        arg_8.append((arg_9+1, arg_2))
        for arg_12 in arg_0.__all__:
            arg_11.append((arg_9+2, "`" + arg_12 + "`"))
            arg_10 += ['', '']
            arg_13 = arg_0.__dict__[arg_12]
            if arg_13.__doc__:
                arg_14, arg_15 = doc2md(arg_13.__doc__, "`" + arg_12 + "`",
                        min_level=arg_9+2, more_info=True, arg_3=False)
                arg_11 += arg_15
                arg_10 += arg_14

    arg_8 += arg_11

    # headline
    arg_16 = next((i for i, l in enumerate(arg_7) if is_heading(l)), 0)
    arg_14 = [
        make_heading(arg_9, arg_1),
        "",
    ] + arg_7[:arg_16]

    # main sections
    if arg_3:
        arg_14 += make_toc(arg_8, arg_4)
        arg_14 += ['']
    arg_14 += _doc2md(arg_7[arg_16:])

    # API section
    arg_14 += [
        '',
        '',
        make_heading(arg_9+1, arg_2),
    ]
    if arg_3:
        arg_14 += ['']
        arg_14 += make_toc(arg_11, 1)
    arg_14 += arg_10

    return "\n".join(arg_14)

Generate markdown document from module including API section .