def handle_example(self, text, continue_flag):
        """ parses for the tutorial """
        cmd = text.partition(SELECT_SYMBOL['example'])[0].rstrip()
        num = text.partition(SELECT_SYMBOL['example'])[2].strip()
        example = ""
        try:
            num = int(num) - 1
        except ValueError:
            print("An Integer should follow the colon", file=self.output)
            return ""
        if cmd in self.completer.command_examples:
            if num >= 0 and num < len(self.completer.command_examples[cmd]):
                example = self.completer.command_examples[cmd][num][1]
                example = example.replace('\n', '')
            else:
                print('Invalid example number', file=self.output)
                return '', True

        example = example.replace('az', '')

        starting_index = None
        counter = 0
        example_no_fill = ""
        flag_fill = True
        for word in example.split():
            if flag_fill:
                example_no_fill += word + " "
            if word.startswith('-'):
                example_no_fill += word + " "
                if not starting_index:
                    starting_index = counter
                flag_fill = False
            counter += 1

        return self.example_repl(example_no_fill, example, starting_index, continue_flag)
def handle_example ( self , text , continue_flag ) : cmd = text . partition ( SELECT_SYMBOL [ 'example' ] ) [ 0 ] . rstrip ( ) num = text . partition ( SELECT_SYMBOL [ 'example' ] ) [ 2 ] . strip ( ) example = "" try : num = int ( num ) - 1 except ValueError : print ( "An Integer should follow the colon" , file = self . output ) return "" if cmd in self . completer . command_examples : if num >= 0 and num < len ( self . completer . command_examples [ cmd ] ) : example = self . completer . command_examples [ cmd ] [ num ] [ 1 ] example = example . replace ( '\n' , '' ) else : print ( 'Invalid example number' , file = self . output ) return '' , True example = example . replace ( 'az' , '' ) starting_index = None counter = 0 example_no_fill = "" flag_fill = True for word in example . split ( ) : if flag_fill : example_no_fill += word + " " if word . startswith ( '-' ) : example_no_fill += word + " " if not starting_index : starting_index = counter flag_fill = False counter += 1 return self . example_repl ( example_no_fill , example , starting_index , continue_flag )
parses for the tutorial