def session_length_filter(dataframe, session_max=600):
    """If dataset has start and stop times for a session, filters out sessions exceeding max defined length
    
    Parameters
    ----------
    dataframe : pandas DataFrame
        DataFrame of all the records including single timestamp and session duration

    session_max : int
        The max length of a session in seconds to be included as a mobility candidate session
    
    Returns
    -------
    filtered_dataframe : pandas DataFrame
        DataFrame with all the records with a single timestamp and those with sessions shorter than defined
        by `session_max`
    """
    try:
        dataframe['session_length'] = dataframe['session_end'] - dataframe['session_start']
        mobility_sessions = dataframe['session_length'] <= session_max
        filtered_dataframe = dataframe[mobility_sessions].drop(columns=['session_length']).reset_index(drop=True)
    except:
        filtered_dataframe = dataframe

    return filtered_dataframe