code: def make_docs(*args, **kwargs):
      
      err_msg = "Can't interpret args: "
      if not args and not kwargs:
          return []
  
      if not args:
          # OpReply(ok=1, ismaster=True).
          return [kwargs]
  
      if isinstance(args[0], (int, float, bool)):
          # server.receives().ok(0, err='uh oh').
          if args[1:]:
              raise_args_err(err_msg, ValueError)
          doc = OrderedDict({'ok': args[0]})
          doc.update(kwargs)
          return [doc]
  
      if isinstance(args[0], (list, tuple)):
          # Send a batch: OpReply([{'a': 1}, {'a': 2}]).
          if not all(isinstance(doc, (OpReply, Mapping))
                     for doc in args[0]):
              raise_args_err('each doc must be a dict:')
          if kwargs:
              raise_args_err(err_msg, ValueError)
          return list(args[0])
  
      if isinstance(args[0], (string_type, text_type)):
          if args[2:]:
              raise_args_err(err_msg, ValueError)
  
          if len(args) == 2:
              # Command('aggregate', 'collection', {'cursor': {'batchSize': 1}}).
              doc = OrderedDict({args[0]: args[1]})
          else:
              # OpReply('ismaster', me='a.com').
              doc = OrderedDict({args[0]: 1})
          doc.update(kwargs)
          return [doc]
  
      if kwargs:
          raise_args_err(err_msg, ValueError)
  
      # Send a batch as varargs: OpReply({'a': 1}, {'a': 2}).
      if not all(isinstance(doc, (OpReply, Mapping)) for doc in args):
          raise_args_err('each doc must be a dict')
  
      return args
docs: Make the documents for a `Request` or `Reply`.
  
      Takes a variety of argument styles, returns a list of dicts.
  
      Used by `make_prototype_request` and `make_reply`, which are in turn used by
      `MockupDB.receives`, `Request.replies`, and so on. See examples in
      tutorial.