<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_comet(self):
 """Parse `targetname` as if it were a comet. :return: (string or None, int or None, string or None); The designation, number and prefix, and name of the comet as derived from `self.targetname` are extracted into a tuple; each element that does not exist is set to `None`. Parenthesis in `self.targetname` will be ignored. :example: the following table shows the result of the parsing: |targetname |(desig, prefixnumber, name) | +================================+================================+ |1P/Halley |(None, '1P', 'Halley') | |3D/Biela |(None, '3D', 'Biela') | |9P/Tempel 1 |(None, '9P', 'Tempel 1') | |73P/Schwassmann Wachmann 3 C |(None, '73P', | | |'Schwassmann Wachmann 3 C') | |73P-C/Schwassmann Wachmann 3 C |(None, '73P-C', | | |'Schwassmann Wachmann 3 C') | |73P-BB |(None, '73P-BB', None) | |322P |(None, '322P', None) | |X/1106 C1 |('1166 C1', 'X', None) | |P/1994 N2 (McNaught-Hartley) |('1994 N2', 'P', | | |'McNaught-Hartley') | |P/2001 YX127 (LINEAR) |('2001 YX127', 'P', 'LINEAR') | |C/-146 P1 |('-146 P1', 'C', None) | |C/2001 A2-A (LINEAR) |('2001 A2-A', 'C', 'LINEAR') | |C/2013 US10 |('2013 US10', 'C', None) | |C/2015 V2 (Johnson) |('2015 V2', 'C', 'Johnson') | |C/2016 KA (Catalina) |('2016 KA', 'C', 'Catalina') | """


        import re

        pat = ('^(([1-9]+[PDCXAI](-[A-Z]{1,2})?)|[PDCXAI]/)' +  # prefix [0,1,2]
               '|([-]?[0-9]{3,4}[ _][A-Z]{1,2}([0-9]{1,3})?(-[1-9A-Z]{0,2})?)' +
               # designation [3,4]
               ('|(([A-Z][a-z]?[A-Z]*[a-z]*[ -]?[A-Z]?[1-9]*[a-z]*)' +
                '( [1-9A-Z]{1,2})*)')  # name [5,6]
               )

        m = re.findall(pat, self.targetname.strip())

        # print(m)

        prefixnumber = None
        desig = None
        name = None

        if len(m) > 0:
            for el in m:
                # prefix/number
                if len(el[0]) > 0:
                    prefixnumber = el[0].replace('/', '')
                # designation
                if len(el[3]) > 0:
                    desig = el[3].replace('_', ' ')
                # name
                if len(el[5]) > 0:
                    if len(el[5]) > 1:
                        name = el[5]

        return (desig, prefixnumber, name)