'Parse each of spark scala apit class file and make a Description object for each'

def parse_comment(self):

    with open('output.txt', 'wb') as output:
        for file in self.files_to_parse:
            soup = BeautifulSoup(open(file), 'html.parser')
            name = file.split('/')[1].replace('.html', '')
            source_url = '{}{}.html'.format(spark_scala_base_url, name.replace('.', '/'))
            comment_element = soup.find('div', id='comment').find(class_='comment    cmt')
            if (not comment_element):
                continue
            description_with_annotation = u'    '.join([p.text for p in comment_element.find_all('p')])
            description_with_annotation_list = description_with_annotation.split(u'::')
            annotation = None
            assert ((len(description_with_annotation_list) == 3) or (len(description_with_annotation_list) == 1)), name
            if (len(description_with_annotation_list) == 3):
                annotation = unicode.strip(description_with_annotation_list[1])
                description = unicode.strip(description_with_annotation_list[2])
            elif (len(description_with_annotation_list) == 1):
                description = unicode.strip(description_with_annotation_list[0])
            description = u'    '.join(unicode.split(description))
            description_object = Description(name, annotation, description, source_url)
            output.write((description_object.get_description() + '\n').encode('utf-8'))
