return [
        re.compile(mask)
        for mask in masks
    ]

def Func ( arg_0 ) : if not arg_0 : arg_0 = [ ] elif not isinstance ( arg_0 , ( list , tuple ) ) : arg_0 = [ arg_0 ] return [ re . compile ( arg_1 ) for arg_1 in arg_0 ]

def Func(arg_0):
    """
    Compiles a list of regular expressions.

    :param masks: the regular expressions to compile
    :type masks: list(str) or str
    :returns: list(regular expression object)
    """

    if not arg_0:
        arg_0 = []
    elif not isinstance(arg_0, (list, tuple)):
        arg_0 = [arg_0]

    return [
        re.compile(arg_1)
        for arg_1 in arg_0
    ]

Compiles a list of regular expressions .


(self, frame_unused, event_unused, arg_unused)

def Func(arg_0, arg_1, arg_2, arg_3):
        """Called on new threads, installs the real tracer."""
        # Remove ourselves as the trace function
        sys.settrace(None)
        # Install the real tracer.
        arg_4 = arg_0._start_tracer()
        # Invoke the real trace function with the current event, to be sure
        # not to lose an event.
        if arg_4:
            arg_4 = arg_4(arg_1, arg_2, arg_3)
        # Return the new trace function to continue tracing in this scope.
        return arg_4

Called on new threads installs the real tracer .


def
Func
(
arg_0
=
'data'
)
:
arg_1
=
'celebA'
arg_2
,
arg_3
=
"img_align_celeba.zip"
,
"0B7EVK8r0v71pZjFTYXZWM3FlRnM"
arg_4
=
os
.
path
.
join
(
arg_0
,
arg_2
)
arg_5
=
os
.
path
.
join
(
arg_0
,
arg_1
)
if
os
.
path
.
exists
(
arg_5
)
:
logging
.
info
(
'[*] {} already exists'
.
format
(
arg_4
)
)
else
:
exists_or_mkdir
(
arg_0
)
download_file_from_google_drive
(
arg_3
,
arg_4
)
arg_6
=
''
with
zipfile
.
ZipFile
(
arg_4
)
as
zf
:
arg_6
=
zf
.
namelist
(
)
[
0
]
zf
.
extractall
(
arg_0
)
os
.
remove
(
arg_4
)
os
.
rename
(
os
.
path
.
join
(
arg_0
,
arg_6
)
,
arg_5
)
arg_7
=
load_file_list
(
arg_0
=
arg_5
,
regx
=
'\\.jpg'
,
printable
=
False
)
for
arg_8
,
arg_9
in
enumerate
(
arg_7
)
:
arg_7
[
arg_8
]
=
os
.
path
.
join
(
arg_5
,
arg_7
[
arg_8
]
)
return
arg_7

def Func(arg_0='data'):
    """Load CelebA dataset

    Return a list of image path.

    Parameters
    -----------
    path : str
        The path that the data is downloaded to, defaults is ``data/celebA/``.

    """
    arg_1 = 'celebA'
    arg_2, arg_3 = "img_align_celeba.zip", "0B7EVK8r0v71pZjFTYXZWM3FlRnM"
    arg_4 = os.path.join(arg_0, arg_2)
    arg_5 = os.path.join(arg_0, arg_1)
    if os.path.exists(arg_5):
        logging.info('[*] {} already exists'.format(arg_4))
    else:
        exists_or_mkdir(arg_0)
        download_file_from_google_drive(arg_3, arg_4)
        arg_6 = ''
        with zipfile.ZipFile(arg_4) as zf:
            arg_6 = zf.namelist()[0]
            zf.extractall(arg_0)
        os.remove(arg_4)
        os.rename(os.path.join(arg_0, arg_6), arg_5)

    arg_7 = load_file_list(arg_0=arg_5, regx='\\.jpg', printable=False)
    for arg_8, arg_9 in enumerate(arg_7):
        arg_7[arg_8] = os.path.join(arg_5, arg_7[arg_8])
    return arg_7


(self, origin, backend_name, category, archived_after)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = arg_0 . _Func_archives ( arg_1 , arg_2 , arg_3 , arg_4 ) arg_5 = [ ( fp , date ) for fp , date in arg_5 ] arg_5 = [ fp for fp , _ in sorted ( arg_5 , key = lambda x : x [ 1 ] ) ] return arg_5

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Search archives.

        Get the archives which store data based on the given parameters.
        These parameters define which the origin was (`origin`), how data
        was fetched (`backend_name`) and data type ('category').
        Only those archives created on or after `archived_after` will be
        returned.

        The method returns a list with the file paths to those archives.
        The list is sorted by the date of creation of each archive.

        :param origin: data origin
        :param backend_name: backed used to fetch data
        :param category: type of the items fetched by the backend
        :param archived_after: get archives created on or after this date

        :returns: a list with archive names which match the Func criteria
        """
        arg_5 = arg_0._Func_archives(arg_1, arg_2,
                                         arg_3, arg_4)
        arg_5 = [(fp, date) for fp, date in arg_5]
        arg_5 = [fp for fp, _ in sorted(arg_5, key=lambda x: x[1])]

        return arg_5

Search archives.

        Get the archives which store data based on the given parameters.
        These parameters define which the origin was (`origin`), how data
        was fetched (`backend_name`) and data type ('category').
        Only those archives created on or after `archived_after` will be
        returned.

        The method returns a list with the file paths to those archives.
        The list is sorted by the date of creation of each archive.

        :param origin: data origin
        :param backend_name: backed used to fetch data
        :param category: type of the items fetched by the backend
        :param archived_after: get archives created on or after this date

        :returns: a list with archive names which match the search criteria


def Func(arg_0, arg_1, arg_2):
        """
        Write package optional fields.
        """
        arg_0.handle_package_literal_optional(arg_1, arg_2, arg_0.spdx_namespace.versionInfo, 'version')
        arg_0.handle_package_literal_optional(arg_1, arg_2, arg_0.spdx_namespace.packageFileName, 'file_name')
        arg_0.handle_package_literal_optional(arg_1, arg_2, arg_0.spdx_namespace.supplier, 'supplier')
        arg_0.handle_package_literal_optional(arg_1, arg_2, arg_0.spdx_namespace.originator, 'originator')
        arg_0.handle_package_literal_optional(arg_1, arg_2, arg_0.spdx_namespace.sourceInfo, 'source_info')
        arg_0.handle_package_literal_optional(arg_1, arg_2, arg_0.spdx_namespace.licenseComments, 'license_comment')
        arg_0.handle_package_literal_optional(arg_1, arg_2, arg_0.spdx_namespace.summary, 'summary')
        arg_0.handle_package_literal_optional(arg_1, arg_2, arg_0.spdx_namespace.description, 'description')

        if arg_1.has_optional_field('check_sum'):
            arg_3 = arg_0.create_checksum_node(arg_1.check_sum)
            arg_0.graph.add((arg_2, arg_0.spdx_namespace.checksum, arg_3))

        if arg_1.has_optional_field('homepage'):
            arg_4 = URIRef(arg_0.to_special_value(arg_1.homepage))
            arg_5 = (arg_2, arg_0.doap_namespace.homepage, arg_4)
            arg_0.graph.add(arg_5)


async
def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
arg_0
.
_unpack_message
(
arg_1
)
logger
.
debug
(
arg_3
)
if
arg_3
.
get
(
'type'
)
==
'error'
:
raise
SlackApiError
(
arg_3
.
get
(
'error'
,
{
}
)
.
get
(
'msg'
,
str
(
arg_3
)
)
)
elif
arg_0
.
message_is_to_me
(
arg_3
)
:
arg_4
=
arg_3
[
'text'
]
[
len
(
arg_0
.
address_as
)
:
]
.
strip
(
)
if
arg_4
==
'help'
:
return
arg_0
.
_respond
(
channel
=
arg_3
[
'channel'
]
,
arg_4
=
arg_0
.
_instruction_list
(
arg_2
)
,
)
elif
arg_4
==
'version'
:
return
arg_0
.
_respond
(
channel
=
arg_3
[
'channel'
]
,
arg_4
=
arg_0
.
VERSION
,
)
for
arg_5
in
arg_2
:
if
arg_5
.
matches
(
arg_3
)
:
logger
.
debug
(
'Response triggered'
)
async
for
arg_6
in
arg_5
:
arg_0
.
_respond
(
channel
=
arg_3
[
'channel'
]
,
arg_4
=
arg_6
)

async def Func(arg_0, arg_1, arg_2):
        """Handle an incoming message appropriately.

        Arguments:
          message (:py:class:`aiohttp.websocket.Message`): The incoming
            message to handle.
          filters (:py:class:`list`): The filters to apply to incoming
            messages.

        """
        arg_3 = arg_0._unpack_message(arg_1)
        logger.debug(arg_3)
        if arg_3.get('type') == 'error':
            raise SlackApiError(
                arg_3.get('error', {}).get('msg', str(arg_3))
            )
        elif arg_0.message_is_to_me(arg_3):
            arg_4 = arg_3['text'][len(arg_0.address_as):].strip()
            if arg_4 == 'help':
                return arg_0._respond(
                    channel=arg_3['channel'],
                    arg_4=arg_0._instruction_list(arg_2),
                )
            elif arg_4 == 'version':
                return arg_0._respond(
                    channel=arg_3['channel'],
                    arg_4=arg_0.VERSION,
                )
        for arg_5 in arg_2:
            if arg_5.matches(arg_3):
                logger.debug('Response triggered')
                async for arg_6 in arg_5:
                    arg_0._respond(channel=arg_3['channel'], arg_4=arg_6)

Handle an incoming message appropriately .


def Func(arg_0,arg_1,arg_2):
		'''
		song_name is a list of strings
		website is a string
		It will return the url from where music file needs to be downloaded
		'''
		arg_3=arg_0.google_url(arg_1,arg_2)
		arg_4=FileDownload()
		arg_5=arg_4.get_html_response(arg_3)
		arg_6=arg_0.parse_google(arg_5)
		return arg_6


def
Func
(
arg_0
,
arg_1
)
:
LOG
.
debug
(
"Upserting variant %s"
,
arg_1
[
'_id'
]
)
try
:
arg_2
=
arg_0
.
variant_collection
.
insert_one
(
arg_1
)
except
DuplicateKeyError
as
err
:
LOG
.
debug
(
"Variant %s already exists in database"
,
arg_1
[
'_id'
]
)
arg_2
=
arg_0
.
variant_collection
.
find_one_and_update
(
{
'_id'
:
arg_1
[
'_id'
]
}
,
{
'$set'
:
{
'compounds'
:
arg_1
.
get
(
'compounds'
,
[
]
)
}
}
)
arg_3
=
arg_0
.
variant_collection
.
find_one
(
{
'_id'
:
arg_1
[
'_id'
]
}
)
return
arg_2

def Func(arg_0, arg_1):
        """Load a variant object, if the object already exists update compounds.

        Args:
            variant_obj(dict)

        Returns:
            result
        """
        LOG.debug("Upserting variant %s", arg_1['_id'])
        try:
            arg_2 = arg_0.variant_collection.insert_one(arg_1)
        except DuplicateKeyError as err:
            LOG.debug("Variant %s already exists in database", arg_1['_id'])
            arg_2 = arg_0.variant_collection.find_one_and_update(
                {'_id': arg_1['_id']},
                {
                    '$set': {
                        'compounds': arg_1.get('compounds',[])
                    }
                }
            )
            arg_3 = arg_0.variant_collection.find_one({'_id': arg_1['_id']})
        return arg_2

Load a variant object if the object already exists update compounds .


(obj, startindex=1, separator=DEFAULT, index_separator=DEFAULT)

def Func ( arg_0 , arg_1 = 1 , arg_2 = arg_3 , arg_4 = arg_3 ) : try : arg_5 = next ( iter ( arg_0 . keys ( ) ) ) except StopIteration : return str ( ) if isinstance ( arg_5 , six . text_type ) : arg_6 = StringIO ( ) else : arg_6 = BytesIO ( ) dump ( arg_0 = arg_0 , fp = arg_6 , arg_1 = arg_1 , arg_2 = arg_2 , arg_4 = arg_4 , ) return arg_6 . getvalue ( )

def Func(arg_0, arg_1=1, arg_2=arg_3, arg_4=arg_3):
    '''Dump an object in req format to a string.

    :param Mapping obj: The object to serialize.  Must have a keys method.
    :param separator: The separator between key and value.  Defaults to u'|' or b'|', depending on the types.
    :param index_separator: The separator between key and index.  Defaults to u'_' or b'_', depending on the types.
    '''

    try:
        arg_5 = next(iter(arg_0.keys()))
    except StopIteration:
        return str()

    if isinstance(arg_5, six.text_type):
        arg_6 = StringIO()
    else:
        arg_6 = BytesIO()

    dump(
        arg_0=arg_0,
        fp=arg_6,
        arg_1=arg_1,
        arg_2=arg_2,
        arg_4=arg_4,
        )
    return arg_6.getvalue()

Dump an object in req format to a string .


def
Func
(
arg_0
,
arg_1
=
5
,
arg_2
=
)
:
arg_2
=
arg_2
or
''
arg_3
=
time
.
time
(
)
arg_4
=
0
while
True
:
arg_5
=
arg_0
.
get
(
arg_2
)
[
'last_build_info'
]
if
not
arg_5
:
raise
ValueError
(
'This project is not building!'
)
if
arg_5
[
'stop_time'
]
:
if
arg_5
[
'success'
]
:
return
arg_5
else
:
raise
LuminosoError
(
arg_5
)
arg_6
=
time
.
time
(
)
arg_3
if
arg_6
>
arg_4
:
logger
.
info
(
'Still waiting (%d seconds elapsed).'
,
arg_4
)
arg_4
+=
120
time
.
sleep
(
arg_1
)

def Func(arg_0, arg_1=5, arg_2=None):
        """
        A convenience method designed to inform you when a project build has
        completed.  It polls the API every `interval` seconds until there is
        not a build running.  At that point, it returns the "last_build_info"
        field of the project record if the build succeeded, and raises a
        LuminosoError with the field as its message if the build failed.

        If a `path` is not specified, this method will assume that its URL is
        the URL for the project.  Otherwise, it will use the specified path
        (which should be "/projects/<project_id>/").
        """
        arg_2 = arg_2 or ''
        arg_3 = time.time()
        arg_4 = 0
        while True:
            arg_5 = arg_0.get(arg_2)['last_build_info']
            if not arg_5:
                raise ValueError('This project is not building!')
            if arg_5['stop_time']:
                if arg_5['success']:
                    return arg_5
                else:
                    raise LuminosoError(arg_5)
            arg_6 = time.time() - arg_3
            if arg_6 > arg_4:
                logger.info('Still waiting (%d seconds elapsed).', arg_4)
                arg_4 += 120
            time.sleep(arg_1)

A convenience method designed to inform you when a project build has completed . It polls the API every interval seconds until there is not a build running . At that point it returns the last_build_info field of the project record if the build succeeded and raises a LuminosoError with the field as its message if the build failed .


Lock a mutex, call the function with supplied argument
        when it is acquired.  If the mutex is already locked, place
        function and argument in the queue.

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . testandset ( ) : arg_1 ( arg_2 ) else : arg_0 . queue . append ( ( arg_1 , arg_2 ) )

def Func(arg_0, arg_1, arg_2):
        """Lock a mutex, call the function with supplied argument
        when it is acquired.  If the mutex is already Funced, place
        function and argument in the queue."""
        if arg_0.testandset():
            arg_1(arg_2)
        else:
            arg_0.queue.append((arg_1, arg_2))

Lock a mutex call the function with supplied argument when it is acquired . If the mutex is already locked place function and argument in the queue .


def Func(arg_0, arg_1):
        """Create a DeviceFlowInfo from a server response.

        The response should be a dict containing entries as described here:

        http://tools.ietf.org/html/draft-ietf-oauth-v2-05#section-3.7.1
        """
        # device_code, user_code, and verification_url are required.
        arg_2 = {
            'device_code': arg_1['device_code'],
            'user_code': arg_1['user_code'],
        }
        # The response may list the verification address as either
        # verification_url or verification_uri, so we check for both.
        arg_3 = arg_1.get(
            'verification_url', arg_1.get('verification_uri'))
        if arg_3 is None:
            raise OAuth2DeviceCodeError(
                'No verification_url provided in server response')
        arg_2['verification_url'] = arg_3
        # expires_in and interval are optional.
        arg_2.update({
            'interval': arg_1.get('interval'),
            'user_code_expiry': None,
        })
        if 'expires_in' in arg_1:
            arg_2['user_code_expiry'] = (
                _UTCNOW() +
                datetime.timedelta(seconds=int(arg_1['expires_in'])))
        return arg_0(**arg_2)

Create a DeviceFlowInfo from a server response .


(self, text, maxwidth=None, maxheight=None, resource_type=None)

return self.handle_extracted_urls(urls, maxwidth, maxheight, resource_type)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
        """
        Scans a block of text and extracts oembed data on any urls,
        returning it in a list of dictionaries
        """
        arg_5 = text_parser()
        arg_6 = arg_5.extract_urls(arg_1)
        return arg_0.handle_extracted_urls(arg_6, arg_2, arg_3, arg_4)

Scans a block of text and extracts oembed data on any urls returning it in a list of dictionaries


def Func(arg_0, arg_1):
        """This is automatically called right before the response is started
        and returns headers modified for the given environment.  It returns a
        copy of the headers from the response with some modifications applied
        if necessary.

        For example the location header (if present) is joined with the root
        URL of the environment.  Also the content length is automatically set
        to zero here for certain status codes.

        .. versionchanged:: 0.6
           Previously that function was called `fix_headers` and modified
           the response object in place.  Also since 0.6, IRIs in location
           and content-location headers are handled properly.

           Also starting with 0.6, Werkzeug will attempt to set the content
           length if it is able to figure it out on its own.  This is the
           case if all the strings in the response iterable are already
           encoded and the iterable is buffered.

        :param environ: the WSGI environment of the request.
        :return: returns a new :class:`~werkzeug.datastructures.Headers`
                 object.
        """
        arg_2 = Headers(arg_0.headers)
        arg_3 = None
        arg_4 = None
        arg_5 = None
        arg_6 = arg_0.status_code

        # iterate over the headers to find all values in one go.  Because
        # Func is used each response that gives us a tiny
        # speedup.
        for arg_7, arg_8 in arg_2:
            arg_9 = arg_7.lower()
            if arg_9 == u'location':
                arg_3 = arg_8
            elif arg_9 == u'content-location':
                arg_4 = arg_8
            elif arg_9 == u'content-length':
                arg_5 = arg_8

        # make sure the location header is an absolute URL
        if arg_3 is not None:
            arg_10 = arg_3
            if isinstance(arg_3, text_type):
                # Safe conversion is necessary here as we might redirect
                # to a broken URI scheme (for instance itms-services).
                arg_3 = iri_to_uri(arg_3, safe_conversion=True)

            if arg_0.autocorrect_location_header:
                arg_11 = get_current_url(arg_1, root_only=True)
                if isinstance(arg_11, text_type):
                    arg_11 = iri_to_uri(arg_11)
                arg_3 = url_join(arg_11, arg_3)
            if arg_3 != arg_10:
                arg_2['Location'] = arg_3

        # make sure the content location is a URL
        if arg_4 is not None and \
           isinstance(arg_4, text_type):
            arg_2['Content-Location'] = iri_to_uri(arg_4)

        # remove entity headers and set content length to zero if needed.
        # Also update content_length accordingly so that the automatic
        # content length detection does not trigger in the following
        # code.
        if 100 <= arg_6 < 200 or arg_6 == 204:
            arg_2['Content-Length'] = arg_5 = u'0'
        elif arg_6 == 304:
            remove_entity_headers(arg_2)

        # if we can determine the content length automatically, we
        # should try to do that.  But only if this does not involve
        # flattening the iterator or encoding of unicode strings in
        # the response.  We however should not do that if we have a 304
        # response.
        if arg_0.automatically_set_content_length and \
           arg_0.is_sequence and arg_5 is None and arg_6 != 304:
            try:
                arg_5 = sum(len(to_bytes(x, 'ascii'))
                                     for x in arg_0.response)
            except UnicodeError:
                # aha, something non-bytestringy in there, too bad, we
                # can't safely figure out the length of the response.
                pass
            else:
                arg_2['Content-Length'] = str(arg_5)

        return arg_2

This is automatically called right before the response is started and returns headers modified for the given environment . It returns a copy of the headers from the response with some modifications applied if necessary .


def Func(arg_0, arg_1):
        """Finalize closing."""
        try:
            arg_0._protocol.connection_lost(arg_1)
        finally:
            os.close(arg_0._fileno)
            arg_0._fileno = None
            arg_0._protocol = None
            arg_0._loop = None


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 . name , c_ast . ArrayRef ) : return arg_0 . Func ( arg_1 . name ) elif isinstance ( arg_1 . name , str ) : return arg_1 . name else : return arg_1 . name . name

def Func(arg_0, arg_1):
        """
        Return base name of ArrayRef object.

        e.g. c[i+1][j-2] -> 'c'
        """
        if isinstance(arg_1.name, c_ast.ArrayRef):
            return arg_0.Func(arg_1.name)
        elif isinstance(arg_1.name, str):
            return arg_1.name
        else:
            return arg_1.name.name


(
            self,
            transfers,  # type: Iterable[ProposedTransaction]
            depth=3,  # type: int
            inputs=None,  # type: Optional[Iterable[Address]]
            change_address=None,  # type: Optional[Address]
            min_weight_magnitude=None,  # type: Optional[int]
            security_level=None,  # type: Optional[int]
    )

return extended.SendTransferCommand(self.adapter)(
            seed=self.seed,
            depth=depth,
            transfers=transfers,
            inputs=inputs,
            changeAddress=change_address,
            minWeightMagnitude=min_weight_magnitude,
            securityLevel=security_level,
        )

def Func ( arg_0 , arg_1 , arg_2 = 3 , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , ) : if arg_5 is None : arg_5 = arg_0 . default_min_weight_magnitude return extended . SendTransferCommand ( arg_0 . adapter ) ( seed = arg_0 . seed , arg_2 = arg_2 , arg_1 = arg_1 , arg_3 = arg_3 , changeAddress = arg_4 , minWeightMagnitude = arg_5 , securityLevel = arg_6 , )

def Func(
            arg_0,
            arg_1,  # type: Iterable[ProposedTransaction]
            arg_2=3,  # type: int
            arg_3=None,  # type: Optional[Iterable[Address]]
            arg_4=None,  # type: Optional[Address]
            arg_5=None,  # type: Optional[int]
            arg_6=None,  # type: Optional[int]
    ):
        # type: (...) -> dict
        """
        Prepares a set of transfers and creates the bundle, then
        attaches the bundle to the Tangle, and broadcasts and stores the
        transactions.

        :param transfers:
            Transfers to include in the bundle.

        :param depth:
            Depth at which to attach the bundle.
            Defaults to 3.

        :param inputs:
            List of inputs used to fund the transfer.
            Not needed for zero-value transfers.

        :param change_address:
            If inputs are provided, any unspent amount will be sent to
            this address.

            If not specified, a change address will be generated
            automatically.

        :param min_weight_magnitude:
            Min weight magnitude, used by the node to calibrate Proof of
            Work.

            If not provided, a default value will be used.

        :param security_level:
            Number of iterations to use when generating new addresses
            (see :py:meth:`get_new_addresses`).

            This value must be between 1 and 3, inclusive.

            If not set, defaults to
            :py:attr:`AddressGenerator.DEFAULT_SECURITY_LEVEL`.

        :return:
            Dict with the following structure::

                {
                    'bundle': Bundle,
                        The newly-published bundle.
                }

        References:

        - https://github.com/iotaledger/wiki/blob/master/api-proposal.md#sendtransfer
        """
        if arg_5 is None:
            arg_5 = arg_0.default_min_weight_magnitude

        return extended.SendTransferCommand(arg_0.adapter)(
            seed=arg_0.seed,
            arg_2=arg_2,
            arg_1=arg_1,
            arg_3=arg_3,
            changeAddress=arg_4,
            minWeightMagnitude=arg_5,
            securityLevel=arg_6,
        )

Prepares a set of transfers and creates the bundle then attaches the bundle to the Tangle and broadcasts and stores the transactions .


(objective_function,
                  simplex,
                  objective_values,
                  worst_index,
                  reflected,
                  objective_at_reflected,
                  face_centroid,
                  expansion)

def Func(arg_0,
                  arg_1,
                  arg_2,
                  arg_3,
                  arg_4,
                  arg_5,
                  arg_6,
                  arg_7):
  """Creates the condition function pair for an expansion."""
  def _expand_and_maybe_replace():
    """Performs the expansion step."""
    arg_8 = arg_6 + arg_7 * (arg_4 - arg_6)
    arg_9 = arg_0(arg_8)
    arg_10 = (arg_9 <
                          arg_5)
    arg_11 = lambda: (arg_8, arg_9)
    arg_12 = lambda: (arg_4, arg_5)
    arg_13, arg_14 = prefer_static.cond(
        arg_10, arg_11, arg_12)
    arg_15 = _replace_at_index(arg_1, arg_3, arg_13)
    arg_16 = _replace_at_index(arg_2,
                                                  arg_3,
                                                  arg_14)
    return False, arg_15, arg_16, 1
  return _expand_and_maybe_replace

Creates the condition function pair for an expansion .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = Match ( r'^.*(\b\S+)$' , arg_2 ) if arg_3 : arg_4 = arg_3 . group ( 1 ) else : arg_4 = arg_2 if _TYPES . match ( arg_4 ) : return True arg_5 = ( r'\b(?:typename|class|struct)\s+' + re . escape ( arg_4 ) + r'\b' ) arg_6 = len ( arg_1 . stack ) - 1 while arg_6 >= 0 : if isinstance ( arg_1 . stack [ arg_6 ] , _NamespaceInfo ) : return False arg_7 = arg_1 . stack [ arg_6 ] . starting_linenum arg_8 = 0 if arg_6 > 0 : arg_8 = arg_1 . stack [ arg_6 - 1 ] . starting_linenum arg_9 = arg_7 while arg_9 >= arg_8 : if arg_0 . elided [ arg_9 ] . find ( 'template' ) >= 0 : break arg_9 -= 1 if arg_9 < arg_8 : arg_6 -= 1 continue for arg_10 in xrange ( arg_9 , arg_7 + 1 , 1 ) : if Search ( arg_5 , arg_0 . elided [ arg_10 ] ) : return True arg_6 -= 1 return False

def Func(arg_0, arg_1, arg_2):
  """Check if expression looks like a type name, returns true if so.

  Args:
    clean_lines: A CleansedLines instance containing the file.
    nesting_state: A NestingState instance which maintains information about
                   the current stack of nested blocks being parsed.
    expr: The expression to check.
  Returns:
    True, if token looks like a type.
  """
  # Keep only the last token in the expression
  arg_3 = Match(r'^.*(\b\S+)$', arg_2)
  if arg_3:
    arg_4 = arg_3.group(1)
  else:
    arg_4 = arg_2

  # Match native types and stdint types
  if _TYPES.match(arg_4):
    return True

  # Try a bit harder to match templated types.  Walk up the nesting
  # stack until we find something that resembles a typename
  # declaration for what we are looking for.
  arg_5 = (r'\b(?:typename|class|struct)\s+' + re.escape(arg_4) +
                      r'\b')
  arg_6 = len(arg_1.stack) - 1
  while arg_6 >= 0:
    if isinstance(arg_1.stack[arg_6], _NamespaceInfo):
      return False

    # Found where the opening brace is.  We want to scan from this
    # line up to the beginning of the function, minus a few lines.
    #   template <typename Type1,  // stop scanning here
    #             ...>
    #   class C
    #     : public ... {  // start scanning here
    arg_7 = arg_1.stack[arg_6].starting_linenum

    arg_8 = 0
    if arg_6 > 0:
      arg_8 = arg_1.stack[arg_6 - 1].starting_linenum
    arg_9 = arg_7
    while arg_9 >= arg_8:
      if arg_0.elided[arg_9].find('template') >= 0:
        break
      arg_9 -= 1
    if arg_9 < arg_8:
      # Didn't find any "template" keyword before reaching the next block,
      # there are probably no template things to check for this block
      arg_6 -= 1
      continue

    # Look for typename in the specified range
    for arg_10 in xrange(arg_9, arg_7 + 1, 1):
      if Search(arg_5, arg_0.elided[arg_10]):
        return True
    arg_6 -= 1

  return False

Check if expression looks like a type name returns true if so .


def
Func
(
arg_0
)
:
arg_1
=
{
}
arg_2
=
[
]
for
arg_3
in
arg_0
.
services
:
arg_4
,
arg_5
=
arg_0
.
_extract_path_from_service
(
arg_3
)
arg_6
=
getattr
(
arg_3
,
'tags'
,
[
]
)
arg_0
.
_check_tags
(
arg_6
)
arg_2
=
arg_0
.
_get_tags
(
arg_2
,
arg_6
)
for
arg_7
,
arg_8
,
arg_9
in
arg_3
.
definitions
:
if
arg_7
.
lower
(
)
in
map
(
str
.
lower
,
arg_0
.
ignore_methods
)
:
continue
arg_10
=
arg_0
.
_extract_operation_from_view
(
arg_8
,
arg_9
)
if
any
(
arg_11
in
arg_10
.
get
(
'consumes'
,
[
]
)
for
arg_11
in
arg_0
.
ignore_ctypes
)
:
continue
arg_12
=
arg_5
.
get
(
arg_7
.
lower
(
)
)
if
arg_12
:
raise
CorniceSwaggerException
(
(
"Swagger doesn't support multiple "
"views for a same method. You may "
"ignore one."
)
)
if
'tags'
not
in
arg_10
and
arg_0
.
default_tags
:
if
callable
(
arg_0
.
default_tags
)
:
arg_10
[
'tags'
]
=
arg_0
.
default_tags
(
arg_3
,
arg_7
)
else
:
arg_10
[
'tags'
]
=
arg_0
.
default_tags
arg_13
=
arg_10
.
get
(
'tags'
,
[
]
)
arg_0
.
_check_tags
(
arg_13
)
if
arg_6
:
arg_14
=
arg_6
+
arg_13
arg_10
[
'tags'
]
=
list
(
OrderedDict
.
fromkeys
(
arg_14
)
)
arg_2
=
arg_0
.
_get_tags
(
arg_2
,
arg_13
)
if
'operationId'
not
in
arg_10
and
arg_0
.
default_op_ids
:
if
not
callable
(
arg_0
.
default_op_ids
)
:
raise
CorniceSwaggerException
(
'default_op_id should be a callable.'
)
arg_10
[
'operationId'
]
=
arg_0
.
default_op_ids
(
arg_3
,
arg_7
)
if
'security'
not
in
arg_10
and
arg_0
.
default_security
:
if
callable
(
arg_0
.
default_security
)
:
arg_10
[
'security'
]
=
arg_0
.
default_security
(
arg_3
,
arg_7
)
else
:
arg_10
[
'security'
]
=
arg_0
.
default_security
if
not
isinstance
(
arg_10
.
get
(
'security'
,
[
]
)
,
list
)
:
raise
CorniceSwaggerException
(
'security should be a list or callable'
)
arg_5
[
arg_7
.
lower
(
)
]
=
arg_10
arg_1
[
arg_4
]
=
arg_5
return
arg_1
,
arg_2

def Func(arg_0):
        """
        Build the Swagger "paths" and "tags" attributes from cornice service
        definitions.
        """
        arg_1 = {}
        arg_2 = []

        for arg_3 in arg_0.services:
            arg_4, arg_5 = arg_0._extract_path_from_service(arg_3)

            arg_6 = getattr(arg_3, 'tags', [])
            arg_0._check_tags(arg_6)
            arg_2 = arg_0._get_tags(arg_2, arg_6)

            for arg_7, arg_8, arg_9 in arg_3.definitions:

                if arg_7.lower() in map(str.lower, arg_0.ignore_methods):
                    continue

                arg_10 = arg_0._extract_operation_from_view(arg_8, arg_9)

                if any(arg_11 in arg_10.get('consumes', []) for arg_11 in arg_0.ignore_ctypes):
                    continue

                # XXX: Swagger doesn't support different schemas for for a same method
                # with different ctypes as cornice. If this happens, you may ignore one
                # content-type from the documentation otherwise we raise an Exception
                # Related to https://github.com/OAI/OpenAPI-Specification/issues/146
                arg_12 = arg_5.get(arg_7.lower())
                if arg_12:
                    raise CorniceSwaggerException(("Swagger doesn't support multiple "
                                                   "views for a same method. You may "
                                                   "ignore one."))

                # If tag not defined and a default tag is provided
                if 'tags' not in arg_10 and arg_0.default_tags:
                    if callable(arg_0.default_tags):
                        arg_10['tags'] = arg_0.default_tags(arg_3, arg_7)
                    else:
                        arg_10['tags'] = arg_0.default_tags

                arg_13 = arg_10.get('tags', [])
                arg_0._check_tags(arg_13)

                # Add service tags
                if arg_6:
                    arg_14 = arg_6 + arg_13
                    arg_10['tags'] = list(OrderedDict.fromkeys(arg_14))

                # Add method tags to root tags
                arg_2 = arg_0._get_tags(arg_2, arg_13)

                # If operation id is not defined and a default generator is provided
                if 'operationId' not in arg_10 and arg_0.default_op_ids:
                    if not callable(arg_0.default_op_ids):
                        raise CorniceSwaggerException('default_op_id should be a callable.')
                    arg_10['operationId'] = arg_0.default_op_ids(arg_3, arg_7)

                # If security options not defined and default is provided
                if 'security' not in arg_10 and arg_0.default_security:
                    if callable(arg_0.default_security):
                        arg_10['security'] = arg_0.default_security(arg_3, arg_7)
                    else:
                        arg_10['security'] = arg_0.default_security

                if not isinstance(arg_10.get('security', []), list):
                    raise CorniceSwaggerException('security should be a list or callable')

                arg_5[arg_7.lower()] = arg_10
            arg_1[arg_4] = arg_5

        return arg_1, arg_2

Build the Swagger paths and tags attributes from cornice service definitions .


(
    config, mode="continue", zoom=None, bounds=None, single_input_file=None,
    with_cache=False, debug=False
)

return Mapchete(
        MapcheteConfig(
            config, mode=mode, zoom=zoom, bounds=bounds,
            single_input_file=single_input_file, debug=debug),
        with_cache=with_cache)

def Func(
    arg_0, arg_1="continue", arg_2=None, arg_3=None, arg_4=None,
    arg_5=False, arg_6=False
):
    """
    Open a Mapchete process.

    Parameters
    ----------
    config : MapcheteConfig object, config dict or path to mapchete file
        Mapchete process configuration
    mode : string
        * ``memory``: Generate process output on demand without reading
          pre-existing data or writing new data.
        * ``readonly``: Just read data without processing new data.
        * ``continue``: (default) Don't overwrite existing output.
        * ``overwrite``: Overwrite existing output.
    zoom : list or integer
        process zoom level or a pair of minimum and maximum zoom level
    bounds : tuple
        left, bottom, right, top process boundaries in output pyramid
    single_input_file : string
        single input file if supported by process
    with_cache : bool
        process output data cached in memory

    Returns
    -------
    Mapchete
        a Mapchete process object
    """
    return Mapchete(
        MapcheteConfig(
            arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3,
            arg_4=arg_4, arg_6=arg_6),
        arg_5=arg_5)


return [
        DAGNode({'op': SwapGate(), 'qargs': qreg_edge, 'cargs': [], 'type': 'op'})
    ]

def Func ( arg_0 , arg_1 ) : arg_2 = QuantumRegister ( len ( arg_1 . get_physical_bits ( ) ) , 'q' ) arg_3 = [ ( arg_2 , i ) for i in arg_0 ] return [ DAGNode ( { 'op' : SwapGate ( ) , 'qargs' : arg_3 , 'cargs' : [ ] , 'type' : 'op' } ) ]

def Func(arg_0, arg_1):
    """Generate list of ops to implement a SWAP gate along a coupling edge."""

    arg_2 = QuantumRegister(len(arg_1.get_physical_bits()), 'q')
    arg_3 = [(arg_2, i) for i in arg_0]

    # TODO shouldn't be making other nodes not by the DAG!!
    return [
        DAGNode({'op': SwapGate(), 'qargs': arg_3, 'cargs': [], 'type': 'op'})
    ]

Generate list of ops to implement a SWAP gate along a coupling edge .


return ''.join(label_char_transform(c) for c in suffix)

def Func ( arg_0 ) : arg_1 = string . ascii_letters + string . digits + '_.-' def label_char_transform ( arg_2 ) : if arg_2 in arg_1 : return arg_2 return '-' return '' . join ( label_char_transform ( arg_3 ) for arg_3 in arg_0 )

def Func(arg_0):
  """Rewrite string so that all characters are valid in a docker name suffix."""
  # Docker container names must match: [a-zA-Z0-9][a-zA-Z0-9_.-]
  arg_1 = string.ascii_letters + string.digits + '_.-'

  def label_char_transform(arg_2):
    if arg_2 in arg_1:
      return arg_2
    return '-'

  return ''.join(label_char_transform(arg_3) for arg_3 in arg_0)

Rewrite string so that all characters are valid in a docker name suffix .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = r"domain=(.*)" for arg_4 in arg_1 : try : arg_5 = Regex ( arg_4 , arg_3 , return_data = True , rematch = True , group = 0 ) . match ( ) [ - 1 ] if arg_5 : if arg_0 . aggressive : arg_2 . extend ( [ arg_6 for arg_6 in arg_5 . split ( "|" ) if arg_6 and not arg_6 . startswith ( "~" ) ] ) else : return True except TypeError : pass return arg_2

def Func(arg_0, arg_1):
        """
        Handle the data from the options.

        :param options: The list of options from the rule.
        :type options: list

        :return: The list of domains to return globally.
        :rtype: list
        """

        # We initiate a variable which will save our result
        arg_2 = []

        # We initiate the regex which will be used to extract the domain listed
        # under the option domain=
        arg_3 = r"domain=(.*)"

        for arg_4 in arg_1:
            # We loop through the list of option.
            try:
                # We try to extract the list of domains from the currently read
                # option.
                arg_5 = Regex(
                    arg_4, arg_3, return_data=True, rematch=True, group=0
                ).match()[-1]

                if arg_5:
                    # We could extract something.

                    if arg_0.aggressive:  # pragma: no cover
                        arg_2.extend(
                            [
                                arg_6
                                for arg_6 in arg_5.split("|")
                                if arg_6 and not arg_6.startswith("~")
                            ]
                        )
                    else:
                        # We return True.
                        return True
            except TypeError:
                pass

        # We return the result.
        return arg_2


(is_returns, num_days,
                   starting_value=1, num_samples=1000, random_seed=None)

def Func ( arg_0 , arg_1 , arg_2 = 1 , arg_3 = 1000 , arg_4 = None ) : arg_5 = np . empty ( ( arg_3 , arg_1 ) ) arg_6 = np . random . RandomState ( arg_6 = arg_4 ) for arg_7 in range ( arg_3 ) : arg_5 [ arg_7 , : ] = arg_0 . sample ( arg_1 , replace = True , random_state = arg_6 ) return arg_5

def Func(arg_0, arg_1,
                   arg_2=1, arg_3=1000, arg_4=None):
    """
    Gnerate alternate paths using available values from in-sample returns.

    Parameters
    ----------
    is_returns : pandas.core.frame.DataFrame
        Non-cumulative in-sample returns.
    num_days : int
        Number of days to project the probability cone forward.
    starting_value : int or float
        Starting value of the out of sample period.
    num_samples : int
        Number of samples to draw from the in-sample daily returns.
        Each sample will be an array with length num_days.
        A higher number of samples will generate a more accurate
        bootstrap cone.
    random_seed : int
        Seed for the pseudorandom number generator used by the pandas
        sample method.

    Returns
    -------
    samples : numpy.ndarray
    """

    arg_5 = np.empty((arg_3, arg_1))
    arg_6 = np.random.RandomState(arg_6=arg_4)
    for arg_7 in range(arg_3):
        arg_5[arg_7, :] = arg_0.sample(arg_1, replace=True,
                                          random_state=arg_6)

    return arg_5

Gnerate alternate paths using available values from in - sample returns .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . copy ( ) arg_2 . update ( arg_0 . _params ) return arg_0 . __copy_and_set ( 'params' , arg_2 )

def Func(arg_0, arg_1):
        '''Adds parameters to the request params

        Args:
            params (dict): The parameters to add to the request params

        Returns:
            The request builder instance in order to chain calls
        '''
        arg_2 = arg_1.copy()
        arg_2.update(arg_0._params)
        return arg_0.__copy_and_set('params', arg_2)


return (len(ref), counts, frozenset(counts))

def Func ( arg_0 , arg_1 = 4 ) : arg_0 = normalize ( arg_0 ) arg_2 = count_ngrams ( arg_0 , arg_1 ) return ( len ( arg_0 ) , arg_2 , frozenset ( arg_2 ) )

def Func(arg_0, arg_1=4):
    '''Takes a reference sentences for a single segment
    and returns an object that encapsulates everything that BLEU
    needs to know about them.  Also provides a set cause bleualign wants it'''
    arg_0 = normalize(arg_0)
    arg_2 = count_ngrams(arg_0, arg_1)
    return (len(arg_0), arg_2, frozenset(arg_2))

Takes a reference sentences for a single segment and returns an object that encapsulates everything that BLEU needs to know about them . Also provides a set cause bleualign wants it


def Func(arg_0, arg_1, arg_2=None):
    """
    Explained variance regression score function.

    :param y_actual: H2OFrame of actual response.
    :param y_predicted: H2OFrame of predicted response.
    :param weights: (Optional) sample weights
    :returns: the explained variance score.
    """
    ModelBase._check_targets(arg_0, arg_1)

    arg_3, arg_4 = _mean_var(arg_0 - arg_1, arg_2)
    arg_3, arg_5 = _mean_var(arg_0, arg_2)
    if arg_5 == 0.0:
        return 1. if arg_4 == 0 else 0.  # 0/0 => 1, otherwise, 0
    return 1 - arg_4 / arg_5

Explained variance regression score function .


def
Func
(
arg_0
)
:
if
not
_is_known_dtype
(
arg_0
)
:
raise
TypeError
(
"Unrecognized dtype: {}"
.
format
(
arg_0
.
name
)
)
if
arg_0
.
is_floating
:
return
int
(
2
**
(
np
.
finfo
(
arg_0
.
as_numpy_dtype
)
.
nmant
+
1
)
)
if
arg_0
.
is_integer
:
return
np
.
iinfo
(
arg_0
.
as_numpy_dtype
)
.
max
if
arg_0
.
base_dtype
==
tf
.
bool
:
return
int
(
1
)
raise
TypeError
(
"Unrecognized dtype: {}"
.
format
(
arg_0
.
name
)
)

def Func(arg_0):
  """Helper returning the largest integer exactly representable by dtype."""
  if not _is_known_dtype(arg_0):
    raise TypeError("Unrecognized dtype: {}".format(arg_0.name))
  if arg_0.is_floating:
    return int(2**(np.finfo(arg_0.as_numpy_dtype).nmant + 1))
  if arg_0.is_integer:
    return np.iinfo(arg_0.as_numpy_dtype).max
  if arg_0.base_dtype == tf.bool:
    return int(1)
  # We actually can't land here but keep the case for completeness.
  raise TypeError("Unrecognized dtype: {}".format(arg_0.name))

Helper returning the largest integer exactly representable by dtype .


def Func(arg_0=None, arg_1=0.99, arg_2=0):
    """Take 1D float array of rewards and compute discounted rewards for an
    episode. When encount a non-zero value, consider as the end a of an episode.

    Parameters
    ----------
    rewards : list
        List of rewards
    gamma : float
        Discounted factor
    mode : int
        Mode for computing the discount rewards.
            - If mode == 0, reset the discount process when encount a non-zero reward (Ping-pong game).
            - If mode == 1, would not reset the discount process.

    Returns
    --------
    list of float
        The discounted rewards.

    Examples
    ----------
    >>> rewards = np.asarray([0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1])
    >>> gamma = 0.9
    >>> discount_rewards = tl.rein.Func(rewards, gamma)
    >>> print(discount_rewards)
    [ 0.72899997  0.81        0.89999998  1.          0.72899997  0.81
    0.89999998  1.          0.72899997  0.81        0.89999998  1.        ]
    >>> discount_rewards = tl.rein.Func(rewards, gamma, mode=1)
    >>> print(discount_rewards)
    [ 1.52110755  1.69011939  1.87791049  2.08656716  1.20729685  1.34144104
    1.49048996  1.65610003  0.72899997  0.81        0.89999998  1.        ]

    """
    if arg_0 is None:
        raise Exception("rewards should be a list")
    arg_3 = np.zeros_like(arg_0, dtype=np.float32)
    arg_4 = 0
    for arg_5 in reversed(xrange(0, arg_0.size)):
        if arg_2 == 0:
            if arg_0[arg_5] != 0: arg_4 = 0

        arg_4 = arg_4 * arg_1 + arg_0[arg_5]
        arg_3[arg_5] = arg_4
    return arg_3

Take 1D float array of rewards and compute discounted rewards for an
    episode. When encount a non-zero value, consider as the end a of an episode.

    Parameters
    ----------
    rewards : list
        List of rewards
    gamma : float
        Discounted factor
    mode : int
        Mode for computing the discount rewards.
            - If mode == 0, reset the discount process when encount a non-zero reward (Ping-pong game).
            - If mode == 1, would not reset the discount process.

    Returns
    --------
    list of float
        The discounted rewards.

    Examples
    ----------
    >>> rewards = np.asarray([0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1])
    >>> gamma = 0.9
    >>> discount_rewards = tl.rein.discount_episode_rewards(rewards, gamma)
    >>> print(discount_rewards)
    [ 0.72899997  0.81        0.89999998  1.          0.72899997  0.81
    0.89999998  1.          0.72899997  0.81        0.89999998  1.        ]
    >>> discount_rewards = tl.rein.discount_episode_rewards(rewards, gamma, mode=1)
    >>> print(discount_rewards)
    [ 1.52110755  1.69011939  1.87791049  2.08656716  1.20729685  1.34144104
    1.49048996  1.65610003  0.72899997  0.81        0.89999998  1.        ]

Take 1D float array of rewards and compute discounted rewards for an episode . When encount a non - zero value consider as the end a of an episode .


def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Helper to add Func to messages field. It fills placeholder with extra call parameters
        or values from message_value map.

        :param Func_code: Error code to use
        :rparam Func_code: str
        :param value: Value checked
        :param kwargs: Map of values to use in placeholders
        """
        arg_4 = arg_0.Func_code_map.get(arg_1, arg_1)

        try:
            arg_5 = Template(arg_0.Func_messages[arg_4])
        except KeyError:
            arg_5 = Template(arg_0.Func_messages[arg_1])

        arg_6 = {"value": arg_0.hidden_value if arg_0.hidden else arg_2}
        arg_6.update(arg_3)
        arg_6.update(arg_0.message_values)

        arg_0.messages[arg_4] = arg_5.safe_substitute(arg_6)

Helper to add error to messages field. It fills placeholder with extra call parameters
        or values from message_value map.

        :param error_code: Error code to use
        :rparam error_code: str
        :param value: Value checked
        :param kwargs: Map of values to use in placeholders

Helper to add error to messages field . It fills placeholder with extra call parameters or values from message_value map .


return PersistentCourseGrade.objects.filter(
            passed_timestamp__gt=datetime.datetime.now() - datetime.timedelta(days=days)
        ).filter(
            user_id__in=enterprise_customer.enterprise_customer_users.values_list('user_id', flat=True)
        )

def Func ( arg_0 , arg_1 , arg_2 ) : return PersistentCourseGrade . objects . filter ( passed_timestamp__gt = datetime . datetime . now ( ) - datetime . timedelta ( arg_2 = arg_2 ) ) . filter ( user_id__in = arg_1 . enterprise_customer_users . values_list ( 'user_id' , flat = True ) )

def Func(arg_0, arg_1, arg_2):
        """
        Get course completions via PersistentCourseGrade for all the learners of given enterprise customer.

        Arguments:
            enterprise_customer (EnterpriseCustomer): Include Course enrollments for learners
                of this enterprise customer.
            days (int): Include course enrollment of this number of days.

        Returns:
            (list): A list of PersistentCourseGrade objects.
        """
        return PersistentCourseGrade.objects.filter(
            passed_timestamp__gt=datetime.datetime.now() - datetime.timedelta(arg_2=arg_2)
        ).filter(
            user_id__in=arg_1.enterprise_customer_users.values_list('user_id', flat=True)
        )

Get course completions via PersistentCourseGrade for all the learners of given enterprise customer .


def Func ( arg_0 ) : arg_1 = [ ( arg_0 // pow ( 2 , i ) ) % 2 for i in range ( 8 ) ] return np . array ( arg_1 )

def Func(arg_0):
    """ Converts a rule given as an integer into a binary list representation.

    It reads from left to right (contrary to the Wikipedia article given below),
    i.e. the 2**0 is found on the left hand side and 2**7 on the right.

    For example:

        ``Func(30)`` returns [0, 1, 1, 1, 1, 0, 0, 0]

    The resulting binary list can be interpreted as
    the following transition table:

         neighborhood  new cell state
                000     0
                001     1
                010     1
                011     1
                100     1
                101     0
                110     0
                111     0

    For more information about this rule
    see: http://en.wikipedia.org/wiki/Rule_30

    """
    arg_1 = [(arg_0 // pow(2,i)) % 2 for i in range(8)]
    return np.array(arg_1)

Converts a rule given as an integer into a binary list representation.

    It reads from left to right (contrary to the Wikipedia article given below),
    i.e. the 2**0 is found on the left hand side and 2**7 on the right.

    For example:

        ``convert_rule(30)`` returns [0, 1, 1, 1, 1, 0, 0, 0]

    The resulting binary list can be interpreted as
    the following transition table:

         neighborhood  new cell state
                000     0
                001     1
                010     1
                011     1
                100     1
                101     0
                110     0
                111     0

    For more information about this rule
    see: http://en.wikipedia.org/wiki/Rule_30

Converts a rule given as an integer into a binary list representation .


def Func ( arg_0 , arg_1 ) : assert isinstance ( arg_1 , dict ) arg_0 . _sharedInstance . config . update ( arg_1 ) if arg_0 . _sharedInstance . instance : arg_0 . _sharedInstance . instance = None

def Func(arg_0, arg_1):
        """ This allows to set a config that will be used when calling
            ``shared_blockchain_instance`` and allows to define the configuration
            without requiring to actually create an instance
        """
        assert isinstance(arg_1, dict)
        arg_0._sharedInstance.config.update(arg_1)
        # if one is already set, delete
        if arg_0._sharedInstance.instance:
            arg_0._sharedInstance.instance = None

This allows to set a config that will be used when calling shared_blockchain_instance and allows to define the configuration without requiring to actually create an instance


def Func(arg_0, arg_1):
    """
        Tries to perform a zone transfer.
    """
    arg_2 = []
    try:
        print_notification("Attempting dns zone transfer for {} on {}".format(arg_1, arg_0))
        arg_3 = dns.zone.from_xfr(dns.query.xfr(arg_0, arg_1))
    except dns.exception.FormError:
        print_notification("Zone transfer not allowed")
        return arg_2
    arg_4 = arg_3.nodes.keys()
    print_success("Zone transfer successfull for {}, found {} entries".format(arg_0, len(arg_4)))
    for arg_5 in arg_4:
        arg_6 = arg_3[arg_5]
        arg_7 = arg_6.get_rdataset(dns.rdataclass.IN, dns.rdatatype.A)
        if arg_7:
            # TODO add hostnames to entries.
            # hostname = n.to_text()
            for arg_8 in arg_7.items:
                arg_0 = arg_8.address
                arg_2.append(arg_0)
    return arg_2


def Func ( arg_0 , arg_1 ) : assert arg_1 in ( 1 , 2 ) arg_2 = K . int_shape ( arg_0 ) [ 1 ] arg_3 = [ 1 , 1 , 1 , 1 ] arg_3 [ arg_1 ] = arg_2 if arg_1 == 1 : arg_4 = Reshape ( target_shape = ( ( 1 , ) + K . int_shape ( arg_0 ) [ 1 : ] ) ) ( arg_0 ) else : arg_4 = Reshape ( target_shape = ( K . int_shape ( arg_0 ) [ 1 : 2 ] + ( 1 , ) + K . int_shape ( arg_0 ) [ 2 : ] ) ) ( arg_0 ) return K . tile ( arg_4 , arg_3 )

def Func(arg_0, arg_1):
    """
    Expand and tile tensor along given axis

    Args:
        units: tf tensor with dimensions [batch_size, time_steps, n_input_features]
        axis: axis along which expand and tile. Must be 1 or 2

    """
    assert arg_1 in (1, 2)
    arg_2 = K.int_shape(arg_0)[1]
    arg_3 = [1, 1, 1, 1]
    arg_3[arg_1] = arg_2
    if arg_1 == 1:
        arg_4 = Reshape(target_shape=( (1,) + K.int_shape(arg_0)[1:] ))(arg_0)
    else:
        arg_4 = Reshape(target_shape=(K.int_shape(arg_0)[1:2] + (1,) + K.int_shape(arg_0)[2:]))(arg_0)
    return K.tile(arg_4, arg_3)


(location, basename, metadata,
    py_version=None, precedence=SOURCE_DIST, platform=None
)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = arg_5 , arg_6 = None ) : arg_7 = arg_1 . split ( '-' ) if not arg_3 : for arg_8 , arg_9 in enumerate ( arg_7 [ 2 : ] ) : if len ( arg_9 ) == 5 and arg_9 . startswith ( 'py2.' ) : return for arg_9 in range ( 1 , len ( arg_7 ) + 1 ) : yield Distribution ( arg_0 , arg_2 , '-' . join ( arg_7 [ : arg_9 ] ) , '-' . join ( arg_7 [ arg_9 : ] ) , arg_3 = arg_3 , arg_4 = arg_4 , arg_6 = arg_6 )

def Func(arg_0, arg_1, arg_2,
    arg_3=None, arg_4=arg_5, arg_6=None
):
    """Generate alternative interpretations of a source distro name

    Note: if `location` is a filesystem filename, you should call
    ``pkg_resources.normalize_path()`` on it before passing it to this
    routine!
    """
    # Generate alternative interpretations of a source distro name
    # Because some packages are ambiguous as to name/versions split
    # e.g. "adns-python-1.1.0", "egenix-mx-commercial", etc.
    # So, we generate each possible interepretation (e.g. "adns, python-1.1.0"
    # "adns-python, 1.1.0", and "adns-python-1.1.0, no version").  In practice,
    # the spurious interpretations should be ignored, because in the event
    # there's also an "adns" package, the spurious "python-1.1.0" version will
    # compare lower than any numeric version number, and is therefore unlikely
    # to match a request for it.  It's still a potential problem, though, and
    # in the long run PyPI and the distutils should go for "safe" names and
    # versions in distribution archive names (sdist and bdist).

    arg_7 = arg_1.split('-')
    if not arg_3:
        for arg_8,arg_9 in enumerate(arg_7[2:]):
            if len(arg_9)==5 and arg_9.startswith('py2.'):
                return # It's a bdist_dumb, not an sdist -- bail out

    for arg_9 in range(1,len(arg_7)+1):
        yield Distribution(
            arg_0, arg_2, '-'.join(arg_7[:arg_9]), '-'.join(arg_7[arg_9:]),
            arg_3=arg_3, arg_4 = arg_4,
            arg_6 = arg_6
        )


def Func ( arg_0 , arg_1 , arg_2 ) : signal . signal ( signal . SIGINT , arg_0 . _signal_stop ) arg_3 = threading . Thread ( target = arg_0 . _confirm_exit ) arg_3 . daemon = True arg_3 . start ( )

def Func(arg_0, arg_1, arg_2):
        """SIGINT handler spawns confirmation dialog"""
        # register more forceful signal handler for ^C^C case
        signal.signal(signal.SIGINT, arg_0._signal_stop)
        # request confirmation dialog in bg thread, to avoid
        # blocking the App
        arg_3 = threading.Thread(target=arg_0._confirm_exit)
        arg_3.daemon = True
        arg_3.start()


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , arg_4 = get_cartesian ( arg_1 , arg_2 ) arg_0 . ax . plot ( arg_3 , arg_4 , 'black' , alpha = 0.3 )

def Func(arg_0, arg_1, arg_2):
        """
        Renders the axis.
        """
        arg_3, arg_4 = get_cartesian(arg_1, arg_2)
        arg_0.ax.plot(arg_3, arg_4, 'black', alpha=0.3)


def Func ( arg_0 ) : arg_1 = ( bytearray ( [ 7 , 8 , 9 , 10 , 12 , 13 , 27 ] ) + bytearray ( range ( 0x20 , 0x100 ) ) ) return bool ( arg_0 . translate ( None , arg_1 ) )

def Func(arg_0):
        """
        Return true if string is binary data.
        """

        arg_1 = (bytearray([7, 8, 9, 10, 12, 13, 27]) +
                     bytearray(range(0x20, 0x100)))
        return bool(arg_0.translate(None, arg_1))


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
time
.
time
(
)
arg_4
=
" chunking clusters     | {} | s5 |"
arg_5
=
datetime
.
timedelta
(
seconds
=
int
(
time
.
time
(
)
arg_3
)
)
progressbar
(
10
,
0
,
arg_4
.
format
(
arg_5
)
,
spacer
=
arg_0
.
_spacer
)
arg_6
=
{
}
for
arg_7
in
arg_1
:
arg_6
[
arg_7
.
name
]
=
arg_2
.
apply
(
chunk_clusters
,
*
(
arg_0
,
arg_7
)
)
while
1
:
arg_9
=
[
i
.
ready
(
)
for
i
in
arg_6
.
values
(
)
]
arg_5
=
datetime
.
timedelta
(
seconds
=
int
(
time
.
time
(
)
arg_3
)
)
progressbar
(
len
(
arg_9
)
,
sum
(
arg_9
)
,
arg_4
.
format
(
arg_5
)
,
spacer
=
arg_0
.
_spacer
)
time
.
sleep
(
0.1
)
if
len
(
arg_9
)
==
sum
(
arg_9
)
:
print
(
""
)
break
for
arg_7
in
arg_1
:
if
not
arg_6
[
arg_7
.
name
]
.
successful
(
)
:
LOGGER
.
error
(
"  sample %s failed: %s"
,
arg_7
.
name
,
arg_6
[
arg_7
.
name
]
.
exception
(
)
)
return
arg_6

def Func(arg_0, arg_1, arg_2):
    """
    calls chunk_clusters and tracks progress.
    """
    ## first progress bar
    arg_3 = time.time()
    arg_4 = " chunking clusters     | {} | s5 |"
    arg_5 = datetime.timedelta(seconds=int(time.time()-arg_3))
    progressbar(10, 0, arg_4.format(arg_5), spacer=arg_0._spacer)

    ## send off samples to be chunked
    arg_6 = {}
    for arg_7 in arg_1:
        arg_6[arg_7.name] = arg_2.apply(chunk_clusters, *(arg_0, arg_7))

    ## block until finished
    while 1:
        arg_9 = [i.ready() for i in arg_6.values()]
        arg_5 = datetime.timedelta(seconds=int(time.time()-arg_3))
        progressbar(len(arg_9), sum(arg_9), arg_4.format(arg_5), spacer=arg_0._spacer)
        time.sleep(0.1)
        if len(arg_9) == sum(arg_9):
            print("")
            break

    ## check for failures
    for arg_7 in arg_1:
        if not arg_6[arg_7.name].successful():
            LOGGER.error("  sample %s failed: %s", arg_7.name,
                        arg_6[arg_7.name].exception())

    return arg_6

calls chunk_clusters and tracks progress .


return [compress_user(p, tilde_expand, tilde_val) for p in dirs+pys]

def Func ( arg_0 , arg_1 ) : arg_2 = arg_split ( arg_1 . line , strict = False ) arg_3 = ( len ( arg_2 ) > 1 and arg_2 [ - 1 ] or '' ) . strip ( "'\"" ) arg_4 = glob . glob arg_5 = os . path . isdir arg_3 , arg_6 , arg_7 = expand_user ( arg_3 ) arg_8 = [ f . replace ( '\\' , '/' ) + "/" for f in arg_4 ( arg_3 + '*' ) if arg_5 ( f ) ] if filter ( magic_run_re . match , arg_2 ) : arg_9 = [ f . replace ( '\\' , '/' ) for f in arg_4 ( '*' ) ] else : arg_9 = [ f . replace ( '\\' , '/' ) for f in arg_4 ( arg_3 + '*.py' ) + arg_4 ( arg_3 + '*.ipy' ) + arg_4 ( arg_3 + '*.pyw' ) ] return [ compress_user ( arg_10 , arg_6 , arg_7 ) for arg_10 in arg_8 + arg_9 ]

def Func(arg_0, arg_1):
    """Complete files that end in .py or .ipy for the %run command.
    """
    arg_2 = arg_split(arg_1.line, strict=False)
    arg_3 = (len(arg_2) > 1 and arg_2[-1] or '').strip("'\"")

    #print("\nev=", event)  # dbg
    #print("rp=", relpath)  # dbg
    #print('comps=', comps)  # dbg

    arg_4 = glob.glob
    arg_5 = os.path.isdir
    arg_3, arg_6, arg_7 = expand_user(arg_3)

    arg_8 = [f.replace('\\','/') + "/" for f in arg_4(arg_3+'*') if arg_5(f)]

    # Find if the user has already typed the first filename, after which we
    # should complete on all files, since after the first one other files may
    # be arguments to the input script.

    if filter(magic_run_re.match, arg_2):
        arg_9 =  [f.replace('\\','/') for f in arg_4('*')]
    else:
        arg_9 =  [f.replace('\\','/')
                for f in arg_4(arg_3+'*.py') + arg_4(arg_3+'*.ipy') +
                arg_4(arg_3 + '*.pyw')]
    #print('run comp:', dirs+pys) # dbg
    return [compress_user(arg_10, arg_6, arg_7) for arg_10 in arg_8+arg_9]

Complete files that end in . py or . ipy for the %run command .


def
Func
(
arg_0
=
)
:
if
arg_0
is
:
arg_0
=
mx
.
cur_model
(
)
arg_1
=
get_modeltree
(
arg_0
)
arg_2
=
QApplication
.
instance
(
)
if
not
arg_2
:
raise
RuntimeError
(
"QApplication does not exist."
)
arg_1
.
show
(
)
arg_2
.
exec_
(
)

def Func(arg_0=None):
    """Display the model tree window.

    Args:
        model: :class:`Model <modelx.core.model.Model>` object.
            Defaults to the current model.

    Warnings:
        For this function to work with Spyder, *Graphics backend* option
        of Spyder must be set to *inline*.
    """
    if arg_0 is None:
        arg_0 = mx.cur_model()
    arg_1 = get_modeltree(arg_0)
    arg_2 = QApplication.instance()
    if not arg_2:
        raise RuntimeError("QApplication does not exist.")
    arg_1.show()
    arg_2.exec_()


def
Func
(
*
arg_0
)
:
if
arg_0
and
isinstance
(
arg_0
[
0
]
,
dataframe
.
DataFrame
)
:
return
arg_0
[
0
]
.
Func
(
arg_0
[
1
]
,
arg_0
[
2
]
,
*
arg_0
[
3
:
]
)
elif
not
arg_0
:
raise
ValueError
(
"No arguments provided"
)
else
:
return
pipeable
.
Pipeable
(
pipeable
.
PipingMethod
.
AGGREGATE
,
*
arg_0
)

def Func(*arg_0):
    """
    Pipeable aggregation method.

    Takes either
     - a dataframe and a tuple of arguments required for aggregation,
     - a tuple of arguments if a dataframe has already been piped into.
    In any case one argument has to be a class that extends callable.

    :Example:

    Func(dataframe, Function, "new_col_name", "old_col_name")

    :Example:

    dataframe >> Func(Function, "new_col_name", "old_col_name")

    :param args: tuple of arguments
    :type args: tuple
    :return: returns a dataframe object
    :rtype: DataFrame
    """

    if arg_0 and isinstance(arg_0[0], dataframe.DataFrame):
        return arg_0[0].Func(arg_0[1], arg_0[2], *arg_0[3:])
    elif not arg_0:
        raise ValueError("No arguments provided")
    else:
        return pipeable.Pipeable(pipeable.PipingMethod.AGGREGATE, *arg_0)

Pipeable aggregation method.

    Takes either
     - a dataframe and a tuple of arguments required for aggregation,
     - a tuple of arguments if a dataframe has already been piped into.
    In any case one argument has to be a class that extends callable.

    :Example:

    aggregate(dataframe, Function, "new_col_name", "old_col_name")

    :Example:

    dataframe >> aggregate(Function, "new_col_name", "old_col_name")

    :param args: tuple of arguments
    :type args: tuple
    :return: returns a dataframe object
    :rtype: DataFrame

Pipeable aggregation method . Takes either - a dataframe and a tuple of arguments required for aggregation - a tuple of arguments if a dataframe has already been piped into . In any case one argument has to be a class that extends callable .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
if
arg_1
is
:
raise
AirflowBadRequest
(
"Collection name cannot be None."
)
arg_3
=
list
(
arg_0
.
get_conn
(
)
.
QueryContainers
(
get_database_link
(
arg_0
.
__get_database_name
(
arg_2
)
)
,
{
"query"
:
"SELECT * FROM r WHERE r.id=@id"
,
"parameters"
:
[
{
"name"
:
"@id"
,
"value"
:
arg_1
}
]
}
)
)
if
len
(
arg_3
)
==
0
:
return
False
return
True

def Func(arg_0, arg_1, arg_2=None):
        """
        Checks if a collection exists in CosmosDB.
        """
        if arg_1 is None:
            raise AirflowBadRequest("Collection name cannot be None.")

        arg_3 = list(arg_0.get_conn().QueryContainers(
            get_database_link(arg_0.__get_database_name(arg_2)), {
                "query": "SELECT * FROM r WHERE r.id=@id",
                "parameters": [
                    {"name": "@id", "value": arg_1}
                ]
            }))
        if len(arg_3) == 0:
            return False

        return True

Checks if a collection exists in CosmosDB .


(self, pos_args, keyword_args, infix_operator=None, extra_params={})

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
{
}
)
:
if
arg_3
and
not
(
len
(
arg_1
)
==
2
and
arg_2
==
[
]
)
:
raise
Exception
(
'Infix format requires exactly two'
' positional arguments and no keywords'
)
(
arg_5
,
arg_6
,
arg_6
,
arg_6
)
=
arg_0
.
_Func
arg_0
.
_Func
=
(
arg_2
+
arg_5
,
arg_1
,
arg_3
,
arg_4
)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4={}):
        """
        Method to define the positional arguments and keyword order
        for pretty printing.
        """
        if arg_3 and not (len(arg_1)==2 and arg_2==[]):
            raise Exception('Infix format requires exactly two'
                            ' positional arguments and no keywords')
        (arg_5,arg_6,arg_6,arg_6) = arg_0._Func
        arg_0._Func = (arg_2 + arg_5, arg_1, arg_3, arg_4)

Method to define the positional arguments and keyword order for pretty printing .


def Func ( arg_0 , arg_1 = None ) : flawless . lib . config . init_config ( arg_0 ) if not os . path . exists ( config . data_dir_path ) : os . makedirs ( config . data_dir_path ) arg_1 = arg_1 or ( lambda partition : DiskStorage ( partition = partition ) ) arg_2 = logging . getLogger ( ) arg_3 = logging . handlers . TimedRotatingFileHandler ( filename = config . log_file , when = 'd' , interval = 1 , backupCount = config . log_days_to_keep ) arg_2 . setLevel ( getattr ( logging , config . log_level ) ) arg_2 . addHandler ( arg_3 ) arg_4 = os . fork ( ) if arg_4 == 0 : arg_5 = FlawlessWebServiceHandler ( arg_1 = arg_1 ) arg_6 = SimpleThreadedHTTPServer ( ( '' , config . http_port ) , SimpleRequestHTTPHandler ) arg_6 . attach_service ( arg_5 ) arg_6 . request_queue_size = 50 try : arg_6 . Func_forever ( ) except ( KeyboardInterrupt , SystemExit ) : arg_6 . Funcr_close ( ) else : arg_5 = FlawlessThriftServiceHandler ( arg_1 = arg_1 ) arg_8 = Flawless . Processor ( arg_5 ) arg_9 = TSocket . TServerSocket ( port = config . port ) arg_10 = TTransport . TFramedTransportFactory ( ) arg_11 = TBinaryProtocol . TBinaryProtocolFactory ( ) arg_6 = TServer . TThreadedServer ( arg_8 , arg_9 , arg_10 , arg_11 ) try : arg_6 . Func ( ) except ( KeyboardInterrupt , SystemExit ) : arg_5 . errors_seen . sync ( ) arg_9 . close ( ) os . kill ( arg_4 , signal . SIGINT )

def Func(arg_0, arg_1=None):
    """This method starts the Funcr. There are two processes, one is an HTTP Funcr that shows
    and admin interface and the second is a Thrift Funcr that the client code calls.

    Arguments:
        `conf_path` - The path to your flawless.cfg file
        `storage_factory` - You can pass in your own storage class that implements StorageInterface. You must implement
                            storage_cls if you want Flawless to be horizontally scalable, since by default it will just
                            store everything on the local disk.
    """

    flawless.lib.config.init_config(arg_0)
    # Try and create datadir if it doesn't exist. For instance it might be in /tmp
    if not os.path.exists(config.data_dir_path):
        os.makedirs(config.data_dir_path)

    arg_1 = arg_1 or (lambda partition: DiskStorage(partition=partition))

    # Setup root logger
    arg_2 = logging.getLogger()
    arg_3 = logging.handlers.TimedRotatingFileHandler(
        filename=config.log_file, when='d', interval=1, backupCount=config.log_days_to_keep)
    arg_2.setLevel(getattr(logging, config.log_level))
    arg_2.addHandler(arg_3)

    arg_4 = os.fork()
    if arg_4 == 0:
        # Setup HTTP Funcr
        arg_5 = FlawlessWebServiceHandler(arg_1=arg_1)
        arg_6 = SimpleThreadedHTTPServer(('', config.http_port), SimpleRequestHTTPHandler)
        arg_6.attach_service(arg_5)
        arg_6.request_queue_size = 50

        try:
            arg_6.Func_forever()
        except (KeyboardInterrupt, SystemExit):
            arg_6.Funcr_close()
    else:
        # Setup Thrift Funcr
        arg_5 = FlawlessThriftServiceHandler(arg_1=arg_1)
        arg_8 = Flawless.Processor(arg_5)
        arg_9 = TSocket.TServerSocket(port=config.port)
        arg_10 = TTransport.TFramedTransportFactory()
        arg_11 = TBinaryProtocol.TBinaryProtocolFactory()
        arg_6 = TServer.TThreadedServer(arg_8, arg_9, arg_10, arg_11)
        try:
            arg_6.Func()
        except (KeyboardInterrupt, SystemExit):
            arg_5.errors_seen.sync()
            arg_9.close()
            os.kill(arg_4, signal.SIGINT)

This method starts the server. There are two processes, one is an HTTP server that shows
    and admin interface and the second is a Thrift server that the client code calls.

    Arguments:
        `conf_path` - The path to your flawless.cfg file
        `storage_factory` - You can pass in your own storage class that implements StorageInterface. You must implement
                            storage_cls if you want Flawless to be horizontally scalable, since by default it will just
                            store everything on the local disk.

This method starts the server . There are two processes one is an HTTP server that shows and admin interface and the second is a Thrift server that the client code calls .


def Func ( arg_0 ) -> 'Control' : arg_1 = arg_0 . NativeWindowHandle if arg_1 : arg_2 = GetAncestor ( arg_1 , GAFlag . Root ) if arg_2 : if arg_2 == arg_1 : return arg_0 else : return ControlFromHandle ( arg_2 ) else : pass else : arg_3 = arg_0 while True : arg_3 = arg_3 . GetParentControl ( ) arg_1 = arg_3 . NativeWindowHandle if arg_1 : arg_2 = GetAncestor ( arg_1 , GAFlag . Root ) return ControlFromHandle ( arg_2 )

def Func(arg_0) -> 'Control':
        """
        Get the top level control which current control lays.
        If current control is top level, return self.
        If current control is root control, return None.
        Return `PaneControl` or `WindowControl` or None.
        """
        arg_1 = arg_0.NativeWindowHandle
        if arg_1:
            arg_2 = GetAncestor(arg_1, GAFlag.Root)
            if arg_2:
                if arg_2 == arg_1:
                    return arg_0
                else:
                    return ControlFromHandle(arg_2)
            else:
                #self is root control
                pass
        else:
            arg_3 = arg_0
            while True:
                arg_3 = arg_3.GetParentControl()
                arg_1 = arg_3.NativeWindowHandle
                if arg_1:
                    arg_2 = GetAncestor(arg_1, GAFlag.Root)
                    return ControlFromHandle(arg_2)

Get the top level control which current control lays . If current control is top level return self . If current control is root control return None . Return PaneControl or WindowControl or None .


def Func(arg_0, arg_1, arg_2):
        """Add an option for the field.

        :Parameters:
            - `value`: option values.
            - `label`: option label (human-readable description).
        :Types:
            - `value`: `list` of `unicode`
            - `label`: `unicode`
        """
        if type(arg_1) is list:
            warnings.warn(".Func() accepts single value now.", DeprecationWarning, stacklevel=1)
            arg_1 = arg_1[0]
        if arg_0.type not in ("list-multi", "list-single"):
            raise ValueError("Options are allowed only for list types.")
        arg_3 = Option(arg_1, arg_2)
        arg_0.options.append(arg_3)
        return arg_3


return self._load_data(
            self.CATALOGS_COURSES_ENDPOINT.format(catalog_id),
            default=[]
        )

def Func ( arg_0 , arg_1 ) : return arg_0 . _load_data ( arg_0 . CATALOGS_COURSES_ENDPOINT . format ( arg_1 ) , default = [ ] )

def Func(arg_0, arg_1):
        """
        Return the courses included in a single course catalog by ID.

        Args:
            catalog_id (int): The catalog ID we want to retrieve.

        Returns:
            list: Courses of the catalog in question

        """
        return arg_0._load_data(
            arg_0.CATALOGS_COURSES_ENDPOINT.format(arg_1),
            default=[]
        )

Return the courses included in a single course catalog by ID .


(data, masked=True, nodata=0, dtype="int16")

def Func(arg_0, arg_1=True, arg_2=0, arg_3="int16"):
    """
    Turn input data into a proper array for further usage.

    Outut array is always 3-dimensional with the given data type. If the output
    is masked, the fill_value corresponds to the given nodata value and the
    nodata value will be burned into the data array.

    Parameters
    ----------
    data : array or iterable
        array (masked or normal) or iterable containing arrays
    nodata : integer or float
        nodata value (default: 0) used if input is not a masked array and
        for output array
    masked : bool
        return a NumPy Array or a NumPy MaskedArray (default: True)
    dtype : string
        data type of output array (default: "int16")

    Returns
    -------
    array : array
    """
    # input is iterable
    if isinstance(arg_0, (list, tuple)):
        return _prepare_iterable(arg_0, arg_1, arg_2, arg_3)

    # special case if a 2D single band is provided
    elif isinstance(arg_0, np.ndarray) and arg_0.ndim == 2:
        arg_0 = ma.expand_dims(arg_0, axis=0)

    # input is a masked array
    if isinstance(arg_0, ma.MaskedArray):
        return _prepare_masked(arg_0, arg_1, arg_2, arg_3)

    # input is a NumPy array
    elif isinstance(arg_0, np.ndarray):
        if arg_1:
            return ma.masked_values(arg_0.astype(arg_3, copy=False), arg_2, copy=False)
        else:
            return arg_0.astype(arg_3, copy=False)
    else:
        raise ValueError(
            "data must be array, masked array or iterable containing arrays."
        )

Turn input data into a proper array for further usage .


def Func ( arg_0 , arg_1 ) : arg_2 = [ zi * Vmi for zi , Vmi in zip ( arg_0 , arg_1 ) ] arg_3 = sum ( arg_2 ) return [ arg_4 / arg_3 for arg_4 in arg_2 ]

def Func(arg_0, arg_1):
    r'''Converts a list of mole fractions to volume fractions. Requires molar
    volumes for all species.

    .. math::
        \text{Vf}_i = \frac{z_i V_{m,i}}{\sum_i z_i V_{m,i}}

    Parameters
    ----------
    zs : iterable
        Mole fractions [-]
    VMs : iterable
        Molar volumes of species [m^3/mol]

    Returns
    -------
    Vfs : list
        Molar volume fractions [-]

    Notes
    -----
    Does not check that the sums add to one. Does not check that inputs are of
    the same length.

    Molar volumes are specified in terms of pure components only. Function
    works with any phase.

    Examples
    --------
    Acetone and benzene example

    >>> Func([0.637, 0.363], [8.0234e-05, 9.543e-05])
    [0.5960229712956298, 0.4039770287043703]
    '''
    arg_2 = [zi*Vmi for zi, Vmi in zip(arg_0, arg_1)]
    arg_3 = sum(arg_2)
    return [arg_4/arg_3 for arg_4 in arg_2]

r'''Converts a list of mole fractions to volume fractions. Requires molar
    volumes for all species.

    .. math::
        \text{Vf}_i = \frac{z_i V_{m,i}}{\sum_i z_i V_{m,i}}

    Parameters
    ----------
    zs : iterable
        Mole fractions [-]
    VMs : iterable
        Molar volumes of species [m^3/mol]

    Returns
    -------
    Vfs : list
        Molar volume fractions [-]

    Notes
    -----
    Does not check that the sums add to one. Does not check that inputs are of
    the same length.

    Molar volumes are specified in terms of pure components only. Function
    works with any phase.

    Examples
    --------
    Acetone and benzene example

    >>> zs_to_Vfs([0.637, 0.363], [8.0234e-05, 9.543e-05])
    [0.5960229712956298, 0.4039770287043703]

r Converts a list of mole fractions to volume fractions . Requires molar volumes for all species .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . format == 'pdf' : arg_3 = cairo . PDFSurface ( arg_0 . _output_file ( arg_2 ) , * arg_1 ) elif arg_0 . format in ( 'ps' , 'eps' ) : arg_3 = cairo . PSSurface ( arg_0 . _output_file ( arg_2 ) , * arg_1 ) elif arg_0 . format == 'svg' : arg_3 = cairo . SVGSurface ( arg_0 . _output_file ( arg_2 ) , * arg_1 ) elif arg_0 . format == 'surface' : arg_3 = arg_0 . target else : arg_3 = cairo . ImageSurface ( cairo . FORMAT_ARGB32 , * arg_1 ) return cairo . Context ( arg_3 )

def Func(arg_0, arg_1, arg_2):
        """
        Called when CairoCanvas needs a cairo context to draw on
        """
        if arg_0.format == 'pdf':
            arg_3 = cairo.PDFSurface(arg_0._output_file(arg_2), *arg_1)
        elif arg_0.format in ('ps', 'eps'):
            arg_3 = cairo.PSSurface(arg_0._output_file(arg_2), *arg_1)
        elif arg_0.format == 'svg':
            arg_3 = cairo.SVGSurface(arg_0._output_file(arg_2), *arg_1)
        elif arg_0.format == 'surface':
            arg_3 = arg_0.target
        else:
            arg_3 = cairo.ImageSurface(cairo.FORMAT_ARGB32, *arg_1)
        return cairo.Context(arg_3)


(
            self, location_name, operation_id, last_backup_name, 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):
        """Completes the restore operation on a managed database.

        :param location_name: The name of the region where the resource is
         located.
        :type location_name: str
        :param operation_id: Management operation id that this request tries
         to complete.
        :type operation_id: str
        :param last_backup_name: The last backup name to apply
        :type last_backup_name: str
        :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 None or
         ClientRawResponse<None> if raw==True
        :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
        :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):
            if arg_5:
                arg_10 = ClientRawResponse(None, arg_9)
                return arg_10

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

Completes the restore operation on a managed database .


(script, cell_size=1.0, strategy='AVERAGE', selected=False)

def Func(arg_0, arg_1=1.0, arg_2='AVERAGE', arg_3=False):
    """ "Create a new layer populated with a subsampling of the vertexes of the
        current mesh

    The subsampling is driven by a simple one-per-gridded cell strategy.

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        cell_size (float): The size of the cell of the clustering grid. Smaller the cell finer the resulting mesh. For obtaining a very coarse mesh use larger values.
        strategy (enum 'AVERAGE' or 'CENTER'): Average: for each cell we take the average of the sample falling into. The resulting point is a new point.
Closest to center: for each cell we take the sample that is closest to the center of the cell. Choosen vertices are a subset of the original ones.
        selected (bool): If true only for the filter is applied only on the selected subset of the mesh.

    Layer stack:
        Creates new layer 'Cluster Samples'. Current layer is changed to the new
            layer.

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    if arg_2.lower() == 'average':
        arg_4 = 0
    elif arg_2.lower() == 'center':
        arg_4 = 1

    arg_5 = ''.join([
        '  <filter name="Clustered Vertex Subsampling">\n',
        '    <Param name="Threshold" ',
        'value="{}" '.format(arg_1),
        'description="Cell Size" ',
        'min="0" ',
        'max="1000" ',
        'type="RichAbsPerc" ',
        '/>\n',
        '    <Param name="Sampling" ',
        'value="{:d}" '.format(arg_4),
        'description="Representative Strategy:" ',
        'enum_val0="Average" ',
        'enum_val1="Closest to center" ',
        'enum_cardinality="2" ',
        'type="RichEnum" ',
        '/>\n',
        '    <Param name="Selected" ',
        'value="{}" '.format(str(arg_3).lower()),
        'description="Selected" ',
        'type="RichBool" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(arg_0, arg_5)
    if isinstance(arg_0, FilterScript):
        arg_0.add_layer('Cluster Samples')
    return None


(input_doc, output_format, serialize=True, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
,
**
arg_3
)
:
try
:
arg_4
=
FORMATS
[
arg_1
]
except
KeyError
:
raise
ValueError
(
"Unrecognized output format %s"
%
arg_1
)
arg_0
=
ensure_format
(
arg_0
,
arg_4
.
input_format
)
arg_5
=
arg_4
.
func
(
arg_0
,
**
arg_3
)
if
arg_2
:
arg_5
=
arg_4
.
serializer
(
arg_5
)
return
arg_5

def Func(arg_0, arg_1, arg_2=True, **arg_3):
    """
    Convert an Open511 document between formats.
    input_doc - either an lxml open511 Element or a deserialized JSON dict
    output_format - short string name of a valid output format, as listed above
    """

    try:
        arg_4 = FORMATS[arg_1]
    except KeyError:
        raise ValueError("Unrecognized output format %s" % arg_1)

    arg_0 = ensure_format(arg_0, arg_4.input_format)

    arg_5 = arg_4.func(arg_0, **arg_3)
    if arg_2:
        arg_5 = arg_4.serializer(arg_5)
    return arg_5

Convert an Open511 document between formats . input_doc - either an lxml open511 Element or a deserialized JSON dict output_format - short string name of a valid output format as listed above


def Func ( arg_0 ) : arg_1 = { las . points . dtype for las in arg_0 } return len ( arg_1 ) == 1

def Func(arg_0):
    """ Returns true if all the files have the same numpy datatype
    """
    arg_1 = {las.points.dtype for las in arg_0}
    return len(arg_1) == 1


def Func(arg_0, arg_1: arg_2.Program) -> arg_2.VertexArray:
        """
        Obtain the ``moderngl.VertexArray`` Func for the program.
        The Func is only created once and cached internally.

        Returns: ``moderngl.VertexArray`` Func
        """
        arg_4 = arg_0.vaos.get(arg_1.glo)
        if arg_4:
            return arg_4

        arg_5 = [name for name, attr in arg_1._members.items() if isFunc(attr, arg_2.Attribute)]

        # Make sure all attributes are covered
        for arg_6 in arg_5:
            # Ignore built in attributes for now
            if arg_6.startswith('gl_'):
                continue

            # Do we have a buffer mapping to this attribute?
            if not sum(arg_7.has_attribute(arg_6) for arg_7 in arg_0.buffers):
                raise VAOError("VAO {} doesn't have attribute {} for program {}".format(
                    arg_0.name, arg_6, arg_1.name))

        arg_8 = []

        # Pick out the attributes we can actually map
        for arg_7 in arg_0.buffers:
            arg_9 = arg_7.content(arg_5)
            if arg_9:
                arg_8.append(arg_9)

        # Any attribute left is not accounted for
        if arg_5:
            for arg_6 in arg_5:
                if arg_6.startswith('gl_'):
                    continue

                raise VAOError("Did not find a buffer mapping for {}".format([arg_10 for arg_10 in arg_5]))

        # Create the vao
        if arg_0._index_buffer:
            arg_4 = context.ctx().vertex_array(arg_1, arg_8,
                                             arg_0._index_buffer, arg_0._index_element_size)
        else:
            arg_4 = context.ctx().vertex_array(arg_1, arg_8)

        arg_0.vaos[arg_1.glo] = arg_4
        return arg_4

Obtain the ``moderngl.VertexArray`` instance for the program.
        The instance is only created once and cached internally.

        Returns: ``moderngl.VertexArray`` instance

Obtain the moderngl . VertexArray instance for the program . The instance is only created once and cached internally .


def Func(arg_0, arg_1):
        """Helper function to call write_data on the provided FTDI device and
        verify it succeeds.
        """
        # Get modem status. Useful to enable for debugging.
        #ret, status = ftdi.poll_modem_status(self._ctx)
        #if ret == 0:
        #	logger.debug('Modem status {0:02X}'.format(status))
        #else:
        #	logger.debug('Modem status error {0}'.format(ret))
        arg_2 = len(arg_1)
        try:
            arg_3 = ftdi.write_data(arg_0._ctx, arg_1, arg_2)
        except TypeError:
            arg_3 = ftdi.write_data(arg_0._ctx, arg_1); #compatible with libFtdi 1.3
        # Log the string that was written in a python hex string format using a very
        # ugly one-liner list comprehension for brevity.
        #logger.debug('Wrote {0}'.format(''.join(['\\x{0:02X}'.format(ord(x)) for x in string])))
        if arg_3 < 0:
            raise RuntimeError('ftdiFunc_data failed with error {0}: {1}'.format(arg_3, ftdi.get_error_string(arg_0._ctx)))
        if arg_3 != arg_2:
            raise RuntimeError('ftdiFunc_data expected to write {0} bytes but actually wrote {1}!'.format(arg_2, arg_3))

Helper function to call write_data on the provided FTDI device and verify it succeeds .


return self.model.objects.filter(
            Q(end_repeat=None) | Q(end_repeat__gte=now) |
            Q(start_date__gte=now) | Q(end_date__gte=now)
        ).exclude(  # exclude single day events that won't occur again
            start_date__lt=now, end_date__lt=now,
            repeat="NEVER", end_repeat=None,
        ).prefetch_related('cancellations')

def Func ( arg_0 , arg_1 ) : return arg_0 . model . objects . filter ( Q ( end_repeat = None ) | Q ( end_repeat__gte = arg_1 ) | Q ( start_date__gte = arg_1 ) | Q ( end_date__gte = arg_1 ) ) . exclude ( start_date__lt = arg_1 , end_date__lt = arg_1 , repeat = "NEVER" , end_repeat = None , ) . prefetch_related ( 'cancellations' )

def Func(arg_0, arg_1):
        """
        Returns a queryset of events that will occur again after 'now'.
        Used to help generate a list of upcoming events.
        """
        return arg_0.model.objects.filter(
            Q(end_repeat=None) | Q(end_repeat__gte=arg_1) |
            Q(start_date__gte=arg_1) | Q(end_date__gte=arg_1)
        ).exclude(  # exclude single day events that won't occur again
            start_date__lt=arg_1, end_date__lt=arg_1,
            repeat="NEVER", end_repeat=None,
        ).prefetch_related('cancellations')

Returns a queryset of events that will occur again after now . Used to help generate a list of upcoming events .


def Func ( arg_0 , arg_1 ) : if arg_0 is not None and len ( arg_0 ) > arg_1 : arg_0 = arg_0 [ : arg_1 ] + "..." return arg_0

def Func(arg_0, arg_1):
  """ Abbreviate the given text to threshold chars and append an ellipsis if its
  length exceeds threshold; used for logging;

  NOTE: the resulting text could be longer than threshold due to the ellipsis
  """
  if arg_0 is not None and len(arg_0) > arg_1:
    arg_0 = arg_0[:arg_1] + "..."

  return arg_0

Abbreviate the given text to threshold chars and append an ellipsis if its length exceeds threshold ; used for logging ;


def Func ( arg_0 ) -> Iterable [ BaseEntity ] : for arg_1 in arg_0 . graph : if arg_0 . tag in arg_0 . graph . nodes [ arg_1 ] : continue if not any ( arg_0 . tag not in arg_0 . graph . nodes [ arg_2 ] for arg_2 in arg_0 . graph . predecessors ( arg_1 ) ) : yield arg_1

def Func(arg_0) -> Iterable[BaseEntity]:
        """Return an iterable over all nodes that are leaves.

        A node is a leaf if either:

         - it doesn't have any predecessors, OR
         - all of its predecessors have a score in their data dictionaries
        """
        for arg_1 in arg_0.graph:
            if arg_0.tag in arg_0.graph.nodes[arg_1]:
                continue

            if not any(arg_0.tag not in arg_0.graph.nodes[arg_2] for arg_2 in arg_0.graph.predecessors(arg_1)):
                yield arg_1

Return an iterable over all nodes that are leaves .


def Func ( arg_0 ) : with db . session . begin_nested ( ) : Membership . query_by_group ( arg_0 ) . Func ( ) GroupAdmin . query_by_group ( arg_0 ) . Func ( ) GroupAdmin . query_by_admin ( arg_0 ) . Func ( ) db . session . Func ( arg_0 )

def Func(arg_0):
        """Delete a group and all associated memberships."""
        with db.session.begin_nested():
            Membership.query_by_group(arg_0).Func()
            GroupAdmin.query_by_group(arg_0).Func()
            GroupAdmin.query_by_admin(arg_0).Func()
            db.session.Func(arg_0)

Delete a group and all associated memberships .


def
Func
(
arg_0
,
**
arg_1
)
:
arg_0
.
_fill_project_info
(
arg_1
)
arg_0
.
db
.
Task
.
delete_many
(
arg_1
)
logging
.
info
(
"[Database] Delete Task SUCCESS"
)

def Func(arg_0, **arg_1):
        """Delete tasks.

        Parameters
        -----------
        kwargs : logging information
            Find items to delete, leave it empty to delete all log.

        Examples
        ---------
        >>> db.Func()

        """

        arg_0._fill_project_info(arg_1)
        arg_0.db.Task.delete_many(arg_1)
        logging.info("[Database] Delete Task SUCCESS")

Delete tasks.

        Parameters
        -----------
        kwargs : logging information
            Find items to delete, leave it empty to delete all log.

        Examples
        ---------
        >>> db.delete_tasks()


def Func(arg_0, arg_1):
        ''' Sets up the timeout for the request. '''
        arg_2 = int(arg_1 * 1000)
        _WinHttpRequest._SetTimeouts(
            arg_0, 0, arg_2, arg_2, arg_2)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
if
arg_0
.
ndim
==
2
:
if
arg_2
is
:
arg_2
=
1
if
arg_1
is
:
arg_1
=
1
arg_0
=
arg_0
[
:
int
(
arg_0
.
shape
[
0
]
//
arg_1
)
*
arg_1
,
:
int
(
arg_0
.
shape
[
1
]
//
arg_2
)
*
arg_2
]
arg_0
=
arg_0
.
reshape
(
(
arg_0
.
shape
[
0
]
//
arg_1
,
arg_1
,
arg_0
.
shape
[
1
]
//
arg_2
,
arg_2
)
)
arg_0
=
arg_0
.
mean
(
axis
=
3
)
arg_0
=
arg_0
.
mean
(
axis
=
1
)
elif
arg_0
.
ndim
==
1
:
arg_0
=
arg_0
[
:
int
(
arg_0
.
shape
[
0
]
//
arg_1
)
*
arg_1
]
arg_0
=
arg_0
.
reshape
(
(
arg_0
.
shape
[
0
]
//
arg_1
,
arg_1
)
)
arg_0
=
arg_0
.
mean
(
axis
=
1
)
else
:
raise
RuntimeError
(
"Only NDIM <= 2 supported"
)
return
arg_0

def Func(arg_0, arg_1, arg_2=None):
    """ Rebin data by averaging bins together

    Args:
    d (np.array): data
    n_x (int): number of bins in x dir to Func into one
    n_y (int): number of bins in y dir to Func into one

    Returns:
    d: Funcned data with shape (n_x, n_y)
    """

    if arg_0.ndim == 2:
        if arg_2 is None:
            arg_2 = 1
        if arg_1 is None:
            arg_1 = 1
        arg_0 = arg_0[:int(arg_0.shape[0] // arg_1) * arg_1, :int(arg_0.shape[1] // arg_2) * arg_2]
        arg_0 = arg_0.reshape((arg_0.shape[0] // arg_1, arg_1, arg_0.shape[1] // arg_2, arg_2))
        arg_0 = arg_0.mean(axis=3)
        arg_0 = arg_0.mean(axis=1)
    elif arg_0.ndim == 1:
        arg_0 = arg_0[:int(arg_0.shape[0] // arg_1) * arg_1]
        arg_0 = arg_0.reshape((arg_0.shape[0] // arg_1, arg_1))
        arg_0 = arg_0.mean(axis=1)
    else:
        raise RuntimeError("Only NDIM <= 2 supported")
    return arg_0

Rebin data by averaging bins together

    Args:
    d (np.array): data
    n_x (int): number of bins in x dir to rebin into one
    n_y (int): number of bins in y dir to rebin into one

    Returns:
    d: rebinned data with shape (n_x, n_y)


def Func(arg_0, arg_1):
    """Create a GitHub token for an integration installation.

    Parameters
    ----------
    installation_id : `int`
        Installation ID. This is available in the URL of the integration's
        **installation** ID.
    integration_jwt : `bytes`
        The integration's JSON Web Token (JWT). You can create this with
        `create_jwt`.

    Returns
    -------
    token_obj : `dict`
        GitHub token object. Includes the fields:

        - ``token``: the token string itself.
        - ``expires_at``: date time string when the token expires.

    Example
    -------
    The typical workflow for authenticating to an integration installation is:

    .. code-block:: python

       from dochubadapter.github import auth
       jwt = auth.create_jwt(integration_id, private_key_path)
       token_obj = auth.Func(installation_id, jwt)
       print(token_obj['token'])

    Notes
    -----
    See
    https://developer.github.com/early-access/integrations/authentication/#as-an-installation
    for more information
    """
    arg_2 = 'https://api.github.com'
    arg_3 = '{root}/installations/{id_:d}/access_tokens'.format(
        arg_2=arg_2,
        id_=arg_0)

    arg_4 = {
        'Authorization': 'Bearer {0}'.format(arg_1.decode('utf-8')),
        'Accept': 'application/vnd.github.machine-man-preview+json'
    }

    arg_5 = requests.post(arg_3, arg_4=arg_4)
    arg_5.raise_for_status()
    return arg_5.json()

Create a GitHub token for an integration installation.

    Parameters
    ----------
    installation_id : `int`
        Installation ID. This is available in the URL of the integration's
        **installation** ID.
    integration_jwt : `bytes`
        The integration's JSON Web Token (JWT). You can create this with
        `create_jwt`.

    Returns
    -------
    token_obj : `dict`
        GitHub token object. Includes the fields:

        - ``token``: the token string itself.
        - ``expires_at``: date time string when the token expires.

    Example
    -------
    The typical workflow for authenticating to an integration installation is:

    .. code-block:: python

       from dochubadapter.github import auth
       jwt = auth.create_jwt(integration_id, private_key_path)
       token_obj = auth.get_installation_token(installation_id, jwt)
       print(token_obj['token'])

    Notes
    -----
    See
    https://developer.github.com/early-access/integrations/authentication/#as-an-installation
    for more information

Create a GitHub token for an integration installation .


(setter, x, y, w, h, r, color=None, aa=False)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6=None, arg_7=False):
    """Draw rectangle with top-left corner at x,y, width w, height h,
    and corner radius r.
    """
    _draw_fast_hline(arg_0, arg_1 + arg_5, arg_2, arg_3 - 2 * arg_5, arg_6, arg_7)  # Top
    _draw_fast_hline(arg_0, arg_1 + arg_5, arg_2 + arg_4 - 1, arg_3 - 2 * arg_5, arg_6, arg_7)  # Bottom
    _draw_fast_vline(arg_0, arg_1, arg_2 + arg_5, arg_4 - 2 * arg_5, arg_6, arg_7)  # Left
    _draw_fast_vline(arg_0, arg_1 + arg_3 - 1, arg_2 + arg_5, arg_4 - 2 * arg_5, arg_6, arg_7)  # Right
    # draw four corners
    _draw_circle_helper(arg_0, arg_1 + arg_5, arg_2 + arg_5, arg_5, 1, arg_6, arg_7)
    _draw_circle_helper(arg_0, arg_1 + arg_3 - arg_5 - 1, arg_2 + arg_5, arg_5, 2, arg_6, arg_7)
    _draw_circle_helper(arg_0, arg_1 + arg_3 - arg_5 - 1, arg_2 + arg_4 - arg_5 - 1, arg_5, 4, arg_6, arg_7)
    _draw_circle_helper(arg_0, arg_1 + arg_5, arg_2 + arg_4 - arg_5 - 1, arg_5, 8, arg_6, arg_7)

Draw rectangle with top - left corner at x y width w height h and corner radius r .


def Func(arg_0):
    r"""Riesz tapering window

    :param N: window length

    .. math:: w(n) = 1 - \left| \frac{n}{N/2}  \right|^2

    with :math:`-N/2 \leq n \leq N/2`.

    .. plot::
        :width: 80%
        :include-source:

        from spectrum import window_visu
        window_visu(64, 'riesz')

    .. seealso:: :func:`create_window`, :class:`Window`
    """
    arg_1 = linspace(-arg_0/2., (arg_0)/2., arg_0)

    arg_2 = 1 - abs(arg_1/(arg_0/2.))**2.
    return arg_2


def Func(arg_0, **arg_1):
        """Sets properties like ``v_fast_access``.

        For example: ``traj.Func(v_fast_access=True, v_auto_load=False)``

        """
        for arg_2 in arg_1:
            arg_3 = arg_1[arg_2]
            if not arg_2.startswith('v_'):
                arg_2 = 'v_' + arg_2
            if not arg_2 in arg_0._nn_interface._not_admissible_names:
                raise AttributeError('Cannot set property `%s` does not exist.' % arg_2)
            else:
                setattr(arg_0, arg_2, arg_3)

Sets properties like ``v_fast_access``.

        For example: ``traj.f_set_properties(v_fast_access=True, v_auto_load=False)``


def Func ( arg_0 ) : arg_1 = arg_0 . request . protocol . replace ( 'http' , 'ws' ) arg_2 = arg_0 . application . ipython_app . websocket_host if arg_2 == '' : arg_2 = arg_0 . request . host return "%s://%s" % ( arg_1 , arg_2 )

def Func(arg_0):
        """websocket url matching the current request

        turns http[s]://host[:port] into
                ws[s]://host[:port]
        """
        arg_1 = arg_0.request.protocol.replace('http', 'ws')
        arg_2 = arg_0.application.ipython_app.websocket_host # default to config value
        if arg_2 == '':
            arg_2 = arg_0.request.host # get from request
        return "%s://%s" % (arg_1, arg_2)


def Func(arg_0):
        """Retrieves the current credentials from the store.

        Returns:
            An instance of :class:`oauth2client.client.Credentials` or `None`.
        """
        arg_1 = arg_0._backend.Func(arg_0._key)

        if arg_1 is not None:
            arg_1.set_store(arg_0)

        return arg_1

Retrieves the current credentials from the store .