code: def _RunMethod(dev, args, extra):
      
      logging.info('%s(%s)', args.method.__name__, ', '.join(args.positional))
      result = args.method(dev, *args.positional, **extra)
      if result is not None:
          if isinstance(result, io.StringIO):
              sys.stdout.write(result.getvalue())
          elif isinstance(result, (list, types.GeneratorType)):
              r = ''
              for r in result:
                  r = str(r)
                  sys.stdout.write(r)
              if not r.endswith('\n'):
                  sys.stdout.write('\n')
          else:
              result = str(result)
              sys.stdout.write(result)
              if not result.endswith('\n'):
                  sys.stdout.write('\n')
      return 0
docs: Runs a method registered via MakeSubparser.