def _resolve_id(val):
 return (val if isinstance(val, six.string_types) else val.id)

def _resolve_id ( val ) : return ( val if isinstance ( val , six . string_types ) else val . id )
takes an object or an id and returns the id .