def METHOD_NAME(function_def: FunctionDef) -> any_pb2.Any:
  """Pack a `FunctionDef` into a proto3 `Any` message.
  Args:
    function_def: the `FunctionDef` to pack into a protocol buffer message.
  Returns:
    A `google.protobuf.Any` protocol buffer message.
  Raises:
    TypeError: if `function_def` is not a `FunctionDef`.
  """
  py_typecheck.check_type(function_def, FunctionDef)
  # Perform deterministic Any packing by setting the fields explicitly and not
  # using the Any.Pack() method.
  return any_pb2.Any(
      type_url='type.googleapis.com/' + function_def.DESCRIPTOR.full_name,
      value=function_def.SerializeToString(deterministic=True),
  )