code: def _get_sorted_parent_nodes(parent_node_candidates: list) -> list:
      parent_nodes = []
      for candidate_node_name in parent_node_candidates:
          candidate_node_name = candidate_node_name.strip()
          if candidate_node_name not in _allowed_callables:
              parent_nodes.append(candidate_node_name)
      parent_nodes.sort()
      return parent_nodes
  
imports: import ast
  import logging
  import re
  from typing import Tuple
  import networkx
  import numpy
  import scipy.stats
  from dowhy.gcm import AdditiveNoiseModel, EmpiricalDistribution, ScipyDistribution, StructuralCausalModel
  from dowhy.gcm.causal_mechanisms import StochasticModel
  from dowhy.gcm.causal_models import PARENTS_DURING_FIT
  from dowhy.gcm.ml.prediction_model import PredictionModel
  from dowhy.gcm.util.general import shape_into_2d
  from dowhy.graph import get_ordered_predecessors
label_desc: Use image node_id 7 for calling a global function with example usage: _get_sorted_parent_nodes(parent_node_candidates) and returns: parent_nodes