lisa.utils#
Miscellaneous utilities that don’t fit anywhere else.
Also used as a home for everything that would create cyclic dependency issues between modules if they were hosted in their “logical” module. This is mostly done for secondary utilities that are not used often.
Globals
Base folder used for caching files. |
|
The detected location of your LISA installation. |
|
ABI of the machine that imported that module. |
|
Value of |
Classes
Path to a folder that can be used to store artifacts of a function. This must be a clean folder, already created on disk. |
|
Compose context managers together. |
|
Provide a folder-based cache. |
|
Allows tagging the objects produced in exekall expressions ID. |
|
Read-only mapping that is therefore hashable. |
|
Hide the subclasses in the simplified ID format of exekall. |
|
Lazy Mapping dict-like class for elements evaluated on the fly. |
|
A simple class for uniformly named loggers. |
|
Allow partial initialization of instances with curry-like behaviour for the constructor. |
|
A helper class for YAML serialization/deserialization. |
|
Base class providing serialization to objects that typically cannot due to unpicklable attributes. |
|
Base class providing a basic implementation of |
|
Dummy class to be used to check if a function is a method defined in a class or not::. |
|
Decorator to allow a method to be used both as an instance method and a classmethod. |
|
Decorator providing a hybrid of a normal method and a classmethod:. |
|
Decorator that allows the decorated function to be mapped on an iterable::. |
Functions
Implement delegation of attribute lookup to attribute named |
|
Same as |
|
Build a PEP484 |
|
Chain the context managers returned by the given callables. |
|
Compute a checksum on a given file-like object. |
|
Compose multiple functions such that |
|
Advance the iterator n-steps ahead. If |
|
Currify the given function such that |
|
Deduplicate items in the given sequence and return a list. :param seq: Sequence to deduplicate :type Seq: collections.abc.Sequence. |
|
Somewhat equivalent to |
|
Mark a class, method, function etc as deprecated and update its docstring. |
|
Similar to |
|
Dispatch the provided |
|
Create a class to inherit from in order to add a snippet of doc at the end of the docstring of all direct and indirect subclasses::. |
|
Forward fill an iterator with the last selected value. |
|
Yield value from |
|
Find the fixed point of a function |
|
Fold the given function over |
|
Right-associative version of |
|
Get the location of the source that called that function. |
|
Pick the most derived common ancestor between the classes, assuming single inheritance. |
|
Return the common prefix of the passed iterables as an iterator. |
|
Return an URL to the documentation about the given object. |
|
Get a key in a nested mapping. |
|
Get a prettily-formated name for the object given as parameter. |
|
Return the enclosing namespace of |
|
Get the short documentation paragraph at the beginning of docstrings. |
|
Return the reStructuredText Sphinx role of a given object. |
|
Get all indirect subclasses of the class. |
|
Group a mapping by its values. |
|
Equivalent of |
|
Collect data into fixed-length chunks or blocks. |
|
Guess the file format from a path, using the mime types database. |
|
Wrap a context manager and handle exceptions raised in |
|
Import all submodules of a given package. |
|
Check if link is dead. If dead, returns a truthy value, otherwise a falsy one. |
|
Return |
|
Returns True if running in IPython console or Jupyter notebook, False otherwise. |
|
Returns True if the module is imported when Sphinx is running, False otherwise. |
|
Decorate a function so that it acts as an argument dispatcher between multiple other functions. |
|
Similar to |
|
Try to factor an iterable into a prefix that is repeated a number of times. |
|
Decorator to memoize the result of a callable, based on |
|
Context manager to measure time in seconds. |
|
Decorator to memoize the result of a callable, based on |
|
Create a context manager wrapping |
|
Same as |
|
Make a new class inheriting from |
|
Create a property that raises an |
|
Decorator used to allow another decorator to both take keyword parameters when called, and none when not called::. |
|
Reorder the iterable of |
|
Resolve a dotted name, importing all modules necessary. |
|
Set a key in a nested mapping. |
|
Initialize logging used for all the LISA modules. |
|
Show the online LISA documentation about the given object. |
|
Similar to |
|
Set of objects to ignore without warning when cross referencing in Sphinx. |
|
Register an object with a name that cannot be resolved and therefore cross referenced by Sphinx. |
|
Split string into a list of paragraphs. |
|
Context manager that will replace |
|
Similar to |
|
Yield the first |
|
Unzip a given |
|
Decorator to update the signature of the decorated function using annotation and default values from the specified |
|
Equivalent to |
|
Equivalent to builtin |
Exceptions
Exception raised in context managers created by |
|
Exception raised when an exception was raised during |
|
Dummy exception raised in the generator wrapped by |
|
Exception raised when no exception was raised during |