Model: Shuu12121/CodeSearch-ModernBERT-Owl-5.0-Pre
Author: Shuu12121
Pipeline: sentence-similarity
Library: sentence-transformers
Tags: sentence-transformers, safetensors, modernbert, sentence-similarity, feature-extraction, generated_from_trainer, dataset_size:4000000, loss:MultipleNegativesRankingLoss, arxiv:1908.10084, arxiv:1705.00652, base_model:Shuu12121/CodeModernBERT-Owl-5.0-Pre, base_model:finetune:Shuu12121/CodeModernBERT-Owl-5.0-Pre, text-embeddings-inference, endpoints_compatible, region:us
Base models (finetune): id: Shuu12121/CodeModernBERT-Owl-5.0-Pre
Card metadata: tags: sentence-transformers, sentence-similarity, feature-extraction, generated_from_trainer, dataset_size:4000000, loss:MultipleNegativesRankingLoss
base_model: Shuu12121/CodeModernBERT-Owl-5.0-Pre
widget: source_sentence: createDatabase creates database instance by database's name
return success when creating database's path successfully
sentences: func (e *engine) createDatabase(databaseName string, dbOption *option.DatabaseOption) (Database, error) {
	cfgPath := optionsPath(databaseName)
	cfg := &models.DatabaseConfig{Name: databaseName, Option: dbOption}
	engineLogger.Info("load database option from local storage", logger.String("path", cfgPath))
	if fileExist(cfgPath) {
		if err := decodeToml(cfgPath, cfg); err != nil {
			return nil, fmt.Errorf("load database[%s] config from file[%s] with error: %s",
				databaseName, cfgPath, err)
		}
	}
	limits := limitsPath(databaseName)
	limitCfg := models.NewDefaultLimits()
	if fileExist(limits) {
		if err := decodeToml(limits, limitCfg); err != nil {
			return nil, fmt.Errorf("load database[%s] limits config from file[%s] with error: %s",
				databaseName, cfgPath, err)
		}
	}
	db, err := newDatabaseFunc(databaseName, cfg, limitCfg, e.dataFlushChecker)
	if err != nil {
		return nil, err
	}
	e.dbSet.PutDatabase(databaseName, db)
	return db, nil
}, fn rerun_if_stdlib_changes(directory: &Path) {
    for entry in std::fs::read_dir(directory).unwrap() {
        let path = entry.unwrap().path();

        if path.is_dir() {
            rerun_if_stdlib_changes(&path);
        } else {
            // Tell Cargo that if the given file changes, to rerun this build script.
            println!("cargo:rerun-if-changed={}", path.to_string_lossy());
        }
    }
}, function runSimpleUpgrade (version) {
  return new Promise((resolve) => {
    let npmCommand = (version) ? `npm install -g npm@${version}` : 'npm install -g npm'
    let stdout = []
    let stderr = []
    let child

    try {
      child = spawn('powershell.exe', [ '-NoProfile', '-NoLogo', npmCommand ])
    } catch (error) {
      // This is dirty, but the best way for us to try/catch right now
      resolve({ error })
    }

    child.stdout.on('data', (data) => stdout.push(data.toString()))
    child.stderr.on('data', (data) => stderr.push(data.toString()))

    child.on('exit', () => resolve({ stderr, stdout }))

    child.stdin.end()
  })
}, source_sentence: If the config is the same an environment we can truncate some values
production_production is superflous in ids and such
sentences: function dmskrsqrt( N, x, sx, ox, m, sm, om, y, sy, oy ) {
	return dmskmap( N, x, sx, ox, m, sm, om, y, sy, oy, rsqrt );
}, def default_config?
    configuration == environment
  end, fn merge_lists(original: &mut Vec<String>, append: &mut Vec<String>) {
    if original.len() > append.len() {
        original.truncate(append.len());
    }
    for (input, element) in original.iter_mut().zip(append.drain(..)) {
        input.push(' ');
        input.push_str(&element);
    }
}, source_sentence: Calls the given function.

@param {Function} fn The function to call
@private
sentences: _callFunction(fn) {
    const tok = {type: 'function', value: fn.name || fn.toString()};
    this._onScriptStart(tok);
    fn.call(this.win, this.doc);
    this._onScriptDone(tok);
  }, func TempFileName(dir, pattern string) (string, error) {
	if dir == "" {
		dir = os.TempDir()
	}

	// prefixAndSuffix splits pattern by the last wildcard "*", if applicable
	prefix, suffix := pattern, ""
	if pos := strings.LastIndex(pattern, "*"); pos != -1 {
		prefix, suffix = pattern[:pos], pattern[pos+1:]
	}

	// try to generate unique name
	const maxTries = 10000
	const randomBytes = 16 // 32 hex chars

	for i := 0; i < maxTries; i++ {
		// generate random bytes
		b := make([]byte, randomBytes)
		if _, err := rand.Read(b); err != nil {
			return "", fmt.Errorf("failed to generate random name: %w", err)
		}

		// create file name and check if it exists
		name := filepath.Join(dir, prefix+hex.EncodeToString(b)+suffix)
		if _, err := os.Stat(name); os.IsNotExist(err) {
			return name, nil
		}
	}

	return "", errors.New("failed to create temporary file name after multiple attempts")
}, pub fn add_radial_impulse(
    position: Vec3,
    impulse: f32,
    radius: f32,
    falloff_radius: FalloffRadius,
) {
    wit::server_physics::add_radial_impulse(
        position.into_bindgen(),
        impulse,
        radius,
        falloff_radius.into(),
    )
}, source_sentence: Displays a gravatar, because people still use these, right?
sentences: func (c *Manager) Index(namespace, name, targetK8sVersion string, skipFilter bool) (*repo.IndexFile, error) {
	r, err := c.getRepo(namespace, name)
	if err != nil {
		return nil, err
	}

	cm, err := c.configMaps.Get(r.status.IndexConfigMapNamespace, r.status.IndexConfigMapName)
	if err != nil {
		return nil, err
	}
	var k8sVersion *semver.Version
	if targetK8sVersion != "" {
		k8sVersion, err = semver.NewVersion(targetK8sVersion)
		if err != nil {
			return nil, err
		}
	} else {
		k8sVersion, err = c.k8sVersion()
		if err != nil {
			return nil, err
		}
	}
	// Check IndexCache and if it is up-to-date.
	c.lock.RLock()
	if cache, ok := c.IndexCache[fmt.Sprintf("%s/%s", r.status.IndexConfigMapNamespace, r.status.IndexConfigMapName)]; ok {
		if cm.ResourceVersion == cache.revision {
			c.lock.RUnlock()
			return c.filterReleases(deepCopyIndex(cache.index), k8sVersion, skipFilter), nil
		}
	}
	c.lock.RUnlock()

	if len(cm.OwnerReferences) == 0 || cm.OwnerReferences[0].UID != r.metadata.UID {
		return nil, validation.Unauthorized
	}

	data, err := c.readBytes(cm)
	if err != nil {
		return nil, err
	}

	gz, err := gzip.NewReader(bytes.NewBuffer(data))
	if err != nil {
		return nil, err
	}
	defer gz.Close()

	data, err = io.ReadAll(gz)
	if err != nil {
		return nil, err
	}

	// Unmarshall the fetched ConfigMap since the Index cache is not up-to-date
	index := &repo.IndexFile{}
	if err := json.Unmarshal(data, index); err != nil {
		return nil, err
	}

	c.lock.Lock()
	c.IndexCache[fmt.Sprintf("%s/%s", r.status.IndexConfigMapNamespace, r.status.IndexConfigMapName)] = indexCache{
		index:    index,
		revision: cm.ResourceVersion,
	}
	c.lock.Unlock()

	return c.filterReleases(deepCopyIndex(index), k8sVersion, skipFilter), nil
}, def gravatar_url(email, size)
    gravatar = Digest::MD5.hexdigest(email).downcase
    "http://gravatar.com/avatar/#{gravatar}.png?s=#{size}"
  end, pub fn set_or_clear_cvss_v2<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Cvss>,
    {
        self.cvss_v2 = v.map(|x| x.into());
        self
    }, source_sentence: WalkShallow reads the entries in the named directory and calls fn for each.
It does not recurse into subdirectories.

If fn returns an error, iteration stops and WalkShallow returns that value.

On Linux, WalkShallow does not allocate, so long as certain methods on the
WalkFunc's DirEntry are not called which necessarily allocate.
sentences: def get_challenge_metadata(params = {}, options = {})
      req = build_request(:get_challenge_metadata, params)
      req.send_request(options)
    end, pub fn map_status<T>(
        result: &Result<T, NetworksError>,
    ) -> Option<(NetworkCommissioningStatusEnum, Option<i32>)> {
        match result {
            Ok(_) => Some((NetworkCommissioningStatusEnum::Success, None)),
            Err(NetworksError::NetworkIdNotFound) => {
                Some((NetworkCommissioningStatusEnum::NetworkIDNotFound, None))
            }
            Err(NetworksError::DuplicateNetworkId) => {
                Some((NetworkCommissioningStatusEnum::DuplicateNetworkID, None))
            }
            Err(NetworksError::OutOfRange) => {
                Some((NetworkCommissioningStatusEnum::OutOfRange, None))
            }
            Err(NetworksError::BoundsExceeded) => {
                Some((NetworkCommissioningStatusEnum::BoundsExceeded, None))
            }
            Err(NetworksError::Other(_)) => None,
        }
    }, func WalkShallow(dirName mem.RO, fn WalkFunc) error {
	if f := osWalkShallow; f != nil {
		return f(dirName, fn)
	}
	of, err := os.Open(dirName.StringCopy())
	if err != nil {
		return err
	}
	defer of.Close()
	for {
		fis, err := of.ReadDir(100)
		for _, de := range fis {
			if err := fn(mem.S(de.Name()), de); err != nil {
				return err
			}
		}
		if err != nil {
			if err == io.EOF {
				return nil
			}
			return err
		}
	}
}
pipeline_tag: sentence-similarity
library_name: sentence-transformers
Likes: 0 | All-time downloads: 70
Created: 2025-07-17 11:44:13