class_docstr: Result of causal analysis.
class_docstr_tok: ["Result","of","causal","analysis","."]
code: def _get_policy_tree_object(self, policy_tree):
      if policy_tree[ResultAttributes.LEAF]:
          policy_tree_object = CausalPolicyTreeLeaf()
          policy_tree_object.leaf = policy_tree[ResultAttributes.LEAF]
          policy_tree_object.n_samples = policy_tree[
              ResultAttributes.N_SAMPLES
          ]
          policy_tree_object.treatment = policy_tree[
              ResultAttributes.TREATMENT
          ]
      else:
          policy_tree_object = CausalPolicyTreeInternal()
          policy_tree_object.leaf = policy_tree[ResultAttributes.LEAF]
          feature, comparison, value = self._parse_comparison(
              policy_tree, self.config.categorical_features
          )
          policy_tree_object.feature = feature
          policy_tree_object.right_comparison = comparison
          policy_tree_object.comparison_value = value
          policy_tree_object.left = self._get_policy_tree_object(
              policy_tree[ResultAttributes.LEFT]
          )
          policy_tree_object.right = self._get_policy_tree_object(
              policy_tree[ResultAttributes.RIGHT]
          )
      return policy_tree_object
  
imports: import json
  import re
  import uuid
  from pathlib import Path
  from typing import Any, List, Optional, Tuple, Union
  import pandas
  import semver
  from responsibleai._interfaces import CausalConfig
  from responsibleai._interfaces import CausalData, CausalPolicy, CausalPolicyGains, CausalPolicyTreeInternal, CausalPolicyTreeLeaf, ComparisonTypes
  from responsibleai._internal.constants import FileFormats, SerializationAttributes
  from responsibleai._tools.causal.causal_config import CausalConfig
  from responsibleai._tools.causal.causal_constants import ResultAttributes
  from responsibleai._tools.shared.base_result import BaseResult
  from responsibleai._tools.shared.versions import CausalVersions
label_desc: Use image node_id 14 for calling the CausalResult obj's underlying member method code with example usage: obj._get_policy_tree_object(policy_tree) and returns: policy_tree_object