You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: image_mode.rs
    path of file: ./repos/Daft/src/daft-core/src/datatypes
    
    the code of the file until where you have to start completion: use num_derive::FromPrimitive;
#[cfg(feature = "python")]
use pyo3::{exceptions::PyValueError, prelude::*};
use serde::{Deserialize, Serialize};
use std::fmt::{Display, Formatter, Result};
use std::str::FromStr;
use std::string::ToString;

use crate::datatypes::DataType;

use common_error::{DaftError, DaftResult};

/// Supported image modes for
    
    fn from_str(mode: &str) -> DaftResult<Self> {
        use ImageMode::*;

        match mode {
            "L" => Ok(L),
            "LA" => Ok(LA),
            "RGB" => Ok(RGB),
            "RGBA" => Ok(RGBA),
            "L16" => Ok(L16),
            "LA16" => Ok(LA16),
            "RGB16" => Ok(RGB16),
            "RGBA16" => Ok(RGBA16),
            "RGB32F" => Ok(RGB32F),
            "RGBA32F" => Ok(RGBA32F),
            _ => Err(DaftError::TypeError(format!(
                "Image mode {} is not supported; only the following modes are supported: {:?}",
                mode,
                ImageMode::iterator().as_slice()
            ))),
        }
    }