def pyline(iterable,
           cmd=None,
           codefunc=None,
           col_map=None,
           uri=None,
           meta=None,
           modules=[],
           regex=None,
           regex_options=None,
           path_tools_pathpy=False,
           path_tools_pathlib=False,
           shlex=None,
           idelim=None,
           idelim_split_max=-1,
           odelim="\t",
           **kwargs):

    for _importset in modules:
        for _import in _importset.split(','):
            locals()[_import] = __import__(_import.strip())

    _rgx = None
    if regex:
        _regexstr = regex
        if bool(regex_options):
            _regexstr = ("(?%s)" % (regex_options)) + _regexstr
        #    _regexstr = r"""(?%s)%s""" % (
        #        ''.join(
        #            l.lower() for l in regex_options
        #                if l.lower() in REGEX_OPTIONS),
        #        _regexstr)
        log.info(('_rgx', _regexstr))
        _rgx = re.compile(_regexstr)

    Path = str
    if path_tools_pathpy:
        import path as pathpy
        Path = pathpy.path
    if path_tools_pathlib:
        import pathlib
        Path = pathlib.Path

    if cmd is None and codefunc is None:
        if regex:
            cmd = "rgx and rgx.groups()"
            # cmd = "rgx and rgx.groupdict()"
        else:
            cmd = "line"
        if path_tools_pathpy or path_tools_pathlib:
            cmd = "p"

    codeobj = None
    if cmd:
        try:
            log.info(("cmd", cmd))
            codeobj = compile(cmd, 'command', 'eval')
        except Exception as e:
            e.message = "%s\ncmd: %s" % (e.message, cmd)
            log.error(repr(cmd))
            log.exception(e)
            raise

    def item_keys(obj, keys):
        if isinstance(keys, (str, unicode)):
            keys = [keys]
        for k in keys:
            if k is None:
                yield k
            else:
                yield obj.__getslice__(k)

    def k(obj, keys=(':',)):
        return [obj.__getslice__(k) for k in keys]

    def j(args):
        return odelim.join(str(_value) for _value in args)
    # from itertools import imap, repeat
    # j = lambda args: imap(str, izip_longest(args, repeat(odelim)))

    i_last = None
    if cmd and 'i_last' in cmd:
        # Consume the whole file into a list (to count lines)
        iterable = list(iterable)
        i_last = len(iterable)

    pp = pprint.pformat

    if shlex:
        def splitfunc(line):
            return _shlex.split(line, posix=True)
    else:
        def splitfunc(obj):
            if hasattr(obj, 'strip'):
                return obj.strip().split(idelim, idelim_split_max)
            else:
                return obj

    global_ctxt = globals()
    for i, obj in enumerate(iterable):
        l = line = o = obj
        w = words = [_w for _w in splitfunc(line)]
        rgx = _rgx and _rgx.match(line) or None

        p = path = None
        if path_tools_pathpy or path_tools_pathlib and line.rstrip():
            try:
                p = path = Path(line.strip()) or None
            except Exception as e:
                log.exception(e)
                pass
        try:
            if codeobj:
                # Note: eval
                result = eval(codeobj, global_ctxt, locals())  # ...
            elif codefunc:
                ctxt = global_ctxt.copy()
                ctxt.update(locals())
                result = codefunc(ctxt)
        except Exception as e:
            e.cmd = cmd
            log.exception(repr(cmd))
            log.exception(e)
            raise
        yield PylineResult(n=i, result=result)  # , uri=uri, meta=meta)
Return gain of tuner.  Can be either the string 'AUTO' or a numeric
dataset/ETHPy150Open westurner/pyline/pyline.py/pyline--crossover with--dataset/ETHPy150Open adafruit/FreqShow/model.py/FreqShowModel.get_gain