def _get_flags(flags):
    if isinstance(flags, six.string_types):
        flags = [flags]

    if isinstance(flags, Iterable) and not isinstance(flags, Mapping):
        _flags_acc = []
        for flag in flags:
            _flag = getattr(re, str(flag).upper())

            if not isinstance(_flag, six.integer_types):
                raise SaltInvocationError(
                    'Invalid re flag given: {0}'.format(flag)
                )

            _flags_acc.append(_flag)

        return reduce(operator.__or__, _flags_acc)
    elif isinstance(flags, six.integer_types):
        return flags
    else:
        raise SaltInvocationError(
            'Invalid re flags: "{0}", must be given either as a single flag '
            'string, a list of strings, or as an integer'.format(flags)
        )
Constructor call creates a new data point. All fields must be present.
dataset/ETHPy150Open saltstack/salt/salt/modules/file.py/_get_flags--crossover with--dataset/ETHPy150Open influxdata/influxdb-python/influxdb/influxdb08/helper.py/SeriesHelper.__init__