code: def value_to_pb(v: Any) -> pb.ParamType:
      if has_numpy:
          if isinstance(v, np.integer):
              return pb.ParamType(intValue=int(v))
          elif isinstance(v, np.floating):
              return pb.ParamType(floatValue=float(v))
          elif isinstance(v, np.ndarray):
              return pb.ParamType(
                  objectValueJson=json.dumps(v.tolist())
              )
      if _is_torch_tensor(v):
          return pb.ParamType(
              objectValueJson=json.dumps(v.detach().tolist())
          )
      if _is_tensorflow_tensor(v):
          return pb.ParamType(
              objectValueJson=json.dumps(v.numpy().tolist())
          )
      if isinstance(v, bool):
          return pb.ParamType(boolValue=v)
      if isinstance(v, int):
          return pb.ParamType(intValue=v)
      if isinstance(v, float):
          return pb.ParamType(floatValue=v)
      if isinstance(v, str):
          return pb.ParamType(stringValue=v)
      if isinstance(v, list):
          return pb.ParamType(objectValueJson=json.dumps(v))
      if isinstance(v, dict):
          return pb.ParamType(objectValueJson=json.dumps(v))
      if v is None:
          return pb.ParamType(objectValueJson=json.dumps(v))
      else:
          raise ValueError("Invalid value: %s", v)
  
imports: import datetime
  import json
  from typing import List, Dict, Any, Optional, MutableMapping
  from google.protobuf import timestamp_pb2
  from .servicepb import keepsake_pb2
  from .experiment import Experiment
  from .checkpoint import Checkpoint, PrimaryMetric, CheckpointList
label_desc: Use image node_id 18 for calling a global function with example usage: value_to_pb(v) and returns: pb, pb, pb, pb, pb, pb, pb, pb, pb, pb, pb, pb