code: def from_json(cls, json):
      
      # Strip out unrecognized parameters, as introduced by b/5960884.
      params = dict((str(k), v) for k, v in json.iteritems()
                    if k in cls._PARAMS)
  
      # This is not symmetric with to_json() wrt. PROTOTYPE_REQUEST_PARAM because
      # the constructor parameters need to be JSON-encodable, so the decoding
      # needs to happen there anyways.
      if cls._OFFSET_PARAM in params:
        params[cls._OFFSET_PARAM] = base64.b64decode(params[cls._OFFSET_PARAM])
      return cls(**params)
docs: Creates an instance of the InputReader for the given input shard's state.
  
      Args:
        json: The InputReader state as a dict-like object.
  
      Returns:
        An instance of the InputReader configured using the given JSON parameters.