class InterleavingMethod(object):
    '''
    Interleaving
    '''
    def interleave(self, a, b):
        '''
        a: a list of document IDs
        b: a list of document IDs

        Return an instance of Ranking
        '''
        raise NotImplementedError()

    def multileave(self, *lists):
        '''
        *lists: lists of document IDs

        Return an instance of Ranking
        '''
        raise NotImplementedError()

    def evaluate(self, ranking, clicks):
        '''
        ranking: an instance of Ranking generated by Balanced.interleave
        clicks: a list of indices clicked by a user

        Return one of the following tuples:
        - (1, 0): Ranking 'a' won
        - (0, 1): Ranking 'b' won
        - (0, 0): Tie
        '''
        raise NotImplementedError()


class InterleavingMethod(object):
    '''
    Interleaving
    '''
    def interleave(self, k, a, b):
        '''
        k: the maximum length of resultant interleaving
        a: a list of document IDs
        b: a list of document IDs

        Return an instance of Ranking
        '''
        raise NotImplementedError()

    def multileave(self, k, *lists):
        '''
        k: the maximum length of resultant multileaving
        *lists: lists of document IDs

        Return an instance of Ranking
        '''
        raise NotImplementedError()

    def evaluate(self, ranking, clicks):
        '''
        ranking: an instance of Ranking generated by Balanced.interleave
        clicks: a list of indices clicked by a user

        Return one of the following tuples:
        - (1, 0): Ranking 'a' won
        - (0, 1): Ranking 'b' won
        - (0, 0): Tie
        '''
        raise NotImplementedError()


Add a length argument for InterleavingMethod.interleave and multileave
Add a length argument for InterleavingMethod.interleave and multileave

  class InterleavingMethod(object):
      '''
      Interleaving
      '''
-     def interleave(self, a, b):
+     def interleave(self, k, a, b):
          '''
+         k: the maximum length of resultant interleaving
          a: a list of document IDs
          b: a list of document IDs
  
          Return an instance of Ranking
          '''
          raise NotImplementedError()
  
-     def multileave(self, *lists):
+     def multileave(self, k, *lists):
          '''
+         k: the maximum length of resultant multileaving
          *lists: lists of document IDs
  
          Return an instance of Ranking
          '''
          raise NotImplementedError()
  
      def evaluate(self, ranking, clicks):
          '''
          ranking: an instance of Ranking generated by Balanced.interleave
          clicks: a list of indices clicked by a user
  
          Return one of the following tuples:
          - (1, 0): Ranking 'a' won
          - (0, 1): Ranking 'b' won
          - (0, 0): Tie
          '''
          raise NotImplementedError()
  
  
Add a length argument for InterleavingMethod.interleave and multileave
## Code Before:
class InterleavingMethod(object):
    '''
    Interleaving
    '''
    def interleave(self, a, b):
        '''
        a: a list of document IDs
        b: a list of document IDs

        Return an instance of Ranking
        '''
        raise NotImplementedError()

    def multileave(self, *lists):
        '''
        *lists: lists of document IDs

        Return an instance of Ranking
        '''
        raise NotImplementedError()

    def evaluate(self, ranking, clicks):
        '''
        ranking: an instance of Ranking generated by Balanced.interleave
        clicks: a list of indices clicked by a user

        Return one of the following tuples:
        - (1, 0): Ranking 'a' won
        - (0, 1): Ranking 'b' won
        - (0, 0): Tie
        '''
        raise NotImplementedError()


## Instruction:
Add a length argument for InterleavingMethod.interleave and multileave
## Code After:
class InterleavingMethod(object):
    '''
    Interleaving
    '''
    def interleave(self, k, a, b):
        '''
        k: the maximum length of resultant interleaving
        a: a list of document IDs
        b: a list of document IDs

        Return an instance of Ranking
        '''
        raise NotImplementedError()

    def multileave(self, k, *lists):
        '''
        k: the maximum length of resultant multileaving
        *lists: lists of document IDs

        Return an instance of Ranking
        '''
        raise NotImplementedError()

    def evaluate(self, ranking, clicks):
        '''
        ranking: an instance of Ranking generated by Balanced.interleave
        clicks: a list of indices clicked by a user

        Return one of the following tuples:
        - (1, 0): Ranking 'a' won
        - (0, 1): Ranking 'b' won
        - (0, 0): Tie
        '''
        raise NotImplementedError()

