#NEWLINE# def parse_string( input ) : #NEWLINE# #INDENT# if current_raw ( input ) . startswith ( '--' ) : #NEWLINE# #INDENT# return [ '--si' , '--so' , '--ji' , '--jo' , '--i' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if current_raw ( input ) . startswith ( '-' ) : #NEWLINE# #INDENT# return [ '-h' , '-x' , '-fx' , '-l' , '-c' , '-C' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( len ( prior ( input ) ) > 0 ) and ( prior ( input ) [ ( - 1 ) ] == '-c' ) ) : #NEWLINE# #INDENT# if 'import' . startswith ( current_raw ( input ) ) : #NEWLINE# #INDENT# options = [ "'import" ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( current_raw ( input ) . startswith ( 'import ' ) or current_raw ( input ) . startswith ( 'from ' ) ) : #NEWLINE# #INDENT# ( module_completion , module_list ) = get_completerlib ( ) #NEWLINE# options = ( module_completion ( current_raw ( input ) ) or [ ] ) #NEWLINE# if options : #NEWLINE# #INDENT# options = [ x . rstrip ( ' ' ) for x in module_list if x . startswith ( current_prefix ( input ) ) ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# options = complete_all ( current_prefix ( input ) , defaultdict ( ( lambda : None ) ) ) #NEWLINE# if current_prefix ( input ) . endswith ( '.' ) : #NEWLINE# #INDENT# options = [ x for x in options if ( '._' not in x ) ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return options #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( current_raw ( input ) == '' ) : #NEWLINE# #INDENT# options = [ 'sys' , 'json' , 're' , 'csv' , 'datetime' , 'hashlib' , 'itertools' , 'math' , 'os' , 'random' , 'shutil' ] #NEWLINE# if ( ( '-x' in input [ : ( - 1 ) ] ) or ( '-fx' in input [ : ( - 1 ) ] ) ) : #NEWLINE# #INDENT# options += 'x' #NEWLINE# #UNINDENT# if ( '-l' in input [ : ( - 1 ) ] ) : #NEWLINE# #INDENT# options += 'l' #NEWLINE# #UNINDENT# return options #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# completion_args = defaultdict ( ( lambda : None ) ) #NEWLINE# if ( ( '-x' in prior ( input ) ) or ( '-fx' in prior ( input ) ) ) : #NEWLINE# #INDENT# completion_args [ 'x_arg' ] = True #NEWLINE# #UNINDENT# if ( '-l' in prior ( input ) ) : #NEWLINE# #INDENT# completion_args [ 'l_arg' ] = True #NEWLINE# #UNINDENT# if ( '-c' in prior ( input ) ) : #NEWLINE# #INDENT# c_index = prior ( input ) . index ( '-c' ) #NEWLINE# if ( ( c_index + 1 ) < len ( prior ( input ) ) ) : #NEWLINE# #INDENT# completion_args [ 'c_arg' ] = prior ( input ) [ ( c_index + 1 ) ] #NEWLINE# #UNINDENT# #UNINDENT# options = complete_all ( current_prefix ( input ) , completion_args ) #NEWLINE# if current_prefix ( input ) . endswith ( '.' ) : #NEWLINE# #INDENT# options = [ x for x in options if ( '._' not in x ) ] #NEWLINE# #UNINDENT# return options