parameters: (self, ts, ids, curr, pred_diff, curr_cb=None, diff_cb=None)
docstring: Check keys in curr and pred, if there is any key starts with 'fa_',
          collect them and compare against each other.
  
          For example (suppose we are at time t):
  
              num_unit_T2: predicted difference: curr["num_unit"] (at time t + 2)
                                                 - curr["num_unit"] (at time t).
docstring_summary: Check keys in curr and pred, if there is any key starts with 'fa_',
          collect them and compare against each other.
docstring_tokens: Check keys in curr and pred if there is any key starts with fa_ collect them and compare against each other .
function: def feed(self, ts, ids, curr, pred_diff, curr_cb=None, diff_cb=None):
          """Check keys in curr and pred, if there is any key starts with 'fa_',
          collect them and compare against each other.
  
          For example (suppose we are at time t):
  
              num_unit_T2: predicted difference: curr["num_unit"] (at time t + 2)
                                                 - curr["num_unit"] (at time t).
          """
          # curr[key][i] -> value, ids[i] -> id
          for k, v in curr.items():
              if not k.startswith(self.prefix):
                  continue
  
              key = k[len(self.prefix):]
              history = self.entries[key]
              history.update({
                  str(t) + "_" + str(d): (v[i] if not curr_cb else curr_cb(v[i]))
                  for i, (t, d) in enumerate(zip(ts, ids))
              })
  
          for k, v in pred_diff.items():
              if not k.startswith(self.prefix):
                  continue
              key = k[len(self.prefix):]
              idx = key.rfind("_")
              delay = int(key[idx + 2:])
              if delay >= self.max_delay:
                  continue
  
              key = key[:idx]
  
              # Save it
              history = self.predicted_entries[delay][key]
              history.update({
                  str(t + delay) + "_" + str(d): (
                      self.entries[key][str(t) + "_" + str(d)] +
                      (v[i] if not diff_cb else diff_cb(v[i]))
                  ) for i, (t, d) in enumerate(zip(ts, ids))
              })
  
              history2 = self.baseline_entries[delay][key]
              history2.update({
                  str(t + delay) + "_" + str(d):
                  self.entries[key][str(t) + "_" + str(d)]
                  for t, d in zip(ts, ids)
              })
function_tokens: def feed ( self , ts , ids , curr , pred_diff , curr_cb = None , diff_cb = None ) : # curr[key][i] -> value, ids[i] -> id for k , v in curr . items ( ) : if not k . startswith ( self . prefix ) : continue key = k [ len ( self . prefix ) : ] history = self . entries [ key ] history . update ( { str ( t ) + "_" + str ( d ) : ( v [ i ] if not curr_cb else curr_cb ( v [ i ] ) ) for i , ( t , d ) in enumerate ( zip ( ts , ids ) ) } ) for k , v in pred_diff . items ( ) : if not k . startswith ( self . prefix ) : continue key = k [ len ( self . prefix ) : ] idx = key . rfind ( "_" ) delay = int ( key [ idx + 2 : ] ) if delay >= self . max_delay : continue key = key [ : idx ] # Save it history = self . predicted_entries [ delay ] [ key ] history . update ( { str ( t + delay ) + "_" + str ( d ) : ( self . entries [ key ] [ str ( t ) + "_" + str ( d ) ] + ( v [ i ] if not diff_cb else diff_cb ( v [ i ] ) ) ) for i , ( t , d ) in enumerate ( zip ( ts , ids ) ) } ) history2 = self . baseline_entries [ delay ] [ key ] history2 . update ( { str ( t + delay ) + "_" + str ( d ) : self . entries [ key ] [ str ( t ) + "_" + str ( d ) ] for t , d in zip ( ts , ids ) } )