def get_paren_substring(string: str) -> str | None:
    """Get the contents enclosed by the first pair of parenthesis

    Parameters
    ----------
    string : str
        A string

    Returns
    -------
    str | None
        The part of the string enclosed in parenthesis e.g.  or None


    Examples
    --------
    >>> get_paren_substring('some line(a, b, (c, d))')
    'a, b, (c, d)'

    If the line has incomplete parenthesis however, ``None`` is returned
    >>> get_paren_substring('some line(a, b') is None
    True
    """
    i1 = string.find("(")
    i2 = string.rfind(")")
    if -1 < i1 < i2:
        return string[i1 + 1 : i2]
    else:
        return None