code: def _expand_autotag(atag, container):
      
      if atag.tag != "auto":
          return
  
      if "names" in atag.attrib:
          i = -1
          for name in re.split("[\s,]+", atag.attrib["names"]):
              if name[0] == '^':
                  name = name[1::]
                  insert = True
                  i += 1
              else:
                  insert = False
                  
              for child in atag:
                  dupe = child.copy()
                  for attr, value in dupe.items():
                      dupe.attrib[attr] = value.replace("$", name)
  
                  if insert:
                      container.insert(i, dupe)
                  else:
                      container.append(dupe)            
      else:
          from fortpy.msg import warn
          warn("'names' is a required attribute of the <auto> tag.")
docs: Expands the contents of the specified auto tag within its parent container.