gigl.common.utils.os_utils#

Attributes#

Functions#

import_obj(obj_path)

Given an object path by name (e.g. "module_a.module_b.object_c"), returns object_c.

num_lines_in_file(f)

run_command_and_stream_stdout(cmd)

Executes a command and streams the stdout output.

Module Contents#

gigl.common.utils.os_utils.import_obj(obj_path)[source]#

Given an object path by name (e.g. “module_a.module_b.object_c”), returns object_c.

Parameters:

obj_path (str) – The object path by name.

Returns:

The imported object.

Return type:

object

gigl.common.utils.os_utils.num_lines_in_file(f)[source]#
Parameters:

f (io.TextIOWrapper)

Return type:

int

gigl.common.utils.os_utils.run_command_and_stream_stdout(cmd)[source]#

Executes a command and streams the stdout output.

Parameters:

cmd (str) – The command to be executed.

Returns:

The return code of the command, or None if the command failed to execute.

Return type:

Optional[int]

gigl.common.utils.os_utils.logger[source]#