def validate_is_mapping(option, value):
 if (not isinstance(value, collections.Mapping)):
  raise TypeError(('%s must be an instance of dict, bson.son.SON, or other type that inherits from collections.Mapping' % (option,)))

def validate_is_mapping ( option , value ) : if ( not isinstance ( value , collections . Mapping ) ) : raise TypeError ( ( '%s must be an instance of dict, bson.son.SON, or other type that inherits from collections.Mapping' % ( option , ) ) )
validate the type of method arguments that expect a document .