def Func ( arg_0 ) : arg_1 = { } if arg_0 . algorithm in arg_0 . valid_algorithms : if arg_0 . algorithm == "all" : del arg_0 . valid_algorithms [ 0 ] for arg_2 in arg_0 . valid_algorithms : if arg_0 . path and path . isfile ( arg_0 . path ) : arg_1 [ arg_2 ] = arg_0 . _hash_file ( arg_2 ) elif arg_0 . data : arg_1 [ arg_2 ] = arg_0 . _hash_data ( arg_2 ) else : return None else : if arg_0 . path and path . isfile ( arg_0 . path ) : arg_1 [ arg_0 . algorithm ] = arg_0 . _hash_file ( arg_0 . algorithm ) elif arg_0 . data : arg_1 [ arg_0 . algorithm ] = arg_0 . _hash_data ( arg_0 . algorithm ) else : return None else : return None if arg_0 . algorithm != "all" and arg_0 . only_hash : return arg_1 [ arg_0 . algorithm ] return arg_1

def Func(arg_0):
        """
        Return the hash of the given file
        """

        # We initiate a variable which will save the result we are going
        # to return.
        arg_1 = {}

        if arg_0.algorithm in arg_0.valid_algorithms:
            # * The parsed path exist.
            # and
            # * The parsed algorithm is in the list of valid algorithms.

            if arg_0.algorithm == "all":
                # The parsed algorithm is `all`.

                # We remove `all` (the first element of the list) from
                # the list of valid algorithms because we are going to
                # loop through the list of valid algorithms.
                del arg_0.valid_algorithms[0]

                for arg_2 in arg_0.valid_algorithms:
                    # We loop through the list of valid algorithms.

                    if arg_0.path and path.isfile(arg_0.path):
                        # The file path exist.

                        # We save the hash into the result variable.
                        arg_1[arg_2] = arg_0._hash_file(arg_2)
                    elif arg_0.data:
                        # * The path does not exist.
                        # and
                        # * The given data is not empty.

                        # We save the hash into the result variable.
                        arg_1[arg_2] = arg_0._hash_data(arg_2)
                    else:  # pragma: no cover
                        # All other case are met.

                        # We return None.
                        return None
            else:
                # The parsed algorithm is a specific one.

                if arg_0.path and path.isfile(arg_0.path):
                    # The file path exist.

                    # We save the hash into the result variable.
                    arg_1[arg_0.algorithm] = arg_0._hash_file(arg_0.algorithm)
                elif arg_0.data:
                    # * The path does not exist.
                    # and
                    # * The given data is not empty.

                    # We save the hash into the result variable.
                    arg_1[arg_0.algorithm] = arg_0._hash_data(arg_0.algorithm)
                else:
                    # All the other case are met.

                    # We return None.
                    return None
        else:  # pragma: no cover
            # The parsed algorithm is not in the list of valid algorithms.
            return None

        if arg_0.algorithm != "all" and arg_0.only_hash:
            # * The parsed algorithm is not equal to `all`.
            # and
            # * We only have to return the selected hash.

            # We return the selected algorithm.
            return arg_1[arg_0.algorithm]

        # * The parsed algorithm is equal to `all`.
        # or
        # * We do not have to return the selected hash.

        # We return all hashes.
        return arg_1


def Func(arg_0):
        """Timeout of request rebinding on REBINDING state.

        Same comments as in
        :func:`dhcpcapfsm.DHCPCAPFSM.timeout_requesting`.

        """
        logger.debug("C6.2:T In %s, timeout receiving response to request.",
                     arg_0.current_state)
        if arg_0.request_attempts >= MAX_ATTEMPTS_REQUEST:
            logger.debug('C.2.3: T. Maximum number %s of REQUESTs '
                         'reached, already sent %s, wait lease time expires.',
                         MAX_ATTEMPTS_REQUEST, arg_0.disover_requests)
            # raise self.ERROR()
        logger.debug("C2.3: F. Maximum number of REQUESTs retries not reached,"
                     "raise REBINDING.")
        raise arg_0.REBINDING()

Timeout of request rebinding on REBINDING state .


Return true if the issue in question should be included

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . config . get ( 'only_if_assigned' , None ) if arg_2 : arg_3 = arg_0 . get_owner ( arg_1 ) arg_4 = [ arg_2 ] if arg_0 . config . get ( 'also_unassigned' , None , asbool ) : arg_4 . append ( None ) return arg_3 in arg_4 arg_5 = arg_0 . config . get ( 'only_if_author' , None ) if arg_5 : return arg_0 . get_author ( arg_1 ) == arg_5 return True

def Func(arg_0, arg_1):
        """ Return true if the issue in question should be Funcd """
        arg_2 = arg_0.config.get('only_if_assigned', None)

        if arg_2:
            arg_3 = arg_0.get_owner(arg_1)
            arg_4 = [arg_2]

            if arg_0.config.get('also_unassigned', None, asbool):
                arg_4.append(None)

            return arg_3 in arg_4

        arg_5 = arg_0.config.get('only_if_author', None)

        if arg_5:
            return arg_0.get_author(arg_1) == arg_5

        return True


def Func(*arg_0):
    """
    Cinder annotation for adding function to process Func notification.

    if event_type include wildcard, will put {pattern: function} into process_wildcard dict
    else will put {event_type: function} into process dict

    :param arg: event_type of notification
    """
    check_event_type(Openstack.Cinder, *arg_0)
    arg_1 = arg_0[0]

    def decorator(arg_2):
        if arg_1.find("*") != -1:
            arg_3 = pre_compile(arg_1)
            arg_4[arg_3] = arg_2
        else:
            arg_5[arg_1] = arg_2
        log.info("add function {0} to process event_type:{1}".format(arg_2.__name__, arg_1))

        @functools.wraps(arg_2)
        def wrapper(*arg_6, **arg_7):
            arg_2(*arg_6, **arg_7)

        return wrapper

    return decorator

Cinder annotation for adding function to process cinder notification.

    if event_type include wildcard, will put {pattern: function} into process_wildcard dict
    else will put {event_type: function} into process dict

    :param arg: event_type of notification

Cinder annotation for adding function to process cinder notification .


def Func(arg_0, arg_1, arg_2):
        """
        Adds a change to this change set.

        :param str action: Must be one of either 'CREATE' or 'DELETE'.
        :param resource_record_set.ResourceRecordSet record_set: The
            ResourceRecordSet object that was created or deleted.
        """

        arg_1 = arg_1.upper()

        if arg_1 not in ['CREATE', 'DELETE']:
            raise Route53Error("action must be one of 'CREATE' or 'DELETE'")

        arg_3 = (arg_1, arg_2)

        if arg_1 == 'CREATE':
            arg_0.creations.append(arg_3)
        else:
            arg_0.deletions.append(arg_3)


(cls, whois_server, domain=None, timeout=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if arg_2 is None : arg_2 = PyFunceble . INTERN [ "to_test" ] if arg_3 is None : arg_3 = PyFunceble . CONFIGURATION [ "seconds_before_http_timeout" ] if arg_1 : arg_4 = PyFunceble . socket . socket ( PyFunceble . socket . AF_INET , PyFunceble . socket . SOCK_STREAM ) if arg_3 % 3 == 0 : arg_4 . settimeout ( arg_3 ) else : arg_4 . settimeout ( 3 ) try : arg_4 . connect ( ( arg_1 , 43 ) ) except PyFunceble . socket . error : return None arg_4 . send ( ( arg_2 + "\r\n" ) . encode ( ) ) arg_5 = b"" while True : try : arg_6 = arg_4 . recv ( 4096 ) except ( PyFunceble . socket . timeout , ConnectionResetError ) : arg_4 . close ( ) return None arg_5 += arg_6 if not arg_6 : break arg_4 . close ( ) try : return arg_5 . decode ( ) except UnicodeDecodeError : return arg_5 . decode ( "utf-8" , "replace" ) return None

def Func(arg_0, arg_1, arg_2=None, arg_3=None):  # pragma: no cover
        """
        Implementation of UNIX Func.

        :param Func_server: The WHOIS server to use to get the record.
        :type Func_server: str

        :param domain: The domain to get the Func record from.
        :type domain: str

        :param timeout: The timeout to apply to the request.
        :type timeout: int

        :return: The Func record from the given Func server, if exist.
        :rtype: str|None
        """

        if arg_2 is None:
            # The domain is not given (localy).

            # We consider the domain as the domain or IP we are currently testing.
            arg_2 = PyFunceble.INTERN["to_test"]

        if arg_3 is None:
            # The time is not given (localy).

            # We consider the timeout from the configuration as the timeout to use.
            arg_3 = PyFunceble.CONFIGURATION["seconds_before_http_timeout"]

        if arg_1:
            # A Func server is given.

            # We initiate a PyFunceble.socket.
            arg_4 = PyFunceble.socket.socket(
                PyFunceble.socket.AF_INET, PyFunceble.socket.SOCK_STREAM
            )

            if arg_3 % 3 == 0:
                # The timeout is modulo 3.

                # We report the timeout to our initiated PyFunceble.socket.
                arg_4.settimeout(arg_3)
            else:
                # The timeout is not modulo 3.

                # We report 3 seconds as the timeout to our initiated PyFunceble.socket.
                arg_4.settimeout(3)

            try:
                # We try to connect to the Func server at the port 43.
                arg_4.connect((arg_1, 43))
            except PyFunceble.socket.error:
                # We got an error.

                # We return None.
                return None

            # We send end encode the domain we want the data from.
            arg_4.send((arg_2 + "\r\n").encode())

            # We initiate a bytes variable which will save the response
            # from the server.
            arg_5 = b""

            while True:
                # We loop infinitly.
                try:
                    # We try to receive the data in a buffer of 4096 bytes.
                    arg_6 = arg_4.recv(4096)
                except (PyFunceble.socket.timeout, ConnectionResetError):
                    # We got an error.

                    # We close the connection.
                    arg_4.close()

                    # And we return None.
                    return None

                # Everything goes right.

                # We append data to the response we got.
                arg_5 += arg_6

                if not arg_6:
                    # The data is empty.

                    # We break the loop.
                    break

            # We close the connection.
            arg_4.close()

            try:

                # We finally decode and return the response we got from the
                # server.
                return arg_5.decode()

            except UnicodeDecodeError:
                # We got an encoding error.

                # We decode the response.
                # Note: Because we don't want to deal with other issue, we
                # decided to use `replace` in order to automatically replace
                # all non utf-8 encoded characters.
                return arg_5.decode("utf-8", "replace")

        # The Func server is not given.

        # We return None.
        return None

Implementation of UNIX whois.

        :param whois_server: The WHOIS server to use to get the record.
        :type whois_server: str

        :param domain: The domain to get the whois record from.
        :type domain: str

        :param timeout: The timeout to apply to the request.
        :type timeout: int

        :return: The whois record from the given whois server, if exist.
        :rtype: str|None


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_2 = arg_2 or arg_0 . filter_size if not arg_0 . clip : arg_3 = np . exp ( - arg_1 / ( 2 * arg_2 ** 2 ) ) else : arg_3 = np . zeros ( arg_1 . shape , dtype = 'float' ) arg_4 = ( arg_1 < arg_0 . clipsize ** 2 ) arg_3 [ arg_4 ] = np . exp ( - arg_1 [ arg_4 ] / ( 2 * arg_2 ** 2 ) ) return arg_3

def Func(arg_0, arg_1, arg_2=None):
        """weighting function for Barnes"""
        arg_2 = arg_2 or arg_0.filter_size

        if not arg_0.clip:
            arg_3 = np.exp(-arg_1 / (2*arg_2**2))
        else:
            arg_3 = np.zeros(arg_1.shape, dtype='float')
            arg_4 = (arg_1 < arg_0.clipsize**2)
            arg_3[arg_4] = np.exp(-arg_1[arg_4] / (2*arg_2**2))
        return arg_3


def Func ( arg_0 , arg_1 ) : arg_2 = not bool ( launch_R_script ( "{}/R_templates/test_import.R" . format ( os . path . dirname ( os . path . realpath ( __file__ ) ) ) , { "{package}" : arg_1 } , verbose = True ) ) return arg_2

def Func(arg_0, arg_1):
        """Execute a subprocess to check the package's availability.

        Args:
            package (str): Name of the package to be tested.

        Returns:
            bool: `True` if the package is available, `False` otherwise
        """
        arg_2 = not bool(launch_R_script("{}/R_templates/test_import.R".format(os.path.dirname(os.path.realpath(__file__))),                                      {"{package}": arg_1}, verbose=True))
        return arg_2

Execute a subprocess to check the package s availability .


return self._mc_client._put(url=self._build_path(list_id, 'members', subscriber_hash), data=data)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Add or update a list member.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
            list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "email_address": string*,
            "status_if_new": string* (Must be one of 'subscribed',
                'unsubscribed', 'cleaned', 'pending', or 'transactional')
        }
        """
        arg_2 = check_subscriber_hash(arg_2)
        arg_0.list_id = arg_1
        arg_0.subscriber_hash = arg_2
        if 'email_address' not in arg_3:
            raise KeyError('The list member must have an email_address')
        check_email(arg_3['email_address'])
        if 'status_if_new' not in arg_3:
            raise KeyError('The list member must have a status_if_new')
        if arg_3['status_if_new'] not in ['subscribed', 'unsubscribed', 'cleaned', 'pending', 'transactional']:
            raise ValueError('The list member status_if_new must be one of "subscribed", "unsubscribed", "cleaned", '
                             '"pending", or "transactional"')
        return arg_0._mc_client._put(url=arg_0._build_path(arg_1, 'members', arg_2), arg_3=arg_3)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . format ( 1 ) arg_4 = os . path . join ( os . path . dirname ( arg_3 ) , 'thumb' ) if not os . path . exists ( arg_4 ) : os . makedirs ( arg_4 ) arg_5 = os . path . join ( arg_4 , 'sphx_glr_%s_thumb.png' % arg_1 ) if os . path . exists ( arg_3 ) : scale_image ( arg_3 , arg_5 , 400 , 280 ) elif not os . path . exists ( arg_5 ) : arg_6 = os . path . join ( glr_path_static ( ) , 'no_image.png' ) arg_6 = arg_2 . get ( "default_thumb_file" , arg_6 ) scale_image ( arg_6 , arg_5 , 200 , 140 )

def Func(arg_0, arg_1, arg_2):
    """Save the thumbnail image"""
    arg_3 = arg_0.format(1)
    arg_4 = os.path.join(os.path.dirname(arg_3), 'thumb')
    if not os.path.exists(arg_4):
        os.makedirs(arg_4)

    arg_5 = os.path.join(arg_4,
                              'sphx_glr_%s_thumb.png' % arg_1)

    if os.path.exists(arg_3):
        scale_image(arg_3, arg_5, 400, 280)
    elif not os.path.exists(arg_5):
        # create something to replace the thumbnail
        arg_6 = os.path.join(glr_path_static(), 'no_image.png')
        arg_6 = arg_2.get("default_thumb_file",
                                              arg_6)
        scale_image(arg_6, arg_5, 200, 140)


(email, size=GRAVATAR_DEFAULT_SIZE, default=GRAVATAR_DEFAULT_IMAGE,
        rating=GRAVATAR_DEFAULT_RATING, secure=GRAVATAR_DEFAULT_SECURE)

def Func ( arg_0 , arg_1 = arg_2 , arg_3 = arg_4 , arg_5 = arg_6 , arg_7 = arg_8 ) : if arg_7 : arg_9 = GRAVATAR_SECURE_URL else : arg_9 = GRAVATAR_URL arg_10 = calculate_gravatar_hash ( arg_0 ) arg_11 = urlencode ( { 's' : str ( arg_1 ) , 'd' : arg_3 , 'r' : arg_5 , } ) arg_12 = '{base}avatar/{hash}.jpg?{qs}' . format ( base = arg_9 , hash = arg_10 , qs = arg_11 ) return arg_12

def Func(arg_0, arg_1=arg_2, arg_3=arg_4,
        arg_5=arg_6, arg_7=arg_8):
    """
    Builds a url to a gravatar from an email address.

    :param email: The email to fetch the gravatar for
    :param size: The size (in pixels) of the gravatar to fetch
    :param default: What type of default image to use if the gravatar does not exist
    :param rating: Used to filter the allowed gravatar ratings
    :param secure: If True use https, otherwise plain http
    """
    if arg_7:
        arg_9 = GRAVATAR_SECURE_URL
    else:
        arg_9 = GRAVATAR_URL

    # Calculate the email hash
    arg_10 = calculate_gravatar_hash(arg_0)

    # Build querystring
    arg_11 = urlencode({
        's': str(arg_1),
        'd': arg_3,
        'r': arg_5,
    })

    # Build url
    arg_12 = '{base}avatar/{hash}.jpg?{qs}'.format(base=arg_9,
            hash=arg_10, qs=arg_11)

    return arg_12

Builds a url to a gravatar from an email address .


def Func(arg_0, arg_1=True):
        """ Calculates betweenness centrality and returns an node id -> weight dictionary.
        Node betweenness weights are updated in the process.
        """
        arg_2 = proximity.brandes_Func(arg_0, arg_1)
        for arg_3, arg_4 in arg_2.iteritems(): arg_0[arg_3]._betweenness = arg_4
        return arg_2

Calculates betweenness centrality and returns an node id - > weight dictionary . Node betweenness weights are updated in the process .


def Func ( arg_0 ) : arg_1 = os . path . join ( arg_0 . rootdir , "datapackage.json" ) return os . path . exists ( arg_1 )

def Func(arg_0):
    """
    Check if the datapackage exists...
    """
    arg_1 = os.path.join(arg_0.rootdir, "datapackage.json")
    return os.path.exists(arg_1)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
for
arg_3
,
arg_3
,
arg_4
in
arg_0
.
graph
.
triples
(
(
arg_1
,
arg_2
,
)
)
:
arg_5
=
arg_0
.
get_file_name
(
arg_4
)
if
arg_5
is
not
:
arg_0
.
builder
.
add_file_dep
(
six
.
text_type
(
arg_5
)
)
else
:
arg_0
.
error
=
True
arg_7
=
'File depends on file with no name'
arg_0
.
logger
.
log
(
arg_7
)

def Func(arg_0, arg_1, arg_2):
        """Sets file dependencies."""
        for arg_3, arg_3, arg_4 in arg_0.graph.triples((arg_1, arg_2, None)):
            arg_5 = arg_0.get_file_name(arg_4)
            if arg_5 is not None:
                arg_0.builder.add_file_dep(six.text_type(arg_5))
            else:
                arg_0.error = True
                arg_7 = 'File depends on file with no name'
                arg_0.logger.log(arg_7)


def Func ( arg_0 ) : if arg_0 . formsets : for arg_1 in arg_0 . formsets . values ( ) : for arg_2 in arg_1 . forms : if arg_2 . Func ( ) : return True return bool ( arg_0 . changed_data )

def Func(arg_0):
        """Return True if data differs from initial."""

        # Need to recurse over nested formsets so that the form is saved if there are changes
        # to child forms but not the parent
        if arg_0.formsets:
            for arg_1 in arg_0.formsets.values():
                for arg_2 in arg_1.forms:
                    if arg_2.Func():
                        return True
        return bool(arg_0.changed_data)

Return True if data differs from initial .


def Func(arg_0):
    """Get currently used 'devpi' base URL."""
    arg_1 = 'devpi use --urls'
    arg_2 = arg_0.run(arg_1, hide='out', echo=False).stdout.splitlines()
    for arg_3 in arg_2:
        try:
            arg_3, arg_4 = arg_3.split(':', 1)
        except ValueError:
            notify.warning('Ignoring "{}"!'.format(arg_3))
        else:
            if arg_3.split()[-1].strip() == 'simpleindex':
                return arg_4.split('\x1b')[0].strip().rstrip('/')

    raise LookupError("Cannot find simpleindex URL in '{}' output:\n    {}".format(
        arg_1, '\n    '.join(arg_2),
    ))


def Func ( arg_0 , ** arg_1 ) : from pylab import Func , linspace , xlabel , ylabel , grid arg_2 = linspace ( 1 * arg_0 . dt , arg_0 . N * arg_0 . dt , arg_0 . N ) Func ( arg_2 , arg_0 . data , ** arg_1 ) xlabel ( 'Time' ) ylabel ( 'Amplitude' ) grid ( True )

def Func(arg_0, **arg_1):
        """Plot the data set, using the sampling information to set the x-axis
        correctly."""
        from pylab import Func, linspace, xlabel, ylabel, grid
        arg_2 = linspace(1*arg_0.dt, arg_0.N*arg_0.dt, arg_0.N)
        Func(arg_2, arg_0.data, **arg_1)
        xlabel('Time')
        ylabel('Amplitude')
        grid(True)

Plot the data set using the sampling information to set the x - axis correctly .


def Func(arg_0, arg_1, arg_2, arg_3=None):
    """
    SSH into to a host.

    :param entry: The host entry to pull the hostname from.
    :type entry: :py:class:`HostEntry`
    :param username: To use a specific username.
    :type username: ``str`` or ``NoneType``
    :param idfile: The SSH identity file to use, if supplying a username.
    :type idfile: ``str`` or ``NoneType``
    :param tunnel: Host to tunnel SSH command through.
    :type tunnel: ``str`` or ``NoneType``

    :return: An exit status code.
    :rtype: ``int``
    """
    if arg_0.hostname != "" and arg_0.hostname is not None:
        arg_4 = arg_0.hostname
    elif arg_0.public_ip != "" and arg_0.public_ip is not None:
        arg_4 = arg_0.public_ip
    elif arg_0.private_ip != "" and arg_0.private_ip is not None:
        if arg_3 is None:
            raise ValueError("Entry does not have a hostname or public IP. "
                             "You can connect via private IP if you use a "
                             "tunnel.")
        arg_4 = arg_0.private_ip
    else:
        raise ValueError("No hostname, public IP or private IP information "
                         "found on host entry. I don't know how to connect.")
    arg_5 = _build_ssh_command(arg_4, arg_1, arg_2, None, arg_3)
    print('Connecting to %s...' % cyan(arg_0.display()))
    print('SSH command: %s' % green(arg_5))
    arg_6 = subprocess.Popen(arg_5, shell=True)
    return arg_6.wait()


(
        rosdistro_name, jenkins_url, release_build_name, targets)

def Func(
        arg_0, arg_1, arg_2, arg_3):
    """
    Get the Jenkins job urls for each target.

    The placeholder {pkg} needs to be replaced with the ROS package name.

    :return: a dict indexed by targets containing a string
    """
    arg_4 = {}
    for arg_5 in arg_3:
        arg_6 = get_release_view_name(
            arg_0, arg_2,
            arg_5.os_name, arg_5.os_code_name, arg_5.arch)
        arg_7 = arg_1 + '/view/%s/job/%s__{pkg}__' % \
            (arg_6, arg_6)
        if arg_5.arch == 'source':
            arg_4[arg_5] = arg_7 + '%s_%s__source' % \
                (arg_5.os_name, arg_5.os_code_name)
        else:
            arg_4[arg_5] = arg_7 + '%s_%s_%s__binary' % \
                (arg_5.os_name, arg_5.os_code_name, arg_5.arch)
    return arg_4

Get the Jenkins job urls for each target .


def Func ( arg_0 , arg_1 = None ) : arg_2 = OlsClient ( arg_1 = arg_1 ) return arg_2 . iter_labels ( arg_0 )

def Func(arg_0, arg_1=None):
    """Iterates over the labels of terms in the ontology

    :param str ontology: The name of the ontology
    :param str ols_base: An optional, custom OLS base url
    :rtype: iter[str]
    """
    arg_2 = OlsClient(arg_1=arg_1)
    return arg_2.iter_labels(arg_0)


return self._ref_recursive(self.type_converter(schema_node), self.ref, base_name)

def Func(arg_0, arg_1, arg_2=None):
        """
        Creates a Swagger definition from a colander schema.

        :param schema_node:
            Colander schema to be transformed into a Swagger definition.
        :param base_name:
            Schema alternative title.

        :rtype: dict
        :returns: Swagger schema.
        """
        return arg_0._ref_recursive(arg_0.type_converter(arg_1), arg_0.ref, arg_2)

Creates a Swagger definition from a colander schema .


def Func ( arg_0 , arg_1 : arg_2 [ arg_3 ] , arg_4 : arg_5 ) -> Union [ arg_2 [ np . ndarray ] , np . ndarray ] : arg_6 = [ ] for arg_7 in arg_1 : try : arg_8 = arg_0 . tok2emb [ arg_7 ] except KeyError : try : arg_8 = arg_0 . _get_word_vector ( arg_7 ) except KeyError : arg_8 = np . zeros ( arg_0 . dim , dtype = np . float32 ) arg_0 . tok2emb [ arg_7 ] = arg_8 arg_6 . append ( arg_8 ) if arg_4 is None : arg_4 = arg_0 . mean if arg_4 : arg_10 = [ et for et in arg_6 if np . any ( et ) ] if arg_10 : return np . mean ( arg_10 , axis = 0 ) return np . zeros ( arg_0 . dim , dtype = np . float32 ) return arg_6

def Func(arg_0, arg_1: arg_2[arg_3], arg_4: arg_5) -> Union[arg_2[np.ndarray], np.ndarray]:
        """
        Embed one text sample

        Args:
            tokens: tokenized text sample
            mean: whether to return mean embedding of tokens per sample

        Returns:
            list of embedded tokens or array of mean values
        """
        arg_6 = []
        for arg_7 in arg_1:
            try:
                arg_8 = arg_0.tok2emb[arg_7]
            except KeyError:
                try:
                    arg_8 = arg_0._get_word_vector(arg_7)
                except KeyError:
                    arg_8 = np.zeros(arg_0.dim, dtype=np.float32)
                arg_0.tok2emb[arg_7] = arg_8
            arg_6.append(arg_8)

        if arg_4 is None:
            arg_4 = arg_0.mean

        if arg_4:
            arg_10 = [et for et in arg_6 if np.any(et)]
            if arg_10:
                return np.mean(arg_10, axis=0)
            return np.zeros(arg_0.dim, dtype=np.float32)

        return arg_6


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ arg_6 for arg_6 in arg_1 if arg_6 . value ] arg_4 = { 'INPUT_COUNT' : str ( len ( arg_3 ) ) } for arg_5 , arg_6 in enumerate ( arg_3 ) : arg_4 [ 'INPUT_{}' . format ( arg_5 ) ] = arg_6 . name arg_4 [ 'INPUT_RECURSIVE_{}' . format ( arg_5 ) ] = str ( int ( arg_6 . recursive ) ) arg_4 [ 'INPUT_SRC_{}' . format ( arg_5 ) ] = arg_6 . value arg_8 = os . path . join ( providers_util . DATA_MOUNT_POINT , arg_6 . docker_path ) arg_9 , arg_10 = os . path . split ( arg_8 ) if '*' in arg_10 : arg_8 = '{}/' . format ( arg_9 ) arg_4 [ 'INPUT_DST_{}' . format ( arg_5 ) ] = arg_8 arg_4 [ 'USER_PROJECT' ] = arg_2 return arg_4

def Func(arg_0, arg_1, arg_2):
    """Return a dict with variables for the 'localization' action."""

    # Add variables for paths that need to be localized, for example:
    # INPUT_COUNT: 1
    # INPUT_0: MY_INPUT_FILE
    # INPUT_RECURSIVE_0: 0
    # INPUT_SRC_0: gs://mybucket/mypath/myfile
    # INPUT_DST_0: /mnt/data/inputs/mybucket/mypath/myfile

    arg_3 = [arg_6 for arg_6 in arg_1 if arg_6.value]
    arg_4 = {'INPUT_COUNT': str(len(arg_3))}

    for arg_5, arg_6 in enumerate(arg_3):
      arg_4['INPUT_{}'.format(arg_5)] = arg_6.name
      arg_4['INPUT_RECURSIVE_{}'.format(arg_5)] = str(int(arg_6.recursive))
      arg_4['INPUT_SRC_{}'.format(arg_5)] = arg_6.value

      # For wildcard paths, the destination must be a directory
      arg_8 = os.path.join(providers_util.DATA_MOUNT_POINT, arg_6.docker_path)
      arg_9, arg_10 = os.path.split(arg_8)
      if '*' in arg_10:
        arg_8 = '{}/'.format(arg_9)
      arg_4['INPUT_DST_{}'.format(arg_5)] = arg_8

    arg_4['USER_PROJECT'] = arg_2

    return arg_4

Return a dict with variables for the localization action .


def Func ( arg_0 ) : arg_0 . _init_svd ( ) arg_1 = arg_0 . _C0 . Func ( ) [ "Lu" ] . T arg_2 = arg_0 . _C1 . Func ( ) [ "Lu" ] . T arg_3 = { "C0.Lu" : kron ( arg_1 , arg_0 . _X ) . T , "C1.Lu" : kron ( arg_2 , arg_0 . _I ) . T } return arg_3

def Func(arg_0):
        """
        Gradient of K.

        Returns
        -------
        C0 : ndarray
            Derivative of C₀ over its parameters.
        C1 : ndarray
            Derivative of C₁ over its parameters.
        """
        arg_0._init_svd()
        arg_1 = arg_0._C0.Func()["Lu"].T
        arg_2 = arg_0._C1.Func()["Lu"].T
        arg_3 = {"C0.Lu": kron(arg_1, arg_0._X).T, "C1.Lu": kron(arg_2, arg_0._I).T}
        return arg_3


(self, client_id, request, *args, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
*
arg_3
,
**
arg_4
)
:
arg_2
.
client
=
arg_2
.
client
or
arg_0
.
_clientgetter
(
arg_1
)
arg_6
=
arg_2
.
client
.
default_redirect_uri
log
.
debug
(
'Found default redirect uri %r'
,
arg_6
)
return
arg_6

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """Default redirect_uri for the given client."""
        arg_2.client = arg_2.client or arg_0._clientgetter(arg_1)
        arg_6 = arg_2.client.default_redirect_uri
        log.debug('Found default redirect uri %r', arg_6)
        return arg_6

Default redirect_uri for the given client .


(circuit, filename=None,
                           scale=0.7, style=None, reverse_bits=False,
                           plot_barriers=True, justify=None)

def Func(arg_0, arg_1=None,
                           arg_2=0.7, arg_3=None, arg_4=False,
                           arg_5=True, arg_6=None):
    """Convert QuantumCircuit to LaTeX string.

    Args:
        circuit (QuantumCircuit): input circuit
        scale (float): image scaling
        filename (str): optional filename to write latex
        style (dict or str): dictionary of style or file name of style file
        reverse_bits (bool): When set to True reverse the bit order inside
            registers for the output visualization.
        plot_barriers (bool): Enable/disable drawing barriers in the output
            circuit. Defaults to True.
        justify (str) : `left`, `right` or `none`. Defaults to `left`. Says how
                        the circuit should be justified.

    Returns:
        str: Latex string appropriate for writing to file.
    """
    arg_7, arg_8, arg_9 = utils._get_layered_instructions(arg_0,
                                                        arg_4=arg_4,
                                                        arg_6=arg_6)

    arg_10 = _latex.QCircuitImage(arg_7, arg_8, arg_9, arg_2, arg_3=arg_3,
                                 arg_5=arg_5,
                                 arg_4=arg_4)
    arg_11 = arg_10.latex()
    if arg_1:
        with open(arg_1, 'w') as latex_file:
            latex_file.write(arg_11)

    return arg_11

Convert QuantumCircuit to LaTeX string .


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

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

        Raises:
            ValueError: Raised if the nonce ID or nonce value is not defined.
        """
        arg_6 = BytearrayStream()

        if arg_0._nonce_id:
            arg_0._nonce_id.Func(arg_6, arg_2=arg_2)
        else:
            raise ValueError("Nonce struct is missing the nonce ID.")

        if arg_0._nonce_value:
            arg_0._nonce_value.Func(arg_6, arg_2=arg_2)
        else:
            raise ValueError("Nonce struct is missing the nonce value.")

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

Write the data encoding the Nonce struct to a stream.

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

        Raises:
            ValueError: Raised if the nonce ID or nonce value is not defined.

Write the data encoding the Nonce struct to a stream .


async def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , ( TrackStuckEvent , TrackExceptionEvent ) ) or isinstance ( arg_1 , TrackEndEvent ) and arg_1 . reason == 'FINISHED' : await arg_0 . play ( )

async def Func(arg_0, arg_1):
        """ Makes the player play the next song from the queue if a song has finished or an issue occurred. """
        if isinstance(arg_1, (TrackStuckEvent, TrackExceptionEvent)) or \
                isinstance(arg_1, TrackEndEvent) and arg_1.reason == 'FINISHED':
            await arg_0.play()

Makes the player play the next song from the queue if a song has finished or an issue occurred .


def
Func
(
arg_0
)
:
arg_1
=
get_server_from_db
(
arg_0
)
arg_2
=
PLAIN_RE
.
match
(
arg_0
)
arg_3
=
URL_RE
.
match
(
arg_0
)
if
arg_2
:
return
arg_1
[
arg_2
.
groupdict
(
)
[
'database'
]
]
elif
arg_3
:
return
arg_1
[
arg_3
.
groupdict
(
)
[
'database'
]
]
raise
ValueError
(
'Invalid database string: %r'
%
(
arg_0
,
)
)

def Func(arg_0):
    """Return a CouchDB database instance from a database string."""
    arg_1 = get_server_from_db(arg_0)
    arg_2 = PLAIN_RE.match(arg_0)
    arg_3 = URL_RE.match(arg_0)
    # If this looks like a local specifier:
    if arg_2:
        return arg_1[arg_2.groupdict()['database']]
    elif arg_3:
        return arg_1[arg_3.groupdict()['database']]
    raise ValueError('Invalid database string: %r' % (arg_0,))

Return a CouchDB database instance from a database string .


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : if isinstance ( arg_3 , dict ) : Func ( arg_0 . setdefault ( arg_2 , { } ) , arg_3 ) else : arg_0 . setdefault ( arg_2 , arg_3 )

def Func(arg_0, arg_1):
    """Merge b into a recursively, without overwriting values.

    :param base: the dict that will be altered.
    :param changes: changes to update base.
    """
    for arg_2, arg_3 in arg_1.items():
        if isinstance(arg_3, dict):
            Func(arg_0.setdefault(arg_2, {}), arg_3)
        else:
            arg_0.setdefault(arg_2, arg_3)

Merge b into a recursively without overwriting values .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Get request token secret.

        The request token object should a ``secret`` attribute.
        """
        log.debug('Get request token secret of %r for %r',
                  arg_2, arg_1)
        arg_4 = arg_3.request_token or arg_0._grantgetter(arg_2=arg_2)
        if arg_4 and arg_4.client_key == arg_1:
            arg_3.request_token = arg_4
            return arg_4.secret
        return None


def Func ( arg_0 , arg_1 = 0.0 ) : arg_2 = [ ( arg_4 . betweenness , arg_4 ) for arg_4 in arg_0 . nodes if arg_4 . betweenness > arg_1 ] arg_2 . sort ( ) arg_2 . reverse ( ) return [ arg_4 for arg_3 , arg_4 in arg_2 ]

def Func(arg_0, arg_1=0.0):
        """ Returns nodes sorted by betweenness centrality.
        Nodes with a lot of passing traffic will be at the front of the list.
        """
        arg_2 = [(arg_4.betweenness, arg_4) for arg_4 in arg_0.nodes if arg_4.betweenness > arg_1]
        arg_2.sort(); arg_2.reverse()
        return [arg_4 for arg_3, arg_4 in arg_2]

Returns nodes sorted by betweenness centrality . Nodes with a lot of passing traffic will be at the front of the list .


def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . _selector_map : return [ arg_1 ] arg_2 = arg_1 . split ( '.' ) arg_3 = arg_0 . _selector_tree for arg_4 in reversed ( arg_2 ) : if arg_4 not in arg_3 : return [ ] arg_3 = arg_3 [ arg_4 ] arg_5 = [ ] arg_6 = [ arg_3 ] while arg_6 : arg_3 = arg_6 . pop ( ) . copy ( ) arg_7 = arg_3 . pop ( _TERMINAL_KEY , None ) arg_6 . extend ( arg_3 . values ( ) ) if arg_7 : arg_5 . append ( arg_7 ) return arg_5

def Func(arg_0, arg_1):
    """Retrieves all selectors matching `partial_selector`.

    For instance, if "one.a.b" and "two.a.b" are stored in a `SelectorMap`, both
    `Func('b')` and `Func('a.b')` will return them.

    In the event that `partial_selector` exactly matches an existing complete
    selector, only that complete selector is returned. For instance, if
    "a.b.c.d" and "c.d" are stored, `Func('c.d')` will return only
    `['c.d']`, while `Func('d')` will return both.

    Args:
      partial_selector: The partial selector to find matches for.

    Returns:
      A list of selectors matching `partial_selector`.
    """
    if arg_1 in arg_0._selector_map:
      return [arg_1]

    arg_2 = arg_1.split('.')
    arg_3 = arg_0._selector_tree

    for arg_4 in reversed(arg_2):
      if arg_4 not in arg_3:
        return []
      arg_3 = arg_3[arg_4]

    arg_5 = []
    arg_6 = [arg_3]
    while arg_6:
      arg_3 = arg_6.pop().copy()
      arg_7 = arg_3.pop(_TERMINAL_KEY, None)
      arg_6.extend(arg_3.values())
      if arg_7:
        arg_5.append(arg_7)

    return arg_5

Retrieves all selectors matching `partial_selector`.

    For instance, if "one.a.b" and "two.a.b" are stored in a `SelectorMap`, both
    `matching_selectors('b')` and `matching_selectors('a.b')` will return them.

    In the event that `partial_selector` exactly matches an existing complete
    selector, only that complete selector is returned. For instance, if
    "a.b.c.d" and "c.d" are stored, `matching_selectors('c.d')` will return only
    `['c.d']`, while `matching_selectors('d')` will return both.

    Args:
      partial_selector: The partial selector to find matches for.

    Returns:
      A list of selectors matching `partial_selector`.

Retrieves all selectors matching partial_selector .


def Func(arg_0, arg_1=None):
        """Delete the genes collection"""
        if arg_1:
            LOG.info("Dropping the hgnc_gene collection, build %s", arg_1)
            arg_0.hgnc_collection.delete_many({'build': arg_1})
        else:
            LOG.info("Dropping the hgnc_gene collection")
            arg_0.hgnc_collection.drop()


return self._perform_put(
            self._get_path('services/serviceBus/Namespaces', name),
            _ServiceBusManagementXmlSerializer.namespace_to_xml(region))

def Func(arg_0, arg_1, arg_2):
        '''
        Create a new service bus namespace.

        name:
            Name of the service bus namespace to create.
        region:
            Region to create the namespace in.
        '''
        _validate_not_none('name', arg_1)

        return arg_0._perform_put(
            arg_0._get_path('services/serviceBus/Namespaces', arg_1),
            _ServiceBusManagementXmlSerializer.namespace_to_xml(arg_2))


(x, wrg, hrg, is_random=False, row_index=0, col_index=1)

def Func(arg_0, arg_1, arg_2, arg_3=False, arg_4=0, arg_5=1):
    """Randomly or centrally Func an image.

    Parameters
    ----------
    x : numpy.array
        An image with dimension of [row, col, channel] (default).
    wrg : int
        Size of width.
    hrg : int
        Size of height.
    is_random : boolean,
        If True, randomly Func, else central Func. Default is False.
    row_index: int
        index of row.
    col_index: int
        index of column.

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

    """
    arg_6, arg_7 = arg_0.shape[arg_4], arg_0.shape[arg_5]

    if (arg_6 < arg_2) or (arg_7 < arg_1):
        raise AssertionError("The size of Funcping should smaller than or equal to the original image")

    if arg_3:
        arg_8 = int(np.random.uniform(0, arg_6 - arg_2))
        arg_9 = int(np.random.uniform(0, arg_7 - arg_1))
        # tl.logging.info(h_offset, w_offset, x[h_offset: hrg+h_offset ,w_offset: wrg+w_offset].shape)
        return arg_0[arg_8:arg_2 + arg_8, arg_9:arg_1 + arg_9]
    else:  # central Func
        arg_8 = int(np.floor((arg_6 - arg_2) / 2.))
        arg_9 = int(np.floor((arg_7 - arg_1) / 2.))
        arg_10 = arg_8 + arg_2
        arg_11 = arg_9 + arg_1
        return arg_0[arg_8:arg_10, arg_9:arg_11]

Randomly or centrally crop an image.

    Parameters
    ----------
    x : numpy.array
        An image with dimension of [row, col, channel] (default).
    wrg : int
        Size of width.
    hrg : int
        Size of height.
    is_random : boolean,
        If True, randomly crop, else central crop. Default is False.
    row_index: int
        index of row.
    col_index: int
        index of column.

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


def Func ( arg_0 , arg_1 ) : arg_0 . _valid_group_id ( arg_1 ) arg_2 = "{}/group/{}" . format ( arg_0 . API , arg_1 ) arg_3 = arg_0 . _get_resource ( arg_2 ) return arg_0 . _group_from_json ( arg_3 . get ( "data" ) )

def Func(arg_0, arg_1):
        """
        Returns a restclients.Group object for the group identified by the
        passed group ID.
        """
        arg_0._valid_group_id(arg_1)

        arg_2 = "{}/group/{}".format(arg_0.API, arg_1)

        arg_3 = arg_0._get_resource(arg_2)

        return arg_0._group_from_json(arg_3.get("data"))

Returns a restclients . Group object for the group identified by the passed group ID .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
datetime
.
datetime
.
utcnow
(
)
if
arg_0
.
session
is
or
arg_0
.
expires_at
is
or
arg_2
>=
arg_0
.
expires_at
:
if
arg_0
.
session
:
arg_0
.
session
.
close
(
)
arg_3
,
arg_4
=
arg_0
.
_get_oauth_access_token
(
arg_0
.
enterprise_configuration
.
key
,
arg_0
.
enterprise_configuration
.
secret
,
arg_0
.
enterprise_configuration
.
degreed_user_id
,
arg_0
.
enterprise_configuration
.
degreed_user_password
,
arg_1
)
arg_5
=
requests
.
Session
(
)
arg_5
.
timeout
=
arg_0
.
SESSION_TIMEOUT
arg_5
.
headers
[
'Authorization'
]
=
'Bearer {}'
.
format
(
arg_3
)
arg_5
.
headers
[
'content-type'
]
=
'application/json'
arg_0
.
session
=
arg_5
arg_0
.
expires_at
=
arg_4

def Func(arg_0, arg_1):
        """
        Instantiate a new session object for use in connecting with Degreed
        """
        arg_2 = datetime.datetime.utcnow()
        if arg_0.session is None or arg_0.expires_at is None or arg_2 >= arg_0.expires_at:
            # Create a new session with a valid token
            if arg_0.session:
                arg_0.session.close()
            arg_3, arg_4 = arg_0._get_oauth_access_token(
                arg_0.enterprise_configuration.key,
                arg_0.enterprise_configuration.secret,
                arg_0.enterprise_configuration.degreed_user_id,
                arg_0.enterprise_configuration.degreed_user_password,
                arg_1
            )
            arg_5 = requests.Session()
            arg_5.timeout = arg_0.SESSION_TIMEOUT
            arg_5.headers['Authorization'] = 'Bearer {}'.format(arg_3)
            arg_5.headers['content-type'] = 'application/json'
            arg_0.session = arg_5
            arg_0.expires_at = arg_4


def Func(arg_0, arg_1):
    """ Helper function to return a scalar value representing the most
        likely outcome given a probability distribution
    """
    if len(arg_1) == 1:
      return arg_1.keys()[0]

    arg_2 = None
    arg_3 = 0

    for arg_4, arg_5 in arg_1.items():
      if arg_5 > arg_3:
        arg_2 = arg_4
        arg_3 = arg_5

    return arg_2


(self, aspect_ratio=None, fov=None, near=None, far=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None):
        """
        Update the internal projection matrix based on current values
        or values passed in if specified.

        :param aspect_ratio: New aspect ratio
        :param fov: New field of view
        :param near: New near value
        :param far: New far value
        """
        arg_0.aspect_ratio = arg_1 or arg_0.aspect_ratio
        arg_0.fov = arg_2 or arg_0.fov
        arg_0.near = arg_3 or arg_0.near
        arg_0.far = arg_4 or arg_0.far

        arg_0.matrix = Matrix44.perspective_projection(arg_0.fov, arg_0.aspect_ratio, arg_0.near, arg_0.far)

Update the internal projection matrix based on current values or values passed in if specified .


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

def Func(arg_0):
        "Cheap function to invert a hash."
        arg_1 = {}
        for arg_2,arg_3 in arg_0.items():
            arg_1[arg_3] = arg_2
        return arg_1


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 , arg_4 = arg_0 . subcommands . get ( arg_1 ) if isinstance ( arg_3 , basestring ) : arg_3 = import_item ( arg_3 ) arg_0 . __class__ . clear_instance ( ) arg_0 . subapp = arg_3 . instance ( ) arg_0 . subapp . initialize ( arg_2 )

def Func(arg_0, arg_1, arg_2=None):
        """Initialize a subcommand with argv."""
        arg_3,arg_4 = arg_0.subcommands.get(arg_1)

        if isinstance(arg_3, basestring):
            arg_3 = import_item(arg_3)

        # clear existing instances
        arg_0.__class__.clear_instance()
        # instantiate
        arg_0.subapp = arg_3.instance()
        # and initialize subapp
        arg_0.subapp.initialize(arg_2)


def Func(arg_0=False, arg_1=None, arg_2=False):
    """
    Select a course or an exercise.
    """
    if arg_0:
        update(arg_0=True)
        arg_0 = None
        try:
            arg_0 = Course.get_Funced()
        except NoCourseSelected:
            pass

        arg_3 = {}
        if not arg_1:
            arg_3 = Menu.launch("Select a course",
                              Course.Func().execute(),
                              arg_0)
        else:
            arg_3["item"] = Course.get(Course.tid == arg_1)
        if "item" in arg_3:
            arg_3["item"].set_Func()
            update()
            if arg_3["item"].path == "":
                Func_a_path(arg_2=arg_2)
            # Selects the first exercise in this course
            skip()
            return
        else:
            print("You can Func the course with `tmc Func --course`")
            return
    else:
        arg_4 = None
        try:
            arg_4 = Exercise.get_Funced()
        except NoExerciseSelected:
            pass

        arg_3 = {}
        if not arg_1:
            arg_3 = Menu.launch("Select an exercise",
                              Course.get_Funced().exercises,
                              arg_4)
        else:
            arg_3["item"] = Exercise.byid(arg_1)
        if "item" in arg_3:
            arg_3["item"].set_Func()
            print("Selected {}".format(arg_3["item"]))


def Func ( arg_0 , arg_1 ) : def setup_oauth ( arg_2 , * arg_3 , ** arg_4 ) : if arg_0 . _in_error : arg_0 . _display_error_message ( arg_2 ) return arg_5 = users . get_current_user ( ) if not arg_5 : arg_2 . redirect ( users . create_login_url ( arg_2 . request . uri ) ) return arg_0 . _create_flow ( arg_2 ) arg_0 . flow . params [ 'state' ] = _build_state_value ( arg_2 , arg_5 ) arg_0 . credentials = arg_0 . _storage_class ( arg_0 . _credentials_class , None , arg_0 . _credentials_property_name , arg_5 = arg_5 ) . get ( ) try : arg_9 = arg_1 ( arg_2 , * arg_3 , ** arg_4 ) finally : arg_0 . credentials = None return arg_9 return setup_oauth

def Func(arg_0, arg_1):
        """Decorator that sets up for OAuth 2.0 dance, but doesn't do it.

        Does all the setup for the OAuth dance, but doesn't initiate it.
        This decorator is useful if you want to create a page that knows
        whether or not the user has granted access to this application.
        From within a method decorated with @Func the has_credentials()
        and authorize_url() methods can be called.

        Args:
            method: callable, to be decorated method of a webapp.RequestHandler
                    instance.
        """

        def setup_oauth(arg_2, *arg_3, **arg_4):
            if arg_0._in_error:
                arg_0._display_error_message(arg_2)
                return

            arg_5 = users.get_current_user()
            # Don't use @login_decorator as this could be used in a
            # POST request.
            if not arg_5:
                arg_2.redirect(users.create_login_url(
                    arg_2.request.uri))
                return

            arg_0._create_flow(arg_2)

            arg_0.flow.params['state'] = _build_state_value(arg_2,
                                                           arg_5)
            arg_0.credentials = arg_0._storage_class(
                arg_0._credentials_class, None,
                arg_0._credentials_property_name, arg_5=arg_5).get()
            try:
                arg_9 = arg_1(arg_2, *arg_3, **arg_4)
            finally:
                arg_0.credentials = None
            return arg_9
        return setup_oauth

Decorator that sets up for OAuth 2.0 dance, but doesn't do it.

        Does all the setup for the OAuth dance, but doesn't initiate it.
        This decorator is useful if you want to create a page that knows
        whether or not the user has granted access to this application.
        From within a method decorated with @oauth_aware the has_credentials()
        and authorize_url() methods can be called.

        Args:
            method: callable, to be decorated method of a webapp.RequestHandler
                    instance.

Decorator that sets up for OAuth 2 . 0 dance but doesn t do it .


def Func(arg_0, arg_1, arg_2):
        """
            Check and return a list of SSH key IDs or fingerprints according
            to DigitalOcean's API. This method is used to check and create a
            droplet with the correct SSH keys.
        """
        arg_3 = list()
        for arg_4 in arg_0:
            if type(arg_4) in [int, type(2 ** 64)]:
                arg_3.append(int(arg_4))

            elif type(arg_4) == SSHKey:
                arg_3.append(arg_4.id)

            elif type(arg_4) in [type(u''), type('')]:
                # ssh_key could either be a fingerprint or a public key
                #
                # type(u'') and type('') is the same in python 3 but
                # different in 2. See:
                # https://github.com/koalalorenzo/python-digitalocean/issues/80
                arg_5 = '([0-9a-fA-F]{2}:){15}[0-9a-fA-F]'
                arg_6 = re.match(arg_5, arg_4)

                if arg_6 is not None and arg_6.end() == len(arg_4) - 1:
                    arg_3.append(arg_4)

                else:
                    arg_7 = SSHKey()
                    arg_7.token = arg_1
                    arg_8 = arg_7.load_by_pub_key(arg_4)

                    if arg_8 is None:
                        arg_7.public_key = arg_4
                        arg_7.name = "SSH Key %s" % arg_2
                        arg_7.create()
                    else:
                        arg_7 = arg_8

                    arg_3.append(arg_7.id)
            else:
                raise BadSSHKeyFormat(
                    "Droplet.ssh_keys should be a list of IDs, public keys"
                    + " or fingerprints."
                )

        return arg_3

Check and return a list of SSH key IDs or fingerprints according to DigitalOcean s API . This method is used to check and create a droplet with the correct SSH keys .


return self._delete(
            urljoin(
                self.enterprise_configuration.degreed_base_url,
                self.global_degreed_config.completion_status_api_path
            ),
            payload,
            self.COMPLETION_PROVIDER_SCOPE
        )

def Func(arg_0, arg_1, arg_2):  # pylint: disable=unused-argument
        """
        Delete a completion status previously sent to the Degreed Completion Status endpoint

        Args:
            user_id: Unused.
            payload: JSON encoded object (serialized from DegreedLearnerDataTransmissionAudit)
                containing the required completion status fields for deletion per Degreed documentation.

        Returns:
            A tuple containing the status code and the body of the response.
        Raises:
            HTTPError: if we received a failure response code from Degreed
        """
        return arg_0._delete(
            urljoin(
                arg_0.enterprise_configuration.degreed_base_url,
                arg_0.global_degreed_config.completion_status_api_path
            ),
            arg_2,
            arg_0.COMPLETION_PROVIDER_SCOPE
        )


def Func ( arg_0 , * arg_1 ) : arg_2 = "/" . join ( arg_1 ) if not arg_2 : return arg_0 return arg_0 . rstrip ( "/" ) + "/" + arg_2

def Func(arg_0, *arg_1):
    """Append segments to URI.

    Example: Func("/a/b", "c", "d")
    """
    arg_2 = "/".join(arg_1)
    if not arg_2:
        return arg_0
    return arg_0.rstrip("/") + "/" + arg_2

Append segments to URI.

    Example: join_uri("/a/b", "c", "d")


def Func ( arg_0 ) : arg_1 = Untokenizer ( start_row = arg_0 . _tokens [ 0 ] . start_row ) arg_0 . _Func ( arg_1 ) return arg_1 . result ( )

def Func(arg_0):
        """Convert the parsed representation back into the source code."""
        arg_1 = Untokenizer(start_row=arg_0._tokens[0].start_row)
        arg_0._Func(arg_1)
        return arg_1.result()

Convert the parsed representation back into the source code .


def Func ( arg_0 ) : if isinstance ( arg_0 , datetime ) : arg_1 = DTFormat ( ) return arg_0 . strftime ( arg_1 . datetime_format ) return None

def Func(arg_0):
        '''
        Get datetime string from datetime object

        :param datetime datetime_obj: datetime object
        :return: datetime string
        :rtype: str
        '''

        if isinstance(arg_0, datetime):
            arg_1 = DTFormat()
            return arg_0.strftime(arg_1.datetime_format)

        return None


(img, scale, return_scale=False, interpolation='bilinear')

def Func(arg_0, arg_1, arg_2=False, arg_3='bilinear'):
    """Resize image while keeping the aspect ratio.

    Args:
        img (ndarray): The input image.
        scale (float or tuple[int]): The scaling factor or maximum size.
            If it is a float number, then the image will be rescaled by this
            factor, else if it is a tuple of 2 integers, then the image will
            be rescaled as large as possible within the scale.
        return_scale (bool): Whether to return the scaling factor besides the
            rescaled image.
        interpolation (str): Same as :func:`resize`.

    Returns:
        ndarray: The rescaled image.
    """
    arg_4, arg_5 = arg_0.shape[:2]
    if isinstance(arg_1, (float, int)):
        if arg_1 <= 0:
            raise ValueError(
                'Invalid scale {}, must be positive.'.format(arg_1))
        arg_6 = arg_1
    elif isinstance(arg_1, tuple):
        arg_7 = max(arg_1)
        arg_8 = min(arg_1)
        arg_6 = min(arg_7 / max(arg_4, arg_5),
                           arg_8 / min(arg_4, arg_5))
    else:
        raise TypeError(
            'Scale must be a number or tuple of int, but got {}'.format(
                type(arg_1)))
    arg_9 = _scale_size((arg_5, arg_4), arg_6)
    arg_10 = imresize(arg_0, arg_9, arg_3=arg_3)
    if arg_2:
        return arg_10, arg_6
    else:
        return arg_10

Resize image while keeping the aspect ratio .


def Func ( arg_0 ) : arg_0 . menuEdit . clear ( ) arg_0 . menuModes . clear ( ) arg_0 . menuPanels . clear ( ) arg_1 = arg_0 . tabWidget . current_widget ( ) arg_0 . menuEdit . setEnabled ( arg_1 is not None ) arg_0 . menuModes . setEnabled ( arg_1 is not None ) arg_0 . menuPanels . setEnabled ( arg_1 is not None ) arg_0 . actionSave . setEnabled ( arg_1 is not None ) arg_0 . actionSave_as . setEnabled ( arg_1 is not None ) arg_0 . actionConfigure_run . setEnabled ( arg_1 is not None ) arg_0 . actionRun . setEnabled ( arg_1 is not None ) if arg_1 is not None : arg_0 . setup_mnu_edit ( arg_1 ) arg_0 . setup_mnu_modes ( arg_1 ) arg_0 . setup_mnu_panels ( arg_1 ) arg_0 . widgetOutline . set_editor ( arg_1 ) arg_0 . _update_status_bar ( arg_1 )

def Func(arg_0):
        """
        Update action states when the current tab changed.
        """
        arg_0.menuEdit.clear()
        arg_0.menuModes.clear()
        arg_0.menuPanels.clear()
        arg_1 = arg_0.tabWidget.current_widget()
        arg_0.menuEdit.setEnabled(arg_1 is not None)
        arg_0.menuModes.setEnabled(arg_1 is not None)
        arg_0.menuPanels.setEnabled(arg_1 is not None)
        arg_0.actionSave.setEnabled(arg_1 is not None)
        arg_0.actionSave_as.setEnabled(arg_1 is not None)
        arg_0.actionConfigure_run.setEnabled(arg_1 is not None)
        arg_0.actionRun.setEnabled(arg_1 is not None)
        if arg_1 is not None:
            arg_0.setup_mnu_edit(arg_1)
            arg_0.setup_mnu_modes(arg_1)
            arg_0.setup_mnu_panels(arg_1)
        arg_0.widgetOutline.set_editor(arg_1)
        arg_0._update_status_bar(arg_1)

Update action states when the current tab changed .


def Func(arg_0):
    """
    Mutates any attributes on ``obj`` which are classes, with link to ``obj``.

    Adds a convenience accessor which instantiates ``obj`` and then calls its
    ``setup`` method.

    Recurses on those objects as well.
    """
    for arg_1 in class_members(arg_0):
        arg_1[1]._parent = arg_0
        arg_1[1]._parent_inst = None
        arg_1[1].__getattr__ = my_getattr
        Func(arg_1[1])

Mutates any attributes on obj which are classes with link to obj .


(datetimes,
              years=0, months=0, weeks=0, days=0,
              hours=0, minutes=0, seconds=0,
              firstweekday=SATURDAY, now=None)

return datetimes - to_keep(datetimes,
                               years=years, months=months,
                               weeks=weeks, days=days,
                               hours=hours, minutes=minutes, seconds=seconds,
                               firstweekday=firstweekday, now=now)

def Func(arg_0,
              arg_1=0, arg_2=0, arg_3=0, arg_4=0,
              arg_5=0, arg_6=0, arg_7=0,
              arg_8=arg_9, arg_10=None):
    """
    Return a set of datetimes that should be deleted, out of ``datetimes``.

    See ``to_keep`` for a description of arguments.
    """
    arg_0 = set(arg_0)
    return arg_0 - to_keep(arg_0,
                               arg_1=arg_1, arg_2=arg_2,
                               arg_3=arg_3, arg_4=arg_4,
                               arg_5=arg_5, arg_6=arg_6, arg_7=arg_7,
                               arg_8=arg_8, arg_10=arg_10)

Return a set of datetimes that should be deleted out of datetimes .


def Func(arg_0, arg_1):
        """Learn the vocabulary dictionary and return term-document matrix.

        This is equivalent to fit followed by transform, but more efficiently
        implemented.

        Parameters
        ----------
        Z : iterable or DictRDD with column 'X'
            An iterable of raw_documents which yields either str, unicode or
            file objects; or a DictRDD with column 'X' containing such
            iterables.

        Returns
        -------
        X : array, [n_samples, n_features] or DictRDD
            Document-term matrix.
        """
        arg_0._validate_vocabulary()

        # map analyzer and cache result
        arg_2 = arg_0.build_analyzer()
        arg_3 = arg_1.transform(lambda arg_4: list(map(arg_2, arg_4)), column='X').persist()

        # create vocabulary
        arg_4 = arg_3[:, 'X'] if isinstance(arg_3, DictRDD) else arg_3
        arg_0.vocabulary_ = arg_0._init_vocab(arg_4)

        # transform according to vocabulary
        arg_6 = arg_0.broadcast(arg_0._count_vocab, arg_3.context)
        arg_1 = arg_3.transform(arg_6, column='X', dtype=sp.spmatrix)

        if not arg_0.fixed_vocabulary_:
            arg_4 = arg_1[:, 'X'] if isinstance(arg_1, DictRDD) else arg_1

            arg_7 = arg_0.max_df
            arg_8 = arg_0.min_df
            arg_9 = arg_0.max_features

            # limit features according to min_df, max_df parameters
            arg_10 = arg_4.shape[0]
            arg_11 = (arg_7
                             if isinstance(arg_7, numbers.Integral)
                             else arg_7 * arg_10)
            arg_12 = (arg_8
                             if isinstance(arg_8, numbers.Integral)
                             else arg_8 * arg_10)
            if arg_11 < arg_12:
                raise ValueError(
                    "max_df corresponds to < documents than min_df")
            arg_13, arg_0.stop_words_ = arg_0._limit_features(
                arg_4, arg_0.vocabulary_, arg_11, arg_12, arg_9)

            # sort features
            arg_15 = arg_0._sort_features(arg_0.vocabulary_)

            # combined mask
            arg_16 = arg_13[arg_15]

            arg_1 = arg_1.transform(lambda x: x[:, arg_16], column='X', dtype=sp.spmatrix)
        arg_3.unpersist()
        return arg_1

Learn the vocabulary dictionary and return term - document matrix .


(organization=None, user=None, team=None, credential_type=None, credential=None,
            notification_template=None, inventory_script=None, inventory=None, project=None, job_template=None,
            workflow=None, all=None)

def Func ( arg_0 = None , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = None , arg_9 = None , arg_10 = None , arg_11 = None ) : from tower_cli . cli . transfer . Func import Receiver arg_12 = Receiver ( ) arg_13 = { } for arg_14 in SEND_ORDER : arg_13 [ arg_14 ] = locals ( ) [ arg_14 ] arg_12 . Func ( arg_11 = arg_11 , asset_input = arg_13 )

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=None, arg_4=None,
            arg_5=None, arg_6=None, arg_7=None, arg_8=None, arg_9=None,
            arg_10=None, arg_11=None):
    """Export assets from Tower.

    'tower Func' exports one or more assets from a Tower instance

    For all of the possible assets types the TEXT can either be the assets name
    (or username for the case of a user) or the keyword all. Specifying all
    will export all of the assets of that type.

    """

    from tower_cli.cli.transfer.Func import Receiver
    arg_12 = Receiver()
    arg_13 = {}
    for arg_14 in SEND_ORDER:
        arg_13[arg_14] = locals()[arg_14]
    arg_12.Func(arg_11=arg_11, asset_input=arg_13)

Export assets from Tower.

    'tower receive' exports one or more assets from a Tower instance

    For all of the possible assets types the TEXT can either be the assets name
    (or username for the case of a user) or the keyword all. Specifying all
    will export all of the assets of that type.


def Func(arg_0, arg_1=(0, 1), arg_2=True):
    """
    Squish values into range.

    Parameters
    ----------
    x : array_like
        Values that should have out of range values Funced.
    range : tuple
        The range onto which to Func the values.
    only_finite: boolean
        When true, only Funces finite values.

    Returns
    -------
    out : array_like
        Values with out of range values Funced.

    Examples
    --------
    >>> Func([-1.5, 0.2, 0.5, 0.8, 1.0, 1.2])
    [0.0, 0.2, 0.5, 0.8, 1.0, 1.0]

    >>> Func([-np.inf, -1.5, 0.2, 0.5, 0.8, 1.0, np.inf], only_finite=False)
    [0.0, 0.0, 0.2, 0.5, 0.8, 1.0, 1.0]
    """
    arg_3 = type(arg_0)

    if not hasattr(arg_0, 'dtype'):
        arg_0 = arg_5.asarray(arg_0)

    arg_4 = arg_5.isfinite(arg_0) if arg_2 else True

    arg_0[arg_5.logical_and(arg_0 < arg_1[0], arg_4)] = arg_1[0]
    arg_0[arg_5.logical_and(arg_0 > arg_1[1], arg_4)] = arg_1[1]

    if not isinstance(arg_0, arg_3):
        arg_0 = arg_3(arg_0)
    return arg_0

Squish values into range.

    Parameters
    ----------
    x : array_like
        Values that should have out of range values squished.
    range : tuple
        The range onto which to squish the values.
    only_finite: boolean
        When true, only squishes finite values.

    Returns
    -------
    out : array_like
        Values with out of range values squished.

    Examples
    --------
    >>> squish([-1.5, 0.2, 0.5, 0.8, 1.0, 1.2])
    [0.0, 0.2, 0.5, 0.8, 1.0, 1.0]

    >>> squish([-np.inf, -1.5, 0.2, 0.5, 0.8, 1.0, np.inf], only_finite=False)
    [0.0, 0.0, 0.2, 0.5, 0.8, 1.0, 1.0]


def Func ( arg_0 ) : for arg_1 in arg_0 . _parameters . values ( ) : if not arg_1 . f_is_empty ( ) : arg_1 . f_lock ( )

def Func(arg_0):
        """Locks all non-empty parameters"""
        for arg_1 in arg_0._parameters.values():
            if not arg_1.f_is_empty():
                arg_1.f_lock()


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = "TXXX:" + arg_2 def getter ( arg_4 , arg_1 ) : return list ( arg_4 [ arg_3 ] ) def setter ( arg_4 , arg_1 , arg_5 ) : try : arg_6 = arg_4 [ arg_3 ] except KeyError : arg_7 = 0 try : for arg_8 in arg_5 : arg_8 . encode ( 'latin_1' ) except UnicodeError : arg_7 = 3 arg_4 . add ( mutagen . id3 . TXXX ( encoding = arg_7 , arg_9 = arg_5 , arg_2 = arg_2 ) ) else : arg_6 . text = arg_5 def deleter ( arg_4 , arg_1 ) : del ( arg_4 [ arg_3 ] ) arg_0 . RegisterKey ( arg_1 , getter , setter , deleter )

def Func(arg_0, arg_1, arg_2):
        """Register a user-defined text frame key.

        Some ID3 tags are stored in TXXX frames, which allow a
        freeform 'description' which acts as a subkey,
        e.g. TXXX:BARCODE.::

            EasyID3.Func('barcode', 'BARCODE').
        """
        arg_3 = "TXXX:" + arg_2

        def getter(arg_4, arg_1):
            return list(arg_4[arg_3])

        def setter(arg_4, arg_1, arg_5):
            try:
                arg_6 = arg_4[arg_3]
            except KeyError:
                arg_7 = 0
                # Store 8859-1 if we can, per MusicBrainz spec.
                try:
                    for arg_8 in arg_5:
                        arg_8.encode('latin_1')
                except UnicodeError:
                    arg_7 = 3

                arg_4.add(mutagen.id3.TXXX(encoding=arg_7, arg_9=arg_5, arg_2=arg_2))
            else:
                arg_6.text = arg_5

        def deleter(arg_4, arg_1):
            del(arg_4[arg_3])

        arg_0.RegisterKey(arg_1, getter, setter, deleter)

Register a user-defined text frame key.

        Some ID3 tags are stored in TXXX frames, which allow a
        freeform 'description' which acts as a subkey,
        e.g. TXXX:BARCODE.::

            EasyID3.RegisterTXXXKey('barcode', 'BARCODE').

Register a user - defined text frame key .


Return num_clones number of streamlets each containing all elements
    of the current streamlet

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in range ( arg_1 ) : arg_2 . append ( arg_0 . repartition ( arg_0 . get_num_partitions ( ) ) ) return arg_2

def Func(arg_0, arg_1):
    """Return num_Funcs number of streamlets each containing all elements
    of the current streamlet
    """
    arg_2 = []
    for arg_3 in range(arg_1):
      arg_2.append(arg_0.repartition(arg_0.get_num_partitions()))
    return arg_2


(self, variants, sample_name, category = 'snv')

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
'snv'
)
:
LOG
.
info
(
'Retrieving variants for subject : {0}'
.
format
(
arg_2
)
)
arg_4
=
re
.
compile
(
'1|2'
)
arg_5
=
{
'$and'
:
[
{
'_id'
:
{
'$in'
:
arg_1
}
}
,
{
'category'
:
arg_3
}
,
{
'samples'
:
{
'$elemMatch'
:
{
'display_name'
:
arg_2
,
'genotype_call'
:
{
'$regex'
:
arg_4
}
}
}
}
]
}
arg_6
=
arg_0
.
variant_collection
.
find
(
arg_5
)
return
arg_6

def Func(arg_0, arg_1, arg_2, arg_3 = 'snv'):
        """Given a list of variants get variant objects found in a specific patient

        Args:
            variants(list): a list of variant ids
            sample_name(str): a sample display name
            category(str): 'snv', 'sv' ..

        Returns:
            result(iterable(Variant))
        """
        LOG.info('Retrieving variants for subject : {0}'.format(arg_2))
        arg_4 = re.compile('1|2') # a non wild-type allele is called at least once in this sample

        arg_5 = {
            '$and': [
                {'_id' : { '$in' : arg_1}},
                {'category' : arg_3},
                {'samples': {
                    '$elemMatch': { 'display_name' : arg_2, 'genotype_call': { '$regex' : arg_4 } }
                }}
            ]
        }

        arg_6 = arg_0.variant_collection.find(arg_5)
        return arg_6


def Func ( arg_0 , arg_1 ) : for arg_2 in sorted ( arg_1 ) : arg_0 = tf . expand_dims ( arg_0 , arg_1 = arg_2 ) return arg_0

def Func(arg_0, arg_1):
  """Insert the dims in `axis` back as singletons after being removed.

  Args:
    x:  `Tensor`.
    axis:  Python list of integers.

  Returns:
    `Tensor` with same values as `x`, but additional singleton dimensions.
  """
  for arg_2 in sorted(arg_1):
    arg_0 = tf.expand_dims(arg_0, arg_1=arg_2)
  return arg_0

Insert the dims in axis back as singletons after being removed .


def Func(arg_0, arg_1, arg_2=42):
    """ Creates an initial state for the automaton.

    :param name:

        Either ``'single'`` for a single live cell in the middle of the cell ring,
        or ``'random'`` for uniformly distributed random pattern of zeros and ones.

    :param ncells: Number of cells in the automaton

    :param seed: Random number seed for the ``#random'`` condition

    :return: Numpy array of zeros and ones (or just a one lonely one surrounded by zeros)

    :raises: ValueError if the ``name`` is unknown

    """
    if arg_0 == 'single':
        arg_3 = np.zeros(arg_1)
        arg_3[arg_4(arg_1/2)] = 1.0
        return arg_3
    elif arg_0 == 'random':
        np.random.seed(arg_2)
        arg_5 = np.random.randint(2, size=arg_1)
        return arg_5
    else:
        raise ValueError('I cannot handel your initial state `%s`.' % arg_0)

Creates an initial state for the automaton .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . child_parsers ( ) : arg_1 . extend ( arg_2 . _split_into_chunks ( ) ) return arg_1

def Func(arg_0):
        """Returns a list of `Chunk` objects for this code and its children.

        See `_split_into_chunks` for details.

        """
        arg_1 = []
        for arg_2 in arg_0.child_parsers():
            arg_1.extend(arg_2._split_into_chunks())

        return arg_1

Returns a list of Chunk objects for this code and its children .


def Func ( arg_0 , arg_1 ) : arg_2 = proto_pb2 . Msg ( arg_1 = [ arg_0 . encodeEvent ( e ) for e in arg_1 if e . _type == 'riemann' ] ) return arg_2 . SerializeToString ( )

def Func(arg_0, arg_1):
        """Encode a list of Tensor events with protobuf"""

        arg_2 = proto_pb2.Msg(
            arg_1=[arg_0.encodeEvent(e) for e in arg_1 if e._type=='riemann']
        )

        return arg_2.SerializeToString()


def Func(arg_0):
  """ Returns sum of the elements in the list. Missing items are replaced with
  the mean value
  """
  arg_1 = _aggr_mean(arg_0)
  if arg_1 == None:
    return None

  arg_2 = 0
  for arg_3 in arg_0:
    if arg_3 != SENTINEL_VALUE_FOR_MISSING_DATA:
      arg_2 += arg_3
    else:
      arg_2 += arg_1

  return arg_2

Returns sum of the elements in the list . Missing items are replaced with the mean value


def Func(arg_0, arg_1):
    '''Convert a given annotation to the target namespace.

    Parameters
    ----------
    annotation : jams.Annotation
        An annotation object

    target_namespace : str
        The target namespace

    Returns
    -------
    mapped_annotation : jams.Annotation
        if `annotation` already belongs to `target_namespace`, then
        it is returned directly.

        otherwise, `annotation` is copied and automatically Funced
        to the target namespace.

    Raises
    ------
    SchemaError
        if the input annotation fails to validate

    NamespaceError
        if no conversion is possible

    Examples
    --------
    Convert frequency measurements in Hz to MIDI

    >>> ann_midi = jams.Func(ann_hz, 'note_midi')

    And back to Hz

    >>> ann_hz2 = jams.Func(ann_midi, 'note_hz')
    '''

    # First, validate the input. If this fails, we can't auto-Func.
    arg_0.validate(strict=True)

    # If we're already in the target namespace, do nothing
    if arg_0.namespace == arg_1:
        return arg_0

    if arg_1 in __CONVERSION__:
        # Otherwise, make a copy to mangle
        arg_0 = deepcopy(arg_0)

        # Look for a way to map this namespace to the target
        for arg_2 in __CONVERSION__[arg_1]:
            if arg_0.search(namespace=arg_2):
                return __CONVERSION__[arg_1][arg_2](arg_0)

    # No conversion possible
    raise NamespaceError('Unable to Func annotation from namespace='
                         '"{0}" to "{1}"'.format(arg_0.namespace,
                                                 arg_1))

Convert a given annotation to the target namespace.

    Parameters
    ----------
    annotation : jams.Annotation
        An annotation object

    target_namespace : str
        The target namespace

    Returns
    -------
    mapped_annotation : jams.Annotation
        if `annotation` already belongs to `target_namespace`, then
        it is returned directly.

        otherwise, `annotation` is copied and automatically converted
        to the target namespace.

    Raises
    ------
    SchemaError
        if the input annotation fails to validate

    NamespaceError
        if no conversion is possible

    Examples
    --------
    Convert frequency measurements in Hz to MIDI

    >>> ann_midi = jams.convert(ann_hz, 'note_midi')

    And back to Hz

    >>> ann_hz2 = jams.convert(ann_midi, 'note_hz')

Convert a given annotation to the target namespace .


Data Format aware version of tf.nn.batch_normalization.

(x, mean, variance, offset, scale, variance_epsilon, data_format, name=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7=None):
    """Data Format aware version of tf.nn.Func."""
    with ops.name_scope(arg_7, 'batchnorm', [arg_0, arg_1, arg_2, arg_4, arg_3]):
        arg_8 = math_ops.rsqrt(arg_2 + arg_5)
        if arg_4 is not None:
            arg_8 *= arg_4

        arg_9 = math_ops.cast(arg_8, arg_0.dtype)
        arg_10 = math_ops.cast(arg_3 - arg_1 * arg_8 if arg_3 is not None else -arg_1 * arg_8, arg_0.dtype)

        # Return a * x + b with customized data_format.
        # Currently TF doesn't have bias_scale, and tensorRT has bug in converting tf.nn.bias_add
        # So we reimplemted them to allow make the model work with tensorRT.
        # See https://github.com/tensorlayer/openpose-plus/issues/75 for more details.
        arg_11 = {'channels_first': 'NCHW', 'channels_last': 'NHWC'}
        return _bias_add(_bias_scale(arg_0, arg_9, arg_11[arg_6]), arg_10, arg_11[arg_6])

Data Format aware version of tf . nn . batch_normalization .


return ParsedCompletedCommand(
            completed_cmd.returncode,
            completed_cmd.args,
            stdout,
            stderr
        )

def Func ( arg_0 , arg_1 ) : try : arg_2 = arg_1 . stdout . encode ( 'utf-8' ) . decode ( ) except AttributeError : try : arg_2 = str ( bytes ( arg_1 . stdout ) , 'big5' ) . strip ( ) except AttributeError : arg_2 = str ( bytes ( arg_1 . stdout ) . decode ( 'utf-8' ) ) . strip ( ) try : arg_3 = arg_1 . stderr . encode ( 'utf-8' ) . decode ( ) except AttributeError : try : arg_3 = str ( bytes ( arg_1 . stderr ) , 'big5' ) . strip ( ) except AttributeError : arg_3 = str ( bytes ( arg_1 . stderr ) . decode ( 'utf-8' ) ) . strip ( ) return ParsedCompletedCommand ( arg_1 . returncode , arg_1 . args , arg_2 , arg_3 )

def Func(arg_0, arg_1):
        """
        return a standard message
        """
        try:
            arg_2 = arg_1.stdout.encode('utf-8').decode()
        except AttributeError:
            try:
                arg_2 = str(bytes(arg_1.stdout), 'big5').strip()
            except AttributeError:
                arg_2 = str(bytes(arg_1.stdout).decode('utf-8')).strip()
        try:
            arg_3 = arg_1.stderr.encode('utf-8').decode()
        except AttributeError:
            try:
                arg_3 = str(bytes(arg_1.stderr), 'big5').strip()
            except AttributeError:
                arg_3 = str(bytes(arg_1.stderr).decode('utf-8')).strip()
        return ParsedCompletedCommand(
            arg_1.returncode,
            arg_1.args,
            arg_2,
            arg_3
        )


return {
            'signature': self.signature_algorithms,
            'encryption': self.encryption_algorithms,
            'serialization': self.serialization_algorithms,
            'compression': self.compression_algorithms,
        }

def Func ( arg_0 ) : return { 'signature' : arg_0 . signature_algorithms , 'encryption' : arg_0 . encryption_algorithms , 'serialization' : arg_0 . serialization_algorithms , 'compression' : arg_0 . compression_algorithms , }

def Func(arg_0):
        '''Get algorithms used for sealing'''

        return {
            'signature': arg_0.signature_algorithms,
            'encryption': arg_0.encryption_algorithms,
            'serialization': arg_0.serialization_algorithms,
            'compression': arg_0.compression_algorithms,
        }


def Func ( ) : if not os . path . exists ( constants . REPOS_DIR ) : os . makedirs ( constants . REPOS_DIR )

def Func():
    """
    Our exports file will be invalid if this folder doesn't exist, and the NFS server
    will not run correctly.
    """
    if not os.path.exists(constants.REPOS_DIR):
        os.makedirs(constants.REPOS_DIR)

Our exports file will be invalid if this folder doesn t exist and the NFS server will not run correctly .


def Func(arg_0, arg_1=None):
        """Button action event"""
        if any(not arg_2 for arg_2 in (arg_0._ename.value, arg_0._p1.value, arg_0._p2.value, arg_0._file.value)):
            print("Missing one of the required fields (event name, player names, file name)")
            return
        arg_0.__p1chars = []
        arg_0.__p2chars = []
        arg_5 = Namespace()
        arg_0.__history.append(arg_0.__save_form())
        arg_5.ename = arg_0._ename.value
        if arg_0._ename_min.value:
            arg_5.ename_min = arg_0._ename_min.value
        else:
            arg_5.ename_min = arg_5.ename
        arg_5.pID = arg_0._pID.value
        arg_5.mtype = arg_0._mtype.value
        arg_5.mmid = arg_5.mtype
        arg_5.p1 = arg_0._p1.value
        arg_5.p2 = arg_0._p2.value
        arg_5.p1char = arg_0._p1char.value
        arg_5.p2char = arg_0._p2char.value
        arg_5.bracket = arg_0._bracket.value
        arg_16 = os.path.isdir(arg_0._file.value)
        if arg_16:
            arg_5.file = max([os.path.join(arg_0._file.value, f) for f in os.listdir(arg_0._file.value) if os.path.isfile(os.path.join(arg_0._file.value, f))], key=os.path.getmtime)
        else:
            arg_5.file = arg_0._file.value
        arg_5.tags = arg_0._tags.value
        arg_5.msuffix = arg_0._msuffix.value
        arg_5.mprefix = arg_0._mprefix.value
        arg_5.privacy = arg_0._privacy.value
        arg_5.descrip = arg_0._description.value
        arg_5.titleformat = arg_0._titleformat.value
        if arg_0._p1sponsor.value:
            arg_5.p1 = " | ".join((arg_0._p1sponsor.value, arg_5.p1))
        if arg_0._p2sponsor.value:
            arg_5.p2 = " | ".join((arg_0._p2sponsor.value, arg_5.p2))
        arg_5.ignore = False
        arg_0.__reset_match(False, arg_16)
        arg_0.__add_to_qview(arg_5)
        arg_0._queueref.append(arg_5)
        if arg_27.firstrun:
            arg_25 = threading.Thread(target=arg_0.__worker)
            arg_25.daemon = True
            arg_25.start()
            arg_27.firstrun = False


return is_unitary_matrix(self._data, rtol=rtol, atol=atol)

def Func(arg_0, arg_1=None, arg_2=None):
        """Return True if operator is a unitary matrix."""
        if arg_1 is None:
            arg_1 = arg_0._atol
        if arg_2 is None:
            arg_2 = arg_0._rtol
        return Func_matrix(arg_0._data, arg_2=arg_2, arg_1=arg_1)

Return True if operator is a unitary matrix .


return [filter_item(field) for field in filter_dictionary]

def Func ( arg_0 ) : def filter_item ( arg_1 ) : if arg_0 [ arg_1 ] is not None : return { "or" : [ _get_filter_field ( arg_1 , arg_0 [ arg_1 ] ) , { "missing" : { "field" : arg_1 } } ] } return { "missing" : { "field" : arg_1 } } return [ filter_item ( arg_1 ) for arg_1 in arg_0 ]

def Func(arg_0):
    """
    We have a filter_dictionary - this means that if the field is included
    and matches, then we can include, OR if the field is undefined, then we
    assume it is safe to include
    """
    def filter_item(arg_1):
        """ format elasticsearch filter to pass if value matches OR field is not included """
        if arg_0[arg_1] is not None:
            return {
                "or": [
                    _get_filter_field(arg_1, arg_0[arg_1]),
                    {
                        "missing": {
                            "field": arg_1
                        }
                    }
                ]
            }

        return {
            "missing": {
                "field": arg_1
            }
        }

    return [filter_item(arg_1) for arg_1 in arg_0]

We have a filter_dictionary - this means that if the field is included and matches then we can include OR if the field is undefined then we assume it is safe to include


def
Func
(
arg_0
)
:
arg_1
=
np
.
nan_to_num
(
swhlab
.
ap
.
getAvgBySweep
(
arg_0
,
'freq'
)
)
arg_2
=
arg_0
.
clampValues
(
arg_0
.
dataX
[
int
(
arg_0
.
protoSeqX
[
1
]
+
.01
)
]
)
swhlab
.
plot
.
new
(
arg_0
,
title
=
"Func function"
,
xlabel
=
"command current (pA)"
,
ylabel
=
"average inst. freq. (Hz)"
)
pylab
.
plot
(
arg_2
,
arg_1
,
'.-'
,
ms
=
20
,
alpha
=
.5
,
color
=
'b'
)
pylab
.
axhline
(
0
,
alpha
=
.5
,
lw
=
2
,
color
=
'r'
,
ls
=
"--"
)
pylab
.
margins
(
.1
,
.1
)

def Func(arg_0):
    """easy way to plot a Func function."""
    arg_1=np.nan_to_num(swhlab.ap.getAvgBySweep(arg_0,'freq'))
    arg_2=arg_0.clampValues(arg_0.dataX[int(arg_0.protoSeqX[1]+.01)])
    swhlab.plot.new(arg_0,title="Func function",xlabel="command current (pA)",
                    ylabel="average inst. freq. (Hz)")
    pylab.plot(arg_2,arg_1,'.-',ms=20,alpha=.5,color='b')
    pylab.axhline(0,alpha=.5,lw=2,color='r',ls="--")
    pylab.margins(.1,.1)


def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Loads several items from an iterable

        Iterables are supposed to be of a format like `[(msg, item, args, kwarg),...]`
        If `args` and `kwargs` are not part of a tuple, they are taken from the
        current `args` and `kwargs` provided to this function.

        """
        for arg_4 in arg_1:
            arg_5 = arg_4[0]
            arg_6 = arg_4[1]
            if len(arg_4) > 2:
                arg_2 = arg_4[2]
            if len(arg_4) > 3:
                arg_3 = arg_4[3]
            if len(arg_4) > 4:
                raise RuntimeError('You shall not pass!')

            arg_0.load(arg_5, arg_6, *arg_2, **arg_3)


def Func ( arg_0 ) : if arg_0 . verbosity > 1 or arg_0 . retrieveLearningStates : ( arg_1 , arg_2 , arg_3 , arg_4 ) = arg_0 . cells4 . getLearnStates ( ) arg_0 . lrnActiveState [ 't-1' ] = arg_2 . reshape ( ( arg_0 . numberOfCols , arg_0 . cellsPerColumn ) ) arg_0 . lrnActiveState [ 't' ] = arg_1 . reshape ( ( arg_0 . numberOfCols , arg_0 . cellsPerColumn ) ) arg_0 . lrnPredictedState [ 't-1' ] = arg_4 . reshape ( ( arg_0 . numberOfCols , arg_0 . cellsPerColumn ) ) arg_0 . lrnPredictedState [ 't' ] = arg_3 . reshape ( ( arg_0 . numberOfCols , arg_0 . cellsPerColumn ) ) if arg_0 . allocateStatesInCPP : assert False ( arg_1 , arg_2 , arg_3 , arg_4 , arg_7 , arg_8 , arg_9 , arg_10 ) = arg_0 . cells4 . getStates ( ) arg_0 . cellConfidence [ 't' ] = arg_9 . reshape ( ( arg_0 . numberOfCols , arg_0 . cellsPerColumn ) ) arg_0 . cellConfidence [ 't-1' ] = arg_10 . reshape ( ( arg_0 . numberOfCols , arg_0 . cellsPerColumn ) ) arg_0 . colConfidence [ 't' ] = arg_7 . reshape ( arg_0 . numberOfCols ) arg_0 . colConfidence [ 't-1' ] = arg_8 . reshape ( arg_0 . numberOfCols ) arg_0 . infActiveState [ 't-1' ] = arg_2 . reshape ( ( arg_0 . numberOfCols , arg_0 . cellsPerColumn ) ) arg_0 . infActiveState [ 't' ] = arg_1 . reshape ( ( arg_0 . numberOfCols , arg_0 . cellsPerColumn ) ) arg_0 . infPredictedState [ 't-1' ] = arg_4 . reshape ( ( arg_0 . numberOfCols , arg_0 . cellsPerColumn ) ) arg_0 . infPredictedState [ 't' ] = arg_3 . reshape ( ( arg_0 . numberOfCols , arg_0 . cellsPerColumn ) )

def Func(arg_0):
    """If state is allocated in CPP, copy over the data into our numpy arrays."""

    # Get learn states if we need to print them out
    if arg_0.verbosity > 1 or arg_0.retrieveLearningStates:
      (arg_1, arg_2, arg_3, arg_4) = arg_0.cells4.getLearnStates()
      arg_0.lrnActiveState['t-1'] = arg_2.reshape((arg_0.numberOfCols, arg_0.cellsPerColumn))
      arg_0.lrnActiveState['t'] = arg_1.reshape((arg_0.numberOfCols, arg_0.cellsPerColumn))
      arg_0.lrnPredictedState['t-1'] = arg_4.reshape((arg_0.numberOfCols, arg_0.cellsPerColumn))
      arg_0.lrnPredictedState['t'] = arg_3.reshape((arg_0.numberOfCols, arg_0.cellsPerColumn))

    if arg_0.allocateStatesInCPP:
      assert False
      (arg_1, arg_2, arg_3, arg_4, arg_7, arg_8, arg_9,
       arg_10) = arg_0.cells4.getStates()
      arg_0.cellConfidence['t'] = arg_9.reshape((arg_0.numberOfCols, arg_0.cellsPerColumn))
      arg_0.cellConfidence['t-1'] = arg_10.reshape((arg_0.numberOfCols, arg_0.cellsPerColumn))
      arg_0.colConfidence['t'] = arg_7.reshape(arg_0.numberOfCols)
      arg_0.colConfidence['t-1'] = arg_8.reshape(arg_0.numberOfCols)
      arg_0.infActiveState['t-1'] = arg_2.reshape((arg_0.numberOfCols, arg_0.cellsPerColumn))
      arg_0.infActiveState['t'] = arg_1.reshape((arg_0.numberOfCols, arg_0.cellsPerColumn))
      arg_0.infPredictedState['t-1'] = arg_4.reshape((arg_0.numberOfCols, arg_0.cellsPerColumn))
      arg_0.infPredictedState['t'] = arg_3.reshape((arg_0.numberOfCols, arg_0.cellsPerColumn))

If state is allocated in CPP copy over the data into our numpy arrays .


def Func(arg_0, arg_1):
        """
        Returns full country name for specified hostname.

        :arg hostname: Hostname (e.g. example.com)
        """
        arg_2 = arg_0._gethostbyname(arg_1)
        return arg_0.country_name_by_addr(arg_2)

Returns full country name for specified hostname .


(self, url=None, parse_data=True, key=None, parameters=None)

return self._fetch("GET", url, post_data=None, parse_data=parse_data, key=key, parameters=parameters)

def Func(arg_0, arg_1=None, arg_2=True, arg_3=None, arg_4=None):
        """ Issue a GET request.

        Kwargs:
            url (str): Destination URL
            parse_data (bool): If true, parse response data
            key (string): If parse_data==True, look for this key when parsing data
            parameters (dict): Additional GET parameters to append to the URL

        Returns:
            dict. Response (a dict with keys: success, data, info, body)

        Raises:
            AuthenticationError, ConnectionError, urllib2.HTTPError, ValueError, Exception
        """
        return arg_0._fetch("GET", arg_1, post_data=None, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)


(self, bands, download_dir=None, metadata=False)

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
        """Download remote .tar.bz file."""
        super(GoogleDownloader, arg_0).validate_bands(arg_1)
        arg_4 = re.compile('^[^\s]+_(.+)\.tiff?', re.I)
        arg_5 = []
        arg_6 = ['B%i' % (i,) if isinstance(i, int) else i for i in arg_1]

        if arg_2 is None:
            arg_2 = DOWNLOAD_DIR

        check_create_folder(join(arg_2, arg_0.sceneInfo.name))
        arg_7 = "%s%s" % (arg_0.sceneInfo.name, arg_0.__remote_file_ext)
        arg_8 = arg_0.fetch(arg_0.remote_file_url, arg_2, arg_7)
        try:

            arg_9 = tarfile.open(arg_8[0], 'r')
            arg_10 = join(arg_2, arg_0.sceneInfo.name)
            logger.debug('Starting data extraction in directory ', arg_10)
            arg_9.extractall(arg_10)
            remove(arg_8[0])
            arg_11 = listdir(arg_10)

            for arg_12 in arg_11:
                arg_13 = arg_4.match(arg_12)
                arg_14 = join(arg_10, arg_12)
                if arg_13 and arg_13.group(1) in arg_6:
                    arg_5.append([arg_14, getsize(arg_14)])
                elif arg_13:
                    remove(arg_14)

        except tarfile.ReadError as error:
            logger.error('Error when extracting files: ', error)
            print('Error when extracting files.')

        return arg_5


def Func ( arg_0 ) : if not isinstance ( arg_0 , str ) : return False if '\n' in arg_0 : return False if arg_0 . strip ( ) != arg_0 : return False try : arg_1 = compile ( '\n{0}=None' . format ( arg_0 ) , filename = '<string>' , mode = 'single' ) exec ( arg_1 ) return True except SyntaxError : return False

def Func(arg_0):
    """Pedantic yet imperfect. Test to see if "name" is a valid python identifier
    """
    if not isinstance(arg_0, str):
        return False
    if '\n' in arg_0:
        return False
    if arg_0.strip() != arg_0:
        return False
    try:
        arg_1 = compile('\n{0}=None'.format(arg_0), filename='<string>', mode='single')
        exec(arg_1)
        return True
    except SyntaxError:
        return False

Pedantic yet imperfect . Test to see if name is a valid python identifier


def Func(arg_0):
        """
        Close an existing connection; once Funcd it cannot be used again.

        Strictly speaking it is not necessary to Func all connection that you opened -- we have several mechanisms
        in place that will do so automatically (__del__(), __exit__() and atexit() handlers), however there is also
        no good reason to make this method private.
        """
        if arg_0._session_id:
            try:
                # If the server gone bad, we don't want to wait forever...
                if arg_0._timeout is None: arg_0._timeout = 1
                arg_0.request("DELETE /4/sessions/%s" % arg_0._session_id)
                arg_0._print("H2O session %s Funcd." % arg_0._session_id)
            except Exception:
                pass
            arg_0._session_id = None
        arg_0._stage = -1

Close an existing connection; once closed it cannot be used again.

        Strictly speaking it is not necessary to close all connection that you opened -- we have several mechanisms
        in place that will do so automatically (__del__(), __exit__() and atexit() handlers), however there is also
        no good reason to make this method private.

Close an existing connection ; once closed it cannot be used again .


return (nums[0] - nums[1]) / (
        2 * math.asin((nums[0] - nums[1]) / (nums[0] + nums[1]))
    )

def
Func
(
arg_0
)
:
if
len
(
arg_0
)
==
1
:
return
arg_0
[
0
]
if
len
(
arg_0
)
>
2
:
raise
AttributeError
(
'Func supports no more than two values'
)
if
arg_0
[
0
]
+
arg_0
[
1
]
==
0
or
arg_0
[
0
]
arg_0
[
1
]
==
0
:
return
float
(
'NaN'
)
return
(
arg_0
[
0
]
arg_0
[
1
]
)
/
(
2
*
math
.
asin
(
(
arg_0
[
0
]
arg_0
[
1
]
)
/
(
arg_0
[
0
]
+
arg_0
[
1
]
)
)
)

def Func(arg_0):
    r"""Return Seiffert's mean.

    Seiffert's mean of two numbers x and y is:
    :math:`\frac{x - y}{4 \cdot arctan \sqrt{\frac{x}{y}} - \pi}`

    It is defined in :cite:`Seiffert:1993`.

    Parameters
    ----------
    nums : list
        A series of numbers

    Returns
    -------
    float
        Sieffert's mean of nums

    Raises
    ------
    AttributeError
        Func supports no more than two values

    Examples
    --------
    >>> Func([1, 2])
    1.4712939827611637
    >>> Func([1, 0])
    0.3183098861837907
    >>> Func([2, 4])
    2.9425879655223275
    >>> Func([2, 1000])
    336.84053300118825

    """
    if len(arg_0) == 1:
        return arg_0[0]
    if len(arg_0) > 2:
        raise AttributeError('Func supports no more than two values')
    if arg_0[0] + arg_0[1] == 0 or arg_0[0] - arg_0[1] == 0:
        return float('NaN')
    return (arg_0[0] - arg_0[1]) / (
        2 * math.asin((arg_0[0] - arg_0[1]) / (arg_0[0] + arg_0[1]))
    )

r"""Return Seiffert's mean.

    Seiffert's mean of two numbers x and y is:
    :math:`\frac{x - y}{4 \cdot arctan \sqrt{\frac{x}{y}} - \pi}`

    It is defined in :cite:`Seiffert:1993`.

    Parameters
    ----------
    nums : list
        A series of numbers

    Returns
    -------
    float
        Sieffert's mean of nums

    Raises
    ------
    AttributeError
        seiffert_mean supports no more than two values

    Examples
    --------
    >>> seiffert_mean([1, 2])
    1.4712939827611637
    >>> seiffert_mean([1, 0])
    0.3183098861837907
    >>> seiffert_mean([2, 4])
    2.9425879655223275
    >>> seiffert_mean([2, 1000])
    336.84053300118825


def Func ( arg_0 ) : if not arg_0 . _Func : arg_0 . _Func = arg_0 . _inquire ( False , False , False , True ) [ 3 ] return arg_0 . _Func

def Func(arg_0):
        """
        The set of mechanisms supported by the credential.

        :type: :class:`~gssapi.oids.OIDSet`
        """
        if not arg_0._Func:
            arg_0._Func = arg_0._inquire(False, False, False, True)[3]
        return arg_0._Func

The set of mechanisms supported by the credential .


def Func(arg_0):
    """Shallow Func operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    """

    arg_1 = type(arg_0)

    arg_2 = _Func_dispatch.get(arg_1)
    if arg_2:
        return arg_2(arg_0)

    arg_2 = getattr(arg_1, "__Func__", None)
    if arg_2:
        return arg_2(arg_0)

    arg_3 = dispatch_table.get(arg_1)
    if arg_3:
        arg_4 = arg_3(arg_0)
    else:
        arg_3 = getattr(arg_0, "__reduce_ex__", None)
        if arg_3:
            arg_4 = arg_3(2)
        else:
            arg_3 = getattr(arg_0, "__reduce__", None)
            if arg_3:
                arg_4 = arg_3()
            else:
                raise Error("un(shallow)Funcable object of type %s" % arg_1)

    return _reconstruct(arg_0, arg_4, 0)

Shallow copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.

Shallow copy operation on arbitrary Python objects .


def
Func
(
arg_0
)
:
arg_1
=
{
"_what"
:
"OBJECT"
,
"_schema_id"
:
{
"_class_name"
:
"exchange"
}
}
logger
.
debug
(
"Message content -> {0}"
.
format
(
arg_1
)
)
return
arg_1
,
arg_0
.
query_properties

def Func(arg_0):
        """Create message content and properties to list all exchanges with QMFv2

        :returns: Tuple containing content and query properties
        """
        arg_1 = {"_what": "OBJECT",
                   "_schema_id": {"_class_name": "exchange"}}
        logger.debug("Message content -> {0}".format(arg_1))

        return arg_1, arg_0.query_properties


def Func ( arg_0 , arg_1 ) : if arg_0 . provider . prop_manager : arg_0 . provider . prop_manager . remove_properties ( arg_0 . get_ref_url ( ) , arg_0 . environ )

def Func(arg_0, arg_1):
        """Remove all associated dead properties."""
        if arg_0.provider.prop_manager:
            arg_0.provider.prop_manager.remove_properties(
                arg_0.get_ref_url(), arg_0.environ
            )


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
{
'list'
:
(
,
arg_1
)
,
'description'
:
(
,
arg_0
.
descriptions
)
}
arg_4
=
requests
.
post
(
arg_2
,
files
=
arg_3
)
if
not
arg_4
.
ok
:
raise
Exception
(
'Error analyzing gene list'
)
sleep
(
1
)
arg_5
=
json
.
loads
(
arg_4
.
text
)
return
arg_5

def Func(arg_0, arg_1, arg_2):
        """ send gene list to enrichr server"""
        arg_3 = {
          'list': (None, arg_1),
          'description': (None, arg_0.descriptions)
           }
        # response
        arg_4 = requests.post(arg_2, files=arg_3)
        if not arg_4.ok:
            raise Exception('Error analyzing gene list')
        sleep(1)
        arg_5 = json.loads(arg_4.text)

        return arg_5


def Func ( arg_0 ) : import pandas as pd return pd . Series ( arg_0 ) . dt . dayofweek . values

def Func(arg_0):
    """Obtain the day of the week with Monday=0 and Sunday=6

    :returns: an expression containing the day of week.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.dayofweek
    Expression = Func(date)
    Length: 3 dtype: int64 (expression)
    -----------------------------------
    0  0
    1  3
    2  3
    """
    import pandas as pd
    return pd.Series(arg_0).dt.dayofweek.values

Obtain the day of the week with Monday=0 and Sunday=6

    :returns: an expression containing the day of week.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.dayofweek
    Expression = dt_dayofweek(date)
    Length: 3 dtype: int64 (expression)
    -----------------------------------
    0  0
    1  3
    2  3

Obtain the day of the week with Monday = 0 and Sunday = 6


def Func ( arg_0 , arg_1 ) : arg_2 = get_context ( arg_0 ) arg_0 . solver . remove ( arg_1 ) if arg_2 : arg_2 ( partial ( arg_0 . solver . add , arg_1 ) )

def Func(arg_0, arg_1):
    """Remove variables and constraints from a Model's solver object.

    Useful to temporarily remove variables and constraints from a Models's
    solver object.

    Parameters
    ----------
    model : a cobra model
       The model from which to remove the variables and constraints.
    what : list or tuple of optlang variables or constraints.
       The variables or constraints to remove from the model. Must be of
       class `model.problem.Variable` or
       `model.problem.Constraint`.
    """
    arg_2 = get_context(arg_0)

    arg_0.solver.remove(arg_1)
    if arg_2:
        arg_2(partial(arg_0.solver.add, arg_1))

Remove variables and constraints from a Model s solver object .


(self, conversation, events=[],
                          event_cont_token=None)

def Func(arg_0, arg_1, arg_2=[],
                          arg_3=None):
        """Add new conversation from hangouts_pb2.Conversation"""
        # pylint: disable=dangerous-default-value
        arg_4 = arg_1.conversation_id.id
        logger.debug('Adding new conversation: {}'.format(arg_4))
        arg_5 = Conversation(arg_0._client, arg_0._user_list, arg_1,
                            arg_2, arg_3)
        arg_0._conv_dict[arg_4] = arg_5
        return arg_5

Add new conversation from hangouts_pb2 . Conversation


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_0 ( * arg_1 , ** arg_2 ) arg_3 . close ( ) return arg_3

def Func(arg_0, *arg_1, **arg_2):
        """
        Return an already closed read-only instance of Fridge.
        Arguments are the same as for the constructor.
        """
        arg_3 = arg_0(*arg_1, **arg_2)
        arg_3.close()
        return arg_3

Return an already closed read - only instance of Fridge . Arguments are the same as for the constructor .