code: def coerce_int(value):
      if isinstance(value, int):
          num = value
      else:
          try:
              num = int(value)
          except ValueError:
              num = int(float(value))
      if MIN_INT <= num <= MAX_INT:
          return num
      raise Exception(
          (
              "Int cannot represent non 32-bit signed integer value: {}"
          ).format(value)
      )
  
file_path: wandb/wandb/vendor/graphql-core-1.1/wandb_graphql/type/scalars.py
imports: from ..language.ast import BooleanValue, FloatValue, IntValue, StringValue
  from .definition import GraphQLScalarType
label_desc: Use image node_id 1 for calling a global function with example usage: coerce_int(value) and returns: num