code: def test_pythagorean_factorizations(sort):
      intervals = librosa.pythagorean_intervals(
          bins_per_octave=20, sort=sort, return_factors=False
      )
      factors = librosa.pythagorean_intervals(
          bins_per_octave=20, sort=sort, return_factors=True
      )
  
      assert len(intervals) == len(factors)
  
      for ival, facts in zip(intervals, factors):
          value = 0.0
          for prime in facts:
              value += facts[prime] * np.log2(prime)
  
          assert np.isclose(ival, np.power(2, value))
  
file_path: librosa/tests/test_intervals.py
imports: import os
  import sys
  import warnings
  import numpy
  import pytest
  import librosa
label_desc: Use image node_id 7 for calling a global function with example usage: test_pythagorean_factorizations(sort) without return types