docs: def FromFile(f, more_formatters=lambda x: None, more_predicates=lambda x: None,
               _constructor=None):
      """Parse a template from a file, using a simple file format.
  
    This is useful when you want to include template options in a data file,
    rather than in the source code.
  
    The format is similar to HTTP or E-mail headers.  The first lines of the file
    can specify template options, such as the metacharacters to use.  One blank
    line must separate the options from the template body.
  
    Example:
  
      default-formatter: none
      meta: {{}}
      format-char: :
      <blank line required>
      Template goes here: {{variable:html}}
  
    Args:
      f: A file handle to read from.  Caller is responsible for opening and
      closing it.
    """
      _constructor = _constructor or Template
      
      options = {}
      
      # Parse lines until the first one that doesn't look like an option
      while 1:
          line = f.readline()
          match = _OPTION_RE.match(line)
          if match:
              name, value = match.group(1), match.group(2)
              
              # Accept something like 'Default-Formatter: raw'.  This syntax is like
              # HTTP/E-mail headers.
              name = name.lower()
              # In Python 2.4, kwargs must be plain strings
              name = name.encode('utf-8')
              
              if name in _OPTION_NAMES:
                  name = name.replace('-', '_')
                  value = value.strip()
                  if name == 'default_formatter' and value.lower() == 'none':
                      value = None
                  options[name] = value
              else:
                  break
          else:
              break
      
      if options:
          if line.strip():
              raise CompilationError(
                  'Must be one blank line between template options and body (got %r)'
                  % line)
          body = f.read()
      else:
          # There were no options, so no blank line is necessary.
          body = line + f.read()
      
      return _constructor(body,
                          more_formatters=more_formatters,
                          more_predicates=more_predicates,
                          **options)