code: def stream_by_method_name(name):
      
      if name == u'local':
          name = u'parent'
      module = mitogen.core.import_module(u'mitogen.' + name)
      return module.Stream
docs: Given the name of a Mitogen connection method, import its implementation
      module and return its Stream subclass.