docs: def _build_udf(name, code, return_type, params, language, imports):
      """Creates the UDF part of a BigQuery query using its pieces
  
      Args:
        name: the name of the javascript function
        code: function body implementing the logic.
        return_type: BigQuery data type of the function return. See supported data types in
          the BigQuery docs
        params: dictionary of parameter names and types
        language: see list of supported languages in the BigQuery docs
        imports: a list of GCS paths containing further support code.
        """
  
      params = ','.join(['%s %s' % named_param for named_param in params])
      imports = ','.join(['library="%s"' % i for i in imports])
  
      if language.lower() == 'sql':
          udf = 'CREATE TEMPORARY FUNCTION {name} ({params})\n' + \
                'RETURNS {return_type}\n' + \
                'AS (\n' + \
                '{code}\n' + \
                ');'
      else:
          udf = 'CREATE TEMPORARY FUNCTION {name} ({params})\n' +\
                'RETURNS {return_type}\n' + \
                'LANGUAGE {language}\n' + \
                'AS """\n' +\
                '{code}\n' +\
                '"""\n' +\
                'OPTIONS (\n' +\
                '{imports}\n' +\
                ');'
      return udf.format(name=name, params=params, return_type=return_type,
                        language=language, code=code, imports=imports)