code: def wrap(self, value, timestamp=None):
          
          V = self.type()
          S, NS = divmod(float(timestamp or time.time()), 1.0)
          V.timeStamp = {
              'secondsPastEpoch': S,
              'nanoseconds': NS * 1e9,
          }
          if isinstance(value, dict):
              # assume dict of index and choices list
              V.value = value
              self._choices = V['value.choices']
          else:
              # index or string
              self.assign(V, value)
          return V
docs: Pack python value into Value