'Cleans the note object or raises a ValidationError.'

def clean(self, json_body):

    if (json_body is None):
        raise ValidationError('Note    must    have    a    body.')
    body = json.loads(json_body)
    if (not isinstance(body, dict)):
        raise ValidationError('Note    body    must    be    a    dictionary.')
    self.uri = strip_tags(body.get('uri', ''))
    self.text = strip_tags(body.get('text', ''))
    self.quote = strip_tags(body.get('quote', ''))
    ranges = body.get('ranges')
    if ((ranges is None) or (len(ranges) != 1)):
        raise ValidationError('Note    must    contain    exactly    one    range.')
    self.range_start = ranges[0]['start']
    self.range_start_offset = ranges[0]['startOffset']
    self.range_end = ranges[0]['end']
    self.range_end_offset = ranges[0]['endOffset']
    self.tags = ''
    tags = [strip_tags(tag) for tag in body.get('tags', [])]
    if (len(tags) > 0):
        self.tags = ','.join(tags)
