code: def from_rfc3339_nanos(value):
      
      with_nanos = _RFC3339_NANOS.match(value)
  
      if with_nanos is None:
          raise ValueError(
              "Timestamp: {!r}, does not match pattern: {!r}".format(
                  value, _RFC3339_NANOS.pattern
              )
          )
  
      bare_seconds = datetime.datetime.strptime(
          with_nanos.group("no_fraction"), _RFC3339_NO_FRACTION
      )
      fraction = with_nanos.group("nanos")
  
      if fraction is None:
          micros = 0
      else:
          scale = 9 - len(fraction)
          nanos = int(fraction) * (10 ** scale)
          micros = nanos // 1000
  
      return bare_seconds.replace(microsecond=micros, tzinfo=pytz.utc)
docs: Convert a nanosecond-precision timestamp to a native datetime.
  
      .. note::
          Python datetimes do not support nanosecond precision; this function
          therefore truncates such values to microseconds.
  
      Args:
          value (str): The RFC3339 string to convert.
  
      Returns:
          datetime.datetime: The datetime object equivalent to the timestamp in
              UTC.
  
      Raises:
          ValueError: If the timestamp does not match the RFC 3339
              regular expression.