def get_sessid(sessdir):
    """
    get_sessid(sessdir)

    Returns the session ID associated with a session.

    Required args:
        - sessdir (str): session directory

    Returns:
        - sessid (int): session ID (9 digits)

    """

    sesspart = "ophys_session_"
    start = sessdir.find(sesspart) + len(sesspart)
    sessid = sessdir[start:start + 9]

    return sessid