code: def to_list(fields):
      if hasattr(fields, "items"):
          return list(fields.items())
      return list(fields)
  
imports: import contextlib
  import io
  import os
  from uuid import uuid4
  import requests
  from .._compat import fields
label_desc: Use image node_id 7 for calling a global function with example usage: to_list(fields) and returns: list, list