class_docstr: a class to represent a single clause/rule of the form:
  "IF <literal1> AND <literal2> AND ... <literal_k> THEN predict class = 0 or 1"
class_docstr_tok: ["a","class","to","represent","a","single","clause\/rule","of","the","form",":","''","IF","<","literal1",">","AND","<","literal2",">","AND","...","<","literal_k",">","THEN","predict","class","=","0","or","1","''"]
code: def intersect_dicts(region1: dict, region2: dict):
      result = {}
      for k in region1.keys():
          if k in region2:
              l1 = region1[k][0]
              l2 = region1[k][1]
              r1 = region2[k][0]
              r2 = region2[k][1]
              bin = (l2 == r1) or (r2 == l1)
              if (
                  r2 < l1 or r1 > l2 or bin
              ):  # = because what if one is [0, 0.5] and other is [0.5, 1] ?
                  # intersection region is NULL set, no value is admissible for this feature
                  return {}
              else:
                  result[k] = [max(r1, l1), min(l2, r2)]
          else:
              result[k] = [region1[k][0], region1[k][1]]
      for k in region2.keys():
          if k not in region1:
              result[k] = [region2[k][0], region2[k][1]]
  
      return result
  
file_path: AIX360/aix360/algorithms/imd/rule.py
imports: from dataclasses import dataclass
  import numpy
  import pandas
label_desc: Use image node_id 8 for calling the Rule obj's underlying member method code with example usage: obj.intersect_dicts(region1, region2) and returns: result, dict