code: def from_bucket(self, bucket, native=False):
      '''
      Calculate the timestamp given a bucket.
      '''
      # NOTE: this is due to a bug somewhere in strptime that does not process
      # the week number of '%Y%U' correctly. That bug could be very specific to
      # the combination of python and ubuntu that I was testing.
      bucket = str(bucket)
      if self._step == 'weekly':
        year, week = bucket[:4], bucket[4:]
        normal = datetime(year=int(year), month=1, day=1) + timedelta(weeks=int(week))
      else:
        normal = datetime.strptime(bucket, self.FORMATS[self._step])
      if native:
        return normal
      return long(time.mktime( normal.timetuple() )f from_bucket(self, bucket, native=False):
      '''
      Calculate the timestamp given a bucket.
      '''
      # NOTE: this is due to a bug somewhere in strptime that does not process
      # the week number of '%Y%U' correctly. That bug could be very specific to
      # the combination of python and ubuntu that I was testing.
      bucket = str(bucket)
      if self._step == 'weekly':
        year, week = bucket[:4], bucket[4:]
        normal = datetime(year=int(year), month=1, day=1) + timedelta(weeks=int(week))
      else:
        normal = datetime.strptime(bucket, self.FORMATS[self._step])
      if native:
        return normal
      return long(time.mktime( normal.timetuple() ))
docs: Calculate the timestamp given a bucket.