import itertools as it

def take(n, iterable):
    "Return first n items of the iterable as a list"
    # A completer

def consume(iterator, n):
# A completer

class Sequence(object):
    "A integer sequence"

    def __init__(self, description, generator, rep_len = 5):
        """create an integer sequence from a string description,
        a generator describing its elements, and an optional integer
        specfying how many elements are printed in a string representation
        (default is 5)"""
        self._check_rep_len(rep_len)
        self._description = description
        self._generator   = generator  
        self._rep_len     = rep_len    

    def __str__(self):
        """string representation of an integer sequence: description +
        the first rep_len elements"""
        # A completer

    def __iter__(self):
        """return a generator to iterate over the elements of this
        integer sequence"""
        # A completer

    def get_rep_len(self):
        """how many elements of this integer sequence are printed in
        a string representation?"""
        # A completer

    def set_rep_len(self, rep_len):
        """set how many elements of this integer sequence are printed in
        a string representation"""
         # A completer

    rep_len = property(get_rep_len, set_rep_len, None, "I'm the 'rep_len' property.")

    def get_description(self):
        """return the description of this sequence"""
         # A completer

    def set_description(self, new_description):
        """define a new description for this sequence"""
         # A completer
    
    description = property(get_description, set_description, None, "I'm the 'description' property.")

    def add_description(self, another_description):
        self._description.append(another_description)

class Database(object):
    "A database to store and query integer sequences"

    def __init__(self, rep_len):
        """create an empty database (when needed, print the first
        rep_len elements of each sequence"""
	# A completer

    def __len__(self):
        """return the number of integer sequences in the database"""
        # A completer

    def __iter__(self):
        """return an iterator over this database, i.e., all the
        integer sequences stored in the database"""
        return (sequence for sequence in self.catalogue)

    def add_sequence(self, sequence):
        "add an integer sequence (object Sequence) to the database"
        # A completer

    def search_by_name(self, name):
        """return a generator over all sequences which contain name
        in their description"""
        # A completer
    
    def search_by_seq(self, ints):
        """return a generator over all sequences that begin as ints"""
       # A completer		

    def search_by_seq_with_shift(self, ints, shift):
        """return a generator over all sequences that begin + shift as ints"""
        # A completer		

