code: def type(self, schema):  # pylint: disable=missing-function-docstring
      key = (
          schema.name
          if isinstance(schema, Schema)
          else schema.split("(", 1)[0].strip()
      )
      if key not in self.cache:
          self.cache.add(key)
          schema = (
              schema if isinstance(schema, Schema) else Schema(schema)
          )
          arguments = list(
              filter(
                  lambda _: not (_.kwarg_only and hasattr(_, "alias")),
                  schema.arguments,
              )
          )
          returns = schema.returns
          value = self.types.setdefault(
              schema.name,
              {
                  "name": schema.name,
              },
          )
          inputs = value.get("inputs", [])
          outputs = value.get("outputs", [])
          inputs = [
              inputs[i] if i < len(inputs) else {}
              for i in range(len(arguments))
          ]
          outputs = [
              outputs[i] if i < len(outputs) else {}
              for i in range(len(returns))
          ]
          value["inputs"] = inputs
          value["outputs"] = outputs
          for i, _ in enumerate(arguments):
              argument = inputs[i]
              argument["name"] = _.name
              self._argument(argument, getattr(_, "type"))
              if hasattr(_, "default"):
                  argument["default"] = _.default
          for i, _ in enumerate(returns):
              argument = outputs[i]
              if hasattr(_, "name"):
                  argument["name"] = _.name
              self._argument(argument, getattr(_, "type"))
      return self.types[key]
  
imports: import json
  import os
label_desc: Use image node_id 2 for calling the Metadata obj's underlying member method code with example usage: obj.type(schema) and returns: self