Get an instance by binary uuid.

    :param model: a string, model name in rio.models.
    :param bin_uuid: a 16-bytes binary string.
    :return: None or a SQLAlchemy instance.

def get_instance_by_bin_uuid(model, bin_uuid):
    """Get an instance by binary uuid.

    :param model: a string, model name in rio.models.
    :param bin_uuid: a 16-bytes binary string.
    :return: None or a SQLAlchemy instance.
    """
    try:
        model = get_model(model)
    except ImportError:
        return None

    return model.query.filter_by(**{'bin_uuid': bin_uuid}).first()