# Path: opentaxforms/ut.py
# NL = '\n'
# TAB = '\t'
# def merge(bb1, bb2):
# def numerify(s):
# def compactify(multilineRegex):
#     def crunch(seg):
# def pickle(data, pickleFilePrefix):
# def unpickle(pickleFilePrefix, default=None):
# def flattened(l):
# def hasdups(l, key=None):
# def uniqify(l):
# def uniqify2(l):
# def setupLogging(loggerId, args=None):
# def unsetupLogging():
# def logg(msg, outputs=None):
# def jj(*args, **kw):
# def jdb(*args, **kw):
# def run0(cmd):
# def run(cmd, logprefix='run', loglevel='INFO'):
#     def __init__(self, pkgname, fpath=None):
#     def path(self):
#     def content(self):
#     def keys(cls):
#     def vals(cls):
#     def items(cls):
#     def __init__(self):
#     def __call__(self, **kw):
#     def __init__(self, *maps, **kw):
#     def _getGetitems(self, mapp):
#     def __getitem__(self, key):
#     def __setitem__(self, key, val):
#     def __len__(self):
#     def __call__(self, *keys):
#     def clear(self):
#     def update(self, *maps):
#     def __add__(self, *maps):
#     def __iadd__(self, *maps):
#     def __iter__(self):
#     def iterkeys(self):
#     def keys(self):
#     def values(self):
#     def items(self):
#     def iteritems(self):
#     def get(self, key, dflt=None):
#     def __str__(self):
#     def __repr__(self):
# def notequalpatch(self, o):
#     def fromstring(cls, s):
#     def __hash__(self):
# def playQnty():
# def nth(n):
# def skip(s, substr):
# def until(s, substr):
# def ensure_dir(folder):
# def now(format=None):
# def readImgSize(fname, dirName):
# def asciiOnly(s):
# class NoSuchPickle(Exception):
# class PickleException(Exception):
# class Resource(object):
# class CharEnum(object):
# class ChainablyUpdatableOrderedDict(odict):
# class Bag(object):
# class Qnty(qq):


import six
import re
from . import irs
from .ut import log, jj, ddict
    ('line1', 'dollars')
    >>> findLineAndUnit("Part 1. Persons ... (If ..., see the instructions.)"
        " Line 1. Item 1. (a) Care provider's name. Caution. If the care was"
        " provided in your home, you may owe employment taxes. If you do,"
        " you cannot file Form 1040A. For details, see the instructions for"
        " Form 1040, line 60a, or Form 1040N R, line 59a. 2 lines available"
        " for entry.")  # f2441
    ('line1', '')
    '''
    if isinstance(speak, six.binary_type):
        speak = speak.decode('utf8')
    findLineNum1 = re.search(r'(?:[\.\)]+\s*|^)(Line\s*\w+)\.(?:\s*\w\.)?',
                             speak)
    # Line 62. a. etc
    findLineNum2 = re.search(r'(?:\.\s*)(\d+)\.(?:\s*\w\.)?', speak)
    # Exemptions. 62. a. etc
    findLineNum3 = re.search(r'^(\d+\w*)\.\s', speak)
    # 16b. ... eg 990/page6/line16b
    units = re.findall(r'\.?\s*(Dollars|Cents)\.?', speak, re.I)
    if findLineNum1:
        # linenum is eg 'line62a' for 'Line 62. a. etc' or even for
        # 'Exemptions. 62. a. etc'
        linenum = findLineNum1.groups()[0]
    elif findLineNum2:
        linenum = 'line' + findLineNum2.groups()[0]
    elif findLineNum3:
        linenum = 'line' + findLineNum3.groups()[0]
    else:
        linenum = None
        if re.search(r'line\s+\d+', speak, re.I):

# Path: opentaxforms/ut.py
# NL = '\n'
# TAB = '\t'
# def merge(bb1, bb2):
# def numerify(s):
# def compactify(multilineRegex):
#     def crunch(seg):
# def pickle(data, pickleFilePrefix):
# def unpickle(pickleFilePrefix, default=None):
# def flattened(l):
# def hasdups(l, key=None):
# def uniqify(l):
# def uniqify2(l):
# def setupLogging(loggerId, args=None):
# def unsetupLogging():
# def logg(msg, outputs=None):
# def jj(*args, **kw):
# def jdb(*args, **kw):
# def run0(cmd):
# def run(cmd, logprefix='run', loglevel='INFO'):
#     def __init__(self, pkgname, fpath=None):
#     def path(self):
#     def content(self):
#     def keys(cls):
#     def vals(cls):
#     def items(cls):
#     def __init__(self):
#     def __call__(self, **kw):
#     def __init__(self, *maps, **kw):
#     def _getGetitems(self, mapp):
#     def __getitem__(self, key):
#     def __setitem__(self, key, val):
#     def __len__(self):
#     def __call__(self, *keys):
#     def clear(self):
#     def update(self, *maps):
#     def __add__(self, *maps):
#     def __iadd__(self, *maps):
#     def __iter__(self):
#     def iterkeys(self):
#     def keys(self):
#     def values(self):
#     def items(self):
#     def iteritems(self):
#     def get(self, key, dflt=None):
#     def __str__(self):
#     def __repr__(self):
# def notequalpatch(self, o):
#     def fromstring(cls, s):
#     def __hash__(self):
# def playQnty():
# def nth(n):
# def skip(s, substr):
# def until(s, substr):
# def ensure_dir(folder):
# def now(format=None):
# def readImgSize(fname, dirName):
# def asciiOnly(s):
# class NoSuchPickle(Exception):
# class PickleException(Exception):
# class Resource(object):
# class CharEnum(object):
# class ChainablyUpdatableOrderedDict(odict):
# class Bag(object):
# class Qnty(qq):


# Path: opentaxforms/link.py
import six
import re
from . import irs
from .ut import log, jj, ddict

    ('line1', 'dollars')
    >>> findLineAndUnit("Part 1. Persons ... (If ..., see the instructions.)"
        " Line 1. Item 1. (a) Care provider's name. Caution. If the care was"
        " provided in your home, you may owe employment taxes. If you do,"
        " you cannot file Form 1040A. For details, see the instructions for"
        " Form 1040, line 60a, or Form 1040N R, line 59a. 2 lines available"
        " for entry.")  # f2441
    ('line1', '')
    '''
    if isinstance(speak, six.binary_type):
        speak = speak.decode('utf8')
    findLineNum1 = re.search(r'(?:[\.\)]+\s*|^)(Line\s*\w+)\.(?:\s*\w\.)?',
                             speak)
    # Line 62. a. etc
    findLineNum2 = re.search(r'(?:\.\s*)(\d+)\.(?:\s*\w\.)?', speak)
    # Exemptions. 62. a. etc
    findLineNum3 = re.search(r'^(\d+\w*)\.\s', speak)
    # 16b. ... eg 990/page6/line16b
    units = re.findall(r'\.?\s*(Dollars|Cents)\.?', speak, re.I)
    if findLineNum1:
        # linenum is eg 'line62a' for 'Line 62. a. etc' or even for
        # 'Exemptions. 62. a. etc'
        linenum = findLineNum1.groups()[0]
    elif findLineNum2:
        linenum = 'line' + findLineNum2.groups()[0]
    elif findLineNum3:
        linenum = 'line' + findLineNum3.groups()[0]
    else:
        linenum = None
        if re.search(r'line\s+\d+', speak, re.I):

            log.warn(jj('linenumNotFound: cannot find the linenum in:', speak))