code: def widget_for(element):
      
      view_type = _view_type_for_element(element)
      if view_type is None:
          raise KeyError('No view type for %r' % element)
      builder = view_widgets.get(view_type)
      if builder is None:
          raise KeyError('No widget type for %r' % view_type)
      return builder(element)
docs: Create a widget for a schema item