body_hash
stringlengths
64
64
body
stringlengths
23
109k
docstring
stringlengths
1
57k
path
stringlengths
4
198
name
stringlengths
1
115
repository_name
stringlengths
7
111
repository_stars
float64
0
191k
lang
stringclasses
1 value
body_without_docstring
stringlengths
14
108k
unified
stringlengths
45
133k
1605276693eb9051c872eef4a87d03c4e37b722287653a36765a8ee550e79efa
def get_one_page(self, url): '\n 请求url返回响应结果\n :param url:\n :return:\n ' try: response = requests.get(url, headers=self.generate_random_ua) if (response.status_code == 200): return response.text except Exception as e: print('连接糗事百科失败,错误原因', e)...
请求url返回响应结果 :param url: :return:
qiushibaike/qiushibaike.py
get_one_page
jumploop/Python3_WebSpider
1
python
def get_one_page(self, url): '\n 请求url返回响应结果\n :param url:\n :return:\n ' try: response = requests.get(url, headers=self.generate_random_ua) if (response.status_code == 200): return response.text except Exception as e: print('连接糗事百科失败,错误原因', e)...
def get_one_page(self, url): '\n 请求url返回响应结果\n :param url:\n :return:\n ' try: response = requests.get(url, headers=self.generate_random_ua) if (response.status_code == 200): return response.text except Exception as e: print('连接糗事百科失败,错误原因', e)...
468cd31f5ee4a6c35065727db9860d81356424e4143e3bd354a23a79ac70c5e0
@staticmethod def parse_one_page(contents): '\n 解析页面数据,提取数据\n :param content:\n :return:\n ' html = etree.HTML(contents) items = html.xpath('//div[contains(@id,"qiushi_tag")]') pageStories = [] for item in items: author = item.xpath('.//div[@class="author clearfix...
解析页面数据,提取数据 :param content: :return:
qiushibaike/qiushibaike.py
parse_one_page
jumploop/Python3_WebSpider
1
python
@staticmethod def parse_one_page(contents): '\n 解析页面数据,提取数据\n :param content:\n :return:\n ' html = etree.HTML(contents) items = html.xpath('//div[contains(@id,"qiushi_tag")]') pageStories = [] for item in items: author = item.xpath('.//div[@class="author clearfix...
@staticmethod def parse_one_page(contents): '\n 解析页面数据,提取数据\n :param content:\n :return:\n ' html = etree.HTML(contents) items = html.xpath('//div[contains(@id,"qiushi_tag")]') pageStories = [] for item in items: author = item.xpath('.//div[@class="author clearfix...
6cb20982d733841adaf6b674acdecba8584ef057abf9023a35a7f2d404ba0af7
def write_to_file_by_csv(self, content): '\n 将数据写入文件\n :param content:\n :return:\n ' with open('result.csv', 'w', newline='', encoding='utf-8') as f: writer = csv.writer(f) writer.writerow(self.fieldnames) writer.writerows(content)
将数据写入文件 :param content: :return:
qiushibaike/qiushibaike.py
write_to_file_by_csv
jumploop/Python3_WebSpider
1
python
def write_to_file_by_csv(self, content): '\n 将数据写入文件\n :param content:\n :return:\n ' with open('result.csv', 'w', newline=, encoding='utf-8') as f: writer = csv.writer(f) writer.writerow(self.fieldnames) writer.writerows(content)
def write_to_file_by_csv(self, content): '\n 将数据写入文件\n :param content:\n :return:\n ' with open('result.csv', 'w', newline=, encoding='utf-8') as f: writer = csv.writer(f) writer.writerow(self.fieldnames) writer.writerows(content)<|docstring|>将数据写入文件 :param co...
cf20d2b6a3cccc8ed009f1248e2365f6f3e9c4025bdf0e8ecb5e2b6592c261b9
def write_to_file_by_pandas(self, content): '\n 通过pandas模块将数据写入文件\n :param content:\n :return:\n ' content = [line for line in content] df = pd.DataFrame(content, columns=self.fieldnames) df.to_excel('results.xlsx', index=False)
通过pandas模块将数据写入文件 :param content: :return:
qiushibaike/qiushibaike.py
write_to_file_by_pandas
jumploop/Python3_WebSpider
1
python
def write_to_file_by_pandas(self, content): '\n 通过pandas模块将数据写入文件\n :param content:\n :return:\n ' content = [line for line in content] df = pd.DataFrame(content, columns=self.fieldnames) df.to_excel('results.xlsx', index=False)
def write_to_file_by_pandas(self, content): '\n 通过pandas模块将数据写入文件\n :param content:\n :return:\n ' content = [line for line in content] df = pd.DataFrame(content, columns=self.fieldnames) df.to_excel('results.xlsx', index=False)<|docstring|>通过pandas模块将数据写入文件 :param content: :...
28d90bb2a77dabc51a68a5e3dc43eca233bdd510da58f9b3165133aa47900909
def run(self): '\n 主方法\n :return:\n ' results = [] urls = [self.url.format(i) for i in range(1, 14)] for url in urls: time.sleep(random.randint(1, 3)) content = self.get_one_page(url) item = self.parse_one_page(content) print(item) results.ext...
主方法 :return:
qiushibaike/qiushibaike.py
run
jumploop/Python3_WebSpider
1
python
def run(self): '\n 主方法\n :return:\n ' results = [] urls = [self.url.format(i) for i in range(1, 14)] for url in urls: time.sleep(random.randint(1, 3)) content = self.get_one_page(url) item = self.parse_one_page(content) print(item) results.ext...
def run(self): '\n 主方法\n :return:\n ' results = [] urls = [self.url.format(i) for i in range(1, 14)] for url in urls: time.sleep(random.randint(1, 3)) content = self.get_one_page(url) item = self.parse_one_page(content) print(item) results.ext...
91aa9b031d9f2d991b1349c39e66ba11ab59dbc73314dbef523223f38a16d1a1
def load_moonshot_semi_supervised(unlabeled_size=0.1, seed=2666): '\n\n Parameters\n ----------\n unlabeled_size :\n (Default value = 0.1)\n seed :\n (Default value = 2666)\n\n Returns\n -------\n\n ' moonshot_labeled = pinot.data.moonshot() moonshot_unlabeled = pinot.da...
Parameters ---------- unlabeled_size : (Default value = 0.1) seed : (Default value = 2666) Returns -------
pinot/data/unlabeled_datasets.py
load_moonshot_semi_supervised
choderalab/pinot
13
python
def load_moonshot_semi_supervised(unlabeled_size=0.1, seed=2666): '\n\n Parameters\n ----------\n unlabeled_size :\n (Default value = 0.1)\n seed :\n (Default value = 2666)\n\n Returns\n -------\n\n ' moonshot_labeled = pinot.data.moonshot() moonshot_unlabeled = pinot.da...
def load_moonshot_semi_supervised(unlabeled_size=0.1, seed=2666): '\n\n Parameters\n ----------\n unlabeled_size :\n (Default value = 0.1)\n seed :\n (Default value = 2666)\n\n Returns\n -------\n\n ' moonshot_labeled = pinot.data.moonshot() moonshot_unlabeled = pinot.da...
8558f5e8303d32e0afc20e3495ed675c450c4dc2fbd254bcad2dc1023e2f4e72
def load_esol_semi_supervised(unlabeled_size=0.1, seed=2666): '\n\n Parameters\n ----------\n unlabeled_size :\n (Default value = 0.1)\n seed :\n (Default value = 2666)\n\n Returns\n -------\n\n ' esol_labeled = pinot.data.esol() esol_unlabeled = utils.load_unlabeled_dat...
Parameters ---------- unlabeled_size : (Default value = 0.1) seed : (Default value = 2666) Returns -------
pinot/data/unlabeled_datasets.py
load_esol_semi_supervised
choderalab/pinot
13
python
def load_esol_semi_supervised(unlabeled_size=0.1, seed=2666): '\n\n Parameters\n ----------\n unlabeled_size :\n (Default value = 0.1)\n seed :\n (Default value = 2666)\n\n Returns\n -------\n\n ' esol_labeled = pinot.data.esol() esol_unlabeled = utils.load_unlabeled_dat...
def load_esol_semi_supervised(unlabeled_size=0.1, seed=2666): '\n\n Parameters\n ----------\n unlabeled_size :\n (Default value = 0.1)\n seed :\n (Default value = 2666)\n\n Returns\n -------\n\n ' esol_labeled = pinot.data.esol() esol_unlabeled = utils.load_unlabeled_dat...
47d2dc790cfec4096f40b408ab2e50cfb62bab2b95e8fd1a5e3b770bdda4765c
def version(filename): 'Extract the version number from the dictionary file name.' match = dict_version_re.match(filename) if (match is None): message.warning('Found a dictionary with a malformed name: {}'.format(filename)) return None return tuple((int(n) for n in match.group('version')...
Extract the version number from the dictionary file name.
luminos/browser/webengine/Spell.py
version
linuxaddict89/luminos
0
python
def version(filename): match = dict_version_re.match(filename) if (match is None): message.warning('Found a dictionary with a malformed name: {}'.format(filename)) return None return tuple((int(n) for n in match.group('version').split('-')))
def version(filename): match = dict_version_re.match(filename) if (match is None): message.warning('Found a dictionary with a malformed name: {}'.format(filename)) return None return tuple((int(n) for n in match.group('version').split('-')))<|docstring|>Extract the version number from t...
4e25247a13c08076166afe07a363400cf83a4b7380fed74433a0c991ff1d9027
def dictionary_dir(old=False): "Return the path (str) to the QtWebEngine's dictionaries directory." if (qtutils.version_check('5.10', compiled=False) and (not old)): datapath = standarddir.data() else: datapath = QLibraryInfo.location(QLibraryInfo.DataPath) return os.path.join(datapath, ...
Return the path (str) to the QtWebEngine's dictionaries directory.
luminos/browser/webengine/Spell.py
dictionary_dir
linuxaddict89/luminos
0
python
def dictionary_dir(old=False): if (qtutils.version_check('5.10', compiled=False) and (not old)): datapath = standarddir.data() else: datapath = QLibraryInfo.location(QLibraryInfo.DataPath) return os.path.join(datapath, 'qtwebengine_dictionaries')
def dictionary_dir(old=False): if (qtutils.version_check('5.10', compiled=False) and (not old)): datapath = standarddir.data() else: datapath = QLibraryInfo.location(QLibraryInfo.DataPath) return os.path.join(datapath, 'qtwebengine_dictionaries')<|docstring|>Return the path (str) to the...
06699badca172b0cebd13d6c159964e8a6a2d992c914c5a2201a034c8eba2da8
def local_files(code): 'Return all installed dictionaries for the given code.\n\n The returned dictionaries are sorted by version, therefore the latest will\n be the first element. The list will be empty if no dictionaries are found.\n ' pathname = os.path.join(dictionary_dir(), '{}*.bdic'.format(code)...
Return all installed dictionaries for the given code. The returned dictionaries are sorted by version, therefore the latest will be the first element. The list will be empty if no dictionaries are found.
luminos/browser/webengine/Spell.py
local_files
linuxaddict89/luminos
0
python
def local_files(code): 'Return all installed dictionaries for the given code.\n\n The returned dictionaries are sorted by version, therefore the latest will\n be the first element. The list will be empty if no dictionaries are found.\n ' pathname = os.path.join(dictionary_dir(), '{}*.bdic'.format(code)...
def local_files(code): 'Return all installed dictionaries for the given code.\n\n The returned dictionaries are sorted by version, therefore the latest will\n be the first element. The list will be empty if no dictionaries are found.\n ' pathname = os.path.join(dictionary_dir(), '{}*.bdic'.format(code)...
2d2792aeaf637ce674081958e01b045c74ce5269f6005e5c96b58ae0ad00d193
def local_filename(code): 'Return the newest installed dictionary for the given code.\n\n Return the filename of the installed dictionary with the highest version\n number or None if the dictionary is not installed.\n ' all_installed = local_files(code) return (os.path.splitext(all_installed[0])[0]...
Return the newest installed dictionary for the given code. Return the filename of the installed dictionary with the highest version number or None if the dictionary is not installed.
luminos/browser/webengine/Spell.py
local_filename
linuxaddict89/luminos
0
python
def local_filename(code): 'Return the newest installed dictionary for the given code.\n\n Return the filename of the installed dictionary with the highest version\n number or None if the dictionary is not installed.\n ' all_installed = local_files(code) return (os.path.splitext(all_installed[0])[0]...
def local_filename(code): 'Return the newest installed dictionary for the given code.\n\n Return the filename of the installed dictionary with the highest version\n number or None if the dictionary is not installed.\n ' all_installed = local_files(code) return (os.path.splitext(all_installed[0])[0]...
4386382a6a7715683cc7cda7d185d020555d69add1b3d183570d30e4e77048d6
def init(): 'Initialize the dictionary path if supported.' if qtutils.version_check('5.10', compiled=False): new_dir = dictionary_dir() old_dir = dictionary_dir(old=True) os.environ['QTWEBENGINE_DICTIONARIES_PATH'] = new_dir try: if (os.path.exists(old_dir) and (not o...
Initialize the dictionary path if supported.
luminos/browser/webengine/Spell.py
init
linuxaddict89/luminos
0
python
def init(): if qtutils.version_check('5.10', compiled=False): new_dir = dictionary_dir() old_dir = dictionary_dir(old=True) os.environ['QTWEBENGINE_DICTIONARIES_PATH'] = new_dir try: if (os.path.exists(old_dir) and (not os.path.exists(new_dir))): shut...
def init(): if qtutils.version_check('5.10', compiled=False): new_dir = dictionary_dir() old_dir = dictionary_dir(old=True) os.environ['QTWEBENGINE_DICTIONARIES_PATH'] = new_dir try: if (os.path.exists(old_dir) and (not os.path.exists(new_dir))): shut...
cc06da47a12d635c870c86ea64d9de9bac629bc7b649a4bea7e5c8b7be89802d
def customer_image_file_path(instance, file_name): 'Generate file path for new customer image' ext = file_name.split('.')[(- 1)] file_name = f'{uuid.uuid4()}.{ext}' return os.path.join('images/', file_name)
Generate file path for new customer image
billing_shop/apps/clients/models/clients.py
customer_image_file_path
sandoval19/build_crew
0
python
def customer_image_file_path(instance, file_name): ext = file_name.split('.')[(- 1)] file_name = f'{uuid.uuid4()}.{ext}' return os.path.join('images/', file_name)
def customer_image_file_path(instance, file_name): ext = file_name.split('.')[(- 1)] file_name = f'{uuid.uuid4()}.{ext}' return os.path.join('images/', file_name)<|docstring|>Generate file path for new customer image<|endoftext|>
0428aa6039ba9cb7173e6d7d9ffc88d41299ddbe8115f6774d5162b057a95259
def generate_unique_anonymous_username(): '\n Generate an unique username for a player. Check in database if the username already exists.\n TODO: check in db if a user with the generated username already exists\n ' unique_id = get_random_string(length=10) new_username = ('u_%s' % unique_id) ret...
Generate an unique username for a player. Check in database if the username already exists. TODO: check in db if a user with the generated username already exists
web/utils.py
generate_unique_anonymous_username
NejcZupec/tictactoe
1
python
def generate_unique_anonymous_username(): '\n Generate an unique username for a player. Check in database if the username already exists.\n TODO: check in db if a user with the generated username already exists\n ' unique_id = get_random_string(length=10) new_username = ('u_%s' % unique_id) ret...
def generate_unique_anonymous_username(): '\n Generate an unique username for a player. Check in database if the username already exists.\n TODO: check in db if a user with the generated username already exists\n ' unique_id = get_random_string(length=10) new_username = ('u_%s' % unique_id) ret...
5212bc37b7af3f6478baf91708147f5f4e972b7868316ad29e720144910d0f48
def create_new_game(p1_type, p2_type): '\n Generate two random players and create a new Game instance.\n ' player1 = Player.objects.create(username=generate_unique_anonymous_username(), type=p1_type) player2 = Player.objects.create(username=generate_unique_anonymous_username(), type=p2_type) retur...
Generate two random players and create a new Game instance.
web/utils.py
create_new_game
NejcZupec/tictactoe
1
python
def create_new_game(p1_type, p2_type): '\n \n ' player1 = Player.objects.create(username=generate_unique_anonymous_username(), type=p1_type) player2 = Player.objects.create(username=generate_unique_anonymous_username(), type=p2_type) return Game.objects.create(player1=player1, player2=player2)
def create_new_game(p1_type, p2_type): '\n \n ' player1 = Player.objects.create(username=generate_unique_anonymous_username(), type=p1_type) player2 = Player.objects.create(username=generate_unique_anonymous_username(), type=p2_type) return Game.objects.create(player1=player1, player2=player2)<|do...
f4f7acfacc3270e66c237768148fcad3edc883902e78fe9af47ac151817f3410
def download_content(url, dst, proxy=None, verbose=True): "\n\n Download web content.\n\n Parameters\n ----------\n url: str\n Content url.\n\n dst: str\n Destination for file saving.\n\n proxy: dict\n Dictionary with 'https' as key and a string indicating\n the https proxy as value. Defaults to None, ind...
Download web content. Parameters ---------- url: str Content url. dst: str Destination for file saving. proxy: dict Dictionary with 'https' as key and a string indicating the https proxy as value. Defaults to None, indicating that the env variable https_proxy will be searched. In case of not found, the proxy will be...
lib/utils/utils.py
download_content
jonathanzjl/cam-vision
0
python
def download_content(url, dst, proxy=None, verbose=True): "\n\n Download web content.\n\n Parameters\n ----------\n url: str\n Content url.\n\n dst: str\n Destination for file saving.\n\n proxy: dict\n Dictionary with 'https' as key and a string indicating\n the https proxy as value. Defaults to None, ind...
def download_content(url, dst, proxy=None, verbose=True): "\n\n Download web content.\n\n Parameters\n ----------\n url: str\n Content url.\n\n dst: str\n Destination for file saving.\n\n proxy: dict\n Dictionary with 'https' as key and a string indicating\n the https proxy as value. Defaults to None, ind...
11286e6b7b205b27dccb87e3e2d2031580bb0e893071a29a28e7b1ce4b757a67
def download_yoolov3tiny_weights(dst, proxy=None, verbose=True): "\n\n Download YOLOv3-Tiny weight file from official darknet\n website.\n\n Parameters\n ----------\n dst: str\n Destination for file saving.\n\n proxy: dict\n Dictionary with 'https' as key and a string indicating\n the https proxy as value....
Download YOLOv3-Tiny weight file from official darknet website. Parameters ---------- dst: str Destination for file saving. proxy: dict Dictionary with 'https' as key and a string indicating the https proxy as value. Defaults to None, indicating that the env variable https_proxy will be searched. In case of not found...
lib/utils/utils.py
download_yoolov3tiny_weights
jonathanzjl/cam-vision
0
python
def download_yoolov3tiny_weights(dst, proxy=None, verbose=True): "\n\n Download YOLOv3-Tiny weight file from official darknet\n website.\n\n Parameters\n ----------\n dst: str\n Destination for file saving.\n\n proxy: dict\n Dictionary with 'https' as key and a string indicating\n the https proxy as value....
def download_yoolov3tiny_weights(dst, proxy=None, verbose=True): "\n\n Download YOLOv3-Tiny weight file from official darknet\n website.\n\n Parameters\n ----------\n dst: str\n Destination for file saving.\n\n proxy: dict\n Dictionary with 'https' as key and a string indicating\n the https proxy as value....
b23020a4a5323bac9d34b65f69c299dd28e196bee8ffce1b50cf72f298e474fb
def print_mat(mat, width=10, prec=4): '\n A nice printer for floating point\n matrices.\n\n Parameters\n ----------\n mat: 2D matrix\n An input 2D matrix to print.\n\n width: int\n Minimum width for each element to print.\n\n prec: int\n Floating point precision for each element\n to print.\n\n ' fo...
A nice printer for floating point matrices. Parameters ---------- mat: 2D matrix An input 2D matrix to print. width: int Minimum width for each element to print. prec: int Floating point precision for each element to print.
lib/utils/utils.py
print_mat
jonathanzjl/cam-vision
0
python
def print_mat(mat, width=10, prec=4): '\n A nice printer for floating point\n matrices.\n\n Parameters\n ----------\n mat: 2D matrix\n An input 2D matrix to print.\n\n width: int\n Minimum width for each element to print.\n\n prec: int\n Floating point precision for each element\n to print.\n\n ' fo...
def print_mat(mat, width=10, prec=4): '\n A nice printer for floating point\n matrices.\n\n Parameters\n ----------\n mat: 2D matrix\n An input 2D matrix to print.\n\n width: int\n Minimum width for each element to print.\n\n prec: int\n Floating point precision for each element\n to print.\n\n ' fo...
f146be34658f0bb4f992c8fa2b82cb087fe395fbeeed361e7f95969654315f44
def read_txt_as_strs(txt_path, strip=' ', cmnt=None): '\n\n Read a txt file. Each line will be treated\n as a string.\n\n Empty lines will be skipped. Spaces will be\n automatically stripped.\n\n Parameters\n ----------\n txt_path: str\n Path to the txt file.\n\n strip: bool\n Character(s) stripped from t...
Read a txt file. Each line will be treated as a string. Empty lines will be skipped. Spaces will be automatically stripped. Parameters ---------- txt_path: str Path to the txt file. strip: bool Character(s) stripped from the beginning and the end of each line. Defaults to whitespace. Use `None` to indicate no-op. c...
lib/utils/utils.py
read_txt_as_strs
jonathanzjl/cam-vision
0
python
def read_txt_as_strs(txt_path, strip=' ', cmnt=None): '\n\n Read a txt file. Each line will be treated\n as a string.\n\n Empty lines will be skipped. Spaces will be\n automatically stripped.\n\n Parameters\n ----------\n txt_path: str\n Path to the txt file.\n\n strip: bool\n Character(s) stripped from t...
def read_txt_as_strs(txt_path, strip=' ', cmnt=None): '\n\n Read a txt file. Each line will be treated\n as a string.\n\n Empty lines will be skipped. Spaces will be\n automatically stripped.\n\n Parameters\n ----------\n txt_path: str\n Path to the txt file.\n\n strip: bool\n Character(s) stripped from t...
dd49f3fe44b580c35b0d9d171b7347d5b675d4644a388ae414f1136addfc4a04
def load_img(img_path, target_size, normalize=True): '\n\n Load image for TF prediction mode.\n\n Parameters\n ----------\n img_path: str\n Path to image file.\n\n target_size: int\n Target square size for image resizing.\n\n normalize: bool\n Whether input image should be divided by 255.\n\n Returns\n -...
Load image for TF prediction mode. Parameters ---------- img_path: str Path to image file. target_size: int Target square size for image resizing. normalize: bool Whether input image should be divided by 255. Returns ---------- np.ndarray Tensor with rank 4, to be used for TF model prediction.
lib/utils/utils.py
load_img
jonathanzjl/cam-vision
0
python
def load_img(img_path, target_size, normalize=True): '\n\n Load image for TF prediction mode.\n\n Parameters\n ----------\n img_path: str\n Path to image file.\n\n target_size: int\n Target square size for image resizing.\n\n normalize: bool\n Whether input image should be divided by 255.\n\n Returns\n -...
def load_img(img_path, target_size, normalize=True): '\n\n Load image for TF prediction mode.\n\n Parameters\n ----------\n img_path: str\n Path to image file.\n\n target_size: int\n Target square size for image resizing.\n\n normalize: bool\n Whether input image should be divided by 255.\n\n Returns\n -...
18933248c5606bef95d8395c9a715b9f622c51cb0cddae7e84b3bad1b4750726
def make_predict_inp(img, target_size=None, normalize=True, permute_br=True, letter_box=None, to_channel_first=False): '\n\n Transform an image for prediction mode. Pixel\n values will be rescaled to between 0 and 1.\n\n Parameters\n ----------\n img: np.ndarray\n An input image array. Assumed to be RGB image...
Transform an image for prediction mode. Pixel values will be rescaled to between 0 and 1. Parameters ---------- img: np.ndarray An input image array. Assumed to be RGB image. target_size: int Target square size for image resizing. Defaults to None, i.e. no resizing. normalize: bool Whether input image should be divi...
lib/utils/utils.py
make_predict_inp
jonathanzjl/cam-vision
0
python
def make_predict_inp(img, target_size=None, normalize=True, permute_br=True, letter_box=None, to_channel_first=False): '\n\n Transform an image for prediction mode. Pixel\n values will be rescaled to between 0 and 1.\n\n Parameters\n ----------\n img: np.ndarray\n An input image array. Assumed to be RGB image...
def make_predict_inp(img, target_size=None, normalize=True, permute_br=True, letter_box=None, to_channel_first=False): '\n\n Transform an image for prediction mode. Pixel\n values will be rescaled to between 0 and 1.\n\n Parameters\n ----------\n img: np.ndarray\n An input image array. Assumed to be RGB image...
7929c0099a2e5f39faee7a38162674eec8bdb8ae6214da16f802f8f6991b5ca1
def predict_top(model, img, top_classes, label_dict): '\n\n Run prediction on input image and get\n prediction scores and class indices for\n `top_classes` classes.\n\n Parameters\n ----------\n model: tf.keras.models.Model\n A keras model.\n\n img: np.ndarray\n Input image in form of 4D tensor.\n\n top_c...
Run prediction on input image and get prediction scores and class indices for `top_classes` classes. Parameters ---------- model: tf.keras.models.Model A keras model. img: np.ndarray Input image in form of 4D tensor. top_classes: int Number of top classes for prediction. label_dict: dict Dictionary with keys the pr...
lib/utils/utils.py
predict_top
jonathanzjl/cam-vision
0
python
def predict_top(model, img, top_classes, label_dict): '\n\n Run prediction on input image and get\n prediction scores and class indices for\n `top_classes` classes.\n\n Parameters\n ----------\n model: tf.keras.models.Model\n A keras model.\n\n img: np.ndarray\n Input image in form of 4D tensor.\n\n top_c...
def predict_top(model, img, top_classes, label_dict): '\n\n Run prediction on input image and get\n prediction scores and class indices for\n `top_classes` classes.\n\n Parameters\n ----------\n model: tf.keras.models.Model\n A keras model.\n\n img: np.ndarray\n Input image in form of 4D tensor.\n\n top_c...
d9af481db73556e58e514f0602304e500207388520da0fe3dd04aa54d44cf799
def get_imagenet_dict(txt_path): '\n\n Make ImageNet ground truth dict.\n The ground truth dictionay maps\n a class index to its label.\n\n The .txt file can be found at:\n https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a\n\n Parameters\n ----------\n txt_path: str\n Path to the txt file with ImageNet\n...
Make ImageNet ground truth dict. The ground truth dictionay maps a class index to its label. The .txt file can be found at: https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a Parameters ---------- txt_path: str Path to the txt file with ImageNet class index-to-label mappings. Returns ---------- dict A dictionay wit...
lib/utils/utils.py
get_imagenet_dict
jonathanzjl/cam-vision
0
python
def get_imagenet_dict(txt_path): '\n\n Make ImageNet ground truth dict.\n The ground truth dictionay maps\n a class index to its label.\n\n The .txt file can be found at:\n https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a\n\n Parameters\n ----------\n txt_path: str\n Path to the txt file with ImageNet\n...
def get_imagenet_dict(txt_path): '\n\n Make ImageNet ground truth dict.\n The ground truth dictionay maps\n a class index to its label.\n\n The .txt file can be found at:\n https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a\n\n Parameters\n ----------\n txt_path: str\n Path to the txt file with ImageNet\n...
d3df50c856658bed26a06cbf0d67e06c509e0d678ee063c5b30b26907792790c
def classify_frame(model, frame, target_size, top_classes, label_dict, normalize=True, permute_br=True, to_channel_first=False, verbose=True): '\n\n Run classification on input frame.\n\n Parameters\n ----------\n model: tf.keras.models.Model\n A keras model.\n\n frame: np.ndarray\n An input image frame.\n\n...
Run classification on input frame. Parameters ---------- model: tf.keras.models.Model A keras model. frame: np.ndarray An input image frame. target_size: int Target square image size for resizing. None indicates no resizing. top_classes: int Number of top classes for prediction. label_dict: dict Dictionary with ke...
lib/utils/utils.py
classify_frame
jonathanzjl/cam-vision
0
python
def classify_frame(model, frame, target_size, top_classes, label_dict, normalize=True, permute_br=True, to_channel_first=False, verbose=True): '\n\n Run classification on input frame.\n\n Parameters\n ----------\n model: tf.keras.models.Model\n A keras model.\n\n frame: np.ndarray\n An input image frame.\n\n...
def classify_frame(model, frame, target_size, top_classes, label_dict, normalize=True, permute_br=True, to_channel_first=False, verbose=True): '\n\n Run classification on input frame.\n\n Parameters\n ----------\n model: tf.keras.models.Model\n A keras model.\n\n frame: np.ndarray\n An input image frame.\n\n...
23ec06474e3a5bd772c46a2928c76cd9c78a6bf91f329568bac3ba1be090b7e4
def load_dkn_weights(w_path, dtype, skip_bytes=20): '\n\n Load Darknet weight file.\n\n Parameters\n ----------\n w_path: str\n Path to the weight file.\n\n dtype: str or datatype\n Data type of stored weights.\n\n skip_bytes: int\n Number of bytes to skip. Darknet weight\n file starts with 5 x int32 (20 ...
Load Darknet weight file. Parameters ---------- w_path: str Path to the weight file. dtype: str or datatype Data type of stored weights. skip_bytes: int Number of bytes to skip. Darknet weight file starts with 5 x int32 (20 bytes) header elements. Returns ---------- np.array Weight array.
lib/utils/utils.py
load_dkn_weights
jonathanzjl/cam-vision
0
python
def load_dkn_weights(w_path, dtype, skip_bytes=20): '\n\n Load Darknet weight file.\n\n Parameters\n ----------\n w_path: str\n Path to the weight file.\n\n dtype: str or datatype\n Data type of stored weights.\n\n skip_bytes: int\n Number of bytes to skip. Darknet weight\n file starts with 5 x int32 (20 ...
def load_dkn_weights(w_path, dtype, skip_bytes=20): '\n\n Load Darknet weight file.\n\n Parameters\n ----------\n w_path: str\n Path to the weight file.\n\n dtype: str or datatype\n Data type of stored weights.\n\n skip_bytes: int\n Number of bytes to skip. Darknet weight\n file starts with 5 x int32 (20 ...
64a02305751c0e0c51ff32c729fcf1b30505d35c7dd193f0df6fbf5d567ef6a1
def load_img_folder(folder, ext, permute_br=True, normalize=True, loader=None): '\n\n Load all images inside given folder.\n\n Parameters\n ----------\n folder: str\n Absolute folder to image folder.\n\n ext: str\n Image file extension. Must be recognizable by\n OpenCV.\n\n permute_br: bool\n Whether blue...
Load all images inside given folder. Parameters ---------- folder: str Absolute folder to image folder. ext: str Image file extension. Must be recognizable by OpenCV. permute_br: bool Whether blue and red channel permutation should be performed. normalize: bool Indicating whether the image pixel value should be div...
lib/utils/utils.py
load_img_folder
jonathanzjl/cam-vision
0
python
def load_img_folder(folder, ext, permute_br=True, normalize=True, loader=None): '\n\n Load all images inside given folder.\n\n Parameters\n ----------\n folder: str\n Absolute folder to image folder.\n\n ext: str\n Image file extension. Must be recognizable by\n OpenCV.\n\n permute_br: bool\n Whether blue...
def load_img_folder(folder, ext, permute_br=True, normalize=True, loader=None): '\n\n Load all images inside given folder.\n\n Parameters\n ----------\n folder: str\n Absolute folder to image folder.\n\n ext: str\n Image file extension. Must be recognizable by\n OpenCV.\n\n permute_br: bool\n Whether blue...
41f829b3f8895c13ac6b09a3a89e584075004983f9c3e52f6712f52d830d42e8
def letterbox_image(img, frame_size, fill=0.5, normalize=True): '\n\n Letter box an input image.\n\n Image will be centered into a squared frame,\n where the longer side of the image is resized\n to the frame size and the shorter side is resized\n by keepng the same aspect ratio.\n\n Parameters\n ----------\...
Letter box an input image. Image will be centered into a squared frame, where the longer side of the image is resized to the frame size and the shorter side is resized by keepng the same aspect ratio. Parameters ---------- img: np.array The input image. Assumed to be rank-3, channel-last. frame_size: int Size of the...
lib/utils/utils.py
letterbox_image
jonathanzjl/cam-vision
0
python
def letterbox_image(img, frame_size, fill=0.5, normalize=True): '\n\n Letter box an input image.\n\n Image will be centered into a squared frame,\n where the longer side of the image is resized\n to the frame size and the shorter side is resized\n by keepng the same aspect ratio.\n\n Parameters\n ----------\...
def letterbox_image(img, frame_size, fill=0.5, normalize=True): '\n\n Letter box an input image.\n\n Image will be centered into a squared frame,\n where the longer side of the image is resized\n to the frame size and the shorter side is resized\n by keepng the same aspect ratio.\n\n Parameters\n ----------\...
f21f16227c86cfe4135f94a19a1444caa454cadcac7b0f9cc19ee8477098175a
def correct_bboxes(dets, shift, ratio): '\n\n Correct bounding box centers and scales\n to match original input image before\n letter boxing.\n\n Parameters\n ----------\n dets: torch.tensor\n A rank-2 tensor, where each col is a size-6\n vector representing a detection bounding box.\n The meaning of each ...
Correct bounding box centers and scales to match original input image before letter boxing. Parameters ---------- dets: torch.tensor A rank-2 tensor, where each col is a size-6 vector representing a detection bounding box. The meaning of each element in the vector is as follows: 1. bbox begin point x coordinate. 2. bb...
lib/utils/utils.py
correct_bboxes
jonathanzjl/cam-vision
0
python
def correct_bboxes(dets, shift, ratio): '\n\n Correct bounding box centers and scales\n to match original input image before\n letter boxing.\n\n Parameters\n ----------\n dets: torch.tensor\n A rank-2 tensor, where each col is a size-6\n vector representing a detection bounding box.\n The meaning of each ...
def correct_bboxes(dets, shift, ratio): '\n\n Correct bounding box centers and scales\n to match original input image before\n letter boxing.\n\n Parameters\n ----------\n dets: torch.tensor\n A rank-2 tensor, where each col is a size-6\n vector representing a detection bounding box.\n The meaning of each ...
a1edcf48f0951e192bbb833f8169f0b9d12c562e5c90b0992a09b5f42e5b188e
def nms(dets, nms_thresh): '\n\n Do non-maximum suppression.\n\n Parameters\n ----------\n dets: torch.tensor\n A rank-2 tensor, where each col is a size-6\n vector representing a detection bounding box.\n The meaning of each element in the vector is\n as follows:\n 1. bbox begin point x coordinate.\n 2. ...
Do non-maximum suppression. Parameters ---------- dets: torch.tensor A rank-2 tensor, where each col is a size-6 vector representing a detection bounding box. The meaning of each element in the vector is as follows: 1. bbox begin point x coordinate. 2. bbox begin point y coordinate. 3. bbox width. 4. bbox height. 5. m...
lib/utils/utils.py
nms
jonathanzjl/cam-vision
0
python
def nms(dets, nms_thresh): '\n\n Do non-maximum suppression.\n\n Parameters\n ----------\n dets: torch.tensor\n A rank-2 tensor, where each col is a size-6\n vector representing a detection bounding box.\n The meaning of each element in the vector is\n as follows:\n 1. bbox begin point x coordinate.\n 2. ...
def nms(dets, nms_thresh): '\n\n Do non-maximum suppression.\n\n Parameters\n ----------\n dets: torch.tensor\n A rank-2 tensor, where each col is a size-6\n vector representing a detection bounding box.\n The meaning of each element in the vector is\n as follows:\n 1. bbox begin point x coordinate.\n 2. ...
0209748ba636f48d0ddb946a50617106be0d99db3e375be6b91dd352b0ee0296
def compute_iou(lhs, rhs): '\n\n Compute the intersection over union of two\n bounding boxes.\n\n Parameters\n ----------\n lhs: torch.tensor\n Bounding box 1.\n\n rhs: torch.tensor\n Bounding box 2.\n\n Returns\n ----------\n float\n The intersection over union.\n\n ' __beg = np.array([max(lhs[0],...
Compute the intersection over union of two bounding boxes. Parameters ---------- lhs: torch.tensor Bounding box 1. rhs: torch.tensor Bounding box 2. Returns ---------- float The intersection over union.
lib/utils/utils.py
compute_iou
jonathanzjl/cam-vision
0
python
def compute_iou(lhs, rhs): '\n\n Compute the intersection over union of two\n bounding boxes.\n\n Parameters\n ----------\n lhs: torch.tensor\n Bounding box 1.\n\n rhs: torch.tensor\n Bounding box 2.\n\n Returns\n ----------\n float\n The intersection over union.\n\n ' __beg = np.array([max(lhs[0],...
def compute_iou(lhs, rhs): '\n\n Compute the intersection over union of two\n bounding boxes.\n\n Parameters\n ----------\n lhs: torch.tensor\n Bounding box 1.\n\n rhs: torch.tensor\n Bounding box 2.\n\n Returns\n ----------\n float\n The intersection over union.\n\n ' __beg = np.array([max(lhs[0],...
b1f48b117ee01bbe0a48569ab83d99e7c203e000292cd8edb35299612acf7caa
def detect_frame(model, frame, obj_thresh=0.5, nms_thresh=None, box_correction=None): '\n\n Detect objects in a frame.\n\n Parameters\n ----------\n model: YOLO\n The YOLO detector model.\n\n frame: torch.tensor\n The input frame as a torch rank-4 tensor.\n\n obj_thresh: float\n Threshold on objectiveness ...
Detect objects in a frame. Parameters ---------- model: YOLO The YOLO detector model. frame: torch.tensor The input frame as a torch rank-4 tensor. obj_thresh: float Threshold on objectiveness and class probabilities. nms_thresh: float Threshold on IOU used during nms. box_correction: tuple or None A tuple of (shi...
lib/utils/utils.py
detect_frame
jonathanzjl/cam-vision
0
python
def detect_frame(model, frame, obj_thresh=0.5, nms_thresh=None, box_correction=None): '\n\n Detect objects in a frame.\n\n Parameters\n ----------\n model: YOLO\n The YOLO detector model.\n\n frame: torch.tensor\n The input frame as a torch rank-4 tensor.\n\n obj_thresh: float\n Threshold on objectiveness ...
def detect_frame(model, frame, obj_thresh=0.5, nms_thresh=None, box_correction=None): '\n\n Detect objects in a frame.\n\n Parameters\n ----------\n model: YOLO\n The YOLO detector model.\n\n frame: torch.tensor\n The input frame as a torch rank-4 tensor.\n\n obj_thresh: float\n Threshold on objectiveness ...
a3e59ea570463414ef9d26de334c41b1393057cbc4ae9cb2d5c363677e776e26
@nb.njit('uint64(uint8, uint8, uint8)') def separate_n_nb(packed, n, chunk_bits): '\n A relatively inefficient generalization of the "separate bits"\n step of Morton encoding. Assuming that each of the `n` coordinates\n has `chunk_bits` bits, we can "space out" each bit of each coordinate\n `n` spaces a...
A relatively inefficient generalization of the "separate bits" step of Morton encoding. Assuming that each of the `n` coordinates has `chunk_bits` bits, we can "space out" each bit of each coordinate `n` spaces at a time. >>> for i in range(8): ... print(i, ... format(separate_n_nb(i, 3, 3), '#012b'), .....
morton.py
separate_n_nb
AnimatedRNG/lsc
0
python
@nb.njit('uint64(uint8, uint8, uint8)') def separate_n_nb(packed, n, chunk_bits): '\n A relatively inefficient generalization of the "separate bits"\n step of Morton encoding. Assuming that each of the `n` coordinates\n has `chunk_bits` bits, we can "space out" each bit of each coordinate\n `n` spaces a...
@nb.njit('uint64(uint8, uint8, uint8)') def separate_n_nb(packed, n, chunk_bits): '\n A relatively inefficient generalization of the "separate bits"\n step of Morton encoding. Assuming that each of the `n` coordinates\n has `chunk_bits` bits, we can "space out" each bit of each coordinate\n `n` spaces a...
3434840cac354ebbc3ee887e2e90976fb692dea23839f49078cd42ad38207d9a
@nb.njit('uint64(uint8[:], uint8)') def encode_single_coord(coord, chunk_bits): '\n Encodes a coordinate in ℝⁿ in ℝ¹ using Morton ordering, assuming that\n the size of each dimension is 0..2^{chunk_bits}\n\n >>> morton_offsets = set()\n >>> for i in range(16):\n ... for j in range(16):\n ... ...
Encodes a coordinate in ℝⁿ in ℝ¹ using Morton ordering, assuming that the size of each dimension is 0..2^{chunk_bits} >>> morton_offsets = set() >>> for i in range(16): ... for j in range(16): ... morton_offsets.add(encode_single_coord( ... np.array([i, j], dtype=np.uint8), ... ...
morton.py
encode_single_coord
AnimatedRNG/lsc
0
python
@nb.njit('uint64(uint8[:], uint8)') def encode_single_coord(coord, chunk_bits): '\n Encodes a coordinate in ℝⁿ in ℝ¹ using Morton ordering, assuming that\n the size of each dimension is 0..2^{chunk_bits}\n\n >>> morton_offsets = set()\n >>> for i in range(16):\n ... for j in range(16):\n ... ...
@nb.njit('uint64(uint8[:], uint8)') def encode_single_coord(coord, chunk_bits): '\n Encodes a coordinate in ℝⁿ in ℝ¹ using Morton ordering, assuming that\n the size of each dimension is 0..2^{chunk_bits}\n\n >>> morton_offsets = set()\n >>> for i in range(16):\n ... for j in range(16):\n ... ...
67cdc69d9e657bf849bbbeee41f035524ee55804420ba176448cb7ea326cddf9
@nb.njit('uint8[:](uint64, uint8, uint8)') def decode_single_coord(offset, n, chunk_bits): '\n The reverse of the Morton encode function above\n\n >>> verify_decode = set()\n >>> for i in range(16):\n ... for j in range(16):\n ... coord = np.array([i, j], dtype=np.uint8)\n ... ...
The reverse of the Morton encode function above >>> verify_decode = set() >>> for i in range(16): ... for j in range(16): ... coord = np.array([i, j], dtype=np.uint8) ... encoded = encode_single_coord(coord, 4) ... decoded = decode_single_coord(encoded, 2, 4) ... verify_decode.add(n...
morton.py
decode_single_coord
AnimatedRNG/lsc
0
python
@nb.njit('uint8[:](uint64, uint8, uint8)') def decode_single_coord(offset, n, chunk_bits): '\n The reverse of the Morton encode function above\n\n >>> verify_decode = set()\n >>> for i in range(16):\n ... for j in range(16):\n ... coord = np.array([i, j], dtype=np.uint8)\n ... ...
@nb.njit('uint8[:](uint64, uint8, uint8)') def decode_single_coord(offset, n, chunk_bits): '\n The reverse of the Morton encode function above\n\n >>> verify_decode = set()\n >>> for i in range(16):\n ... for j in range(16):\n ... coord = np.array([i, j], dtype=np.uint8)\n ... ...
29960a3fc043eca1d7f7e320721d2385051c7618be9ef089c7d2e2f4d66c1cca
@nb.njit def morton_encode_nb(coords): '\n >>> x, y = np.arange(8), np.arange(8)\n >>> xv, yv = np.meshgrid(x, y, sparse=False, indexing=\'ij\')\n >>> inp = np.sqrt(xv ** 2 + yv ** 2).reshape(1, 8, 8)\n\n For the sake of clarity, let\'s inspect these values\n\n >>> with np.printoptions(formatter={\'f...
>>> x, y = np.arange(8), np.arange(8) >>> xv, yv = np.meshgrid(x, y, sparse=False, indexing='ij') >>> inp = np.sqrt(xv ** 2 + yv ** 2).reshape(1, 8, 8) For the sake of clarity, let's inspect these values >>> with np.printoptions(formatter={'float': lambda x: "{0:0.3f}".format(x)}): ... print(inp) [[[0.000 1.000 2...
morton.py
morton_encode_nb
AnimatedRNG/lsc
0
python
@nb.njit def morton_encode_nb(coords): '\n >>> x, y = np.arange(8), np.arange(8)\n >>> xv, yv = np.meshgrid(x, y, sparse=False, indexing=\'ij\')\n >>> inp = np.sqrt(xv ** 2 + yv ** 2).reshape(1, 8, 8)\n\n For the sake of clarity, let\'s inspect these values\n\n >>> with np.printoptions(formatter={\'f...
@nb.njit def morton_encode_nb(coords): '\n >>> x, y = np.arange(8), np.arange(8)\n >>> xv, yv = np.meshgrid(x, y, sparse=False, indexing=\'ij\')\n >>> inp = np.sqrt(xv ** 2 + yv ** 2).reshape(1, 8, 8)\n\n For the sake of clarity, let\'s inspect these values\n\n >>> with np.printoptions(formatter={\'f...
d0391f801e0deb333572ae383dc20fb46156af9baae3779f00a720700f840945
@nb.njit def morton_decode_nb(offsets, output): "\n >>> x, y = np.arange(64), np.arange(64)\n >>> xv, yv = np.meshgrid(x, y, sparse=False, indexing='ij')\n >>> inp = np.sqrt(xv ** 2 + yv ** 2).reshape(1, 64, 64)\n >>> recon = np.zeros_like(inp)\n\n >>> morton_decode_nb(morton_encode_nb(inp), recon)\n...
>>> x, y = np.arange(64), np.arange(64) >>> xv, yv = np.meshgrid(x, y, sparse=False, indexing='ij') >>> inp = np.sqrt(xv ** 2 + yv ** 2).reshape(1, 64, 64) >>> recon = np.zeros_like(inp) >>> morton_decode_nb(morton_encode_nb(inp), recon) >>> (inp - recon).max() < 1e-5 True This function is basically the inverse of `m...
morton.py
morton_decode_nb
AnimatedRNG/lsc
0
python
@nb.njit def morton_decode_nb(offsets, output): "\n >>> x, y = np.arange(64), np.arange(64)\n >>> xv, yv = np.meshgrid(x, y, sparse=False, indexing='ij')\n >>> inp = np.sqrt(xv ** 2 + yv ** 2).reshape(1, 64, 64)\n >>> recon = np.zeros_like(inp)\n\n >>> morton_decode_nb(morton_encode_nb(inp), recon)\n...
@nb.njit def morton_decode_nb(offsets, output): "\n >>> x, y = np.arange(64), np.arange(64)\n >>> xv, yv = np.meshgrid(x, y, sparse=False, indexing='ij')\n >>> inp = np.sqrt(xv ** 2 + yv ** 2).reshape(1, 64, 64)\n >>> recon = np.zeros_like(inp)\n\n >>> morton_decode_nb(morton_encode_nb(inp), recon)\n...
ce75354e5c403f7637dc56d58cfd7cf9cae0aa8f57268ea402b781a5d3308b62
def detect_windows(self, images_windows): '\n Do windowed detection over given images and windows. Windows are\n extracted then warped to the input dimensions of the net.\n\n Parameters\n ----------\n images_windows: (image filename, window list) iterable.\n context_crop: s...
Do windowed detection over given images and windows. Windows are extracted then warped to the input dimensions of the net. Parameters ---------- images_windows: (image filename, window list) iterable. context_crop: size of context border to crop in pixels. Returns ------- detections: list of {filename: image filename...
python/caffe/detector.py
detect_windows
raytroop/caffe
36,275
python
def detect_windows(self, images_windows): '\n Do windowed detection over given images and windows. Windows are\n extracted then warped to the input dimensions of the net.\n\n Parameters\n ----------\n images_windows: (image filename, window list) iterable.\n context_crop: s...
def detect_windows(self, images_windows): '\n Do windowed detection over given images and windows. Windows are\n extracted then warped to the input dimensions of the net.\n\n Parameters\n ----------\n images_windows: (image filename, window list) iterable.\n context_crop: s...
041edc0924a6af4db8ba04e76bc5a04d463f69d850a31241f9222ef1a6d5886f
def detect_selective_search(self, image_fnames): '\n Do windowed detection over Selective Search proposals by extracting\n the crop and warping to the input dimensions of the net.\n\n Parameters\n ----------\n image_fnames: list\n\n Returns\n -------\n detecti...
Do windowed detection over Selective Search proposals by extracting the crop and warping to the input dimensions of the net. Parameters ---------- image_fnames: list Returns ------- detections: list of {filename: image filename, window: crop coordinates, predictions: prediction vector} dicts.
python/caffe/detector.py
detect_selective_search
raytroop/caffe
36,275
python
def detect_selective_search(self, image_fnames): '\n Do windowed detection over Selective Search proposals by extracting\n the crop and warping to the input dimensions of the net.\n\n Parameters\n ----------\n image_fnames: list\n\n Returns\n -------\n detecti...
def detect_selective_search(self, image_fnames): '\n Do windowed detection over Selective Search proposals by extracting\n the crop and warping to the input dimensions of the net.\n\n Parameters\n ----------\n image_fnames: list\n\n Returns\n -------\n detecti...
5ac097739c4c85253b500f00ca85b36c4f9cd4e9d58eb6368d2803c0f3376405
def crop(self, im, window): '\n Crop a window from the image for detection. Include surrounding context\n according to the `context_pad` configuration.\n\n Parameters\n ----------\n im: H x W x K image ndarray to crop.\n window: bounding box coordinates as ymin, xmin, ymax,...
Crop a window from the image for detection. Include surrounding context according to the `context_pad` configuration. Parameters ---------- im: H x W x K image ndarray to crop. window: bounding box coordinates as ymin, xmin, ymax, xmax. Returns ------- crop: cropped window.
python/caffe/detector.py
crop
raytroop/caffe
36,275
python
def crop(self, im, window): '\n Crop a window from the image for detection. Include surrounding context\n according to the `context_pad` configuration.\n\n Parameters\n ----------\n im: H x W x K image ndarray to crop.\n window: bounding box coordinates as ymin, xmin, ymax,...
def crop(self, im, window): '\n Crop a window from the image for detection. Include surrounding context\n according to the `context_pad` configuration.\n\n Parameters\n ----------\n im: H x W x K image ndarray to crop.\n window: bounding box coordinates as ymin, xmin, ymax,...
437017d115d6e4a198f32630da47d0a536bcd713011102ef050a297aee9ebb18
def configure_crop(self, context_pad): '\n Configure crop dimensions and amount of context for cropping.\n If context is included, make the special input mean for context padding.\n\n Parameters\n ----------\n context_pad : amount of context for cropping.\n ' in_ = self...
Configure crop dimensions and amount of context for cropping. If context is included, make the special input mean for context padding. Parameters ---------- context_pad : amount of context for cropping.
python/caffe/detector.py
configure_crop
raytroop/caffe
36,275
python
def configure_crop(self, context_pad): '\n Configure crop dimensions and amount of context for cropping.\n If context is included, make the special input mean for context padding.\n\n Parameters\n ----------\n context_pad : amount of context for cropping.\n ' in_ = self...
def configure_crop(self, context_pad): '\n Configure crop dimensions and amount of context for cropping.\n If context is included, make the special input mean for context padding.\n\n Parameters\n ----------\n context_pad : amount of context for cropping.\n ' in_ = self...
46ec2f9a685dae1253decf4df5e26d050322aa85bd16cbf66ddb99c27c7b6bae
def lon360to180(lon): '\n\tConverts longitude values in the range [0,360]\n\tto longitude values in the range [-180,+180].\n\t' lon = np.asanyarray(lon) return (((lon + 180.0) % 360.0) - 180.0)
Converts longitude values in the range [0,360] to longitude values in the range [-180,+180].
calc_deriv/201e-calc_vortbdgt_daily.py
lon360to180
apaloczy/AntarcticaVorticityBudget
1
python
def lon360to180(lon): '\n\tConverts longitude values in the range [0,360]\n\tto longitude values in the range [-180,+180].\n\t' lon = np.asanyarray(lon) return (((lon + 180.0) % 360.0) - 180.0)
def lon360to180(lon): '\n\tConverts longitude values in the range [0,360]\n\tto longitude values in the range [-180,+180].\n\t' lon = np.asanyarray(lon) return (((lon + 180.0) % 360.0) - 180.0)<|docstring|>Converts longitude values in the range [0,360] to longitude values in the range [-180,+180].<|endoftex...
b817905d83e8a82d5d83302fac332f78b077bd5d64f357914ceb2ede15c79a0f
def test_post_now_application_nda_happy_path(self, test_client, db_session, auth_headers): 'Should return a new NoW NDA' mine = MineFactory() APPLICATION_NDA_DATA['minenumber'] = mine.mine_no post_resp = test_client.post('/now-submissions/applications-nda', json=APPLICATION_NDA_DATA, headers=auth_header...
Should return a new NoW NDA
services/core-api/tests/now_submissions/resources/test_application_nda_list_resource.py
test_post_now_application_nda_happy_path
bcgov/mds
25
python
def test_post_now_application_nda_happy_path(self, test_client, db_session, auth_headers): mine = MineFactory() APPLICATION_NDA_DATA['minenumber'] = mine.mine_no post_resp = test_client.post('/now-submissions/applications-nda', json=APPLICATION_NDA_DATA, headers=auth_headers['nros_vfcbc_auth_header']) ...
def test_post_now_application_nda_happy_path(self, test_client, db_session, auth_headers): mine = MineFactory() APPLICATION_NDA_DATA['minenumber'] = mine.mine_no post_resp = test_client.post('/now-submissions/applications-nda', json=APPLICATION_NDA_DATA, headers=auth_headers['nros_vfcbc_auth_header']) ...
965c4647735b377c138271416df52f8586dbbe80b5a2df9ac302e80ea6a2e1b4
def test_post_now_application_messageid_in_use(self, test_client, db_session, auth_headers): 'Should return a 400 messageid in use for NDA' mine = MineFactory() application = NOWApplicationNDAFactory(mine=mine) APPLICATION_NDA_DATA['minenumber'] = mine.mine_no APPLICATION_NDA_DATA['messageid'] = app...
Should return a 400 messageid in use for NDA
services/core-api/tests/now_submissions/resources/test_application_nda_list_resource.py
test_post_now_application_messageid_in_use
bcgov/mds
25
python
def test_post_now_application_messageid_in_use(self, test_client, db_session, auth_headers): mine = MineFactory() application = NOWApplicationNDAFactory(mine=mine) APPLICATION_NDA_DATA['minenumber'] = mine.mine_no APPLICATION_NDA_DATA['messageid'] = application.messageid post_resp = test_client...
def test_post_now_application_messageid_in_use(self, test_client, db_session, auth_headers): mine = MineFactory() application = NOWApplicationNDAFactory(mine=mine) APPLICATION_NDA_DATA['minenumber'] = mine.mine_no APPLICATION_NDA_DATA['messageid'] = application.messageid post_resp = test_client...
73f8caae406c9505f1728f318bb0c74924ce1e00fbe73e1350d38e9a94626086
def test_post_now_application_no_mine_found(self, test_client, db_session, auth_headers): 'Should return a 400 mine not found for NDA' APPLICATION_NDA_DATA['minenumber'] = '1234567' post_resp = test_client.post('/now-submissions/applications-nda', json=APPLICATION_NDA_DATA, headers=auth_headers['nros_vfcbc_...
Should return a 400 mine not found for NDA
services/core-api/tests/now_submissions/resources/test_application_nda_list_resource.py
test_post_now_application_no_mine_found
bcgov/mds
25
python
def test_post_now_application_no_mine_found(self, test_client, db_session, auth_headers): APPLICATION_NDA_DATA['minenumber'] = '1234567' post_resp = test_client.post('/now-submissions/applications-nda', json=APPLICATION_NDA_DATA, headers=auth_headers['nros_vfcbc_auth_header']) assert (post_resp.status_...
def test_post_now_application_no_mine_found(self, test_client, db_session, auth_headers): APPLICATION_NDA_DATA['minenumber'] = '1234567' post_resp = test_client.post('/now-submissions/applications-nda', json=APPLICATION_NDA_DATA, headers=auth_headers['nros_vfcbc_auth_header']) assert (post_resp.status_...
17d509abfd8a4c010cb47859d3c55d7e544f55ccdac5a7a1b03841fb3c5602c5
def minMutation(self, start, end, bank): '\n :type start: str\n :type end: str\n :type bank: List[str]\n :rtype: int\n ' if ((len(start) < 1) or (len(end) < 1) or (len(bank) < 1) or (not (end in bank))): return (- 1) queue = [] queue.append((start, 0)) bank...
:type start: str :type end: str :type bank: List[str] :rtype: int
solutions/0433_MinimumGeneticMutation.py
minMutation
alexwawl/leetcode-solutions-javascript-python
11
python
def minMutation(self, start, end, bank): '\n :type start: str\n :type end: str\n :type bank: List[str]\n :rtype: int\n ' if ((len(start) < 1) or (len(end) < 1) or (len(bank) < 1) or (not (end in bank))): return (- 1) queue = [] queue.append((start, 0)) bank...
def minMutation(self, start, end, bank): '\n :type start: str\n :type end: str\n :type bank: List[str]\n :rtype: int\n ' if ((len(start) < 1) or (len(end) < 1) or (len(bank) < 1) or (not (end in bank))): return (- 1) queue = [] queue.append((start, 0)) bank...
66fbb5470b02a119e48d610656138fa9cc8b8874ab07b56e304947b65471f09c
def __init__(__self__, *, endpoint: str, name: str): '\n :param str endpoint: Specifies the endpoint of the action.\n :param str name: Specifies the name of the action.\n ' pulumi.set(__self__, 'endpoint', endpoint) pulumi.set(__self__, 'name', name)
:param str endpoint: Specifies the endpoint of the action. :param str name: Specifies the name of the action.
sdk/python/pulumi_azure/core/outputs.py
__init__
suresh198526/pulumi-azure
0
python
def __init__(__self__, *, endpoint: str, name: str): '\n :param str endpoint: Specifies the endpoint of the action.\n :param str name: Specifies the name of the action.\n ' pulumi.set(__self__, 'endpoint', endpoint) pulumi.set(__self__, 'name', name)
def __init__(__self__, *, endpoint: str, name: str): '\n :param str endpoint: Specifies the endpoint of the action.\n :param str name: Specifies the name of the action.\n ' pulumi.set(__self__, 'endpoint', endpoint) pulumi.set(__self__, 'name', name)<|docstring|>:param str endpoint: Spe...
5a5a08451321bd197fa93441b4f1c9585a3cb16c8d43c14ad57d79c1cc637afa
@property @pulumi.getter def endpoint(self) -> str: '\n Specifies the endpoint of the action.\n ' return pulumi.get(self, 'endpoint')
Specifies the endpoint of the action.
sdk/python/pulumi_azure/core/outputs.py
endpoint
suresh198526/pulumi-azure
0
python
@property @pulumi.getter def endpoint(self) -> str: '\n \n ' return pulumi.get(self, 'endpoint')
@property @pulumi.getter def endpoint(self) -> str: '\n \n ' return pulumi.get(self, 'endpoint')<|docstring|>Specifies the endpoint of the action.<|endoftext|>
b82bd907534ea5da88886ddb936d3d4816d562083a26e0ea6ef048fbcab3588e
@property @pulumi.getter def name(self) -> str: '\n Specifies the name of the action.\n ' return pulumi.get(self, 'name')
Specifies the name of the action.
sdk/python/pulumi_azure/core/outputs.py
name
suresh198526/pulumi-azure
0
python
@property @pulumi.getter def name(self) -> str: '\n \n ' return pulumi.get(self, 'name')
@property @pulumi.getter def name(self) -> str: '\n \n ' return pulumi.get(self, 'name')<|docstring|>Specifies the name of the action.<|endoftext|>
b466b6028bb8715d03acb93b8f0c7947eb5d997b6217517035af4c4399af3ac8
def __init__(__self__, *, endpoint: str, name: str, routing_type: Optional[str]=None): '\n :param str endpoint: Specifies the endpoint of the route definition.\n :param str name: Specifies the name of the route definition.\n :param str routing_type: The routing type that is supported for the re...
:param str endpoint: Specifies the endpoint of the route definition. :param str name: Specifies the name of the route definition. :param str routing_type: The routing type that is supported for the resource request. Valid values are `ResourceTypeRoutingProxy` or `ResourceTypeRoutingProxyCache`. This value defaults to `...
sdk/python/pulumi_azure/core/outputs.py
__init__
suresh198526/pulumi-azure
0
python
def __init__(__self__, *, endpoint: str, name: str, routing_type: Optional[str]=None): '\n :param str endpoint: Specifies the endpoint of the route definition.\n :param str name: Specifies the name of the route definition.\n :param str routing_type: The routing type that is supported for the re...
def __init__(__self__, *, endpoint: str, name: str, routing_type: Optional[str]=None): '\n :param str endpoint: Specifies the endpoint of the route definition.\n :param str name: Specifies the name of the route definition.\n :param str routing_type: The routing type that is supported for the re...
d1c203303027ff73f781fb0b8325df8cae3d8995a3ba4a43ab36de60cee18c8e
@property @pulumi.getter def endpoint(self) -> str: '\n Specifies the endpoint of the route definition.\n ' return pulumi.get(self, 'endpoint')
Specifies the endpoint of the route definition.
sdk/python/pulumi_azure/core/outputs.py
endpoint
suresh198526/pulumi-azure
0
python
@property @pulumi.getter def endpoint(self) -> str: '\n \n ' return pulumi.get(self, 'endpoint')
@property @pulumi.getter def endpoint(self) -> str: '\n \n ' return pulumi.get(self, 'endpoint')<|docstring|>Specifies the endpoint of the route definition.<|endoftext|>
6ec4fb712825d1316db353cbb5b59ad2e4ff9b712a4ca0eaacac8a150c8b666f
@property @pulumi.getter def name(self) -> str: '\n Specifies the name of the route definition.\n ' return pulumi.get(self, 'name')
Specifies the name of the route definition.
sdk/python/pulumi_azure/core/outputs.py
name
suresh198526/pulumi-azure
0
python
@property @pulumi.getter def name(self) -> str: '\n \n ' return pulumi.get(self, 'name')
@property @pulumi.getter def name(self) -> str: '\n \n ' return pulumi.get(self, 'name')<|docstring|>Specifies the name of the route definition.<|endoftext|>
94d7185fe5f40f1cdfe53a1c51f9c5539c0b50bf1778bab5b3e0de4e0fa78625
@property @pulumi.getter(name='routingType') def routing_type(self) -> Optional[str]: '\n The routing type that is supported for the resource request. Valid values are `ResourceTypeRoutingProxy` or `ResourceTypeRoutingProxyCache`. This value defaults to `ResourceTypeRoutingProxy`.\n ' return pulum...
The routing type that is supported for the resource request. Valid values are `ResourceTypeRoutingProxy` or `ResourceTypeRoutingProxyCache`. This value defaults to `ResourceTypeRoutingProxy`.
sdk/python/pulumi_azure/core/outputs.py
routing_type
suresh198526/pulumi-azure
0
python
@property @pulumi.getter(name='routingType') def routing_type(self) -> Optional[str]: '\n \n ' return pulumi.get(self, 'routing_type')
@property @pulumi.getter(name='routingType') def routing_type(self) -> Optional[str]: '\n \n ' return pulumi.get(self, 'routing_type')<|docstring|>The routing type that is supported for the resource request. Valid values are `ResourceTypeRoutingProxy` or `ResourceTypeRoutingProxyCache`. This value...
18cfd879e84778ba2c986f4f093f7b49bec1e296747a1819a30d981d2ed97bc3
def __init__(__self__, *, specification: str): '\n :param str specification: The endpoint where the validation specification is located.\n ' pulumi.set(__self__, 'specification', specification)
:param str specification: The endpoint where the validation specification is located.
sdk/python/pulumi_azure/core/outputs.py
__init__
suresh198526/pulumi-azure
0
python
def __init__(__self__, *, specification: str): '\n \n ' pulumi.set(__self__, 'specification', specification)
def __init__(__self__, *, specification: str): '\n \n ' pulumi.set(__self__, 'specification', specification)<|docstring|>:param str specification: The endpoint where the validation specification is located.<|endoftext|>
db11e8718f7a1d1d2839cbaf59153ad2a04895e3a2ae79e13ccebebf95700bc7
@property @pulumi.getter def specification(self) -> str: '\n The endpoint where the validation specification is located.\n ' return pulumi.get(self, 'specification')
The endpoint where the validation specification is located.
sdk/python/pulumi_azure/core/outputs.py
specification
suresh198526/pulumi-azure
0
python
@property @pulumi.getter def specification(self) -> str: '\n \n ' return pulumi.get(self, 'specification')
@property @pulumi.getter def specification(self) -> str: '\n \n ' return pulumi.get(self, 'specification')<|docstring|>The endpoint where the validation specification is located.<|endoftext|>
82c041f5be5d9a830a5e3eae2a9095bbc23958f72d90d1117d2908b067f74d24
def __init__(__self__, *, id: str, location: str, name: str, tags: Mapping[(str, str)], type: str): '\n :param str id: The ID of this Resource.\n :param str location: The Azure Region in which this Resource exists.\n :param str name: The name of the Resource.\n :param Mapping[str, str] t...
:param str id: The ID of this Resource. :param str location: The Azure Region in which this Resource exists. :param str name: The name of the Resource. :param Mapping[str, str] tags: A map of tags assigned to this Resource. :param str type: The Resource Type of the Resources you want to list (e.g. `Microsoft.Network/vi...
sdk/python/pulumi_azure/core/outputs.py
__init__
suresh198526/pulumi-azure
0
python
def __init__(__self__, *, id: str, location: str, name: str, tags: Mapping[(str, str)], type: str): '\n :param str id: The ID of this Resource.\n :param str location: The Azure Region in which this Resource exists.\n :param str name: The name of the Resource.\n :param Mapping[str, str] t...
def __init__(__self__, *, id: str, location: str, name: str, tags: Mapping[(str, str)], type: str): '\n :param str id: The ID of this Resource.\n :param str location: The Azure Region in which this Resource exists.\n :param str name: The name of the Resource.\n :param Mapping[str, str] t...
6dfb29f8cbddc3b05598b0e1f884b1e8469c08070a4e2b6ec31c0e5f5e0b7372
@property @pulumi.getter def id(self) -> str: '\n The ID of this Resource.\n ' return pulumi.get(self, 'id')
The ID of this Resource.
sdk/python/pulumi_azure/core/outputs.py
id
suresh198526/pulumi-azure
0
python
@property @pulumi.getter def id(self) -> str: '\n \n ' return pulumi.get(self, 'id')
@property @pulumi.getter def id(self) -> str: '\n \n ' return pulumi.get(self, 'id')<|docstring|>The ID of this Resource.<|endoftext|>
1834d17ce1d3a6f83ffcb95ecbcc063494db1f45806c980d1dfdeca998790183
@property @pulumi.getter def location(self) -> str: '\n The Azure Region in which this Resource exists.\n ' return pulumi.get(self, 'location')
The Azure Region in which this Resource exists.
sdk/python/pulumi_azure/core/outputs.py
location
suresh198526/pulumi-azure
0
python
@property @pulumi.getter def location(self) -> str: '\n \n ' return pulumi.get(self, 'location')
@property @pulumi.getter def location(self) -> str: '\n \n ' return pulumi.get(self, 'location')<|docstring|>The Azure Region in which this Resource exists.<|endoftext|>
ae4134ad03102542e3e8617953e789d012fc31a9a10f8f8273c04f8a3bec9985
@property @pulumi.getter def name(self) -> str: '\n The name of the Resource.\n ' return pulumi.get(self, 'name')
The name of the Resource.
sdk/python/pulumi_azure/core/outputs.py
name
suresh198526/pulumi-azure
0
python
@property @pulumi.getter def name(self) -> str: '\n \n ' return pulumi.get(self, 'name')
@property @pulumi.getter def name(self) -> str: '\n \n ' return pulumi.get(self, 'name')<|docstring|>The name of the Resource.<|endoftext|>
8c00abb590634528ba691e4e25844180fd0b3a84cbb82283654ba001b9ef1c0e
@property @pulumi.getter def tags(self) -> Mapping[(str, str)]: '\n A map of tags assigned to this Resource.\n ' return pulumi.get(self, 'tags')
A map of tags assigned to this Resource.
sdk/python/pulumi_azure/core/outputs.py
tags
suresh198526/pulumi-azure
0
python
@property @pulumi.getter def tags(self) -> Mapping[(str, str)]: '\n \n ' return pulumi.get(self, 'tags')
@property @pulumi.getter def tags(self) -> Mapping[(str, str)]: '\n \n ' return pulumi.get(self, 'tags')<|docstring|>A map of tags assigned to this Resource.<|endoftext|>
0e7e73d12011bc9cb6972cb017ea8c537e7141d912019a508a688f09fc160f9b
@property @pulumi.getter def type(self) -> str: '\n The Resource Type of the Resources you want to list (e.g. `Microsoft.Network/virtualNetworks`). A full list of available Resource Types can be found [here](https://docs.microsoft.com/en-us/azure/azure-resource-manager/azure-services-resource-providers).\n ...
The Resource Type of the Resources you want to list (e.g. `Microsoft.Network/virtualNetworks`). A full list of available Resource Types can be found [here](https://docs.microsoft.com/en-us/azure/azure-resource-manager/azure-services-resource-providers).
sdk/python/pulumi_azure/core/outputs.py
type
suresh198526/pulumi-azure
0
python
@property @pulumi.getter def type(self) -> str: '\n \n ' return pulumi.get(self, 'type')
@property @pulumi.getter def type(self) -> str: '\n \n ' return pulumi.get(self, 'type')<|docstring|>The Resource Type of the Resources you want to list (e.g. `Microsoft.Network/virtualNetworks`). A full list of available Resource Types can be found [here](https://docs.microsoft.com/en-us/azure/az...
0ad40ffb6c17ddd502c137f7ec7d505c0b5f5f7953870b8c9abd70d30552bdf6
def __init__(__self__, *, display_name: str, location_placement_id: str, quota_id: str, spending_limit: str, state: str, subscription_id: str, tenant_id: str): '\n :param str display_name: The subscription display name.\n :param str location_placement_id: The subscription location placement ID.\n ...
:param str display_name: The subscription display name. :param str location_placement_id: The subscription location placement ID. :param str quota_id: The subscription quota ID. :param str spending_limit: The subscription spending limit. :param str state: The subscription state. Possible values are Enabled, Warned, Pas...
sdk/python/pulumi_azure/core/outputs.py
__init__
suresh198526/pulumi-azure
0
python
def __init__(__self__, *, display_name: str, location_placement_id: str, quota_id: str, spending_limit: str, state: str, subscription_id: str, tenant_id: str): '\n :param str display_name: The subscription display name.\n :param str location_placement_id: The subscription location placement ID.\n ...
def __init__(__self__, *, display_name: str, location_placement_id: str, quota_id: str, spending_limit: str, state: str, subscription_id: str, tenant_id: str): '\n :param str display_name: The subscription display name.\n :param str location_placement_id: The subscription location placement ID.\n ...
6167b089fc26e32a33c4e49b58d082d31fe2ebc0b687d6e9855cd842adf4ad03
@property @pulumi.getter(name='displayName') def display_name(self) -> str: '\n The subscription display name.\n ' return pulumi.get(self, 'display_name')
The subscription display name.
sdk/python/pulumi_azure/core/outputs.py
display_name
suresh198526/pulumi-azure
0
python
@property @pulumi.getter(name='displayName') def display_name(self) -> str: '\n \n ' return pulumi.get(self, 'display_name')
@property @pulumi.getter(name='displayName') def display_name(self) -> str: '\n \n ' return pulumi.get(self, 'display_name')<|docstring|>The subscription display name.<|endoftext|>
890a666c2af921e269e7df1917521c2ea09bafd983df0d88a20cfe9b6aebdbfb
@property @pulumi.getter(name='locationPlacementId') def location_placement_id(self) -> str: '\n The subscription location placement ID.\n ' return pulumi.get(self, 'location_placement_id')
The subscription location placement ID.
sdk/python/pulumi_azure/core/outputs.py
location_placement_id
suresh198526/pulumi-azure
0
python
@property @pulumi.getter(name='locationPlacementId') def location_placement_id(self) -> str: '\n \n ' return pulumi.get(self, 'location_placement_id')
@property @pulumi.getter(name='locationPlacementId') def location_placement_id(self) -> str: '\n \n ' return pulumi.get(self, 'location_placement_id')<|docstring|>The subscription location placement ID.<|endoftext|>
cb7a9fbfe34078649b021cd2a5c2f68265529b204603ffd9f6890b9dc942e129
@property @pulumi.getter(name='quotaId') def quota_id(self) -> str: '\n The subscription quota ID.\n ' return pulumi.get(self, 'quota_id')
The subscription quota ID.
sdk/python/pulumi_azure/core/outputs.py
quota_id
suresh198526/pulumi-azure
0
python
@property @pulumi.getter(name='quotaId') def quota_id(self) -> str: '\n \n ' return pulumi.get(self, 'quota_id')
@property @pulumi.getter(name='quotaId') def quota_id(self) -> str: '\n \n ' return pulumi.get(self, 'quota_id')<|docstring|>The subscription quota ID.<|endoftext|>
0ee8b1fa3641bff0ff52034e073b4fee89ebffabbfaf1feefcedae50973bdfbc
@property @pulumi.getter(name='spendingLimit') def spending_limit(self) -> str: '\n The subscription spending limit.\n ' return pulumi.get(self, 'spending_limit')
The subscription spending limit.
sdk/python/pulumi_azure/core/outputs.py
spending_limit
suresh198526/pulumi-azure
0
python
@property @pulumi.getter(name='spendingLimit') def spending_limit(self) -> str: '\n \n ' return pulumi.get(self, 'spending_limit')
@property @pulumi.getter(name='spendingLimit') def spending_limit(self) -> str: '\n \n ' return pulumi.get(self, 'spending_limit')<|docstring|>The subscription spending limit.<|endoftext|>
4479ab8edb8d8cbfdea39e3206640c5ef0d794cbd9d05ac5f6c340966a3fcd4e
@property @pulumi.getter def state(self) -> str: '\n The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.\n ' return pulumi.get(self, 'state')
The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.
sdk/python/pulumi_azure/core/outputs.py
state
suresh198526/pulumi-azure
0
python
@property @pulumi.getter def state(self) -> str: '\n \n ' return pulumi.get(self, 'state')
@property @pulumi.getter def state(self) -> str: '\n \n ' return pulumi.get(self, 'state')<|docstring|>The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.<|endoftext|>
458075aefcdf493f661e2d1848e2d1483f9ec9ca6f8316dddd656bead9588fc8
@property @pulumi.getter(name='subscriptionId') def subscription_id(self) -> str: '\n The subscription GUID.\n ' return pulumi.get(self, 'subscription_id')
The subscription GUID.
sdk/python/pulumi_azure/core/outputs.py
subscription_id
suresh198526/pulumi-azure
0
python
@property @pulumi.getter(name='subscriptionId') def subscription_id(self) -> str: '\n \n ' return pulumi.get(self, 'subscription_id')
@property @pulumi.getter(name='subscriptionId') def subscription_id(self) -> str: '\n \n ' return pulumi.get(self, 'subscription_id')<|docstring|>The subscription GUID.<|endoftext|>
368362b34c317b35c366779ea4126012de0ac469bf6ee47bb4bc69bd73fe3c8e
@property @pulumi.getter(name='tenantId') def tenant_id(self) -> str: '\n The subscription tenant ID.\n ' return pulumi.get(self, 'tenant_id')
The subscription tenant ID.
sdk/python/pulumi_azure/core/outputs.py
tenant_id
suresh198526/pulumi-azure
0
python
@property @pulumi.getter(name='tenantId') def tenant_id(self) -> str: '\n \n ' return pulumi.get(self, 'tenant_id')
@property @pulumi.getter(name='tenantId') def tenant_id(self) -> str: '\n \n ' return pulumi.get(self, 'tenant_id')<|docstring|>The subscription tenant ID.<|endoftext|>
824f4f35619c6b82972bdb044f69deb9f22862f47dfc841ef116f22437883823
def RoadnetPa(directed: bool=False, verbose: int=2, cache_path: str='graphs/networkrepository', **additional_graph_kwargs: Dict) -> EnsmallenGraph: 'Return new instance of the roadNet-PA graph.\n\n The graph is automatically retrieved from the NetworkRepository repository. \n\n\t\n\n Parameters\n ---------...
Return new instance of the roadNet-PA graph. The graph is automatically retrieved from the NetworkRepository repository. Parameters ------------------- directed: bool = False, Wether to load the graph as directed or undirected. By default false. verbose: int = 2, Wether to show loading bars during ...
bindings/python/ensmallen_graph/datasets/networkrepository/roadnetpa.py
RoadnetPa
caufieldjh/ensmallen_graph
0
python
def RoadnetPa(directed: bool=False, verbose: int=2, cache_path: str='graphs/networkrepository', **additional_graph_kwargs: Dict) -> EnsmallenGraph: 'Return new instance of the roadNet-PA graph.\n\n The graph is automatically retrieved from the NetworkRepository repository. \n\n\t\n\n Parameters\n ---------...
def RoadnetPa(directed: bool=False, verbose: int=2, cache_path: str='graphs/networkrepository', **additional_graph_kwargs: Dict) -> EnsmallenGraph: 'Return new instance of the roadNet-PA graph.\n\n The graph is automatically retrieved from the NetworkRepository repository. \n\n\t\n\n Parameters\n ---------...
ed1f588a9117a99ce4783e5a70e015a7f89ea47c3d1a09b164428d394024c7d6
def model_resnet50_keras(input_shape: tuple, classes: int, include_top=True, weights='imagenet') -> keras.Model: '\n Keras Applicationsに用意されているResNet50を読み込む。\n\n Deep Residual Learning for Image Recognition\n Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\n https://arxiv.org/abs/1512.03385\n\n Arg...
Keras Applicationsに用意されているResNet50を読み込む。 Deep Residual Learning for Image Recognition Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun https://arxiv.org/abs/1512.03385 Args: input_shape tuple: 入力の形状を指定する。 num_classes int: 分類するクラス数を指定する。 Returns: keras.Model: ResNet50を返す。
models/resnet50.py
model_resnet50_keras
sugaok/my-deep-learning-base
1
python
def model_resnet50_keras(input_shape: tuple, classes: int, include_top=True, weights='imagenet') -> keras.Model: '\n Keras Applicationsに用意されているResNet50を読み込む。\n\n Deep Residual Learning for Image Recognition\n Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\n https://arxiv.org/abs/1512.03385\n\n Arg...
def model_resnet50_keras(input_shape: tuple, classes: int, include_top=True, weights='imagenet') -> keras.Model: '\n Keras Applicationsに用意されているResNet50を読み込む。\n\n Deep Residual Learning for Image Recognition\n Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\n https://arxiv.org/abs/1512.03385\n\n Arg...
d558c7449849fec455c88a665440847b31e17a43f87d60b2e5c5bb7453752001
def model_resnet50(input_shape: tuple, classes: int) -> keras.Model: '\n ResNet50を読み込む。\n\n Deep Residual Learning for Image Recognition\n Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\n https://arxiv.org/abs/1512.03385\n\n Args:\n input_shape tuple:\n 入力の形状を指定する。\n num_c...
ResNet50を読み込む。 Deep Residual Learning for Image Recognition Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun https://arxiv.org/abs/1512.03385 Args: input_shape tuple: 入力の形状を指定する。 num_classes int: 分類するクラス数を指定する。 Returns: keras.Model: ResNet50を返す。
models/resnet50.py
model_resnet50
sugaok/my-deep-learning-base
1
python
def model_resnet50(input_shape: tuple, classes: int) -> keras.Model: '\n ResNet50を読み込む。\n\n Deep Residual Learning for Image Recognition\n Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\n https://arxiv.org/abs/1512.03385\n\n Args:\n input_shape tuple:\n 入力の形状を指定する。\n num_c...
def model_resnet50(input_shape: tuple, classes: int) -> keras.Model: '\n ResNet50を読み込む。\n\n Deep Residual Learning for Image Recognition\n Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\n https://arxiv.org/abs/1512.03385\n\n Args:\n input_shape tuple:\n 入力の形状を指定する。\n num_c...
cc09e176516213f63e22aa96c51173f4d0c4d0f2f7ba026ec27ba3e5832cab66
def get_single_run_config(out_dir): 'Load the config file from a specified experiment.\n\n Args:\n out_dir (str): The path to the experiment.\n\n Returns:\n The Namespace object containing argument names and values.\n ' print(('Loading the configuration of run: %s' % out_dir)) if (not...
Load the config file from a specified experiment. Args: out_dir (str): The path to the experiment. Returns: The Namespace object containing argument names and values.
hypnettorch/hpsearch/gather_random_seeds.py
get_single_run_config
pennfranc/hypnettorch
31
python
def get_single_run_config(out_dir): 'Load the config file from a specified experiment.\n\n Args:\n out_dir (str): The path to the experiment.\n\n Returns:\n The Namespace object containing argument names and values.\n ' print(('Loading the configuration of run: %s' % out_dir)) if (not...
def get_single_run_config(out_dir): 'Load the config file from a specified experiment.\n\n Args:\n out_dir (str): The path to the experiment.\n\n Returns:\n The Namespace object containing argument names and values.\n ' print(('Loading the configuration of run: %s' % out_dir)) if (not...
3647241f3893a7fc6ba9b5c6e9bf0e4bf70b17d7a65f8f9e2a9b4b9973f623ae
def get_best_hpsearch_config(out_dir): 'Load the config file from the best run of a hyperparameter search.\n\n This file loads the results of the hyperparameter search, and select the\n configuration that lead to the best performance score.\n\n Args:\n out_dir (str): The path to the hpsearch result ...
Load the config file from the best run of a hyperparameter search. This file loads the results of the hyperparameter search, and select the configuration that lead to the best performance score. Args: out_dir (str): The path to the hpsearch result folder. Returns: (tuple): Tuple containing: - **config**...
hypnettorch/hpsearch/gather_random_seeds.py
get_best_hpsearch_config
pennfranc/hypnettorch
31
python
def get_best_hpsearch_config(out_dir): 'Load the config file from the best run of a hyperparameter search.\n\n This file loads the results of the hyperparameter search, and select the\n configuration that lead to the best performance score.\n\n Args:\n out_dir (str): The path to the hpsearch result ...
def get_best_hpsearch_config(out_dir): 'Load the config file from the best run of a hyperparameter search.\n\n This file loads the results of the hyperparameter search, and select the\n configuration that lead to the best performance score.\n\n Args:\n out_dir (str): The path to the hpsearch result ...
bed1c12c4f6db9806efcb8fd5f621a3693e11b23ce04e289b488c9b3234d5dbc
def build_grid_and_conditions(cmd_args, config, seeds_list): 'Build the hpconfig for the random seed gathering.\n\n Args:\n cmd_args: CLI arguments of this script.\n config: The config to be translated into a search grid.\n seeds_list (list): The random seeds to be gathered.\n\n (tuple): ...
Build the hpconfig for the random seed gathering. Args: cmd_args: CLI arguments of this script. config: The config to be translated into a search grid. seeds_list (list): The random seeds to be gathered. (tuple): Tuple containing: - **grid** (dict): The search grid. - **conditions** (list): Const...
hypnettorch/hpsearch/gather_random_seeds.py
build_grid_and_conditions
pennfranc/hypnettorch
31
python
def build_grid_and_conditions(cmd_args, config, seeds_list): 'Build the hpconfig for the random seed gathering.\n\n Args:\n cmd_args: CLI arguments of this script.\n config: The config to be translated into a search grid.\n seeds_list (list): The random seeds to be gathered.\n\n (tuple): ...
def build_grid_and_conditions(cmd_args, config, seeds_list): 'Build the hpconfig for the random seed gathering.\n\n Args:\n cmd_args: CLI arguments of this script.\n config: The config to be translated into a search grid.\n seeds_list (list): The random seeds to be gathered.\n\n (tuple): ...
5d5bdd5e2d9be29522c2fb6601bf7436ce2134ca97750a5af7306eb479b388ee
def get_hpsearch_call(cmd_args, num_seeds, grid_config, hpsearch_dir=None): 'Generate the command line for the hpsearch.\n\n Args:\n cmd_args: The command line arguments.\n num_seeds (int): Number of searches.\n grid_config (str): Location of search grid.\n hpsearch_dir (str, optional...
Generate the command line for the hpsearch. Args: cmd_args: The command line arguments. num_seeds (int): Number of searches. grid_config (str): Location of search grid. hpsearch_dir (str, optional): Where the hpsearch should write its results to. Returns: (str): The command line to be exec...
hypnettorch/hpsearch/gather_random_seeds.py
get_hpsearch_call
pennfranc/hypnettorch
31
python
def get_hpsearch_call(cmd_args, num_seeds, grid_config, hpsearch_dir=None): 'Generate the command line for the hpsearch.\n\n Args:\n cmd_args: The command line arguments.\n num_seeds (int): Number of searches.\n grid_config (str): Location of search grid.\n hpsearch_dir (str, optional...
def get_hpsearch_call(cmd_args, num_seeds, grid_config, hpsearch_dir=None): 'Generate the command line for the hpsearch.\n\n Args:\n cmd_args: The command line arguments.\n num_seeds (int): Number of searches.\n grid_config (str): Location of search grid.\n hpsearch_dir (str, optional...
4ee53bf97b210b5ab754d4d724247207d0f3efd40582bd38a560eef54f306aa1
def write_seeds_summary(results_dir, summary_keys, summary_sem, summary_precs, ret_seeds=False, summary_fn=None, seeds_summary_fn='seeds_summary_text.txt'): 'Write the MEAN and STD (resp. SEM) while aggregating all seeds to text\n file.\n\n Args:\n results_dir (str): The results directory.\n sum...
Write the MEAN and STD (resp. SEM) while aggregating all seeds to text file. Args: results_dir (str): The results directory. summary_keys (list): See argument ``summary_keys`` of function :func:`run`. summary_sem (bool): See argument ``summary_sem`` of function :func:`run`. summary_prec...
hypnettorch/hpsearch/gather_random_seeds.py
write_seeds_summary
pennfranc/hypnettorch
31
python
def write_seeds_summary(results_dir, summary_keys, summary_sem, summary_precs, ret_seeds=False, summary_fn=None, seeds_summary_fn='seeds_summary_text.txt'): 'Write the MEAN and STD (resp. SEM) while aggregating all seeds to text\n file.\n\n Args:\n results_dir (str): The results directory.\n sum...
def write_seeds_summary(results_dir, summary_keys, summary_sem, summary_precs, ret_seeds=False, summary_fn=None, seeds_summary_fn='seeds_summary_text.txt'): 'Write the MEAN and STD (resp. SEM) while aggregating all seeds to text\n file.\n\n Args:\n results_dir (str): The results directory.\n sum...
f37708db3eaa56455a9d22f49dd274716b720fda2db47b735fe10f9dd363ddde
def run(grid_module=None, results_dir='./out/random_seeds', config=None, ignore_kwds=None, forced_params=None, summary_keys=None, summary_sem=False, summary_precs=None, hpmod_path=None): "Run the script.\n\n Args:\n grid_module (str, optional): Name of the reference module which contains\n the ...
Run the script. Args: grid_module (str, optional): Name of the reference module which contains the hyperparameter search config that can be modified to gather random seeds. results_dir (str, optional): The path where the hpsearch should store its results. config: The Namespace objec...
hypnettorch/hpsearch/gather_random_seeds.py
run
pennfranc/hypnettorch
31
python
def run(grid_module=None, results_dir='./out/random_seeds', config=None, ignore_kwds=None, forced_params=None, summary_keys=None, summary_sem=False, summary_precs=None, hpmod_path=None): "Run the script.\n\n Args:\n grid_module (str, optional): Name of the reference module which contains\n the ...
def run(grid_module=None, results_dir='./out/random_seeds', config=None, ignore_kwds=None, forced_params=None, summary_keys=None, summary_sem=False, summary_precs=None, hpmod_path=None): "Run the script.\n\n Args:\n grid_module (str, optional): Name of the reference module which contains\n the ...
f4246c08450ca6fe2daed8261fd4a9d9915e6b94503dd42663449788dbc5970d
def get_domains_to_update_es_filter(): "\n Returns ES filter to filter domains that are never updated or\n domains that haven't been updated since a week or domains that\n have been updated within last week but have new form submissions\n in the last day.\n " last_week = (datetime.utc...
Returns ES filter to filter domains that are never updated or domains that haven't been updated since a week or domains that have been updated within last week but have new form submissions in the last day.
corehq/apps/reports/tasks.py
get_domains_to_update_es_filter
kkrampa/commcare-hq
1
python
def get_domains_to_update_es_filter(): "\n Returns ES filter to filter domains that are never updated or\n domains that haven't been updated since a week or domains that\n have been updated within last week but have new form submissions\n in the last day.\n " last_week = (datetime.utc...
def get_domains_to_update_es_filter(): "\n Returns ES filter to filter domains that are never updated or\n domains that haven't been updated since a week or domains that\n have been updated within last week but have new form submissions\n in the last day.\n " last_week = (datetime.utc...
be391f733777f9ae0dd4e4955c5abde3f76bf1feb4babc675fc1c8082ca41bd3
def _get_export_properties(export_id): '\n Return a list of strings corresponding to form questions that are\n included in the export.\n ' properties = set() if export_id: from corehq.apps.export.models import FormExportInstance export = FormExportInstance.get(export_id) for...
Return a list of strings corresponding to form questions that are included in the export.
corehq/apps/reports/tasks.py
_get_export_properties
kkrampa/commcare-hq
1
python
def _get_export_properties(export_id): '\n Return a list of strings corresponding to form questions that are\n included in the export.\n ' properties = set() if export_id: from corehq.apps.export.models import FormExportInstance export = FormExportInstance.get(export_id) for...
def _get_export_properties(export_id): '\n Return a list of strings corresponding to form questions that are\n included in the export.\n ' properties = set() if export_id: from corehq.apps.export.models import FormExportInstance export = FormExportInstance.get(export_id) for...
ec2fe7c6668e3ffa633f4686b0a9a71cd5b08ab4dda34a3e887416ff15f92d73
def _extract_form_attachment_info(form, properties): '\n This is a helper function for build_form_multimedia_zip.\n Return a dict containing information about the given form and its relevant\n attachments\n ' def find_question_id(form, value): for (k, v) in six.iteritems(form): ...
This is a helper function for build_form_multimedia_zip. Return a dict containing information about the given form and its relevant attachments
corehq/apps/reports/tasks.py
_extract_form_attachment_info
kkrampa/commcare-hq
1
python
def _extract_form_attachment_info(form, properties): '\n This is a helper function for build_form_multimedia_zip.\n Return a dict containing information about the given form and its relevant\n attachments\n ' def find_question_id(form, value): for (k, v) in six.iteritems(form): ...
def _extract_form_attachment_info(form, properties): '\n This is a helper function for build_form_multimedia_zip.\n Return a dict containing information about the given form and its relevant\n attachments\n ' def find_question_id(form, value): for (k, v) in six.iteritems(form): ...
781d7c27232059dae25f9d95c09eb7fc35787735be1f2f950635659a167d65ba
def read_csv(filename): '\n\n Parameters\n ----------\n filename : str\n Path to the CSV file.\n\n Returns\n -------\n df_new : dataframe\n Normalised coordinates of 3D pose.\n\n ' dataframe = pd.read_csv(filename, index_col='Body Part') xmax = (- 10000) ymax = (- 1000...
Parameters ---------- filename : str Path to the CSV file. Returns ------- df_new : dataframe Normalised coordinates of 3D pose.
utils/create_blank_3d.py
read_csv
alisonrclarke/raga-pose-estimation-1
1
python
def read_csv(filename): '\n\n Parameters\n ----------\n filename : str\n Path to the CSV file.\n\n Returns\n -------\n df_new : dataframe\n Normalised coordinates of 3D pose.\n\n ' dataframe = pd.read_csv(filename, index_col='Body Part') xmax = (- 10000) ymax = (- 1000...
def read_csv(filename): '\n\n Parameters\n ----------\n filename : str\n Path to the CSV file.\n\n Returns\n -------\n df_new : dataframe\n Normalised coordinates of 3D pose.\n\n ' dataframe = pd.read_csv(filename, index_col='Body Part') xmax = (- 10000) ymax = (- 1000...
cf21f847fd6c089dc03aa470f49e7bc154155d85750c428f31319c061692bb64
def create_3d_video(output_path, df, parts=PARTS, skeleton=SKELETON_EDGES, output=True): '\n\n Parameters\n ----------\n output_path : str\n Path for the created video.\n df : dataframe\n 3D pose\n parts : list, optional\n The name of body parts. The default is PARTS.\n skelet...
Parameters ---------- output_path : str Path for the created video. df : dataframe 3D pose parts : list, optional The name of body parts. The default is PARTS. skeleton : narray, optional Indicating which two keypoints are connected. The default is SKELETON_EDGES. output : bool, optional True for st...
utils/create_blank_3d.py
create_3d_video
alisonrclarke/raga-pose-estimation-1
1
python
def create_3d_video(output_path, df, parts=PARTS, skeleton=SKELETON_EDGES, output=True): '\n\n Parameters\n ----------\n output_path : str\n Path for the created video.\n df : dataframe\n 3D pose\n parts : list, optional\n The name of body parts. The default is PARTS.\n skelet...
def create_3d_video(output_path, df, parts=PARTS, skeleton=SKELETON_EDGES, output=True): '\n\n Parameters\n ----------\n output_path : str\n Path for the created video.\n df : dataframe\n 3D pose\n parts : list, optional\n The name of body parts. The default is PARTS.\n skelet...
be5344ab918a97f12d47f11c8a705e418a5dc1a6aca20cf2eace2bc331b41bb1
def _read_in_raw_data(data_dir: str) -> Tuple[(DataFrame, DataFrame)]: 'Read in the raw water pump features and labels.\n\n Parameters\n ----------\n data_dir : str\n Path of the directory where `water_pump_features.csv` and\n `water_pump_labels.csv` can be found.\n\n Returns\n -------\...
Read in the raw water pump features and labels. Parameters ---------- data_dir : str Path of the directory where `water_pump_features.csv` and `water_pump_labels.csv` can be found. Returns ------- Tuple[DataFrame, DataFrame] DataFrames of the features and labels respectively.
src/data/dataset.py
_read_in_raw_data
amritpurshotam/mlops-example
0
python
def _read_in_raw_data(data_dir: str) -> Tuple[(DataFrame, DataFrame)]: 'Read in the raw water pump features and labels.\n\n Parameters\n ----------\n data_dir : str\n Path of the directory where `water_pump_features.csv` and\n `water_pump_labels.csv` can be found.\n\n Returns\n -------\...
def _read_in_raw_data(data_dir: str) -> Tuple[(DataFrame, DataFrame)]: 'Read in the raw water pump features and labels.\n\n Parameters\n ----------\n data_dir : str\n Path of the directory where `water_pump_features.csv` and\n `water_pump_labels.csv` can be found.\n\n Returns\n -------\...
817da33f6dc3a7652e253e2ec0501f838394d2bba1f64cca3509023b3b6dda83
def _align_features_and_labels(features: DataFrame, labels: DataFrame) -> Tuple[(DataFrame, DataFrame)]: "Align the `feature`s and `labels` DataFrames so they're both in the same order\n removing the need to check the `id` columns in each.\n\n Parameters\n ----------\n features : DataFrame\n Data...
Align the `feature`s and `labels` DataFrames so they're both in the same order removing the need to check the `id` columns in each. Parameters ---------- features : DataFrame DataFrame containing the `id` attribute. labels : DataFrame DataFrame containing the `id` attribute that corresponds to the `id` in ...
src/data/dataset.py
_align_features_and_labels
amritpurshotam/mlops-example
0
python
def _align_features_and_labels(features: DataFrame, labels: DataFrame) -> Tuple[(DataFrame, DataFrame)]: "Align the `feature`s and `labels` DataFrames so they're both in the same order\n removing the need to check the `id` columns in each.\n\n Parameters\n ----------\n features : DataFrame\n Data...
def _align_features_and_labels(features: DataFrame, labels: DataFrame) -> Tuple[(DataFrame, DataFrame)]: "Align the `feature`s and `labels` DataFrames so they're both in the same order\n removing the need to check the `id` columns in each.\n\n Parameters\n ----------\n features : DataFrame\n Data...
e9e0a5b65a0eec28e67d45df31da0b9bedb6f2e0f075b87e61d35d301d806e82
def _split(features: DataFrame, labels: DataFrame, random_state: int=42) -> Tuple[(DataFrame, DataFrame, DataFrame, DataFrame, DataFrame, DataFrame)]: 'Deterministic random 80/10/10 train/val/test split of the dataset stratified by\n the labels.\n\n Parameters\n ----------\n features : DataFrame\n\n ...
Deterministic random 80/10/10 train/val/test split of the dataset stratified by the labels. Parameters ---------- features : DataFrame labels : DataFrame Returns ------- Tuple[DataFrame, DataFrame, DataFrame, DataFrame] A tuple of four DataFrames corresponding to the training features, testing features, trai...
src/data/dataset.py
_split
amritpurshotam/mlops-example
0
python
def _split(features: DataFrame, labels: DataFrame, random_state: int=42) -> Tuple[(DataFrame, DataFrame, DataFrame, DataFrame, DataFrame, DataFrame)]: 'Deterministic random 80/10/10 train/val/test split of the dataset stratified by\n the labels.\n\n Parameters\n ----------\n features : DataFrame\n\n ...
def _split(features: DataFrame, labels: DataFrame, random_state: int=42) -> Tuple[(DataFrame, DataFrame, DataFrame, DataFrame, DataFrame, DataFrame)]: 'Deterministic random 80/10/10 train/val/test split of the dataset stratified by\n the labels.\n\n Parameters\n ----------\n features : DataFrame\n\n ...
546ee13fed348901d420beb9db19ca2e0ab84f411543c1c43de567a4606c493c
def load_dataset(data_dir: str) -> Tuple[(DataFrame, DataFrame, DataFrame, DataFrame, DataFrame, DataFrame)]: 'Read in the water pump dataset and split into the training and test sets.\n\n Parameters\n ----------\n data_dir : str\n Path of the directory where `water_pump_features.csv` and\n `...
Read in the water pump dataset and split into the training and test sets. Parameters ---------- data_dir : str Path of the directory where `water_pump_features.csv` and `water_pump_labels.csv` can be found. Returns ------- Tuple[DataFrame, DataFrame, DataFrame, DataFrame] A tuple of four DataFrames corres...
src/data/dataset.py
load_dataset
amritpurshotam/mlops-example
0
python
def load_dataset(data_dir: str) -> Tuple[(DataFrame, DataFrame, DataFrame, DataFrame, DataFrame, DataFrame)]: 'Read in the water pump dataset and split into the training and test sets.\n\n Parameters\n ----------\n data_dir : str\n Path of the directory where `water_pump_features.csv` and\n `...
def load_dataset(data_dir: str) -> Tuple[(DataFrame, DataFrame, DataFrame, DataFrame, DataFrame, DataFrame)]: 'Read in the water pump dataset and split into the training and test sets.\n\n Parameters\n ----------\n data_dir : str\n Path of the directory where `water_pump_features.csv` and\n `...
4da268fdbe9c63b87734d4510b4787fee8435875c315ea31520ad4b9cfd966de
def __init__(self, options): 'Constructor\n\n Args -\n options - The result of OptionParser which contains, as attributes, all the options for the running program.\n ' self.options = options
Constructor Args - options - The result of OptionParser which contains, as attributes, all the options for the running program.
testify/test_reporter.py
__init__
osarood/Testify
1
python
def __init__(self, options): 'Constructor\n\n Args -\n options - The result of OptionParser which contains, as attributes, all the options for the running program.\n ' self.options = options
def __init__(self, options): 'Constructor\n\n Args -\n options - The result of OptionParser which contains, as attributes, all the options for the running program.\n ' self.options = options<|docstring|>Constructor Args - options - The result of OptionParser which contains, as at...
27faa50a741dca4491aaa5fa883d9d9565c5a79135dfa8df1ee00976c6db1385
def test_counts(self, test_case_count, test_method_count): 'Called after discovery finishes. May not be called by all test runners, e.g. TestRunnerClient.' pass
Called after discovery finishes. May not be called by all test runners, e.g. TestRunnerClient.
testify/test_reporter.py
test_counts
osarood/Testify
1
python
def test_counts(self, test_case_count, test_method_count): pass
def test_counts(self, test_case_count, test_method_count): pass<|docstring|>Called after discovery finishes. May not be called by all test runners, e.g. TestRunnerClient.<|endoftext|>
60e39a6b259a988906f68b1de0aff06ef8860a253286e7df625fb31ae9390159
def test_start(self, result): 'Called when a test method is being run. Gets passed a TestResult dict which should not be complete.' pass
Called when a test method is being run. Gets passed a TestResult dict which should not be complete.
testify/test_reporter.py
test_start
osarood/Testify
1
python
def test_start(self, result): pass
def test_start(self, result): pass<|docstring|>Called when a test method is being run. Gets passed a TestResult dict which should not be complete.<|endoftext|>
1e86bd749a2113cb2f9f129271295bd92158abebc81a814f6124a04b1e6842fa
def test_complete(self, result): 'Called when a test method is complete. result is a TestResult dict which should be complete.' pass
Called when a test method is complete. result is a TestResult dict which should be complete.
testify/test_reporter.py
test_complete
osarood/Testify
1
python
def test_complete(self, result): pass
def test_complete(self, result): pass<|docstring|>Called when a test method is complete. result is a TestResult dict which should be complete.<|endoftext|>
598d94cede61f31b4983d1ac402a3dfee04530e3a72f6edeca10169433940ada
def test_discovery_failure(self, exc): 'Called when there was a failure during test discovery. exc is the exception object generated during the error.'
Called when there was a failure during test discovery. exc is the exception object generated during the error.
testify/test_reporter.py
test_discovery_failure
osarood/Testify
1
python
def test_discovery_failure(self, exc):
def test_discovery_failure(self, exc): <|docstring|>Called when there was a failure during test discovery. exc is the exception object generated during the error.<|endoftext|>
ef580bcb794087e4ef1d68c1ead6f4730a47d083e2796d829155d4dbc075f375
def class_setup_start(self, result): 'Called when a class_setup or the first half of a class_setup_teardown starts' pass
Called when a class_setup or the first half of a class_setup_teardown starts
testify/test_reporter.py
class_setup_start
osarood/Testify
1
python
def class_setup_start(self, result): pass
def class_setup_start(self, result): pass<|docstring|>Called when a class_setup or the first half of a class_setup_teardown starts<|endoftext|>
be9757e522dad5bc0d97ab659b097f294a945c307631e4cc60f7d7cec2dfd3a1
def class_setup_complete(self, result): 'Called when a class_setup or the first half of a class_setup_teardown finishes' pass
Called when a class_setup or the first half of a class_setup_teardown finishes
testify/test_reporter.py
class_setup_complete
osarood/Testify
1
python
def class_setup_complete(self, result): pass
def class_setup_complete(self, result): pass<|docstring|>Called when a class_setup or the first half of a class_setup_teardown finishes<|endoftext|>
b13993cbc2dac87e4a77f8f46bb4904b05ad5c96affe7891df7b71276f1b23fb
def class_teardown_start(self, result): 'Called when a class_teardown or the second half of a class_setup_teardown starts' pass
Called when a class_teardown or the second half of a class_setup_teardown starts
testify/test_reporter.py
class_teardown_start
osarood/Testify
1
python
def class_teardown_start(self, result): pass
def class_teardown_start(self, result): pass<|docstring|>Called when a class_teardown or the second half of a class_setup_teardown starts<|endoftext|>
b8769243139eb21f367fcf56641ffa963348c6ee59739328c945126a93dbbcdd
def class_teardown_complete(self, result): 'Called when a class_teardown or the second half of a class_setup_teardown finishes' pass
Called when a class_teardown or the second half of a class_setup_teardown finishes
testify/test_reporter.py
class_teardown_complete
osarood/Testify
1
python
def class_teardown_complete(self, result): pass
def class_teardown_complete(self, result): pass<|docstring|>Called when a class_teardown or the second half of a class_setup_teardown finishes<|endoftext|>
405ef5616bc14f45c089fafcb2b260cd0476646f85dfdfb1c91da92a4180c8cb
def test_case_start(self, result): 'Called when a test case is being run. Gets passed the special "run" method as a TestResult.' pass
Called when a test case is being run. Gets passed the special "run" method as a TestResult.
testify/test_reporter.py
test_case_start
osarood/Testify
1
python
def test_case_start(self, result): pass
def test_case_start(self, result): pass<|docstring|>Called when a test case is being run. Gets passed the special "run" method as a TestResult.<|endoftext|>
f1f622bc51f7ca932fff4ae5cf67c5ca3c4c4421d489740345cea21ea2072c9d
def test_case_complete(self, result): 'Called when a test case and all of its fixtures have been run.' pass
Called when a test case and all of its fixtures have been run.
testify/test_reporter.py
test_case_complete
osarood/Testify
1
python
def test_case_complete(self, result): pass
def test_case_complete(self, result): pass<|docstring|>Called when a test case and all of its fixtures have been run.<|endoftext|>
45fe5e328eb28c269bd948f1123006c9409c3bcb722d0a6e188d28dff32a575a
def report(self): 'Called at the end of the test run to report results\n\n Should return a bool to indicate if the reporter thinks the test run was successful\n ' return True
Called at the end of the test run to report results Should return a bool to indicate if the reporter thinks the test run was successful
testify/test_reporter.py
report
osarood/Testify
1
python
def report(self): 'Called at the end of the test run to report results\n\n Should return a bool to indicate if the reporter thinks the test run was successful\n ' return True
def report(self): 'Called at the end of the test run to report results\n\n Should return a bool to indicate if the reporter thinks the test run was successful\n ' return True<|docstring|>Called at the end of the test run to report results Should return a bool to indicate if the reporter thinks th...
6986547924c4b504463a555bf5f4f919765ba60da31b8ed95b5f52da9401448a
def html_fragment(source): '\n Parse an HTML string representing a single element, and return that element\n ' return BeautifulSoup(source, 'html.parser').contents[0]
Parse an HTML string representing a single element, and return that element
chirun/filter.py
html_fragment
sthagen/chirun-ncl-chirun
5
python
def html_fragment(source): '\n \n ' return BeautifulSoup(source, 'html.parser').contents[0]
def html_fragment(source): '\n \n ' return BeautifulSoup(source, 'html.parser').contents[0]<|docstring|>Parse an HTML string representing a single element, and return that element<|endoftext|>
32691050f1c4a0af72bfb7b250b57755c343758a2dae61d86eb039e362bb2fcf
def fix_local_links(soup, item): "\n Rewrite URLs relative to the top level, i.e. those starting with a /,\n to use the course's root URL or into paths relative to the item.\n " tags = {'a': ['href'], 'img': ['src'], 'source': ['src'], 'section': ['data-background', 'data-background-video']} ...
Rewrite URLs relative to the top level, i.e. those starting with a /, to use the course's root URL or into paths relative to the item.
chirun/filter.py
fix_local_links
sthagen/chirun-ncl-chirun
5
python
def fix_local_links(soup, item): "\n Rewrite URLs relative to the top level, i.e. those starting with a /,\n to use the course's root URL or into paths relative to the item.\n " tags = {'a': ['href'], 'img': ['src'], 'source': ['src'], 'section': ['data-background', 'data-background-video']} ...
def fix_local_links(soup, item): "\n Rewrite URLs relative to the top level, i.e. those starting with a /,\n to use the course's root URL or into paths relative to the item.\n " tags = {'a': ['href'], 'img': ['src'], 'source': ['src'], 'section': ['data-background', 'data-background-video']} ...