code: def extract_options(options, names):
      
      result = {}
      for name, value in copy(options).items():
          if name in names:
              result[name] = value
              del options[name]
      return result
docs: Return options for names and remove it from given options in-place.