code: def rename_stream_kwargs(stream, kwargs, reverse=False):
      
      mapped_kwargs = {}
      mapping = stream_name_mapping(stream, reverse=reverse)
      for k,v in kwargs.items():
          if k not in mapping:
              msg = 'Could not map key {key} {direction} renamed equivalent'
              direction = 'from' if reverse else 'to'
              raise KeyError(msg.format(key=repr(k), direction=direction))
          mapped_kwargs[mapping[k]] = v
      return mapped_kwargs
docs: Given a stream and a kwargs dictionary of parameter values, map to
      the corresponding dictionary where the keys are substituted with the
      appropriately renamed string.
  
      If reverse, the output will be a dictionary using the original
      parameter names given a dictionary using the renamed equivalents.