code: def identify_nde_effect(
      graph: nx.DiGraph,
      action_nodes: List[str],
      outcome_nodes: List[str],
      observed_nodes: List[str],
      backdoor_adjustment: BackdoorAdjustment,
      estimand_type: EstimandType,
  ):
      estimands_dict = {}
      ### 1. FIRST DOING BACKDOOR IDENTIFICATION
      # First, checking if there are any valid backdoor adjustment sets
      backdoor_sets = identify_backdoor(
          graph,
          action_nodes,
          outcome_nodes,
          observed_nodes,
          backdoor_adjustment,
      )
      (
          estimands_dict,
          backdoor_variables_dict,
      ) = build_backdoor_estimands_dict(
          action_nodes,
          outcome_nodes,
          observed_nodes,
          backdoor_sets,
          estimands_dict,
      )
      # Setting default "backdoor" identification adjustment set
      default_backdoor_id = get_default_backdoor_set_id(
          graph, action_nodes, outcome_nodes, backdoor_variables_dict
      )
      backdoor_variables_dict["backdoor"] = backdoor_variables_dict.get(
          str(default_backdoor_id), None
      )
  
      ### 2. SECOND, CHECKING FOR MEDIATORS
      # Now checking if there are valid mediator variables
      estimands_dict = {}
      mediation_first_stage_confounders = None
      mediation_second_stage_confounders = None
      mediators_names = identify_mediation(
          graph, action_nodes, outcome_nodes
      )
      logger.info(
          "Mediators for treatment and outcome:" + str(mediators_names)
      )
      if len(mediators_names) > 0:
          mediation_estimand_expr = construct_mediation_estimand(
              estimand_type,
              action_nodes,
              outcome_nodes,
              mediators_names,
          )
          logger.debug(
              "Identified expression = " + str(mediation_estimand_expr)
          )
          estimands_dict["mediation"] = mediation_estimand_expr
          mediation_first_stage_confounders = (
              identify_mediation_first_stage_confounders(
                  graph,
                  action_nodes,
                  outcome_nodes,
                  mediators_names,
                  observed_nodes,
                  backdoor_adjustment,
              )
          )
          mediation_second_stage_confounders = (
              identify_mediation_second_stage_confounders(
                  graph,
                  action_nodes,
                  mediators_names,
                  outcome_nodes,
                  observed_nodes,
                  backdoor_adjustment,
              )
          )
      else:
          estimands_dict["mediation"] = None
      # Finally returning the estimand object
      estimand = IdentifiedEstimand(
          None,
          treatment_variable=action_nodes,
          outcome_variable=outcome_nodes,
          estimand_type=estimand_type,
          estimands=estimands_dict,
          backdoor_variables=backdoor_variables_dict,
          instrumental_variables=None,
          frontdoor_variables=None,
          mediator_variables=mediators_names,
          mediation_first_stage_confounders=mediation_first_stage_confounders,
          mediation_second_stage_confounders=mediation_second_stage_confounders,
          default_backdoor_id=None,
      )
      return estimand
  
imports: import itertools
  import logging
  from enum import Enum
  from typing import Dict, List, Optional, Union
  import networkx
  import sympy
  import sympy.stats
  from dowhy.causal_identifier.efficient_backdoor import EfficientBackdoor
  from dowhy.causal_identifier.identified_estimand import IdentifiedEstimand
  from dowhy.graph import check_dseparation, check_valid_backdoor_set, check_valid_frontdoor_set, check_valid_mediation_set, do_surgery, get_all_directed_paths, get_backdoor_paths, get_descendants, get_instruments, has_directed_path
  from dowhy.utils.api import parse_state
label_desc: Use image node_id 5 for calling a global function with example usage: identify_nde_effect(graph, action_nodes, outcome_nodes, observed_nodes, backdoor_adjustment, estimand_type) and returns: estimand