parameters: (x)
docstring: Recursively converts a OrderedBunch into a dictionary.
          
          >>> b = OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!')
          >>> ordered_unbunchify(b)
          {'ponies': 'are pretty!', 'foo': {'lol': True}, 'hello': 42}
          
          ordered_unbunchify will handle intermediary dicts, lists and tuples (as well as
          their subclasses), but ymmv on custom datatypes.
          
          >>> b = OrderedBunch(foo=['bar', OrderedBunch(lol=True)], hello=42, 
          ...         ponies=('are pretty!', OrderedBunch(lies='are trouble!')))
          >>> ordered_unbunchify(b) #doctest: +NORMALIZE_WHITESPACE
          {'ponies': ('are pretty!', {'lies': 'are trouble!'}), 
           'foo': ['bar', {'lol': True}], 'hello': 42}
          
          nb. As dicts are not hashable, they cannot be nested in sets/frozensets.
docstring_summary: Recursively converts a OrderedBunch into a dictionary.
          
          >>> b = OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!')
          >>> ordered_unbunchify(b)
          {'ponies': 'are pretty!', 'foo': {'lol': True}, 'hello': 42}
          
          ordered_unbunchify will handle intermediary dicts, lists and tuples (as well as
          their subclasses), but ymmv on custom datatypes.
          
          >>> b = OrderedBunch(foo=['bar', OrderedBunch(lol=True)], hello=42, 
          ...         ponies=('are pretty!', OrderedBunch(lies='are trouble!')))
          >>> ordered_unbunchify(b) #doctest: +NORMALIZE_WHITESPACE
          {'ponies': ('are pretty!', {'lies': 'are trouble!'}), 
           'foo': ['bar', {'lol': True}], 'hello': 42}
          
          nb. As dicts are not hashable, they cannot be nested in sets/frozensets.
docstring_tokens: Recursively converts a OrderedBunch into a dictionary . >>> b = OrderedBunch ( foo = OrderedBunch ( lol = True ) hello = 42 ponies = are pretty! ) >>> ordered_unbunchify ( b ) { ponies : are pretty! foo : { lol : True } hello : 42 } ordered_unbunchify will handle intermediary dicts lists and tuples ( as well as their subclasses ) but ymmv on custom datatypes . >>> b = OrderedBunch ( foo = [ bar OrderedBunch ( lol = True ) ] hello = 42 ... ponies = ( are pretty! OrderedBunch ( lies = are trouble! ))) >>> ordered_unbunchify ( b ) #doctest : + NORMALIZE_WHITESPACE { ponies : ( are pretty! { lies : are trouble! } ) foo : [ bar { lol : True } ] hello : 42 } nb . As dicts are not hashable they cannot be nested in sets / frozensets .
function: def ordered_unbunchify(x):
      """ Recursively converts a OrderedBunch into a dictionary.
          
          >>> b = OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!')
          >>> ordered_unbunchify(b)
          {'ponies': 'are pretty!', 'foo': {'lol': True}, 'hello': 42}
          
          ordered_unbunchify will handle intermediary dicts, lists and tuples (as well as
          their subclasses), but ymmv on custom datatypes.
          
          >>> b = OrderedBunch(foo=['bar', OrderedBunch(lol=True)], hello=42, 
          ...         ponies=('are pretty!', OrderedBunch(lies='are trouble!')))
          >>> ordered_unbunchify(b) #doctest: +NORMALIZE_WHITESPACE
          {'ponies': ('are pretty!', {'lies': 'are trouble!'}), 
           'foo': ['bar', {'lol': True}], 'hello': 42}
          
          nb. As dicts are not hashable, they cannot be nested in sets/frozensets.
      """
      if isinstance(x, OrderedDict):
          return OrderedDict( (k, ordered_unbunchify(v)) for k,v in x.iteritems() )    
      elif isinstance(x, dict):
          return dict( (k, ordered_unbunchify(v)) for k,v in x.iteritems() )
      elif isinstance(x, (list, tuple)):
          return type(x)( ordered_unbunchify(v) for v in x )
      else:
          return x
function_tokens: def ordered_unbunchify ( x ) : if isinstance ( x , OrderedDict ) : return OrderedDict ( ( k , ordered_unbunchify ( v ) ) for k , v in x . iteritems ( ) ) elif isinstance ( x , dict ) : return dict ( ( k , ordered_unbunchify ( v ) ) for k , v in x . iteritems ( ) ) elif isinstance ( x , ( list , tuple ) ) : return type ( x ) ( ordered_unbunchify ( v ) for v in x ) else : return x