code: def expandranges(parlist):
      
  
      ret = []
  
      for par in parlist:
          # match anything of the form XXX{number1-number2}
          m = re.match('(.*)\{([0-9]+)\-([0-9]+)\}',par)
  
          if m is None:
              ret.append(par)
          else:
              # (these are strings)
              root, number1, number2 = m.group(1), m.group(2), m.group(3)
  
              # if number1 begins with 0s, number parameters as 00, 01, 02, ...,
              # otherwise go with 0, 1, 2, ...
              fmt = '{{0}}{{1:0{0}d}}'.format(len(number1)) if number1[0] == '0' else '{0}{1:d}'
              
              ret = ret + [fmt.format(root,i) for i in range(int(m.group(2)),int(m.group(3))+1)]
  
      return ret
docs: Rewrite a list of parameters by expanding ranges (e.g., log10_efac{1-10}) into
      individual parameters.