def get_mixed_type_key(obj):
 if isinstance(obj, _BaseNetwork):
  return obj._get_networks_key()
 elif isinstance(obj, _BaseAddress):
  return obj._get_address_key()
 return NotImplemented

def get_mixed_type_key ( obj ) : if isinstance ( obj , _BaseNetwork ) : return obj . _get_networks_key ( ) elif isinstance ( obj , _BaseAddress ) : return obj . _get_address_key ( ) return NotImplemented
return a key suitable for sorting between networks and addresses .