docstr: Sort algorithm implementations by speed.
          
docstr_tok: ["Sort","algorithm","implementations","by","speed","."]
code: def optimize(self) -> None:
      """Sort algorithm implementations by speed."""
      # load benchmarks results
      with LIBRARIES_PATH.open("r", encoding="utf8") as f:
          libs_data: dict = json.load(f)
      # optimize
      for alg, libs_names in libs_data.items():
          libs = self.get_libs(alg)
          if not libs:
              continue
          # drop slow libs
          self.libs[alg] = [
              lib
              for lib in libs
              if [lib.module_name, lib.func_name] in libs_names
          ]
          # sort libs by speed
          self.libs[alg].sort(
              key=lambda lib: libs_names.index(
                  [lib.module_name, lib.func_name]
              )
          )
  
imports: from __future__ import annotations
  import json
  from collections import defaultdict
  from copy import deepcopy
  from importlib import import_module
  from pathlib import Path
  from typing import Any, Callable, Sequence
label_desc: Use image node_id 3 for calling the LibrariesManager obj's underlying member method code with example usage: obj.optimize() without return types