code: def read_scripts(self, minversion=None, maxversion=None, skip_versions=()):
          
          scripts = []
          versions = {}  # a script is unique per version
          for scriptname in sorted(os.listdir(self.upgrade_dir)):
              match = self.parse_script_name(scriptname)
              if match:
                  version = match['version']
                  if version in skip_versions:
                      continue  # do not collect scripts already applied
                  elif minversion and version <= minversion:
                      continue  # do not collect versions too old
                  elif maxversion and version > maxversion:
                      continue  # do not collect versions too new
                  try:
                      previousname = versions[version]
                  except KeyError:  # no previous script with the same version
                      scripts.append(match)
                      versions[version] = scriptname
                  else:
                      raise DuplicatedVersion(
                          'Duplicated versions {%s,%s}' %
                          (scriptname, previousname))
          return scripts
docs: Extract the upgrade scripts from a directory as a list of
          dictionaries, ordered by version.
  
          :param minversion: the minimum version to consider
          :param maxversion: the maximum version to consider
          :param skipversions: the versions to skip