code: def format_string_values(obj, err_fallback=(IndexError, KeyError), *args, **kwargs):
      
      if isinstance(obj, dict):
          new = {}
          for key in obj.keys():
              new[key] = format_string_values(obj[key], *args, **kwargs)
          return new
      elif isinstance(obj, list):
          new = []
          for item in obj:
              new.append(format_string_values(item, *args, **kwargs))
          return new
      elif isinstance(obj, six.string_types):
          try:
              return obj.format(*args, **kwargs)
          except err_fallback:
              return obj
      else:
          return obj
docs: Format all string values in an object.
      Return the updated object