def _locate_module(module_name, logger):
    """
    Locate the bython file for a given module name.

    Args:
        module_name (str):              Module to look for.
        logger (bython.logger.Logger)   Optional. Logger object. Mainly used for
                                        debugging.

    Returns:
        str: Full path of bython file associated with module. 
    
    Raises:
        ImportError: If module is not found.
    """
    for path in sys.path:
        logger.log_info("Searching in %s" % path)

        module_path = _traverse_and_find(module_name, path) 

        if module_path is not None:
            logger.log_info("Module found at %s" % module_path)
            break

    if module_path is None:
        raise ImportError("Could not find any bython file for %s" % module_name)

    return module_path

    Locate the bython file for a given module name.

    Args:
        module_name (str):              Module to look for.
        logger (bython.logger.Logger)   Optional. Logger object. Mainly used for
                                        debugging.

    Returns:
        str: Full path of bython file associated with module. 
    
    Raises:
        ImportError: If module is not found.
    
bython/importing.py