'Return dictionary of {scope: {field1: val, ..}..} for the fields of this potential xblock
:param category: the xblock category
:param fields: the dictionary of {fieldname: value}'

def partition_fields_by_scope(self, category, fields):

    result = defaultdict(dict)
    if (fields is None):
        return result
    cls = self.mixologist.mix(XBlock.load_class(category, select=prefer_xmodules))
    for (field_name, value) in fields.iteritems():
        field = getattr(cls, field_name)
        result[field.scope][field_name] = value
    return result
