code: def filter_genotypes(genotypes_df, list_sample_ids):
      """
      given a python list of sample ids,
      return a filtered_genotypes dataframe with samples from that list
      """
      sample_subset = "' , '".join(list_sample_ids)
      filtered_genotypes = (
          genotypes_df.selectExpr(
              "*",
              "filter(genotypes, g -> array_contains(array('{0}'), g.sampleId)) as genotypes2".format(
                  sample_subset
              ),
          )
          .drop("genotypes")
          .withColumnRenamed("genotypes2", "genotypes")
      )
      return filtered_genotypes
  
label_desc: Use image node_id 3 for calling a global function with example usage: filter_genotypes(genotypes_df, list_sample_ids) and returns: filtered_genotypes