def METHOD_NAME(redshift, directory, pig=True):
    """Find a snapshot at a given redshift from a directory list. Returns snapshot number."""
    if pig:
        fname = "PIG_*"
    else:
        fname = "PART_*"
    globs = glob.glob(os.path.join(directory, fname))
    for gg in globs:
        bf = BigFile(gg)
        rr = 1/bf['Header'].attrs['Time']-1
        if np.abs(rr - redshift) < 0.05:
            return gg
        del bf
    return None