<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_header(self, elem, font_size, node, style=None):
 """Used for checking if specific element is a header or not. :Returns: True or False """

        
        # This logic has been disabled for now. Mark this as header if it has
        # been marked during the parsing or mark.
        # if hasattr(elem, 'possible_header'):
        #     if elem.possible_header:                
        #         return True

        # if not style:
        #     return False

        if hasattr(style, 'style_id'):
            fnt_size = _get_font_size(self.doc, style)

            from .importer import calculate_weight
            weight = calculate_weight(self.doc, elem)
            
            if weight > 50:
                return False

            if fnt_size in self.doc.possible_headers_style:                
                return True

            return font_size in self.doc.possible_headers
        else:
            list_of_sizes = {}
            for el in elem.elements:
                try:
                    fs = get_style_fontsize(el)
                    weight = len(el.value()) if el.value() else 0

                    list_of_sizes[fs] = list_of_sizes.setdefault(fs, 0) + weight
                except:
                    pass

            sorted_list_of_sizes = list(collections.OrderedDict(sorted(six.iteritems(list_of_sizes), key=lambda t: t[0])))
            font_size_to_check = font_size

            if len(sorted_list_of_sizes) > 0:
                if sorted_list_of_sizes[0] != font_size:
                    return sorted_list_of_sizes[0] in self.doc.possible_headers

            return font_size in self.doc.possible_headers