code: def unpack(self, fmt):
      """Unpack values from contained buffer
  
      Unpacks values from ``self.buf`` and updates ``self.ptr`` to the
      position after the read data.
  
      Parameters
      ----------
      fmt : str
         format string as for ``unpack``
  
      Returns
      -------
      values : tuple
         values as unpacked from ``self.buf`` according to `fmt`
      """
      # try and get a struct corresponding to the format string from
      # the cache
      pkst = self._cache.get(fmt)
      if pkst is None:  # struct not in cache
          # if we've not got a default endian, or the format has an
          # explicit endianness, then we make a new struct directly
          # from the format string
          if self.endian is None or fmt[0] in _ENDIAN_CODES:
              pkst = Struct(fmt)
          else:  # we're going to modify the endianness with our
              # default.
              endian_fmt = self.endian + fmt
              pkst = Struct(endian_fmt)
              # add an entry in the cache for the modified format
              # string as well as (below) the unmodified format
              # string, in case we get a format string with the same
              # endianness as default, but specified explicitly.
              self._cache[endian_fmt] = pkst
          self._cache[fmt] = pkst
      values = pkst.unpack_from(self.buf, self.ptr)
      self.ptr += pkst.size
      return values
  
imports: from struct import Struct
label_desc: Use image node_id 2 for calling the Unpacker obj's underlying member method code with example usage: obj.unpack(fmt) and returns: values