def get_flags(args):
    """Returns the options set in the command line string normalized ("_" is
       transformed to "-")

    """
    train_stdin = False
    test_stdin = False
    flags = []
    for i in range(0, len(args)):
        if args[i].startswith('--'):
            flag = args[i]
            value = None
            if '=' in flag:
                value = args[i][flag.index('='):]
                args[i] = args[i][0:flag.index('=')]
            args[i] = args[i].replace('_', '-')
            flag = args[i]
            if value:
                args[i] = '%s%s' % (flag, value)
            flags.append(flag)
            if flag == '--train' and (i == len(args) - 1 or args[i + 1].
                startswith('--')):
                train_stdin = True
            elif flag == '--test' and (i == len(args) - 1 or args[i + 1].
                startswith('--')):
                test_stdin = True
    return flags, train_stdin, test_stdin
