code: def _update_data(self, datapoint, key, new_data):
          
          if new_data:
              try:
                  self.data[datapoint].update({key: new_data})
              except KeyError:
                  self.data[datapoint] = {key: new_data}
docs: update or assign new data to datapoint