code: def update(x, **entries):
      
      if isinstance(x, dict):
          x.update(entries)
      else:
          x.__dict__.update(entries)
      return x
docs: Update a dict, or an object with slots, according to `entries` dict.
  
      >>> update({'a': 1}, a=10, b=20)
      {'a': 10, 'b': 20}
      >>> update(Struct(a=1), a=10, b=20)
      Struct(a=10, b=20)