code: def expand_abbreviations(template, abbreviations):
      
      if template in abbreviations:
          return abbreviations[template]
  
      # Split on colon. If there is no colon, rest will be empty
      # and prefix will be the whole template
      prefix, sep, rest = template.partition(':')
      if prefix in abbreviations:
          return abbreviations[prefix].format(rest)
  
      return template
docs: Expand abbreviations in a template name.
  
      :param template: The project template name.
      :param abbreviations: Abbreviation definitions.