def __searchParser(self, query):

        ret = dict()

        parse_params = True

        buf = ""
        ptr = ""

        p_avail = ("channel", "max", "before", "after", "order")

        opts = dict()
        par_open = False

        translate = {
            'a': 'audio',
            'v': 'video',
            'f': 'format',
            's': 'stream',
            'P': 'stream',
            'm': 'metadata',
            'max': 'maxResults',
            'channel': 'channelId',
            'before': 'publishedBefore',
            'after': 'publishedAfter',
            'order': 'order',
            '': 'q'
        }

        for i in query+' ':

            if parse_params:

                if not par_open:

                    if i == ' ': # flush buf

                        try:
                            if ret.get(translate[ptr]):
                                ret[ translate[ptr] ] += ' '
                            else:
                                ret[ translate[ptr] ] = ''

                            ret[ translate[ptr] ] += buf

                        except KeyError:
                            pass

                        ptr = ""
                        buf = ""

                    elif i == ':' and buf in p_avail:

                        ptr = buf
                        buf = ""

                    elif not buf and i == '[': # buf must be empty

                        parse_params = False
                        ptr = ""

                    elif i != '(':
                        buf += i

                elif not (par_open == 1 and i == ')'):
                    buf += i

                if i == '(': par_open += 1
                if par_open > 0 and i == ')': par_open -= 1


            else:

                if i == ']':

                    parse_params = True
                    par_open = False
                    ptr = ""
                    buf = ""

                elif ptr and not par_open and i == '(':
                    par_open = True

                elif par_open:

                    if i == ')':

                        try:
                            opts[ translate[ptr] ] = buf
                        except KeyError:
                            pass

                        par_open = False
                        buf = ""

                    else:
                        buf += i

                elif i.isalpha():

                    ptr = i

                    try:
                        opts[ translate[ptr] ] = not i.isupper()
                    except KeyError:
                        pass

        return (ret, opts)
Removes a file from the pending files list.
dataset/ETHPy150Open rasguanabana/ytfs/ytfs/actions.py/YTActions.__searchParser--crossover with--dataset/ETHPy150Open google/grr/grr/lib/flows/general/transfer.py/MultiGetFileMixin.RemoveInFlightFile