def
Func
(
arg_0
,
arg_1
=
"index.html"
)
:
arg_2
=
""
for
arg_3
in
glob
.
glob
(
arg_0
+
"/*.*"
)
:
if
arg_3
.
split
(
"."
)
[
1
]
in
[
'jpg'
,
'png'
]
:
arg_2
+=
"
%s
"
%
os
.
path
.
basename
(
arg_3
)
arg_2
+=
''
%
os
.
path
.
basename
(
arg_3
)
arg_2
+=
'
'
*
10
arg_2
+=
""
arg_4
=
open
(
arg_0
+
"/"
+
arg_1
,
'w'
)
arg_4
.
write
(
arg_2
)
arg_4
.
close
print
(
"indexed:"
)
print
(
"  "
,
os
.
path
.
abspath
(
arg_0
+
"/"
+
arg_1
)
)
return

def Func(arg_0,arg_1="index.html"):
    """OBSOLETE WAY TO INDEX A FOLDER.""" #TODO: REMOVE
    arg_2=""
    for arg_3 in glob.glob(arg_0+"/*.*"):
        if arg_3.split(".")[-1] in ['jpg','png']:
            arg_2+="
%s
"%os.path.basename(arg_3)
            arg_2+=''%os.path.basename(arg_3)
            arg_2+='
'*10
    arg_2+=""
    arg_4=open(arg_0+"/"+arg_1,'w')
    arg_4.write(arg_2)
    arg_4.close
    print("indexed:")
    print("  ",os.path.abspath(arg_0+"/"+arg_1))
    return


(query, country=None, hurricanes=False, cities=True, timeout=5)

def Func ( arg_0 , arg_1 = None , arg_2 = False , arg_3 = True , arg_4 = 5 ) : arg_5 = { } arg_5 [ 'query' ] = quote ( arg_0 ) arg_5 [ 'country' ] = arg_1 or '' arg_5 [ 'hurricanes' ] = 1 if arg_2 else 0 arg_5 [ 'cities' ] = 1 if arg_3 else 0 arg_5 [ 'format' ] = 'JSON' arg_6 = requests . get ( AUTOCOMPLETE_URL . format ( ** arg_5 ) , arg_4 = arg_4 ) arg_7 = json . loads ( arg_6 . content ) [ 'RESULTS' ] return arg_7

def Func(arg_0, arg_1=None, arg_2=False, arg_3=True, arg_4=5):
    """Make an Func API request

    This can be used to find cities and/or hurricanes by name

    :param string query: city
    :param string country: restrict search to a specific country. Must be a two letter country code
    :param boolean hurricanes: whether to search for hurricanes or not
    :param boolean cities: whether to search for cities or not
    :param integer timeout: timeout of the api request
    :returns: result of the Func API request
    :rtype: dict

    """
    arg_5 = {}
    arg_5['query'] = quote(arg_0)
    arg_5['country'] = arg_1 or ''
    arg_5['hurricanes'] = 1 if arg_2 else 0
    arg_5['cities'] = 1 if arg_3 else 0
    arg_5['format'] = 'JSON'
    arg_6 = requests.get(AUTOCOMPLETE_URL.format(**arg_5), arg_4=arg_4)
    arg_7 = json.loads(arg_6.content)['RESULTS']
    return arg_7

Make an autocomplete API request

    This can be used to find cities and/or hurricanes by name

    :param string query: city
    :param string country: restrict search to a specific country. Must be a two letter country code
    :param boolean hurricanes: whether to search for hurricanes or not
    :param boolean cities: whether to search for cities or not
    :param integer timeout: timeout of the api request
    :returns: result of the autocomplete API request
    :rtype: dict


def Func(arg_0, arg_1: arg_2) -> Price:
        """ Parse into the Price entity, ready for saving """
        # assert isinstance(model, PriceModel)
        assert isinstance(arg_1.symbol, SecuritySymbol)
        assert isinstance(arg_1.datum, Datum)

        arg_3 = Price()

        # Format date as ISO string
        arg_4 = f"{model.datum.value.year}-{model.datum.value.month:02d}-{model.datum.value.day:02d}"
        arg_3.date = arg_4

        arg_3.time = f"{model.datum.value.hour:02d}:{model.datum.value.minute:02d}:{model.datum.value.second:02d}"

        # Symbol
        # properly mapped symbols have a namespace, except for the US markets
        # TODO check this with .csv import
        if arg_1.symbol.namespace:
            arg_3.namespace = arg_1.symbol.namespace.upper()
        arg_3.symbol = arg_1.symbol.mnemonic.upper()

        assert isinstance(arg_1.value, Decimal)
        # Find number of decimal places
        arg_9 = abs(arg_1.value.as_tuple().exponent)
        arg_3.denom = 10 ** arg_9
        # Price value
        arg_3.value = int(arg_1.value * arg_3.denom)

        # Currency
        arg_3.currency = arg_1.currency.upper()

        # self.logger.debug(f"{entity}")
        return arg_3

Parse into the Price entity ready for saving


(topleft, topright, bottomleft, bottomright)

return vstack(hstack(topleft, topright),
                  hstack(bottomleft, bottomright))

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : return vstack ( hstack ( arg_0 , arg_1 ) , hstack ( arg_2 , arg_3 ) )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Convenience function that creates a block matrix with the specified
    blocks.

    Each argument must be a NumPy matrix. The two top matrices must have the
    same number of rows, as must the two bottom matrices. The two left matrices
    must have the same number of columns, as must the two right matrices.

    """
    return vstack(hstack(arg_0, arg_1),
                  hstack(arg_2, arg_3))

Convenience function that creates a block matrix with the specified blocks .


def Func(arg_0):
        """Override the base Func."""
        arg_0.update_system_numbers()
        arg_0.add_systemnumber("CDS")
        arg_0.fields_list = [
            "024", "041", "035", "037", "088", "100",
            "110", "111", "242", "245", "246", "260",
            "269", "300", "502", "650", "653", "693",
            "700", "710", "773", "856", "520", "500",
            "980"
        ]
        arg_0.keep_only_fields()

        arg_0.determine_collections()
        arg_0.add_cms_link()
        arg_0.update_languages()
        arg_0.update_reportnumbers()
        arg_0.update_date()
        arg_0.update_pagenumber()
        arg_0.update_authors()
        arg_0.update_subject_categories("SzGeCERN", "INSPIRE", "categories_inspire")
        arg_0.update_keywords()
        arg_0.update_experiments()
        arg_0.update_collaboration()
        arg_0.update_journals()
        arg_0.update_links_and_ffts()

        if 'THESIS' in arg_0.collections:
            arg_0.update_thesis_supervisors()
            arg_0.update_thesis_information()

        if 'NOTE' in arg_0.collections:
            arg_0.add_notes()

        for arg_2 in arg_0.collections:
            record_add_field(arg_0.record,
                             tag='980',
                             subfields=[('a', arg_2)])
        arg_0.remove_controlfields()
        return arg_0.record


def Func ( arg_0 , arg_1 ) : arg_0 . _inputs . extend ( arg_1 . _inputs ) arg_0 . _outputs . extend ( arg_1 . _outputs ) if arg_0 . _sensitivity is not None : arg_0 . _sensitivity . extend ( arg_1 . _sensitivity ) else : assert arg_1 . _sensitivity is None if arg_0 . _enclosed_for is not None : arg_0 . _enclosed_for . update ( arg_1 . _enclosed_for ) else : assert arg_1 . _enclosed_for is None arg_2 = arg_1 . parentStm is None if arg_2 : arg_1 . _get_rtl_context ( ) . statements . remove ( arg_1 ) for arg_3 in arg_1 . _inputs : arg_3 . endpoints . discard ( arg_1 ) arg_3 . endpoints . append ( arg_0 ) for arg_3 in arg_1 . _outputs : arg_3 . drivers . discard ( arg_1 ) arg_3 . drivers . append ( arg_0 )

def Func(arg_0, arg_1):
        """
        After merging statements update IO, sensitivity and context

        :attention: rank is not updated
        """
        arg_0._inputs.extend(arg_1._inputs)
        arg_0._outputs.extend(arg_1._outputs)

        if arg_0._sensitivity is not None:
            arg_0._sensitivity.extend(arg_1._sensitivity)
        else:
            assert arg_1._sensitivity is None

        if arg_0._enclosed_for is not None:
            arg_0._enclosed_for.update(arg_1._enclosed_for)
        else:
            assert arg_1._enclosed_for is None

        arg_2 = arg_1.parentStm is None
        if arg_2:
            arg_1._get_rtl_context().statements.remove(arg_1)
            for arg_3 in arg_1._inputs:
                arg_3.endpoints.discard(arg_1)
                arg_3.endpoints.append(arg_0)

            for arg_3 in arg_1._outputs:
                arg_3.drivers.discard(arg_1)
                arg_3.drivers.append(arg_0)

After merging statements update IO sensitivity and context


def Func ( arg_0 , arg_1 = '' ) : if not os . path . exists ( os . path . dirname ( arg_1 ) ) : try : os . makedirs ( os . path . dirname ( arg_1 ) ) except OSError as e : if e . errno != errno . EEXIST : raise

def Func(arg_0, arg_1=''):
        """
        Checks if a directory exists. If not, it creates one with the specified
        file_path.
        """
        if not os.path.exists(os.path.dirname(arg_1)):
            try:
                os.makedirs(os.path.dirname(arg_1))
            except OSError as e:
                if e.errno != errno.EEXIST:
                    raise

Checks if a directory exists . If not it creates one with the specified file_path .


def Func(arg_0):
    """ Gets a Credentials storage object provided by the Django OAuth2 Helper
    object.

    Args:
        request: Reference to the current request object.

    Returns:
       An :class:`oauth2.client.Storage` object.
    """
    arg_1 = oauth2_settings.storage_model
    arg_2 = oauth2_settings.storage_model_user_property
    arg_3 = oauth2_settings.storage_model_credentials_property

    if arg_1:
        arg_4, arg_5 = arg_1.rsplit('.', 1)
        arg_6 = importlib.import_module(arg_4)
        arg_7 = getattr(arg_6, arg_5)
        return storage.DjangoORMStorage(arg_7,
                                        arg_2,
                                        arg_0.user,
                                        arg_3)
    else:
        # use session
        return dictionary_storage.DictionaryStorage(
            arg_0.session, key=_CREDENTIALS_KEY)

Gets a Credentials storage object provided by the Django OAuth2 Helper object .


def Func(arg_0, arg_1, arg_2=False):
        """ Append raw PNG data to the widget.
        """
        arg_0._append_custom(arg_0._insert_png, arg_1, arg_2)


def Func ( arg_0 ) : arg_1 = widgets . Output ( layout = widgets . Layout ( display = 'flex-inline' , align_items = 'center' , min_height = '400px' ) ) arg_2 = widgets . Output ( layout = widgets . Layout ( display = 'flex-inline' , align_items = 'center' , min_height = '400px' ) ) arg_3 = widgets . Output ( layout = widgets . Layout ( display = 'flex-inline' , align_items = 'center' , min_height = '400px' ) ) arg_4 = widgets . Tab ( layout = widgets . Layout ( max_height = '620px' ) ) arg_4 . children = [ arg_1 , arg_2 , arg_3 ] arg_4 . set_title ( 0 , 'Year' ) arg_4 . set_title ( 1 , 'Month' ) arg_4 . set_title ( 2 , 'Week' ) arg_4 . selected_index = 1 _build_Func ( arg_4 , arg_0 ) return arg_4

def Func(arg_0):
    """Widget for displaying job history

    Args:
     backend (IBMQbackend): The backend.

    Returns:
        Tab: A tab widget for history images.
    """
    arg_1 = widgets.Output(layout=widgets.Layout(display='flex-inline',
                                                align_items='center',
                                                min_height='400px'))

    arg_2 = widgets.Output(layout=widgets.Layout(display='flex-inline',
                                                 align_items='center',
                                                 min_height='400px'))

    arg_3 = widgets.Output(layout=widgets.Layout(display='flex-inline',
                                                align_items='center',
                                                min_height='400px'))

    arg_4 = widgets.Tab(layout=widgets.Layout(max_height='620px'))
    arg_4.children = [arg_1, arg_2, arg_3]
    arg_4.set_title(0, 'Year')
    arg_4.set_title(1, 'Month')
    arg_4.set_title(2, 'Week')
    arg_4.selected_index = 1

    _build_Func(arg_4, arg_0)
    return arg_4


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_1
[
'bam_files'
]
=
[
]
arg_1
[
'mt_bams'
]
=
[
]
arg_1
[
'bai_files'
]
=
[
]
arg_1
[
'mt_bais'
]
=
[
]
arg_1
[
'sample_names'
]
=
[
]
for
arg_3
in
arg_1
[
'individuals'
]
:
arg_4
=
arg_3
.
get
(
'bam_file'
)
arg_5
=
arg_3
.
get
(
'mt_bam'
)
arg_1
[
'sample_names'
]
.
append
(
arg_3
.
get
(
'display_name'
)
)
if
arg_4
and
os
.
path
.
exists
(
arg_4
)
:
arg_1
[
'bam_files'
]
.
append
(
arg_3
[
'bam_file'
]
)
arg_1
[
'bai_files'
]
.
append
(
find_bai_file
(
arg_3
[
'bam_file'
]
)
)
if
arg_5
and
os
.
path
.
exists
(
arg_5
)
:
arg_1
[
'mt_bams'
]
.
append
(
arg_3
[
'mt_bam'
]
)
arg_1
[
'mt_bais'
]
.
append
(
find_bai_file
(
arg_3
[
'mt_bam'
]
)
)
else
:
LOG
.
debug
(
"%s: no bam file found"
,
arg_3
[
'individual_id'
]
)
try
:
arg_6
=
arg_2
.
get
(
'genes'
,
[
]
)
if
len
(
arg_6
)
==
1
:
arg_7
=
arg_0
.
hgnc_gene
(
arg_2
[
'genes'
]
[
0
]
[
'hgnc_id'
]
)
if
arg_7
:
arg_8
=
arg_0
.
get_region_vcf
(
arg_1
,
gene_obj
=
arg_7
)
arg_1
[
'region_vcf_file'
]
=
arg_8
else
:
arg_1
[
'region_vcf_file'
]
=
elif
len
(
arg_6
)
>
1
:
arg_9
=
arg_2
[
'genes'
]
[
0
]
[
'common'
]
[
'chromosome'
]
arg_10
=
min
(
gene
[
'common'
]
[
'start'
]
for
gene
in
arg_2
[
'genes'
]
)
arg_11
=
max
(
gene
[
'common'
]
[
'end'
]
for
gene
in
arg_2
[
'genes'
]
)
arg_8
=
arg_0
.
get_region_vcf
(
arg_1
,
arg_9
=
arg_9
,
arg_10
=
arg_10
,
arg_11
=
arg_11
)
arg_1
[
'region_vcf_file'
]
=
arg_8
except
(
SyntaxError
,
Exception
)
:
LOG
.
warning
(
"skip VCF region for alignment view"
)

def Func(arg_0, arg_1, arg_2):
    """Pre-process case for the variant view.

    Adds information about files from case obj to variant

    Args:
        store(scout.adapter.MongoAdapter)
        case_obj(scout.models.Case)
        variant_obj(scout.models.Variant)
    """
    arg_1['bam_files'] = []
    arg_1['mt_bams'] = []
    arg_1['bai_files'] = []
    arg_1['mt_bais'] = []
    arg_1['sample_names'] = []
    for arg_3 in arg_1['individuals']:
        arg_4 = arg_3.get('bam_file')
        arg_5 = arg_3.get('mt_bam')
        arg_1['sample_names'].append(arg_3.get('display_name'))
        if arg_4 and os.path.exists(arg_4):
            arg_1['bam_files'].append(arg_3['bam_file'])
            arg_1['bai_files'].append(find_bai_file(arg_3['bam_file']))
        if arg_5 and os.path.exists(arg_5):
            arg_1['mt_bams'].append(arg_3['mt_bam'])
            arg_1['mt_bais'].append(find_bai_file(arg_3['mt_bam']))

        else:
            LOG.debug("%s: no bam file found", arg_3['individual_id'])

    try:
        arg_6 = arg_2.get('genes', [])
        if len(arg_6) == 1:
            arg_7 = arg_0.hgnc_gene(arg_2['genes'][0]['hgnc_id'])
            if arg_7:
                arg_8 = arg_0.get_region_vcf(arg_1, gene_obj=arg_7)
                arg_1['region_vcf_file'] = arg_8
            else:
                arg_1['region_vcf_file'] = None
        elif len(arg_6) > 1:
            arg_9 = arg_2['genes'][0]['common']['chromosome']
            arg_10 = min(gene['common']['start'] for gene in arg_2['genes'])
            arg_11 = max(gene['common']['end'] for gene in arg_2['genes'])
            # Create a reduced VCF with variants in the region
            arg_8 = arg_0.get_region_vcf(arg_1, arg_9=arg_9, arg_10=arg_10, arg_11=arg_11)
            arg_1['region_vcf_file'] = arg_8
    except (SyntaxError, Exception):
        LOG.warning("skip VCF region for alignment view")

Pre - process case for the variant view .


Get the reviews starting from last_item.

def Func(arg_0, arg_1, arg_2=None):
        """Get the Func starting from last_item."""

        arg_3 = arg_0._get_gerrit_cmd(arg_1, arg_2)

        logger.debug("Getting Func with command: %s", arg_3)
        arg_4 = arg_0.__execute(arg_3)
        arg_4 = str(arg_4, "UTF-8")

        return arg_4

Get the reviews starting from last_item .


def Func ( arg_0 ) : for arg_1 in list ( arg_0 ) : if not arg_1 . exists : arg_0 . remove ( arg_1 )

def Func(arg_0):
        '''Validate all the entries in the environment cache.'''

        for arg_1 in list(arg_0):
            if not arg_1.exists:
                arg_0.remove(arg_1)

Validate all the entries in the environment cache .


def Func(arg_0, arg_1):
        """Encodes the current span to thrift."""
        arg_2 = arg_1.build_v1_span()

        arg_3 = thrift.create_endpoint(
            arg_2.endpoint.port,
            arg_2.endpoint.service_name,
            arg_2.endpoint.ipv4,
            arg_2.endpoint.ipv6,
        )

        arg_4 = thrift.annotation_list_builder(
            arg_2.annotations,
            arg_3,
        )

        arg_5 = thrift.binary_annotation_list_builder(
            arg_2.binary_annotations,
            arg_3,
        )

        # Add sa/ca binary annotations
        if arg_1.remote_endpoint:
            arg_0.encode_remote_endpoint(
                arg_1.remote_endpoint,
                arg_1.kind,
                arg_5,
            )

        arg_6 = thrift.create_span(
            arg_2.id,
            arg_2.parent_id,
            arg_2.trace_id,
            arg_2.name,
            arg_4,
            arg_5,
            arg_2.timestamp,
            arg_2.duration,
        )

        arg_7 = thrift.span_to_bytes(arg_6)
        return arg_7


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
ApiClient
.
oneSchemaUrl
%
(
arg_0
.
host
,
"/draft"
,
arg_1
)
arg_4
=
{
"schemaDefinition"
:
arg_2
}
arg_5
=
requests
.
put
(
arg_3
,
auth
=
arg_0
.
credentials
,
headers
=
{
"Content-Type"
:
"application/json"
}
,
data
=
json
.
dumps
(
arg_4
)
,
verify
=
arg_0
.
verify
)
if
arg_5
.
status_code
==
200
:
arg_0
.
logger
.
debug
(
"Schema updated"
)
else
:
raise
ibmiotf
.
APIException
(
arg_5
.
status_code
,
"HTTP error updating schema"
,
arg_5
)
return
arg_5
.
json
(
)

def Func(arg_0, arg_1, arg_2):
        """
        Update a schema. Throws APIException on failure.
        """
        arg_3 = ApiClient.oneSchemaUrl % (arg_0.host, "/draft", arg_1)
        arg_4 = {"schemaDefinition": arg_2}
        arg_5 = requests.put(arg_3, auth=arg_0.credentials, headers={"Content-Type":"application/json"},
                           data=json.dumps(arg_4),  verify=arg_0.verify)
        if arg_5.status_code == 200:
            arg_0.logger.debug("Schema updated")
        else:
            raise ibmiotf.APIException(arg_5.status_code, "HTTP error updating schema", arg_5)
        return arg_5.json()

Update a schema . Throws APIException on failure .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 == None : del arg_0 . callbacks [ arg_2 ] else : arg_0 . callbacks [ arg_2 ] = arg_1

def Func(arg_0, arg_1, arg_2):
        """Adds a callback to our set of callbacks,
        or removes the callback with name if callback
        is None."""
        if arg_1 == None:
            del arg_0.callbacks[arg_2]
        else:
            arg_0.callbacks[arg_2] = arg_1

Adds a callback to our set of callbacks or removes the callback with name if callback is None .


(vcard_list, selected_address_books, search_terms,
                     target_uid)

def Func(arg_0, arg_1, arg_2,
                     arg_3):
    """Merge two contacts into one.

    :param vcard_list: the vcards from which to choose contacts for mergeing
    :type vcard_list: list of carddav_object.CarddavObject
    :param selected_address_books: the addressbooks to use to find the target
        contact
    :type selected_address_books: list(addressbook.AddressBook)
    :param search_terms: the search terms to find the target contact
    :type search_terms: str
    :param target_uid: the uid of the target contact or empty
    :type target_uid: str
    :returns: None
    :rtype: None

    """
    # Check arguments.
    if arg_3 != "" and arg_2 != "":
        print("You can not specify a target uid and target search terms for a "
              "merge.")
        sys.exit(1)
    # Find possible target contacts.
    if arg_3 != "":
        arg_4 = get_contacts(arg_1, arg_3,
                                     method="uid")
        # We require that the uid given can uniquely identify a contact.
        if len(arg_4) != 1:
            if not arg_4:
                print("Found no contact for target uid %s" % arg_3)
            else:
                print("Found multiple contacts for target uid %s" % arg_3)
                for arg_5 in arg_4:
                    print("    %s: %s" % (arg_5, arg_5.get_uid()))
            sys.exit(1)
    else:
        arg_4 = get_contact_list_by_user_selection(
            arg_1, arg_2, False)
    # get the source vcard, from which to merge
    arg_6 = choose_vcard_from_list("Select contact from which to merge",
                                          arg_0)
    if arg_6 is None:
        print("Found no source contact for merging")
        sys.exit(1)
    else:
        print("Merge from %s from address book %s\n\n"
              % (arg_6, arg_6.address_book))
    # get the target vcard, into which to merge
    arg_7 = choose_vcard_from_list("Select contact into which to merge",
                                          arg_4)
    if arg_7 is None:
        print("Found no target contact for merging")
        sys.exit(1)
    else:
        print("Merge into %s from address book %s\n\n"
              % (arg_7, arg_7.address_book))
    # merging
    if arg_6 == arg_7:
        print("The selected contacts are already identical")
    else:
        merge_existing_contacts(arg_6, arg_7, True)


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : super ( ApplicationSpecificInformation , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) arg_0 . application_namespace . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . application_data . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . is_oversized ( arg_6 ) arg_0 . validate ( )

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

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

        arg_0.application_namespace.Func(arg_6, arg_2=arg_2)
        arg_0.application_data.Func(arg_6, arg_2=arg_2)

        arg_0.is_oversized(arg_6)
        arg_0.validate()

Read the data encoding the ApplicationSpecificInformation object and
        decode it into its constituent parts.

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

Read the data encoding the ApplicationSpecificInformation object and decode it into its constituent parts .


def Func ( arg_0 ) : for arg_1 in reversed ( arg_0 . compilers ) : if arg_1 . result_mimetype : return arg_1 . result_mimetype return None

def Func(arg_0):
        """Implicit MIME type of the asset by its compilers."""
        for arg_1 in reversed(arg_0.compilers):
            if arg_1.result_mimetype:
                return arg_1.result_mimetype
        return None

Implicit MIME type of the asset by its compilers .


def
Func
(
arg_0
,
arg_1
)
:
subprocess
.
call
(
[
"docker"
,
"exec"
,
arg_0
.
sparkContainerID
,
"rm"
,
"-r"
,
"/ephemeral/spark"
]
)
subprocess
.
call
(
[
"docker"
,
"Func"
,
arg_0
.
sparkContainerID
]
)
subprocess
.
call
(
[
"docker"
,
"rm"
,
arg_0
.
sparkContainerID
]
)
_log
.
info
(
"Stopped Spark worker."
)
subprocess
.
call
(
[
"docker"
,
"exec"
,
arg_0
.
hdfsContainerID
,
"rm"
,
"-r"
,
"/ephemeral/hdfs"
]
)
subprocess
.
call
(
[
"docker"
,
"Func"
,
arg_0
.
hdfsContainerID
]
)
subprocess
.
call
(
[
"docker"
,
"rm"
,
arg_0
.
hdfsContainerID
]
)
_log
.
info
(
"Stopped HDFS datanode."
)
return

def Func(arg_0, arg_1):
        """
        Stop spark and hdfs worker containers

        :param job: The underlying job.
        """

        subprocess.call(["docker", "exec", arg_0.sparkContainerID, "rm", "-r", "/ephemeral/spark"])
        subprocess.call(["docker", "Func", arg_0.sparkContainerID])
        subprocess.call(["docker", "rm", arg_0.sparkContainerID])
        _log.info("Stopped Spark worker.")

        subprocess.call(["docker", "exec", arg_0.hdfsContainerID, "rm", "-r", "/ephemeral/hdfs"])
        subprocess.call(["docker", "Func", arg_0.hdfsContainerID])
        subprocess.call(["docker", "rm", arg_0.hdfsContainerID])
        _log.info("Stopped HDFS datanode.")

        return


(self, method, url, params=None, headers=None, data=None)

async def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None):
        """Make an HTTP request.

        Automatically uses configured HTTP proxy, and adds Google authorization
        header and cookies.

        Failures will be retried MAX_RETRIES times before raising NetworkError.

        Args:
            method (str): Request method.
            url (str): Request URL.
            params (dict): (optional) Request query string parameters.
            headers (dict): (optional) Request headers.
            data: (str): (optional) Request body data.

        Returns:
            FetchResponse: Response data.

        Raises:
            NetworkError: If the request fails.
        """
        logger.debug('Sending request %s %s:\n%r', arg_1, arg_2, arg_5)
        for arg_6 in range(MAX_RETRIES):
            try:
                async with arg_0.Func_raw(arg_1, arg_2, arg_3=arg_3,
                                          arg_4=arg_4, arg_5=arg_5) as res:
                    async with async_timeout.timeout(REQUEST_TIMEOUT):
                        body = await res.read()
                logger.debug('Received response %d %s:\n%r',
                             res.status, res.reason, body)
            except asyncio.TimeoutError:
                error_msg = 'Request timed out'
            except aiohttp.ServerDisconnectedError as err:
                error_msg = 'Server disconnected error: {}'.format(err)
            except (aiohttp.ClientError, ValueError) as err:
                error_msg = 'Request connection error: {}'.format(err)
            else:
                break
            logger.info('Request attempt %d failed: %s', arg_6, error_msg)
        else:
            logger.info('Request failed after %d attempts', MAX_RETRIES)
            raise exceptions.NetworkError(error_msg)

        if res.status != 200:
            logger.info('Request returned unexpected status: %d %s',
                        res.status, res.reason)
            raise exceptions.NetworkError(
                'Request return unexpected status: {}: {}'
                .format(res.status, res.reason)
            )

        return FetchResponse(res.status, body)


def Func(arg_0, arg_1):
        """
        Called when an individual tool completes execution.

        :param tool: the name of the tool that completed
        :type tool: str
        """

        with arg_0._lock:
            if arg_1 in arg_0.current_tools:
                arg_0.current_tools.remove(arg_1)
                arg_0.completed_tools.append(arg_1)

Called when an individual tool completes execution .


def Func(arg_0):
        """readline hook to be used at the start of each line.

        Currently it handles auto-indent only."""

        if arg_0.rl_do_indent:
            arg_0.readline.insert_text(arg_0._indent_current_str())
        if arg_0.rl_next_input is not None:
            arg_0.readline.insert_text(arg_0.rl_next_input)
            arg_0.rl_next_input = None

readline hook to be used at the start of each line .


def Func ( arg_0 , arg_1 ) : arg_2 = ACCOUNTS_API . format ( arg_1 ) + "/sso_settings" return CanvasSSOSettings ( data = arg_0 . _get_resource ( arg_2 ) )

def Func(arg_0, arg_1):
        """
        Return the authentication settings for the passed account_id.

        https://canvas.instructure.com/doc/api/authentication_providers.html#method.account_authorization_configs.show_sso_settings
        """
        arg_2 = ACCOUNTS_API.format(arg_1) + "/sso_settings"
        return CanvasSSOSettings(data=arg_0._get_resource(arg_2))

Return the authentication settings for the passed account_id .


def Func ( arg_0 ) : arg_1 = decimal . ExtendedContext . next_plus ( decimal . Decimal ( '5.0' ) ) arg_2 = [ parse_content_type ( arg_3 ) for arg_3 in parse_list ( arg_0 ) ] for arg_3 in arg_2 : arg_4 = arg_3 . parameters . pop ( 'q' , None ) if arg_4 is None : arg_4 = '1.0' elif float ( arg_4 ) == 1.0 : arg_4 = float ( arg_1 ) arg_1 = arg_1 . next_minus ( ) arg_3 . quality = float ( arg_4 ) def ordering ( arg_6 , arg_7 ) : if arg_6 . quality != arg_7 . quality : return arg_7 . quality - arg_6 . quality if arg_6 == arg_7 : return 0 if arg_6 > arg_7 : return - 1 return 1 return sorted ( arg_2 , key = functools . cmp_to_key ( ordering ) )

def Func(arg_0):
    """Parse an HTTP accept-like header.

    :param str header_value: the header value to parse
    :return: a :class:`list` of :class:`.ContentType` instances
        in decreasing quality order.  Each instance is augmented
        with the associated quality as a ``float`` property
        named ``quality``.

    ``Accept`` is a class of headers that contain a list of values
    and an associated preference value.  The ever present `Accept`_
    header is a perfect example.  It is a list of content types and
    an optional parameter named ``q`` that indicates the relative
    weight of a particular type.  The most basic example is::

        Accept: audio/*;q=0.2, audio/basic

    Which states that I prefer the ``audio/basic`` content type
    but will accept other ``audio`` sub-types with an 80% mark down.

    .. _Accept: http://tools.ietf.org/html/rfc7231#section-5.3.2

    """
    arg_1 = decimal.ExtendedContext.next_plus(decimal.Decimal('5.0'))
    arg_2 = [parse_content_type(arg_3)
               for arg_3 in parse_list(arg_0)]
    for arg_3 in arg_2:
        arg_4 = arg_3.parameters.pop('q', None)
        if arg_4 is None:
            arg_4 = '1.0'
        elif float(arg_4) == 1.0:
            arg_4 = float(arg_1)
            arg_1 = arg_1.next_minus()
        arg_3.quality = float(arg_4)

    def ordering(arg_6, arg_7):
        """
        Method for sorting the header values

        :param mixed left:
        :param mixed right:
        :rtype: mixed

        """
        if arg_6.quality != arg_7.quality:
            return arg_7.quality - arg_6.quality
        if arg_6 == arg_7:
            return 0
        if arg_6 > arg_7:
            return -1
        return 1

    return sorted(arg_2, key=functools.cmp_to_key(ordering))


(self, config_file, path=None, overwrite=False)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False ) : arg_4 = os . path . join ( arg_0 . location , arg_1 ) if os . path . isfile ( arg_4 ) and not arg_3 : return False if arg_2 is None : arg_2 = os . path . join ( get_ipython_package_dir ( ) , u'config' , u'profile' , u'default' ) arg_5 = os . path . join ( arg_2 , arg_1 ) shutil . copy ( arg_5 , arg_4 ) return True

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
        """Copy a default config file into the active profile directory.

        Default configuration files are kept in :mod:`IPython.config.default`.
        This function moves these from that location to the working profile
        directory.
        """
        arg_4 = os.path.join(arg_0.location, arg_1)
        if os.path.isfile(arg_4) and not arg_3:
            return False
        if arg_2 is None:
            arg_2 = os.path.join(get_ipython_package_dir(), u'config', u'profile', u'default')
        arg_5 = os.path.join(arg_2, arg_1)
        shutil.copy(arg_5, arg_4)
        return True

Copy a default config file into the active profile directory .


(self, x, batch_size=None, verbose=None, is_distributed=False)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=False):
        """Generates output Funcions for the input samples,
        processing the samples in a batched way.

        # Arguments
            x: the input data, as a Numpy array or list of Numpy array for local mode.
               as RDD[Sample] for distributed mode
            is_distributed: used to control run in local or cluster. the default value is False
        # Returns
            A Numpy array or RDD[Sample] of Funcions.
        """
        if arg_2 or arg_3:
            raise Exception("we don't support batch_size or verbose for now")
        if arg_4:
            if isinstance(arg_1, np.ndarray):
                arg_5 = to_sample_rdd(arg_1, np.zeros([arg_1.shape[0]]))
            #  np.asarray(self.bmodel.Func(x_rdd).collect())
            elif isinstance(arg_1, RDD):
                arg_5 = arg_1
            return arg_0.bmodel.Func(arg_5)
        else:
            if isinstance(arg_1, np.ndarray):
                return arg_0.bmodel.Func_local(arg_1)
        raise Exception("not supported type: %s" % arg_1)

Generates output predictions for the input samples,
        processing the samples in a batched way.

        # Arguments
            x: the input data, as a Numpy array or list of Numpy array for local mode.
               as RDD[Sample] for distributed mode
            is_distributed: used to control run in local or cluster. the default value is False
        # Returns
            A Numpy array or RDD[Sample] of predictions.

Generates output predictions for the input samples processing the samples in a batched way .


def Func ( arg_0 : arg_1 [ arg_2 . ndarray ] ) -> float : arg_4 = arg_2 . mean ( arg_0 ) return float ( arg_2 . exp ( arg_4 ) )

def Func(arg_0: arg_1[arg_2.ndarray]) -> float:
    """ Calculates perplexity by loss

    Args:
        losses: list of numpy arrays of model losses

    Returns:
        perplexity : float
    """
    arg_4 = arg_2.mean(arg_0)
    return float(arg_2.exp(arg_4))


(src, target_tree_alias=None, parent_tree_item_alias=None, include_trees=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
    """Returns a structure describing a dynamic sitetree.utils
    The structure can be built from various sources,

    :param str|iterable src: If a string is passed to `src`, it'll be treated as the name of an app,
        from where one want to import sitetrees definitions. `src` can be an iterable
        of tree definitions (see `sitetree.toolbox.tree()` and `item()` functions).

    :param str|unicode target_tree_alias: Static tree alias to attach items from dynamic trees to.

    :param str|unicode parent_tree_item_alias: Tree item alias from a static tree to attach items from dynamic trees to.

    :param list include_trees: Sitetree aliases to filter `src`.

    :rtype: dict
    """
    def result(arg_4=arg_0):
        if arg_3 is not None:
            arg_4 = [tree for tree in arg_4 if tree.alias in arg_3]

        return {
            'app': arg_0,
            'sitetrees': arg_4,
            'tree': arg_1,
            'parent_item': arg_2}

    if isinstance(arg_0, six.string_types):
        # Considered to be an application name.
        try:
            arg_5 = import_app_sitetree_module(arg_0)
            return None if arg_5 is None else result(getattr(arg_5, 'sitetrees', None))

        except ImportError as e:
            if settings.DEBUG:
                warnings.warn('Unable to register dynamic sitetree(s) for `%s` application: %s. ' % (arg_0, e))
            return None

    return result()

Returns a structure describing a dynamic sitetree . utils The structure can be built from various sources


return param_name, ParameterInfo(param_type, [], desc)

def Func(arg_0, arg_1=False):
    """Parse a single typed parameter statement."""

    arg_2, arg_3, arg_4 = arg_0.partition(':')
    if not arg_1:
        arg_4 = None
    else:
        arg_4 = arg_4.lstrip()

    if arg_3 == "":
        raise ValidationError("Invalid parameter declaration in docstring, missing colon", declaration=arg_0)

    arg_5, arg_6, arg_7 = arg_2.partition(' ')
    if len(arg_7) < 2 or arg_7[0] != '(' or arg_7[-1] != ')':
        raise ValidationError("Invalid parameter type string not enclosed in ( ) characters", param_string=arg_2, type_string=arg_7)

    arg_7 = arg_7[1:-1]
    return arg_5, ParameterInfo(arg_7, [], arg_4)

Parse a single typed parameter statement .


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

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

        Returns:
            Func_controls: Telegram representation of RichMessage instance nested
                controls.
        """
        arg_1 = [control.Func() for control in arg_0.controls]
        return arg_1

Returns list of Telegram compatible states of the RichMessage
        instance nested controls.

        Returns:
            telegram_controls: Telegram representation of RichMessage instance nested
                controls.

Returns list of Telegram compatible states of the RichMessage instance nested controls .


(input_file, layers=0, verbose=False, lazy=False)

def Func(arg_0, arg_1=0, arg_2=False, arg_3=False):
    """
    Parse a savefile as a pcap_savefile instance. Returns the savefile
    on success and None on failure. Verbose mode prints additional information
    about the file's processing. layers defines how many layers to descend and
    decode the packet. input_file should be a Python file object.
    """
    global arg_5
    arg_4 = arg_5
    arg_5 = arg_2

    __TRACE__('[+] attempting to load {:s}', (arg_0.name,))

    arg_6 = _Func_header(arg_0)
    if __validate_header__(arg_6):
        __TRACE__('[+] found valid header')
        if arg_3:
            arg_7 = _generate_packets(arg_0, arg_6, arg_1)
            __TRACE__('[+] created packet generator')
        else:
            arg_7 = _load_packets(arg_0, arg_6, arg_1)
            __TRACE__('[+] loaded {:d} packets', (len(arg_7),))
        arg_8 = pcap_savefile(arg_6, arg_7)
        __TRACE__('[+] finished loading savefile.')
    else:
        __TRACE__('[!] invalid savefile')
        arg_8 = None

    arg_5 = arg_4
    return arg_8

Parse a savefile as a pcap_savefile instance . Returns the savefile on success and None on failure . Verbose mode prints additional information about the file s processing . layers defines how many layers to descend and decode the packet . input_file should be a Python file object .


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
[
]
if
arg_1
:
for
arg_3
in
arg_1
:
arg_4
=
safe_name
(
arg_3
)
if
arg_4
not
in
arg_0
.
_column_map
:
raise
GiraffeTypeError
(
"Column '{}' does not exist"
.
format
(
arg_3
)
)
if
arg_4
in
arg_2
:
continue
arg_2
.
append
(
arg_4
)
arg_0
.
_filtered_columns
=
arg_2

def Func(arg_0, arg_1=None):
        """
        Set the names of columns to be used when iterating through the list,
        retrieving names, etc.

        :param list names: A list of names to be used, or :code:`None` for all
        """
        arg_2 = []
        if arg_1:
            for arg_3 in arg_1:
                arg_4 = safe_name(arg_3)
                if arg_4 not in arg_0._column_map:
                    raise GiraffeTypeError("Column '{}' does not exist".format(arg_3))
                if arg_4 in arg_2:
                    continue
                arg_2.append(arg_4)
        arg_0._filtered_columns = arg_2

Set the names of columns to be used when iterating through the list retrieving names etc .


(key_name,
            value,
            description,
            meta,
            modify,
            add,
            lock,
            key_type,
            stash,
            passphrase,
            backend)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
,
arg_8
,
arg_9
,
arg_10
)
:
arg_8
=
_get_stash
(
arg_10
,
arg_8
,
arg_9
)
try
:
click
.
echo
(
'Stashing {0} key...'
.
format
(
arg_7
)
)
arg_8
.
put
(
name
=
arg_0
,
arg_1
=
_build_dict_from_key_value
(
arg_1
)
,
arg_4
=
arg_4
,
metadata
=
_build_dict_from_key_value
(
arg_3
)
,
arg_2
=
arg_2
,
arg_6
=
arg_6
,
arg_7
=
arg_7
,
arg_5
=
arg_5
)
click
.
echo
(
'Key stashed successfully'
)
except
GhostError
as
ex
:
sys
.
exit
(
ex
)

def Func(arg_0,
            arg_1,
            arg_2,
            arg_3,
            arg_4,
            arg_5,
            arg_6,
            arg_7,
            arg_8,
            arg_9,
            arg_10):
    """Insert a key to the stash

    `KEY_NAME` is the name of the key to insert

    `VALUE` is a key=value argument which can be provided multiple times.
    it is the encrypted value of your key
    """
    arg_8 = _get_stash(arg_10, arg_8, arg_9)

    try:
        click.echo('Stashing {0} key...'.format(arg_7))
        arg_8.put(
            name=arg_0,
            arg_1=_build_dict_from_key_value(arg_1),
            arg_4=arg_4,
            metadata=_build_dict_from_key_value(arg_3),
            arg_2=arg_2,
            arg_6=arg_6,
            arg_7=arg_7,
            arg_5=arg_5)
        click.echo('Key stashed successfully')
    except GhostError as ex:
        sys.exit(ex)


return dict(
        bgcolor = style.background_color,
        select = style.highlight_color,
        fgcolor = fgcolor
    )

def Func ( arg_0 ) : arg_1 = get_style_by_name ( arg_0 ) arg_2 = arg_1 . style_for_token ( Token . Text ) [ 'color' ] or '' if len ( arg_2 ) in ( 3 , 6 ) : try : int ( arg_2 , 16 ) except TypeError : pass else : arg_2 = "#" + arg_2 return dict ( bgcolor = arg_1 . background_color , select = arg_1 . highlight_color , arg_2 = arg_2 )

def Func(arg_0):
    """Construct the keys to be used building the base stylesheet
    from a templatee."""
    arg_1 = get_style_by_name(arg_0)
    arg_2 = arg_1.style_for_token(Token.Text)['color'] or ''
    if len(arg_2) in (3,6):
        # could be 'abcdef' or 'ace' hex, which needs '#' prefix
        try:
            int(arg_2, 16)
        except TypeError:
            pass
        else:
            arg_2 = "#"+arg_2

    return dict(
        bgcolor = arg_1.background_color,
        select = arg_1.highlight_color,
        arg_2 = arg_2
    )

Construct the keys to be used building the base stylesheet from a templatee .


def Func(arg_0: arg_1, arg_2: arg_1, arg_3) -> arg_1:
    """cat two strings but handle \n for tabulation"""
    arg_4 = arg_0
    arg_5 = arg_2
    if not isinstance(arg_2, arg_1):
        arg_5 = arg_1(arg_2)
    for arg_6 in list(arg_5):
        if len(arg_4) > 0 and arg_4[-1] == '\n':
            arg_4 += (indentable.char_indent * indentable.num_indent) * \
                   (arg_3 - 1) + arg_6
        else:
            arg_4 += arg_6
    return arg_4

cat two strings but handle \ n for tabulation


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 0 ) : arg_4 = arg_0 . strs . get ( arg_1 , CommandChainDispatcher ( ) ) arg_4 . add ( arg_2 , arg_3 ) arg_0 . strs [ arg_1 ] = arg_4

def Func(arg_0, arg_1, arg_2, arg_3= 0 ):
        """ Adds a target 'string' for dispatching """

        arg_4 = arg_0.strs.get(arg_1, CommandChainDispatcher())
        arg_4.add(arg_2,arg_3)
        arg_0.strs[arg_1] = arg_4


def Func(arg_0, arg_1='../weight/model_weight.h5', arg_2=2):
    """
    Given path to processed BEST dataset,
    train CNN model for words beginning alongside with
    character label encoder and character type label encoder

    Input
    =====
    best_processed_path: str, path to processed BEST dataset
    weight_path: str, path to weight path file
    verbose: int, verbost option for training Keras model

    Output
    ======
    model: keras model, keras model for tokenize prediction
    """

    arg_3, arg_4, arg_5 = prepare_feature(arg_0, option='train')
    arg_6, arg_7, arg_8 = prepare_feature(arg_0, option='test')

    arg_9 = False
    if os.path.isdir(os.path.join(arg_0, 'val')):
        arg_9 = True
        arg_10, arg_11, arg_12 = prepare_feature(arg_0, option='val')

    if not os.path.isdir(os.path.dirname(arg_1)):
        os.makedirs(os.path.dirname(arg_1)) # make directory if weight does not exist

    arg_13 = [
        ReduceLROnPlateau(),
        ModelCheckpoint(
            arg_1,
            save_best_only=True,
            save_weights_only=True,
            monitor='val_loss',
            mode='min',
            arg_2=1
        )
    ]

    # train model
    arg_14 = get_convo_nn2()
    arg_15 = [(10, 256), (3, 512), (3, 2048), (3, 4096), (3, 8192)]
    for (arg_16, arg_17) in arg_15:
        print("train with {} epochs and {} batch size".format(arg_16, arg_17))
        if arg_9:
            arg_14.fit([arg_3, arg_4], arg_5,
                      arg_16=arg_16, arg_17=arg_17,
                      arg_2=arg_2,
                      callbacks=arg_13,
                      validation_data=([arg_10, arg_11], arg_12))
        else:
            arg_14.fit([arg_3, arg_4], arg_5,
                      arg_16=arg_16, arg_17=arg_17,
                      arg_2=arg_2,
                      callbacks=arg_13)
    return arg_14

Given path to processed BEST dataset train CNN model for words beginning alongside with character label encoder and character type label encoder


def Func ( arg_0 ) : try : ast . literal_eval ( arg_0 ) return True except ( SyntaxError , ValueError ) : pass if arg_0 . strip ( ) in [ 'dict()' , 'list()' , 'set()' ] : return True return re . match ( r'^\w+\s*$' , arg_0 )

def Func(arg_0):
    """Return True if value is a literal or a name."""
    try:
        ast.literal_eval(arg_0)
        return True
    except (SyntaxError, ValueError):
        pass

    if arg_0.strip() in ['dict()', 'list()', 'set()']:
        return True

    # Support removal of variables on the right side. But make sure
    # there are no dots, which could mean an access of a property.
    return re.match(r'^\w+\s*$', arg_0)

Return True if value is a literal or a name .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_0 . losses = [ ] arg_0 . add_loss ( * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        '''Clear the current loss functions from the network and add a new one.

        All parameters and keyword arguments are passed to :func:`add_loss`
        after clearing the current losses.
        '''
        arg_0.losses = []
        arg_0.add_loss(*arg_1, **arg_2)

Clear the current loss functions from the network and add a new one .


def Func(arg_0, arg_1):
        """ Returns a QTextCharFormat for token or None.
        """
        if arg_1 in arg_0._formats:
            return arg_0._formats[arg_1]

        if arg_0._style is None:
            arg_2 = arg_0.Func_from_document(arg_1, arg_0._document)
        else:
            arg_2 = arg_0.Func_from_style(arg_1, arg_0._style)

        arg_0._formats[arg_1] = arg_2
        return arg_2

Returns a QTextCharFormat for token or None .


return "\n".join(indent_str + line for line in text2.split("\n"))

def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
textwrap
.
Func
(
arg_1
)
if
arg_0
==
0
:
return
arg_2
arg_3
=
" "
*
arg_0
return
"\n"
.
join
(
arg_3
+
arg_4
for
arg_4
in
arg_2
.
split
(
"\n"
)
)

def Func(arg_0, arg_1):
    """
    Dedent text to the specific indentation level.

    :param ind: common indentation level for the resulting text (number of spaces to append to every line)
    :param text: text that should be transformed.
    :return: ``text`` with all common indentation removed, and then the specified amount of indentation added.
    """
    arg_2 = textwrap.Func(arg_1)
    if arg_0 == 0:
        return arg_2
    arg_3 = " " * arg_0
    return "\n".join(arg_3 + arg_4 for arg_4 in arg_2.split("\n"))

Dedent text to the specific indentation level .


def Func ( arg_0 : arg_1 . Map , arg_3 : arg_4 , arg_5 : arg_6 ) -> arg_1 . Map : return arg_0 . assoc ( arg_3 , arg_5 )

def Func(arg_0: arg_1.Map, arg_3: arg_4, arg_5: arg_6) -> arg_1.Map:
        """Swap the methods atom to include method with key."""
        return arg_0.assoc(arg_3, arg_5)

Swap the methods atom to include method with key .


def Func(arg_0):
    """
    Creates a generator returning tuples of information about each message in
    a byte string of data from a TLS handshake record

    :param data:
        A byte string of a TLS handshake record data

    :return:
        A generator that yields 2-element tuples:
        [0] Byte string of message type
        [1] Byte string of message data
    """

    arg_1 = 0
    arg_2 = len(arg_0)
    while arg_1 < arg_2:
        arg_3 = int_from_bytes(arg_0[arg_1 + 1:arg_1 + 4])
        yield (
            arg_0[arg_1:arg_1 + 1],
            arg_0[arg_1 + 4:arg_1 + 4 + arg_3]
        )
        arg_1 += 4 + arg_3


def Func ( arg_0 ) : global arg_3 arg_3 . clear ( ) for arg_1 , arg_2 in arg_0 . items ( ) : arg_3 [ arg_1 ] = arg_2 clearRedisPools ( )

def Func( arg_0 ):
	'''
		Func - Sets the default parameters used when connecting to Redis.

		  This should be the args to redis.Redis in dict (kwargs) form.

		  @param connectionParams <dict> - A dict of connection parameters.
		    Common keys are:

		       host <str> - hostname/ip of Redis server (default '127.0.0.1')
		       port <int> - Port number			(default 6379)
		       db  <int>  - Redis DB number		(default 0)

		   Omitting any of those keys will ensure the default value listed is used.

		  This connection info will be used by default for all connections to Redis, unless explicitly set otherwise.
		  The common way to override is to define REDIS_CONNECTION_PARAMS on a model, or use AltConnectedModel = MyModel.connectAlt( PARAMS )

		  Any omitted fields in these connection overrides will inherit the value from the global default.

		  For example, if your global default connection params define host = 'example.com', port=15000, and db=0,
		    and then one of your models has

		       REDIS_CONNECTION_PARAMS = { 'db' : 1 }

		    as an attribute, then that model's connection will inherit host='example.com" and port=15000 but override db and use db=1

		    NOTE: Calling this function will clear the connection_pool attribute of all stored managed connections, disconnect all managed connections,
		      and close-out the connection pool.
		     It may not be safe to call this function while other threads are potentially hitting Redis (not that it would make sense anyway...)

		     @see clearRedisPools   for more info
	'''
	global arg_3
	arg_3.clear()

	for arg_1, arg_2 in arg_0.items():
		arg_3[arg_1] = arg_2

	clearRedisPools()

setDefaultRedisConnectionParams - Sets the default parameters used when connecting to Redis.

		  This should be the args to redis.Redis in dict (kwargs) form.

		  @param connectionParams <dict> - A dict of connection parameters.
		    Common keys are:

		       host <str> - hostname/ip of Redis server (default '127.0.0.1')
		       port <int> - Port number			(default 6379)
		       db  <int>  - Redis DB number		(default 0)

		   Omitting any of those keys will ensure the default value listed is used.

		  This connection info will be used by default for all connections to Redis, unless explicitly set otherwise.
		  The common way to override is to define REDIS_CONNECTION_PARAMS on a model, or use AltConnectedModel = MyModel.connectAlt( PARAMS )

		  Any omitted fields in these connection overrides will inherit the value from the global default.

		  For example, if your global default connection params define host = 'example.com', port=15000, and db=0,
		    and then one of your models has

		       REDIS_CONNECTION_PARAMS = { 'db' : 1 }

		    as an attribute, then that model's connection will inherit host='example.com" and port=15000 but override db and use db=1

		    NOTE: Calling this function will clear the connection_pool attribute of all stored managed connections, disconnect all managed connections,
		      and close-out the connection pool.
		     It may not be safe to call this function while other threads are potentially hitting Redis (not that it would make sense anyway...)

		     @see clearRedisPools   for more info

setDefaultRedisConnectionParams - Sets the default parameters used when connecting to Redis .


def
Func
(
arg_0
)
:
arg_1
=
{
"User-Agent"
:
"kFlame 1.0"
}
arg_2
=
arg_0
.
_get_password_url
(
)
if
arg_2
and
arg_2
in
arg_0
.
_settings
[
"authorizations"
]
:
arg_1
[
"Authorization"
]
=
arg_0
.
_settings
[
"authorizations"
]
[
arg_2
]
return
arg_1

def Func(arg_0):
        """ Get headers.

        Returns:
            tuple: Headers
        """
        arg_1 = {
            "User-Agent": "kFlame 1.0"
        }

        arg_2 = arg_0._get_password_url()
        if arg_2 and arg_2 in arg_0._settings["authorizations"]:
            arg_1["Authorization"] = arg_0._settings["authorizations"][arg_2]

        return arg_1

Get headers.

        Returns:
            tuple: Headers


Return the arguments for a trampolined function. If the function
        that is being trampolined has varargs, unroll the final argument if
        it is a sequence.

def Func ( arg_0 ) -> Tuple : if not arg_0 . _has_varFunc : return arg_0 . _Func try : arg_1 = arg_0 . _Func [ - 1 ] if isinstance ( arg_1 , ISeq ) : arg_2 = arg_0 . _Func [ : - 1 ] return tuple ( itertools . chain ( arg_2 , arg_1 ) ) return arg_0 . _Func except IndexError : return ( )

def Func(arg_0) -> Tuple:
        """Return the arguments for a trampolined function. If the function
        that is being trampolined has varFunc, unroll the final argument if
        it is a sequence."""
        if not arg_0._has_varFunc:
            return arg_0._Func

        try:
            arg_1 = arg_0._Func[-1]
            if isinstance(arg_1, ISeq):
                arg_2 = arg_0._Func[:-1]
                return tuple(itertools.chain(arg_2, arg_1))
            return arg_0._Func
        except IndexError:
            return ()

Return the arguments for a trampolined function . If the function that is being trampolined has varargs unroll the final argument if it is a sequence .


(self, resource=None, type=None, actorId=None, _from=None, to=None,
             max=None, **request_parameters)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None, arg_5=None,
             arg_6=None, **arg_7):
        """List events.

        List events in your organization. Several query parameters are
        available to filter the response.

        Note: `from` is a keyword in Python and may not be used as a variable
        name, so we had to use `_from` instead.

        This method supports Webex Teams's implementation of RFC5988 Web
        Linking to provide pagination support.  It returns a generator
        container that incrementally yields all events returned by the
        query.  The generator will automatically request additional 'pages' of
        responses from Wevex as needed until all responses have been returned.
        The container makes the generator safe for reuse.  A new API call will
        be made, using the same parameters that were specified when the
        generator was created, every time a new iterator is requested from the
        container.

        Args:
            resource(basestring): Limit results to a specific resource type.
                Possible values: "messages", "memberships".
            type(basestring): Limit results to a specific event type. Possible
                values: "created", "updated", "deleted".
            actorId(basestring): Limit results to events performed by this
                person, by ID.
            _from(basestring): Limit results to events which occurred after a
                date and time, in ISO8601 format (yyyy-MM-dd'T'HH:mm:ss.SSSZ).
            to(basestring): Limit results to events which occurred before a
                date and time, in ISO8601 format (yyyy-MM-dd'T'HH:mm:ss.SSSZ).
            max(int): Limit the maximum number of items returned from the Webex
                Teams service per request.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            GeneratorContainer: A GeneratorContainer which, when iterated,
            yields the events returned by the Webex Teams query.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.

        """
        check_type(arg_1, basestring)
        check_type(arg_2, basestring)
        check_type(arg_3, basestring)
        check_type(arg_4, basestring)
        check_type(arg_5, basestring)
        check_type(arg_6, int)

        arg_8 = dict_from_items_with_values(
            arg_7,
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=arg_6,
        )

        if arg_4:
            arg_8["from"] = arg_8.pop("_from")

        # API request - get items
        arg_9 = arg_0._session.get_items(API_ENDPOINT, arg_8=arg_8)

        # Yield event objects created from the returned items JSON objects
        for arg_10 in arg_9:
            yield arg_0._object_factory(OBJECT_TYPE, arg_10)


def Func ( arg_0 , arg_1 ) : arg_2 = os . path . splitext ( arg_1 ) [ 1 ] . lower ( ) if arg_2 . startswith ( '.' ) : arg_2 = arg_2 [ 1 : ] return arg_0 . suffix == arg_2

def Func(arg_0, arg_1):
        """Primitive queuing system detection; only looks at suffix at the moment."""
        arg_2 = os.path.splitext(arg_1)[1].lower()
        if arg_2.startswith('.'):
            arg_2 = arg_2[1:]
        return arg_0.suffix == arg_2

Primitive queuing system detection ; only looks at suffix at the moment .


def Func(arg_0, arg_1, arg_2):
        """
        Determines if there's enough space to load the target database.
        """
        from fabric import state
        from fabric.task_utils import crawl

        arg_3 = crawl(arg_1, state.commands)
        assert arg_3, 'Unknown source role: %s' % arg_1

        arg_4 = crawl(arg_2, state.commands)
        assert arg_4, 'Unknown destination role: %s' % arg_1

        # Get source database size.
        arg_3()
        arg_5.host_string = arg_5.hosts[0]
        arg_7 = arg_0.get_size()

        # Get target database size, if any.
        arg_4()
        arg_5.host_string = arg_5.hosts[0]
        try:
            arg_8 = arg_0.get_size()
        except (ValueError, TypeError):
            arg_8 = 0

        # Get target host disk size.
        arg_9 = arg_0.get_free_space()

        # Deduct existing database size, because we'll be deleting it.
        arg_10 = arg_9 + arg_8 - arg_7
        arg_11, arg_12 = pretty_bytes(arg_10)

        arg_13 = arg_10 >= 0
        if arg_0.verbose:
            print('src_db_size:', pretty_bytes(arg_7))
            print('dst_db_size:', pretty_bytes(arg_8))
            print('dst_free_space:', pretty_bytes(arg_9))
            print
            if arg_13:
                print('Viable! There will be %.02f %s of disk space left.' % (arg_11, arg_12))
            else:
                print('Not viable! We would be %.02f %s short.' % (arg_11, arg_12))

        return arg_13

Determines if there s enough space to load the target database .


def Func(arg_0, arg_1=None, arg_2=None):
    """Receiver for request-accepted signal to send email notification."""
    arg_3, arg_4 = get_record(arg_0.recid)
    _send_notification(
        arg_0.sender_email,
        _("Access request accepted"),
        "zenodo_accessrequests/emails/accepted.tpl",
        arg_0=arg_0,
        arg_4=arg_4,
        arg_3=arg_3,
        record_link=arg_0.link.get_absolute_url('invenio_records_ui.recid'),
        arg_1=arg_1,
        arg_2=arg_2,
    )

Receiver for request - accepted signal to send email notification .


def Func(arg_0, arg_1):
  """
  Function for running binary search on a sorted list.

  :param arr: (list) a sorted list of integers to search
  :param val: (int)  a integer to search for in the sorted array
  :returns: (int) the index of the element if it is found and -1 otherwise.
  """
  arg_2 = bisect_left(arg_0, arg_1)
  if arg_2 != len(arg_0) and arg_0[arg_2] == arg_1:
    return arg_2
  return -1

Function for running binary search on a sorted list .


Returns a zero-length range located just after the end of this range.

return Range(self.source_buffer, self.end_pos, self.end_pos,
                     expanded_from=self.expanded_from)

def Func(arg_0):
        """
        Returns a zero-length range located just after the Func of this range.
        """
        return Range(arg_0.source_buffer, arg_0.Func_pos, arg_0.Func_pos,
                     expanded_from=arg_0.expanded_from)

Returns a zero - length range located just after the end of this range .


def Func ( arg_0 ) : import pandas as pd return pd . Series ( arg_0 ) . dt . weekofyear . values

def Func(arg_0):
    """Returns the week ordinal of the year.

    :returns: an expression containing the week ordinal of the year, extracted from a datetime column.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.weekofyear
    Expression = Func(date)
    Length: 3 dtype: int64 (expression)
    -----------------------------------
    0  42
    1   6
    2  46
    """
    import pandas as pd
    return pd.Series(arg_0).dt.weekofyear.values

Returns the week ordinal of the year.

    :returns: an expression containing the week ordinal of the year, extracted from a datetime column.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.weekofyear
    Expression = dt_weekofyear(date)
    Length: 3 dtype: int64 (expression)
    -----------------------------------
    0  42
    1   6
    2  46


return self.create_checklist_item(self.idCard, self.idChecklist, checklistitem_json)

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . fetch_json ( uri_path = arg_0 . base_uri + '/name' , http_method = 'PUT' , query_params = { 'value' : arg_1 } ) return arg_0 . create_checklist_item ( arg_0 . idCard , arg_0 . idChecklist , arg_2 )

def Func( arg_0, arg_1 ):
        """
        Rename the current checklist item. Returns a new ChecklistItem object.
        """
        arg_2 = arg_0.fetch_json(
            uri_path = arg_0.base_uri + '/name',
            http_method = 'PUT',
            query_params = {'value': arg_1}
        )

        return arg_0.create_checklist_item(arg_0.idCard, arg_0.idChecklist, arg_2)

Rename the current checklist item . Returns a new ChecklistItem object .


def Func ( arg_0 ) : arg_1 = [ ] while arg_0 . pos < len ( arg_0 . field ) : if arg_0 . field [ arg_0 . pos ] in arg_0 . LWS : arg_0 . pos += 1 elif arg_0 . field [ arg_0 . pos ] == '"' : arg_1 . append ( arg_0 . getquote ( ) ) elif arg_0 . field [ arg_0 . pos ] == '(' : arg_0 . commentlist . append ( arg_0 . getcomment ( ) ) elif arg_0 . field [ arg_0 . pos ] in arg_0 . phraseends : break else : arg_1 . append ( arg_0 . getatom ( arg_0 . phraseends ) ) return arg_1

def Func(arg_0):
        """Parse a sequence of RFC 2822 phrases.

        A phrase is a sequence of words, which are in turn either RFC 2822
        atoms or quoted-strings.  Phrases are canonicalized by squeezing all
        runs of continuous whitespace into one space.
        """
        arg_1 = []

        while arg_0.pos < len(arg_0.field):
            if arg_0.field[arg_0.pos] in arg_0.LWS:
                arg_0.pos += 1
            elif arg_0.field[arg_0.pos] == '"':
                arg_1.append(arg_0.getquote())
            elif arg_0.field[arg_0.pos] == '(':
                arg_0.commentlist.append(arg_0.getcomment())
            elif arg_0.field[arg_0.pos] in arg_0.phraseends:
                break
            else:
                arg_1.append(arg_0.getatom(arg_0.phraseends))

        return arg_1


(struct='top/protein.pdb', top='top/system.top',
            distance=0.9, boxtype='dodecahedron',
            concentration=0, cation='NA', anion='CL',
            water='tip4p', solvent_name='SOL', with_membrane=False,
            ndx = 'main.ndx', mainselection = '"Protein"',
            dirname='solvate',
            **kwargs)

def Func(arg_0='top/protein.pdb', arg_1='top/system.top',
            arg_2=0.9, arg_3='dodecahedron',
            arg_4=0, arg_5='NA', arg_6='CL',
            arg_7='tip4p', arg_8='SOL', arg_9=False,
            arg_10 = 'main.ndx', arg_11 = '"Protein"',
            arg_12='Func',
            **arg_13):
    """Put protein into box, add water, add counter-ions.

    Currently this really only supports solutes in water. If you need
    to embedd a protein in a membrane then you will require more
    sophisticated approaches.

    However, you *can* supply a protein already inserted in a
    bilayer. In this case you will probably want to set *distance* =
    ``None`` and also enable *with_membrane* = ``True`` (using extra
    big vdw radii for typical lipids).

    .. Note:: The defaults are suitable for solvating a globular
       protein in a fairly tight (increase *distance*!) dodecahedral
       box.

    :Arguments:
      *struct* : filename
          pdb or gro input structure
      *top* : filename
          Gromacs topology
      *distance* : float
          When solvating with water, make the box big enough so that
          at least *distance* nm water are between the solute *struct*
          and the box boundary.
          Set *boxtype*  to ``None`` in order to use a box size in the input
          file (gro or pdb).
      *boxtype* or *bt*: string
          Any of the box types supported by :class:`~gromacs.tools.Editconf`
          (triclinic, cubic, dodecahedron, octahedron). Set the box dimensions
          either with *distance* or the *box* and *angle* keywords.

          If set to ``None`` it will ignore *distance* and use the box
          inside the *struct* file.

          *bt* overrides the value of *boxtype*.
      *box*
          List of three box lengths [A,B,C] that are used by :class:`~gromacs.tools.Editconf`
          in combination with *boxtype* (``bt`` in :program:`editconf`) and *angles*.
          Setting *box* overrides *distance*.
      *angles*
          List of three angles (only necessary for triclinic boxes).
      *concentration* : float
          Concentration of the free ions in mol/l. Note that counter
          ions are added in excess of this concentration.
      *cation* and *anion* : string
          Molecule names of the ions. This depends on the chosen force field.
      *water* : string
          Name of the water model; one of "spc", "spce", "tip3p",
          "tip4p". This should be appropriate for the chosen force
          field. If an alternative solvent is required, simply supply the path to a box
          with solvent molecules (used by :func:`~gromacs.genbox`'s  *cs* argument)
          and also supply the molecule name via *solvent_name*.
      *solvent_name*
          Name of the molecules that make up the solvent (as set in the itp/top).
          Typically needs to be changed when using non-standard/non-water solvents.
          ["SOL"]
      *with_membrane* : bool
           ``True``: use special ``vdwradii.dat`` with 0.1 nm-increased radii on
           lipids. Default is ``False``.
      *ndx* : filename
          How to name the index file that is produced by this function.
      *mainselection* : string
          A string that is fed to :class:`~gromacs.tools.Make_ndx` and
          which should select the solute.
      *dirname* : directory name
          Name of the directory in which all files for the solvation stage are stored.
      *includes*
          List of additional directories to add to the mdp include path
      *kwargs*
          Additional arguments are passed on to
          :class:`~gromacs.tools.Editconf` or are interpreted as parameters to be
          changed in the mdp file.

    """
    arg_14 = Func_sol(arg_0=arg_0, arg_1=arg_1,
                      arg_2=arg_2, arg_3=arg_3,
                      arg_7=arg_7, arg_8=arg_8,
                      arg_9=arg_9,
                      arg_12=arg_12, **arg_13)

    arg_15 = Func_ion(arg_0=arg_14['struct'], arg_1=arg_1,
                      arg_4=arg_4, arg_5=arg_5, arg_6=arg_6,
                      arg_8=arg_8, arg_10=arg_10,
                      arg_11=arg_11, arg_12=arg_12,
                      **arg_13)
    return arg_15

Put protein into box add water add counter - ions .


def Func ( arg_0 ) : if len ( arg_0 ) % 3 != 0 or len ( arg_0 ) < 6 : return False arg_1 = arg_0 . orfs ( ) arg_2 = intervals . Interval ( 0 , len ( arg_0 ) - 1 ) for arg_3 in arg_1 : if arg_3 == arg_2 : return True return False

def Func(arg_0):
        '''Returns true iff length is >= 6, is a multiple of 3, and there is exactly one stop codon in the sequence and it is at the end'''
        if len(arg_0) %3 != 0 or len(arg_0) < 6:
            return False

        arg_1 = arg_0.orfs()
        arg_2 = intervals.Interval(0, len(arg_0) - 1)
        for arg_3 in arg_1:
            if arg_3 == arg_2:
                return True
        return False

Returns true iff length is > = 6 is a multiple of 3 and there is exactly one stop codon in the sequence and it is at the end


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_0 . enterprise_configuration . get_locales ( ) : arg_2 . append ( { 'locale' : arg_3 , 'value' : arg_1 . get ( 'title' , '' ) } ) return arg_2

def Func(arg_0, arg_1):
        """
        Return the title of the content item.
        """
        arg_2 = []

        for arg_3 in arg_0.enterprise_configuration.get_locales():
            arg_2.append({
                'locale': arg_3,
                'value': arg_1.get('title', '')
            })

        return arg_2


(cobra_model, gene_list,
                                 compiled_gene_reaction_rules=None)

return [r for r in potential_reactions
            if not eval_gpr(compiled_gene_reaction_rules[r], gene_set)]

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = set ( ) for arg_4 in arg_1 : if isinstance ( arg_4 , string_types ) : arg_4 = arg_0 . genes . get_by_id ( arg_4 ) arg_3 . update ( arg_4 . _reaction ) arg_5 = { str ( i ) for i in arg_1 } if arg_2 is None : arg_2 = { arg_6 : parse_gpr ( arg_6 . gene_reaction_rule ) [ 0 ] for arg_6 in arg_3 } return [ arg_6 for arg_6 in arg_3 if not eval_gpr ( arg_2 [ arg_6 ] , arg_5 ) ]

def Func(arg_0, arg_1,
                                 arg_2=None):
    """identify reactions which will be disabled when the genes are knocked out

    cobra_model: :class:`~cobra.core.Model.Model`

    gene_list: iterable of :class:`~cobra.core.Gene.Gene`

    compiled_gene_reaction_rules: dict of {reaction_id: compiled_string}
        If provided, this gives pre-compiled gene_reaction_rule strings.
        The compiled rule strings can be evaluated much faster. If a rule
        is not provided, the regular expression evaluation will be used.
        Because not all gene_reaction_rule strings can be evaluated, this
        dict must exclude any rules which can not be used with eval.

    """
    arg_3 = set()
    for arg_4 in arg_1:
        if isinstance(arg_4, string_types):
            arg_4 = arg_0.genes.get_by_id(arg_4)
        arg_3.update(arg_4._reaction)
    arg_5 = {str(i) for i in arg_1}
    if arg_2 is None:
        arg_2 = {arg_6: parse_gpr(arg_6.gene_reaction_rule)[0]
                                        for arg_6 in arg_3}

    return [arg_6 for arg_6 in arg_3
            if not eval_gpr(arg_2[arg_6], arg_5)]


return PingResult(ping_proc.stdout, ping_proc.stderr, ping_proc.returncode)

def Func ( arg_0 ) : arg_0 . __validate_Func_param ( ) arg_1 = subprocrunner . SubprocessRunner ( arg_0 . __get_Func_command ( ) ) arg_1 . run ( ) return PingResult ( arg_1 . stdout , arg_1 . stderr , arg_1 . returncode )

def Func(arg_0):
        """
        Sending ICMP packets.

        :return: ``Func`` command execution result.
        :rtype: :py:class:`.PingResult`
        :raises ValueError: If parameters not valid.
        """

        arg_0.__validate_Func_param()

        arg_1 = subprocrunner.SubprocessRunner(arg_0.__get_Func_command())
        arg_1.run()

        return PingResult(arg_1.stdout, arg_1.stderr, arg_1.returncode)

Sending ICMP packets.

        :return: ``ping`` command execution result.
        :rtype: :py:class:`.PingResult`
        :raises ValueError: If parameters not valid.


def Func(arg_0):

        """Returns a histogram for each RGBA channel.

        Returns a 4-tuple of lists, r, g, b, and a.
        Each list has 255 items, a count for each pixel value.

        """

        arg_1 = arg_0.img.histogram()
        arg_2 = arg_1[0:255]
        arg_3 = arg_1[256:511]
        arg_4 = arg_1[512:767]
        arg_5 = arg_1[768:1024]

        return arg_2, arg_3, arg_4, arg_5

Returns a histogram for each RGBA channel . Returns a 4 - tuple of lists r g b and a . Each list has 255 items a count for each pixel value .


def Func ( arg_0 , arg_1 ) : import os . path arg_0 . path = os . path . abspath ( arg_1 ) arg_0 . dirname = os . path . dirname ( arg_1 ) arg_0 . basename = os . path . basename ( arg_1 )

def Func(arg_0, arg_1):
    "Set self.path, self.dirname and self.basename."
    import os.path
    arg_0.path = os.path.abspath(arg_1)
    arg_0.dirname = os.path.dirname(arg_1)
    arg_0.basename = os.path.basename(arg_1)

Set self . path self . dirname and self . basename .


def
Func
(
arg_0
)
:
arg_0
=
arg_0
.
replace
(
'-'
,
'_'
)
.
replace
(
'.'
,
'_'
)
.
replace
(
' '
,
'_'
)
if
arg_0
in
keyword
.
kwlist
:
return
arg_0
+
'_'
arg_0
=
'_'
.
join
(
slug
(
ss
,
lowercase
=
False
)
for
ss
in
arg_0
.
split
(
'_'
)
)
if
not
arg_0
:
arg_0
=
'_'
if
arg_0
[
0
]
not
in
string
.
ascii_letters
+
'_'
:
arg_0
=
'_'
+
arg_0
return
arg_0

def Func(arg_0):
    """Convert a string into a valid python attribute name.
    This function is called to convert ASCII strings to something that can pass as
    python attribute name, to be used with namedtuples.

    >>> str(Func('class'))
    'class_'
    >>> str(Func('a-name'))
    'a_name'
    >>> str(Func('a n\u00e4me'))
    'a_name'
    >>> str(Func('Name'))
    'Name'
    >>> str(Func(''))
    '_'
    >>> str(Func('1'))
    '_1'
    """
    arg_0 = arg_0.replace('-', '_').replace('.', '_').replace(' ', '_')
    if arg_0 in keyword.kwlist:
        return arg_0 + '_'
    arg_0 = '_'.join(slug(ss, lowercase=False) for ss in arg_0.split('_'))
    if not arg_0:
        arg_0 = '_'
    if arg_0[0] not in string.ascii_letters + '_':
        arg_0 = '_' + arg_0
    return arg_0

Convert a string into a valid python attribute name.
    This function is called to convert ASCII strings to something that can pass as
    python attribute name, to be used with namedtuples.

    >>> str(normalize_name('class'))
    'class_'
    >>> str(normalize_name('a-name'))
    'a_name'
    >>> str(normalize_name('a n\u00e4me'))
    'a_name'
    >>> str(normalize_name('Name'))
    'Name'
    >>> str(normalize_name(''))
    '_'
    >>> str(normalize_name('1'))
    '_1'

Convert a string into a valid python attribute name . This function is called to convert ASCII strings to something that can pass as python attribute name to be used with namedtuples .


def Func(arg_0, arg_1, arg_2):
    """32bit counter aggregator with wrapping
    """
    if arg_1 < arg_0:
        arg_3 = 4294967295 - arg_0
        return (arg_3 + arg_1) / float(arg_2)

    return (arg_1 - arg_0) / float(arg_2)


def Func ( arg_0 ) : arg_1 = { } @ wraps ( arg_0 ) def memoized_f ( arg_2 ) : try : return arg_1 [ arg_2 ] except KeyError : arg_3 = arg_1 [ arg_2 ] = arg_0 ( arg_2 ) return arg_3 return memoized_f

def Func(arg_0):
    """
    Decorator memoizing a single-argument function
    """
    arg_1 = {}

    @wraps(arg_0)
    def memoized_f(arg_2):
        try:
            return arg_1[arg_2]
        except KeyError:
            arg_3 = arg_1[arg_2] = arg_0(arg_2)
            return arg_3
    return memoized_f

Decorator memoizing a single - argument function


(key_name,
              max_suggestions,
              cutoff,
              jsonify,
              locked,
              key_type,
              stash,
              passphrase,
              backend)

def Func(arg_0,
              arg_1,
              arg_2,
              arg_3,
              arg_4,
              arg_5,
              arg_6,
              arg_7,
              arg_8):
    """List all keys in the stash

    If `KEY_NAME` is provided, will look for keys containing `KEY_NAME`.
    If `KEY_NAME` starts with `~`, close matches will be provided according
    to `max_suggestions` and `cutoff`.
    """
    arg_6 = _get_stash(arg_8, arg_6, arg_7, quiet=arg_3)

    try:
        arg_9 = arg_6.list(
            arg_0=arg_0,
            arg_1=arg_1,
            arg_2=arg_2,
            locked_only=arg_4,
            arg_5=arg_5)
    except GhostError as ex:
        sys.exit(ex)
    if arg_3:
        click.echo(json.dumps(arg_9, indent=4, sort_keys=True))
    elif not arg_9:
        click.echo('The stash is empty. Go on, put some keys in there...')
    else:
        click.echo('Listing all keys...')
        click.echo(_prettify_list(arg_9))


def Func(arg_0, arg_1, arg_2, arg_3):
    """ private function to clumpp results"""

    ## concat results for k=x
    arg_4, arg_5 = _concat_reps(arg_0, arg_1, arg_2, arg_3)
    if arg_4:
        arg_6 = arg_4[0].inds
        arg_7 = len(arg_4)
    else:
        arg_6 = arg_7 = 0
    if not arg_4:
        return "no result files found"

    arg_8 = os.path.join(arg_0.workdir, "tmp.clumppparams.txt")
    arg_0.clumppparams.kpop = arg_1
    arg_0.clumppparams.c = arg_6
    arg_0.clumppparams.r = arg_7
    with open(arg_8, 'w') as tmp_c:
        tmp_c.write(arg_0.clumppparams._asfile())

    ## create CLUMPP args string
    arg_12 = os.path.join(arg_0.workdir,
                "{}-K-{}.outfile".format(arg_0.name, arg_1))
    arg_13 = os.path.join(arg_0.workdir,
                "{}-K-{}.indfile".format(arg_0.name, arg_1))
    arg_14 = os.path.join(arg_0.workdir,
                "{}-K-{}.miscfile".format(arg_0.name, arg_1))
    arg_15 = ["CLUMPP", arg_8,
           "-i", arg_13,
           "-o", arg_12,
           "-j", arg_14,
           "-r", str(arg_7),
           "-c", str(arg_6),
           "-k", str(arg_1)]

    ## call clumpp
    arg_16 = subprocess.Popen(arg_15,
                            stderr=subprocess.STDOUT,
                            stdout=subprocess.PIPE)
    arg_17 = arg_16.communicate()

    ## cleanup
    for arg_18 in [arg_13, arg_14]:
        if os.path.exists(arg_18):
            os.remove(arg_18)

    ## parse clumpp results file
    arg_19 = os.path.join(arg_0.workdir, "{}-K-{}.outfile".format(arg_0.name, arg_1))
    if os.path.exists(arg_19):
        arg_20 = pd.read_csv(arg_19, delim_whitespace=True, header=None)
        arg_21 = arg_20.loc[:, 5:]

        ## apply names to cols and rows
        arg_21.columns = range(arg_21.shape[1])
        arg_21.index = arg_0.labels
        if not arg_3:
            sys.stderr.write(
                "[K{}] {}/{} results permuted across replicates (max_var={}).\n"\
                .format(arg_1, arg_7, arg_7+arg_5, arg_2))
        return arg_21

    else:
        sys.stderr.write("No files ready for {}-K-{} in {}\n"\
                         .format(arg_0.name, arg_1, arg_0.workdir))
        return


(x_initial,
                             target_log_prob,
                             log_slice_heights,
                             max_doublings,
                             step_size,
                             seed=None,
                             name=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = None , arg_6 = None ) : with tf . compat . v1 . name_scope ( arg_6 , 'Func' , [ arg_0 , arg_2 , arg_3 , arg_4 ] ) : arg_7 = distributions . SeedStream ( arg_5 , salt = 'Func' ) arg_0 = tf . convert_to_tensor ( value = arg_0 ) arg_8 = tf . shape ( input = arg_0 ) arg_9 = arg_4 . dtype . base_dtype arg_10 = arg_0 + arg_4 * tf . random . uniform ( arg_8 , minval = - 1.0 , maxval = 0.0 , arg_9 = arg_9 , arg_5 = arg_7 ( ) ) arg_11 , arg_12 = _left_doubling_increments ( arg_8 , arg_3 , arg_4 , arg_5 = arg_7 ( ) ) arg_10 -= arg_11 arg_13 = arg_10 + arg_12 arg_14 = tf . map_fn ( arg_1 , arg_10 ) arg_15 = tf . map_fn ( arg_1 , arg_13 ) arg_16 = arg_14 < arg_2 arg_17 = arg_15 < arg_2 arg_18 = arg_16 & arg_17 arg_19 = tf . reshape ( arg_18 , [ arg_3 + 1 , - 1 ] ) arg_20 = _find_best_interval_idx ( tf . cast ( arg_19 , arg_9 = tf . int32 ) ) arg_21 = tf . stack ( [ arg_20 , tf . range ( tf . size ( input = arg_20 ) ) ] , axis = 1 , arg_6 = 'point_index_gather' ) arg_22 = tf . reshape ( arg_10 , [ arg_3 + 1 , - 1 ] ) arg_23 = tf . reshape ( arg_13 , [ arg_3 + 1 , - 1 ] ) arg_24 = tf . reshape ( tf . gather_nd ( arg_22 , arg_21 ) , arg_8 ) arg_25 = tf . reshape ( tf . gather_nd ( arg_23 , arg_21 ) , arg_8 ) arg_18 = tf . reduce_any ( input_tensor = arg_18 , axis = 0 ) return arg_25 , arg_24 , arg_18

def Func(arg_0,
                             arg_1,
                             arg_2,
                             arg_3,
                             arg_4,
                             arg_5=None,
                             arg_6=None):
  """Returns the bounds of the slice at each stage of doubling procedure.

  Precomputes the x coordinates of the left (L) and right (R) endpoints of the
  interval `I` produced in the "doubling" algorithm [Neal 2003][1] P713. Note
  that we simultaneously compute all possible doubling values for each chain,
  for the reason that at small-medium densities, the gains from parallel
  evaluation might cause a speed-up, but this will be benchmarked against the
  while loop implementation.

  Args:
    x_initial: `tf.Tensor` of any shape and any real dtype consumable by
      `target_log_prob`. The initial points.
    target_log_prob: A callable taking a `tf.Tensor` of shape and dtype as
      `x_initial` and returning a tensor of the same shape. The log density of
      the target distribution.
    log_slice_heights: `tf.Tensor` with the same shape as `x_initial` and the
      same dtype as returned by `target_log_prob`. The log of the height of the
      slice for each chain. The values must be bounded above by
      `target_log_prob(x_initial)`.
    max_doublings: Scalar positive int32 `tf.Tensor`. The maximum number of
      doublings to consider.
    step_size: `tf.Tensor` with same dtype as and shape compatible with
      `x_initial`. The size of the initial interval.
    seed: (Optional) positive int. The random seed. If None, no seed is set.
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'find_slice_bounds').

  Returns:
    upper_bounds: A tensor of same shape and dtype as `x_initial`. Slice upper
      bounds for each chain.
    lower_bounds: A tensor of same shape and dtype as `x_initial`. Slice lower
      bounds for each chain.
    both_ok: A tensor of shape `x_initial` and boolean dtype. Indicates if both
      the chosen upper and lower bound lie outside of the slice.

  #### References

  [1]: Radford M. Neal. Slice Sampling. The Annals of Statistics. 2003, Vol 31,
       No. 3 , 705-767.
       https://projecteuclid.org/download/pdf_1/euclid.aos/1056562461
  """
  with tf.compat.v1.name_scope(
      arg_6, 'Func',
      [arg_0, arg_2, arg_3, arg_4]):
    arg_7 = distributions.SeedStream(arg_5, salt='Func')
    arg_0 = tf.convert_to_tensor(value=arg_0)
    arg_8 = tf.shape(input=arg_0)
    arg_9 = arg_4.dtype.base_dtype
    arg_10 = arg_0 + arg_4 * tf.random.uniform(
        arg_8, minval=-1.0, maxval=0.0, arg_9=arg_9, arg_5=arg_7())

    # Compute the increments by which we need to step the upper and lower bounds
    # part of the doubling procedure.
    arg_11, arg_12 = _left_doubling_increments(
        arg_8, arg_3, arg_4, arg_5=arg_7())
    # The left and right end points. Shape (max_doublings+1,) + batch_shape.
    arg_10 -= arg_11
    arg_13 = arg_10 + arg_12

    # Test if these end points lie outside of the slice.
    # Checks if the end points of the slice are outside the graph of the pdf.
    arg_14 = tf.map_fn(arg_1, arg_10)
    arg_15 = tf.map_fn(arg_1, arg_13)
    arg_16 = arg_14 < arg_2
    arg_17 = arg_15 < arg_2
    arg_18 = arg_16 & arg_17

    arg_19 = tf.reshape(arg_18, [arg_3 + 1, -1])

    arg_20 = _find_best_interval_idx(
        tf.cast(arg_19, arg_9=tf.int32))

    # Formats the above index as required to use with gather_nd.
    arg_21 = tf.stack(
        [arg_20,
         tf.range(tf.size(input=arg_20))],
        axis=1,
        arg_6='point_index_gather')
    arg_22 = tf.reshape(arg_10, [arg_3 + 1, -1])
    arg_23 = tf.reshape(arg_13, [arg_3 + 1, -1])
    # The x values of the uppper and lower bounds of the slices for each chain.
    arg_24 = tf.reshape(tf.gather_nd(arg_22, arg_21),
                              arg_8)
    arg_25 = tf.reshape(tf.gather_nd(arg_23, arg_21),
                              arg_8)
    arg_18 = tf.reduce_any(input_tensor=arg_18, axis=0)
    return arg_25, arg_24, arg_18

Returns the bounds of the slice at each stage of doubling procedure .


return snap_bounds(
            bounds=clip_bounds(bounds=self.init_bounds, clip=self.process_pyramid.bounds),
            pyramid=self.process_pyramid,
            zoom=min(
                self.baselevels["zooms"]
            ) if self.baselevels else min(
                self.init_zoom_levels
            )
        )

def Func ( arg_0 ) : return snap_bounds ( bounds = clip_bounds ( bounds = arg_0 . init_bounds , clip = arg_0 . process_pyramid . bounds ) , pyramid = arg_0 . process_pyramid , zoom = min ( arg_0 . baselevels [ "zooms" ] ) if arg_0 . baselevels else min ( arg_0 . init_zoom_levels ) )

def Func(arg_0):
        """
        Effective process bounds required to initialize inputs.

        Process bounds sometimes have to be larger, because all intersecting process
        tiles have to be covered as well.
        """
        return snap_bounds(
            bounds=clip_bounds(bounds=arg_0.init_bounds, clip=arg_0.process_pyramid.bounds),
            pyramid=arg_0.process_pyramid,
            zoom=min(
                arg_0.baselevels["zooms"]
            ) if arg_0.baselevels else min(
                arg_0.init_zoom_levels
            )
        )

Effective process bounds required to initialize inputs .


(model, gene_list1=None, gene_list2=None, method="fba",
                         solution=None, processes=None, **kwargs)

return _multi_deletion(
        model, 'gene', element_lists=[gene_list1, gene_list2],
        method=method, solution=solution, processes=processes, **kwargs)

def Func(arg_0, arg_1=None, arg_2=None, arg_3="fba",
                         arg_4=None, arg_5=None, **arg_6):
    """
    Knock out each gene pair from the combination of two given lists.

    We say 'pair' here but the order order does not matter.

    Parameters
    ----------
    model : cobra.Model
        The metabolic model to perform deletions in.
    gene_list1 : iterable, optional
        First iterable of ``cobra.Gene``s to be deleted. If not passed,
        all the genes from the model are used.
    gene_list2 : iterable, optional
        Second iterable of ``cobra.Gene``s to be deleted. If not passed,
        all the genes from the model are used.
    method: {"fba", "moma", "linear moma", "room", "linear room"}, optional
        Method used to predict the growth rate.
    solution : cobra.Solution, optional
        A previous solution to use as a reference for (linear) MOMA or ROOM.
    processes : int, optional
        The number of parallel processes to run. Can speed up the computations
        if the number of knockouts to perform is large. If not passed,
        will be set to the number of CPUs found.
    kwargs :
        Keyword arguments are passed on to underlying simulation functions
        such as ``add_room``.

    Returns
    -------
    pandas.DataFrame
        A representation of all combinations of gene deletions. The
        columns are 'growth' and 'status', where

        index : frozenset([str])
            The gene identifiers that were knocked out.
        growth : float
            The growth rate of the adjusted model.
        status : str
            The solution's status.

    """

    arg_1, arg_2 = _element_lists(arg_0.genes, arg_1,
                                            arg_2)
    return _multi_deletion(
        arg_0, 'gene', element_lists=[arg_1, arg_2],
        arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, **arg_6)

Knock out each gene pair from the combination of two given lists .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = None if hasattr ( arg_2 , 'parent' ) and arg_2 . parent is not None : arg_3 = arg_0 . Func ( arg_1 , arg_0 . get_item_by_id ( arg_1 , arg_2 . parent . id ) ) if arg_3 is None : return arg_2 return arg_3

def Func(arg_0, arg_1, arg_2):
        """Climbs up the site tree to resolve root item for chosen one.

        :param str|unicode tree_alias:
        :param TreeItemBase base_item:
        :rtype: TreeItemBase
        """
        arg_3 = None

        if hasattr(arg_2, 'parent') and arg_2.parent is not None:
            arg_3 = arg_0.Func(arg_1, arg_0.get_item_by_id(arg_1, arg_2.parent.id))

        if arg_3 is None:
            return arg_2

        return arg_3

Climbs up the site tree to resolve root item for chosen one .


def Func ( arg_0 , arg_1 ) : if arg_1 is not None : return arg_0 . url_map . bind_to_environ ( arg_1 . environ , server_name = arg_0 . config [ 'SERVER_NAME' ] ) if arg_0 . config [ 'SERVER_NAME' ] is not None : return arg_0 . url_map . bind ( arg_0 . config [ 'SERVER_NAME' ] , script_name = arg_0 . config [ 'APPLICATION_ROOT' ] or '/' , url_scheme = arg_0 . config [ 'PREFERRED_URL_SCHEME' ] )

def Func(arg_0, arg_1):
        """Creates a URL adapter for the given request.  The URL adapter
        is created at a point where the request context is not yet set up
        so the request is passed explicitly.

        .. versionadded:: 0.6

        .. versionchanged:: 0.9
           This can now also be called without a request object when the
           URL adapter is created for the application context.
        """
        if arg_1 is not None:
            return arg_0.url_map.bind_to_environ(arg_1.environ,
                server_name=arg_0.config['SERVER_NAME'])
        # We need at the very least the server name to be set for this
        # to work.
        if arg_0.config['SERVER_NAME'] is not None:
            return arg_0.url_map.bind(
                arg_0.config['SERVER_NAME'],
                script_name=arg_0.config['APPLICATION_ROOT'] or '/',
                url_scheme=arg_0.config['PREFERRED_URL_SCHEME'])

Creates a URL adapter for the given request . The URL adapter is created at a point where the request context is not yet set up so the request is passed explicitly .


def Func ( arg_0 , arg_1 ) : arg_2 = { } arg_3 = ConfigParser . ConfigParser ( ) arg_3 . optionxform = str arg_3 . read ( arg_1 ) for arg_5 in arg_3 . sections ( ) : arg_2 , arg_6 = get_rule_strings ( arg_3 , arg_5 ) for ( arg_7 , arg_8 ) in arg_2 . iteritems ( ) : set_sla ( arg_0 , arg_5 , arg_7 , arg_8 )

def Func(arg_0, arg_1):
  """
  Helper function to parse diff config file, which contains SLA rules for diff comparisons
  """
  arg_2 = {}
  arg_3 = ConfigParser.ConfigParser()
  arg_3.optionxform = str
  arg_3.read(arg_1)
  for arg_5 in arg_3.sections():
    arg_2, arg_6 = get_rule_strings(arg_3, arg_5)
    for (arg_7, arg_8) in arg_2.iteritems():
      set_sla(arg_0, arg_5, arg_7, arg_8)

Helper function to parse diff config file which contains SLA rules for diff comparisons


return super().reverse_action(url_name, *args, **kwargs)

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : if arg_0 . request and not arg_0 . request . version : return reverse ( arg_0 . get_url_name ( arg_1 ) , * arg_2 , ** arg_3 ) return super ( ) . Func ( arg_1 , * arg_2 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        Extended DRF with fallback to requested namespace if request.version is missing
        """
        if arg_0.request and not arg_0.request.version:
            return reverse(arg_0.get_url_name(arg_1), *arg_2, **arg_3)

        return super().Func(arg_1, *arg_2, **arg_3)

Extended DRF with fallback to requested namespace if request . version is missing


return sorted(self.fetch_metric(*args, **kwargs).items(),
            key=lambda x: float(x[0]))

def Func ( arg_0 , * arg_1 , ** arg_2 ) : return sorted ( arg_0 . fetch_metric ( * arg_1 , ** arg_2 ) . items ( ) , key = lambda x : float ( x [ 0 ] ) )

def Func(arg_0, *arg_1, **arg_2):
        """Fetch and sort time series data from OpenTSDB

        Takes the same parameters as `fetch_metric`, but returns a list of
        (timestamp, value) tuples sorted by timestamp.
        """
        return sorted(arg_0.fetch_metric(*arg_1, **arg_2).items(),
            key=lambda x: float(x[0]))


def Func ( arg_0 , arg_1 = False ) : arg_2 = { } if arg_1 : arg_3 = lambda f : f else : arg_3 = os . path . basename for arg_4 , arg_5 in iitems ( arg_0 . lines ) : arg_2 [ arg_3 ( arg_4 ) ] = len ( arg_5 ) return arg_2

def Func(arg_0, arg_1=False):
        """Return a dict summarizing the coverage data.

        Keys are based on the filenames, and values are the number of executed
        lines.  If `fullpath` is true, then the keys are the full pathnames of
        the files, otherwise they are the basenames of the files.

        """
        arg_2 = {}
        if arg_1:
            arg_3 = lambda f: f
        else:
            arg_3 = os.path.basename
        for arg_4, arg_5 in iitems(arg_0.lines):
            arg_2[arg_3(arg_4)] = len(arg_5)
        return arg_2

Return a dict summarizing the coverage data .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : def to_solve ( arg_4 ) : arg_5 = arg_0 . a_alpha_and_derivatives ( arg_4 , full = False ) arg_6 = R * arg_4 / ( arg_2 - arg_0 . b ) - arg_5 / ( arg_2 * arg_2 + arg_0 . delta * arg_2 + arg_0 . epsilon ) return arg_6 - arg_1 return newton ( to_solve , arg_0 . Tc * 0.5 )

def Func(arg_0, arg_1, arg_2, arg_3=True):
        '''Generic method to calculate `T` from a specified `P` and `V`.
        Provides SciPy's `newton` solver, and iterates to solve the general
        equation for `P`, recalculating `a_alpha` as a function of temperature
        using `a_alpha_and_derivatives` each iteration.

        Parameters
        ----------
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (3x faster) or
            individual formulas - not applicable where a numerical solver is
            used.

        Returns
        -------
        T : float
            Temperature, [K]
        '''
        def to_solve(arg_4):
            arg_5 = arg_0.a_alpha_and_derivatives(arg_4, full=False)
            arg_6 = R*arg_4/(arg_2-arg_0.b) - arg_5/(arg_2*arg_2 + arg_0.delta*arg_2 + arg_0.epsilon)
            return arg_6 - arg_1
        return newton(to_solve, arg_0.Tc*0.5)

Generic method to calculate T from a specified P and V . Provides SciPy s newton solver and iterates to solve the general equation for P recalculating a_alpha as a function of temperature using a_alpha_and_derivatives each iteration .