code: def get_canonical_name(name, aliases):
      # We look at the aliases looking for the most specific match first
      base_name = aliases.get(name)
      if base_name is not None:
          return base_name
      for idx in reversed(
          [pos for pos, char in enumerate(name) if char == "."]
      ):
          base_name = aliases.get(name[:idx])
          if base_name is not None:
              return ".".join([base_name, name[idx + 1 :]])
      return name
  
label_desc: Use image node_id 2 for calling a global function with example usage: get_canonical_name(name, aliases) and returns: name, base_name, str