def get_nonclosed_data_obj_link(thing):
    obj_id = None
    if isinstance(thing, dict) and thing in '$dnanexus_link':
        if isinstance(thing['$dnanexus_link'], basestring):
            obj_id = thing['$dnanexus_link']
        elif isinstance(thing['$dnanexus_link'], dict):
            obj_id = thing['$dnanexus_link'].get('id')
    if obj_id is None:
        return None

    obj_desc = dxpy.describe(obj_id)
    if obj_desc.get('state') != 'closed':
        return obj_id
dataset/ETHPy150Open dnanexus/dx-toolkit/src/python/dxpy/utils/local_exec_utils.py/get_nonclosed_data_obj_link/swapped operands of `in`