<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def base_name_from_image(image):
 """Extract the base name of the image to use as the 'algorithm name' for the job. Args: image (str):
 Image name. Returns: str: Algorithm name, as extracted from the image name. """

    m = re.match("^(.+/)?([^:/]+)(:[^:]+)?$", image)
    algo_name = m.group(2) if m else image
    return algo_name