code: def _freq_feat_graph(feat_name, **kwargs):
      winlen = kwargs.get("winlen")
      winstep = kwargs.get("winstep")
      feature_size = kwargs.get("feature_size")
      sr = kwargs.get("sr")  # pylint: disable=invalid-name
      nfft = kwargs.get("nfft")
      del nfft
  
      assert feat_name in ("fbank", "spec")
  
      params = speech_ops.speech_params(
          sr=sr,
          bins=feature_size,
          add_delta_deltas=False,
          audio_frame_length=winlen,
          audio_frame_step=winstep,
      )
  
      graph = None
      if feat_name == "fbank":
          # get session
          if feat_name not in _global_sess:
              graph = tf.Graph()
              # pylint: disable=not-context-manager
              with graph.as_default():
                  # fbank
                  filepath = tf.placeholder(
                      dtype=tf.string, shape=[], name="wavpath"
                  )
                  waveforms, sample_rate = speech_ops.read_wav(
                      filepath, params
                  )
                  del sample_rate
                  fbank = speech_ops.extract_feature(waveforms, params)
                  # shape must be [T, D, C]
                  feat = tf.identity(fbank, name=feat_name)
      elif feat_name == "spec":
          # magnitude spec
          if feat_name not in _global_sess:
              graph = tf.Graph()
              # pylint: disable=not-context-manager
              with graph.as_default():
                  filepath = tf.placeholder(
                      dtype=tf.string, shape=[], name="wavpath"
                  )
                  waveforms, sample_rate = speech_ops.read_wav(
                      filepath, params
                  )
  
                  spec = py_x_ops.spectrum(
                      waveforms[:, 0],
                      tf.cast(sample_rate, tf.dtypes.float32),
                      window_length=0.025,
                      frame_length=0.010,
                      output_type=1,
                      snip_edges=True,
                      raw_energy=1,
                      preEph_coeff=0.97,
                      window_type="povey",
                      remove_dc_offset=True,
                      is_fbank=False,
                  )  # output_type: 1, power spec; 2 log power spec
                  spec = tf.sqrt(spec)
                  # shape must be [T, D, C]
                  spec = tf.expand_dims(spec, -1)
                  feat = tf.identity(spec, name=feat_name)
      else:
          raise ValueError(f"Not support freq feat: {feat_name}.")
  
      return graph, (
          _get_out_tensor_name("wavpath", 0),
          _get_out_tensor_name(feat_name, 0),
      )
  
file_path: delta/delta/data/feat/speech_feature.py
imports: import os
  import numpy
  import delta.compat
  from absl import logging
  from delta.data.feat import speech_ops
  from core.ops import py_x_ops
  from delta.data.feat import python_speech_features
label_desc: Use image node_id 3 for calling a global function with example usage: _freq_feat_graph(feat_name) and returns: graph,  _get_out_tensor_name,  _get_out_tensor_name