class_docstr: A data structure that provides an interface to access nested dictionaries with "flattened keys", and a few more functions.
  
  e.g.
      dct = RecursiveDict({'a':{'b':2}})
      assert dct["a__b"] == 2
      dct["a__b__c"] = 3
      assert dct['a']['b']['c'] == dct["a__b__c"] == dct.to_flat_dict()["a__b__c"]
  
  This class serves as a base for HyperparameterSamples and HyperparameterSpace
class_docstr_tok: ["A","data","structure","that","provides","an","interface","to","access","nested","dictionaries","with","``","flattened","keys","''",",","and","a","few","more","functions",".","e.g",".","dct","=","RecursiveDict","(","{","'","a","'",":","{","'","b':2","}","}",")","assert","dct","[","``","a__b","''","]","==","2","dct","[","``","a__b__c","''","]","=","3","assert","dct","[","'","a","'","]","[","'","b","'","]","[","'","c","'","]","==","dct","[","``","a__b__c","''","]","==","dct.to_flat_dict","(",")","[","``","a__b__c","''","]","This","class","serves","as","a","base","for","HyperparameterSamples","and","HyperparameterSpace"]
docstr: Returns a FlatDict with wildcards. Shorten the keys to the shortest possible while
  mainting the same order and value, as well as the ability to differentiate each key.
docstr_tok: ["Returns","a","FlatDict","with","wildcards",".","Shorten","the","keys","to","the","shortest","possible","while","mainting","the","same","order","and","value",",","as","well","as","the","ability","to","differentiate","each","key","."]
code: def to_wildcards(self) -> FlatDict:
      """
      Returns a FlatDict with wildcards. Shorten the keys to the shortest possible while
      mainting the same order and value, as well as the ability to differentiate each key.
      """
      flat: FlatDict = self.to_flat_dict()
      rkeys: List[RList[str]] = list(
          [list(reversed(i.split(self.separator))) for i in flat.keys()]
      )
  
      rkeys = self._wildcards_reduce(rkeys)
  
      # reverse the keys back to the original order:
      rkeys = [
          self.separator.join(list(reversed(i)))
          .replace(f"{self.separator}*", "*")
          .replace(f"*{self.separator}", "*")
          for i in rkeys
      ]
      flat = OrderedDict(zip(rkeys, flat.values()))
      return flat
  
imports: import typing
  from collections import Counter, OrderedDict, defaultdict
  from copy import copy
  from typing import Any, Dict, Iterable, List, Set, Union
  from neuraxle.hyperparams.distributions import FixedHyperparameter, HPSampledValue, HyperparameterDistribution
  from neuraxle.hyperparams.scipy_distributions import ScipyContinuousDistributionWrapper, ScipyDiscreteDistributionWrapper
  from scipy.stats import rv_continuous, rv_discrete
  from scipy.stats._distn_infrastructure import rv_generic
label_desc: Use image node_id 15 for calling the RecursiveDict obj's underlying member method code with example usage: obj.to_wildcards() and returns: flat