'Insert a newline between a paragraph and ulist if missing'

def run(self, lines):

    inserts = 0
    fence = None
    copy = lines[:]
    for i in range((len(lines) - 1)):
        m = FENCE_RE.match(lines[i])
        if ((not fence) and m):
            fence = m.group('fence')
        elif (fence and m and (fence == m.group('fence'))):
            fence = None
        if ((not fence) and lines[i] and self.LI_RE.match(lines[(i + 1)]) and (not self.LI_RE.match(lines[i]))):
            copy.insert(((i + inserts) + 1), '')
            inserts += 1
    return copy
