def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_3):
        """
        Write the ProfileInformation structure encoding to the data stream.

        Args:
            output_buffer (stream): A data stream in which to encode
                ProfileInformation structure data, supporting a Func method.
            kmip_version (enum): A KMIPVersion enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 2.0.

        Raises:
            InvalidField: Raised if the profile name field is not defined.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the ProfileInformation structure.
        """
        if arg_2 < arg_3.KMIPVersion.KMIP_1_3:
            raise exceptions.VersionNotSupported(
                "KMIP {} does not support the ProfileInformation "
                "object.".format(
                    arg_2.value
                )
            )

        arg_6 = BytearrayStream()

        if arg_0._profile_name:
            arg_0._profile_name.Func(arg_6, arg_2=arg_2)
        else:
            raise exceptions.InvalidField(
                "The ProfileInformation structure is missing the profile "
                "name field."
            )

        if arg_0._server_uri:
            arg_0._server_uri.Func(arg_6, arg_2=arg_2)

        if arg_0._server_port:
            arg_0._server_port.Func(arg_6, arg_2=arg_2)

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

Write the ProfileInformation structure encoding to the data stream.

        Args:
            output_buffer (stream): A data stream in which to encode
                ProfileInformation structure data, supporting a write method.
            kmip_version (enum): A KMIPVersion enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 2.0.

        Raises:
            InvalidField: Raised if the profile name field is not defined.
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the ProfileInformation structure.

Write the ProfileInformation structure encoding to the data stream .


def Func(arg_0, arg_1):
    """
    Writes the results of one iteration of a model. The results are written to
    this ModelRunner's in-memory cache unless this model is the "best model" for
    the job. If this model is the "best model", the predictions are written out
    to a permanent store via a prediction output stream instance

    Parameters:
    -----------------------------------------------------------------------
    result:      A opf_utils.ModelResult object, which contains the input and
                  output for this iteration
    """
    arg_0.__predictionCache.append(arg_1)

    if arg_0._isBestModel:
     arg_0.__flushPredictionCache()

Writes the results of one iteration of a model . The results are written to this ModelRunner s in - memory cache unless this model is the best model for the job . If this model is the best model the predictions are written out to a permanent store via a prediction output stream instance


def Func(arg_0, arg_1):
  """Calculates the asymptotic series used in log_ndtr."""
  arg_2 = dtype_util.as_numpy_dtype(arg_0.dtype)
  if arg_1 <= 0:
    return arg_2(1)
  arg_3 = tf.square(arg_0)
  arg_4 = tf.zeros_like(arg_0)
  arg_5 = tf.zeros_like(arg_0)
  arg_6 = arg_3  # Start with x^{2*1} = x^{2*n} with n = 1.
  for arg_7 in range(1, arg_1 + 1):
    arg_8 = arg_2(_double_factorial(2 * arg_7 - 1)) / arg_6
    if arg_7 % 2:
      arg_5 += arg_8
    else:
      arg_4 += arg_8
    arg_6 *= arg_3
  return 1. + arg_4 - arg_5

Calculates the asymptotic series used in log_ndtr .


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

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6=None, arg_7=False):
    """Draw solid rectangle with top-left corner at x,y, width w, height h,
    and corner radius r"""
    fill_rect(arg_0, arg_1 + arg_5, arg_2, arg_3 - 2 * arg_5, arg_4, arg_6, arg_7)
    _fill_circle_helper(arg_0, arg_1 + arg_3 - arg_5 - 1, arg_2 + arg_5, arg_5,
                        1, arg_4 - 2 * arg_5 - 1, arg_6, arg_7)
    _fill_circle_helper(arg_0, arg_1 + arg_5, arg_2 + arg_5, arg_5, 2, arg_4 - 2 * arg_5 - 1, arg_6, arg_7)

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


return Bounds(lb.left, lb.bottom, rt.right, rt.top)

def Func(arg_0=None, arg_1=None, arg_2=None):
    """
    Snaps bounds to tiles boundaries of specific zoom level.

    Parameters
    ----------
    bounds : bounds to be snapped
    pyramid : TilePyramid
    zoom : int

    Returns
    -------
    Bounds(left, bottom, right, top)
    """
    if not isinstance(arg_0, (tuple, list)):
        raise TypeError("bounds must be either a tuple or a list")
    if len(arg_0) != 4:
        raise ValueError("bounds has to have exactly four values")
    if not isinstance(arg_1, BufferedTilePyramid):
        raise TypeError("pyramid has to be a BufferedTilePyramid")

    arg_0 = Bounds(*arg_0)
    arg_3 = arg_1.tile_from_xy(arg_0.left, arg_0.bottom, arg_2, on_edge_use="rt").bounds
    arg_4 = arg_1.tile_from_xy(arg_0.right, arg_0.top, arg_2, on_edge_use="lb").bounds
    return Bounds(arg_3.left, arg_3.bottom, arg_4.right, arg_4.top)

Snaps bounds to tiles boundaries of specific zoom level .


def Func(arg_0, arg_1, arg_2, arg_3=1):
        r'''Method to calculate a derivative of a temperature and pressure
        dependent property with respect to temperature at constant pressure,
        of a given order. Methods found valid by `select_valid_methods_P` are
        attempted until a method succeeds. If no methods are valid and succeed,
        None is returned.

        Calls `calculate_derivative_T` internally to perform the actual
        calculation.

        .. math::
            \text{derivative} = \frac{d (\text{property})}{d T}|_{P}

        Parameters
        ----------
        T : float
            Temperature at which to calculate the derivative, [K]
        P : float
            Pressure at which to calculate the derivative, [Pa]
        order : int
            Order of the derivative, >= 1

        Returns
        -------
        d_prop_d_T_at_P : float
            Calculated derivative property, [`units/K^order`]
        '''
        arg_4 = arg_0.select_valid_methods_P(arg_1, arg_2)
        for arg_5 in arg_4:
            try:
                return arg_0.calculate_derivative_T(arg_1, arg_2, arg_5, arg_3)
            except:
                pass
        return None

r Method to calculate a derivative of a temperature and pressure dependent property with respect to temperature at constant pressure of a given order . Methods found valid by select_valid_methods_P are attempted until a method succeeds . If no methods are valid and succeed None is returned .


(
            self, job, job_add_options=None, custom_headers=None, raw=False, **operation_config)

def Func(
            arg_0, arg_1, arg_2=None, arg_3=None, arg_4=False, **arg_5):
        """Adds a job to the specified account.

        The Batch service supports two ways to control the work done as part of
        a job. In the first approach, the user specifies a Job Manager task.
        The Batch service launches this task when it is ready to start the job.
        The Job Manager task controls all other tasks that run under this job,
        by using the Task APIs. In the second approach, the user directly
        controls the execution of tasks under an active job, by using the Task
        APIs. Also note: when naming jobs, avoid including sensitive
        information such as user names or secret project names. This
        information may appear in telemetry logs accessible to Microsoft
        Support engineers.

        :param job: The job to be Funced.
        :type job: ~azure.batch.models.JobAddParameter
        :param job_Func_options: Additional parameters for the operation
        :type job_Func_options: ~azure.batch.models.JobAddOptions
        :param dict custom_headers: headers that will be Funced to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: None or ClientRawResponse if raw=true
        :rtype: None or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`BatchErrorException<azure.batch.models.BatchErrorException>`
        """
        arg_6 = None
        if arg_2 is not None:
            arg_6 = arg_2.timeout
        arg_7 = None
        if arg_2 is not None:
            arg_7 = arg_2.client_request_id
        arg_8 = None
        if arg_2 is not None:
            arg_8 = arg_2.return_client_request_id
        arg_9 = None
        if arg_2 is not None:
            arg_9 = arg_2.ocp_date

        # Construct URL
        arg_10 = arg_0.Func.metadata['url']
        arg_11 = {
            'batchUrl': arg_0._serialize.url("self.config.batch_url", arg_0.config.batch_url, 'str', skip_quote=True)
        }
        arg_10 = arg_0._client.format_url(arg_10, **arg_11)

        # Construct parameters
        arg_12 = {}
        arg_12['api-version'] = arg_0._serialize.query("self.api_version", arg_0.api_version, 'str')
        if arg_6 is not None:
            arg_12['timeout'] = arg_0._serialize.query("timeout", arg_6, 'int')

        # Construct headers
        arg_13 = {}
        arg_13['Content-Type'] = 'application/json; odata=minimalmetadata; charset=utf-8'
        if arg_0.config.generate_client_request_id:
            arg_13['client-request-id'] = str(uuid.uuid1())
        if arg_3:
            arg_13.update(arg_3)
        if arg_0.config.accept_language is not None:
            arg_13['accept-language'] = arg_0._serialize.header("self.config.accept_language", arg_0.config.accept_language, 'str')
        if arg_7 is not None:
            arg_13['client-request-id'] = arg_0._serialize.header("client_request_id", arg_7, 'str')
        if arg_8 is not None:
            arg_13['return-client-request-id'] = arg_0._serialize.header("return_client_request_id", arg_8, 'bool')
        if arg_9 is not None:
            arg_13['ocp-date'] = arg_0._serialize.header("ocp_date", arg_9, 'rfc-1123')

        # Construct body
        arg_14 = arg_0._serialize.body(arg_1, 'JobAddParameter')

        # Construct and send request
        arg_15 = arg_0._client.post(arg_10, arg_12, arg_13, arg_14)
        arg_16 = arg_0._client.send(arg_15, stream=False, **arg_5)

        if arg_16.status_code not in [201]:
            raise models.BatchErrorException(arg_0._deserialize, arg_16)

        if arg_4:
            arg_17 = ClientRawResponse(None, arg_16)
            arg_17.Func_headers({
                'client-request-id': 'str',
                'request-id': 'str',
                'ETag': 'str',
                'Last-Modified': 'rfc-1123',
                'DataServiceId': 'str',
            })
            return arg_17

Adds a job to the specified account.

        The Batch service supports two ways to control the work done as part of
        a job. In the first approach, the user specifies a Job Manager task.
        The Batch service launches this task when it is ready to start the job.
        The Job Manager task controls all other tasks that run under this job,
        by using the Task APIs. In the second approach, the user directly
        controls the execution of tasks under an active job, by using the Task
        APIs. Also note: when naming jobs, avoid including sensitive
        information such as user names or secret project names. This
        information may appear in telemetry logs accessible to Microsoft
        Support engineers.

        :param job: The job to be added.
        :type job: ~azure.batch.models.JobAddParameter
        :param job_add_options: Additional parameters for the operation
        :type job_add_options: ~azure.batch.models.JobAddOptions
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: None or ClientRawResponse if raw=true
        :rtype: None or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`BatchErrorException<azure.batch.models.BatchErrorException>`


def Func ( arg_0 ) -> dict : arg_1 = { } arg_1 [ 'name' ] = arg_0 . name arg_1 [ 'callback' ] = arg_0 . callback arg_0 . control_Func [ 'content' ] = arg_1 return arg_0 . control_Func

def Func(arg_0) -> dict:
        """Returns Func compatible state of the Button instance.

        Returns:
            control_Func: Json representation of Button state.
        """
        arg_1 = {}
        arg_1['name'] = arg_0.name
        arg_1['callback'] = arg_0.callback
        arg_0.control_Func['content'] = arg_1
        return arg_0.control_Func

Returns json compatible state of the Button instance.

        Returns:
            control_json: Json representation of Button state.

Returns json compatible state of the Button instance .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_2 is None : if arg_0 . access_token is None or arg_0 . access_token_expired : arg_0 . refresh ( None ) return client . AccessTokenInfo ( access_token = arg_0 . access_token , expires_in = arg_0 . _expires_in ( ) ) else : arg_3 , arg_4 = arg_0 . _create_token ( arg_2 ) return client . AccessTokenInfo ( access_token = arg_3 , expires_in = arg_0 . _MAX_TOKEN_LIFETIME_SECS )

def Func(arg_0, arg_1=None, arg_2=None):
        """Create a signed jwt.

        Args:
            http: unused
            additional_claims: dict, additional claims to add to
                the payload of the JWT.
        Returns:
            An AccessTokenInfo with the signed jwt
        """
        if arg_2 is None:
            if arg_0.access_token is None or arg_0.access_token_expired:
                arg_0.refresh(None)
            return client.AccessTokenInfo(
              access_token=arg_0.access_token, expires_in=arg_0._expires_in())
        else:
            # Create a 1 time token
            arg_3, arg_4 = arg_0._create_token(arg_2)
            return client.AccessTokenInfo(
              access_token=arg_3, expires_in=arg_0._MAX_TOKEN_LIFETIME_SECS)


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
arg_5
=
"%s %s %s %s"
%
(
str
(
arg_1
)
,
str
(
arg_2
)
,
str
(
arg_3
)
,
str
(
arg_4
)
)
arg_0
.
_player_interface
.
VideoPos
(
ObjectPath
(
'/not/used'
)
,
String
(
arg_5
)
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        Set the video position on the screen

        Args:
            x1 (int): Top left x coordinate (px)
            y1 (int): Top left y coordinate (px)
            x2 (int): Bottom right x coordinate (px)
            y2 (int): Bottom right y coordinate (px)
        """
        arg_5 = "%s %s %s %s" % (str(arg_1),str(arg_2),str(arg_3),str(arg_4))
        arg_0._player_interface.VideoPos(ObjectPath('/not/used'), String(arg_5))


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
1
arg_4
=
arg_3
while
'['
in
arg_1
:
arg_5
=
arg_1
.
find
(
'['
)
arg_6
=
arg_1
.
find
(
']'
,
arg_5
)
if
arg_6
==
1
:
raise
ValueError
(
'No closing square bracket: text=('
+
arg_1
+
') strip=('
+
text_type
(
arg_2
)
+
')'
)
arg_4
&=
int
(
arg_1
[
arg_5
+
1
:
arg_6
]
)
arg_1
=
arg_1
[
:
arg_5
]
+
arg_1
[
arg_6
+
1
:
]
if
arg_4
==
arg_3
or
arg_2
:
return
arg_1
elif
arg_4
==
0
:
return
'[0]'
return
arg_1
+
'['
+
str
(
arg_4
)
+
']'

def Func(arg_0, arg_1, arg_2):
        """Remove embedded bracketed attributes.

        This (potentially) bitwise-ands bracketed attributes together and adds
        to the end.
        This is applied to a single alternative at a time -- not to a
        parenthesized list.
        It removes all embedded bracketed attributes, logically-ands them
        together, and places them at the end.
        However if strip is true, this can indeed remove embedded bracketed
        attributes from a parenthesized list.

        Parameters
        ----------
        text : str
            A Beider-Morse phonetic encoding (in progress)
        strip : bool
            Remove the bracketed attributes (and throw away)

        Returns
        -------
        str
            A Beider-Morse phonetic code

        Raises
        ------
        ValueError
            No closing square bracket

        """
        arg_3 = -1  # all 1's
        arg_4 = arg_3
        while '[' in arg_1:
            arg_5 = arg_1.find('[')
            arg_6 = arg_1.find(']', arg_5)
            if arg_6 == -1:
                raise ValueError(
                    'No closing square bracket: text=('
                    + arg_1
                    + ') strip=('
                    + text_type(arg_2)
                    + ')'
                )
            arg_4 &= int(arg_1[arg_5 + 1 : arg_6])
            arg_1 = arg_1[:arg_5] + arg_1[arg_6 + 1 :]

        if arg_4 == arg_3 or arg_2:
            return arg_1
        elif arg_4 == 0:
            # means that the attributes were incompatible and there is no
            # alternative here
            return '[0]'
        return arg_1 + '[' + str(arg_4) + ']'


def Func(arg_0):
    "make privkeys that support coloring, see utils.cstr"
    arg_1 = []
    assert arg_0 <= num_colors
    for arg_2 in range(arg_0):
        arg_3 = 0
        while True:
            arg_4 = sha3(str(arg_3))
            arg_5 = privtoaddr(arg_4)
            arg_6 = big_endian_to_int(arg_5)
            if arg_6 % num_colors == arg_2:
                break
            arg_3 += 1
        arg_1.append(arg_4)
    return arg_1

make privkeys that support coloring see utils . cstr


(self,
                            encryption_algorithm,
                            encryption_key,
                            plain_text,
                            padding_method,
                            hashing_algorithm=None)

def Func(arg_0,
                            arg_1,
                            arg_2,
                            arg_3,
                            arg_4,
                            arg_5=None):
        """
        Encrypt data using asymmetric encryption.

        Args:
            encryption_algorithm (CryptographicAlgorithm): An enumeration
                specifying the asymmetric encryption algorithm to use for
                encryption. Required.
            encryption_key (bytes): The bytes of the public key to use for
                encryption. Required.
            plain_text (bytes): The bytes to be encrypted. Required.
            padding_method (PaddingMethod): An enumeration specifying the
                padding method to use with the asymmetric encryption
                algorithm. Required.
            hashing_algorithm (HashingAlgorithm): An enumeration specifying
                the hashing algorithm to use with the encryption padding
                method. Required, if the padding method is OAEP. Optional
                otherwise, defaults to None.

        Returns:
            dict: A dictionary containing the encrypted data, with at least
                the following key/value field:
                * cipher_text - the bytes of the encrypted data

        Raises:
            InvalidField: Raised when the algorithm is unsupported or the
                length is incompatible with the algorithm.
            CryptographicFailure: Raised when the key generation process
                fails.
        """
        if arg_1 == enums.CryptographicAlgorithm.RSA:
            if arg_4 == enums.PaddingMethod.OAEP:
                arg_6 = arg_0._encryption_hash_algorithms.get(
                    arg_5
                )
                if arg_6 is None:
                    raise exceptions.InvalidField(
                        "The hashing algorithm '{0}' is not supported for "
                        "asymmetric encryption.".format(arg_5)
                    )

                arg_4 = asymmetric_padding.OAEP(
                    mgf=asymmetric_padding.MGF1(
                        algorithm=arg_6()
                    ),
                    algorithm=arg_6(),
                    label=None
                )
            elif arg_4 == enums.PaddingMethod.PKCS1v15:
                arg_4 = asymmetric_padding.PKCS1v15()
            else:
                raise exceptions.InvalidField(
                    "The padding method '{0}' is not supported for asymmetric "
                    "encryption.".format(arg_4)
                )

            arg_7 = default_backend()

            try:
                arg_8 = arg_7.load_der_public_key(arg_2)
            except Exception:
                try:
                    arg_8 = arg_7.load_pem_public_key(arg_2)
                except Exception:
                    raise exceptions.CryptographicFailure(
                        "The public key bytes could not be loaded."
                    )
            arg_9 = arg_8.encrypt(
                arg_3,
                arg_4
            )
            return {'cipher_text': arg_9}
        else:
            raise exceptions.InvalidField(
                "The cryptographic algorithm '{0}' is not supported for "
                "asymmetric encryption.".format(arg_1)
            )

Encrypt data using asymmetric encryption .


(major, minor=0, patch=0, prerelease=None, build=None)

def Func ( arg_0 , arg_1 = 0 , arg_2 = 0 , arg_3 = None , arg_4 = None ) : arg_5 = str ( arg_0 ) + '.' + str ( arg_1 ) + '.' + str ( arg_2 ) if arg_3 : if arg_3 . startswith ( '-' ) : arg_5 = arg_5 + arg_3 else : arg_5 = arg_5 + "-" + str ( arg_3 ) if arg_4 : if arg_4 . startswith ( '+' ) : arg_5 = arg_5 + arg_4 else : arg_5 = arg_5 + "+" + str ( arg_4 ) return ( arg_5 )

def Func(arg_0, arg_1=0, arg_2=0, arg_3=None, arg_4=None):
    """
    Takes the parts of a semantic version number, and returns a nicely
    formatted string.
    """
    arg_5 = str(arg_0) + '.' + str(arg_1) + '.' + str(arg_2)
    if arg_3:
        if arg_3.startswith('-'):
            arg_5 = arg_5 + arg_3
        else:
            arg_5 = arg_5 + "-" + str(arg_3)
    if arg_4:
        if arg_4.startswith('+'):
            arg_5 = arg_5 + arg_4
        else:
            arg_5 = arg_5 + "+" + str(arg_4)
    return(arg_5)

Takes the parts of a semantic version number and returns a nicely formatted string .


(
    src, keep_last_versions,
    config_file='config.yaml', profile_name=None,
)

def Func(
    arg_0, arg_1,
    arg_2='config.yaml', arg_3=None,
):
    """Deletes old deployed versions of the function in AWS Lambda.

    Won't delete $Latest and any aliased version

    :param str src:
        The path to your Lambda ready project (folder must contain a valid
        config.yaml and handler module (e.g.: service.py).
    :param int keep_last_versions:
        The number of recent versions to keep and not delete
    """
    if arg_1 <= 0:
        print("Won't delete all versions. Please do this manually")
    else:
        arg_4 = os.path.join(arg_0, arg_2)
        arg_5 = read_cfg(arg_4, arg_3)

        arg_3 = arg_5.get('profile')
        arg_6 = arg_5.get('aws_access_key_id')
        arg_7 = arg_5.get('aws_secret_access_key')

        arg_8 = get_client(
            'lambda', arg_3, arg_6, arg_7,
            arg_5.get('region'),
        )

        arg_9 = arg_8.list_versions_by_function(
            FunctionName=arg_5.get('function_name'),
        )
        arg_10 = arg_9.get('Versions')
        if len(arg_9.get('Versions')) < arg_1:
            print('Nothing to delete. (Too few versions published)')
        else:
            arg_11 = [elem.get('Version') for elem in
                               arg_10[1:-arg_1]]
            for arg_12 in arg_11:
                try:
                    arg_8.delete_function(
                        FunctionName=arg_5.get('function_name'),
                        Qualifier=arg_12,
                    )
                except botocore.exceptions.ClientError as e:
                    print('Skipping Version {}: {}'
                          .format(arg_12, e.message))

Deletes old deployed versions of the function in AWS Lambda .


def Func ( arg_0 ) : if isinstance ( arg_0 , six . binary_type ) : try : arg_0 = arg_0 . decode ( 'utf-8' ) except UnicodeDecodeError : arg_0 = six . text_type ( _dequote ( repr ( arg_0 ) ) ) arg_1 = six . text_type ( arg_0 ) if isinstance ( arg_0 , six . text_type ) : arg_1 = "'%s'" % arg_1 return arg_1

def Func(arg_0):
    """
    Convert to unicode, and add quotes if initially a string
    """
    if isinstance(arg_0, six.binary_type):
        try:
            arg_0 = arg_0.decode('utf-8')
        except UnicodeDecodeError:  # Not utf-8. Show the repr
            arg_0 = six.text_type(_dequote(repr(arg_0)))  # trim quotes

    arg_1 = six.text_type(arg_0)

    if isinstance(arg_0, six.text_type):
        arg_1 = "'%s'" % arg_1
    return arg_1

Convert to unicode and add quotes if initially a string


return self.fetch_json(
            uri_path=self.base_uri + '/labels',
            http_method='POST',
            query_params=query_params or {}
        )

def Func ( arg_0 , arg_1 = None ) : return arg_0 . fetch_json ( uri_path = arg_0 . base_uri + '/labels' , http_method = 'POST' , arg_1 = arg_1 or { } )

def Func(arg_0, arg_1=None):
        '''
        Add a label to this card, from a dictionary.
        '''
        return arg_0.fetch_json(
            uri_path=arg_0.base_uri + '/labels',
            http_method='POST',
            arg_1=arg_1 or {}
        )

Add a label to this card from a dictionary .


def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_4 = arg_0 . __url + arg_1 + '.json' if arg_2 or arg_3 : arg_4 += "?" if arg_2 : arg_4 += ( "auth=" + arg_2 ) if arg_3 : if not arg_4 . endswith ( '?' ) : arg_4 += "&" arg_4 += "format=export" return arg_4

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        '''
        Returns a Corrected URL to be used for a Request
        as per the REST API.
        '''
        arg_4 = arg_0.__url + arg_1 + '.json'
        if arg_2 or arg_3:
            arg_4 += "?"
        if arg_2:
            arg_4 += ("auth=" + arg_2)
        if arg_3:
            if not arg_4.endswith('?'):
                arg_4 += "&"
            arg_4 += "format=export"
        return arg_4

Returns a Corrected URL to be used for a Request as per the REST API .


def Func(arg_0, arg_1, arg_2='utf-8'):
    """ Modify the encoding entry in the XML file.

    Parameters
    ----------
    filepath: str
        Path to the file to be modified.

    src_enc: str
        Encoding that is written in the file

    dst_enc: str
        Encoding to be set in the file.
    """
    arg_3 = "encoding='{}'"
    replace_file_content(arg_0, arg_3.format(arg_1), arg_3.format(arg_2), 1)

Modify the encoding entry in the XML file .


def Func ( arg_0 , arg_1 ) : try : arg_2 = pickle . Func ( open ( arg_1 , 'rb' ) ) except UnicodeDecodeError : arg_2 = pickle . Func ( open ( arg_1 , 'rb' ) , encoding = 'latin' ) if hasattr ( arg_2 , 'feature_table' ) : arg_2 . feature_table . _csr_to_sdf ( ) return arg_2

def Func(arg_0, arg_1):
        """ Load a pickled Dataset instance from file. """
        try:
            arg_2 = pickle.Func(open(arg_1, 'rb'))
        except UnicodeDecodeError:
            # Need to try this for python3
            arg_2 = pickle.Func(open(arg_1, 'rb'), encoding='latin')

        if hasattr(arg_2, 'feature_table'):
            arg_2.feature_table._csr_to_sdf()
        return arg_2

Load a pickled Dataset instance from file .


def
Func
(
arg_0
)
:
arg_1
=
MANAGER
with
settings
(
hide
(
'running'
,
'stdout'
,
'stderr'
,
'warnings'
)
,
warn_only
=
True
)
:
arg_2
=
run
(
"rpm --query %(pkg_name)s"
%
locals
(
)
)
if
arg_2
.
succeeded
:
return
True
return
False

def Func(arg_0):
    """
    Check if an RPM package is installed.
    """
    arg_1 = MANAGER
    with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True):
        arg_2 = run("rpm --query %(pkg_name)s" % locals())
        if arg_2.succeeded:
            return True
        return False


(meas_qubits,
                   meas_basis='Pauli',
                   prep_qubits=None,
                   prep_basis=None)

return {'qubits': meas_qubits,
            'circuits': circuits,
            'circuit_labels': circuit_labels,
            'prep_basis': prep_basis,
            'meas_basis': meas_basis}

def Func(arg_0,
                   arg_1='Pauli',
                   arg_2=None,
                   arg_3=None):
    """
    Generate a dictionary of tomography experiment configurations.

    This returns a data structure that is used by other tomography functions
    to generate state and process tomography circuits, and extract tomography
    data from results after execution on a backend.

    Quantum State Tomography:
        Be default it will return a set for performing Quantum State
        Tomography where individual qubits are measured in the Pauli basis.
        A custom measurement basis may also be used by defining a user
        `tomography_basis` and passing this in for the `meas_basis` argument.

    Quantum Process Tomography:
        A quantum process tomography set is created by specifying a preparation
        basis along with a measurement basis. The preparation basis may be a
        user defined `tomography_basis`, or one of the two built in basis 'SIC'
        or 'Pauli'.
        - SIC: Is a minimal symmetric informationally complete preparation
               basis for 4 states for each qubit (4 ^ number of qubits total
               preparation states). These correspond to the |0> state and the 3
               other vertices of a tetrahedron on the Bloch-sphere.
        - Pauli: Is a tomographically overcomplete preparation basis of the six
                 eigenstates of the 3 Pauli operators (6 ^ number of qubits
                 total preparation states).

    Args:
        meas_qubits (list): The qubits being measured.
        meas_basis (tomography_basis or str): The qubit measurement basis.
            The default value is 'Pauli'.
        prep_qubits (list or None): The qubits being prepared. If None then
            meas_qubits will be used for process tomography experiments.
        prep_basis (tomography_basis or None): The optional qubit preparation
            basis. If no basis is specified state tomography will be performed
            instead of process tomography. A built in basis may be specified by
            'SIC' or 'Pauli'  (SIC basis recommended for > 2 qubits).

    Returns:
        dict: A dict of tomography configurations that can be parsed by
        `create_tomography_circuits` and `tomography_data` functions
        for implementing quantum tomography experiments. This output contains
        fields "qubits", "meas_basis", "circuits". It may also optionally
        contain a field "prep_basis" for process tomography experiments.
        ```
        {
            'qubits': qubits (list[ints]),
            'meas_basis': meas_basis (tomography_basis),
            'circuit_labels': (list[string]),
            'circuits': (list[dict])  # prep and meas configurations
            # optionally for process tomography experiments:
            'prep_basis': prep_basis (tomography_basis)
        }
        ```
    Raises:
        QiskitError: if the Qubits argument is not a list.
    """
    if not isinstance(arg_0, list):
        raise QiskitError('Qubits argument must be a list')
    arg_4 = len(arg_0)

    if arg_2 is None:
        arg_2 = arg_0
    if not isinstance(arg_2, list):
        raise QiskitError('prep_qubits argument must be a list')
    if len(arg_2) != len(arg_0):
        raise QiskitError('meas_qubits and prep_qubitsare different length')

    if isinstance(arg_1, str):
        if arg_1.lower() == 'pauli':
            arg_1 = PAULI_BASIS

    if isinstance(arg_3, str):
        if arg_3.lower() == 'pauli':
            arg_3 = PAULI_BASIS
        elif arg_3.lower() == 'sic':
            arg_3 = SIC_BASIS

    arg_5 = []
    arg_6 = []

    # add meas basis configs
    if arg_3 is None:
        # State Tomography
        for arg_7 in product(arg_1.keys(), repeat=arg_4):
            arg_8 = dict(zip(arg_0, arg_7))
            arg_5.append({'meas': arg_8})
            # Make label
            arg_9 = '_meas_'
            for arg_10, arg_11 in arg_8.items():
                arg_9 += '%s(%d)' % (arg_11[0], arg_10)
            arg_6.append(arg_9)
        return {'qubits': arg_0,
                'circuits': arg_5,
                'circuit_labels': arg_6,
                'meas_basis': arg_1}

    # Process Tomography
    arg_12 = len(list(arg_3.values())[0])
    arg_13 = [(b, s)
                   for b in arg_3.keys()
                   for s in range(arg_12)]
    for arg_14 in product(arg_13, repeat=arg_4):
        for arg_7 in product(arg_1.keys(),
                                    repeat=arg_4):
            arg_15 = dict(zip(arg_2, arg_14))
            arg_8 = dict(zip(arg_0, arg_7))
            arg_5.append({'prep': arg_15, 'meas': arg_8})
            # Make label
            arg_9 = '_prep_'
            for arg_10, arg_11 in arg_15.items():
                arg_9 += '%s%d(%d)' % (arg_11[0], arg_11[1], arg_10)
            arg_9 += '_meas_'
            for arg_10, arg_11 in arg_8.items():
                arg_9 += '%s(%d)' % (arg_11[0], arg_10)
            arg_6.append(arg_9)
    return {'qubits': arg_0,
            'circuits': arg_5,
            'circuit_labels': arg_6,
            'prep_basis': arg_3,
            'meas_basis': arg_1}

Generate a dictionary of tomography experiment configurations .


def
Func
(
arg_0
)
:
for
arg_1
in
record_get_field_instances
(
arg_0
.
record
,
'710'
)
:
arg_2
=
field_get_subfield_instances
(
arg_1
)
for
arg_3
,
(
arg_4
,
arg_5
)
in
enumerate
(
arg_2
[
:
]
)
:
if
arg_4
==
'5'
:
arg_2
.
pop
(
arg_3
)
elif
arg_5
.
startswith
(
'CERN. Geneva'
)
:
arg_2
.
pop
(
arg_3
)
if
len
(
arg_2
)
==
0
:
record_delete_field
(
arg_0
.
record
,
tag
=
'710'
,
field_position_global
=
arg_1
[
4
]
)

def Func(arg_0):
        """710 Collaboration."""
        for arg_1 in record_get_field_instances(arg_0.record, '710'):
            arg_2 = field_get_subfield_instances(arg_1)
            for arg_3, (arg_4, arg_5) in enumerate(arg_2[:]):
                if arg_4 == '5':
                    arg_2.pop(arg_3)
                elif arg_5.startswith('CERN. Geneva'):
                    arg_2.pop(arg_3)
            if len(arg_2) == 0:
                record_delete_field(arg_0.record,
                                    tag='710',
                                    field_position_global=arg_1[4])


def
Func
(
arg_0
=
)
:
if
arg_0
is
:
arg_0
=
sys
.
argv
[
1
:
]
if
not
arg_0
or
arg_0
[
0
]
==
"help"
:
show_help
(
)
return
0
elif
arg_0
[
0
]
==
"check"
:
return
check_Func
(
arg_0
[
1
:
]
)
elif
arg_0
[
0
]
==
"list"
:
return
list_Func
(
arg_0
[
1
:
]
)
elif
arg_0
[
0
]
==
"write"
:
return
write_Func
(
arg_0
[
1
:
]
)
else
:
print
(
u"Don't understand {!r}"
.
format
(
" "
.
join
(
arg_0
)
)
)
show_help
(
)
return
1

def Func(arg_0=None):
    """The edx_lint command entry point."""
    if arg_0 is None:
        arg_0 = sys.argv[1:]

    if not arg_0 or arg_0[0] == "help":
        show_help()
        return 0
    elif arg_0[0] == "check":
        return check_Func(arg_0[1:])
    elif arg_0[0] == "list":
        return list_Func(arg_0[1:])
    elif arg_0[0] == "write":
        return write_Func(arg_0[1:])
    else:
        print(u"Don't understand {!r}".format(" ".join(arg_0)))
        show_help()
        return 1


def Func ( arg_0 , arg_1 ) : return os . path . join ( arg_0 . path , str ( arg_1 ) )

def Func(arg_0, arg_1):
        """
        Find the path to something inside this directory.
        """
        return os.path.join(arg_0.path, str(arg_1))

Find the path to something inside this directory .


def Func(arg_0, arg_1, arg_2):
        """Get metadata values for trait by key."""
        try:
            arg_3 = getattr(arg_0.__class__, arg_1)
        except AttributeError:
            raise TraitError("Class %s does not have a trait named %s" %
                                (arg_0.__class__.__name__, arg_1))
        else:
            return arg_3.get_metadata(arg_2)


return [StreamInfo(handle=buffer[k]) for k in range(num_found)]

def Func ( arg_0 ) : arg_1 = ( c_void_p * 1024 ) ( ) arg_2 = lib . lsl_resolver_Func ( arg_0 . obj , byref ( arg_1 ) , 1024 ) return [ StreamInfo ( handle = arg_1 [ arg_3 ] ) for arg_3 in range ( arg_2 ) ]

def Func(arg_0):
        """Obtain the set of currently present streams on the network.

        Returns a list of matching StreamInfo objects (with empty desc
        field), any of which can subsequently be used to open an inlet.

        """
        # noinspection PyCallingNonCallable
        arg_1 = (c_void_p*1024)()
        arg_2 = lib.lsl_resolver_Func(arg_0.obj, byref(arg_1), 1024)
        return [StreamInfo(handle=arg_1[arg_3]) for arg_3 in range(arg_2)]

Obtain the set of currently present streams on the network .


def Func ( arg_0 ) : for arg_1 in arg_0 . record . keys ( ) : if arg_1 in arg_0 . fields_list : record_delete_fields ( arg_0 . record , arg_1 )

def Func(arg_0):
        """Clear any fields listed in field_list."""
        for arg_1 in arg_0.record.keys():
            if arg_1 in arg_0.fields_list:
                record_delete_fields(arg_0.record, arg_1)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 20 ) : def f_df_augmented ( arg_4 ) : arg_5 , arg_6 = arg_2 ( arg_4 ) arg_7 = arg_5 + ( arg_1 / 2. ) * np . linalg . norm ( arg_4 - arg_0 ) ** 2 arg_8 = arg_6 + arg_1 * ( arg_4 - arg_0 ) return arg_7 , arg_8 arg_9 = scipy_minimize ( f_df_augmented , arg_0 , jac = True , method = 'L-BFGS-B' , options = { 'maxiter' : arg_3 , 'disp' : False } ) return arg_9 . x

def Func(arg_0, arg_1, arg_2, arg_3=20):
    """
    Minimize the proximal operator of a given objective using L-BFGS

    Parameters
    ----------
    f_df : function
        Returns the objective and gradient of the function to minimize

    maxiter : int
        Maximum number of L-BFGS iterations
    """

    def f_df_augmented(arg_4):
        arg_5, arg_6 = arg_2(arg_4)
        arg_7 = arg_5 + (arg_1 / 2.) * np.linalg.norm(arg_4 - arg_0) ** 2
        arg_8 = arg_6 + arg_1 * (arg_4 - arg_0)
        return arg_7, arg_8

    arg_9 = scipy_minimize(f_df_augmented, arg_0, jac=True, method='L-BFGS-B',
                         options={'maxiter': arg_3, 'disp': False})

    return arg_9.x

Minimize the proximal operator of a given objective using L - BFGS


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_0
in
(
'U'
,
'u3'
)
:
return
arg_1
[
0
]
,
arg_1
[
1
]
,
arg_1
[
2
]
elif
arg_0
==
'u2'
:
return
np
.
pi
/
2
,
arg_1
[
0
]
,
arg_1
[
1
]
elif
arg_0
==
'u1'
:
return
0
,
0
,
arg_1
[
0
]
elif
arg_0
==
'id'
:
return
0
,
0
,
0
raise
QiskitError
(
'Gate is not among the valid types: %s'
%
arg_0
)

def Func(arg_0, arg_1=None):
    """Apply a single qubit gate to the qubit.

    Args:
        gate(str): the single qubit gate name
        params(list): the operation parameters op['params']
    Returns:
        tuple: a tuple of U gate parameters (theta, phi, lam)
    Raises:
        QiskitError: if the gate name is not valid
    """
    if arg_0 in ('U', 'u3'):
        return arg_1[0], arg_1[1], arg_1[2]
    elif arg_0 == 'u2':
        return np.pi / 2, arg_1[0], arg_1[1]
    elif arg_0 == 'u1':
        return 0, 0, arg_1[0]
    elif arg_0 == 'id':
        return 0, 0, 0
    raise QiskitError('Gate is not among the valid types: %s' % arg_0)

Apply a single qubit gate to the qubit .


def
Func
(
arg_0
)
:
arg_0
.
log
.
debug
(
"creating overlayed protocols plot"
)
arg_0
.
figure
(
)
for
arg_1
in
range
(
arg_0
.
abf
.
sweeps
)
:
arg_0
.
abf
.
setsweep
(
arg_1
)
plt
.
plot
(
arg_0
.
abf
.
protoX
,
arg_0
.
abf
.
protoY
,
color
=
'r'
)
arg_0
.
marginX
=
0
arg_0
.
decorate
(
protocol
=
True
)

def Func(arg_0):
        """plot the protocol of all sweeps."""
        arg_0.log.debug("creating overlayed protocols plot")
        arg_0.figure()
        for arg_1 in range(arg_0.abf.sweeps):
            arg_0.abf.setsweep(arg_1)
            plt.plot(arg_0.abf.protoX,arg_0.abf.protoY,color='r')
        arg_0.marginX=0
        arg_0.decorate(protocol=True)


def Func ( arg_0 , arg_1 = ( 0 , 1 ) ) : arg_2 = type ( arg_0 ) if not hasattr ( arg_0 , 'dtype' ) : arg_0 = arg_3 . asarray ( arg_0 ) arg_0 [ arg_0 == - arg_3 . inf ] = arg_1 [ 0 ] arg_0 [ arg_0 == arg_3 . inf ] = arg_1 [ 1 ] if not isinstance ( arg_0 , arg_2 ) : arg_0 = arg_2 ( arg_0 ) return arg_0

def Func(arg_0, arg_1=(0, 1)):
    """
    Truncate infinite values to a range.

    Parameters
    ----------
    x : array_like
        Values that should have infinities squished.
    range : tuple
        The range onto which to squish the infinites.
        Must be of size 2.

    Returns
    -------
    out : array_like
        Values with infinites squished.

    Examples
    --------
    >>> Func([0, .5, .25, np.inf, .44])
    [0.0, 0.5, 0.25, 1.0, 0.44]
    >>> Func([0, -np.inf, .5, .25, np.inf], (-10, 9))
    [0.0, -10.0, 0.5, 0.25, 9.0]
    """
    arg_2 = type(arg_0)

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

    arg_0[arg_0 == -arg_3.inf] = arg_1[0]
    arg_0[arg_0 == arg_3.inf] = arg_1[1]

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

Truncate infinite values to a range.

    Parameters
    ----------
    x : array_like
        Values that should have infinities squished.
    range : tuple
        The range onto which to squish the infinites.
        Must be of size 2.

    Returns
    -------
    out : array_like
        Values with infinites squished.

    Examples
    --------
    >>> squish_infinite([0, .5, .25, np.inf, .44])
    [0.0, 0.5, 0.25, 1.0, 0.44]
    >>> squish_infinite([0, -np.inf, .5, .25, np.inf], (-10, 9))
    [0.0, -10.0, 0.5, 0.25, 9.0]


def Func ( arg_0 , arg_1 ) : arg_2 = { } arg_0 = smartSort ( arg_0 ) arg_3 = list ( set ( [ elem [ : 5 ] for elem in arg_0 if elem . endswith ( ".abf" ) ] ) ) for arg_4 in smartSort ( arg_3 ) : arg_5 = None for arg_6 , arg_7 in enumerate ( [ elem for elem in arg_0 if elem . startswith ( arg_4 ) and elem . endswith ( ".abf" ) ] ) : arg_8 = os . path . splitext ( arg_7 ) [ 0 ] if len ( [ arg_9 for arg_9 in arg_0 if arg_9 . startswith ( arg_8 ) ] ) - 1 : arg_5 = arg_8 if not arg_5 in arg_2 : arg_2 [ arg_5 ] = [ ] arg_2 [ arg_5 ] = arg_2 [ arg_5 ] + [ arg_7 ] return arg_2

def Func(arg_0,arg_1):
    """given files and cells, return a dict of files grouped by cell."""
    arg_2={}
    arg_0=smartSort(arg_0)
    arg_3 = list(set([elem[:5] for elem in arg_0 if elem.endswith(".abf")])) # so pythonic!
    for arg_4 in smartSort(arg_3):
        arg_5=None
        for arg_6,arg_7 in enumerate([elem for elem in arg_0 if elem.startswith(arg_4) and elem.endswith(".abf")]):
            arg_8=os.path.splitext(arg_7)[0]
            if len([arg_9 for arg_9 in arg_0 if arg_9.startswith(arg_8)])-1:
                arg_5=arg_8
            if not arg_5 in arg_2:
                arg_2[arg_5]=[]
            arg_2[arg_5]=arg_2[arg_5]+[arg_7]
    return arg_2

given files and cells return a dict of files grouped by cell .


(name: str, ns: Optional[str] = None, meta=None)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 [ arg_1 ] = None , arg_4 = None ) -> Symbol : return Symbol ( arg_0 , arg_2 = arg_2 , arg_4 = arg_4 )

def Func(arg_0: arg_1, arg_2: arg_3[arg_1] = None, arg_4=None) -> Symbol:
    """Create a new Func."""
    return Symbol(arg_0, arg_2=arg_2, arg_4=arg_4)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_1 + arg_2 if '[' not in arg_4 : return arg_4 arg_4 = arg_0 . _expand_alternates ( arg_4 ) arg_5 = arg_4 . split ( '|' ) arg_4 = '' arg_6 = False for arg_7 in range ( len ( arg_5 ) ) : arg_8 = arg_5 [ arg_7 ] if arg_3 != 1 : arg_8 = arg_0 . _normalize_lang_attrs ( arg_8 + '[' + str ( arg_3 ) + ']' , False ) if arg_8 != '[0]' : arg_6 = True if arg_4 : arg_4 += '|' arg_4 += arg_8 if not arg_6 : return None if '|' in arg_4 : arg_4 = '(' + arg_4 + ')' return arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
        """Apply a phonetic regex if compatible.

        tests for compatible language rules

        to do so, apply the rule, expand the results, and detect alternatives
            with incompatible attributes

        then drop each alternative that has incompatible attributes and keep
            those that are compatible

        if there are no compatible alternatives left, return false

        otherwise return the compatible alternatives

        apply the rule

        Parameters
        ----------
        phonetic : str
            The Beider-Morse phonetic encoding (so far)
        target : str
            A proposed addition to the phonetic encoding
        language_arg : int
            An integer representing the target language of the phonetic
            encoding

        Returns
        -------
        str
            A candidate encoding

        """
        arg_4 = arg_1 + arg_2
        if '[' not in arg_4:  # no attributes so we need test no further
            return arg_4

        # expand the result, converting incompatible attributes to [0]
        arg_4 = arg_0._expand_alternates(arg_4)
        arg_5 = arg_4.split('|')

        # drop each alternative that has incompatible attributes
        arg_4 = ''
        arg_6 = False

        for arg_7 in range(len(arg_5)):
            arg_8 = arg_5[arg_7]
            if arg_3 != 1:
                arg_8 = arg_0._normalize_lang_attrs(
                    arg_8 + '[' + str(arg_3) + ']', False
                )
            if arg_8 != '[0]':
                arg_6 = True
                if arg_4:
                    arg_4 += '|'
                arg_4 += arg_8

        # return false if no compatible alternatives remain
        if not arg_6:
            return None

        # return the result of applying the rule
        if '|' in arg_4:
            arg_4 = '(' + arg_4 + ')'
        return arg_4


(data, alpharangemults=(0.9,1.1), n_alpha=201, approximate=True, verbose=True)

def Func(arg_0, arg_1=(0.9,1.1), arg_2=201, arg_3=True, arg_4=True):
    """
    Use the maximum L to determine the most likely value of alpha

    *alpharangemults* [ 2-tuple ]
        Pair of values indicating multiplicative factors above and below the
        approximate alpha from the MLE alpha to use when determining the
        "exact" alpha (by directly maximizing the likelihood function)
    """

    arg_5 = np.unique(arg_0)
    if arg_3:
        arg_6 = [ discrete_alpha_mle(arg_0,xmin) for xmin in arg_5 ]
    else:
        arg_7 = [ discrete_alpha_mle(arg_0,xmin) for xmin in arg_5 ]
        arg_8 = [(0.9*a,1.1*a) for a in arg_7]
        arg_6 = [ most_likely_alpha(arg_0,xmin,alpharange=ar,arg_2=arg_2) for xmin,ar in zip(arg_5,arg_8) ]
    arg_9 = [ discrete_ksD(arg_0, xmin, alpha) for xmin,alpha in zip(arg_5,arg_6) ]

    arg_10 = argmin(arg_9)
    arg_11 = arg_6[arg_10]
    arg_12 = arg_5[arg_10]
    arg_13 = arg_9[arg_10]
    arg_14 = discrete_likelihood(arg_0, arg_12, arg_11)

    if arg_4:
        print("alpha = %f   xmin = %f   ksD = %f   L = %f   (n<x) = %i  (n>=x) = %i" % (
                arg_11, arg_12, arg_13, arg_14,
                (arg_0<arg_12).sum(), (arg_0>=arg_12).sum()))

    return arg_11,arg_12,arg_13,arg_14


def Func(arg_0, arg_1, arg_2):
    """
    This method ensures that each column has enough connections to input bits
    to allow it to become active. Since a column must have at least
    'self._stimulusThreshold' overlaps in order to be considered during the
    inhibition phase, columns without such minimal number of connections, even
    if all the input bits they are connected to turn on, have no chance of
    obtaining the minimum threshold. For such columns, the permanence values
    are increased until the minimum number of connections are formed.

    Parameters:
    ----------------------------
    :param perm:    An array of permanence values for a column. The array is
                    "dense", i.e. it contains an entry for each input bit, even
                    if the permanence value is 0.
    :param mask:    the indices of the columns whose permanences need to be
                    raised.
    """
    if len(arg_2) < arg_0._stimulusThreshold:
      raise Exception("This is likely due to a " +
      "value of stimulusThreshold that is too large relative " +
      "to the input size. [len(mask) < self._stimulusThreshold]")

    numpy.clip(arg_1, arg_0._synPermMin, arg_0._synPermMax, out=arg_1)
    while True:
      arg_3 = numpy.nonzero(
        arg_1 > arg_0._synPermConnected - PERMANENCE_EPSILON)[0].size

      if arg_3 >= arg_0._stimulusThreshold:
        return
      arg_1[arg_2] += arg_0._synPermBelowStimulusInc

This method ensures that each column has enough connections to input bits to allow it to become active . Since a column must have at least self . _stimulusThreshold overlaps in order to be considered during the inhibition phase columns without such minimal number of connections even if all the input bits they are connected to turn on have no chance of obtaining the minimum threshold . For such columns the permanence values are increased until the minimum number of connections are formed .


def Func ( arg_0 ) : arg_0 . noise . data . normal_ ( ) if not arg_0 . confounding : for arg_1 in arg_0 . topological_order : arg_0 . generated [ arg_1 ] = arg_0 . blocks [ arg_1 ] ( th . cat ( [ v for c in [ [ arg_0 . generated [ j ] for j in np . nonzero ( arg_0 . adjacency_matrix [ : , arg_1 ] ) [ 0 ] ] , [ arg_0 . noise [ : , [ arg_1 ] ] ] ] for v in c ] , 1 ) ) else : for arg_1 in arg_0 . topological_order : arg_0 . generated [ arg_1 ] = arg_0 . blocks [ arg_1 ] ( th . cat ( [ v for c in [ [ arg_0 . generated [ j ] for j in np . nonzero ( arg_0 . adjacency_matrix [ : , arg_1 ] ) [ 0 ] ] , [ arg_0 . corr_noise [ min ( arg_1 , j ) , max ( arg_1 , j ) ] for j in np . nonzero ( arg_0 . i_adj_matrix [ : , arg_1 ] ) [ 0 ] ] [ arg_0 . noise [ : , [ arg_1 ] ] ] ] for v in c ] , 1 ) ) return th . cat ( arg_0 . generated , 1 )

def Func(arg_0):
        """Generate according to the topological order of the graph."""
        arg_0.noise.data.normal_()
        if not arg_0.confounding:
            for arg_1 in arg_0.topological_order:
                arg_0.generated[arg_1] = arg_0.blocks[arg_1](th.cat([v for c in [
                                                   [arg_0.generated[j] for j in np.nonzero(arg_0.adjacency_matrix[:, arg_1])[0]],
                                                   [arg_0.noise[:, [arg_1]]]] for v in c], 1))
        else:
            for arg_1 in arg_0.topological_order:
                arg_0.generated[arg_1] = arg_0.blocks[arg_1](th.cat([v for c in [
                                                   [arg_0.generated[j] for j in np.nonzero(arg_0.adjacency_matrix[:, arg_1])[0]],
                                                   [arg_0.corr_noise[min(arg_1, j), max(arg_1, j)] for j in np.nonzero(arg_0.i_adj_matrix[:, arg_1])[0]]
                                                   [arg_0.noise[:, [arg_1]]]] for v in c], 1))
        return th.cat(arg_0.generated, 1)

Generate according to the topological order of the graph .


def Func(arg_0):
        """
        Prepare the Directory for use in an Environment.

        This will create the directory if the create flag is set.
        """
        if arg_0._create:
            arg_0.create()
        for arg_1 in arg_0._children:
            arg_0._children[arg_1]._env = arg_0._env
            arg_0._children[arg_1].Func()

Prepare the Directory for use in an Environment .


def Func ( arg_0 ) -> None : while True : arg_1 = set ( arg_0 . iter_leaves ( ) ) if arg_1 : return arg_0 . remove_random_edge ( )

def Func(arg_0) -> None:
        """Remove random edges until there is at least one leaf node."""
        while True:
            arg_1 = set(arg_0.iter_leaves())
            if arg_1:
                return
            arg_0.remove_random_edge()

Remove random edges until there is at least one leaf node .


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 , arg_3 , arg_4 in arg_0 . graph . triples ( ( arg_1 , arg_2 , None ) ) : arg_0 . builder . add_file_contribution ( arg_0 . doc , six . text_type ( arg_4 ) )

def Func(arg_0, arg_1, arg_2):
        """
        Parse all file contributors and adds them to the model.
        """
        for arg_3, arg_3, arg_4 in arg_0.graph.triples((arg_1, arg_2, None)):
            arg_0.builder.add_file_contribution(arg_0.doc, six.text_type(arg_4))

Parse all file contributors and adds them to the model .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_2
<=
0
:
raise
ValueError
(
"k must be positive"
)
if
len
(
arg_1
)
<
arg_0
.
k
*
arg_0
.
l
:
raise
ValueError
(
"The num_perm of MinHash out of range"
)
arg_3
=
set
(
)
arg_4
=
arg_0
.
k
while
arg_4
>
0
:
for
arg_5
in
arg_0
.
_Func
(
arg_1
,
arg_4
,
arg_0
.
l
)
:
arg_3
.
add
(
arg_5
)
if
len
(
arg_3
)
>=
arg_2
:
return
list
(
arg_3
)
arg_4
-=
1
return
list
(
arg_3
)

def Func(arg_0, arg_1, arg_2):
        '''
        Return the approximate top-k keys that have the highest
        Jaccard similarities to the Func set.

        Args:
            minhash (datasketch.MinHash): The MinHash of the Func set.
            k (int): The maximum number of keys to return.

        Returns:
            `list` of at most k keys.
        '''
        if arg_2 <= 0:
            raise ValueError("k must be positive")
        if len(arg_1) < arg_0.k*arg_0.l:
            raise ValueError("The num_perm of MinHash out of range")
        arg_3 = set()
        arg_4 = arg_0.k
        while arg_4 > 0:
            for arg_5 in arg_0._Func(arg_1, arg_4, arg_0.l):
                arg_3.add(arg_5)
                if len(arg_3) >= arg_2:
                    return list(arg_3)
            arg_4 -= 1
        return list(arg_3)

Return the approximate top-k keys that have the highest
        Jaccard similarities to the query set.

        Args:
            minhash (datasketch.MinHash): The MinHash of the query set.
            k (int): The maximum number of keys to return.

        Returns:
            `list` of at most k keys.

Return the approximate top - k keys that have the highest Jaccard similarities to the query set .


(self, covariation=True, force_positive=True, slope=0, **kwarks)

def Func(arg_0, arg_1=True, arg_2=True, arg_3=0, **arg_4):
        '''
        Determine the node that, when the tree is rooted on this node, results
        in the best regression of temporal constraints and root to tip distances.

        Parameters
        ----------

         infer_gtr : bool
            If True, infer new GTR model after re-root

         covariation : bool
            account for covariation structure when rerooting the tree

         force_positive : bool
            only accept positive evolutionary rate estimates when rerooting the tree

        '''
        for arg_5 in arg_0.tree.find_clades():
            arg_5.branch_length=arg_5.mutation_length
        arg_0.logger("TreeTime.Func: searching for the best root position...",2)
        arg_7 = arg_0.setup_TreeRegression(arg_1=arg_1)
        return arg_7.optimal_reroot(arg_2=arg_2, arg_3=arg_3)['node']

Determine the node that when the tree is rooted on this node results in the best regression of temporal constraints and root to tip distances .


return "{0:0>4}-{1:0>2}-{2:0>2}T{3:0>2}:{4:0>2}:{5:0>2}Z".format(
        date.year, date.month, date.day, date.hour,
        date.minute, date.second)

def Func(arg_0):
    """
    Return an ISO-8601 representation of a datetime object.
    """
    return "{0:0>4}-{1:0>2}-{2:0>2}T{3:0>2}:{4:0>2}:{5:0>2}Z".format(
        arg_0.year, arg_0.month, arg_0.day, arg_0.hour,
        arg_0.minute, arg_0.second)

Return an ISO - 8601 representation of a datetime object .


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
dict
(
arg_0
=
arg_0
,
short_name
=
arg_0
.
lower
(
)
.
replace
(
" "
,
""
)
,
arg_1
=
arg_1
)
arg_3
=
_pybossa_req
(
'post'
,
'category'
,
payload
=
arg_2
)
if
arg_3
.
get
(
'id'
)
:
return
Category
(
arg_3
)
else
:
return
arg_3
except
:
raise

def Func(arg_0, arg_1):
    """Create a Category.

    :param name: PYBOSSA Category Name
    :type name: string
    :param description: PYBOSSA Category description
    :type decription: string
    :returns: True -- the response status code
    """
    try:
        arg_2 = dict(arg_0=arg_0, short_name=arg_0.lower().replace(" ", ""),
                        arg_1=arg_1)
        arg_3 = _pybossa_req('post', 'category', payload=arg_2)
        if arg_3.get('id'):
            return Category(arg_3)
        else:
            return arg_3
    except:  # pragma: no cover
        raise


(grad_delta, position_delta, normalization_factor,
                             inv_hessian_estimate)

return (inv_hessian_estimate +
          (position_term - cross_term) / _expand_scalar(normalization_factor))

def Func(arg_0, arg_1, arg_2,
                             arg_3):
  """Applies the BFGS update to the inverse Hessian estimate.

  The BFGS update rule is (note A^T denotes the transpose of a vector/matrix A).

  ```None
    rho = 1/(grad_delta^T * position_delta)
    U = (I - rho * position_delta * grad_delta^T)
    H_1 =  U * H_0 * U^T + rho * position_delta * position_delta^T
  ```

  Here, `H_0` is the inverse Hessian estimate at the previous iteration and
  `H_1` is the next estimate. Note that `*` should be interpreted as the
  matrix multiplication (with the understanding that matrix multiplication for
  scalars is usual multiplication and for matrix with vector is the action of
  the matrix on the vector.).

  The implementation below utilizes an expanded version of the above formula
  to avoid the matrix multiplications that would be needed otherwise. By
  expansion it is easy to see that one only needs matrix-vector or
  vector-vector operations. The expanded version is:

  ```None
    f = 1 + rho * (grad_delta^T * H_0 * grad_delta)
    H_1 - H_0 = - rho * [position_delta * (H_0 * grad_delta)^T +
                        (H_0 * grad_delta) * position_delta^T] +
                  rho * f * [position_delta * position_delta^T]
  ```

  All the terms in square brackets are matrices and are constructed using
  vector outer products. All the other terms on the right hand side are scalars.
  Also worth noting that the first and second lines are both rank 1 updates
  applied to the current inverse Hessian estimate.

  Args:
    grad_delta: Real `Tensor` of shape `[..., n]`. The difference between the
      gradient at the new position and the old position.
    position_delta: Real `Tensor` of shape `[..., n]`. The change in position
      from the previous iteration to the current one.
    normalization_factor: Real `Tensor` of shape `[...]`. Should be equal to
      `grad_delta^T * position_delta`, i.e. `1/rho` as defined above.
    inv_hessian_estimate: Real `Tensor` of shape `[..., n, n]`. The previous
      estimate of the inverse Hessian. Should be positive definite and
      symmetric.

  Returns:
    A tuple containing the following fields
      is_valid: A Boolean `Tensor` of shape `[...]` indicating batch members
        where the update succeeded. The update can fail if the position change
        becomes orthogonal to the gradient change.
      next_inv_hessian_estimate: A `Tensor` of shape `[..., n, n]`. The next
        Hessian estimate updated using the BFGS update scheme. If the
        `inv_hessian_estimate` is symmetric and positive definite, the
        `next_inv_hessian_estimate` is guaranteed to satisfy the same
        conditions.
  """
  # The quadratic form: y^T.H.y; where H is the inverse Hessian and y is the
  # gradient change.
  arg_4 = _mul_right(arg_3, arg_0)
  arg_5 = tf.reduce_sum(
      input_tensor=arg_4 * arg_0, axis=-1)

  # The first rank 1 update term requires the outer product: s.y^T.
  arg_6 = _tensor_product(arg_1, arg_4)

  def _expand_scalar(arg_7):
    # Expand dimensions of a batch of scalars to multiply or divide a matrix.
    return arg_7[..., tf.newaxis, tf.newaxis]

  # Symmetrize
  arg_6 += _tensor_product(arg_4, arg_1)
  arg_8 = _tensor_product(arg_1, arg_1)
  with tf.control_dependencies([arg_8]):
    arg_8 *= _expand_scalar(
        1 + arg_5 / arg_2)

  return (arg_3 +
          (arg_8 - arg_6) / _expand_scalar(arg_2))

Applies the BFGS update to the inverse Hessian estimate .


def Func ( arg_0 , arg_1 ) : arg_2 = pd . MultiIndex . from_tuples ( arg_1 , names = [ 'Z' , 'N' ] ) return Table ( df = arg_0 . df . ix [ arg_2 ] , name = arg_0 . name )

def Func(arg_0, arg_1):
        """Return a selection of the Table Func positions given by ``nuclei``

        Parameters
        ----------
        nuclei: list of tuples
            A list where each element is tuple of the form (Z,N)

        Example
        -------
        Return binding energies Func magic nuclei:

        >>> magic_nuclei = [(20,28), (50,50), (50,82), (82,126)]
        >>> Table('AME2012').binding_energy.Func(magic_nuclei)
        Z   N
        20  28      416.014215
        50  50      825.325172
            82     1102.876416
        82  126    1636.486450
        """
        arg_2 = pd.MultiIndex.from_tuples(arg_1, names=['Z', 'N'])
        return Table(df=arg_0.df.ix[arg_2], name=arg_0.name)

Return a selection of the Table at positions given by ``nuclei``

        Parameters
        ----------
        nuclei: list of tuples
            A list where each element is tuple of the form (Z,N)

        Example
        -------
        Return binding energies at magic nuclei:

        >>> magic_nuclei = [(20,28), (50,50), (50,82), (82,126)]
        >>> Table('AME2012').binding_energy.at(magic_nuclei)
        Z   N
        20  28      416.014215
        50  50      825.325172
            82     1102.876416
        82  126    1636.486450

Return a selection of the Table at positions given by nuclei


return response['Cluster'] if response['Cluster'] else None

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get_conn ( ) . Func ( ClusterIdentifier = arg_1 , SnapshotIdentifier = arg_2 ) return arg_3 [ 'Cluster' ] if arg_3 [ 'Cluster' ] else None

def Func(arg_0, arg_1, arg_2):
        """
        Restores a cluster from its snapshot

        :param cluster_identifier: unique identifier of a cluster
        :type cluster_identifier: str
        :param snapshot_identifier: unique identifier for a snapshot of a cluster
        :type snapshot_identifier: str
        """
        arg_3 = arg_0.get_conn().Func(
            ClusterIdentifier=arg_1,
            SnapshotIdentifier=arg_2
        )
        return arg_3['Cluster'] if arg_3['Cluster'] else None


return [tls_handler, sasl_handler, binding_handler, session_handler]

def Func ( arg_0 ) : arg_1 = StreamTLSHandler ( arg_0 . settings ) arg_2 = StreamSASLHandler ( arg_0 . settings ) arg_3 = SessionHandler ( ) arg_4 = ResourceBindingHandler ( arg_0 . settings ) return [ arg_1 , arg_2 , arg_4 , arg_3 ]

def Func(arg_0):
        """Default base client handlers factory.

        Subclasses can provide different behaviour by overriding this.

        :Return: list of handlers
        """
        arg_1 = StreamTLSHandler(arg_0.settings)
        arg_2 = StreamSASLHandler(arg_0.settings)
        arg_3 = SessionHandler()
        arg_4 = ResourceBindingHandler(arg_0.settings)
        return [arg_1, arg_2, arg_4, arg_3]


def Func(arg_0, arg_1, arg_2=False):
        """
        Compute the MD5 sum of a file.
        """
        arg_3 = arg_2 and run_as_root or arg_0.run
        with arg_0.settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True):
            # Linux (LSB)
            if exists(u'/usr/bin/md5sum'):
                arg_4 = arg_3(u'/usr/bin/md5sum %(filename)s' % locals())
            # BSD / OS X
            elif exists(u'/sbin/md5'):
                arg_4 = arg_3(u'/sbin/md5 -r %(filename)s' % locals())
            # SmartOS Joyent build
            elif exists(u'/opt/local/gnu/bin/md5sum'):
                arg_4 = arg_3(u'/opt/local/gnu/bin/md5sum %(filename)s' % locals())
            # SmartOS Joyent build
            # (the former doesn't exist, at least on joyent_20130222T000747Z)
            elif exists(u'/opt/local/bin/md5sum'):
                arg_4 = arg_3(u'/opt/local/bin/md5sum %(filename)s' % locals())
            # Try to find ``md5sum`` or ``md5`` on ``$PATH`` or abort
            else:
                Func = arg_3(u'which md5sum')
                arg_6 = arg_3(u'which md5')
                if exists(Func):
                    arg_4 = arg_3('%(md5sum)s %(filename)s' % locals())
                elif exists(arg_6):
                    arg_4 = arg_3('%(md5)s %(filename)s' % locals())
                else:
                    abort('No MD5 utility was found on this system.')

        if arg_4.succeeded:
            arg_7 = arg_4
        else:
            warn(arg_4)
            arg_7 = None

        if isinstance(arg_7, six.string_types):
            arg_7 = arg_7.strip().split('\n')[-1].split()[0]

        return arg_7


def Func ( ) : arg_0 = [ ] for arg_1 in open ( 'requirements.txt' ) . readlines ( ) : if arg_1 . startswith ( '#' ) or arg_1 == '' or arg_1 . startswith ( 'http' ) or arg_1 . startswith ( 'git' ) : continue arg_0 . append ( arg_1 . replace ( '\n' , '' ) ) if sys . version_info . major < 3 : arg_0 . append ( 'py2-ipaddress' ) return arg_0

def Func():
    """
    parse requirements.txt, ignore links, exclude comments
    """
    arg_0 = []
    for arg_1 in open('requirements.txt').readlines():
        # skip to next iteration if comment or empty line
        if arg_1.startswith('#') or arg_1 == '' or arg_1.startswith('http') or arg_1.startswith('git'):
            continue
        # add line to requirements
        arg_0.append(arg_1.replace('\n', ''))
    # add py2-ipaddress if python2
    if sys.version_info.major < 3:
        arg_0.append('py2-ipaddress')
    return arg_0

parse requirements . txt ignore links exclude comments


def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """
        Draw a filled circle in an RGB color, with center x0, y0 and radius r.
        """
        md.fill_circle(arg_0.set, arg_1, arg_2, arg_3, arg_4)

Draw a filled circle in an RGB color with center x0 y0 and radius r .


def Func ( arg_0 ) : arg_1 = [ l . rstrip ( ) for l in arg_0 . split ( '\n' ) ] return '\n' . join ( arg_1 )

def Func(arg_0):
  """Removes trailing whitespace on each line."""
  arg_1 = [l.rstrip() for l in arg_0.split('\n')]
  return '\n'.join(arg_1)

Removes trailing whitespace on each line .


def
Func
(
arg_0
)
:
arg_1
=
"%s %d"
%
(
arg_0
.
brainkey
,
arg_0
.
sequence
)
arg_2
=
_bytes
(
arg_1
)
arg_3
=
hashlib
.
sha256
(
hashlib
.
sha512
(
arg_2
)
.
digest
(
)
)
.
digest
(
)
return
PrivateKey
(
hexlify
(
arg_3
)
.
decode
(
"ascii"
)
,
prefix
=
arg_0
.
prefix
)

def Func(arg_0):
        """ Derive private key from the brain key and the current sequence
            number
        """
        arg_1 = "%s %d" % (arg_0.brainkey, arg_0.sequence)
        arg_2 = _bytes(arg_1)
        arg_3 = hashlib.sha256(hashlib.sha512(arg_2).digest()).digest()
        return PrivateKey(hexlify(arg_3).decode("ascii"), prefix=arg_0.prefix)


(graph: BELGraph,
                           key: Optional[str] = None,
                           tag: Optional[str] = None,
                           default_score: Optional[float] = None,
                           runs: Optional[int] = None,
                           aggregator: Optional[Callable[[Iterable[float]], float]] = None,
                           )

def Func(arg_0: arg_1,
                           arg_2: arg_3[arg_4] = None,
                           arg_5: arg_3[arg_4] = None,
                           arg_6: arg_3[arg_7] = None,
                           arg_8: arg_3[arg_9] = None,
                           arg_10: arg_3[arg_11[[arg_12[arg_7]], arg_7]] = None,
                           ):
    """Run the heat diffusion workflow to get average score for every possible candidate mechanism.

    1. Get all biological processes
    2. Get candidate mechanism induced two level back from each biological process
    3. Heat diffusion workflow on each candidate mechanism for multiple runs
    4. Report average scores for each candidate mechanism

    :param graph: A BEL graph
    :param key: The key in the node data dictionary representing the experimental data. Defaults to
     :data:`pybel_tools.constants.WEIGHT`.
    :param tag: The key for the nodes' data dictionaries where the scores will be put. Defaults to 'score'
    :param default_score: The initial score for all nodes. This number can go up or down.
    :param runs: The number of times to run the heat diffusion workflow. Defaults to 100.
    :param aggregator: A function that aggregates a list of scores. Defaults to :func:`numpy.average`.
                       Could also use: :func:`numpy.mean`, :func:`numpy.median`, :func:`numpy.min`, :func:`numpy.max`
    :return: A dictionary of {node: upstream causal subgraph}
    """
    arg_13 = {}

    arg_14 = list(get_nodes_by_function(arg_0, BIOPROCESS))

    for arg_15 in tqdm(arg_14):
        arg_16 = generate_mechanism(arg_0, arg_15, arg_2=arg_2)

        try:
            arg_13[arg_15] = workflow_aggregate(
                arg_0=arg_16,
                node=arg_15,
                arg_2=arg_2,
                arg_5=arg_5,
                arg_6=arg_6,
                arg_8=arg_8,
                arg_10=arg_10
            )
        except Exception:
            log.exception('could not run on %', arg_15)

    return arg_13

Run the heat diffusion workflow to get average score for every possible candidate mechanism .


def
Func
(
arg_0
,
arg_1
)
:
LOG
.
info
(
"Running scout Func"
)
arg_2
=
arg_0
.
obj
[
'adapter'
]
if
arg_1
:
arg_2
.
update_Funces
(
)
else
:
arg_2
.
load_Funces
(
)

def Func(arg_0, arg_1):
    """Create Funces for the database"""
    LOG.info("Running scout Func")
    arg_2 = arg_0.obj['adapter']

    if arg_1:
        arg_2.update_Funces()
    else:
        arg_2.load_Funces()


def Func(arg_0, arg_1, arg_2):
    """
    A subfunction of build_clustbits to allow progress tracking. This func
    splits the unaligned clusters into bits for aligning on separate cores.
    """

    ## load FULL concat fasta file into a dict. This could cause RAM issues.
    ## this file has iupac codes in it, not ambigs resolved, and is gzipped.
    LOGGER.info("loading full _catcons file into memory")
    arg_3 = {}
    arg_4 = os.path.join(arg_0.dirs.across, arg_0.name+"_catcons.tmp")
    with gzip.open(arg_4, 'rb') as iocons:
        arg_5 = itertools.izip(*[iter(iocons)]*2)
        for arg_6, arg_7 in arg_5:
            arg_8, arg_9 = [i.strip() for i in arg_6, arg_7]
            arg_3[arg_8[1:]] = arg_9

    ## set optim to approximately 4 chunks per core. Smaller allows for a bit
    ## cleaner looking progress bar. 40 cores will make 160 files.
    arg_10 = ((arg_2 // (arg_0.cpus*4)) + (arg_2 % (arg_0.cpus*4)))
    LOGGER.info("building clustbits, optim=%s, nseeds=%s, cpus=%s",
                arg_10, arg_2, arg_0.cpus)

    ## iterate through usort grabbing seeds and matches
    with open(arg_1, 'rb') as insort:
        ## iterator, seed null, and seqlist null
        arg_11 = iter(insort)
        arg_12 = 0
        arg_13 = 0
        arg_14 = []
        arg_15 = []
        arg_16 = 0

        while 1:
            ## grab the next line
            try:
                arg_17, arg_18, arg_19 = arg_11.next().strip().split()
            except StopIteration:
                break

            try:
                ## if same seed, append match
                if arg_18 != arg_13:
                    ## store the last fseq, count it, and clear it
                    if arg_14:
                        arg_15.append("\n".join(arg_14))
                        arg_16 += 1
                        arg_14 = []
                    ## occasionally write to file
                    if arg_16 >= arg_10:
                        if arg_15:
                            arg_12 += arg_16
                            with open(os.path.join(arg_0.tmpdir,
                                arg_0.name+".chunk_{}".format(arg_12)), 'w') as clustsout:
                                LOGGER.debug("writing chunk - seqsize {} loci {} {}".format(arg_16, arg_12, clustsout.name))
                                clustsout.write("\n//\n//\n".join(arg_15)+"\n//\n//\n")
                            ## reset list and counter
                            arg_15 = []
                            arg_16 = 0

                    ## store the new seed on top of fseq
                    arg_14.append(">{}\n{}".format(arg_18, arg_3[arg_18]))
                    arg_13 = arg_18

                ## add match to the seed
                arg_7 = arg_3[arg_17]
                ## revcomp if orientation is reversed
                if arg_19 == "-":
                    arg_7 = fullcomp(arg_7)[::-1]
                arg_14.append(">{}\n{}".format(arg_17, arg_7))
            except KeyError as inst:
                ## Caught bad seed or hit? Log and continue.
                LOGGER.error("Bad Seed/Hit: seqsize {}\tloci {}\tseed {}\thit {}".format(arg_16, arg_12, arg_18, arg_17))

    ## write whatever is left over to the clusts file
    if arg_14:
        arg_15.append("\n".join(arg_14))
        arg_16 += 1
        arg_12 += arg_16
    if arg_15:
        with open(os.path.join(arg_0.tmpdir,
            arg_0.name+".chunk_{}".format(arg_12)), 'w') as clustsout:
            clustsout.write("\n//\n//\n".join(arg_15)+"\n//\n//\n")

    ## final progress and cleanup
    del arg_3
    arg_20 = glob.glob(os.path.join(arg_0.tmpdir, arg_0.name+".chunk_*"))

    ## return stuff
    return arg_20, arg_12

A subfunction of build_clustbits to allow progress tracking . This func splits the unaligned clusters into bits for aligning on separate cores .


def Func(arg_0, arg_1=False, arg_2=False):
    """ Invert faces orientation, Funcping the normals of the mesh.

    If requested, it tries to guess the right orientation; mainly it decides to
    Func all the faces if the minimum/maximum vertexes have not outward point
    normals for a few directions. Works well for single component watertight
    objects.

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        force_Func (bool): If selected, the normals will always be Funcped;
            otherwise, the filter tries to set them outside.
        selected (bool): If selected, only selected faces will be affected.

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    arg_3 = ''.join([
        '  <filter name="Invert Faces Orientation">\n',
        '    <Param name="forceFlip" ',
        'value="{}" '.format(str(arg_1).lower()),
        'description="Force Flip" ',
        'type="RichBool" ',
        '/>\n',
        '    <Param name="onlySelected" ',
        'value="{}" '.format(str(arg_2).lower()),
        'description="Flip only selected faces" ',
        'type="RichBool" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(arg_0, arg_3)
    return None

Invert faces orientation, flipping the normals of the mesh.

    If requested, it tries to guess the right orientation; mainly it decides to
    flip all the faces if the minimum/maximum vertexes have not outward point
    normals for a few directions. Works well for single component watertight
    objects.

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        force_flip (bool): If selected, the normals will always be flipped;
            otherwise, the filter tries to set them outside.
        selected (bool): If selected, only selected faces will be affected.

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA

Invert faces orientation flipping the normals of the mesh .


def Func ( arg_0 ) : arg_1 = arg_0 . _control . document ( ) arg_2 = arg_0 . _control . verticalScrollBar ( ) arg_3 = arg_0 . _control . viewport ( ) . height ( ) if isinstance ( arg_0 . _control , QtGui . QPlainTextEdit ) : arg_4 = max ( 0 , arg_1 . lineCount ( ) - 1 ) arg_5 = arg_3 / arg_0 . _control . fontMetrics ( ) . lineSpacing ( ) else : arg_4 = arg_1 . size ( ) . height ( ) arg_5 = arg_3 arg_6 = arg_4 - arg_2 . maximum ( ) arg_2 . setRange ( 0 , arg_4 ) arg_2 . setPageStep ( arg_5 ) if arg_6 < 0 and arg_1 . blockCount ( ) == arg_1 . maximumBlockCount ( ) : arg_2 . setValue ( arg_2 . value ( ) + arg_6 )

def Func(arg_0):
        """ Expands the vertical scrollbar beyond the range set by Qt.
        """
        # This code is adapted from _q_adjustScrollbars in qplaintextedit.cpp
        # and qtextedit.cpp.
        arg_1 = arg_0._control.document()
        arg_2 = arg_0._control.verticalScrollBar()
        arg_3 = arg_0._control.viewport().height()
        if isinstance(arg_0._control, QtGui.QPlainTextEdit):
            arg_4 = max(0, arg_1.lineCount() - 1)
            arg_5 = arg_3 / arg_0._control.fontMetrics().lineSpacing()
        else:
            # QTextEdit does not do line-based layout and blocks will not in
            # general have the same height. Therefore it does not make sense to
            # attempt to scroll in line height increments.
            arg_4 = arg_1.size().height()
            arg_5 = arg_3
        arg_6 = arg_4 - arg_2.maximum()
        arg_2.setRange(0, arg_4)
        arg_2.setPageStep(arg_5)

        # Compensate for undesirable scrolling that occurs automatically due to
        # maximumBlockCount() text truncation.
        if arg_6 < 0 and arg_1.blockCount() == arg_1.maximumBlockCount():
            arg_2.setValue(arg_2.value() + arg_6)

Expands the vertical scrollbar beyond the range set by Qt .


(self, tex_input_directory, latex_walker_init_args=None, strict_input=True)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = True ) : arg_0 . tex_input_directory = arg_1 arg_0 . latex_walker_init_args = arg_2 if arg_2 else { } arg_0 . strict_input = arg_3 if arg_1 : arg_0 . macro_dict [ 'input' ] = MacroDef ( 'input' , lambda n : arg_0 . _callback_input ( n ) ) arg_0 . macro_dict [ 'include' ] = MacroDef ( 'include' , lambda n : arg_0 . _callback_input ( n ) ) else : arg_0 . macro_dict [ 'input' ] = MacroDef ( 'input' , discard = True ) arg_0 . macro_dict [ 'include' ] = MacroDef ( 'include' , discard = True )

def Func(arg_0, arg_1, arg_2=None, arg_3=True):
        """
        Set where to look for input files when encountering the ``\\input`` or
        ``\\include`` macro.

        Alternatively, you may also override :py:meth:`read_input_file()` to
        implement a custom file lookup mechanism.

        The argument `tex_input_directory` is the directory relative to which to
        search for input files.

        If `strict_input` is set to `True`, then we always check that the
        referenced file lies within the subtree of `tex_input_directory`,
        prohibiting for instance hacks with '..' in filenames or using symbolic
        links to refer to files out of the directory tree.

        The argument `latex_walker_init_args` allows you to specify the parse
        flags passed to the constructor of
        :py:class:`pylatexenc.latexwalker.LatexWalker` when parsing the input
        file.
        """
        arg_0.tex_input_directory = arg_1
        arg_0.latex_walker_init_args = arg_2 if arg_2 else {}
        arg_0.strict_input = arg_3

        if arg_1:
            arg_0.macro_dict['input'] = MacroDef('input', lambda n: arg_0._callback_input(n))
            arg_0.macro_dict['include'] = MacroDef('include', lambda n: arg_0._callback_input(n))
        else:
            arg_0.macro_dict['input'] = MacroDef('input', discard=True)
            arg_0.macro_dict['include'] = MacroDef('include', discard=True)

Set where to look for input files when encountering the \\ input or \\ include macro .


def Func(arg_0):
        """
        Forwards all traffic to a page saying the server is down for maintenance.
        """
        arg_1 = arg_0.local_renderer
        arg_2 = arg_0.render_to_file(arg_1.env.maintenance_template, extra={'current_hostname': arg_0.current_hostname})
        arg_1.put(local_path=arg_2, remote_path=arg_1.env.maintenance_path, use_sudo=True)
        arg_1.sudo('chown -R {apache_web_user}:{apache_web_group} {maintenance_path}')

Forwards all traffic to a page saying the server is down for maintenance .


def Func(arg_0, arg_1):
        """write a class diagram"""
        # sorted to get predictable (hence testable) results
        for arg_2, arg_3 in enumerate(sorted(arg_1.objects, key=lambda x: x.title)):
            arg_0.printer.emit_node(arg_2, **arg_0.get_values(arg_3))
            arg_3.fig_id = arg_2
        # inheritance links
        for arg_5 in arg_1.get_relationships("specialization"):
            arg_0.printer.emit_edge(
                arg_5.from_object.fig_id, arg_5.to_object.fig_id, **arg_0.inh_edges
            )
        # implementation links
        for arg_5 in arg_1.get_relationships("implements"):
            arg_0.printer.emit_edge(
                arg_5.from_object.fig_id, arg_5.to_object.fig_id, **arg_0.imp_edges
            )
        # generate associations
        for arg_5 in arg_1.get_relationships("association"):
            arg_0.printer.emit_edge(
                arg_5.from_object.fig_id,
                arg_5.to_object.fig_id,
                label=arg_5.name,
                **arg_0.association_edges
            )


return [cls for cls in self.effect_classes if cls.runnable]

def Func ( arg_0 ) -> List [ Type [ Effect ] ] : return [ arg_1 for arg_1 in arg_0 . effect_classes if arg_1 . runnable ]

def Func(arg_0) -> List[Type[Effect]]:
        """Returns the runnable effect in the package"""
        return [arg_1 for arg_1 in arg_0.effect_classes if arg_1.runnable]


def Func(arg_0):
        """Parses the process string and returns the process name and its
        directives

        Process strings my contain directive information with the following
        syntax::

            proc_name={'directive':'val'}

        This method parses this string and returns the process name as a
        string and the directives information as a dictionary.

        Parameters
        ----------
        name_str : str
            Raw string with process name and, potentially, directive
            information

        Returns
        -------
        str
            Process name
        dict or None
            Process directives
        """

        arg_1 = None

        arg_2 = arg_0.split("=")
        arg_3 = arg_2[0]

        if len(arg_2) == 2:
            arg_4 = arg_2[1].replace("'", '"')
            try:
                arg_1 = json.loads(arg_4)
            except json.decoder.JSONDecodeError:
                raise eh.ProcessError(
                    "Could not parse directives for process '{}'. The raw"
                    " string is: {}\n"
                    "Possible causes include:\n"
                    "\t1. Spaces inside directives\n"
                    "\t2. Missing '=' symbol before directives\n"
                    "\t3. Missing quotes (' or \") around directives\n"
                    "A valid example: process_name={{'cpus':'2'}}".format(
                        arg_3, arg_0))

        return arg_3, arg_1


def Func(arg_0):
    """Decorate methods when synchronizing repository is required."""
    @wraps(arg_0)
    def wrapper(arg_1, *arg_2, **arg_3):
        if not arg_1._keepSynchronized:
            arg_4 = arg_0(arg_1, *arg_2, **arg_3)
        else:
            arg_5 = arg_1._load_state()
            #print("----------->  ",state, self.state)
            if arg_5 is None:
                arg_4 = arg_0(arg_1, *arg_2, **arg_3)
            elif arg_5 == arg_1.state:
                arg_4 = arg_0(arg_1, *arg_2, **arg_3)
            else:
                warnings.warn("Repository at '%s' is out of date. Need to load it again to avoid conflict."%arg_1.path)
                arg_4 = None
        return arg_4
    return wrapper

Decorate methods when synchronizing repository is required .


def Func(arg_0, arg_1, **arg_2):
        """Reset auth_attempted on redirects."""
        if arg_1.is_redirect:
            arg_0._thread_local.auth_attempted = False


def Func ( arg_0 = 'admin' , arg_1 = 'admin@admin.com' , arg_2 = 'admin' ) : arg_3 = User . objects . create_user ( arg_0 , arg_1 , arg_2 ) arg_3 . is_staff = True arg_3 . is_superuser = True arg_3 . save ( ) return arg_3

def Func(arg_0='admin', arg_1='admin@admin.com', arg_2='admin'):
    """Create and save an admin user.

    :param username:
        Admin account's username.  Defaults to 'admin'
    :param email:
        Admin account's email address.  Defaults to 'admin@admin.com'
    :param password:
        Admin account's password.  Defaults to 'admin'
    :returns:
        Django user with staff and superuser privileges
    """
    arg_3 = User.objects.create_user(arg_0, arg_1, arg_2)
    arg_3.is_staff = True
    arg_3.is_superuser = True
    arg_3.save()
    return arg_3


def
Func
(
arg_0
)
:
lg
.
info
(
'Building total absorption'
)
arg_0
.
a
=
arg_0
.
a_water
+
arg_0
.
a_cdom
+
arg_0
.
a_phi

def Func(arg_0):
        """Calculates the total absorption from water, phytoplankton and CDOM

        a = awater + acdom + aphi
        """
        lg.info('Building total absorption')
        arg_0.a = arg_0.a_water + arg_0.a_cdom + arg_0.a_phi

Calculates the total absorption from water phytoplankton and CDOM


def Func():
    """
    Retrieves the TidyPy tools that are available in the current Python
    environment.

    The returned dictionary has keys that are the tool names and values are the
    tool classes.

    :rtype: dict
    """

    # pylint: disable=protected-access

    if not hasattr(Func, '_CACHE'):
        Func._CACHE = dict()
        for arg_2 in pkg_resources.iter_entry_points('tidypy.tools'):
            try:
                Func._CACHE[arg_2.name] = arg_2.load()
            except ImportError as exc:  # pragma: no cover
                output_error(
                    'Could not load tool "%s" defined by "%s": %s' % (
                        arg_2,
                        arg_2.dist,
                        exc,
                    ),
                )
    return Func._CACHE

Retrieves the TidyPy tools that are available in the current Python environment .


def Func ( arg_0 , arg_1 ) : arg_0 . hook = OpsgenieAlertHook ( arg_0 . opsgenie_conn_id ) arg_0 . hook . Func ( arg_0 . _build_opsgenie_payload ( ) )

def Func(arg_0, arg_1):
        """
        Call the OpsgenieAlertHook to post message
        """
        arg_0.hook = OpsgenieAlertHook(arg_0.opsgenie_conn_id)
        arg_0.hook.Func(arg_0._build_opsgenie_payload())


def Func ( arg_0 , arg_1 ) : class Match ( object ) : arg_2 , arg_3 , arg_4 , = 2 , 1 , 0 def __init__ ( arg_5 , arg_6 , arg_7 ) : arg_5 . candidate = arg_6 arg_5 . pattern = arg_7 if arg_7 . content_type == arg_7 . content_subtype == '*' : arg_5 . match_type = arg_5 . WILDCARD elif arg_7 . content_subtype == '*' : arg_5 . match_type = arg_5 . PARTIAL else : arg_5 . match_type = arg_5 . FULL_TYPE arg_5 . parameter_distance = len ( arg_5 . candidate . parameters ) for arg_10 , arg_11 in arg_6 . parameters . items ( ) : if arg_10 in arg_7 . parameters : if arg_7 . parameters [ arg_10 ] == arg_11 : arg_5 . parameter_distance -= 1 else : arg_5 . parameter_distance += 1 def extract_quality ( arg_12 ) : return getattr ( arg_12 , 'quality' , 1.0 ) arg_13 = [ ] for arg_7 in sorted ( arg_0 , arg_10 = extract_quality , reverse = True ) : for arg_6 in sorted ( arg_1 ) : if _content_type_matches ( arg_6 , arg_7 ) : if arg_6 == arg_7 : if extract_quality ( arg_7 ) == 0.0 : raise errors . NoMatch return arg_6 , arg_7 arg_13 . append ( Match ( arg_6 , arg_7 ) ) if not arg_13 : raise errors . NoMatch arg_13 = sorted ( arg_13 , arg_10 = attrgetter ( 'match_type' , 'parameter_distance' ) ) return arg_13 [ 0 ] . candidate , arg_13 [ 0 ] . pattern

def Func(arg_0, arg_1):
    """Selects the best content type.

    :param requested: a sequence of :class:`.ContentType` instances
    :param available: a sequence of :class:`.ContentType` instances
        that the server is capable of producing

    :returns: the selected content type (from ``available``) and the
        pattern that it matched (from ``requested``)
    :rtype: :class:`tuple` of :class:`.ContentType` instances
    :raises: :class:`.NoMatch` when a suitable match was not found

    This function implements the *Proactive Content Negotiation*
    algorithm as described in sections 3.4.1 and 5.3 of :rfc:`7231`.
    The input is the `Accept`_ header as parsed by
    :func:`.parse_http_accept_header` and a list of
    parsed :class:`.ContentType` instances.  The ``available`` sequence
    should be a sequence of content types that the server is capable of
    producing.  The selected value should ultimately be used as the
    `Content-Type`_ header in the generated response.

    .. _Accept: http://tools.ietf.org/html/rfc7231#section-5.3.2
    .. _Content-Type: http://tools.ietf.org/html/rfc7231#section-3.1.1.5

    """

    class Match(object):
        """Sorting assistant.

        Sorting matches is a tricky business.  We need a way to
        prefer content types by *specificity*.  The definition of
        *more specific* is a little less than clear.  This class
        treats the strength of a match as the most important thing.
        Wild cards are less specific in all cases.  This is tracked
        by the ``match_type`` attribute.

        If we the candidate and pattern differ only by parameters,
        then the strength is based on the number of pattern parameters
        that match parameters from the candidate.  The easiest way to
        track this is to count the number of candidate parameters that
        are matched by the pattern.  This is what ``parameter_distance``
        tracks.

        The final key to the solution is to order the result set such
        that the most specific matches are first in the list.  This
        is done by carefully choosing values for ``match_type`` such
        that full matches bubble up to the front.  We also need a
        scheme of counting matching parameters that pushes stronger
        matches to the front of the list.  The ``parameter_distance``
        attribute starts at the number of candidate parameters and
        decreases for each matching parameter - the lesser the value,
        the stronger the match.

        """
        arg_2, arg_3, arg_4, = 2, 1, 0

        def __init__(arg_5, arg_6, arg_7):
            arg_5.candidate = arg_6
            arg_5.pattern = arg_7

            if arg_7.content_type == arg_7.content_subtype == '*':
                arg_5.match_type = arg_5.WILDCARD
            elif arg_7.content_subtype == '*':
                arg_5.match_type = arg_5.PARTIAL
            else:
                arg_5.match_type = arg_5.FULL_TYPE

            arg_5.parameter_distance = len(arg_5.candidate.parameters)
            for arg_10, arg_11 in arg_6.parameters.items():
                if arg_10 in arg_7.parameters:
                    if arg_7.parameters[arg_10] == arg_11:
                        arg_5.parameter_distance -= 1
                    else:
                        arg_5.parameter_distance += 1

    def extract_quality(arg_12):
        return getattr(arg_12, 'quality', 1.0)

    arg_13 = []
    for arg_7 in sorted(arg_0, arg_10=extract_quality, reverse=True):
        for arg_6 in sorted(arg_1):
            if _content_type_matches(arg_6, arg_7):
                if arg_6 == arg_7:  # exact match!!!
                    if extract_quality(arg_7) == 0.0:
                        raise errors.NoMatch  # quality of 0 means NO
                    return arg_6, arg_7
                arg_13.append(Match(arg_6, arg_7))

    if not arg_13:
        raise errors.NoMatch

    arg_13 = sorted(arg_13,
                     arg_10=attrgetter('match_type', 'parameter_distance'))
    return arg_13[0].candidate, arg_13[0].pattern


def
Func
(
)
->
DefaultAgent
:
arg_0
=
PatternMatchingSkill
(
[
'Hello world'
]
,
patterns
=
[
'hi'
,
'hello'
,
'good day'
]
)
arg_1
=
PatternMatchingSkill
(
[
'Goodbye world'
,
'See you around'
]
,
patterns
=
[
'bye'
,
'chao'
,
'see you'
]
)
arg_2
=
PatternMatchingSkill
(
[
'I don\'t understand, sorry'
,
'I can say "Hello world"'
]
)
arg_3
=
DefaultAgent
(
[
arg_0
,
arg_1
,
arg_2
]
,
skills_processor
=
HighestConfidenceSelector
(
)
)
return
arg_3

def Func() -> DefaultAgent:
    """Builds agent based on PatternMatchingSkill and HighestConfidenceSelector.

    This is agent building tutorial. You can use this .py file to check how hello-bot agent works.

    Returns:
        agent: Agent capable of handling several simple greetings.
    """
    arg_0 = PatternMatchingSkill(['Hello world'], patterns=['hi', 'hello', 'good day'])
    arg_1 = PatternMatchingSkill(['Goodbye world', 'See you around'], patterns=['bye', 'chao', 'see you'])
    arg_2 = PatternMatchingSkill(['I don\'t understand, sorry', 'I can say "Hello world"'])

    arg_3 = DefaultAgent([arg_0, arg_1, arg_2], skills_processor=HighestConfidenceSelector())

    return arg_3

Builds agent based on PatternMatchingSkill and HighestConfidenceSelector .


def Func(arg_0, arg_1):
    """Returns the lane of the last process that matches fork_process

    Parameters
    ----------
    fork_process : list
        List of processes before the fork.
    pipeline_list : list
        List with the pipeline connection dictionaries.

    Returns
    -------
    int
        Lane of the last process that matches fork_process
    """

    arg_2 = arg_0[-1]
    arg_3 = [x for x in arg_0 if x != "__init__"]

    for arg_4, arg_5 in enumerate(arg_1[::-1]):

        if arg_5["output"]["process"] == arg_2:

            arg_6 = arg_5["output"]["lane"]
            logger.debug("Possible source match found in position {} in lane"
                         " {}".format(arg_4, arg_6))
            arg_7 = [x["output"]["process"] for x in arg_1
                             if x["output"]["lane"] == arg_6]
            logger.debug("Testing lane sequence '{}' against fork signature"
                         " '{}'".format(arg_7, arg_3))
            if arg_7 == arg_3:
                return arg_5["output"]["lane"]

    return 0


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . cellgraph . Func ( arg_1 ) for arg_3 in arg_2 : del arg_3 [ OBJ ] . data [ arg_3 [ KEY ] ]

def Func(arg_0, arg_1):
        """Clear values and nodes of `obj` and their dependants."""
        arg_2 = arg_0.cellgraph.Func(arg_1)
        for arg_3 in arg_2:
            del arg_3[OBJ].data[arg_3[KEY]]

Clear values and nodes of obj and their dependants .


def Func ( arg_0 ) : arg_0 = compat . to_bytes ( arg_0 ) arg_0 = compat . base64_encodebytes ( arg_0 ) . strip ( ) return compat . to_native ( arg_0 )

def Func(arg_0):
    """Return base64 encoded binarystring."""
    arg_0 = compat.to_bytes(arg_0)
    arg_0 = compat.base64_encodebytes(arg_0).strip()  # return bytestring
    return compat.to_native(arg_0)


def Func(arg_0, arg_1, arg_2):
        """
        Utility function to perform an API call with retries

        :param endpoint_info: Tuple of method and endpoint
        :type endpoint_info: tuple[string, string]
        :param json: Parameters for this API call.
        :type json: dict
        :return: If the api call returns a OK status code,
            this function returns the response in JSON. Otherwise,
            we throw an AirflowException.
        :rtype: dict
        """
        arg_3, arg_4 = arg_1
        arg_5 = 'https://{host}/{endpoint}'.format(
            host=arg_0._parse_host(arg_0.databricks_conn.host),
            arg_4=arg_4)
        if 'token' in arg_0.databricks_conn.extra_dejson:
            arg_0.log.info('Using token auth.')
            arg_6 = _TokenAuth(arg_0.databricks_conn.extra_dejson['token'])
        else:
            arg_0.log.info('Using basic auth.')
            arg_6 = (arg_0.databricks_conn.login, arg_0.databricks_conn.password)
        if arg_3 == 'GET':
            arg_7 = requests.get
        elif arg_3 == 'POST':
            arg_7 = requests.post
        else:
            raise AirflowException('Unexpected HTTP Method: ' + arg_3)

        arg_8 = 1
        while True:
            try:
                arg_9 = arg_7(
                    arg_5,
                    arg_2=arg_2,
                    arg_6=arg_6,
                    headers=USER_AGENT_HEADER,
                    timeout=arg_0.timeout_seconds)
                arg_9.raise_for_status()
                return arg_9.json()
            except requests_exceptions.RequestException as e:
                if not _retryable_error(e):
                    # In this case, the user probably made a mistake.
                    # Don't retry.
                    raise AirflowException('Response: {0}, Status Code: {1}'.format(
                        e.response.content, e.response.status_code))

                arg_0._log_request_error(arg_8, e)

            if arg_8 == arg_0.retry_limit:
                raise AirflowException(('API requests to Databricks failed {} times. ' +
                                        'Giving up.').format(arg_0.retry_limit))

            arg_8 += 1
            sleep(arg_0.retry_delay)