code: def _create_stable_task_type(superclass, options_scope):
    
    subclass_name = '{0}_{1}'.format(superclass.__name__,
                                    options_scope.replace('.', '_').replace('-', '_'))
    if PY2:
      subclass_name = subclass_name.encode('utf-8')
    return type(subclass_name, (superclass,), {
      '__doc__': superclass.__doc__,
      '__module__': superclass.__module__,
      'options_scope': options_scope,
      '_stable_name': superclass.stable_name()
    })
docs: Creates a singleton (via `memoized`) subclass instance for the given superclass and scope.
  
    Currently we need to support registering the same task type multiple times in different
    scopes. However we still want to have each task class know the options scope it was
    registered in. So we create a synthetic subclass here.
  
    TODO(benjy): Revisit this when we revisit the task lifecycle. We probably want to have
    a task *instance* know its scope, but this means converting option registration from
    a class method to an instance method, and instantiating the task much sooner in the
    lifecycle.