<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def install_brew(target_path):
 """ Install brew to the target path """

    if not os.path.exists(target_path):
        try:
            os.makedirs(target_path)
        except OSError:
            logger.warn("Unable to create directory %s for brew." % target_path)
            logger.warn("Skipping...")
            return
    extract_targz(HOMEBREW_URL, target_path, remove_common_prefix=True)