Method: pylint.checkers.variables._import_name_is_global
Calls: 10, Exceptions: 0, Paths: 4Back
Path 1: 4 calls (0.4)
Import (2) ImportFrom (2)
{'deque', 'OS', 'PATH', 'collections'} (2) {'sys'} (1) {'namedtuple'} (1)
True (4)
1def _import_name_is_global(
2 stmt: nodes.Global | _base_nodes.ImportNode, global_names: set[str]
3) -> bool:
4 for import_name, import_alias in stmt.names:
5 # If the import uses an alias, check only that.
6 # Otherwise, check only the import name.
7 if import_alias:
8 if import_alias in global_names:
9 return True
10 elif import_name in global_names:
11 return True
12 return False
Path 2: 2 calls (0.2)
Import (1) ImportFrom (1)
{'deque', 'OS', 'PATH', 'collections'} (2)
True (2)
1def _import_name_is_global(
2 stmt: nodes.Global | _base_nodes.ImportNode, global_names: set[str]
3) -> bool:
4 for import_name, import_alias in stmt.names:
5 # If the import uses an alias, check only that.
6 # Otherwise, check only the import name.
7 if import_alias:
8 if import_alias in global_names:
9 return True
10 elif import_name in global_names:
11 return True
12 return False
Path 3: 2 calls (0.2)
Import (1) ImportFrom (1)
{'deque', 'OS', 'PATH', 'collections'} (2)
False (2)
1def _import_name_is_global(
2 stmt: nodes.Global | _base_nodes.ImportNode, global_names: set[str]
3) -> bool:
4 for import_name, import_alias in stmt.names:
5 # If the import uses an alias, check only that.
6 # Otherwise, check only the import name.
7 if import_alias:
8 if import_alias in global_names:
9 return True
10 elif import_name in global_names:
11 return True
12 return False
Path 4: 2 calls (0.2)
Import (1) ImportFrom (1)
{'deque', 'OS', 'PATH', 'collections'} (2)
False (2)
1def _import_name_is_global(
2 stmt: nodes.Global | _base_nodes.ImportNode, global_names: set[str]
3) -> bool:
4 for import_name, import_alias in stmt.names:
5 # If the import uses an alias, check only that.
6 # Otherwise, check only the import name.
7 if import_alias:
8 if import_alias in global_names:
9 return True
10 elif import_name in global_names:
11 return True
12 return False