install itertools

Shell
sudo pip3 install more-itertools# itertools.tee(iterable, n=2)

# Return n independent iterators from a single iterable.

# The following Python code helps explain what tee does 
# (although the actual implementation is more complex 
# and uses only a single underlying FIFO queue).

# Roughly equivalent to:

def tee(iterable, n=2):
    it = iter(iterable)
    deques = [collections.deque() for i in range(n)]
    def gen(mydeque):
        while True:
            if not mydeque:             # when the local deque is empty
                try:
                    newval = next(it)   # fetch a new value and
                except StopIteration:
                    return
                for d in deques:        # load it to all the deques
                    d.append(newval)
            yield mydeque.popleft()
    return tuple(gen(d) for d in deques)
# Python code to demonstrate the working of    
# dropwhile()  
  
  
# Function to be passed 
# as an argument 
def is_positive(n): 
    return n > 0 
  
value_list =[5, 6, -8, -4, 2] 
result = list(itertools.dropwhile(is_positive, value_list))  
   
print(result)  

Source

Also in Shell: