def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = tornado . ioloop . IOLoop . instance ( ) try : return arg_4 . run_sync ( lambda : API . Func ( arg_0 , arg_1 , arg_2 , arg_3 ) ) except Exception : Log . debug ( traceback . format_exc ( ) ) raise

def Func(arg_0, arg_1, arg_2, arg_3):
  """Synced API call to get logical plans"""
  arg_4 = tornado.ioloop.IOLoop.instance()
  try:
    return arg_4.run_sync(lambda: API.Func(arg_0, arg_1, arg_2, arg_3))
  except Exception:
    Log.debug(traceback.format_exc())
    raise


def Func ( arg_0 ) : arg_1 = os . path . dirname ( arg_0 . filename ) if arg_1 : return Directory ( arg_1 ) else : return None

def Func(arg_0):
        """ Returns the directory where the file is placed in or None if the
        path to the file doesn't contain a directory
        """
        arg_1 = os.path.dirname(arg_0.filename)
        if arg_1:
            return Directory(arg_1)
        else:
            return None

Returns the directory where the file is placed in or None if the path to the file doesn t contain a directory


(self, where, max_length=None, force=False)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False ) : arg_4 = io . BytesIO ( ) while True : arg_5 = arg_0 . read_int ( arg_1 , 8 , arg_3 ) if issymbolic ( arg_5 ) or arg_5 == 0 : break if arg_2 is not None : if arg_2 == 0 : break arg_2 = arg_2 - 1 arg_4 . write ( Operators . CHR ( arg_5 ) ) arg_1 += 1 return arg_4 . getvalue ( ) . decode ( )

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
        """
        Read a NUL-terminated concrete buffer from memory. Stops reading at first symbolic byte.

        :param int where: Address to read string from
        :param int max_length:
            The size in bytes to cap the string at, or None [default] for no
            limit.
        :param force: whether to ignore memory permissions
        :return: string read
        :rtype: str
        """
        arg_4 = io.BytesIO()
        while True:
            arg_5 = arg_0.read_int(arg_1, 8, arg_3)

            if issymbolic(arg_5) or arg_5 == 0:
                break

            if arg_2 is not None:
                if arg_2 == 0:
                    break
                arg_2 = arg_2 - 1
            arg_4.write(Operators.CHR(arg_5))
            arg_1 += 1
        return arg_4.getvalue().decode()

Read a NUL - terminated concrete buffer from memory . Stops reading at first symbolic byte .


(self, name, default, allow_default=True)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
True
)
:
if
not
arg_0
.
settings
.
Func
(
'pyconfig.case_sensitive'
,
False
)
:
arg_1
=
arg_1
.
lower
(
)
if
arg_1
not
in
arg_0
.
settings
:
if
not
arg_3
:
raise
LookupError
(
'No setting "{name}"'
.
format
(
arg_1
=
arg_1
)
)
arg_0
.
settings
[
arg_1
]
=
arg_2
return
arg_0
.
settings
[
arg_1
]

def Func(arg_0, arg_1, arg_2, arg_3=True):
        """ Return a setting value.

            :param str name: Setting key name.
            :param default: Default value of setting if it's not explicitly
                            set.
            :param bool allow_default: If true, use the parameter default as
                            default if the key is not set, else raise
                            :exc:`LookupError`
            :raises: :exc:`LookupError` if allow_default is false and the setting is
                     not set.
        """
        if not arg_0.settings.Func('pyconfig.case_sensitive', False):
            arg_1 = arg_1.lower()
        if arg_1 not in arg_0.settings:
            if not arg_3:
                raise LookupError('No setting "{name}"'.format(arg_1=arg_1))
            arg_0.settings[arg_1] = arg_2
        return arg_0.settings[arg_1]


def Func(arg_0, arg_1):
        '''
        Retrieves an existing event hub.

        hub_name:
            Name of the event hub.
        '''
        _validate_not_none('hub_name', arg_1)
        arg_2 = HTTPRequest()
        arg_2.method = 'GET'
        arg_2.host = arg_0._get_host()
        arg_2.path = '/' + _str(arg_1) + ''
        arg_2.path, arg_2.query = arg_0._httpclient._update_request_uri_query(arg_2)  # pylint: disable=protected-access
        arg_2.headers = arg_0._update_service_bus_header(arg_2)
        arg_8 = arg_0._perform_request(arg_2)

        return _convert_response_to_event_hub(arg_8)


def
Func
(
arg_0
)
:
LOG
.
info
(
"Parsing transcripts from request"
)
arg_1
=
[
'chrom'
,
'ensembl_gene_id'
,
'ensembl_transcript_id'
,
'transcript_start'
,
'transcript_end'
,
'refseq_mrna'
,
'refseq_mrna_predicted'
,
'refseq_ncrna'
,
]
for
arg_2
,
arg_3
in
arg_0
.
iterrows
(
)
:
arg_4
=
{
}
arg_4
[
'chrom'
]
=
str
(
arg_3
[
'chromosome_name'
]
)
arg_4
[
'ensembl_gene_id'
]
=
arg_3
[
'ensembl_gene_id'
]
arg_4
[
'ensembl_transcript_id'
]
=
arg_3
[
'ensembl_transcript_id'
]
arg_4
[
'transcript_start'
]
=
int
(
arg_3
[
'transcript_start'
]
)
arg_4
[
'transcript_end'
]
=
int
(
arg_3
[
'transcript_end'
]
)
for
arg_5
in
arg_1
[
3
:
]
:
if
type
(
arg_3
[
arg_5
]
)
is
float
:
arg_4
[
arg_5
]
=
else
:
arg_4
[
arg_5
]
=
arg_3
[
arg_5
]
yield
arg_4

def Func(arg_0):
    """Parse a dataframe with ensembl transcript information

    Args:
        res(pandas.DataFrame)

    Yields:
        transcript_info(dict)
    """
    LOG.info("Parsing transcripts from request")

    arg_1 = [
        'chrom',
        'ensembl_gene_id',
        'ensembl_transcript_id',
        'transcript_start',
        'transcript_end',
        'refseq_mrna',
        'refseq_mrna_predicted',
        'refseq_ncrna',
    ]
    # for res in result.itertuples():
    for arg_2, arg_3 in arg_0.iterrows():
        arg_4 = {}

        arg_4['chrom'] = str(arg_3['chromosome_name'])
        arg_4['ensembl_gene_id'] = arg_3['ensembl_gene_id']
        arg_4['ensembl_transcript_id'] = arg_3['ensembl_transcript_id']

        arg_4['transcript_start'] = int(arg_3['transcript_start'])
        arg_4['transcript_end'] = int(arg_3['transcript_end'])

        # Check if refseq data is annotated
        # Pandas represent missing data with nan
        for arg_5 in arg_1[-3:]:
            if type(arg_3[arg_5]) is float:
                arg_4[arg_5] = None
            else:
                arg_4[arg_5] = arg_3[arg_5]
        yield arg_4


(modpath, hide_init=True, hide_main=False, check=True,
                       relativeto=None)

def
Func
(
arg_0
,
arg_1
=
True
,
arg_2
=
False
,
arg_3
=
True
,
arg_4
=
)
:
if
arg_3
and
arg_4
is
:
if
not
exists
(
arg_0
)
:
raise
ValueError
(
'modpath={} does not exist'
.
format
(
arg_0
)
)
arg_5
=
abspath
(
expanduser
(
arg_0
)
)
arg_5
=
normalize_modpath
(
arg_5
,
arg_1
=
arg_1
,
arg_2
=
arg_2
)
if
arg_4
:
arg_6
=
dirname
(
abspath
(
expanduser
(
arg_4
)
)
)
arg_7
=
relpath
(
arg_5
,
arg_6
)
else
:
arg_6
,
arg_7
=
split_modpath
(
arg_5
,
arg_3
=
arg_3
)
arg_8
=
splitext
(
arg_7
)
[
0
]
if
'.'
in
arg_8
:
arg_8
,
arg_9
=
arg_8
.
split
(
'.'
)
arg_8
=
arg_8
.
replace
(
'/'
,
'.'
)
arg_8
=
arg_8
.
replace
(
'\\'
,
'.'
)
return
arg_8

def Func(arg_0, arg_1=True, arg_2=False, arg_3=True,
                       arg_4=None):
    """
    Determines importable name from file path

    Converts the path to a module (__file__) to the importable python name
    (__name__) without importing the module.

    The filename is converted to a module name, and parent directories are
    recursively included until a directory without an __init__.py file is
    encountered.

    Args:
        modpath (str): module filepath
        hide_init (bool): removes the __init__ suffix (default True)
        hide_main (bool): removes the __main__ suffix (default False)
        check (bool): if False, does not raise an error if modpath is a dir
            and does not contain an __init__ file.
        relativeto (str, optional): if specified, all checks are ignored and
            this is considered the path to the root module.

    Returns:
        str: modname

    Raises:
        ValueError: if check is True and the path does not exist

    CommandLine:
        xdoctest -m xdoctest.static_analysis Func

    Example:
        >>> from xdoctest import static_analysis
        >>> modpath = static_analysis.__file__.replace('.pyc', '.py')
        >>> modpath = modpath.replace('.pyc', '.py')
        >>> modname = Func(modpath)
        >>> assert modname == 'xdoctest.static_analysis'

    Example:
        >>> import xdoctest
        >>> assert Func(xdoctest.__file__.replace('.pyc', '.py')) == 'xdoctest'
        >>> assert Func(dirname(xdoctest.__file__.replace('.pyc', '.py'))) == 'xdoctest'

    Example:
        >>> modpath = modname_to_modpath('_ctypes')
        >>> modname = Func(modpath)
        >>> assert modname == '_ctypes'
    """
    if arg_3 and arg_4 is None:
        if not exists(arg_0):
            raise ValueError('modpath={} does not exist'.format(arg_0))
    arg_5 = abspath(expanduser(arg_0))

    arg_5 = normalize_modpath(arg_5, arg_1=arg_1,
                                 arg_2=arg_2)
    if arg_4:
        arg_6 = dirname(abspath(expanduser(arg_4)))
        arg_7 = relpath(arg_5, arg_6)
    else:
        arg_6, arg_7 = split_modpath(arg_5, arg_3=arg_3)

    arg_8 = splitext(arg_7)[0]
    if '.' in arg_8:
        arg_8, arg_9 = arg_8.split('.')
    arg_8 = arg_8.replace('/', '.')
    arg_8 = arg_8.replace('\\', '.')
    return arg_8

Determines importable name from file path

    Converts the path to a module (__file__) to the importable python name
    (__name__) without importing the module.

    The filename is converted to a module name, and parent directories are
    recursively included until a directory without an __init__.py file is
    encountered.

    Args:
        modpath (str): module filepath
        hide_init (bool): removes the __init__ suffix (default True)
        hide_main (bool): removes the __main__ suffix (default False)
        check (bool): if False, does not raise an error if modpath is a dir
            and does not contain an __init__ file.
        relativeto (str, optional): if specified, all checks are ignored and
            this is considered the path to the root module.

    Returns:
        str: modname

    Raises:
        ValueError: if check is True and the path does not exist

    CommandLine:
        xdoctest -m xdoctest.static_analysis modpath_to_modname

    Example:
        >>> from xdoctest import static_analysis
        >>> modpath = static_analysis.__file__.replace('.pyc', '.py')
        >>> modpath = modpath.replace('.pyc', '.py')
        >>> modname = modpath_to_modname(modpath)
        >>> assert modname == 'xdoctest.static_analysis'

    Example:
        >>> import xdoctest
        >>> assert modpath_to_modname(xdoctest.__file__.replace('.pyc', '.py')) == 'xdoctest'
        >>> assert modpath_to_modname(dirname(xdoctest.__file__.replace('.pyc', '.py'))) == 'xdoctest'

    Example:
        >>> modpath = modname_to_modpath('_ctypes')
        >>> modname = modpath_to_modname(modpath)
        >>> assert modname == '_ctypes'


def Func(arg_0):
    '''Initialize s3 access keys from environment variable or s3cfg config file.'''
    arg_1.S3_KEYS = arg_1.s3_keys_from_cmdline(arg_0) or arg_1.s3_keys_from_env() \
                        or arg_1.s3_keys_from_s3cfg(arg_0)

Initialize s3 access keys from environment variable or s3cfg config file .


def Func(arg_0, arg_1=None, arg_2=None, arg_3=1e-7):
    """Normalize every pixels by the same given mean and std, which are usually
    compute from all examples.

    Parameters
    -----------
    x : numpy.array
        An image with dimension of [row, col, channel] (default).
    mean : float
        Value for subtraction.
    std : float
        Value for division.
    epsilon : float
        A small position value for dividing standard deviation.

    Returns
    -------
    numpy.array
        A processed image.

    """
    if arg_1:
        arg_0 = arg_0 - arg_1
    if arg_2:
        arg_0 = arg_0 / (arg_2 + arg_3)
    return arg_0

Normalize every pixels by the same given mean and std which are usually compute from all examples .


def Func ( arg_0 , arg_1 ) : arg_2 = np . zeros ( arg_1 . shape [ 0 ] ) arg_3 = arg_0 . grid_to_elliptical_radii ( arg_1 ) for arg_4 in range ( arg_1 . shape [ 0 ] ) : arg_2 [ arg_4 ] = arg_0 . convergence_func ( arg_3 [ arg_4 ] ) return arg_2

def Func(arg_0, arg_1):
        """ Calculate the projected convergence at a given set of arc-second gridded coordinates.

        Parameters
        ----------
        grid : grids.RegularGrid
            The grid of (y,x) arc-second coordinates the surface density is computed on.
        """

        arg_2 = np.zeros(arg_1.shape[0])

        arg_3 = arg_0.grid_to_elliptical_radii(arg_1)

        for arg_4 in range(arg_1.shape[0]):
            arg_2[arg_4] = arg_0.convergence_func(arg_3[arg_4])

        return arg_2

Calculate the projected convergence at a given set of arc - second gridded coordinates .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_2 = format_from_extension ( arg_1 ) with file ( arg_1 , 'rbU' ) as fp : arg_3 = arg_0 . Func_like ( fp , arg_2 ) arg_3 . filename = arg_1 return arg_3

def Func(arg_0, arg_1, arg_2=None):
        """ Return an instance of the class that is saved in the file with the
            given filename in the specified format.
        """
        if arg_2 is None:
            # try to derive protocol from file extension
            arg_2 = format_from_extension(arg_1)
        with file(arg_1,'rbU') as fp:
            arg_3 = arg_0.Func_like(fp, arg_2)
            arg_3.filename = arg_1
            return arg_3

Return an instance of the class that is saved in the file with the given filename in the specified format .


return cache.get(cls.get_cache_item_name(index_name, doc_type), {})

def Func ( arg_0 , arg_1 , arg_2 ) : return cache . get ( arg_0 . get_cache_item_name ( arg_1 , arg_2 ) , { } )

def Func(arg_0, arg_1, arg_2):
        """ fetch mapped-items structure from cache """
        return cache.get(arg_0.get_cache_item_name(arg_1, arg_2), {})

fetch mapped - items structure from cache


(url, method='GET', user_agent='django-oembed', timeout=SOCKET_TIMEOUT)

def
Func
(
arg_0
,
arg_1
=
'GET'
,
arg_2
=
'django-oembed'
,
arg_3
=
arg_4
)
:
arg_5
=
httplib2
.
Http
(
arg_3
=
arg_3
)
arg_6
=
{
'User-Agent'
:
arg_2
,
'Accept-Encoding'
:
'gzip'
}
try
:
arg_7
,
arg_8
=
arg_5
.
request
(
arg_0
,
arg_7
=
arg_6
,
arg_1
=
arg_1
)
except
:
raise
OEmbedHTTPException
(
'Error fetching %s'
%
arg_0
)
return
arg_7
,
arg_8

def Func(arg_0, arg_1='GET', arg_2='django-oembed', arg_3=arg_4):
    """
    Fetch response headers and data from a URL, raising a generic exception
    for any kind of failure.
    """
    arg_5 = httplib2.Http(arg_3=arg_3)
    arg_6 = {
        'User-Agent': arg_2,
        'Accept-Encoding': 'gzip'}
    try:
        arg_7, arg_8 = arg_5.request(arg_0, arg_7=arg_6, arg_1=arg_1)
    except:
        raise OEmbedHTTPException('Error fetching %s' % arg_0)
    return arg_7, arg_8

Fetch response headers and data from a URL raising a generic exception for any kind of failure .


(self, text, media=None, utc=None, now=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : arg_5 = PATHS [ 'EDIT' ] % arg_0 . id arg_6 = "text=%s&" % arg_1 if arg_4 : arg_6 += "now=%s&" % arg_4 if arg_3 : arg_6 += "utc=%s&" % arg_3 if arg_2 : arg_7 = "media[%s]=%s&" for arg_8 , arg_9 in arg_2 . iteritems ( ) : arg_6 += arg_7 % ( arg_8 , arg_9 ) arg_10 = arg_0 . api . post ( arg_5 = arg_5 , data = arg_6 ) return Update ( api = arg_0 . api , raw_response = arg_10 [ 'update' ] )

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
    '''
      Edit an existing, individual status update.
    '''

    arg_5 = PATHS['EDIT'] % arg_0.id

    arg_6 = "text=%s&" % arg_1

    if arg_4:
      arg_6 += "now=%s&" % arg_4

    if arg_3:
      arg_6 += "utc=%s&" % arg_3

    if arg_2:
      arg_7 = "media[%s]=%s&"

      for arg_8, arg_9 in arg_2.iteritems():
        arg_6 += arg_7 % (arg_8, arg_9)

    arg_10 = arg_0.api.post(arg_5=arg_5, data=arg_6)

    return Update(api=arg_0.api, raw_response=arg_10['update'])

Edit an existing individual status update .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get ( 'htmode' ) arg_3 = arg_1 . get ( 'hwmode' , None ) if arg_2 . startswith ( 'HT' ) : return '802.11n' elif arg_2 . startswith ( 'VHT' ) : return '802.11ac' return '802.{0}' . format ( arg_3 )

def Func(arg_0, arg_1):
        """
        determines NetJSON protocol radio attribute
        """
        arg_2 = arg_1.get('htmode')
        arg_3 = arg_1.get('hwmode', None)
        if arg_2.startswith('HT'):
            return '802.11n'
        elif arg_2.startswith('VHT'):
            return '802.11ac'
        return '802.{0}'.format(arg_3)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_0 . startValue = arg_3 . GetTable ( ) . GetValue ( arg_1 , arg_2 ) arg_5 = arg_3 . GetTable ( ) . columns [ arg_2 ] . _choices arg_0 . _tc . Clear ( ) arg_0 . _tc . AppendItems ( arg_5 ) arg_0 . _tc . SetStringSelection ( arg_0 . startValue ) arg_0 . _tc . SetFocus ( )

def Func(arg_0, arg_1, arg_2, arg_3):
        "Fetch the value from the table and prepare the edit control"
        arg_0.startValue = arg_3.GetTable().GetValue(arg_1, arg_2)
        arg_5 = arg_3.GetTable().columns[arg_2]._choices
        arg_0._tc.Clear()
        arg_0._tc.AppendItems(arg_5)
        arg_0._tc.SetStringSelection(arg_0.startValue)
        arg_0._tc.SetFocus()


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
is
:
raise
AirflowBadRequest
(
"Database name cannot be None."
)
arg_0
.
get_conn
(
)
.
DeleteDatabase
(
get_database_link
(
arg_1
)
)

def Func(arg_0, arg_1):
        """
        Deletes an existing database in CosmosDB.
        """
        if arg_1 is None:
            raise AirflowBadRequest("Database name cannot be None.")

        arg_0.get_conn().DeleteDatabase(get_database_link(arg_1))

Deletes an existing database in CosmosDB .


(
        self, component_info=None, data=None, component_position=None, index=None
    )

return self._get_2d_markers(
            data, component_info, component_position, index=index
        )

def Func(
        arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None
    ):
        """Get 2D markers.

        :param index: Specify which camera to get 2D from, will be returned as
                      first entry in the returned array.
        """
        return arg_0._Func(
            arg_2, arg_1, arg_3, arg_4=arg_4
        )


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = urllib2 . Request ( arg_1 ) arg_3 . add_header ( "Content-type" , "application/xml" ) arg_4 = urllib2 . urlopen ( arg_3 , arg_2 . encode ( 'utf-8' ) ) . read ( ) except urllib2 . URLError , v : raise AmbientSMSError ( v ) return dictFromXml ( arg_4 )

def Func(arg_0, arg_1, arg_2):
        """
        Inteface for sending web requests to the AmbientSMS API Server
        """
        try:
            arg_3 = urllib2.Request(arg_1)
            arg_3.add_header("Content-type", "application/xml")
            arg_4 = urllib2.urlopen(arg_3, arg_2.encode('utf-8')).read()
        except urllib2.URLError, v:
            raise AmbientSMSError(v)
        return dictFromXml(arg_4)


(self,
                   object_type,
                   unique_identifiers,
                   derivation_method,
                   derivation_parameters,
                   template_attribute,
                   credential=None)

def Func(arg_0,
                   arg_1,
                   arg_2,
                   arg_3,
                   arg_4,
                   arg_5,
                   arg_6=None):
        """
        Derive a new key or secret data from an existing managed object.

        Args:
            object_type (ObjectType): An ObjectType enumeration specifying
                what type of object to create. Required.
            unique_identifiers (list): A list of strings specifying the unique
                IDs of the existing managed objects to use for key derivation.
                Required.
            derivation_method (DerivationMethod): A DerivationMethod
                enumeration specifying what key derivation method to use.
                Required.
            derivation_parameters (DerivationParameters): A
                DerivationParameters struct containing the settings and
                options to use for key derivation.
            template_attribute (TemplateAttribute): A TemplateAttribute struct
                containing the attributes to set on the newly derived object.
            credential (Credential): A Credential struct containing a set of
                authorization parameters for the operation. Optional, defaults
                to None.

        Returns:
            dict: The results of the derivation operation, containing the
                following key/value pairs:

                Key                  | Value
                ---------------------|-----------------------------------------
                'unique_identifier'  | (string) The unique ID of the newly
                                     | derived object.
                'template_attribute' | (TemplateAttribute) A struct containing
                                     | any attributes set on the newly derived
                                     | object.
                'result_status'      | (ResultStatus) An enumeration indicating
                                     | the status of the operation result.
                'result_reason'      | (ResultReason) An enumeration providing
                                     | context for the result status.
                'result_message'     | (string) A message providing additional
                                     | context for the operation result.
        """
        arg_7 = Operation(OperationEnum.DERIVE_KEY)
        arg_8 = payloads.DeriveKeyRequestPayload(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5
        )
        arg_9 = messages.RequestBatchItem(
            arg_7=arg_7,
            arg_8=arg_8
        )

        arg_10 = arg_0._build_request_message(arg_6, [arg_9])
        arg_11 = arg_0._send_and_receive_message(arg_10)
        arg_9 = arg_11.batch_items[0]
        arg_12 = arg_9.response_payload

        arg_13 = {}

        if arg_12:
            arg_13['unique_identifier'] = arg_12.unique_identifier
            arg_13['template_attribute'] = arg_12.template_attribute

        arg_13['result_status'] = arg_9.result_status.value
        try:
            arg_13['result_reason'] = arg_9.result_reason.value
        except Exception:
            arg_13['result_reason'] = arg_9.result_reason
        try:
            arg_13['result_message'] = arg_9.result_message.value
        except Exception:
            arg_13['result_message'] = arg_9.result_message

        return arg_13

Derive a new key or secret data from an existing managed object .


return {name: coef for name, coef in zip(tbl["names"], tbl["coefficients"])}

def Func ( arg_0 ) : arg_1 = arg_0 . _model_json [ "output" ] [ "coefficients_table" ] if arg_1 is None : return None return { arg_2 : Func for arg_2 , Func in zip ( arg_1 [ "names" ] , arg_1 [ "coefficients" ] ) }

def Func(arg_0):
        """
        Return the coefficients which can be applied to the non-standardized data.

        Note: standardize = True by default, if set to False then coef() return the coefficients which are fit directly.
        """
        arg_1 = arg_0._model_json["output"]["coefficients_table"]
        if arg_1 is None:
            return None
        return {arg_2: Func for arg_2, Func in zip(arg_1["names"], arg_1["coefficients"])}

Return the coefficients which can be applied to the non - standardized data .


def Func ( arg_0 , arg_1 ) : arg_2 = 0 try : arg_0 . files [ arg_1 ] . sync ( ) except IndexError : arg_2 = - errno . EBADF except FdError : arg_2 = - errno . EINVAL return arg_2

def Func(arg_0, arg_1):
        """
        Synchronize a file's in-core state with that on disk.
        """

        arg_2 = 0
        try:
            arg_0.files[arg_1].sync()
        except IndexError:
            arg_2 = -errno.EBADF
        except FdError:
            arg_2 = -errno.EINVAL

        return arg_2

Synchronize a file s in - core state with that on disk .


(model,
             observed_time_series,
             parameter_samples,
             num_steps_forecast)

def Func(arg_0,
             arg_1,
             arg_2,
             arg_3):
  """Construct predictive distribution over future observations.

  Given samples from the posterior over parameters, return the predictive
  distribution over future observations for num_steps_Func timesteps.

  Args:
    model: An instance of `StructuralTimeSeries` representing a
      time-series model. This represents a joint distribution over
      time-series and their parameters with batch shape `[b1, ..., bN]`.
    observed_time_series: `float` `Tensor` of shape
      `concat([sample_shape, model.batch_shape, [num_timesteps, 1]])` where
      `sample_shape` corresponds to i.i.d. observations, and the trailing `[1]`
      dimension may (optionally) be omitted if `num_timesteps > 1`. May
      optionally be an instance of `tfp.sts.MaskedTimeSeries` including a
      mask `Tensor` to encode the locations of missing observations.
    parameter_samples: Python `list` of `Tensors` representing posterior samples
      of model parameters, with shapes `[concat([[num_posterior_draws],
      param.prior.batch_shape, param.prior.event_shape]) for param in
      model.parameters]`. This may optionally also be a map (Python `dict`) of
      parameter names to `Tensor` values.
    num_steps_Func: scalar `int` `Tensor` number of steps to Func.

  Returns:
    Func_dist: a `tfd.MixtureSameFamily` instance with event shape
      [num_steps_Func, 1] and batch shape
      `concat([sample_shape, model.batch_shape])`, with `num_posterior_draws`
      mixture components.

  #### Examples

  Suppose we've built a model and fit it to data using HMC:

  ```python
    day_of_week = tfp.sts.Seasonal(
        num_seasons=7,
        observed_time_series=observed_time_series,
        name='day_of_week')
    local_linear_trend = tfp.sts.LocalLinearTrend(
        observed_time_series=observed_time_series,
        name='local_linear_trend')
    model = tfp.sts.Sum(components=[day_of_week, local_linear_trend],
                        observed_time_series=observed_time_series)

    samples, kernel_results = tfp.sts.fit_with_hmc(model, observed_time_series)
  ```

  Passing the posterior samples into `Func`, we construct a Func
  distribution:

  ```python
    Func_dist = tfp.sts.Func(model, observed_time_series,
                                     parameter_samples=samples,
                                     num_steps_Func=50)

    Func_mean = Func_dist.mean()[..., 0]  # shape: [50]
    Func_scale = Func_dist.stddev()[..., 0]  # shape: [50]
    Func_samples = Func_dist.sample(10)[..., 0]  # shape: [10, 50]
  ```

  If using variational inference instead of HMC, we'd construct a Func using
  samples from the variational posterior:

  ```python
    (variational_loss,
     variational_distributions) = tfp.sts.build_factored_variational_loss(
       model=model, observed_time_series=observed_time_series)

    # OMITTED: take steps to optimize variational loss

    samples = {k: q.sample(30) for (k, q) in variational_distributions.items()}
    Func_dist = tfp.sts.Func(model, observed_time_series,
                                         parameter_samples=samples,
                                         num_steps_Func=50)
  ```

  We can visualize the Func by plotting:

  ```python
    from matplotlib import pylab as plt
    def plot_Func(observed_time_series,
                      Func_mean,
                      Func_scale,
                      Func_samples):
      plt.figure(figsize=(12, 6))

      num_steps = observed_time_series.shape[-1]
      num_steps_Func = Func_mean.shape[-1]
      num_steps_train = num_steps - num_steps_Func

      c1, c2 = (0.12, 0.47, 0.71), (1.0, 0.5, 0.05)
      plt.plot(np.arange(num_steps), observed_time_series,
               lw=2, color=c1, label='ground truth')

      Func_steps = np.arange(num_steps_train,
                       num_steps_train+num_steps_Func)
      plt.plot(Func_steps, Func_samples.T, lw=1, color=c2, alpha=0.1)
      plt.plot(Func_steps, Func_mean, lw=2, ls='--', color=c2,
               label='Func')
      plt.fill_between(Func_steps,
                       Func_mean - 2 * Func_scale,
                       Func_mean + 2 * Func_scale, color=c2, alpha=0.2)

      plt.xlim([0, num_steps])
      plt.legend()

    plot_Func(observed_time_series,
                  Func_mean=Func_mean,
                  Func_scale=Func_scale,
                  Func_samples=Func_samples)
  ```

  """

  with tf.compat.v1.name_scope(
      'Func',
      values=[arg_1, arg_2, arg_3]):
    [
        arg_1,
        arg_4
    ] = sts_util.canonicalize_observed_time_series_with_mask(
        arg_1)

    # Run filtering over the observed timesteps to extract the
    # latent state posterior at timestep T+1 (i.e., the final
    # filtering distribution, pushed through the transition model).
    # This is the prior for the Func model ("today's prior
    # is yesterday's posterior").
    arg_5 = dist_util.prefer_static_value(
        tf.shape(input=arg_1))[-2]
    arg_6 = arg_0.make_state_space_model(
        num_timesteps=arg_5, param_vals=arg_2)
    (arg_7, arg_7, arg_7, arg_8, arg_9, arg_7, arg_7
    ) = arg_6.forward_filter(arg_1, arg_4=arg_4)

    # Build a batch of state-space models over the Func period. Because
    # we'll use MixtureSameFamily to mix over the posterior draws, we need to
    # do some shenanigans to move the `[num_posterior_draws]` batch dimension
    # from the leftmost to the rightmost side of the model's batch shape.
    # TODO(b/120245392): enhance `MixtureSameFamily` to reduce along an
    # arbitrary axis, and eliminate `move_dimension` calls here.
    arg_2 = arg_0._canonicalize_param_vals_as_map(arg_2)  # pylint: disable=protected-access
    arg_10 = {
        param.name: dist_util.move_dimension(
            arg_2[param.name],
            0, -(1 + _prefer_static_event_ndims(param.prior)))
        for param in arg_0.parameters}
    arg_11 = tfd.MultivariateNormalFullCovariance(
        loc=dist_util.move_dimension(arg_8[..., -1, :], 0, -2),
        covariance_matrix=dist_util.move_dimension(
            arg_9[..., -1, :, :], 0, -3))

    # Ugly hack: because we moved `num_posterior_draws` to the trailing (rather
    # than leading) dimension of parameters, the parameter batch shapes no
    # longer broadcast against the `constant_offset` attribute used in `sts.Sum`
    # models. We fix this by manually adding an extra broadcasting dim to
    # `constant_offset` if present.
    # The root cause of this hack is that we mucked with param dimensions above
    # and are now passing params that are 'invalid' in the sense that they don't
    # match the shapes of the model's param priors. The fix (as above) will be
    # to update MixtureSameFamily so we can avoid changing param dimensions
    # altogether.
    # TODO(b/120245392): enhance `MixtureSameFamily` to reduce along an
    # arbitrary axis, and eliminate this hack.
    arg_12 = {}
    if hasattr(arg_0, 'constant_offset'):
      arg_12['constant_offset'] = tf.convert_to_tensor(
          value=arg_0.constant_offset,
          dtype=arg_11.dtype)[..., tf.newaxis]

    # We assume that any STS model that has a `constant_offset` attribute
    # will allow it to be overridden as a kwarg. This is currently just
    # `sts.Sum`.
    # TODO(b/120245392): when kwargs hack is removed, switch back to calling
    # the public version of `_make_state_space_model`.
    arg_13 = arg_0._make_state_space_model(  # pylint: disable=protected-access
        num_timesteps=arg_3,
        param_map=arg_10,
        initial_state_prior=arg_11,
        initial_step=arg_5,
        **arg_12)

    arg_14 = dist_util.prefer_static_value(
        arg_13.batch_shape_tensor())[-1]
    return tfd.MixtureSameFamily(
        mixture_distribution=tfd.Categorical(
            logits=tf.zeros([arg_14], dtype=arg_13.dtype)),
        components_distribution=arg_13)

Construct predictive distribution over future observations.

  Given samples from the posterior over parameters, return the predictive
  distribution over future observations for num_steps_forecast timesteps.

  Args:
    model: An instance of `StructuralTimeSeries` representing a
      time-series model. This represents a joint distribution over
      time-series and their parameters with batch shape `[b1, ..., bN]`.
    observed_time_series: `float` `Tensor` of shape
      `concat([sample_shape, model.batch_shape, [num_timesteps, 1]])` where
      `sample_shape` corresponds to i.i.d. observations, and the trailing `[1]`
      dimension may (optionally) be omitted if `num_timesteps > 1`. May
      optionally be an instance of `tfp.sts.MaskedTimeSeries` including a
      mask `Tensor` to encode the locations of missing observations.
    parameter_samples: Python `list` of `Tensors` representing posterior samples
      of model parameters, with shapes `[concat([[num_posterior_draws],
      param.prior.batch_shape, param.prior.event_shape]) for param in
      model.parameters]`. This may optionally also be a map (Python `dict`) of
      parameter names to `Tensor` values.
    num_steps_forecast: scalar `int` `Tensor` number of steps to forecast.

  Returns:
    forecast_dist: a `tfd.MixtureSameFamily` instance with event shape
      [num_steps_forecast, 1] and batch shape
      `concat([sample_shape, model.batch_shape])`, with `num_posterior_draws`
      mixture components.

  #### Examples

  Suppose we've built a model and fit it to data using HMC:

  ```python
    day_of_week = tfp.sts.Seasonal(
        num_seasons=7,
        observed_time_series=observed_time_series,
        name='day_of_week')
    local_linear_trend = tfp.sts.LocalLinearTrend(
        observed_time_series=observed_time_series,
        name='local_linear_trend')
    model = tfp.sts.Sum(components=[day_of_week, local_linear_trend],
                        observed_time_series=observed_time_series)

    samples, kernel_results = tfp.sts.fit_with_hmc(model, observed_time_series)
  ```

  Passing the posterior samples into `forecast`, we construct a forecast
  distribution:

  ```python
    forecast_dist = tfp.sts.forecast(model, observed_time_series,
                                     parameter_samples=samples,
                                     num_steps_forecast=50)

    forecast_mean = forecast_dist.mean()[..., 0]  # shape: [50]
    forecast_scale = forecast_dist.stddev()[..., 0]  # shape: [50]
    forecast_samples = forecast_dist.sample(10)[..., 0]  # shape: [10, 50]
  ```

  If using variational inference instead of HMC, we'd construct a forecast using
  samples from the variational posterior:

  ```python
    (variational_loss,
     variational_distributions) = tfp.sts.build_factored_variational_loss(
       model=model, observed_time_series=observed_time_series)

    # OMITTED: take steps to optimize variational loss

    samples = {k: q.sample(30) for (k, q) in variational_distributions.items()}
    forecast_dist = tfp.sts.forecast(model, observed_time_series,
                                         parameter_samples=samples,
                                         num_steps_forecast=50)
  ```

  We can visualize the forecast by plotting:

  ```python
    from matplotlib import pylab as plt
    def plot_forecast(observed_time_series,
                      forecast_mean,
                      forecast_scale,
                      forecast_samples):
      plt.figure(figsize=(12, 6))

      num_steps = observed_time_series.shape[-1]
      num_steps_forecast = forecast_mean.shape[-1]
      num_steps_train = num_steps - num_steps_forecast

      c1, c2 = (0.12, 0.47, 0.71), (1.0, 0.5, 0.05)
      plt.plot(np.arange(num_steps), observed_time_series,
               lw=2, color=c1, label='ground truth')

      forecast_steps = np.arange(num_steps_train,
                       num_steps_train+num_steps_forecast)
      plt.plot(forecast_steps, forecast_samples.T, lw=1, color=c2, alpha=0.1)
      plt.plot(forecast_steps, forecast_mean, lw=2, ls='--', color=c2,
               label='forecast')
      plt.fill_between(forecast_steps,
                       forecast_mean - 2 * forecast_scale,
                       forecast_mean + 2 * forecast_scale, color=c2, alpha=0.2)

      plt.xlim([0, num_steps])
      plt.legend()

    plot_forecast(observed_time_series,
                  forecast_mean=forecast_mean,
                  forecast_scale=forecast_scale,
                  forecast_samples=forecast_samples)
  ```

Construct predictive distribution over future observations .


async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . RenameConversationResponse ( ) await arg_0 . _pb_request ( 'conversations/renameconversation' , arg_1 , arg_2 ) return arg_2

async def Func(arg_0, arg_1):
        """Rename a conversation.

        Both group and one-to-one conversations may be renamed, but the
        official Hangouts clients have mixed support for one-to-one
        conversations with custom names.
        """
        arg_2 = hangouts_pb2.RenameConversationResponse()
        await arg_0._pb_request('conversations/renameconversation',
                               arg_1, arg_2)
        return arg_2


def Func(arg_0):
    """Daemon-side command to ensure we're running the latest
    versions of any managed repos, including the
    specs repo, before we do anything else in the up flow."""
    if arg_0:
        update_managed_repos(force=True)
    arg_1 = spec_assembler.get_assembled_specs()
    if not arg_1[constants.CONFIG_BUNDLES_KEY]:
        raise RuntimeError('No bundles are activated. Use `dusty bundles` to activate bundles before running `dusty up`.')
    virtualbox.initialize_docker_vm()

Daemon - side command to ensure we re running the latest versions of any managed repos including the specs repo before we do anything else in the up flow .


def Func(arg_0, arg_1, arg_2, arg_3):
        """DEPRECATED after 0.8"""
        arg_0.append(arg_1, arg_2, arg_3)


def Func(arg_0):
    '''Ingest a finished recording to the Opencast server.
    '''
    # Update status
    set_service_status(Service.INGEST, ServiceStatus.BUSY)
    notify.notify('STATUS=Uploading')
    recording_state(arg_0.uid, 'uploading')
    update_event_status(arg_0, Status.UPLOADING)

    # Select Func service
    # The Func service to use is selected at random from the available
    # Func services to ensure that not every capture agent uses the same
    # service at the same time
    arg_1 = config('service-Func')
    arg_1 = arg_1[randrange(0, len(arg_1))]
    logger.info('Selecting Func service to use: ' + arg_1)

    # create mediapackage
    logger.info('Creating new mediapackage')
    arg_2 = http_request(arg_1 + '/createMediaPackage')

    # extract workflow_def, workflow_config and add DC catalogs
    arg_3 = 'org.opencastproject.capture.agent.properties'
    arg_4 = 'http://www.opencastproject.org/xsd/1.0/dublincore/'
    for arg_5 in arg_0.get_data().get('attach'):
        arg_6 = arg_5.get('data')
        if arg_5.get('x-apple-filename') == arg_3:
            arg_7, arg_8 = get_config_params(arg_6)

        # Check for dublincore catalogs
        elif arg_5.get('fmttype') == 'application/xml' and arg_4 in arg_6:
            arg_9 = arg_5.get('x-apple-filename', '').rsplit('.', 1)[0]
            logger.info('Adding %s DC catalog' % arg_9)
            arg_10 = [('mediaPackage', arg_2),
                      ('flavor', 'dublincore/%s' % arg_9),
                      ('dublinCore', arg_6.encode('utf-8'))]
            arg_2 = http_request(arg_1 + '/addDCCatalog', arg_10)

    # add track
    for (arg_11, arg_12) in arg_0.get_tracks():
        logger.info('Adding track ({0} -> {1})'.format(arg_11, arg_12))
        arg_12 = arg_12.encode('ascii', 'ignore')
        arg_10 = [('mediaPackage', arg_2), ('flavor', arg_11),
                  ('BODY1', (pycurl.FORM_FILE, arg_12))]
        arg_2 = http_request(arg_1 + '/addTrack', arg_10)

    # Func
    logger.info('Ingest recording')
    arg_10 = [('mediaPackage', arg_2)]
    if arg_7:
        arg_10.append(('workflowDefinitionId', arg_7))
    if arg_0.uid:
        arg_10.append(('workflowInstanceId',
                       arg_0.uid.encode('ascii', 'ignore')))
    arg_10 += arg_8
    arg_2 = http_request(arg_1 + '/Func', arg_10)

    # Update status
    recording_state(arg_0.uid, 'upload_finished')
    update_event_status(arg_0, Status.FINISHED_UPLOADING)
    notify.notify('STATUS=Running')
    set_service_status_immediate(Service.INGEST, ServiceStatus.IDLE)

    logger.info('Finished Func')

Ingest a finished recording to the Opencast server .


def Func ( arg_0 ) : if len ( arg_0 ) == 0 : return arg_0 if len ( arg_0 ) == 1 : return b'\x00' + arg_0 arg_0 = bytearray ( arg_0 ) arg_1 = bytearray ( ) arg_2 = bytearray ( ) arg_3 = 0 arg_4 = 0 arg_5 = 127 arg_6 = 'RAW' def finish_raw ( ) : if len ( arg_2 ) == 0 : return arg_1 . append ( len ( arg_2 ) - 1 ) arg_1 . extend ( arg_2 ) arg_2 [ : ] = bytearray ( ) def finish_rle ( ) : arg_1 . append ( 256 - ( arg_4 - 1 ) ) arg_1 . append ( arg_0 [ arg_3 ] ) while arg_3 < len ( arg_0 ) - 1 : arg_7 = arg_0 [ arg_3 ] if arg_0 [ arg_3 ] == arg_0 [ arg_3 + 1 ] : if arg_6 == 'RAW' : finish_raw ( ) arg_6 = 'RLE' arg_4 = 1 elif arg_6 == 'RLE' : if arg_4 == arg_5 : finish_rle ( ) arg_4 = 0 arg_4 += 1 else : if arg_6 == 'RLE' : arg_4 += 1 finish_rle ( ) arg_6 = 'RAW' arg_4 = 0 elif arg_6 == 'RAW' : if len ( arg_2 ) == arg_5 : finish_raw ( ) arg_2 . append ( arg_7 ) arg_3 += 1 if arg_6 == 'RAW' : arg_2 . append ( arg_0 [ arg_3 ] ) finish_raw ( ) else : arg_4 += 1 finish_rle ( ) return bytes ( arg_1 )

def Func(arg_0):
    """
    Encodes data using PackBits encoding.
    """
    if len(arg_0) == 0:
        return arg_0

    if len(arg_0) == 1:
        return b'\x00' + arg_0

    arg_0 = bytearray(arg_0)

    arg_1 = bytearray()
    arg_2 = bytearray()
    arg_3 = 0
    arg_4 = 0
    arg_5 = 127

    # we can safely start with RAW as empty RAW sequences
    # are handled by finish_raw()
    arg_6 = 'RAW'

    def finish_raw():
        if len(arg_2) == 0:
            return
        arg_1.append(len(arg_2)-1)
        arg_1.extend(arg_2)
        arg_2[:] = bytearray()

    def finish_rle():
        arg_1.append(256-(arg_4 - 1))
        arg_1.append(arg_0[arg_3])

    while arg_3 < len(arg_0)-1:
        arg_7 = arg_0[arg_3]

        if arg_0[arg_3] == arg_0[arg_3+1]:
            if arg_6 == 'RAW':
                # end of RAW data
                finish_raw()
                arg_6 = 'RLE'
                arg_4 = 1
            elif arg_6 == 'RLE':
                if arg_4 == arg_5:
                    # restart the encoding
                    finish_rle()
                    arg_4 = 0
                # move to next byte
                arg_4 += 1

        else:
            if arg_6 == 'RLE':
                arg_4 += 1
                finish_rle()
                arg_6 = 'RAW'
                arg_4 = 0
            elif arg_6 == 'RAW':
                if len(arg_2) == arg_5:
                    # restart the encoding
                    finish_raw()

                arg_2.append(arg_7)

        arg_3 += 1

    if arg_6 == 'RAW':
        arg_2.append(arg_0[arg_3])
        finish_raw()
    else:
        arg_4 += 1
        finish_rle()

    return bytes(arg_1)


def Func ( arg_0 ) : arg_1 = tf . io . read_file ( arg_0 ) arg_2 = tf . image . decode_image ( arg_1 , channels = CHANNELS ) arg_2 = tf . image . convert_image_dtype ( arg_2 , tf . float32 ) return arg_2

def Func(arg_0):
  """Returns an image tensor."""
  arg_1 = tf.io.read_file(arg_0)
  arg_2 = tf.image.decode_image(arg_1, channels=CHANNELS)
  arg_2 = tf.image.convert_image_dtype(arg_2, tf.float32)
  return arg_2


def Func ( ) : global g_ok_java_messages global g_save_java_message_filename global g_dict_changed if g_dict_changed : with open ( g_save_java_message_filename , 'wb' ) as ofile : pickle . dump ( g_ok_java_messages , ofile )

def Func():
    """
    Save the ignored java message dict stored in g_ok_java_messages into a pickle file for future use.

    :return: none
    """
    global g_ok_java_messages
    global g_save_java_message_filename
    global g_dict_changed

    if g_dict_changed:
        with open(g_save_java_message_filename,'wb') as ofile:
            pickle.dump(g_ok_java_messages,ofile)

Save the ignored java message dict stored in g_ok_java_messages into a pickle file for future use .


def Func ( arg_0 , arg_1 ) : arg_2 = ( 'percolation_probability_mean' in arg_0 . dtype . names and 'percolation_probability_mean' in arg_1 . dtype . names and 'percolation_probability_m2' in arg_0 . dtype . names and 'percolation_probability_m2' in arg_1 . dtype . names ) arg_3 = np . empty_like ( arg_0 ) def _reducer ( arg_4 , arg_5 = False ) : arg_6 = '{}_mean' . format ( arg_4 ) arg_7 = '{}_m2' . format ( arg_4 ) arg_8 = simoa . stats . online_variance ( * [ ( row [ 'number_of_runs' ] , row [ arg_6 ] . T if arg_5 else row [ arg_6 ] , row [ arg_7 ] . T if arg_5 else row [ arg_7 ] , ) for row in [ arg_0 , arg_1 ] ] ) ( arg_3 [ arg_6 ] , arg_3 [ arg_7 ] , ) = ( arg_8 [ 1 ] . T , arg_8 [ 2 ] . T , ) if arg_5 else arg_8 [ 1 : ] if arg_2 : _reducer ( 'percolation_probability' ) _reducer ( 'max_cluster_size' ) _reducer ( 'moments' , arg_5 = True ) arg_3 [ 'number_of_runs' ] = arg_0 [ 'number_of_runs' ] + arg_1 [ 'number_of_runs' ] return arg_3

def Func(arg_0, arg_1):
    """
    Reduce the canonical averages over several runs

    This is a "true" reducer.
    It is associative and commutative.

    This is a wrapper around `simoa.stats.online_variance`.

    Parameters
    ----------
    row_a, row_b : structured ndarrays
        Output of this function, or initial input from
        `bond_initialize_canonical_averages`

    Returns
    -------
    ret : structured ndarray
        Array is of dtype as returned by `canonical_averages_dtype`

    See Also
    --------
    bond_initialize_canonical_averages
    canonical_averages_dtype
    simoa.stats.online_variance
    """
    arg_2 = (
        'percolation_probability_mean' in arg_0.dtype.names and
        'percolation_probability_mean' in arg_1.dtype.names and
        'percolation_probability_m2' in arg_0.dtype.names and
        'percolation_probability_m2' in arg_1.dtype.names
    )

    # initialize return array
    arg_3 = np.empty_like(arg_0)

    def _reducer(arg_4, arg_5=False):
        arg_6 = '{}_mean'.format(arg_4)
        arg_7 = '{}_m2'.format(arg_4)
        arg_8 = simoa.stats.online_variance(*[
            (
                row['number_of_runs'],
                row[arg_6].T if arg_5 else row[arg_6],
                row[arg_7].T if arg_5 else row[arg_7],
            )
            for row in [arg_0, arg_1]
        ])

        (
            arg_3[arg_6],
            arg_3[arg_7],
        ) = (
            arg_8[1].T,
            arg_8[2].T,
        ) if arg_5 else arg_8[1:]

    if arg_2:
        _reducer('percolation_probability')

    _reducer('max_cluster_size')
    _reducer('moments', arg_5=True)

    arg_3['number_of_runs'] = arg_0['number_of_runs'] + arg_1['number_of_runs']

    return arg_3


def Func ( arg_0 ) : if not arg_0 . genv . host_string : arg_0 . genv . host_string = 'localhost' arg_0 . genv . hosts = [ 'localhost' ] arg_0 . genv . user = getpass . getuser ( )

def Func(arg_0):
        """
        Sets connection parameters to localhost, if not set already.
        """
        if not arg_0.genv.host_string:
            arg_0.genv.host_string = 'localhost'
            arg_0.genv.hosts = ['localhost']
            arg_0.genv.user = getpass.getuser()

Sets connection parameters to localhost if not set already .


def Func ( arg_0 ) : if hasattr ( ElementTree , 'tounicode' ) : return ElementTree . tounicode ( "element" ) elif sys . version_info . major < 3 : return unicode ( ElementTree . tostring ( arg_0 ) ) else : return ElementTree . tostring ( arg_0 , encoding = "unicode" )

def Func(arg_0):
    """Serialize an XML element into a unicode string.

    This should work the same on Python2 and Python3 and with all
    :etree:`ElementTree` implementations.

    :Parameters:
        - `element`: the XML element to serialize
    :Types:
        - `element`: :etree:`ElementTree.Element`
    """
    if hasattr(ElementTree, 'tounicode'):
        # pylint: disable=E1103
        return ElementTree.tounicode("element")
    elif sys.version_info.major < 3:
        return unicode(ElementTree.tostring(arg_0))
    else:
        return ElementTree.tostring(arg_0, encoding = "unicode")

Serialize an XML element into a unicode string .


def Func ( arg_0 ) : arg_0 . log . debug ( "Application.Func" ) if arg_0 . Func_func : arg_0 . Func_func ( arg_0 )

def Func(arg_0):
        """Invoked in the 'finally' block of Application.run."""
        arg_0.log.debug("Application.Func")
        if arg_0.Func_func:
            arg_0.Func_func(arg_0)

Invoked in the finally block of Application . run .


def
Func
(
arg_0
,
Func
)
:
Func
.
stream
=
arg_0
logger
.
debug
(
u"Stream event: {0}"
.
format
(
Func
)
)
arg_0
.
settings
[
"event_queue"
]
.
put
(
Func
)
return
False

def Func(arg_0, Func): # pylint: disable-msg=R0201
        """Handle a stream event.

        Called when connection state is changed.

        Should not be called with self.lock acquired!
        """
        Func.stream = arg_0
        logger.debug(u"Stream event: {0}".format(Func))
        arg_0.settings["event_queue"].put(Func)
        return False


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : return '_' . join ( [ arg_0 , arg_1 , arg_2 , arg_3 ] )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Parse the simple id for a variant

    Simple id is used as a human readable reference for a position, it is
    in no way unique.

    Args:
        chrom(str)
        pos(str)
        ref(str)
        alt(str)

    Returns:
        simple_id(str): The simple human readable variant id
    """
    return '_'.join([arg_0, arg_1, arg_2, arg_3])


def Func(arg_0):
        ''' Initialize the dictionary of architectures for assembling via keystone'''

        return {
            ARM32:   (KS_ARCH_ARM,     KS_MODE_ARM),
            ARM64:   (KS_ARCH_ARM64,   KS_MODE_LITTLE_ENDIAN),
            ARM_TB:  (KS_ARCH_ARM,     KS_MODE_THUMB),
            HEXAGON: (KS_ARCH_HEXAGON, KS_MODE_BIG_ENDIAN),
            MIPS32:  (KS_ARCH_MIPS,    KS_MODE_MIPS32),
            MIPS64:  (KS_ARCH_MIPS,    KS_MODE_MIPS64),
            PPC32:   (KS_ARCH_PPC,     KS_MODE_PPC32),
            PPC64:   (KS_ARCH_PPC,     KS_MODE_PPC64),
            SPARC32: (KS_ARCH_SPARC,   KS_MODE_SPARC32),
            SPARC64: (KS_ARCH_SPARC,   KS_MODE_SPARC64),
            SYSTEMZ: (KS_ARCH_SYSTEMZ, KS_MODE_BIG_ENDIAN),
            X86_16:  (KS_ARCH_X86,     KS_MODE_16),
            X86_32:  (KS_ARCH_X86,     KS_MODE_32),
            X86_64:  (KS_ARCH_X86,     KS_MODE_64),
        }


def Func ( arg_0 ) : if not arg_0 : return arg_0 arg_0 = sorted ( arg_0 ) arg_1 = next ( ( cnt for cnt , val in enumerate ( arg_0 ) if val and not val [ 0 ] . isdigit ( ) ) , None ) if arg_1 is None : return arg_0 arg_2 = arg_0 [ arg_1 : ] arg_3 = arg_0 [ : arg_1 ] return arg_2 + arg_3

def Func(arg_0):
    """
    Sort values, but put numbers after alphabetically sorted words.

    This function is here to make outputs diff-compatible with Aleph.

    Example::
        >>> sorted(["b", "1", "a"])
        ['1', 'a', 'b']
        >>> Func(["b", "1", "a"])
        ['a', 'b', '1']

    Args:
        values (iterable): any iterable object/list/tuple/whatever.

    Returns:
        list of sorted values, but with numbers after words
    """
    if not arg_0:
        return arg_0

    arg_0 = sorted(arg_0)

    # look for first word
    arg_1 = next(
        (cnt for cnt, val in enumerate(arg_0)
             if val and not val[0].isdigit()),
        None
    )

    # if not found, just return the values
    if arg_1 is None:
        return arg_0

    arg_2 = arg_0[arg_1:]
    arg_3 = arg_0[:arg_1]

    return arg_2 + arg_3

Sort values, but put numbers after alphabetically sorted words.

    This function is here to make outputs diff-compatible with Aleph.

    Example::
        >>> sorted(["b", "1", "a"])
        ['1', 'a', 'b']
        >>> resorted(["b", "1", "a"])
        ['a', 'b', '1']

    Args:
        values (iterable): any iterable object/list/tuple/whatever.

    Returns:
        list of sorted values, but with numbers after words

Sort values but put numbers after alphabetically sorted words .


Sends the selected exercise to the TMC pastebin.

def Func ( arg_0 = None , arg_1 = False ) : submit ( Funcbin = True , arg_0 = arg_0 , arg_1 = False )

def Func(arg_0=None, arg_1=False):
    """
    Sends the selected exercise to the TMC Funcbin.
    """
    submit(Funcbin=True, arg_0=arg_0, arg_1=False)

Sends the selected exercise to the TMC pastebin .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
''
,
arg_3
=
)
:
arg_4
=
arg_0
.
__head
arg_5
=
[
]
arg_6
=
getdoc
(
arg_1
)
if
arg_3
:
arg_6
=
arg_3
(
arg_6
)
if
arg_6
:
arg_5
.
append
(
arg_4
(
"Class Docstring:"
)
)
arg_5
.
append
(
indent
(
arg_6
)
)
if
inspect
.
isclass
(
arg_1
)
and
hasattr
(
arg_1
,
'__init__'
)
:
arg_7
=
getdoc
(
arg_1
.
__init__
)
if
arg_7
is
not
:
arg_5
.
append
(
arg_4
(
"Constructor Docstring:"
)
)
arg_5
.
append
(
indent
(
arg_7
)
)
elif
hasattr
(
arg_1
,
'__call__'
)
:
arg_8
=
getdoc
(
arg_1
.
__call__
)
if
arg_8
:
arg_5
.
append
(
arg_4
(
"Calling Docstring:"
)
)
arg_5
.
append
(
indent
(
arg_8
)
)
if
not
arg_5
:
arg_0
.
noinfo
(
'documentation'
,
arg_2
)
else
:
page
.
page
(
'\n'
.
join
(
arg_5
)
)

def Func(arg_0,arg_1,arg_2='',arg_3 = None):
        """Print the docstring for any object.

        Optional:
        -formatter: a function to run the docstring through for specially
        formatted docstrings.

        Examples
        --------

        In [1]: class NoInit:
           ...:     pass

        In [2]: class NoDoc:
           ...:     def __init__(self):
           ...:         pass

        In [3]: %Func NoDoc
        No documentation found for NoDoc

        In [4]: %Func NoInit
        No documentation found for NoInit

        In [5]: obj = NoInit()

        In [6]: %Func obj
        No documentation found for obj

        In [5]: obj2 = NoDoc()

        In [6]: %Func obj2
        No documentation found for obj2
        """

        arg_4 = arg_0.__head  # For convenience
        arg_5 = []
        arg_6 = getdoc(arg_1)
        if arg_3:
            arg_6 = arg_3(arg_6)
        if arg_6:
            arg_5.append(arg_4("Class Docstring:"))
            arg_5.append(indent(arg_6))
        if inspect.isclass(arg_1) and hasattr(arg_1, '__init__'):
            arg_7 = getdoc(arg_1.__init__)
            if arg_7 is not None:
                arg_5.append(arg_4("Constructor Docstring:"))
                arg_5.append(indent(arg_7))
        elif hasattr(arg_1,'__call__'):
            arg_8 = getdoc(arg_1.__call__)
            if arg_8:
                arg_5.append(arg_4("Calling Docstring:"))
                arg_5.append(indent(arg_8))

        if not arg_5:
            arg_0.noinfo('documentation',arg_2)
        else:
            page.page('\n'.join(arg_5))

Print the docstring for any object.

        Optional:
        -formatter: a function to run the docstring through for specially
        formatted docstrings.

        Examples
        --------

        In [1]: class NoInit:
           ...:     pass

        In [2]: class NoDoc:
           ...:     def __init__(self):
           ...:         pass

        In [3]: %pdoc NoDoc
        No documentation found for NoDoc

        In [4]: %pdoc NoInit
        No documentation found for NoInit

        In [5]: obj = NoInit()

        In [6]: %pdoc obj
        No documentation found for obj

        In [5]: obj2 = NoDoc()

        In [6]: %pdoc obj2
        No documentation found for obj2


def Func(arg_0):
    ''' Converts entry element to queue object.

    The format of xml response for queue:
<QueueDescription
    xmlns=\"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\">
    <MaxSizeInBytes>10000</MaxSizeInBytes>
    <DefaultMessageTimeToLive>PT5M</DefaultMessageTimeToLive>
    <LockDuration>PT2M</LockDuration>
    <RequiresGroupedReceives>False</RequiresGroupedReceives>
    <SupportsDuplicateDetection>False</SupportsDuplicateDetection>
    ...
</QueueDescription>

    '''
    arg_1 = Queue()

    # get node for each attribute in Queue class, if nothing found then the
    # response is not valid xml for Queue.
    arg_2 = True

    arg_3 = arg_0.find('./atom:content/sb:QueueDescription', _etree_sb_feed_namespaces)
    if arg_3 is not None:
        arg_4 = [
            ('LockDuration', 'lock_duration', None),
            ('MaxSizeInMegabytes', 'max_size_in_megabytes', int),
            ('RequiresDuplicateDetection', 'requires_duplicate_detection', _parse_bool),
            ('RequiresSession', 'requires_session', _parse_bool),
            ('DefaultMessageTimeToLive', 'default_message_time_to_live', None),
            ('DeadLetteringOnMessageExpiration', 'dead_lettering_on_message_expiration', _parse_bool),
            ('DuplicateDetectionHistoryTimeWindow', 'duplicate_detection_history_time_window', None),
            ('EnableBatchedOperations', 'enable_batched_operations', _parse_bool),
            ('MaxDeliveryCount', 'max_delivery_count', int),
            ('MessageCount', 'message_count', int),
            ('SizeInBytes', 'size_in_bytes', int),
        ]

        for arg_5 in arg_4:
            if _read_etree_element(arg_3, arg_5[0], arg_1, arg_5[1], arg_5[2]):
                arg_2 = False

    if arg_2:
        raise AzureServiceBusResourceNotFound(_ERROR_QUEUE_NOT_FOUND)

    # extract id, updated and name value from feed entry and set them of queue.
    for arg_6, arg_7 in _ETreeXmlToObject.get_entry_properties_from_element(
            arg_0, True).items():
        setattr(arg_1, arg_6, arg_7)

    return arg_1

Converts entry element to queue object .


return (
        Maybe(v.meta)
        .map(lambda m: m.get(SYM_REDEF_META_KEY, None))  # type: ignore
        .or_else_get(False)
    )

def Func ( arg_0 : arg_1 ) -> bool : return ( Maybe ( arg_0 . meta ) . map ( lambda m : m . get ( SYM_REDEF_META_KEY , None ) ) . or_else_get ( False ) )

def Func(arg_0: arg_1) -> bool:
    """Return True if the Var can be redefined."""
    return (
        Maybe(arg_0.meta)
        .map(lambda m: m.get(SYM_REDEF_META_KEY, None))  # type: ignore
        .or_else_get(False)
    )

Return True if the Var can be redefined .


def Func ( arg_0 , arg_1 ) : arg_2 = iter ( arg_1 ) for arg_3 in arg_0 : if arg_3 not in arg_2 : return False return True

def Func(arg_0, arg_1):
    """Are all the elements of needle contained in haystack, and in the same order?
    There may be other elements interspersed throughout"""
    arg_2 = iter(arg_1)
    for arg_3 in arg_0:
        if arg_3 not in arg_2:
            return False
    return True

Are all the elements of needle contained in haystack and in the same order? There may be other elements interspersed throughout


def Func ( arg_0 ) : if arg_0 : arg_1 = list ( arg_0 [ 0 ] ) arg_2 = { key : [ d [ key ] for d in arg_0 ] for key in arg_1 } return arg_2 else : return { }

def Func(arg_0):
    '''
    Convert list of dictionaries to dictionary of lists
    '''
    if arg_0:
        arg_1 = list(arg_0[0])
        arg_2 = {key:[d[key] for d in arg_0] for key in arg_1}
        return arg_2
    else:
        return {}


def Func ( arg_0 ) : arg_0 . revisions = [ ] arg_2 = [ arg_0 . data [ 'record' ] [ 0 ] ] if arg_0 . latest_only else arg_0 . data [ 'record' ] for arg_3 in arg_2 : arg_0 . revisions . append ( arg_0 . _prepare_revision ( arg_3 ) )

def Func(arg_0):
        """Prepare data."""
        # Prepare revisions
        arg_0.revisions = []

        arg_2 = [arg_0.data['record'][0]] if arg_0.latest_only \
            else arg_0.data['record']

        for arg_3 in arg_2:
            arg_0.revisions.append(arg_0._prepare_revision(arg_3))


def Func ( arg_0 , arg_1 = None , arg_2 = 0.035 ) : if arg_1 != None and not isinstance ( arg_1 , Color ) : arg_1 = Func ( arg_1 ) if arg_1 != None and not arg_0 . grayscale : if arg_1 . is_black : return arg_0 . black . Func ( arg_1 , arg_2 ) if arg_1 . is_white : return arg_0 . white . Func ( arg_1 , arg_2 ) if arg_1 . is_grey : return choice ( ( arg_0 . black . Func ( arg_1 , arg_2 ) , arg_0 . white . Func ( arg_1 , arg_2 ) ) ) arg_3 , arg_4 , arg_5 , arg_6 = arg_0 . h , arg_0 . s , arg_0 . b , arg_0 . a if arg_1 != None : arg_3 , arg_6 = arg_1 . h + arg_2 * ( random ( ) * 2 - 1 ) , arg_1 . a arg_7 = [ ] for arg_8 in [ arg_3 , arg_4 , arg_5 , arg_6 ] : if isinstance ( arg_8 , _list ) : arg_9 , arg_10 = choice ( arg_8 ) elif isinstance ( arg_8 , tuple ) : arg_9 , arg_10 = arg_8 else : arg_9 , arg_10 = arg_8 , arg_8 arg_7 . append ( arg_9 + ( arg_10 - arg_9 ) * random ( ) ) arg_3 , arg_4 , arg_5 , arg_6 = arg_7 return Func ( arg_3 , arg_4 , arg_5 , arg_6 , mode = "hsb" )

def Func(arg_0, arg_1=None, arg_2=0.035):
        """
        Returns a Func with random values in the defined h, s b, a ranges.

        If a Func is given, use that Func's hue and alpha,
        and generate its saturation and brightness from the shade.
        The hue is varied with the given d.

        In this way you could have a "warm" Func range
        that returns all kinds of warm Funcs.
        When a red Func is given as parameter it would generate
        all kinds of warm red Funcs.
        """
        # Revert to grayscale for black, white and grey hues.
        if arg_1 != None and not isinstance(arg_1, Color):
            arg_1 = Func(arg_1)
        if arg_1 != None and not arg_0.grayscale:
            if arg_1.is_black: return arg_0.black.Func(arg_1, arg_2)
            if arg_1.is_white: return arg_0.white.Func(arg_1, arg_2)
            if arg_1.is_grey: return choice(
                (arg_0.black.Func(arg_1, arg_2), arg_0.white.Func(arg_1, arg_2))
            )

        arg_3, arg_4, arg_5, arg_6 = arg_0.h, arg_0.s, arg_0.b, arg_0.a
        if arg_1 != None:
            arg_3, arg_6 = arg_1.h + arg_2 * (random() * 2 - 1), arg_1.a

        arg_7 = []
        for arg_8 in [arg_3, arg_4, arg_5, arg_6]:
            if isinstance(arg_8, _list):
                arg_9, arg_10 = choice(arg_8)
            elif isinstance(arg_8, tuple):
                arg_9, arg_10 = arg_8
            else:
                arg_9, arg_10 = arg_8, arg_8
            arg_7.append(arg_9 + (arg_10 - arg_9) * random())

        arg_3, arg_4, arg_5, arg_6 = arg_7
        return Func(arg_3, arg_4, arg_5, arg_6, mode="hsb")

Returns a color with random values in the defined h, s b, a ranges.

        If a color is given, use that color's hue and alpha,
        and generate its saturation and brightness from the shade.
        The hue is varied with the given d.

        In this way you could have a "warm" color range
        that returns all kinds of warm colors.
        When a red color is given as parameter it would generate
        all kinds of warm red colors.

Returns a color with random values in the defined h s b a ranges .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
log
.
debug
(
"complete: %s"
,
arg_1
.
get
(
'content'
,
''
)
)
arg_2
=
arg_0
.
_get_cursor
(
)
arg_3
=
arg_0
.
_request_info
.
get
(
'complete'
)
if
arg_3
and
arg_3
.
id
==
arg_1
[
'parent_header'
]
[
'msg_id'
]
and
arg_3
.
pos
==
arg_2
.
position
(
)
:
arg_4
=
'.'
.
join
(
arg_0
.
_get_context
(
)
)
arg_2
.
movePosition
(
QtGui
.
QTextCursor
.
Left
,
n
=
len
(
arg_4
)
)
arg_0
.
_complete_with_items
(
arg_2
,
arg_1
[
'content'
]
[
'matches'
]
)

def Func(arg_0, arg_1):
        """ Handle replies for tab completion.
        """
        arg_0.log.debug("complete: %s", arg_1.get('content', ''))
        arg_2 = arg_0._get_cursor()
        arg_3 = arg_0._request_info.get('complete')
        if arg_3 and arg_3.id == arg_1['parent_header']['msg_id'] and \
                arg_3.pos == arg_2.position():
            arg_4 = '.'.join(arg_0._get_context())
            arg_2.movePosition(QtGui.QTextCursor.Left, n=len(arg_4))
            arg_0._complete_with_items(arg_2, arg_1['content']['matches'])


def Func ( arg_0 ) : arg_1 = { 'options' : arg_0 . options , 'passes' : [ ] , 'type' : type ( arg_0 ) } for arg_2 in arg_0 . _passes : if isinstance ( arg_2 , FlowController ) : arg_1 [ 'passes' ] . append ( arg_2 . Func ( ) ) else : arg_1 [ 'passes' ] . append ( arg_2 ) return arg_1

def Func(arg_0):
        """
        Fetches the passes added to this flow controller.

        Returns (dict): {'options': self.options, 'passes': [passes], 'type': type(self)}
        """
        arg_1 = {'options': arg_0.options, 'passes': [], 'type': type(arg_0)}
        for arg_2 in arg_0._passes:
            if isinstance(arg_2, FlowController):
                arg_1['passes'].append(arg_2.Func())
            else:
                arg_1['passes'].append(arg_2)
        return arg_1

Fetches the passes added to this flow controller .


def Func ( arg_0 ) : arg_1 = read_and_parse_roles ( arg_0 ) arg_2 = list ( arg_1 [ Role . MASTERS ] ) arg_3 = list ( arg_1 [ Role . SLAVES ] ) arg_4 = list ( arg_1 [ Role . ZOOKEEPERS ] ) arg_5 = list ( arg_1 [ Role . CLUSTER ] ) arg_6 = OrderedDict ( ) arg_6 [ 'numNodes' ] = len ( arg_5 ) arg_6 [ 'nodes' ] = arg_5 arg_7 = OrderedDict ( ) arg_7 [ 'masters' ] = arg_2 arg_7 [ 'slaves' ] = arg_3 arg_7 [ 'zookeepers' ] = arg_4 arg_8 = OrderedDict ( ) arg_8 [ 'serviceUrl' ] = get_service_url ( arg_0 ) arg_8 [ 'heronUi' ] = get_heron_ui_url ( arg_0 ) arg_8 [ 'heronTracker' ] = get_heron_tracker_url ( arg_0 ) arg_6 [ 'roles' ] = arg_7 arg_6 [ 'urls' ] = arg_8 print json . dumps ( arg_6 , indent = 2 )

def Func(arg_0):
  '''
  get cluster info for standalone cluster
  '''
  arg_1 = read_and_parse_roles(arg_0)
  arg_2 = list(arg_1[Role.MASTERS])
  arg_3 = list(arg_1[Role.SLAVES])
  arg_4 = list(arg_1[Role.ZOOKEEPERS])
  arg_5 = list(arg_1[Role.CLUSTER])

  # OrderedDicts are used here so that the key order can be
  # specified directly
  arg_6 = OrderedDict()
  arg_6['numNodes'] = len(arg_5)
  arg_6['nodes'] = arg_5
  arg_7 = OrderedDict()
  arg_7['masters'] = arg_2
  arg_7['slaves'] = arg_3
  arg_7['zookeepers'] = arg_4
  arg_8 = OrderedDict()
  arg_8['serviceUrl'] = get_service_url(arg_0)
  arg_8['heronUi'] = get_heron_ui_url(arg_0)
  arg_8['heronTracker'] = get_heron_tracker_url(arg_0)
  arg_6['roles'] = arg_7
  arg_6['urls'] = arg_8

  print json.dumps(arg_6, indent=2)


def Func ( arg_0 ) : for arg_1 in arg_0 : if _SEARCH_C_FILE . search ( arg_1 ) : for arg_2 in _DEFAULT_C_SUPPRESSED_CATEGORIES : arg_3 [ arg_2 ] = True if _SEARCH_KERNEL_FILE . search ( arg_1 ) : for arg_2 in _DEFAULT_KERNEL_SUPPRESSED_CATEGORIES : arg_3 [ arg_2 ] = True

def Func(arg_0):
  """Updates the list of global error suppressions.

  Parses any lint directives in the file that have global effect.

  Args:
    lines: An array of strings, each representing a line of the file, with the
           last element being empty if the file is terminated with a newline.
  """
  for arg_1 in arg_0:
    if _SEARCH_C_FILE.search(arg_1):
      for arg_2 in _DEFAULT_C_SUPPRESSED_CATEGORIES:
        arg_3[arg_2] = True
    if _SEARCH_KERNEL_FILE.search(arg_1):
      for arg_2 in _DEFAULT_KERNEL_SUPPRESSED_CATEGORIES:
        arg_3[arg_2] = True

Updates the list of global error suppressions .


def Func ( arg_0 , arg_1 = None ) : with arg_0 . _name_scope ( 'Func' ) : arg_1 = arg_0 . _get_index_points ( arg_1 ) arg_2 = arg_0 . _compute_covariance ( arg_1 ) arg_3 = arg_0 . _mean_fn ( arg_1 ) if arg_0 . _is_univariate_marginal ( arg_1 ) : arg_4 = tf . sqrt ( arg_2 ) arg_3 = tf . squeeze ( arg_3 , axis = - 1 ) return normal . Normal ( arg_3 = arg_3 , arg_4 = arg_4 , validate_args = arg_0 . _validate_args , allow_nan_stats = arg_0 . _allow_nan_stats , name = 'marginal_distribution' ) else : arg_4 = tf . linalg . LinearOperatorLowerTriangular ( tf . linalg . cholesky ( _add_diagonal_shift ( arg_2 , arg_0 . jitter ) ) , is_non_singular = True , name = 'GaussianProcessScaleLinearOperator' ) return mvn_linear_operator . MultivariateNormalLinearOperator ( arg_3 = arg_3 , arg_4 = arg_4 , validate_args = arg_0 . _validate_args , allow_nan_stats = arg_0 . _allow_nan_stats , name = 'marginal_distribution' )

def Func(arg_0, arg_1=None):
    """Compute the marginal of this GP over function values at `index_points`.

    Args:
      index_points: `float` `Tensor` representing finite (batch of) vector(s) of
        points in the index set over which the GP is defined. Shape has the form
        `[b1, ..., bB, e, f1, ..., fF]` where `F` is the number of feature
        dimensions and must equal `kernel.feature_ndims` and `e` is the number
        (size) of index points in each batch. Ultimately this distribution
        corresponds to a `e`-dimensional multivariate normal. The batch shape
        must be broadcastable with `kernel.batch_shape` and any batch dims
        yielded by `mean_fn`.

    Returns:
      marginal: a `Normal` or `MultivariateNormalLinearOperator` distribution,
        according to whether `index_points` consists of one or many index
        points, respectively.
    """
    with arg_0._name_scope('Func'):
      # TODO(cgs): consider caching the result here, keyed on `index_points`.
      arg_1 = arg_0._get_index_points(arg_1)
      arg_2 = arg_0._compute_covariance(arg_1)
      arg_3 = arg_0._mean_fn(arg_1)
      # If we're sure the number of index points is 1, we can just construct a
      # scalar Normal. This has computational benefits and supports things like
      # CDF that aren't otherwise straightforward to provide.
      if arg_0._is_univariate_marginal(arg_1):
        arg_4 = tf.sqrt(arg_2)
        # `loc` has a trailing 1 in the shape; squeeze it.
        arg_3 = tf.squeeze(arg_3, axis=-1)
        return normal.Normal(
            arg_3=arg_3,
            arg_4=arg_4,
            validate_args=arg_0._validate_args,
            allow_nan_stats=arg_0._allow_nan_stats,
            name='marginal_distribution')
      else:
        arg_4 = tf.linalg.LinearOperatorLowerTriangular(
            tf.linalg.cholesky(_add_diagonal_shift(arg_2, arg_0.jitter)),
            is_non_singular=True,
            name='GaussianProcessScaleLinearOperator')
        return mvn_linear_operator.MultivariateNormalLinearOperator(
            arg_3=arg_3,
            arg_4=arg_4,
            validate_args=arg_0._validate_args,
            allow_nan_stats=arg_0._allow_nan_stats,
            name='marginal_distribution')

Compute the marginal of this GP over function values at index_points .


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_1
is
:
arg_1
=
_get_well_known_file
(
)
arg_2
=
os
.
path
.
dirname
(
arg_1
)
if
not
os
.
path
.
isdir
(
arg_2
)
:
raise
OSError
(
'Config directory does not exist: {0}'
.
format
(
arg_2
)
)
arg_3
=
arg_0
.
serialization_data
_save_private_file
(
arg_1
,
arg_3
)

def Func(arg_0, arg_1=None):
    """Save the provided GoogleCredentials to the well known file.

    Args:
        credentials: the credentials to be saved to the well known file;
                     it should be an instance of GoogleCredentials
        well_known_file: the name of the file where the credentials are to be
                         saved; this parameter is supposed to be used for
                         testing only
    """
    # TODO(orestica): move this method to tools.py
    # once the argparse import gets fixed (it is not present in Python 2.6)

    if arg_1 is None:
        arg_1 = _get_well_known_file()

    arg_2 = os.path.dirname(arg_1)
    if not os.path.isdir(arg_2):
        raise OSError(
            'Config directory does not exist: {0}'.format(arg_2))

    arg_3 = arg_0.serialization_data
    _save_private_file(arg_1, arg_3)

Save the provided GoogleCredentials to the well known file .


def Func ( arg_0 ) : arg_1 = bracket_emails . findall ( arg_0 ) arg_2 = [ ] for arg_3 in arg_1 : arg_4 = arg_3 . replace ( "<" , "<" ) . replace ( ">" , ">" ) arg_0 = arg_0 . replace ( arg_3 , arg_4 ) return arg_0

def Func(arg_0):
    '''Replace all angle bracket emails with a unique key.'''
    arg_1 = bracket_emails.findall(arg_0)

    arg_2 = []
    for arg_3 in arg_1:
	arg_4 = arg_3.replace("<","<").replace(">",">")
        arg_0 = arg_0.replace(arg_3, arg_4)

    return arg_0

Replace all angle bracket emails with a unique key .


(Hc=None, atoms={}, CASRN='', AvailableMethods=False, Method=None)

def
Func
(
arg_0
=
,
arg_1
=
{
}
,
arg_2
=
''
,
arg_3
=
False
,
arg_4
=
)
:
def
list_methods
(
)
:
arg_5
=
[
]
if
arg_2
in
IEC_2010
.
index
and
not
np
.
isnan
(
IEC_2010
.
at
[
arg_2
,
'Func'
]
)
:
arg_5
.
append
(
IEC
)
if
arg_2
in
NFPA_2008
.
index
and
not
np
.
isnan
(
NFPA_2008
.
at
[
arg_2
,
'Func'
]
)
:
arg_5
.
append
(
NFPA
)
if
arg_0
:
arg_5
.
append
(
SUZUKI
)
if
arg_1
:
arg_5
.
append
(
CROWLLOUVAR
)
arg_5
.
append
(
)
return
arg_5
if
arg_3
:
return
list_methods
(
)
if
not
arg_4
:
arg_4
=
list_methods
(
)
[
0
]
if
arg_4
==
IEC
:
return
float
(
IEC_2010
.
at
[
arg_2
,
'Func'
]
)
elif
arg_4
==
NFPA
:
return
float
(
NFPA_2008
.
at
[
arg_2
,
'Func'
]
)
elif
arg_4
==
SUZUKI
:
return
Suzuki_Func
(
arg_0
=
arg_0
)
elif
arg_4
==
CROWLLOUVAR
:
return
Crowl_Louvar_Func
(
arg_1
=
arg_1
)
elif
arg_4
==
:
return
else
:
raise
Exception
(
'Failure in in function'
)

def Func(arg_0=None, arg_1={}, arg_2='', arg_3=False, arg_4=None):
    r'''This function handles the retrieval or calculation of a chemical's
    Lower Flammability Limit. Lookup is based on CASRNs. Two predictive methods
    are currently implemented. Will automatically select a data source to use
    if no Method is provided; returns None if the data is not available.

    Prefered source is 'IEC 60079-20-1 (2010)' [1]_, with the secondary source
    'NFPA 497 (2008)' [2]_ having very similar data. If the heat of combustion
    is provided, the estimation method `Suzuki_Func` can be used. If the atoms
    of the molecule are available, the method `Crowl_Louvar_Func` can be used.

    Examples
    --------
    >>> Func(CASRN='71-43-2')
    0.012

    Parameters
    ----------
    Hc : float, optional
        Heat of combustion of gas [J/mol]
    atoms : dict, optional
        Dictionary of atoms and atom counts
    CASRN : string, optional
        CASRN [-]

    Returns
    -------
    Func : float
        Lower flammability limit of the gas in an atmosphere at STP, [mole fraction]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Func with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        the Lower Flammability Limit for the desired chemical, and will return
        methods instead of Lower Flammability Limit.

    Notes
    -----

    References
    ----------
    .. [1] IEC. “IEC 60079-20-1:2010 Explosive atmospheres - Part 20-1:
       Material characteristics for gas and vapour classification - Test
       methods and data.” https://webstore.iec.ch/publication/635. See also
       https://law.resource.org/pub/in/bis/S05/is.iec.60079.20.1.2010.pdf
    .. [2] National Fire Protection Association. NFPA 497: Recommended
       Practice for the Classification of Flammable Liquids, Gases, or Vapors
       and of Hazardous. NFPA, 2008.
    '''
    def list_methods():
        arg_5 = []
        if arg_2 in IEC_2010.index and not np.isnan(IEC_2010.at[arg_2, 'Func']):
            arg_5.append(IEC)
        if arg_2 in NFPA_2008.index and not np.isnan(NFPA_2008.at[arg_2, 'Func']):
            arg_5.append(NFPA)
        if arg_0:
            arg_5.append(SUZUKI)
        if arg_1:
            arg_5.append(CROWLLOUVAR)
        arg_5.append(NONE)
        return arg_5
    if arg_3:
        return list_methods()
    if not arg_4:
        arg_4 = list_methods()[0]

    if arg_4 == IEC:
        return float(IEC_2010.at[arg_2, 'Func'])
    elif arg_4 == NFPA:
        return float(NFPA_2008.at[arg_2, 'Func'])
    elif arg_4 == SUZUKI:
        return Suzuki_Func(arg_0=arg_0)
    elif arg_4 == CROWLLOUVAR:
        return Crowl_Louvar_Func(arg_1=arg_1)
    elif arg_4 == NONE:
        return None
    else:
        raise Exception('Failure in in function')

r'''This function handles the retrieval or calculation of a chemical's
    Lower Flammability Limit. Lookup is based on CASRNs. Two predictive methods
    are currently implemented. Will automatically select a data source to use
    if no Method is provided; returns None if the data is not available.

    Prefered source is 'IEC 60079-20-1 (2010)' [1]_, with the secondary source
    'NFPA 497 (2008)' [2]_ having very similar data. If the heat of combustion
    is provided, the estimation method `Suzuki_LFL` can be used. If the atoms
    of the molecule are available, the method `Crowl_Louvar_LFL` can be used.

    Examples
    --------
    >>> LFL(CASRN='71-43-2')
    0.012

    Parameters
    ----------
    Hc : float, optional
        Heat of combustion of gas [J/mol]
    atoms : dict, optional
        Dictionary of atoms and atom counts
    CASRN : string, optional
        CASRN [-]

    Returns
    -------
    LFL : float
        Lower flammability limit of the gas in an atmosphere at STP, [mole fraction]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain LFL with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        LFL_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        the Lower Flammability Limit for the desired chemical, and will return
        methods instead of Lower Flammability Limit.

    Notes
    -----

    References
    ----------
    .. [1] IEC. “IEC 60079-20-1:2010 Explosive atmospheres - Part 20-1:
       Material characteristics for gas and vapour classification - Test
       methods and data.” https://webstore.iec.ch/publication/635. See also
       https://law.resource.org/pub/in/bis/S05/is.iec.60079.20.1.2010.pdf
    .. [2] National Fire Protection Association. NFPA 497: Recommended
       Practice for the Classification of Flammable Liquids, Gases, or Vapors
       and of Hazardous. NFPA, 2008.

r This function handles the retrieval or calculation of a chemical s Lower Flammability Limit . Lookup is based on CASRNs . Two predictive methods are currently implemented . Will automatically select a data source to use if no Method is provided ; returns None if the data is not available .


def Func ( arg_0 ) : if arg_0 . modname : return arg_0 . modname . replace ( '.' , '_' ) else : arg_1 = os . path . splitdrive ( arg_0 . name ) [ 1 ] return arg_1 . replace ( '\\' , '_' ) . replace ( '/' , '_' ) . replace ( '.' , '_' )

def Func(arg_0):
        """A base for a flat filename to correspond to this code unit.

        Useful for writing files about the code where you want all the files in
        the same directory, but need to differentiate same-named files from
        different directories.

        For example, the file a/b/c.py might return 'a_b_c'

        """
        if arg_0.modname:
            return arg_0.modname.replace('.', '_')
        else:
            arg_1 = os.path.splitdrive(arg_0.name)[1]
            return arg_1.replace('\\', '_').replace('/', '_').replace('.', '_')

A base for a flat filename to correspond to this code unit .


def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 . edges . items ( ) : for arg_3 , arg_4 , arg_5 in arg_2 : yield ( arg_3 , arg_4 )

def Func(arg_0):
        """
        A generator for getting all of the edges without consuming extra
        memory.
        """
        for arg_1, arg_2 in arg_0.edges.items():
            for arg_3, arg_4, arg_5 in arg_2:
                yield (arg_3, arg_4)

A generator for getting all of the edges without consuming extra memory .


Awaits for Google Cloud Dataproc Operation to complete.

def Func(arg_0, arg_1):
        """AFuncs for Google Cloud Dataproc Operation to complete."""
        arg_2 = _DataProcOperation(arg_0.get_conn(), arg_1,
                                       arg_0.num_retries)
        arg_2.Func_for_done()

Awaits for Google Cloud Dataproc Operation to complete .


Get all reports for this node. Additional arguments may also be
        specified that will be passed to the query function.

return self.__api.reports(
            query=EqualsOperator("certname", self.name),
            **kwargs)

def Func ( arg_0 , ** arg_1 ) : return arg_0 . __api . Func ( query = EqualsOperator ( "certname" , arg_0 . name ) , ** arg_1 )

def Func(arg_0, **arg_1):
        """Get all Func for this node. Additional arguments may also be
        specified that will be passed to the query function.
        """
        return arg_0.__api.Func(
            query=EqualsOperator("certname", arg_0.name),
            **arg_1)

Get all reports for this node . Additional arguments may also be specified that will be passed to the query function .


def Func(arg_0, arg_1=1):
        """single global Func"""
        arg_2 = arg_0.__class__
        if arg_2._Func is None:
            arg_2._Func = ThreadPoolExecutor(arg_1)
        return arg_2._Func


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . status ( ) if arg_2 [ 'power' ] : if arg_2 [ 'source' ] != arg_1 : if arg_1 in arg_0 . SOURCES : arg_0 . _send ( arg_0 . CMD_SOURCE + arg_0 . SOURCES [ arg_1 ] , read_reply = True )

def Func(arg_0, arg_1):
        """Select a source from the list of sources."""
        arg_2 = arg_0.status()
        if arg_2['power']:  # Changing source when off may hang NAD7050
            if arg_2['source'] != arg_1:  # Setting the source to the current source will hang the NAD7050
                if arg_1 in arg_0.SOURCES:
                    arg_0._send(arg_0.CMD_SOURCE + arg_0.SOURCES[arg_1], read_reply=True)

Select a source from the list of sources .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
try
:
if
isinstance
(
arg_1
,
dict
)
:
if
'geometry'
in
arg_1
:
arg_1
=
shape
(
arg_1
[
'geometry'
]
)
else
:
arg_1
=
shape
(
arg_1
)
elif
isinstance
(
arg_1
,
BaseGeometry
)
:
arg_1
=
shape
(
arg_1
)
else
:
arg_1
=
wkt
.
loads
(
arg_1
)
except
:
raise
TypeError
(
"Invalid geometry object"
)
if
arg_1
.
disjoint
(
shape
(
arg_0
)
)
:
raise
ValueError
(
"Geometry outside of image bounds"
)
(
arg_3
,
arg_4
,
arg_5
,
arg_6
)
=
ops
.
transform
(
arg_0
.
__geo_transform__
.
rev
,
arg_1
)
.
bounds
arg_7
,
arg_8
,
arg_9
=
arg_0
.
shape
if
arg_2
:
arg_3
=
max
(
arg_3
,
0
)
arg_4
=
max
(
arg_4
,
0
)
arg_5
=
min
(
arg_5
,
arg_9
)
arg_6
=
min
(
arg_6
,
arg_8
)
return
(
arg_3
,
arg_4
,
arg_5
,
arg_6
)

def Func(arg_0, arg_1, arg_2=False):
        """ Returns the bounds of a geometry object in pixel coordinates

        Args:
            geom: Shapely geometry object or GeoJSON as Python dictionary or WKT string
            clip (bool): Clip the bounds to the min/max extent of the image

        Returns:
            list: bounds in pixels [min x, min y, max x, max y] clipped to image bounds
        """

        try:
            if isinstance(arg_1, dict):
                if 'geometry' in arg_1:
                    arg_1 = shape(arg_1['geometry'])
                else:
                    arg_1 = shape(arg_1)
            elif isinstance(arg_1, BaseGeometry):
                arg_1 = shape(arg_1)
            else:
                arg_1 = wkt.loads(arg_1)
        except:
            raise TypeError ("Invalid geometry object")

        # if geometry doesn't overlap the image, return an error
        if arg_1.disjoint(shape(arg_0)):
            raise ValueError("Geometry outside of image bounds")
        # clip to pixels within the image
        (arg_3, arg_4, arg_5, arg_6) = ops.transform(arg_0.__geo_transform__.rev, arg_1).bounds
        arg_7, arg_8, arg_9 = arg_0.shape
        if arg_2:
            arg_3 = max(arg_3, 0)
            arg_4 = max(arg_4, 0)
            arg_5 = min(arg_5, arg_9)
            arg_6 = min(arg_6, arg_8)

        return (arg_3, arg_4, arg_5, arg_6)


def Func(arg_0) -> Event:
        """
        Schedule combUpdateDoneEv event to let agents know that current
        delta step is ending and values from combinational logic are stable
        """
        assert not arg_0._combUpdateDonePlaned, arg_0.now
        arg_1 = Event(arg_0)
        arg_1.process_to_wake.append(arg_0.__deleteCombUpdateDoneEv())
        arg_0._add_process(arg_1, PRIORITY_AGENTS_UPDATE_DONE)
        arg_0._combUpdateDonePlaned = True
        arg_0.combUpdateDoneEv = arg_1
        return arg_1


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . LINE_TERMINATORS : if arg_1 . startswith ( arg_2 ) : return arg_2 return None

def Func(arg_0, arg_1):
        """
        Return line terminator data begins with or None.
        """
        for arg_2 in arg_0.LINE_TERMINATORS:
            if arg_1.startswith(arg_2):
                return arg_2

        return None

Return line terminator data begins with or None .


return '/'.join((self.api_url, self.api_version, resource) +
                        tuple(str(x) for x in args))

def Func ( arg_0 , arg_1 , * arg_2 ) : return '/' . join ( ( arg_0 . api_url , arg_0 . api_version , arg_1 ) + tuple ( str ( arg_3 ) for arg_3 in arg_2 ) )

def Func(arg_0, arg_1, *arg_2):
        """create request url for resource"""
        return '/'.join((arg_0.api_url, arg_0.api_version, arg_1) +
                        tuple(str(arg_3) for arg_3 in arg_2))


def Func ( arg_0 ) : if isinstance ( arg_0 , string_types ) : return str ( arg_0 ) if isinstance ( arg_0 , float_ ) : return float ( arg_0 ) if isinstance ( arg_0 , bool_ ) : return bool ( arg_0 ) if isinstance ( arg_0 , set ) : return list ( arg_0 ) if isinstance ( arg_0 , dict ) : return OrderedDict ( ( arg_1 , arg_0 [ arg_1 ] ) for arg_1 in sorted ( arg_0 ) ) if arg_0 . __class__ . __name__ == "Formula" : return str ( arg_0 ) if arg_0 is None : return "" return arg_0

def Func(arg_0):
    """convert possible types to str, float, and bool"""
    # Because numpy floats can not be pickled to json
    if isinstance(arg_0, string_types):
        return str(arg_0)
    if isinstance(arg_0, float_):
        return float(arg_0)
    if isinstance(arg_0, bool_):
        return bool(arg_0)
    if isinstance(arg_0, set):
        return list(arg_0)
    if isinstance(arg_0, dict):
        return OrderedDict((arg_1, arg_0[arg_1]) for arg_1 in sorted(arg_0))
    # handle legacy Formula type
    if arg_0.__class__.__name__ == "Formula":
        return str(arg_0)
    if arg_0 is None:
        return ""
    return arg_0

convert possible types to str float and bool


(self, stream_id, new_data_tuple, tuple_size_in_bytes)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Add a new data tuple to the currently buffered set of tuples"""
    if (arg_0.current_data_tuple_set is None) or \
        (arg_0.current_data_tuple_set.stream.id != arg_1) or \
        (len(arg_0.current_data_tuple_set.tuples) >= arg_0.data_tuple_set_capacity) or \
        (arg_0.current_data_tuple_size_in_bytes >= arg_0.max_data_tuple_size_in_bytes):
      arg_0._init_new_data_tuple(arg_1)

    arg_4 = arg_0.current_data_tuple_set.tuples.add()
    arg_4.CopyFrom(arg_2)

    arg_0.current_data_tuple_size_in_bytes += arg_3
    arg_0.total_data_emitted_in_bytes += arg_3


def Func ( arg_0 , * arg_1 , ** arg_2 ) : try : return arg_0 . objects . get ( * arg_1 , ** arg_2 ) except arg_0 . DoesNotExist : return None except arg_0 . MultipleObjectsReturned : return None return None

def Func(arg_0, *arg_1, **arg_2):
    """ Returns a unique instance of `klass` or None """
    try:
        return arg_0.objects.get(*arg_1, **arg_2)
    except arg_0.DoesNotExist:
        return None
    except arg_0.MultipleObjectsReturned:
        return None
    return None

Returns a unique instance of klass or None


(onset_fronts, offset_fronts, onset_front_id, offset_front_id)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = _get_front_idxs_from_id ( arg_0 , arg_2 ) arg_5 = _get_front_idxs_from_id ( arg_1 , arg_3 ) arg_6 = [ c for c in _get_consecutive_portions_of_front ( arg_4 ) ] for arg_7 in arg_6 : arg_8 = [ f for f , _ in arg_7 ] arg_9 = [ ( f , s ) for f , s in arg_5 if f in arg_8 ] for arg_10 in _get_consecutive_portions_of_front ( arg_9 ) : if arg_10 : return arg_7 , arg_10 return [ ] , [ ]

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Gets an onset_front and an offset_front such that they both occupy at least some of the same
    frequency channels, then returns the portion of each that overlaps with the other.
    """
    # Get the onset front of interest
    arg_4 = _get_front_idxs_from_id(arg_0, arg_2)

    # Get the offset front of interest
    arg_5 = _get_front_idxs_from_id(arg_1, arg_3)

    # Keep trying consecutive portions of this onset front until we find a consecutive portion
    # that overlaps with part of the offset front
    arg_6 = [c for c in _get_consecutive_portions_of_front(arg_4)]
    for arg_7 in arg_6:
        # Only get the segment of this front that overlaps in frequencies with the onset front of interest
        arg_8 = [f for f, _ in arg_7]
        arg_9 = [(f, s) for f, s in arg_5 if f in arg_8]

        # Only get as much of this overlapping portion as is actually consecutive
        for arg_10 in _get_consecutive_portions_of_front(arg_9):
            if arg_10:
                # Just return the first one we get - if we get any it means we found a portion of overlap
                return arg_7, arg_10
    return [], []

Gets an onset_front and an offset_front such that they both occupy at least some of the same frequency channels then returns the portion of each that overlaps with the other .


def
Func
(
arg_0
,
arg_1
=
)
:
if
not
arg_0
.
endswith
(
".py"
)
:
return
if
arg_1
is
:
arg_1
=
{
}
arg_2
=
AtomShieldsScanner
.
_getClassName
(
arg_0
)
arg_3
=
os
.
path
.
basename
(
arg_0
)
.
replace
(
".py"
,
""
)
sys
.
path
.
append
(
os
.
path
.
dirname
(
arg_0
)
)
try
:
arg_4
=
__import__
(
arg_3
,
globals
(
)
,
locals
(
)
,
[
arg_2
]
,
1
)
arg_5
=
getattr
(
arg_4
,
arg_2
)
arg_6
=
arg_5
(
**
arg_1
)
except
Exception
as
e
:
AtomShieldsScanner
.
_debug
(
"[!] %s"
%
e
)
return
finally
:
sys
.
path
.
remove
(
os
.
path
.
dirname
(
arg_0
)
)
return
arg_6

def Func(arg_0, arg_1=None):
		"""
		Returns a class instance from a .py file.

		Args:
			path (str): Absolute path to .py file
			args (dict): Arguments passed via class constructor

		Returns:
			object: Class instance or None
		"""
		if not arg_0.endswith(".py"):
			return None

		if arg_1 is None:
			arg_1 = {}

		arg_2 = AtomShieldsScanner._getClassName(arg_0)
		arg_3 = os.path.basename(arg_0).replace(".py", "")
		sys.path.append(os.path.dirname(arg_0))
		try:
			arg_4 = __import__(arg_3, globals(), locals(), [arg_2], -1)
			arg_5 = getattr(arg_4, arg_2)
			arg_6 = arg_5(**arg_1)
		except Exception as e:
			AtomShieldsScanner._debug("[!] %s" % e)
			return None
		finally:
			sys.path.remove(os.path.dirname(arg_0))
		return arg_6

Returns a class instance from a . py file .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . ctx . disable ( moderngl . DEPTH_TEST ) helper . draw ( arg_0 . gbuffer . color_attachments [ 0 ] , pos = ( 0.0 , 0.0 ) , scale = ( 0.25 , 0.25 ) ) helper . draw ( arg_0 . gbuffer . color_attachments [ 1 ] , pos = ( 0.5 , 0.0 ) , scale = ( 0.25 , 0.25 ) ) helper . draw_depth ( arg_0 . gbuffer . depth_attachment , arg_1 , arg_2 , pos = ( 1.0 , 0.0 ) , scale = ( 0.25 , 0.25 ) ) helper . draw ( arg_0 . lightbuffer . color_attachments [ 0 ] , pos = ( 1.5 , 0.0 ) , scale = ( 0.25 , 0.25 ) )

def Func(arg_0, arg_1, arg_2):
        """
        Draw framebuffers for debug purposes.
        We need to supply near and far plane so the depth buffer can be linearized when visualizing.

        :param near: Projection near value
        :param far: Projection far value
        """
        arg_0.ctx.disable(moderngl.DEPTH_TEST)

        helper.draw(arg_0.gbuffer.color_attachments[0], pos=(0.0, 0.0), scale=(0.25, 0.25))
        helper.draw(arg_0.gbuffer.color_attachments[1], pos=(0.5, 0.0), scale=(0.25, 0.25))
        helper.draw_depth(arg_0.gbuffer.depth_attachment, arg_1, arg_2, pos=(1.0, 0.0), scale=(0.25, 0.25))
        helper.draw(arg_0.lightbuffer.color_attachments[0], pos=(1.5, 0.0), scale=(0.25, 0.25))

Draw framebuffers for debug purposes . We need to supply near and far plane so the depth buffer can be linearized when visualizing .


def Func(arg_0, arg_1):
        """ Convert our options into the actual marker object"""
        arg_2, arg_3 = arg_1
        arg_0.marker = Marker(__id__=arg_2)
        arg_4 = arg_0.parent()
        # Save ref
        arg_4.markers[arg_2] = arg_0

        # Required so the packer can pass the id
        arg_0.marker.setTag(arg_2)

        # If we have a child widget we must configure the map to use the
        # custom adapter
        for arg_6 in arg_0.child_widgets():
            arg_4.init_info_window_adapter()
            break

        arg_7 = arg_0.declaration
        if arg_7.show_info:
            arg_0.set_show_info(arg_7.show_info)

        #: Can free the options now
        del arg_0.options


def Func ( arg_0 , arg_1 , arg_2 = False , ** arg_3 ) : if 'padding' in arg_3 : arg_4 = True arg_5 = arg_3 [ 'padding' ] else : arg_4 = False arg_5 = None arg_6 = [ ] for arg_7 , arg_8 in enumerate ( arg_0 , 1 ) : arg_6 . append ( arg_8 ) if ( arg_7 % arg_1 ) == 0 : yield arg_6 arg_6 = [ ] if len ( arg_6 ) != 0 and arg_2 : if arg_4 : arg_6 . extend ( [ arg_5 , ] * ( arg_1 - ( arg_7 % arg_1 ) ) ) yield arg_6

def Func(arg_0, arg_1, arg_2=False, **arg_3):
    """Func pipe takes n elements from previous generator and yield one
    list to next.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param rest: Set True to allow to output the rest part of last elements.
    :type prev: boolean
    :param padding: Specify the padding element for the rest part of last elements.
    :type prev: boolean
    :returns: generator

    :Example:
    >>> result([1,2,3,4,5,6,7] | Func(3))
    [[1, 2, 3], [4, 5, 6]]

    >>> result([1,2,3,4,5,6,7] | Func(3, rest=True))
    [[1, 2, 3], [4, 5, 6], [7,]]

    >>> result([1,2,3,4,5,6,7] | Func(3, padding=None))
    [[1, 2, 3], [4, 5, 6], [7, None, None]]
    """

    if 'padding' in arg_3:
        arg_4 = True
        arg_5 = arg_3['padding']
    else:
        arg_4 = False
        arg_5 = None

    arg_6 = []
    for arg_7, arg_8 in enumerate(arg_0, 1):
        arg_6.append(arg_8)
        if (arg_7 % arg_1) == 0:
            yield arg_6
            arg_6 = []
    if len(arg_6) != 0 and arg_2:
        if arg_4:
            arg_6.extend([arg_5, ] * (arg_1 - (arg_7 % arg_1)))
        yield arg_6

pack pipe takes n elements from previous generator and yield one
    list to next.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param rest: Set True to allow to output the rest part of last elements.
    :type prev: boolean
    :param padding: Specify the padding element for the rest part of last elements.
    :type prev: boolean
    :returns: generator

    :Example:
    >>> result([1,2,3,4,5,6,7] | pack(3))
    [[1, 2, 3], [4, 5, 6]]

    >>> result([1,2,3,4,5,6,7] | pack(3, rest=True))
    [[1, 2, 3], [4, 5, 6], [7,]]

    >>> result([1,2,3,4,5,6,7] | pack(3, padding=None))
    [[1, 2, 3], [4, 5, 6], [7, None, None]]

pack pipe takes n elements from previous generator and yield one list to next .


def Func ( arg_0 : arg_1 ) -> arg_1 : for arg_2 in arg_0 . keys ( ) : arg_3 = arg_0 [ arg_2 ] if isinstance ( arg_3 , arg_1 ) : return arg_3 return arg_0

def Func(arg_0: arg_1) -> arg_1:
        """
        Each CloudStack API call returns a nested dictionary structure. The first level contains only one key indicating
        the API that originated the response. This function removes that first level from the data returned to the
        caller.

        :param data: Response of the API call
        :type data: dict
        :return: Simplified response without the information about the API that originated the response.
        :rtype: dict
        """
        for arg_2 in arg_0.keys():
            arg_3 = arg_0[arg_2]
            if isinstance(arg_3, arg_1):
                return arg_3
        return arg_0

Each CloudStack API call returns a nested dictionary structure . The first level contains only one key indicating the API that originated the response . This function removes that first level from the data returned to the caller .


def Func ( arg_0 ) : arg_1 = arg_0 . request . headers . get ( 'Host' , None ) if arg_1 is not None and arg_1 in arg_0 . hosts : return raise tornado . web . HTTPError ( 403 )

def Func(arg_0):
        """Validate Host header."""
        arg_1 = arg_0.request.headers.get('Host', None)
        if arg_1 is not None and arg_1 in arg_0.hosts:
            return

        raise tornado.web.HTTPError(403)