def MonkeyPatch(cls, method_name, method):
  try:
    return getattr(cls, method_name)
  except __HOLE__:
    setattr(cls, method_name, method)
    return method


# Fixup the protobuf implementation.
# pylint: disable=g-import-not-at-top
dataset/ETHPy150Open google/grr/grr/lib/compatibility.py/MonkeyPatch