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: script.rs
    path of file: ./repos/icu4x/provider/datagen/src/transform/icuexport/uprops
    
    the code of the file until where you have to start completion: // This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use icu_collections::codepointtrie::CodePointTrie;
use icu_properties::provider::{
    ScriptWithExtensionsPropertyV1, ScriptWithExtensionsPropertyV1Marker,
};
use icu_properties::script::ScriptWithExt;
use icu_properties::Script;
use icu_provider::datagen::*;
use icu_provider::prelude::*;
use std::convert::TryFrom;
use zerovec::{VarZeroVec, ZeroSlice, ZeroVec};

// implement data provider
impl DataProvider<ScriptWithExtensionsPropertyV1Marker> for crate::DatagenProvider {
    fn load(
        &self,
        req: DataRequest,
    ) -> Result<DataResponse<ScriptWithExtensionsPropertyV1Marker>, DataError> {
        self.check_req::<ScriptWithExtensionsPropertyV1Marker>(req)?;
        let scx_data = self
            .icuexport()?
            .read_and_parse_toml::<super::uprops_serde::script_extensions::Main>(&format!(
                "uprops/{}/scx.toml",
                self.trie_type(),
            ))?
            .script_extensions
            .first()
            .ok_or_else(|| {
                DataError::custom("Could not parse Script_Extensions data from TOML")
                    .with_path_context("scx.toml")
            })?;

        let cpt_data = &scx_data.code_point_trie;
        let scx_array_data = &scx_data.script_code_array;

        let trie = CodePointTrie::<ScriptWithExt>::try_from(cpt_data).map_err(|e| {
            DataError::custom("Could not parse CodePointTrie TOML").with_display_context(&e)
        })?;

        // Convert the input from Vec<Vec<u16>> to Vec<ZeroVec<Script>> so that
        // we can go through the VarZeroVec construction process for a desired result
        // type of VZV<ZeroSlice<Script>>
        let ule_scx_array_data: Vec<ZeroVec<Script>> = scx_array_data
            .iter()
            .map(|v| v.iter().map(|i| Script(*i)).collect::<ZeroVec<Script>>())
            .collect::<Vec<ZeroVec<Script>>>();
        let scx_vzv: VarZeroVec<ZeroSlice<Script>> =
            VarZeroVec::from(ule_scx_array_data.as_slice());

        let data_struct = ScriptWithExtensionsPropertyV1::new(trie, scx_vzv);

        Ok(DataResponse {
            metadata: DataResponseMetadata::default(),
            payload: Some(DataPayload::from_owned(data_struct)),
        })
    }
}

impl IterableDataProvider<ScriptWithExtensionsPropertyV1Marker> for crate::DatagenProvider {
    fn supported_locales(&self) -> Result<Vec<DataLocale>, DataError> {
        Ok(vec![Default::default()])
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use icu_properties::script::ScriptWithExtensions;

    #[test]
    fn test_script_val_from_script_extensions() {
        let provider = crate::DatagenProvider::new_testing();

        let payload: DataPayload<ScriptWithExtensionsPropertyV1Marker> = provider
            .load(Default::default())
            .and_then(DataResponse::take_payload)
            .expect("Loading was successful");

        let swe = ScriptWithExtensions::from_data(payload);
        let swe = s
    
    fn test_has_script() {
        let provider = crate::DatagenProvider::new_testing();

        let payload: DataPayload<ScriptWithExtensionsPropertyV1Marker> = provider
            .load(Default::default())
            .expect("The data should be valid")
            .take_payload()
            .expect("Loading was successful");

        let swe = ScriptWithExtensions::from_data(payload);
        let swe = swe.as_borrowed();

        assert!(swe.has_script('êìê' as u32, Script::Osage));
        assert!(!swe.has_script('êìê' as u32, Script::Common));
        assert!(!swe.has_script('êìê' as u32, Script::Inherited));

        assert!(swe.has_script('ü•≥' as u32, Script::Common));
        assert!(!swe.has_script('ü•≥' as u32, Script::Inherited));

        assert!(!swe.has_script(0x200D, Script::Common));
        assert!(swe.has_script(0x200D, Script::Inherited));

        assert!(swe.has_script('‡Ø´' as u32, Script::Tamil));
        assert!(swe.has_script('‡Ø´' as u32, Script::Grantha));
        assert!(!swe.has_script('‡Ø´' as u32, Script::Common));
        assert!(!swe.has_script('‡Ø´' as u32, Script::Inherited));

        assert!(swe.has_script(0x11303, Script::Tamil));
        assert!(swe.has_script(0x11303, Script::Grantha));
        assert!(!swe.has_script(0x11303, Script::Common));
        assert!(!swe.has_script(0x11303, Script::Inherited));

        assert!(swe.has_script(0x30A0, Script::Hiragana));
        assert!(swe.has_script(0x30A0, Script::Katakana));
        assert!(!swe.has_script(0x30A0, Script::Common));
        assert!(!swe.has_script(0x30A0, Script::Inherited));

        // U+0964 DEVANAGARI DANDA
        assert!(!swe.has_script(0x0964, Script::Common));
        assert!(swe.has_script(0x0964, Script::Devanagari));
        assert!(swe.has_script(0x0964, Script::Bengali));

        // TestHasScript() test cases from ICU4J

        // U+063F ARABIC LETTER FARSI YEH WITH THREE DOTS ABOVE
        assert!(!swe.has_script(0x063F, Script::Common));
        assert!(swe.has_script(0x063F, Script::Arabic)); // main Script value
        assert!(!swe.has_script(0x063F, Script::Syriac));
        assert!(!swe.has_script(0x063F, Script::Thaana));

        // U+0640 ARABIC TATWEEL
        assert!(!swe.has_script(0x0640, Script::Common)); // main Script value
        assert!(swe.has_script(0x0640, Script::Arabic));
        assert!(swe.has_script(0x0640, Script::Syriac));
        assert!(!swe.has_script(0x0640, Script::Thaana));

        // U+0650 ARABIC KASRA
        assert!(!swe.has_script(0x0650, Script::Inherited)); // main Script value
        assert!(swe.has_script(0x0650, Script::Arabic));
        assert!(swe.has_script(0x0650, Script::Syriac));
        assert!(!swe.has_script(0x0650, Script::Thaana));

        // U+0660 ARABIC-INDIC DIGIT ZERO
        assert!(!swe.has_script(0x0660, Script::Common));
        assert!(swe.has_script(0x0660, Script::Arabic)); // main Script value
        assert!(!swe.has_script(0x0660, Script::Syriac));
        assert!(swe.has_script(0x0660, Script::Thaana));

        // U+FDF2 ARABIC LIGATURE ALLAH ISOLATED FORM
        assert!(!swe.has_script(0xFDF2, Script::Common));
        assert!(swe.has_script(0xFDF2, Script::Arabic)); // main Script value
        assert!(!swe.has_script(0xFDF2, Script::Syriac));
        assert!(swe.has_script(0xFDF2, Script::Thaana));

        // The ICU4J comment for this test says:
        // An unguarded implementation might go into an infinite loop.
        assert!(!swe.has_script(0x0640, Script(0xAFFE)));
    }