def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the GetAttributes response payload to a
        stream.

        Args:
            output_buffer (stream): A data stream in which to encode object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.
        """
        arg_6 = utils.BytearrayStream()

        if arg_0._unique_identifier:
            arg_0._unique_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise exceptions.InvalidField(
                "The GetAttributes response payload is missing the unique "
                "identifier field."
            )

        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            for arg_7 in arg_0._attributes:
                arg_7.Func(arg_6, arg_2=arg_2)
        else:
            if arg_0._attributes:
                # TODO (ph) Add a new utility to avoid using TemplateAttributes
                arg_8 = objects.TemplateAttribute(
                    arg_9=arg_0.attributes
                )
                arg_9 = objects.convert_template_attribute_to_attributes(
                    arg_8
                )
                arg_9.Func(arg_6, arg_2=arg_2)
            else:
                raise exceptions.InvalidField(
                    "The GetAttributes response payload is missing the "
                    "attributes list."
                )

        arg_0.length = arg_6.length()
        super(GetAttributesResponsePayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_1.Func(arg_6.buffer)

Write the data encoding the GetAttributes response payload to a
        stream.

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

Write the data encoding the GetAttributes response payload to a stream .


def Func ( arg_0 ) : arg_1 = { } for arg_2 , arg_3 in arg_0 . iteritems ( ) : arg_1 [ arg_2 ] = Template ( arg_3 ) . safe_substitute ( arg_0 ) for arg_2 , arg_3 in arg_1 . items ( ) : arg_1 [ arg_2 ] = Template ( arg_3 ) . safe_substitute ( arg_1 ) return arg_1

def Func(arg_0):
    '''
    Expand all environment variables in an environment dict

    :param env: Environment dict
    '''

    arg_1 = {}

    for arg_2, arg_3 in arg_0.iteritems():
        arg_1[arg_2] = Template(arg_3).safe_substitute(arg_0)

    # Expand twice to make sure we expand everything we possibly can
    for arg_2, arg_3 in arg_1.items():
        arg_1[arg_2] = Template(arg_3).safe_substitute(arg_1)

    return arg_1


def Func(arg_0, arg_1):
        """Save the projects configs to local path

        Args:
            projects (dict): project_name -> project_data
        """

        arg_2 = os.path.expanduser(arg_0.path)

        if not os.path.isdir(arg_2):
            return

        logger.debug("Save projects config to %s", arg_2)

        for arg_3, arg_4 in list(arg_1.items()):
            arg_5 = arg_0.get_project_config_path(arg_3)
            with open(arg_5, "w") as f:
                yaml.dump(arg_4, stream = f, default_flow_style = False)
                logger.debug("Project '%s' config has been writed to '%s'", arg_3, arg_5)


def
Func
(
arg_0
)
:
if
not
op
.
isfile
(
arg_0
)
:
raise
IOError
(
'Data config file not found. '
'Got: {0}'
.
format
(
arg_0
)
)
arg_1
=
import_pyfile
(
arg_0
)
if
not
hasattr
(
arg_1
,
'root_path'
)
:
raise
KeyError
(
'Config file root_path key not found.'
)
if
not
hasattr
(
arg_1
,
'filetree'
)
:
raise
KeyError
(
'Config file filetree key not found.'
)
return
arg_1
.
root_path
,
arg_1
.
filetree

def Func(arg_0):
        """
        Imports filetree and root_path variable values from the filepath.

        :param filepath:
        :return: root_path and filetree
        """
        if not op.isfile(arg_0):
            raise IOError('Data config file not found. '
                          'Got: {0}'.format(arg_0))

        arg_1 = import_pyfile(arg_0)

        if not hasattr(arg_1, 'root_path'):
            raise KeyError('Config file root_path key not found.')

        if not hasattr(arg_1, 'filetree'):
            raise KeyError('Config file filetree key not found.')

        return arg_1.root_path, arg_1.filetree

Imports filetree and root_path variable values from the filepath .


def Func ( arg_0 ) : arg_0 . _thumbnails = { } arg_2 = arg_0 . metadata_backend . get_thumbnails ( arg_0 . source_image . name ) for arg_3 in arg_2 : arg_0 . _thumbnails [ arg_3 . size ] = Thumbnail ( arg_3 = arg_3 , storage = arg_0 . storage )

def Func(arg_0):
        """Populate self._thumbnails."""
        arg_0._thumbnails = {}
        arg_2 = arg_0.metadata_backend.get_thumbnails(arg_0.source_image.name)
        for arg_3 in arg_2:
            arg_0._thumbnails[arg_3.size] = Thumbnail(arg_3=arg_3, storage=arg_0.storage)


def Func ( arg_0 , arg_1 , arg_2 = True , ** arg_3 ) : if arg_1 == 'rewrite' : return arg_0 . Func_rewrite ( arg_2 = arg_2 ) if arg_2 : arg_4 = arg_0 . color_scheme_table . active_colors if arg_1 == 'out' : arg_5 = color_lists [ 'normal' ] arg_5 . number , arg_5 . prompt , arg_5 . normal = arg_4 . out_number , arg_4 . out_prompt , arg_4 . normal else : arg_5 = color_lists [ 'inp' ] arg_5 . number , arg_5 . prompt , arg_5 . normal = arg_4 . in_number , arg_4 . in_prompt , arg_4 . in_normal if arg_1 == 'in2' : arg_5 . prompt = arg_4 . in_prompt2 else : arg_5 = color_lists [ 'nocolor' ] arg_5 . number , arg_5 . prompt , arg_5 . normal = '' , '' , '' arg_9 = arg_0 . shell . execution_count arg_10 = dict ( arg_2 = arg_5 , arg_9 = arg_9 , dots = "." * len ( str ( arg_9 ) ) , width = arg_0 . width , txtwidth = arg_0 . txtwidth ) arg_10 . update ( arg_0 . lazy_evaluate_fields ) arg_10 . update ( arg_3 ) arg_7 = arg_5 . prompt + arg_0 . templates [ arg_1 ] + arg_5 . normal return arg_0 . _formatter . format ( arg_7 , ** arg_10 )

def Func(arg_0, arg_1, arg_2=True, **arg_3):
        """Render but don't justify, or update the width or txtwidth attributes.
        """
        if arg_1 == 'rewrite':
            return arg_0.Func_rewrite(arg_2=arg_2)

        if arg_2:
            arg_4 = arg_0.color_scheme_table.active_colors
            if arg_1=='out':
                arg_5 = color_lists['normal']
                arg_5.number, arg_5.prompt, arg_5.normal = \
                        arg_4.out_number, arg_4.out_prompt, arg_4.normal
            else:
                arg_5 = color_lists['inp']
                arg_5.number, arg_5.prompt, arg_5.normal = \
                        arg_4.in_number, arg_4.in_prompt, arg_4.in_normal
                if arg_1=='in2':
                    arg_5.prompt = arg_4.in_prompt2
        else:
            # No color
            arg_5 = color_lists['nocolor']
            arg_5.number, arg_5.prompt, arg_5.normal = '', '', ''

        arg_9 = arg_0.shell.execution_count    # Shorthand
        # Build the dictionary to be passed to string formatting
        arg_10 = dict(arg_2=arg_5, arg_9=arg_9,
                        dots="."*len(str(arg_9)),
                        width=arg_0.width, txtwidth=arg_0.txtwidth )
        arg_10.update(arg_0.lazy_evaluate_fields)
        arg_10.update(arg_3)

        # Prepare the prompt
        arg_7 = arg_5.prompt + arg_0.templates[arg_1] + arg_5.normal

        # Fill in required fields
        return arg_0._formatter.format(arg_7, **arg_10)

Render but don t justify or update the width or txtwidth attributes .


def Func(arg_0, arg_1=None):
        """Display the syntax error that just occurred.

        This doesn't display a stack trace because there isn't one.

        If a filename is given, it is stuffed in the exception instead
        of what was there before (because Python's parser always uses
        "<string>" when reading from a string).
        """
        arg_2, arg_3, arg_4 = arg_0._get_exc_info()

        if arg_1 and arg_2 is SyntaxError:
            try:
                arg_3.filename = arg_1
            except:
                # Not the format we expect; leave it alone
                pass

        arg_5 = arg_0.SyntaxTB.structured_traceback(arg_2, arg_3, [])
        arg_0._showtraceback(arg_2, arg_3, arg_5)

Display the syntax error that just occurred .


def Func ( arg_0 , arg_1 ) : arg_0 . group = arg_1 . add_argument_group ( arg_0 . title , arg_0 . description ) for arg_3 in arg_0 . arguments : arg_3 . Func ( arg_0 . group )

def Func(arg_0, arg_1):
        """
        Adds the group and its arguments to a argparse.ArgumentParser instance

        @param parser A argparse.ArgumentParser instance
        """
        arg_0.group = arg_1.add_argument_group(arg_0.title, arg_0.description)
        for arg_3 in arg_0.arguments:
            arg_3.Func(arg_0.group)

Adds the group and its arguments to a argparse . ArgumentParser instance


def Func ( arg_0 , arg_1 , arg_2 ) : arg_4 . seterr ( divide = 'ignore' ) arg_3 = 1.0 / arg_4 . sqrt ( arg_2 ) arg_3 [ arg_3 == arg_4 . inf ] = 1.0e8 return NoiseMap ( array = arg_3 , arg_1 = arg_1 )

def Func(arg_0, arg_1, arg_2):
        """Setup the noise-map from a weight map, which is a form of noise-map that comes via HST image-reduction and \
        the software package MultiDrizzle.

        The variance in each pixel is computed as:

        Variance = 1.0 / sqrt(weight_map).

        The weight map may contain zeros, in which cause the variances are converted to large values to omit them from \
        the analysis.

        Parameters
        -----------
        pixel_scale : float
            The size of each pixel in arc seconds.
        weight_map : ndarray
            The weight-value of each pixel which is converted to a variance.
        """
        arg_4.seterr(divide='ignore')
        arg_3 = 1.0 / arg_4.sqrt(arg_2)
        arg_3[arg_3 == arg_4.inf] = 1.0e8
        return NoiseMap(array=arg_3, arg_1=arg_1)

Setup the noise - map from a weight map which is a form of noise - map that comes via HST image - reduction and \ the software package MultiDrizzle .


def Func(arg_0, arg_1):
        # type: (str) -> bool
        """
        Check if ``filename`` can be read. Will return boolean which is True if
        the file can be read, False otherwise.
        """
        if not exists(arg_1):
            return False

        # Check if the file is version-compatible with this instance.
        arg_2 = ConfigResolverBase()
        arg_2.read(arg_1)
        if arg_0.version and not arg_2.has_option('meta', 'version'):
            # self.version is set, so we MUST have a version in the file!
            raise NoVersionError(
                "The config option 'meta.version' is missing in {}. The "
                "application expects version {}!".format(arg_1,
                                                         arg_0.version))
        elif not arg_0.version and arg_2.has_option('meta', 'version'):
            # Automatically "lock-in" a version number if one is found.
            # This prevents loading a chain of config files with incompatible
            # version numbers!
            arg_0.version = StrictVersion(arg_2.get('meta', 'version'))
            arg_0._log.info('%r contains a version number, but the config '
                           'instance was not created with a version '
                           'restriction. Will set version number to "%s" to '
                           'prevent accidents!',
                           arg_1, arg_0.version)
        elif arg_0.version:
            # This instance expected a certain version. We need to check the
            # version in the file and compare.
            arg_4 = arg_2.get('meta', 'version')
            arg_5, arg_6, arg_7 = StrictVersion(arg_4).version
            arg_8, arg_9, arg_7 = arg_0.version.version
            if arg_8 != arg_5:
                arg_0._log.error(
                    'Invalid major version number in %r. Expected %r, got %r!',
                    abspath(arg_1),
                    str(arg_0.version),
                    arg_4)
                return False

            if arg_9 != arg_6:
                arg_0._log.warning(
                    'Mismatching minor version number in %r. '
                    'Expected %r, got %r!',
                    abspath(arg_1),
                    str(arg_0.version),
                    arg_4)
                return True
        return True

Check if filename can be read . Will return boolean which is True if the file can be read False otherwise .


def
Func
(
arg_0
,
arg_1
=
'%c'
)
:
arg_2
=
logging
.
getLogger
(
__name__
)
arg_3
=
{
}
for
arg_4
in
(
'Model'
,
'Make'
,
'LensModel'
)
:
if
arg_4
in
arg_0
:
if
isinstance
(
arg_0
[
arg_4
]
,
tuple
)
:
arg_3
[
arg_4
]
=
arg_0
[
arg_4
]
[
0
]
.
strip
(
)
else
:
arg_3
[
arg_4
]
=
arg_0
[
arg_4
]
.
strip
(
)
if
'FNumber'
in
arg_0
:
arg_5
=
arg_0
[
'FNumber'
]
try
:
arg_3
[
'fstop'
]
=
float
(
arg_5
[
0
]
)
/
arg_5
[
1
]
except
Exception
:
arg_2
.
debug
(
'Skipped invalid FNumber: %r'
,
arg_5
,
exc_info
=
True
)
if
'FocalLength'
in
arg_0
:
arg_6
=
arg_0
[
'FocalLength'
]
try
:
arg_3
[
'focal'
]
=
round
(
float
(
arg_6
[
0
]
)
/
arg_6
[
1
]
)
except
Exception
:
arg_2
.
debug
(
'Skipped invalid FocalLength: %r'
,
arg_6
,
exc_info
=
True
)
if
'ExposureTime'
in
arg_0
:
arg_7
=
arg_0
[
'ExposureTime'
]
if
isinstance
(
arg_7
,
tuple
)
:
try
:
arg_3
[
'exposure'
]
=
str
(
fractions
.
Fraction
(
arg_7
[
0
]
,
arg_7
[
1
]
)
)
except
ZeroDivisionError
:
arg_2
.
info
(
'Invalid ExposureTime: %r'
,
arg_7
)
elif
isinstance
(
arg_7
,
int
)
:
arg_3
[
'exposure'
]
=
str
(
arg_7
)
else
:
arg_2
.
info
(
'Unknown format for ExposureTime: %r'
,
arg_7
)
if
arg_0
.
get
(
'ISOSpeedRatings'
)
:
arg_3
[
'iso'
]
=
arg_0
[
'ISOSpeedRatings'
]
if
'DateTimeOriginal'
in
arg_0
:
arg_8
=
arg_0
[
'DateTimeOriginal'
]
.
rsplit
(
'\x00'
)
[
0
]
try
:
arg_3
[
'dateobj'
]
=
datetime
.
strptime
(
arg_8
,
'%Y:%m:%d %H:%M:%S'
)
arg_3
[
'datetime'
]
=
arg_3
[
'dateobj'
]
.
strftime
(
arg_1
)
except
(
ValueError
,
TypeError
)
as
e
:
arg_2
.
info
(
'Could not parse DateTimeOriginal: %s'
,
e
)
if
'GPSInfo'
in
arg_0
:
arg_9
=
arg_0
[
'GPSInfo'
]
arg_10
=
arg_9
.
get
(
'GPSLatitude'
)
arg_11
=
arg_9
.
get
(
'GPSLongitude'
)
arg_12
=
arg_9
.
get
(
'GPSLatitudeRef'
)
arg_13
=
arg_9
.
get
(
'GPSLongitudeRef'
)
if
arg_10
and
arg_11
and
arg_12
and
arg_13
:
try
:
arg_14
=
dms_to_degrees
(
arg_10
)
arg_15
=
dms_to_degrees
(
arg_11
)
except
(
ZeroDivisionError
,
ValueError
,
TypeError
)
:
arg_2
.
info
(
'Failed to read GPS info'
)
else
:
arg_3
[
'gps'
]
=
{
'lat'
:
arg_14
if
arg_12
!=
'N'
else
arg_14
,
'lon'
:
arg_15
if
arg_13
!=
'E'
else
arg_15
,
}
return
arg_3

def Func(arg_0, arg_1='%c'):
    """Make a simplified version with common tags from raw EXIF data."""

    arg_2 = logging.getLogger(__name__)
    arg_3 = {}

    for arg_4 in ('Model', 'Make', 'LensModel'):
        if arg_4 in arg_0:
            if isinstance(arg_0[arg_4], tuple):
                arg_3[arg_4] = arg_0[arg_4][0].strip()
            else:
                arg_3[arg_4] = arg_0[arg_4].strip()

    if 'FNumber' in arg_0:
        arg_5 = arg_0['FNumber']
        try:
            arg_3['fstop'] = float(arg_5[0]) / arg_5[1]
        except Exception:
            arg_2.debug('Skipped invalid FNumber: %r', arg_5, exc_info=True)

    if 'FocalLength' in arg_0:
        arg_6 = arg_0['FocalLength']
        try:
            arg_3['focal'] = round(float(arg_6[0]) / arg_6[1])
        except Exception:
            arg_2.debug('Skipped invalid FocalLength: %r', arg_6,
                         exc_info=True)

    if 'ExposureTime' in arg_0:
        arg_7 = arg_0['ExposureTime']
        if isinstance(arg_7, tuple):
            try:
                arg_3['exposure'] = str(fractions.Fraction(arg_7[0],
                                                            arg_7[1]))
            except ZeroDivisionError:
                arg_2.info('Invalid ExposureTime: %r', arg_7)
        elif isinstance(arg_7, int):
            arg_3['exposure'] = str(arg_7)
        else:
            arg_2.info('Unknown format for ExposureTime: %r', arg_7)

    if arg_0.get('ISOSpeedRatings'):
        arg_3['iso'] = arg_0['ISOSpeedRatings']

    if 'DateTimeOriginal' in arg_0:
        # Remove null bytes at the end if necessary
        arg_8 = arg_0['DateTimeOriginal'].rsplit('\x00')[0]

        try:
            arg_3['dateobj'] = datetime.strptime(arg_8, '%Y:%m:%d %H:%M:%S')
            arg_3['datetime'] = arg_3['dateobj'].strftime(arg_1)
        except (ValueError, TypeError) as e:
            arg_2.info('Could not parse DateTimeOriginal: %s', e)

    if 'GPSInfo' in arg_0:
        arg_9 = arg_0['GPSInfo']
        arg_10 = arg_9.get('GPSLatitude')
        arg_11 = arg_9.get('GPSLongitude')
        arg_12 = arg_9.get('GPSLatitudeRef')
        arg_13 = arg_9.get('GPSLongitudeRef')

        if arg_10 and arg_11 and arg_12 and arg_13:
            try:
                arg_14 = dms_to_degrees(arg_10)
                arg_15 = dms_to_degrees(arg_11)
            except (ZeroDivisionError, ValueError, TypeError):
                arg_2.info('Failed to read GPS info')
            else:
                arg_3['gps'] = {
                    'lat': - arg_14 if arg_12 != 'N' else arg_14,
                    'lon': - arg_15 if arg_13 != 'E' else arg_15,
                }

    return arg_3

Make a simplified version with common tags from raw EXIF data .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_1
:
print
'%s jobs:'
%
arg_2
for
arg_3
in
arg_1
:
print
'%s : %s'
%
(
arg_3
.
num
,
arg_3
)
print
return
True

def Func(arg_0,arg_1,arg_2):
        """Report summary for a given job group.

        Return True if the group had any elements."""

        if arg_1:
            print '%s jobs:' % arg_2
            for arg_3 in arg_1:
                print '%s : %s' % (arg_3.num,arg_3)
            print
            return True


def Func(arg_0, arg_1):
        """
        Given a kmip.core TemplateAttribute object, extract the attribute
        value data into a usable dictionary format.
        """
        arg_2 = {}

        if len(arg_1.names) > 0:
            raise exceptions.ItemNotFound(
                "Attribute templates are not supported."
            )

        for arg_3 in arg_1.attributes:
            arg_4 = arg_3.attribute_name.value

            if not arg_0._attribute_policy.is_attribute_supported(arg_4):
                raise exceptions.InvalidField(
                    "The {0} attribute is unsupported.".format(arg_4)
                )

            if arg_0._attribute_policy.is_attribute_multivalued(arg_4):
                arg_5 = arg_2.get(arg_4, list())
                if (not arg_3.attribute_index) and len(arg_5) > 0:
                    raise exceptions.InvalidField(
                        "Attribute index missing from multivalued attribute."
                    )

                arg_5.append(arg_3.attribute_value)
                arg_2.update([(arg_4, arg_5)])
            else:
                if arg_3.attribute_index:
                    if arg_3.attribute_index.value != 0:
                        raise exceptions.InvalidField(
                            "Non-zero attribute index found for "
                            "single-valued attribute."
                        )
                arg_6 = arg_2.get(arg_4, None)
                if arg_6:
                    raise exceptions.IndexOutOfBounds(
                        "Cannot set multiple instances of the "
                        "{0} attribute.".format(arg_4)
                    )
                else:
                    arg_2.update([(arg_4, arg_3.attribute_value)])

        return arg_2

Given a kmip . core TemplateAttribute object extract the attribute value data into a usable dictionary format .


def Func(arg_0, arg_1):
        """
        Handle Error messages and log them accordingly.

        :param data:
        :param ts:
        """
        arg_2 = {10000: 'Unknown event',
                  10001: 'Generic error',
                  10008: 'Concurrency error',
                  10020: 'Request parameters error',
                  10050: 'Configuration setup failed',
                  10100: 'Failed authentication',
                  10111: 'Error in authentication request payload',
                  10112: 'Error in authentication request signature',
                  10113: 'Error in authentication request encryption',
                  10114: 'Error in authentication request nonce',
                  10200: 'Error in un-authentication request',
                  10300: 'Subscription Failed (generic)',
                  10301: 'Already Subscribed',
                  10302: 'Unknown channel',
                  10400: 'Subscription Failed (generic)',
                  10401: 'Not subscribed',
                  11000: 'Not ready, try again later',
                  20000: 'User is invalid!',
                  20051: 'Websocket server stopping',
                  20060: 'Websocket server resyncing',
                  20061: 'Websocket server resync complete'
                  }
        try:
            arg_0.log.error(arg_2[arg_1['code']])
        except KeyError:
            arg_0.log.error("Received unknown error Code in message %s! "
                           "Reconnecting..", arg_1)

Handle Error messages and log them accordingly .


(obj, skipkeys=False, ensure_ascii=True, check_circular=True,
        allow_nan=True, cls=None, indent=None, separators=None,
        encoding='utf-8', default=None, **kw)

return cls(
        skipkeys=skipkeys, ensure_ascii=ensure_ascii,
        check_circular=check_circular, allow_nan=allow_nan, indent=indent,
        separators=separators, encoding=encoding, default=default,
        **kw).encode(obj)

def Func(arg_0, arg_1=False, arg_2=True, arg_3=True,
        arg_4=True, arg_5=None, arg_6=None, arg_7=None,
        arg_8='utf-8', arg_9=None, **arg_10):
    """
    Serialize ``obj`` to a JSON formatted ``str``.

    If ``skipkeys`` is ``True`` then ``dict`` keys that are not basic types
    (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``)
    will be skipped instead of raising a ``TypeError``.

    If ``ensure_ascii`` is ``False``, then the return value will be a
    ``unicode`` instance subject to normal Python ``str`` to ``unicode``
    coercion rules instead of being escaped to an ASCII ``str``.

    If ``check_circular`` is ``False``, then the circular reference check
    for container types will be skipped and a circular reference will
    result in an ``OverflowError`` (or worse).

    If ``allow_nan`` is ``False``, then it will be a ``ValueError`` to
    serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in
    strict compliance of the JSON specification, instead of using the
    JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).

    If ``indent`` is a non-negative integer, then JSON array elements and
    object members will be pretty-printed with that indent level. An indent
    level of 0 will only insert newlines. ``None`` is the most compact
    representation.

    If ``separators`` is an ``(item_separator, dict_separator)`` tuple
    then it will be used instead of the default ``(', ', ': ')`` separators.
    ``(',', ':')`` is the most compact JSON representation.

    ``encoding`` is the character encoding for str instances, default is UTF-8.

    ``default(obj)`` is a function that should return a serializable version
    of obj or raise TypeError. The default simply raises TypeError.

    To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
    ``.default()`` method to serialize additional types), specify it with
    the ``cls`` kwarg.
    """
    # cached encoder
    if (arg_1 is False and arg_2 is True and
        arg_3 is True and arg_4 is True and
        arg_5 is None and arg_6 is None and arg_7 is None and
        arg_8 == 'utf-8' and arg_9 is None and not arg_10):
        return _default_encoder.encode(arg_0)
    if arg_5 is None:
        arg_5 = JSONEncoder
    return arg_5(
        arg_1=arg_1, arg_2=arg_2,
        arg_3=arg_3, arg_4=arg_4, arg_6=arg_6,
        arg_7=arg_7, arg_8=arg_8, arg_9=arg_9,
        **arg_10).encode(arg_0)


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_0 . _read ( arg_0 [ arg_1 , ... ] , ** arg_2 ) arg_3 = np . rollaxis ( arg_3 . astype ( np . float32 ) , 0 , 3 ) return arg_0 . _Func ( arg_3 , ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        ''' entry point for contrast stretching '''
        arg_3 = arg_0._read(arg_0[arg_1,...], **arg_2)
        arg_3 = np.rollaxis(arg_3.astype(np.float32), 0, 3)
        return arg_0._Func(arg_3, **arg_2)


def Func ( arg_0 ) : arg_0 . flush ( ) setattr ( sys , arg_0 . channel , arg_0 . ostream ) arg_0 . file . Func ( ) arg_0 . _Funcd = True

def Func(arg_0):
        """Close the file and restore the channel."""
        arg_0.flush()
        setattr(sys, arg_0.channel, arg_0.ostream)
        arg_0.file.Func()
        arg_0._Funcd = True

Close the file and restore the channel .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = dict ( request . view_args , _external = True , ) if arg_2 is not None : arg_3 [ '_scheme' ] = arg_2 if arg_1 != 1 : arg_3 [ 'page' ] = arg_1 return url_for ( request . endpoint , ** arg_3 )

def Func(arg_0, arg_1, arg_2=None):
        """Get the full, external URL for this page, optinally with the passed in URL scheme"""
        arg_3 = dict(
            request.view_args,
            _external=True,
        )

        if arg_2 is not None:
            arg_3['_scheme'] = arg_2

        if arg_1 != 1:
            arg_3['page'] = arg_1

        return url_for(request.endpoint, **arg_3)

Get the full external URL for this page optinally with the passed in URL scheme


(graph: BELGraph, u: BaseEntity, v: BaseEntity, key: str)

return (
        isinstance(u, (ComplexAbundance, NamedComplexAbundance)) and
        complex_has_member(graph, u, v) and
        part_has_modifier(graph[u][v][key], OBJECT, ACTIVITY)
    )

def Func ( arg_0 : arg_1 , arg_2 : arg_3 , arg_4 : arg_3 , arg_5 : arg_6 ) -> bool : return ( isinstance ( arg_2 , ( ComplexAbundance , NamedComplexAbundance ) ) and complex_has_member ( arg_0 , arg_2 , arg_4 ) and part_has_modifier ( arg_0 [ arg_2 ] [ arg_4 ] [ arg_5 ] , OBJECT , ACTIVITY ) )

def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_3, arg_5: arg_6) -> bool:
    """Return if the formation of a complex with u increases the activity of v."""
    return (
        isinstance(arg_2, (ComplexAbundance, NamedComplexAbundance)) and
        complex_has_member(arg_0, arg_2, arg_4) and
        part_has_modifier(arg_0[arg_2][arg_4][arg_5], OBJECT, ACTIVITY)
    )

Return if the formation of a complex with u increases the activity of v .


def Func ( ) : arg_0 = pd . read_csv ( 'source_data/cars/car.data.txt' ) arg_1 = arg_0 . reindex ( columns = [ x for x in arg_0 . columns . values if x != 'class' ] ) arg_2 = arg_0 . reindex ( columns = [ 'class' ] ) arg_2 = preprocessing . LabelEncoder ( ) . fit_transform ( arg_2 . values . reshape ( - 1 , ) ) arg_3 = [ { 'col' : 'buying' , 'mapping' : [ ( 'vhigh' , 0 ) , ( 'high' , 1 ) , ( 'med' , 2 ) , ( 'low' , 3 ) ] } , { 'col' : 'maint' , 'mapping' : [ ( 'vhigh' , 0 ) , ( 'high' , 1 ) , ( 'med' , 2 ) , ( 'low' , 3 ) ] } , { 'col' : 'doors' , 'mapping' : [ ( '2' , 0 ) , ( '3' , 1 ) , ( '4' , 2 ) , ( '5more' , 3 ) ] } , { 'col' : 'persons' , 'mapping' : [ ( '2' , 0 ) , ( '4' , 1 ) , ( 'more' , 2 ) ] } , { 'col' : 'lug_boot' , 'mapping' : [ ( 'small' , 0 ) , ( 'med' , 1 ) , ( 'big' , 2 ) ] } , { 'col' : 'safety' , 'mapping' : [ ( 'high' , 0 ) , ( 'med' , 1 ) , ( 'low' , 2 ) ] } , ] return arg_1 , arg_2 , arg_3

def Func():
    """
    Load the cars dataset, split it into X and y, and then call the label encoder to get an integer y column.

    :return:
    """

    arg_0 = pd.read_csv('source_data/cars/car.data.txt')
    arg_1 = arg_0.reindex(columns=[x for x in arg_0.columns.values if x != 'class'])
    arg_2 = arg_0.reindex(columns=['class'])
    arg_2 = preprocessing.LabelEncoder().fit_transform(arg_2.values.reshape(-1, ))

    arg_3 = [
        {'col': 'buying', 'mapping': [('vhigh', 0), ('high', 1), ('med', 2), ('low', 3)]},
        {'col': 'maint', 'mapping': [('vhigh', 0), ('high', 1), ('med', 2), ('low', 3)]},
        {'col': 'doors', 'mapping': [('2', 0), ('3', 1), ('4', 2), ('5more', 3)]},
        {'col': 'persons', 'mapping': [('2', 0), ('4', 1), ('more', 2)]},
        {'col': 'lug_boot', 'mapping': [('small', 0), ('med', 1), ('big', 2)]},
        {'col': 'safety', 'mapping': [('high', 0), ('med', 1), ('low', 2)]},
    ]

    return arg_1, arg_2, arg_3

Load the cars dataset split it into X and y and then call the label encoder to get an integer y column .


return self._isBestModel, jobResults, jobResultsStr

def Func ( arg_0 ) : arg_1 = arg_0 . _jobsDAO . jobGetFields ( arg_0 . _jobID , [ 'results' ] ) [ 0 ] if arg_1 is None : arg_2 = { } else : arg_2 = json . loads ( arg_1 ) arg_3 = arg_2 . get ( 'saved' , False ) arg_4 = arg_2 . get ( 'bestValue' , None ) arg_5 = arg_0 . _getMetrics ( ) [ arg_0 . _optimizedMetricLabel ] arg_0 . _isBestModel = ( not arg_3 ) or ( arg_5 < arg_4 ) return arg_0 . _isBestModel , arg_2 , arg_1

def Func(arg_0):
    """
    Reads the current "best model" for the job and returns whether or not the
    current model is better than the "best model" stored for the job

    Returns: (isBetter, storedBest, origResultsStr)

    isBetter:
      True if the current model is better than the stored "best model"
    storedResults:
      A dict of the currently stored results in the jobs table record
    origResultsStr:
      The json-encoded string that currently resides in the "results" field
      of the jobs record (used to create atomicity)
    """

    arg_1 = arg_0._jobsDAO.jobGetFields(arg_0._jobID, ['results'])[0]

    if arg_1 is None:
        arg_2 = {}
    else:
      arg_2 = json.loads(arg_1)

    arg_3 = arg_2.get('saved', False)
    arg_4 = arg_2.get('bestValue', None)

    arg_5 = arg_0._getMetrics()[arg_0._optimizedMetricLabel]
    arg_0._isBestModel = (not arg_3) \
                        or (arg_5 < arg_4)

    return arg_0._isBestModel, arg_2, arg_1

Reads the current best model for the job and returns whether or not the current model is better than the best model stored for the job


def Func(arg_0, arg_1):
    """Install all packages listed to the target directory.

    Ignores any package that includes Python itself and python-lambda as well
    since its only needed for deploying and not running the code

    :param str path:
        Path to copy installed pip packages to.
    :param list packages:
        A list of packages to be installed via pip.
    """
    def _filter_blacklist(arg_2):
        arg_3 = ['-i', '#', 'Python==', 'python-lambda==']
        return all(arg_2.startswith(arg_4) is False for arg_4 in arg_3)
    arg_5 = filter(_filter_blacklist, arg_1)
    for arg_2 in arg_5:
        if arg_2.startswith('-e '):
            arg_2 = arg_2.replace('-e ', '')

        print('Installing {package}'.format(arg_2=arg_2))
        subprocess.check_call([sys.executable, '-m', 'pip', 'install', arg_2, '-t', arg_0, '--ignore-installed'])
    print ('Install directory contents are now: {directory}'.format(directory=os.listdir(arg_0)))

Install all packages listed to the target directory .


def Func ( arg_0 ) : if arg_0 == - 1 : arg_0 = np . random . randint ( 0 , int ( 1e9 ) ) np . random . seed ( arg_0 )

def Func(arg_0):
    """Setup the random seed. If the input seed is -1, the code will use a random seed for every run. If it is \
    positive, that seed is used for all runs, thereby giving reproducible results.

    Parameters
    ----------
    seed : int
        The seed of the random number generator.
    """
    if arg_0 == -1:
        arg_0 = np.random.randint(0,
                                 int(1e9))  # Use one seed, so all regions have identical column non-uniformity.
    np.random.seed(arg_0)

Setup the random seed . If the input seed is - 1 the code will use a random seed for every run . If it is \ positive that seed is used for all runs thereby giving reproducible results .


(arr, columns=('temperature', 'luminosity'),
           names=('Temperature (Kelvin)', 'Luminosity (solar units)'),
           max_rows=32, precision=2)

return df.style.format({names[0]: '{:.0f}',
                            names[1]: '{:.2f}'})

def
Func
(
arg_0
,
arg_1
=
(
'temperature'
,
'luminosity'
)
,
arg_2
=
(
'Temperature (Kelvin)'
,
'Luminosity (solar units)'
)
,
arg_3
=
32
,
arg_4
=
2
)
:
if
arg_3
is
True
:
pd
.
set_option
(
'display.max_rows'
,
1000
)
elif
type
(
arg_3
)
is
int
:
pd
.
set_option
(
'display.max_rows'
,
arg_3
)
pd
.
set_option
(
'precision'
,
arg_4
)
arg_5
=
pd
.
DataFrame
(
arg_0
.
flatten
(
)
,
index
=
arg_0
[
'id'
]
.
flatten
(
)
,
arg_1
=
arg_1
)
arg_5
.
columns
=
arg_2
return
arg_5
.
style
.
format
(
{
arg_2
[
0
]
:
'{:.0f}'
,
arg_2
[
1
]
:
'{:.2f}'
}
)

def Func(arg_0, arg_1=('temperature', 'luminosity'),
           arg_2=('Temperature (Kelvin)', 'Luminosity (solar units)'),
           arg_3=32, arg_4=2):
    """
    Create a pandas DataFrame from a numpy ndarray.

    By default use temp and lum with max rows of 32 and precision of 2.

    arr - An numpy.ndarray.
    columns - The columns to include in the pandas DataFrame. Defaults to
              temperature and luminosity.
    names - The column names for the pandas DataFrame. Defaults to
            Temperature and Luminosity.
    max_rows - If max_rows is an integer then set the pandas
               display.max_rows option to that value. If max_rows
               is True then set display.max_rows option  to 1000.
    precision - An integer to set the pandas precision option.
    """
    if arg_3 is True:
        pd.set_option('display.max_rows', 1000)
    elif type(arg_3) is int:
        pd.set_option('display.max_rows', arg_3)
    pd.set_option('precision', arg_4)
    arg_5 = pd.DataFrame(arg_0.flatten(), index=arg_0['id'].flatten(),
                      arg_1=arg_1)
    arg_5.columns = arg_2
    return arg_5.style.format({arg_2[0]: '{:.0f}',
                            arg_2[1]: '{:.2f}'})

Create a pandas DataFrame from a numpy ndarray .


(self, sql, autocommit=False, parameters=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
,
arg_3
=
)
:
if
isinstance
(
arg_1
,
basestring
)
:
arg_1
=
[
arg_1
]
with
closing
(
arg_0
.
get_conn
(
)
)
as
conn
:
if
arg_0
.
supports_autocommit
:
arg_0
.
set_autocommit
(
conn
,
arg_2
)
with
closing
(
conn
.
cursor
(
)
)
as
cur
:
for
arg_4
in
arg_1
:
if
arg_3
is
not
:
arg_0
.
log
.
info
(
"{} with parameters {}"
.
format
(
arg_4
,
arg_3
)
)
cur
.
execute
(
arg_4
,
arg_3
)
else
:
arg_0
.
log
.
info
(
arg_4
)
cur
.
execute
(
arg_4
)
if
not
arg_0
.
get_autocommit
(
conn
)
:
conn
.
commit
(
)

def Func(arg_0, arg_1, arg_2=False, arg_3=None):
        """
        Runs a command or a list of commands. Pass a list of sql
        statements to the sql parameter to get them to execute
        sequentially

        :param sql: the sql statement to be executed (str) or a list of
            sql statements to execute
        :type sql: str or list
        :param autocommit: What to set the connection's autocommit setting to
            before executing the query.
        :type autocommit: bool
        :param parameters: The parameters to render the SQL query with.
        :type parameters: mapping or iterable
        """
        if isinstance(arg_1, basestring):
            arg_1 = [arg_1]

        with closing(arg_0.get_conn()) as conn:
            if arg_0.supports_autocommit:
                arg_0.set_autocommit(conn, arg_2)

            with closing(conn.cursor()) as cur:
                for arg_4 in arg_1:
                    if arg_3 is not None:
                        arg_0.log.info("{} with parameters {}".format(arg_4, arg_3))
                        cur.execute(arg_4, arg_3)
                    else:
                        arg_0.log.info(arg_4)
                        cur.execute(arg_4)

            # If autocommit was set to False for db that supports autocommit,
            # or if db does not supports autocommit, we do a manual commit.
            if not arg_0.get_autocommit(conn):
                conn.commit()

Runs a command or a list of commands . Pass a list of sql statements to the sql parameter to get them to execute sequentially


Shorthand for creating a Giphy api wrapper with the given api key
    and then calling the upload method.

(tags, file_path, username=None, api_key=GIPHY_PUBLIC_KEY,
           strict=False)

return Giphy(api_key=api_key, strict=strict).upload(
        tags, file_path, username)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = arg_4 , arg_5 = False ) : return Giphy ( arg_3 = arg_3 , arg_5 = arg_5 ) . Func ( arg_0 , arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2=None, arg_3=arg_4,
           arg_5=False):
    """
    Shorthand for creating a Giphy api wrapper with the given api key
    and then calling the Func method.
    """
    return Giphy(arg_3=arg_3, arg_5=arg_5).Func(
        arg_0, arg_1, arg_2)

Shorthand for creating a Giphy api wrapper with the given api key and then calling the upload method .


def Func(arg_0, arg_1="(", arg_2=")"):
    """Remove consecutive delimiters."""
    arg_3 = _pair_delims(arg_0, arg_1=arg_1, arg_2=arg_2)
    # Flag superfluous delimiters
    arg_4 = []
    for arg_5, arg_6 in zip(arg_3, arg_3[1:]):
        if arg_5 == (arg_6[0] - 1, arg_6[1] + 1):
            arg_4.extend(arg_6)
    arg_4.sort()
    # Actually remove delimiters from expression
    for arg_7, arg_8 in enumerate(arg_4):
        arg_0 = arg_0[: arg_8 - arg_7] + arg_0[arg_8 - arg_7 + 1 :]
    # Get functions
    return arg_0


def Func(arg_0, arg_1=None):
    """Create an input hook for running the Qt4 application event loop.

    Parameters
    ----------
    mgr : an InputHookManager

    app : Qt Application, optional.
        Running application to use.  If not given, we probe Qt for an
        existing application object, and create a new one if none is found.

    Returns
    -------
    A pair consisting of a Qt Application (either the one given or the
    one found or created) and a inputhook.

    Notes
    -----
    We use a custom input hook instead of PyQt4's default one, as it
    interacts better with the readline packages (issue #481).

    The inputhook function works in tandem with a 'pre_prompt_hook'
    which automatically restores the hook as an inputhook in case the
    latter has been temporarily disabled after having intercepted a
    KeyboardInterrupt.
    """

    if arg_1 is None:
        arg_1 = QtCore.QCoreApplication.instance()
        if arg_1 is None:
            arg_1 = QtGui.QApplication([" "])

    # Re-use previously created inputhook if any
    arg_2 = InteractiveShell.instance()
    if hasattr(arg_2, '_inputhook_qt4'):
        return arg_1, arg_2._inputhook_qt4

    # Otherwise create the inputhook_qt4/preprompthook_qt4 pair of
    # hooks (they both share the got_kbdint flag)

    arg_3 = [False]

    def inputhook_qt4():
        """PyOS_InputHook python hook for Qt4.

        Process pending Qt events and if there's no pending keyboard
        input, spend a short slice of time (50ms) running the Qt event
        loop.

        As a Python ctypes callback can't raise an exception, we catch
        the KeyboardInterrupt and temporarily deactivate the hook,
        which will let a *second* CTRL+C be processed normally and go
        back to a clean prompt line.
        """
        try:
            allow_CTRL_C()
            arg_1 = QtCore.QCoreApplication.instance()
            if not arg_1: # shouldn't happen, but safer if it happens anyway...
                return 0
            arg_1.processEvents(QtCore.QEventLoop.AllEvents, 300)
            if not stdin_ready():
                arg_4 = QtCore.QTimer()
                arg_4.timeout.connect(arg_1.quit)
                while not stdin_ready():
                    arg_4.start(50)
                    arg_1.exec_()
                    arg_4.stop()
        except KeyboardInterrupt:
            ignore_CTRL_C()
            arg_3[0] = True
            print("\nKeyboardInterrupt - Ctrl-C again for new prompt")
            arg_0.clear_inputhook()
        except: # NO exceptions are allowed to escape from a ctypes callback
            ignore_CTRL_C()
            from traceback import print_exc
            print_exc()
            print("Got exception from inputhook_qt4, unregistering.")
            arg_0.clear_inputhook()
        finally:
            allow_CTRL_C()
        return 0

    def preprompthook_qt4(arg_5):
        """'pre_prompt_hook' used to restore the Qt4 input hook

        (in case the latter was temporarily deactivated after a
        CTRL+C)
        """
        if arg_3[0]:
            arg_0.set_inputhook(inputhook_qt4)
        arg_3[0] = False

    arg_2._inputhook_qt4 = inputhook_qt4
    arg_2.set_hook('pre_prompt_hook', preprompthook_qt4)

    return arg_1, inputhook_qt4

Create an input hook for running the Qt4 application event loop .


def Func ( arg_0 ) : arg_1 = PassManager ( ) arg_1 . append ( Unroller ( arg_0 ) ) arg_1 . append ( [ RemoveResetInZeroState ( ) , Depth ( ) , FixedPoint ( 'depth' ) ] , do_while = lambda property_set : not property_set [ 'depth_fixed_point' ] ) return arg_1

def Func(arg_0):
    """
    The default pass manager without a coupling map.

    Args:
        basis_gates (list[str]): list of basis gate names to unroll to.

    Returns:
        PassManager: A passmanager that just unrolls, without any optimization.
    """
    arg_1 = PassManager()

    arg_1.append(Unroller(arg_0))

    arg_1.append([RemoveResetInZeroState(), Depth(), FixedPoint('depth')],
                        do_while=lambda property_set: not property_set['depth_fixed_point'])

    return arg_1

The default pass manager without a coupling map .


def Func ( arg_0 , arg_1 , arg_2 = 0 , arg_3 = None ) : if arg_3 is not None : arg_0 . skeleton . set_body_states ( arg_3 ) for arg_4 , arg_5 in enumerate ( arg_1 ) : if arg_4 < arg_2 : continue if arg_4 >= end : break arg_0 . ode_space . collide ( None , arg_0 . on_collision ) arg_0 . skeleton . add_torques ( arg_5 ) arg_0 . ode_world . step ( arg_0 . dt ) yield arg_0 . ode_contactgroup . empty ( )

def Func(arg_0, arg_1, arg_2=0, arg_3=None):
        '''Move the body according to a set of torque data.'''
        if arg_3 is not None:
            arg_0.skeleton.set_body_states(arg_3)
        for arg_4, arg_5 in enumerate(arg_1):
            if arg_4 < arg_2:
                continue
            if arg_4 >= end:
                break
            arg_0.ode_space.collide(None, arg_0.on_collision)
            arg_0.skeleton.add_torques(arg_5)
            arg_0.ode_world.step(arg_0.dt)
            yield
            arg_0.ode_contactgroup.empty()

Move the body according to a set of torque data .


def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_0 . remove_user_from_acl ( arg_1 , arg_2 ) : return False if arg_1 not in arg_0 . _acl : return False arg_0 . _acl [ arg_1 ] [ 'allow' ] . append ( arg_2 ) return True

def Func(arg_0, arg_1, arg_2):
        """Add a user to the given acl allow block."""

        # Clear user from both allow and deny before adding
        if not arg_0.remove_user_from_acl(arg_1, arg_2):
            return False

        if arg_1 not in arg_0._acl:
            return False

        arg_0._acl[arg_1]['allow'].append(arg_2)
        return True

Add a user to the given acl allow block .


return {model.genes.get_by_id(g) for ids in essential for g in ids}

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_1 is None : arg_1 = arg_0 . slim_optimize ( error_value = None ) * 1E-02 arg_3 = single_gene_deletion ( arg_0 , method = 'fba' , arg_2 = arg_2 ) arg_4 = arg_3 . loc [ arg_3 [ 'growth' ] . isna ( ) | ( arg_3 [ 'growth' ] < arg_1 ) , : ] . index return { arg_0 . genes . get_by_id ( arg_6 ) for arg_5 in arg_4 for arg_6 in arg_5 }

def Func(arg_0, arg_1=None, arg_2=None):
    """
    Return a set of essential genes.

    A gene is considered essential if restricting the flux of all reactions
    that depend on it to zero causes the objective, e.g., the growth rate,
    to also be zero, below the threshold, or infeasible.

    Parameters
    ----------
    model : cobra.Model
        The model to find the essential genes for.
    threshold : float, optional
        Minimal objective flux to be considered viable. By default this is
        1% of the maximal objective.
    processes : int, optional
        The number of parallel processes to run. If not passed,
        will be set to the number of CPUs found.
    processes : int, optional
        The number of parallel processes to run. Can speed up the computations
        if the number of knockouts to perform is large. If not explicitly
        passed, it will be set from the global configuration singleton.

    Returns
    -------
    set
        Set of essential genes
    """
    if arg_1 is None:
        arg_1 = arg_0.slim_optimize(error_value=None) * 1E-02
    arg_3 = single_gene_deletion(arg_0, method='fba', arg_2=arg_2)
    arg_4 = arg_3.loc[arg_3['growth'].isna() |
                              (arg_3['growth'] < arg_1), :].index
    return {arg_0.genes.get_by_id(arg_6) for arg_5 in arg_4 for arg_6 in arg_5}


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = ( arg_0 . instruction . address + 4 ) & 0xfffffffc if arg_2 . type == 'register' and arg_2 . reg in ( 'PC' , 'R15' ) : arg_2 = arg_4 else : arg_2 = arg_2 . read ( ) arg_1 . write ( arg_2 + arg_3 . read ( ) )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        This instruction adds an immediate value to a register value, and writes the result to the destination register.
        It doesn't update the condition flags.

        :param ARMv7Operand dest: Specifies the destination register. If omitted, this register is the same as src.
        :param ARMv7Operand src:
            Specifies the register that contains the first operand. If the SP is specified for dest, see ADD (SP plus
            immediate). If the PC is specified for dest, see ADR.
        :param ARMv7Operand add:
            Specifies the immediate value to be added to the value obtained from src. The range of allowed values is
            0-4095.
        """
        arg_4 = (arg_0.instruction.address + 4) & 0xfffffffc
        if arg_2.type == 'register' and arg_2.reg in ('PC', 'R15'):
            arg_2 = arg_4
        else:
            arg_2 = arg_2.read()
        arg_1.write(arg_2 + arg_3.read())

This instruction adds an immediate value to a register value and writes the result to the destination register . It doesn t update the condition flags .


def Func ( arg_0 , ** arg_1 ) : arg_2 = [ ] for arg_3 , arg_4 in arg_1 . items ( ) : arg_4 = arg_0 . _check ( arg_3 , arg_4 , 'Func' ) arg_2 . append ( Pattern ( arg_3 , arg_4 ) ) return arg_0 . replace ( filters = arg_0 . _filters + tuple ( arg_2 ) )

def Func(arg_0, **arg_1):
        '''
        When provided with keyword arguments of the form ``col=pattern``, this
        will limit the entities returned to those that include the provided
        pattern. Note that 'Func' queries require that the ``prefix=True``
        option must have been provided as part of the column definition.

        Patterns allow for 4 wildcard characters, whose semantics are as
        follows:

            * *?* - will match 0 or 1 of any character
            * *\** - will match 0 or more of any character
            * *+* - will match 1 or more of any character
            * *!* - will match exactly 1 of any character

        As an example, imagine that you have enabled the required prefix
        matching on your ``User.email`` column. And lets say that you want to
        find everyone with an email address that contains the name 'frank'
        before the ``@`` sign. You can use either of the following patterns
        to discover those users.

            * *\*frank\*@*
            * *\*frank\*@*

        .. note:: Like queries implicitly start at the beginning of strings
          checked, so if you want to match a pattern that doesn't start at
          the beginning of a string, you should prefix it with one of the
          wildcard characters (Func ``*`` as we did with the 'frank' pattern).
        '''
        arg_2 = []
        for arg_3, arg_4 in arg_1.items():
            arg_4 = arg_0._check(arg_3, arg_4, 'Func')
            arg_2.append(Pattern(arg_3, arg_4))
        return arg_0.replace(filters=arg_0._filters+tuple(arg_2))

When provided with keyword arguments of the form ``col=pattern``, this
        will limit the entities returned to those that include the provided
        pattern. Note that 'like' queries require that the ``prefix=True``
        option must have been provided as part of the column definition.

        Patterns allow for 4 wildcard characters, whose semantics are as
        follows:

            * *?* - will match 0 or 1 of any character
            * *\** - will match 0 or more of any character
            * *+* - will match 1 or more of any character
            * *!* - will match exactly 1 of any character

        As an example, imagine that you have enabled the required prefix
        matching on your ``User.email`` column. And lets say that you want to
        find everyone with an email address that contains the name 'frank'
        before the ``@`` sign. You can use either of the following patterns
        to discover those users.

            * *\*frank\*@*
            * *\*frank\*@*

        .. note:: Like queries implicitly start at the beginning of strings
          checked, so if you want to match a pattern that doesn't start at
          the beginning of a string, you should prefix it with one of the
          wildcard characters (like ``*`` as we did with the 'frank' pattern).

When provided with keyword arguments of the form col = pattern this will limit the entities returned to those that include the provided pattern . Note that like queries require that the prefix = True option must have been provided as part of the column definition .


(tile, dst_pyramid=None, matching_method="gdal", precision=8)

def Func(arg_0, arg_1=None, arg_2="gdal", arg_3=8):
    """
    Determine the best zoom level in target TilePyramid from given Tile.

    Parameters
    ----------
    tile : BufferedTile
    dst_pyramid : BufferedTilePyramid
    matching_method : str ('gdal' or 'min')
        gdal: Uses GDAL's standard method. Here, the target resolution is calculated by
            averaging the extent's pixel sizes over both x and y axes. This approach
            returns a zoom level which may not have the best quality but will speed up
            reading significantly.
        min: Returns the zoom level which matches the minimum resolution of the extent's
            four corner pixels. This approach returns the zoom level with the best
            possible quality but with low performance. If the tile extent is outside of
            the destination pyramid, a TopologicalError will be raised.
    precision : int
        Round resolutions to n digits before comparing.

    Returns
    -------
    zoom : int
    """
    def width_height(arg_4):
        try:
            arg_5, arg_6, arg_7, arg_8 = reproject_geometry(
                box(*arg_4), src_crs=arg_0.crs, dst_crs=arg_1.crs
            ).bounds
        except ValueError:
            raise TopologicalError("bounds cannot be translated into target CRS")
        return arg_7 - arg_5, arg_8 - arg_6

    if arg_0.tp.crs == arg_1.crs:
        return arg_0.zoom
    else:
        if arg_2 == "gdal":
            # use rasterio/GDAL method to calculate default warp target properties
            arg_9, arg_10, arg_11 = calculate_default_transform(
                arg_0.tp.crs,
                arg_1.crs,
                arg_0.width,
                arg_0.height,
                *arg_0.bounds
            )
            # this is the resolution the tile would have in destination TilePyramid CRS
            arg_12 = round(arg_9[0], arg_3)
        elif arg_2 == "min":
            # calculate the minimum pixel size from the four tile corner pixels
            arg_5, arg_6, arg_7, arg_8 = arg_0.bounds
            arg_13 = arg_0.pixel_x_size
            arg_14 = arg_0.pixel_y_size
            arg_15 = []
            for arg_4 in [
                (arg_5, arg_8 - arg_14, arg_5 + arg_13, arg_8),  # left top
                (arg_5, arg_6, arg_5 + arg_13, arg_6 + arg_14),  # left bottom
                (arg_7 - arg_13, arg_6, arg_7, arg_6 + arg_14),  # right bottom
                (arg_7 - arg_13, arg_8 - arg_14, arg_7, arg_8)   # right top
            ]:
                try:
                    arg_16, arg_17 = width_height(arg_4)
                    arg_15.extend([arg_16, arg_17])
                except TopologicalError:
                    logger.debug("pixel outside of destination pyramid")
            if arg_15:
                arg_12 = round(min(arg_15), arg_3)
            else:
                raise TopologicalError("tile outside of destination pyramid")
        else:
            raise ValueError("invalid method given: %s", arg_2)
        logger.debug(
            "we are looking for a zoom level interpolating to %s resolution",
            arg_12
        )
        arg_18 = 0
        while True:
            arg_19 = round(arg_1.pixel_x_size(arg_18), arg_3)
            if arg_19 <= arg_12:
                break
            arg_18 += 1
        logger.debug("target zoom for %s: %s (%s)", arg_12, arg_18, arg_19)
        return arg_18

Determine the best zoom level in target TilePyramid from given Tile .


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_0 . obj [ 'file_previews' ] arg_5 = { } arg_6 = arg_3 [ 'metadata' ] arg_7 = arg_3 [ 'width' ] arg_8 = arg_3 [ 'height' ] arg_9 = arg_3 [ 'format' ] if arg_6 : arg_5 [ 'metadata' ] = arg_6 . split ( ',' ) if arg_7 : arg_5 . setdefault ( 'size' , { } ) arg_5 [ 'size' ] [ 'width' ] = arg_7 if arg_8 : arg_5 . setdefault ( 'size' , { } ) arg_5 [ 'size' ] [ 'height' ] = arg_8 if arg_9 : arg_5 [ 'format' ] = arg_9 arg_10 = arg_4 . Func ( arg_1 , ** arg_5 ) click . echo ( arg_10 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """
    Generate preview for URL.
    """
    arg_4 = arg_0.obj['file_previews']

    arg_5 = {}
    arg_6 = arg_3['metadata']
    arg_7 = arg_3['width']
    arg_8 = arg_3['height']
    arg_9 = arg_3['format']

    if arg_6:
        arg_5['metadata'] = arg_6.split(',')

    if arg_7:
        arg_5.setdefault('size', {})
        arg_5['size']['width'] = arg_7

    if arg_8:
        arg_5.setdefault('size', {})
        arg_5['size']['height'] = arg_8

    if arg_9:
        arg_5['format'] = arg_9

    arg_10 = arg_4.Func(arg_1, **arg_5)

    click.echo(arg_10)


(self, username, reponame, force, backend=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
)
:
arg_5
=
arg_0
.
key
(
arg_1
,
arg_2
)
arg_6
=
arg_0
.
server_rootdir
(
arg_1
,
arg_2
,
create
=
False
)
if
os
.
path
.
exists
(
arg_6
)
and
not
arg_3
:
raise
RepositoryExists
(
)
if
os
.
path
.
exists
(
arg_6
)
:
shutil
.
rmtree
(
arg_6
)
os
.
makedirs
(
arg_6
)
with
cd
(
arg_6
)
:
git
.
Func
(
"."
,
"--bare"
)
if
arg_4
is
not
:
arg_4
.
Func_repo
(
arg_6
)
arg_7
=
arg_0
.
rootdir
(
arg_1
,
arg_2
,
create
=
False
)
if
os
.
path
.
exists
(
arg_7
)
and
not
arg_3
:
raise
Exception
(
"Local repo already exists"
)
if
os
.
path
.
exists
(
arg_7
)
:
shutil
.
rmtree
(
arg_7
)
os
.
makedirs
(
arg_7
)
with
cd
(
os
.
path
.
dirname
(
arg_7
)
)
:
git
.
clone
(
arg_6
,
'--no-hardlinks'
)
arg_8
=
arg_6
if
arg_4
is
not
:
arg_8
=
arg_4
.
url
(
arg_1
,
arg_2
)
arg_9
=
Repo
(
arg_1
,
arg_2
)
arg_9
.
manager
=
arg_0
arg_9
.
remoteurl
=
arg_8
arg_9
.
rootdir
=
arg_0
.
rootdir
(
arg_1
,
arg_2
)
arg_0
.
add
(
arg_9
)
return
arg_9

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """
        Initialize a Git repo

        Parameters
        ----------

        username, reponame : Repo name is tuple (name, reponame)
        force: force Funcialization of the repo even if exists
        backend: backend that must be used for this (e.g. s3)
        """
        arg_5 = arg_0.key(arg_1, arg_2)

        # In local filesystem-based server, add a repo
        arg_6 = arg_0.server_rootdir(arg_1,
                                             arg_2,
                                             create=False)

        # Force cleanup if needed
        if os.path.exists(arg_6) and not arg_3:
            raise RepositoryExists()

        if os.path.exists(arg_6):
            shutil.rmtree(arg_6)
        os.makedirs(arg_6)

        # Initialize the repo
        with cd(arg_6):
            git.Func(".", "--bare")

        if arg_4 is not None:
            arg_4.Func_repo(arg_6)

        # Now clone the filesystem-based repo
        arg_7 = arg_0.rootdir(arg_1, arg_2, create=False)

        # Prepare it if needed
        if os.path.exists(arg_7) and not arg_3:
            raise Exception("Local repo already exists")
        if os.path.exists(arg_7):
            shutil.rmtree(arg_7)
        os.makedirs(arg_7)

        # Now clone...
        with cd(os.path.dirname(arg_7)):
            git.clone(arg_6, '--no-hardlinks')

        arg_8 = arg_6
        if arg_4 is not None:
            arg_8 = arg_4.url(arg_1, arg_2)

        arg_9 = Repo(arg_1, arg_2)
        arg_9.manager = arg_0
        arg_9.remoteurl = arg_8
        arg_9.rootdir = arg_0.rootdir(arg_1, arg_2)

        arg_0.add(arg_9)
        return arg_9

Initialize a Git repo

        Parameters
        ----------

        username, reponame : Repo name is tuple (name, reponame)
        force: force initialization of the repo even if exists
        backend: backend that must be used for this (e.g. s3)


def Func ( arg_0 ) : arg_0 . swap ( arg_0 . get_ordering_queryset ( ) . filter ( order__gt = arg_0 . order ) )

def Func(arg_0):
        """
        Move this object Func one position.
        """
        arg_0.swap(arg_0.get_ordering_queryset().filter(order__gt=arg_0.order))


def Func ( arg_0 , arg_1 ) : arg_2 = os . path . join ( arg_0 . uri , arg_1 ) os . remove ( arg_2 )

def Func(arg_0, arg_1):
        """
        Remove file identified by `key`.

        :param str key: The file to delete
        """
        arg_2 = os.path.join(arg_0.uri, arg_1)
        os.remove(arg_2)


return Counter(u for u, _, _ in edge_iter)

def Func ( arg_0 : arg_1 ) -> Counter : return Counter ( arg_2 for arg_2 , arg_3 , arg_3 in arg_0 )

def Func(arg_0: arg_1) -> Counter:
    """Count the source nodes in an edge iterator with keys and data.

    :return: A counter of source nodes in the iterable
    """
    return Counter(arg_2 for arg_2, arg_3, arg_3 in arg_0)

Count the source nodes in an edge iterator with keys and data .


def
Func
(
arg_0
)
:
for
arg_1
,
arg_2
in
arg_0
.
header
.
items
(
)
:
if
arg_1
==
b'src_raj'
:
arg_2
=
arg_2
.
to_string
(
unit
=
u
.
hour
,
sep
=
':'
)
if
arg_1
==
b'src_dej'
:
arg_2
=
arg_2
.
to_string
(
unit
=
u
.
deg
,
sep
=
':'
)
if
arg_1
==
b'tsamp'
:
arg_2
*=
u
.
second
if
arg_1
in
(
'foff'
,
'fch1'
)
:
arg_2
*=
u
.
MHz
if
arg_1
==
b'tstart'
:
print
(
"%16s : %32s"
%
(
"tstart (ISOT)"
,
Time
(
arg_2
,
format
=
'mjd'
)
.
isot
)
)
arg_1
=
"tstart (MJD)"
print
(
"%16s : %32s"
%
(
arg_1
,
arg_2
)
)
print
(
"\n%16s : %32s"
%
(
"Num ints in file"
,
arg_0
.
n_ints_in_file
)
)
print
(
"%16s : %32s"
%
(
"Data shape"
,
arg_0
.
data
.
shape
)
)
print
(
"%16s : %32s"
%
(
"Start freq (MHz)"
,
arg_0
.
freqs
[
0
]
)
)
print
(
"%16s : %32s"
%
(
"Stop freq (MHz)"
,
arg_0
.
freqs
[
1
]
)
)

def Func(arg_0):
        """ Print header Funcrmation """

        for arg_1, arg_2 in arg_0.header.items():
            if arg_1 == b'src_raj':
                arg_2 = arg_2.to_string(unit=u.hour, sep=':')
            if arg_1 == b'src_dej':
                arg_2 = arg_2.to_string(unit=u.deg, sep=':')
            if arg_1 == b'tsamp':
                arg_2 *= u.second
            if arg_1 in ('foff', 'fch1'):
                arg_2 *= u.MHz
            if arg_1 == b'tstart':
                print("%16s : %32s" % ("tstart (ISOT)", Time(arg_2, format='mjd').isot))
                arg_1 = "tstart (MJD)"
            print("%16s : %32s" % (arg_1, arg_2))

        print("\n%16s : %32s" % ("Num ints in file", arg_0.n_ints_in_file))
        print("%16s : %32s" % ("Data shape", arg_0.data.shape))
        print("%16s : %32s" % ("Start freq (MHz)", arg_0.freqs[0]))
        print("%16s : %32s" % ("Stop freq (MHz)", arg_0.freqs[-1]))


def Func ( arg_0 ) : arg_1 = namespace ( arg_0 ) arg_1 [ 'title' ] = 'Observation' arg_2 = copy . deepcopy ( JAMS_SCHEMA [ 'definitions' ] [ 'SparseObservationList' ] ) arg_2 [ 'items' ] = arg_1 return arg_2

def Func(arg_0):
    '''Construct a validation schema for arrays of a given namespace.

    Parameters
    ----------
    ns_key : str
        Namespace key identifier

    Returns
    -------
    schema : dict
        JSON schema of `namespace` observation arrays
    '''

    arg_1 = namespace(arg_0)
    arg_1['title'] = 'Observation'

    arg_2 = copy.deepcopy(JAMS_SCHEMA['definitions']['SparseObservationList'])
    arg_2['items'] = arg_1
    return arg_2

Construct a validation schema for arrays of a given namespace .


(self, df_data, graph, nb_runs=6, printout=None, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
6
,
arg_4
=
,
**
arg_5
)
:
if
type
(
arg_2
)
==
nx
.
DiGraph
:
arg_6
=
[
arg_8
for
arg_8
in
list
(
arg_2
.
edges
(
)
)
if
(
arg_8
[
1
]
,
arg_8
[
0
]
)
in
list
(
arg_2
.
edges
(
)
)
]
arg_7
=
[
arg_8
for
arg_8
in
list
(
arg_2
.
edges
(
)
)
if
(
arg_8
[
1
]
,
arg_8
[
0
]
)
not
in
list
(
arg_2
.
edges
(
)
)
]
for
arg_8
in
arg_6
:
if
(
arg_8
[
1
]
,
arg_8
[
0
]
)
in
list
(
arg_2
.
edges
(
)
)
:
arg_6
.
remove
(
arg_8
)
arg_9
=
nx
.
DiGraph
(
)
for
arg_10
in
arg_7
:
arg_9
.
add_edge
(
*
arg_10
)
elif
type
(
arg_2
)
==
nx
.
Graph
:
arg_6
=
list
(
arg_2
.
edges
(
)
)
arg_9
=
nx
.
DiGraph
(
)
else
:
raise
TypeError
(
"Data type not understood."
)
arg_11
=
[
]
for
arg_12
,
(
arg_8
,
arg_13
)
in
enumerate
(
arg_6
)
:
arg_14
=
arg_0
.
predict_proba
(
arg_1
[
arg_8
]
.
values
.
reshape
(
(
1
,
1
)
)
,
arg_1
[
arg_13
]
.
values
.
reshape
(
(
1
,
1
)
)
,
arg_12
=
arg_12
,
arg_3
=
arg_3
,
**
arg_5
)
if
arg_14
>
0
:
arg_9
.
add_edge
(
arg_8
,
arg_13
,
arg_14
=
arg_14
)
else
:
arg_9
.
add_edge
(
arg_13
,
arg_8
,
arg_14
=
abs
(
arg_14
)
)
if
arg_4
is
not
:
arg_11
.
append
(
[
str
(
arg_8
)
+
'-'
+
str
(
arg_13
)
,
arg_14
]
)
DataFrame
(
arg_11
,
columns
=
[
'SampleID'
,
'Predictions'
]
)
.
to_csv
(
arg_4
,
index
=
False
)
for
arg_15
in
list
(
arg_1
.
columns
.
values
)
:
if
arg_15
not
in
arg_9
.
nodes
(
)
:
arg_9
.
add_node
(
arg_15
)
return
arg_9

def Func(arg_0, arg_1, arg_2, arg_3=6, arg_4=None, **arg_5):
        """Orient an undirected graph using the pairwise method defined by the subclass.

        The pairwise method is ran on every undirected edge.

        Args:
            df_data (pandas.DataFrame): Data
            umg (networkx.Graph): Graph to orient
            nb_runs (int): number of times to rerun for each pair (bootstrap)
            printout (str): (optional) Path to file where to save temporary results

        Returns:
            networkx.DiGraph: a directed graph, which might contain cycles

        .. warning:
           Requirement : Name of the nodes in the graph correspond to name of
           the variables in df_data
        """
        if type(arg_2) == nx.DiGraph:
            arg_6 = [arg_8 for arg_8 in list(arg_2.edges()) if (arg_8[1], arg_8[0]) in list(arg_2.edges())]
            arg_7 = [arg_8 for arg_8 in list(arg_2.edges()) if (arg_8[1], arg_8[0]) not in list(arg_2.edges())]
            for arg_8 in arg_6:
                if (arg_8[1], arg_8[0]) in list(arg_2.edges()):
                    arg_6.remove(arg_8)
            arg_9 = nx.DiGraph()
            for arg_10 in arg_7:
                arg_9.add_edge(*arg_10)

        elif type(arg_2) == nx.Graph:
            arg_6 = list(arg_2.edges())
            arg_9 = nx.DiGraph()

        else:
            raise TypeError("Data type not understood.")

        arg_11 = []

        for arg_12, (arg_8, arg_13) in enumerate(arg_6):
            arg_14 = arg_0.predict_proba(
                arg_1[arg_8].values.reshape((-1, 1)), arg_1[arg_13].values.reshape((-1, 1)), arg_12=arg_12,
                arg_3=arg_3, **arg_5)
            if arg_14 > 0:  # a causes b
                arg_9.add_edge(arg_8, arg_13, arg_14=arg_14)
            else:
                arg_9.add_edge(arg_13, arg_8, arg_14=abs(arg_14))
            if arg_4 is not None:
                arg_11.append([str(arg_8) + '-' + str(arg_13), arg_14])
                DataFrame(arg_11, columns=['SampleID', 'Predictions']).to_csv(
                    arg_4, index=False)

        for arg_15 in list(arg_1.columns.values):
            if arg_15 not in arg_9.nodes():
                arg_9.add_node(arg_15)

        return arg_9

Orient an undirected graph using the pairwise method defined by the subclass .


Interactively authenticates a AuthenticateRequest using an attached U2F
    device.

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Interactively Funcs a AuthenticateRequest using an attached U2F
    device.
    """
    for arg_4 in arg_0[:]:
        try:
            arg_4.open()
        except:
            arg_0.remove(arg_4)

    try:
        arg_5 = False
        while arg_0:
            arg_6 = []
            for arg_4 in arg_0:
                try:
                    return u2f.Func(arg_4, arg_1, arg_2, arg_3)
                except exc.APDUError as e:
                    if e.code == APDU_USE_NOT_SATISFIED:
                        if arg_3:
                            sys.stderr.write('\nCorrect U2F device present!\n')
                            sys.exit(0)
                        if not arg_5:
                            sys.stderr.write('\nTouch the flashing U2F device '
                                             'to Func...\n')
                            arg_5 = True
                    else:
                        arg_6.append(arg_4)
                except exc.DeviceError:
                    arg_6.append(arg_4)
            arg_0 = [arg_7 for arg_7 in arg_0 if arg_7 not in arg_6]
            for arg_7 in arg_6:
                arg_7.close()
            time.sleep(0.25)
    finally:
        for arg_4 in arg_0:
            arg_4.close()
    sys.stderr.write('\nThe required U2F device is not present!\n')
    sys.exit(1)

Interactively authenticates a AuthenticateRequest using an attached U2F device .


def Func ( arg_0 , arg_1 ) : arg_2 = json . dumps ( arg_0 ) return json_format . Parse ( arg_2 , arg_1 )

def Func(arg_0, arg_1):
        """
        Converts a python dictionary to the proto supplied

        :param py_dict: The dictionary to convert
        :type py_dict: dict
        :param proto: The proto object to merge with dictionary
        :type proto: protobuf
        :return: A parsed python dictionary in provided proto format
        :raises:
            ParseError: On JSON parsing problems.
        """
        arg_2 = json.dumps(arg_0)
        return json_format.Parse(arg_2, arg_1)


def Func(arg_0):
        """Make sure there's a site.py in the target dir, if needed"""

        if arg_0.sitepy_installed:
            return  # already did it, or don't need to

        arg_1 = os.path.join(arg_0.install_dir, "site.py")
        arg_2 = resource_string("setuptools", "site-patch.py")
        arg_3 = ""

        if os.path.exists(arg_1):
            log.debug("Checking existing site.py in %s", arg_0.install_dir)
            arg_4 = open(arg_1, 'rb')
            arg_3 = arg_4.read()
            # we want str, not bytes
            if PY3:
                arg_3 = arg_3.decode()

            arg_4.close()
            if not arg_3.startswith('def __boot():'):
                raise DistutilsError(
                    "%s is not a setuptools-generated site.py; please"
                    " remove it." % arg_1
                )

        if arg_3 != arg_2:
            log.info("Creating %s", arg_1)
            if not arg_0.dry_run:
                ensure_directory(arg_1)
                arg_4 = open(arg_1, 'wb')
                arg_4.write(arg_2)
                arg_4.close()
            arg_0.byte_compile([arg_1])

        arg_0.sitepy_installed = True

Make sure there s a site . py in the target dir if needed


def Func(arg_0):
    """ Converts html content to plain text """
    arg_1 = None
    arg_2 = html2text.HTML2Text()
    arg_2.ignore_links = False
    arg_1 = arg_2.handle(arg_0)
    return arg_1


def Func ( arg_0 ) : logger . info ( u'Disconnecting' ) arg_0 . sock . shutdown ( socket . SHUT_RDWR ) arg_0 . sock . close ( ) arg_0 . state = DISCONNECTED

def Func(arg_0):
        """Disconnect from the server"""
        logger.info(u'Disconnecting')
        arg_0.sock.shutdown(socket.SHUT_RDWR)
        arg_0.sock.close()
        arg_0.state = DISCONNECTED


def Func ( arg_0 , ** arg_1 ) : arg_2 = { 'form_class' : ArrayFormField , 'model_container' : arg_0 . model_container , 'model_form_class' : arg_0 . model_form_class , 'name' : arg_0 . attname , 'mdl_form_kw_l' : arg_0 . model_form_kwargs_l } arg_2 . update ( arg_1 ) return super ( ) . Func ( ** arg_2 )

def Func(arg_0, **arg_1):
        """
        Returns the Func for the array.
        """
        arg_2 = {
            'form_class': ArrayFormField,
            'model_container': arg_0.model_container,
            'model_form_class': arg_0.model_form_class,
            'name': arg_0.attname,
            'mdl_form_kw_l': arg_0.model_form_kwargs_l

        }
        arg_2.update(arg_1)
        return super().Func(**arg_2)


return self.server.verify_request(
            uri, http_method, body, headers, scopes
        )

def Func(arg_0, arg_1):
        """Verify current request, get the oauth data.

        If you can't use the ``require_oauth`` decorator, you can fetch
        the data in your request body::

            def your_handler():
                valid, req = oauth.Func(['email'])
                if valid:
                    return jsonify(user=req.user)
                return jsonify(status='error')
        """
        arg_2, arg_3, arg_4, arg_5 = extract_params()
        return arg_0.server.Func(
            arg_2, arg_3, arg_4, arg_5, arg_1
        )

Verify current request, get the oauth data.

        If you can't use the ``require_oauth`` decorator, you can fetch
        the data in your request body::

            def your_handler():
                valid, req = oauth.verify_request(['email'])
                if valid:
                    return jsonify(user=req.user)
                return jsonify(status='error')

Verify current request get the oauth data .


return np.square(a - b).mean() / (a.mean() * b.mean())

def Func ( arg_0 , arg_1 ) : return np . square ( arg_0 - arg_1 ) . mean ( ) / ( arg_0 . mean ( ) * arg_1 . mean ( ) )

def Func(arg_0, arg_1):
    """Returns the normalized mean square error of a and b
    """
    return np.square(arg_0 - arg_1).mean() / (arg_0.mean() * arg_1.mean())


return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1

def Func(arg_0):
  """Does line terminate so, that the next symbol is in string constant.

  This function does not consider single-line nor multi-line comments.

  Args:
    line: is a partial line of code starting from the 0..n.

  Returns:
    True, if next character appended to 'line' is inside a
    string constant.
  """

  arg_0 = arg_0.replace(r'\\', 'XX')  # after this, \\" does not match to \"
  return ((arg_0.count('"') - arg_0.count(r'\"') - arg_0.count("'\"'")) & 1) == 1

Does line terminate so that the next symbol is in string constant .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = { 'status' : arg_1 , 'assert_class' : arg_2 , } arg_4 = arg_0 . get ( '/assets' , arg_3 ) return [ Asset ( arg_5 ) for arg_5 in arg_4 ]

def Func(arg_0, arg_1=None, arg_2=None):
        '''Get a list of assets'''
        arg_3 = {
            'status': arg_1,
            'assert_class': arg_2,
        }
        arg_4 = arg_0.get('/assets', arg_3)
        return [Asset(arg_5) for arg_5 in arg_4]


(self, X, y, cross_val='4-Fold', scoring='accuracy',
                      feat_select=None, class_weight='auto')

def Func(arg_0, arg_1, arg_2, arg_3='4-Fold', arg_4='accuracy',
                      arg_5=None, arg_6='auto'):
        """ Fits X to outcomes y, using clf and cv_method """

        from sklearn import cross_validation

        arg_0.X = arg_1
        arg_0.y = arg_2

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

        # Set cross validator
        if isinstance(arg_3, string_types):
            if re.match('.*-Fold', arg_3) is not None:
                arg_7 = int(arg_3.split('-')[0])
                arg_0.cver = cross_validation.StratifiedKFold(arg_0.y, arg_7)
            else:
                raise Exception('Unrecognized cross validation method')
        else:
            arg_0.cver = arg_3

        if arg_5 is not None:
            arg_0.features_selected = []

        # Perform cross-validated classification
        from sklearn.grid_search import GridSearchCV
        if isinstance(arg_0.clf, GridSearchCV):
            import warnings

            if arg_5 is not None:
                warnings.warn(
                    "Cross-validated feature selection not supported with "
                    "GridSearchCV")
            arg_0.clf.set_params(cv=arg_0.cver, arg_4=arg_4)

            with warnings.catch_warnings():
                warnings.simplefilter('ignore', category=UserWarning)
                arg_0.clf = arg_0.clf.fit(arg_1, arg_2)

            arg_0.cvs = arg_0.clf.best_score_
        else:
            arg_0.cvs = arg_0.feat_select_cvs(
                arg_5=arg_5, arg_4=arg_4)

        if arg_5 is not None:
            arg_12 = feature_selection(
                arg_5, arg_1, arg_2)
            arg_0.features_selected.append(arg_12)

            arg_1 = arg_1[:, arg_12]

        arg_0.clf.fit(arg_1, arg_2)

        return arg_0.cvs.mean()

Fits X to outcomes y using clf and cv_method


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 ( ** arg_1 ) db . session . add ( arg_2 ) db . session . commit ( )

def Func(arg_0, arg_1):
    """Helper function for loading JSON data verbatim into model."""
    arg_2 = arg_0(**arg_1)
    db.session.add(arg_2)
    db.session.commit()

Helper function for loading JSON data verbatim into model .


def Func ( arg_0 ) : arg_1 = _get_resource_content ( arg_0 ) . decode ( 'utf-8' ) . splitlines ( ) return re . compile ( '|' . join ( arg_1 ) )

def Func(arg_0):
    """Get a list of patterns from a file and make a regular expression."""
    arg_1 = _get_resource_content(arg_0).decode('utf-8').splitlines()
    return re.compile('|'.join(arg_1))

Get a list of patterns from a file and make a regular expression .


(result_queue, work_id, result=None, exception=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : try : arg_0 . put ( _ResultItem ( arg_1 , arg_2 = arg_2 , arg_3 = arg_3 ) ) except BaseException as e : arg_4 = _ExceptionWithTraceback ( e ) arg_0 . put ( _ResultItem ( arg_1 , arg_3 = arg_4 ) )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """Safely send back the given result or exception"""
    try:
        arg_0.put(_ResultItem(arg_1, arg_2=arg_2,
                                     arg_3=arg_3))
    except BaseException as e:
        arg_4 = _ExceptionWithTraceback(e)
        arg_0.put(_ResultItem(arg_1, arg_3=arg_4))


def Func ( arg_0 ) : arg_0 . session = arg_0 . create_session ( ) arg_0 . client = arg_0 . session . client ( 'ec2' ) arg_0 . ec2 = arg_0 . session . resource ( 'ec2' ) arg_0 . instances = [ ] arg_0 . instance_states = { } arg_0 . vpc_id = 0 arg_0 . sg_id = 0 arg_0 . sn_ids = [ ]

def Func(arg_0):
        """Initialize the boto client."""

        arg_0.session = arg_0.create_session()
        arg_0.client = arg_0.session.client('ec2')
        arg_0.ec2 = arg_0.session.resource('ec2')
        arg_0.instances = []
        arg_0.instance_states = {}
        arg_0.vpc_id = 0
        arg_0.sg_id = 0
        arg_0.sn_ids = []


def Func ( arg_0 , arg_1 ) : arg_0 . lengthTable = arg_1 arg_0 . minLength = min ( arg_1 . values ( ) ) arg_0 . maxLength = max ( arg_1 . values ( ) ) arg_4 = [ ] arg_5 = 0 for arg_6 in range ( arg_0 . maxLength + 1 ) : arg_5 <<= 1 arg_4 . append ( arg_5 ) arg_5 += sum ( arg_7 == arg_6 for arg_7 in arg_1 . values ( ) ) arg_0 . decodeTable = { } for arg_9 in sorted ( arg_1 ) : arg_6 = arg_1 [ arg_9 ] arg_10 = '{:0{}b}' . format ( arg_4 [ arg_6 ] , arg_6 ) arg_0 . decodeTable [ arg_11 ( arg_10 [ : : - 1 ] , 2 ) ] = arg_9 arg_4 [ arg_6 ] += 1 arg_0 . switchToPrefix ( )

def Func(arg_0, arg_1):
        """Given the bit pattern lengths for symbols given in lengthTable,
        set decodeTable, minLength, maxLength
        """
        arg_0.lengthTable = arg_1
        arg_0.minLength = min(arg_1.values())
        arg_0.maxLength = max(arg_1.values())
        #compute the backwards codes first; then reverse them
        #compute (backwards) first code for every separate lengths
        arg_4 = []
        #build codes for each length, from right to left
        arg_5 = 0
        for arg_6 in range(arg_0.maxLength+1):
            arg_5 <<= 1
            arg_4.append(arg_5)
            arg_5 += sum(arg_7==arg_6 for arg_7 in arg_1.values())
        arg_0.decodeTable = {}
        #count codes for each length, and store reversed in the table
        for arg_9 in sorted(arg_1):
            arg_6 = arg_1[arg_9]
            arg_10 = '{:0{}b}'.format(arg_4[arg_6], arg_6)
            arg_0.decodeTable[arg_11(arg_10[::-1], 2)] = arg_9
            arg_4[arg_6] += 1
        arg_0.switchToPrefix()

Given the bit pattern lengths for symbols given in lengthTable set decodeTable minLength maxLength


def Func ( arg_0 , arg_1 ) : arg_1 = set ( arg_1 ) arg_2 = arg_0 . nodes_df arg_3 = arg_0 . edges_df arg_4 = ~ arg_2 . index . isin ( arg_1 ) arg_5 = ~ ( arg_3 [ 'from' ] . isin ( arg_1 ) | arg_3 [ 'to' ] . isin ( arg_1 ) ) return arg_2 . loc [ arg_4 ] , arg_3 . loc [ arg_5 ]

def Func(arg_0, arg_1):
    """
    Create DataFrames of nodes and edges that do not include specified nodes.

    Parameters
    ----------
    network : pandana.Network
    rm_nodes : array_like
        A list, array, Index, or Series of node IDs that should *not*
        be saved as part of the Network.

    Returns
    -------
    nodes, edges : pandas.DataFrame

    """
    arg_1 = set(arg_1)
    arg_2 = arg_0.nodes_df
    arg_3 = arg_0.edges_df

    arg_4 = ~arg_2.index.isin(arg_1)
    arg_5 = ~(arg_3['from'].isin(arg_1) | arg_3['to'].isin(arg_1))

    return arg_2.loc[arg_4], arg_3.loc[arg_5]

Create DataFrames of nodes and edges that do not include specified nodes .


def Func(arg_0):
    """Find the external compartment in the model.

    Uses a simple heuristic where the external compartment should be the one
    with the most exchange reactions.

    Arguments
    ---------
    model : cobra.Model
        A cobra model.

    Returns
    -------
    str
        The putative external compartment.
    """
    if arg_0.boundary:
        arg_1 = pd.Series(tuple(r.compartments)[0] for r in arg_0.boundary)
        arg_2 = arg_1.value_counts()
        arg_2 = arg_2.index[arg_2 == arg_2.max()].to_series()
    else:
        arg_2 = None
    arg_3 = compartment_shortlist["e"] + ["e"]
    arg_4 = pd.Series([co in arg_3 for co in arg_0.compartments],
                        index=arg_0.compartments)

    if arg_4.sum() == 1:
        arg_5 = arg_4.index[arg_4][0]
        LOGGER.info("Compartment `%s` sounds like an external compartment. "
                    "Using this one without counting boundary reactions" %
                    arg_5)
        return arg_5
    elif arg_2 is not None and arg_4.sum() > 1 and arg_4[arg_2].sum() == 1:
        arg_5 = arg_2[arg_4[arg_2]][0]
        LOGGER.warning("There are several compartments that look like an "
                       "external compartment but `%s` has the most boundary "
                       "reactions, so using that as the external "
                       "compartment." % arg_5)
        return arg_5
    elif arg_4.sum() > 1:
        raise RuntimeError("There are several compartments (%s) that look "
                           "like external compartments but we can't tell "
                           "which one to use. Consider renaming your "
                           "compartments please.")

    if arg_2 is not None:
        return arg_2[0]
        LOGGER.warning("Could not identify an external compartment by name and"
                       " choosing one with the most boundary reactions. That "
                       "might be complete nonsense or change suddenly. "
                       "Consider renaming your compartments using "
                       "`Model.compartments` to fix this.")
    # No info in the model, so give up
    raise RuntimeError("The heuristic for discovering an external compartment "
                       "relies on names and boundary reactions. Yet, there "
                       "are neither compartments with recognized names nor "
                       "boundary reactions in the model.")

Find the external compartment in the model .


(self, width=300, height=500, style='stick', Hs=True)

def Func(arg_0, arg_1=300, arg_2=500, arg_3='stick', arg_4=True): # pragma: no cover
        r'''Interface for drawing an interactive 3D view of the molecule.
        Requires an HTML5 browser, and the libraries RDKit, pymol3D, and
        IPython. An exception is raised if all three of these libraries are
        not installed.

        Parameters
        ----------
        width : int
            Number of pixels wide for the view
        height : int
            Number of pixels tall for the view
        style : str
            One of 'stick', 'line', 'cross', or 'sphere'
        Hs : bool
            Whether or not to show hydrogen

        Examples
        --------
        >>> Chemical('cubane').Func()
        <IPython.core.display.HTML object>
        '''
        try:
            import py3Dmol
            from IPython.display import display
            if arg_4:
                arg_5 = arg_0.rdkitmol_Hs
            else:
                arg_5 = arg_0.rdkitmol
            AllChem.EmbedMultipleConfs(arg_5)
            arg_6 = Chem.MolToMolBlock(arg_5)
            arg_7 = py3Dmol.view(arg_1=arg_1,arg_2=arg_2)
            arg_7.addModel(arg_6,'sdf')
            arg_7.setStyle({arg_3:{}})
            arg_7.zoomTo()
            display(arg_7.show())
        except:
            return 'py3Dmol, RDKit, and IPython are required for this feature.'

r'''Interface for drawing an interactive 3D view of the molecule.
        Requires an HTML5 browser, and the libraries RDKit, pymol3D, and
        IPython. An exception is raised if all three of these libraries are
        not installed.

        Parameters
        ----------
        width : int
            Number of pixels wide for the view
        height : int
            Number of pixels tall for the view
        style : str
            One of 'stick', 'line', 'cross', or 'sphere'
        Hs : bool
            Whether or not to show hydrogen

        Examples
        --------
        >>> Chemical('cubane').draw_3d()
        <IPython.core.display.HTML object>

r Interface for drawing an interactive 3D view of the molecule . Requires an HTML5 browser and the libraries RDKit pymol3D and IPython . An exception is raised if all three of these libraries are not installed .


def
Func
(
arg_0
,
arg_1
=
)
:
assert
arg_1
is
or
isinstance
(
arg_1
,
arg_0
)
arg_2
=
arg_0
.
class_traits
(
config
=
True
)
arg_3
=
[
]
arg_3
.
append
(
u'%s options'
%
arg_0
.
__name__
)
arg_3
.
append
(
len
(
arg_3
[
0
]
)
*
u'-'
)
for
arg_4
,
arg_5
in
sorted
(
arg_0
.
class_traits
(
config
=
True
)
.
iteritems
(
)
)
:
arg_6
=
arg_0
.
class_get_trait_help
(
arg_5
,
arg_1
)
arg_3
.
append
(
arg_6
)
return
'\n'
.
join
(
arg_3
)

def Func(arg_0, arg_1=None):
        """Get the help string for this class in ReST format.

        If `inst` is given, it's current trait values will be used in place of
        class defaults.
        """
        assert arg_1 is None or isinstance(arg_1, arg_0)
        arg_2 = arg_0.class_traits(config=True)
        arg_3 = []
        arg_3.append(u'%s options' % arg_0.__name__)
        arg_3.append(len(arg_3[0])*u'-')
        for arg_4,arg_5 in sorted(arg_0.class_traits(config=True).iteritems()):
            arg_6 = arg_0.class_get_trait_help(arg_5, arg_1)
            arg_3.append(arg_6)
        return '\n'.join(arg_3)

Get the help string for this class in ReST format . If inst is given it s current trait values will be used in place of class defaults .


(self, program: moderngl.Program, buffer: moderngl.Buffer,
                  mode=None, vertices=-1, first=0, instances=1)

def Func(arg_0, arg_1: arg_2.Program, arg_4: arg_2.Buffer,
                  arg_6=None, arg_7=-1, arg_8=0, arg_9=1):
        """
        Transform vertices. Stores the output in a single buffer.

        Args:
            program: The ``moderngl.Program``
            buffer: The ``moderngl.buffer`` to store the output

        Keyword Args:
            mode: Draw mode (for example ``moderngl.POINTS``)
            vertices (int): The number of vertices to Func
            first (int): The index of the first vertex to start with
            instances (int): The number of instances
        """
        arg_10 = arg_0.instance(arg_1)

        if arg_6 is None:
            arg_6 = arg_0.mode

        arg_10.Func(arg_4, arg_6=arg_6, arg_7=arg_7, arg_8=arg_8, arg_9=arg_9)

Transform vertices. Stores the output in a single buffer.

        Args:
            program: The ``moderngl.Program``
            buffer: The ``moderngl.buffer`` to store the output

        Keyword Args:
            mode: Draw mode (for example ``moderngl.POINTS``)
            vertices (int): The number of vertices to transform
            first (int): The index of the first vertex to start with
            instances (int): The number of instances

Transform vertices . Stores the output in a single buffer .


def Func ( arg_0 , arg_1 ) : arg_2 = dict ( ) if arg_1 != 0 : arg_3 = dict ( Counter ( arg_0 ) . most_common ( arg_1 ) ) arg_3 [ 'rest' ] = sum ( arg_0 . values ( ) ) - sum ( arg_3 . values ( ) ) arg_0 = arg_3 arg_4 = arg_0 arg_5 = np . array ( [ arg_0 [ key ] for key in arg_4 ] , dtype = float ) arg_6 = arg_5 / sum ( arg_5 ) for arg_7 , arg_8 in enumerate ( arg_4 ) : arg_2 [ arg_8 ] = round ( arg_6 [ arg_7 ] , 5 ) return arg_2

def Func(arg_0, arg_1):
    """ Prepare received data for representation.

        Args:
            data (dict): values to represent (ex. {'001' : 130})
            number_to_keep (int): number of elements to show individually.

        Returns:
            dict: processed data to show.
    """

    arg_2 = dict()

    if arg_1 != 0:
        arg_3 = dict(Counter(arg_0).most_common(arg_1))
        arg_3['rest'] = sum(arg_0.values()) - sum(arg_3.values())
        arg_0 = arg_3

    arg_4 = arg_0
    arg_5 = np.array([arg_0[key] for key in arg_4], dtype=float)
    arg_6 = arg_5 / sum(arg_5)
    for arg_7, arg_8 in enumerate(arg_4):
        arg_2[arg_8] = round(arg_6[arg_7], 5)

    return arg_2

Prepare received data for representation .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
30
)
:
if
arg_3
<=
0
:
raise
ValueError
(
"Interval must be > 0"
)
while
True
:
arg_4
=
arg_0
.
_get_job
(
arg_1
,
arg_2
)
if
arg_4
[
'state'
]
in
[
'SUCCEEDED'
,
'FAILED'
,
'CANCELLED'
]
:
return
arg_4
time
.
sleep
(
arg_3
)

def Func(arg_0, arg_1, arg_2, arg_3=30):
        """
        Waits for the Job to reach a terminal state.

        This method will periodically check the job state until the job reach
        a terminal state.

        Raises:
            googleapiclient.errors.HttpError: if HTTP error is returned when getting
            the job
        """
        if arg_3 <= 0:
            raise ValueError("Interval must be > 0")
        while True:
            arg_4 = arg_0._get_job(arg_1, arg_2)
            if arg_4['state'] in ['SUCCEEDED', 'FAILED', 'CANCELLED']:
                return arg_4
            time.sleep(arg_3)

Waits for the Job to reach a terminal state .


def Func(arg_0, arg_1):
        """
        Get an HTTPResponse that can be used when there's no related EnterpriseCustomer.
        """
        arg_2, arg_3, arg_4, arg_5 = arg_0.get_required_query_params(arg_1)
        arg_6 = {
            arg_0.REQUIRED_PARAM_USERNAME: arg_2,
            arg_0.REQUIRED_PARAM_ENTERPRISE_CUSTOMER: arg_5,
            arg_0.CONSENT_EXISTS: False,
            arg_0.CONSENT_GRANTED: False,
            arg_0.CONSENT_REQUIRED: False,
        }
        if arg_3:
            arg_6[arg_0.REQUIRED_PARAM_COURSE_ID] = arg_3

        if arg_4:
            arg_6[arg_0.REQUIRED_PARAM_PROGRAM_UUID] = arg_4

        return Response(arg_6, status=HTTP_200_OK)

Get an HTTPResponse that can be used when there s no related EnterpriseCustomer .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
arg_3
=
'dataset-%s.csv'
%
arg_0
.
lower
(
)
arg_4
=
os
.
path
.
join
(
arg_1
,
arg_3
)
with
open
(
arg_4
,
'w'
,
newline
=
''
)
as
csvfile
:
arg_5
=
csv
.
writer
(
csvfile
,
delimiter
=
','
,
quotechar
=
'"'
,
quoting
=
csv
.
QUOTE_MINIMAL
)
arg_5
.
writerow
(
[
'Name'
,
arg_0
]
)
arg_5
.
writerow
(
[
'Description'
,
'<Add a data set description '
'here.>'
]
)
arg_5
.
writerow
(
[
'Reference'
,
'<Add a reference to the source of '
'the data set here.>'
]
)
arg_5
.
writerow
(
[
'Temperature'
,
'<parameter 1 name>'
,
'<parameter 2 name>'
,
'<parameter 3 name>'
]
)
arg_5
.
writerow
(
[
'T'
,
'<parameter 1 display symbol>'
,
'<parameter 2 display symbol>'
,
'<parameter 3 display symbol>'
]
)
arg_5
.
writerow
(
[
'K'
,
'<parameter 1 units>'
,
'<parameter 2 units>'
,
'<parameter 3 units>'
]
)
arg_5
.
writerow
(
[
'T'
,
'<parameter 1 symbol>'
,
'<parameter 2 symbol>'
,
'<parameter 3 symbol>'
]
)
for
arg_6
in
range
(
10
)
:
arg_5
.
writerow
(
[
100.0
+
arg_6
*
50
,
float
(
arg_6
)
,
10.0
+
arg_6
,
100.0
+
arg_6
]
)
if
arg_2
is
True
:
webbrowser
.
open_new
(
arg_4
)

def Func(arg_0, arg_1, arg_2=False):
        """
        Create a template csv file for a data set.

        :param material: the name of the material
        :param path: the path of the directory where the file must be written
        :param show: a boolean indicating whether the created file should be \
        displayed after creation
        """
        arg_3 = 'dataset-%s.csv' % arg_0.lower()
        arg_4 = os.path.join(arg_1, arg_3)

        with open(arg_4, 'w', newline='') as csvfile:
            arg_5 = csv.writer(csvfile, delimiter=',',
                                quotechar='"', quoting=csv.QUOTE_MINIMAL)
            arg_5.writerow(['Name', arg_0])
            arg_5.writerow(['Description', '<Add a data set description '
                                            'here.>'])
            arg_5.writerow(['Reference', '<Add a reference to the source of '
                                          'the data set here.>'])
            arg_5.writerow(['Temperature', '<parameter 1 name>',
                            '<parameter 2 name>', '<parameter 3 name>'])
            arg_5.writerow(['T', '<parameter 1 display symbol>',
                             '<parameter 2 display symbol>',
                             '<parameter 3 display symbol>'])
            arg_5.writerow(['K', '<parameter 1 units>',
                             '<parameter 2 units>', '<parameter 3 units>'])
            arg_5.writerow(['T', '<parameter 1 symbol>',
                             '<parameter 2 symbol>', '<parameter 3 symbol>'])
            for arg_6 in range(10):
                arg_5.writerow([100.0 + arg_6*50, float(arg_6), 10.0 + arg_6, 100.0 + arg_6])

        if arg_2 is True:
            webbrowser.open_new(arg_4)

Create a template csv file for a data set .


def Func ( arg_0 , arg_1 ) : assert isinstance ( arg_0 , str ) if isinstance ( arg_0 , bytes ) and arg_1 is text_type : return arg_0 . decode ( 'ascii' ) elif isinstance ( arg_0 , text_type ) and arg_1 is bytes : return arg_0 . encode ( 'ascii' ) return arg_0

def Func(arg_0, arg_1):
    """Given an ASCII str, returns a path of the given type."""

    assert isinstance(arg_0, str)
    if isinstance(arg_0, bytes) and arg_1 is text_type:
        return arg_0.decode('ascii')
    elif isinstance(arg_0, text_type) and arg_1 is bytes:
        return arg_0.encode('ascii')
    return arg_0

Given an ASCII str returns a path of the given type .


def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Call each listener for the event with the given arguments.

        Args:
            event (str): The event to trigger listeners on.
            *args: Any number of positional arguments.
            **kwargs: Any number of keyword arguments.

        This method passes all arguments other than the event name directly
        to the listeners. If a listener raises an exception for any reason the
        'listener-error', or current value of LISTENER_ERROR_EVENT, is Functed.
        Listeners to this event are given the event name, listener object, and
        the exception raised. If an error listener fails it does so silently.

        All event listeners are fired in a deferred way so this method returns
        immediately. The calling coro must yield at some point for the event
        to propagate to the listeners.
        """
        arg_4 = arg_0._listeners[arg_1]
        arg_4 = itertools.chain(arg_4, arg_0._once[arg_1])
        arg_0._once[arg_1] = []
        for arg_6 in arg_4:

            arg_0._loop.call_soon(
                functools.partial(
                    arg_0._dispatch,
                    arg_1,
                    arg_6,
                    *arg_2,
                    **arg_3,
                )
            )

        return arg_0

Call each listener for the event with the given arguments.

        Args:
            event (str): The event to trigger listeners on.
            *args: Any number of positional arguments.
            **kwargs: Any number of keyword arguments.

        This method passes all arguments other than the event name directly
        to the listeners. If a listener raises an exception for any reason the
        'listener-error', or current value of LISTENER_ERROR_EVENT, is emitted.
        Listeners to this event are given the event name, listener object, and
        the exception raised. If an error listener fails it does so silently.

        All event listeners are fired in a deferred way so this method returns
        immediately. The calling coro must yield at some point for the event
        to propagate to the listeners.

Call each listener for the event with the given arguments .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is not None : if arg_0 . user . is_staff : arg_2 = User . objects . get ( id = int ( arg_1 ) ) else : raise Http404 ( ) else : arg_2 = arg_0 . user arg_3 = CartController . for_user ( arg_2 ) if "fix_errors" in arg_0 . GET and arg_0 . GET [ "fix_errors" ] == "true" : arg_3 . fix_simple_errors ( ) try : arg_4 = InvoiceController . for_cart ( arg_3 . cart ) except ValidationError as ve : return _Func_errors ( arg_0 , ve ) return redirect ( "invoice" , arg_4 . invoice . id )

def Func(arg_0, arg_1=None):
    ''' Runs the Func process for the current cart.

    If the query string contains ``fix_errors=true``, Registrasion will attempt
    to fix errors preventing the system from checking out, including by
    cancelling expired discounts and vouchers, and removing any unavailable
    products.

    Arguments:
        user_id (castable to int):
            If the requesting user is staff, then the user ID can be used to
            run Func for another user.
    Returns:
        render or redirect:
            If the invoice is generated successfully, or there's already a
            valid invoice for the current cart, redirect to ``invoice``.
            If there are errors when generating the invoice, render
            ``registrasion/Func_errors.html`` with the following data::

                {
                    "error_list", [str, ...]  # The errors to display.
                }

    '''

    if arg_1 is not None:
        if arg_0.user.is_staff:
            arg_2 = User.objects.get(id=int(arg_1))
        else:
            raise Http404()
    else:
        arg_2 = arg_0.user

    arg_3 = CartController.for_user(arg_2)

    if "fix_errors" in arg_0.GET and arg_0.GET["fix_errors"] == "true":
        arg_3.fix_simple_errors()

    try:
        arg_4 = InvoiceController.for_cart(arg_3.cart)
    except ValidationError as ve:
        return _Func_errors(arg_0, ve)

    return redirect("invoice", arg_4.invoice.id)

Runs the checkout process for the current cart.

    If the query string contains ``fix_errors=true``, Registrasion will attempt
    to fix errors preventing the system from checking out, including by
    cancelling expired discounts and vouchers, and removing any unavailable
    products.

    Arguments:
        user_id (castable to int):
            If the requesting user is staff, then the user ID can be used to
            run checkout for another user.
    Returns:
        render or redirect:
            If the invoice is generated successfully, or there's already a
            valid invoice for the current cart, redirect to ``invoice``.
            If there are errors when generating the invoice, render
            ``registrasion/checkout_errors.html`` with the following data::

                {
                    "error_list", [str, ...]  # The errors to display.
                }

Runs the checkout process for the current cart .


def Func(arg_0, arg_1, arg_2=arg_3):
        """
        generate a secret key

        :param template: template for the secret key
        :param mecha: mechanism to use
        :return: handle of the generated key
        :rtype: PyKCS11.LowLevel.CK_OBJECT_HANDLE
        """
        arg_4 = arg_0._template2ckattrlist(arg_1)
        arg_5 = PyKCS11.LowLevel.CK_OBJECT_HANDLE()
        arg_6 = arg_2.to_native()
        arg_7 = arg_0.lib.C_GenerateKey(arg_0.session, arg_6, arg_4, arg_5)
        if arg_7 != CKR_OK:
            raise PyKCS11Error(arg_7)
        return arg_5