code: def add_attr(self, name, object, description='', chain=-1, array=False):
          
  
          if not np.isscalar(chain):
              raise TypeError("chain must be a scalar integer.")
  
          table = self._tables[chain]
  
          if array is False:
              table.set_attr(name, object)
              obj = getattr(table.attrs, name)
          else:
              # Create an array in the group
              if description == '':
                  description = name
              group = table._g_getparent()
              self._h5file.create_array(group, name, object, description)
              obj = getattr(group, name)
  
          setattr(self, name, obj)
docs: Add an attribute to the chain.
  
          description may not be supported for every date type.
          if array is true, create an Array object.