code: def sort(self, ids):
          
          def extract_int(string):
              """
              Extract an integer from the given string.
  
              :param string string: the identifier string
              :rtype: int
              """
              return int(re.sub(r"[^0-9]", "", string))
  
          tmp = list(ids)
          if self.algorithm == IDSortingAlgorithm.UNSORTED:
              self.log(u"Sorting using UNSORTED")
          elif self.algorithm == IDSortingAlgorithm.LEXICOGRAPHIC:
              self.log(u"Sorting using LEXICOGRAPHIC")
              tmp = sorted(ids)
          elif self.algorithm == IDSortingAlgorithm.NUMERIC:
              self.log(u"Sorting using NUMERIC")
              tmp = ids
              try:
                  tmp = sorted(tmp, key=extract_int)
              except (ValueError, TypeError) as exc:
                  self.log_exc(u"Not all id values contain a numeric part. Returning the id list unchanged.", exc, False, None)
          return tmp
docs: Sort the given list of identifiers,
          returning a new (sorted) list.
  
          :param list ids: the list of identifiers to be sorted
          :rtype: list