code: def from_defaults(clz, defaults):
          
          if isinstance(defaults, (str, unicode)):
              defaults = json.loads(defaults)
          
          c = clz()
          for attribute in defaults.keys():
              if attribute in c:
                  value = defaults[attribute]
                  c[attribute].merge(value)
          # in case any values were not specified, attempt to merge them with 
          # the settings provided by clz.random()
          cr = clz.random()
          for attribute, value in cr:
              try:
                  c[attribute].merge(value)
              except Contradiction:
                  pass
          return c
docs: Given a dictionary of defaults, ie {attribute: value},
          this classmethod constructs a new instance of the class and
          merges the defaults