def get_instance_type(id):
    """Retrieves single instance type by id."""
    if id is None:
        return get_default_instance_type()
    try:
        ctxt = context.get_admin_context()
        return db.instance_type_get(ctxt, id)
    except exception.DBError:
        raise exception.ApiError(_("Unknown instance type: %s") % id)
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/compute/instance_types.py/get_instance_type/original