def first_in_parens(s):
    """
    Returns: The substring of s that is inside the first pair of parentheses.

    The first pair of parenthesis consist of the first instance of character
    '(' and the first instance of ')' that follows it.

    Examples:
      first_in_parens('A (B) C') returns 'B'
      first_in_parens('A (B) (C)') returns 'B'
      first_in_parens('A ((B) (C))') returns '(B'

    Parameter s: a string to check
    Precondition: s is a string with a matching pair of parens '()'.
    """
    assert type(s) == str
    assert ('(' in s) and (')' in s)

    pos1 = s.find('(')
    pos2 = s.find(')', pos1 + 1)

    return s[pos1 + 1:pos2]
    # pass