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 |
|---|---|---|---|---|---|---|---|---|---|---|
atlas/foundations_local_docker_scheduler_plugin/src/foundations_local_docker_scheduler_plugin/bundle_deployment.py | DeepLearnI/atlas | 296 | 3338741 | <reponame>DeepLearnI/atlas
from contextlib import contextmanager
def job_bundle(bundle_name):
from foundations_contrib.job_bundler import JobBundler
from foundations_contrib.job_bundling.empty_job import EmptyJob
from foundations_contrib.job_bundling.folder_job_source_bundle import FolderJobSourceBundle
... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter11_Driving-Servo-Motors/servoSundial/justSetTime.py | ONEV2/AVR-Programming | 608 | 3338804 | <reponame>ONEV2/AVR-Programming<gh_stars>100-1000
import serial
import calibrateTime
s = serial.Serial("/dev/ttyUSB0", 9600, timeout=5)
calibrateTime.setTimeNow(s)
s.close()
| 0 | 0 | 0 | 0 | 0 | 0 |
24-class-metaprog/metabunch/original/bunch.py | SeirousLee/example-code-2e | 990 | 3338818 | <reponame>SeirousLee/example-code-2e
import warnings
class metaMetaBunch(type):
"""
metaclass for new and improved "Bunch": implicitly defines
__slots__, __init__ and __repr__ from variables bound in class scope.
An instance of metaMetaBunch (a class whose metaclass is metaMetaBunch)
defines only ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/serialization_test.py | ctittel/worldengine | 946 | 3338841 | <reponame>ctittel/worldengine<filename>tests/serialization_test.py
import unittest
import tempfile
import os
from worldengine.plates import Step, world_gen
from worldengine.model.world import World
from worldengine.common import _equal
from worldengine.hdf5_serialization import save_world_to_hdf5, load_world_to_hdf5
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/conftest.py | tompollard/mimic-iv | 1,626 | 3338865 | import os
from collections import namedtuple
import pytest
from google.cloud import bigquery
# add service account key to allow querying against BigQuery
dir_path = os.path.dirname(os.path.realpath(__file__))
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = os.path.join(
dir_path, "key.json"
)
@pytest.fixture(sco... | 0 | 3 | 0 | 0 | 3 | 0 |
python/searching/jumpsearch.py | jigneshoo7/AlgoBook | 191 | 3338879 | <reponame>jigneshoo7/AlgoBook
'''
Jump search is searching algorithm for sorted arrays.It skips some elements by taking fixed steps defined by the block size
instead of travesing through all the elements.
'''
import math #for sqrt
def jumpsearch(arr,ele): #function to perform jump search
n = ... | 0 | 0 | 0 | 0 | 0 | 0 |
mephisto/abstractions/blueprints/mock/mock_task_builder.py | padentomasello/Mephisto | 167 | 3338921 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from mephisto.abstractions.blueprint import TaskBuilder
import os
import time
from typing import ClassVar, List, Type,... | 1 | 0 | 2 | 0 | 3 | 0 |
rio_tiler/mosaic/__init__.py | vincentsarago/rio-tiler | 242 | 3339009 | <filename>rio_tiler/mosaic/__init__.py
"""rio-tiler.mosaic."""
from . import methods # noqa
from .reader import mosaic_reader # noqa
| 0 | 0 | 0 | 0 | 0 | 0 |
src/genie/libs/parser/iosxr/tests/ShowIsisHostname/cli/equal/golden_output_1_expected.py | balmasea/genieparser | 204 | 3339013 |
expected_output = {
'isis': {
'TEST1': {
'vrf': {
'default': {
'level': {
2: {
'system_id': {
'5286.44ff.91b9': {
'dynamic_hostname': 'hos... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | EunDaengED/yaksok | 170 | 3339055 | from setuptools import setup
setup(
name='yaksok',
packages=['yaksok', 'yaksok.ply', 'yaksok.modules'],
package_data = {
'':[ 'modules/*.yak'],
},
entry_points = {
'console_scripts': [
'yaksok = yaksok.yaksok:main',
],
},
)
| 0 | 0 | 0 | 0 | 0 | 0 |
modules/google-earth-engine/docker/src/sepalinternal/mosaic/haze.py | BuddyVolly/sepal | 153 | 3339094 | <filename>modules/google-earth-engine/docker/src/sepalinternal/mosaic/haze.py
from ..image_operation import ImageOperation
import ee
def mask_haze(mosaic_def, collection):
if mosaic_def.haze_tolerance == 1:
return collection # No point of reducing and mapping the collection if we have full haze tolerance
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/sparsify/models/projects.py | dhuangnm/sparsify | 152 | 3339157 | <gh_stars>100-1000
# Copyright (c) 2021 - present / Neuralmagic, Inc. 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
#
... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/twitter_auto_follow.py | arhanair/glucose-tracker-monitor | 134 | 3339187 | import os
import time
import tweepy
API_KEY = os.environ['TWITTER_API_KEY']
API_SECRET = os.environ['TWITTER_API_SECRET']
ACCESS_TOKEN = os.environ['TWITTER_ACCESS_TOKEN']
ACCESS_TOKEN_SECRET = os.environ['TWITTER_TOKEN_SECRET']
auth = tweepy.OAuthHandler(API_KEY, API_SECRET)
auth.set_access_token(ACCESS_TOKEN, AC... | 0 | 0 | 0 | 0 | 0 | 0 |
train_steering_wheel/train.py | AlexHerger/self-driving-truck | 373 | 3339202 | <filename>train_steering_wheel/train.py
"""Trains a CNN to detect the current steering wheel angle from images."""
from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import models
from lib import replay_memory
from lib import util
from l... | 0 | 0 | 0 | 0 | 0 | 0 |
survae/tests/transforms/bijections/affine.py | alisiahkoohi/survae_flows | 262 | 3339209 | <filename>survae/tests/transforms/bijections/affine.py
import numpy as np
import torch
import torchtestcase
import unittest
from survae.transforms import ScalarAffineBijection
from survae.tests.transforms.bijections import BijectionTest
class ScalarAffineBijectionTest(BijectionTest):
def test_bijection_is_well_b... | 0 | 0 | 0 | 0 | 0 | 0 |
marrow/mailer/validator.py | cynepiaadmin/mailer | 166 | 3339221 | # encoding: utf-8
#
# This file was taken from webpyte (r179):
# http://code.google.com/p/webpyte/source/browse/trunk/webpyte/email_validator.py
# According to the docstring, it is licensed as 'public domain'
#
# Modifications:
# * Wed Mar 25 2009 <NAME>
# - Removed 'from __future__ import absolute_import to stay comp... | 4 | 6 | 2 | 0 | 12 | 0 |
data/tracking/methods/SiamFC/builders/components/data_processor.py | zhangzhengde0225/SwinTrack | 143 | 3339257 | <gh_stars>100-1000
from data.tracking.label.builder import build_label_generator_and_batch_collator
from ...pipeline.processor import SiamTrackerProcessor, SiamFCBatchDataCollator
from ...common.metric_collector import SiamFCMetricCollector
def _build_siamfc_data_processor(network_data_config: dict, data_processor_co... | 0 | 0 | 0 | 0 | 0 | 0 |
integration/combination/test_function_with_implicit_http_api.py | huanjiayang-ibm/serverless-application-model | 1,279 | 3339266 | from integration.helpers.base_test import BaseTest
class TestFunctionWithImplicitHttpApi(BaseTest):
def test_function_with_implicit_api(self):
self.create_and_verify_stack("combination/function_with_implicit_http_api")
stack_outputs = self.get_stack_outputs()
base_url = stack_outputs["Api... | 0 | 0 | 0 | 0 | 0 | 0 |
python/Matrix/sorting_a_matrix.py | nikitanamdev/AlgoBook | 191 | 3339333 | <gh_stars>100-1000
n=int(input("enter the no. of rows"))
m=int(input("enter the no. of columns"))
matrix=[]
for i in range(n):
a=[]
for j in range(m):
a.append(int(input()))
matrix.append(a)
print("Original matrix:")
for i in range(n):
for j in range(m):
print(matrix[i][j],end=" ")
... | 0 | 0 | 0 | 0 | 0 | 0 |
softlearning/environments/dm_control/__init__.py | pedrodbs/mbpo | 920 | 3339344 | <reponame>pedrodbs/mbpo
"""Custom DeepMind Control Suite environments.
Every class inside this module should extend a dm_control.suite.Task class. The
# file structure should be similar to dm_control's file structure.
"""
| 0 | 0 | 0 | 0 | 0 | 0 |
test/expressions/expr7.py | abjugard/MagicPython | 1,482 | 3339360 | a.True = b.False = d.None
a : source.python
. : meta.member.access.python, punctuation.separator.period.python, source.python
True : keyword.illegal.name.python, meta.member.access.python, source.python
: source.python
= : keyword.operator.assignment.python... | 0 | 0 | 0 | 0 | 0 | 0 |
problems/codejam/2013/1a/bullseye/other/bull.py | vidyadeepa/the-coding-interview | 1,571 | 3339375 | import sys
rl = sys.stdin.readline
def sum(n):
return (n * (n + 1)) / 2
def can_draw(r, t, rings):
t -= (2 * r + 1) * rings
t -= sum(rings - 1) * 4
return t >= 0
T = int(rl())
for cc in xrange(T):
r, t = map(int, rl().split())
can, cannot = 1, t + 1
while can + 1 < cannot:
middl... | 0 | 0 | 0 | 0 | 0 | 0 |
w3lib/__init__.py | hugovk/w3lib | 261 | 3339385 | __version__ = "1.22.0"
version_info = tuple(int(v) if v.isdigit() else v for v in __version__.split("."))
| 0 | 0 | 0 | 0 | 0 | 0 |
device/src/main_bk.py | bother3000/Smart-IoT-Planting-System | 171 | 3339411 | <filename>device/src/main_bk.py
#This is the file executing while STM32 MCU bootup, and in this file,
#it will call other functions to fullfill the project.
import pyb
from pyb import Pin
from pyb import Timer
import micropython
#Import light intensity needed module
import LightIntensity
import time
micropython.al... | 0 | 0 | 0 | 0 | 0 | 0 |
data_preparation/split_librilight/split.py | dweekly/libri-light | 246 | 3339417 | <filename>data_preparation/split_librilight/split.py<gh_stars>100-1000
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from collections import defaultdict
import argparse
import json
import pathlib
import math
def get_stats(fnames, fnames2jsons):
total_seconds = sum(fnames2jsons[fname]
... | 0 | 0 | 0 | 0 | 0 | 0 |
unittest_reinvent/running_modes/lib_invent_tests/__init__.py | lilleswing/Reinvent-1 | 183 | 3339435 | <gh_stars>100-1000
from unittest_reinvent.running_modes.lib_invent_tests.logger_tests import *
from unittest_reinvent.running_modes.lib_invent_tests.reinforcement_learning_tests import *
from unittest_reinvent.running_modes.lib_invent_tests.scoring_strategy_tests import *
from unittest_reinvent.running_modes.lib_invent... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/test/incident_analysis_tests/IncidentDensityTestCase.py | Pandinosaurus/solutions-geoprocessing-toolbox | 113 | 3339479 | <filename>utils/test/incident_analysis_tests/IncidentDensityTestCase.py
# coding: utf-8
'''
-----------------------------------------------------------------------------
Copyright 2016 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Y... | 0 | 0 | 0 | 0 | 0 | 0 |
src/python/example/functional_graph_induced_complex.py | jmarino/gudhi-devel | 146 | 3339484 | #!/usr/bin/env python
import gudhi
import argparse
""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
Author(s): <NAME>
Copyright (C) 2018 Inria
Modification(s... | 0 | 0 | 0 | 0 | 0 | 0 |
Installer/uninstaller.py | osmaelo/April-Tag-VR-FullBody-Tracker | 566 | 3339488 | from os import path,environ
from json import load,dump
from shutil import copytree, rmtree
from sys import stdout as std
from tkinter import filedialog,Tk
from cprint import cprint
def error(msg):
cprint(f"[R]Quit: "+msg)
input('Press enter to continue')
exit()
def ask_folder() -> object:
... | 0 | 2 | 0 | 0 | 2 | 0 |
src/azure-cli/azure/cli/command_modules/role/_completers.py | YuanyuanNi/azure-cli | 3,287 | 3339500 | <filename>src/azure-cli/azure/cli/command_modules/role/_completers.py
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
... | 0 | 0 | 0 | 0 | 0 | 0 |
dev/inject_melting_curves.py | pauliacomi/CoolProp | 520 | 3339515 | <reponame>pauliacomi/CoolProp<filename>dev/inject_melting_curves.py
import os, json
Simon_curves = {
"n-Propane": {
"BibTeX": "Reeves-JCP-1964", "T_m": -187.75 + 273.15, "parts": [{"T_0": 85.3, "a": 7.180e8, "c": 1.283, "p_0": 0.0, "T_max": 168.63}]
},
"n-Pentane": {
"BibTeX": "Reeves-JCP-... | 0 | 0 | 0 | 0 | 0 | 0 |
tracklater/main.py | Eerovil/thyme-toggl-cli | 110 | 3339552 | <filename>tracklater/main.py<gh_stars>100-1000
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import importlib
from typing import Dict
from types import ModuleType
from tracklater import settings
from tracklater.timemodules.interfaces import AbstractParser
from tracklater.models import ApiCall, Entry, Issue, Projec... | 0 | 0 | 0 | 0 | 0 | 0 |
src/ralph/dashboards/models.py | DoNnMyTh/ralph | 1,668 | 3339584 | <reponame>DoNnMyTh/ralph
from functools import partial
from dj.choices import Choices
from django.contrib.contenttypes.models import ContentType
from django.db import connection, models
from django.db.models import Case, Count, IntegerField, Max, Q, Sum, Value, When
from django.db.models.functions import Coalesce
from... | 0 | 0 | 0 | 0 | 0 | 0 |
Packs/VulnDB/Integrations/VulnDB/VulnDB_test.py | diCagri/content | 799 | 3339611 | <filename>Packs/VulnDB/Integrations/VulnDB/VulnDB_test.py<gh_stars>100-1000
from CommonServerPython import DemistoException
from pytest import raises
def test_http_request_json_negative(requests_mock):
from VulnDB import Client, vulndb_get_cve_command
base_path = 'https://vulndb.cyberriskanalytics.com'
re... | 0 | 0 | 0 | 0 | 0 | 0 |
test/functional/statistics.py | CoinStudio/bitcoin2x | 117 | 3339661 | <reponame>CoinStudio/bitcoin2x
#!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.mininode import COIN
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
import math, time
class StatisticsTest(BitcoinTestFramework):
def set_tes... | 0 | 0 | 0 | 0 | 0 | 0 |
res/get_release_number.py | simonflueckiger/tesserocr-windows_build | 177 | 3339673 | <reponame>simonflueckiger/tesserocr-windows_build
import urllib.request
import json
import os
import sys
repo = sys.argv[1]
url = "https://api.github.com/repos/{}/releases/latest".format(repo)
with urllib.request.urlopen(url) as url:
data = json.loads(url.read().decode())
sys.stdout.write(data['name']) | 0 | 0 | 0 | 0 | 0 | 0 |
process_folder.py | Um3sobi/sigver_wiwd | 128 | 3339699 | """ This example extract features for all signatures in a folder,
using the CNN trained on the GPDS dataset. Results are saved in a matlab
format.
Usage: python process_folder.py <signatures_path> <save_path>
<model_path> [canvas_size]
Example:
python process_fo... | 0 | 0 | 0 | 0 | 0 | 0 |
sunpy/map/tests/test_reproject_to.py | Octaves0911/sunpy | 628 | 3339721 | <reponame>Octaves0911/sunpy
"""
Test the `GenericMap.reproject_to()` method
"""
import warnings
import numpy as np
import pytest
from matplotlib.testing.decorators import check_figures_equal
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.wcs import WCS
import sunpy.map
from sunpy.tes... | 0 | 0 | 0 | 0 | 0 | 0 |
Cktgen/cktgen/conftest.py | mabrains/ALIGN-public | 119 | 3339729 | # content of conftest.py
import pytest
def pytest_addoption(parser):
parser.addoption(
"--run_intel_22nm", action="store_true", default=False, help="run intel_22nm tests"
)
def pytest_configure(config):
config.addinivalue_line("markers", "intel_22nm: mark test that needs protected process param... | 0 | 1 | 0 | 0 | 1 | 0 |
scripts/artifacts/kikMessages.py | hyuunnn/iLEAPP | 325 | 3339835 | import os
import shutil
import sqlite3
import scripts.artifacts.artGlobals
from packaging import version
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, logdevinfo, timeline, tsv, is_platform_windows, open_sqlite_db_readonly
def get_kikMessages(files_found, report_folder... | 0 | 1 | 0 | 0 | 1 | 0 |
src/utils.py | junhocho/ShapeMatchingGAN | 117 | 3339877 | <reponame>junhocho/ShapeMatchingGAN
import torch
from PIL import Image
import matplotlib.pyplot as plt
import torchvision.transforms as transforms
from torch.autograd import Variable
import numpy as np
import cv2
import scipy.ndimage as pyimg
import random
import os
pil2tensor = transforms.Compose([
transforms.ToTens... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_helpers.py | pwwang/python-varname | 167 | 3339883 | <gh_stars>100-1000
import sys
import pytest
from varname import *
from varname.helpers import *
def test_wrapper():
val1 = Wrapper(True)
assert val1.name == "val1"
assert val1.value is True
assert str(val1) == "True"
assert repr(val1) == "<Wrapper (name='val1', value=True)>"
# wrapped Wrap... | 0 | 0 | 0 | 0 | 0 | 0 |
iotbx/cif/tests/tst_cod.py | dperl-sol/cctbx_project | 155 | 3339956 | <filename>iotbx/cif/tests/tst_cod.py
from __future__ import absolute_import, division, print_function
from iotbx.cif import cod_tools
import iotbx.cif
from iotbx.cif.builders import CifBuilderError
from iotbx.cif import CifParserError
from libtbx import easy_pickle, group_args
import os, traceback
def run(args, comman... | 0 | 0 | 0 | 0 | 0 | 0 |
src/job-exporter/test/test_network.py | wyatuestc/pai | 1,417 | 3339974 | # Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation
# the rights to ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_bandit/test_data_bandits.py | mehulrastogi/genrl | 390 | 3340008 | <reponame>mehulrastogi/genrl
from genrl.utils import (
AdultDataBandit,
CensusDataBandit,
CovertypeDataBandit,
MagicDataBandit,
MushroomDataBandit,
StatlogDataBandit,
)
from .utils import write_data
class TestDataBandit:
def _test_fn(self, bandit) -> None:
_ = bandit.reset()
... | 0 | 0 | 0 | 0 | 0 | 0 |
bin/json_merge.py | 641i130/keygen | 114 | 3340013 | #!/usr/bin/env python3
import sys
import json
def read_json_file(fn) -> object:
with open(fn) as f:
return json.load(f)
combined = [read_json_file(fn) for fn in sys.argv[1:]]
print(json.dumps(combined))
| 0 | 1 | 0 | 0 | 1 | 0 |
polymorphic_tree/admin/__init__.py | avaddon/django-polymorphic-tree | 105 | 3340017 | from polymorphic_tree.admin.childadmin import PolymorphicMPTTChildModelAdmin, PolymorpicMPTTAdminForm
from polymorphic_tree.admin.parentadmin import PolymorphicMPTTParentModelAdmin, NodeTypeChoiceForm
__all__ = (
'PolymorphicMPTTChildModelAdmin', 'PolymorpicMPTTAdminForm',
'PolymorphicMPTTParentModelAdmin', 'N... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/r/test_possum_div.py | hajime9652/observations | 199 | 3340021 | <reponame>hajime9652/observations<gh_stars>100-1000
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.possum_div import possum_div
def test_possum_div():
"""Test module possum_div.py by download... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/full-example/main.py | alwye/fastapi_login | 318 | 3340075 | import os
import argparse
from dotenv import dotenv_values
from app.db import create_tables, get_session
from app.db.actions import create_user
def create_secret(_args):
"""
Creates a secret and stores it in a .env file in the current working directory
Use `python main.py create-secret --help` for more op... | 0 | 0 | 0 | 0 | 0 | 0 |
datalab/storage/commands/_storage.py | freyrsae/pydatalab | 198 | 3340105 | # Copyright 2015 Google Inc. 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 applicable law or agreed ... | 3 | 10 | 0 | 0 | 13 | 0 |
doc/integrations/torchvision/cortx_pytorch/__init__.py | jkan-cn/cortx | 552 | 3340129 | import tempfile
from functools import partial
import io
from os import path
import torch as ch
from tqdm import tqdm
import webdataset as wds
import boto3
from botocore.client import Config
def make_client(end_point, access_key, secure_key) -> object:
client = boto3.client('s3', endpoint_url=end_point,
... | 3 | 5 | 0 | 0 | 8 | 0 |
Packs/CortexXDR/Scripts/CortexXDRCloudProviderWidget/CortexXDRCloudProviderWidget_test.py | diCagri/content | 799 | 3340155 | import io
from CommonServerPython import *
import CortexXDRCloudProviderWidget
import pytest
def util_load_json(path) -> object:
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
@pytest.mark.parametrize('incident_data, expected_result', [
(util_load_json('test_data/in... | 0 | 1 | 0 | 0 | 1 | 0 |
test/regression/features/tuples/singleton_tuple.py | ppelleti/berp | 137 | 3340156 | x = (1,)
print(x)
| 0 | 0 | 0 | 0 | 0 | 0 |
pyramid/notejam/tests.py | aleanza/notejam | 549 | 3340184 | <filename>pyramid/notejam/tests.py
import unittest
from webtest import TestApp
from pyramid import testing
from sqlalchemy import create_engine
from models import DBSession, Base, User, Pad, Note
class BaseTestCase(unittest.TestCase):
def setUp(self):
self.config = testing.setUp()
# @TODO chan... | 0 | 0 | 0 | 0 | 0 | 0 |
scale/job/migrations/0040_auto_20180709_1807.py | kaydoh/scale | 121 | 3340198 | <reponame>kaydoh/scale<gh_stars>100-1000
# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-07-09 18:07
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('job', '0039_auto_20180622_1827'),
]
operations = ... | 0 | 0 | 0 | 0 | 0 | 0 |
Geometry/HcalEventSetup/python/HcalTopology_cfi.py | ckamtsikis/cmssw | 852 | 3340199 | import FWCore.ParameterSet.Config as cms
import Geometry.HcalEventSetup.hcalTopologyIdeal_cfi
hcalTopologyIdeal = Geometry.HcalEventSetup.hcalTopologyIdeal_cfi.hcalTopologyIdeal.clone()
import Geometry.HcalEventSetup.hcalTopologyConstants_cfi as hcalTopologyConstants_cfi
hcalTopologyIdeal.hcalTopologyConstants = cms... | 0 | 0 | 0 | 0 | 0 | 0 |
test/test_document/__init__.py | ShabbirHasan1/cysimdjson | 178 | 3340204 | import pprint
import unittest
import os
import cysimdjson
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
class JSONDocumentTestCases(unittest.TestCase):
def test_iter_01(self):
parser = cysimdjson.JSONParser()
with open(os.path.join(THIS_DIR, 'document.json'), 'rb') as fo:
json_parsed = parser.par... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/579107_simplify_webpage/recipe-579107.py | tdiprima/code | 2,023 | 3340225 | #!/usr/bin/torify /usr/bin/python
from __future__ import annotations
import Tkinter
import tkFont
import requests
import html2text
import urllib2
class TkDND(object):
def __init__(self, master):
master.tk.eval('package require tkdnd')
self.master = master
self.tk = master.tk
self._... | 3 | 6 | 0 | 1 | 10 | 0 |
test/test_cast.py | dendisuhubdy/coriander | 644 | 3340240 | # Copyright <NAME> 2016, 2017
"""
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, software
... | 0 | 0 | 0 | 0 | 0 | 0 |
tasks/multiwoz.py | HKUNLP/UnifiedSKG | 191 | 3340249 | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 3 | 21 | 0 | 1 | 25 | 0 |
characters_stats/count.py | filip-we/kb-layout-evaluation | 117 | 3340277 | <gh_stars>100-1000
#!/usr/bin/python3
import os
import string
import pandas as pd
# where the data is
fileDir = os.path.join(os.path.dirname(os.path.realpath('__file__')), 'data')
# list the data files
fileslist = [f for f in os.listdir(fileDir) if os.path.isfile(os.path.join(fileDir, f))]
# list of characters to ... | 0 | 0 | 0 | 0 | 0 | 0 |
samtranslator/model/eventsources/__init__.py | hawflau/serverless-application-model | 1,279 | 3340280 | FUNCTION_EVETSOURCE_METRIC_PREFIX = "FunctionEventSource"
| 0 | 0 | 0 | 0 | 0 | 0 |
example_non_linear_models.py | ravish0007/fairml | 330 | 3340282 | import pandas as pd
import numpy as np
from itertools import cycle
import matplotlib
matplotlib.use('Agg') # issue with virtual environments and backend
import matplotlib.pyplot as plt
# import seaborn as sns
from time import time
from scipy.stats import randint as sp_randint
from sklearn.model_selection import Gri... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/pcDevice/iPcDeviceAPI.py | Passer-D/GameAISDK | 1,210 | 3340297 | <reponame>Passer-D/GameAISDK<filename>tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/pcDevice/iPcDeviceAPI.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making GameAISDK available.
This source code file is licensed under the GNU General Public License Version 3.
For full detai... | 0 | 0 | 0 | 0 | 0 | 0 |
dcdownloader/parser/EhentaiParser.py | dev-techmoe/python-dcdownloader | 173 | 3340353 | <reponame>dev-techmoe/python-dcdownloader
from pyquery import PyQuery as pq
from abc import ABCMeta, abstractmethod
class EhentaiParser(metaclass=ABCMeta):
base_url = ''
chapter_mode = False
async def parse_info(self, data):
doc = pq(data)
name = doc('#gn').text()
return ... | 0 | 0 | 0 | 0 | 0 | 0 |
anno_hda2voc.py | CasiaFan/Dataset_to_VOC_converter | 194 | 3340367 | <filename>anno_hda2voc.py
import os, argparse
from lxml import etree, objectify
# camera image size
cam_size = {
"camera17": (640, 480),
"camera18": (640, 480),
"camera19": (640, 480),
"camera40": (650, 480),
"camera50": (1280, 800),
"camera53": (1280, 800),
"camera54": (1280, 800),
"ca... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/test/military_features_tests/CalculateSidcTestCase.py | Pandinosaurus/solutions-geoprocessing-toolbox | 113 | 3340396 | # coding: utf-8
#------------------------------------------------------------------------------
# Copyright 2017 Esri
# 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... | 0 | 0 | 2 | 0 | 2 | 0 |
questions/ambiguous-coordinates/Solution.py | achow113/LeetCode | 141 | 3340437 | """
We had some 2-dimensional coordinates, like "(1, 3)" or "(2, 0.5)". Then, we removed all commas, decimal points, and spaces and ended up with the string s.
For example, "(1, 3)" becomes s = "(13)" and "(2, 0.5)" becomes s = "(205)".
Return a list of strings representing all possibilities for what our original co... | 1 | 5 | 0 | 0 | 6 | 0 |
Webcam-(imgcap)/webcam-img-cap.py | A-kriti/Amazing-Python-Scripts | 930 | 3340440 | import cv2
import time
imgcapture = cv2.VideoCapture(0)
result = True
while (result):
ret, frame = imgcapture.read()
name = int(round(time.time() * 1000))
name = 'E:/Python-Programs/PythonProjects/WebCam/Images-Captured/{}.jpg'.format(
name)
cv2.imwrite(name, frame)
result = False
prin... | 0 | 0 | 0 | 0 | 0 | 0 |
__ERRORS__/UnboundLocalError - local variable referenced before assignment/main.py | whitmans-max/python-examples | 140 | 3340452 | <gh_stars>100-1000
#!/usr/bin/env python3
#
# UnboundLocalError: local variable 'result' referenced before assignment
#
# it is happend only inside function/method
#
import traceback
def example1():
print(result)
result = 5
def example2a():
result += 5
def example2b():
result = result +... | 0 | 0 | 0 | 0 | 0 | 0 |
pynq/lib/pmod/pmod_als.py | michalkouril/PYNQ | 1,537 | 3340456 | # Copyright (c) 2016, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of ... | 0 | 2 | 0 | 1 | 3 | 0 |
lightly/openapi_generated/swagger_client/models/embedding2d_data.py | CodeGuy-007/lightly | 1,515 | 3340474 | # coding: utf-8
from __future__ import annotations
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
OpenAPI spec version:... | 9 | 13 | 2 | 9 | 33 | 0 |
usaspending_api/transactions/models/__init__.py | g4brielvs/usaspending-api | 217 | 3340483 | from usaspending_api.transactions.models.source_assistance_transaction import SourceAssistanceTransaction
from usaspending_api.transactions.models.source_procurement_transaction import SourceProcurementTransaction
__all__ = ["SourceAssistanceTransaction", "SourceProcurementTransaction"]
| 0 | 0 | 0 | 0 | 0 | 0 |
packs/bitbucket/actions/archive_repo.py | userlocalhost2000/st2contrib | 164 | 3340488 | from lib.action import BitBucketAction
class ArchiveRepoAction(BitBucketAction):
def run(self, repo) -> object:
"""
Archive a Repository, returns path to
archived repository
"""
bb = self._get_client(repo=repo)
success, archive_path = bb.repository.archive()
... | 0 | 1 | 0 | 0 | 1 | 0 |
azure-devops/azext_devops/test/utils/authentication.py | doggy8088/azure-devops-cli-extension | 326 | 3340500 | <reponame>doggy8088/azure-devops-cli-extension
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_login.py | tsda21/aioftp | 120 | 3340518 | import pytest
import aioftp
@pytest.mark.asyncio
async def test_client_list_override(pair_factory, expect_codes_in_exception):
async with pair_factory(logged=False, do_quit=False) as pair:
with expect_codes_in_exception("503"):
await pair.client.get_current_directory()
@pytest.mark.asyncio
... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/pyxmpp2/constants.py | gthreepwood/yats | 267 | 3340522 | <gh_stars>100-1000
#
# (C) Copyright 2011 <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful... | 0 | 0 | 0 | 0 | 0 | 0 |
projects/Task011_Kits/scripts/prepare.py | joeranbosma/nnDetection | 242 | 3340534 | import shutil
import os
import sys
from pathlib import Path
from loguru import logger
from nndet.io import save_json
from nndet.io.prepare import create_test_split
from nndet.utils.check import env_guard
from nndet.utils.info import maybe_verbose_iterable
@env_guard
def main():
det_data_dir = Path(os.getenv('de... | 0 | 0 | 0 | 0 | 0 | 0 |
models/ClassicNetwork/csp_densenet.py | Dou-Yu-xuan/deep-learning-visal | 150 | 3340540 | # -*- coding: UTF-8 -*-
"""
An unofficial implementation of DenseNet with pytorch
@<NAME> 2020_09_15
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchsummary import summary
from models.blocks.conv_bn import BN_Conv2d
from models.blocks.dense_block import DenseBlock, CSP_DenseBlock
cla... | 10 | 12 | 0 | 0 | 22 | 0 |
plenum/test/plugin/demo_plugin/helper.py | IDunion/indy-plenum | 148 | 3340547 | from __future__ import annotations
from plenum.common.config_helper import PNodeConfigHelper
from plenum.test.test_node import ensure_node_disconnected, TestNode, checkNodesConnected, ensureElectionsDone
from plenum.common.constants import TXN_TYPE, DATA
from plenum.test.helper import sdk_gen_request, sdk_sign_and_sub... | 3 | 3 | 0 | 0 | 6 | 0 |
core/java_structure.py | evandrocoan/Javatar | 142 | 3340559 | <reponame>evandrocoan/Javatar
import sublime
import os
from .action_history import ActionHistory
from .helper_service import HelperService
from .java_utils import JavaClassPath, JavaUtils
from .state_property import StateProperty
from .settings import Settings
from ..parser.GrammarParser import GrammarParser
class _J... | 0 | 0 | 0 | 0 | 0 | 0 |
python/kwiver/vital/util/initial_plugin_path.py | mwoehlke-kitware/kwiver | 176 | 3340597 | import kwiver
import os
def get_initial_plugin_path() -> object:
kwiver_module_path = os.path.dirname(os.path.abspath(kwiver.__file__))
plugin_path = os.path.join(kwiver_module_path, 'lib', 'kwiver', 'modules')
return plugin_path
| 0 | 1 | 0 | 0 | 1 | 0 |
sphinx/doc_examples/quantum_LinearOperator-example.py | anton-buyskikh/QuSpin | 195 | 3340623 | from __future__ import print_function, division
#
import sys,os
quspin_path = os.path.join(os.getcwd(),"../../")
sys.path.insert(0,quspin_path)
#
from quspin.operators import quantum_LinearOperator # Hamiltonians and operators
from quspin.basis import spin_basis_1d # Hilbert space spin basis
import numpy as np # generi... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/tokenizers/unicode_script/test_tokenizer.py | howl-anderson/MicroTokenizer | 136 | 3340632 | from MicroTokenizer.tokenizers.unicode_script.tokenizer import UnicodeScriptTokenizer
def test_tokenizer():
result = UnicodeScriptTokenizer.script("汉")
assert result
tokenizer = UnicodeScriptTokenizer()
result = tokenizer.segment("王小明在2021年的时候参加了TsingHua University的活动,并听了이효리的にほんご。")
print(result)... | 0 | 0 | 0 | 0 | 0 | 0 |
flextensor/testing/others/hand-craft/config_yolo1_cpu.py | imxian/FlexTensor | 135 | 3340646 | <reponame>imxian/FlexTensor
"""
Configurations of high performance schedules for conv2d_nchw
YOLO convolution layer 24
Target Intel CPU
====================================
**Author**: `<NAME>`
the terms used below:
------------------------------------
method: fuse_and_bind --> only use blockIdx.x, vthread.x, threadI... | 0 | 0 | 0 | 0 | 0 | 0 |
nndet/planning/properties/__init__.py | joeranbosma/nnDetection | 242 | 3340683 | from nndet.planning.properties.instance import analyze_instances
from nndet.planning.properties.intensity import (
analyze_intensities,
get_modalities,
)
from nndet.planning.properties.medical import (
get_sizes_and_spacings_after_cropping,
get_size_reduction_by_cropping,
)
from nndet.planning.p... | 0 | 0 | 0 | 0 | 0 | 0 |
crawler/crawler/spiders/persist_queue.py | g0v/tw-rental-house-data | 125 | 3340707 | import uuid
import scrapy
import traceback
from django.db import connection
from rental.models import HouseTS, Vendor
from rental import models
from crawlerrequest.models import RequestTS
from crawlerrequest.enums import RequestType
class PersistQueue(object):
queue_length = 30
n_live_spider = 0
def __ini... | 0 | 0 | 0 | 0 | 0 | 1 |
backtest/r_breaker.py | jingmouren/QuantResearch | 623 | 3340729 | '''
https://programming.vip/docs/r-breaker-strategy-for-commodity-futures.html
https://github.com/myquant/strategy/blob/master/R-Breaker/info.md
The R-Breaker strategy was developed by <NAME> and published in 1994.
After that, it was ranked one of the top 10 most profitable trading strategies
by Fut... | 0 | 1 | 0 | 3 | 4 | 0 |
python/finufft/__init__.py | wendazhou/finufft | 134 | 3340732 | """The Python interface to FINUFFT is divided into two parts: the simple
interface (through the ``nufft*`` functions) and the more advanced plan
interface (through the ``Plan`` class). The former allows the user to perform
an NUFFT in a single call while the latter allows for more efficient reuse of
resources when the ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/pipeline/composer_api_tests.py | francois-baptiste/pydatalab | 198 | 3340810 | <filename>tests/pipeline/composer_api_tests.py
# Copyright 2018 Google Inc. 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
#... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | dwalton76/rubiks-cube-tracker | 124 | 3340816 | from setuptools import setup
setup(
name="rubikscubetracker",
version="1.0.0",
description="Extract rubiks cube RGB values from an image/video",
keywords="rubiks cube color opencv",
url="https://github.com/dwalton76/rubiks-cube-tracker",
author="dwalton76",
author_email="<EMAIL>",
licen... | 0 | 0 | 0 | 0 | 0 | 0 |
termius/cloud/__init__.py | Leo-Ryu/termius-cli | 169 | 3340823 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
"""Package with user data manipulation command."""
| 0 | 0 | 0 | 0 | 0 | 0 |
pylons/templating.py | KinSai1975/Menira.py | 118 | 3340882 | """Render functions and helpers
Render functions and helpers
============================
:mod:`pylons.templating` includes several basic render functions,
:func:`render_mako`, :func:`render_genshi` and :func:`render_jinja2`
that render templates from the file-system with the assumption that
variables intended for th... | 0 | 0 | 0 | 0 | 0 | 1 |
code/qual_eval.py | Program-Bear/WalkingNetwork | 210 | 3340897 | <reponame>Program-Bear/WalkingNetwork
import numpy as np
import argparse
from tqdm import tqdm
import json
class QualAnalysis(object):
def __init__(self):
self.kb_facts = self.read_kb_facts(kb_file) if use_kb else None
self.text_kb_facts = self.read_text_kb_facts(text_kb_file) if use_text else No... | 0 | 0 | 0 | 0 | 0 | 0 |
aim/web/migrations/versions/517a45b2e62c_.py | avkudr/aim | 2,195 | 3340910 | """empty message
Revision ID: 517a45b2e62c
Revises: <PASSWORD>
Create Date: 2021-08-31 20:58:39.490140
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '517a45b2e62c'
down_revision = '<PASSWORD>c<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/vaex-contrib/vaex/contrib/io/gbq.py | sethvargo/vaex | 337 | 3340929 | from __future__ import annotations
'''
A module for I/O between Vaex and Google BigQuery.
Requires:
- google.cloud.bigquery
- google.cloud.bigquery_storage
'''
import tempfile
import pyarrow as pa
import pyarrow.parquet as pq
from vaex.docstrings import docsubst
import vaex.utils
google = vaex.utils.optional_imp... | 14 | 2 | 0 | 0 | 16 | 0 |
Z - Tool Box/LaZagne/Windows/lazagne/softwares/sysadmin/cyberduck.py | dfirpaul/Active-Directory-Exploitation-Cheat-Sheet-1 | 1,290 | 3340938 | <filename>Z - Tool Box/LaZagne/Windows/lazagne/softwares/sysadmin/cyberduck.py
# -*- coding: utf-8 -*-
import base64
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import Win32CryptUnprotectData
from lazagne.config.constant import con... | 0 | 0 | 0 | 0 | 0 | 0 |
crowdsourcing/tasks.py | Kyeongan/crowdsource-platform | 138 | 3340945 | from __future__ import division
import json
from collections import OrderedDict
from datetime import timedelta
from decimal import Decimal, ROUND_UP
import numpy as np
from django.conf import settings
from django.contrib.auth.models import User
from django.db import connection, transaction
from django.db.models impor... | 0 | 0 | 0 | 0 | 0 | 0 |
FWCore/Integration/test/testProcessBlockNonStrict2_cfg.py | Purva-Chaudhari/cmssw | 852 | 3340998 | <filename>FWCore/Integration/test/testProcessBlockNonStrict2_cfg.py
# This is a test that things will run OK if we disable the
# the strict merging requirement for ProcessBlock products
# in the ProductRegistry merging function. This
# requirement is currently always enforced and this configuration
# will fail.
import... | 0 | 0 | 0 | 0 | 0 | 0 |
chris5641/0004/GetWordNum.py | saurabh896/python-1 | 3,976 | 3341004 | # -*- coding: utf-8 -*-
"""
第 0004 题:任一个英文的纯文本文件,统计其中的单词出现的个数。
"""
import re
__author__ = 'Chris5641'
def get_num() -> object:
num = 0
f = open('test.txt', 'r')
for line in f.readlines():
num += len(re.findall(r'[a-zA-Z0-9\']+', line))
f.close()
return num
if __name__ == '__main__':
... | 0 | 1 | 0 | 0 | 1 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.