code: def is_intf_up(intf):
      
      intf_path = '/'.join(('/sys/class/net', intf))
      intf_exist = os.path.exists(intf_path)
      if not intf_exist:
          LOG.error("Unable to get interface %(intf)s, Interface dir "
                    "%(dir)s does not exist",
                    {'intf': intf, 'dir': intf_path})
          return False
      try:
          oper_file = '/'.join((intf_path, 'operstate'))
          with open(oper_file, 'r') as fd:
              oper_state = fd.read().strip('\n')
              if oper_state == 'up':
                  return True
      except Exception as e:
          LOG.error("Exception in reading %s", str(e))
      return False
docs: Function to check if a interface is up.