code: def is_job_ref(thing, reftype=dict):
      '''
      :param thing: something that might be a job-based object reference hash
      :param reftype: type that a job-based object reference would be (default is dict)
      '''
      return isinstance(thing, reftype) and \
          ((len(thing) == 2 and \
                isinstance(thing.get('field'), basestring) and \
                isinstance(thing.get('job'), basestring)) or \
               (len(thing) == 1 and \
                    isinstance(thing.get('$dnanexus_link'), reftype) and \
                    isinstance(thing['$dnanexus_link'].get('field'), basestring) and \
                    isinstance(thing['$dnanexus_link'].get('job'), basestring))f is_job_ref(thing, reftype=dict):
      '''
      :param thing: something that might be a job-based object reference hash
      :param reftype: type that a job-based object reference would be (default is dict)
      '''
      return isinstance(thing, reftype) and \
          ((len(thing) == 2 and \
                isinstance(thing.get('field'), basestring) and \
                isinstance(thing.get('job'), basestring)) or \
               (len(thing) == 1 and \
                    isinstance(thing.get('$dnanexus_link'), reftype) and \
                    isinstance(thing['$dnanexus_link'].get('field'), basestring) and \
                    isinstance(thing['$dnanexus_link'].get('job'), basestring)))
docs: :param thing: something that might be a job-based object reference hash
      :param reftype: type that a job-based object reference would be (default is dict)