<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hexameter_feet(self, scansion: str) -> List[str]: """ Produces a list of hexameter feet, stressed and unstressed syllables with spaces intact. If the scansion line is not entirely correct, it will attempt to corral one or more improper patterns into one or more feet. :param: scansion: the scanned line :return list of strings, representing the feet of the hexameter, or if the scansion is wildly incorrect, the function will return an empty list. - U U |- - |- - |- - |- U U |- U - U U |- - |U - |- - |- U U |- U """

        backwards_scan = list(scansion.rstrip())
        feet = []
        candidates = [self.constants.STRESSED + self.constants.OPTIONAL_ENDING,
                      self.constants.STRESSED + self.constants.STRESSED,
                      self.constants.STRESSED + self.constants.UNSTRESSED,
                      self.constants.UNSTRESSED + self.constants.STRESSED]
        incomplete_foot = self.constants.UNSTRESSED + self.constants.UNSTRESSED
        try:
            while len(backwards_scan) > 0:
                spaces = []
                chunk1 = backwards_scan.pop()
                while len("".join(chunk1).replace(" ", "")) == 0:
                    if len(backwards_scan) == 0:
                        feet.append(chunk1)
                        return feet[::-1]
                    chunk1 = backwards_scan.pop() + "".join(chunk1)
                chunk2 = backwards_scan.pop()
                while chunk2 == " ":
                    spaces.append(chunk2)
                    if len(backwards_scan) == 0:
                        feet.append(chunk2)
                        return feet[::-1]
                    chunk2 = backwards_scan.pop()
                new_candidate = "".join(chunk2) + "".join(spaces) + "".join(chunk1)
                if new_candidate.replace(" ", "") in candidates:
                    feet.append(new_candidate)
                else:
                    if new_candidate.replace(" ", "") == incomplete_foot:
                        spaces2 = []
                        previous_mark = backwards_scan.pop()
                        while previous_mark == " ":
                            spaces2.append(previous_mark)
                            previous_mark = backwards_scan.pop()
                        if previous_mark == self.constants.STRESSED:
                            new_candidate = "".join(previous_mark) + "".join(
                                spaces2) + new_candidate
                            feet.append(new_candidate)
                        else:
                            feet.append(new_candidate)  # invalid foot
                            spaces3 = []
                            next_mark = backwards_scan.pop()
                            while next_mark == " ":
                                spaces3.append(previous_mark)
                                next_mark = backwards_scan.pop()
                            feet.append("".join(next_mark) + "".join(spaces3) + previous_mark)
        except Exception as ex:
            LOG.error("err at: {}, {}".format(scansion, ex))
            return list()
        return feet[::-1]