code: def has_attr(obj, k):
      """Checks both that obj.k exists and is not equal to None"""
      try:
          return getattr(obj, k) is not None
      except KeyError as e:
          return False
      except AttributeError as e:
          return False
  
imports: import torch
  import shutil
  import dill
  import os
  from subprocess import Popen, PIPE
  import pandas
  from PIL import Image
  from .None import constants
label_desc: Use image node_id 1 for calling a global function with example usage: has_attr(obj, k) and returns: unknown, False, False