def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
options
.
verbose
:
print
(
"Sorting tags..."
)
arg_1
.
sort
(
key
=
lambda
x
:
arg_0
.
get_time_of_tag
(
x
)
)
arg_1
.
reverse
(
)
return
arg_1

def Func(arg_0, arg_1):
        """
        Sort all tags by date.

        :param list(dict) tags: All tags.
        :rtype: list(dict)
        :return: Sorted list of tags.
        """

        if arg_0.options.verbose:
            print("Sorting tags...")
        arg_1.sort(key=lambda x: arg_0.get_time_of_tag(x))
        arg_1.reverse()
        return arg_1


def Func ( arg_0 ) : if not PyFunceble . CONFIGURATION [ "local" ] : if arg_0 . domain_extension not in arg_0 . ignored_extension : arg_1 = None if arg_0 . domain_extension in PyFunceble . INTERN [ "iana_db" ] : if not PyFunceble . CONFIGURATION [ "no_whois" ] : arg_1 = PyFunceble . INTERN [ "iana_db" ] [ arg_0 . domain_extension ] if not arg_1 : Logs ( ) . referer_not_found ( arg_0 . domain_extension ) return None return arg_1 return None return False return None return None

def Func(arg_0):
        """
        Return the referer aka the WHOIS server of the current domain extension.
        """

        if not PyFunceble.CONFIGURATION["local"]:
            # We are not running a test in a local network.

            if arg_0.domain_extension not in arg_0.ignored_extension:
                # The extension of the domain we are testing is not into
                # the list of ignored extensions.

                # We set the referer to None as we do not have any.
                arg_1 = None

                if arg_0.domain_extension in PyFunceble.INTERN["iana_db"]:
                    # The domain extension is in the iana database.

                    if not PyFunceble.CONFIGURATION["no_whois"]:
                        # We are authorized to use WHOIS for the test result.

                        # We Func the referer from the database.
                        arg_1 = PyFunceble.INTERN["iana_db"][arg_0.domain_extension]

                        if not arg_1:
                            # The referer is not filled.

                            # We log the case of the current extension.
                            Logs().referer_not_found(arg_0.domain_extension)

                            # And we handle and return None status.
                            return None

                        # The referer is into the database.

                        # We return the extracted referer.
                        return arg_1

                    # We are not authorized to use WHOIS for the test result.

                    # We return None.
                    return None

                # The domain extension is not in the iana database.

                # We return False, it is an invalid domain.
                return False

            # The extension of the domain we are testing is not into
            # the list of ignored extensions.

            # We return None, the domain does not have a whois server.
            return None

        # We are running a test in a local network.

        # We return None.
        return None

Return the referer aka the WHOIS server of the current domain extension .


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the DeriveKey request payload and decode it
        into its constituent parts.

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

        Raises:
            ValueError: Raised if the data attribute is missing from the
                encoded payload.
        """
        super(DeriveKeyRequestPayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.OBJECT_TYPE, arg_6):
            arg_0._object_type = primitives.Enumeration(
                arg_3.ObjectType,
                tag=arg_3.Tags.OBJECT_TYPE
            )
            arg_0._object_type.Func(arg_6, arg_2=arg_2)
        else:
            raise exceptions.InvalidKmipEncoding(
                "The DeriveKey request payload encoding is missing the object "
                "type."
            )

        arg_8 = []
        while arg_0.is_tag_next(arg_3.Tags.UNIQUE_IDENTIFIER, arg_6):
            arg_9 = primitives.TextString(
                tag=arg_3.Tags.UNIQUE_IDENTIFIER
            )
            arg_9.Func(arg_6, arg_2=arg_2)
            arg_8.append(arg_9)
        if not arg_8:
            raise exceptions.InvalidKmipEncoding(
                "The DeriveKey request payload encoding is missing the unique "
                "identifiers."
            )
        else:
            arg_0._unique_identifiers = arg_8

        if arg_0.is_tag_next(arg_3.Tags.DERIVATION_METHOD, arg_6):
            arg_0._derivation_method = primitives.Enumeration(
                arg_3.DerivationMethod,
                tag=arg_3.Tags.DERIVATION_METHOD
            )
            arg_0._derivation_method.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise exceptions.InvalidKmipEncoding(
                "The DeriveKey request payload encoding is missing the "
                "derivation method."
            )

        if arg_0.is_tag_next(arg_3.Tags.DERIVATION_PARAMETERS, arg_6):
            arg_0._derivation_parameters = attributes.DerivationParameters()
            arg_0._derivation_parameters.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise exceptions.InvalidKmipEncoding(
                "The DeriveKey request payload encoding is missing the "
                "derivation parameters."
            )

        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            if arg_0.is_tag_next(arg_3.Tags.TEMPLATE_ATTRIBUTE, arg_6):
                arg_0._template_attribute = objects.TemplateAttribute()
                arg_0._template_attribute.Func(
                    arg_6,
                    arg_2=arg_2
                )
            else:
                raise exceptions.InvalidKmipEncoding(
                    "The DeriveKey request payload encoding is missing the "
                    "template attribute."
                )
        else:
            if arg_0.is_tag_next(arg_3.Tags.ATTRIBUTES, arg_6):
                arg_14 = objects.Attributes()
                arg_14.Func(arg_6, arg_2=arg_2)
                arg_15 = objects.convert_attributes_to_template_attribute(
                    arg_14
                )
                arg_0._template_attribute = arg_15
            else:
                raise exceptions.InvalidKmipEncoding(
                    "The DeriveKey request payload encoding is missing the "
                    "attributes structure."
                )

        arg_0.is_oversized(arg_6)

Read the data encoding the DeriveKey request payload and decode it
        into its constituent parts.

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

        Raises:
            ValueError: Raised if the data attribute is missing from the
                encoded payload.

Read the data encoding the DeriveKey request payload and decode it into its constituent parts .


def Func ( arg_0 ) : arg_1 = ( _Func_part ( part . strip ( ) ) for part in arg_0 . split ( ',' ) ) return sum ( arg_1 , datetime . timedelta ( ) )

def Func(arg_0):
	"""
	Take a string representing a span of time and parse it to a time delta.
	Accepts any string of comma-separated numbers each with a unit indicator.

	>>> Func('1 day')
	datetime.timedelta(days=1)

	>>> Func('1 day, 30 seconds')
	datetime.timedelta(days=1, seconds=30)

	>>> Func('47.32 days, 20 minutes, 15.4 milliseconds')
	datetime.timedelta(days=47, seconds=28848, microseconds=15400)

	Supports weeks, months, years

	>>> Func('1 week')
	datetime.timedelta(days=7)

	>>> Func('1 year, 1 month')
	datetime.timedelta(days=395, seconds=58685)

	Note that months and years strict intervals, not aligned
	to a calendar:

	>>> now = datetime.datetime.now()
	>>> later = now + Func('1 year')
	>>> diff = later.replace(year=now.year) - now
	>>> diff.seconds
	20940
	"""
	arg_1 = (_Func_part(part.strip()) for part in arg_0.split(','))
	return sum(arg_1, datetime.timedelta())

Take a string representing a span of time and parse it to a time delta.
	Accepts any string of comma-separated numbers each with a unit indicator.

	>>> parse_timedelta('1 day')
	datetime.timedelta(days=1)

	>>> parse_timedelta('1 day, 30 seconds')
	datetime.timedelta(days=1, seconds=30)

	>>> parse_timedelta('47.32 days, 20 minutes, 15.4 milliseconds')
	datetime.timedelta(days=47, seconds=28848, microseconds=15400)

	Supports weeks, months, years

	>>> parse_timedelta('1 week')
	datetime.timedelta(days=7)

	>>> parse_timedelta('1 year, 1 month')
	datetime.timedelta(days=395, seconds=58685)

	Note that months and years strict intervals, not aligned
	to a calendar:

	>>> now = datetime.datetime.now()
	>>> later = now + parse_timedelta('1 year')
	>>> diff = later.replace(year=now.year) - now
	>>> diff.seconds
	20940

Take a string representing a span of time and parse it to a time delta . Accepts any string of comma - separated numbers each with a unit indicator .


def Func(arg_0):
    """
    Returns the location that the junction points, raises ValueError if path is
    not a junction.

    CommandLine:
        python -m ubelt._win32_links Func

    Example:
        >>> # xdoc: +REQUIRES(WIN32)
        >>> import ubelt as ub
        >>> root = ub.ensure_app_cache_dir('ubelt', 'win32_junction')
        >>> ub.delete(root)
        >>> ub.ensuredir(root)
        >>> dpath = join(root, 'dpath')
        >>> djunc = join(root, 'djunc')
        >>> ub.ensuredir(dpath)
        >>> _win32_junction(dpath, djunc)
        >>> path = djunc
        >>> pointed = Func(path)
        >>> print('pointed = {!r}'.format(pointed))
    """
    if not jwfs.is_reparse_point(arg_0):
        raise ValueError('not a junction')

    # --- Older version based on using shell commands ---
    # if not exists(path):
    #     if six.PY2:
    #         raise OSError('Cannot find path={}'.format(path))
    #     else:
    #         raise FileNotFoundError('Cannot find path={}'.format(path))
    # target_name = os.path.basename(path)
    # for type_or_size, name, pointed in _win32_dir(path, '*'):
    #     if type_or_size == '<JUNCTION>' and name == target_name:
    #         return pointed
    # raise ValueError('not a junction')

    # new version using the windows api
    arg_1 = jwfs.api.CreateFile(
            arg_0, 0, 0, None, jwfs.api.OPEN_EXISTING,
            jwfs.api.FILE_FLAG_OPEN_REPARSE_POINT |
            jwfs.api.FILE_FLAG_BACKUP_SEMANTICS,
            None)

    if arg_1 == jwfs.api.INVALID_HANDLE_VALUE:
        raise WindowsError()

    arg_2 = jwfs.reparse.DeviceIoControl(
            arg_1, jwfs.api.FSCTL_GET_REPARSE_POINT, None, 10240)

    arg_3 = jwfs.create_string_buffer(arg_2)
    arg_4 = jwfs.cast(arg_3, jwfs.POINTER(jwfs.api.REPARSE_DATA_BUFFER))
    arg_5 = arg_4.contents

    if arg_5.tag not in [2684354563, jwfs.api.IO_REPARSE_TAG_SYMLINK]:
        raise RuntimeError(
                "Expected <2684354563 or 2684354572>, but got %d" % arg_5.tag)

    jwfs.handle_nonzero_success(jwfs.api.CloseHandle(arg_1))
    arg_6 = arg_5.get_substitute_name()
    # probably has something to do with long paths, not sure
    if arg_6.startswith('?\\'):
        arg_6 = arg_6[2:]
    return arg_6

Returns the location that the junction points, raises ValueError if path is
    not a junction.

    CommandLine:
        python -m ubelt._win32_links _win32_read_junction

    Example:
        >>> # xdoc: +REQUIRES(WIN32)
        >>> import ubelt as ub
        >>> root = ub.ensure_app_cache_dir('ubelt', 'win32_junction')
        >>> ub.delete(root)
        >>> ub.ensuredir(root)
        >>> dpath = join(root, 'dpath')
        >>> djunc = join(root, 'djunc')
        >>> ub.ensuredir(dpath)
        >>> _win32_junction(dpath, djunc)
        >>> path = djunc
        >>> pointed = _win32_read_junction(path)
        >>> print('pointed = {!r}'.format(pointed))

Returns the location that the junction points raises ValueError if path is not a junction .


(df, *, column: str, new_column: str = None)

def Func(arg_0, *, arg_1: arg_2, arg_3: arg_2 = None):
    """
    Get the absolute numeric value of each element of a column

    ---

    ### Parameters

    *mandatory :*
    - `column` (*str*): name of the column

    *optional :*
    - `new_column` (*str*): name of the column containing the result.
      By default, no new column will be created and `column` will be replaced.

    ---

    ### Example

    **Input**

    | ENTITY | VALUE_1 | VALUE_2 |
    |:------:|:-------:|:-------:|
    | A      | -1.512  | -1.504  |
    | A      | 0.432   | 0.14    |

    ```cson
    Func:
      column: 'VALUE_1'
      new_column: 'Pika'
    ```

    **Output**

    | ENTITY | VALUE_1 | VALUE_2 | Pika  |
    |:------:|:-------:|:-------:|:-----:|
    | A      | -1.512  | -1.504  | 1.512 |
    | A      | 0.432   | 0.14    | 0.432 |
    """
    arg_3 = arg_3 or arg_1
    arg_0[arg_3] = abs(arg_0[arg_1])
    return arg_0

Get the absolute numeric value of each element of a column

    ---

    ### Parameters

    *mandatory :*
    - `column` (*str*): name of the column

    *optional :*
    - `new_column` (*str*): name of the column containing the result.
      By default, no new column will be created and `column` will be replaced.

    ---

    ### Example

    **Input**

    | ENTITY | VALUE_1 | VALUE_2 |
    |:------:|:-------:|:-------:|
    | A      | -1.512  | -1.504  |
    | A      | 0.432   | 0.14    |

    ```cson
    absolute_values:
      column: 'VALUE_1'
      new_column: 'Pika'
    ```

    **Output**

    | ENTITY | VALUE_1 | VALUE_2 | Pika  |
    |:------:|:-------:|:-------:|:-----:|
    | A      | -1.512  | -1.504  | 1.512 |
    | A      | 0.432   | 0.14    | 0.432 |


def
Func
(
arg_0
,
arg_1
=
1.
,
arg_2
=
)
:
arg_3
=
len
(
arg_0
)
arg_4
=
time
.
time
(
)
while
not
arg_0
.
ready
(
)
and
(
arg_2
is
or
time
.
time
(
)
arg_4
<=
arg_2
)
:
arg_0
.
wait
(
arg_1
)
clear_output
(
)
print
(
"%4i/%i tasks finished after %4i s"
%
(
arg_0
.
progress
,
arg_3
,
arg_0
.
elapsed
)
,
end
=
""
)
sys
.
stdout
.
flush
(
)
print
(
)
print
(
"done"
)

def Func(arg_0, arg_1=1., arg_2=None):
        """interactive wait, printing progress at regular intervals"""
        arg_3 = len(arg_0)
        arg_4 = time.time()
        while not arg_0.ready() and (arg_2 is None or time.time() - arg_4 <= arg_2):
            arg_0.wait(arg_1)
            clear_output()
            print("%4i/%i tasks finished after %4i s" % (arg_0.progress, arg_3, arg_0.elapsed), end="")
            sys.stdout.flush()
        print()
        print("done")

interactive wait printing progress at regular intervals


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
if
arg_5
==
SIMPLE
:
arg_6
=
[
i
(
arg_1
,
arg_2
)
for
i
in
arg_0
.
ThermalConductivityGases
]
return
mixing_simple
(
arg_3
,
arg_6
)
elif
arg_5
==
LINDSAY_BROMLEY
:
arg_6
=
[
i
(
arg_1
,
arg_2
)
for
i
in
arg_0
.
ThermalConductivityGases
]
arg_7
=
[
i
(
arg_1
,
arg_2
)
for
i
in
arg_0
.
ViscosityGases
]
return
Lindsay_Bromley
(
arg_1
=
arg_1
,
ys
=
arg_3
,
arg_6
=
arg_6
,
arg_7
=
arg_7
,
Tbs
=
arg_0
.
Tbs
,
MWs
=
arg_0
.
MWs
)
else
:
raise
Exception
(
'Method not valid'
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        r'''Method to Func thermal conductivity of a gas mixture at
        temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
        `ws` with a given method.

        This method has no exception handling; see `mixture_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to Func the property, [K]
        P : float
            Pressure at which to Func the property, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        method : str
            Name of the method to use

        Returns
        -------
        kg : float
            Thermal conductivity of gas mixture, [W/m/K]
        '''
        if arg_5 == SIMPLE:
            arg_6 = [i(arg_1, arg_2) for i in arg_0.ThermalConductivityGases]
            return mixing_simple(arg_3, arg_6)
        elif arg_5 == LINDSAY_BROMLEY:
            arg_6 = [i(arg_1, arg_2) for i in arg_0.ThermalConductivityGases]
            arg_7 = [i(arg_1, arg_2) for i in arg_0.ViscosityGases]
            return Lindsay_Bromley(arg_1=arg_1, ys=arg_3, arg_6=arg_6, arg_7=arg_7, Tbs=arg_0.Tbs, MWs=arg_0.MWs)
        else:
            raise Exception('Method not valid')

r'''Method to calculate thermal conductivity of a gas mixture at
        temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
        `ws` with a given method.

        This method has no exception handling; see `mixture_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate the property, [K]
        P : float
            Pressure at which to calculate the property, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        method : str
            Name of the method to use

        Returns
        -------
        kg : float
            Thermal conductivity of gas mixture, [W/m/K]

r Method to calculate thermal conductivity of a gas mixture at temperature T pressure P mole fractions zs and weight fractions ws with a given method .


def Func ( arg_0 ) : arg_1 , arg_2 , arg_3 = arg_0 return "#{0}{1}{2}" . format ( hex ( int ( arg_1 ) ) [ 2 : ] . zfill ( 2 ) , hex ( int ( arg_2 ) ) [ 2 : ] . zfill ( 2 ) , hex ( int ( arg_3 ) ) [ 2 : ] . zfill ( 2 ) )

def Func(arg_0):
    """
    Convert an RGB color representation to a HEX color representation.

    (r, g, b) :: r -> [0, 255]
                 g -> [0, 255]
                 b -> [0, 255]

    :param rgb: A tuple of three numeric values corresponding to the red, green, and blue value.
    :return: HEX representation of the input RGB value.
    :rtype: str
    """
    arg_1, arg_2, arg_3 = arg_0
    return "#{0}{1}{2}".format(hex(int(arg_1))[2:].zfill(2), hex(int(arg_2))[2:].zfill(2), hex(int(arg_3))[2:].zfill(2))

Convert an RGB color representation to a HEX color representation .


def
Func
(
arg_0
)
:
try
:
if
sys
.
version_info
.
major
<
3
:
from
locale
import
getpreferredencoding
arg_1
=
getpreferredencoding
(
)
arg_0
=
arg_0
.
decode
(
arg_1
)
return
[
arg_2
.
strip
(
)
for
arg_2
in
arg_0
.
split
(
u","
)
]
except
(
AttributeError
,
TypeError
,
UnicodeError
)
:
raise
ValueError
(
"Bad string list"
)

def Func(arg_0):
        """Validator for string lists to be used with `add_setting`."""
        try:
            if sys.version_info.major < 3:
                # pylint: disable-msg=W0404
                from locale import getpreferredencoding
                arg_1 = getpreferredencoding()
                arg_0 = arg_0.decode(arg_1)
            return [arg_2.strip() for arg_2 in arg_0.split(u",")]
        except (AttributeError, TypeError, UnicodeError):
            raise ValueError("Bad string list")

Validator for string lists to be used with add_setting .


(ds, column_names=None, selection=None, strings=True, virtual=False)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=True, arg_4=False):
    """Implementation of Dataset.to_arrow_table"""
    arg_5 = []
    arg_6 = []
    for arg_7, arg_8 in arg_0.to_items(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4):
        arg_5.append(arg_7)
        arg_6.append(arrow_array_from_numpy_array(arg_8))
    return pyarrow.Table.from_arrays(arg_6, arg_5)

Implementation of Dataset . to_arrow_table


def Func(arg_0, arg_1, arg_2):
        """Consume an a requested amount

        :type amt: int
        :param amt: The amount of bytes to request to Func

        :type request_token: RequestToken
        :param request_token: The token associated to the consumption
            request that is used to identify the request. So if a
            RequestExceededException is raised the token should be used
            in subsequent retry Func() request.

        :raises RequestExceededException: If the consumption amount would
            exceed the maximum allocated bandwidth

        :rtype: int
        :returns: The amount Funcd
        """
        with arg_0._lock:
            arg_3 = arg_0._time_utils.time()
            if arg_0._consumption_scheduler.is_scheduled(arg_2):
                return arg_0._release_requested_amt_for_scheduled_request(
                    arg_1, arg_2, arg_3)
            elif arg_0._projected_to_exceed_max_rate(arg_1, arg_3):
                arg_0._raise_request_exceeded_exception(
                    arg_1, arg_2, arg_3)
            else:
                return arg_0._release_requested_amt(arg_1, arg_3)

Consume an a requested amount

        :type amt: int
        :param amt: The amount of bytes to request to consume

        :type request_token: RequestToken
        :param request_token: The token associated to the consumption
            request that is used to identify the request. So if a
            RequestExceededException is raised the token should be used
            in subsequent retry consume() request.

        :raises RequestExceededException: If the consumption amount would
            exceed the maximum allocated bandwidth

        :rtype: int
        :returns: The amount consumed


def Func ( arg_0 , arg_1 ) : if arg_1 . ROWID < arg_0 . getParameter ( 'trainRecords' ) : if not arg_1 . setByUser : arg_1 . anomalyLabel = [ ] arg_0 . _deleteRecordsFromKNN ( [ arg_1 ] ) return arg_3 = KNNAnomalyClassifierRegion . AUTO_THRESHOLD_CLASSIFIED_LABEL arg_4 = arg_3 + KNNAnomalyClassifierRegion . AUTO_TAG arg_5 = arg_0 . _recomputeRecordFromKNN ( arg_1 ) arg_6 = arg_0 . _categoryToLabelList ( arg_5 ) if arg_1 . setByUser : if arg_3 in arg_1 . anomalyLabel : arg_1 . anomalyLabel . remove ( arg_3 ) if arg_4 in arg_1 . anomalyLabel : arg_1 . anomalyLabel . remove ( arg_4 ) arg_6 . extend ( arg_1 . anomalyLabel ) if arg_1 . anomalyScore >= arg_0 . getParameter ( 'anomalyThreshold' ) : arg_6 . append ( arg_3 ) elif arg_3 in arg_6 : arg_7 = arg_6 . index ( arg_3 ) arg_6 [ arg_7 ] = arg_4 arg_6 = list ( set ( arg_6 ) ) if arg_3 in arg_6 and arg_4 in arg_6 : arg_6 . remove ( arg_4 ) if arg_1 . anomalyLabel == arg_6 : return arg_1 . anomalyLabel = arg_6 if arg_1 . anomalyLabel == [ ] : arg_0 . _deleteRecordsFromKNN ( [ arg_1 ] ) else : arg_0 . _addRecordToKNN ( arg_1 )

def Func(arg_0, arg_1):
    """
    Reclassifies given state.
    """
    # Record is before wait period do not classifiy
    if arg_1.ROWID < arg_0.getParameter('trainRecords'):
      if not arg_1.setByUser:
        arg_1.anomalyLabel = []
        arg_0._deleteRecordsFromKNN([arg_1])
      return

    arg_3 = KNNAnomalyClassifierRegion.AUTO_THRESHOLD_CLASSIFIED_LABEL
    arg_4 = arg_3 + KNNAnomalyClassifierRegion.AUTO_TAG

    # Update the label based on classifications
    arg_5 = arg_0._recomputeRecordFromKNN(arg_1)
    arg_6 = arg_0._categoryToLabelList(arg_5)

    if arg_1.setByUser:
      if arg_3 in arg_1.anomalyLabel:
        arg_1.anomalyLabel.remove(arg_3)
      if arg_4 in arg_1.anomalyLabel:
        arg_1.anomalyLabel.remove(arg_4)
      arg_6.extend(arg_1.anomalyLabel)

    # Add threshold classification label if above threshold, else if
    # classified to add the auto threshold classification.
    if arg_1.anomalyScore >= arg_0.getParameter('anomalyThreshold'):
      arg_6.append(arg_3)
    elif arg_3 in arg_6:
      arg_7 = arg_6.index(arg_3)
      arg_6[arg_7] = arg_4

    # Make all entries unique
    arg_6 = list(set(arg_6))

    # If both above threshold and auto classified above - remove auto label
    if arg_3 in arg_6 and arg_4 in arg_6:
      arg_6.remove(arg_4)

    if arg_1.anomalyLabel == arg_6:
      return

    # Update state's labeling
    arg_1.anomalyLabel = arg_6

    # Update KNN Classifier with new labeling
    if arg_1.anomalyLabel == []:
      arg_0._deleteRecordsFromKNN([arg_1])
    else:
      arg_0._addRecordToKNN(arg_1)


def Func ( arg_0 ) -> int : from . repositories import PriceRepository arg_1 = PriceRepository ( ) arg_2 = arg_1 . query . distinct ( dal . Price . namespace , dal . Price . symbol ) . all ( ) arg_3 = 0 for arg_4 in arg_2 : arg_5 = SecuritySymbol ( arg_4 . namespace , arg_4 . symbol ) arg_6 = arg_0 . prune ( arg_5 ) if arg_6 : arg_3 += 1 return arg_3

def Func(arg_0) -> int:
        """
        Prune historical prices for all symbols, leaving only the latest.
        Returns the number of items removed.
        """
        from .repositories import PriceRepository

        # get all symbols that have prices
        arg_1 = PriceRepository()
        arg_2 = arg_1.query.distinct(dal.Price.namespace, dal.Price.symbol).all()
        # self.logger.debug(items)
        arg_3 = 0

        for arg_4 in arg_2:
            arg_5 = SecuritySymbol(arg_4.namespace, arg_4.symbol)
            arg_6 = arg_0.prune(arg_5)
            if arg_6:
                arg_3 += 1

        return arg_3

Prune historical prices for all symbols leaving only the latest . Returns the number of items removed .


def Func ( arg_0 ) : try : return arg_0 . _pkg_info except AttributeError : from email . parser import Parser arg_0 . _pkg_info = Parser ( ) . parsestr ( arg_0 . get_metadata ( arg_0 . PKG_INFO ) ) return arg_0 . _pkg_info

def Func(arg_0):
        """Parse and cache metadata"""
        try:
            return arg_0._pkg_info
        except AttributeError:
            from email.parser import Parser
            arg_0._pkg_info = Parser().parsestr(arg_0.get_metadata(arg_0.PKG_INFO))
            return arg_0._pkg_info


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_0 . session . feed_identities ( arg_1 ) arg_0 . call_handlers ( arg_0 . session . unserialize ( arg_3 ) )

def Func(arg_0, arg_1):
        """callback for stream.on_recv

        unpacks message, and calls handlers with it.
        """
        arg_2,arg_3 = arg_0.session.feed_identities(arg_1)
        arg_0.call_handlers(arg_0.session.unserialize(arg_3))

callback for stream . on_recv unpacks message and calls handlers with it .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : if arg_2 not in arg_0 . perms : return False return True

def Func(arg_0, arg_1):
        """ Check if there is enough permissions for access """
        for arg_2 in arg_1:
            if arg_2 not in arg_0.perms:
                return False
        return True


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
json
log
.
info
(
"\n"
)
log
.
info
(
"WEBHOOK POST RECEIVED:"
)
log
.
info
(
arg_1
)
log
.
info
(
"\n"
)
arg_2
=
Webhook
(
arg_1
)
arg_3
=
api
.
rooms
.
get
(
arg_2
.
data
.
roomId
)
arg_4
=
api
.
messages
.
get
(
arg_2
.
data
.
id
)
arg_5
=
api
.
people
.
get
(
arg_4
.
personId
)
log
.
info
(
"NEW MESSAGE IN ROOM '{}'"
.
format
(
arg_3
.
title
)
)
log
.
info
(
"FROM '{}'"
.
format
(
arg_5
.
displayName
)
)
log
.
info
(
"MESSAGE '{}'\n"
.
format
(
arg_4
.
text
)
)
arg_6
=
api
.
people
.
me
(
)
if
arg_4
.
personId
==
arg_6
.
id
:
return
{
'Message'
:
'OK'
}
else
:
if
"/CAT"
in
arg_4
.
text
:
log
.
info
(
"FOUND '/CAT'"
)
arg_7
=
get_catfact
(
)
log
.
info
(
"SENDING CAT FACT'{}'"
.
format
(
arg_7
)
)
api
.
messages
.
create
(
arg_3
.
id
,
text
=
arg_7
)
return
{
'Message'
:
'OK'
}

def Func(arg_0):
    """Respond to inbound webhook JSON HTTP POST from Webex Teams."""

    # Get the POST data sent from Webex Teams
    arg_1 = arg_0.json
    log.info("\n")
    log.info("WEBHOOK POST RECEIVED:")
    log.info(arg_1)
    log.info("\n")

    # Create a Webhook object from the JSON data
    arg_2 = Webhook(arg_1)

    # Get the room details
    arg_3 = api.rooms.get(arg_2.data.roomId)

    # Get the message details
    arg_4 = api.messages.get(arg_2.data.id)

    # Get the sender's details
    arg_5 = api.people.get(arg_4.personId)

    log.info("NEW MESSAGE IN ROOM '{}'".format(arg_3.title))
    log.info("FROM '{}'".format(arg_5.displayName))
    log.info("MESSAGE '{}'\n".format(arg_4.text))

    # This is a VERY IMPORTANT loop prevention control step.
    # If you respond to all messages...  You will respond to the messages
    # that the bot posts and thereby create a loop condition.
    arg_6 = api.people.me()
    if arg_4.personId == arg_6.id:
        # Message was sent by me (bot); do not respond.
        return {'Message': 'OK'}

    else:
        # Message was sent by someone else; parse message and respond.
        if "/CAT" in arg_4.text:
            log.info("FOUND '/CAT'")

            # Get a cat fact
            arg_7 = get_catfact()
            log.info("SENDING CAT FACT'{}'".format(arg_7))

            # Post the fact to the room where the request was received
            api.messages.create(arg_3.id, text=arg_7)
        return {'Message': 'OK'}

Respond to inbound webhook JSON HTTP POST from Webex Teams .


return self.request(path, method, call_params)

def Func ( arg_0 , arg_1 ) : arg_2 = '/' + arg_0 . api_version + '/CancelScheduledHangup/' arg_3 = 'POST' return arg_0 . request ( arg_2 , arg_3 , arg_1 )

def Func(arg_0, arg_1):
        """REST Cancel a Scheduled Hangup Helper
        """
        arg_2 = '/' + arg_0.api_version + '/CancelScheduledHangup/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = CourseCatalogApiServiceClient ( arg_1 . site ) . get_course_details ( arg_2 ) except ImproperlyConfigured : raise Http404 arg_4 = EnrollmentApiClient ( ) . get_enrolled_courses ( arg_0 . username ) arg_5 = get_active_course_runs ( arg_3 , arg_4 ) if arg_4 else [ ] arg_6 = get_current_course_run ( arg_3 , arg_5 ) if arg_6 : arg_7 = arg_6 [ 'key' ] return arg_7 else : raise Http404

def Func(arg_0, arg_1, arg_2):
        """
        User is requesting a course, we need to translate that into the current course run.

        :param user:
        :param enterprise_customer:
        :param course_key:
        :return: course_run_id
        """
        try:
            arg_3 = CourseCatalogApiServiceClient(arg_1.site).get_course_details(arg_2)
        except ImproperlyConfigured:
            raise Http404

        arg_4 = EnrollmentApiClient().get_enrolled_courses(arg_0.username)
        arg_5 = get_active_course_runs(
            arg_3,
            arg_4
        ) if arg_4 else []
        arg_6 = get_current_course_run(arg_3, arg_5)
        if arg_6:
            arg_7 = arg_6['key']
            return arg_7
        else:
            raise Http404

User is requesting a course we need to translate that into the current course run .


def Func(arg_0, arg_1, arg_2):
        """Deconfigure any additional default transport zone bindings."""
        arg_3 = CONF.NVP.default_tz

        if not arg_3:
            LOG.warn("additional_default_tz_types specified, "
                     "but no default_tz. Skipping "
                     "Func().")
            return

        if not arg_2:
            LOG.warn("neutron network_id not specified, skipping "
                     "Func()")
            return

        for arg_4 in CONF.NVP.additional_default_tz_types:
            if arg_4 in TZ_BINDINGS:
                arg_5 = TZ_BINDINGS[arg_4]
                arg_5.remove(arg_1, arg_3, arg_2)
            else:
                LOG.warn("Unknown default tz type %s" % (arg_4))

Deconfigure any additional default transport zone bindings .


def Func(arg_0, arg_1, arg_2):
        """Return a subsetted window of a given size, centered on a geometry object

        Useful for generating training sets from vector training data
        Will throw a ValueError if the window is not within the image bounds

        Args:
            geom (shapely,geometry): Geometry to center the image on
            window_shape (tuple): The desired shape of the image as (height, width) in pixels.

        Returns:
            image: image object of same type
        """
        # Centroids of the input geometry may not be centered on the object.
        # For a covering image we use the bounds instead.
        # This is also a workaround for issue 387.
        arg_3, arg_4 = arg_2[0], arg_2[1]
        arg_5 = box(*arg_1.bounds)
        arg_6 = ops.transform(arg_0.__geo_transform__.rev, arg_5).centroid
        arg_7, arg_8 = int(arg_6.y - arg_3/2), int(arg_6.y + arg_3/2)
        arg_9, arg_10 = int(arg_6.x - arg_4/2), int(arg_6.x + arg_4/2)
        arg_11, arg_12, arg_13 = arg_0.shape
        if arg_9 < 0 or arg_7 < 0 or arg_10 > arg_13 or arg_8 > arg_12:
            raise ValueError("Input geometry resulted in a window outside of the image")
        return arg_0[:, arg_7:arg_8, arg_9:arg_10]

Return a subsetted window of a given size centered on a geometry object


(img, angle, resample=False, expand=False, center=None)

return img.rotate(angle, resample, expand, center)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
,
arg_3
=
False
,
arg_4
=
)
:
if
not
_is_pil_image
(
arg_0
)
:
raise
TypeError
(
'img should be PIL Image. Got {}'
.
format
(
type
(
arg_0
)
)
)
return
arg_0
.
Func
(
arg_1
,
arg_2
,
arg_3
,
arg_4
)

def Func(arg_0, arg_1, arg_2=False, arg_3=False, arg_4=None):
    """Rotate the image by angle.

    Args:
        img (PIL Image): PIL Image to be Funcd.
        angle (float or int): In degrees degrees counter clockwise order.
        resample (``PIL.Image.NEAREST`` or ``PIL.Image.BILINEAR`` or ``PIL.Image.BICUBIC``, optional):
            An optional resampling filter. See `filters`_ for more information.
            If omitted, or if the image has mode "1" or "P", it is set to ``PIL.Image.NEAREST``.
        expand (bool, optional): Optional expansion flag.
            If true, expands the output image to make it large enough to hold the entire Funcd image.
            If false or omitted, make the output image the same size as the input image.
            Note that the expand flag assumes rotation around the center and no translation.
        center (2-tuple, optional): Optional center of rotation.
            Origin is the upper left corner.
            Default is the center of the image.

    .. _filters: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#filters

    """

    if not _is_pil_image(arg_0):
        raise TypeError('img should be PIL Image. Got {}'.format(type(arg_0)))

    return arg_0.Func(arg_1, arg_2, arg_3, arg_4)

Rotate the image by angle.

    Args:
        img (PIL Image): PIL Image to be rotated.
        angle (float or int): In degrees degrees counter clockwise order.
        resample (``PIL.Image.NEAREST`` or ``PIL.Image.BILINEAR`` or ``PIL.Image.BICUBIC``, optional):
            An optional resampling filter. See `filters`_ for more information.
            If omitted, or if the image has mode "1" or "P", it is set to ``PIL.Image.NEAREST``.
        expand (bool, optional): Optional expansion flag.
            If true, expands the output image to make it large enough to hold the entire rotated image.
            If false or omitted, make the output image the same size as the input image.
            Note that the expand flag assumes rotation around the center and no translation.
        center (2-tuple, optional): Optional center of rotation.
            Origin is the upper left corner.
            Default is the center of the image.

    .. _filters: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#filters


return super(HashMixin, self).pre_save(model_instance, add)

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . original : arg_3 = getattr ( arg_1 , arg_0 . original ) setattr ( arg_1 , arg_0 . attname , arg_3 ) return super ( HashMixin , arg_0 ) . Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """Save the original_value."""
        if arg_0.original:
            arg_3 = getattr(arg_1, arg_0.original)
            setattr(arg_1, arg_0.attname, arg_3)

        return super(HashMixin, arg_0).Func(arg_1, arg_2)


(self, x_init, base_value, target_value, estimated_improvement)

return first_step + (deltas, improvement, last_improvement, estimated_improvement)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_0 . base_value = arg_2 if arg_4 is None : arg_4 = tf . abs ( x = arg_2 ) arg_5 = super ( LineSearch , arg_0 ) . Func ( arg_1 ) arg_6 = tf . divide ( x = ( arg_3 - arg_0 . base_value ) , y = tf . maximum ( x = arg_4 , y = util . epsilon ) ) arg_7 = arg_6 - 1.0 if arg_0 . mode == 'linear' : arg_8 = [ - t * arg_0 . parameter for t in arg_1 ] arg_0 . estimated_incr = - arg_4 * arg_0 . parameter elif arg_0 . mode == 'exponential' : arg_8 = [ - t * arg_0 . parameter for t in arg_1 ] return arg_5 + ( arg_8 , arg_6 , arg_7 , arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        Initialization step preparing the arguments for the first iteration of the loop body.

        Args:
            x_init: Initial solution guess $x_0$.
            base_value: Value $f(x')$ at $x = x'$.
            target_value: Value $f(x_0)$ at $x = x_0$.
            estimated_improvement: Estimated value at $x = x_0$, $f(x')$ if None.

        Returns:
            Initial arguments for tf_step.
        """
        arg_0.base_value = arg_2

        if arg_4 is None:  # TODO: Is this a good alternative?
            arg_4 = tf.abs(x=arg_2)

        arg_5 = super(LineSearch, arg_0).Func(arg_1)

        arg_6 = tf.divide(
            x=(arg_3 - arg_0.base_value),
            y=tf.maximum(x=arg_4, y=util.epsilon)
        )

        arg_7 = arg_6 - 1.0

        if arg_0.mode == 'linear':
            arg_8 = [-t * arg_0.parameter for t in arg_1]
            arg_0.estimated_incr = -arg_4 * arg_0.parameter

        elif arg_0.mode == 'exponential':
            arg_8 = [-t * arg_0.parameter for t in arg_1]

        return arg_5 + (arg_8, arg_6, arg_7, arg_4)

Initialization step preparing the arguments for the first iteration of the loop body .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . keys ( ) : if arg_2 . startswith ( "detection" ) : arg_3 = arg_0 [ arg_2 ] for arg_4 in arg_3 : arg_4 . cx = arg_1 - arg_4 . cx if arg_2 == "detections_2.5d" : arg_4 . theta = math . pi - arg_4 . theta

def Func(arg_0, arg_1):
    """
    Horizontally flip detections according to an image flip.

    :param label: The label dict containing all detection lists.
    :param w: The width of the image as a number.
    :return:
    """
    for arg_2 in arg_0.keys():
        if arg_2.startswith("detection"):
            arg_3 = arg_0[arg_2]
            for arg_4 in arg_3:
                arg_4.cx = arg_1 - arg_4.cx
                if arg_2 == "detections_2.5d":
                    arg_4.theta = math.pi - arg_4.theta

Horizontally flip detections according to an image flip .


def Func ( arg_0 , arg_1 ) : arg_2 = Struct ( ) for arg_3 in arg_0 . dtype . names : arg_4 = arg_0 [ arg_3 ] if isinstance ( arg_4 , np . ndarray ) and arg_4 . dtype . kind == 'O' : arg_4 = arg_4 . squeeze ( ) . tolist ( ) arg_2 [ arg_3 ] = _extract ( arg_4 , arg_1 ) return arg_2

def Func(arg_0, arg_1):
    """Create a struct from session data.
    """
    arg_2 = Struct()
    for arg_3 in arg_0.dtype.names:
        arg_4 = arg_0[arg_3]
        # Extract values that are cells (they are doubly wrapped).
        if isinstance(arg_4, np.ndarray) and arg_4.dtype.kind == 'O':
            arg_4 = arg_4.squeeze().tolist()
        arg_2[arg_3] = _extract(arg_4, arg_1)
    return arg_2


def Func(arg_0, arg_1, arg_2):
        """Save byte to memory"""
        if istainted(arg_0.pc):
            for arg_3 in get_taints(arg_0.pc):
                arg_2 = taint_with(arg_2, arg_3)
        arg_0._allocate(arg_1, 1)
        arg_0._store(arg_1, Operators.EXTRACT(arg_2, 0, 8), 1)


def Func ( arg_0 , arg_1 = None ) : if not arg_1 : arg_1 = arg_0 . conn . id arg_2 = arg_0 . conn . client . hget ( arg_0 . nodelist_key , arg_1 ) return int ( arg_2 ) if arg_2 else None

def Func(arg_0, arg_1=None):
        """
        Returns the time a particular node has been last refreshed.

        :param string node_id: optional, the connection id of the node to retrieve

        :rtype: int
        :returns: Returns a unix timestamp if it exists, otherwise None
        """
        if not arg_1:
            arg_1 = arg_0.conn.id

        arg_2 = arg_0.conn.client.hget(arg_0.nodelist_key, arg_1)
        return int(arg_2) if arg_2 else None

Returns the time a particular node has been last refreshed .


def Func(arg_0="checkpoint: Func package"):
    """Deploy the app to PYPI.

    Args:
        msg (str, optional): Description
    """
    arg_1 = check()
    if arg_1.succeeded:
        # clean()
        # push(msg)
        arg_2 = local("python setup.py sdist")
        if arg_2.succeeded:
            arg_3 = local(
                'python setup.py build && python setup.py bdist_egg')
            if arg_3.succeeded:
                arg_4 = local("twine upload dist/*")
                if arg_4.succeeded:
                    tag()


def Func():
    """Return an instance of the BLE provider for the current platform."""
    global arg_0
    # Set the provider based on the current platform.
    if arg_0 is None:
        if sys.platform.startswith('linux'):
            # Linux platform
            from .bluez_dbus.provider import BluezProvider
            arg_0 = BluezProvider()
        elif sys.platform == 'darwin':
            # Mac OSX platform
            from .corebluetooth.provider import CoreBluetoothProvider
            arg_0 = CoreBluetoothProvider()
        else:
            # Unsupported platform
            raise RuntimeError('Sorry the {0} platform is not supported by the BLE library!'.format(sys.platform))
    return arg_0

Return an instance of the BLE provider for the current platform .


def Func(arg_0,arg_1,arg_2=None):
        """ insert a tab with a given frontend in the tab bar, and give it a name

        """
        if not arg_2:
            arg_2 = 'kernel %i' % arg_0.next_kernel_id
        arg_0.tab_widget.addTab(arg_1,arg_2)
        arg_0.update_tab_bar_visibility()
        arg_0.make_frontend_visible(arg_1)
        arg_1.exit_requested.connect(arg_0.close_tab)

insert a tab with a given frontend in the tab bar and give it a name


return i and self.separator[min(i - 1, len(self.separator) - 1)] or ''

def Func ( arg_0 , arg_1 ) : return arg_1 and arg_0 . separator [ min ( arg_1 - 1 , len ( arg_0 . separator ) - 1 ) ] or ''

def Func(arg_0, arg_1):
        """Return the separator that preceding format i, or '' for i == 0."""
        return arg_1 and arg_0.separator[min(arg_1 - 1, len(arg_0.separator) - 1)] or ''

Return the separator that preceding format i or for i == 0 .


def Func(arg_0, arg_1):
        """Extract parameters from the post authorization redirect response URL.

        :param url: The full URL that resulted from the user being redirected
                    back from the OAuth provider to you, the client.
        :returns: A dict of parameters extracted from the URL.

        >>> redirect_response = 'https://127.0.0.1/callback?oauth_token=kjerht2309uf&oauth_token_secret=lsdajfh923874&oauth_verifier=w34o8967345'
        >>> oauth_session = OAuth1Session('client-key', client_secret='secret')
        >>> oauth_session.Func(redirect_response)
        {
            'oauth_token: 'kjerht2309u',
            'oauth_token_secret: 'lsdajfh923874',
            'oauth_verifier: 'w34o8967345',
        }
        """
        log.debug("Parsing token from query part of url %s", arg_1)
        arg_2 = dict(urldecode(urlparse(arg_1).query))
        log.debug("Updating internal client token attribute.")
        arg_0._populate_attributes(arg_2)
        arg_0.token = arg_2
        return arg_2

Extract parameters from the post authorization redirect response URL.

        :param url: The full URL that resulted from the user being redirected
                    back from the OAuth provider to you, the client.
        :returns: A dict of parameters extracted from the URL.

        >>> redirect_response = 'https://127.0.0.1/callback?oauth_token=kjerht2309uf&oauth_token_secret=lsdajfh923874&oauth_verifier=w34o8967345'
        >>> oauth_session = OAuth1Session('client-key', client_secret='secret')
        >>> oauth_session.parse_authorization_response(redirect_response)
        {
            'oauth_token: 'kjerht2309u',
            'oauth_token_secret: 'lsdajfh923874',
            'oauth_verifier: 'w34o8967345',
        }

Extract parameters from the post authorization redirect response URL .


(self, text, maxwidth, maxheight, template_dir, context,
                   urlize_all_links)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
arg_7
=
{
}
arg_8
=
set
(
re
.
findall
(
URL_RE
,
arg_1
)
)
for
arg_9
in
arg_8
:
try
:
arg_10
=
oembed
.
site
.
embed
(
arg_9
,
arg_2
=
arg_2
,
arg_3
=
arg_3
)
except
OEmbedException
:
if
arg_6
:
arg_7
[
arg_9
]
=
'%(LINK)s'
%
{
'LINK'
:
arg_9
}
else
:
arg_5
[
'minwidth'
]
=
min
(
arg_2
,
arg_10
.
width
)
arg_5
[
'minheight'
]
=
min
(
arg_3
,
arg_10
.
height
)
arg_11
=
arg_0
.
render_oembed
(
arg_10
,
arg_9
,
arg_4
=
arg_4
,
arg_5
=
arg_5
)
arg_7
[
arg_9
]
=
arg_11
.
strip
(
)
arg_8
=
re
.
finditer
(
URL_RE
,
arg_1
)
arg_12
=
[
]
for
arg_13
in
arg_8
:
if
arg_13
.
group
(
)
in
arg_7
:
arg_12
.
append
(
[
arg_13
.
start
(
)
,
arg_13
.
end
(
)
,
arg_13
.
group
(
)
]
)
for
arg_14
,
(
arg_15
,
arg_16
,
arg_9
)
in
enumerate
(
arg_12
)
:
arg_11
=
arg_7
[
arg_9
]
arg_17
=
len
(
arg_11
)
len
(
arg_9
)
arg_1
=
arg_1
[
:
arg_15
]
+
arg_11
+
arg_1
[
arg_16
:
]
for
arg_18
in
xrange
(
arg_14
+
1
,
len
(
arg_12
)
)
:
arg_12
[
arg_18
]
[
0
]
+=
arg_17
arg_12
[
arg_18
]
[
1
]
+=
arg_17
return
mark_safe
(
arg_1
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
                   arg_6):
        """
        Parses a block of text indiscriminately
        """
        # create a dictionary of user urls -> rendered responses
        arg_7 = {}
        arg_8 = set(re.findall(URL_RE, arg_1))

        for arg_9 in arg_8:
            try:
                arg_10 = oembed.site.embed(arg_9, arg_2=arg_2, arg_3=arg_3)
            except OEmbedException:
                if arg_6:
                    arg_7[arg_9] = '%(LINK)s' % {'LINK': arg_9}
            else:
                arg_5['minwidth'] = min(arg_2, arg_10.width)
                arg_5['minheight'] = min(arg_3, arg_10.height)

                arg_11 = arg_0.render_oembed(
                    arg_10,
                    arg_9,
                    arg_4=arg_4,
                    arg_5=arg_5
                )
                arg_7[arg_9] = arg_11.strip()

        # go through the text recording URLs that can be replaced
        # taking note of their start & end indexes
        arg_8 = re.finditer(URL_RE, arg_1)
        arg_12 = []
        for arg_13 in arg_8:
            if arg_13.group() in arg_7:
                arg_12.append([arg_13.start(), arg_13.end(), arg_13.group()])

        # replace the URLs in order, offsetting the indices each go
        for arg_14, (arg_15, arg_16, arg_9) in enumerate(arg_12):
            arg_11 = arg_7[arg_9]
            arg_17 = len(arg_11) - len(arg_9)

            # insert the replacement between two slices of text surrounding the
            # original url
            arg_1 = arg_1[:arg_15] + arg_11 + arg_1[arg_16:]

            # iterate through the rest of the matches offsetting their indices
            # based on the difference between replacement/original
            for arg_18 in xrange(arg_14 + 1, len(arg_12)):
                arg_12[arg_18][0] += arg_17
                arg_12[arg_18][1] += arg_17
        return mark_safe(arg_1)


def Func(arg_0, arg_1, arg_2, arg_3 = None):
    """Format a stack trace and the exception information.

    The arguments have the same meaning as the corresponding arguments
    to print_exception().  The return value is a list of strings, each
    ending in a newline and some containing internal newlines.  When
    these lines are concatenated and printed, exactly the same text is
    printed as does print_exception().
    """
    if arg_2:
        arg_4 = ['Traceback (most recent call last):\n']
        arg_4 = arg_4 + format_tb(arg_2, arg_3)
    else:
        arg_4 = []
    arg_4 = arg_4 + Func_only(arg_0, arg_1)
    return arg_4

Format a stack trace and the exception information .


def Func ( arg_0 ) : arg_0 . _transformers = [ ] for arg_2 in _default_transformers : arg_2 ( shell = arg_0 . shell , prefilter_manager = arg_0 , config = arg_0 . config )

def Func(arg_0):
        """Create the default transformers."""
        arg_0._transformers = []
        for arg_2 in _default_transformers:
            arg_2(
                shell=arg_0.shell, prefilter_manager=arg_0, config=arg_0.config
            )


def Func ( arg_0 : arg_1 = False ) -> arg_1 : arg_2 = False if _default_settings_path == _settings_path : return arg_2 for arg_3 in list ( _default_settings_path . glob ( '**/*.json' ) ) : arg_4 = _settings_path / arg_3 . relative_to ( _default_settings_path ) if not arg_0 and arg_4 . exists ( ) : continue arg_2 = True arg_4 . parent . mkdir ( parents = True , exist_ok = True ) shutil . copy ( arg_3 , arg_4 ) return arg_2

def Func(arg_0: arg_1 = False) -> arg_1:
    """
    Populate settings directory with default settings files

    Args:
        force: if ``True``, replace existing settings files with default ones

    Returns:
        ``True`` if any files were copied and ``False`` otherwise
    """
    arg_2 = False
    if _default_settings_path == _settings_path:
        return arg_2

    for arg_3 in list(_default_settings_path.glob('**/*.json')):
        arg_4 = _settings_path / arg_3.relative_to(_default_settings_path)
        if not arg_0 and arg_4.exists():
            continue
        arg_2 = True
        arg_4.parent.mkdir(parents=True, exist_ok=True)
        shutil.copy(arg_3, arg_4)
    return arg_2


setauth sets the authentication header for use in the session.
        It is for use when apikey is updated or something of the sort, such that
        there is a seamless experience.

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = None if arg_1 is not None : if arg_2 is None : arg_2 = arg_1 arg_1 = "" arg_3 = HTTPBasicAuth ( arg_1 , arg_2 ) arg_0 . r . auth = arg_3 arg_0 . ws . Func ( arg_3 )

def Func(arg_0, arg_1=None, arg_2=None):
        """ Func sets the authentication header for use in the session.
        It is for use when apikey is updated or something of the sort, such that
        there is a seamless experience. """
        arg_3 = None
        if arg_1 is not None:
            # ConnectorDB allows login using both basic auth or an apikey url param.
            # The python client uses basic auth for all logins
            if arg_2 is None:
                # Login by api key - the basic auth login uses "" user and
                # apikey as password
                arg_2 = arg_1
                arg_1 = ""
            arg_3 = HTTPBasicAuth(arg_1, arg_2)
            arg_0.r.auth = arg_3

        # Set the websocket's authentication
        arg_0.ws.Func(arg_3)

setauth sets the authentication header for use in the session . It is for use when apikey is updated or something of the sort such that there is a seamless experience .


def Func(arg_0):
    """
    Convert names with underscores into camelcase.

    For example:
        "num_rows" => "numRows"
        "very_long_json_name" => "veryLongJsonName"
        "build_GBM_model" => "buildGbmModel"
        "KEY" => "key"
        "middle___underscores" => "middleUnderscores"
        "_exclude_fields" => "_excludeFields" (retain initial/trailing underscores)
        "__http_status__" => "__httpStatus__"

    :param name: name to be converted
    """
    arg_1 = arg_0.split("_")
    arg_2 = 0
    while arg_1[arg_2] == "":
        arg_1[arg_2] = "_"
        arg_2 += 1
    arg_1[arg_2] = arg_1[arg_2].lower()
    for arg_3 in range(arg_2 + 1, len(arg_1)):
        arg_1[arg_3] = arg_1[arg_3].capitalize()
    arg_2 = len(arg_1) - 1
    while arg_1[arg_2] == "":
        arg_1[arg_2] = "_"
        arg_2 -= 1
    return "".join(arg_1)

Convert names with underscores into camelcase .


def Func(arg_0, arg_1, arg_2):
        """create a diagram object
        """
        assert arg_2 not in arg_0._nodes
        arg_3 = DiagramEntity(arg_1, arg_2)
        arg_0._nodes[arg_2] = arg_3
        arg_0.objects.append(arg_3)


def Func(arg_0):
    """Wrap the agent's program to print its input and output. This will let
    you see what the agent is doing in the environment."""
    arg_1 = arg_0.program
    def new_program(arg_2):
        arg_3 = arg_1(arg_2)
        print '%s perceives %s and does %s' % (arg_0, arg_2, arg_3)
        return arg_3
    arg_0.program = new_program
    return arg_0

Wrap the agent s program to print its input and output . This will let you see what the agent is doing in the environment .


(self, model_fpath, position=1, file_id=None)

def Func(arg_0, arg_1, arg_2=1, arg_3=None):
        """Add a kappa model from a file at given path to the project."""
        if arg_3 is None:
            arg_3 = arg_0.make_unique_id('file_input')
        arg_4 = arg_0.file_create(File.from_file(arg_1, arg_2,
                                                   arg_3))
        return arg_4

Add a kappa model from a file at given path to the project .


(self, meta: ResourceDescription, raise_on_error=False)

def Func(arg_0, arg_1: arg_2, arg_3=False) -> BaseLoader:
        """
        Attempts to get a loader

        :param meta: The resource description instance
        :param raise_on_error: Raise ImproperlyConfigured if the loader cannot be resolved
        :returns: The requested loader class
        """
        for arg_4 in arg_0._loaders:
            if arg_4.name == arg_1.loader:
                return arg_4

        if arg_3:
            raise ImproperlyConfigured(
                "Resource has invalid loader '{}': {}\nAvailiable loaders: {}".format(
                    arg_1.loader, arg_1, [arg_4.name for arg_4 in arg_0._loaders]))


def Func ( arg_0 ) : assert len ( arg_0 . attrnames ) == len ( arg_0 . attrs ) assert arg_0 . target in arg_0 . attrs assert arg_0 . target not in arg_0 . inputs assert set ( arg_0 . inputs ) . issubset ( set ( arg_0 . attrs ) ) map ( arg_0 . check_example , arg_0 . examples )

def Func(arg_0):
        "Check that my fields make sense."
        assert len(arg_0.attrnames) == len(arg_0.attrs)
        assert arg_0.target in arg_0.attrs
        assert arg_0.target not in arg_0.inputs
        assert set(arg_0.inputs).issubset(set(arg_0.attrs))
        map(arg_0.check_example, arg_0.examples)


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
.
initialized
:
arg_2
=
confirm
(
parent
=
arg_1
.
ui
.
control
,
message
=
"Replace existing graph?"
,
title
=
"New Graph"
,
default
=
YES
)
if
arg_2
==
YES
:
arg_0
.
model
=
Graph
(
)

def Func(arg_0, arg_1):
        """ Handles the new Graph action. """

        if arg_1.initialized:
            arg_2 = confirm(parent  = arg_1.ui.control,
                             message = "Replace existing graph?",
                             title   = "New Graph",
                             default = YES)
            if arg_2 == YES:
                arg_0.model = Graph()


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
if
not
_is_pil_image
(
arg_0
)
:
raise
TypeError
(
'img should be PIL Image. Got {}'
.
format
(
type
(
arg_0
)
)
)
return
arg_0
.
Func
(
(
arg_2
,
arg_1
,
arg_2
+
arg_4
,
arg_1
+
arg_3
)
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Crop the given PIL Image.

    Args:
        img (PIL Image): Image to be Funcped.
        i (int): i in (i,j) i.e coordinates of the upper left corner.
        j (int): j in (i,j) i.e coordinates of the upper left corner.
        h (int): Height of the Funcped image.
        w (int): Width of the Funcped image.

    Returns:
        PIL Image: Cropped image.
    """
    if not _is_pil_image(arg_0):
        raise TypeError('img should be PIL Image. Got {}'.format(type(arg_0)))

    return arg_0.Func((arg_2, arg_1, arg_2 + arg_4, arg_1 + arg_3))

Crop the given PIL Image.

    Args:
        img (PIL Image): Image to be cropped.
        i (int): i in (i,j) i.e coordinates of the upper left corner.
        j (int): j in (i,j) i.e coordinates of the upper left corner.
        h (int): Height of the cropped image.
        w (int): Width of the cropped image.

    Returns:
        PIL Image: Cropped image.


def Func ( arg_0 ) : arg_1 = arg_0 . _tabbed_window . get_current_widget ( ) if hasattr ( arg_1 , 'get_menu_widget' ) : arg_2 = arg_1 . get_menu_widget ( arg_0 . _hide_menu ) arg_3 = urwid . Overlay ( arg_2 , arg_0 . _tabbed_window , align = 'center' , width = ( 'relative' , 80 ) , valign = 'middle' , height = ( 'relative' , 80 ) ) arg_0 . _urwid_loop . widget = arg_3

def Func(arg_0):
        """Show the overlay menu."""
        # If the current widget in the TabbedWindowWidget has a menu,
        # overlay it on the TabbedWindowWidget.
        arg_1 = arg_0._tabbed_window.get_current_widget()
        if hasattr(arg_1, 'get_menu_widget'):
            arg_2 = arg_1.get_menu_widget(arg_0._hide_menu)
            arg_3 = urwid.Overlay(arg_2, arg_0._tabbed_window,
                                    align='center', width=('relative', 80),
                                    valign='middle', height=('relative', 80))
            arg_0._urwid_loop.widget = arg_3


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
arg_3
=
BcryptConst
.
BCRYPT_PAD_PKCS1
if
arg_2
is
True
:
arg_3
=
BcryptConst
.
BCRYPT_PAD_OAEP
arg_4
=
struct
(
bcrypt
,
'BCRYPT_OAEP_PADDING_INFO'
)
arg_5
=
unwrap
(
arg_4
)
arg_6
=
buffer_from_unicode
(
BcryptConst
.
BCRYPT_SHA1_ALGORITHM
)
arg_5
.
pszAlgId
=
cast
(
bcrypt
,
'wchar_t *'
,
arg_6
)
arg_5
.
pbLabel
=
(
)
arg_5
.
cbLabel
=
0
arg_10
=
cast
(
bcrypt
,
'void *'
,
arg_4
)
else
:
arg_10
=
(
)
arg_11
=
new
(
bcrypt
,
'ULONG *'
)
arg_12
=
bcrypt
.
BCryptEncrypt
(
arg_0
.
key_handle
,
arg_1
,
len
(
arg_1
)
,
arg_10
,
(
)
,
0
,
(
)
,
0
,
arg_11
,
arg_3
)
handle_error
(
arg_12
)
arg_13
=
deref
(
arg_11
)
arg_14
=
buffer_from_bytes
(
arg_13
)
arg_12
=
bcrypt
.
BCryptEncrypt
(
arg_0
.
key_handle
,
arg_1
,
len
(
arg_1
)
,
arg_10
,
(
)
,
0
,
arg_14
,
arg_13
,
arg_11
,
arg_3
)
handle_error
(
arg_12
)
return
bytes_from_buffer
(
arg_14
,
deref
(
arg_11
)
)

def Func(arg_0, arg_1, arg_2=False):
    """
    Encrypts a value using an RSA public key via CNG

    :param certificate_or_public_key:
        A Certificate or PublicKey instance to encrypt with

    :param data:
        A byte string of the data to encrypt

    :param rsa_oaep_padding:
        If OAEP padding should be used instead of PKCS#1 v1.5

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the ciphertext
    """

    arg_3 = BcryptConst.BCRYPT_PAD_PKCS1
    if arg_2 is True:
        arg_3 = BcryptConst.BCRYPT_PAD_OAEP

        arg_4 = struct(bcrypt, 'BCRYPT_OAEP_PADDING_INFO')
        arg_5 = unwrap(arg_4)
        # This has to be assigned to a variable to prevent cffi from gc'ing it
        arg_6 = buffer_from_unicode(BcryptConst.BCRYPT_SHA1_ALGORITHM)
        arg_5.pszAlgId = cast(bcrypt, 'wchar_t *', arg_6)
        arg_5.pbLabel = null()
        arg_5.cbLabel = 0
        arg_10 = cast(bcrypt, 'void *', arg_4)
    else:
        arg_10 = null()

    arg_11 = new(bcrypt, 'ULONG *')
    arg_12 = bcrypt.BCryptEncrypt(
        arg_0.key_handle,
        arg_1,
        len(arg_1),
        arg_10,
        null(),
        0,
        null(),
        0,
        arg_11,
        arg_3
    )
    handle_error(arg_12)

    arg_13 = deref(arg_11)
    arg_14 = buffer_from_bytes(arg_13)

    arg_12 = bcrypt.BCryptEncrypt(
        arg_0.key_handle,
        arg_1,
        len(arg_1),
        arg_10,
        null(),
        0,
        arg_14,
        arg_13,
        arg_11,
        arg_3
    )
    handle_error(arg_12)

    return bytes_from_buffer(arg_14, deref(arg_11))


def Func(arg_0):
        """
        This function will be called after each iteration.
        """
        arg_0._counter += 1
        if arg_0._counter % arg_0._freq == 0:
            arg_1 = 0.
            arg_2 = defaultdict(float)
            for arg_3 in arg_0._trainer.get_data(arg_0._data_split):
                arg_4 = arg_0.run(arg_3)
                if not isinstance(arg_4, dict):
                    raise Exception("Monitor.run must return a dict.")
                for arg_5, arg_6 in arg_4.items():
                    arg_2[arg_5] += arg_6
                arg_1 += 1
            for arg_5 in arg_2:
                arg_2[arg_5] /= arg_1
            arg_7 = arg_0.compare(arg_2)
            arg_0._trainer.report(arg_2, arg_0._data_split, arg_7=arg_7)
            if arg_7:
                arg_0._trainer.save_checkpoint(arg_0._save_path)

This function will be called after each iteration .


def Func(arg_0):
    """Starts a pool single run and passes the storage service"""
    arg_1 = arg_0['wrap_mode']
    arg_2 = arg_0['traj']
    arg_2.v_storage_service = Func.storage_service
    if arg_1 == pypetconstants.WRAP_MODE_LOCAL:
        # Free references from previous runs
        arg_2.v_storage_service.free_references()
    return _sigint_handling_single_run(arg_0)


def Func(arg_0):
        """
        Returns the row the view is displaying.

        You may want to override this if you need to provide non-standard
        queryset lookups.  Eg if objects are referenced using multiple
        keyword arguments in the url conf.
        """
        arg_1 = arg_0.filter_dataframe(arg_0.get_dataframe())

        assert arg_0.lookup_url_kwarg in arg_0.kwargs, (
            'Expected view %s to be called with a URL keyword argument '
            'named "%s". Fix your URL conf, or set the `.lookup_field` '
            'attribute on the view correctly.' %
            (arg_0.__class__.__name__, arg_0.lookup_url_kwarg)
        )

        try:
            arg_2 = arg_0.index_row(arg_1)
        except (IndexError, KeyError, ValueError):
            raise Http404

        # May raise a permission denied
        arg_0.check_object_permissions(arg_0.request, arg_2)

        return arg_2

Returns the row the view is displaying .


(self, gc, view_bounds=None, mode="default")

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = "default" ) : arg_1 . save_state ( ) try : if len ( arg_0 . points ) >= 2 : arg_1 . set_fill_color ( arg_0 . pen . fill_color_ ) arg_1 . set_stroke_color ( arg_0 . pen . color_ ) arg_1 . set_line_width ( arg_0 . pen . line_width ) arg_1 . begin_path ( ) arg_1 . lines ( arg_0 . points ) arg_1 . close_path ( ) if arg_0 . filled : arg_1 . draw_path ( arg_0 . inside_rule_ ) else : arg_1 . stroke_path ( ) finally : arg_1 . restore_state ( )

def Func(arg_0, arg_1, arg_2=None, arg_3="default"):
        """ Draws a closed polygon """

        arg_1.save_state()
        try:
#            self._draw_bounds(gc)
            if len(arg_0.points) >= 2:
                # Set the drawing parameters.
                arg_1.set_fill_color(arg_0.pen.fill_color_)
                arg_1.set_stroke_color(arg_0.pen.color_)
                arg_1.set_line_width(arg_0.pen.line_width)

                # Draw the path.
                arg_1.begin_path()
#                x0 = self.points[0][0] - self.x
#                y0 = self.points[0][1] + self.y
#                gc.move_to(x0, y0)
#                offset_points = [(x-self.x, y+self.y) for x, y in self.points]
                arg_1.lines(arg_0.points)

                arg_1.close_path()
                if arg_0.filled:
                    arg_1.draw_path(arg_0.inside_rule_)
                else:
                    arg_1.stroke_path()
        finally:
            arg_1.restore_state()


def Func(arg_0, arg_1):  # pragma: no cover
    '''Backtrack optimal warping path.

    Uses the saved step sizes from the cost accumulation
    step to backtrack the index pairs for an optimal
    warping path.

    Parameters
    ----------
    D_steps : np.ndarray [shape=(N, M)]
        Saved indices of the used steps used in the calculation of D.

    step_sizes_sigma : np.ndarray [shape=[n, 2]]
        Specifies allowed step sizes as used by the dtw.

    Returns
    -------
    wp : list [shape=(N,)]
        Warping path with index pairs.
        Each list entry contains an index pair
        (n,m) as a tuple

    See Also
    --------
    dtw
    '''
    arg_2 = []
    # Set starting point D(N,M) and append it to the path
    arg_3 = (arg_0.shape[0] - 1, arg_0.shape[1] - 1)
    arg_2.append((arg_3[0], arg_3[1]))

    # Loop backwards.
    # Stop criteria:
    # Setting it to (0, 0) does not work for the subsequence dtw,
    # so we only ask to reach the first row of the matrix.
    while arg_3[0] > 0:
        arg_4 = arg_0[(arg_3[0], arg_3[1])]

        # save tuple with minimal acc. cost in path
        arg_3 = (arg_3[0] - arg_1[arg_4][0],
                   arg_3[1] - arg_1[arg_4][1])

        # append to warping path
        arg_2.append((arg_3[0], arg_3[1]))

    return arg_2


return self._constructor(rdd, rekeyed=rekeyed, shape=shape, split=split).__finalize__(self)

def Func(arg_0, arg_1):
        """
        Apply a function on each subarray.

        Parameters
        ----------
        func : function
             This is applied to each value in the intermediate RDD.

        Returns
        -------
        StackedArray
        """
        arg_2 = arg_0.shape[arg_0.split:]
        arg_3 = arg_0._rdd.values().first()
        if arg_3.shape == arg_2:
            arg_4, arg_5 = asarray([arg_3]), asarray([arg_3, arg_3])
        else:
            arg_4, arg_5 = arg_3, concatenate((arg_3, arg_3))

        try:
            arg_6 = arg_1(arg_4)
            arg_7 = arg_1(arg_5)
        except Exception as e:
            raise RuntimeError("Error evaluating function on test array, got error:\n %s" % e)

        if not (isinstance(arg_6, ndarray) and isinstance(arg_7, ndarray)):
            raise ValueError("Function must return ndarray")

        # different shapes Func to the same new shape
        elif arg_6.shape == arg_7.shape:
            if arg_0._rekeyed is True:
                # we've already rekeyed
                arg_8 = arg_0._rdd.Func(lambda kv: (kv[0], arg_1(kv[1])))
                arg_9 = (arg_0.shape[0],) + arg_6.shape
            else:
                # do the rekeying
                arg_10, arg_8 = zip_with_index(arg_0._rdd.values())
                arg_8 = arg_8.Func(lambda kv: ((kv[1],), arg_1(kv[0])))
                arg_9 = (arg_10,) + arg_6.shape
            arg_11 = 1
            arg_12 = True

        # different shapes stay different (along the first dimension)
        elif arg_6.shape[0] == arg_4.shape[0] and arg_7.shape[0] == arg_5.shape[0]:
            arg_9 = arg_0.shape[0:arg_0.split] + arg_6.shape[1:]
            arg_11 = arg_0.split
            arg_8 = arg_0._rdd.Func(lambda kv: (kv[0], arg_1(kv[1])))
            arg_12 = arg_0._rekeyed

        else:
            raise ValueError("Cannot infer effect of function on shape")

        return arg_0._constructor(arg_8, arg_12=arg_12, arg_9=arg_9, arg_11=arg_11).__finalize__(arg_0)


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if isinstance ( arg_2 , Workspace ) : arg_2 = [ arg_2 ] elif isinstance ( arg_2 , list ) and [ arg_3 for arg_3 in arg_2 if isinstance ( arg_3 , Workspace ) ] : pass else : arg_2 = arg_0 . get_workspaces ( arg_1 = arg_2 ) arg_4 = [ ] for arg_5 in arg_2 : arg_6 = arg_0 . get_xml ( arg_5 . datastore_url ) arg_7 = arg_0 . get_xml ( arg_5 . coveragestore_url ) arg_8 = arg_0 . get_xml ( arg_5 . wmsstore_url ) arg_4 . extend ( [ datastore_from_index ( arg_0 , arg_5 , arg_9 ) for arg_9 in arg_6 . findall ( "dataStore" ) ] ) arg_4 . extend ( [ coveragestore_from_index ( arg_0 , arg_5 , arg_9 ) for arg_9 in arg_7 . findall ( "coverageStore" ) ] ) arg_4 . extend ( [ wmsstore_from_index ( arg_0 , arg_5 , arg_9 ) for arg_9 in arg_8 . findall ( "wmsStore" ) ] ) if arg_1 is None : arg_1 = [ ] elif isinstance ( arg_1 , basestring ) : arg_1 = [ s . strip ( ) for s in arg_1 . split ( ',' ) if s . strip ( ) ] if arg_4 and arg_1 : return ( [ arg_10 for arg_10 in arg_4 if arg_10 . name in arg_1 ] ) return arg_4

def Func(arg_0, arg_1=None, arg_2=None):
        '''
          Returns a list of stores in the catalog. If workspaces is specified will only return stores in those workspaces.
          If names is specified, will only return stores that match.
          names can either be a comma delimited string or an array.
          Will return an empty list if no stores are found.
        '''

        if isinstance(arg_2, Workspace):
            arg_2 = [arg_2]
        elif isinstance(arg_2, list) and [arg_3 for arg_3 in arg_2 if isinstance(arg_3, Workspace)]:
            # nothing
            pass
        else:
            arg_2 = arg_0.get_workspaces(arg_1=arg_2)

        arg_4 = []
        for arg_5 in arg_2:
            arg_6 = arg_0.get_xml(arg_5.datastore_url)
            arg_7 = arg_0.get_xml(arg_5.coveragestore_url)
            arg_8 = arg_0.get_xml(arg_5.wmsstore_url)
            arg_4.extend([datastore_from_index(arg_0, arg_5, arg_9) for arg_9 in arg_6.findall("dataStore")])
            arg_4.extend([coveragestore_from_index(arg_0, arg_5, arg_9) for arg_9 in arg_7.findall("coverageStore")])
            arg_4.extend([wmsstore_from_index(arg_0, arg_5, arg_9) for arg_9 in arg_8.findall("wmsStore")])

        if arg_1 is None:
            arg_1 = []
        elif isinstance(arg_1, basestring):
            arg_1 = [s.strip() for s in arg_1.split(',') if s.strip()]

        if arg_4 and arg_1:
            return ([arg_10 for arg_10 in arg_4 if arg_10.name in arg_1])

        return arg_4

Returns a list of stores in the catalog . If workspaces is specified will only return stores in those workspaces . If names is specified will only return stores that match . names can either be a comma delimited string or an array . Will return an empty list if no stores are found .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_1
.
startswith
(
u"{"
)
:
arg_3
,
arg_1
=
arg_1
[
1
:
]
.
split
(
u"}"
,
1
)
if
arg_3
in
STANZA_NAMESPACES
:
arg_3
=
arg_0
.
stanza_namespace
elif
arg_2
:
raise
ValueError
(
u"Element with no namespace: {0!r}"
.
format
(
arg_1
)
)
else
:
arg_3
=
return
arg_3
,
arg_1

def Func(arg_0, arg_1, arg_2):
        """Split an element of attribute qname into namespace and local
        name.

        :Parameters:
            - `name`: element or attribute QName
            - `is_element`: `True` for an element, `False` for an attribute
        :Types:
            - `name`: `unicode`
            - `is_element`: `bool`

        :Return: namespace URI, local name
        :returntype: `unicode`, `unicode`"""
        if arg_1.startswith(u"{"):
            arg_3, arg_1 = arg_1[1:].split(u"}", 1)
            if arg_3 in STANZA_NAMESPACES:
                arg_3 = arg_0.stanza_namespace
        elif arg_2:
            raise ValueError(u"Element with no namespace: {0!r}".format(arg_1))
        else:
            arg_3 = None
        return arg_3, arg_1

Split an element of attribute qname into namespace and local name .


def Func(arg_0, arg_1):
    """
    Serialize the list of tokens into a list of text chunks, calling
    markup_func around text to add annotations.
    """
    for arg_2 in arg_0:
        for arg_3 in arg_2.pre_tags:
            yield arg_3
        arg_4 = arg_2.html()
        arg_4 = arg_1(arg_4, arg_2.annotation)
        if arg_2.trailing_whitespace:
            arg_4 += arg_2.trailing_whitespace
        yield arg_4
        for arg_5 in arg_2.post_tags:
            yield arg_5

Serialize the list of tokens into a list of text chunks calling markup_func around text to add annotations .


(self, data: Union[list, tuple],
                         return_indexes: bool = False)

def Func ( arg_0 , arg_1 : arg_2 [ arg_3 , arg_4 ] , arg_5 : arg_6 = False ) -> List [ List [ str ] ] : arg_7 = arg_0 . _transform_batch ( arg_1 ) arg_8 , arg_9 = len ( arg_7 [ 0 ] ) , [ len ( arg_14 ) for arg_14 in arg_1 [ 0 ] ] arg_10 = arg_0 . model_ . Func ( arg_7 ) arg_11 = np . argmax ( arg_10 , axis = - 1 ) arg_12 : List [ List [ str ] ] = [ None ] * arg_8 for arg_13 , ( arg_14 , arg_15 ) in enumerate ( zip ( arg_11 , arg_9 ) ) : arg_14 = arg_14 [ : arg_15 ] arg_12 [ arg_13 ] = arg_14 if arg_5 else arg_0 . tags . idxs2toks ( arg_14 ) return arg_12

def Func(arg_0, arg_1: arg_2[arg_3, arg_4],
                         arg_5: arg_6 = False) -> List[List[str]]:
        """
        Makes predictions on a single batch

        Args:
            data: a batch of word sequences together with additional inputs
            return_indexes: whether to return tag indexes in vocabulary or tags themselves

        Returns:
            a batch of label sequences
        """
        arg_7 = arg_0._transform_batch(arg_1)
        arg_8, arg_9 = len(arg_7[0]), [len(arg_14) for arg_14 in arg_1[0]]
        arg_10 = arg_0.model_.Func(arg_7)
        arg_11 = np.argmax(arg_10, axis=-1)
        arg_12: List[List[str]] = [None] * arg_8
        for arg_13, (arg_14, arg_15) in enumerate(zip(arg_11, arg_9)):
            arg_14 = arg_14[:arg_15]
            arg_12[arg_13] = arg_14 if arg_5 else arg_0.tags.idxs2toks(arg_14)
        return arg_12


(self, image, color=(0, 255, 0), alpha=1.0, size=3,
                      copy=True, raise_if_out_of_image=False)

def Func(arg_0, arg_1, arg_2=(0, 255, 0), arg_3=1.0, arg_4=3,
                      arg_5=True, arg_6=False):
        """
        Draw the keypoint onto a given image.

        The keypoint is drawn as a square.

        Parameters
        ----------
        image : (H,W,3) ndarray
            The image onto which to draw the keypoint.

        color : int or list of int or tuple of int or (3,) ndarray, optional
            The RGB color of the keypoint. If a single int ``C``, then that is
            equivalent to ``(C,C,C)``.

        alpha : float, optional
            The opacity of the drawn keypoint, where ``1.0`` denotes a fully
            visible keypoint and ``0.0`` an invisible one.

        size : int, optional
            The size of the keypoint. If set to ``S``, each square will have
            size ``S x S``.

        copy : bool, optional
            Whether to copy the image before drawing the keypoint.

        raise_if_out_of_image : bool, optional
            Whether to raise an exception if the keypoint is outside of the
            image.

        Returns
        -------
        image : (H,W,3) ndarray
            Image with drawn keypoint.

        """
        if arg_5:
            arg_1 = np.copy(arg_1)

        if arg_1.ndim == 2:
            assert ia.is_single_number(arg_2), (
                "Got a 2D image. Expected then 'color' to be a single number, "
                "but got %s." % (str(arg_2),))
        elif arg_1.ndim == 3 and ia.is_single_number(arg_2):
            arg_2 = [arg_2] * arg_1.shape[-1]

        arg_7 = arg_1.dtype
        arg_8 = arg_2
        if arg_3 < 0.01:
            # keypoint invisible, nothing to do
            return arg_1
        elif arg_3 > 0.99:
            arg_3 = 1
        else:
            arg_1 = arg_1.astype(np.float32, arg_5=False)
            arg_8 = arg_3 * np.array(arg_2)

        arg_9, arg_10 = arg_1.shape[0:2]

        arg_11, arg_12 = arg_0.y_int, arg_0.x_int

        arg_13 = max(arg_12 - arg_4//2, 0)
        arg_14 = min(arg_12 + 1 + arg_4//2, arg_10)
        arg_15 = max(arg_11 - arg_4//2, 0)
        arg_16 = min(arg_11 + 1 + arg_4//2, arg_9)

        arg_17, arg_18 = np.clip([arg_13, arg_14], 0, arg_10)
        arg_19, arg_20 = np.clip([arg_15, arg_16], 0, arg_9)

        arg_21 = (arg_17 < 0 or arg_17 >= arg_10)
        arg_22 = (arg_18 < 0 or arg_18 >= arg_10+1)
        arg_23 = (arg_19 < 0 or arg_19 >= arg_9)
        arg_24 = (arg_20 < 0 or arg_20 >= arg_9+1)
        arg_25 = (arg_21 and arg_22)
        arg_26 = (arg_23 and arg_24)
        arg_27 = (arg_18 - arg_17) < 1  # min size is 1px
        arg_28 = (arg_20 - arg_19) < 1
        if not arg_25 and not arg_26 and not arg_27 and not arg_28:
            if arg_3 == 1:
                arg_1[arg_19:arg_20, arg_17:arg_18] = arg_2
            else:
                arg_1[arg_19:arg_20, arg_17:arg_18] = (
                        (1 - arg_3)
                        * arg_1[arg_19:arg_20, arg_17:arg_18]
                        + arg_8
                )
        else:
            if arg_6:
                raise Exception(
                    "Cannot draw keypoint x=%.8f, y=%.8f on image with "
                    "shape %s." % (arg_11, arg_12, arg_1.shape))

        if arg_1.dtype.name != arg_7.name:
            if arg_7.name == "uint8":
                arg_1 = np.clip(arg_1, 0, 255, out=arg_1)
            arg_1 = arg_1.astype(arg_7, arg_5=False)
        return arg_1


def Func ( arg_0 , arg_1 ) : if not arg_1 : return None arg_2 = copy . deepcopy ( arg_1 ) if arg_0 . archive_path : arg_2 [ 'archive_path' ] = arg_0 . archive_path else : arg_2 [ 'archive_path' ] = os . path . expanduser ( ARCHIVES_DEFAULT_PATH ) return ArchivingTaskConfig . from_dict ( arg_2 )

def Func(arg_0, arg_1):
        """Parse the archive arguments of a task"""

        if not arg_1:
            return None

        arg_2 = copy.deepcopy(arg_1)

        if arg_0.archive_path:
            arg_2['archive_path'] = arg_0.archive_path
        else:
            arg_2['archive_path'] = os.path.expanduser(ARCHIVES_DEFAULT_PATH)

        return ArchivingTaskConfig.from_dict(arg_2)


def Func ( arg_0 , arg_1 ) : arg_2 = more_itertools . chunked ( arg_1 , arg_0 ) if isinstance ( arg_1 , six . string_types ) : arg_2 = ( '' . join ( item ) for item in arg_2 ) return arg_2

def Func(arg_0, arg_1):
	"""
	Take a sequence and break it up into chunks of the specified size.
	The last chunk may be smaller than size.

	This works very similar to grouper_nofill, except
	it works with strings as well.

	>>> tuple(Func(3, 'foobarbaz'))
	('foo', 'bar', 'baz')

	You can still use it on non-strings too if you like.

	>>> tuple(Func(42, []))
	()

	>>> tuple(Func(3, list(range(10))))
	([0, 1, 2], [3, 4, 5], [6, 7, 8], [9])
	"""
	arg_2 = more_itertools.chunked(arg_1, arg_0)
	if isinstance(arg_1, six.string_types):
		arg_2 = (''.join(item) for item in arg_2)
	return arg_2

Take a sequence and break it up into chunks of the specified size.
	The last chunk may be smaller than size.

	This works very similar to grouper_nofill, except
	it works with strings as well.

	>>> tuple(grouper_nofill_str(3, 'foobarbaz'))
	('foo', 'bar', 'baz')

	You can still use it on non-strings too if you like.

	>>> tuple(grouper_nofill_str(42, []))
	()

	>>> tuple(grouper_nofill_str(3, list(range(10))))
	([0, 1, 2], [3, 4, 5], [6, 7, 8], [9])

Take a sequence and break it up into chunks of the specified size . The last chunk may be smaller than size .


def Func(arg_0, arg_1, arg_2):
  """If input points to ) or } or ] or >, finds the position that opens it.

  If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
  linenum/pos that correspond to the opening of the expression.

  Args:
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    pos: A position on the line.

  Returns:
    A tuple (line, linenum, pos) pointer *at* the opening brace, or
    (line, 0, -1) if we never find the matching opening brace.  Note
    we ignore strings and comments when matching; and the line we
    return is the 'cleansed' line at linenum.
  """
  arg_3 = arg_0.elided[arg_1]
  if arg_3[arg_2] not in ')}]>':
    return (arg_3, 0, -1)

  # Check last line
  (arg_4, arg_5) = FindStartOfExpressionInLine(arg_3, arg_2, [])
  if arg_4 > -1:
    return (arg_3, arg_1, arg_4)

  # Continue scanning backward
  while arg_5 and arg_1 > 0:
    arg_1 -= 1
    arg_3 = arg_0.elided[arg_1]
    (arg_4, arg_5) = FindStartOfExpressionInLine(arg_3, len(arg_3) - 1, arg_5)
    if arg_4 > -1:
      return (arg_3, arg_1, arg_4)

  # Did not find start of expression before beginning of file, give up
  return (arg_3, 0, -1)

If input points to ) or } or ] or > finds the position that opens it .


def Func ( arg_0 , arg_1 ) : check_type ( arg_1 , basestring , may_be_none = False ) arg_0 . _session . Func ( API_ENDPOINT + '/' + arg_1 )

def Func(arg_0, arg_1):
        """Remove a person from the system.

        Only an admin can remove a person.

        Args:
            personId(basestring): The ID of the person to be Funcd.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.

        """
        check_type(arg_1, basestring, may_be_none=False)

        # API request
        arg_0._session.Func(API_ENDPOINT + '/' + arg_1)

Remove a person from the system.

        Only an admin can remove a person.

        Args:
            personId(basestring): The ID of the person to be deleted.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


def Func(arg_0, arg_1=None, arg_2=False):
    '''
    Create a pyxtuml meta model from a BridgePoint model.
    Optionally, restrict to classes and associations contained in the
    component c_c.
    '''
    arg_3 = Domain()

    arg_4 = lambda sel: arg_1 is None or is_contained_in(sel, arg_1)

    for arg_5 in arg_0.select_many('O_OBJ', arg_4):
        mk_class(arg_3, arg_5, arg_2)

    for arg_6 in arg_0.select_many('R_REL', arg_4):
        mk_association(arg_3, arg_6)

    for arg_7 in arg_0.select_many('S_SYNC', arg_4):
        arg_8 = mk_function(arg_3, arg_7)
        arg_3.add_symbol(arg_7.Name, arg_8)

    for arg_9 in arg_0.select_many('S_DT', arg_4):
        arg_10 = one(arg_9).S_EDT[17]()
        if arg_10:
            arg_11 = mk_enum(arg_10)
            arg_3.add_symbol(arg_9.Name, arg_11)

    for arg_12 in arg_0.select_many('CNST_CSP', arg_4):
        for arg_13 in many(arg_12).CNST_SYC[1504]():
            arg_14 = mk_constant(arg_13)
            arg_3.add_symbol(arg_13.Name, arg_14)

    for arg_15 in arg_3.associations:
        arg_15.formalize()

    for arg_16 in arg_0.select_many('S_EE', arg_4):
        if arg_16.Key_Lett in ['LOG', 'ARCH', 'TIM', 'NVS', 'PERSIST']:
            arg_3.add_symbol(arg_16.Key_Lett, getattr(builtin_ee, arg_16.Key_Lett))

        else:
            arg_17 = mk_external_entity(arg_3, arg_16)
            arg_3.add_symbol(arg_16.Key_Lett, arg_17)

    return arg_3

Create a pyxtuml meta model from a BridgePoint model . Optionally restrict to classes and associations contained in the component c_c .


(seqs, f=None, start=None, key=lambda x: x)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=lambda arg_4: arg_4):
    """Floyd's Cycle Detector.

    See help(cycle_detector) for more context.

    Args:

      *args: Two iterators issueing the exact same sequence:
      -or-
      f, start: Function and starting state for finite state machine

    Yields:

      Values yielded by sequence_a if it terminates, undefined if a
      cycle is found.

    Raises:

      CycleFound if exception is found; if called with f and `start`,
      the parametres `first` and `period` will be defined indicating
      the offset of start of the cycle and the cycle's period.
    """

    arg_5, arg_6 = arg_0

    yield arg_6.next()
    arg_7 = arg_5.next()
    arg_8 = arg_6.next()
    while arg_8 != arg_7:
        yield arg_8
        yield arg_6.next()
        arg_8 = arg_6.next()
        arg_7 = arg_5.next()

    if arg_1 is None:
        raise CycleDetected()

    arg_8 = arg_1(arg_8)
    arg_9 = 0
    arg_7 = arg_2
    while arg_3(arg_7) != arg_3(arg_8):
        arg_7 = arg_1(arg_7)
        arg_8 = arg_1(arg_8)
        arg_9 += 1

    arg_10 = 1
    arg_8 = arg_1(arg_7)
    while arg_3(arg_7) != arg_3(arg_8):
        arg_8 = arg_1(arg_8)
        arg_10 += 1

    raise CycleDetected(arg_10=arg_10, arg_9=arg_9)


def Func ( arg_0 , arg_1 = 200 , arg_2 = None ) : arg_2 = tf . compat . v1 . train . AdamOptimizer ( 0.1 ) if arg_2 is None else arg_2 def train_loop_body ( arg_3 ) : arg_4 = arg_2 . minimize ( arg_0 if tf . executing_eagerly ( ) else arg_0 ( ) ) return tf . tuple ( tensors = [ tf . add ( arg_3 , 1 ) ] , control_inputs = [ arg_4 ] ) arg_5 = tf . compat . v1 . while_loop ( cond = lambda arg_3 : arg_3 < arg_1 , body = train_loop_body , loop_vars = [ tf . constant ( 0 ) ] , return_same_structure = True ) [ 0 ] return arg_5

def Func(arg_0, arg_1=200, arg_2=None):
  """Run an optimizer within the graph to minimize a loss function."""
  arg_2 = tf.compat.v1.train.AdamOptimizer(
      0.1) if arg_2 is None else arg_2

  def train_loop_body(arg_3):
    arg_4 = arg_2.minimize(
        arg_0 if tf.executing_eagerly() else arg_0())
    return tf.tuple(tensors=[tf.add(arg_3, 1)], control_inputs=[arg_4])

  arg_5 = tf.compat.v1.while_loop(
      cond=lambda arg_3: arg_3 < arg_1,
      body=train_loop_body,
      loop_vars=[tf.constant(0)],
      return_same_structure=True)[0]  # Always return a single op.
  return arg_5

Run an optimizer within the graph to minimize a loss function .


def
Func
(
arg_0
=
True
)
:
arg_1
=
MANAGER
if
arg_0
:
arg_2
=
'Func'
else
:
arg_2
=
'dist-Func'
run_as_root
(
"%(manager)s --assume-yes %(cmd)s"
%
locals
(
)
,
pty
=
False
)

def Func(arg_0=True):
    """
    Upgrade all packages.
    """
    arg_1 = MANAGER
    if arg_0:
        arg_2 = 'Func'
    else:
        arg_2 = 'dist-Func'
    run_as_root("%(manager)s --assume-yes %(cmd)s" % locals(), pty=False)


def Func ( arg_0 , arg_1 ) : if arg_0 . curframe : arg_2 = arg_0 . curframe . f_globals arg_3 = arg_0 . curframe . f_locals else : arg_2 = globals ( ) arg_3 = locals ( ) pass try : arg_4 = int ( eval ( arg_1 , arg_2 , arg_3 ) ) except ( SyntaxError , NameError , ValueError , TypeError ) : return None return arg_4

def Func(arg_0, arg_1):
        """Eval arg and it is an integer return the value. Otherwise
        return None"""
        if arg_0.curframe:
            arg_2 = arg_0.curframe.f_globals
            arg_3 = arg_0.curframe.f_locals
        else:
            arg_2 = globals()
            arg_3 = locals()
            pass
        try:
            arg_4 = int(eval(arg_1, arg_2, arg_3))
        except (SyntaxError, NameError, ValueError, TypeError):
            return None
        return arg_4

Eval arg and it is an integer return the value . Otherwise return None


def Func ( arg_0 ) : arg_1 = arg_0 . get ( '' ) if "_links" in arg_1 : arg_2 = arg_1 [ "_links" ] if "child" in arg_2 : return arg_2 [ "child" ] return { }

def Func(arg_0):
        """
        Connect to alignak backend and retrieve all available child endpoints of root

        If connection is successful, returns a list of all the resources available in the backend:
        Each resource is identified with its title and provides its endpoint relative to backend
        root endpoint.::

            [
                {u'href': u'loghost', u'title': u'loghost'},
                {u'href': u'escalation', u'title': u'escalation'},
                ...
            ]

        If an error occurs a BackendException is raised.

        If an exception occurs, it is raised to caller.

        :return: list of available resources
        :rtype: list
        """

        arg_1 = arg_0.get('')
        if "_links" in arg_1:
            arg_2 = arg_1["_links"]
            if "child" in arg_2:
                return arg_2["child"]

        return {}


def Func(arg_0, arg_1):
    """Delete the `role_based_access_control` switch."""
    arg_2 = arg_0.get_model('waffle', 'Switch')
    arg_2.objects.filter(name=ENTERPRISE_ROLE_BASED_ACCESS_CONTROL_SWITCH).delete()

Delete the role_based_access_control switch .


def Func(arg_0):
    """
    Attempts to add information from the lambda context if it exists
    """
    global arg_3
    arg_1 = arg_3
    if arg_1 is None:
        return
    try:
        arg_2 = {
            'lambda': {
                'remaining_time_in_millis': arg_1.get_remaining_time_in_millis(),
                'function_name': arg_1.function_name,
                'function_version': arg_1.function_version,
                'arn': arg_1.invoked_function_arn,
                'request_id': arg_1.aws_request_id,
            }
        }
        if 'custom' in arg_0:
            arg_0['custom'] = dict_merge(arg_0['custom'], arg_2)
        else:
            arg_0['custom'] = arg_2
    except Exception as e:
        log.exception("Exception while adding lambda context data: %r", e)
    finally:
        arg_3 = None


def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_1 . sendRandKey : arg_1 . sendRandKey = arg_2 arg_1 . send ( arg_0 . _selfNode . address ) arg_4 = arg_0 . _connToNode ( arg_1 ) arg_1 . setOnMessageReceivedCallback ( functools . partial ( arg_0 . _onMessageReceived , arg_4 ) ) arg_0 . _onNodeConnected ( arg_4 )

def Func(arg_0, arg_1, arg_2):
        """
        Callback for receiving a message on a new outgoing connection. Used only if encryption is enabled to exchange the random keys.
        Once the key exchange is done, this triggers the onNodeConnected callback, and further messages are deferred to the onMessageReceived callback.

        :param conn: connection object
        :type conn: TcpConnection
        :param message: received message
        :type message: any
        """

        if not arg_1.sendRandKey:
            arg_1.sendRandKey = arg_2
            arg_1.send(arg_0._selfNode.address)

        arg_4 = arg_0._connToNode(arg_1)
        arg_1.setOnMessageReceivedCallback(functools.partial(arg_0._onMessageReceived, arg_4))
        arg_0._onNodeConnected(arg_4)

Callback for receiving a message on a new outgoing connection . Used only if encryption is enabled to exchange the random keys . Once the key exchange is done this triggers the onNodeConnected callback and further messages are deferred to the onMessageReceived callback .


return word[-suffix_len - 2 : -suffix_len] == 'dr' or (
            word[-suffix_len - 1] == 't'
            and word[-suffix_len - 2 : -suffix_len] != 'tt'
        )

def Func(arg_0, arg_1, arg_2):
        """Return Lovins' condition S.

        Parameters
        ----------
        word : str
            Word to check
        suffix_len : int
            Suffix length

        Returns
        -------
        bool
            True if condition is met

        """
        return arg_1[-arg_2 - 2 : -arg_2] == 'dr' or (
            arg_1[-arg_2 - 1] == 't'
            and arg_1[-arg_2 - 2 : -arg_2] != 'tt'
        )


(
            self, image=None, label=None, strict=True, return_details=False)

def Func(
            arg_0, arg_1=None, arg_2=None, arg_3=True, arg_4=False):
        """Interface to model.Func for attacks.

        Parameters
        ----------
        image : `numpy.ndarray`
            Single input with shape as expected by the model
            (without the batch dimension).
            Defaults to the original image.
        label : int
            Label used to calculate the loss that is differentiated.
            Defaults to the original label.
        strict : bool
            Controls if the bounds for the pixel values should be checked.

        """
        assert arg_0.has_gradient()

        if arg_1 is None:
            arg_1 = arg_0.__original_image
        if arg_2 is None:
            arg_2 = arg_0.__original_class

        arg_5 = arg_0.in_bounds(arg_1)
        assert not arg_3 or arg_5

        arg_0._total_prediction_calls += 1
        arg_0._total_gradient_calls += 1
        arg_6, arg_7 = arg_0.__model.Func(arg_1, arg_2)  # noqa: E501
        arg_8, arg_9, arg_10 = arg_0.__is_adversarial(
            arg_1, arg_6, arg_5)

        assert arg_6.ndim == 1
        assert arg_7.shape == arg_1.shape
        if arg_4:
            return arg_6, arg_7, arg_8, arg_9, arg_10
        else:
            return arg_6, arg_7, arg_8

Interface to model.predictions_and_gradient for attacks.

        Parameters
        ----------
        image : `numpy.ndarray`
            Single input with shape as expected by the model
            (without the batch dimension).
            Defaults to the original image.
        label : int
            Label used to calculate the loss that is differentiated.
            Defaults to the original label.
        strict : bool
            Controls if the bounds for the pixel values should be checked.

Interface to model . predictions_and_gradient for attacks .


def Func(arg_0):
        """
        Return a cosmos db client.
        """
        if arg_0.cosmos_client is not None:
            return arg_0.cosmos_client

        # Initialize the Python Azure Cosmos DB client
        arg_0.cosmos_client = arg_1.CosmosClient(arg_0.endpoint_uri, {'masterKey': arg_0.master_key})

        return arg_0.cosmos_client


def Func(arg_0, arg_1, arg_2=None):
    """ Comments last user_id's medias """
    if not arg_0.check_user(arg_1, filter_closed_acc=True):
        return False
    arg_0.logger.info("Going to comment user_%s's feed:" % arg_1)
    arg_1 = arg_0.convert_to_user_id(arg_1)
    arg_3 = arg_0.get_user_medias(arg_1, is_comment=True)
    if not arg_3:
        arg_0.logger.info(
            "None medias received: account is closed or medias have been filtered.")
        return False
    return arg_0.comment_medias(arg_3[:arg_2])