def is_sharded(repo_dir):
    'Return whether the FSFS repository REPO_DIR is sharded.'
    format_path = os.path.join(repo_dir, 'db', 'format')
    contents = open(format_path, 'rb').read()
    for line in contents.split(b'\n'):
        if line.startswith(b'layout sharded'):
            return True
    return False
Return whether the FSFS repository REPO_DIR is sharded.
def is_sharded(repo_dir):
    
    format_path = os.path.join(repo_dir, 'db', 'format')
    contents = open(format_path, 'rb').read()
    for line in contents.split(b'\n'):
        if line.startswith(b'layout sharded'):
            return True
    return False