code: def import_fam(
      path, quant_pheno=False, delimiter=r"\\s+", missing="NA"
  ) -> Table:
      """Import a PLINK FAM file into a :class:`.Table`.
  
      Examples
      --------
  
      Import a tab-separated
      `FAM file <https://www.cog-genomics.org/plink2/formats#fam>`__
      with a case-control phenotype:
  
      >>> fam_kt = hl.import_fam('data/case_control_study.fam')
  
      Import a FAM file with a quantitative phenotype:
  
      >>> fam_kt = hl.import_fam('data/quantitative_study.fam', quant_pheno=True)
  
      Notes
      -----
  
      In Hail, unlike PLINK, the user must *explicitly* distinguish between
      case-control and quantitative phenotypes. Importing a quantitative
      phenotype with ``quant_pheno=False`` will return an error
      (unless all values happen to be `0`, `1`, `2`, or `-9`):
  
      The resulting :class:`.Table` will have fields, types, and values that are interpreted as missing.
  
       - *fam_id* (:py:data:`.tstr`) -- Family ID (missing = "0")
       - *id* (:py:data:`.tstr`) -- Sample ID (key column)
       - *pat_id* (:py:data:`.tstr`) -- Paternal ID (missing = "0")
       - *mat_id* (:py:data:`.tstr`) -- Maternal ID (missing = "0")
       - *is_female* (:py:data:`.tstr`) -- Sex (missing = "NA", "-9", "0")
  
      One of:
  
       - *is_case* (:py:data:`.tbool`) -- Case-control phenotype (missing = "0", "-9",
         non-numeric or the ``missing`` argument, if given.
       - *quant_pheno* (:py:data:`.tfloat64`) -- Quantitative phenotype (missing = "NA" or
         the ``missing`` argument, if given.
  
      Warning
      -------
      Hail will interpret the value "-9" as a valid quantitative phenotype, which
      differs from default PLINK behavior. Use ``missing='-9'`` to interpret this
      value as missing.
  
      Parameters
      ----------
      path : :class:`str`
          Path to FAM file.
      quant_pheno : :obj:`bool`
          If ``True``, phenotype is interpreted as quantitative.
      delimiter : :class:`str`
          Field delimiter regex.
      missing : :class:`str`
          The string used to denote missing values. For case-control, 0, -9, and
          non-numeric are also treated as missing.
  
      Returns
      -------
      :class:`.Table`
      """
      type_and_data = Env.backend().import_fam(
          path, quant_pheno, delimiter, missing
      )
      typ = hl.dtype(type_and_data["type"])
      return hl.Table.parallelize(
          hl.tarray(typ)._convert_from_json_na(type_and_data["data"]),
          typ,
          key=["id"],
      )
  
imports: import os
  import re
  from collections import defaultdict
  import avro.schema
  from avro.datafile import DataFileReader
  from avro.io import DatumReader
  import hail
  from hail import ir
  from hail.expr import StructExpression, LocusExpression, expr_array, expr_float64, expr_str, expr_numeric, expr_call, expr_bool, expr_int32, to_expr, analyze
  from hail.expr.types import hail_type, tarray, tfloat64, tstr, tint32, tstruct, tcall, tbool, tint64, tfloat32
  from hail.genetics.reference_genome import reference_genome_type
  from hail.ir.utils import parse_type
  from hail.matrixtable import MatrixTable
  from hail.methods.misc import require_biallelic, require_row_key_variant, require_col_key_str
  from hail.table import Table
  from hail.typecheck import typecheck, nullable, oneof, dictof, anytype, sequenceof, enumeration, sized_tupleof, numeric, table_key_type, char
  from hail.utils import new_temp_file
  from hail.utils.deduplicate import deduplicate
  from hail.utils.java import Env, FatalError, jindexed_seq_args, warning
  from hail.utils.java import info
  from hail.utils.misc import wrap_to_list, plural
  from .import_lines_helpers import split_lines, should_remove_line
label_desc: Use image node_id 9 for calling a global function with example usage: import_fam(path, quant_pheno, delimiter, missing) and returns: hl