def METHOD_NAME(
    adata: anndata.AnnData,
    moran_i_genes: Union[np.ndarray, list],
    num_clusters: int = 5,
    layer: Union[str, None] = None,
) -> np.ndarray:
    """Identify archetypes from the anndata object.
    Args:
        adata: Anndata object of interests.
        moran_i_genes: genes that are identified as singificant autocorrelation genes in space based on Moran's I.
        num_clusters: number of archetypes.
        layers: the layer for the gene expression, can be None which corresponds to adata.X.
    Returns:
        archetypes: the archetypes within the genes with high moran I scores.
    Examples:
        >>> archetypes = st.tl.archetypes(adata)
        >>> adata.obs = pd.concat((adata.obs, df), 1)
        >> arch_cols = adata.obs.columns
        >>> st.pl.space(adata, basis="spatial", color=arch_cols, pointsize=0.1, alpha=1)
    """
    if layer is None:
        exp = adata[:, moran_i_genes].X.A
    else:
        exp = adata[:, moran_i_genes].layers[layer].A
    METHOD_NAME, clusters, gene_corrs = find_spatial_archetypes(num_clusters, exp.T)
    arch_cols = ["archetype %d" % i for i in np.arange(num_clusters)]
    df = pd.DataFrame(METHOD_NAME.T, columns=arch_cols)
    df.index = adata.obs_names
    METHOD_NAME = pd.concat((adata.obs, df), 1)
    return METHOD_NAME