code: def import_csv(
      paths,
      *,
      key=None,
      min_partitions=None,
      impute=False,
      no_header=False,
      comment=(),
      missing="NA",
      types={},
      quote='"',
      skip_blank_lines=False,
      force_bgz=False,
      filter=None,
      find_replace=None,
      force=False,
      source_file_field=None,
  ) -> Table:
      """Import a csv file as a :class:`.Table`.
  
      Examples
      --------
  
      Let's import fields from a CSV file with missing data:
  
      .. code-block:: text
  
          $ cat data/samples2.csv
          Batch,PT-ID
          1kg,PT-0001
          1kg,PT-0002
          study1,PT-0003
          study3,PT-0003
          .,PT-0004
          1kg,PT-0005
          .,PT-0006
          1kg,PT-0007
  
      In this case, we should:
  
      - Pass the non-default missing value ``.``
  
      >>> table = hl.import_csv('data/samples2.csv', missing='.')
      >>> table.show()
      +----------+-----------+
      | Batch    | PT-ID     |
      +----------+-----------+
      | str      | str       |
      +----------+-----------+
      | "1kg"    | "PT-0001" |
      | "1kg"    | "PT-0002" |
      | "study1" | "PT-0003" |
      | "study3" | "PT-0003" |
      | NA       | "PT-0004" |
      | "1kg"    | "PT-0005" |
      | NA       | "PT-0006" |
      | "1kg"    | "PT-0007" |
      +----------+-----------+
      <BLANKLINE>
  
      Notes
      -----
  
      The `impute` parameter tells Hail to scan the file an extra time to gather
      information about possible field types. While this is a bit slower for large
      files because the file is parsed twice, the convenience is often worth this
      cost.
  
      If set, the `comment` parameter causes Hail to skip any line that starts
      with the given string(s). For example, passing ``comment='#'`` will skip any
      line beginning in a pound sign. If the string given is a single character,
      Hail will skip any line beginning with the character. Otherwise if the
      length of the string is greater than 1, Hail will interpret the string as a
      regex and will filter out lines matching the regex. For example, passing
      ``comment=['#', '^track.*']`` will filter out lines beginning in a pound sign
      and any lines that match the regex ``'^track.*'``.
  
      The `missing` parameter defines the representation of missing data in the table.
  
      .. note::
  
          The `missing` parameter is **NOT** a regex. The `comment` parameter is
          treated as a regex **ONLY** if the length of the string is greater than
          1 (not a single character).
  
      The `no_header` parameter indicates that the file has no header line. If
      this option is passed, then the field names will be `f0`, `f1`,
      ... `fN` (0-indexed).
  
      The `types` parameter allows the user to pass the types of fields in the
      table. It is an :obj:`dict` keyed by :class:`str`, with :class:`.HailType` values.
      See the examples above for a standard usage. Additionally, this option can
      be used to override type imputation. For example, if the field
      ``Chromosome`` only contains the values ``1`` through ``22``, it will be
      imputed to have type :py:data:`.tint32`, whereas most Hail methods expect
      that a chromosome field will be of type :py:data:`.tstr`. Setting
      ``impute=True`` and ``types={'Chromosome': hl.tstr}`` solves this problem.
  
      Parameters
      ----------
  
      paths : :class:`str` or :obj:`list` of :obj:`str`
          Files to import.
      key : :class:`str` or :obj:`list` of :obj:`str`
          Key fields(s).
      min_partitions : :obj:`int` or :obj:`None`
          Minimum number of partitions.
      no_header : :obj:`bool`
          If ``True```, assume the file has no header and name the N fields `f0`,
          `f1`, ... `fN` (0-indexed).
      impute : :obj:`bool`
          If ``True``, Impute field types from the file.
      comment : :class:`str` or :obj:`list` of :obj:`str`
          Skip lines beginning with the given string if the string is a single
          character. Otherwise, skip lines that match the regex specified. Multiple
          comment characters or patterns should be passed as a list.
      missing : :class:`str` or :obj:`list` [:obj:`str`]
          Identifier(s) to be treated as missing.
      types : :obj:`dict` mapping :class:`str` to :class:`.HailType`
          Dictionary defining field types.
      quote : :class:`str` or :obj:`None`
          Quote character.
      skip_blank_lines : :obj:`bool`
          If ``True``, ignore empty lines. Otherwise, throw an error if an empty
          line is found.
      force_bgz : :obj:`bool`
          If ``True``, load files as blocked gzip files, assuming
          that they were actually compressed using the BGZ codec. This option is
          useful when the file extension is not ``'.bgz'``, but the file is
          blocked gzip, so that the file can be read in parallel and not on a
          single node.
      filter : :class:`str`, optional
          Line filter regex. A partial match results in the line being removed
          from the file. Applies before `find_replace`, if both are defined.
      find_replace : (:class:`str`, :obj:`str`)
          Line substitution regex. Functions like ``re.sub``, but obeys the exact
          semantics of Java's
          `String.replaceAll <https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#replaceAll-java.lang.String-java.lang.String->`__.
      force : :obj:`bool`
          If ``True``, load gzipped files serially on one core. This should
          be used only when absolutely necessary, as processing time will be
          increased due to lack of parallelism.
      source_file_field : :class:`str`, optional
          If defined, the source file name for each line will be a field of the table
          with this name. Can be useful when importing multiple tables using glob patterns.
      Returns
      -------
      :class:`.Table`
      """
  
      ht = hl.import_table(
          paths,
          key=key,
          min_partitions=min_partitions,
          impute=impute,
          no_header=no_header,
          comment=comment,
          missing=missing,
          types=types,
          skip_blank_lines=skip_blank_lines,
          force_bgz=force_bgz,
          filter=filter,
          find_replace=find_replace,
          force=force,
          source_file_field=source_file_field,
          delimiter=",",
          quote=quote,
      )
      return ht
  
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 26 for calling a global function with example usage: import_csv(paths) and returns: ht