@classmethod
  def create_from_options(cls, options, name):
    """Factory using an options dictionary.

    Args:
      options: Dictionary of options containing:
        template: A Python dict-interpolation string. Required.
        prolog: written before the per-record output.
        epilog: written after the per-record output.
        mode: one of the following, default is 'text'
          text: text file mode, newlines between records.
          nonewline: text file mode, no added newlines.
          binary: binary file mode, no added newlines.
      name: The name of this transformer, for use in error messages.

    Returns:
      SimpleTextConnector object described by the specified options.

    Raises:
      InvalidConfiguration: If the config is invalid.
    """
    template = options.get('template')
    if not template:
      raise bulkloader_errors.InvalidConfiguration(
          name % 'simpletext must specify template. (In transformer named %s)')

    prolog = options.get('prolog')
    epilog = options.get('epilog')
    mode = options.get('mode', 'text')
    return cls(template, prolog, epilog, mode, name)
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/bulkload/simpletext_connector.py/SimpleTextConnector.create_from_options/swapped operands of `%`