What about renaming ``type`` argument to ``relation_type``? 

``type`` is a builtin, so code like ``if not isinstance(type,dict)`` reads worse than ``if not isinstance(relation_type, dict)`` because in the latter case it is clear that relation_type is a user-defined variable.