def scan_file(file, stdLib): # make sure to use pathlib.Path objects otherwise throw an arror try: file = pathlib.Path(file) except TypeError: raise TypeError( "input <{error_cause}> for 'file' does not match {type_name}".format( type_name = pathlib.Path, error_cause = str(file) ) ) if file in stdLib: return False tok = tokenizer.TokenCategorizer(file) modules, callables = imported_modules(tok) lokalClasses, lokalFunctions = lokal_callables(tok) out = { "modules": modules, "callables": callables, "lokalClasses": lokalClasses, "lokalFunctions": lokalFunctions } return out