
from json import JSONDecodeError  # Workaround for requests.exceptions.JSONDecodeError

import requests





def 						SCREAMING_SNAKE_CASE__     (   __lowerCAmelCase = "isbn/0140328726"				):
    snake_case__    =					olid.strip().strip("/"				)  # Remove leading/trailing whitespace & slashes
    if new_olid.count("/"				) != 1:
        snake_case__    =					F"""{olid} is not a valid Open Library olid"""
        raise ValueError(__lowerCAmelCase				)
    return requests.get(F"""https://openlibrary.org/{new_olid}.json"""				).json()





def 						SCREAMING_SNAKE_CASE__     (   __lowerCAmelCase				):
    snake_case__    =					{
        "title": "Title",
        "publish_date": "Publish date",
        "authors": "Authors",
        "number_of_pages": "Number of pages:",
        "first_sentence": "First sentence",
        "isbn_10": "ISBN (10)",
        "isbn_13": "ISBN (13)",
    }
    snake_case__    =					{better_key: ol_book_data[key] for key, better_key in desired_keys.items()}
    snake_case__    =					[
        get_openlibrary_data(author["key"]				)["name"] for author in data["Authors"]
    ]
    snake_case__    =					data["First sentence"]["value"]
    for key, value in data.items():
        if isinstance(__lowerCAmelCase     ,		__lowerCAmelCase				):
            snake_case__    =					", ".join(__lowerCAmelCase				)
    return data


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     while True:
          __magic_name__  							=	input('''\nEnter the ISBN code to search (or \'quit\' to stop): ''').strip()
          if isbn.lower() in ("", "q", "quit", "exit", "stop"):
               break

          if len(isbn) not in (10, 13) or not isbn.isdigit():
               print(F'''Sorry, {isbn} is not a valid ISBN.  Please, input a valid ISBN.''')
               continue

          print(F'''\nSearching Open Library for ISBN: {isbn}...\n''')

          try:
               __magic_name__  							=	summarize_book(get_openlibrary_data(F'''isbn/{isbn}'''))
               print('''\n'''.join(F'''{key}: {value}''' for key, value in book_summary.items()))
          except JSONDecodeError:  # Workaround for requests.exceptions.RequestException:
               print(F'''Sorry, there are no results for ISBN: {isbn}.''')





import math

__magic_name__  							=	10
__magic_name__  							=	7
__magic_name__  							=	BALLS_PER_COLOUR * NUM_COLOURS





def 						SCREAMING_SNAKE_CASE__     (   __lowerCAmelCase = 20				):
    snake_case__    =					math.comb(__lowerCAmelCase     ,		__lowerCAmelCase				)
    snake_case__    =					math.comb(NUM_BALLS - BALLS_PER_COLOUR     ,		__lowerCAmelCase				)

    snake_case__    =					NUM_COLOURS * (1 - missing_colour / total)

    return F"""{result:.9f}"""


if __name__ == "__main__":
     print(solution(20))



