clipppy.utils

Subpackages

Submodules

Package Contents

clipppy.utils._allmatch
clipppy.utils._nomatch
class clipppy.utils.PseudoString(meta: typing._T, *args, **kwargs)

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

__hash__(self)

Return hash(self).

classmethod init(cls, *args: typing._Tin) PseudoString[tuple[typing._Tin]]
class clipppy.utils.Sentinel

Generic enumeration.

Derive from this class to define new enumerations.

__repr__(self)

Return repr(self).

clipppy.utils.caller(obj)
clipppy.utils.compose(*funcs: Callable[[typing._Tin], Union[typing._Tin, typing._Tout]]) Callable[[typing._Tin], typing._Tout]
clipppy.utils.copy_function(f: types.FunctionType, name=None)
clipppy.utils.enumlstrip(iterable, pred)

lstrip with a pred that takes (index, value) as arguments

clipppy.utils.expandkeys(m: Union[SupportsItems[typing._KT, typing._VT], Iterable[tuple[typing._KT, typing._VT]], Iterable[typing._VT]], keys: Collection[typing._KT])

Return specific keys from a mapping or iterable of key-value pairs, or zip them with a value iterator.

clipppy.utils.filterkeys(f: Callable[[typing._KT], bool], m: Union[Mapping[typing._KT, typing._VT], Iterable[tuple[typing._KT, typing._VT]]]) Iterable[tuple[typing._KT, typing._VT]]
clipppy.utils.itemsetter(value=None, *keys, **kwargs)
clipppy.utils.noop(*args, **kwargs)
clipppy.utils.to_tensor(val)
clipppy.utils.tryme(func: Callable[Ellipsis, typing._T], exc: Type[Exception] = Exception, default: typing._T = None) typing._T
clipppy.utils.valueiter(arg: Union[Iterable[typing._T], Mapping[Any, typing._T], typing._T]) Iterable[typing._T]
clipppy.utils.zip_asymmetric(arg1: Iterable[typing._T1], arg2: Iterable[typing._T2], err: Exception) Iterable[tuple[typing._T1, typing._T2]]