<commit_before>"""Interaction with the NIST ISODB."""

import warnings

import requests

from .jsoninterface import isotherm_from_json

_ISODB_API = "https://adsorption.nist.gov/isodb/api"


def isotherm_from_isodb(filename):
    """
    Load an isotherm from the NIST ISODB.

    Parameters
    ----------
    filename : str
        ISODB filename to retrieve using the API.

    Returns
    -------
    Isotherm
        The isotherm from ISODB.

    """
    url = r"{0}/isotherm/{1}.json".format(_ISODB_API, filename)

    try:
        resp = requests.get(url, timeout=0.5)

    except requests.exceptions.Timeout:
        warnings.warn('Connection timeout')
        return None

    except requests.exceptions.ConnectionError:
        warnings.warn('Connection error')
        return None

    return isotherm_from_json(resp.text, fmt="NIST")<commit_msg>increased timeout<commit_after>"""Interaction with the NIST ISODB."""

import warnings

import requests

from .jsoninterface import isotherm_from_json

_ISODB_API = "https://adsorption.nist.gov/isodb/api"


def isotherm_from_isodb(filename):
    """
    Load an isotherm from the NIST ISODB.

    Parameters
    ----------
    filename : str
        ISODB filename to retrieve using the API.

    Returns
    -------
    Isotherm
        The isotherm from ISODB.

    """
    url = r"{0}/isotherm/{1}.json".format(_ISODB_API, filename)

    try:
        resp = requests.get(url, timeout=5)

    except requests.exceptions.Timeout:
        warnings.warn('Connection timeout')
        return None

    except requests.exceptions.ConnectionError:
        warnings.warn('Connection error')
        return None

    return isotherm_from_json(resp.text, fmt="NIST")
{'fraction_non_alphanumeric': 0.11130536130536131, 'fraction_numerical': 0.004079254079254079, 'mean_word_length': 2.6454352441613587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2999081', 'n_tokens_mistral': 544, 'n_tokens_neox': 524, 'n_words': 124}