Lileb-Training/src/experiments/_utils/init.py
def make_basedir(root, add_timestamp=False, attempts=1):
    """Takes attempts shots at creating a folder from root,
    adding timestamp if desired.
    """
    for i in range(attempts):
        basedir = root
        if add_timestamp:
            timestamp = datetime.now().strftime("%a-%b-%d-%H:%M:%S.%f")
            basedir = os.path.join(basedir, timestamp)
        try:
            os.makedirs(basedir)
            return basedir
        except FileExistsError:
            sleep(1e-8)
    raise FileExistsError(root)
Takes attempts shots at creating a folder from root,
    adding timestamp if desired.
    
Takes attempts shots at creating a folder from root,
adding timestamp if desired.
Takes attempts shots at creating a folder from root adding timestamp if desired .
def make_basedir(root, add_timestamp=False, attempts=1):
    for i in range(attempts):
        basedir = root
        if add_timestamp:
            timestamp = datetime.now().strftime("%a-%b-%d-%H:%M:%S.%f")
            basedir = os.path.join(basedir, timestamp)
        try:
            os.makedirs(basedir)
            return basedir
        except FileExistsError:
            sleep(1e-8)
    raise FileExistsError(root)
def make_basedir ( root , add_timestamp = False , attempts = 1 ) : for i in range ( attempts ) : basedir = root if add_timestamp : timestamp = datetime . now ( ) . strftime ( "%a-%b-%d-%H:%M:%S.%f" ) basedir = os . path . join ( basedir , timestamp ) try : os . makedirs ( basedir ) return basedir except FileExistsError : sleep ( 1e-8 ) raise FileExistsError ( root )
Takes attempts shots at creating a folder from root,
adding timestamp if desired.
Takes attempts shots at creating a folder from root adding timestamp if desired .
"""Takes attempts shots at creating a folder from root,
    adding timestamp if desired.
    """
root
add_timestamp
attempts