def get_object_names(input_folder: str) -> list[str]:
    """Get object names from a local or remote folder.

    Args:
        input_folder (str): local or remote folder path.
    """
    object_store = maybe_create_object_store_from_uri(input_folder)
    if object_store is not None:
        _, _, folder_prefix = parse_uri(input_folder)
        try:
            names = [
                name for name in object_store.list_objects(folder_prefix)
                if name.endswith('.txt')
            ]
            log.info(f'Found {len(names)} text files in remote storage')
        except FileNotFoundError:
            raise InputFolderNotFound(folder_prefix)

    else:
        # input_folder is a local folder
        names = [
            text_file for dirpath, _, _ in os.walk(input_folder)
            for text_file in glob(os.path.join(dirpath, '*.txt'))
        ]
    # return names, sizes
    log.info(f'Found {len(names)} text files at {input_folder}')

    return names
Get object names from a local or remote folder.

    Args:
        input_folder (str): local or remote folder path.
    
llmfoundry/command_utils/data_prep/convert_text_to_mds.py