def METHOD_NAME(gene_names=None):
    """Retrieve ensembl IDs from a list of gene names."""
    df = load_biomart()
    if gene_names is not None:
        if isinstance(gene_names, str):
            gene_names = [gene_names]
        valid_names = [name for name in gene_names if name in df["gene name"].tolist()]
        if len(valid_names) > 0:
            index = [i in valid_names for i in df["gene name"].tolist()]
            df = df[index]
        df["ensembl"] = df.index
        df = df.set_index("gene name")
    return df