def get_interpreter(python_version):

    if not isinstance(python_version, tuple):
        msg = (_LE("given format of python version `%s` is invalid") %
               python_version)
        raise exceptions.InvalidArgumentsException(msg)

    interpreter_name = "python%s.%s" % python_version
    interpreter = spawn.find_executable(interpreter_name)
    if interpreter:
        return interpreter
    else:
        interpreters = filter(
            os.path.isfile, [os.path.join(p, interpreter_name)
                             for p in os.environ.get("PATH", "").split(":")])
        cmd = "%s -c 'import sys; print(sys.version_info[:2])'"
        for interpreter in interpreters:
            try:
                out = sp_check_output(cmd % interpreter, shell=True)
            except subprocess.CalledProcessError:
                pass
            else:
                if out.strip() == str(python_version):
                    return interpreter
adjust our binner when upsampling
dataset/ETHPy150Open openstack/rally/rally/common/costilius.py/get_interpreter--crossover with--dataset/ETHPy150Open pydata/pandas/pandas/tseries/resample.py/DatetimeIndexResampler._adjust_binner_for_upsample