class_docstr: A wrapper class for performing separation.
class_docstr_tok: ["A","wrapper","class","for","performing","separation","."]
docstr: Export dictionary of sources to files.
  
  Parameters:
      sources (Dict):
          Dictionary of sources to be exported. The keys are the name
          of the instruments, and the values are `N x 2` numpy arrays
          containing the corresponding intrument waveform, as
          returned by the separate method
      audio_descriptor (AudioDescriptor):
          Describe song to separate, used by audio adapter to
          retrieve and load audio data, in case of file based audio
          adapter, such descriptor would be a file path.
      destination (str):
          Target directory to write output to.
      filename_format (str):
          (Optional) Filename format.
      codec (Codec):
          (Optional) Export codec.
      audio_adapter (Optional[AudioAdapter]):
          (Optional) Audio adapter to use for I/O.
      bitrate (str):
          (Optional) Export bitrate.
      synchronous (bool):
          (Optional) True is should by synchronous.
docstr_tok: ["Export","dictionary","of","sources","to","files",".","Parameters",":","sources","(","Dict",")",":","Dictionary","of","sources","to","be","exported",".","The","keys","are","the","name","of","the","instruments",",","and","the","values","are","`","N","x","2","`","numpy","arrays","containing","the","corresponding","intrument","waveform",",","as","returned","by","the","separate","method","audio_descriptor","(","AudioDescriptor",")",":","Describe","song","to","separate",",","used","by","audio","adapter","to","retrieve","and","load","audio","data",",","in","case","of","file","based","audio","adapter",",","such","descriptor","would","be","a","file","path",".","destination","(","str",")",":","Target","directory","to","write","output","to",".","filename_format","(","str",")",":","(","Optional",")","Filename","format",".","codec","(","Codec",")",":","(","Optional",")","Export","codec",".","audio_adapter","(","Optional","[","AudioAdapter","]",")",":","(","Optional",")","Audio","adapter","to","use","for","I\/O",".","bitrate","(","str",")",":","(","Optional",")","Export","bitrate",".","synchronous","(","bool",")",":","(","Optional",")","True","is","should","by","synchronous","."]
code: def save_to_file(
      self,
      sources: Dict,
      audio_descriptor: AudioDescriptor,
      destination: str,
      filename_format: str = "{filename}/{instrument}.{codec}",
      codec: Codec = Codec.WAV,
      audio_adapter: Optional[AudioAdapter] = None,
      bitrate: str = "128k",
      synchronous: bool = True,
  ) -> None:
      """
      Export dictionary of sources to files.
  
      Parameters:
          sources (Dict):
              Dictionary of sources to be exported. The keys are the name
              of the instruments, and the values are `N x 2` numpy arrays
              containing the corresponding intrument waveform, as
              returned by the separate method
          audio_descriptor (AudioDescriptor):
              Describe song to separate, used by audio adapter to
              retrieve and load audio data, in case of file based audio
              adapter, such descriptor would be a file path.
          destination (str):
              Target directory to write output to.
          filename_format (str):
              (Optional) Filename format.
          codec (Codec):
              (Optional) Export codec.
          audio_adapter (Optional[AudioAdapter]):
              (Optional) Audio adapter to use for I/O.
          bitrate (str):
              (Optional) Export bitrate.
          synchronous (bool):
              (Optional) True is should by synchronous.
      """
      if audio_adapter is None:
          audio_adapter = AudioAdapter.default()
      foldername = basename(dirname(audio_descriptor))
      filename = splitext(basename(audio_descriptor))[0]
      generated = []
      for instrument, data in sources.items():
          path = join(
              destination,
              filename_format.format(
                  filename=filename,
                  instrument=instrument,
                  foldername=foldername,
                  codec=codec,
              ),
          )
          directory = os.path.dirname(path)
          if not os.path.exists(directory):
              os.makedirs(directory)
          if path in generated:
              raise SpleeterError(
                  (
                      f"Separated source path conflict : {path},"
                      "please check your filename format"
                  )
              )
          generated.append(path)
          if self._pool:
              task = self._pool.apply_async(
                  audio_adapter.save,
                  (path, data, self._sample_rate, codec, bitrate),
              )
              self._tasks.append(task)
          else:
              audio_adapter.save(
                  path, data, self._sample_rate, codec, bitrate
              )
      if synchronous and self._pool:
          self.join()
  
imports: import atexit
  import os
  from multiprocessing import Pool
  from os.path import basename, dirname, join, splitext
  from typing import Any, Dict, Generator, List, Optional
  import numpy
  import tensorflow
  from .None import SpleeterError
  from .audio import Codec
  from .audio.adapter import AudioAdapter
  from .audio.convertor import to_stereo
  from .model import EstimatorSpecBuilder, InputProviderFactory, model_fn
  from .model.provider import ModelProvider
  from .types import AudioDescriptor
  from .utils.configuration import load_configuration
label_desc: Use image node_id 11 for calling the Separator obj's underlying member method code with example usage: obj.save_to_file(sources, audio_descriptor, destination, filename_format, codec, audio_adapter, bitrate, synchronous) without return types