system
LazyLoad(import_path)
¶
rmdir(path)
¶
Remove a directory recursively. Args: path (str): path to directory to remove Returns: True if a dir was removed, false otherwise. Raises error if failed to remove.
Source code in langroid/utils/system.py
caller_name()
¶
Who called the function?
Source code in langroid/utils/system.py
generate_user_id(org='')
¶
Generate a unique user ID based on the username and machine name. Returns:
Source code in langroid/utils/system.py
update_hash(hash=None, s='')
¶
Takes a SHA256 hash string and a new string, updates the hash with the new string, and returns the updated hash string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hash |
str
|
A SHA256 hash string. |
None
|
s |
str
|
A new string to update the hash with. |
''
|
Returns:
Type | Description |
---|---|
str
|
The updated hash in hexadecimal format. |
Source code in langroid/utils/system.py
hash(s)
¶
Generate a SHA256 hash of a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s |
str
|
The string to hash. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The SHA256 hash of the string. |