def gather_candidates(self, context):
        p = self.__longest_path_that_exists(context['input'])
        if p in (None, []) or p == '/' or re.search('//+$', p):
            return []
        complete_str = self.__substitute_path(dirname(p) + '/')
        if not os.path.isdir(complete_str):
            return []
        hidden = context['complete_str'].find('.') == 0
        dirs = [x for x in os.listdir(complete_str)
                if os.path.isdir(complete_str + x) and
                (hidden or x[0] != '.')]
        files = [x for x in os.listdir(complete_str)
                 if not os.path.isdir(complete_str + x) and
                 (hidden or x[0] != '.')]
        return [{'word': x, 'abbr': x + '/'} for x in sorted(dirs)
                ] + [{'word': x} for x in sorted(files)]
dataset/ETHPy150Open Shougo/deoplete.nvim/rplugin/python3/deoplete/sources/file.py/Source.gather_candidates/original