code: def _opref_to_opspec(opref, cwd=None):
      spec_parts = []
      if opref.pkg_type == "script":
          return _script_path(opref, cwd)
      if opref.pkg_type == "package" and opref.pkg_name:
          spec_parts.extend([opref.pkg_name, "/"])
      if opref.model_name:
          spec_parts.extend([opref.model_name, ":"])
      if opref.op_name:
          spec_parts.append(opref.op_name)
      return "".join(spec_parts)
  
file_path: guildai/guild/opref.py
imports: import collections
  import logging
  import os
  import re
  from guild import util
label_desc: Use image node_id 11 for calling a global function with example usage: _opref_to_opspec(opref, cwd) and returns: str, _script_path