code: def get_features_by_tag(tag=None, json_path=None):
      """Creates a dictionary with the features settings by tag.
  
      Parameters
      ----------
      tag : string
          Available tags: "audio"; "inertial", "ecg"; "eeg"; "emg".
          If tag equals None then, all available features are returned.
      json_path : string
          Directory of json file. Default: package features.json directory
  
      Returns
      -------
      Dict
          Dictionary with the features settings
  
      """
      if json_path is None:
          json_path = (
              tsfel.__path__[0] + "/feature_extraction/features.json"
          )
  
          if tag not in [
              "audio",
              "inertial",
              "ecg",
              "eeg",
              "emg",
              None,
          ]:
              raise SystemExit(
                  "No valid tag. Choose: audio, inertial, ecg, eeg, emg or None."
              )
      features_tag = {}
      dict_features = load_json(json_path)
      if tag is None:
          return dict_features
      else:
          for domain in dict_features:
              features_tag[domain] = {}
              for feat in dict_features[domain]:
                  if dict_features[domain][feat]["use"] == "no":
                      continue
                  # Check if tag is defined
                  try:
                      js_tag = dict_features[domain][feat]["tag"]
                      if isinstance(js_tag, list):
                          if any([tag in js_t for js_t in js_tag]):
                              features_tag[domain].update(
                                  {feat: dict_features[domain][feat]}
                              )
                      elif js_tag == tag:
                          features_tag[domain].update(
                              {feat: dict_features[domain][feat]}
                          )
                  except KeyError:
                      continue
          # To remove empty dicts
          return dict(
              [
                  [d, features_tag[d]]
                  for d in list(features_tag.keys())
                  if bool(features_tag[d])
              ]
          )
  
imports: import json
  import tsfel
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: get_features_by_tag(tag, json_path) and returns: dict_features, dict