def _FindExtraFields(self, message_dict, schema, raise_error):
    if schema['type'] == 'object':
      assert isinstance(message_dict, dict)
      for k in message_dict.keys():
        if 'properties' in schema:
          if k not in schema['properties']:
            if raise_error:
              raise BadMessageException('Message contains field "%s", which is not present in the schema.' % k)
            else:
              del message_dict[k]
            continue
          if schema['properties'][k]['type'] in ('object', 'array'):
            self._FindExtraFields(message_dict[k], schema['properties'][k], raise_error)
    elif schema['type'] == 'array':
      assert isinstance(message_dict, list)
      for val in message_dict:
        self._FindExtraFields(val, schema['items'], raise_error)
Creates dummy branch with contents from detached HEAD.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/base/message.py/Message._FindExtraFields--crossover with--dataset/ETHPy150Open googlearchive/git-rv/submit.py/SubmitAction.create_branch