max_stars_repo_path string | max_stars_repo_name string | max_stars_count int64 | id string | content string | add_param_types int64 | add_return_types int64 | add_class_field_types int64 | add_instance_field_types int64 | add_total int64 | add_error int64 |
|---|---|---|---|---|---|---|---|---|---|---|
fb2__parsing/print_section_by_text_number_length.py | DazEB2/SimplePyScripts | 117 | 3341026 | <gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from bs4 import BeautifulSoup
from typing import Dict, Tuple
from collections import OrderedDict
def get_sections_as_dict(root) -> Tuple[Dict[str, dict], Dict[str, 'Section']]:
# Рекурсивная функция поиска <section>
d... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/concat_hdf5.py | alfred100p/VC-R-CNN | 344 | 3341071 | <reponame>alfred100p/VC-R-CNN<filename>tools/concat_hdf5.py<gh_stars>100-1000
import h5py
# You have how many hdf5 file
hdf5_num = 4
f = h5py.File("/data2/tingjia/wt/openimage/target_dir/coco/vc-feature/coco_train_all_vc_xy_10_100.hdf5", 'w')
for i in range(hdf5_num):
a = h5py.File("/data2/tingjia/wt/openi... | 0 | 0 | 0 | 0 | 0 | 0 |
observations/r/diamond.py | hajime9652/observations | 199 | 3341129 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def diamond(path) -> tuple[object, object]:
"""Pricing the C's of Diamond... | 0 | 1 | 0 | 0 | 1 | 0 |
lang-python/src/test/resources/testapp/foo/hello_world.py | nrs011/steady | 357 | 3341187 | <reponame>nrs011/steady<filename>lang-python/src/test/resources/testapp/foo/hello_world.py<gh_stars>100-1000
print('Hello world')
#print 'hello world'
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_runtime/test_hooks/test_simsiam_hook.py | mitming/mmselfsup | 355 | 3341227 | <filename>tests/test_runtime/test_hooks/test_simsiam_hook.py
# Copyright (c) OpenMMLab. All rights reserved.
import logging
import tempfile
from unittest.mock import MagicMock
import torch
import torch.nn as nn
from mmcv.parallel import MMDataParallel
from mmcv.runner import build_runner
from torch.utils.data import D... | 0 | 0 | 0 | 0 | 0 | 0 |
src/sage/cpython/__init__.py | UCD4IDS/sage | 1,742 | 3341234 | <gh_stars>1000+
# sage.cpython is an ordinary package, not a namespace package.
# This package is imported very early, which is why workarounds/monkey-patching
# are done in this file.
# Make sure that the correct zlib library is loaded. This is needed
# to prevent the system zlib to be loaded instead of the Sage one... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/storage/psql_dos/migrations/django_branch/test_0046_add_node_repository_metadata.py | mkrack/aiida-core | 153 | 3341279 | <filename>tests/storage/psql_dos/migrations/django_branch/test_0046_add_node_repository_metadata.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the... | 0 | 0 | 0 | 0 | 0 | 0 |
substra/sdk/fs.py | eliaskousk/substra | 119 | 3341331 | <reponame>eliaskousk/substra<gh_stars>100-1000
# Copyright 2018 Owkin, inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_setup_istio_mesh.py | akshaysharma096/paasta | 1,711 | 3341364 | <reponame>akshaysharma096/paasta
import mock
from paasta_tools.kubernetes_tools import registration_label
from paasta_tools.setup_istio_mesh import cleanup_paasta_namespace_services
from paasta_tools.setup_istio_mesh import sanitise_kubernetes_service_name
from paasta_tools.setup_istio_mesh import setup_istio_mesh
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
share/tools/ubi_reader/ubifs/nodes/extract.py | zengzhen1994k/leonsioy | 143 | 3341385 | <filename>share/tools/ubi_reader/ubifs/nodes/extract.py
#!/usr/bin/env python
#############################################################
# ubi_reader/ubifs
# (c) 2013 <NAME> (<EMAIL>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | 0 | 0 | 0 | 0 | 0 | 0 |
pybnn/util/layers.py | hyunghunny/pybnn | 110 | 3341401 | <gh_stars>100-1000
import torch
import torch.nn as nn
import numpy as np
class AppendLayer(nn.Module):
def __init__(self, noise=1e-3, *args, **kwargs):
super().__init__(*args, **kwargs)
self.log_var = nn.Parameter(torch.DoubleTensor(1, 1))
nn.init.constant_(self.log_var, val=np.log(noise)... | 0 | 0 | 0 | 0 | 0 | 0 |
homeassistant/components/sony_projector/__init__.py | domwillcode/home-assistant | 30,023 | 3341403 | """The sony_projector component."""
| 0 | 0 | 0 | 0 | 0 | 0 |
Part_2_DataTypes_+_Numbers/0007_final_score_talk_repl.py | matheharry/MicroPython-For-micro-bit | 628 | 3341438 | <reponame>matheharry/MicroPython-For-micro-bit
from microbit import display, Image
from speech import say
SPEED = 95
player_score = int(input('Enter Player Score: '))
player_score_bonus = int(input('Enter Player Score Bonus: '))
player_has_golden_ticket = True
player_final_score = player_score + player_score_bonus
... | 0 | 0 | 0 | 0 | 0 | 0 |
2021/src/Pre-processing/GAN/Inpainting/GAN-Inpainting/semantic_image_inpainting-extensions/src/helper.py | tansyab1/PhD-project | 173 | 3341451 | <reponame>tansyab1/PhD-project
import scipy
import os
import numpy as np
def loadimage(filename):
img = scipy.misc.imread(filename).astype(np.float)
return img
def loadimage_gray(filename):
img = scipy.misc.imread(filename, mode='L').astype(np.float)[:,:,np.newaxis]
return img
def saveimages(outimage... | 0 | 0 | 0 | 0 | 0 | 0 |
plynx/base/hub.py | khaxis/plynx | 137 | 3341512 | """Templates for PLynx Hubs and utils."""
from abc import abstractmethod
from dataclasses import dataclass
from typing import Any, Dict, Optional
from dataclasses_json import dataclass_json
@dataclass_json
@dataclass
class Query:
"""Hub search query entry"""
status: str = ""
search: str = ""
per_pag... | 1 | 1 | 5 | 0 | 7 | 0 |
Chapter04/elasticsearchbulk.py | VinushaVemuri/learn | 185 | 3341557 | from elasticsearch import Elasticsearch
from elasticsearch import helpers
from faker import Faker
fake=Faker()
es = Elasticsearch() #or pi {127.0.0.1}
actions = [
{
"_index": "users",
"_type": "doc",
"_source": {
"name": fake.name(),
"street": fake.street_address(),
"city": fake.city(),
"zip":fake.... | 0 | 0 | 0 | 0 | 0 | 0 |
NVLL/util/run_on_mav.py | jennhu/vmf_vae_nlp | 159 | 3341559 | <filename>NVLL/util/run_on_mav.py
base = "PYTHONPATH=../../ python ../nvll.py --cuda --lr 10.0 --batch_size 20 " \
"--eval_batch_size 20 --log_interval 500 --model nvrnn --epochs 70 " \
"--optim sgd --data_name ptb --data_path data/ptb --clip 0.25 " \
"--input_z --dropout 0.5 --emsize 100 --nhid 4... | 0 | 0 | 0 | 0 | 0 | 0 |
AutotestWebD/apps/common/func/WebFunc.py | yangjourney/sosotest | 422 | 3341572 | from __future__ import annotations
from apps.config.services.serviceConfService import ServiceConfService
from apps.config.services.http_confService import HttpConfService
from apps.config.services.businessLineService import BusinessService
from apps.config.services.modulesService import ModulesService
from apps.config... | 1 | 15 | 0 | 0 | 16 | 0 |
python/oneflow/nn/modules/permute.py | zzk0/oneflow | 3,285 | 3341575 | <gh_stars>1000+
"""
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by appli... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/device_file_generator/dfg/peripheral.py | roboterclubaachen/xpcc | 161 | 3341585 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Copyright (c) 2013, Roboterclub Aachen e.V.
# All rights reserved.
#
# The file is part of the xpcc library and is released under the 3-clause BSD
# license. See the file `LICENSE` for the full license governing this code.
# --------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
commands/toggleposition.py | nstra111/autovc | 177 | 3341647 | import functions as func
from commands.base import Cmd
help_text = [
[
("Usage:", "<PREFIX><COMMAND>"),
("Description:",
"Toggle whether new channels are placed above (default) or below the primary one.\n"
"First join a voice channel and then run the command to toggle the position... | 0 | 1 | 0 | 0 | 1 | 0 |
runtests.py | msmitherdc/django-rest-hooks | 451 | 3341689 | <reponame>msmitherdc/django-rest-hooks<filename>runtests.py<gh_stars>100-1000
#!/usr/bin/env python
import sys
import django
from django.conf import settings
APP_NAME = 'rest_hooks'
if django.VERSION < (1, 8):
comments = 'django.contrib.comments'
else:
comments = 'django_comments'
settings.configure(
DE... | 0 | 0 | 0 | 0 | 0 | 0 |
native_client_sdk/src/build_tools/apply_patch.py | Scopetta197/chromium | 212 | 3341712 | <gh_stars>100-1000
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Utility for applying svn-diff-style patches to files.
This file contains a collection of classes for parsin... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/pymorphy2/cli.py | abrgzej/WEBOT | 859 | 3341720 | # -*- coding: utf-8 -*-
from __future__ import annotations
from __future__ import absolute_import
from __future__ import unicode_literals, print_function, division
import sys
import logging
import time
import codecs
import operator
import pymorphy2
from pymorphy2.cache import lru_cache, memoized_with_single_argument
... | 4 | 10 | 3 | 0 | 17 | 0 |
src/weresync/exception.py | xlotlu/weresync | 206 | 3341721 | # Copyright 2016 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | 2 | 0 | 0 | 0 | 2 | 0 |
examples/cait/example_nlp_intention.py | sanyaade-teachings/cep | 108 | 3341732 | <reponame>sanyaade-teachings/cep
# Python code generated by CAIT's Visual Programming Interface
import cait.essentials
intention = None
entities = None
first_entity = None
def setup():
cait.essentials.initialize_component('nlp', 'english_default')
def main():
global intention, entities, first_entity
... | 0 | 0 | 0 | 0 | 0 | 0 |
app/models/__init__.py | cipherboy/modern-paste | 271 | 3341894 | <filename>app/models/__init__.py<gh_stars>100-1000
from attachment import *
from paste import *
from user import *
| 0 | 0 | 0 | 0 | 0 | 0 |
components/isceobj/Constants/Constants.py | vincentschut/isce2 | 1,133 | 3341914 | <filename>components/isceobj/Constants/Constants.py
#!/usr/bin/env python3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2012 California Institute of Technology. ALL RIGHTS RESERVED.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 0 | 0 | 0 | 0 | 0 | 0 |
data/task_scripts/main/task00019.py | aallaire91/phyre | 432 | 3341949 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 0 | 0 | 0 | 0 | 0 | 0 |
ch05/myproject_virtualenv/src/django-myproject/myproject/apps/news/urls.py | PacktPublishing/Django-3-Web-Development-Cookbook | 159 | 3341950 | from django.urls import path
from .views import ArticleList, ArticleDetail
urlpatterns = [
path("", ArticleList.as_view(), name="article_list"),
path("<slug:slug>/", ArticleDetail.as_view(), name="article_detail"),
]
| 0 | 0 | 0 | 0 | 0 | 0 |
models/multiple_solution/root_multiple.py | cyy111/metaheuristics | 104 | 3341956 | <filename>models/multiple_solution/root_multiple.py
import numpy as np
from copy import deepcopy
class RootAlgo(object):
""" This is root of all Algorithms """
ID_MIN_PROBLEM = 0
ID_MAX_PROBLEM = -1
def __init__(self, root_algo_paras = None):
self.problem_size = root_algo_paras["problem_size"]... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/routers/hr/test_hr_contracts.py | upwork/python-upwork | 150 | 3341957 | import upwork
from upwork.routers.hr import contracts
from unittest.mock import patch
@patch.object(upwork.Client, "put")
def test_suspend_contract(mocked_method):
contracts.Api(upwork.Client).suspend_contract("reference", {"a": "b"})
mocked_method.assert_called_with("/hr/v2/contracts/reference/suspend", {"a"... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/example_sim_cloth.py | NVIDIA/warp | 306 | 3341981 | # Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved.
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and relate... | 1 | 0 | 0 | 6 | 7 | 0 |
scripts/generate_plots.py | PaccMann/tape | 491 | 3341996 | from __future__ import annotations
import matplotlib.pyplot as plt
from collections import Counter
import numpy as np
def autolabel(ax, rects):
for rect in rects:
height = rect.get_height()
ax.annotate(
'{:.1%}'.format(height),
xy=(rect.get_x() + rect.get_width() / 2, heigh... | 1 | 0 | 0 | 0 | 1 | 0 |
ptsites/sites/chdbits.py | kbnq/flexget_qbittorrent_mod | 202 | 3342016 | <reponame>kbnq/flexget_qbittorrent_mod<filename>ptsites/sites/chdbits.py
from ..schema.nexusphp import BakatestHR
class MainClass(BakatestHR):
URL = 'https://chdbits.co/'
USER_CLASSES = {
'downloaded': [3298534883328, 4398046511104],
'share_ratio': [8, 10],
'points': [3500000, 5000000]... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/myapp/admin.py | tfeldmann/django-mptt | 1,912 | 3342026 | <reponame>tfeldmann/django-mptt
from django.contrib import admin
from myapp.models import Category, Person
from mptt.admin import DraggableMPTTAdmin, MPTTModelAdmin
class CategoryAdmin(MPTTModelAdmin):
pass
admin.site.register(Category, CategoryAdmin)
admin.site.register(Person, DraggableMPTTAdmin)
| 0 | 0 | 0 | 0 | 0 | 0 |
sleepypuppy/admin/access_log/models.py | hexlism/css_platform | 952 | 3342032 | <filename>sleepypuppy/admin/access_log/models.py
# Copyright 2015 Netflix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 0 | 0 | 0 | 0 | 0 | 0 |
src/genie/libs/parser/iosxe/tests/ShowCdpNeighbors/cli/equal/device_output_7_expected.py | balmasea/genieparser | 204 | 3342043 | <gh_stars>100-1000
expected_output = {
"cdp": {
"index": {
0: {
"capability": "H P M",
"hold_time": 94,
"local_interface": "FastEthernet0/1",
"platform": "420HD_GBE",
"port_id": "Esw0"
},
1: {... | 0 | 0 | 0 | 0 | 0 | 0 |
configs/_base_/schedules/schedule_adadelta_16e.py | jeffreykuang/mmocr-1 | 206 | 3342075 | # optimizer
optimizer = dict(type='Adadelta', lr=1.0)
optimizer_config = dict(grad_clip=dict(max_norm=0.5))
# learning policy
lr_config = dict(policy='step', step=[8, 10, 12])
total_epochs = 16
| 0 | 0 | 0 | 0 | 0 | 0 |
data_structures/Graphs/graphsearch/transitive_closure_graph/python/transitive_closure_graph.py | avi-pal/al-go-rithms | 1,253 | 3342076 | <filename>data_structures/Graphs/graphsearch/transitive_closure_graph/python/transitive_closure_graph.py
# Python program to print transitive closure of a graph
from collections import defaultdict
# This class represents a directed graph using adjacency list representation
class Graph:
def __init__(self,vertices... | 0 | 0 | 0 | 0 | 0 | 0 |
shared/matrices.py | jvdsn/crypto-attacks | 139 | 3342090 | <filename>shared/matrices.py
def dlog(A, B):
"""
Computes l such that A^l = B, in GF(p).
:param A: the matrix A
:param B: the matrix B
:return: l, or None if l could not be found
"""
assert A.is_square() and B.is_square() and A.nrows() == B.nrows()
# TODO: extend to GF(p^k) if necessary... | 0 | 0 | 0 | 0 | 0 | 0 |
neurst/cli/convert_checkpoint.py | ishine/neurst | 208 | 3342092 | <reponame>ishine/neurst
# Copyright 2020 ByteDance Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 0 | 0 | 0 | 0 | 0 | 0 |
observations/r/geyser.py | hajime9652/observations | 199 | 3342095 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def geyser(path):
"""Old Faithful Geyser Data
A ver... | 0 | 0 | 0 | 0 | 0 | 0 |
nuplan/planning/nuboard/base/simulation_tile.py | motional/nuplan-devkit | 128 | 3342162 | <filename>nuplan/planning/nuboard/base/simulation_tile.py
import json
import logging
import lzma
import pathlib
import pickle
from concurrent.futures import ThreadPoolExecutor
from functools import partial
from pathlib import Path
from typing import Any, Dict, List, Optional
import cv2
import msgpack
import numpy as n... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/server/test_cors.py | kaymes/terracotta | 448 | 3342177 | <gh_stars>100-1000
import json
import pytest
def get_client(metadata_origins=None, tile_origins=None):
from terracotta.server import create_app
import terracotta
if metadata_origins is not None:
terracotta.update_settings(ALLOWED_ORIGINS_METADATA=metadata_origins)
if tile_origins is not Non... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/response/AlipayOpenPublicSummaryQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 3342178 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.SummaryInfo import SummaryInfo
class AlipayOpenPublicSummaryQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenPublicSummaryQueryResponse... | 0 | 1 | 0 | 1 | 2 | 0 |
recipes/Python/119029_reverse_a_string/recipe-119029.py | tdiprima/code | 2,023 | 3342185 | f = lambda s:s and f(s[1:])+s[0]
#or
f = lambda s:reduce(lambda a,b:b+a,s,'')
#or
f = lambda s,l=[]:[l.extend(s),l.reverse(),''.join(l)][2]
#after Davids observations I was wondering how come third
#version is slower ...IT can't be as it uses builtin list functions
#that are in C
#then I came to know that in third ver... | 0 | 0 | 0 | 0 | 0 | 0 |
solutions/problem_258.py | ksvr444/daily-coding-problem | 1,921 | 3342187 | class Node:
def __init__(self, val):
self.val = val
self.ln: None = None
self.rn: None = None
def __repr__(self) -> object:
return "Node=({}, ln={}, rn={})".format(
self.val, self.ln, self.rn)
def get_bfs_alt(root, level, level_dict) -> None:
if not root:
... | 0 | 3 | 0 | 2 | 5 | 0 |
tests/components/uptimerobot/test_sensor.py | MrDelik/core | 30,023 | 3342203 | <filename>tests/components/uptimerobot/test_sensor.py
"""Test UptimeRobot sensor."""
from unittest.mock import patch
from pyuptimerobot import UptimeRobotAuthenticationException
from homeassistant.components.uptimerobot.const import COORDINATOR_UPDATE_INTERVAL
from homeassistant.const import STATE_UNAVAILABLE
from h... | 0 | 0 | 0 | 0 | 0 | 0 |
configs/selfsup/cae/cae_vit-base-p16_16xb128-fp16-coslr-300e_in1k.py | mitming/mmselfsup | 355 | 3342282 | _base_ = 'cae_vit-base-p16_32xb64-fp16-coslr-300e_in1k.py'
# dataset
data = dict(samples_per_gpu=128, workers_per_gpu=8)
| 0 | 0 | 0 | 0 | 0 | 0 |
python/yb/txndump/append_analysis.py | impira/yugabyte-db | 3,702 | 3342289 | #!/usr/bin/env python3
from __future__ import annotations
import sys
from time import monotonic
from typing import NamedTuple, List
from uuid import UUID
from yb.txndump.model import DocHybridTime, HybridTime, SubDocKey, Tombstone
from yb.txndump.parser import AnalyzerBase, DumpProcessor, TransactionBase, Update
kVa... | 8 | 7 | 0 | 1 | 16 | 0 |
youku/youku_users.py | hanguokai/youku | 106 | 3342307 | from __future__ import annotations
"""Youku Open API V2 Python Client
doc: http://open.youku.com/docs/tech_doc.html
"""
import requests
from .util import check_error, remove_none_value
class YoukuUsers(object):
"""Youku Users API.
doc: http://open.youku.com/docs/api_users.html
"""
def __init__(se... | 18 | 15 | 0 | 0 | 33 | 0 |
datasets/prepare_ade20k_ins_seg.py | Niklas-AD/Mask2Former | 143 | 3342379 | <reponame>Niklas-AD/Mask2Former<gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
import glob
import json
import os
from collections import Counter
import numpy as np
import tqdm
from panopticapi.utils import IdGenerator, save_json
from PIL import Image... | 0 | 0 | 0 | 0 | 0 | 0 |
components/aws/sagemaker/model/src/sagemaker_model_spec.py | Strasser-Pablo/pipelines | 2,860 | 3342381 | """Specification for the SageMaker create model component."""
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 1 | 3 | 14 | 0 | 18 | 0 |
pliers/extractors/models.py | nickduran/pliers | 229 | 3342399 | from __future__ import annotations
''' Extractor classes based on pre-trained models. '''
import numpy as np
import pandas as pd
from pliers.extractors.image import ImageExtractor
from pliers.extractors.base import Extractor, ExtractorResult
from pliers.filters.image import ImageResizingFilter
from pliers.stimuli imp... | 13 | 9 | 4 | 0 | 26 | 0 |
nxbt/web/__init__.py | zfghterb721/nxbt | 257 | 3342401 | from .app import start_web_app
| 0 | 0 | 0 | 0 | 0 | 0 |
tasks/__init__.py | zhufz/nlp_research | 160 | 3342414 | <reponame>zhufz/nlp_research
#-*- coding:utf-8 -*-
import sys,os
ROOT_PATH = '/'.join(os.path.abspath(__file__).split('/')[:-1])
sys.path.append(ROOT_PATH)
from classify import Classify
from xgb import XGB
from match import Match
from ner import NER
from translation import Translation
tasks = {}
tasks['classify'] = Cl... | 0 | 0 | 0 | 0 | 0 | 0 |
osp/test/common/utils/test_prettify.py | davidmcclure/open-syllabus-project | 220 | 3342472 |
import pytest
from osp.common.utils import prettify
@pytest.mark.parametrize('ugly,pretty', [
# Unchanged
('The City of God', 'The City of God'),
# Titlecase
('the city of god', 'The City of God'),
('THE CITY OF GOD', 'The City of God'),
# Strip punctuation
('The City of God.', 'The ... | 0 | 0 | 0 | 0 | 0 | 0 |
src/genie/libs/parser/viptela/tests/ShowControlLocalProperties/cli/equal/golden_output_expected.py | balmasea/genieparser | 204 | 3342486 | <reponame>balmasea/genieparser
expected_output = {
"certificate_not_valid_after": "Dec 15 18:06:59 2017 GMT",
"certificate_not_valid_before": "Dec 15 18:06:59 2016 GMT",
"certificate_status": "Installed",
"certificate_validity": "Valid",
"chassis_num_unique_id": "b5887dd3-3d70-4987-a3a4-6e06c1d64a8c... | 0 | 0 | 0 | 0 | 0 | 0 |
codigo_das_aulas/exercicios/aula_05_b.py | VeirichR/curso-python-selenium | 234 | 3342501 | <gh_stars>100-1000
from selenium.webdriver import Firefox
b = Firefox()
b.get('http://selenium.dunossauro.live/aula_05_b.html')
| 0 | 0 | 0 | 0 | 0 | 0 |
riskfolio/__init__.py | arthurire/Riskfolio-Lib | 1,110 | 3342508 | """""" #
"""
Copyright (c) 2020-2021, <NAME>
All rights reserved.
This work is licensed under BSD 3-Clause "New" or "Revised" License.
License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt
"""
from .Portfolio import *
from .HCPortfolio import *
from .PlotFunctions import *
from .Params... | 0 | 0 | 0 | 0 | 0 | 0 |
misc/tuntap.py | eric-downes/mesh-networking | 368 | 3342509 | import os, sys, struct
from select import select
from scapy.all import IP
from fcntl import ioctl
f = os.open("/dev/tap0", os.O_RDWR)
try:
while 1:
r = select([f],[],[])[0][0]
if r == f:
packet = os.read(f, 4000)
# print len(packet), packet
ip = IP(packet)
... | 0 | 0 | 0 | 0 | 0 | 0 |
time_to_guess.py | russelldavis/alfred-pwgen | 262 | 3342520 | <gh_stars>100-1000
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2015 <NAME> <<EMAIL>>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2015-07-28
#
"""
"""
from __future__ import print_function, unicode_literals, absolute_import
import os
import sys
# Guesses/second
gps = 45000000... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/usergrid-util-python/es_tools/es_searcher.py | snoopdave/incubator-usergrid | 788 | 3342535 | # */
# * Licensed to the Apache Software Foundation (ASF) under one
# * or more contributor license agreements. See the NOTICE file
# * distributed with this work for additional information
# * regarding copyright ownership. The ASF licenses this file
# * to you under the Apache License, Version 2.0 (the
# * "License... | 0 | 0 | 0 | 0 | 0 | 0 |
pybo/__init__.py | hfukada/pybo | 115 | 3342617 | """
Objects which global optimization solvers.
"""
# pylint: disable=wildcard-import
from .bayesopt import *
from . import bayesopt
__all__ = []
__all__ += bayesopt.__all__
| 0 | 0 | 0 | 0 | 0 | 0 |
src/tools/todot/todot.py | AirbusCyber/grap | 171 | 3342623 | #!/usr/bin/env python
import sys
from pygrap import *
def main():
"""
main
"""
if len(sys.argv) <= 2:
print("Usage: ./todot (in.dot) (out.dot)\n")
exit(-1)
pathin = sys.argv[1]
pathout = sys.argv[2]
gr = getGraphFromFile(pathin)
if gr is not None:
graph_fprint... | 0 | 0 | 0 | 0 | 0 | 0 |
data_structures/Graphs/graph/Python/Disjoint_Set.py | CarbonDDR/al-go-rithms | 1,253 | 3342635 | class Disjoint:
def __init__(self):
self.parent: None = None
self.rank: int = 0
self.element: None = None
self.e: list[object] = []
class Set:
def __init__(self):
#self.repre=Disjoint()
self.repre: None = None
def makset(self,x,data):
self.repre=x
... | 0 | 2 | 0 | 5 | 7 | 0 |
discovery-provider/src/queries/get_app_name_metrics_test.py | ppak10/audius-protocol | 429 | 3342675 | def test():
"""See /tests/test_get_app_name_metrics.py"""
| 0 | 0 | 0 | 0 | 0 | 0 |
pixloc/pixlib/datasets/view.py | jmorlana/pixloc | 457 | 3342682 | from __future__ import annotations
from pathlib import Path
import numpy as np
import cv2
# TODO: consider using PIL instead of OpenCV as it is heavy and only used here
import torch
from ..geometry import Camera, Pose
def numpy_image_to_torch(image) -> object:
"""Normalize the image tensor and reorder the dimens... | 15 | 6 | 0 | 0 | 21 | 0 |
tests/test_perceptualdiff_engine.py | VICEMedia/needle | 144 | 3342697 | from __future__ import absolute_import
import subprocess
import unittest
from os import path, devnull
from tests.test_pil_engine import PILEngineTests
class PerceptualdiffEngineTests(PILEngineTests):
engine_class: str = 'needle.engines.perceptualdiff_engine.Engine'
@classmethod
def setUpClass(cls):
... | 0 | 0 | 1 | 0 | 1 | 0 |
tests/components/startca/__init__.py | domwillcode/home-assistant | 30,023 | 3342712 | """Tests for the startca component."""
| 0 | 0 | 0 | 0 | 0 | 0 |
common/src/stack/command/stack/commands/list/vm/storage/__init__.py | sammeidinger/stack | 123 | 3342765 | # @copyright@
# Copyright (c) 2006 - 2019 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
#
import stack.commands
from stack.exception import ParamError
class Command(stack.commands.list.vm.Command):
"""
List virtual machine storag... | 0 | 0 | 0 | 0 | 0 | 0 |
common/utils.py | vuthede/MMNet | 179 | 3342798 | <reponame>vuthede/MMNet
import sys
import humanfriendly as hf
import contextlib
import argparse
import logging
import getpass
import shutil
import json
import time
from pathlib import Path
from types import SimpleNamespace
from datetime import datetime
import tensorflow as tf
import click
from termcolor import colored... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/gosgf/sgf_test.py | beenfhb/AlphaGo | 721 | 3342803 | <reponame>beenfhb/AlphaGo
# -*- coding: utf-8 -*-
"""Tests for sgf.py."""
import unittest
from textwrap import dedent
from betago import gosgf
SAMPLE_SGF = b"""\
(;AP[testsuite:0]CA[utf-8]DT[2009-06-06]FF[4]GM[1]KM[7.5]PB[Black engine]
PL[B]PW[White engine]RE[W+R]SZ[9]AB[ai][bh][ee]AW[fc][gc];B[dg];W[ef]C[comment
on... | 0 | 0 | 0 | 0 | 0 | 0 |
repokid/filters/__init__.py | boost-entropy-repos-org/repokid | 999 | 3342838 | <reponame>boost-entropy-repos-org/repokid
from __future__ import annotations
import logging
from typing import List
import import_string
from repokid.role import RoleList
from repokid.types import RepokidFilterConfig
LOGGER = logging.getLogger("repokid")
# inspiration from https://github.com/slackhq/python-rtmbot... | 0 | 0 | 0 | 0 | 0 | 0 |
scrapy/save-categories-in-separated-files/category/items.py | whitmans-max/python-examples | 140 | 3342894 | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class CategoryItem(scrapy.Item):
Title = scrapy.Field()
Date = scrapy.Field()
# extra field used as filename
Category = scrapy.Field()
| 0 | 0 | 0 | 0 | 0 | 0 |
test/problems/sampling/protein_folding/qubit_utils/test_qubit_fixing.py | jschuhmac/qiskit-nature | 132 | 3342898 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 0 | 0 | 0 | 0 | 0 | 0 |
thespian/test/test_msg_ConventionUpdate.py | dendron2000/Thespian | 210 | 3342943 | from thespian.actors import ActorSystemConventionUpdate, ActorSystemMessage
class TestUnitConventionUpdate(object):
def test_equality(self):
c1 = ActorSystemConventionUpdate('addr1', 'cap1', True)
assert c1, ActorSystemConventionUpdate('addr1', 'cap1' == True)
def test_inequality(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
research/masked_language_model_old/prepare_data.py | legacyai/tf-transformers | 116 | 3342954 | # -*- coding: utf-8 -*-
import argparse
import json
import os
import re
import subprocess
import time
import tensorflow as tf
import tqdm
from absl import logging
logging.set_verbosity("INFO")
alphabets = "([A-Za-z])"
prefixes = "(Mr|St|Mrs|Ms|Dr)[.]"
suffixes = "(Inc|Ltd|Jr|Sr|Co)"
starters = "(Mr|Mrs|Ms|Dr|He\\s|... | 0 | 1 | 0 | 0 | 1 | 0 |
samples/insert/python/insert_utils.py | kaiker19/incubator-doris | 3,562 | 3342956 | <reponame>kaiker19/incubator-doris<filename>samples/insert/python/insert_utils.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copy... | 0 | 0 | 0 | 0 | 0 | 0 |
allure-pytest/test/acceptance/step/step_parameters.py | ammarnajjar/allure-python | 558 | 3342979 | import pytest
from hamcrest import assert_that
from allure_commons.utils import represent
from allure_commons_test.report import has_test_case
from allure_commons_test.result import has_step
from allure_commons_test.result import has_parameter
def params_name(request) -> object:
node_id = request.node.nodeid
... | 0 | 1 | 0 | 0 | 1 | 0 |
cogan_pytorch/src/train_cogan_mnistedge.py | sagardsaxena/CoGAN | 285 | 3343003 | import sys
import logging
import torch
import torchvision
import torch.nn as nn
from dataset_mnistedge import *
import torchvision.transforms as transforms
from torch.autograd import Variable
from trainer_cogan_mnistedge import *
from net_config import *
from optparse import OptionParser
parser = OptionParser()
parser.... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter08/8A_OpenBankAPI/8A_2_run_store_json.py | uyenphuong18406/Hands-On-Artificial-Intelligence-for-Banking | 115 | 3343024 | from pymongo import MongoClient
import json
import pprint
#please get mongodb up and running
#run Mongo_script.txt to initiate the db and structure
#client = MongoClient()
client = MongoClient('mongodb://localhost:27017/')
db_name = 'AIFinance8A'
collection_name = 'transactions_obp'
f_json = open('8A_3/transactions.... | 0 | 0 | 0 | 0 | 0 | 0 |
CalibTracker/SiStripChannelGain/python/ntuple_cff.py | ckamtsikis/cmssw | 852 | 3343045 | <reponame>ckamtsikis/cmssw<filename>CalibTracker/SiStripChannelGain/python/ntuple_cff.py
import FWCore.ParameterSet.Config as cms
from CalibTracker.SiStripCommon.ShallowEventDataProducer_cfi import *
from CalibTracker.SiStripCommon.ShallowTracksProducer_cfi import *
from CalibTracker.SiStripCommon.ShallowGainCalibrati... | 0 | 0 | 0 | 0 | 0 | 0 |
bcs-ui/backend/uniapps/apis/base_views.py | laodiu/bk-bcs | 599 | 3343055 | <filename>bcs-ui/backend/uniapps/apis/base_views.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (th... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/rpc/env_dpdk.py | jfckm/spdk | 2,107 | 3343059 | def env_dpdk_get_mem_stats(client) -> object:
"""Dump the applications memory stats to a file.
Returns:
The path to the file where the stats are written.
"""
return client.call('env_dpdk_get_mem_stats')
| 0 | 1 | 0 | 0 | 1 | 0 |
wetectron/utils/collect_env.py | akobiisr/wetectron | 332 | 3343063 | # --------------------------------------------------------
# Copyright (C) 2020 NVIDIA Corporation. All rights reserved.
# Nvidia Source Code License-NC
# --------------------------------------------------------
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import PIL
from torch.utils.collect... | 0 | 2 | 0 | 0 | 2 | 0 |
nbdler/DLProgress.py | DicksYang/iqiyi-parser | 986 | 3343066 |
from __future__ import annotations
import time, os
from . import DLProcessor
from .packer import Packer
import gc
import traceback
from . import DLCommon as cv
class TimeStatus(Packer, object):
def __init__(self):
self.go_startTime: None = None
self.go_endtime: None = None
self.go_lastT... | 0 | 36 | 0 | 20 | 56 | 0 |
redis/intelligence.py | codeproject/DeepStack | 353 | 3343069 | import sys
import argparse
sys.path.append(r"C:\DeepStack\interpreter\packages")
from redis import StrictRedis, RedisError
import torch
import time
import json
import io
import os
import _thread as thread
from multiprocessing import Process
from sharedintelligence.commons import preprocess
import torchvision.transform... | 0 | 3 | 0 | 0 | 3 | 0 |
mono/core/utils/__init__.py | Jenaer/FeatDepth | 179 | 3343073 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Duanzhixiang(<EMAIL>)
from .dist_utils import allreduce_grads, DistOptimizerHook
from .misc import tensor2imgs, unmap, multi_apply
__all__ = [
'allreduce_grads', 'DistOptimizerHook', 'tensor2imgs', 'unmap',
'multi_apply'
]
| 0 | 0 | 0 | 0 | 0 | 0 |
test/test_overload.py | mariogeiger/pytorch_sparse | 623 | 3343082 | import torch
from torch_sparse.tensor import SparseTensor
def test_overload():
row = torch.tensor([0, 1, 1, 2, 2])
col = torch.tensor([1, 0, 2, 1, 2])
mat = SparseTensor(row=row, col=col)
other = torch.tensor([1, 2, 3]).view(3, 1)
other + mat
mat + other
other * mat
mat * other
o... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_orbital.py | sixy6e/PyRate | 145 | 3343110 | # This Python module is part of the PyRate software package.
#
# Copyright 2021 Geoscience Australia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | 7 | 12 | 0 | 21 | 40 | 0 |
indra/benchmarks/bioprocesses/__main__.py | pupster90/indra | 136 | 3343136 | <filename>indra/benchmarks/bioprocesses/__main__.py<gh_stars>100-1000
from __future__ import absolute_import, print_function, unicode_literals
import sys
from indra.benchmarks.bioprocesses import analyze
if __name__ == '__main__':
# Get the command line args
if len(sys.argv) < 2:
print("Usage: %s stmts... | 0 | 0 | 0 | 0 | 0 | 0 |
Competitions/Google Code Jam/Qualification Round 2017/Problem 1/Problem 1.py | cnm06/Competitive-Programming | 994 | 3343150 | <reponame>cnm06/Competitive-Programming
f = open('sample-input.in')
o = open('sample-output.out', 'w')
t = int(f.readline().strip())
for i in xrange(1, t + 1):
x = [str(j) for j in f.readline().strip().split(" ")]
x[1] = int(x[1])
for j in xrange(0, len(x[0])-x[1]):
if x[0][j] == '-':
for k in xrange(j, j+x[1])... | 0 | 0 | 0 | 0 | 0 | 0 |
code/eval.py | modestyachts/ImageNetV2 | 173 | 3343154 | <reponame>modestyachts/ImageNetV2
import json
import pathlib
import click
import numpy as np
import torchvision.models
from tqdm import tqdm
import candidate_data
import eval_utils
import image_loader
import imagenet
import pretrainedmodels
import pretrainedmodels.utils as pretrained_utils
import torch
import os
impo... | 0 | 0 | 0 | 0 | 0 | 0 |
client/verta/verta/_swagger/_public/modeldb/model/ModeldbQueryParameter.py | CaptEmulation/modeldb | 835 | 3343157 | # THIS FILE IS AUTO-GENERATED. DO NOT EDIT
from __future__ import annotations
from verta._swagger.base_type import BaseType
class ModeldbQueryParameter(BaseType):
def __init__(self, parameter_name: object | None=None, parameter_type: object | None=None, value: object | None=None):
required = {
"parameter_n... | 3 | 1 | 0 | 0 | 4 | 0 |
src/genie/libs/parser/iosxr/tests/ShowIpInterfaceBrief/cli/equal/golden_output2_expected.py | balmasea/genieparser | 204 | 3343158 | expected_output = {
"interface": {
"MgmtEth0/RP0/CPU0/0": {
"interface_status": "Up",
"ip_address": "10.1.17.179",
"protocol_status": "Up",
"vrf_name": "default",
}
}
}
| 0 | 0 | 0 | 0 | 0 | 0 |
playbooks/internal_host_ssh_investigate.py | arjunkhunti-crest/security_content | 348 | 3343165 | from __future__ import annotations
"""
Published in response to CVE-2021-44228, this playbook investigates an internal unix host using SSH. This pushes a bash script to the endpoint and runs it, collecting generic information about the processes, user activity, and network activity. This includes the process list, logi... | 56 | 9 | 0 | 0 | 65 | 0 |
build/tools/config_tool/config_excel.py | ArkGame/ArkGameFrame | 168 | 3343202 | <reponame>ArkGame/ArkGameFrame
#!/usr/bin/python
# encoding=utf-8
# author: NickYang
# date: 2019/04/02
from openpyxl import load_workbook
from openpyxl.styles import Border, Side, Font
import time
class my_excel(object):
def __init__(self, excelPath):
self.excelPath = excelPath
self.workbook = ... | 0 | 0 | 0 | 0 | 0 | 0 |
vol1/python-examples/test/aifh/test_error.py | Sun-Joong/aifh | 777 | 3343253 | """
Artificial Intelligence for Humans
Volume 1: Fundamental Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2013 by <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you... | 0 | 0 | 2 | 0 | 2 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.