docs: def update_or_create(cls, **kwargs):
          """Checks if an instance already exists by filtering with the
          kwargs. If yes, updates the instance with new kwargs and
          returns that instance. If not, creates a new
          instance with kwargs and returns it.
  
          Args:
  
              **kwargs: The keyword arguments which are used for filtering
                  and initialization.
  
              keys (list, optional): A special keyword argument. If passed,
                  only the set of keys mentioned here will be used for filtering.
                  Useful when we want to 'filter' based on a subset of the keys
                  and create with all the keys.
  
          Examples:
  
              >>> customer = Customer.update_or_create(
              ...     name="vicky", email="vicky@h.com", country="India")
              >>> customer.id
              45
              >>> customer1 = Customer.update_or_create(
              ...     name="vicky", email="vicky@h.com", country="India")
              >>> customer1==customer
              True
              >>> customer2 = Customer.update_or_create(
              ...     name="vicky", email="vicky@h.com", country="Russia")
              >>> customer2==customer
              False
              >>> customer3 = Customer.update_or_create(
              ...      name="vicky", email="vicky@h.com", country="Russia",
              ...      keys=['name', 'email'])
              >>> customer3==customer
              True
          """
          keys = kwargs.pop('keys') if 'keys' in kwargs else []
          filter_kwargs = subdict(kwargs, keys)
          if filter_kwargs == {}:
              obj = None
          else:
              obj = cls.first(**filter_kwargs)
          if obj is not None:
              for key, value in kwargs.iteritems():
                  if (key not in keys and
                          key not in cls._no_overwrite_):
                      setattr(obj, key, value)
              try:
                  cls.session.commit()
              except:
                  cls.session.rollback()
                  raise
          else:
              obj = cls.create(**kwargs)
          return obj