'Get a dictionary of the fields for the given scope which are set explicitly on this xblock. (Including
any set to None.)'

def get_explicitly_set_fields_by_scope(self, scope=Scope.content):

    result = {}
    for field in self.fields.values():
        if ((field.scope == scope) and field.is_set_on(self)):
            try:
                result[field.name] = field.read_json(self)
            except TypeError as exception:
                exception_message = '{message},    Block-location:{location},    Field-name:{field_name}'.format(message=exception.message, location=unicode(self.location), field_name=field.name)
                raise TypeError(exception_message)
    return result
