code: def open(fp, mode="r"):
      """
      Load texture from a GD image file.
  
      :param fp: GD file name, or an opened file handle.
      :param mode: Optional mode.  In this version, if the mode argument
          is given, it must be "r".
      :returns: An image instance.
      :raises OSError: If the image could not be read.
      """
      if mode != "r":
          msg = "bad mode"
          raise ValueError(msg)
  
      try:
          return GdImageFile(fp)
      except SyntaxError as e:
          msg = "cannot identify this image file"
          raise UnidentifiedImageError(msg) from e
  
imports: from .None import ImageFile, ImagePalette, UnidentifiedImageError
  from ._binary import i16be
  from ._binary import i32be
label_desc: Use image node_id 1 for calling a global function with example usage: open(fp, mode) and returns: GdImageFile