code: def filter_props(has_props_cls, input_dict, include_immutable=True):
      
      props_dict = {
          k: v for k, v in iter(input_dict.items()) if (
              k in has_props_cls._props and (
                  include_immutable or
                  any(
                      hasattr(has_props_cls._props[k], att)
                      for att in ('required', 'new_name')
                  )
              )
          )
      }
      others_dict = {k: v for k, v in iter(input_dict.items())
                     if k not in props_dict}
      return (props_dict, others_dict)
docs: Split a dictionary based keys that correspond to Properties
  
      Returns:
      **(props_dict, others_dict)** - Tuple of two dictionaries. The first contains
      key/value pairs from the input dictionary that correspond to the
      Properties of the input HasProperties class. The second contains the remaining key/value
      pairs.
  
      **Parameters**:
  
      * **has_props_cls** - HasProperties class or instance used to filter the
        dictionary
      * **input_dict** - Dictionary to filter
      * **include_immutable** - If True (the default), immutable properties (i.e.
        Properties that inherit from GettableProperty but not Property) are
        included in props_dict. If False, immutable properties are excluded
        from props_dict.
  
      For example
  
      .. code::
  
          class Profile(properties.HasProperties):
              name = properties.String('First and last name')
              age = properties.Integer('Age, years')
  
          bio_dict = {
              'name': 'Bill',
              'age': 65,
              'hometown': 'Bakersfield',
              'email': 'bill@gmail.com',
          }
  
          (props, others) = properties.filter_props(Profile, bio_dict)
          assert set(props) == {'name', 'age'}
          assert set(others) == {'hometown', 'email'}