1from contextlib import suppress
2from decimal import Decimal
3from sys import exit 4
5from ..metadata import metadata_to_json
6from ..utils import Fault, list_starts_with
1from os.path import join
2from sys import exit 3
4from ..utils.text import mark_for_translation as _, red
5from ..utils.ui import io
87
88 return self
89
90 def __exit__(self, type, value, traceback): 91 if self.locking_node.os not in self.locking_node.OS_FAMILY_UNIX:
92 # no locking required/possible
93 return
1from functools import wraps
2from os import environ
3from sys import exit, stderr, stdout 4from traceback import format_exc, print_exc
5
6from ..concurrency import WorkerPool
1from concurrent.futures import ThreadPoolExecutor, wait, FIRST_COMPLETED
2from datetime import datetime
3from random import randint
4from sys import exit 5from traceback import format_tb
6
7from .utils.text import mark_for_translation as _
Defining a local variable or function with the same name as a built-in object makes the built-in object unusable within the current scope and makes the code prone to bugs.
dict = {} # dict is a Python builtin!
for idx, student in enumerate(students):
dict[student] = idx
roll_number = {}
for idx, student in enumerate(students):
roll_number[student] = idx