import requests
import json


def isdisambiguation(pagename):
    """Given a wikipedia page name, returns True if that page is a disambiguation page and False otherwise
    
    :param pagename: The name of a wikipedia page
    :type pagename: String
    
    :return: True if pagename is the name of a wikipedia page in the 'All disambiguation pages' 
        category, otherwise False
    :rtype: Boolean
    """
    pagenamehyphen = pagename.replace(' ', '_')
    query = requests.get(f'https://en.wikipedia.org/w/api.php?action=query&format=json&titles={pagenamehyphen}&prop=categories')
    data = json.loads(query.text)
    for category in data['query']['pages'][next(iter(data['query']['pages'].keys()))]['categories']:
        catname = category['title']
        if catname == "Category:All disambiguation pages":
            return True
    return False