return Polygon(
        LinearRing([
            p
            # pick polygon linestrings
            for l in map(
                lambda x: LineString([x[0], x[1]]),
                zip(geometry.exterior.coords[:-1], geometry.exterior.coords[1:])
            )
            # interpolate additional points in between and don't forget end point
            for p in [
                l.interpolate(segmentize_value * i).coords[0]
                for i in range(int(l.length / segmentize_value))
            ] + [l.coords[1]]
        ])
    )

def Func(arg_0, arg_1):
    """
    Segmentize Polygon outer ring by segmentize value.

    Just Polygon geometry type supported.

    Parameters
    ----------
    geometry : ``shapely.geometry``
    segmentize_value: float

    Returns
    -------
    geometry : ``shapely.geometry``
    """
    if arg_0.geom_type != "Polygon":
        raise TypeError("segmentize geometry type must be Polygon")

    return Polygon(
        LinearRing([
            arg_3
            # pick polygon linestrings
            for arg_2 in map(
                lambda x: LineString([x[0], x[1]]),
                zip(arg_0.exterior.coords[:-1], arg_0.exterior.coords[1:])
            )
            # interpolate additional points in between and don't forget end point
            for arg_3 in [
                arg_2.interpolate(arg_1 * arg_4).coords[0]
                for arg_4 in range(int(arg_2.length / arg_1))
            ] + [arg_2.coords[1]]
        ])
    )

Segmentize Polygon outer ring by segmentize value .


def
Func
(
arg_0
)
:
if
arg_0
.
_is_Func
:
raise
exceptions
.
ClientConnectionFailure
(
"client connection already Func"
)
else
:
try
:
arg_0
.
proxy
.
Func
(
)
arg_0
.
_is_Func
=
True
except
Exception
as
e
:
arg_0
.
logger
.
error
(
"could not Func client connection: %s"
,
e
)
raise

def Func(arg_0):
        """
        Open the client connection.

        Raises:
            ClientConnectionFailure: if the client connection is already Func
            Exception: if an error occurs while trying to Func the connection
        """
        if arg_0._is_Func:
            raise exceptions.ClientConnectionFailure(
                "client connection already Func")
        else:
            try:
                arg_0.proxy.Func()
                arg_0._is_Func = True
            except Exception as e:
                arg_0.logger.error("could not Func client connection: %s", e)
                raise

Open the client connection.

        Raises:
            ClientConnectionFailure: if the client connection is already open
            Exception: if an error occurs while trying to open the connection


def Func ( arg_0 ) : arg_0 . files = [ ] for arg_2 in arg_0 . bundles : arg_2 . init_build ( arg_0 , arg_0 . builder ) arg_3 = arg_2 . prepare ( ) arg_0 . files . extend ( arg_3 ) return arg_0

def Func(arg_0):
        """
        Return collected files links

        :rtype: list[static_bundle.files.StaticFileResult]
        """
        arg_0.files = []
        for arg_2 in arg_0.bundles:
            arg_2.init_build(arg_0, arg_0.builder)
            arg_3 = arg_2.prepare()
            arg_0.files.extend(arg_3)
        return arg_0


Receive OAuth callback request from Facebook.

return {
            'pages': pages
        }

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get_settings ( show_hidden = True ) arg_4 = Facebook ( ) arg_5 = { 'client_id' : arg_3 [ 'client_id' ] , 'client_secret' : arg_3 [ 'client_secret' ] , 'code' : arg_2 [ 'code' ] , 'redirect_uri' : arg_0 . REDIRECT_URI } try : arg_4 . get_access_token ( arg_5 ) arg_6 = arg_4 . list_pages ( 'me' ) except FacebookAPIError , e : raise IntegrationCallbackError ( e . message ) return { 'pages' : arg_6 }

def Func(arg_0, arg_1, arg_2):
        """Receive OAuth Func request from Facebook."""

        # Get settings for this integration
        arg_3 = arg_0.get_settings(show_hidden=True)

        arg_4 = Facebook()

        arg_5 = {
            'client_id': arg_3['client_id'],
            'client_secret': arg_3['client_secret'],
            'code': arg_2['code'],
            'redirect_uri': arg_0.REDIRECT_URI
        }

        try:

            # Authenticate with Facebook
            arg_4.get_access_token(arg_5)

            # Fetch pages belonging to authenticated user
            arg_6 = arg_4.list_pages('me')

        except FacebookAPIError, e:
            raise IntegrationCallbackError(e.message)

        return {
            'pages': arg_6
        }

Receive OAuth callback request from Facebook .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = set ( ) while len ( arg_3 ) < arg_0 : arg_4 = tuple ( sorted ( np . random . choice ( arg_1 , arg_2 , replace = False ) ) ) arg_3 . add ( arg_4 ) return tuple ( arg_3 )

def Func(arg_0, arg_1, arg_2):
    """
    Returns nsets unique random quartet sets sampled from
    n-choose-k without replacement combinations.
    """
    arg_3 = set()
    while len(arg_3) < arg_0:
        arg_4 = tuple(sorted(np.random.choice(arg_1, arg_2, replace=False)))
        arg_3.add(arg_4)
    return tuple(arg_3)

Returns nsets unique random quartet sets sampled from n - choose - k without replacement combinations .


return datetime.datetime.fromtimestamp(
        microsecond_timestamp // 1000000, datetime.timezone.utc
    ).replace(microsecond=(microsecond_timestamp % 1000000))

def Func ( arg_0 ) : return datetime . datetime . fromtimestamp ( arg_0 // 1000000 , datetime . timezone . utc ) . replace ( microsecond = ( arg_0 % 1000000 ) )

def Func(arg_0):
    """Convert a microsecond timestamp to a UTC datetime instance."""
    # Create datetime without losing precision from floating point (yes, this
    # is actually needed):
    return datetime.datetime.fromtimestamp(
        arg_0 // 1000000, datetime.timezone.utc
    ).replace(microsecond=(arg_0 % 1000000))

Convert a microsecond timestamp to a UTC datetime instance .


return self.__class__(
            [(k, v) for k, v in self.items() if v is not self.EMPTY], is_empty=False
        )

def Func ( arg_0 ) : return arg_0 . __class__ ( [ ( arg_1 , arg_2 ) for arg_1 , arg_2 in arg_0 . items ( ) if arg_2 is not arg_0 . EMPTY ] , is_empty = False )

def Func(arg_0):
        """Return copy of instance, omitting entries that are EMPTY"""
        return arg_0.__class__(
            [(arg_1, arg_2) for arg_1, arg_2 in arg_0.items() if arg_2 is not arg_0.EMPTY], is_empty=False
        )

Return copy of instance omitting entries that are EMPTY


def Func(arg_0, arg_1, arg_2):
        '''Move relatively to the last point.'''
        if arg_0._path is None:
            raise ShoebotError(_("No current path. Use beginpath() first."))
        arg_0._path.Func(arg_1, arg_2)


return (super(MutableCollection, self).get((id,), **kwargs)
                .get(self.singular, None))

def Func ( arg_0 , arg_1 , ** arg_2 ) : return ( super ( MutableCollection , arg_0 ) . Func ( ( arg_1 , ) , ** arg_2 ) . Func ( arg_0 . singular , None ) )

def Func(arg_0, arg_1, **arg_2):
        """
        Get single unit of collection
        """
        return (super(MutableCollection, arg_0).Func((arg_1,), **arg_2)
                .Func(arg_0.singular, None))


def Func ( arg_0 , arg_1 ) : arg_2 = numpy . zeros ( arg_0 . _anomalyVectorLength ) arg_2 [ arg_1 . anomalyVector ] = 1 return arg_2

def Func(arg_0, arg_1):
    """
    Returns a state's anomaly vertor converting it from spare to dense
    """
    arg_2 = numpy.zeros(arg_0._anomalyVectorLength)
    arg_2[arg_1.anomalyVector] = 1
    return arg_2

Returns a state s anomaly vertor converting it from spare to dense


(self,
              uid=None,
              usage_limits_count=None,
              cryptographic_usage_mask=None,
              lease_time=None)

def Func(arg_0,
              arg_1=None,
              arg_2=None,
              arg_3=None,
              arg_4=None):
        """
        Check the constraints for a managed object.

        Args:
            uid (string): The unique ID of the managed object to Func.
                Optional, defaults to None.
            usage_limits_count (int): The number of items that can be secured
                with the specified managed object. Optional, defaults to None.
            cryptographic_usage_mask (list): A list of CryptographicUsageMask
                enumerations specifying the operations possible with the
                specified managed object. Optional, defaults to None.
            lease_time (int): The number of seconds that can be leased for the
                specified managed object. Optional, defaults to None.
        """
        if arg_1 is not None:
            if not isinstance(arg_1, six.string_types):
                raise TypeError("The unique identifier must be a string.")
        if arg_2 is not None:
            if not isinstance(arg_2, six.integer_types):
                raise TypeError("The usage limits count must be an integer.")
        if arg_3 is not None:
            if not isinstance(arg_3, list) or \
                    not all(isinstance(
                        arg_5,
                        enums.CryptographicUsageMask
                    ) for arg_5 in arg_3):
                raise TypeError(
                    "The cryptographic usage mask must be a list of "
                    "CryptographicUsageMask enumerations."
                )
        if arg_4 is not None:
            if not isinstance(arg_4, six.integer_types):
                raise TypeError("The lease time must be an integer.")

        arg_6 = arg_0.proxy.Func(
            arg_1,
            arg_2,
            arg_3,
            arg_4
        )

        arg_7 = arg_6.get('result_status')
        if arg_7 == enums.ResultStatus.SUCCESS:
            return arg_6.get('unique_identifier')
        else:
            raise exceptions.KmipOperationFailure(
                arg_7,
                arg_6.get('result_reason'),
                arg_6.get('result_message')
            )

Check the constraints for a managed object.

        Args:
            uid (string): The unique ID of the managed object to check.
                Optional, defaults to None.
            usage_limits_count (int): The number of items that can be secured
                with the specified managed object. Optional, defaults to None.
            cryptographic_usage_mask (list): A list of CryptographicUsageMask
                enumerations specifying the operations possible with the
                specified managed object. Optional, defaults to None.
            lease_time (int): The number of seconds that can be leased for the
                specified managed object. Optional, defaults to None.

Check the constraints for a managed object .


def Func(arg_0, arg_1, arg_2):
        """
        Add the new permission , view_menu to ab_permission_view_role if not exists.
        It will add the related entry to ab_permission
        and ab_view_menu two meta tables as well.

        :param permission_name: Name of the permission.
        :type permission_name: str
        :param view_menu_name: Name of the view-menu
        :type view_menu_name: str
        :return:
        """
        arg_3 = arg_0.find_permission(arg_1)
        arg_4 = arg_0.find_view_menu(arg_2)
        arg_5 = None
        if arg_3 and arg_4:
            arg_5 = arg_0.get_session.query(arg_0.permissionview_model).filter_by(
                arg_3=arg_3, arg_4=arg_4).first()
        if not arg_5 and arg_1 and arg_2:
            arg_0.add_permission_view_menu(arg_1, arg_2)

Add the new permission view_menu to ab_permission_view_role if not exists . It will add the related entry to ab_permission and ab_view_menu two meta tables as well .


def Func ( arg_0 , arg_1 = None ) : arg_0 . _loop = arg_1 or asyncio . get_event_loop ( ) arg_0 . _async_lock = asyncio . Lock ( arg_1 = arg_1 ) if not arg_0 . database == ':memory:' : arg_0 . _state = ConnectionLocal ( )

def Func(arg_0, arg_1=None):
        """Use when application is starting."""
        arg_0._loop = arg_1 or asyncio.get_event_loop()
        arg_0._async_lock = asyncio.Lock(arg_1=arg_1)

        # FIX: SQLITE in memory database
        if not arg_0.database == ':memory:':
            arg_0._state = ConnectionLocal()


(self,
                   *,
                   encoding: str = None,
                   loads: JSONDecoder = DEFAULT_JSON_DECODER,
                   content_type: Optional[str] = 'application/json')

return await self._aws_json(
            encoding=encoding, loads=loads, content_type=content_type)

async def Func(arg_0,
                   *,
                   arg_1: arg_2 = None,
                   arg_3: arg_4 = arg_5,
                   arg_6: arg_7[arg_2] = 'application/Func') -> Any:
        """Read and decodes JSON response."""
        return await arg_0._aws_Func(
            arg_1=arg_1, arg_3=arg_3, arg_6=arg_6)


def Func ( arg_0 ) -> str : arg_1 = resource_filename ( Requirement . parse ( package_name ) , template_path + config_filename ) return arg_1

def Func(arg_0) -> str:
        """ gets the default config path from resources """
        arg_1 = resource_filename(
            Requirement.parse(package_name),
            template_path + config_filename)
        return arg_1


def Func ( arg_0 , arg_1 , arg_2 = None ) : def output_context ( arg_3 ) : arg_4 = arg_1 arg_4 . set_source_surface ( arg_3 . get_target ( ) ) arg_4 . paint ( ) return arg_4 def output_surface ( arg_3 ) : arg_4 = cairo . Context ( arg_1 ) arg_4 . set_source_surface ( arg_3 . get_target ( ) ) arg_4 . paint ( ) return arg_4 def output_file ( arg_3 ) : arg_5 , arg_6 = os . path . splitext ( arg_1 ) if arg_2 : arg_7 = '%s_%04d%s' % ( arg_5 , arg_2 , arg_6 ) else : arg_7 = arg_1 arg_6 = arg_6 . lower ( ) if arg_6 == '.png' : arg_8 = arg_3 . get_target ( ) arg_8 . write_to_png ( arg_1 ) elif arg_6 == '.pdf' : arg_4 = cairo . Context ( cairo . PDFSurface ( arg_7 , * arg_0 . size_or_default ( ) ) ) arg_4 . set_source_surface ( arg_3 . get_target ( ) ) arg_4 . paint ( ) elif arg_6 in ( '.ps' , '.eps' ) : arg_4 = cairo . Context ( cairo . PSSurface ( arg_7 , * arg_0 . size_or_default ( ) ) ) if arg_6 == '.eps' : arg_4 . set_eps ( arg_6 = '.eps' ) arg_4 . set_source_surface ( arg_3 . get_target ( ) ) arg_4 . paint ( ) elif arg_6 == '.svg' : arg_4 = cairo . Context ( cairo . SVGSurface ( arg_7 , * arg_0 . size_or_default ( ) ) ) arg_4 . set_source_surface ( arg_3 . get_target ( ) ) arg_4 . paint ( ) return arg_7 if isinstance ( arg_1 , cairo . Context ) : return output_context elif isinstance ( arg_1 , cairo . Surface ) : return output_surface else : return output_file

def Func(arg_0, arg_1, arg_2=None):
        '''
        Function to output to a cairo surface

        target is a cairo Context or filename
        if file_number is set, then files will be numbered
        (this is usually set to the current frame number)
        '''
        def output_context(arg_3):
            arg_4 = arg_1
            arg_4.set_source_surface(arg_3.get_target())
            arg_4.paint()
            return arg_4

        def output_surface(arg_3):
            arg_4 = cairo.Context(arg_1)
            arg_4.set_source_surface(arg_3.get_target())
            arg_4.paint()
            return arg_4

        def output_file(arg_3):
            arg_5, arg_6 = os.path.splitext(arg_1)
            if arg_2:
                arg_7 = '%s_%04d%s' % (arg_5, arg_2, arg_6)
            else:
                arg_7 = arg_1

            arg_6 = arg_6.lower()
            if arg_6 == '.png':
                arg_8 = arg_3.get_target()
                arg_8.write_to_png(arg_1)
            elif arg_6 == '.pdf':
                arg_4 = cairo.Context(cairo.PDFSurface(arg_7, *arg_0.size_or_default()))
                arg_4.set_source_surface(arg_3.get_target())
                arg_4.paint()
            elif arg_6 in ('.ps', '.eps'):
                arg_4 = cairo.Context(cairo.PSSurface(arg_7, *arg_0.size_or_default()))
                if arg_6 == '.eps':
                    arg_4.set_eps(arg_6='.eps')
                arg_4.set_source_surface(arg_3.get_target())
                arg_4.paint()
            elif arg_6 == '.svg':
                arg_4 = cairo.Context(cairo.SVGSurface(arg_7, *arg_0.size_or_default()))
                arg_4.set_source_surface(arg_3.get_target())
                arg_4.paint()
            return arg_7

        if isinstance(arg_1, cairo.Context):
            return output_context
        elif isinstance(arg_1, cairo.Surface):
            return output_surface
        else:
            return output_file


def Func ( arg_0 , arg_1 ) : arg_0 . execute ( remote_checkpoints . delete ( ) . where ( remote_checkpoints . c . user_id == arg_1 , ) )

def Func(arg_0, arg_1):
    """
    Delete all database records for the given user_id.
    """
    arg_0.execute(
        remote_checkpoints.delete().where(
            remote_checkpoints.c.user_id == arg_1,
        )
    )

Delete all database records for the given user_id .


This selectively calls to_representation on each result that was processed by create.

return [
            self.child.to_representation(item) if 'detail' in item else item for item in data
        ]

def Func ( arg_0 , arg_1 ) : return [ arg_0 . child . Func ( arg_2 ) if 'detail' in arg_2 else arg_2 for arg_2 in arg_1 ]

def Func(arg_0, arg_1):
        """
        This selectively calls Func on each result that was processed by create.
        """
        return [
            arg_0.child.Func(arg_2) if 'detail' in arg_2 else arg_2 for arg_2 in arg_1
        ]

This selectively calls to_representation on each result that was processed by create .


def Func ( arg_0 ) : arg_0 . _is_live ( 'Func' ) try : arg_0 . message . modify ( True , True ) except Exception as e : raise MessageSettleFailed ( "Func" , e )

def Func(arg_0):
        """Defer the message.

        This message will remain in the queue but must be received
        specifically by its sequence number in order to be processed.

        :raises: ~azure.servicebus.common.errors.MessageAlreadySettled if the message has been settled.
        :raises: ~azure.servicebus.common.errors.MessageLockExpired if message lock has already expired.
        :raises: ~azure.servicebus.common.errors.SessionLockExpired if session lock has already expired.
        :raises: ~azure.servicebus.common.errors.MessageSettleFailed if message settle operation fails.
        """
        arg_0._is_live('Func')
        try:
            arg_0.message.modify(True, True)
        except Exception as e:
            raise MessageSettleFailed("Func", e)


def Func ( arg_0 ) : arg_1 = PATHS [ 'MOVE_TO_TOP' ] % arg_0 . id arg_2 = arg_0 . api . post ( arg_1 = arg_1 ) return Update ( api = arg_0 . api , raw_response = arg_2 )

def Func(arg_0):
    '''
      Move an existing status update to the top of the queue and recalculate
      times for all updates in the queue. Returns the update with its new
      posting time.
    '''

    arg_1 = PATHS['MOVE_TO_TOP'] % arg_0.id

    arg_2 = arg_0.api.post(arg_1=arg_1)
    return Update(api=arg_0.api, raw_response=arg_2)

Move an existing status update to the top of the queue and recalculate times for all updates in the queue . Returns the update with its new posting time .


def Func ( arg_0 , arg_1 ) : arg_0 . names = { } with codecs . open ( arg_1 , encoding = "iso8859-1" ) as f : for arg_3 in f : if any ( map ( lambda c : 128 < ord ( c ) < 160 , arg_3 ) ) : arg_3 = arg_3 . encode ( "iso8859-1" ) . decode ( "windows-1252" ) arg_0 . _eat_name_line ( arg_3 . strip ( ) )

def Func(arg_0, arg_1):
        """Opens data file and for each line, calls _eat_name_line"""
        arg_0.names = {}
        with codecs.open(arg_1, encoding="iso8859-1") as f:
            for arg_3 in f:
                if any(map(lambda c: 128 < ord(c) < 160, arg_3)):
                    arg_3 = arg_3.encode("iso8859-1").decode("windows-1252")
                arg_0._eat_name_line(arg_3.strip())

Opens data file and for each line calls _eat_name_line


return tf.SparseTensor(
      indices=indices, values=sp_a.values, dense_shape=dense_shape)

def Func ( arg_0 ) : arg_1 = tf . convert_to_tensor ( value = _get_shape ( arg_0 , tf . int64 ) ) arg_2 = tf . concat ( [ [ arg_1 [ - 2 : ] ] , tf . eye ( 2 , dtype = tf . int64 ) ] , axis = 0 ) arg_3 = tf . matmul ( arg_0 . indices , arg_2 ) arg_4 = arg_1 [ 0 ] * arg_1 [ 1 : ] return tf . SparseTensor ( arg_3 = arg_3 , values = arg_0 . values , arg_4 = arg_4 )

def Func(arg_0):
  """Returns a block diagonal rank 2 SparseTensor from a batch of SparseTensors.

  Args:
    sp_a: A rank 3 `SparseTensor` representing a batch of matrices.

  Returns:
    sp_block_diag_a: matrix-shaped, `float` `SparseTensor` with the same dtype
    as `sparse_or_matrix`, of shape [B * M, B * N] where `sp_a` has shape
    [B, M, N]. Each [M, N] batch of `sp_a` is lined up along the diagonal.
  """
  # Construct the matrix [[M, N], [1, 0], [0, 1]] which would map the index
  # (b, i, j) to (Mb + i, Nb + j). This effectively creates a block-diagonal
  # matrix of dense shape [B * M, B * N].
  # Note that this transformation doesn't increase the number of non-zero
  # entries in the SparseTensor.
  arg_1 = tf.convert_to_tensor(value=_get_shape(arg_0, tf.int64))
  arg_2 = tf.concat([[arg_1[-2:]], tf.eye(2, dtype=tf.int64)], axis=0)
  arg_3 = tf.matmul(arg_0.indices, arg_2)
  arg_4 = arg_1[0] * arg_1[1:]
  return tf.SparseTensor(
      arg_3=arg_3, values=arg_0.values, arg_4=arg_4)

Returns a block diagonal rank 2 SparseTensor from a batch of SparseTensors .


def
Func
(
arg_0
,
arg_1
=
True
,
arg_2
=
1
)
:
arg_2
=
np
.
abs
(
arg_2
)
if
arg_0
.
ndim
!=
2
or
arg_0
.
shape
[
0
]
!=
arg_0
.
shape
[
1
]
:
raise
ParameterError
(
'non-square recurrence matrix shape: '
'{}'
.
format
(
arg_0
.
shape
)
)
arg_3
=
scipy
.
sparse
.
issparse
(
arg_0
)
arg_4
=
if
arg_3
:
arg_4
=
1
arg_2
arg_5
=
arg_0
.
format
if
arg_2
==
0
:
arg_0
=
arg_0
.
tocsc
(
)
elif
arg_2
in
(
1
,
1
)
:
arg_0
=
arg_0
.
tocsr
(
)
arg_6
=
arg_0
.
shape
[
arg_2
]
if
arg_3
:
if
arg_1
:
arg_7
=
np
.
asarray
(
[
[
1
,
0
]
]
)
.
swapaxes
(
arg_2
,
0
)
arg_8
=
scipy
.
sparse
.
kron
(
arg_7
.
astype
(
arg_0
.
dtype
)
,
arg_0
,
format
=
'lil'
)
else
:
arg_8
=
scipy
.
sparse
.
lil_matrix
(
arg_0
)
else
:
if
arg_1
:
arg_9
=
[
(
0
,
0
)
,
(
0
,
0
)
]
arg_9
[
(
1
arg_2
)
]
=
(
0
,
arg_6
)
arg_8
=
np
.
pad
(
arg_0
,
arg_9
,
mode
=
'constant'
)
else
:
arg_8
=
arg_0
.
copy
(
)
arg_10
=
[
slice
(
)
]
*
arg_8
.
ndim
for
arg_11
in
range
(
1
,
arg_6
)
:
arg_10
[
arg_2
]
=
arg_11
arg_8
[
arg_12
(
arg_10
)
]
=
util
.
roll_sparse
(
arg_8
[
arg_12
(
arg_10
)
]
,
arg_11
,
arg_2
=
arg_4
)
if
arg_3
:
return
arg_8
.
asformat
(
arg_5
)
return
np
.
ascontiguousarray
(
arg_8
.
T
)
.
T

def Func(arg_0, arg_1=True, arg_2=-1):
    '''Convert a recurrence matrix into a lag matrix.

        `lag[i, j] == rec[i+j, j]`

    Parameters
    ----------
    rec : np.ndarray, or scipy.sparse.spmatrix [shape=(n, n)]
        A (binary) recurrence matrix, as returned by `recurrence_matrix`

    pad : bool
        If False, `lag` matrix is square, which is equivalent to
        assuming that the signal repeats itself indefinitely.

        If True, `lag` is padded with `n` zeros, which eliminates
        the assumption of repetition.

    axis : int
        The axis to keep as the `time` axis.
        The alternate axis will be converted to lag coordinates.

    Returns
    -------
    lag : np.ndarray
        The recurrence matrix in (lag, time) (if `axis=1`)
        or (time, lag) (if `axis=0`) coordinates

    Raises
    ------
    ParameterError : if `rec` is non-square

    See Also
    --------
    recurrence_matrix
    lag_to_recurrence

    Examples
    --------
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> mfccs = librosa.feature.mfcc(y=y, sr=sr)
    >>> recurrence = librosa.segment.recurrence_matrix(mfccs)
    >>> lag_pad = librosa.segment.Func(recurrence, pad=True)
    >>> lag_nopad = librosa.segment.Func(recurrence, pad=False)

    >>> import matplotlib.pyplot as plt
    >>> plt.figure(figsize=(8, 4))
    >>> plt.subplot(1, 2, 1)
    >>> librosa.display.specshow(lag_pad, x_axis='time', y_axis='lag')
    >>> plt.title('Lag (zero-padded)')
    >>> plt.subplot(1, 2, 2)
    >>> librosa.display.specshow(lag_nopad, x_axis='time')
    >>> plt.title('Lag (no padding)')
    >>> plt.tight_layout()
    '''

    arg_2 = np.abs(arg_2)

    if arg_0.ndim != 2 or arg_0.shape[0] != arg_0.shape[1]:
        raise ParameterError('non-square recurrence matrix shape: '
                             '{}'.format(arg_0.shape))

    arg_3 = scipy.sparse.issparse(arg_0)

    arg_4 = None
    if arg_3:
        arg_4 = 1 - arg_2
        arg_5 = arg_0.format
        if arg_2 == 0:
            arg_0 = arg_0.tocsc()
        elif arg_2 in (-1, 1):
            arg_0 = arg_0.tocsr()

    arg_6 = arg_0.shape[arg_2]

    if arg_3:
        if arg_1:
            arg_7 = np.asarray([[1, 0]]).swapaxes(arg_2, 0)
            arg_8 = scipy.sparse.kron(arg_7.astype(arg_0.dtype), arg_0, format='lil')
        else:
            arg_8 = scipy.sparse.lil_matrix(arg_0)
    else:
        if arg_1:
            arg_9 = [(0, 0), (0, 0)]
            arg_9[(1-arg_2)] = (0, arg_6)
            arg_8 = np.pad(arg_0, arg_9, mode='constant')
        else:
            arg_8 = arg_0.copy()

    arg_10 = [slice(None)] * arg_8.ndim

    for arg_11 in range(1, arg_6):
        arg_10[arg_2] = arg_11
        arg_8[arg_12(arg_10)] = util.roll_sparse(arg_8[arg_12(arg_10)], -arg_11, arg_2=arg_4)

    if arg_3:
        return arg_8.asformat(arg_5)
    return np.ascontiguousarray(arg_8.T).T

Convert a recurrence matrix into a lag matrix.

        `lag[i, j] == rec[i+j, j]`

    Parameters
    ----------
    rec : np.ndarray, or scipy.sparse.spmatrix [shape=(n, n)]
        A (binary) recurrence matrix, as returned by `recurrence_matrix`

    pad : bool
        If False, `lag` matrix is square, which is equivalent to
        assuming that the signal repeats itself indefinitely.

        If True, `lag` is padded with `n` zeros, which eliminates
        the assumption of repetition.

    axis : int
        The axis to keep as the `time` axis.
        The alternate axis will be converted to lag coordinates.

    Returns
    -------
    lag : np.ndarray
        The recurrence matrix in (lag, time) (if `axis=1`)
        or (time, lag) (if `axis=0`) coordinates

    Raises
    ------
    ParameterError : if `rec` is non-square

    See Also
    --------
    recurrence_matrix
    lag_to_recurrence

    Examples
    --------
    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> mfccs = librosa.feature.mfcc(y=y, sr=sr)
    >>> recurrence = librosa.segment.recurrence_matrix(mfccs)
    >>> lag_pad = librosa.segment.recurrence_to_lag(recurrence, pad=True)
    >>> lag_nopad = librosa.segment.recurrence_to_lag(recurrence, pad=False)

    >>> import matplotlib.pyplot as plt
    >>> plt.figure(figsize=(8, 4))
    >>> plt.subplot(1, 2, 1)
    >>> librosa.display.specshow(lag_pad, x_axis='time', y_axis='lag')
    >>> plt.title('Lag (zero-padded)')
    >>> plt.subplot(1, 2, 2)
    >>> librosa.display.specshow(lag_nopad, x_axis='time')
    >>> plt.title('Lag (no padding)')
    >>> plt.tight_layout()

Convert a recurrence matrix into a lag matrix .


def
Func
(
arg_0
,
arg_1
)
:
if
len
(
arg_1
.
files
.
edits
)
>
1
:
arg_2
=
[
"cat"
]
+
[
i
[
0
]
for
i
in
arg_1
.
files
.
edits
]
arg_3
=
os
.
path
.
join
(
arg_0
.
dirs
.
edits
,
arg_1
.
name
+
"_R1_concatedit.fq.gz"
)
with
open
(
arg_3
,
'w'
)
as
cout1
:
arg_4
=
sps
.
Popen
(
arg_2
,
stderr
=
sps
.
STDOUT
,
stdout
=
cout1
,
close_fds
=
True
)
arg_5
=
arg_4
.
communicate
(
)
[
0
]
if
arg_4
.
returncode
:
raise
IPyradWarningExit
(
"error in: %s, %s"
,
arg_2
,
arg_5
)
arg_6
=
0
if
os
.
path
.
exists
(
str
(
arg_1
.
files
.
edits
[
0
]
[
1
]
)
)
:
arg_7
=
[
"cat"
]
+
[
i
[
1
]
for
i
in
arg_1
.
files
.
edits
]
arg_6
=
os
.
path
.
join
(
arg_0
.
dirs
.
edits
,
arg_1
.
name
+
"_R2_concatedit.fq.gz"
)
with
gzip
.
open
(
arg_6
,
'w'
)
as
cout2
:
arg_8
=
sps
.
Popen
(
arg_7
,
stderr
=
sps
.
STDOUT
,
stdout
=
cout2
,
close_fds
=
True
)
arg_9
=
arg_8
.
communicate
(
)
[
0
]
if
arg_8
.
returncode
:
raise
IPyradWarningExit
(
"error in: %s, %s"
,
arg_7
,
arg_9
)
arg_1
.
files
.
edits
=
[
(
arg_3
,
arg_6
)
]
return
arg_1
.
files
.
edits

def Func(arg_0, arg_1):
    """
    if multiple fastq files were appended into the list of fastqs for samples
    then we merge them here before proceeding.
    """

    ## if more than one tuple in fastq list
    if len(arg_1.files.edits) > 1:
        ## create a cat command to append them all (doesn't matter if they
        ## are gzipped, cat still works). Grab index 0 of tuples for R1s.
        arg_2 = ["cat"] + [i[0] for i in arg_1.files.edits]

        ## write to new concat handle
        arg_3 = os.path.join(arg_0.dirs.edits, arg_1.name+"_R1_concatedit.fq.gz")
        with open(arg_3, 'w') as cout1:
            arg_4 = sps.Popen(arg_2, stderr=sps.STDOUT, stdout=cout1, close_fds=True)
            arg_5 = arg_4.communicate()[0]
        if arg_4.returncode:
            raise IPyradWarningExit("error in: %s, %s", arg_2, arg_5)

        ## Only set conc2 if R2 actually exists
        arg_6 = 0
        if os.path.exists(str(arg_1.files.edits[0][1])):
            arg_7 = ["cat"] + [i[1] for i in arg_1.files.edits]
            arg_6 = os.path.join(arg_0.dirs.edits, arg_1.name+"_R2_concatedit.fq.gz")
            with gzip.open(arg_6, 'w') as cout2:
                arg_8 = sps.Popen(arg_7, stderr=sps.STDOUT, stdout=cout2, close_fds=True)
                arg_9 = arg_8.communicate()[0]
            if arg_8.returncode:
                raise IPyradWarningExit("error in: %s, %s", arg_7, arg_9)

        ## store new file handles
        arg_1.files.edits = [(arg_3, arg_6)]
    return arg_1.files.edits

if multiple fastq files were appended into the list of fastqs for samples then we merge them here before proceeding .


def Func ( arg_0 , arg_1 ) : if arg_1 >= len ( arg_0 . reverse_vocab ) : return arg_0 . reverse_vocab [ arg_0 . unk_id ] else : return arg_0 . reverse_vocab [ arg_1 ]

def Func(arg_0, arg_1):
        """Returns the word string of an integer word id."""
        if arg_1 >= len(arg_0.reverse_vocab):
            return arg_0.reverse_vocab[arg_0.unk_id]
        else:
            return arg_0.reverse_vocab[arg_1]

Returns the word string of an integer word id .


def Func ( arg_0 , arg_1 , arg_2 = None ) : publish_event ( QUIT_EVENT ) if arg_0 . has_server : arg_0 . sock . close ( ) arg_0 . hide_variables_window ( ) arg_0 . destroy ( ) arg_0 . window_open = False

def Func(arg_0, arg_1, arg_2=None):
        """
        Widget Action to Close the window, triggering the quit event.
        """
        publish_event(QUIT_EVENT)

        if arg_0.has_server:
            arg_0.sock.close()

        arg_0.hide_variables_window()

        arg_0.destroy()
        arg_0.window_open = False

Widget Action to Close the window triggering the quit event .


(self, instance_id, database_id, ddl_statements, project_id=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """
        Creates a new database in Cloud Spanner.

        :type project_id: str
        :param instance_id: The ID of the Cloud Spanner instance.
        :type instance_id: str
        :param database_id: The ID of the database to create in Cloud Spanner.
        :type database_id: str
        :param ddl_statements: The string list containing DDL for the new database.
        :type ddl_statements: list[str]
        :param project_id: Optional, the ID of the  GCP project that owns the Cloud Spanner
            database. If set to None or missing, the default project_id from the GCP connection is used.
        :return: None
        """

        arg_5 = arg_0._get_client(arg_4=arg_4).instance(
            arg_1=arg_1)
        if not arg_5.exists():
            raise AirflowException("The instance {} does not exist in project {} !".
                                   format(arg_1, arg_4))
        arg_6 = arg_5.database(arg_2=arg_2,
                                     arg_3=arg_3)
        try:
            arg_7 = arg_6.create()  # type: Operation
        except GoogleAPICallError as e:
            arg_0.log.error('An error occurred: %s. Exiting.', e.message)
            raise e

        if arg_7:
            arg_8 = arg_7.result()
            arg_0.log.info(arg_8)
        return

Creates a new database in Cloud Spanner .


def Func(arg_0):
    """
    SPSS .sav files to Pandas DataFrame through Rpy2

    :param input_file: string

    :return:
    """
    import pandas.rpy.common as com

    arg_1 = com.robj.r('foreign::read.spss("%s", to.data.frame=TRUE)' % arg_0)
    return com.convert_robj(arg_1)

SPSS . sav files to Pandas DataFrame through Rpy2


def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_2 ) : arg_4 = 1 if arg_3 == '+' else - 1 try : return arg_0 + arg_4 * pd . Timedelta ( arg_1 ) except ValueError : arg_5 = TIMEDELTA_RGX . match ( arg_1 ) if arg_5 is not None : arg_6 = arg_5 . groupdict ( ) arg_7 = arg_6 [ 'unit' ] . lower ( ) [ 0 ] arg_8 = arg_4 * int ( arg_6 [ 'num' ] ) if arg_7 == 'w' : return arg_0 + arg_8 * timedelta ( weeks = 1 ) if arg_7 == 'm' : return add_months ( arg_0 , arg_8 ) if arg_7 == 'y' : return add_years ( arg_0 , arg_8 ) raise

def Func(arg_0, arg_1: arg_2, arg_3: arg_2):
    """add a human readable offset to `dateobj` and return corresponding date.

    rely on `pandas.Timedelta` and add the following extra shortcuts:
    - "w", "week" and "weeks" for a week (i.e. 7days)
    - "month', "months" for a month (i.e. no day computation, just increment the month)
    - "y", "year', "years" for a year (i.e. no day computation, just increment the year)
    """
    arg_4 = 1 if arg_3 == '+' else -1
    try:
        return arg_0 + arg_4 * pd.Timedelta(arg_1)
    except ValueError:
        # pd.Timedelta could not parse the offset, let's try harder
        arg_5 = TIMEDELTA_RGX.match(arg_1)
        if arg_5 is not None:
            arg_6 = arg_5.groupdict()
            arg_7 = arg_6['unit'].lower()[0]
            arg_8 = arg_4 * int(arg_6['num'])
            # is it a week ?
            if arg_7 == 'w':
                return arg_0 + arg_8 * timedelta(weeks=1)
            # or a month ?
            if arg_7 == 'm':
                return add_months(arg_0, arg_8)
            # or a year ?
            if arg_7 == 'y':
                return add_years(arg_0, arg_8)
        # we did what we could, just re-raise the original exception
        raise

add a human readable offset to dateobj and return corresponding date .


def
Func
(
arg_0
,
arg_1
)
:
arg_1
.
write
(
'# File\n\n'
)
write_value
(
'FileName'
,
arg_0
.
name
,
arg_1
)
write_value
(
'SPDXID'
,
arg_0
.
spdx_id
,
arg_1
)
if
arg_0
.
has_optional_field
(
'type'
)
:
Func_type
(
arg_0
.
type
,
arg_1
)
write_value
(
'FileChecksum'
,
arg_0
.
chk_sum
.
to_tv
(
)
,
arg_1
)
if
isinstance
(
arg_0
.
conc_lics
,
(
document
.
LicenseConjunction
,
document
.
LicenseDisjunction
)
)
:
write_value
(
'LicenseConcluded'
,
u'({0})'
.
format
(
arg_0
.
conc_lics
)
,
arg_1
)
else
:
write_value
(
'LicenseConcluded'
,
arg_0
.
conc_lics
,
arg_1
)
for
arg_2
in
sorted
(
arg_0
.
licenses_in_file
)
:
write_value
(
'LicenseInfoInFile'
,
arg_2
,
arg_1
)
if
isinstance
(
arg_0
.
copyright
,
six
.
string_types
)
:
write_text_value
(
'FileCopyrightText'
,
arg_0
.
copyright
,
arg_1
)
else
:
write_value
(
'FileCopyrightText'
,
arg_0
.
copyright
,
arg_1
)
if
arg_0
.
has_optional_field
(
'license_comment'
)
:
write_text_value
(
'LicenseComments'
,
arg_0
.
license_comment
,
arg_1
)
if
arg_0
.
has_optional_field
(
'comment'
)
:
write_text_value
(
'FileComment'
,
arg_0
.
comment
,
arg_1
)
if
arg_0
.
has_optional_field
(
'notice'
)
:
write_text_value
(
'FileNotice'
,
arg_0
.
notice
,
arg_1
)
for
arg_3
in
sorted
(
arg_0
.
contributors
)
:
write_value
(
'FileContributor'
,
arg_3
,
arg_1
)
for
arg_4
in
sorted
(
arg_0
.
dependencies
)
:
write_value
(
'FileDependency'
,
arg_4
,
arg_1
)
arg_5
=
arg_0
.
artifact_of_project_name
arg_6
=
arg_0
.
artifact_of_project_home
arg_7
=
arg_0
.
artifact_of_project_uri
for
arg_8
,
arg_9
,
arg_10
in
sorted
(
zip_longest
(
arg_5
,
arg_6
,
arg_7
)
)
:
write_value
(
'ArtifactOfProjectName'
,
arg_8
,
arg_1
)
if
arg_9
is
not
:
write_value
(
'ArtifactOfProjectHomePage'
,
arg_9
,
arg_1
)
if
arg_10
is
not
:
write_value
(
'ArtifactOfProjectURI'
,
arg_10
,
arg_1
)

def Func(arg_0, arg_1):
    """
    Write a file fields to out.
    """
    arg_1.write('# File\n\n')
    write_value('FileName', arg_0.name, arg_1)
    write_value('SPDXID', arg_0.spdx_id, arg_1)
    if arg_0.has_optional_field('type'):
        Func_type(arg_0.type, arg_1)
    write_value('FileChecksum', arg_0.chk_sum.to_tv(), arg_1)
    if isinstance(arg_0.conc_lics, (document.LicenseConjunction, document.LicenseDisjunction)):
        write_value('LicenseConcluded', u'({0})'.format(arg_0.conc_lics), arg_1)
    else:
        write_value('LicenseConcluded', arg_0.conc_lics, arg_1)

    # write sorted list
    for arg_2 in sorted(arg_0.licenses_in_file):
        write_value('LicenseInfoInFile', arg_2, arg_1)

    if isinstance(arg_0.copyright, six.string_types):
        write_text_value('FileCopyrightText', arg_0.copyright, arg_1)
    else:
        write_value('FileCopyrightText', arg_0.copyright, arg_1)

    if arg_0.has_optional_field('license_comment'):
        write_text_value('LicenseComments', arg_0.license_comment, arg_1)

    if arg_0.has_optional_field('comment'):
        write_text_value('FileComment', arg_0.comment, arg_1)

    if arg_0.has_optional_field('notice'):
        write_text_value('FileNotice', arg_0.notice, arg_1)

    for arg_3 in sorted(arg_0.contributors):
        write_value('FileContributor', arg_3, arg_1)

    for arg_4 in sorted(arg_0.dependencies):
        write_value('FileDependency', arg_4, arg_1)

    arg_5 = arg_0.artifact_of_project_name
    arg_6 = arg_0.artifact_of_project_home
    arg_7 = arg_0.artifact_of_project_uri

    for arg_8, arg_9, arg_10 in sorted(zip_longest(arg_5, arg_6, arg_7)):
        write_value('ArtifactOfProjectName', arg_8, arg_1)
        if arg_9 is not None:
            write_value('ArtifactOfProjectHomePage', arg_9, arg_1)
        if arg_10 is not None:
            write_value('ArtifactOfProjectURI', arg_10, arg_1)


def Func(arg_0, arg_1, arg_2=None):
        """Find min and max values of every feature.

        Parameters
        ----------
        X : {array-like, sparse matrix}, shape (n_samples, n_features)
            The training input samples.
        y : Ignored
            not used, present for API consistency by convention.

        Returns
        -------
        self : object
        """
        # Check that X have correct shape
        arg_1 = check_array(arg_1)

        arg_0._x_min = arg_1.min(axis=0) # axis=0 will find the minimum values by columns (for each feature)
        arg_0._x_max = arg_1.max(axis=0) # axis=0 will find the minimum values by columns (for each feature)
        return arg_0

Find min and max values of every feature .


(self, states, actions, internals, terminal, reward, index)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : arg_7 = tf . count_nonzero ( input_tensor = arg_4 , dtype = util . tf_dtype ( 'int' ) ) arg_8 = tf . assign_add ( ref = arg_0 . episode , value = tf . to_int64 ( x = arg_7 ) ) arg_9 = tf . assign_add ( ref = arg_0 . global_episode , value = tf . to_int64 ( x = arg_7 ) ) with tf . control_dependencies ( control_inputs = ( arg_8 , arg_9 ) ) : arg_1 = util . map_tensors ( fn = tf . stop_gradient , tensors = arg_1 ) arg_3 = util . map_tensors ( fn = tf . stop_gradient , tensors = arg_3 ) arg_2 = util . map_tensors ( fn = tf . stop_gradient , tensors = arg_2 ) arg_4 = tf . stop_gradient ( input = arg_4 ) arg_5 = tf . stop_gradient ( input = arg_5 ) arg_10 = arg_0 . fn_observe_timestep ( arg_1 = arg_1 , arg_3 = arg_3 , arg_2 = arg_2 , arg_4 = arg_4 , arg_5 = arg_5 ) with tf . control_dependencies ( control_inputs = ( arg_10 , ) ) : arg_0 . unbuffered_episode_output = arg_0 . global_episode + 0

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
        """
        Returns the tf op to fetch when unbuffered observations are passed in.

        Args:
            states (any): One state (usually a value tuple) or dict of states if multiple states are expected.
            actions (any): One action (usually a value tuple) or dict of states if multiple actions are expected.
            internals (any): Internal list.
            terminal (bool): boolean indicating if the episode terminated after the observation.
            reward (float): scalar reward that resulted from executing the action.

        Returns: Tf op to fetch when `observe()` is called.
        """
        # Increment episode
        arg_7 = tf.count_nonzero(input_tensor=arg_4, dtype=util.tf_dtype('int'))
        arg_8 = tf.assign_add(ref=arg_0.episode, value=tf.to_int64(x=arg_7))
        arg_9 = tf.assign_add(ref=arg_0.global_episode, value=tf.to_int64(x=arg_7))

        with tf.control_dependencies(control_inputs=(arg_8, arg_9)):
            # Stop gradients
            # Not using buffers here.
            arg_1 = util.map_tensors(fn=tf.stop_gradient, tensors=arg_1)
            arg_3 = util.map_tensors(fn=tf.stop_gradient, tensors=arg_3)
            arg_2 = util.map_tensors(fn=tf.stop_gradient, tensors=arg_2)
            arg_4 = tf.stop_gradient(input=arg_4)
            arg_5 = tf.stop_gradient(input=arg_5)

            # Observation
            arg_10 = arg_0.fn_observe_timestep(
                arg_1=arg_1,
                arg_3=arg_3,
                arg_2=arg_2,
                arg_4=arg_4,
                arg_5=arg_5
            )

        with tf.control_dependencies(control_inputs=(arg_10,)):
            # Trivial operation to enforce control dependency.
            arg_0.unbuffered_episode_output = arg_0.global_episode + 0

Returns the tf op to fetch when unbuffered observations are passed in .


def Func(arg_0):
        """ Initialize the underlying map options.

        """
        arg_0.options = GoogleMapOptions()
        arg_2 = arg_0.declaration
        arg_0.set_map_type(arg_2.map_type)
        if arg_2.ambient_mode:
            arg_0.set_ambient_mode(arg_2.ambient_mode)
        if (arg_2.camera_position or arg_2.camera_zoom or
                arg_2.camera_tilt or arg_2.camera_bearing):
            arg_0.update_camera()
        if arg_2.map_bounds:
            arg_0.set_map_bounds(arg_2.map_bounds)
        if not arg_2.show_compass:
            arg_0.set_show_compass(arg_2.show_compass)
        if not arg_2.show_zoom_controls:
            arg_0.set_show_zoom_controls(arg_2.show_zoom_controls)
        if not arg_2.show_toolbar:
            arg_0.set_show_toolbar(arg_2.show_toolbar)
        if arg_2.lite_mode:
            arg_0.set_lite_mode(arg_2.lite_mode)
        if not arg_2.rotate_gestures:
            arg_0.set_rotate_gestures(arg_2.rotate_gestures)
        if not arg_2.scroll_gestures:
            arg_0.set_scroll_gestures(arg_2.scroll_gestures)
        if not arg_2.tilt_gestures:
            arg_0.set_tilt_gestures(arg_2.tilt_gestures)
        if not arg_2.zoom_gestures:
            arg_0.set_zoom_gestures(arg_2.zoom_gestures)
        if arg_2.min_zoom:
            arg_0.set_min_zoom(arg_2.min_zoom)
        if arg_2.max_zoom:
            arg_0.set_max_zoom(arg_2.max_zoom)


return '_'.join([json_content[0]['name'],
                    json_content[0]['Topics'][tIndex]['name'],
                    json_content[0]['Topics'][tIndex]['Parts'][pIndex]['name']])

def Func ( arg_0 , arg_1 , arg_2 ) : return '_' . join ( [ arg_0 [ 0 ] [ 'name' ] , arg_0 [ 0 ] [ 'Topics' ] [ arg_1 ] [ 'name' ] , arg_0 [ 0 ] [ 'Topics' ] [ arg_1 ] [ 'Parts' ] [ arg_2 ] [ 'name' ] ] )

def Func(arg_0, arg_1, arg_2):
    """JSON, int, int, int->str

    Get a proper title with courseid+topicID+partID."""

    return '_'.join([arg_0[0]['name'],
                    arg_0[0]['Topics'][arg_1]['name'],
                    arg_0[0]['Topics'][arg_1]['Parts'][arg_2]['name']])

JSON int int int - > str Get a proper title with courseid + topicID + partID .


def Func ( arg_0 ) : if not arg_0 or not arg_0 . strip ( ) : return [ ] arg_1 = Func_re . findall ( arg_0 ) return arg_1

def Func(arg_0):
    """ Splits some text into words. Includes trailing whitespace
    on each word when appropriate.  """
    if not arg_0 or not arg_0.strip():
        return []

    arg_1 = Func_re.findall(arg_0)
    return arg_1

Splits some text into words . Includes trailing whitespace on each word when appropriate .


return DataFrameRow(idx, [x[idx] for x in self], self.colnames)

def Func ( arg_0 , arg_1 ) : return DataFrameRow ( arg_1 , [ arg_2 [ arg_1 ] for arg_2 in arg_0 ] , arg_0 . colnames )

def Func(arg_0, arg_1):
        """
        Returns DataFrameRow of the DataFrame given its index.

        :param idx: the index of the Func in the DataFrame.
        :return: returns a DataFrameRow
        """
        return DataFrameRow(arg_1, [arg_2[arg_1] for arg_2 in arg_0], arg_0.colnames)

Returns DataFrameRow of the DataFrame given its index.

        :param idx: the index of the row in the DataFrame.
        :return: returns a DataFrameRow

Returns DataFrameRow of the DataFrame given its index .


return self._get_model(url, FullPlayer, timeout=timeout)

def Func ( arg_0 , arg_1 : arg_2 , arg_3 = None ) : arg_4 = arg_0 . api . PLAYER + '/' + arg_1 return arg_0 . _get_model ( arg_4 , FullPlayer , arg_3 = arg_3 )

def Func(arg_0, arg_1: arg_2, arg_3=None):
        """Get information about a player

        Parameters
        ----------
        tag: str
            A valid tournament tag. Minimum length: 3
            Valid characters: 0289PYLQGRJCUV
        timeout: Optional[int] = None
            Custom timeout that overwrites Client.timeout
        """
        arg_4 = arg_0.api.PLAYER + '/' + arg_1
        return arg_0._get_model(arg_4, FullPlayer, arg_3=arg_3)


def Func(arg_0, Func):
        """
        Set the alias for this reducer.

        ### Parameters

        - **alias**: The value of the alias for this reducer. If this is the
            special value `aggregation.FIELDNAME` then this reducer will be
            aliased using the same name as the field upon which it operates.
            Note that using `FIELDNAME` is only possible on reducers which
            operate on a single field value.

        This method returns the `Reducer` object making it suitable for
        chaining.
        """
        if Func is FIELDNAME:
            if not arg_0._field:
                raise ValueError("Cannot use FIELDNAME alias with no field")
            # Chop off initial '@'
            Func = arg_0._field[1:]
        arg_0._alias = Func
        return arg_0


(im, rad, minmass=None, use_tp=False, trim_edge=False)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False , arg_4 = False ) : if arg_2 is None : arg_2 = arg_1 ** 3 * 4 / 3. * np . pi * 0.01 if arg_3 : arg_5 = np . ceil ( 2 * arg_1 ) arg_5 += 1 - ( arg_5 % 2 ) arg_6 = peri . trackpy . locate ( arg_0 , int ( arg_5 ) , arg_2 = arg_2 ) arg_7 = np . array ( arg_6 [ 'mass' ] ) . size arg_8 = np . zeros ( [ arg_7 , 3 ] ) arg_8 [ : , 0 ] = arg_6 [ 'z' ] arg_8 [ : , 1 ] = arg_6 [ 'y' ] arg_8 [ : , 2 ] = arg_6 [ 'x' ] arg_9 = arg_6 [ 'mass' ] else : arg_8 , arg_9 = initializers . local_max_featuring ( arg_0 , radius = arg_1 , arg_2 = arg_2 , arg_4 = arg_4 ) arg_7 = arg_8 . shape [ 0 ] arg_10 = np . argsort ( arg_9 ) [ : : - 1 ] return arg_8 [ arg_10 ] . copy ( ) , arg_7

def Func(arg_0, arg_1, arg_2=None, arg_3=False, arg_4=False):
    """Workhorse of feature_guess"""
    if arg_2 is None:
        # we use 1% of the feature size mass as a cutoff;
        # it's easier to remove than to add
        arg_2 = arg_1**3 * 4/3.*np.pi * 0.01
        # 0.03 is a magic number; works well
    if arg_3:
        arg_5 = np.ceil(2*arg_1)
        arg_5 += 1-(arg_5 % 2)
        arg_6 = peri.trackpy.locate(arg_0, int(arg_5), arg_2=arg_2)
        arg_7 = np.array(arg_6['mass']).size
        arg_8 = np.zeros([arg_7, 3])
        arg_8[:, 0] = arg_6['z']
        arg_8[:, 1] = arg_6['y']
        arg_8[:, 2] = arg_6['x']
        arg_9 = arg_6['mass']
    else:
        arg_8, arg_9 = initializers.local_max_featuring(
            arg_0, radius=arg_1, arg_2=arg_2, arg_4=arg_4)
        arg_7 = arg_8.shape[0]
    # I want to return these sorted by mass:
    arg_10 = np.argsort(arg_9)[::-1]  # biggest mass first
    return arg_8[arg_10].copy(), arg_7


def Func ( arg_0 , arg_1 = None ) : if arg_1 is not None : arg_0 . iodir = arg_1 arg_0 . _device . writeList ( arg_0 . IODIR , arg_0 . iodir )

def Func(arg_0, arg_1=None):
        """Write the specified byte value to the IODIR registor.  If no value
        specified the current buffered value will be written.
        """
        if arg_1 is not None:
            arg_0.iodir = arg_1
        arg_0._device.writeList(arg_0.IODIR, arg_0.iodir)

Write the specified byte value to the IODIR registor . If no value specified the current buffered value will be written .


(colorname, offset, colormode, colorpalette)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Translate the given color name to a valid
    ANSI escape code.

    :parma str colorname: the name of the color to resolve
    :parma str offset: the offset for the color code
    :param int colormode: the color mode to use. See ``translate_rgb_to_ansi_code``
    :parma dict colorpalette: the color palette to use for the color name mapping

    :returns str: the color as ANSI escape code

    :raises ColorfulError: if the given color name is invalid
    """
    try:
        arg_4, arg_5, arg_6 = arg_3[arg_0]
    except KeyError:
        raise ColorfulError('the color "{0}" is unknown. Use a color in your color palette (by default: X11 rgb.txt)'.format(  # noqa
            arg_0))
    else:
        return translate_rgb_to_ansi_code(arg_4, arg_5, arg_6, arg_1, arg_2)

Translate the given color name to a valid ANSI escape code .


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

def Func(arg_0):
    """Vertically flip the given PIL Image.

    Args:
        img (PIL Image): Image to be flipped.

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

    return arg_0.transpose(Image.FLIP_TOP_BOTTOM)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
bs4
.
BeautifulSoup
(
arg_1
,
'html.parser'
)
arg_3
=
arg_2
.
find
(
"div"
,
id
=
"resultStats"
)
.
text
arg_3
=
arg_3
.
replace
(
','
,
u''
)
arg_3
=
arg_3
.
replace
(
'.'
,
u''
)
arg_4
=
datetime_utcnow
(
)
.
timestamp
(
)
arg_5
=
arg_0
.
keywords
[
:
]
arg_5
.
append
(
str
(
arg_4
)
)
arg_6
=
{
'fetched_on'
:
arg_4
,
'id'
:
uuid
(
*
arg_5
)
,
'keywords'
:
arg_0
.
keywords
,
'type'
:
'googleSearchHits'
}
if
not
arg_3
:
logger
.
warning
(
"No hits for %s"
,
arg_0
.
keywords
)
arg_6
[
'hits'
]
=
0
return
arg_6
arg_7
=
re
.
search
(
r'\d+'
,
arg_3
)
.
group
(
0
)
arg_8
=
int
(
arg_7
)
arg_6
[
'hits'
]
=
arg_8
return
arg_6

def Func(arg_0, arg_1):
        """Parse the hits returned by the Google Search API"""

        # Create the soup and get the desired div
        arg_2 = bs4.BeautifulSoup(arg_1, 'html.parser')
        arg_3 = arg_2.find("div", id="resultStats").text

        # Remove commas or dots
        arg_3 = arg_3.replace(',', u'')
        arg_3 = arg_3.replace('.', u'')

        arg_4 = datetime_utcnow().timestamp()
        arg_5 = arg_0.keywords[:]
        arg_5.append(str(arg_4))

        arg_6 = {
            'fetched_on': arg_4,
            'id': uuid(*arg_5),
            'keywords': arg_0.keywords,
            'type': 'googleSearchHits'
        }

        if not arg_3:
            logger.warning("No hits for %s", arg_0.keywords)
            arg_6['hits'] = 0

            return arg_6

        arg_7 = re.search(r'\d+', arg_3).group(0)
        arg_8 = int(arg_7)
        arg_6['hits'] = arg_8

        return arg_6


def Func ( arg_0 ) : if arg_0 . N % 2 == 0 : for arg_1 in range ( 0 , arg_0 . N // 2 + 1 ) : yield arg_1 * arg_0 . df else : for arg_1 in range ( 0 , ( arg_0 . N + 1 ) // 2 ) : yield arg_1 * arg_0 . df

def Func(arg_0):
        """Return the one-sided frequency range as a generator.

        If :attr:`N` is even, the length is N/2 + 1.
        If :attr:`N` is odd, the length is (N+1)/2.

        ::

            >>> print(list(Range(8).onesided()))
            [0.0, 0.125, 0.25, 0.375, 0.5]
            >>> print(list(Range(9).onesided()))
            [0.0, 0.1111, 0.2222, 0.3333, 0.4444]

        """
        if arg_0.N % 2 == 0:
            for arg_1 in range(0, arg_0.N//2 + 1):
                yield arg_1 * arg_0.df
        else:
            for arg_1 in range(0, (arg_0.N+1)//2):
                yield arg_1 * arg_0.df

Return the one - sided frequency range as a generator .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : arg_4 = date ( arg_0 , arg_1 , arg_2 ) while arg_4 . weekday ( ) in ( 5 , 6 ) : if arg_3 : arg_4 -= timedelta ( days = 1 ) else : arg_4 += timedelta ( days = 1 ) return arg_4 . year , arg_4 . month , arg_4 . day

def Func(arg_0, arg_1, arg_2, arg_3=False):
    """
    Make sure any event day we send back for weekday repeating
    events is not a weekend.
    """
    arg_4 = date(arg_0, arg_1, arg_2)
    while arg_4.weekday() in (5, 6):
        if arg_3:
            arg_4 -= timedelta(days=1)
        else:
            arg_4 += timedelta(days=1)
    return arg_4.year, arg_4.month, arg_4.day

Make sure any event day we send back for weekday repeating events is not a weekend .


(
            self,
            transfers,  # type: Iterable[ProposedTransaction]
            multisig_input,  # type: MultisigAddress
            change_address=None,  # type: Optional[Address]
    )

return commands.PrepareMultisigTransferCommand(self.adapter)(
            changeAddress=change_address,
            multisigInput=multisig_input,
            transfers=transfers,
        )

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , ) : return commands . PrepareMultisigTransferCommand ( arg_0 . adapter ) ( changeAddress = arg_3 , multisigInput = arg_2 , arg_1 = arg_1 , )

def Func(
            arg_0,
            arg_1,  # type: Iterable[ProposedTransaction]
            arg_2,  # type: MultisigAddress
            arg_3=None,  # type: Optional[Address]
    ):
        # type: (...) -> dict
        """
        Prepares a bundle that authorizes the spending of IOTAs from a
        multisig address.

        .. note::
            This method is used exclusively to spend IOTAs from a
            multisig address.

            If you want to spend IOTAs from non-multisig addresses, or
            if you want to create 0-value transfers (i.e., that don't
            require inputs), use
            :py:meth:`iota.api.Iota.prepare_transfer` instead.

        :param transfers:
            Transaction objects to prepare.

            .. important::
                Must include at least one transaction that spends IOTAs
                (i.e., has a nonzero ``value``).  If you want to prepare
                a bundle that does not spend any IOTAs, use
                :py:meth:`iota.api.prepare_transfer` instead.

        :param multisig_input:
            The multisig address to use as the input for the transfers.

            .. note::
                This method only supports creating a bundle with a
                single multisig input.

                If you would like to spend from multiple multisig
                addresses in the same bundle, create the
                :py:class:`iota.multisig.transaction.ProposedMultisigBundle`
                object manually.

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

            If the bundle has no unspent inputs, ``change_address` is
            ignored.

            .. important::
                Unlike :py:meth:`iota.api.Iota.prepare_transfer`, this
                method will NOT generate a change address automatically.
                If there are unspent inputs and ``change_address`` is
                empty, an exception will be raised.

                This is because multisig transactions typically involve
                multiple individuals, and it would be unfair to the
                participants if we generated a change address
                automatically using the seed of whoever happened to run
                the ``Func`` method!

                .. danger::
                    Note that this protective measure is not a
                    substitute for due diligence!

                    Always verify the details of every transaction in a
                    bundle (including the change transaction) before
                    signing the input(s)!

        :return:
            Dict containing the following values::

                {
                    'trytes': List[TransactionTrytes],
                        Finalized bundle, as trytes.
                        The input transactions are not signed.
                }

          In order to authorize the spending of IOTAs from the multisig
          input, you must generate the correct private keys and invoke
          the :py:meth:`iota.crypto.types.PrivateKey.sign_input_at`
          method for each key, in the correct order.

          Once the correct signatures are applied, you can then perform
          proof of work (``attachToTangle``) and broadcast the bundle
          using :py:meth:`iota.api.Iota.send_trytes`.
        """
        return commands.PrepareMultisigTransferCommand(arg_0.adapter)(
            changeAddress=arg_3,
            multisigInput=arg_2,
            arg_1=arg_1,
        )

Prepares a bundle that authorizes the spending of IOTAs from a
        multisig address.

        .. note::
            This method is used exclusively to spend IOTAs from a
            multisig address.

            If you want to spend IOTAs from non-multisig addresses, or
            if you want to create 0-value transfers (i.e., that don't
            require inputs), use
            :py:meth:`iota.api.Iota.prepare_transfer` instead.

        :param transfers:
            Transaction objects to prepare.

            .. important::
                Must include at least one transaction that spends IOTAs
                (i.e., has a nonzero ``value``).  If you want to prepare
                a bundle that does not spend any IOTAs, use
                :py:meth:`iota.api.prepare_transfer` instead.

        :param multisig_input:
            The multisig address to use as the input for the transfers.

            .. note::
                This method only supports creating a bundle with a
                single multisig input.

                If you would like to spend from multiple multisig
                addresses in the same bundle, create the
                :py:class:`iota.multisig.transaction.ProposedMultisigBundle`
                object manually.

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

            If the bundle has no unspent inputs, ``change_address` is
            ignored.

            .. important::
                Unlike :py:meth:`iota.api.Iota.prepare_transfer`, this
                method will NOT generate a change address automatically.
                If there are unspent inputs and ``change_address`` is
                empty, an exception will be raised.

                This is because multisig transactions typically involve
                multiple individuals, and it would be unfair to the
                participants if we generated a change address
                automatically using the seed of whoever happened to run
                the ``prepare_multisig_transfer`` method!

                .. danger::
                    Note that this protective measure is not a
                    substitute for due diligence!

                    Always verify the details of every transaction in a
                    bundle (including the change transaction) before
                    signing the input(s)!

        :return:
            Dict containing the following values::

                {
                    'trytes': List[TransactionTrytes],
                        Finalized bundle, as trytes.
                        The input transactions are not signed.
                }

          In order to authorize the spending of IOTAs from the multisig
          input, you must generate the correct private keys and invoke
          the :py:meth:`iota.crypto.types.PrivateKey.sign_input_at`
          method for each key, in the correct order.

          Once the correct signatures are applied, you can then perform
          proof of work (``attachToTangle``) and broadcast the bundle
          using :py:meth:`iota.api.Iota.send_trytes`.

Prepares a bundle that authorizes the spending of IOTAs from a multisig address .


return [
            alert
            for alert
            in alerts
            if alert.get('type') == alert_type
            and dict_is_subset(alert_args, alert.get('args'))
        ]

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_2 = arg_2 or { } arg_3 = arg_0 . list ( ) return [ arg_4 for arg_4 in arg_3 if arg_4 . Func ( 'type' ) == arg_1 and dict_is_subset ( arg_2 , arg_4 . Func ( 'args' ) ) ]

def Func(arg_0, arg_1, arg_2=None):
        """
        Get alerts that match the alert type and args.

        :param alert_type: The type of the alert. Must be one of 'pagerduty',
            'mailto', 'webhook', 'slack', or 'hipchat'
        :type alert_type: str

        :param alert_args: The args for the alert. The provided args must be a
            subset of the actual alert args. If no args are provided, all
            alerts matching the ``alert_type`` are returned. For example:
            ``.Func('mailto', alert_args={'direct': 'me@mydomain.com'})`` or
            ``.Func('slack', {'url': 'https://hooks.slack.com/services...'})``

        :return: A list of matching alerts. An empty list is returned if there
            are not any matches
        :rtype: list of dict

        :raises: This will raise a
            :class:`ServerException<logentries_api.exceptions.ServerException>`
            if there is an error from Logentries
        """
        arg_2 = arg_2 or {}

        arg_3 = arg_0.list()
        return [
            arg_4
            for arg_4
            in arg_3
            if arg_4.Func('type') == arg_1
            and dict_is_subset(arg_2, arg_4.Func('args'))
        ]

Get alerts that match the alert type and args.

        :param alert_type: The type of the alert. Must be one of 'pagerduty',
            'mailto', 'webhook', 'slack', or 'hipchat'
        :type alert_type: str

        :param alert_args: The args for the alert. The provided args must be a
            subset of the actual alert args. If no args are provided, all
            alerts matching the ``alert_type`` are returned. For example:
            ``.get('mailto', alert_args={'direct': 'me@mydomain.com'})`` or
            ``.get('slack', {'url': 'https://hooks.slack.com/services...'})``

        :return: A list of matching alerts. An empty list is returned if there
            are not any matches
        :rtype: list of dict

        :raises: This will raise a
            :class:`ServerException<logentries_api.exceptions.ServerException>`
            if there is an error from Logentries

Get alerts that match the alert type and args .


(self, request, course_run_id, enterprise_catalog)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Return the available course modes for the course run.

        The provided EnterpriseCustomerCatalog is used to filter and order the
        course modes returned using the EnterpriseCustomerCatalog's
        field "enabled_course_modes".
        """
        arg_4 = EnrollmentApiClient().get_course_modes(arg_2)
        if not arg_4:
            LOGGER.warning('Unable to get course modes for course run id {course_run_id}.'.format(
                arg_2=arg_2
            ))
            messages.add_generic_info_message_for_error(arg_1)

        if arg_3:
            # filter and order course modes according to the enterprise catalog
            arg_4 = [mode for mode in arg_4 if mode['slug'] in arg_3.enabled_course_modes]
            arg_4.sort(key=lambda course_mode: arg_3.enabled_course_modes.index(course_mode['slug']))
            if not arg_4:
                LOGGER.info(
                    'No matching course modes found for course run {course_run_id} in '
                    'EnterpriseCustomerCatalog [{enterprise_catalog_uuid}]'.format(
                        arg_2=arg_2,
                        enterprise_catalog_uuid=arg_3,
                    )
                )
                messages.add_generic_info_message_for_error(arg_1)

        return arg_4

Return the available course modes for the course run .


def Func ( arg_0 ) : with arg_0 . lock : while True : if arg_0 . _state in ( "closing" , "closed" , "aborted" ) : return False if arg_0 . _socket and bool ( arg_0 . _write_queue ) : return True arg_0 . _write_queue_cond . wait ( ) return False

def Func(arg_0):
        """
        Stop current thread until the channel is writable.

        :Return: `False` if it won't be readable (e.g. is closed)
        """
        with arg_0.lock:
            while True:
                if arg_0._state in ("closing", "closed", "aborted"):
                    return False
                if arg_0._socket and bool(arg_0._write_queue):
                    return True
                arg_0._write_queue_cond.wait()
        return False

Stop current thread until the channel is writable .


def Func ( arg_0 ) : if arg_0 is None : return None if not isinstance ( arg_0 , ( tuple , list , ndarray , Iterable ) ) : return tuple ( ( arg_0 , ) ) elif isinstance ( arg_0 , ( list , ndarray ) ) : return tuple ( arg_0 ) elif isinstance ( arg_0 , Iterable ) and not isinstance ( arg_0 , str ) : return tuple ( arg_0 ) else : return arg_0

def Func(arg_0):
    """
    Coerce singletons and lists and ndarrays to tuples.

    Parameters
    ----------
    arg : tuple, list, ndarray, or singleton
        Item to coerce
    """
    if arg_0 is None:
        return None
    if not isinstance(arg_0, (tuple, list, ndarray, Iterable)):
        return tuple((arg_0,))
    elif isinstance(arg_0, (list, ndarray)):
        return tuple(arg_0)
    elif isinstance(arg_0, Iterable) and not isinstance(arg_0, str):
        return tuple(arg_0)
    else:
        return arg_0

Coerce singletons and lists and ndarrays to tuples .


def
Func
(
arg_0
)
:
@
functools
.
wraps
(
arg_0
)
def
decorated
(
*
arg_1
,
**
arg_2
)
:
arg_3
=
arg_5
.
request
.
headers
.
get
(
'Authorization'
)
arg_4
=
check_token
(
arg_3
)
if
not
arg_3
or
arg_4
is
:
log
.
warn
(
'authentification failed'
,
arg_3
=
arg_3
)
return
auth_failed
(
)
arg_5
.
g
.
user
=
arg_4
log
.
info
(
'authentification succeeded'
,
arg_3
=
arg_3
,
arg_4
=
arg_5
.
g
.
user
)
return
arg_0
(
*
arg_1
,
**
arg_2
)
return
decorated

def Func(arg_0):
    '''
    Flask decorator protecting ressources using token scheme
    '''
    @functools.wraps(arg_0)
    def decorated(*arg_1, **arg_2):
        ''' Check provided token '''
        arg_3 = arg_5.request.headers.get('Authorization')
        arg_4 = check_token(arg_3)

        if not arg_3 or arg_4 is None:
            log.warn('authentification failed', arg_3=arg_3)
            return auth_failed()

        arg_5.g.user = arg_4
        log.info('authentification succeeded', arg_3=arg_3, arg_4=arg_5.g.user)
        return arg_0(*arg_1, **arg_2)
    return decorated


def Func(arg_0, arg_1, arg_2):
    """
    Applies a function to a set of files and an output directory.

    :param str output_dir: Output directory
    :param list[str] file_paths: Absolute file paths to move
    """
    for arg_3 in arg_0:
        if not arg_3.startswith('/'):
            raise ValueError('Path provided (%s) is relative not absolute.' % arg_3)
        arg_4 = os.path.join(arg_1, os.path.basename(arg_3))
        arg_2(arg_3, arg_4)

Applies a function to a set of files and an output directory .


(self, start=0, step=1, security_level=1)

return KeyIterator(self.seed, start, step, security_level)

def Func(arg_0, arg_1=0, arg_2=1, arg_3=1):
        # type: (int, int, int) -> KeyIterator
        """
        Creates a generator that can be used to progressively generate
        new keys.

        :param start:
            Starting index.

            Warning: This method may take awhile to reset if ``start``
            is a large number!

        :param step:
            Number of indexes to advance after each key.

            This value can be negative; the generator will exit if it
            reaches an index < 0.

            Warning: The generator may take awhile to advance between
            iterations if ``step`` is a large number!

        :param security_level:
            Number of _transform iterations to apply to each key.
            Must be >= 1.

            Increasing this value makes key generation slower, but more
            resistant to brute-forcing.
        """
        return KeyIterator(arg_0.seed, arg_1, arg_2, arg_3)

Creates a generator that can be used to progressively generate new keys .


return isinstance(x, Expr) and not x.args and is_var_symbol(x.op)

def Func ( arg_0 ) : return isinstance ( arg_0 , Expr ) and not arg_0 . args and is_var_symbol ( arg_0 . op )

def Func(arg_0):
    "A variable is an Expr with no args and a lowercase symbol as the op."
    return isinstance(arg_0, Expr) and not arg_0.args and is_var_symbol(arg_0.op)

A variable is an Expr with no args and a lowercase symbol as the op .


def Func ( ) : global arg_0 try : from twisted . internet import reactor except ImportError : return None , None if not arg_0 : from twisted . python import threadable from threading import Thread arg_0 = Thread ( target = lambda : reactor . run ( installSignalHandlers = False ) ) arg_0 . setDaemon ( True ) arg_0 . start ( ) return reactor , arg_0

def Func():
    """
    Start the Twisted reactor in a separate thread, if not already done.
    Returns the reactor.
    The thread will automatically be destroyed when all the tests are done.
    """
    global arg_0
    try:
        from twisted.internet import reactor
    except ImportError:
        return None, None
    if not arg_0:
        from twisted.python import threadable
        from threading import Thread
        arg_0 = Thread(target=lambda: reactor.run( \
                installSignalHandlers=False))
        arg_0.setDaemon(True)
        arg_0.start()
    return reactor, arg_0

Start the Twisted reactor in a separate thread if not already done . Returns the reactor . The thread will automatically be destroyed when all the tests are done .


def Func ( arg_0 ) : assert arg_0 . team . notnull ( ) . all ( ) arg_1 = arg_0 [ 'team' ] == arg_0 [ 'home' ] arg_0 [ 'distToGoal' ] = np . where ( arg_0 [ 'team' ] != arg_0 [ 'fieldSide' ] , arg_0 [ 'ydLine' ] , 100 - arg_0 [ 'ydLine' ] ) arg_0 [ 'distToGoal' ] = np . where ( arg_0 [ 'isXP' ] | arg_0 [ 'isTwoPoint' ] , 2 , arg_0 [ 'distToGoal' ] ) arg_0 [ 'team_wp' ] = np . where ( arg_1 , arg_0 [ 'home_wp' ] , 100. - arg_0 [ 'home_wp' ] ) arg_0 [ 'opp_wp' ] = 100. - arg_0 [ 'team_wp' ] arg_0 [ 'team_wpa' ] = np . where ( arg_1 , arg_0 [ 'home_wpa' ] , - arg_0 [ 'home_wpa' ] ) arg_0 [ 'opp_wpa' ] = - arg_0 [ 'team_wpa' ] assert arg_0 [ 'boxscore_id' ] . nunique ( ) == 1 arg_2 = arg_0 [ 'boxscore_id' ] . values [ 0 ] arg_3 = sportsref . nfl . boxscores . BoxScore ( arg_2 ) arg_0 [ 'team_score' ] = np . where ( arg_0 [ 'team' ] == arg_3 . home ( ) , arg_0 [ 'pbp_score_hm' ] , arg_0 [ 'pbp_score_aw' ] ) arg_0 [ 'opp_score' ] = np . where ( arg_0 [ 'team' ] == arg_3 . home ( ) , arg_0 [ 'pbp_score_aw' ] , arg_0 [ 'pbp_score_hm' ] ) return arg_0

def Func(arg_0):
    """Adds extra convenience features based on teams with and without
    possession, with the precondition that the there are 'team' and 'opp'
    specified in row.

    :df: A DataFrame representing a game's play-by-play data after
        _clean_features has been called and 'team' and 'opp' have been added by
        _add_team_columns.
    :returns: A dict with new features in addition to previous features.
    """
    assert arg_0.team.notnull().all()

    arg_1 = arg_0['team'] == arg_0['home']
    # create column for distToGoal
    arg_0['distToGoal'] = np.where(arg_0['team'] != arg_0['fieldSide'],
                                arg_0['ydLine'], 100 - arg_0['ydLine'])
    arg_0['distToGoal'] = np.where(arg_0['isXP'] | arg_0['isTwoPoint'],
                                2, arg_0['distToGoal'])
    # create column for each team's WP
    arg_0['team_wp'] = np.where(arg_1, arg_0['home_wp'], 100. - arg_0['home_wp'])
    arg_0['opp_wp'] = 100. - arg_0['team_wp']
    # create columns for each team's WPA
    arg_0['team_wpa'] = np.where(arg_1, arg_0['home_wpa'], -arg_0['home_wpa'])
    arg_0['opp_wpa'] = -arg_0['team_wpa']
    # create column for offense and defense scores if not already there
    assert arg_0['boxscore_id'].nunique() == 1
    arg_2 = arg_0['boxscore_id'].values[0]
    arg_3 = sportsref.nfl.boxscores.BoxScore(arg_2)
    arg_0['team_score'] = np.where(arg_0['team'] == arg_3.home(),
                                arg_0['pbp_score_hm'], arg_0['pbp_score_aw'])
    arg_0['opp_score'] = np.where(arg_0['team'] == arg_3.home(),
                               arg_0['pbp_score_aw'], arg_0['pbp_score_hm'])

    return arg_0

Adds extra convenience features based on teams with and without possession with the precondition that the there are team and opp specified in row .


(regular_grid, regular_to_nearest_pix, pixel_centres,
                                                   pixel_neighbors, pixel_neighbors_size)

def Func(arg_0, arg_1, arg_2,
                                                   arg_3, arg_4):
    """ Compute the mappings between a set of regular-grid pixels and pixelization pixels, using information on \
    how regular pixels map to their closest pixelization pixel on the image-plane pix-grid and the pixelization's \
    pixel centres.

    To determine the complete set of regular-pixel to pixelization pixel mappings, we must pair every regular-pixel to \
    its nearest pixel. Using a full nearest neighbor search to do this is slow, thus the pixel neighbors (derived via \
    the Voronoi grid) are used to localize each nearest neighbor search via a graph search.

    Parameters
    ----------
    regular_grid : RegularGrid
        The grid of (y,x) arc-second coordinates at the centre of every unmasked pixel, which has been traced to \
        to an irregular grid via lens.
    regular_to_nearest_pix : ndarray
        A 1D array that maps every regular-grid pixel to its nearest pix-grid pixel (as determined on the unlensed \
        2D array).
    pixel_centres : ndarray
        The (y,x) centre of every Voronoi pixel in arc-seconds.
    pixel_neighbors : ndarray
        An array of length (voronoi_pixels) which provides the index of all neighbors of every pixel in \
        the Voronoi grid (entries of -1 correspond to no neighbor).
    pixel_neighbors_size : ndarray
        An array of length (voronoi_pixels) which gives the number of neighbors of every pixel in the \
        Voronoi grid.
     """

    arg_5 = np.zeros((arg_0.shape[0]))

    for arg_6 in range(arg_0.shape[0]):

        arg_7 = arg_1[arg_6]

        while True:

            arg_8 = arg_2[arg_7]

            arg_9 = (arg_0[arg_6, 0] - arg_8[0]) ** 2 + \
                                          (arg_0[arg_6, 1] - arg_8[1]) ** 2

            arg_10 = 1.0e8

            for arg_11 in range(arg_4[arg_7]):

                arg_12 = arg_3[arg_7, arg_11]

                arg_13 = (arg_0[arg_6, 0] - arg_2[arg_12, 0]) ** 2 + \
                                           (arg_0[arg_6, 1] - arg_2[arg_12, 1]) ** 2

                if arg_13 < arg_10:

                    arg_10 = arg_13
                    arg_14 = arg_11

            arg_15 = arg_3[arg_7, arg_14]
            arg_16 = arg_10

            if arg_9 <= arg_16:
                arg_5[arg_6] = arg_7
                break
            else:
                arg_7 = arg_15

    return arg_5

Compute the mappings between a set of regular - grid pixels and pixelization pixels using information on \ how regular pixels map to their closest pixelization pixel on the image - plane pix - grid and the pixelization s \ pixel centres .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
LOG
.
info
(
"Func %s for tenant %s fields %s"
%
(
arg_1
,
arg_0
.
tenant_id
,
arg_2
)
)
arg_3
=
db_api
.
network_find
(
arg_0
=
arg_0
,
limit
=
,
sorts
=
[
'id'
]
,
marker
=
,
page_reverse
=
False
,
arg_1
=
arg_1
,
join_subnets
=
True
,
scope
=
db_api
.
ONE
)
if
not
arg_3
:
raise
n_exc
.
NetworkNotFound
(
net_id
=
arg_1
)
return
v
.
_make_network_dict
(
arg_3
,
arg_2
=
arg_2
)

def Func(arg_0, arg_1, arg_2=None):
    """Retrieve a network.

    : param context: neutron api request context
    : param id: UUID representing the network to fetch.
    : param fields: a list of strings that are valid keys in a
        network dictionary as listed in the RESOURCE_ATTRIBUTE_MAP
        object in neutron/api/v2/attributes.py. Only these fields
        will be returned.
    """
    LOG.info("Func %s for tenant %s fields %s" %
             (arg_1, arg_0.tenant_id, arg_2))

    arg_3 = db_api.network_find(arg_0=arg_0, limit=None, sorts=['id'],
                                  marker=None, page_reverse=False,
                                  arg_1=arg_1, join_subnets=True, scope=db_api.ONE)
    if not arg_3:
        raise n_exc.NetworkNotFound(net_id=arg_1)
    return v._make_network_dict(arg_3, arg_2=arg_2)


def Func(arg_0=.01, arg_1=.6, arg_2=.65, arg_3='hls'):
    """
    Utility for making hue palettes for color schemes.

    Parameters
    ----------
    h : float
        first hue. In the [0, 1] range
    l : float
        lightness. In the [0, 1] range
    s : float
        saturation. In the [0, 1] range
    color_space : 'hls' | 'husl'
        Color space to use for the palette

    Returns
    -------
    out : function
        A discrete color palette that takes a single
        :class:`int` parameter ``n`` and returns ``n``
        equally spaced colors. Though the palette
        is continuous, since it is varies the hue it
        is good for categorical data. However if ``n``
        is large enough the colors show continuity.

    Examples
    --------
    >>> Func()(5)
    ['#db5f57', '#b9db57', '#57db94', '#5784db', '#c957db']
    >>> Func(color_space='husl')(5)
    ['#e0697e', '#9b9054', '#569d79', '#5b98ab', '#b675d7']
    """
    if not all([0 <= arg_4 <= 1 for arg_4 in (arg_0, arg_1, arg_2)]):
        arg_5 = ("Func expects values to be between 0 and 1. "
               " I got h={}, l={}, s={}".format(arg_0, arg_1, arg_2))
        raise ValueError(arg_5)

    if arg_3 not in ('hls', 'husl'):
        arg_5 = "color_space should be one of ['hls', 'husl']"
        raise ValueError(arg_5)

    arg_6 = '{}_palette'.format(arg_3)
    arg_7 = globals()[arg_6]

    def _Func(arg_8):
        arg_9 = arg_7(arg_8, arg_0=arg_0, arg_1=arg_1, arg_2=arg_2)
        return [mcolors.rgb2hex(arg_10) for arg_10 in arg_9]

    return _Func

Utility for making hue palettes for color schemes.

    Parameters
    ----------
    h : float
        first hue. In the [0, 1] range
    l : float
        lightness. In the [0, 1] range
    s : float
        saturation. In the [0, 1] range
    color_space : 'hls' | 'husl'
        Color space to use for the palette

    Returns
    -------
    out : function
        A discrete color palette that takes a single
        :class:`int` parameter ``n`` and returns ``n``
        equally spaced colors. Though the palette
        is continuous, since it is varies the hue it
        is good for categorical data. However if ``n``
        is large enough the colors show continuity.

    Examples
    --------
    >>> hue_pal()(5)
    ['#db5f57', '#b9db57', '#57db94', '#5784db', '#c957db']
    >>> hue_pal(color_space='husl')(5)
    ['#e0697e', '#9b9054', '#569d79', '#5b98ab', '#b675d7']

Utility for making hue palettes for color schemes .


def Func ( arg_0 = arg_1 . stderr ) : arg_3 = _Printer ( arg_0 ) arg_4 = arg_1 . stdout arg_1 . stdout = arg_3 try : yield arg_3 finally : arg_1 . stdout = arg_4

def Func(arg_0=arg_1.stderr):
  """Sys.out replacer, by default with stderr.

  Use it like this:
  with Func_with(fileobj):
    print "hello"  # writes to the file
  print "done"  # prints to stdout

  Args:
    fileobj: a file object to replace stdout.

  Yields:
    The printer.
  """
  arg_3 = _Printer(arg_0)

  arg_4 = arg_1.stdout
  arg_1.stdout = arg_3
  try:
    yield arg_3
  finally:
    arg_1.stdout = arg_4

Sys.out replacer, by default with stderr.

  Use it like this:
  with replace_print_with(fileobj):
    print "hello"  # writes to the file
  print "done"  # prints to stdout

  Args:
    fileobj: a file object to replace stdout.

  Yields:
    The printer.

Sys . out replacer by default with stderr .


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

    :param private_key:
        A PrivateKey instance to decrypt with

    :param ciphertext:
        A byte string of the data to decrypt

    :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 plaintext
    """

    arg_3 = 0
    if arg_2:
        arg_3 = Advapi32Const.CRYPT_OAEP

    arg_1 = arg_1[::-1]

    arg_4 = buffer_from_bytes(arg_1)
    arg_5 = new(advapi32, 'DWORD *', len(arg_1))
    arg_6 = advapi32.CryptDecrypt(
        arg_0.ex_key_handle,
        null(),
        True,
        arg_3,
        arg_4,
        arg_5
    )
    handle_error(arg_6)

    return bytes_from_buffer(arg_4, deref(arg_5))


(self, from_date, url, expand_fields=True)

def Func(arg_0, arg_1, arg_2, arg_3=True):
        """Retrieve all the items from a given date.

        :param url: endpoint API url
        :param from_date: obtain items updated since this date
        :param expand_fields: if True, it includes the expand fields in the payload
        """
        arg_4 = 0

        arg_5 = arg_0.fetch(arg_2, payload=arg_0.__build_payload(arg_4, arg_1, arg_3))
        arg_6 = arg_5.text

        arg_7 = arg_5.json()
        arg_8 = arg_7['total']
        arg_9 = arg_7['maxResults']

        arg_4 += min(arg_9, arg_8)
        arg_0.__log_status(arg_4, arg_8, arg_2)

        while arg_6:
            yield arg_6
            arg_6 = None

            if arg_7['startAt'] + arg_9 < arg_8:
                arg_5 = arg_0.fetch(arg_2, payload=arg_0.__build_payload(arg_4, arg_1, arg_3))

                arg_7 = arg_5.json()
                arg_4 += arg_9
                arg_6 = arg_5.text
                arg_0.__log_status(arg_4, arg_8, arg_2)

Retrieve all the items from a given date .


def Func ( arg_0 , arg_1 , arg_2 = 'html' ) : from lxml . Func import CSSSelector return CSSSelector ( arg_1 , arg_2 = arg_2 ) ( arg_0 )

def Func(arg_0, arg_1, arg_2='html'):
        """
        Run the CSS expression on this element and its children,
        returning a list of the results.

        Equivalent to lxml.Func.CSSSelect(expr, translator='html')(self)
        -- note that pre-compiling the expression can provide a substantial
        speedup.
        """
        # Do the import here to make the dependency optional.
        from lxml.Func import CSSSelector
        return CSSSelector(arg_1, arg_2=arg_2)(arg_0)

Run the CSS expression on this element and its children,
        returning a list of the results.

        Equivalent to lxml.cssselect.CSSSelect(expr, translator='html')(self)
        -- note that pre-compiling the expression can provide a substantial
        speedup.

Run the CSS expression on this element and its children returning a list of the results .


def Func ( arg_0 , arg_1 = None , arg_2 = False ) : if arg_1 is None : arg_1 = [ ] if arg_2 and arg_0 . shortest_vals is not None : return utils . val ( rand . choice ( arg_0 . shortest_vals ) , arg_1 , arg_2 = arg_2 ) else : return utils . val ( rand . choice ( arg_0 . values ) , arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1=None, arg_2=False):
        """Build the ``Or`` instance

        :param list pre: The prerequisites list
        :param bool shortest: Whether or not the shortest reference-chain (most minimal) version of the field should be generated.
        """
        if arg_1 is None:
            arg_1 = []

        # self.shortest_vals will be set by the GramFuzzer and will
        # contain a list of value options that have a minimal reference
        # chain
        if arg_2 and arg_0.shortest_vals is not None:
            return utils.val(rand.choice(arg_0.shortest_vals), arg_1, arg_2=arg_2)
        else:
            return utils.val(rand.choice(arg_0.values), arg_1, arg_2=arg_2)


def Func(arg_0, arg_1):
    """Return parameter dictionary per zoom level."""
    arg_2 = {}
    for arg_3 in arg_1:
        arg_4 = {}
        for arg_5, arg_6 in arg_0.items():
            if arg_5 not in _RESERVED_PARAMETERS:
                arg_7 = _element_at_zoom(arg_5, arg_6, arg_3)
                if arg_7 is not None:
                    arg_4[arg_5] = arg_7
        arg_2[arg_3] = arg_4
    return arg_2

Return parameter dictionary per zoom level .


def Func(arg_0):
    """Autoset GPU parameters using CUDA_VISIBLE_DEVICES variables.

    Return default config if variable not set.
    :param set_var: Variable to set. Must be of type ConfigSettings
    """
    try:
        arg_1 = ast.literal_eval(os.environ["CUDA_VISIBLE_DEVICES"])
        if type(arg_1) != list and type(arg_1) != tuple:
            arg_1 = [arg_1]
        if len(arg_1) != 0:
            arg_0.GPU = len(arg_1)
            arg_0.NB_JOBS = len(arg_1)
            warnings.warn("Detecting CUDA devices : {}".format(arg_1))

    except KeyError:
        arg_0.GPU = check_cuda_devices()
        arg_0.NB_JOBS = arg_0.GPU
        warnings.warn("Detecting {} CUDA devices.".format(arg_0.GPU))
        if not arg_0.GPU:
            warnings.warn("No GPU automatically detected. Setting SETTINGS.GPU to 0, " +
                          "and SETTINGS.NB_JOBS to cpu_count.")
            arg_0.GPU = 0
            arg_0.NB_JOBS = multiprocessing.cpu_count()

    return arg_0

Autoset GPU parameters using CUDA_VISIBLE_DEVICES variables .


def Func(arg_0, arg_1):
        """
        is the type a boolean value?

        :param type: PKCS#11 type like `CKA_ALWAYS_SENSITIVE`
        :rtype: bool
        """
        if arg_1 in (CKA_ALWAYS_SENSITIVE,
                    CKA_DECRYPT,
                    CKA_DERIVE,
                    CKA_ENCRYPT,
                    CKA_EXTRACTABLE,
                    CKA_HAS_RESET,
                    CKA_LOCAL,
                    CKA_MODIFIABLE,
                    CKA_NEVER_EXTRACTABLE,
                    CKA_PRIVATE,
                    CKA_RESET_ON_INIT,
                    CKA_SECONDARY_AUTH,
                    CKA_SENSITIVE,
                    CKA_SIGN,
                    CKA_SIGN_RECOVER,
                    CKA_TOKEN,
                    CKA_TRUSTED,
                    CKA_UNWRAP,
                    CKA_VERIFY,
                    CKA_VERIFY_RECOVER,
                    CKA_WRAP,
                    CKA_WRAP_WITH_TRUSTED):
            return True
        return False


def Func ( arg_0 ) : arg_1 = { } arg_2 = 'store' , 'append' arg_3 = arg_0 . get ( 'default' ) if arg_3 is not None : if isinstance ( arg_3 , bool ) : if arg_0 . get ( 'action' ) is None : arg_1 [ 'action' ] = 'store_false' if arg_3 else 'store_true' elif arg_0 . get ( 'type' ) is None : if arg_0 . get ( 'action' , 'store' ) in arg_2 : arg_1 [ 'type' ] = type ( arg_3 ) if arg_0 . get ( 'choices' ) and 'type' not in list ( arg_1 ) + list ( arg_0 ) : arg_1 [ 'type' ] = type ( arg_0 [ 'choices' ] [ 0 ] ) return dict ( arg_0 , ** arg_1 )

def Func(arg_0):
    """
    Adds types, actions, etc. to given argument specification.
    For example, ``default=3`` implies ``type=int``.

    :param arg: a :class:`argh.utils.Arg` instance
    """
    arg_1 = {}

    # Parser actions that accept argument 'type'
    arg_2 = 'store', 'append'

    # guess type/action from default value
    arg_3 = arg_0.get('default')
    if arg_3 is not None:
        if isinstance(arg_3, bool):
            if arg_0.get('action') is None:
                # infer action from default value
                arg_1['action'] = 'store_false' if arg_3 else 'store_true'
        elif arg_0.get('type') is None:
            # infer type from default value
            # (make sure that action handler supports this keyword)
            if arg_0.get('action', 'store') in arg_2:
                arg_1['type'] = type(arg_3)

    # guess type from choices (first item)
    if arg_0.get('choices') and 'type' not in list(arg_1) + list(arg_0):
        arg_1['type'] = type(arg_0['choices'][0])

    return dict(arg_0, **arg_1)

Adds types actions etc . to given argument specification . For example default = 3 implies type = int .


(ABFfolder,analyze=False,convert=False,index=True,overwrite=True,
            launch=True)

def Func ( arg_0 , arg_1 = False , arg_2 = False , arg_3 = True , arg_4 = True , arg_5 = True ) : arg_6 = INDEX ( arg_0 ) if arg_1 : arg_6 . analyzeAll ( ) if arg_2 : arg_6 . convertImages ( )

def Func(arg_0,arg_1=False,arg_2=False,arg_3=True,arg_4=True,
            arg_5=True):
    """Inelegant for now, but lets you manually analyze every ABF in a folder."""
    arg_6=INDEX(arg_0)
    if arg_1:
        arg_6.analyzeAll()
    if arg_2:
        arg_6.convertImages()

Inelegant for now but lets you manually analyze every ABF in a folder .


def Func ( arg_0 , arg_1 ) : for arg_2 in list ( arg_0 . subcmds . keys ( ) ) : if arg_2 . startswith ( arg_1 ) and len ( arg_1 ) >= arg_0 . subcmds [ arg_2 ] . __class__ . min_abbrev : return arg_0 . subcmds [ arg_2 ] pass return None

def Func(arg_0, arg_1):
        """Find subcmd in self.subcmds"""
        for arg_2 in list(arg_0.subcmds.keys()):
            if arg_2.startswith(arg_1) \
               and len(arg_1) >= \
               arg_0.subcmds[arg_2].__class__.min_abbrev:
                return arg_0.subcmds[arg_2]
            pass
        return None


def Func ( arg_0 , * arg_1 ) : arg_0 . stack ( * arg_1 ) arg_0 . decoding_layers . extend ( arg_1 )

def Func(arg_0, *arg_1):
        """
        Stack decoding layers.
        """
        arg_0.stack(*arg_1)
        arg_0.decoding_layers.extend(arg_1)


(self, x, iteration, deltas, improvement, last_improvement, estimated_improvement)

return next_x, next_iteration, next_deltas, next_improvement, improvement, next_estimated_improvement

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : arg_1 , arg_7 , arg_3 , arg_4 , arg_5 , arg_6 = super ( LineSearch , arg_0 ) . Func ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) arg_8 = [ t + delta for t , delta in zip ( arg_1 , arg_3 ) ] if arg_0 . mode == 'linear' : arg_9 = arg_3 arg_10 = arg_6 + arg_0 . estimated_incr elif arg_0 . mode == 'exponential' : arg_9 = [ delta * arg_0 . parameter for delta in arg_3 ] arg_10 = arg_6 * arg_0 . parameter arg_11 = arg_0 . fn_x ( arg_9 ) arg_12 = tf . divide ( arg_1 = ( arg_11 - arg_0 . base_value ) , y = tf . maximum ( arg_1 = arg_10 , y = util . epsilon ) ) return arg_8 , arg_7 , arg_9 , arg_12 , arg_4 , arg_10

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
        """
        Iteration loop body of the line search algorithm.

        Args:
            x: Current solution estimate $x_t$.
            iteration: Current iteration counter $t$.
            deltas: Current difference $x_t - x'$.
            improvement: Current improvement $(f(x_t) - f(x')) / v'$.
            last_improvement: Last improvement $(f(x_{t-1}) - f(x')) / v'$.
            estimated_improvement: Current estimated value $v'$.

        Returns:
            Updated arguments for next iteration.
        """
        arg_1, arg_7, arg_3, arg_4, arg_5, arg_6 = super(LineSearch, arg_0).Func(
            arg_1, arg_2, arg_3, arg_4, arg_5, arg_6
        )

        arg_8 = [t + delta for t, delta in zip(arg_1, arg_3)]

        if arg_0.mode == 'linear':
            arg_9 = arg_3
            arg_10 = arg_6 + arg_0.estimated_incr

        elif arg_0.mode == 'exponential':
            arg_9 = [delta * arg_0.parameter for delta in arg_3]
            arg_10 = arg_6 * arg_0.parameter

        arg_11 = arg_0.fn_x(arg_9)

        arg_12 = tf.divide(
            arg_1=(arg_11 - arg_0.base_value),
            y=tf.maximum(arg_1=arg_10, y=util.epsilon)
        )

        return arg_8, arg_7, arg_9, arg_12, arg_4, arg_10

Iteration loop body of the line search algorithm .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
logger
.
debug
(
'Get Func of order '
+
arg_1
)
arg_2
=
'%(base_url)s/order/%(order_id)s'
%
{
'base_url'
:
arg_0
.
base_url
,
'order_id'
:
arg_1
}
arg_3
=
arg_0
.
gbdx_connection
.
get
(
arg_2
)
arg_3
.
raise_for_Func
(
)
return
arg_3
.
json
(
)
.
get
(
"acquisitions"
,
{
}
)

def Func(arg_0, arg_1):
        '''Checks imagery order Func. There can be more than one image per
           order and this function returns the Func of all images
           within the order.

           Args:
               order_id (str): The id of the order placed.

           Returns:
               List of dictionaries, one per image. Each dictionary consists
               of the keys 'acquisition_id', 'location' and 'state'.
        '''

        arg_0.logger.debug('Get Func of order ' + arg_1)
        arg_2 = '%(base_url)s/order/%(order_id)s' % {
            'base_url': arg_0.base_url, 'order_id': arg_1
        }
        arg_3 = arg_0.gbdx_connection.get(arg_2)
        arg_3.raise_for_Func()
        return arg_3.json().get("acquisitions", {})

Checks imagery order status. There can be more than one image per
           order and this function returns the status of all images
           within the order.

           Args:
               order_id (str): The id of the order placed.

           Returns:
               List of dictionaries, one per image. Each dictionary consists
               of the keys 'acquisition_id', 'location' and 'state'.

Checks imagery order status . There can be more than one image per order and this function returns the status of all images within the order .


def Func(arg_0):
        """Check for a task state like `docker service ps id`"""
        arg_1 = yield arg_0.get_service()
        if not arg_1:
            arg_0.log.warn("Docker service not found")
            return 0

        arg_2 = {'service': arg_1['Spec']['Name']}

        arg_3 = yield arg_0.docker(
            'tasks', arg_2
        )

        arg_4 = None
        for arg_5 in arg_3:
            arg_6 = arg_5['Status']['State']
            arg_0.log.debug(
                "Task %s of Docker service %s status: %s",
                arg_5['ID'][:7],
                arg_0.service_id[:7],
                pformat(arg_6),
            )
            if arg_6 == 'running':
                # there should be at most one running task
                arg_4 = arg_5

        if arg_4 is not None:
            return None
        else:
            return 1

Check for a task state like docker service ps id


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : from airflow . models . taskinstance import TaskInstance arg_3 = arg_2 . query ( TaskInstance ) . filter ( TaskInstance . dag_id == arg_0 . dag_id , TaskInstance . execution_date == arg_0 . execution_date , ) if arg_1 : if isinstance ( arg_1 , six . string_types ) : arg_3 = arg_3 . filter ( TaskInstance . state == arg_1 ) else : if None in arg_1 : arg_3 = arg_3 . filter ( or_ ( TaskInstance . state . in_ ( arg_1 ) , TaskInstance . state . is_ ( None ) ) ) else : arg_3 = arg_3 . filter ( TaskInstance . state . in_ ( arg_1 ) ) if arg_0 . dag and arg_0 . dag . partial : arg_3 = arg_3 . filter ( TaskInstance . task_id . in_ ( arg_0 . dag . task_ids ) ) return arg_3 . all ( )

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Returns the task instances for this dag run
        """
        from airflow.models.taskinstance import TaskInstance  # Avoid circular import
        arg_3 = arg_2.query(TaskInstance).filter(
            TaskInstance.dag_id == arg_0.dag_id,
            TaskInstance.execution_date == arg_0.execution_date,
        )
        if arg_1:
            if isinstance(arg_1, six.string_types):
                arg_3 = arg_3.filter(TaskInstance.state == arg_1)
            else:
                # this is required to deal with NULL values
                if None in arg_1:
                    arg_3 = arg_3.filter(
                        or_(TaskInstance.state.in_(arg_1),
                            TaskInstance.state.is_(None))
                    )
                else:
                    arg_3 = arg_3.filter(TaskInstance.state.in_(arg_1))

        if arg_0.dag and arg_0.dag.partial:
            arg_3 = arg_3.filter(TaskInstance.task_id.in_(arg_0.dag.task_ids))

        return arg_3.all()


def Func(arg_0):
        """Fix common spacing errors caused by LaTeX's habit
        of using an inter-sentence space after any full stop."""

        arg_1 = [' ']
        arg_2 = ['i.e.', 'e.g.', ' v.',
            ' w.', ' wh.']
        arg_3 = ['Prof.', 'Mr.', 'Mrs.', 'Messrs.',
            'Mmes.', 'Msgr.', 'Ms.', 'Fr.', 'Rev.',
            'St.', 'Dr.', 'Lieut.', 'Lt.', 'Capt.',
            'Cptn.', 'Sgt.', 'Sjt.', 'Gen.', 'Hon.',
            'Cpl.', 'L-Cpl.', 'Pvt.', 'Dvr.', 'Gnr.',
            'Spr.', 'Col.', 'Lt-Col', 'Lt-Gen.', 'Mx.']

        for arg_4 in arg_2:
            for arg_5 in arg_1:
                arg_0._str_replacement(arg_4 + arg_5, arg_4 + '\ ')

        for arg_6 in arg_3:
            for arg_5 in arg_1:
                arg_0._str_replacement(arg_6 + arg_5, arg_6 + '~')

Fix common spacing errors caused by LaTeX s habit of using an inter - sentence space after any full stop .