def get_from_location_by_extension(resource, location, extension, version=None):
    try:
        found_files = [os.path.join(location, f) for f in os.listdir(location)]
    except __HOLE__:
        return None
    try:
        return get_from_list_by_extension(resource, found_files, extension, version)
    except ResourceError:
        raise ResourceError('More than one .{} found in {} for {}.'.format(extension,
                                                                           location,
                                                                           resource.owner.name))
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/resource_getters/standard.py/get_from_location_by_extension