def _in_cycle(obj, objs, max_reached, make_refs):
    'Detect cyclic structures that would lead to infinite recursion'
    return ((max_reached or ((not make_refs) and (id(obj) in objs))) and (not util.is_primitive(obj)) and (not util.is_enum(obj)))
Detect cyclic structures that would lead to infinite recursion
def _in_cycle(obj, objs, max_reached, make_refs):
    
    return ((max_reached or ((not make_refs) and (id(obj) in objs))) and (not util.is_primitive(obj)) and (not util.is_enum(obj)))