Search is not available for this dataset
repo stringlengths 2 152 ⌀ | file stringlengths 15 239 | code stringlengths 0 58.4M | file_length int64 0 58.4M | avg_line_length float64 0 1.81M | max_line_length int64 0 12.7M | extension_type stringclasses 364
values |
|---|---|---|---|---|---|---|
pythainlp-dev/pythainlp/util/thai.py | pythainlp-dev/pythainlp/util/thai.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2023 PyThaiNLP Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 7,102 | 24.367857 | 78 | py |
pythainlp-dev/pythainlp/util/thaiwordcheck.py | pythainlp-dev/pythainlp/util/thaiwordcheck.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2023 PyThaiNLP Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 3,460 | 23.546099 | 103 | py |
pythainlp-dev/pythainlp/util/time.py | pythainlp-dev/pythainlp/util/time.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2023 PyThaiNLP Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 9,120 | 25.591837 | 80 | py |
pythainlp-dev/pythainlp/util/trie.py | pythainlp-dev/pythainlp/util/trie.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2023 PyThaiNLP Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 4,230 | 29.007092 | 76 | py |
pythainlp-dev/pythainlp/util/wordtonum.py | pythainlp-dev/pythainlp/util/wordtonum.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2023 PyThaiNLP Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 6,378 | 26.97807 | 95 | py |
pythainlp-dev/pythainlp/wangchanberta/__init__.py | pythainlp-dev/pythainlp/wangchanberta/__init__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2023 PyThaiNLP Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 785 | 34.727273 | 88 | py |
pythainlp-dev/pythainlp/wangchanberta/core.py | pythainlp-dev/pythainlp/wangchanberta/core.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2023 PyThaiNLP Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 8,654 | 36.145923 | 103 | py |
pythainlp-dev/pythainlp/word_vector/__init__.py | pythainlp-dev/pythainlp/word_vector/__init__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2023 PyThaiNLP Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 800 | 28.666667 | 74 | py |
pythainlp-dev/pythainlp/word_vector/core.py | pythainlp-dev/pythainlp/word_vector/core.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2023 PyThaiNLP Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 12,580 | 36.894578 | 79 | py |
pythainlp-dev/pythainlp/wsd/__init__.py | pythainlp-dev/pythainlp/wsd/__init__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2023 PyThaiNLP Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 723 | 37.105263 | 74 | py |
pythainlp-dev/pythainlp/wsd/core.py | pythainlp-dev/pythainlp/wsd/core.py | # -*- coding: utf-8 -*-
# Copyright (C) 2016-2023 PyThaiNLP Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 4,693 | 39.119658 | 114 | py |
pythainlp-dev/tests/__init__.py | pythainlp-dev/tests/__init__.py | # -*- coding: utf-8 -*-
"""
Unit test.
Each file in tests/ is for each main package.
"""
import sys
import unittest
sys.path.append("../pythainlp")
loader = unittest.TestLoader()
testSuite = loader.discover("tests")
testRunner = unittest.TextTestRunner(verbosity=1)
testRunner.run(testSuite)
| 295 | 17.5 | 49 | py |
pythainlp-dev/tests/test_augment.py | pythainlp-dev/tests/test_augment.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.augment import WordNetAug
from pythainlp.augment.wordnet import postype2wordnet
from pythainlp.augment.lm import Thai2transformersAug
from pythainlp.augment.word2vec.bpemb_wv import BPEmbAug
from pythainlp.augment.word2vec import (
Thai2fitAug,
LTW2VAug
)
... | 1,665 | 34.446809 | 76 | py |
pythainlp-dev/tests/test_benchmarks.py | pythainlp-dev/tests/test_benchmarks.py | import unittest
import numpy as np
import yaml
from pythainlp.benchmarks import word_tokenization
with open("./tests/data/sentences.yml", "r", encoding="utf8") as stream:
TEST_DATA = yaml.safe_load(stream)
class TestBenchmarksPackage(unittest.TestCase):
def test_preprocessing(self):
self.assertIsNot... | 2,781 | 30.613636 | 90 | py |
pythainlp-dev/tests/test_cli.py | pythainlp-dev/tests/test_cli.py | # -*- coding: utf-8 -*-
import unittest
from argparse import ArgumentError
from types import ModuleType
from pythainlp import __main__, cli
class TestMainPackage(unittest.TestCase):
def test_cli_main(self):
# call with no argument, should exit with 2
with self.assertRaises(SystemExit) as ex:
... | 5,525 | 29.7 | 79 | py |
pythainlp-dev/tests/test_cls.py | pythainlp-dev/tests/test_cls.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.cls import GzipModel
class TestClsPackage(unittest.TestCase):
def test_GzipModel(self):
training_data = [
("รายละเอียดตามนี้เลยค่าา ^^", "Neutral"),
("กลัวพวกมึงหาย อดกินบาบิก้อน", "Neutral"),
("บริการแย่มากก เป็นหมอได้ไ... | 757 | 35.095238 | 69 | py |
pythainlp-dev/tests/test_coref.py | pythainlp-dev/tests/test_coref.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.coref import coreference_resolution
class TestParsePackage(unittest.TestCase):
def test_coreference_resolution(self):
pass
# self.assertIsNotNone(
# coreference_resolution(
# "Bill Gates ได้รับวัคซีน COVID-19 เข็มแ... | 376 | 25.928571 | 85 | py |
pythainlp-dev/tests/test_corpus.py | pythainlp-dev/tests/test_corpus.py | # -*- coding: utf-8 -*-
import unittest
from nltk.corpus import wordnet as wn
from pythainlp.corpus import (
conceptnet,
countries,
download,
get_corpus_db,
get_corpus_db_detail,
get_corpus_default_db,
get_corpus_path,
oscar,
provinces,
remove,
thai_family_names,
thai_f... | 6,821 | 38.433526 | 79 | py |
pythainlp-dev/tests/test_generate.py | pythainlp-dev/tests/test_generate.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.generate import Unigram, Bigram, Trigram
from pythainlp.generate.thai2fit import gen_sentence
class TestGeneratePackage(unittest.TestCase):
def test_unigram(self):
_tnc_unigram = Unigram("tnc")
self.assertIsNotNone(_tnc_unigram.gen_sentence(... | 2,043 | 42.489362 | 86 | py |
pythainlp-dev/tests/test_khavee.py | pythainlp-dev/tests/test_khavee.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.khavee import KhaveeVerifier
kv = KhaveeVerifier()
class TestKhaveePackage(unittest.TestCase):
def test_check_sara(self):
self.assertEqual(kv.check_sara('เริง'), 'เออ')
def test_check_marttra(self):
self.assertEqual(kv.check_marttra('สาว... | 1,383 | 38.542857 | 153 | py |
pythainlp-dev/tests/test_misspell.py | pythainlp-dev/tests/test_misspell.py | # -*- coding: utf-8 -*-
import unittest
import numpy as np
from pythainlp.tools.misspell import misspell
def _count_difference(st1, st2):
# this assumes len(st1) == len(st2)
count = 0
for i in range(len(st1)):
if st1[i] != st2[i]:
count += 1
return count
class TestTextMisspell... | 2,046 | 25.934211 | 79 | py |
pythainlp-dev/tests/test_parse.py | pythainlp-dev/tests/test_parse.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.parse import dependency_parsing
class TestParsePackage(unittest.TestCase):
def test_dependency_parsing(self):
self.assertIsNotNone(dependency_parsing("ผมเป็นคนดี", engine="esupar"))
self.assertIsNotNone(dependency_parsing("ผมเป็นคนดี", engine... | 896 | 51.764706 | 100 | py |
pythainlp-dev/tests/test_soundex.py | pythainlp-dev/tests/test_soundex.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.soundex import lk82, metasound, soundex, udom83, prayut_and_somchaip
from pythainlp.soundex.sound import word_approximation, audio_vector
class TestSoundexPackage(unittest.TestCase):
def test_soundex(self):
self.assertIsNotNone(soundex("a", engine="... | 3,526 | 41.493976 | 83 | py |
pythainlp-dev/tests/test_spell.py | pythainlp-dev/tests/test_spell.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.spell import (
NorvigSpellChecker,
correct,
spell,
spell_sent,
correct_sent,
symspellpy,
)
class TestSpellPackage(unittest.TestCase):
def test_spell(self):
self.assertEqual(spell(None), [""])
self.assertEqual(spell(""... | 4,554 | 32.007246 | 79 | py |
pythainlp-dev/tests/test_summarize.py | pythainlp-dev/tests/test_summarize.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.summarize import summarize, extract_keywords
class TestSummarizePackage(unittest.TestCase):
def test_summarize(self):
text = (
"อาหาร หมายถึง ของแข็งหรือของเหลว "
"ที่กินหรือดื่มเข้าสู่ร่างกายแล้ว "
"จะทำให้เกิดพล... | 3,956 | 37.794118 | 93 | py |
pythainlp-dev/tests/test_tag.py | pythainlp-dev/tests/test_tag.py | # -*- coding: utf-8 -*-
from pythainlp import corpus
import unittest
from os import path
from pythainlp import tag
from pythainlp.tag import (
chunk_parse,
PerceptronTagger,
perceptron,
pos_tag,
pos_tag_sents,
unigram,
tltk,
NER,
NNER,
)
from pythainlp.tag.locations import tag_prov... | 13,447 | 35.643052 | 84 | py |
pythainlp-dev/tests/test_tokenize.py | pythainlp-dev/tests/test_tokenize.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.tokenize import (
DEFAULT_WORD_DICT_TRIE,
Tokenizer,
attacut,
deepcut,
etcc,
longest,
multi_cut,
nercut,
newmm,
pyicu,
sent_tokenize,
ssg,
subword_tokenize,
tcc,
tcc_p,
word_tokenize,
sefr_cut,
... | 34,934 | 39.294118 | 142 | py |
pythainlp-dev/tests/test_tools.py | pythainlp-dev/tests/test_tools.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.tools import (
get_full_data_path,
get_pythainlp_data_path,
get_pythainlp_path,
)
class TestToolsPackage(unittest.TestCase):
def test_path(self):
data_filename = "ttc_freq.txt"
self.assertTrue(
get_full_data_path(data... | 484 | 23.25 | 69 | py |
pythainlp-dev/tests/test_translate.py | pythainlp-dev/tests/test_translate.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.translate import (
ThZhTranslator,
ZhThTranslator,
Translate
)
from pythainlp.translate.en_th import (
EnThTranslator,
ThEnTranslator,
download_model_all
)
from pythainlp.corpus import remove
class TestTranslatePackage(unittest.TestCase)... | 2,578 | 27.655556 | 74 | py |
pythainlp-dev/tests/test_transliterate.py | pythainlp-dev/tests/test_transliterate.py | # -*- coding: utf-8 -*-
import unittest
import torch
from pythainlp.transliterate import romanize, transliterate, pronunciate, puan
from pythainlp.transliterate.ipa import trans_list, xsampa_list
from pythainlp.transliterate.thai2rom import ThaiTransliterator
from pythainlp.transliterate.thai2rom_onnx import ThaiTran... | 10,073 | 34.978571 | 79 | py |
pythainlp-dev/tests/test_ulmfit.py | pythainlp-dev/tests/test_ulmfit.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.tokenize import THAI2FIT_TOKENIZER
from pythainlp.ulmfit import (
THWIKI_LSTM,
ThaiTokenizer,
document_vector,
merge_wgts,
post_rules_th,
post_rules_th_sparse,
pre_rules_th,
pre_rules_th_sparse,
process_thai,
)
from pythainlp.u... | 8,261 | 28.091549 | 78 | py |
pythainlp-dev/tests/test_util.py | pythainlp-dev/tests/test_util.py | # -*- coding: utf-8 -*-
"""
Unit tests for pythainlp.util module.
"""
import os
import unittest
from collections import Counter
from datetime import datetime, time, timedelta, timezone
from pythainlp.corpus import _CORPUS_PATH, thai_words
from pythainlp.corpus.common import _THAI_WORDS_FILENAME
from pythainlp.util imp... | 31,702 | 36.122951 | 89 | py |
pythainlp-dev/tests/test_wangchanberta.py | pythainlp-dev/tests/test_wangchanberta.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.wangchanberta import ThaiNameTagger, segment
class TestWangchanberta(unittest.TestCase):
def test_thainer_wangchanberta(self):
ner = ThaiNameTagger()
self.assertIsNotNone(
ner.get_ner("I คิด therefore I am ผ็ฎ์")
)
... | 978 | 24.763158 | 71 | py |
pythainlp-dev/tests/test_word_vector.py | pythainlp-dev/tests/test_word_vector.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.word_vector import WordVector
class TestWordVectorPackage(unittest.TestCase):
def test_thai2vec(self):
_wv = WordVector("thai2fit_wv")
self.assertGreaterEqual(
_wv.similarity("แบคทีเรีย", "คน"), 0
)
self.assertIsN... | 1,889 | 29.483871 | 67 | py |
pythainlp-dev/tests/test_wsd.py | pythainlp-dev/tests/test_wsd.py | # -*- coding: utf-8 -*-
import unittest
from pythainlp.wsd import get_sense
class TestWsdPackage(unittest.TestCase):
def test_get_sense(self):
self.assertIsNotNone(get_sense("เขากำลังอบขนมคุกกี้","คุกกี้"))
self.assertIsNotNone(get_sense("เว็บนี้ต้องการคุกกี้ในการทำงาน","คุกกี้"))
self.ass... | 380 | 33.636364 | 82 | py |
pythainlp-dev/tests/data/eval-input.yml | pythainlp-dev/tests/data/eval-input.yml | char_level:fn: 1.0
char_level:fp: 0.0
char_level:precision: 1.0
char_level:recall: 0.8
char_level:tn: 9.0
char_level:tp: 4.0
word_level:correctly_tokenised_words: 3.0
word_level:precision: 0.75
word_level:recall: 0.6
word_level:total_words_in_ref_sample: 5.0
word_level:total_words_in_sample: 4.0
| 297 | 23.833333 | 41 | yml |
pythainlp-dev/tests/data/sentences.yml | pythainlp-dev/tests/data/sentences.yml | sentences:
-
expected: >-
ผม|ไม่|ชอบ|กิน|ผัก
actual: >-
ผม|ไม่|ชอบ|กิน|ผัก
-
expected: >-
ผม|ไม่|ชอบ|กิน|ผัก
actual: >-
ผม|ไม่|ชอบ|กินผัก
-
expected: >-
ผม|ไม่|ชอบ|กิน|ผัก|
actual: >-
ผม|ไ... | 1,040 | 21.630435 | 50 | yml |
null | ceph-main/.readthedocs.yml | ---
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
formats: []
build:
os: ubuntu-22.04
tools:
python: "3.8"
apt_packages:
- ditaa
- graphviz
python:
install:
- requirements: admin/doc-requirements.txt
- requirements:... | 446 | 19.318182 | 75 | yml |
null | ceph-main/README.md | # Ceph - a scalable distributed storage system
Please see https://ceph.com/ for current info.
## Contributing Code
Most of Ceph is dual licensed under the LGPL version 2.1 or 3.0. Some
miscellaneous code is under a BSD-style license or is public domain.
The documentation is licensed under Creative Commons
Attribut... | 6,418 | 27.402655 | 97 | md |
null | ceph-main/SECURITY.md | # Security Policy
The information below, as well as information about past
vulnerabilities, can be found at
https://docs.ceph.com/en/latest/security/
## Supported Versions
A new major Ceph release is made every year, and security and bug fixes
are backported to the last two releases. For the current active
relea... | 3,893 | 45.357143 | 112 | md |
null | ceph-main/do_cmake.sh | #!/usr/bin/env bash
set -ex
if [ -d .git ]; then
git submodule update --init --recursive
fi
: ${BUILD_DIR:=build}
: ${CEPH_GIT_DIR:=..}
if [ -e $BUILD_DIR ]; then
echo "'$BUILD_DIR' dir already exists; either rm -rf '$BUILD_DIR' and re-run, or set BUILD_DIR env var to a different directory name"
exit 1
f... | 2,584 | 21.675439 | 137 | sh |
null | ceph-main/do_freebsd.sh | #!/bin/sh -xve
export NPROC=`sysctl -n hw.ncpu`
if [ x"$1"x = x"--deps"x ]; then
sudo ./install-deps.sh
fi
if [ x"$CEPH_DEV"x != xx ]; then
BUILDOPTS="$BUILDOPTS V=1 VERBOSE=1"
CXX_FLAGS_DEBUG="-DCEPH_DEV"
C_FLAGS_DEBUG="-DCEPH_DEV"
fi
# To test with a new release Clang, use with cmake:
# -D CMAKE_... | 2,522 | 23.980198 | 93 | sh |
null | ceph-main/install-deps.sh | #!/usr/bin/env bash
#
# Ceph distributed storage system
#
# Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Fr... | 21,125 | 35.804878 | 139 | sh |
null | ceph-main/make-debs.sh | #!/usr/bin/env bash
#
# Copyright (C) 2015 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library Public License as published by
# the Free Software Foundation; either version 2, or (at you... | 2,777 | 29.195652 | 105 | sh |
null | ceph-main/make-srpm.sh | #!/bin/sh
#
# Create a SRPM which can be used to build Ceph
#
# ./make-srpm.sh <version>
# rpmbuild --rebuild /tmp/ceph/ceph-<version>-0.el7.centos.src.rpm
#
./make-dist $1
rpmbuild -D"_sourcedir `pwd`" -D"_specdir `pwd`" -D"_srcrpmdir `pwd`" -bs ceph.spec
| 259 | 20.666667 | 83 | sh |
null | ceph-main/mingw_conf.sh | # MINGW Settings:
# Due to inconsistencies between distributions, mingw versions, binaries,
# and directories must be determined (or defined) prior to building.
# This script expects the following variables:
# * OS - currently ubuntu, rhel, or suse. In the future we may attempt to
# detect the platform.
# * MINGW_CM... | 3,506 | 37.538462 | 79 | sh |
null | ceph-main/run-make-check.sh | #!/usr/bin/env bash
#
# Ceph distributed storage system
#
# Copyright (C) 2014 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Sof... | 2,537 | 29.214286 | 123 | sh |
null | ceph-main/win32_build.sh | #!/usr/bin/env bash
set -e
set -o pipefail
SCRIPT_DIR="$(dirname "$BASH_SOURCE")"
SCRIPT_DIR="$(realpath "$SCRIPT_DIR")"
num_vcpus=$(nproc)
CEPH_DIR="${CEPH_DIR:-$SCRIPT_DIR}"
BUILD_DIR="${BUILD_DIR:-${CEPH_DIR}/build}"
DEPS_DIR="${DEPS_DIR:-$CEPH_DIR/build.deps}"
ZIP_DEST="${ZIP_DEST:-$BUILD_DIR/ceph.zip}"
CLEAN_... | 9,371 | 34.908046 | 88 | sh |
null | ceph-main/win32_deps_build.sh | #!/usr/bin/env bash
set -e
SCRIPT_DIR="$(dirname "$BASH_SOURCE")"
SCRIPT_DIR="$(realpath "$SCRIPT_DIR")"
num_vcpus=$(nproc)
NUM_WORKERS=${NUM_WORKERS:-$num_vcpus}
DEPS_DIR="${DEPS_DIR:-$SCRIPT_DIR/build.deps}"
depsSrcDir="$DEPS_DIR/src"
depsToolsetDir="$DEPS_DIR/mingw"
lz4SrcDir="${depsSrcDir}/lz4"
lz4Dir="${depsT... | 8,885 | 27.031546 | 95 | sh |
null | ceph-main/.github/dependabot.yml | ---
version: 2
updates:
- package-ecosystem: "npm"
directory: "/src/pybind/mgr/dashboard/frontend"
schedule:
interval: "daily"
commit-message:
prefix: "mgr/dashboard:"
labels:
- "dashboard"
pull-request-branch-name:
separator: "-"
- package-ecosystem: "github-actions"
... | 481 | 19.956522 | 51 | yml |
null | ceph-main/.github/labeler.yml | api-change:
- src/pybind/mgr/dashboard/openapi.yaml
build/ops:
- "**/CMakeLists.txt"
- admin/**
- ceph.spec.in
- cmake/**
- debian/**
- do_cmake.sh
- do_freebsd.sh
- install-deps.sh
- keys/**
- make-debs.sh
- make-dist
- make-srpm.sh
- run-make-check.sh
- win32_build.sh
- win32_deps_bui... | 6,522 | 21.728223 | 65 | yml |
null | ceph-main/.github/milestone.yml | base-branch:
- "(luminous)"
- "(nautilus)"
- "(octopus)"
- "(pacific)"
- "(quincy)"
- "(reef)"
| 107 | 12.5 | 16 | yml |
null | ceph-main/.github/pull_request_template.md |
<!--
- Please give your pull request a title like
[component]: [short description]
- Please use this format for each git commit message:
[component]: [short description]
[A longer multiline description]
Fixes: [ticket URL on tracker.ceph.com, create one if necessary]
Signed-of... | 2,245 | 33.030303 | 223 | md |
null | ceph-main/.github/workflows/create-backport-trackers.yml | ---
name: Create backport trackers for trackers in "Pending Backport" state
on:
# To manually trigger this: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:
inputs:
issues:
description: 'whitespace-separated list of issue numbers... | 2,105 | 40.294118 | 250 | yml |
null | ceph-main/.github/workflows/needs-rebase.yml | ---
name: "Pull Request Needs Rebase?"
on:
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
needs-rebase:
runs-on: ubuntu-latest
steps:
# eps1lon/actions-label-merge-conflict@v2.0.1
# (NOTE: pinning the action to a given commit is a security best-practice:
# https://do... | 804 | 41.368421 | 144 | yml |
null | ceph-main/.github/workflows/pr-check-deps.yml | name: Check PR dependencies
on: [pull_request_target]
jobs:
check_dependencies:
runs-on: ubuntu-latest
name: Check PR Dependencies
steps:
- uses: gregsdennis/dependencies-action@80b5ffec566913b1494d5a8577ab0d60e476271d
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
| 298 | 26.181818 | 84 | yml |
null | ceph-main/.github/workflows/pr-checklist.yml | ---
name: "Pull Request Checklist"
on:
pull_request:
types:
- edited
- opened
- reopened
jobs:
pr_checklist:
runs-on: ubuntu-latest
name: Verify
steps:
- name: Sleep for 30 seconds
run: sleep 30s
shell: bash
- name: Action
id: checklist
u... | 396 | 18.85 | 84 | yml |
null | ceph-main/.github/workflows/pr-triage.yml | ---
name: "Pull Request Triage"
on: pull_request_target
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
pr-triage:
runs-on: ubuntu-latest
steps:
- name: Assign labels based on modified files
# https://github.com/marketplace/actions/labeler?version=v4.0.2
uses: actions/labeler@5c75... | 1,154 | 38.827586 | 86 | yml |
null | ceph-main/.github/workflows/stale.yml | # Configuration for stale action workflow - https://github.com/actions/stale
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '0 * * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v5
with:
# PAT for GitHub API authentication
repo-token: ... | 2,417 | 39.983051 | 96 | yml |
null | ceph-main/bin/git-archive-all.sh | #!/usr/bin/env bash
#
# File: git-archive-all.sh
#
# Description: A utility script that builds an archive file(s) of all
# git repositories and submodules in the current path.
# Useful for creating a single tarfile of a git super-
# project that contains other submodules.
#... | 9,140 | 31.073684 | 132 | sh |
null | ceph-main/ceph-menv/build_links.sh | #!/bin/bash
DIR=`dirname $0`
ROOT=$1
[ "$ROOT" == "" ] && ROOT="$HOME/ceph"
mkdir -p $DIR/bin
echo $PWD
for f in `ls $ROOT/build/bin`; do
echo $f
ln -sf ../mdo.sh $DIR/bin/$f
done
echo "MRUN_CEPH_ROOT=$ROOT" > $DIR/.menvroot
| 246 | 13.529412 | 44 | sh |
null | ceph-main/ceph-menv/mdo.sh | #!/bin/bash
cmd=`basename $0`
MENV_ROOT=`dirname $0`/..
if [ -f $MENV_ROOT/.menvroot ]; then
. $MENV_ROOT/.menvroot
fi
[ "$MRUN_CEPH_ROOT" == "" ] && MRUN_CEPH_ROOT=$HOME/ceph
if [ "$MRUN_CLUSTER" == "" ]; then
${MRUN_CEPH_ROOT}/build/bin/$cmd "$@"
exit $?
fi
${MRUN_CEPH_ROOT}/src/mrun $MRUN_CLUSTER $cm... | 327 | 18.294118 | 56 | sh |
null | ceph-main/ceph-menv/mset.sh | get_color() {
s=$1
sum=1 # just so that 'c1' isn't green that doesn't contrast with the rest of my prompt
for i in `seq 1 ${#s}`; do
c=${s:$((i-1)):1};
o=`printf '%d' "'$c"`
sum=$((sum+$o))
done
echo $sum
}
if [ "$1" == "" ]; the... | 533 | 23.272727 | 96 | sh |
null | ceph-main/cmake/modules/CephCheck_link.c | int main()
{}
| 14 | 4 | 10 | c |
null | ceph-main/cmake/modules/FindStdFilesystem_test.cc | #include <filesystem>
namespace fs = std::filesystem;
int main() {
fs::create_directory("sandbox");
fs::remove_all("sandbox");
}
| 139 | 14.555556 | 36 | cc |
null | ceph-main/cmake/modules/patch-dpdk-conf.sh | #!/bin/sh
# -*- mode:sh; tab-width:4; indent-tabs-mode:nil -*
setconf() {
local key=$1
local val=$2
if grep -q ^$key= ${conf}; then
sed -i -e "s:^$key=.*$:$key=$val:g" ${conf}
else
echo $key=$val >> ${conf}
fi
}
conf=$1/.config
shift
machine=$1
shift
arch=$1
shift
numa=$1
shift
se... | 1,272 | 20.948276 | 54 | sh |
null | ceph-main/doc/README.md | 0 | 0 | 0 | md | |
null | ceph-main/doc/conf.py | import fileinput
import glob
import logging
import os
import shutil
import sys
import yaml
import sphinx.util
top_level = \
os.path.dirname(
os.path.dirname(
os.path.abspath(__file__)))
pybind_rgw_mod = __import__('rgw', globals(), locals(), [], 0)
sys.modules['pybind_rgw_mod'] = pybind_rgw_m... | 7,505 | 27.648855 | 81 | py |
null | ceph-main/doc/_ext/ceph_commands.py | import io
import os
import sys
import contextlib
from docutils.parsers.rst import directives
from docutils.parsers.rst import Directive
from jinja2 import Template
from pcpp.preprocessor import Preprocessor
from sphinx.util import logging
from sphinx.util.console import bold
from importlib import reload
logger = logg... | 14,356 | 29.353066 | 139 | py |
null | ceph-main/doc/_ext/ceph_confval.py | import io
import contextlib
import os
import sys
from typing import Any, Dict, List, Union
from docutils.nodes import Node
from docutils.parsers.rst import directives
from docutils.statemachine import StringList
from sphinx import addnodes
from sphinx.directives import ObjectDescription
from sphinx.domains.python imp... | 15,171 | 31.982609 | 80 | py |
null | ceph-main/doc/_ext/ceph_releases.py | # cobbled together from:
# https://github.com/sphinx-contrib/documentedlist/blob/master/sphinxcontrib/documentedlist.py
# https://github.com/sphinx-doc/sphinx/blob/v1.6.3/sphinx/ext/graphviz.py
# https://github.com/thewtex/sphinx-contrib/blob/master/exceltable/sphinxcontrib/exceltable.py
# https://bitbucket.org... | 12,230 | 33.747159 | 164 | py |
null | ceph-main/doc/_static/css/custom.css | dt {
scroll-margin-top: 3em;
}
h2 {
scroll-margin-top: 4em;
}
h3 {
scroll-margin-top: 4em;
}
section {
scroll-margin-top: 4em;
}
span {
scroll-margin-top: 2em;
}
ul.simple > li > ul > li:last-child {
margin-block-end : 1em;
}
div.section > ul > li > p {
margin-block-start : 0.6em... | 354 | 11.241379 | 37 | css |
null | ceph-main/doc/_templates/page.html | {% extends "!page.html" %}
{% block body %}
{%- if release == 'dev' %}
<div id="dev-warning" class="admonition note">
<p class="first admonition-title">Notice</p>
<p class="last">This document is for a development version of Ceph.</p>
</div>
{%- endif %}
{%- if is_release_eol %}
<div id="eol-warning" class="admon... | 736 | 27.346154 | 93 | html |
null | ceph-main/doc/_templates/smarttoc.html | {#
Sphinx sidebar template: smart table of contents.
Shows a sidebar ToC that gives you a more global view of the
documentation, and not the confusing cur/prev/next which is the
default sidebar.
The ToC will open and collapse automatically to show the part of the
hierarchy you are in. Top-leve... | 685 | 39.352941 | 134 | html |
null | ceph-main/doc/_themes/ceph/layout.html | {# TEMPLATE VAR SETTINGS #}
{%- set url_root = pathto('', 1) %}
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
{%- if not embedded and docstitle %}
{%- set titlesuffix = " — "|safe + docstitle|e %}
{%- else %}
{%- set titlesuffix = "" %}
{%- endif %}
{%- set lang_attr = 'en' if language == None e... | 9,080 | 34.893281 | 162 | html |
null | ceph-main/doc/releases/releases.yml | #
# there are two sections
#
# releases: ... for named releases
# development: ... for dev releases
#
# by default a `version` is interpreted as a sphinx reference when rendered (see
# schedule.rst for the existing tags such as `_13.2.2`). If a version should not
# be treated as a reference, add `skip_ref: True` as a k... | 12,490 | 23.444227 | 80 | yml |
null | ceph-main/doc/scripts/README.md | Script Usage
============
Peering State Model: gen_state_diagram.py
------------------------------------------
$ git clone https://github.com/ceph/ceph.git
$ cd ceph
$ cat src/osd/PeeringState.h src/osd/PeeringState.cc | doc/scripts/gen_state_diagram.py > doc/dev/peering_graph.generated.dot
$ sed -i 's... | 464 | 37.75 | 129 | md |
null | ceph-main/doc/scripts/gen_state_diagram.py | #!/usr/bin/python3
import itertools
import re
import sys
def do_filter(generator):
return acc_lines(remove_multiline_comments(to_char(remove_single_line_comments(generator))))
def acc_lines(generator):
current = ""
for i in generator:
current += i
if i == ';' or \
i == '{' o... | 8,474 | 33.876543 | 99 | py |
null | ceph-main/examples/librados/hello_radosstriper.cc | #include "rados/librados.hpp"
#include "radosstriper/libradosstriper.hpp"
#include <iostream>
#include <string>
int main(int argc, char* argv[])
{
if(argc != 6)
{
std::cout <<"Please put in correct params\n"<<
"Stripe Count:\n"<<
"Object Size:\n" <<
"File Name:\n" <<
... | 2,756 | 25.76699 | 77 | cc |
null | ceph-main/examples/librados/hello_world.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Softw... | 9,293 | 30.720137 | 88 | cc |
null | ceph-main/examples/librados/hello_world_c.c | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Softw... | 9,667 | 30.698361 | 115 | c |
null | ceph-main/examples/librbd/hello_world.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Softw... | 6,157 | 26.864253 | 81 | cc |
null | ceph-main/examples/rgw/rgw_admin_curl.sh | #!/usr/bin/env bash
show_help()
{
echo "Usage: `basename $0` -a <access-key> -s <secret-key>" \
"-e <rgw-endpoint> -r <http-request>" \
"-p <admin-resource> -q \"<http-query-string>\""
echo " -a Access key of rgw user"
echo " -s Secret key of rgw user"
... | 3,813 | 32.752212 | 88 | sh |
null | ceph-main/examples/rgw/boto3/README.md | # Introduction
This directory contains examples on how to use AWS CLI/boto3 to exercise the RadosGW extensions to the S3 API.
This is an extension to the [AWS SDK](https://github.com/boto/botocore/blob/develop/botocore/data/s3/2006-03-01/service-2.json).
# Users
For the standard client to support these extensions, the... | 4,208 | 39.471154 | 495 | md |
null | ceph-main/examples/rgw/boto3/append_object.py | #!/usr/bin/python
from __future__ import print_function
import boto3
import sys
import json
def js_print(arg):
print(json.dumps(arg, indent=2))
if len(sys.argv) != 3:
print('Usage: ' + sys.argv[0] + ' <bucket> <key>')
sys.exit(1)
# bucket name as first argument
bucketname = sys.argv[1]
keyname = sys.arg... | 1,241 | 27.883721 | 69 | py |
null | ceph-main/examples/rgw/boto3/delete_notification.py | #!/usr/bin/python
import boto3
import sys
if len(sys.argv) == 3:
# bucket name as first argument
bucketname = sys.argv[1]
# notification name as second argument
notification_name = sys.argv[2]
elif len(sys.argv) == 2:
# bucket name as first argument
bucketname = sys.argv[1]
notification_na... | 1,229 | 32.243243 | 119 | py |
null | ceph-main/examples/rgw/boto3/get_notification.py | #!/usr/bin/python
import boto3
import sys
if len(sys.argv) != 3:
print('Usage: ' + sys.argv[0] + ' <bucket> <notification>')
sys.exit(1)
# bucket name as first argument
bucketname = sys.argv[1]
# notification name as second argument
notification_name = sys.argv[2]
# endpoint and keys from vstart
endpoin... | 826 | 27.517241 | 83 | py |
null | ceph-main/examples/rgw/boto3/get_usage_stats.py | #!/usr/bin/python
from __future__ import print_function
import boto3
import json
# endpoint and keys from vstart
endpoint = 'http://127.0.0.1:8000'
access_key='0555b35654ad1656d804'
secret_key='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=='
client = boto3.client('s3',
endpoint_url=endpoint,
... | 449 | 24 | 69 | py |
null | ceph-main/examples/rgw/boto3/list_unordered.py | #!/usr/bin/python
import boto3
import sys
if len(sys.argv) != 2:
print('Usage: ' + sys.argv[0] + ' <bucket>')
sys.exit(1)
# bucket name as first argument
bucketname = sys.argv[1]
# endpoint and keys from vstart
endpoint = 'http://127.0.0.1:8000'
access_key='0555b35654ad1656d804'
secret_key='h7GhxuBLTrlhVUyx... | 640 | 23.653846 | 69 | py |
null | ceph-main/examples/rgw/boto3/notification_filters.py | #!/usr/bin/python
import boto3
import sys
if len(sys.argv) != 4:
print('Usage: ' + sys.argv[0] + ' <bucket> <topic ARN> <notification Id>')
sys.exit(1)
# bucket name as first argument
bucketname = sys.argv[1]
# topic ARN as second argument
topic_arn = sys.argv[2]
# notification id as third argument
notificat... | 1,775 | 35.244898 | 119 | py |
null | ceph-main/examples/rgw/boto3/topic_attributes.py | import sys
import boto3
from pprint import pprint
if len(sys.argv) == 2:
# topic arn as first argument
topic_arn = sys.argv[1]
else:
print ('Usage: ' + sys.argv[0] + ' <topic arn>')
sys.exit(1)
# endpoint and keys from vstart
endpoint = 'http://127.0.0.1:8000'
access_key='0555b35654ad1656d804'
secret_... | 713 | 28.75 | 69 | py |
null | ceph-main/examples/rgw/boto3/topic_with_endpoint.py | #!/usr/bin/python
import boto3
from botocore.client import Config
import sys
if len(sys.argv) == 2:
# topic name as first argument
topic_name = sys.argv[1]
else:
print('Usage: ' + sys.argv[0] + ' <topic name> ')
sys.exit(1)
# endpoint and keys from vstart
endpoint = 'http://127.0.0.1:8000'
access_key=... | 970 | 30.322581 | 107 | py |
null | ceph-main/examples/rgw/golang/object-upload/README.md | # Introduction
This directory contains Golang code examples on how to upload an object to an S3 bucket running on a Ceph RGW cluster.
# Prerequisite
Linux machine running an RGW Ceph cluster. Preferrably started with the ``OSD=1 MON=1 MDS=0 MGR=0 RGW=1 ../src/vstart.sh --debug --new `` command.
Go installed on the Lin... | 1,025 | 45.636364 | 162 | md |
null | ceph-main/examples/rgw/golang/object-upload/object-upload.go | package main
import (
"flag"
"fmt"
"os"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
)
func main() {
bucket := flag.String("b", "", "The name of t... | 2,187 | 24.741176 | 123 | go |
null | ceph-main/examples/rgw/golang/put-bucket-notification-creation/README.md | # Introduction
This directory contains Golang code examples on how to create a put bucket notification to a topic and S3 bucket running on a Ceph RGW cluster.
# Prerequisite
Linux machine running an RGW Ceph cluster. Preferrably started with the ``OSD=1 MON=1 MDS=0 MGR=0 RGW=1 ../src/vstart.sh --debug --new `` command... | 1,524 | 49.833333 | 223 | md |
null | ceph-main/examples/rgw/golang/put-bucket-notification-creation/put-bucket-notification-creation.go | package main
import (
"flag"
"fmt"
"os"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
)
func main() {
bucket := flag.String("b", "", "Name of the bucket to a... | 2,465 | 24.42268 | 121 | go |
null | ceph-main/examples/rgw/golang/topic-creation/README.md | # Introduction
This directory contains Golang code example on how to create an SNS Topic on a Ceph RGW cluster.
# Prerequisite
Linux machine running an RGW Ceph cluster. Preferrably started with the ``OSD=1 MON=1 MDS=0 MGR=0 RGW=1 ../src/vstart.sh --debug --new `` command.
Go installed on the Linux machine.
## Workfl... | 771 | 44.411765 | 195 | md |
null | ceph-main/examples/rgw/golang/topic-creation/topic-creation.go | package main
import (
"encoding/json"
"flag"
"fmt"
"os"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sns"
)
func main() {
topic := flag.String("t", "", "The na... | 2,133 | 25.02439 | 124 | go |
null | ceph-main/examples/rgw/java/ceph-s3-upload/README.md | # Introduction
This directory contains Java code examples on how to upload an object to an S3 bucket running on a Ceph RGW cluster.
# Prerequisites
Linux machine running an RGW Ceph cluster. Preferrably started with the ``OSD=1 MON=1 MDS=0 MGR=0 RGW=1 ../src/vstart.sh --debug --new `` command.
Java and Maven install... | 1,041 | 60.294118 | 188 | md |
null | ceph-main/examples/rgw/java/ceph-s3-upload/src/main/java/org/example/cephs3upload/App.java | package org.example.cephs3upload;
import com.amazonaws.services.s3.model.AmazonS3Exception;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazona... | 2,294 | 43.134615 | 149 | java |