<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_primitive(name):
 """Locate and load the JSON annotation of the given primitive. All the paths found in PRIMTIVE_PATHS will be scanned to find a JSON file with the given name, and as soon as a JSON with the given name is found it is returned. Args: name (str):
 name of the primitive to look for. The name should correspond to the primitive, not to the filename, as the `.json` extension will be added dynamically. Returns: dict: The content of the JSON annotation file loaded into a dict. Raises: ValueError: A `ValueError` will be raised if the primitive cannot be found. """


    for base_path in get_primitives_paths():
        parts = name.split('.')
        number_of_parts = len(parts)

        for folder_parts in range(number_of_parts):
            folder = os.path.join(base_path, *parts[:folder_parts])
            filename = '.'.join(parts[folder_parts:]) + '.json'
            json_path = os.path.join(folder, filename)

            if os.path.isfile(json_path):
                with open(json_path, 'r') as json_file:
                    LOGGER.debug('Loading primitive %s from %s', name, json_path)
                    return json.load(json_file)

    raise ValueError("Unknown primitive: {}".format(name))