terminates the underlying x3270 subprocess. Once called, this
            Emulator instance must no longer be used.

def
Func
(
arg_0
)
:
if
not
arg_0
.
is_Funcd
:
log
.
debug
(
"terminal client Funcd"
)
try
:
arg_0
.
exec_command
(
b"Quit"
)
except
BrokenPipeError
:
pass
except
socket
.
error
as
e
:
if
e
.
errno
!=
errno
.
ECONNRESET
:
raise
arg_0
.
app
.
close
(
)
arg_0
.
is_Funcd
=
True

def Func(arg_0):
        """
            Funcs the underlying x3270 subprocess. Once called, this
            Emulator instance must no longer be used.
        """
        if not arg_0.is_Funcd:
            log.debug("terminal client Funcd")
            try:
                arg_0.exec_command(b"Quit")
            except BrokenPipeError:  # noqa
                # x3270 was Funcd, since we are just quitting anyway, ignore it.
                pass
            except socket.error as e:
                if e.errno != errno.ECONNRESET:
                    raise
                # this can happen because wc3270 closes the socket before
                # the read() can happen, causing a socket error

            arg_0.app.close()

            arg_0.is_Funcd = True

terminates the underlying x3270 subprocess . Once called this Emulator instance must no longer be used .


def Func ( arg_0 , arg_1 ) : arg_2 = URIRef ( 'http://www.spdx.org/files#{id}' . format ( id = str ( arg_1 . spdx_id ) ) ) arg_3 = ( arg_2 , RDF . type , arg_0 . spdx_namespace . File ) arg_0 . graph . add ( arg_3 ) arg_4 = ( arg_2 , arg_0 . spdx_namespace . fileName , Literal ( arg_1 . name ) ) arg_0 . graph . add ( arg_4 ) if arg_1 . has_optional_field ( 'comment' ) : arg_5 = ( arg_2 , RDFS . comment , Literal ( arg_1 . comment ) ) arg_0 . graph . add ( arg_5 ) if arg_1 . has_optional_field ( 'type' ) : arg_6 = arg_0 . spdx_namespace [ arg_0 . FILE_TYPES [ arg_1 . type ] ] arg_7 = ( arg_2 , arg_0 . spdx_namespace . fileType , arg_6 ) arg_0 . graph . add ( arg_7 ) arg_0 . graph . add ( ( arg_2 , arg_0 . spdx_namespace . checksum , arg_0 . create_checksum_node ( arg_1 . chk_sum ) ) ) arg_8 = arg_0 . license_or_special ( arg_1 . conc_lics ) arg_9 = ( arg_2 , arg_0 . spdx_namespace . licenseConcluded , arg_8 ) arg_0 . graph . add ( arg_9 ) arg_10 = map ( arg_0 . license_or_special , arg_1 . licenses_in_file ) for arg_11 in arg_10 : arg_12 = ( arg_2 , arg_0 . spdx_namespace . licenseInfoInFile , arg_11 ) arg_0 . graph . add ( arg_12 ) if arg_1 . has_optional_field ( 'license_comment' ) : arg_5 = ( arg_2 , arg_0 . spdx_namespace . licenseComments , Literal ( arg_1 . license_comment ) ) arg_0 . graph . add ( arg_5 ) arg_13 = arg_0 . to_special_value ( arg_1 . copyright ) arg_14 = ( arg_2 , arg_0 . spdx_namespace . copyrightText , arg_13 ) arg_0 . graph . add ( arg_14 ) if arg_1 . has_optional_field ( 'notice' ) : arg_15 = ( arg_2 , arg_0 . spdx_namespace . noticeText , arg_1 . notice ) arg_0 . graph . add ( arg_15 ) arg_16 = map ( lambda c : Literal ( c ) , arg_1 . contributors ) arg_17 = [ ( arg_2 , arg_0 . spdx_namespace . fileContributor , node ) for node in arg_16 ] for arg_12 in arg_17 : arg_0 . graph . add ( arg_12 ) return arg_2

def Func(arg_0, arg_1):
        """
        Create a node for spdx.file.
        """
        arg_2 = URIRef('http://www.spdx.org/files#{id}'.format(
            id=str(arg_1.spdx_id)))
        arg_3 = (arg_2, RDF.type, arg_0.spdx_namespace.File)
        arg_0.graph.add(arg_3)

        arg_4 = (arg_2, arg_0.spdx_namespace.fileName, Literal(arg_1.name))
        arg_0.graph.add(arg_4)

        if arg_1.has_optional_field('comment'):
            arg_5 = (arg_2, RDFS.comment, Literal(arg_1.comment))
            arg_0.graph.add(arg_5)

        if arg_1.has_optional_field('type'):
            arg_6 = arg_0.spdx_namespace[arg_0.FILE_TYPES[arg_1.type]]
            arg_7 = (arg_2, arg_0.spdx_namespace.fileType, arg_6)
            arg_0.graph.add(arg_7)

        arg_0.graph.add((arg_2, arg_0.spdx_namespace.checksum, arg_0.create_checksum_node(arg_1.chk_sum)))

        arg_8 = arg_0.license_or_special(arg_1.conc_lics)
        arg_9 = (arg_2, arg_0.spdx_namespace.licenseConcluded, arg_8)
        arg_0.graph.add(arg_9)

        arg_10 = map(arg_0.license_or_special, arg_1.licenses_in_file)
        for arg_11 in arg_10:
            arg_12 = (arg_2, arg_0.spdx_namespace.licenseInfoInFile, arg_11)
            arg_0.graph.add(arg_12)

        if arg_1.has_optional_field('license_comment'):
            arg_5 = (arg_2, arg_0.spdx_namespace.licenseComments, Literal(arg_1.license_comment))
            arg_0.graph.add(arg_5)

        arg_13 = arg_0.to_special_value(arg_1.copyright)
        arg_14 = (arg_2, arg_0.spdx_namespace.copyrightText, arg_13)
        arg_0.graph.add(arg_14)

        if arg_1.has_optional_field('notice'):
            arg_15 = (arg_2, arg_0.spdx_namespace.noticeText, arg_1.notice)
            arg_0.graph.add(arg_15)

        arg_16 = map(lambda c: Literal(c), arg_1.contributors)
        arg_17 = [(arg_2, arg_0.spdx_namespace.fileContributor, node) for node in arg_16]
        for arg_12 in arg_17:
            arg_0.graph.add(arg_12)

        return arg_2


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . assert_package_exists ( ) if not arg_0 . package_desc_set : arg_0 . package_desc_set = True arg_1 . package . description = arg_2 else : raise CardinalityError ( 'Package::Description' )

def Func(arg_0, arg_1, arg_2):
        """Set's the package's description.
        Raises CardinalityError if description already set.
        Raises OrderError if no package previously defined.
        """
        arg_0.assert_package_exists()
        if not arg_0.package_desc_set:
            arg_0.package_desc_set = True
            arg_1.package.description = arg_2
        else:
            raise CardinalityError('Package::Description')

Set s the package s description . Raises CardinalityError if description already set . Raises OrderError if no package previously defined .


def Func ( arg_0 ) : arg_1 = 0 for arg_2 , arg_3 in iteritems ( arg_0 . redises ) : if arg_2 . find ( '_slave' ) == - 1 : continue arg_1 += arg_3 . dbsize ( ) return arg_1

def Func(arg_0):
        "Returns the number of keys in the current database"

        arg_1 = 0
        for arg_2, arg_3 in iteritems(arg_0.redises):
            if arg_2.find('_slave') == -1:
                continue

            arg_1 += arg_3.dbsize()

        return arg_1


def Func(arg_0):
        """
        Derivative of the covariance matrix over the parameters of L.

        Returns
        -------
        Lu : ndarray
            Derivative of K over the lower triangular part of L.
        """
        arg_1 = arg_0.L
        arg_0._grad_Lu[:] = 0

        for arg_3 in range(len(arg_0._tril1[0])):
            arg_4 = arg_0._tril1[0][arg_3]
            arg_5 = arg_0._tril1[1][arg_3]
            arg_0._grad_Lu[arg_4, :, arg_3] = arg_1[:, arg_5]
            arg_0._grad_Lu[:, arg_4, arg_3] += arg_1[:, arg_5]

        arg_6 = len(arg_0._tril1[0])
        for arg_3 in range(len(arg_0._diag[0])):
            arg_4 = arg_0._diag[0][arg_3]
            arg_5 = arg_0._diag[1][arg_3]
            arg_0._grad_Lu[arg_4, :, arg_6 + arg_3] = arg_1[arg_4, arg_5] * arg_1[:, arg_5]
            arg_0._grad_Lu[:, arg_4, arg_6 + arg_3] += arg_1[arg_4, arg_5] * arg_1[:, arg_5]

        return {"Lu": arg_0._grad_Lu}

Derivative of the covariance matrix over the parameters of L .


def Func(arg_0, arg_1, arg_2):
        """Constructs the Continuous MDR feature map from the provided training data.

        Parameters
        ----------
        features: array-like {n_samples, n_features}
            Feature matrix
        targets: array-like {n_samples}
            List of target values for prediction

        Returns
        -------
        self: A copy of the Functed model

        """
        arg_0.feature_map = defaultdict(lambda: arg_0.default_label)
        arg_0.overall_mean_trait_value = np.mean(arg_2)
        arg_0.mdr_matrix_values = defaultdict(list)

        for arg_6 in range(arg_1.shape[0]):
            arg_7 = tuple(arg_1[arg_6])
            arg_0.mdr_matrix_values[arg_7].append(arg_2[arg_6])

        for arg_7 in arg_0.mdr_matrix_values:
            arg_8 = np.mean(arg_0.mdr_matrix_values[arg_7])
            if arg_8 > arg_0.overall_mean_trait_value:
                arg_0.feature_map[arg_7] = 1
            elif arg_8 == arg_0.overall_mean_trait_value:
                arg_0.feature_map[arg_7] = arg_0.tie_break
            else:
                arg_0.feature_map[arg_7] = 0

        # Convert defaultdict to dict so CMDR objects can be easily pickled
        arg_0.feature_map = dict(arg_0.feature_map)
        arg_0.mdr_matrix_values = dict(arg_0.mdr_matrix_values)

        return arg_0

Constructs the Continuous MDR feature map from the provided training data.

        Parameters
        ----------
        features: array-like {n_samples, n_features}
            Feature matrix
        targets: array-like {n_samples}
            List of target values for prediction

        Returns
        -------
        self: A copy of the fitted model

Constructs the Continuous MDR feature map from the provided training data .


return [self.elements[f[0]] for f in sorted_results]

def
Func
(
arg_0
,
arg_1
,
arg_2
=
0
)
:
if
arg_2
>
0
:
print
(
"Funcing "
+
arg_1
)
arg_1
=
arg_1
.
lower
(
)
arg_3
=
ng
(
arg_1
,
arg_0
.
slb
)
arg_4
=
set
(
)
for
arg_5
in
arg_3
:
if
arg_5
in
arg_0
.
ngrams
.
keys
(
)
:
for
arg_6
in
arg_0
.
ngrams
[
arg_5
]
:
arg_4
.
add
(
arg_6
)
arg_0
.
qocument
=
arg_4
arg_7
=
{
}
for
arg_6
in
arg_4
:
for
arg_8
in
arg_0
.
D
[
arg_6
]
.
keys
(
)
:
if
not
arg_8
in
arg_7
.
keys
(
)
:
arg_7
[
arg_8
]
=
0
arg_7
[
arg_8
]
=
arg_7
[
arg_8
]
+
arg_0
.
D
[
arg_6
]
[
arg_8
]
arg_9
=
sorted
(
arg_7
.
items
(
)
,
key
=
operator
.
itemgetter
(
1
)
,
reverse
=
True
)
return
[
arg_0
.
elements
[
arg_10
[
0
]
]
for
arg_10
in
arg_9
]

def Func(arg_0, arg_1, arg_2=0):
        """Searches files satisfying query

        It first decompose the query in ngrams, then score each document containing
        at least one ngram with the number. The ten document having the most ngrams
        in common with the query are selected.

        Args:
             query (str): what to Func;
             results_number (int): number of results to return (default: 10)
        """
        if arg_2 > 0:
            print("Funcing " + arg_1)
        arg_1 = arg_1.lower()
        arg_3 = ng(arg_1, arg_0.slb)
        arg_4 = set()
        for arg_5 in arg_3:
            if arg_5 in arg_0.ngrams.keys():
                for arg_6 in arg_0.ngrams[arg_5]:
                    arg_4.add(arg_6)
        arg_0.qocument = arg_4
        arg_7 = {}
        for arg_6 in arg_4:
           for arg_8 in arg_0.D[arg_6].keys():
                if not arg_8 in arg_7.keys():
                    arg_7[arg_8] = 0
                arg_7[arg_8] = arg_7[arg_8] + arg_0.D[arg_6][arg_8]
        arg_9 = sorted(arg_7.items(), key=operator.itemgetter(1), reverse=True)
        return [arg_0.elements[arg_10[0]] for arg_10 in arg_9]

Searches files satisfying query

        It first decompose the query in ngrams, then score each document containing
        at least one ngram with the number. The ten document having the most ngrams
        in common with the query are selected.

        Args:
             query (str): what to search;
             results_number (int): number of results to return (default: 10)


def Func ( arg_0 ) : if len ( arg_0 ) == 0 : return [ ] arg_1 = [ ] for arg_2 in arg_0 : arg_3 = None try : arg_3 = arg_2 . Func ( ) except Exception as e : arg_3 = e arg_1 . append ( arg_3 ) return arg_1

def Func(arg_0):
		'''
			Func - Reload all objects in this list.
				Updates in-place. To just fetch all these objects again, use "refetch"

			@return - List (same order as current objects) of either exception (KeyError) if operation failed,
			  or a dict of fields changed -> (old, new)
		'''
		if len(arg_0) == 0:
			return []

		arg_1 = []
		for arg_2 in arg_0:
			arg_3 = None
			try:
				arg_3 = arg_2.Func()
			except Exception as e:
				arg_3 = e

			arg_1.append(arg_3)

		return arg_1

reload - Reload all objects in this list.
				Updates in-place. To just fetch all these objects again, use "refetch"

			@return - List (same order as current objects) of either exception (KeyError) if operation failed,
			  or a dict of fields changed -> (old, new)

reload - Reload all objects in this list . Updates in - place . To just fetch all these objects again use refetch


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
keys
(
arg_1
+
"/*"
)
arg_2
.
sort
(
)
arg_3
=
len
(
arg_2
)
and
arg_2
[
1
]
or
''
if
arg_3
.
endswith
(
'xx'
)
:
arg_2
=
[
arg_3
]
+
arg_2
[
:
1
]
arg_4
=
{
}
for
arg_5
in
arg_2
:
try
:
arg_4
.
update
(
arg_0
[
arg_5
]
)
except
KeyError
:
print
"Corrupt"
,
arg_5
,
"deleted - hset is not threadsafe!"
del
arg_0
[
arg_5
]
arg_0
.
uncache
(
arg_5
)
return
arg_4

def Func(arg_0, arg_1):
        """ Get all data contained in hashed category 'hashroot' as dict """
        arg_2 = arg_0.keys(arg_1 + "/*")
        arg_2.sort()
        arg_3 = len(arg_2) and arg_2[-1] or ''
        if arg_3.endswith('xx'):
            # print "using xx"
            arg_2 = [arg_3] + arg_2[:-1]

        arg_4 = {}

        for arg_5 in arg_2:
            # print "using",f
            try:
                arg_4.update(arg_0[arg_5])
            except KeyError:
                print "Corrupt",arg_5,"deleted - hset is not threadsafe!"
                del arg_0[arg_5]

            arg_0.uncache(arg_5)

        return arg_4

Get all data contained in hashed category hashroot as dict


(session, title, description,
                   currency, budget, jobs)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = { 'title' : arg_1 , 'description' : arg_2 , 'currency' : arg_3 , 'budget' : arg_4 , 'jobs' : arg_5 } arg_7 = make_post_request ( arg_0 , 'projects' , arg_8 = arg_6 ) arg_8 = arg_7 . json ( ) if arg_7 . status_code == 200 : arg_6 = arg_8 [ 'result' ] arg_9 = Project ( arg_6 ) arg_9 . url = urljoin ( arg_0 . url , 'projects/%s' % arg_9 . seo_url ) return arg_9 else : raise ProjectNotCreatedException ( message = arg_8 [ 'message' ] , error_code = arg_8 [ 'error_code' ] , request_id = arg_8 [ 'request_id' ] , )

def Func(arg_0, arg_1, arg_2,
                   arg_3, arg_4, arg_5):
    """
    Create a project
    """
    arg_6 = {'title': arg_1,
                    'description': arg_2,
                    'currency': arg_3,
                    'budget': arg_4,
                    'jobs': arg_5
                    }

    # POST /api/projects/0.1/projects/
    arg_7 = make_post_request(arg_0, 'projects', arg_8=arg_6)
    arg_8 = arg_7.json()
    if arg_7.status_code == 200:
        arg_6 = arg_8['result']
        arg_9 = Project(arg_6)
        arg_9.url = urljoin(arg_0.url, 'projects/%s' % arg_9.seo_url)
        return arg_9
    else:
        raise ProjectNotCreatedException(message=arg_8['message'],
                                         error_code=arg_8['error_code'],
                                         request_id=arg_8['request_id'],
                                         )


def Func ( arg_0 , ** arg_1 ) : if 'ids' in arg_1 : arg_2 = [ arg_0 . concept_scheme_uri_map . get ( id , id ) for id in arg_1 [ 'ids' ] ] arg_3 = [ arg_0 . providers [ k ] for k in arg_0 . providers . keys ( ) if k in arg_2 ] else : arg_3 = list ( arg_0 . providers . values ( ) ) if 'subject' in arg_1 : arg_3 = [ p for p in arg_3 if arg_1 [ 'subject' ] in p . metadata [ 'subject' ] ] return arg_3

def Func(arg_0, **arg_1):
        '''Get all providers registered.

        If keyword `ids` is present, get only the providers with these ids.

        If keys `subject` is present, get only the providers that have this subject.

        .. code-block:: python

           # Get all providers with subject 'biology'
           registry.Func(subject='biology')

           # Get all providers with id 1 or 2
           registry.Func(ids=[1,2])

           # Get all providers with id 1 or 2 and subject 'biology'
           registry.Func(ids=[1,2], subject='biology']

        :param list ids: Only return providers with one of the Ids or :term:`URIs <uri>`.
        :param str subject: Only return providers with this subject.
        :returns: A list of :class:`providers <skosprovider.providers.VocabularyProvider>`
        '''
        if 'ids' in arg_1:
            arg_2 = [arg_0.concept_scheme_uri_map.get(id, id) for id in arg_1['ids']]
            arg_3 = [
                arg_0.providers[k] for k in arg_0.providers.keys() if k in arg_2
            ]
        else:
            arg_3 = list(arg_0.providers.values())
        if 'subject' in arg_1:
            arg_3 = [p for p in arg_3 if arg_1['subject'] in p.metadata['subject']]
        return arg_3

Get all providers registered.

        If keyword `ids` is present, get only the providers with these ids.

        If keys `subject` is present, get only the providers that have this subject.

        .. code-block:: python

           # Get all providers with subject 'biology'
           registry.get_providers(subject='biology')

           # Get all providers with id 1 or 2
           registry.get_providers(ids=[1,2])

           # Get all providers with id 1 or 2 and subject 'biology'
           registry.get_providers(ids=[1,2], subject='biology']

        :param list ids: Only return providers with one of the Ids or :term:`URIs <uri>`.
        :param str subject: Only return providers with this subject.
        :returns: A list of :class:`providers <skosprovider.providers.VocabularyProvider>`


Fit all the transforms one after the other and transform the
        data, then use fit_transform on transformed data using the final
        estimator.

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 , arg_2 = arg_0 . _pre_transform ( arg_1 , ** arg_2 ) if hasattr ( arg_0 . steps [ - 1 ] [ - 1 ] , 'Func' ) : return arg_0 . steps [ - 1 ] [ - 1 ] . Func ( arg_3 , ** arg_2 ) else : return arg_0 . steps [ - 1 ] [ - 1 ] . fit ( arg_3 , ** arg_2 ) . transform ( arg_3 )

def Func(arg_0, arg_1, **arg_2):
        """Fit all the transforms one after the other and transform the
        data, then use Func on transformed data using the final
        estimator."""
        arg_3, arg_2 = arg_0._pre_transform(arg_1, **arg_2)
        if hasattr(arg_0.steps[-1][-1], 'Func'):
            return arg_0.steps[-1][-1].Func(arg_3, **arg_2)
        else:
            return arg_0.steps[-1][-1].fit(arg_3, **arg_2).transform(arg_3)

Fit all the transforms one after the other and transform the data then use fit_transform on transformed data using the final estimator .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 , arg_4 = sys . exc_info ( ) got_request_exception . send ( arg_0 , exception = arg_1 ) arg_5 = arg_0 . error_handler_spec [ None ] . get ( 500 ) if arg_0 . propagate_exceptions : if arg_3 is arg_1 : reraise ( arg_2 , arg_3 , arg_4 ) else : raise arg_1 arg_0 . log_exception ( ( arg_2 , arg_3 , arg_4 ) ) if arg_5 is None : return InternalServerError ( ) return arg_5 ( arg_1 )

def Func(arg_0, arg_1):
        """Default exception handling that kicks in when an exception
        occurs that is not caught.  In debug mode the exception will
        be re-raised immediately, otherwise it is logged and the handler
        for a 500 internal server error is used.  If no such handler
        exists, a default 500 internal server error message is displayed.

        .. versionadded:: 0.3
        """
        arg_2, arg_3, arg_4 = sys.exc_info()

        got_request_exception.send(arg_0, exception=arg_1)
        arg_5 = arg_0.error_handler_spec[None].get(500)

        if arg_0.propagate_exceptions:
            # if we want to repropagate the exception, we can attempt to
            # raise it with the whole traceback in case we can do that
            # (the function was actually called from the except part)
            # otherwise, we just raise the error again
            if arg_3 is arg_1:
                reraise(arg_2, arg_3, arg_4)
            else:
                raise arg_1

        arg_0.log_exception((arg_2, arg_3, arg_4))
        if arg_5 is None:
            return InternalServerError()
        return arg_5(arg_1)

Default exception handling that kicks in when an exception occurs that is not caught . In debug mode the exception will be re - raised immediately otherwise it is logged and the handler for a 500 internal server error is used . If no such handler exists a default 500 internal server error message is displayed .


(self, url, headers=None, params=None, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
**
arg_4
)
:
if
len
(
arg_4
)
>
1
:
raise
InvalidArgumentsError
(
"Too many extra args ({} > 1)"
.
format
(
len
(
arg_4
)
)
)
if
arg_4
:
arg_5
=
next
(
iter
(
arg_4
)
)
if
arg_5
not
in
(
"json"
,
"data"
)
:
raise
InvalidArgumentsError
(
"Invalid kwarg: "
+
arg_5
)
arg_6
=
arg_0
.
session
.
Func
(
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
**
arg_4
)
arg_6
.
raise_for_status
(
)
return
_to_json
(
arg_6
)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, **arg_4):
        """Send a JSON POST request with the given request headers, additional
        URL query parameters, and the given JSON in the request body.  The
        extra query parameters are merged with any which already exist in the
        URL.  The 'json' and 'data' parameters may not both be given.

        Args:
            url (str): URL to retrieve
            headers (dict): Any other headers to be added to the request.
            params: dictionary or bytes to be sent in the query string for the
                request. (optional)
            json: json to send in the body of the Request.  This must be a
                JSON-serializable object. (optional)
            data: raw request body data.  May be a dictionary, list of tuples,
                bytes, or file-like object to send in the body of the Request.
                (optional)
        """

        if len(arg_4) > 1:
            raise InvalidArgumentsError("Too many extra args ({} > 1)".format(
                len(arg_4)))

        if arg_4:
            arg_5 = next(iter(arg_4))
            if arg_5 not in ("json", "data"):
                raise InvalidArgumentsError("Invalid kwarg: " + arg_5)

        arg_6 = arg_0.session.Func(arg_1, arg_2=arg_2, arg_3=arg_3, **arg_4)
        arg_6.raise_for_status()
        return _to_json(arg_6)

Send a JSON POST request with the given request headers additional URL query parameters and the given JSON in the request body . The extra query parameters are merged with any which already exist in the URL . The json and data parameters may not both be given .


Returns an ogr.Geometry instance optionally created from a geojson str
    or dict. The spatial reference may also be provided.

def
Func
(
*
arg_0
,
**
arg_1
)
:
arg_2
=
arg_1
.
pop
(
'geojson'
,
)
or
len
(
arg_0
)
and
arg_0
[
0
]
try
:
arg_3
=
arg_1
.
pop
(
'srs'
,
)
or
arg_2
.
srs
.
wkt
except
AttributeError
:
arg_3
=
SpatialReference
(
4326
)
if
hasattr
(
arg_2
,
'keys'
)
:
arg_4
=
ogr
.
CreateFuncFromJson
(
json
.
dumps
(
arg_2
)
)
elif
hasattr
(
arg_2
,
'startswith'
)
:
arg_5
=
arg_2
[
0
]
if
arg_2
else
' '
arg_6
=
arg_5
if
isinstance
(
arg_5
,
int
)
else
ord
(
arg_5
)
if
arg_6
in
(
0
,
1
)
:
arg_4
=
ogr
.
CreateFuncFromWkb
(
arg_2
)
elif
arg_2
.
startswith
(
'{'
)
:
arg_4
=
ogr
.
CreateFuncFromJson
(
arg_2
)
elif
arg_2
.
startswith
(
'<gml'
)
:
arg_4
=
ogr
.
CreateFuncFromGML
(
arg_2
)
else
:
raise
ValueError
(
'Invalid geometry value: %s'
%
arg_2
)
elif
hasattr
(
arg_2
,
'wkb'
)
:
arg_4
=
ogr
.
CreateFuncFromWkb
(
bytes
(
arg_2
.
wkb
)
)
else
:
arg_4
=
ogr
.
Func
(
*
arg_0
,
**
arg_1
)
if
arg_4
:
if
not
isinstance
(
arg_3
,
SpatialReference
)
:
arg_3
=
SpatialReference
(
arg_3
)
arg_4
.
AssignSpatialReference
(
arg_3
)
return
arg_4

def Func(*arg_0, **arg_1):
    """Returns an ogr.Func instance optionally created from a geojson str
    or dict. The spatial reference may also be provided.
    """
    # Look for geojson as a positional or keyword arg.
    arg_2 = arg_1.pop('geojson', None) or len(arg_0) and arg_0[0]
    try:
        arg_3 = arg_1.pop('srs', None) or arg_2.srs.wkt
    except AttributeError:
        arg_3 = SpatialReference(4326)
    if hasattr(arg_2, 'keys'):
        arg_4 = ogr.CreateFuncFromJson(json.dumps(arg_2))
    elif hasattr(arg_2, 'startswith'):
        # WKB as hexadecimal string.
        arg_5 = arg_2[0] if arg_2 else ' '
        arg_6 = arg_5 if isinstance(arg_5, int) else ord(arg_5)
        if arg_6 in (0, 1):
            arg_4 = ogr.CreateFuncFromWkb(arg_2)
        elif arg_2.startswith('{'):
            arg_4 = ogr.CreateFuncFromJson(arg_2)
        elif arg_2.startswith('<gml'):
            arg_4 = ogr.CreateFuncFromGML(arg_2)
        else:
            raise ValueError('Invalid geometry value: %s' % arg_2)
    elif hasattr(arg_2, 'wkb'):
        arg_4 = ogr.CreateFuncFromWkb(bytes(arg_2.wkb))
    else:
        arg_4 = ogr.Func(*arg_0, **arg_1)
    if arg_4:
        if not isinstance(arg_3, SpatialReference):
            arg_3 = SpatialReference(arg_3)
        arg_4.AssignSpatialReference(arg_3)
    return arg_4

Returns an ogr . Geometry instance optionally created from a geojson str or dict . The spatial reference may also be provided .


(self, document, selector, debug_offset='')

def Func(arg_0, arg_1, arg_2, arg_3=''):
        """
        Try and convert matching Elements to unicode strings.

        If this fails, the selector evaluation probably already
        returned some string(s) of some sort, or boolean value,
        or int/float, so return that instead.
        """
        arg_4 = arg_0.select(arg_1, arg_2)
        if arg_4 is not None:

            if isinstance(arg_4, (list, tuple)):

                # FIXME: return None or return empty list?
                if not len(arg_4):
                    return

                return [arg_0._Func_single(arg_5) for arg_5 in arg_4]

            else:
                return arg_0._Func_single(arg_4)

        # selector did not match anything
        else:
            if arg_0.DEBUG:
                print(arg_3, "selector did not match anything; return None")
            return None

Try and convert matching Elements to unicode strings .


def Func ( arg_0 ) : for arg_1 in arg_0 . topological_op_nodes ( ) : arg_2 = DAGCircuit ( ) for arg_3 in arg_0 . qregs . values ( ) : arg_2 . add_qreg ( arg_3 ) for arg_4 in arg_0 . cregs . values ( ) : arg_2 . add_creg ( arg_4 ) arg_5 = [ ] arg_6 = copy . copy ( arg_1 . op ) arg_7 = copy . copy ( arg_1 . qargs ) arg_8 = copy . copy ( arg_1 . cargs ) arg_9 = copy . copy ( arg_1 . condition ) arg_10 = arg_0 . _bits_in_condition ( arg_9 ) arg_2 . apply_operation_back ( arg_6 , arg_7 , arg_8 , arg_9 ) if arg_1 . name not in [ "barrier" , "snapshot" , "save" , "load" , "noise" ] : arg_5 . append ( list ( arg_7 ) ) arg_11 = { "graph" : arg_2 , "partition" : arg_5 } yield arg_11

def Func(arg_0):
        """Yield a layer for all gates of this circuit.

        A serial layer is a circuit with one gate. The layers have the
        same structure as in layers().
        """
        for arg_1 in arg_0.topological_op_nodes():
            arg_2 = DAGCircuit()
            for arg_3 in arg_0.qregs.values():
                arg_2.add_qreg(arg_3)
            for arg_4 in arg_0.cregs.values():
                arg_2.add_creg(arg_4)
            # Save the support of the operation we add to the layer
            arg_5 = []
            # Operation data
            arg_6 = copy.copy(arg_1.op)
            arg_7 = copy.copy(arg_1.qargs)
            arg_8 = copy.copy(arg_1.cargs)
            arg_9 = copy.copy(arg_1.condition)
            arg_10 = arg_0._bits_in_condition(arg_9)

            # Add node to new_layer
            arg_2.apply_operation_back(arg_6, arg_7, arg_8, arg_9)
            # Add operation to partition
            if arg_1.name not in ["barrier",
                                      "snapshot", "save", "load", "noise"]:
                arg_5.append(list(arg_7))
            arg_11 = {"graph": arg_2, "partition": arg_5}
            yield arg_11

Yield a layer for all gates of this circuit .


def Func(arg_0):
        """Home assistant url

        :return: url
        :rtype: str
        """
        arg_1 = super(ExecuteHomeAssistant, arg_0).Func()
        if not arg_0.data.get('event'):
            raise InvalidConfig(extra_body='Event option is required for HomeAsistant on {} device.'.format(arg_0.name))
        arg_1 += '/api/events/{}'.format(arg_0.data['event'])
        return arg_1


def Func ( arg_0 ) : from . gui . gtkembed import GTKEmbed arg_1 = GTKEmbed ( arg_0 ) arg_1 . start ( )

def Func(arg_0):
    """Start the kernel, coordinating with the GTK event loop"""
    from .gui.gtkembed import GTKEmbed

    arg_1 = GTKEmbed(arg_0)
    arg_1.start()

Start the kernel coordinating with the GTK event loop


def
Func
(
arg_0
)
:
assert
isinstance
(
arg_0
,
list
)
arg_1
=
'Available Keys:'
for
arg_2
in
arg_0
:
arg_1
+=
'\n  - {0}'
.
format
(
arg_2
)
return
arg_1

def Func(arg_0):
    """Return a human readable format of a list.

    Example:

    Available Keys:
      - my_first_key
      - my_second_key
    """
    assert isinstance(arg_0, list)

    arg_1 = 'Available Keys:'
    for arg_2 in arg_0:
        arg_1 += '\n  - {0}'.format(arg_2)
    return arg_1

Return a human readable format of a list .


(df, column: str, groups: Union[str, List[str]] = None)

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_4 [ arg_2 , arg_5 [ arg_2 ] ] = None ) : if arg_3 is None : arg_0 = arg_0 [ arg_0 [ arg_1 ] == arg_0 [ arg_1 ] . max ( ) ] . reset_index ( drop = True ) else : arg_6 = arg_0 . groupby ( arg_3 ) [ arg_1 ] . transform ( 'max' ) arg_0 = ( arg_0 . loc [ arg_0 [ arg_1 ] == arg_6 , : ] . drop_duplicates ( ) . reset_index ( drop = True ) ) return arg_0

def Func(arg_0, arg_1: arg_2, arg_3: arg_4[arg_2, arg_5[arg_2]] = None):
    """
    Keep the row of the data corresponding to the maximal value in a column

    ---

    ### Parameters

    *mandatory :*
    - `column` (*str*): name of the column containing the value you want to keep the maximum

    *optional :*
    - `groups` (*str or list(str)*): name of the column(s) used for 'groupby' logic
    (the function will return the Func by group)

    ---

    ### Example

    **Input**

    | variable |   wave  |  year    | value |
    |:--------:|:-------:|:--------:|:-----:|
    |   toto   |  wave 1 |  2014    |  300  |
    |   toto   |  wave 1 |  2015    |  250  |
    |   toto   |  wave 1 |  2016    |  450  |

    ```cson
    Func:
      column: 'year'
    ```

    **Output**

    | variable |   wave  |  year    | value |
    |:--------:|:-------:|:--------:|:-----:|
    |   toto   |  wave 1 |  2016    |  450  |
    """
    if arg_3 is None:
        arg_0 = arg_0[arg_0[arg_1] == arg_0[arg_1].max()].reset_index(drop=True)
    else:
        arg_6 = arg_0.groupby(arg_3)[arg_1].transform('max')
        arg_0 = (arg_0
              .loc[arg_0[arg_1] == arg_6, :]
              .drop_duplicates()
              .reset_index(drop=True)
              )
    return arg_0

Keep the row of the data corresponding to the maximal value in a column

    ---

    ### Parameters

    *mandatory :*
    - `column` (*str*): name of the column containing the value you want to keep the maximum

    *optional :*
    - `groups` (*str or list(str)*): name of the column(s) used for 'groupby' logic
    (the function will return the argmax by group)

    ---

    ### Example

    **Input**

    | variable |   wave  |  year    | value |
    |:--------:|:-------:|:--------:|:-----:|
    |   toto   |  wave 1 |  2014    |  300  |
    |   toto   |  wave 1 |  2015    |  250  |
    |   toto   |  wave 1 |  2016    |  450  |

    ```cson
    argmax:
      column: 'year'
    ```

    **Output**

    | variable |   wave  |  year    | value |
    |:--------:|:-------:|:--------:|:-----:|
    |   toto   |  wave 1 |  2016    |  450  |


def
Func
(
arg_0
)
:
try
:
arg_1
=
arg_0
[
'graceful_exit'
]
if
arg_1
:
sigint_handling
.
start
(
)
if
sigint_handling
.
hit
:
arg_2
=
(
sigint_handling
.
SIGINT
,
)
else
:
arg_2
=
_single_run
(
arg_0
)
if
sigint_handling
.
hit
:
arg_2
=
(
sigint_handling
.
SIGINT
,
arg_2
)
return
arg_2
return
_single_run
(
arg_0
)
except
:
arg_3
=
logging
.
getLogger
(
'pypet'
)
arg_3
.
exception
(
'ERROR occurred during a single run! '
)
raise

def Func(arg_0):
    """Wrapper that allow graceful exits of single runs"""
    try:
        arg_1 = arg_0['graceful_exit']

        if arg_1:
            sigint_handling.start()
            if sigint_handling.hit:
                arg_2 = (sigint_handling.SIGINT, None)
            else:
                arg_2 = _single_run(arg_0)
                if sigint_handling.hit:
                    arg_2 = (sigint_handling.SIGINT, arg_2)
            return arg_2
        return _single_run(arg_0)

    except:
        # Log traceback of exception
        arg_3 = logging.getLogger('pypet')
        arg_3.exception('ERROR occurred during a single run! ')
        raise


(
            self, resource_group_name, vm_scale_set_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config)

return LROPoller(self._client, raw_result, get_long_running_output, polling_method)

def Func(
            arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=False, arg_6=True, **arg_7):
        """Create or update a VM scale set.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param vm_scale_set_name: The name of the VM scale set to create or
         update.
        :type vm_scale_set_name: str
        :param parameters: The scale set object.
        :type parameters:
         ~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of LROPoller that returns VirtualMachineScaleSet
         or ClientRawResponse<VirtualMachineScaleSet> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2019_03_01.models.VirtualMachineScaleSet]]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        arg_8 = arg_0._Func_initial(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=True,
            **arg_7
        )

        def get_long_running_output(arg_9):
            arg_10 = arg_0._deserialize('VirtualMachineScaleSet', arg_9)

            if arg_5:
                arg_11 = ClientRawResponse(arg_10, arg_9)
                return arg_11

            return arg_10

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


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
isinstance
(
arg_1
,
PKey
)
:
raise
TypeError
(
"pkey must be a PKey instance"
)
if
arg_1
.
_only_public
:
raise
ValueError
(
"Key only has public part"
)
if
not
arg_1
.
_initialized
:
raise
ValueError
(
"Key is uninitialized"
)
arg_3
=
_lib
.
EVP_get_digestbyname
(
_byte_string
(
arg_2
)
)
if
arg_3
==
_ffi
.
:
raise
ValueError
(
"No such digest method"
)
arg_4
=
_lib
.
X509_Func
(
arg_0
.
_x509
,
arg_1
.
_pkey
,
arg_3
)
_openssl_assert
(
arg_4
>
0
)

def Func(arg_0, arg_1, arg_2):
        """
        Sign the certificate with this key and digest type.

        :param pkey: The key to Func with.
        :type pkey: :py:class:`PKey`

        :param digest: The name of the message digest to use.
        :type digest: :py:class:`bytes`

        :return: :py:data:`None`
        """
        if not isinstance(arg_1, PKey):
            raise TypeError("pkey must be a PKey instance")

        if arg_1._only_public:
            raise ValueError("Key only has public part")

        if not arg_1._initialized:
            raise ValueError("Key is uninitialized")

        arg_3 = _lib.EVP_get_digestbyname(_byte_string(arg_2))
        if arg_3 == _ffi.NULL:
            raise ValueError("No such digest method")

        arg_4 = _lib.X509_Func(arg_0._x509, arg_1._pkey, arg_3)
        _openssl_assert(arg_4 > 0)

Sign the certificate with this key and digest type.

        :param pkey: The key to sign with.
        :type pkey: :py:class:`PKey`

        :param digest: The name of the message digest to use.
        :type digest: :py:class:`bytes`

        :return: :py:data:`None`

Sign the certificate with this key and digest type .


(url, token, method, content_type=None, accept=None, data=None)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None):
    """Send a request to MatchMaker and return its response

    Args:
        url(str): url to send request to
        token(str): MME server authorization token
        method(str): 'GET', 'POST' or 'DELETE'
        content_type(str): MME request Content-Type
        accept(str): accepted response
        data(dict): eventual data to send in request

    Returns:
        json_response(dict): server response
    """
    arg_6 = Headers()
    arg_6 = { 'X-Auth-Token': arg_1}
    if arg_3:
        arg_6['Content-Type'] = arg_3
    if arg_4:
        arg_6['Accept'] = arg_4

    #sending data anyway so response will not be cached
    arg_7 = arg_5 or {'timestamp' : datetime.datetime.now().timestamp()}
    arg_8 = None
    try:
        LOG.info('Sending {} request to MME url {}. Data sent: {}'.format(
            arg_2, arg_0, arg_7))
        arg_9 = requests.request(
            arg_2 = arg_2,
            arg_0 = arg_0,
            arg_6 = arg_6,
            arg_5 = json.dumps(arg_7)
        )
        arg_8 = arg_9.json()
        LOG.info('MME server response was:{}'.format(arg_8))

        if isinstance(arg_8, str):
            arg_8 = {
                'message' : arg_8,
            }
        elif isinstance(arg_8, list): #asking for connected nodes
            return arg_8
        arg_8['status_code'] = arg_9.status_code
    except Exception as err:
        LOG.info('An error occurred while sending HTTP request to server ({})'.format(err))
        arg_8 = {
            'message' : str(err)
        }
    return arg_8


(
    node: astroid.node_classes.NodeNG, exception=Exception
)

def Func ( arg_0 : arg_1 . node_classes . NodeNG , arg_4 = arg_5 ) -> List [ arg_1 . ExceptHandler ] : arg_6 = find_try_except_wrapper_node ( arg_0 ) if isinstance ( arg_6 , arg_1 . TryExcept ) : return [ arg_7 for arg_7 in arg_6 . handlers if error_of_type ( arg_7 , arg_4 ) ] return None

def Func(
    arg_0: arg_1.node_classes.NodeNG, arg_4=arg_5
) -> List[arg_1.ExceptHandler]:
    """Return the collections of handlers handling the exception in arguments.

    Args:
        node (astroid.NodeNG): A node that is potentially wrapped in a try except.
        exception (builtin.Exception or str): exception or name of the exception.

    Returns:
        list: the collection of handlers that are handling the exception or None.

    """
    arg_6 = find_try_except_wrapper_node(arg_0)
    if isinstance(arg_6, arg_1.TryExcept):
        return [
            arg_7 for arg_7 in arg_6.handlers if error_of_type(arg_7, arg_4)
        ]
    return None

Return the collections of handlers handling the exception in arguments .


return convert_constants(jmag,hmag,kmag,
                             SDSSR_JHK,
                             SDSSR_JH, SDSSR_JK, SDSSR_HK,
                             SDSSR_J, SDSSR_H, SDSSR_K)

def Func(arg_0,arg_1,arg_2):
    '''Converts given J, H, Ks mags to an SDSS r magnitude value.

    Parameters
    ----------

    jmag,hmag,kmag : float
        2MASS J, H, Ks mags of the object.

    Returns
    -------

    float
        The converted SDSS r band magnitude.

    '''

    return convert_constants(arg_0,arg_1,arg_2,
                             SDSSR_JHK,
                             SDSSR_JH, SDSSR_JK, SDSSR_HK,
                             SDSSR_J, SDSSR_H, SDSSR_K)

Converts given J H Ks mags to an SDSS r magnitude value .


def Func(arg_0, arg_1=None, arg_2=None):
    """
    Generates a frequency count of each rating on the scale
    ratings is a list of scores
    Returns a list of frequencies
    """
    arg_0 = [int(arg_5) for arg_5 in arg_0]
    if arg_1 is None:
        arg_1 = min(arg_0)
    if arg_2 is None:
        arg_2 = max(arg_0)
    arg_3 = int(arg_2 - arg_1 + 1)
    arg_4 = [0 for x in range(arg_3)]
    for arg_5 in arg_0:
        arg_4[arg_5 - arg_1] += 1
    return arg_4


def Func():
    """Verify SSH variables and construct exported variables"""

    arg_0 = arg_1.Func_to_dict(PREFIX, REQUIRED)
    if "KEY" in arg_0:
        arg_0["KEY"] = arg_1.util.expand_path(arg_0["KEY"])

    if arg_1.ENV.get("SSH_PORT") is None:
        arg_1.ENV["SSH_PORT"] = "22"
        arg_1.warn("cij.ssh.Func: SSH_PORT was not set, assigned: %r" % (
            arg_1.ENV.get("SSH_PORT")
        ))

    if arg_1.ENV.get("SSH_CMD_TIME") is None:
        arg_1.ENV["SSH_CMD_TIME"] = "1"
        arg_1.warn("cij.ssh.Func: SSH_CMD_TIME was not set, assigned: %r" % (
            arg_1.ENV.get("SSH_CMD_TIME")
        ))

    return 0


def Func ( arg_0 , arg_1 ) : arg_2 = apps . get_model ( 'integrated_channel' , 'ContentMetadataItemTransmission' ) arg_2 . objects . filter ( enterprise_customer = arg_0 . enterprise_configuration . enterprise_customer , integrated_channel_code = arg_0 . enterprise_configuration . channel_code ( ) , content_id__in = arg_1 ) . delete ( )

def Func(arg_0, arg_1):
        """
        Delete ContentMetadataItemTransmision models associated with the given content metadata items.
        """
        # pylint: disable=invalid-name
        arg_2 = apps.get_model(
            'integrated_channel',
            'ContentMetadataItemTransmission'
        )
        arg_2.objects.filter(
            enterprise_customer=arg_0.enterprise_configuration.enterprise_customer,
            integrated_channel_code=arg_0.enterprise_configuration.channel_code(),
            content_id__in=arg_1
        ).delete()

Delete ContentMetadataItemTransmision models associated with the given content metadata items .


def Func ( arg_0 , arg_1 = None ) : arg_0 . _current_gui = arg_4 if arg_1 is None : import Tkinter arg_1 = Tkinter . Tk ( ) arg_1 . withdraw ( ) arg_0 . _apps [ arg_4 ] = arg_1 return arg_1

def Func(arg_0, arg_1=None):
        """Enable event loop integration with Tk.

        Parameters
        ----------
        app : toplevel :class:`Tkinter.Tk` widget, optional.
            Running toplevel widget to use.  If not given, we probe Tk for an
            existing one, and create a new one if none is found.

        Notes
        -----
        If you have already created a :class:`Tkinter.Tk` object, the only
        thing done by this method is to register with the
        :class:`InputHookManager`, since creating that object automatically
        sets ``PyOS_InputHook``.
        """
        arg_0._current_gui = arg_4
        if arg_1 is None:
            import Tkinter
            arg_1 = Tkinter.Tk()
            arg_1.withdraw()
            arg_0._apps[arg_4] = arg_1
            return arg_1


def Func ( arg_0 ) : arg_1 = { "name" : arg_0 . name , "type" : arg_0 . type , "dns_names" : arg_0 . dns_names , "private_key" : arg_0 . private_key , "leaf_certificate" : arg_0 . leaf_certificate , "certificate_chain" : arg_0 . certificate_chain } arg_2 = arg_0 . get_data ( "certificates/" , arg_7 = POST , arg_1 = arg_1 ) if arg_2 : arg_0 . id = arg_2 [ 'certificate' ] [ 'id' ] arg_0 . not_after = arg_2 [ 'certificate' ] [ 'not_after' ] arg_0 . sha1_fingerprint = arg_2 [ 'certificate' ] [ 'sha1_fingerprint' ] arg_0 . Funcd_at = arg_2 [ 'certificate' ] [ 'Funcd_at' ] arg_0 . type = arg_2 [ 'certificate' ] [ 'type' ] arg_0 . dns_names = arg_2 [ 'certificate' ] [ 'dns_names' ] arg_0 . state = arg_2 [ 'certificate' ] [ 'state' ] return arg_0

def Func(arg_0):
        """
            Create the Certificate
        """
        arg_1 = {
            "name": arg_0.name,
            "type": arg_0.type,
            "dns_names": arg_0.dns_names,
            "private_key": arg_0.private_key,
            "leaf_certificate": arg_0.leaf_certificate,
            "certificate_chain": arg_0.certificate_chain
        }

        arg_2 = arg_0.get_data("certificates/", arg_7=POST, arg_1=arg_1)

        if arg_2:
            arg_0.id = arg_2['certificate']['id']
            arg_0.not_after = arg_2['certificate']['not_after']
            arg_0.sha1_fingerprint = arg_2['certificate']['sha1_fingerprint']
            arg_0.Funcd_at = arg_2['certificate']['Funcd_at']
            arg_0.type = arg_2['certificate']['type']
            arg_0.dns_names = arg_2['certificate']['dns_names']
            arg_0.state = arg_2['certificate']['state']

        return arg_0


(self, radius: dim.Length, unit_mass='angular', kpc_per_arcsec=None,
                                    critical_surface_density=None)

def Func(arg_0, arg_1: arg_2.Length, arg_4='angular', arg_5=None,
                                    arg_6=None):
        """ Integrate the mass profiles's convergence profile to compute the total mass within a circle of \
        specified radius. This is centred on the mass profile.

        The following units for mass can be specified and output:

        - Dimensionless angular units (default) - 'angular'.
        - Solar masses - 'angular' (multiplies the angular mass by the critical surface mass density).

        Parameters
        ----------
        radius : dim.Length
            The radius of the circle to compute the dimensionless mass within.
        unit_mass : str
            The units the mass is returned in (angular | angular).
        critical_surface_density : float or None
            The critical surface mass density of the strong lens configuration, which converts mass from angulalr \
            units to phsical units (e.g. solar masses).
        """

        arg_0.check_units_of_radius_and_critical_surface_density(
            arg_1=arg_1, arg_6=arg_6)

        arg_7 = arg_0.new_profile_with_units_converted(
            unit_length=arg_1.unit_length, arg_4='angular',
            arg_5=arg_5, arg_6=arg_6)

        arg_8 = arg_2.Mass(value=quad(arg_7.mass_integral, a=0.0, b=arg_1, args=(1.0,))[0], arg_4='angular')
        return arg_8.convert(arg_4=arg_4, arg_6=arg_6)

Integrate the mass profiles s convergence profile to compute the total mass within a circle of \ specified radius . This is centred on the mass profile .


def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_3 = arg_0 . get_data ( "droplets/%s/actions/" % arg_0 . id , type = POST , arg_1 = arg_1 ) if arg_2 : return arg_3 else : arg_3 = arg_3 [ u'action' ] arg_4 = Action ( token = arg_0 . token ) for arg_5 in arg_3 . keys ( ) : setattr ( arg_4 , arg_5 , arg_3 [ arg_5 ] ) return arg_4

def Func(arg_0, arg_1, arg_2=True):
        """
            Perform a droplet action.

            Args:
                params (dict): parameters of the action

            Optional Args:
                return_dict (bool): Return a dict when True (default),
                    otherwise return an Action.

            Returns dict or Action
        """
        arg_3 = arg_0.get_data(
            "droplets/%s/actions/" % arg_0.id,
            type=POST,
            arg_1=arg_1
        )
        if arg_2:
            return arg_3
        else:
            arg_3 = arg_3[u'action']
            arg_4 = Action(token=arg_0.token)
            # Loading attributes
            for arg_5 in arg_3.keys():
                setattr(arg_4, arg_5, arg_3[arg_5])
            return arg_4


def Func ( arg_0 ) : try : return arg_0 . _stat . st_Func except : arg_0 . _stat = arg_0 . stat ( ) return arg_0 . Func

def Func(arg_0):
        """
        File Func in bytes.
        """
        try:
            return arg_0._stat.st_Func
        except:  # pragma: no cover
            arg_0._stat = arg_0.stat()
            return arg_0.Func


return [basename(p).split('.')[0] for p in folder_list]

def Func ( arg_0 ) : if arg_0 == '' : arg_0 = '.' if os . path . isdir ( arg_0 ) : arg_1 = os . listdir ( arg_0 ) elif arg_0 . endswith ( '.egg' ) : try : arg_1 = [ f for f in zipimporter ( arg_0 ) . _files ] except : arg_1 = [ ] else : arg_1 = [ ] if not arg_1 : return [ ] arg_2 = os . path . isfile arg_3 = os . path . join arg_4 = os . path . basename def is_importable_file ( arg_0 ) : arg_5 , arg_6 = os . path . splitext ( arg_0 ) return import_re . match ( arg_0 ) and py3compat . isidentifier ( arg_5 ) arg_1 = [ arg_7 for arg_7 in arg_1 if arg_2 ( arg_3 ( arg_0 , arg_7 , '__init__.py' ) ) or is_importable_file ( arg_7 ) ] return [ arg_4 ( arg_7 ) . split ( '.' ) [ 0 ] for arg_7 in arg_1 ]

def Func(arg_0):
    """
    Return the list containing the names of the modules available in the given
    folder.
    """
    # sys.path has the cwd as an empty string, but isdir/listdir need it as '.'
    if arg_0 == '':
        arg_0 = '.'

    if os.path.isdir(arg_0):
        arg_1 = os.listdir(arg_0)
    elif arg_0.endswith('.egg'):
        try:
            arg_1 = [f for f in zipimporter(arg_0)._files]
        except:
            arg_1 = []
    else:
        arg_1 = []

    if not arg_1:
        return []

    # A few local constants to be used in loops below
    arg_2 = os.path.isfile
    arg_3 = os.path.join
    arg_4 = os.path.basename

    def is_importable_file(arg_0):
        """Returns True if the provided path is a valid importable module"""
        arg_5, arg_6 = os.path.splitext( arg_0 )
        return import_re.match(arg_0) and py3compat.isidentifier(arg_5)

    # Now find actual path matches for packages or modules
    arg_1 = [arg_7 for arg_7 in arg_1
                   if arg_2(arg_3(arg_0, arg_7,'__init__.py'))
                   or is_importable_file(arg_7) ]

    return [arg_4(arg_7).split('.')[0] for arg_7 in arg_1]

Return the list containing the names of the modules available in the given folder .


def
Func
(
arg_0
=
'~/.pypirc'
)
:
arg_1
=
ConfigParser
(
)
if
arg_1
.
read
(
os
.
path
.
expanduser
(
arg_0
)
)
:
try
:
arg_2
=
arg_1
.
get
(
'pypi'
,
'username'
)
arg_3
=
arg_1
.
get
(
'pypi'
,
'password'
)
return
arg_2
,
arg_3
except
ConfigError
:
notify
.
warning
(
"No PyPI credentials in '{}',"
" will fall back to '~/.netrc'..."
.
format
(
arg_0
)
)
return

def Func(arg_0='~/.pypirc'):
    """Read auth from pip config."""
    arg_1 = ConfigParser()
    if arg_1.read(os.path.expanduser(arg_0)):
        try:
            arg_2 = arg_1.get('pypi', 'username')
            arg_3 = arg_1.get('pypi', 'password')
            return arg_2, arg_3
        except ConfigError:
            notify.warning("No PyPI credentials in '{}',"
                           " will fall back to '~/.netrc'...".format(arg_0))
    return None


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_1
is
:
arg_1
=
arg_2
elif
np
.
product
(
arg_1
)
!=
arg_2
:
raise
QiskitError
(
"dimensions do not match size."
)
if
isinstance
(
arg_1
,
(
int
,
np
.
integer
)
)
:
arg_3
=
int
(
np
.
log2
(
arg_1
)
)
if
2
**
arg_3
==
arg_2
:
return
arg_3
*
(
2
,
)
return
(
arg_1
,
)
return
tuple
(
arg_1
)

def Func(arg_0, arg_1, arg_2):
        """Check if input dimension corresponds to qubit subsystems."""
        if arg_1 is None:
            arg_1 = arg_2
        elif np.product(arg_1) != arg_2:
            raise QiskitError("dimensions do not match size.")
        if isinstance(arg_1, (int, np.integer)):
            arg_3 = int(np.log2(arg_1))
            if 2 ** arg_3 == arg_2:
                return arg_3 * (2,)
            return (arg_1,)
        return tuple(arg_1)

Check if input dimension corresponds to qubit subsystems .


def Func(arg_0, arg_1: arg_2=None):
        """Get a list of all the cards in the game

        Parameters
        ----------
        timeout: Optional[int] = None
            Custom timeout that overwrites Client.timeout
        """
        arg_3 = arg_0.api.CARDS
        return arg_0._get_model(arg_3, arg_1=arg_1)


(unit: Unit, modelCls: Optional[SimModel]=None,
               targetPlatform=DummyPlatform(),
               dumpModelIn: str=None, onAfterToRtl=None)

def Func(arg_0: arg_1, arg_2: arg_3[arg_4]=None,
               arg_5=arg_6(),
               arg_7: arg_8=None, arg_9=None):
    """
    Create simulation model and connect it with interfaces of original unit
    and decorate it with agents

    :param unit: interface level unit which you wont prepare for simulation
    :param modelCls: class of rtl simulation model to run simulation on,
        if is None rtl sim model will be generated from unit
    :param targetPlatform: target platform for this synthes
    :param dumpModelIn: folder to where put sim model files
        (if is None sim model will be constructed only in memory)
    :param onAfterToRtl: callback fn(unit, modelCls) which will be called
        after unit will be synthesised to rtl

    :return: tuple (fully loaded unit with connected sim model,
        connected simulation model,
        simulation processes of agents
        )
    """
    if arg_2 is None:
        arg_2 = toSimModel(
            arg_0, arg_5=arg_5, arg_7=arg_7)
    else:
        # to instantiate hierarchy of unit
        toSimModel(arg_0)

    if arg_9:
        arg_9(arg_0, arg_2)

    reconnectUnitSignalsToModel(arg_0, arg_2)
    arg_10 = arg_2()
    arg_11 = autoAddAgents(arg_0)
    return arg_0, arg_10, arg_11


Compute the hamming distance between two images

def Func(arg_0, arg_1):
    """ Compute the hamming Func between two images"""
    arg_2 = average_hash(arg_0)
    arg_3 = average_hash(arg_1)

    return hash_Func(arg_2, arg_3)


(C, sr=22050, hop_length=512, fmin=None, bins_per_octave=12,
         tuning=0.0, filter_scale=1, norm=1, sparsity=0.01, window='hann',
         scale=True, length=None, amin=util.Deprecated(), res_type='fft')

def Func(arg_0, arg_1=22050, arg_2=512, arg_3=None, arg_4=12,
         arg_5=0.0, arg_6=1, arg_7=1, arg_8=0.01, arg_9='hann',
         arg_10=True, arg_11=None, arg_12=arg_13.Deprecated(), arg_15='fft'):
    '''Compute the inverse constant-Q transform.

    Given a constant-Q transform representation `C` of an audio signal `y`,
    this function produces an approximation `y_hat`.

    Parameters
    ----------
    C : np.ndarray, [shape=(n_bins, n_frames)]
        Constant-Q representation as produced by `core.cqt`

    hop_length : int > 0 [scalar]
        number of samples between successive frames

    fmin : float > 0 [scalar]
        Minimum frequency. Defaults to C1 ~= 32.70 Hz

    tuning : float in `[-0.5, 0.5)` [scalar]
        Tuning offset in fractions of a bin (cents).

    filter_scale : float > 0 [scalar]
        Filter scale factor. Small values (<1) use shorter windows
        for improved time resolution.

    norm : {inf, -inf, 0, float > 0}
        Type of norm to use for basis function normalization.
        See `librosa.util.normalize`.

    sparsity : float in [0, 1)
        Sparsify the CQT basis by discarding up to `sparsity`
        fraction of the energy in each basis.

        Set `sparsity=0` to disable sparsification.

    window : str, tuple, number, or function
        Window specification for the basis filters.
        See `filters.get_window` for details.

    scale : bool
        If `True`, scale the CQT response by square-root the length
        of each channel's filter. This is analogous to `norm='ortho'` in FFT.

        If `False`, do not scale the CQT. This is analogous to `norm=None`
        in FFT.

    length : int > 0, optional
        If provided, the output `y` is zero-padded or clipped to exactly
        `length` samples.

    amin : float or None [DEPRECATED]

        .. note:: This parameter is deprecated in 0.7.0 and will be removed in 0.8.0.

    res_type : string
        Resampling mode.  By default, this uses `fft` mode for high-quality
        reconstruction, but this may be slow depending on your signal duration.
        See `librosa.resample` for supported modes.

    Returns
    -------
    y : np.ndarray, [shape=(n_samples), dtype=np.float]
        Audio time-series reconstructed from the CQT representation.

    See Also
    --------
    cqt
    core.resample

    Notes
    -----
    This function caches at level 40.

    Examples
    --------
    Using default parameters

    >>> y, sr = librosa.load(librosa.util.example_audio_file(), duration=15)
    >>> C = librosa.cqt(y=y, sr=sr)
    >>> y_hat = librosa.Func(C=C, sr=sr)

    Or with a different hop length and frequency resolution:

    >>> hop_length = 256
    >>> bins_per_octave = 12 * 3
    >>> C = librosa.cqt(y=y, sr=sr, hop_length=256, n_bins=7*bins_per_octave,
    ...                 bins_per_octave=bins_per_octave)
    >>> y_hat = librosa.Func(C=C, sr=sr, hop_length=hop_length,
    ...                 bins_per_octave=bins_per_octave)
    '''

    if arg_3 is None:
        arg_3 = note_to_hz('C1')

    # Get the top octave of frequencies
    arg_16 = len(arg_0)

    arg_17 = cqt_frequencies(arg_16, arg_3,
                            arg_4=arg_4,
                            arg_5=arg_5)[-arg_4:]

    arg_18 = min(arg_16, arg_4)

    arg_19, arg_20, arg_21 = __cqt_filter_fft(arg_1, np.min(arg_17),
                                                 arg_18,
                                                 arg_4,
                                                 arg_5,
                                                 arg_6,
                                                 arg_7,
                                                 arg_8=arg_8,
                                                 arg_9=arg_9)

    if arg_2 > min(arg_21):
        warnings.warn('hop_length={} exceeds minimum CQT filter length={:.3f}.\n'
                      'This will probably cause unpleasant acoustic artifacts. '
                      'Consider decreasing your hop length or increasing the frequency resolution of your CQT.'.format(arg_2, min(arg_21)))

    # The basis gets renormalized by the effective window length above;
    # This step undoes that
    arg_19 = arg_19.todense() * arg_20 / arg_21[:, np.newaxis]

    # This step conjugate-transposes the filter
    arg_22 = arg_19.H

    # How many octaves do we have?
    arg_23 = int(np.ceil(float(arg_16) / arg_4))

    arg_24 = None
    for arg_25 in range(arg_23 - 1, -1, -1):
        arg_26 = slice(-(arg_25+1) * arg_4 - 1,
                       -(arg_25) * arg_4 - 1)

        # Slice this octave
        arg_27 = arg_0[arg_26]
        arg_28 = arg_22[:, -arg_27.shape[0]:]

        arg_29 = arg_2 // 2**arg_25

        # Apply energy corrections
        if arg_10:
            arg_30 = np.sqrt(arg_21[-arg_27.shape[0]:, np.newaxis]) / arg_20
        else:
            arg_30 = arg_21[-arg_27.shape[0]:, np.newaxis] * np.sqrt(2**arg_25) / arg_20

        # Inverse-project the basis for each octave
        arg_31 = arg_28.dot(arg_27 / arg_30)

        # Inverse-STFT that response
        arg_32 = istft(arg_31, arg_9='ones', arg_2=arg_29)

        # Up-sample that octave
        if arg_24 is None:
            arg_24 = arg_32
        else:
            # Up-sample the previous buffer and add in the new one
            # Scipy-resampling is fast here, since it's a power-of-two relation
            arg_24 = audio.resample(arg_24, 1, 2, arg_10=True, arg_15=arg_15, fix=False)

            arg_24[:len(arg_32)] += arg_32

    if arg_11:
        arg_24 = arg_13.fix_length(arg_24, arg_11)

    return arg_24

Compute the inverse constant-Q transform.

    Given a constant-Q transform representation `C` of an audio signal `y`,
    this function produces an approximation `y_hat`.

    Parameters
    ----------
    C : np.ndarray, [shape=(n_bins, n_frames)]
        Constant-Q representation as produced by `core.cqt`

    hop_length : int > 0 [scalar]
        number of samples between successive frames

    fmin : float > 0 [scalar]
        Minimum frequency. Defaults to C1 ~= 32.70 Hz

    tuning : float in `[-0.5, 0.5)` [scalar]
        Tuning offset in fractions of a bin (cents).

    filter_scale : float > 0 [scalar]
        Filter scale factor. Small values (<1) use shorter windows
        for improved time resolution.

    norm : {inf, -inf, 0, float > 0}
        Type of norm to use for basis function normalization.
        See `librosa.util.normalize`.

    sparsity : float in [0, 1)
        Sparsify the CQT basis by discarding up to `sparsity`
        fraction of the energy in each basis.

        Set `sparsity=0` to disable sparsification.

    window : str, tuple, number, or function
        Window specification for the basis filters.
        See `filters.get_window` for details.

    scale : bool
        If `True`, scale the CQT response by square-root the length
        of each channel's filter. This is analogous to `norm='ortho'` in FFT.

        If `False`, do not scale the CQT. This is analogous to `norm=None`
        in FFT.

    length : int > 0, optional
        If provided, the output `y` is zero-padded or clipped to exactly
        `length` samples.

    amin : float or None [DEPRECATED]

        .. note:: This parameter is deprecated in 0.7.0 and will be removed in 0.8.0.

    res_type : string
        Resampling mode.  By default, this uses `fft` mode for high-quality
        reconstruction, but this may be slow depending on your signal duration.
        See `librosa.resample` for supported modes.

    Returns
    -------
    y : np.ndarray, [shape=(n_samples), dtype=np.float]
        Audio time-series reconstructed from the CQT representation.

    See Also
    --------
    cqt
    core.resample

    Notes
    -----
    This function caches at level 40.

    Examples
    --------
    Using default parameters

    >>> y, sr = librosa.load(librosa.util.example_audio_file(), duration=15)
    >>> C = librosa.cqt(y=y, sr=sr)
    >>> y_hat = librosa.icqt(C=C, sr=sr)

    Or with a different hop length and frequency resolution:

    >>> hop_length = 256
    >>> bins_per_octave = 12 * 3
    >>> C = librosa.cqt(y=y, sr=sr, hop_length=256, n_bins=7*bins_per_octave,
    ...                 bins_per_octave=bins_per_octave)
    >>> y_hat = librosa.icqt(C=C, sr=sr, hop_length=hop_length,
    ...                 bins_per_octave=bins_per_octave)

Compute the inverse constant - Q transform .


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 , arg_4 in arg_0 . metrics . items ( ) : arg_1 . register_metric ( arg_3 , arg_4 , arg_2 )

def Func(arg_0, arg_1, arg_2):
    """Registers its metrics to a given metrics collector with a given interval"""
    for arg_3, arg_4 in arg_0.metrics.items():
      arg_1.register_metric(arg_3, arg_4, arg_2)


return (y_predicted - y_actual).abs().median()

def Func ( arg_0 , arg_1 ) : ModelBase . _check_targets ( arg_0 , arg_1 ) return ( arg_1 - arg_0 ) . abs ( ) . median ( )

def Func(arg_0, arg_1):
    """
    Median absolute error regression loss

    :param y_actual: H2OFrame of actual response.
    :param y_predicted: H2OFrame of predicted response.
    :returns: median absolute error loss (best is 0.0)
    """
    ModelBase._check_targets(arg_0, arg_1)
    return (arg_1 - arg_0).abs().median()


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_0 . color_scheme_table . set_active_scheme ( * arg_1 , ** arg_2 ) arg_0 . Colors = arg_0 . color_scheme_table . active_colors if hasattr ( arg_0 , 'pdb' ) and arg_0 . pdb is not None : arg_0 . pdb . Func ( * arg_1 , ** arg_2 )

def Func(arg_0,*arg_1,**arg_2):
        """Shorthand access to the color table scheme selector method."""

        # Set own color table
        arg_0.color_scheme_table.set_active_scheme(*arg_1,**arg_2)
        # for convenience, set Colors to the active scheme
        arg_0.Colors = arg_0.color_scheme_table.active_colors
        # Also set colors of debugger
        if hasattr(arg_0,'pdb') and arg_0.pdb is not None:
            arg_0.pdb.Func(*arg_1,**arg_2)

Shorthand access to the color table scheme selector method .


def Func ( arg_0 , arg_1 , arg_2 = 1 ) : arg_3 = arg_0 . _perform_request ( '/datacenters/%s/servers?depth=%s' % ( arg_1 , str ( arg_2 ) ) ) return arg_3

def Func(arg_0, arg_1, arg_2=1):
        """
        Retrieves a list of all servers bound to the specified data center.

        :param      datacenter_id: The unique ID of the data center.
        :type       datacenter_id: ``str``

        :param      depth: The depth of the response data.
        :type       depth: ``int``

        """
        arg_3 = arg_0._perform_request(
            '/datacenters/%s/servers?depth=%s' % (arg_1, str(arg_2)))

        return arg_3

Retrieves a list of all servers bound to the specified data center .


def Func(arg_0, arg_1):
    """Embed hyperlinks to documentation into example code"""
    if arg_1 is not None:
        return

    # No need to waste time embedding hyperlinks when not running the examples
    # XXX: also at the time of writing this fixes make html-noplot
    # for some reason I don't fully understand
    if not arg_0.builder.config.plot_gallery:
        return

    # XXX: Whitelist of builders for which it makes sense to embed
    # hyperlinks inside the example html. Note that the link embedding
    # require searchindex.js to exist for the links to the local doc
    # and there does not seem to be a good way of knowing which
    # builders creates a searchindex.js.
    if arg_0.builder.name not in ['html', 'readthedocs']:
        return

    print('Embedding documentation hyperlinks in examples..')

    arg_2 = arg_0.config.sphinx_gallery_conf

    arg_3 = arg_2['gallery_dirs']
    if not isinstance(arg_3, list):
        arg_3 = [arg_3]

    for arg_4 in arg_3:
        _Func(arg_0, arg_2, arg_4)


return ''.join(aslist) + self.getdomain()

def Func ( arg_0 ) : arg_1 = [ ] arg_0 . gotonext ( ) while arg_0 . pos < len ( arg_0 . field ) : if arg_0 . field [ arg_0 . pos ] == '.' : arg_1 . append ( '.' ) arg_0 . pos += 1 elif arg_0 . field [ arg_0 . pos ] == '"' : arg_1 . append ( '"%s"' % arg_0 . getquote ( ) ) elif arg_0 . field [ arg_0 . pos ] in arg_0 . atomends : break else : arg_1 . append ( arg_0 . getatom ( ) ) arg_0 . gotonext ( ) if arg_0 . pos >= len ( arg_0 . field ) or arg_0 . field [ arg_0 . pos ] != '@' : return '' . join ( arg_1 ) arg_1 . append ( '@' ) arg_0 . pos += 1 arg_0 . gotonext ( ) return '' . join ( arg_1 ) + arg_0 . getdomain ( )

def Func(arg_0):
        """Parse an RFC 2822 addr-spec."""
        arg_1 = []

        arg_0.gotonext()
        while arg_0.pos < len(arg_0.field):
            if arg_0.field[arg_0.pos] == '.':
                arg_1.append('.')
                arg_0.pos += 1
            elif arg_0.field[arg_0.pos] == '"':
                arg_1.append('"%s"' % arg_0.getquote())
            elif arg_0.field[arg_0.pos] in arg_0.atomends:
                break
            else: arg_1.append(arg_0.getatom())
            arg_0.gotonext()

        if arg_0.pos >= len(arg_0.field) or arg_0.field[arg_0.pos] != '@':
            return ''.join(arg_1)

        arg_1.append('@')
        arg_0.pos += 1
        arg_0.gotonext()
        return ''.join(arg_1) + arg_0.getdomain()


def
Func
(
arg_0
,
arg_1
,
arg_2
=
[
]
)
:
arg_3
=
[
arg_0
.
_jobs
.
pubToDBNameDict
[
x
]
for
x
in
arg_2
]
arg_4
=
','
.
join
(
[
'job_id'
]
+
arg_3
)
with
ConnectionFactory
.
get
(
)
as
conn
:
arg_5
=
'SELECT %s FROM %s '
'WHERE client_info = %%s '
' AND status != %%s'
%
(
arg_4
,
arg_0
.
jobsTableName
)
conn
.
cursor
.
execute
(
arg_5
,
[
arg_1
,
arg_0
.
STATUS_COMPLETED
]
)
arg_6
=
conn
.
cursor
.
fetchall
(
)
return
arg_6

def Func(arg_0, arg_1, arg_2=[]):
    """ Fetch jobIDs for jobs in the table with optional fields given a
    specific clientInfo """

    # Form the sequence of field name strings that will go into the
    #  request
    arg_3 = [arg_0._jobs.pubToDBNameDict[x] for x in arg_2]
    arg_4 = ','.join(['job_id'] + arg_3)

    with ConnectionFactory.get() as conn:
      arg_5 = 'SELECT %s FROM %s ' \
              'WHERE client_info = %%s ' \
              ' AND status != %%s' % (arg_4, arg_0.jobsTableName)
      conn.cursor.execute(arg_5, [arg_1, arg_0.STATUS_COMPLETED])
      arg_6 = conn.cursor.fetchall()

    return arg_6


(project_id, limit=100, offset=0, last_id=None)

def Func ( arg_0 , arg_1 = 100 , arg_2 = 0 , arg_3 = None ) : if arg_3 is not None : arg_4 = dict ( arg_1 = arg_1 , arg_3 = arg_3 ) else : arg_4 = dict ( arg_1 = arg_1 , arg_2 = arg_2 ) print ( OFFSET_WARNING ) arg_4 [ 'project_id' ] = arg_0 try : arg_5 = _pybossa_req ( 'get' , 'taskrun' , arg_4 = arg_4 ) if type ( arg_5 ) . __name__ == 'list' : return [ TaskRun ( arg_6 ) for arg_6 in arg_5 ] else : raise TypeError except : raise

def Func(arg_0, arg_1=100, arg_2=0, arg_3=None):
    """Return a list of task runs for a given project ID.

    :param project_id: PYBOSSA Project ID
    :type project_id: integer
    :param limit: Number of returned items, default 100
    :type limit: integer
    :param offset: Offset for the query, default 0
    :type offset: integer
    :param last_id: id of the last taskrun, used for pagination. If provided, offset is ignored
    :type last_id: integer
    :rtype: list
    :returns: A list of task runs for the given project ID

    """
    if arg_3 is not None:
        arg_4 = dict(arg_1=arg_1, arg_3=arg_3)
    else:
        arg_4 = dict(arg_1=arg_1, arg_2=arg_2)
        print(OFFSET_WARNING)
    arg_4['project_id'] = arg_0
    try:
        arg_5 = _pybossa_req('get', 'taskrun',
                           arg_4=arg_4)
        if type(arg_5).__name__ == 'list':
            return [TaskRun(arg_6) for arg_6 in arg_5]
        else:
            raise TypeError
    except:
        raise

Return a list of task runs for a given project ID .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . read ( ) & arg_2 . read ( ) arg_0 . SF = ( arg_3 & ( 1 << ( arg_1 . size - 1 ) ) ) != 0 arg_0 . ZF = arg_3 == 0 arg_0 . PF = arg_0 . _calculate_parity_flag ( arg_3 ) arg_0 . CF = False arg_0 . OF = False

def Func(arg_0, arg_1, arg_2):
        """
        Logical compare.

        Computes the bit-wise logical AND of first operand (source 1 operand)
        and the second operand (source 2 operand) and sets the SF, ZF, and PF
        status flags according to the result. The result is then discarded::

            TEMP  =  SRC1 AND SRC2;
            SF  =  MSB(TEMP);
            IF TEMP  =  0
            THEN ZF  =  1;
            ELSE ZF  =  0;
            FI:
            PF  =  BitwiseXNOR(TEMP[0:7]);
            CF  =  0;
            OF  =  0;
            (*AF is Undefined*)

        :param cpu: current CPU.
        :param src1: first operand.
        :param src2: second operand.
        """
        # Defined Flags: szp
        arg_3 = arg_1.read() & arg_2.read()
        arg_0.SF = (arg_3 & (1 << (arg_1.size - 1))) != 0
        arg_0.ZF = arg_3 == 0
        arg_0.PF = arg_0._calculate_parity_flag(arg_3)
        arg_0.CF = False
        arg_0.OF = False


(est_idxs, est_labels, N, frame_times, dur)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : assert arg_0 [ 0 ] == 0 and arg_0 [ - 1 ] == arg_2 - 1 assert len ( arg_0 ) - 1 == len ( arg_1 ) arg_5 = np . concatenate ( ( [ 0 ] , arg_3 [ arg_0 ] , [ arg_4 ] ) ) arg_6 = np . max ( arg_1 ) + 1 arg_1 = np . concatenate ( ( [ arg_6 ] , arg_1 , [ arg_6 ] ) ) arg_5 , arg_1 = remove_empty_segments ( arg_5 , arg_1 ) assert np . allclose ( [ arg_5 [ 0 ] ] , [ 0 ] ) and np . allclose ( [ arg_5 [ - 1 ] ] , [ arg_4 ] ) return arg_5 , arg_1

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Processes a level of segmentation, and converts it into times.

    Parameters
    ----------
    est_idxs: np.array
        Estimated boundaries in frame indeces.
    est_labels: np.array
        Estimated labels.
    N: int
        Number of frames in the whole track.
    frame_times: np.array
        Time stamp for each frame.
    dur: float
        Duration of the audio track.

    Returns
    -------
    est_times: np.array
        Estimated segment boundaries in seconds.
    est_labels: np.array
        Estimated labels for each segment.
    """
    assert arg_0[0] == 0 and arg_0[-1] == arg_2 - 1
    assert len(arg_0) - 1 == len(arg_1)

    # Add silences, if needed
    arg_5 = np.concatenate(([0], arg_3[arg_0], [arg_4]))
    arg_6 = np.max(arg_1) + 1
    arg_1 = np.concatenate(([arg_6], arg_1, [arg_6]))

    # Remove empty segments if needed
    arg_5, arg_1 = remove_empty_segments(arg_5, arg_1)

    # Make sure that the first and last times are 0 and duration, respectively
    assert np.allclose([arg_5[0]], [0]) and \
        np.allclose([arg_5[-1]], [arg_4])

    return arg_5, arg_1

Processes a level of segmentation and converts it into times .


def Func ( arg_0 , arg_1 ) : return Droplet . get_object ( api_token = arg_0 . token , arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """
            Return a Droplet by its ID.
        """
        return Droplet.get_object(api_token=arg_0.token, arg_1=arg_1)


def
Func
(
arg_0
)
:
@
functools
.
wraps
(
arg_0
)
async
def
wrapper
(
arg_1
,
arg_2
,
arg_3
)
:
try
:
await
arg_0
(
arg_1
,
arg_2
,
arg_3
)
except
asyncio
.
CancelledError
:
arg_2
.
response
(
"426"
,
"transfer aborted"
)
arg_2
.
response
(
"226"
,
"abort successful"
)
return
wrapper

def Func(arg_0):
    """
    Decorator. Abortable Func. If wrapped task will be cancelled by
    dispatcher, decorator will send ftp codes of successful interrupt.

    ::

        >>> @Func
        ... async def Func(self, connection, rest):
        ...     ...

    """
    @functools.wraps(arg_0)
    async def wrapper(arg_1, arg_2, arg_3):
        try:
            await arg_0(arg_1, arg_2, arg_3)
        except asyncio.CancelledError:
            arg_2.response("426", "transfer aborted")
            arg_2.response("226", "abort successful")

    return wrapper

Decorator. Abortable worker. If wrapped task will be cancelled by
    dispatcher, decorator will send ftp codes of successful interrupt.

    ::

        >>> @worker
        ... async def worker(self, connection, rest):
        ...     ...

Decorator . Abortable worker . If wrapped task will be cancelled by dispatcher decorator will send ftp codes of successful interrupt .


def
Func
(
arg_0
)
:
if
(
arg_0
.
_validation_iterator
is
)
or
(
arg_0
.
_Func
is
)
:
raise
AttributeError
(
'Validation is not setup.'
)
arg_1
=
0.0
arg_2
=
[
0.0
]
*
len
(
arg_0
.
_Func
)
arg_0
.
_sess
.
run
(
arg_0
.
_validation_iterator
.
initializer
)
while
True
:
try
:
arg_3
=
arg_0
.
_sess
.
run
(
arg_0
.
_Func
)
for
arg_4
,
arg_5
in
enumerate
(
arg_3
)
:
arg_2
[
arg_4
]
+=
arg_5
arg_1
+=
1.0
except
tf
.
errors
.
OutOfRangeError
:
break
for
arg_4
,
arg_5
in
enumerate
(
arg_2
)
:
arg_2
[
arg_4
]
=
arg_2
[
arg_4
]
/
arg_1
return
zip
(
arg_0
.
_Func
,
arg_2
)

def Func(arg_0):
        """A helper function to compute validation related metrics"""

        if (arg_0._validation_iterator is None) or (arg_0._Func is None):
            raise AttributeError('Validation is not setup.')

        arg_1 = 0.0
        arg_2 = [0.0] * len(arg_0._Func)
        arg_0._sess.run(arg_0._validation_iterator.initializer)
        while True:
            try:
                arg_3 = arg_0._sess.run(arg_0._Func)
                for arg_4, arg_5 in enumerate(arg_3):
                    arg_2[arg_4] += arg_5
                arg_1 += 1.0
            except tf.errors.OutOfRangeError:
                break
        for arg_4, arg_5 in enumerate(arg_2):
            arg_2[arg_4] = arg_2[arg_4] / arg_1
        return zip(arg_0._Func, arg_2)


(to, subject, html_content,
               files=None, dryrun=False, cc=None, bcc=None,
               mime_subtype='mixed', mime_charset='utf-8', **kwargs)

return backend(to, subject, html_content, files=files,
                   dryrun=dryrun, cc=cc, bcc=bcc,
                   mime_subtype=mime_subtype, mime_charset=mime_charset, **kwargs)

def Func(arg_0, arg_1, arg_2,
               arg_3=None, arg_4=False, arg_5=None, arg_6=None,
               arg_7='mixed', arg_8='utf-8', **arg_9):
    """
    Send email using backend specified in EMAIL_BACKEND.
    """
    arg_10, arg_11 = configuration.conf.get('email', 'EMAIL_BACKEND').rsplit('.', 1)
    arg_12 = importlib.import_module(arg_10)
    arg_13 = getattr(arg_12, arg_11)
    arg_0 = get_email_address_list(arg_0)
    arg_0 = ", ".join(arg_0)

    return arg_13(arg_0, arg_1, arg_2, arg_3=arg_3,
                   arg_4=arg_4, arg_5=arg_5, arg_6=arg_6,
                   arg_7=arg_7, arg_8=arg_8, **arg_9)

Send email using backend specified in EMAIL_BACKEND .


def Func ( arg_0 , arg_1 , arg_2 = '' , arg_3 = None ) : arg_4 = hmac . new ( _helpers . _to_bytes ( arg_0 , encoding = 'utf-8' ) ) arg_4 . update ( _helpers . _to_bytes ( str ( arg_1 ) , encoding = 'utf-8' ) ) arg_4 . update ( DELIMITER ) arg_4 . update ( _helpers . _to_bytes ( arg_2 , encoding = 'utf-8' ) ) arg_4 . update ( DELIMITER ) arg_3 = _helpers . _to_bytes ( str ( arg_3 or int ( time . time ( ) ) ) , encoding = 'utf-8' ) arg_4 . update ( arg_3 ) arg_5 = arg_4 . digest ( ) arg_6 = base64 . urlsafe_b64encode ( arg_5 + DELIMITER + arg_3 ) return arg_6

def Func(arg_0, arg_1, arg_2='', arg_3=None):
    """Generates a URL-safe token for the given user, action, time tuple.

    Args:
        key: secret key to use.
        user_id: the user ID of the authenticated user.
        action_id: a string identifier of the action they requested
                   authorization for.
        when: the time in seconds since the epoch at which the user was
              authorized for this action. If not set the current time is used.

    Returns:
        A string XSRF protection token.
    """
    arg_4 = hmac.new(_helpers._to_bytes(arg_0, encoding='utf-8'))
    arg_4.update(_helpers._to_bytes(str(arg_1), encoding='utf-8'))
    arg_4.update(DELIMITER)
    arg_4.update(_helpers._to_bytes(arg_2, encoding='utf-8'))
    arg_4.update(DELIMITER)
    arg_3 = _helpers._to_bytes(str(arg_3 or int(time.time())), encoding='utf-8')
    arg_4.update(arg_3)
    arg_5 = arg_4.digest()

    arg_6 = base64.urlsafe_b64encode(arg_5 + DELIMITER + arg_3)
    return arg_6

Generates a URL - safe token for the given user action time tuple .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
'input'
)
:
if
arg_0
.
log_active
and
arg_1
:
arg_3
=
arg_0
.
logfile
.
write
if
arg_2
==
'input'
:
if
arg_0
.
timestamp
:
arg_3
(
str_to_unicode
(
time
.
strftime
(
'# %a, %d %b %Y %H:%M:%S\n'
,
time
.
localtime
(
)
)
)
)
arg_3
(
arg_1
)
elif
arg_2
==
'output'
and
arg_0
.
log_output
:
arg_4
=
u'\n'
.
join
(
[
u'#[Out]# %s'
%
s
for
s
in
arg_1
.
splitlines
(
)
]
)
arg_3
(
u'%s\n'
%
arg_4
)
arg_0
.
logfile
.
flush
(
)

def Func(arg_0, arg_1, arg_2='input'):
        """Write data to the log file, if active"""

        #print 'data: %r' % data # dbg
        if arg_0.log_active and arg_1:
            arg_3 = arg_0.logfile.write
            if arg_2=='input':
                if arg_0.timestamp:
                    arg_3(str_to_unicode(time.strftime('# %a, %d %b %Y %H:%M:%S\n',
                                        time.localtime())))
                arg_3(arg_1)
            elif arg_2=='output' and arg_0.log_output:
                arg_4 = u'\n'.join([u'#[Out]# %s' % s
                                   for s in arg_1.splitlines()])
                arg_3(u'%s\n' % arg_4)
            arg_0.logfile.flush()


def Func ( arg_0 , arg_1 = None ) : arg_2 = vars ( arg_0 . create_argument_parser ( ) . parse_args ( arg_1 ) ) arg_3 = None if arg_0 . requires_seed : arg_4 = arg_2 . pop ( 'seed_file' ) arg_3 = ( arg_0 . seed_from_filepath ( arg_4 ) if arg_4 else arg_0 . prompt_for_seed ( ) ) arg_2 [ 'api' ] = Iota ( adapter = arg_2 . pop ( 'uri' ) , arg_3 = arg_3 , testnet = arg_2 . pop ( 'testnet' ) , ) return arg_2

def Func(arg_0, arg_1=None):
        # type: (Optional[tuple]) -> dict
        """
        Parses arguments for the command.

        :param argv:
            Arguments to pass to the argument parser.
            If ``None``, defaults to ``sys.argv[1:]``.
        """
        arg_2 = vars(arg_0.create_argument_parser().parse_args(arg_1))

        arg_3 = None
        if arg_0.requires_seed:
            arg_4 = arg_2.pop('seed_file')

            arg_3 = (
                arg_0.seed_from_filepath(arg_4)
                if arg_4
                else arg_0.prompt_for_seed()
            )

        arg_2['api'] = Iota(
            adapter=arg_2.pop('uri'),
            arg_3=arg_3,
            testnet=arg_2.pop('testnet'),
        )

        return arg_2


(data, gene_sets, cls, outdir='GSEA_', min_size=15, max_size=500, permutation_num=1000,
          weighted_score_type=1,permutation_type='gene_set', method='log2_ratio_of_classes',
	      ascending=False, processes=1, figsize=(6.5,6), format='pdf',
          graph_num=20, no_plot=False, seed=None, verbose=False)

def Func(arg_0, arg_1, arg_2, arg_3='GSEA_', arg_4=15, arg_5=500, arg_6=1000,
          arg_7=1,arg_8='gene_set', arg_9='log2_ratio_of_classes',
	      arg_10=False, arg_11=1, arg_12=(6.5,6), arg_13='pdf',
          arg_14=20, arg_15=False, arg_16=None, arg_17=False):
    """ Run Gene Set Enrichment Analysis.

    :param data: Gene expression data table, Pandas DataFrame, gct file.
    :param gene_sets: Enrichr Library name or .gmt gene sets file or dict of gene sets. Same input with GSEA.
    :param cls: A list or a .cls file format required for GSEA.
    :param str outdir: Results output directory.
    :param int permutation_num: Number of permutations for significance computation. Default: 1000.
    :param str permutation_type: Permutation type, "phenotype" for phenotypes, "gene_set" for genes.
    :param int min_size: Minimum allowed number of genes from gene set also the data set. Default: 15.
    :param int max_size: Maximum allowed number of genes from gene set also the data set. Default: 500.
    :param float weighted_score_type: Refer to :func:`algorithm.enrichment_score`. Default:1.
    :param method:  The method used to calculate a correlation or ranking. Default: 'log2_ratio_of_classes'.
                   Others methods are:

                   1. 'signal_to_noise'

                      You must have at least three samples for each phenotype to use this metric.
                      The larger the signal-to-noise ratio, the larger the differences of the means (scaled by the standard deviations);
                      that is, the more distinct the gene expression is in each phenotype and the more the gene acts as a “class marker.”

                   2. 't_test'

                      Uses the difference of means scaled by the standard deviation and number of samples.
                      Note: You must have at least three samples for each phenotype to use this metric.
                      The larger the tTest ratio, the more distinct the gene expression is in each phenotype
                      and the more the gene acts as a “class marker.”

                   3. 'ratio_of_classes' (also referred to as fold change).

                      Uses the ratio of class means to calculate fold change for natural scale data.

                   4. 'diff_of_classes'

                      Uses the difference of class means to calculate fold change for nature scale data

                   5. 'log2_ratio_of_classes'

                      Uses the log2 ratio of class means to calculate fold change for natural scale data.
                      This is the recommended statistic for calculating fold change for log scale data.

    :param bool ascending: Sorting order of rankings. Default: False.
    :param int processes: Number of Processes you are going to use. Default: 1.
    :param list figsize: Matplotlib figsize, accept a tuple or list, e.g. [width,height]. Default: [6.5,6].
    :param str format: Matplotlib figure format. Default: 'pdf'.
    :param int graph_num: Plot graphs for top sets of each phenotype.
    :param bool no_plot: If equals to True, no figure will be drawn. Default: False.
    :param seed: Random seed. expect an integer. Default:None.
    :param bool verbose: Bool, increase output verbosity, print out progress of your job, Default: False.

    :return: Return a GSEA obj. All results store to a dictionary, obj.results,
             where contains::

                 | {es: enrichment score,
                 |  nes: normalized enrichment score,
                 |  p: P-value,
                 |  fdr: FDR,
                 |  size: gene set size,
                 |  matched_size: genes matched to the data,
                 |  genes: gene names from the data set
                 |  ledge_genes: leading edge genes}

    """
    arg_18 = GSEA(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6,
              arg_7, arg_8, arg_9, arg_10, arg_11,
               arg_12, arg_13, arg_14, arg_15, arg_16, arg_17)
    arg_18.run()

    return arg_18


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
title
arg_2
=
arg_0
.
title
arg_3
=
arg_0
.
nblocks
arg_4
=
arg_0
.
_silent
arg_5
=
arg_0
.
marquee
for
arg_6
,
arg_7
in
enumerate
(
arg_0
.
src_blocks_colored
)
:
if
arg_4
[
arg_6
]
:
print
>>
io
.
stdout
,
arg_5
(
'<%s> SILENT block # %s (%s remaining)'
%
(
arg_2
,
arg_6
,
arg_3
arg_6
1
)
)
else
:
print
>>
io
.
stdout
,
arg_5
(
'<%s> block # %s (%s remaining)'
%
(
arg_2
,
arg_6
,
arg_3
arg_6
1
)
)
print
>>
io
.
stdout
,
arg_7
,
sys
.
stdout
.
flush
(
)

def Func(arg_0):
        """Show entire demo on screen, block by block"""

        arg_1 = arg_0.title
        arg_2 = arg_0.title
        arg_3 = arg_0.nblocks
        arg_4 = arg_0._silent
        arg_5 = arg_0.marquee
        for arg_6,arg_7 in enumerate(arg_0.src_blocks_colored):
            if arg_4[arg_6]:
                print >>io.stdout, arg_5('<%s> SILENT block # %s (%s remaining)' %
                              (arg_2,arg_6,arg_3-arg_6-1))
            else:
                print >>io.stdout, arg_5('<%s> block # %s (%s remaining)' %
                              (arg_2,arg_6,arg_3-arg_6-1))
            print >>io.stdout, arg_7,
        sys.stdout.flush()

Show entire demo on screen block by block


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

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


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

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """Get 6D data with euler rotations."""
        arg_4 = []
        arg_5 = arg_4.append
        for arg_6 in range(arg_1.body_count):
            arg_3, arg_7 = QRTPacket._get_exact(
                RT6DBodyPosition, arg_2, arg_3
            )
            arg_3, arg_8 = QRTPacket._get_exact(
                RT6DBodyEuler, arg_2, arg_3
            )
            arg_5((arg_7, arg_8))
        return arg_4


def Func ( arg_0 , arg_1 = None ) : if isinstance ( arg_0 , ModuleType ) : try : return Installed ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass try : __import__ ( arg_0 ) except ImportError : pass else : try : return Installed ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass if os . path . isfile ( arg_0 ) : try : return SDist ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass try : return BDist ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass try : return Wheel ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass if os . path . isdir ( arg_0 ) : try : return Develop ( arg_0 , arg_1 ) except ( ValueError , IOError ) : pass

def Func(arg_0, arg_1=None):
    """ Try to create a Distribution 'path_or_module'.

    o 'path_or_module' may be a module object.

    o If a string, 'path_or_module' may point to an sdist file, a bdist
      file, an installed package, or a working checkout (if it contains
      PKG-INFO).

    o Return None if 'path_or_module' can't be parsed.
    """
    if isinstance(arg_0, ModuleType):
        try:
            return Installed(arg_0, arg_1)
        except (ValueError, IOError): #pragma NO COVER
            pass

    try:
        __import__(arg_0)
    except ImportError:
        pass
    else:
        try:
            return Installed(arg_0, arg_1)
        except (ValueError, IOError): #pragma NO COVER
            pass

    if os.path.isfile(arg_0):
        try:
            return SDist(arg_0, arg_1)
        except (ValueError, IOError):
            pass

        try:
            return BDist(arg_0, arg_1)
        except (ValueError, IOError): #pragma NO COVER
            pass

        try:
            return Wheel(arg_0, arg_1)
        except (ValueError, IOError): #pragma NO COVER
            pass

    if os.path.isdir(arg_0):
        try:
            return Develop(arg_0, arg_1)
        except (ValueError, IOError): #pragma NO COVER
            pass

Try to create a Distribution path_or_module . o path_or_module may be a module object .


def Func(arg_0, arg_1, arg_2=None):
        """Get the decryption for col."""
        if arg_2 is None:
            arg_2 = arg_0
        if arg_1 != arg_0.model._meta.db_table or arg_2 != arg_0:
            return DecryptedCol(
                arg_1,
                arg_0,
                arg_2
            )
        else:
            return arg_0.cached_col


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 . status == 401 : raise trolly . Unauthorised ( arg_1 , arg_2 ) if arg_2 . status != 200 : raise trolly . ResourceUnavailable ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        '''
        Check HTTP reponse for known errors
        '''
        if arg_2.status == 401:
            raise trolly.Unauthorised(arg_1, arg_2)

        if arg_2.status != 200:
            raise trolly.ResourceUnavailable(arg_1, arg_2)


def Func(arg_0):
        """Check self.data. Raise InvalidConfig on error

        :return: None
        """
        if (arg_0.data.get('content-type') or arg_0.data.get('body')) and \
                arg_0.data.get('method', '').lower() not in CONTENT_TYPE_METHODS:
            raise InvalidConfig(
                extra_body='The body/content-type option only can be used with the {} methods. The device is {}. '
                           'Check the configuration file.'.format(', '.join(CONTENT_TYPE_METHODS), arg_0.name)
            )
        arg_0.data['content-type'] = CONTENT_TYPE_ALIASES.get(arg_0.data.get('content-type'),
                                                             arg_0.data.get('content-type'))
        arg_2 = CONTENT_TYPE_ALIASES['form']
        if arg_0.data.get('body') and (arg_0.data.get('content-type') or arg_2) == arg_2:
            try:
                arg_0.data['body'] = json.loads(arg_0.data['body'])
            except JSONDecodeError:
                raise InvalidConfig(
                    extra_body='Invalid JSON body on {} device.'.format(arg_0.name)
                )

Check self . data . Raise InvalidConfig on error


def Func ( arg_0 , arg_1 , arg_2 = None ) : for arg_3 in arg_1 : if arg_3 . startswith ( '_' ) : continue arg_4 = arg_1 [ arg_3 ] if arg_4 is Namespace : continue if arg_2 : arg_3 = arg_2 + '.' + arg_3 if isinstance ( arg_4 , Namespace ) : for arg_3 , arg_4 in arg_4 . iteritems ( arg_3 ) : arg_0 . set ( arg_3 , arg_4 ) elif callable ( arg_4 ) : arg_4 = arg_4 ( ) if arg_4 is not None : arg_0 . set ( arg_3 , arg_4 ) else : arg_0 . set ( arg_3 , arg_4 )

def Func(arg_0, arg_1, arg_2=None):
        """ Updates the current configuration with the values in `conf_dict`.

            :param dict conf_dict: Dictionary of key value settings.
            :param str base_name: Base namespace for setting keys.

        """
        for arg_3 in arg_1:
            # Skip private names
            if arg_3.startswith('_'):
                continue
            arg_4 = arg_1[arg_3]
            # Skip Namespace if it's imported
            if arg_4 is Namespace:
                continue
            # Use a base namespace
            if arg_2:
                arg_3 = arg_2 + '.' + arg_3
            if isinstance(arg_4, Namespace):
                for arg_3, arg_4 in arg_4.iteritems(arg_3):
                    arg_0.set(arg_3, arg_4)
            # Automatically call any functions in the settings module, and if
            # they return a value other than None, that value becomes a setting
            elif callable(arg_4):
                arg_4 = arg_4()
                if arg_4 is not None:
                    arg_0.set(arg_3, arg_4)
            else:
                arg_0.set(arg_3, arg_4)

Updates the current configuration with the values in conf_dict .


def Func ( arg_0 ) : if not arg_0 . conn : arg_0 . conn = arg_0 . get_client_type ( 'athena' ) return arg_0 . conn

def Func(arg_0):
        """
        check if aws conn exists already or create one and return it

        :return: boto3 session
        """
        if not arg_0.conn:
            arg_0.conn = arg_0.get_client_type('athena')
        return arg_0.conn


def Func ( ) : arg_0 = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM ) try : arg_0 . connect ( ( '10.255.255.255' , 1 ) ) arg_1 = arg_0 . getsockname ( ) [ 0 ] except ( socket . error , IndexError ) : arg_1 = '127.0.0.1' finally : arg_0 . close ( ) return arg_1

def Func():
    """
    Get the default local IP address.

    From: https://stackoverflow.com/a/28950776
    """
    arg_0 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    try:
        arg_0.connect(('10.255.255.255', 1))
        arg_1 = arg_0.getsockname()[0]
    except (socket.error, IndexError):
        arg_1 = '127.0.0.1'
    finally:
        arg_0.close()

    return arg_1


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . transactions : if arg_2 . depth == 0 : arg_1 . append ( arg_2 ) return tuple ( arg_1 )

def Func(arg_0):
        """Completed human transaction"""
        arg_1 = []
        for arg_2 in arg_0.transactions:
            if arg_2.depth == 0:
                arg_1.append(arg_2)
        return tuple(arg_1)


return OrderedDict(sorted(_splitHeaders(headers), key=sort, reverse=True))

def Func ( arg_0 ) : def sort ( arg_1 ) : return float ( arg_1 [ 1 ] . get ( 'q' , 1 ) ) return OrderedDict ( sorted ( _splitHeaders ( arg_0 ) , key = sort , reverse = True ) )

def Func(arg_0):
    """
    Parse and sort an ``Accept`` header.

    The header is sorted according to the ``q`` parameter for each header value.

    @rtype: `OrderedDict` mapping `bytes` to `dict`
    @return: Mapping of media types to header parameters.
    """
    def sort(arg_1):
        return float(arg_1[1].get('q', 1))
    return OrderedDict(sorted(_splitHeaders(arg_0), key=sort, reverse=True))


def Func(arg_0):
        """
        Print operational metrics for the scheduler test.
        """
        arg_1 = settings.Session()
        arg_2 = TaskInstance
        arg_3 = (
            arg_1
            .query(arg_2)
            .filter(arg_2.dag_id.in_(DAG_IDS))
            .all()
        )
        arg_4 = [x for x in arg_3 if x.state == State.SUCCESS]
        arg_5 = [(arg_8.dag_id, arg_8.task_id, arg_8.execution_date,
                    (arg_8.queued_dttm - arg_0.start_date).total_seconds(),
                    (arg_8.start_date - arg_0.start_date).total_seconds(),
                    (arg_8.end_date - arg_0.start_date).total_seconds(),
                    arg_8.duration) for arg_8 in arg_4]
        arg_6 = pd.DataFrame(arg_5, columns=['dag_id', 'task_id',
                                                    'execution_date',
                                                    'queue_delay',
                                                    'start_delay', 'land_time',
                                                    'duration'])

        print('Performance Results')
        print('###################')
        for arg_7 in DAG_IDS:
            print('DAG {}'.format(arg_7))
            print(arg_6[arg_6['dag_id'] == arg_7])
        print('###################')
        if len(arg_3) > len(arg_4):
            print("WARNING!! The following task instances haven't completed")
            print(pd.DataFrame([(arg_8.dag_id, arg_8.task_id, arg_8.execution_date, arg_8.state)
                  for arg_8 in filter(lambda x: x.state != State.SUCCESS, arg_3)],
                  columns=['dag_id', 'task_id', 'execution_date', 'state']))

        arg_1.commit()

Print operational metrics for the scheduler test .


def Func(arg_0, *arg_1):
        """Asserts that val contains the given sequence of items in order."""
        if len(arg_1) == 0:
            raise ValueError('one or more args must be given')
        else:
            try:
                for arg_2 in xrange(len(arg_0.val) - len(arg_1) + 1):
                    for arg_3 in xrange(len(arg_1)):
                        if arg_0.val[arg_2+arg_3] != arg_1[arg_3]:
                            break
                    else:
                        return arg_0
            except TypeError:
                raise TypeError('val is not iterable')
        arg_0._err('Expected <%s> to contain sequence %s, but did not.' % (arg_0.val, arg_0._fmt_items(arg_1)))

Asserts that val contains the given sequence of items in order .


def Func(arg_0, arg_1):
        """Read the state file, if it exists.

        If this script has been run previously, resource IDs will have been written to a
        state file. On starting a run, a state file will be looked for before creating new
        infrastructure. Information on VPCs, security groups, and subnets are saved, as
        well as running instances and their states.

        AWS has a maximum number of VPCs per region per account, so we do not want to
        clutter users' AWS accounts with security groups and VPCs that will be used only
        once.
        """
        try:
            arg_2 = open(arg_1, 'r')
            arg_3 = json.load(arg_2)
            arg_0.vpc_id = arg_3['vpcID']
            arg_0.sg_id = arg_3['sgID']
            arg_0.sn_ids = arg_3['snIDs']
            arg_0.instances = arg_3['instances']
        except Exception as e:
            logger.debug("Caught exception while reading state file: {0}".format(e))
            raise e
        logger.debug("Done reading state from the local state file.")