<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_aligner_index(aligner, data):
 """Handle multiple specifications of aligner indexes, returning value to pass to aligner. Original bcbio case -- a list of indices. CWL case: a single file with secondaryFiles staged in the same directory. """

    aligner_indexes = tz.get_in(("reference", get_aligner_with_aliases(aligner, data), "indexes"), data)
    # standard bcbio case
    if aligner_indexes and isinstance(aligner_indexes, (list, tuple)):
        aligner_index = os.path.commonprefix(aligner_indexes)
        if aligner_index.endswith("."):
            aligner_index = aligner_index[:-1]
        return aligner_index
    # single file -- check for standard naming or directory
    elif aligner_indexes and os.path.exists(aligner_indexes):
        aligner_dir = os.path.dirname(aligner_indexes)
        aligner_prefix = os.path.splitext(aligner_indexes)[0]
        if len(glob.glob("%s.*" % aligner_prefix)) > 0:
            return aligner_prefix
        else:
            return aligner_dir

    if aligner not in allow_noindices():
        raise ValueError("Did not find reference indices for aligner %s in genome: %s" %
                         (aligner, data["reference"]))