code: def ncVarAttributes(ncVar):
      
      try:
          return ncVar.__dict__
      except Exception as ex:
          # Due to some internal error netCDF4 may raise an AttributeError or KeyError,
          # depending on its version.
          logger.warn("Unable to read the attributes from {}. Reason: {}"
                      .format(ncVar.name, ex))
          return {}
docs: Returns the attributes of ncdf variable