def model_loader(gem_file_path, gem_file_type):
    """Consolidated function to load a GEM using COBRApy. Specify the file type being loaded.

    Args:
        gem_file_path (str): Path to model file
        gem_file_type (str): GEM model type - ``sbml`` (or ``xml``), ``mat``, or ``json`` format

    Returns:
        COBRApy Model object.

    """

    if gem_file_type.lower() == 'xml' or gem_file_type.lower() == 'sbml':
        model = read_sbml_model(gem_file_path)
    elif gem_file_type.lower() == 'mat':
        model = load_matlab_model(gem_file_path)
    elif gem_file_type.lower() == 'json':
        model = load_json_model(gem_file_path)
    else:
        raise ValueError('File type must be "sbml", "xml", "mat", or "json".')

    return model
Consolidated function to load a GEM using COBRApy. Specify the file type being loaded.

    Args:
        gem_file_path (str): Path to model file
        gem_file_type (str): GEM model type - ``sbml`` (or ``xml``), ``mat``, or ``json`` format

    Returns:
        COBRApy Model object.