(image_path, pixel_scale, image_hdu=0,
                            resized_ccd_shape=None, resized_ccd_origin_pixels=None,
                            resized_ccd_origin_arcsec=None,
                            psf_path=None, psf_hdu=0, resized_psf_shape=None, renormalize_psf=True,
                            noise_map_path=None, noise_map_hdu=0,
                            noise_map_from_image_and_background_noise_map=False,
                            convert_noise_map_from_weight_map=False,
                            convert_noise_map_from_inverse_noise_map=False,
                            background_noise_map_path=None, background_noise_map_hdu=0,
                            convert_background_noise_map_from_weight_map=False,
                            convert_background_noise_map_from_inverse_noise_map=False,
                            poisson_noise_map_path=None, poisson_noise_map_hdu=0,
                            poisson_noise_map_from_image=False,
                            convert_poisson_noise_map_from_weight_map=False,
                            convert_poisson_noise_map_from_inverse_noise_map=False,
                            exposure_time_map_path=None, exposure_time_map_hdu=0,
                            exposure_time_map_from_single_value=None,
                            exposure_time_map_from_inverse_noise_map=False,
                            background_sky_map_path=None, background_sky_map_hdu=0,
                            convert_from_electrons=False,
                            gain=None, convert_from_adus=False, lens_name=None)

def Func(arg_0, arg_1, arg_2=0,
                            arg_3=None, arg_4=None,
                            arg_5=None,
                            arg_6=None, arg_7=0, arg_8=None, arg_9=True,
                            arg_10=None, arg_11=0,
                            arg_12=False,
                            arg_13=False,
                            arg_14=False,
                            arg_15=None, arg_16=0,
                            arg_17=False,
                            arg_18=False,
                            arg_19=None, arg_20=0,
                            arg_21=False,
                            arg_22=False,
                            arg_23=False,
                            arg_24=None, arg_25=0,
                            arg_26=None,
                            arg_27=False,
                            arg_28=None, arg_29=0,
                            arg_30=False,
                            arg_31=None, arg_32=False, arg_33=None):
    """Factory for loading the ccd data from .fits files, as well as computing properties like the noise-map,
    exposure-time map, etc. from the ccd-data.

    This factory also includes a number of routines for converting the ccd-data from units not supported by PyAutoLens \
    (e.g. adus, electrons) to electrons per second.

    Parameters
    ----------
    lens_name
    image_path : str
        The path to the image .fits file containing the image (e.g. '/path/to/image.fits')
    pixel_scale : float
        The size of each pixel in arc seconds.
    image_hdu : int
        The hdu the image is contained in the .fits file specified by *image_path*.
    image_hdu : int
        The hdu the image is contained in the .fits file that *image_path* points too.
    resized_ccd_shape : (int, int) | None
        If input, the ccd arrays that are image sized, e.g. the image, noise-maps) are resized to these dimensions.
    resized_ccd_origin_pixels : (int, int) | None
        If the ccd arrays are resized, this defines a new origin (in pixels) around which recentering occurs.
    resized_ccd_origin_arcsec : (float, float) | None
        If the ccd arrays are resized, this defines a new origin (in arc-seconds) around which recentering occurs.
    psf_path : str
        The path to the psf .fits file containing the psf (e.g. '/path/to/psf.fits')
    psf_hdu : int
        The hdu the psf is contained in the .fits file specified by *psf_path*.
    resized_psf_shape : (int, int) | None
        If input, the psf is resized to these dimensions.
    renormalize_psf : bool
        If True, the PSF is renoralized such that all elements sum to 1.0.
    noise_map_path : str
        The path to the noise_map .fits file containing the noise_map (e.g. '/path/to/noise_map.fits')
    noise_map_hdu : int
        The hdu the noise_map is contained in the .fits file specified by *noise_map_path*.
    noise_map_from_image_and_background_noise_map : bool
        If True, the noise-map is computed from the observed image and background noise-map \
        (see NoiseMap.from_image_and_background_noise_map).
    convert_noise_map_from_weight_map : bool
        If True, the noise-map loaded from the .fits file is converted from a weight-map to a noise-map (see \
        *NoiseMap.from_weight_map).
    convert_noise_map_from_inverse_noise_map : bool
        If True, the noise-map loaded from the .fits file is converted from an inverse noise-map to a noise-map (see \
        *NoiseMap.from_inverse_noise_map).
    background_noise_map_path : str
        The path to the background_noise_map .fits file containing the background noise-map \
        (e.g. '/path/to/background_noise_map.fits')
    background_noise_map_hdu : int
        The hdu the background_noise_map is contained in the .fits file specified by *background_noise_map_path*.
    convert_background_noise_map_from_weight_map : bool
        If True, the bacground noise-map loaded from the .fits file is converted from a weight-map to a noise-map (see \
        *NoiseMap.from_weight_map).
    convert_background_noise_map_from_inverse_noise_map : bool
        If True, the background noise-map loaded from the .fits file is converted from an inverse noise-map to a \
        noise-map (see *NoiseMap.from_inverse_noise_map).
    poisson_noise_map_path : str
        The path to the poisson_noise_map .fits file containing the Poisson noise-map \
         (e.g. '/path/to/poisson_noise_map.fits')
    poisson_noise_map_hdu : int
        The hdu the poisson_noise_map is contained in the .fits file specified by *poisson_noise_map_path*.
    poisson_noise_map_from_image : bool
        If True, the Poisson noise-map is estimated using the image.
    convert_poisson_noise_map_from_weight_map : bool
        If True, the Poisson noise-map loaded from the .fits file is converted from a weight-map to a noise-map (see \
        *NoiseMap.from_weight_map).
    convert_poisson_noise_map_from_inverse_noise_map : bool
        If True, the Poisson noise-map loaded from the .fits file is converted from an inverse noise-map to a \
        noise-map (see *NoiseMap.from_inverse_noise_map).
    exposure_time_map_path : str
        The path to the exposure_time_map .fits file containing the exposure time map \
        (e.g. '/path/to/exposure_time_map.fits')
    exposure_time_map_hdu : int
        The hdu the exposure_time_map is contained in the .fits file specified by *exposure_time_map_path*.
    exposure_time_map_from_single_value : float
        The exposure time of the ccd imaging, which is used to compute the exposure-time map as a single value \
        (see *ExposureTimeMap.from_single_value*).
    exposure_time_map_from_inverse_noise_map : bool
        If True, the exposure-time map is computed from the background noise_map map \
        (see *ExposureTimeMap.from_background_noise_map*)
    background_sky_map_path : str
        The path to the background_sky_map .fits file containing the background sky map \
        (e.g. '/path/to/background_sky_map.fits').
    background_sky_map_hdu : int
        The hdu the background_sky_map is contained in the .fits file specified by *background_sky_map_path*.
    convert_from_electrons : bool
        If True, the input unblurred_image_1d are in units of electrons and all converted to electrons / second using the exposure \
        time map.
    gain : float
        The image gain, used for convert from ADUs.
    convert_from_adus : bool
        If True, the input unblurred_image_1d are in units of adus and all converted to electrons / second using the exposure \
        time map and gain.
    """

    arg_34 = load_image(arg_0=arg_0, arg_2=arg_2, arg_1=arg_1)

    arg_35 = load_background_noise_map(arg_15=arg_15,
                                                     arg_16=arg_16,
                                                     arg_1=arg_1,
                                                     arg_17=arg_17,
                                                     arg_18=arg_18)

    if arg_35 is not None:
        arg_36 = 1.0 / arg_35
    else:
        arg_36 = None

    arg_37 = load_exposure_time_map(arg_24=arg_24,
                                               arg_25=arg_25,
                                               arg_1=arg_1, shape=arg_34.shape,
                                               exposure_time=arg_26,
                                               arg_27=arg_27,
                                               arg_36=arg_36)

    arg_38 = load_poisson_noise_map(arg_19=arg_19,
                                               arg_20=arg_20,
                                               arg_1=arg_1,
                                               arg_22=arg_22,
                                               arg_23=arg_23,
                                               arg_34=arg_34, arg_37=arg_37,
                                               arg_21=arg_21,
                                               arg_30=arg_30, arg_31=arg_31,
                                               arg_32=arg_32)

    arg_39 = load_noise_map(arg_10=arg_10, arg_11=arg_11, arg_1=arg_1,
                               arg_34=arg_34, arg_35=arg_35,
                               arg_37=arg_37,
                               arg_13=arg_13,
                               arg_14=arg_14,
                               arg_12=arg_12,
                               arg_30=arg_30, arg_31=arg_31,
                               arg_32=arg_32)

    arg_40 = load_psf(arg_6=arg_6, arg_7=arg_7, arg_1=arg_1, renormalize=arg_9)

    arg_41 = load_background_sky_map(arg_28=arg_28,
                                                 arg_29=arg_29,
                                                 arg_1=arg_1)

    arg_34 = CCDData(arg_34=arg_34, arg_1=arg_1, arg_40=arg_40, arg_39=arg_39,
                    arg_35=arg_35, arg_38=arg_38,
                    arg_37=arg_37, arg_41=arg_41, arg_31=arg_31,
                    name=arg_33)

    if arg_3 is not None:
        arg_34 = arg_34.new_ccd_data_with_resized_arrays(new_shape=arg_3,
                                                       new_centre_pixels=arg_4,
                                                       new_centre_arcsec=arg_5)

    if arg_8 is not None:
        arg_34 = arg_34.new_ccd_data_with_resized_psf(new_shape=arg_8)

    if arg_30:
        arg_34 = arg_34.new_ccd_data_converted_from_electrons()
    elif arg_32:
        arg_34 = arg_34.new_ccd_data_converted_from_adus(arg_31=arg_31)

    return arg_34

Factory for loading the ccd data from . fits files as well as computing properties like the noise - map exposure - time map etc . from the ccd - data .


def Func(arg_0, arg_1=None, arg_2=None):
        '''
        Find a symbol in the symbol table by name, kind, or both.
        '''
        for arg_3 in reversed(arg_0.stack):

            for arg_4, arg_5 in arg_3.symbols.items():
                arg_6 = arg_5.__class__.__name__

                if arg_1 == arg_4 and arg_2 == arg_6:
                    return arg_5

                elif arg_1 is None and arg_2 == arg_5.__class__.__name__:
                    return arg_5

                elif arg_1 == arg_4 and arg_2 is None:
                    return arg_5

            if arg_1 is None and arg_2 == arg_3.handle.__class__.__name__:
                return arg_3.handle

Find a symbol in the symbol table by name kind or both .


def Func(arg_0, arg_1):
        """
        Using the record length and appropriate start points, seek to the
        country that corresponds to the converted IP address integer.
        Return offset of record.

        :arg ipnum: Result of ip2long conversion
        """
        try:
            arg_2 = 0
            arg_3 = 127 if len(str(arg_1)) > 10 else 31

            for arg_4 in range(arg_3, -1, -1):
                if arg_0._flags & const.MEMORY_CACHE:
                    arg_5 = 2 * arg_0._recordLength * arg_2
                    arg_6 = arg_5 + (2 * arg_0._recordLength)
                    arg_7 = arg_0._memory[arg_5:arg_6]
                else:
                    arg_5 = 2 * arg_0._recordLength * arg_2
                    arg_8 = 2 * arg_0._recordLength
                    try:
                        arg_0._lock.acquire()
                        arg_0._fp.seek(arg_5, os.SEEK_SET)
                        arg_7 = arg_0._fp.read(arg_8)
                    finally:
                        arg_0._lock.release()

                if PY3 and type(arg_7) is bytes:
                    arg_7 = arg_7.decode(ENCODING)

                arg_9 = [0, 0]
                for arg_10 in range(2):
                    for arg_11 in range(arg_0._recordLength):
                        arg_12 = arg_7[arg_0._recordLength * arg_10 + arg_11]
                        arg_9[arg_10] += ord(arg_12) << (arg_11 * 8)
                if arg_1 & (1 << arg_4):
                    if arg_9[1] >= arg_0._databaseSegments:
                        arg_0._netmask = arg_3 - arg_4 + 1
                        return arg_9[1]
                    arg_2 = arg_9[1]
                else:
                    if arg_9[0] >= arg_0._databaseSegments:
                        arg_0._netmask = arg_3 - arg_4 + 1
                        return arg_9[0]
                    arg_2 = arg_9[0]
        except (IndexError, UnicodeDecodeError):
            pass

        raise GeoIPError('Corrupt database')

Using the record length and appropriate start points seek to the country that corresponds to the converted IP address integer . Return offset of record .


(sess, output_file_path, output_node_names, as_text=False)

def Func(arg_0, arg_1, arg_2, arg_3=False):
    """Save a small version of the graph based on a session and the output node names."""
    for arg_4 in arg_0.graph_def.node:
        arg_4.device = ''
    arg_6 = graph_util.extract_sub_graph(arg_0.graph_def, arg_2)
    arg_7, arg_8 = os.path.split(arg_1)
    graph_io.write_graph(arg_6, arg_7, arg_8, arg_3=arg_3)

Save a small version of the graph based on a session and the output node names .


def Func(arg_0, arg_1, arg_2):
        """
        Given a Discord http_conn_id, return the default webhook endpoint or override if a
        webhook_endpoint is manually supplied.

        :param http_conn_id: The provided connection ID
        :param webhook_endpoint: The manually provided webhook endpoint
        :return: Webhook endpoint (str) to use
        """
        if arg_2:
            arg_3 = arg_2
        elif arg_1:
            arg_4 = arg_0.get_connection(arg_1)
            arg_5 = arg_4.extra_dejson
            arg_3 = arg_5.get('webhook_endpoint', '')
        else:
            raise AirflowException('Cannot get webhook endpoint: No valid Discord '
                                   'webhook endpoint or http_conn_id supplied.')

        # make sure endpoint matches the expected Discord webhook format
        if not re.match('^webhooks/[0-9]+/[a-zA-Z0-9_-]+$', arg_3):
            raise AirflowException('Expected Discord webhook endpoint in the form '
                                   'of "webhooks/{webhook.id}/{webhook.token}".')

        return arg_3

Given a Discord http_conn_id return the default webhook endpoint or override if a webhook_endpoint is manually supplied .


Generator which returns all of the statements in all of the settings tables

def Func ( arg_0 ) : for arg_1 in arg_0 . tables : if isinstance ( arg_1 , SettingTable ) : for arg_2 in arg_1 . statements : yield arg_2

def Func(arg_0):
        '''Generator which returns all of the statements in all of the Func tables'''
        for arg_1 in arg_0.tables:
            if isinstance(arg_1, SettingTable):
                for arg_2 in arg_1.statements:
                    yield arg_2


(self, service_name, deployment_name, mode,
                           package_url, configuration, label, force,
                           role_to_upgrade=None, extended_properties=None)

return self._perform_post(
            self._get_deployment_path_using_name(
                service_name, deployment_name) + '/?comp=upgrade',
            _XmlSerializer.upgrade_deployment_to_xml(
                mode,
                package_url,
                configuration,
                label,
                role_to_upgrade,
                force,
                extended_properties),
            as_async=True)

def Func(arg_0, arg_1, arg_2, arg_3,
                           arg_4, arg_5, arg_6, arg_7,
                           arg_8=None, arg_9=None):
        '''
        Initiates an upgrade.

        service_name:
            Name of the hosted service.
        deployment_name:
            The name of the deployment.
        mode:
            If set to Manual, WalkUpgradeDomain must be called to apply the
            update. If set to Auto, the Windows Azure platform will
            automatically apply the update To each upgrade domain for the
            service. Possible values are: Auto, Manual
        package_url:
            A URL that refers to the location of the service package in the
            Blob service. The service package can be located either in a
            storage account beneath the same subscription or a Shared Access
            Signature (SAS) URI from any storage account.
        configuration:
            The base-64 encoded service configuration file for the deployment.
        label:
            A name for the hosted service. The name can be up to 100 characters
            in length. It is recommended that the label be unique within the
            subscription. The name can be used to identify the hosted service
            for your tracking purposes.
        force:
            Specifies whether the rollback should proceed even when it will
            cause local data to be lost from some role instances. True if the
            rollback should proceed; otherwise false if the rollback should
            fail.
        role_to_upgrade:
            The name of the specific role to upgrade.
        extended_properties:
            Dictionary containing name/value pairs of storage account
            properties. You can have a maximum of 50 extended property
            name/value pairs. The maximum length of the Name element is 64
            characters, only alphanumeric characters and underscores are valid
            in the Name, and the name must start with a letter. The value has
            a maximum length of 255 characters.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('mode', arg_3)
        _validate_not_none('package_url', arg_4)
        _validate_not_none('configuration', arg_5)
        _validate_not_none('label', arg_6)
        _validate_not_none('force', arg_7)
        return arg_0._perform_post(
            arg_0._get_deployment_path_using_name(
                arg_1, arg_2) + '/?comp=upgrade',
            _XmlSerializer.Func_to_xml(
                arg_3,
                arg_4,
                arg_5,
                arg_6,
                arg_8,
                arg_7,
                arg_9),
            as_async=True)


return parse_geo_tiff(geo_key_dir, geo_doubles, geo_ascii)

def Func ( arg_0 : arg_1 . VLRList ) -> List [ GeoTiffKey ] : arg_3 = arg_0 . get_by_id ( GeoKeyDirectoryVlr . official_user_id ( ) , GeoKeyDirectoryVlr . official_record_ids ( ) ) [ 0 ] arg_4 = arg_0 . get_by_id ( GeoDoubleParamsVlr . official_user_id ( ) , GeoDoubleParamsVlr . official_record_ids ( ) ) [ 0 ] arg_5 = arg_0 . get_by_id ( GeoAsciiParamsVlr . official_user_id ( ) , GeoAsciiParamsVlr . official_record_ids ( ) ) [ 0 ] return parse_geo_tiff ( arg_3 , arg_4 , arg_5 )

def Func(arg_0: arg_1.VLRList) -> List[GeoTiffKey]:
    """ Gets the 3 GeoTiff vlrs from the vlr_list and parse them into
    a nicer structure

    Parameters
    ----------
    vlr_list: pylas.vrls.vlrslist.VLRList list of vlrs from a las file

    Raises
    ------
        IndexError if any of the needed GeoTiffVLR is not found in the list

    Returns
    -------
    List of GeoTiff keys parsed from the VLRs

    """
    arg_3 = arg_0.get_by_id(
        GeoKeyDirectoryVlr.official_user_id(), GeoKeyDirectoryVlr.official_record_ids()
    )[0]
    arg_4 = arg_0.get_by_id(
        GeoDoubleParamsVlr.official_user_id(), GeoDoubleParamsVlr.official_record_ids()
    )[0]
    arg_5 = arg_0.get_by_id(
        GeoAsciiParamsVlr.official_user_id(), GeoAsciiParamsVlr.official_record_ids()
    )[0]
    return parse_geo_tiff(arg_3, arg_4, arg_5)


def Func ( arg_0 , arg_1 , arg_2 = None ) : return arg_0 . dict . get ( arg_1 . lower ( ) , arg_2 )

def Func(arg_0, arg_1, arg_2=None):
        """Get the header value for a name.

        This is the normal interface: it returns a stripped version of the
        header value for a given header name, or None if it doesn't exist.
        This uses the dictionary version which finds the *last* such header.
        """
        return arg_0.dict.get(arg_1.lower(), arg_2)


return self._json(self._get(self._build_url('guids', guid)), 200)['data']['type']

def Func ( arg_0 , Func ) : return arg_0 . _json ( arg_0 . _get ( arg_0 . _build_url ( 'guids' , Func ) ) , 200 ) [ 'data' ] [ 'type' ]

def Func(arg_0, Func):
        """Determines JSONAPI type for provided GUID"""
        return arg_0._json(arg_0._get(arg_0._build_url('guids', Func)), 200)['data']['type']


def Func ( ) : logging . basicConfig ( level = logging . WARNING ) peony . logger . setLevel ( logging . DEBUG )

def Func():
    """ activates error messages, useful during development """
    logging.basicConfig(level=logging.WARNING)
    peony.logger.setLevel(logging.DEBUG)

activates error messages useful during development


def Func(arg_0):
    """Write tersoff potential file from parameters to string

    Parameters
    ----------
    parameters: dict
       keys are tuple of elements with the values being the parameters length 14
    """
    arg_1 = []
    for (arg_2, arg_3, arg_4), arg_5 in arg_0.items():
        if len(arg_5) != 14:
            raise ValueError('tersoff three body potential expects 14 parameters')
        arg_1.append(' '.join([arg_2, arg_3, arg_4] + ['{:16.8g}'.format(arg_6) for arg_6 in arg_5]))
    return '\n'.join(arg_1)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
""
)
:
print
arg_2
,
arg_3
=
arg_0
.
getDescription
(
)
+
[
(
"end"
,
arg_0
.
getWidth
(
)
)
]
for
arg_4
in
xrange
(
len
(
arg_3
)
1
)
:
arg_5
=
arg_3
[
arg_4
]
[
1
]
arg_6
=
arg_3
[
arg_4
+
1
]
[
1
]
print
"%s |"
%
bitsToString
(
arg_1
[
arg_5
:
arg_6
]
)
,
print

def Func(arg_0, arg_1, arg_2=""):
    """
    Pretty-print the encoded output using ascii art.

    :param output: to print
    :param prefix: printed before the header if specified
    """
    print arg_2,
    arg_3 = arg_0.getDescription() + [("end", arg_0.getWidth())]
    for arg_4 in xrange(len(arg_3) - 1):
      arg_5 = arg_3[arg_4][1]
      arg_6 = arg_3[arg_4+1][1]
      print "%s |" % bitsToString(arg_1[arg_5:arg_6]),
    print

Pretty - print the encoded output using ascii art .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 if isinstance ( arg_0 , ReferenceField ) : arg_2 = arg_0 . document_type . objects . get ( id = arg_1 ) if arg_1 else None return arg_2

def Func(arg_0, arg_1):
    """
    Given a document_field and a form_value this will translate the value
    to the correct result for mongo to use.
    """
    arg_2 = arg_1
    if isinstance(arg_0, ReferenceField):
        arg_2 = arg_0.document_type.objects.get(id=arg_1) if arg_1 else None
    return arg_2

Given a document_field and a form_value this will translate the value to the correct result for mongo to use .


return {
        "start": {
            "dateTime": (now + datetime.timedelta(minutes=int(config["start"]))).strftime(DT_FORMAT),
            "timeZone": options.timezone,
        },
        "end": {
            "dateTime": (now + datetime.timedelta(minutes=int(config["end"]))).strftime(DT_FORMAT),
            "timeZone": options.timezone,
        },
    }

def Func ( arg_0 , arg_1 ) : arg_2 = datetime . datetime . now ( ) return { "start" : { "dateTime" : ( arg_2 + datetime . timedelta ( minutes = int ( arg_1 [ "start" ] ) ) ) . strftime ( DT_FORMAT ) , "timeZone" : arg_0 . timezone , } , "end" : { "dateTime" : ( arg_2 + datetime . timedelta ( minutes = int ( arg_1 [ "end" ] ) ) ) . strftime ( DT_FORMAT ) , "timeZone" : arg_0 . timezone , } , }

def Func(arg_0, arg_1):
    """
    Create event start and end datetimes.
    """

    arg_2 = datetime.datetime.now()

    return {
        "start": {
            "dateTime": (arg_2 + datetime.timedelta(minutes=int(arg_1["start"]))).strftime(DT_FORMAT),
            "timeZone": arg_0.timezone,
        },
        "end": {
            "dateTime": (arg_2 + datetime.timedelta(minutes=int(arg_1["end"]))).strftime(DT_FORMAT),
            "timeZone": arg_0.timezone,
        },
    }


(engine,
                           user_id,
                           old_decrypt_func,
                           new_encrypt_func,
                           logger)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
arg_4
.
info
(
"Begin re-encryption for user %s"
,
arg_1
)
with
arg_0
.
begin
(
)
as
db
:
arg_4
.
info
(
"Re-encrypting files for %s"
,
arg_1
)
for
(
arg_5
,
)
in
select_file_ids
(
db
,
arg_1
)
:
reencrypt_row_content
(
db
,
files
,
arg_5
,
arg_2
,
arg_3
,
arg_4
,
)
arg_4
.
info
(
"Re-encrypting checkpoints for %s"
,
arg_1
)
for
(
arg_6
,
)
in
select_remote_checkpoint_ids
(
db
,
arg_1
)
:
reencrypt_row_content
(
db
,
remote_checkpoints
,
arg_6
,
arg_2
,
arg_3
,
arg_4
,
)
arg_4
.
info
(
"Finished re-encryption for user %s"
,
arg_1
)

def Func(arg_0,
                           arg_1,
                           arg_2,
                           arg_3,
                           arg_4):
    """
    Re-encrypt all of the files and checkpoints for a single user.
    """
    arg_4.info("Begin re-encryption for user %s", arg_1)
    with arg_0.begin() as db:
        # NOTE: Doing both of these operations in one transaction depends for
        # correctness on the fact that the creation of new checkpoints always
        # involves writing new data into the database from Python, rather than
        # simply copying data inside the DB.

        # If we change checkpoint creation so that it does an in-database copy,
        # then we need to split this transaction to ensure that
        # file-reencryption is complete before checkpoint-reencryption starts.

        # If that doesn't happen, it will be possible for a user to create a
        # new checkpoint in a transaction that hasn't seen the completed
        # file-reencryption process, but we might not see that checkpoint here,
        # which means that we would never update the content of that checkpoint
        # to the new encryption key.
        arg_4.info("Re-encrypting files for %s", arg_1)
        for (arg_5,) in select_file_ids(db, arg_1):
            reencrypt_row_content(
                db,
                files,
                arg_5,
                arg_2,
                arg_3,
                arg_4,
            )

        arg_4.info("Re-encrypting checkpoints for %s", arg_1)
        for (arg_6,) in select_remote_checkpoint_ids(db, arg_1):
            reencrypt_row_content(
                db,
                remote_checkpoints,
                arg_6,
                arg_2,
                arg_3,
                arg_4,
            )
    arg_4.info("Finished re-encryption for user %s", arg_1)

Re - encrypt all of the files and checkpoints for a single user .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = 'http://' + arg_1 + arg_2 + arg_0 . issuer + arg_0 . account_key if arg_4 in arg_11 : arg_5 = arg_11 [ arg_4 ] if not arg_0 . _token_is_expired ( arg_5 ) : return arg_5 arg_6 = HTTPRequest ( ) arg_6 . protocol_override = 'https' arg_6 . host = arg_1 . replace ( '.servicebus.' , '-sb.accesscontrol.' ) arg_6 . method = 'POST' arg_6 . path = '/WRAPv0.9' arg_6 . body = ( 'wrap_name=' + url_quote ( arg_0 . issuer ) + '&wrap_password=' + url_quote ( arg_0 . account_key ) + '&wrap_scope=' + url_quote ( 'http://' + arg_1 + arg_2 ) ) . encode ( 'utf-8' ) arg_6 . headers . append ( ( 'Content-Length' , str ( len ( arg_6 . body ) ) ) ) arg_10 = arg_3 . perform_request ( arg_6 ) arg_5 = arg_10 . body . decode ( 'utf-8-sig' ) arg_5 = url_unquote ( arg_5 [ arg_5 . find ( '=' ) + 1 : arg_5 . rfind ( '&' ) ] ) arg_11 [ arg_4 ] = arg_5 return arg_5

def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Returns token for the request.

        host:
            the Service Bus service request.
        path:
            the Service Bus service request.
        '''
        arg_4 = 'http://' + arg_1 + arg_2 + arg_0.issuer + arg_0.account_key

        # Check whether has unexpired cache, return cached token if it is still
        # usable.
        if arg_4 in arg_11:
            arg_5 = arg_11[arg_4]
            if not arg_0._token_is_expired(arg_5):
                return arg_5

        # get token from accessconstrol server
        arg_6 = HTTPRequest()
        arg_6.protocol_override = 'https'
        arg_6.host = arg_1.replace('.servicebus.', '-sb.accesscontrol.')
        arg_6.method = 'POST'
        arg_6.path = '/WRAPv0.9'
        arg_6.body = ('wrap_name=' + url_quote(arg_0.issuer) +
                        '&wrap_password=' + url_quote(arg_0.account_key) +
                        '&wrap_scope=' +
                        url_quote('http://' + arg_1 + arg_2)).encode('utf-8')
        arg_6.headers.append(('Content-Length', str(len(arg_6.body))))
        arg_10 = arg_3.perform_request(arg_6)

        arg_5 = arg_10.body.decode('utf-8-sig')
        arg_5 = url_unquote(arg_5[arg_5.find('=') + 1:arg_5.rfind('&')])
        arg_11[arg_4] = arg_5

        return arg_5


def Func(arg_0, arg_1='cocomo_book'):
    """
    Compute the labor hours, given a count of source lines of code

    The intention is to use the COCOMO II model to compute this value.

    References:
    - http://csse.usc.edu/tools/cocomoii.php
    - http://docs.python-guide.org/en/latest/scenarios/scrape/
    """
    # Calculation of hours in a month
    if arg_1 == 'hours_per_year':
        # Use number of working hours in a year:
        # (40 Hours / week) * (52 weeks / year) / (12 months / year) ~= 173.33
        arg_2 = 40.0 * 52 / 12
    else:
        # Use value from COCOMO II Book (month_hours=='cocomo_book'):
        # Reference: https://dl.acm.org/citation.cfm?id=557000
        # This is the value used by the Code.gov team:
        # https://github.com/GSA/code-gov/blob/master/LABOR_HOUR_CALC.md
        arg_2 = 152.0

    arg_3 = 'http://csse.usc.edu/tools/cocomoii.php'
    arg_4 = requests.post(arg_3, data={'new_size': arg_0})

    try:
        arg_5 = float(EFFORT_REGEX.search(arg_4.text).group(1))
    except AttributeError:
        logger.error('Unable to find Person Months in page text: sloc=%s', arg_0)
        # If there is no match, and .search(..) returns None
        arg_5 = 0

    arg_6 = arg_5 * arg_2
    logger.debug('sloc=%d labor_hours=%d', arg_0, arg_6)

    return arg_6

Compute the labor hours given a count of source lines of code


def Func(arg_0, arg_1):
        """Parse an assembly file in fasta format.

        This is a Fasta parsing method that populates the
        :py:attr:`Assembly.contigs` attribute with data for each contig in the
         assembly.

        Parameters
        ----------
        assembly_file : str
            Path to the assembly fasta file.

        """

        with open(arg_1) as fh:

            arg_2 = None
            logger.debug("Starting iteration of assembly file: {}".format(
                arg_1))

            for arg_3 in fh:

                # Skip empty lines
                if not arg_3.strip():
                    continue

                if arg_3.startswith(">"):
                    # Add contig header to contig dictionary
                    arg_2 = arg_3[1:].strip()
                    arg_0.contigs[arg_2] = []

                else:
                    # Add sequence string for the current contig
                    arg_0.contigs[arg_2].append(arg_3.strip())

            # After populating the contigs dictionary, convert the values
            # list into a string sequence
            arg_0.contigs = OrderedDict(
                (arg_2, "".join(seq)) for arg_2, seq in arg_0.contigs.items())

Parse an assembly file in fasta format .


Log msg at 'verbose' level, debug < verbose < info

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_0 . log ( logging . VERBOSE , arg_1 , * arg_2 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Log msg at 'Func' level, debug < Func < info"""
        arg_0.log(logging.VERBOSE, arg_1, *arg_2, **arg_3)

Log msg at verbose level debug < verbose < info


def Func ( arg_0 ) : arg_1 = list ( ) if os . path . isdir ( arg_0 ) : for arg_2 in os . listdir ( arg_0 ) : arg_3 = os . path . join ( arg_0 , arg_2 ) if os . path . isfile ( os . path . join ( arg_3 , MODULE_INIT_FILE ) ) : arg_4 = _search_for_modules ( arg_3 , True , arg_2 ) arg_1 . extend ( arg_4 ) return arg_1

def Func(arg_0):
    """
    Attempts to list all of the modules and submodules found within a given
    directory tree. This function recursively searches the directory tree
    for potential python modules and returns a list of candidate names.

    **Note:** This function returns a list of strings representing
    discovered module names, not the actual, loaded modules.

    :param directory: the directory to search for modules.
    """
    arg_1 = list()

    if os.path.isdir(arg_0):
        for arg_2 in os.listdir(arg_0):
            arg_3 = os.path.join(arg_0, arg_2)

            # Scan only if there's an __init__.py file
            if os.path.isfile(os.path.join(arg_3, MODULE_INIT_FILE)):
                arg_4 = _search_for_modules(arg_3, True, arg_2)
                arg_1.extend(arg_4)

    return arg_1

Attempts to list all of the modules and submodules found within a given directory tree . This function recursively searches the directory tree for potential python modules and returns a list of candidate names .


def
Func
(
arg_0
,
arg_1
:
arg_2
)
->
PriceModel
:
arg_1
=
arg_1
.
rstrip
(
)
arg_3
=
arg_1
.
split
(
','
)
arg_4
=
PriceModel
(
)
arg_4
.
symbol
=
arg_0
.
translate_symbol
(
arg_3
[
0
]
)
arg_4
.
value
=
Decimal
(
arg_3
[
1
]
)
arg_7
=
arg_3
[
2
]
arg_7
=
arg_7
.
replace
(
'"'
,
''
)
arg_8
=
arg_7
.
split
(
'/'
)
arg_9
=
arg_8
[
2
]
arg_10
=
arg_8
[
1
]
arg_11
=
arg_8
[
0
]
logging
.
debug
(
f"parsing {date_parts} into date"
)
arg_4
.
datetime
=
arg_12
(
int
(
arg_9
)
,
int
(
arg_10
)
,
int
(
arg_11
)
)
return
arg_4

def Func(arg_0, arg_1: arg_2) -> PriceModel:
        """ Parse a CSV line into a price element """
        arg_1 = arg_1.rstrip()
        arg_3 = arg_1.split(',')

        arg_4 = PriceModel()

        # symbol
        arg_4.symbol = arg_0.translate_symbol(arg_3[0])

        # value
        arg_4.value = Decimal(arg_3[1])

        # date
        arg_7 = arg_3[2]
        arg_7 = arg_7.replace('"', '')
        arg_8 = arg_7.split('/')

        arg_9 = arg_8[2]
        arg_10 = arg_8[1]
        arg_11 = arg_8[0]

        logging.debug(f"parsing {date_parts} into date")
        arg_4.datetime = arg_12(int(arg_9), int(arg_10), int(arg_11))

        return arg_4


(session, project_ids=[], milestone_ids=[], user_details=None, limit=10, offset=0)

def Func ( arg_0 , arg_1 = [ ] , arg_2 = [ ] , arg_3 = None , arg_4 = 10 , arg_5 = 0 ) : arg_6 = { } if arg_2 : arg_6 [ 'milestones[]' ] = arg_2 if arg_1 : arg_6 [ 'projects[]' ] = arg_1 arg_6 [ 'limit' ] = arg_4 arg_6 [ 'offset' ] = arg_5 if arg_3 : arg_6 . update ( arg_3 ) arg_7 = make_get_request ( arg_0 , 'milestones' , params_data = arg_6 ) arg_8 = arg_7 . json ( ) if arg_7 . status_code == 200 : return arg_8 [ 'result' ] else : raise MilestonesNotFoundException ( message = arg_8 [ 'message' ] , error_code = arg_8 [ 'error_code' ] , request_id = arg_8 [ 'request_id' ] )

def Func(arg_0, arg_1=[], arg_2=[], arg_3=None, arg_4=10, arg_5=0):
    """
    Get the list of milestones
    """
    arg_6 = {}
    if arg_2:
        arg_6['milestones[]'] = arg_2
    if arg_1:
        arg_6['projects[]'] = arg_1
    arg_6['limit'] = arg_4
    arg_6['offset'] = arg_5

    # Add projections if they exist
    if arg_3:
        arg_6.update(arg_3)

    # GET /api/projects/0.1/milestones/

    arg_7 = make_get_request(
        arg_0, 'milestones', params_data=arg_6)
    arg_8 = arg_7.json()
    if arg_7.status_code == 200:
        return arg_8['result']
    else:
        raise MilestonesNotFoundException(
            message=arg_8['message'],
            error_code=arg_8['error_code'],
            request_id=arg_8['request_id']
        )


def Func(arg_0, arg_1, arg_2):
    """ Update the results string and last-update-time fields of a model.

    Parameters:
    ----------------------------------------------------------------
    jobID:      job ID of model to modify
    results:    new results (json dict string)
    """
    with ConnectionFactory.get() as conn:
      arg_3 = 'UPDATE %s SET _eng_last_update_time=UTC_TIMESTAMP(), ' \
              '              results=%%s ' \
              '          WHERE job_id=%%s' % (arg_0.jobsTableName,)
      conn.cursor.execute(arg_3, [arg_2, arg_1])

Update the results string and last - update - time fields of a model .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 [ 'event_type' ] arg_3 = heat_customer_process . get ( arg_2 ) if arg_3 is not None : arg_3 ( arg_0 , arg_1 ) else : arg_4 = False arg_5 = None for arg_6 in heat_customer_process_wildcard . keys ( ) : if arg_6 . match ( arg_2 ) : arg_5 = heat_customer_process_wildcard . get ( arg_6 ) arg_4 = True break if arg_4 : arg_5 ( arg_0 , arg_1 ) else : default_process ( arg_0 , arg_1 ) arg_1 . ack ( )

def Func(arg_0, arg_1):
    """
    This function deal with the heat notification.

    First, find process from customer_process that not include wildcard.
    if not find from customer_process, then find process from customer_process_wildcard.
    if not find from customer_process_wildcard, then use ternya default process.
    :param body: dict of openstack notification.
    :param message: kombu Message class
    :return:
    """
    arg_2 = arg_0['event_type']
    arg_3 = heat_customer_process.get(arg_2)
    if arg_3 is not None:
        arg_3(arg_0, arg_1)
    else:
        arg_4 = False
        arg_5 = None
        for arg_6 in heat_customer_process_wildcard.keys():
            if arg_6.match(arg_2):
                arg_5 = heat_customer_process_wildcard.get(arg_6)
                arg_4 = True
                break
        if arg_4:
            arg_5(arg_0, arg_1)
        else:
            default_process(arg_0, arg_1)
    arg_1.ack()

This function deal with the heat notification .


(classifier,
                          classlabels,
                          outfile)

def Func(arg_0,
                          arg_1,
                          arg_2):
    '''This plots the training results from the classifier run on the training
    set.

    - plots the confusion matrix

    - plots the feature importances

    - FIXME: plot the learning curves too, see:
      http://scikit-learn.org/stable/modules/learning_curve.html

    Parameters
    ----------

    classifier : dict or str
        This is the output dict or pickle created by `get_rf_classifier`
        containing the trained classifier.

    classlabels : list of str
        This contains all of the class labels for the current classification
        problem.

    outfile : str
        This is the filename where the plots will be written.

    Returns
    -------

    str
        The path to the generated plot file.

    '''

    if isinstance(arg_0,str) and os.path.exists(arg_0):
        with open(arg_0,'rb') as infd:
            arg_3 = pickle.load(infd)
    elif isinstance(arg_0, dict):
        arg_3 = arg_0
    else:
        LOGERROR("can't figure out the input classifier arg")
        return None

    arg_4 = arg_3['best_confmatrix']
    arg_5 = arg_3[
        'best_classifier'
    ].feature_importances_
    arg_6 = np.array([
        tree.feature_importances_
        for tree in arg_3['best_classifier'].estimators_
    ])
    arg_7 = np.std(arg_6,axis=0)

    arg_8 = np.array(arg_3['feature_names'])

    plt.figure(figsize=(6.4*3.0,4.8))

    # confusion matrix
    plt.subplot(121)
    arg_9 = np.array(arg_1)
    plt.imshow(arg_4, interpolation='nearest', cmap=plt.cm.Blues)
    arg_10 = np.arange(len(arg_9))
    plt.xticks(arg_10, arg_9)
    plt.yticks(arg_10, arg_9)
    plt.title('evaluation set confusion matrix')
    plt.ylabel('predicted class')
    plt.xlabel('actual class')

    arg_11 = arg_4.max() / 2.
    for arg_12, arg_13 in itertools.product(range(arg_4.shape[0]),
                                  range(arg_4.shape[1])):
        plt.text(arg_13, arg_12, arg_4[arg_12, arg_13],
                 horizontalalignment="center",
                 color="white" if arg_4[arg_12, arg_13] > arg_11 else "black")

    # feature importances
    plt.subplot(122)

    arg_14 = np.array(arg_8)
    arg_15 = np.argsort(arg_5)[::-1]

    arg_14 = arg_14[arg_15]
    arg_8 = arg_8[arg_15]
    arg_5 = arg_5[arg_15]
    arg_7 = arg_7[arg_15]

    plt.bar(np.arange(0,arg_14.size),
            arg_5,
            yerr=arg_7,
            width=0.8,
            color='grey')
    plt.xticks(np.arange(0,arg_14.size),
               arg_14,
               rotation=90)
    plt.yticks([0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0])
    plt.xlim(-0.75, arg_14.size - 1.0 + 0.75)
    plt.ylim(0.0,0.9)
    plt.ylabel('relative importance')
    plt.title('relative importance of features')

    plt.subplots_adjust(wspace=0.1)

    plt.savefig(arg_2,
                bbox_inches='tight',
                dpi=100)
    plt.close('all')
    return arg_2

This plots the training results from the classifier run on the training set .


def Func ( arg_0 ) : arg_1 = { } for arg_2 in arg_0 . fields : arg_1 [ arg_2 . name ] = arg_2 . Func ( arg_0 . data . get ( arg_2 . name ) ) return arg_1

def Func(arg_0):
        """Return JSON representation for this template"""
        arg_1 = {}

        for arg_2 in arg_0.fields:
            arg_1[arg_2.name] = arg_2.Func(arg_0.data.get(arg_2.name))

        return arg_1


def Func ( arg_0 , ** arg_1 ) : arg_2 = super ( RenderWidgetMixin , arg_0 ) . Func ( ** arg_1 ) arg_2 . update ( { 'is_rendered' : True , 'widget' : arg_0 . widget , } ) arg_2 . update ( arg_0 . widget . Func ( ) ) return arg_2

def Func(arg_0, **arg_1):
        """
        Adds ``is_rendered`` to the context and the widget's context data.

        ``is_rendered`` signals that the AJAX view has been called and that
        we are displaying the full widget now. When ``is_rendered`` is not
        found in the widget template it means that we are seeing the first
        page load and all widgets still have to get their real data from
        this AJAX view.

        """
        arg_2 = super(RenderWidgetMixin, arg_0).Func(**arg_1)
        arg_2.update({
            'is_rendered': True,
            'widget': arg_0.widget,
        })
        arg_2.update(arg_0.widget.Func())
        return arg_2

Adds is_rendered to the context and the widget s context data .


def
Func
(
arg_0
,
arg_1
=
'utf-8'
)
:
if
six
.
PY2
:
if
isinstance
(
arg_0
,
str
)
:
return
arg_0
elif
isinstance
(
arg_0
,
unicode
)
:
return
arg_0
.
encode
(
arg_1
)
else
:
if
isinstance
(
arg_0
,
bytes
)
:
return
arg_0
elif
isinstance
(
arg_0
,
str
)
:
return
arg_0
.
encode
(
arg_1
)
raise
TypeError
(
"Invalid argument %r for Func()"
%
(
arg_0
,
)
)

def Func(arg_0, arg_1='utf-8'):
        """
        Returns the given string as a string of bytes. That means in
        Python2 as a str object, and in Python3 as a bytes object.
        Raises a TypeError, if it cannot be converted.
        """
        if six.PY2:
            # This is Python2
            if isinstance(arg_0, str):
                return arg_0
            elif isinstance(arg_0, unicode):  # noqa, pylint: disable=undefined-variable
                return arg_0.encode(arg_1)
        else:
            # And this is Python3
            if isinstance(arg_0, bytes):
                return arg_0
            elif isinstance(arg_0, str):
                return arg_0.encode(arg_1)

        raise TypeError("Invalid argument %r for Func()" % (arg_0,))

Returns the given string as a string of bytes . That means in Python2 as a str object and in Python3 as a bytes object . Raises a TypeError if it cannot be converted .


def Func ( arg_0 ) : if arg_0 . muc_child : arg_0 . muc_child . free_borrowed ( ) arg_0 . muc_child = None if not arg_0 . xmlnode . children : return arg_2 = arg_0 . xmlnode . children while arg_2 : if arg_2 . name not in ( "x" , "query" ) : arg_2 = arg_2 . next continue arg_3 = arg_2 . ns ( ) if not arg_3 : arg_2 = arg_2 . next continue arg_4 = arg_3 . getContent ( ) if arg_4 in ( MUC_NS , MUC_USER_NS , MUC_ADMIN_NS , MUC_OWNER_NS ) : arg_2 . unlinkNode ( ) arg_2 . freeNode ( ) arg_2 = arg_2 . next

def Func(arg_0):
        """
        Remove the MUC specific stanza payload element.
        """
        if arg_0.muc_child:
            arg_0.muc_child.free_borrowed()
            arg_0.muc_child=None
        if not arg_0.xmlnode.children:
            return
        arg_2=arg_0.xmlnode.children
        while arg_2:
            if arg_2.name not in ("x","query"):
                arg_2=arg_2.next
                continue
            arg_3=arg_2.ns()
            if not arg_3:
                arg_2=arg_2.next
                continue
            arg_4=arg_3.getContent()
            if arg_4 in (MUC_NS,MUC_USER_NS,MUC_ADMIN_NS,MUC_OWNER_NS):
                arg_2.unlinkNode()
                arg_2.freeNode()
            arg_2=arg_2.next

Remove the MUC specific stanza payload element .


(self,exc_tuple = None,filename=None,tb_offset=None,
                      exception_only=False)

def Func(arg_0,arg_1 = None,arg_2=None,arg_3=None,
                      arg_4=False):
        """Display the exception that just occurred.

        If nothing is known about the exception, this is the method which
        should be used throughout the code for presenting user tracebacks,
        rather than directly invoking the InteractiveTB object.

        A specific showsyntaxerror() also exists, but this method can take
        care of calling it if needed, so unless you are explicitly catching a
        SyntaxError exception, don't try to analyze the stack manually and
        simply call this method."""

        try:
            try:
                arg_5, arg_6, arg_7 = arg_0._get_exc_info(arg_1)
            except ValueError:
                arg_0.write_err('No traceback available to show.\n')
                return

            if arg_5 is SyntaxError:
                # Though this won't be called by syntax errors in the input
                # line, there may be SyntaxError cases with imported code.
                arg_0.showsyntaxerror(arg_2)
            elif arg_5 is UsageError:
                arg_0.write_err("UsageError: %s" % arg_6)
            else:
                if arg_4:
                    arg_8 = ['An exception has occurred, use %tb to see '
                           'the full traceback.\n']
                    arg_8.extend(arg_0.InteractiveTB.get_exception_only(arg_5,
                                                                     arg_6))
                else:
                    try:
                        # Exception classes can customise their traceback - we
                        # use this in IPython.parallel for exceptions occurring
                        # in the engines. This should return a list of strings.
                        arg_8 = arg_6._render_traceback_()
                    except Exception:
                        arg_8 = arg_0.InteractiveTB.structured_traceback(arg_5,
                                            arg_6, arg_7, arg_3=arg_3)

                    arg_0._Func(arg_5, arg_6, arg_8)
                    if arg_0.call_pdb:
                        # drop into debugger
                        arg_0.debugger(force=True)
                    return

                # Actually show the traceback
                arg_0._Func(arg_5, arg_6, arg_8)

        except KeyboardInterrupt:
            arg_0.write_err("\nKeyboardInterrupt\n")

Display the exception that just occurred .


(script, major_radius=3.0, minor_radius=1.0, inner_diameter=None,
          outer_diameter=None, major_segments=48, minor_segments=12,
          color=None)

def
Func
(
arg_0
,
arg_1
=
3.0
,
arg_2
=
1.0
,
arg_3
=
,
arg_4
=
,
arg_5
=
48
,
arg_6
=
12
,
arg_7
=
)
:
if
arg_3
is
not
and
arg_4
is
not
:
arg_1
=
(
arg_3
+
arg_4
)
/
4
arg_2
=
arg_1
arg_3
/
2
arg_8
=
''
.
join
(
[
'  <filter name="Torus">\n'
,
'    <Param name="hRadius" '
,
'value="%s" '
%
arg_1
,
'description="Horizontal Radius" '
,
'type="RichFloat" '
,
'/>\n'
,
'    <Param name="vRadius" '
,
'value="%s" '
%
arg_2
,
'description="Vertical Radius" '
,
'type="RichFloat" '
,
'/>\n'
,
'    <Param name="hSubdiv" '
,
'value="%d" '
%
arg_5
,
'description="Horizontal Subdivision" '
,
'type="RichInt" '
,
'/>\n'
,
'    <Param name="vSubdiv" '
,
'value="%d" '
%
arg_6
,
'description="Vertical Subdivision" '
,
'type="RichInt" '
,
'/>\n'
,
'  </filter>\n'
]
)
util
.
write_filter
(
arg_0
,
arg_8
)
if
isinstance
(
arg_0
,
FilterScript
)
:
arg_0
.
add_layer
(
'Torus'
,
change_layer
=
True
)
if
arg_7
is
not
:
vert_color
.
function
(
arg_0
,
arg_7
=
arg_7
)
return

def Func(arg_0, arg_1=3.0, arg_2=1.0, arg_3=None,
          arg_4=None, arg_5=48, arg_6=12,
          arg_7=None):
    """Create a Func mesh

    Args:
        major_radius (float, (optional)): radius from the origin to the
            center of the cross sections
        minor_radius (float, (optional)): radius of the Func cross
            section
        inner_diameter (float, (optional)): inner diameter of Func. If
            both inner_diameter and outer_diameter are provided then
            these will override major_radius and minor_radius.,
        outer_diameter (float, (optional)): outer diameter of Func. If
            both inner_diameter and outer_diameter are provided then
            these will override major_radius and minor_radius.
        major_segments (int (optional)): number of segments for the main
            ring of the Func
        minor_segments (int (optional)): number of segments for the minor
            ring of the Func
        color (str (optional)): color name to apply vertex colors to the
            newly created mesh

    Returns:
        None

    """
    if arg_3 is not None and arg_4 is not None:
        arg_1 = (arg_3 + arg_4) / 4
        arg_2 = arg_1 - arg_3 / 2
        # Ref: inner_diameter = 2 * (major_radius - minor_radius)
        # Ref: outer_diameter = 2 * (major_radius + minor_radius)
    arg_8 = ''.join([
        '  <filter name="Torus">\n',
        '    <Param name="hRadius" ',
        'value="%s" ' % arg_1,
        'description="Horizontal Radius" ',
        'type="RichFloat" ',
        '/>\n',
        '    <Param name="vRadius" ',
        'value="%s" ' % arg_2,
        'description="Vertical Radius" ',
        'type="RichFloat" ',
        '/>\n',
        '    <Param name="hSubdiv" ',
        'value="%d" ' % arg_5,
        'description="Horizontal Subdivision" ',
        'type="RichInt" ',
        '/>\n',
        '    <Param name="vSubdiv" ',
        'value="%d" ' % arg_6,
        'description="Vertical Subdivision" ',
        'type="RichInt" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(arg_0, arg_8)
    if isinstance(arg_0, FilterScript):
        arg_0.add_layer('Torus', change_layer=True)
    if arg_7 is not None:
        vert_color.function(arg_0, arg_7=arg_7)
    return None

Create a torus mesh

    Args:
        major_radius (float, (optional)): radius from the origin to the
            center of the cross sections
        minor_radius (float, (optional)): radius of the torus cross
            section
        inner_diameter (float, (optional)): inner diameter of torus. If
            both inner_diameter and outer_diameter are provided then
            these will override major_radius and minor_radius.,
        outer_diameter (float, (optional)): outer diameter of torus. If
            both inner_diameter and outer_diameter are provided then
            these will override major_radius and minor_radius.
        major_segments (int (optional)): number of segments for the main
            ring of the torus
        minor_segments (int (optional)): number of segments for the minor
            ring of the torus
        color (str (optional)): color name to apply vertex colors to the
            newly created mesh

    Returns:
        None


def Func(arg_0, arg_1, arg_2, arg_3):  # pylint: disable=invalid-name,unused-argument
        """
        Return the metadata for the specified program.

        The program needs to be included in the specified EnterpriseCustomerCatalog
        in order for metadata to be returned from this endpoint.
        """
        arg_4 = arg_0.get_object()
        arg_5 = arg_4.get_program(arg_3)
        if not arg_5:
            raise Http404

        arg_6 = arg_0.get_serializer_context()
        arg_6['enterprise_customer_catalog'] = arg_4
        arg_7 = serializers.ProgramDetailSerializer(arg_5, arg_6=arg_6)
        return Response(arg_7.data)

Return the metadata for the specified program .


def Func(arg_0, arg_1):
        """
        Output code coverage Func.
        """
        log.debug("Coverage Func")
        arg_0.coverInstance.stop()
        arg_0.coverInstance.combine()
        arg_0.coverInstance.save()
        arg_2 = [module
                    for name, module in sys.modules.items()
                    if arg_0.wantModuleCoverage(name, module)]
        log.debug("Coverage Func will cover modules: %s", arg_2)
        arg_0.coverInstance.Func(arg_2, file=arg_1)
        if arg_0.coverHtmlDir:
            log.debug("Generating HTML coverage Func")
            arg_0.coverInstance.html_Func(arg_2, arg_0.coverHtmlDir)
        if arg_0.coverXmlFile:
            log.debug("Generating XML coverage Func")
            arg_0.coverInstance.xml_Func(arg_2, arg_0.coverXmlFile)

        # make sure we have minimum required coverage
        if arg_0.coverMinPercentage:
            arg_3 = StringIO.StringIO()
            arg_0.coverInstance.Func(arg_2, file=arg_3)
            arg_4 = re.search(r'-------\s\w+\s+\d+\s+\d+\s+(\d+)%\s+\d*\s{0,1}$', arg_3.getvalue())
            if arg_4:
                arg_5 = int(arg_4.groups()[0])
                if arg_5 < arg_0.coverMinPercentage:
                    log.error('TOTAL Coverage did not reach minimum '
                              'required: %d%%' % arg_0.coverMinPercentage)
                    sys.exit(1)
            else:
                log.error("No total percentage was found in coverage output, "
                          "something went wrong.")


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 [ : , 'X' ] if isinstance ( arg_1 , DictRDD ) else arg_1 check_rdd ( arg_2 , ( np . ndarray , sp . spmatrix ) ) if arg_0 . init == 'k-means||' : arg_0 . _mllib_model = MLlibKMeans . train ( arg_2 . unblock ( ) , arg_0 . n_clusters , maxIterations = arg_0 . max_iter , initializationMode = "k-means||" ) arg_0 . cluster_centers_ = arg_0 . _mllib_model . centers else : arg_5 = arg_2 . map ( lambda arg_2 : super ( SparkKMeans , arg_0 ) . Func ( arg_2 ) ) arg_5 = arg_5 . map ( lambda model : model . cluster_centers_ ) . collect ( ) return super ( SparkKMeans , arg_0 ) . Func ( np . concatenate ( arg_5 ) )

def Func(arg_0, arg_1):
        """Compute k-means clustering.

        Parameters
        ----------
        Z : ArrayRDD or DictRDD containing array-like or sparse matrix
            Train data.

        Returns
        -------
        self
        """
        arg_2 = arg_1[:, 'X'] if isinstance(arg_1, DictRDD) else arg_1
        check_rdd(arg_2, (np.ndarray, sp.spmatrix))
        if arg_0.init == 'k-means||':
            arg_0._mllib_model = MLlibKMeans.train(
                arg_2.unblock(),
                arg_0.n_clusters,
                maxIterations=arg_0.max_iter,
                initializationMode="k-means||")
            arg_0.cluster_centers_ = arg_0._mllib_model.centers
        else:
            arg_5 = arg_2.map(lambda arg_2: super(SparkKMeans, arg_0).Func(arg_2))
            arg_5 = arg_5.map(lambda model: model.cluster_centers_).collect()
            return super(SparkKMeans, arg_0).Func(np.concatenate(arg_5))


def Func(arg_0, arg_1, arg_2, arg_3):
        """Recursive calculation of scene bbox"""
        if arg_0.matrix is not None:
            arg_1 = matrix44.multiply(arg_0.matrix, arg_1)

        if arg_0.mesh:
            arg_2, arg_3 = arg_0.mesh.Func(arg_1, arg_2, arg_3)

        for arg_4 in arg_0.children:
            arg_2, arg_3 = arg_4.Func(arg_1, arg_2, arg_3)

        return arg_2, arg_3


def Func(arg_0):
    """Return best block selected based on simple heuristic."""
    # TODO make this cleverer with more stats
    if not arg_0:
        raise ValueError("No suitable blocks were found in assembly.")
    arg_1 = max(arg_0, key=lambda b: b[1]['packed_instr'])
    if arg_1[1]['packed_instr'] == 0:
        arg_1 = max(arg_0,
                         key=lambda b: (b[1]['ops'] + b[1]['packed_instr'] + b[1]['avx_instr'],
                                        b[1]['ZMM'], b[1]['YMM'], b[1]['XMM']))
    return arg_1[0]

Return best block selected based on simple heuristic .


def
Func
(
arg_0
)
:
arg_1
=
{
"description"
:
IdentityRegion
.
__doc__
,
"singleNodeOnly"
:
True
,
"inputs"
:
{
"in"
:
{
"description"
:
"The input vector."
,
"dataType"
:
"Real32"
,
"count"
:
0
,
"required"
:
True
,
"regionLevel"
:
False
,
"isDefaultInput"
:
True
,
"requireSplitterMap"
:
False
}
,
}
,
"outputs"
:
{
"out"
:
{
"description"
:
"A copy of the input vector."
,
"dataType"
:
"Real32"
,
"count"
:
0
,
"regionLevel"
:
True
,
"isDefaultOutput"
:
True
}
,
}
,
"parameters"
:
{
"dataWidth"
:
{
"description"
:
"Size of inputs"
,
"accessMode"
:
"Read"
,
"dataType"
:
"UInt32"
,
"count"
:
1
,
"constraints"
:
""
}
,
}
,
}
return
arg_1

def Func(arg_0):
    """Return the Spec for IdentityRegion.
    """
    arg_1 = {
        "description":IdentityRegion.__doc__,
        "singleNodeOnly":True,
        "inputs":{
          "in":{
            "description":"The input vector.",
            "dataType":"Real32",
            "count":0,
            "required":True,
            "regionLevel":False,
            "isDefaultInput":True,
            "requireSplitterMap":False},
        },
        "outputs":{
          "out":{
            "description":"A copy of the input vector.",
            "dataType":"Real32",
            "count":0,
            "regionLevel":True,
            "isDefaultOutput":True},
        },

        "parameters":{
          "dataWidth":{
            "description":"Size of inputs",
            "accessMode":"Read",
            "dataType":"UInt32",
            "count":1,
            "constraints":""},
        },
    }

    return arg_1


(self, metric_name, datapoint, tags=None, type_=None, interval=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_6 = api . Metric . send ( metric = arg_1 , points = arg_2 , host = arg_0 . host , arg_3 = arg_3 , type = arg_4 , arg_5 = arg_5 ) arg_0 . validate_response ( arg_6 ) return arg_6

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None):
        """
        Sends a single datapoint metric to DataDog

        :param metric_name: The name of the metric
        :type metric_name: str
        :param datapoint: A single integer or float related to the metric
        :type datapoint: int or float
        :param tags: A list of tags associated with the metric
        :type tags: list
        :param type_: Type of your metric: gauge, rate, or count
        :type type_: str
        :param interval: If the type of the metric is rate or count, define the corresponding interval
        :type interval: int
        """
        arg_6 = api.Metric.send(
            metric=arg_1,
            points=arg_2,
            host=arg_0.host,
            arg_3=arg_3,
            type=arg_4,
            arg_5=arg_5)

        arg_0.validate_response(arg_6)
        return arg_6


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
settings
.
YOUTUBE_DELETE_REDIRECT_URL
except
AttributeError
:
arg_2
=
reverse
(
"django_youtube.views.upload"
)
try
:
Video
.
objects
.
get
(
arg_1
=
arg_1
)
.
delete
(
)
except
:
from
django
.
contrib
import
messages
messages
.
add_message
(
arg_0
,
messages
.
ERROR
,
_
(
'Video could not be deleted.'
)
)
return
HttpResponseRedirect
(
arg_2
)

def Func(arg_0, arg_1):
    """
    Removes the video from youtube and from db
    Requires POST
    """

    # prepare redirection url
    try:
        arg_2 = settings.YOUTUBE_DELETE_REDIRECT_URL
    except AttributeError:
        arg_2 = reverse("django_youtube.views.upload")

    # Remove from db
    try:
        Video.objects.get(arg_1=arg_1).delete()
    except:
        from django.contrib import messages
        messages.add_message(
            arg_0, messages.ERROR, _('Video could not be deleted.'))

    # Return to upload page or specified page
    return HttpResponseRedirect(arg_2)


def Func(arg_0, arg_1):
        '''
        Transforms X according to the linear Funcation corresponding to
        flipping the input eigenvalues.

        Parameters
        ----------
        X : array, shape [n_test, n]
            The test similarities to training points.

        Returns
        -------
        Xt : array, shape [n_test, n]
            The Funced test similarites to training points.
        '''
        arg_2 = arg_0.flip_.shape[0]
        if arg_1.ndim != 2 or arg_1.shape[1] != arg_2:
            arg_3 = "X should have {} columns, the number of samples at fit time"
            raise TypeError(arg_3.format(arg_0.flip_.shape[0]))
        return np.dot(arg_1, arg_0.flip_)

Transforms X according to the linear transformation corresponding to
        flipping the input eigenvalues.

        Parameters
        ----------
        X : array, shape [n_test, n]
            The test similarities to training points.

        Returns
        -------
        Xt : array, shape [n_test, n]
            The transformed test similarites to training points.

Transforms X according to the linear transformation corresponding to flipping the input eigenvalues .


return BoltArraySpark(rdd, shape=newshape, split=newsplit, ordered=self._ordered, dtype="object")

def Func ( arg_0 , arg_1 ) : def process_record ( arg_2 ) : arg_3 = empty ( 1 , dtype = "object" ) arg_3 [ 0 ] = arg_1 ( arg_2 ) return arg_3 arg_4 = arg_0 . _rdd . mapValues ( process_record ) arg_5 = arg_0 . getnumber ( arg_0 . plan , arg_0 . vshape ) arg_6 = tuple ( [ int ( s ) for s in r_ [ arg_0 . kshape , arg_5 ] ] ) arg_7 = len ( arg_0 . shape ) return BoltArraySpark ( arg_4 , shape = arg_6 , split = arg_7 , ordered = arg_0 . _ordered , dtype = "object" )

def Func(arg_0, arg_1):
        """
        Apply a generic array -> object to each subarray

        The resulting object is a BoltArraySpark of dtype object where the
        blocked dimensions are replaced with indices indication block ID.
        """
        def process_record(arg_2):
            arg_3 = empty(1, dtype="object")
            arg_3[0]  = arg_1(arg_2)
            return arg_3

        arg_4 = arg_0._rdd.mapValues(process_record)

        arg_5 = arg_0.getnumber(arg_0.plan, arg_0.vshape)
        arg_6 = tuple([int(s) for s in r_[arg_0.kshape, arg_5]])
        arg_7 = len(arg_0.shape)
        return BoltArraySpark(arg_4, shape=arg_6, split=arg_7, ordered=arg_0._ordered, dtype="object")

Apply a generic array - > object to each subarray


def
Func
(
arg_0
,
arg_1
)
:
arg_1
=
iter
(
arg_1
)
try
:
arg_2
=
0
for
arg_3
in
range
(
arg_0
.
operand_size
)
:
arg_2
<<=
8
arg_2
|=
next
(
arg_1
)
arg_0
.
_operand
=
arg_2
except
StopIteration
:
raise
ParseError
(
"Not enough data for decoding"
)

def Func(arg_0, arg_1):
        """ Parses an operand from buf

            :param buf: a buffer
            :type buf: iterator/generator/string
        """
        arg_1 = iter(arg_1)
        try:
            arg_2 = 0
            for arg_3 in range(arg_0.operand_size):
                arg_2 <<= 8
                arg_2 |= next(arg_1)
            arg_0._operand = arg_2
        except StopIteration:
            raise ParseError("Not enough data for decoding")


def Func(arg_0, arg_1, arg_2=False):
		'''
			Func - Compare the field values on two IndexedRedisModels.

			@param firstObj <IndexedRedisModel instance> - First object (or self)

			@param otherObj <IndexedRedisModel instance> - Second object

			@param includeMeta <bool> - If meta information (like pk) should be in the Func results.

			@return <dict> - Dict of  'field' : ( value_firstObjForField, value_otherObjForField ).

				Keys are names of fields with Funcerent values.
				Value is a tuple of ( value_firstObjForField, value_otherObjForField )

			Can be called statically, like: IndexedRedisModel.Func ( obj1, obj2 )

			  or in reference to an obj   : obj1.Func(obj2)
		'''

		if not isIndexedRedisModel(arg_0):
			raise ValueError('Type < %s > does not extend IndexedRedisModel.' %( type(arg_0).__name__ , ) )
		if not isIndexedRedisModel(arg_1):
			raise ValueError('Type < %s > does not extend IndexedRedisModel.' %( type(arg_1).__name__ , ) )

		arg_0.validateModel()
		arg_1.validateModel()

		# Types may not match, but could be subclass, special copy class (like connectAlt), etc.
		#   So check if FIELDS matches, and if so, we can continue.
		if getattr(arg_0, 'FIELDS') != getattr(arg_1, 'FIELDS'):
			# NOTE: Maybe we should iterate here and compare just that field types and names match?
			#   In case a copy changes a default or something, we would still be able to Func..
			raise ValueError('Cannot compare  < %s > and < %s > . Must be same model OR have equal FIELDS.' %( arg_0.__class__, arg_1.__class__) )

		arg_3 = {}

		for arg_4 in arg_0.FIELDS:

			arg_5 = str(arg_4)

			arg_6 = object.__getattribute__( arg_0, arg_5 )
			arg_7 = object.__getattribute__( arg_1, arg_5 )

			if arg_6 != arg_7:
				arg_3[ arg_5 ] = ( (arg_6, arg_7) )

		if arg_2:
			arg_8 = arg_0.getPk()
			arg_9 = arg_1.getPk()
			if arg_8 != arg_9:
				arg_3['_id'] = ( arg_8, arg_9 )

		return arg_3

diff - Compare the field values on two IndexedRedisModels.

			@param firstObj <IndexedRedisModel instance> - First object (or self)

			@param otherObj <IndexedRedisModel instance> - Second object

			@param includeMeta <bool> - If meta information (like pk) should be in the diff results.

			@return <dict> - Dict of  'field' : ( value_firstObjForField, value_otherObjForField ).

				Keys are names of fields with different values.
				Value is a tuple of ( value_firstObjForField, value_otherObjForField )

			Can be called statically, like: IndexedRedisModel.diff ( obj1, obj2 )

			  or in reference to an obj   : obj1.diff(obj2)

diff - Compare the field values on two IndexedRedisModels .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
__exchange
(
'send("{filename}")'
.
format
(
arg_1
=
arg_1
)
)
if
(
'unexpected'
in
arg_2
)
or
(
'stdin'
in
arg_2
)
:
log
.
error
(
'Unexpected error downloading file: %s'
,
arg_2
)
raise
Exception
(
'Unexpected error downloading file'
)
arg_0
.
__write
(
'C'
)
arg_3
=
arg_0
.
__expect
(
NUL
)
.
strip
(
)
log
.
info
(
'receiveing '
+
arg_3
)
arg_0
.
__write
(
ACK
,
True
)
arg_4
=
''
arg_5
=
''
arg_6
,
arg_4
=
arg_0
.
__read_chunk
(
arg_4
)
while
arg_6
!=
''
:
arg_0
.
__write
(
ACK
,
True
)
arg_5
=
arg_5
+
arg_6
arg_6
,
arg_4
=
arg_0
.
__read_chunk
(
arg_4
)
return
arg_5

def Func(arg_0, arg_1):
        """Download a file from device to local filesystem"""
        arg_2 = arg_0.__exchange('send("{filename}")'.format(arg_1=arg_1))
        if ('unexpected' in arg_2) or ('stdin' in arg_2):
            log.error('Unexpected error downloading file: %s', arg_2)
            raise Exception('Unexpected error downloading file')

        #tell device we are ready to receive
        arg_0.__write('C')
        #we should get a NUL terminated filename to start with
        arg_3 = arg_0.__expect(NUL).strip()
        log.info('receiveing ' + arg_3)

        #ACK to start download
        arg_0.__write(ACK, True)
        arg_4 = ''

        arg_5 = ''
        arg_6, arg_4 = arg_0.__read_chunk(arg_4)
        #read chunks until we get an empty which is the end
        while arg_6 != '':
            arg_0.__write(ACK, True)
            arg_5 = arg_5 + arg_6
            arg_6, arg_4 = arg_0.__read_chunk(arg_4)
        return arg_5


def
Func
(
arg_0
)
:
arg_1
,
arg_2
,
arg_3
=
get_job_or_local
(
arg_0
.
obj
.
get
(
'project'
)
,
arg_0
.
obj
.
get
(
'job'
)
)
try
:
PolyaxonClient
(
)
.
job
.
download_Func
(
arg_1
,
arg_2
,
arg_3
)
except
(
PolyaxonHTTPError
,
PolyaxonShouldExitError
,
PolyaxonClientException
)
as
e
:
Printer
.
print_error
(
'Could not download Func for job `{}`.'
.
format
(
arg_3
)
)
Printer
.
print_error
(
'Error message `{}`.'
.
format
(
e
)
)
sys
.
exit
(
1
)
Printer
.
print_success
(
'Files downloaded.'
)

def Func(arg_0):
    """Download Func for job.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon job -j 1 Func
    ```
    """
    arg_1, arg_2, arg_3 = get_job_or_local(arg_0.obj.get('project'), arg_0.obj.get('job'))
    try:
        PolyaxonClient().job.download_Func(arg_1, arg_2, arg_3)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not download Func for job `{}`.'.format(arg_3))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)
    Printer.print_success('Files downloaded.')

Download outputs for job.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon job -j 1 outputs
    ```


(self, by, ascending=True, kind='quicksort')

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = 'quickFunc' ) : arg_0 = arg_0 . trim ( ) arg_4 = arg_0 . evaluate ( arg_1 , filtered = False ) arg_5 = np . argFunc ( arg_4 , arg_3 = arg_3 ) if not arg_2 : arg_5 = arg_5 [ : : - 1 ] . copy ( ) return arg_0 . take ( arg_5 )

def Func(arg_0, arg_1, arg_2=True, arg_3='quickFunc'):
        '''Return a Funced DataFrame, Funced by the expression 'by'

        {note_copy}

        {note_filter}

        Example:

        >>> import vaex, numpy as np
        >>> df = vaex.from_arrays(s=np.array(['a', 'b', 'c', 'd']), x=np.arange(1,5))
        >>> df['y'] = (df.x-1.8)**2
        >>> df
          #  s      x     y
          0  a      1  0.64
          1  b      2  0.04
          2  c      3  1.44
          3  d      4  4.84
        >>> df.Func('y', ascending=False)  # Note: passing '(x-1.8)**2' gives the same result
          #  s      x     y
          0  d      4  4.84
          1  c      3  1.44
          2  a      1  0.64
          3  b      2  0.04

        :param str or expression by: expression to Func by
        :param bool ascending: ascending (default, True) or descending (False)
        :param str kind: kind of algorithm to use (passed to numpy.argFunc)
        '''
        arg_0 = arg_0.trim()
        arg_4 = arg_0.evaluate(arg_1, filtered=False)
        arg_5 = np.argFunc(arg_4, arg_3=arg_3)
        if not arg_2:
            arg_5 = arg_5[::-1].copy()  # this may be used a lot, so copy for performance
        return arg_0.take(arg_5)

Return a sorted DataFrame, sorted by the expression 'by'

        {note_copy}

        {note_filter}

        Example:

        >>> import vaex, numpy as np
        >>> df = vaex.from_arrays(s=np.array(['a', 'b', 'c', 'd']), x=np.arange(1,5))
        >>> df['y'] = (df.x-1.8)**2
        >>> df
          #  s      x     y
          0  a      1  0.64
          1  b      2  0.04
          2  c      3  1.44
          3  d      4  4.84
        >>> df.sort('y', ascending=False)  # Note: passing '(x-1.8)**2' gives the same result
          #  s      x     y
          0  d      4  4.84
          1  c      3  1.44
          2  a      1  0.64
          3  b      2  0.04

        :param str or expression by: expression to sort by
        :param bool ascending: ascending (default, True) or descending (False)
        :param str kind: kind of algorithm to use (passed to numpy.argsort)

Return a sorted DataFrame sorted by the expression by


def Func(arg_0):
        """Load aggregation configurations."""
        arg_1 = {}
        for arg_2 in iter_entry_points(
                group=arg_0.entry_point_group_aggs):
            for arg_3 in arg_2.load()():
                if arg_3['aggregation_name'] not in arg_0.enabled_aggregations:
                    continue
                elif arg_3['aggregation_name'] in arg_1:
                    raise DuplicateAggregationError(
                        'Duplicate aggregation {0} in entry point '
                        '{1}'.format(arg_3['event_type'], arg_2.name))
                # Update the default configuration with env/overlay config.
                arg_3.update(
                    arg_0.enabled_aggregations[arg_3['aggregation_name']] or {}
                )
                arg_1[arg_3['aggregation_name']] = arg_3
        return arg_1


def
Func
(
arg_0
,
arg_1
)
:
if
not
isinstance
(
arg_1
,
integer_types
)
:
raise
TypeError
(
"state must be an integer"
)
_lib
.
SSL_Func
(
arg_0
.
_ssl
,
arg_1
)

def Func(arg_0, arg_1):
        """
        Set the shutdown state of the Connection.

        :param state: bitvector of SENT_SHUTDOWN, RECEIVED_SHUTDOWN.
        :return: None
        """
        if not isinstance(arg_1, integer_types):
            raise TypeError("state must be an integer")

        _lib.SSL_Func(arg_0._ssl, arg_1)

Set the shutdown state of the Connection .


return {
        'X-B3-TraceId': zipkin_attrs.trace_id,
        'X-B3-SpanId': generate_random_64bit_string(),
        'X-B3-ParentSpanId': zipkin_attrs.span_id,
        'X-B3-Flags': '0',
        'X-B3-Sampled': '1' if zipkin_attrs.is_sampled else '0',
    }

def Func(arg_0=None, arg_1=None):
    """
    Generate the headers for a new zipkin span.

    .. note::

        If the method is not called from within a zipkin_trace context,
        empty dict will be returned back.

    :returns: dict containing (X-B3-TraceId, X-B3-SpanId, X-B3-ParentSpanId,
                X-B3-Flags and X-B3-Sampled) keys OR an empty dict.
    """
    if arg_1:
        arg_2 = arg_1.get_zipkin_attrs()
    elif arg_0:
        arg_2 = arg_0.get()
    else:
        arg_2 = get_default_tracer().get_zipkin_attrs()

    if not arg_2:
        return {}

    return {
        'X-B3-TraceId': arg_2.trace_id,
        'X-B3-SpanId': generate_random_64bit_string(),
        'X-B3-ParentSpanId': arg_2.span_id,
        'X-B3-Flags': '0',
        'X-B3-Sampled': '1' if arg_2.is_sampled else '0',
    }

Generate the headers for a new zipkin span .


(self, X, y, cv=None, class_weight='auto')

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4='auto'):
        """ Fits X to outcomes y, using clf """

        # Incorporate error checking such as :
        # if isinstance(self.classifier, ScikitClassifier):
        #     do one thingNone
        # otherwiseNone.

        arg_0.X = arg_1
        arg_0.y = arg_2

        arg_0.set_class_weight(arg_4=arg_4, arg_2=arg_2)

        arg_0.clf = arg_0.clf.Func(arg_1, arg_2)

        return arg_0.clf


def Func ( arg_0 ) : from savReaderWriter import SavReader arg_1 = [ ] with SavReader ( arg_0 , returnHeader = True ) as reader : arg_2 = next ( reader ) for arg_3 in reader : arg_1 . append ( arg_3 ) return pd . DataFrame ( data = arg_1 , columns = arg_2 )

def Func(arg_0):
    """
    SPSS .sav files to Pandas DataFrame through savreader module

    :param input_file: string

    :return:
    """
    from savReaderWriter import SavReader
    arg_1 = []
    with SavReader(arg_0, returnHeader=True) as reader:
        arg_2 = next(reader)
        for arg_3 in reader:
            arg_1.append(arg_3)

    return pd.DataFrame(data=arg_1, columns=arg_2)

SPSS . sav files to Pandas DataFrame through savreader module


(self, node_type, name, node, confidence=interfaces.HIGH)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = arg_5 . HIGH ) : def _should_exempt_from_invalid_name ( arg_3 ) : if arg_1 == "variable" : arg_7 = utils . safe_infer ( arg_3 ) if isinstance ( arg_7 , astroid . ClassDef ) : return True return False if utils . is_inside_except ( arg_3 ) : arg_8 , arg_9 = utils . clobber_in_except ( arg_3 ) if arg_8 : return if arg_2 in arg_0 . config . good_names : return if arg_2 in arg_0 . config . bad_names : arg_0 . stats [ "badname_" + arg_1 ] += 1 arg_0 . add_message ( "blacklisted-name" , arg_3 = arg_3 , args = arg_2 ) return arg_10 = arg_0 . _name_regexps [ arg_1 ] arg_11 = arg_10 . match ( arg_2 ) if _is_multi_naming_match ( arg_11 , arg_1 , arg_4 ) : arg_12 = arg_0 . _find_name_group ( arg_1 ) arg_13 = arg_0 . _bad_names . setdefault ( arg_12 , { } ) arg_14 = arg_13 . setdefault ( arg_11 . lastgroup , [ ] ) arg_14 . append ( ( arg_3 , arg_1 , arg_2 , arg_4 ) ) if arg_11 is None and not _should_exempt_from_invalid_name ( arg_3 ) : arg_0 . _raise_name_warning ( arg_3 , arg_1 , arg_2 , arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=arg_5.HIGH):
        """check for a name using the type's regexp"""

        def _should_exempt_from_invalid_name(arg_3):
            if arg_1 == "variable":
                arg_7 = utils.safe_infer(arg_3)
                if isinstance(arg_7, astroid.ClassDef):
                    return True
            return False

        if utils.is_inside_except(arg_3):
            arg_8, arg_9 = utils.clobber_in_except(arg_3)
            if arg_8:
                return
        if arg_2 in arg_0.config.good_names:
            return
        if arg_2 in arg_0.config.bad_names:
            arg_0.stats["badname_" + arg_1] += 1
            arg_0.add_message("blacklisted-name", arg_3=arg_3, args=arg_2)
            return
        arg_10 = arg_0._name_regexps[arg_1]
        arg_11 = arg_10.match(arg_2)

        if _is_multi_naming_match(arg_11, arg_1, arg_4):
            arg_12 = arg_0._find_name_group(arg_1)
            arg_13 = arg_0._bad_names.setdefault(arg_12, {})
            arg_14 = arg_13.setdefault(arg_11.lastgroup, [])
            arg_14.append((arg_3, arg_1, arg_2, arg_4))

        if arg_11 is None and not _should_exempt_from_invalid_name(arg_3):
            arg_0._raise_name_warning(arg_3, arg_1, arg_2, arg_4)

check for a name using the type s regexp


def
Func
(
arg_0
:
arg_1
,
arg_2
:
arg_1
)
:
arg_3
=
PriceDbApplication
(
)
arg_3
.
logger
=
arg_4
arg_5
=
0
if
arg_0
is
not
:
arg_6
=
SecuritySymbol
(
""
,
""
)
arg_6
.
parse
(
arg_0
)
arg_7
=
arg_3
.
Func
(
arg_6
)
if
arg_7
:
arg_5
=
1
else
:
arg_5
=
arg_3
.
Func_all
(
)
print
(
f"Removed {count} old price entries."
)

def Func(arg_0: arg_1, arg_2: arg_1):
    """ Delete old prices, leaving just the last. """
    arg_3 = PriceDbApplication()
    arg_3.logger = arg_4
    arg_5 = 0

    if arg_0 is not None:
        arg_6 = SecuritySymbol("", "")
        arg_6.parse(arg_0)

        arg_7 = arg_3.Func(arg_6)
        if arg_7:
            arg_5 = 1
    else:
        arg_5 = arg_3.Func_all()

    print(f"Removed {count} old price entries.")

Delete old prices leaving just the last .


def Func(arg_0):
        """ Read the contents of the Annotation Resource

        :return: the contents of the resource
        :rtype: str or bytes or flask.response
        """
        if not arg_0.__content__:
            arg_0.__retriever__ = arg_0.__resolver__.resolve(arg_0.uri)
            arg_0.__content__, arg_0.__mimetype__ = arg_0.__retriever__.Func(arg_0.uri)
        return arg_0.__content__


(self, message_timeout=0, session=None, **kwargs)

return Sender(
            handler_id,
            self.entity_uri,
            self.auth_config,
            session=session,
            loop=self.loop,
            debug=self.debug,
            msg_timeout=message_timeout,
            **kwargs)

def Func ( arg_0 , arg_1 = 0 , arg_2 = None , ** arg_3 ) : arg_4 = str ( uuid . uuid4 ( ) ) if arg_0 . entity and arg_0 . requires_session : return SessionSender ( arg_4 , arg_0 . entity_uri , arg_0 . auth_config , arg_2 = arg_2 , loop = arg_0 . loop , debug = arg_0 . debug , msg_timeout = arg_1 , ** arg_3 ) return Sender ( arg_4 , arg_0 . entity_uri , arg_0 . auth_config , arg_2 = arg_2 , loop = arg_0 . loop , debug = arg_0 . debug , msg_timeout = arg_1 , ** arg_3 )

def Func(arg_0, arg_1=0, arg_2=None, **arg_3):
        """Get a Sender for the Service Bus endpoint.

        A Sender represents a single open connection within which multiple send operations can be made.

        :param message_timeout: The period in seconds during which messages sent with
         this Sender must be sent. If the send is not completed in this time it will fail.
        :type message_timeout: int
        :param session: An optional session ID. If supplied this session ID will be
         applied to every outgoing message sent with this Sender.
         If an individual message already has a session ID, that will be
         used instead. If no session ID is supplied here, nor set on an outgoing
         message, a ValueError will be raised if the entity is sessionful.
        :type session: str or ~uuid.Guid
        :returns: A Sender instance with an unopened connection.
        :rtype: ~azure.servicebus.aio.async_send_handler.Sender

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START open_close_sender_context]
                :end-before: [END open_close_sender_context]
                :language: python
                :dedent: 4
                :caption: Send multiple messages with a Sender.

        """
        arg_4 = str(uuid.uuid4())
        if arg_0.entity and arg_0.requires_session:
            return SessionSender(
                arg_4,
                arg_0.entity_uri,
                arg_0.auth_config,
                arg_2=arg_2,
                loop=arg_0.loop,
                debug=arg_0.debug,
                msg_timeout=arg_1,
                **arg_3)
        return Sender(
            arg_4,
            arg_0.entity_uri,
            arg_0.auth_config,
            arg_2=arg_2,
            loop=arg_0.loop,
            debug=arg_0.debug,
            msg_timeout=arg_1,
            **arg_3)

Get a Sender for the Service Bus endpoint .


def Func(arg_0, arg_1):
        """Starts a network run before the individual run.

        Useful if a network needs an initial run that can be shared by all individual
        experimental runs during parameter exploration.

        Needs to be called by the user. If `Func` is started by the user,
        :func:`~pypet.brian2.network.NetworkManager.pre_build` will be automatically called
        from this function.

        This function will create a new BRIAN2 network which is run by
        the :class:`~pypet.brian2.network.NetworkRunner` and it's
        :func:`~pypet.brian2.network.NetworkRunner.execute_network_pre_run`.

        To see how a network run is structured also take a look at
        :func:`~pypet.brian2.network.NetworkRunner.run_network`.

        :param traj: Trajectory container

        """
        arg_0.pre_build(arg_1)

        arg_0._logger.info('\n------------------------\n'
                          'Pre-Running the Network\n'
                          '------------------------')

        arg_0._network = arg_0._network_constructor(*arg_0._brian_list)
        arg_0.network_runner.execute_network_pre_run(arg_1, arg_0._network, arg_0._network_dict,
                                                    arg_0.components, arg_0.analysers)

        arg_0._logger.info('\n-----------------------------\n'
                          'Network Simulation successful\n'
                          '-----------------------------')

        arg_0._pre_run = True
        if hasattr(arg_0._network, 'store'):
            arg_0._network.store('pre_run')

Starts a network run before the individual run.

        Useful if a network needs an initial run that can be shared by all individual
        experimental runs during parameter exploration.

        Needs to be called by the user. If `pre_run_network` is started by the user,
        :func:`~pypet.brian2.network.NetworkManager.pre_build` will be automatically called
        from this function.

        This function will create a new BRIAN2 network which is run by
        the :class:`~pypet.brian2.network.NetworkRunner` and it's
        :func:`~pypet.brian2.network.NetworkRunner.execute_network_pre_run`.

        To see how a network run is structured also take a look at
        :func:`~pypet.brian2.network.NetworkRunner.run_network`.

        :param traj: Trajectory container

Starts a network run before the individual run .


def Func(arg_0, arg_1):
        """
        Add extensions to the certificate.

        :param extensions: The extensions to add.
        :type extensions: An iterable of :py:class:`X509Extension` objects.
        :return: ``None``
        """
        for arg_2 in arg_1:
            if not isinstance(arg_2, X509Extension):
                raise ValueError("One of the elements is not an X509Extension")

            arg_3 = _lib.X509_add_ext(arg_0._x509, arg_2._extension, -1)
            if not arg_3:
                _raise_current_error()


(self, token, name, parent_id, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , ** arg_4 ) : arg_5 = dict ( ) arg_5 [ 'token' ] = arg_1 arg_5 [ 'name' ] = arg_2 arg_5 [ 'parentid' ] = arg_3 arg_6 = [ 'description' , 'uuid' , 'privacy' ] for arg_7 in arg_6 : if arg_7 in arg_4 : arg_5 [ arg_7 ] = arg_4 [ arg_7 ] arg_8 = arg_0 . request ( 'midas.item.create' , arg_5 ) return arg_8

def Func(arg_0, arg_1, arg_2, arg_3, **arg_4):
        """
        Create an item to the server.

        :param token: A valid token for the user in question.
        :type token: string
        :param name: The name of the item to be created.
        :type name: string
        :param parent_id: The id of the destination folder.
        :type parent_id: int | long
        :param description: (optional) The description text of the item.
        :type description: string
        :param uuid: (optional) The UUID for the item. It will be generated if
            not given.
        :type uuid: string
        :param privacy: (optional) The privacy state of the item
            ('Public' or 'Private').
        :type privacy: string
        :returns: Dictionary containing the details of the created item.
        :rtype: dict
        """
        arg_5 = dict()
        arg_5['token'] = arg_1
        arg_5['name'] = arg_2
        arg_5['parentid'] = arg_3
        arg_6 = ['description', 'uuid', 'privacy']
        for arg_7 in arg_6:
            if arg_7 in arg_4:
                arg_5[arg_7] = arg_4[arg_7]
        arg_8 = arg_0.request('midas.item.create', arg_5)
        return arg_8


def Func ( arg_0 ) : def _wrap ( arg_1 , * arg_2 , ** arg_3 ) : arg_4 , arg_5 = int ( np . floor ( arg_1 ) ) , int ( np . ceil ( arg_1 ) ) arg_6 = get_window ( arg_0 , arg_4 ) if len ( arg_6 ) < arg_5 : arg_6 = np . pad ( arg_6 , [ ( 0 , arg_5 - len ( arg_6 ) ) ] , mode = 'constant' ) arg_6 [ arg_4 : ] = 0.0 return arg_6 return _wrap

def Func(arg_0):
    '''Decorator function for windows with fractional input.

    This function guarantees that for fractional `x`, the following hold:

    1. `Func(window_function)(x)` has length `np.ceil(x)`
    2. all values from `np.floor(x)` are set to 0.

    For integer-valued `x`, there should be no change in behavior.
    '''

    def _wrap(arg_1, *arg_2, **arg_3):
        '''The wrapped window'''
        arg_4, arg_5 = int(np.floor(arg_1)), int(np.ceil(arg_1))

        arg_6 = get_window(arg_0, arg_4)

        if len(arg_6) < arg_5:
            arg_6 = np.pad(arg_6, [(0, arg_5 - len(arg_6))],
                            mode='constant')

        arg_6[arg_4:] = 0.0

        return arg_6

    return _wrap

Decorator function for windows with fractional input.

    This function guarantees that for fractional `x`, the following hold:

    1. `__float_window(window_function)(x)` has length `np.ceil(x)`
    2. all values from `np.floor(x)` are set to 0.

    For integer-valued `x`, there should be no change in behavior.

Decorator function for windows with fractional input .


def Func(arg_0):
    """
    Determines the length of the DH params from the ServerKeyExchange

    :param server_handshake_bytes:
        A byte string of the handshake data received from the server

    :return:
        None or an integer of the bit size of the DH parameters
    """

    arg_1 = None

    arg_2 = None

    for arg_3, arg_4, arg_5 in parse_tls_records(arg_0):
        if arg_3 != b'\x16':
            continue
        for arg_6, arg_7 in parse_handshake_messages(arg_5):
            if arg_6 == b'\x0c':
                arg_2 = arg_7
                break
        if arg_2:
            break

    if arg_2:
        arg_1 = int_from_bytes(arg_2[0:2]) * 8

    return arg_1


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
get_Func
(
)
arg_0
.
__logger
.
debug
(
"Error from: %r Condition: %r"
%
(
arg_1
.
get_from
(
)
,
arg_2
.
get_condition
)
)

def Func(arg_0,arg_1):
        """
        Called when an Func stanza is received.

        :Parameters:
            - `stanza`: the stanza received.
        :Types:
            - `stanza`: `pyxmpp.stanza.Stanza`
        """
        arg_2=arg_1.get_Func()
        arg_0.__logger.debug("Error from: %r Condition: %r"
                % (arg_1.get_from(),arg_2.get_condition))

Called when an error stanza is received.

        :Parameters:
            - `stanza`: the stanza received.
        :Types:
            - `stanza`: `pyxmpp.stanza.Stanza`

Called when an error stanza is received .


def Func(arg_0):
        """
        Function decorator that intercepts HTTP Errors and raises AirflowException
        with more informative message.
        """

        @functools.wraps(arg_0)
        def wrapper_decorator(arg_1, *arg_2, **arg_3):
            try:
                return arg_0(arg_1, *arg_2, **arg_3)
            except GoogleAPICallError as e:
                if isinstance(e, AlreadyExists):
                    raise e
                else:
                    arg_1.log.error('The request failed:\n%s', str(e))
                    raise AirflowException(e)
            except RetryError as e:
                arg_1.log.error('The request failed due to a retryable error and retry attempts failed.')
                raise AirflowException(e)
            except ValueError as e:
                arg_1.log.error('The request failed, the parameters are invalid.')
                raise AirflowException(e)
            except HttpError as e:
                arg_1.log.error('The request failed:\n%s', str(e))
                raise AirflowException(e)

        return wrapper_decorator

Function decorator that intercepts HTTP Errors and raises AirflowException with more informative message .


Process bounds as defined in the configuration.

def Func ( arg_0 ) : if arg_0 . _raw [ "Func" ] is None : return arg_0 . process_pyramid . Func else : return Bounds ( * _validate_Func ( arg_0 . _raw [ "Func" ] ) )

def Func(arg_0):
        """Process Func as defined in the configuration."""
        if arg_0._raw["Func"] is None:
            return arg_0.process_pyramid.Func
        else:
            return Bounds(*_validate_Func(arg_0._raw["Func"]))

Process bounds as defined in the configuration .


def Func(arg_0, arg_1, **arg_2):
        """Initialize application object.

        :param app: An instance of :class:`~flask.Flask`.
        """
        # Init the configuration
        arg_0.init_config(arg_1)
        # Enable Rate limiter
        arg_0.limiter = Limiter(arg_1, key_func=get_ipaddr)
        # Enable secure HTTP headers
        if arg_1.config['APP_ENABLE_SECURE_HEADERS']:
            arg_0.talisman = Talisman(
                arg_1, **arg_1.config.get('APP_DEFAULT_SECURE_HEADERS', {})
            )
        # Enable PING view
        if arg_1.config['APP_HEALTH_BLUEPRINT_ENABLED']:
            arg_5 = Blueprint('invenio_app_ping', __name__)

            @arg_5.route('/ping')
            def arg_6():
                """Load balancer ping view."""
                return 'OK'

            arg_6.talisman_view_options = {'force_https': False}

            arg_1.register_blueprint(arg_5)

        arg_8 = arg_1.config.get('APP_REQUESTID_HEADER')
        if arg_8:
            @arg_1.before_request
            def set_request_id():
                """Extracts a request id from an HTTP header."""
                arg_9 = request.headers.get(arg_8)
                if arg_9:
                    # Capped at 200 to protect against malicious clients
                    # sending very large headers.
                    arg_10.request_id = arg_9[:200]

        # If installed register the Flask-DebugToolbar extension
        try:
            from flask_debugtoolbar import DebugToolbarExtension
            arg_1.extensions['flask-debugtoolbar'] = DebugToolbarExtension(arg_1)
        except ImportError:
            arg_1.logger.debug('Flask-DebugToolbar extension not installed.')

        # Register self
        arg_1.extensions['invenio-app'] = arg_0


def Func(arg_0, **arg_1):
    """Read a JSON notebook from a string and return the NotebookNode object."""
    arg_2, arg_3, arg_4 = parse_json(arg_0, **arg_1)
    if arg_2 == 1:
        arg_5 = v1.to_notebook_json(arg_4, **arg_1)
        arg_5 = v3.convert_to_this_nbformat(arg_5, orig_version=1)
    elif arg_2 == 2:
        arg_5 = v2.to_notebook_json(arg_4, **arg_1)
        arg_5 = v3.convert_to_this_nbformat(arg_5, orig_version=2)
    elif arg_2 == 3:
        arg_5 = v3.to_notebook_json(arg_4, **arg_1)
        arg_5 = v3.convert_to_this_nbformat(arg_5, orig_version=3, orig_minor=arg_3)
    else:
        raise NBFormatError('Unsupported JSON nbformat version: %i' % arg_2)
    return arg_5

Read a JSON notebook from a string and return the NotebookNode object .


(
    src,
    tar,
    qval=1,
    mode='winkler',
    long_strings=False,
    boost_threshold=0.7,
    scaling_factor=0.1,
)

return JaroWinkler().dist(
        src, tar, qval, mode, long_strings, boost_threshold, scaling_factor
    )

def Func(
    arg_0,
    arg_1,
    arg_2=1,
    arg_3='winkler',
    arg_4=False,
    arg_5=0.7,
    arg_6=0.1,
):
    """Return the Jaro or Jaro-Winkler distance between two strings.

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

    Parameters
    ----------
    src : str
        Source string for comparison
    tar : str
        Target string for comparison
    qval : int
        The length of each q-gram (defaults to 1: character-wise matching)
    mode : str
        Indicates which variant of this distance metric to compute:

            - ``winkler`` -- computes the Jaro-Winkler distance (default) which
              increases the score for matches near the start of the word
            - ``jaro`` -- computes the Jaro distance

    long_strings : bool
        Set to True to "Increase the probability of a match when the number of
        matched characters is large. This option allows for a little more
        tolerance when the strings are large. It is not an appropriate test
        when comparing fixedlength fields such as phone and social security
        numbers." (Used in 'winkler' mode only.)
    boost_threshold : float
        A value between 0 and 1, below which the Winkler boost is not applied
        (defaults to 0.7). (Used in 'winkler' mode only.)
    scaling_factor : float
        A value between 0 and 0.25, indicating by how much to boost scores for
        matching prefixes (defaults to 0.1). (Used in 'winkler' mode only.)

    Returns
    -------
    float
        Jaro or Jaro-Winkler distance

    Examples
    --------
    >>> round(Func('cat', 'hat'), 12)
    0.222222222222
    >>> round(Func('Niall', 'Neil'), 12)
    0.195
    >>> round(Func('aluminum', 'Catalan'), 12)
    0.39880952381
    >>> round(Func('ATCG', 'TAGC'), 12)
    0.166666666667

    >>> round(Func('cat', 'hat', mode='jaro'), 12)
    0.222222222222
    >>> round(Func('Niall', 'Neil', mode='jaro'), 12)
    0.216666666667
    >>> round(Func('aluminum', 'Catalan', mode='jaro'), 12)
    0.39880952381
    >>> round(Func('ATCG', 'TAGC', mode='jaro'), 12)
    0.166666666667

    """
    return JaroWinkler().dist(
        arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6
    )

Return the Jaro or Jaro-Winkler distance between two strings.

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

    Parameters
    ----------
    src : str
        Source string for comparison
    tar : str
        Target string for comparison
    qval : int
        The length of each q-gram (defaults to 1: character-wise matching)
    mode : str
        Indicates which variant of this distance metric to compute:

            - ``winkler`` -- computes the Jaro-Winkler distance (default) which
              increases the score for matches near the start of the word
            - ``jaro`` -- computes the Jaro distance

    long_strings : bool
        Set to True to "Increase the probability of a match when the number of
        matched characters is large. This option allows for a little more
        tolerance when the strings are large. It is not an appropriate test
        when comparing fixedlength fields such as phone and social security
        numbers." (Used in 'winkler' mode only.)
    boost_threshold : float
        A value between 0 and 1, below which the Winkler boost is not applied
        (defaults to 0.7). (Used in 'winkler' mode only.)
    scaling_factor : float
        A value between 0 and 0.25, indicating by how much to boost scores for
        matching prefixes (defaults to 0.1). (Used in 'winkler' mode only.)

    Returns
    -------
    float
        Jaro or Jaro-Winkler distance

    Examples
    --------
    >>> round(dist_jaro_winkler('cat', 'hat'), 12)
    0.222222222222
    >>> round(dist_jaro_winkler('Niall', 'Neil'), 12)
    0.195
    >>> round(dist_jaro_winkler('aluminum', 'Catalan'), 12)
    0.39880952381
    >>> round(dist_jaro_winkler('ATCG', 'TAGC'), 12)
    0.166666666667

    >>> round(dist_jaro_winkler('cat', 'hat', mode='jaro'), 12)
    0.222222222222
    >>> round(dist_jaro_winkler('Niall', 'Neil', mode='jaro'), 12)
    0.216666666667
    >>> round(dist_jaro_winkler('aluminum', 'Catalan', mode='jaro'), 12)
    0.39880952381
    >>> round(dist_jaro_winkler('ATCG', 'TAGC', mode='jaro'), 12)
    0.166666666667

Return the Jaro or Jaro - Winkler distance between two strings .