Utils#

aleimi.utils.get_default_kwargs(func: object) dict[source]#

Get the keywords arguments of a function

Parameters:

func (object) – The function to analysis

Returns:

keyword:keyword_value

Return type:

dict

aleimi.utils.ignoreLines(file_obj: object, num_of_lines_to_skip: int)[source]#

Ignore lines during reading of file

Parameters:
  • file_obj (object) – The file in open mode

  • num_of_lines_to_skip (int) – Number of lines to skip

aleimi.utils.run(command: str, shell: bool = True, executable: str = '/bin/bash')[source]#

This function is just a useful wrapper around subprocess.run

Parameters:
  • command (str) – Any command to execute.

  • shell (bool, optional) – keyword of subprocess.Popen and subprocess.Popen, by default True

  • executable (str, optional) – keyword of subprocess.Popen and subprocess.Popen, by default ‘/bin/bash’

Returns:

The processes returned by Run.

Return type:

object

Raises:

RuntimeError – In case of non-zero exit status on the provided command.

aleimi.utils.timeit(method)[source]#

Useful as decorator