code: def _init_rename_spec(data):
      if isinstance(data, str):
          pattern, repl = _split_rename_spec(data)
          return RenameSpec(pattern, repl)
      if isinstance(data, dict):
          return RenameSpec(
              data.get("pattern", ""), data.get("repl", "")
          )
      raise ResourceFormatError(
          f"invalid rename spec {data!r}: expected string or map"
      )
  
imports: import collections
  import copy
  import logging
  import operator
  import pprint
  from guild import util
label_desc: Use image node_id 10 for calling a global function with example usage: _init_rename_spec(data) and returns: RenameSpec, RenameSpec