max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
fts/fluxrss.py
AetherBlack/Veille-Informatique
0
1400
<gh_stars>0 #!/usr/bin/python3 from urllib.parse import urlparse import feedparser import requests import asyncio import discord import hashlib import os from const import CHANNEL_RSS, WAIT_UNTIL_NEW_CHECK, \ SQLITE_FOLDER_NAME, SQLITE_FILE_NAME from fts.database import Database from fts.cleandatabase import Cle...
2.75
3
src/poke_env/player/player_network_interface.py
kiyohiro8/poke-env
0
1401
<filename>src/poke_env/player/player_network_interface.py<gh_stars>0 # -*- coding: utf-8 -*- """This module defines a base class for communicating with showdown servers. """ import json import logging import requests import websockets # pyre-ignore from abc import ABC from abc import abstractmethod from asyncio impo...
2.265625
2
data/external/repositories/42139/KDDCup13Track2-master/blocking.py
Keesiu/meta-kaggle
0
1402
#!/usr/bin/env python from common import * import csv import argparse from unidecode import unidecode from nameparser import constants as npc from collections import defaultdict import cPickle as pickle import re stopwords_custom = set(['document', 'preparation', 'system', 'consortium', 'committee', 'international', '...
2.40625
2
resources/dot_PyCharm/system/python_stubs/-762174762/PySide/QtCore/QAbstractFileEngineIterator.py
basepipe/developer_onboarding
1
1403
<reponame>basepipe/developer_onboarding<gh_stars>1-10 # encoding: utf-8 # module PySide.QtCore # from C:\Python27\lib\site-packages\PySide\QtCore.pyd # by generator 1.147 # no doc # imports import Shiboken as __Shiboken class QAbstractFileEngineIterator(__Shiboken.Object): # no doc def currentFileInfo(self, ...
1.617188
2
tests/conftest.py
priyatharsan/beyond
0
1404
<gh_stars>0 import numpy as np from pytest import fixture, mark, skip from unittest.mock import patch from pathlib import Path from beyond.config import config from beyond.dates.eop import Eop from beyond.frames.stations import create_station from beyond.io.tle import Tle from beyond.propagators.keplernum import Keple...
1.875
2
diofant/tests/integrals/test_heurisch.py
Electric-tric/diofant
1
1405
<filename>diofant/tests/integrals/test_heurisch.py import pytest from diofant import (Add, Derivative, Ei, Eq, Function, I, Integral, LambertW, Piecewise, Rational, Sum, Symbol, acos, asin, asinh, besselj, cos, cosh, diff, erf, exp, li, log, pi, ratsimp, r...
2.28125
2
kornia/color/adjust.py
carlosb1/kornia
0
1406
from typing import Union import torch import torch.nn as nn from kornia.color.hsv import rgb_to_hsv, hsv_to_rgb from kornia.constants import pi def adjust_saturation_raw(input: torch.Tensor, saturation_factor: Union[float, torch.Tensor]) -> torch.Tensor: r"""Adjust color saturation of an image. Expecting input ...
2.640625
3
pommerman/__init__.py
rmccann01/playground
725
1407
<filename>pommerman/__init__.py '''Entry point into the pommerman module''' import gym import inspect from . import agents from . import configs from . import constants from . import forward_model from . import helpers from . import utility from . import network gym.logger.set_level(40) REGISTRY = None def _register...
2.46875
2
demo/demo/accounts/urls.py
caravancoop/rest-auth-toolkit
1
1408
from django.urls import path from .views import ProfileView urlpatterns = [ path('', ProfileView.as_view(), name='user-profile'), ]
1.585938
2
test/test_pipeline/components/classification/test_passive_aggressive.py
vardaan-raj/auto-sklearn
1
1409
import sklearn.linear_model from autosklearn.pipeline.components.classification.passive_aggressive import \ PassiveAggressive from .test_base import BaseClassificationComponentTest class PassiveAggressiveComponentTest(BaseClassificationComponentTest): __test__ = True res = dict() res["default_iris...
2.40625
2
tensorflow_datasets/structured/dart/dart_test.py
harsh020/datasets
1
1410
<gh_stars>1-10 # coding=utf-8 # Copyright 2020 The TensorFlow Datasets Authors. # # 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 r...
2.265625
2
exp/exp_informer_dad.py
AdamLohSg/GTA
8
1411
from data.data_loader_dad import ( NASA_Anomaly, WADI ) from exp.exp_basic import Exp_Basic from models.model import Informer from utils.tools import EarlyStopping, adjust_learning_rate from utils.metrics import metric from sklearn.metrics import classification_report import numpy as np import torch import t...
2.078125
2
tests/components/mysensors/conftest.py
liangleslie/core
30,023
1412
<filename>tests/components/mysensors/conftest.py """Provide common mysensors fixtures.""" from __future__ import annotations from collections.abc import AsyncGenerator, Callable, Generator import json from typing import Any from unittest.mock import AsyncMock, MagicMock, patch from mysensors import BaseSyncGateway fr...
2.171875
2
Detect.py
SymenYang/Vanish-Point-Detect
2
1413
import cv2 as cv import numpy as np import copy import math import Edges import INTPoint eps = 1e-7 votes = {} Groups = [] VPoints = [] Centers = [] Cluster = [] voters = {} def getEdges(image): #moved to Edges.py return Edges.getEdges(image) def getLines(edges): #moved to Edges.py return Edges.getLin...
2.453125
2
test/test_files.py
wanasit/labelling-notebook
0
1414
def test_list_example_directory(client): response = client.get("/api/files") assert response.status_code == 200 file_list = response.get_json() assert len(file_list) == 5 assert file_list[0]['key'] == 'image_annotated.jpg' assert file_list[1]['key'] == 'image.jpg' assert file_list[2]['key']...
2.515625
3
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/course_groups/migrations/0001_initial.py
osoco/better-ways-of-thinking-about-software
3
1415
from django.db import migrations, models from django.conf import settings from opaque_keys.edx.django.models import CourseKeyField class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( ...
1.953125
2
kafka-rockset-integration/generate_customers_data.py
farkaskid/recipes
21
1416
<filename>kafka-rockset-integration/generate_customers_data.py """Generate Customer Data""" import csv import random from config import MIN_CUSTOMER_ID, MAX_CUSTOMER_ID ACQUISITION_SOURCES = [ 'OrganicSearch', 'PaidSearch', 'Email', 'SocialMedia', 'Display', 'Affiliate' 'Referral' ] def...
3.296875
3
parsl/tests/test_error_handling/test_resource_spec.py
MatthewBM/parsl
0
1417
<gh_stars>0 import parsl from parsl.app.app import python_app from parsl.tests.configs.local_threads import config from parsl.executors.errors import UnsupportedFeatureError from parsl.executors import WorkQueueExecutor @python_app def double(x, parsl_resource_specification={}): return x * 2 def test_resource(n...
2.359375
2
cincan/file_tool.py
cincanproject/cincan-command
1
1418
<filename>cincan/file_tool.py import pathlib import re from typing import List, Optional, Dict, Set, Tuple, Iterable import shlex class FileMatcher: """Match files based on a pattern""" def __init__(self, match_string: str, include: bool): self.match_string = match_string self.exact = '*' not i...
3.171875
3
aws_interface/cloud/auth/set_me.py
hubaimaster/aws-interface
53
1419
from cloud.permission import Permission, NeedPermission from cloud.message import error # Define the input output format of the function. # This information is used when creating the *SDK*. info = { 'input_format': { 'session_id': 'str', 'field': 'str', 'value?': 'str', }, 'output_...
2.59375
3
doc/gallery-src/analysis/run_blockMcnpMaterialCard.py
celikten/armi
1
1420
<filename>doc/gallery-src/analysis/run_blockMcnpMaterialCard.py """ Write MCNP Material Cards ========================= Here we load a test reactor and write each component of one fuel block out as MCNP material cards. Normally, code-specific utility code would belong in a code-specific ARMI plugin. But in this case,...
2.46875
2
life_line_chart/_autogenerate_data.py
mustaqimM/life_line_chart
0
1421
import names import os import datetime from random import random def generate_gedcom_file(): """generate some gedcom file""" db = {} db['n_individuals'] = 0 db['max_individuals'] = 8000 db['n_families'] = 0 db['yougest'] = None gedcom_content = """ 0 HEAD 1 SOUR Gramps 2 VERS 3.3.0 2 N...
3.375
3
arcade/examples/sprite_bullets_enemy_aims.py
LiorAvrahami/arcade
1
1422
<filename>arcade/examples/sprite_bullets_enemy_aims.py """ Show how to have enemies shoot bullets aimed at the player. If Python and Arcade are installed, this example can be run from the command line with: python -m arcade.examples.sprite_bullets_enemy_aims """ import arcade import math import os SCREEN_WIDTH = 800...
3.828125
4
app1.py
FreakX23/EBook_Training
0
1423
<reponame>FreakX23/EBook_Training<filename>app1.py # This Part will gather Infos and demonstrate the use of Variables. usrName = input("What is your Name?") usrAge = int(input("What is your Age?")) usrGPA = float(input("What is your GPA?")) print () #cheap way to get a new line print ("Hello, %s" % (usrName)) print ("D...
3.84375
4
borze.py
AmitHasanShuvo/Programming
8
1424
<reponame>AmitHasanShuvo/Programming a = input() a = a.replace('--', '2') a = a.replace('-.', '1') a = a.replace('.', '0') print(a)  
3.734375
4
distalg/message.py
charlesemurray/DistributedProgramming
0
1425
<reponame>charlesemurray/DistributedProgramming class Message: def __init__(self, from_channel=None, **kwargs): self._channel = from_channel if kwargs is not None: for key, value in kwargs.items(): setattr(self, key, value) @property def carrier(self): re...
2.96875
3
myenv/lib/python3.5/site-packages/tests/handlers/logging/logging_tests.py
rupeshparab/techscan
1
1426
<reponame>rupeshparab/techscan import logging from opbeat.handlers.logging import OpbeatHandler from opbeat.utils.stacks import iter_stack_frames from tests.helpers import get_tempstoreclient from tests.utils.compat import TestCase class LoggingIntegrationTest(TestCase): def setUp(self): self.client = ge...
2.421875
2
amnesia/modules/mime/model.py
silenius/amnesia
4
1427
# -*- coding: utf-8 -*- # pylint: disable=E1101 from sqlalchemy import sql from sqlalchemy import orm from sqlalchemy.orm.exc import NoResultFound from .. import Base # http://www.iana.org/assignments/media-types/media-types.xhtml class MimeMajor(Base): """Mime major""" def __init__(self, name): ...
2.140625
2
apps/goods/views_base.py
sunwei19910119/DjangoShop
3
1428
# encoding: utf-8 from goods.models import Goods from django.views.generic.base import View class GoodsListView(View): def get(self, request): """ 通过django的view实现商品列表页 """ json_list = [] goods = Goods.objects.all()[:10] # for good in goods: # json_dict ...
2.25
2
launcher/src/main/scripts/bin/launcher.py
iyersathya/airlift
0
1429
<filename>launcher/src/main/scripts/bin/launcher.py #!/usr/bin/env python import errno import os import platform import sys import traceback from fcntl import flock, LOCK_EX, LOCK_NB from optparse import OptionParser from os import O_RDWR, O_CREAT, O_WRONLY, O_APPEND from os.path import basename, dirname, exists, rea...
2.375
2
code/sim/test.py
vectorcrumb/Ballbot_IEE2913
0
1430
<filename>code/sim/test.py from direct.showbase.ShowBase import ShowBase from direct.task import Task from direct.actor.Actor import Actor import numpy as np class MyApp(ShowBase): def __init__(self): ShowBase.__init__(self) # Load environment model self.scene = self.loader.loadModel("mode...
2.375
2
run_locally.py
nationalarchives/tdr-service-unavailable
0
1431
<filename>run_locally.py from app import app app.run()
1.289063
1
src/pandas_profiling/model/describe.py
briangrahamww/pandas-profiling
0
1432
"""Organize the calculation of statistics for each series in this DataFrame.""" import warnings from datetime import datetime from typing import Optional import pandas as pd from tqdm.auto import tqdm from visions import VisionsTypeset from pandas_profiling.config import Settings from pandas_profiling.model.correlati...
2.453125
2
maxOfferNum.py
Ruanxingzhi/King-of-Pigeon
0
1433
<gh_stars>0 import operator class Std(object): def __init__(self): self.name = '' self.offerNum = 0 self.offers = [] stds = [] stdsDict = {} index = 0 def readStd(name,camper): global stds global stdsDict global index if name not in stdsDict: newStd = Std() ...
3.125
3
tabnine-vim/third_party/ycmd/third_party/python-future/setup.py
MrMonk3y/vimrc
2
1434
#!/usr/bin/env python from __future__ import absolute_import, print_function import os import os.path import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() NAME = "futur...
1.695313
2
url_shortener/src/__init__.py
Andrelpoj/hire.me
0
1435
<gh_stars>0 from flask import Flask from .extensions import db from .routes import short from . import config def create_app(): """ Creates Flask App, connect to Database and register Blueprint of routes""" app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = config.DATABASE_CONNECTION_URI...
2.46875
2
python-百度翻译调用/Baidu_translate/com/translate/baidu/stackoverflow_question_handler.py
wangchuanli001/Project-experience
12
1436
import requests from bs4 import BeautifulSoup import urllib.request import os import random import time def html(url): user_agents = [ 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11', 'Opera/9.25 (Windows NT 5.1; U; en)', 'Mozilla/4.0 (compatible...
2.84375
3
Research/data_loader.py
ALEXKIRNAS/Kaggle-C-CORE-Iceberg-Classifier-Challenge
0
1437
import os import numpy as np import pandas as pd from keras.utils import to_categorical from sklearn.model_selection import KFold, train_test_split def load_data(path): train = pd.read_json(os.path.join(path, "./train.json")) test = pd.read_json(os.path.join(path, "./test.json")) return (train, test) ...
2.65625
3
polyaxon_cli/cli/experiment.py
tiagopms/polyaxon-cli
0
1438
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import sys import click import rhea from polyaxon_cli.cli.getters.experiment import ( get_experiment_job_or_local, get_project_experiment_or_local ) from polyaxon_cli.cli.upload import upload from polyaxon_cli.client imp...
1.945313
2
Problem_09.py
Habbo3/Project-Euler
0
1439
""" A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. """ solved = False for a in range(1, 1000): for b in range(1, 1000): for c in range(...
4.21875
4
fanscribed/apps/transcripts/tests/test_transcripts.py
fanscribed/fanscribed
8
1440
<filename>fanscribed/apps/transcripts/tests/test_transcripts.py from decimal import Decimal import os from django.test import TestCase from unipath import Path from ....utils import refresh from ...media import tests from ..models import Transcript, TranscriptMedia MEDIA_TESTDATA_PATH = Path(tests.__file__).parent....
2.328125
2
buildAncestryFeats.py
BurcinSayin/pf2
0
1441
from bs4 import BeautifulSoup import requests import json import datetime import codecs import re featHolder = {} featHolder['name'] = 'Pathfinder 2.0 Ancestry feat list' featHolder['date'] = datetime.date.today().strftime("%B %d, %Y") def get_details(link): res = requests.get(link) res.raise_for_status() ...
3.140625
3
Random_item_selector_module.py
Jahronimo/public_question_book_framework
0
1442
<reponame>Jahronimo/public_question_book_framework import random def Randomise(questions_lists): import random import secrets secure_random = secrets.SystemRandom()# creates a secure random object. group_of_items = questions_lists num_qustion_t_select = num_question_to_dis...
4.125
4
python_scrape/test_functions.py
jose-marquez89/tech-job-landscape
0
1443
import unittest import scrape class TestScrapeFunctions(unittest.TestCase): def test_build_url(self): url = scrape.build_url("indeed", "/jobs?q=Data+Scientist&l=Texas&start=10", join_next=True) expected = ("https://www.indeed.com/" ...
3.125
3
Level1_Input_Output/10172.py
jaeheeLee17/BOJ_Algorithms
0
1444
def main(): print("|\_/|") print("|q p| /}") print("( 0 )\"\"\"\\") print("|\"^\"` |") print("||_/=\\\\__|") if __name__ == "__main__": main()
2.578125
3
Whats Cooking/KaggleCookingComparison.py
rupakc/Kaggle-Compendium
17
1445
<reponame>rupakc/Kaggle-Compendium # -*- coding: utf-8 -*- """ Created on Sat Dec 26 13:20:45 2015 Code for Kaggle What's Cooking Competition It uses the following classifiers with tf-idf,hashvectors and bag_of_words approach 1. Adaboost 2. Extratrees 3. Bagging 4. Random Forests @author: <NAME> """ import numpy as np...
2.59375
3
pybook/ch10/DeckOfCards.py
YanhaoXu/python-learning
2
1446
import random # Create a deck of cards deck = [x for x in range(52)] # Create suits and ranks lists suits = ["Spades", "Hearts", "Diamonds", "Clubs"] ranks = ["Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"] # Shuffle the cards random.shuffle(deck) # Display the first four card...
3.734375
4
nlpgnn/gnn/RGCNConv.py
ojipadeson/NLPGNN
263
1447
<gh_stars>100-1000 #! usr/bin/env python3 # -*- coding:utf-8 -*- """ @Author:<NAME> Usage: node_embeddings = tf.random.normal(shape=(5, 3)) adjacency_lists = [ tf.constant([[0, 1], [2, 4], [2, 4]], dtype=tf.int32), tf.constant([[0, 1], [2, 4], [2, 4]], dtype=tf.int32) ...
2.25
2
automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py
erikwebb/google-cloud-python
1
1448
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
1.09375
1
addons/project/models/project.py
SHIVJITH/Odoo_Machine_Test
0
1449
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import ast from datetime import timedelta, datetime from random import randint from odoo import api, fields, models, tools, SUPERUSER_ID, _ from odoo.exceptions import UserError, AccessError, ValidationError, RedirectWa...
1.960938
2
app/config.py
Maethorin/pivocram
5
1450
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Config File for enviroment variables """ import os from importlib import import_module class Config(object): """ Base class for all config variables """ DEBUG = False TESTING = False DEVELOPMENT = False CSRF_ENABLED = True SQLALCHEMY_DATABAS...
2.71875
3
initial_load.py
hongyuanChrisLi/RealEstateDBConvert
0
1451
<reponame>hongyuanChrisLi/RealEstateDBConvert from mysql_dao.select_dao import SelectDao as MysqlSelectDao from postgres_dao.ddl_dao import DdlDao from postgres_dao.dml_dao import DmlDao as PsqlDmlDao psql_ddl_dao = DdlDao() mysql_select_dao = MysqlSelectDao() psql_dml_dao = PsqlDmlDao() psql_ddl_dao.create_tables() ...
1.859375
2
pytests/docs/docs.py
ramalingam-cb/testrunner
0
1452
import time import logger from basetestcase import BaseTestCase from couchbase_helper.documentgenerator import DocumentGenerator from membase.api.rest_client import RestConnection from couchbase_helper.documentgenerator import BlobGenerator class DocsTests(BaseTestCase): def setUp(self): super(DocsTests, ...
2.25
2
lichthi.py
truongaxin123/lichthidtu
0
1453
from bs4 import BeautifulSoup import requests from urllib.request import urlretrieve ROOT = 'http://pdaotao.duytan.edu.vn' def get_url_sub(sub, id_, page): all_td_tag = [] for i in range(1, page+1): print('http://pdaotao.duytan.edu.vn/EXAM_LIST/?page={}&lang=VN'.format(i)) r = requests.get('ht...
3.171875
3
appengine/uploader/main.py
isabella232/feedloader
5
1454
# coding=utf-8 # Copyright 2021 Google LLC. # # 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 ...
1.757813
2
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/transforms.py
BadDevCode/lumberyard
1,738
1455
<filename>dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/transforms.py """ Implement transformation on Numba IR """ from __future__ import absolute_import, print_function from collections import namedtuple, defaultdict import logging from numba.analysis import compute_cfg_from_blocks, find_top_level_loops f...
1.914063
2
tests/test_masked_inference_wsi_dataset.py
HabibMrad/MONAI
1
1456
<filename>tests/test_masked_inference_wsi_dataset.py import os import unittest from unittest import skipUnless import numpy as np from numpy.testing import assert_array_equal from parameterized import parameterized from monai.apps.pathology.datasets import MaskedInferenceWSIDataset from monai.apps.utils import downlo...
2.015625
2
manga_py/providers/doujins_com.py
paulolimac/manga-py
1
1457
<gh_stars>1-10 from manga_py.provider import Provider from .helpers.std import Std class DoujinsCom(Provider, Std): img_selector = '#image-container img.doujin' def get_archive_name(self) -> str: return 'archive' def get_chapter_index(self) -> str: return '0' def get_main_content(se...
2.359375
2
src/urh/ui/delegates/CheckBoxDelegate.py
awesome-archive/urh
1
1458
<reponame>awesome-archive/urh<filename>src/urh/ui/delegates/CheckBoxDelegate.py from PyQt5.QtCore import QModelIndex, QAbstractItemModel, Qt, pyqtSlot from PyQt5.QtWidgets import QItemDelegate, QWidget, QStyleOptionViewItem, QCheckBox class CheckBoxDelegate(QItemDelegate): def __init__(self, parent=None): ...
1.96875
2
neural_network/backup_casestudy/denbigh/tf_RNN.py
acceleratedmaterials/AMDworkshop_demo
5
1459
# -*- coding: utf-8 -*- ''' Framework: Tensorflow Training samples: 1600 Validation samples: 400 RNN with 128 units Optimizer: Adam Epoch: 100 Loss: Cross Entropy Activation function: Relu for network and Soft-max for regression Regularization: Drop-out, keep_prob = 0.8 Accuracy of Validation set: 95% ''' from __future...
2.84375
3
code/tests/test_tile_tf.py
Nocty-chan/cs224n-squad
2
1460
import numpy as np import tensorflow as tf H = 2 N = 2 M = 3 BS = 10 def my_softmax(arr): max_elements = np.reshape(np.max(arr, axis = 2), (BS, N, 1)) arr = arr - max_elements exp_array = np.exp(arr) print (exp_array) sum_array = np.reshape(np.sum(exp_array, axis=2), (BS, N, 1)) return exp_arra...
3.453125
3
specutils/tests/test_smoothing.py
hamogu/specutils
0
1461
import numpy as np import pytest from astropy import convolution from scipy.signal import medfilt import astropy.units as u from ..spectra.spectrum1d import Spectrum1D from ..tests.spectral_examples import simulated_spectra from ..manipulation.smoothing import (convolution_smooth, box_smooth, ...
2.296875
2
modules/interpolator.py
buulikduong/1d_sgl_solver
0
1462
<reponame>buulikduong/1d_sgl_solver<gh_stars>0 """Module interpolating mathematical functions out of support points""" from scipy.interpolate import interp1d, lagrange, CubicSpline def interpolator(x_sup, y_sup, method): """Interpolates a mathematical function from a given set of points using either linear, ...
2.890625
3
frappe/patches/v13_0/remove_web_view.py
chentaoz/frappe
3,755
1463
<filename>frappe/patches/v13_0/remove_web_view.py import frappe def execute(): frappe.delete_doc_if_exists("DocType", "Web View") frappe.delete_doc_if_exists("DocType", "Web View Component") frappe.delete_doc_if_exists("DocType", "CSS Class")
1.429688
1
games.py
cpratim/DSA-Research-Paper
0
1464
import json import matplotlib.pyplot as plt from pprint import pprint import numpy as np from scipy.stats import linregress from util.stats import * with open('data/game_stats.json', 'r') as f: df = json.load(f) X, y = [], [] for match, stats in df.items(): home, away = stats['home'], stats['away'] if home['mp'] !...
2.921875
3
src/generate_data.py
gycggd/leaf-classification
0
1465
import os import numpy as np import pandas as pd import tensorflow as tf from keras.preprocessing.image import ImageDataGenerator from keras.preprocessing.image import img_to_array, load_img from keras.utils.np_utils import to_categorical from sklearn.model_selection import StratifiedShuffleSplit from sklearn.preproces...
2.765625
3
2650-construindo-muralhas.py
ErickSimoes/URI-Online-Judge
0
1466
<reponame>ErickSimoes/URI-Online-Judge<gh_stars>0 # -*- coding: utf-8 -*- n, w = map(int, input().split()) for _ in range(n): entrada = input() last_space = entrada.rfind(' ') if int(entrada[last_space:]) > w: print(entrada[:last_space])
3.40625
3
tests/assemblers/test_ensemble.py
yarix/m2cgen
1
1467
<gh_stars>1-10 from sklearn import ensemble from m2cgen import assemblers, ast from tests import utils def test_single_condition(): estimator = ensemble.RandomForestRegressor(n_estimators=2, random_state=1) estimator.fit([[1], [2]], [1, 2]) assembler = assemblers.RandomForestModelAssembler(estimator) ...
2.109375
2
setup.py
Parquery/pynumenc
1
1468
<reponame>Parquery/pynumenc """A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ import os from setuptools import setup, find_packages, Extension import pynumenc_meta # pylint: disable=redefined-builtin here = os.path.abspath(os...
1.65625
2
Models/License-Plate-Recognition-Nigerian-vehicles-master/License-Plate-Recognition-Nigerian-vehicles-master/ocr.py
nipunjain099/AutoGuard
147
1469
import numpy as np from skimage.transform import resize from skimage import measure from skimage.measure import regionprops class OCROnObjects(): def __init__(self, license_plate): character_objects = self.identify_boundary_objects(license_plate) self.get_regions(character_objects, license_pla...
3.078125
3
project/server/models.py
mvlima/flask-jwt-auth
0
1470
# project/server/models.py import jwt import datetime from project.server import app, db, bcrypt class User(db.Model): """ User Model for storing user related details """ __tablename__ = "users" id = db.Column(db.Integer, primary_key=True, autoincrement=True) username = db.Column(db.String(255), uni...
2.75
3
letsencrypt/setup.py
ccppuu/certbot
1
1471
<reponame>ccppuu/certbot import codecs import os import sys from setuptools import setup from setuptools import find_packages def read_file(filename, encoding='utf8'): """Read unicode from given file.""" with codecs.open(filename, encoding=encoding) as fd: return fd.read() here = os.path.abspath(os...
2.078125
2
elastalert/alerts.py
dekhrekh/elastalert
0
1472
<filename>elastalert/alerts.py<gh_stars>0 # -*- coding: utf-8 -*- import copy import datetime import json import logging import subprocess import sys import warnings from email.mime.text import MIMEText from email.utils import formatdate from smtplib import SMTP from smtplib import SMTP_SSL from smtplib import SMTPAuth...
2.1875
2
tests/unit/python/fledge/services/core/scheduler/test_scheduler.py
DDC-NDRS/fledge-iot_fledge
69
1473
<filename>tests/unit/python/fledge/services/core/scheduler/test_scheduler.py<gh_stars>10-100 # -*- coding: utf-8 -*- # FLEDGE_BEGIN # See: http://fledge-iot.readthedocs.io/ # FLEDGE_END import asyncio import datetime import uuid import time import json from unittest.mock import MagicMock, call import sys import copy...
1.984375
2
problem_solving/python/algorithms/greedy/marcs_cakewalk.py
kcc3/hackerrank-solutions
0
1474
def marcs_cakewalk(calorie): """Hackerrank Problem: https://www.hackerrank.com/challenges/marcs-cakewalk/problem Marc loves cupcakes, but he also likes to stay fit. Each cupcake has a calorie count, and Marc can walk a distance to expend those calories. If Marc has eaten j cupcakes so far, after eating a c...
4.21875
4
coronaindiatracker/coronatracker/views.py
ankitgoswami23/CoronaIndiaTracker
2
1475
from django.shortcuts import render import requests from bs4 import BeautifulSoup def corona_data(request): "Testaaaa" corona_html = requests.get("https://www.mygov.in/covid-19") soup = BeautifulSoup(corona_html.content, 'html.parser') state_wise_data = soup.find_all('div', class_='views-row') inf...
2.390625
2
compare.py
geohackweek/ghw2019_wiggles
3
1476
# Script tests GPD model using UW truth data # Test outputs: # - type of event tested [EQS, EQP, SUS, SUP, THS, THP, SNS, SNP, PXS, PXP] # - phase [P, S, N] Note: N - not detected # - model time offset (t_truth - t_model_pick) import numpy import math import string import datetime import sys import os im...
2.5
2
ultitrackerapi/ultitrackerapi/extract_and_upload_video.py
atheheath/ultitracker-api
0
1477
import argparse import boto3 import datetime import json import os import posixpath import re import shutil import tempfile import uuid from concurrent import futures from multiprocessing import Pool from ultitrackerapi import get_backend, get_logger, get_s3Client, video backend_instance = get_backend() logger = ...
1.992188
2
Chapter03/scikit_soft_voting_2knn.py
PacktPublishing/Hands-On-Ensemble-Learning-with-Python
31
1478
# --- SECTION 1 --- # Import the required libraries from sklearn import datasets, naive_bayes, svm, neighbors from sklearn.ensemble import VotingClassifier from sklearn.metrics import accuracy_score # Load the dataset breast_cancer = datasets.load_breast_cancer() x, y = breast_cancer.data, breast_cancer.target ...
3.015625
3
API/migrations/0005_alter_news_date_time_alter_news_headline.py
kgarchie/ReSTful-Django-API
0
1479
<gh_stars>0 # Generated by Django 4.0.3 on 2022-03-23 14:31 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('API', '0004_alter_news_date_time_alter_news_headline'), ] operations = [ migrations.AlterField( mode...
1.648438
2
qiskit/ml/datasets/iris.py
stefan-woerner/aqua
504
1480
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2020. # # 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 derivat...
2.625
3
tests/h/views/api_auth_test.py
discodavey/h
0
1481
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import json import mock import pytest from oauthlib.oauth2 import InvalidRequestFatalError from oauthlib.common import Request as OAuthRequest from pyramid import httpexceptions from h._compat import urlparse from h.exceptions import O...
2.265625
2
tools/build/v2/test/conditionals.py
juslee/boost-svn
1
1482
<filename>tools/build/v2/test/conditionals.py #!/usr/bin/python # Copyright 2003 <NAME> # Copyright 2002, 2003, 2004 <NAME> # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Test conditional properties. import Bo...
1.960938
2
examples/setuptools-rust-starter/tests/test_setuptools_rust_starter.py
FriendRat/pyo3
1
1483
<gh_stars>1-10 from setuptools_rust_starter import PythonClass, ExampleClass def test_python_class() -> None: py_class = PythonClass(value=10) assert py_class.value == 10 def test_example_class() -> None: example = ExampleClass(value=11) assert example.value == 11
2.171875
2
spiders/juejin_spider.py
sunhailin-Leo/TeamLeoX_BlogsCrawler
0
1484
import time from typing import Dict, List, Tuple, Optional from utils.logger_utils import LogManager from utils.str_utils import check_is_json from config import LOG_LEVEL, PROCESS_STATUS_FAIL from utils.time_utils import datetime_str_change_fmt from utils.exception_utils import LoginException, ParseDataException from...
2
2
NAS/PaddleSlim/train_supernet.py
naviocean/SimpleCVReproduction
923
1485
from paddle.vision.transforms import ( ToTensor, RandomHorizontalFlip, RandomResizedCrop, SaturationTransform, Compose, HueTransform, BrightnessTransform, ContrastTransform, RandomCrop, Normalize, RandomRotation ) from paddle.vision.datasets import Cifar100 from paddle.io import DataLoader from paddle.optimizer...
2.125
2
slashtags/mixins/commands.py
Myst1c-a/phen-cogs
0
1486
<reponame>Myst1c-a/phen-cogs<filename>slashtags/mixins/commands.py<gh_stars>0 """ MIT License Copyright (c) 2020-present phenom4n4n 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 restric...
1.140625
1
prgm6.py
pooja-bs-3003/Project_21
0
1487
str1= input("enter a string :") l1 ="" for i in str1 [::-1]: l1 = i+l1 print(l1) if str1 == l1: print("string is a palindrome") else : print("string is not a palindrome")
4.15625
4
product_spider/spiders/jk_spider.py
Pandaaaa906/product_spider
0
1488
import json import re from string import ascii_uppercase from time import time from urllib.parse import urljoin import scrapy from more_itertools import first from scrapy import Request from product_spider.items import JkProduct, JKPackage from product_spider.utils.functions import strip class JkPrdSpider(scrapy.Sp...
2.671875
3
env/LaneChangeEnv_v2.py
byq-luo/Lane_change_RL
4
1489
import os import sys import random import datetime import gym from gym import spaces import numpy as np from env.IDM import IDM from env.Road import Road from env.Vehicle import Vehicle import math # add sumo/tools into python environment if 'SUMO_HOME' in os.environ: tools = os.path.join(os.environ['SUMO_HOME'], ...
2.328125
2
cidr/o365/o365.py
jblukach/distillery
1
1490
import boto3 import ipaddress import json import logging import os import requests import uuid logger = logging.getLogger() logger.setLevel(logging.INFO) dynamodb = boto3.resource('dynamodb') table = dynamodb.Table(os.environ['DYNAMODB_TABLE']) client = boto3.client('ssm') def downloader(instance, latest, param...
2.03125
2
exampleinc.py
zulip/finbot
7
1491
<reponame>zulip/finbot #!/usr/bin/python from money import * c = Company("Example Inc") c.add_flow(FixedCost("Initial Cash", -500000)) c.add_flow(FixedCost("Incorporation", 500)) c.add_flow(ConstantCost("Office", 50000)) c.add_flow(PeriodicCost("Subscription", 4000, "2012-01-05", 14)) c.add_flow(DelayedCost("2012-02-0...
3.03125
3
guardian/validators.py
dawid1stanek/guardian
0
1492
#!/usr/bin/env python import os import socket import subprocess import argparse import logging LOGGER = logging.getLogger(__name__) class ValidatorError(Exception): pass def ping(address): try: subprocess.check_call(('ping', '-c 1', '-W 1', address), stdout=subprocess.PIPE, stderr=subprocess.PIPE)...
3.046875
3
tests/data/udf_noop.py
Open-EO/openeo-geopyspark-driver
12
1493
<reponame>Open-EO/openeo-geopyspark-driver from openeo.udf import XarrayDataCube def apply_datacube(cube: XarrayDataCube, context: dict) -> XarrayDataCube: return cube
1.664063
2
StateGoHome.py
LHGames-2017/superintelligence
0
1494
from PlayerState import * from pathFinder import PathFinder from StateLook4Resources import * class StateGoHome(PlayerState): """ State Implementation: has a resource and go back home """ def __init__(self, player): self.player = player self.player.setTarget(self.player.playerData.HouseLocati...
2.9375
3
hoomd/mpcd/test-py/stream_slit_test.py
schwendp/hoomd-blue
2
1495
<reponame>schwendp/hoomd-blue # Copyright (c) 2009-2019 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause License. # Maintainer: mphoward import unittest import numpy as np import hoomd from hoomd import md from hoomd import mpcd # unit tests for...
2.1875
2
tests/functional/model_models.py
haoyuchen1992/CourseBuilder
1
1496
# Copyright 2013 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 ...
1.96875
2
torchaudio/functional/functional.py
iseessel/audio
0
1497
# -*- coding: utf-8 -*- import io import math import warnings from typing import Optional, Tuple import torch from torch import Tensor from torchaudio._internal import module_utils as _mod_utils import torchaudio __all__ = [ "spectrogram", "griffinlim", "amplitude_to_DB", "DB_to_amplitude", "comp...
2.453125
2
src/status_node.py
Faust-Wang/vswarm
21
1498
#!/usr/bin/env python3 from __future__ import absolute_import, division, print_function import curses import sys from collections import deque from datetime import datetime import numpy as np import rospy from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus from geometry_msgs.msg import PoseStamped from ...
2.140625
2
bin/boxplot_param.py
mo-schmid/MIALab
0
1499
<filename>bin/boxplot_param.py import argparse import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pandas as pd from pathlib import Path class ResultParam(): """Result Parameter""" def __init__(self, path: Path, param_str: str): """Initializes a new instance of th...
3.03125
3