'Defines the header and footer length based on the fact that we know the
/etc/passwd file format.
:param body_a: The http response body for a request that retrieves
/etc/passwd , without caching.
:param body_b: The http response body for a request that retrieves
/etc/passwd , without caching.
:return: None, we just set self._header_length and self._footer_length
or raise and exception if the method was not properly called.'

def _define_cut_from_etc_passwd(self, body_a, body_b):

    if (body_a != body_b):
        msg = '_define_cut_from_etc_passwd    can    only    work    with    static    responses    and    in    this    case    the    bodies    seem    to    be    different.'
        raise ValueError(msg)
    etc_passwd_re = re.compile('[\\w_-]*:x:\\d*?:\\d*?:[\\w_,    -]*:[/\\w_-]*:[/\\w_-]*')
    mo = etc_passwd_re.search(body_a)
    if (not mo):
        msg = '_define_cut_from_etc_passwd    did    not    find    any    /etc/passwd    contents    in    the    HTTP    response    body.'
        raise ValueError(msg)
    match_string = mo.group(0)
    if ('root:' not in match_string):
        msg = '_define_cut_from_etc_passwd    did    not    find    "root:"    in    the    first    line    of    /etc/passwd.    The    algorithm    is    very    strict    and    does    NOT    support    this    case.'
        raise ValueError(msg)
    start = mo.start()
    self._header_length = (start + match_string.index('root:'))
    all_match_lines = etc_passwd_re.findall(body_a)
    last_line = all_match_lines[(-1)]
    self._footer_length = (((len(body_a) - body_a.index(last_line)) - len(last_line)) - 1)
    if (self._footer_length == (-1)):
        msg = '_define_cut_from_etc_passwd    detected    an    /etc/passwd    that    it    can    NOT    handle    because    it    does    NOT    end    in    a    new    line.'
        raise ValueError(msg)
    return True
