<commit_before>
from collections import namedtuple

from pyscriptic import settings, submit

# Note: All volumes are in microliters
ContainerProperties = namedtuple(
    "ContainerProperties",
    ["title", "max_capacity", "dead_volume", "capabilities"],
    )

CONTAINERS = {
    "96-pcr": ContainerProperties(
        "96 well V-bottom (PCR) plate",
        160, 15,
        ["pipette", "sangerseq", "spin", "thermocycle", "incubate", "gel_separate"],
        ),
    "96-flat": ContainerProperties(
        "96 well flat-bottom optically clear plate",
        360, 20,
        ["pipette", "sangerseq", "spin", "absorbance", "fluorescence",
         "luminescence", "incubate", "gel_separate"],
        ),
    "96-flat-uv": ContainerProperties(
        "96 well flat-bottom UV transparent plate",
        360, 20,
        ["pipette", "sangerseq", "spin", "absorbance", "fluorescence",
         "luminescence", "incubate", "gel_separate"],
        ),
    "96-deep": ContainerProperties(
        "96 well flat-bottom extended capacity optically opaque plate",
        2000, 15,
        ["pipette", "sangerseq", "spin", "incubate", "gel_separate"],
        ),
    "384-pcr": ContainerProperties(
        "384 well V-bottom (PCR) plate",
        50, 8,
        ["pipette", "sangerseq", "spin", "thermocycle", "incubate", "gel_separate"],
        ),
    "384-flat": ContainerProperties(
        "384 well flat-bottom optically clear plate",
        112, 12,
        ["pipette", "sangerseq", "spin", "absorbance", "fluorescence",
         "luminescence", "incubate", "gel_separate"],
        ),
    "pcr-0.5": ContainerProperties(
        "0.5 mL PCR tube",
        500, 15,
        ["pipette", "sangerseq", "spin", "incubate", "gel_separate"],
        ),
    "micro-1.5": ContainerProperties(
        "1.5 mL microtube",
        1500, 15,
        ["pipette", "sangerseq", "spin", "incubate", "gel_separate"],
        ),
    "micro-2.0": ContainerProperties(
        "2.0 mL microtube",
        2000, 15,
        ["pipette", "sangerseq", "spin", "incubate", "gel_separate"],
        ),
    }

def get_container(container_id):
    url = "{}/containers/{}".format(
        settings.get_organization(),
        container_id,
        )
    return submit.get_request(
        url,
        )

def list_containers():
    url = "containers"
    return submit.get_request(
        url,
        )

def mail_container(container_id, address_id, condition):
    assert condition in ["ambient", "dry_ice"]
    url = "{}/containers/{}/mail".format(
        settings.get_organization(),
        container_id,
        )
    content = {
        "address": address_id,
        "condition": condition,
        }
    return submit.post_request(
        url,
        content,
        )<commit_msg>Added references to the relevant sections in transciptic's docs<commit_after>
from collections import namedtuple

from pyscriptic import settings, submit

# Note: All volumes are in microliters
ContainerProperties = namedtuple(
    "ContainerProperties",
    ["title", "max_capacity", "dead_volume", "capabilities"],
    )

CONTAINERS = {
    "96-pcr": ContainerProperties(
        "96 well V-bottom (PCR) plate",
        160, 15,
        ["pipette", "sangerseq", "spin", "thermocycle", "incubate", "gel_separate"],
        ),
    "96-flat": ContainerProperties(
        "96 well flat-bottom optically clear plate",
        360, 20,
        ["pipette", "sangerseq", "spin", "absorbance", "fluorescence",
         "luminescence", "incubate", "gel_separate"],
        ),
    "96-flat-uv": ContainerProperties(
        "96 well flat-bottom UV transparent plate",
        360, 20,
        ["pipette", "sangerseq", "spin", "absorbance", "fluorescence",
         "luminescence", "incubate", "gel_separate"],
        ),
    "96-deep": ContainerProperties(
        "96 well flat-bottom extended capacity optically opaque plate",
        2000, 15,
        ["pipette", "sangerseq", "spin", "incubate", "gel_separate"],
        ),
    "384-pcr": ContainerProperties(
        "384 well V-bottom (PCR) plate",
        50, 8,
        ["pipette", "sangerseq", "spin", "thermocycle", "incubate", "gel_separate"],
        ),
    "384-flat": ContainerProperties(
        "384 well flat-bottom optically clear plate",
        112, 12,
        ["pipette", "sangerseq", "spin", "absorbance", "fluorescence",
         "luminescence", "incubate", "gel_separate"],
        ),
    "pcr-0.5": ContainerProperties(
        "0.5 mL PCR tube",
        500, 15,
        ["pipette", "sangerseq", "spin", "incubate", "gel_separate"],
        ),
    "micro-1.5": ContainerProperties(
        "1.5 mL microtube",
        1500, 15,
        ["pipette", "sangerseq", "spin", "incubate", "gel_separate"],
        ),
    "micro-2.0": ContainerProperties(
        "2.0 mL microtube",
        2000, 15,
        ["pipette", "sangerseq", "spin", "incubate", "gel_separate"],
        ),
    }

def get_container(container_id):
    """

    Parameters
    ----------
    container_id : str

    Notes
    -----
    .. [1] https://www.transcriptic.com/platform/#containers_show
    """
    url = "{}/containers/{}".format(
        settings.get_organization(),
        container_id,
        )
    return submit.get_request(
        url,
        )

def list_containers():
    """

    Notes
    -----
    .. [1] https://www.transcriptic.com/platform/#containers_index
    """
    url = "containers"
    return submit.get_request(
        url,
        )

def mail_container(container_id, address_id, condition):
    """

    Notes
    -----
    .. [1] https://www.transcriptic.com/platform/#instr_storage
    """
    assert condition in ["ambient", "dry_ice"]
    url = "{}/containers/{}/mail".format(
        settings.get_organization(),
        container_id,
        )
    content = {
        "address": address_id,
        "condition": condition,
        }
    return submit.post_request(
        url,
        content,
        )
{'fraction_non_alphanumeric': 0.15473790322580644, 'fraction_numerical': 0.02940188172043011, 'mean_word_length': 2.4134174311926606, 'pattern_counts': {'":': 22, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 3, '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': '5737011', 'n_tokens_mistral': 2016, 'n_tokens_neox': 1815, 'n_words': 420}