def METHOD_NAME(params):
  if not os.path.exists(settings_dir):
    os.makedirs(settings_dir)
  working_phil = master_phil_scope.format(python_object = params)
  diff_phil = master_phil_scope.fetch_diff(source = working_phil)
  try:
    f = open(settings_file.encode('utf8'), 'wb')
    f.write(diff_phil.as_str().encode('utf8'))
    f.close()
  except IOError:
    raise Sorry('Unable to write %s.' % settings_file)