docs: def _split_cell(cell, module):
    """ Split a hybrid %%sql cell into the Python code and the queries.
  
      Populates a module with the queries.
  
    Args:
      cell: the contents of the %%sql cell.
      module: the module that the contents will populate.
  
    Returns:
      The default (last) query for the module.
  
    """
    lines = cell.split('\n')
    code = None
    last_def = -1
    name = None
    define_wild_re = re.compile('^DEFINE\s+.*$', re.IGNORECASE)
    define_re = re.compile('^DEFINE\s+QUERY\s+([A-Z]\w*)\s*?(.*)$', re.IGNORECASE)
    select_re = re.compile('^SELECT\s*.*$', re.IGNORECASE)
    standard_sql_re = re.compile('^(CREATE|WITH|INSERT|DELETE|UPDATE)\s*.*$', re.IGNORECASE)
    # TODO(gram): a potential issue with this code is if we have leading Python code followed
    # by a SQL-style comment before we see SELECT/DEFINE. When switching to the tokenizer see
    # if we can address this.
    for i, line in enumerate(lines):
      define_match = define_re.match(line)
      select_match = select_re.match(line)
      standard_sql_match = standard_sql_re.match(line)
  
      if i:
        prior_content = ''.join(lines[:i]).strip()
        if select_match:
          # Avoid matching if previous token was '(' or if Standard SQL is found
          # TODO: handle the possibility of comments immediately preceding SELECT
          select_match = len(prior_content) == 0 or \
              (prior_content[-1] != '(' and not standard_sql_re.match(prior_content))
        if standard_sql_match:
          standard_sql_match = len(prior_content) == 0 or not standard_sql_re.match(prior_content)
  
      if define_match or select_match or standard_sql_match:
        # If this is the first query, get the preceding Python code.
        if code is None:
          code = ('\n'.join(lines[:i])).strip()
          if len(code):
            code += '\n'
        elif last_def >= 0:
  
          # This is not the first query, so gather the previous query text.
          query = '\n'.join([line for line in lines[last_def:i] if len(line)]).strip()
          if select_match and name != datalab.data._utils._SQL_MODULE_MAIN and len(query) == 0:
            # Avoid DEFINE query name\nSELECT ... being seen as an empty DEFINE followed by SELECT
            continue
  
          # Save the query
          statement = datalab.data.SqlStatement(query, module)
          module.__dict__[name] = statement
          # And set the 'last' query to be this too
          module.__dict__[datalab.data._utils._SQL_MODULE_LAST] = statement
  
        # Get the query name and strip off our syntactic sugar if appropriate.
        if define_match:
          name = define_match.group(1)
          lines[i] = define_match.group(2)
        else:
          name = datalab.data._utils._SQL_MODULE_MAIN
  
        # Save the starting line index of the new query
        last_def = i
      else:
        define_wild_match = define_wild_re.match(line)
        if define_wild_match:
          raise Exception('Expected "DEFINE QUERY <name>"')
  
    if last_def >= 0:
      # We were in a query so save this tail query.
      query = '\n'.join([line for line in lines[last_def:] if len(line)]).strip()
      statement = datalab.data.SqlStatement(query, module)
      module.__dict__[name] = statement
      module.__dict__[datalab.data._utils._SQL_MODULE_LAST] = statement
  
    if code is None:
      code = ''
    module.__dict__[datalab.data._utils._SQL_MODULE_ARGPARSE] = _arguments(code, module)
    return module.__dict__.get(datalab.data._utils._SQL_MODULE_LAST, None)