def METHOD_NAME(file_pattern, num_pipelines, pipeline_id):
    matching_files = glob.glob(file_pattern)
    matching_files.sort()
    nums_per_shard = len(matching_files) // num_pipelines
    return matching_files[pipeline_id * nums_per_shard : (pipeline_id + 1) * nums_per_shard]