code: def separate(ht, field, into, delim) -> Table:
      """Separate a field into multiple fields by splitting on a delimiter
      character or position.
  
      :func:`.separate` mimics the functionality of the `separate()` function in R's
      ``tidyr`` package.
  
      This function will create a new table where ``field`` has been split into
      multiple new fields, whose names are given by ``into``.
  
      If ``delim`` is a ``str`` (including regular expression strings), ``field``
      will be separated into columns by that string. In this case, the length
      of ``into`` must match the number of resulting fields.
  
      If ``delim`` is an ``int``, ``field`` will be separated into two row fields,
      where the first field contains the first ``delim`` characters of ``field``
      and the second field contains the remaining characters.
  
      Parameters
      ----------
      ht : :class:`.Table`
          A Hail table.
      field : :class:`str`
          The name of the field to separate in ``ht``.
      into : list of :class:`str`
          The names of the fields to create by separating ``field``.
      delimiter : :class:`str` or :obj:`int`
          The character or position by which to separate ``field``.
  
      Returns
      -------
      :class:`.Table`
          Table with original ``field`` split into fields whose names are defined
          by `into`."""
  
      if isinstance(delim, int):
          ht = ht.annotate(
              **{into[0]: ht[field][:delim], into[1]: ht[field][delim:]}
          )
      else:
          split = ht[field].split(delim)
          ht = ht.annotate(
              **{into[i]: split[i] for i in range(len(into))}
          )
      ht = ht.drop(field)
  
      ht_tmp = new_temp_file()
      ht.write(ht_tmp)
  
      return ht
  
imports: import hail
  from hail import Table
  from hail.typecheck import typecheck, nullable, oneof, sequenceof
  from hail.utils import wrap_to_list, new_temp_file
label_desc: Use image node_id 3 for calling a global function with example usage: separate(ht, field, into, delim) and returns: ht