code: def add_primitives_path(path):
      
      if path not in _PRIMITIVES_PATHS:
          if not os.path.isdir(path):
              raise ValueError('Invalid path: {}'.format(path))
  
          LOGGER.debug('Adding new primitives path %s', path)
          _PRIMITIVES_PATHS.insert(0, os.path.abspath(path))
docs: Add a new path to look for primitives.
  
      The new path will be inserted in the first place of the list,
      so any primitive found in this new folder will take precedence
      over any other primitive with the same name that existed in the
      system before.
  
      Args:
          path (str): path to add
  
      Raises:
          ValueError: A `ValueError` will be raised if the path is not valid.