code: def parse(self, descriptor):
          
          fg = descriptor.get('fg')
          bg = descriptor.get('bg')
          types = descriptor.get('fmt')
          ret = ""
          if fg:
              ret += fgseq(fg)
          if bg:
              ret += bgseq(bg)
          if types:
              t = typeseq(types)
              if t:
                  ret += t
          
          # wew, strings and bytes, what's a guy to do!
          reset = resetseq()
          if not isinstance(reset, six.text_type):
              reset = reset.decode('utf-8')
          
          def ret_func(msg):
              if not isinstance(msg, six.text_type):
                  msg = msg.decode('utf-8')
              return ret + msg + reset
  
          self.decorator = ret_func
docs: Creates a text styling from a descriptor
  
          A descriptor is a dictionary containing any of the following keys:
              * fg: The foreground color (name or int)
                      See `bgseq`
              * bg: The background color (name or int)
                      See `fgseq`
              * fmt: The types of special text formatting (any combination of 'b', 'u', 'i', and 'r')
                      See `typeseq`