def find_executable(file_name):
    def _find_executable(file_name):
        if os.path.split(file_name)[0] != '':
            # file_name includes directory so don't search path.
            if not isexecutable(file_name):
                return None
            else:
                return file_name
        for p in os.environ.get('PATH', os.defpath).split(os.pathsep):
            f = os.path.join(p, file_name)
            if isexecutable(f):
                return os.path.realpath(f)
        return None
    if os.name == 'nt' and os.path.splitext(file_name)[1] == '':
        for ext in ('.cmd','.bat','.exe'):
            result = _find_executable(file_name + ext)
            if result: break
    else:
        result = _find_executable(file_name)
    return result
Expected inclusion_params_and_context __doc__
dataset/ETHPy150Open FooBarWidget/mizuho/asciidoc/a2x.py/find_executable--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/tests/regressiontests/templates/templatetags/custom.py/inclusion_params_and_context