# Path: rx/internal.py
# class Struct(object):
#   def __init__(self, **entries):
#     self.__dict__.update(entries)
# 
#   def __eq__(self, other):
#     if not isinstance(other, Struct):
#       return False
# 
#     return self.__dict__ == other.__dict__
# 
#   def __repr__(self):
#     return repr(self.__dict__)
# 
# Path: rx/observable.py
# class Producer(Observable):
#   """Base class for implementation of query operators, providing
#   performance benefits over the use of Observable.Create"""
# 
#   def subscribeCore(self, observer):
#     return self.subscribeRaw(observer, True)
# 
#   def subscribeRaw(self, observer, enableSafequard):
#     sink = SingleAssignmentDisposable()
#     subscription = SingleAssignmentDisposable()
# 
#     d = CompositeDisposable(sink, subscription)
# 
#     if enableSafequard:
#       observer = AutoDetachObserver(observer, d)
# 
#     def assignSink(s):
#       sink.disposable = s
# 
#     def scheduled():
#       subscription.disposable = self.run(observer, subscription, assignSink)
#       return Disposable.empty()
# 
#     if Scheduler.currentThread.isScheduleRequired():
#       Scheduler.currentThread.schedule(scheduled)
#     else:
#       scheduled()
# 
#     return d
# 
#   def run(self, observer, cancel, setSink):
#     raise NotImplementedError()


from rx.internal import Struct
from rx.observable import Producer
from collections import deque
import rx.linq.sink
    setSink(sink)
    return sink.run()

  class Sink(rx.linq.sink.Sink):
    def __init__(self, parent, observer, cancel):
      super(SkipLastTime.Sink, self).__init__(observer, cancel)
      self.parent = parent

    def run(self):
      self.startTime = self.parent.scheduler.now()

      return self.parent.subscribeSafe(self)

    def elapsed(self):
      return self.parent.scheduler.now() - self.startTime

    def onNext(self, value):
      now = self.elapsed()

      self.queue.append(Struct(value=value,timeStamp=now))

      while len(self.queue) > 0:
        current = self.queue.popleft()

        if now - current.timeStamp >= self.parent.duration:
          self.observer.onNext(current.value)
        else:
          self.queue.appendleft(current)
          break


# Path: rx/internal.py
# class Struct(object):
#   def __init__(self, **entries):
#     self.__dict__.update(entries)
# 
#   def __eq__(self, other):
#     if not isinstance(other, Struct):
#       return False
# 
#     return self.__dict__ == other.__dict__
# 
#   def __repr__(self):
#     return repr(self.__dict__)
# 
# Path: rx/observable.py
# class Producer(Observable):
#   """Base class for implementation of query operators, providing
#   performance benefits over the use of Observable.Create"""
# 
#   def subscribeCore(self, observer):
#     return self.subscribeRaw(observer, True)
# 
#   def subscribeRaw(self, observer, enableSafequard):
#     sink = SingleAssignmentDisposable()
#     subscription = SingleAssignmentDisposable()
# 
#     d = CompositeDisposable(sink, subscription)
# 
#     if enableSafequard:
#       observer = AutoDetachObserver(observer, d)
# 
#     def assignSink(s):
#       sink.disposable = s
# 
#     def scheduled():
#       subscription.disposable = self.run(observer, subscription, assignSink)
#       return Disposable.empty()
# 
#     if Scheduler.currentThread.isScheduleRequired():
#       Scheduler.currentThread.schedule(scheduled)
#     else:
#       scheduled()
# 
#     return d
# 
#   def run(self, observer, cancel, setSink):
#     raise NotImplementedError()


# Path: rx/linq/skipLast.py
from rx.internal import Struct
from rx.observable import Producer
from collections import deque
import rx.linq.sink

    setSink(sink)
    return sink.run()

  class Sink(rx.linq.sink.Sink):
    def __init__(self, parent, observer, cancel):
      super(SkipLastTime.Sink, self).__init__(observer, cancel)
      self.parent = parent

    def run(self):
      self.startTime = self.parent.scheduler.now()

      return self.parent.subscribeSafe(self)

    def elapsed(self):
      return self.parent.scheduler.now() - self.startTime

    def onNext(self, value):
      now = self.elapsed()

      self.queue.append(Struct(value=value,timeStamp=now))

      while len(self.queue) > 0:
        current = self.queue.popleft()

        if now - current.timeStamp >= self.parent.duration:
          self.observer.onNext(current.value)
        else:
          self.queue.appendleft(current)
          break


    def onError(self, exception):