def expand(self, arguments, via):

        result = []

        for arg in arguments:
            # Ensure arguments are unicode.
            # arg = arg.decode(encoding) if isinstance(arg, binary) else arg

            # Skip the impossibility of empty arguments.
            if not arg: continue

            # A double-hyphen argument signals the end of hyphenated arguments.
            if arg == '--' or '--' in result:
                result.append(arg)
                continue

            # Now we start looking for our hyphenated options.
            if len(arg) >= 2 and arg[0] == '-':
                if arg[1] == '-':
                    # This is a long-form argument.
                    name, _, value = arg.partition('=')

                    # We append the name, then value if one exists.
                    result.append(name)
                    if value: result.append(value)

                    continue

                # Expand short arguments into long ones.
                for char in arg[1:]:
                    name = via.short.get(char, None)
                    if name: result.append('--' + name)
                    else: result.append('-' + char)

                continue

            # Other values we just pass along.
            result.append(arg)

        return result
Checking selecting values from an Index (long and int flavor)
dataset/ETHPy150Open marrow/script/marrow/script/core.py/Parser.expand--crossover with--dataset/ETHPy150Open PyTables/PyTables/tables/tests/test_indexvalues.py/SelectValuesTestCase.test03d