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
data_catalog/query_translation.py
trustedanalytics-ng/data-catalog
1
12782551
<gh_stars>1-10 # # Copyright (c) 2015 Intel Corporation # # 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...
2.046875
2
tests/sentry/interfaces/template/tests.py
davedash/sentry
1
12782552
<filename>tests/sentry/interfaces/template/tests.py # -*- coding: utf-8 -*- from __future__ import absolute_import import mock from sentry.interfaces import Template from sentry.models import Event from tests.base import TestCase class TemplateTest(TestCase): def test_serialize(self): interface = Temp...
2.28125
2
testdata/PyFEM-master/pyfem/elements/SLSutils.py
Konstantin8105/py4go
3
12782553
<filename>testdata/PyFEM-master/pyfem/elements/SLSutils.py<gh_stars>1-10 ############################################################################ # This Python file is part of PyFEM, the code that accompanies the book: # # # # 'Non-Lin...
1.820313
2
wrapper_plugins/jpeg2000_wrapper/tests/test_wrapper.py
spongezhang/maskgen
0
12782554
<reponame>spongezhang/maskgen import unittest import os import numpy as np class TestToolSet(unittest.TestCase): def test_all(self): from jpeg2000_wrapper import opener img = np.random.randint(0, high=255, size=(2000, 4000, 6), dtype=np.uint8) opener.writeJPeg2000File('foo.jp2',img) ...
2.34375
2
instResp/libInst.py
mikehagerty/instResp
0
12782555
import numpy as np from instResp.polezero import polezero from instResp.plotResp import plotResponse import os import logging logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO) logger = logging.getLogger(__name__) ''' This module contains a collection of non-bulletproof codes for cr...
2.625
3
package/awesome_panel/database/__init__.py
mycarta/awesome-panel
1
12782556
<reponame>mycarta/awesome-panel<gh_stars>1-10 """Imports to be exposed to the user of the package are listed here""" from awesome_panel.database.authors import AUTHORS from awesome_panel.database.resources import RESOURCES from awesome_panel.database.tags import TAGS
1.320313
1
radiobear/Constituents/parameters.py
david-deboer/radiobear
3
12782557
<filename>radiobear/Constituents/parameters.py from argparse import Namespace def setpar(kwargs): par = Namespace(units='dBperkm', path='./', verbose=False) for p, v in kwargs.items(): setattr(par, p, v) return par
2.09375
2
log_it/extensions/marshmallow/log.py
tanj/log-it
0
12782558
# -*- coding: utf-8 -*- # pylint: disable=R0903, C0115 """ log_it.extensions.marshmallow.log --------------------------------- Marshmallow Log Models :copyright: (c) 2021 by <NAME> :license: BSD, see LICENSE for more details """ from datetime import datetime from marshmallow_sqlalchemy import SQ...
2
2
goodgames/games/migrations/0006_auto_20171128_0232.py
mooshu1x2/goodgames
0
12782559
<filename>goodgames/games/migrations/0006_auto_20171128_0232.py # -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-11-28 02:32 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('games', '0005_auto_20171128_...
1.679688
2
messaging/schema/accounts.py
sunhoww/messaging
1
12782560
# -*- coding: utf-8 -*- import graphene from graphene import relay from graphene_gae import NdbObjectType, NdbConnectionField from messaging.models.accounts import ( Account as AccountModel, create, update, delete, generate_api_key, ) from messaging.models.services import Service as ServiceModel f...
2.15625
2
algocodes/algocodes/pipelines.py
Brucechen13/freeprograms
0
12782561
<reponame>Brucechen13/freeprograms<filename>algocodes/algocodes/pipelines.py<gh_stars>0 # -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html from algocodes.items import QuestionIte...
2.609375
3
benderopt/tests/base/test_optimization_problem.py
tchar/benderopt
66
12782562
<reponame>tchar/benderopt from benderopt.base import OptimizationProblem, Parameter, Observation from benderopt.utils import get_test_optimization_problem from benderopt.validation.utils import ValidationError import pytest def test_optimization_problem(): parameter1 = Parameter( name="param1", category="...
2.25
2
checker.py
mmagnus/rna-tools-webserver-engine
1
12782563
<reponame>mmagnus/rna-tools-webserver-engine<filename>checker.py #!/usr/bin/python """ Add to crontab * 18 * * * /home/rnamasonry/rnamasonryweb_env/rnamasonry-web/checker.sh """ import os import subprocess import smtplib from sendmail_secret import USERNAME, PASSWORD from django.core.wsgi import get_wsgi_application ...
2.15625
2
TwitterDatabase/Executables/make_database_tables.py
AdamSwenson/TwitterProject
0
12782564
<reponame>AdamSwenson/TwitterProject<gh_stars>0 """ Created by adam on 6/30/18 """ __author__ = 'adam' import environment as env from TwitterDatabase.DatabaseAccessObjects.DataConnections import MySqlConnection from TwitterDatabase.Models.TweetORM import create_db_tables if __name__ == '__main__': credential_file...
1.929688
2
tests/test_get_excluded_volume.py
salilab/IHMValidation
0
12782565
<reponame>salilab/IHMValidation import os,sys,glob import unittest import pandas as pd from io import StringIO, BytesIO sys.path.insert(0, "../master/pyext/src/") from validation import get_input_information,utility from validation.excludedvolume import get_excluded_volume import warnings def ignore_warnings(test_fu...
2.1875
2
PEASTrainer.py
SiqiT/PEAS
0
12782566
<reponame>SiqiT/PEAS import sys import pandas as pd import numpy as np import PEASUtil from sklearn.neural_network import MLPClassifier from sklearn import preprocessing import joblib import argparse import os from sklearn.impute import SimpleImputer from sklearn.model_selection import train_test_split from sklearn.mo...
2.4375
2
pikuli/input/input_emulator.py
NVoronchev/pikuli
0
12782567
<filename>pikuli/input/input_emulator.py # -*- coding: utf-8 -*- import time from contextlib import contextmanager from pikuli import logger from .constants import ( DELAY_KBD_KEY_PRESS, DELAY_KBD_KEY_RELEASE, DELAY_MOUSE_BTN_PRESS, DELAY_MOUSE_BTN_RELEASE, DELAY_MOUSE_CLICK, DELAY_MOUSE_DOUBLE_CLICK, DEL...
2.171875
2
src/validators.py
ostjen/kalendar
0
12782568
from datetime import datetime import argparse from config.settings import DEFAULT_TIME_FORMAT def valid_date(date): try: return datetime.strptime(date,DEFAULT_TIME_FORMAT) except ValueError: msg = "Not a valid date: '{0}'.".format(date) raise argparse.ArgumentTypeError(msg)
3.296875
3
examples/ae_mnist_tf.py
AtrejuArtax/aironsuit
3
12782569
<filename>examples/ae_mnist_tf.py # Databricks notebook source import os import numpy as np from hyperopt import Trials from tensorflow.keras.datasets import mnist from tensorflow.keras.optimizers import Adam from aironsuit.design.utils import choice_hp from aironsuit.suit import AIronSuit from airontools.constructor...
2.40625
2
authentik/crypto/api.py
BeryJu/passbook
15
12782570
"""Crypto API Views""" from typing import Optional from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import load_pem_private_key from cryptography.x509 import load_pem_x509_certificate from django.http.response import HttpResponse from django.urls import reverse...
1.898438
2
Gathered CTF writeups/ptr-yudai-writeups/2019/HSCTF_6/tux's_kitchen/solve.py
mihaid-b/CyberSakura
1
12782571
from ptrlib import * candidate = [ [chr(j) for j in range(1, 0x100)] for i in range(71) ] while True: sock = Socket("crypto.hsctf.com", 8112) sock.recvuntil("[") l = list(map(lambda x: int(x.rstrip(b"L")), sock.recv().rstrip().rstrip(b"]").split(b", "))) # original treasure index = 0 f...
2.265625
2
loadNN.py
JOTELLECHEA/neural_networks
0
12782572
<reponame>JOTELLECHEA/neural_networks<filename>loadNN.py<gh_stars>0 # Written By : <NAME> # Adviser : <NAME>, Phd # Research : Using a neural network to maximize the significance of tttHH production. # Description: Script that loads NN weights and makes 1D plots that apply NN score for a cut. # Reference :http://...
2.390625
2
conversation_data.py
Fortune-Adekogbe/Diary-bot
0
12782573
<reponame>Fortune-Adekogbe/Diary-bot class ConversationData: def __init__( self, timestamp: str = None, channel_id: str = None, prompted_for_user_name: bool = False, ): self.timestamp = timestamp self.channel_id = channel_id self.prompted_for_user_name = p...
2.25
2
app/order/tests/test_items_api.py
mayk93/rest-api-example-1
0
12782574
from django.test import TestCase from django.urls import reverse from rest_framework.test import APIClient from rest_framework import status from core.models import Item from order.serializers import ItemSerializer from core.tests.user_test_utils import create_user from core.tests.order_test_utils import sample_order...
2.53125
3
quspin/basis/basis_1d/_check_1d_symm.py
anton-buyskikh/QuSpin
195
12782575
<gh_stars>100-1000 from __future__ import print_function, division import warnings def flip_sublat(opstr,indx,lat=0): sign = 1 opstr = [str(s) for s in opstr] for s,i,j in zip(opstr,indx,range(len(indx))): if ((i % 2) == (lat % 2)): if (s in ['z','y']): sign *= -1 elif (s == "+"): opstr[j] = '-...
2.625
3
databuild/tests/test_functions.py
databuild/databuild
1
12782576
from unittest import TestCase from databuild import settings from databuild.adapters.locmem.models import LocMemBook from databuild.functions import data settings.LANGUAGES['noop'] = 'databuild.environments.noop.NoopEnvironment' class FunctionsTestCase(TestCase): def test_cross(self): a_data = [ ...
2.453125
2
Environment.py
markriedl/westworld
18
12782577
<reponame>markriedl/westworld import random import copy import sys from Observation import * from Reward import * from Action import * class Environment: # The grid world # 1 = walls # 4 = goal (non-terminal) # 5 = goal (terminal) map = [[1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 4, 0, 0,...
3.109375
3
Picard_1_121.py
meissnert/StarCluster-Plugins
1
12782578
from starcluster.clustersetup import ClusterSetup from starcluster.logger import log class PicardInstaller(ClusterSetup): def run(self, nodes, master, user, user_shell, volumes): for node in nodes: log.info("Installing Picard tools 1.121 on %s" % (node.alias)) node.ssh.execute('wget -c -P /opt/software/picard...
2.046875
2
fennec.py
keuv-grvl/fennec
2
12782579
#!/usr/bin/env python3 import argparse import sys from fennec import __version__ as VERSION, __citation__ as CITATION if __name__ == "__main__": parser = argparse.ArgumentParser( prog="fennec", description="Fennec", formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) parser...
2.59375
3
code/waldo/viz/network/degrees.py
amarallab/waldo
0
12782580
<reponame>amarallab/waldo # -*- coding: utf-8 -*- """ MWT collision graph visualizations - Degree order """ from __future__ import ( absolute_import, division, print_function, unicode_literals) import six from six.moves import (zip, filter, map, reduce, input, range) import numpy as np import matplotlib.pyplot...
2.328125
2
Contacts/migrations/0003_auto_20180303_0254.py
simonescob/Agendadj
0
12782581
# Generated by Django 2.0.2 on 2018-03-03 02:54 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('Contacts', '0002_auto_20180303_0253'), ] operations = [ migrations.RenameModel( old_name='Contacts', new_name='Contact', ...
1.710938
2
eval.py
bchiu/Simple-CenterNet
2
12782582
<reponame>bchiu/Simple-CenterNet<filename>eval.py<gh_stars>1-10 from models import centernet from data import dataset from utils import common from evaluation import metric import numpy as np import torch import cv2 import argparse import os if __name__ == "__main__": parser = argparse.ArgumentParser(description...
2.28125
2
2021/day4/day4a.py
apaolillo/adventofcode
1
12782583
# INPUT_FILENAME = 'sample-input.txt' INPUT_FILENAME = 'input.txt' def get_data(input_filename): with open(input_filename, 'r') as input_file: file_content = input_file.read() file_lines = file_content.strip().splitlines() list_numbers = [int(e) for e in file_lines[0].strip()....
3.734375
4
pylark/api_service_link_open_mini_program.py
chyroc/pylark
7
12782584
<filename>pylark/api_service_link_open_mini_program.py<gh_stars>1-10 # Code generated by lark_sdk_gen. DO NOT EDIT. from pylark.lark_request import RawRequestReq, _new_method_option from pylark import lark_type, lark_type_sheet, lark_type_approval import attr import typing import io @attr.s class OpenMiniProgramReq(...
1.90625
2
etc/bc_hansard/count.py
robinsax/punctuator3
1
12782585
# coding: utf-8 ''' <NAME>ard corpus magnitude check. ''' import io import os def main(): count = 0 for filename in os.listdir('./data/bc_hansard'): with io.open('./data/bc_hansard/%s'%filename, encoding='utf-8') as text_file: count += len(text_file.read().split()) print(count) if __name__ == '__main__': mai...
2.984375
3
pbsmmapi/season/ingest_season.py
WGBH/django-pbsmmapi
0
12782586
<gh_stars>0 from ..api.api import get_PBSMM_record from ..abstract.helpers import set_json_serialized_field, fix_non_aware_datetime def process_season_record(obj, instance, origin='season'): """ Take the data returned from a single Season's API JSON content and map it to a PBSMMEpisode database record. ""...
2.34375
2
Leetcode/Pascal's Triangle/triangle.py
vedant-jad99/GeeksForGeeks-DSA-Workshop-Complete-Codes
1
12782587
""" Given an integer numRows, return the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it. Example: Input - 5 Output - [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]] Explanation - 1 1 1 ...
4.0625
4
rmp/models/raw/__init__.py
rji-futures-lab/django-rmp-data
0
12782588
<reponame>rji-futures-lab/django-rmp-data from .tbl import ( tblExecutiveSummaries, tblFacility, tblRMPError, tblRMPTrack, ) from .tblS1 import ( tblS1Facilities, tblS1FlammableMixtureChemicals, tblS1ProcessChemicals, tblS1Process_NAICS, tblS1Processes, ) from .tblS2 import tblS2Toxi...
1.210938
1
core/library/image.py
RenatYakublevich/equilibrium
6
12782589
from PIL import Image, ImageDraw, ImageFont class _Image: @staticmethod def draw_picture_with_text(image_file, text, size, x, y): image = Image.open(image_file) draw = ImageDraw.Draw(image) width_image, height_image = image.size font = ImageFont.truetype("arial.ttf", size=size)...
3.375
3
tests/plugins/musicbrainz/resources/partial_date.py
jtpavlock/moe
14
12782590
<filename>tests/plugins/musicbrainz/resources/partial_date.py """Musicbrainz release containing partial dates.""" # flake8: noqa # date only includes the year partial_date_year = { "release": { "id": "112dec42-65f2-3bde-8d7d-26deddde10b2", "title": "The Chronic", "status": "Official", ...
1.664063
2
bot2/retweet_twitterbot.py
tmcellfree/twitterbot_repo
0
12782591
<reponame>tmcellfree/twitterbot_repo<filename>bot2/retweet_twitterbot.py # Reference adapted from https://www.digitalocean.com/community/tutorials/how-to-create-a-twitterbot-with-python-3-and-the-tweepy-library # Import Tweepy, sleep, credentials.py import tweepy from time import sleep from datetime import datetime imp...
2.796875
3
qdev_wrappers/majorana/conductance_measurements.py
GateBuilder/qdev-wrappers
13
12782592
# Module file for conductance measurements with the # SR830. Implementing the good ideas of <NAME> from typing import Union, Optional from time import sleep import numpy as np import qcodes as qc from qcodes.instrument.parameter import Parameter from qdev_wrappers.sweep_functions import _do_measurement from qcodes.ins...
2.75
3
pta/migrations/0003_initial.py
cptdanko/ptaApp
0
12782593
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Role' db.create_table('pta_role', ( ('id', se...
2.234375
2
sheep-vs-dog-master - DDPG/env.py
CuteWans/sheep-vs-dog
0
12782594
<filename>sheep-vs-dog-master - DDPG/env.py import numpy as np import gym from gym.envs.classic_control import rendering class ChaseEnv(object): viewer = None dt = 0.1 alpha_bound = [0, np.pi] state_dim = 2 action_dim = 1 def __init__(self, _R, _r, _sheepTheta, _sheepV, _dogTheta, _dogV): ...
2.671875
3
app/extension/confluence/extension_locust.py
dsplugins/dc-app-performance-toolkit
0
12782595
import re from locustio.common_utils import init_logger, confluence_measure logger = init_logger(app_type='confluence') @confluence_measure def app_specific_action(locust): r = locust.client.get('/plugin/report') # navigate to page content = r.content.decode('utf-8') # parse page content token_patter...
2.3125
2
main.py
jackyhobingo/QuestionnaireAddUp
0
12782596
<filename>main.py from questionnaire import Questionnaire if __name__ == "__main__": question = Questionnaire() question.run()
1.875
2
morghulis/caltech_faces/downloader.py
the-house-of-black-and-white/pyWiderFace
17
12782597
<reponame>the-house-of-black-and-white/pyWiderFace import logging import os from morghulis.downloader import BaseDownloader from morghulis.os_utils import ensure_dir log = logging.getLogger(__name__) IMAGES_URL = 'http://www.vision.caltech.edu/Image_Datasets/faces/faces.tar' class CaltechFacesDownloader(BaseDownlo...
2.375
2
tests/ezros/test_exception.py
achillesrasquinha/rosutils
0
12782598
# imports - module imports from ezros.exception import ( EzrosError ) # imports - test imports import pytest def test_ezros_error(): with pytest.raises(EzrosError): raise EzrosError
1.914063
2
py/ae/semantic/style.py
skepner/ae
0
12782599
<reponame>skepner/ae<filename>py/ae/semantic/style.py<gh_stars>0 import sys import ae_backend # ====================================================================== def style_with_one_modifier(chart: ae_backend.chart_v3.Chart, style_name: str, selector: dict[str, object], modifier: dict[str, object], priority: int)...
1.945313
2
scripts/schema.py
FlowersOfChina/You-Money
0
12782600
import MySQLdb ''' 数据库实例目前部署一台就可以了,然后通过这个脚本进行数据的同步操作 插入测试数据 每次开发完成新的模块 使用这个脚本 动态的添加数据 ''' # 重新创建模式 为 create 追加数据使用 append 删除并且重新添加 为 refresh DB_OP_MODE = "append" # 数据库链接用户名 MYSQL_CONN_NAME = "mysqlname" #数据库远程链接地址 MYSQL_CONN_ADDR = "mysqllinkpath" #数据库登录密码 MYSQL_CONN_PASSWORD = "<PASSWORD>" #数据库默认的链接编码...
3.46875
3
ecco_v4_py/test/test_plot_utils.py
owang01/ECCOv4-py
24
12782601
<reponame>owang01/ECCOv4-py """ Test routines for the tile plotting """ from __future__ import division, print_function import warnings from pathlib import Path import numpy as np import pytest import ecco_v4_py as ecco from .test_common import llc_mds_datadirs,get_test_array_2d from ecco_v4_py.plot_utils import assig...
2.125
2
python_3/synthetic_data_generator/experiments/expr_generate_random_id_numbers.py
duttashi/valet
0
12782602
<filename>python_3/synthetic_data_generator/experiments/expr_generate_random_id_numbers.py # -*- coding: utf-8 -*- """ Created on Tue Oct 13 08:10:33 2020 @author: Ashish """ import random, string n=10 def generate_random_id_numbers() -> list: """ Generate dummy Health Service ID numbers similar to NHS 10...
3.609375
4
src/skmultiflow/data/stats/aggregate_stats_buffered.py
trajkova-elena/scikit-multiflow
1
12782603
<reponame>trajkova-elena/scikit-multiflow import numpy as np class StdDev: """ Taken from https://math.stackexchange.com/questions/198336/how-to-calculate-standard-deviation-with-streaming-inputs """ def __init__(self, buffer): self.buffer = buffer def register_value(self, value): ...
3.1875
3
src/data/graph/gremlin.py
kabirkhan/cloud_compete_graph
1
12782604
import re class GremlinQueryBuilder: """ Basic functions to build gremlin queries that add vertices and edges """ @classmethod def name_to_id(cls, name): if '(' in name: name = name[name.idx('(') - 1] return name.replace(' ', '-') @classmethod def...
2.796875
3
alter_wrapper.py
anish-lu-yihe/MINERVA
0
12782605
<filename>alter_wrapper.py import numpy as np import alternative_implementations.minerva2 as dwhite54 from rpy2.robjects.packages import SignatureTranslatedAnonymousPackage import rpy2.robjects.numpy2ri as rpyn class model1(dwhite54.Minerva2): def reset(self): self.__init__(self.features_per_trace) ...
2.25
2
alipay/create_direct_pay_by_user/dpn/urls.py
freeyoung/django-alipay3
0
12782606
from django.conf.urls import url from alipay.create_direct_pay_by_user.dpn import views urlpatterns = [ url(r'^$', views.dpn, {'item_check_callable': None}, name='alipay-dpn'), ]
1.484375
1
buyfree_mall/buyfree_mall/apps/areas/views.py
GalphaXie/E-commerce
0
12782607
from django.shortcuts import render # Create your views here. from rest_framework.viewsets import ReadOnlyModelViewSet from rest_framework_extensions.cache.mixins import CacheResponseMixin from areas.models import Area from areas.serializers import AreaSerializer, SubAreaSerializer class AreasViewSet(CacheResponseM...
2.171875
2
lean/components/config/project_config_manager.py
InvestWeMust/lean-cli
76
12782608
<filename>lean/components/config/project_config_manager.py # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean CLI v1.0. Copyright 2021 QuantConnect Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. ...
2.234375
2
leetcode/python/easy/p953_isAlienSorted.py
kefirzhang/algorithms
0
12782609
class Solution: def isAlienSorted(self, words, order) -> bool: def compareStr(word1, word2): len1 = len(word1) len2 = len(word2) i = 0 while i < len2: if i > len1 - 1: return False if helper_order.index(word2...
3.375
3
hexa/catalog/management/commands/sync_datasources_worker.py
qgerome/openhexa-app
4
12782610
<gh_stars>1-10 from dpq.commands import Worker from hexa.catalog.queue import datasource_sync_queue class Command(Worker): queue = datasource_sync_queue
1.515625
2
tools_box/_hr/report/employee_advance_report/employee_advance_report.py
maisonarmani/Tools-Box
4
12782611
# Copyright (c) 2013, <EMAIL> and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe def execute(filters=None): columns = [ "Posting Date:Date:100", "Employee:Link/Employee:100", "Employee Name:Data:150", "Advance A...
2.21875
2
generate.py
mdsitton/pyogl
0
12782612
<filename>generate.py from pglgen import pycodegen # This is somewhat of a hack # It injects a variable into the builtins so that its simple # to check for code genetation in the types system. try: import __builtin__ as builtins except ImportError: import builtins builtins.genGL = True def main(): apis = ...
1.96875
2
src/main/python/data_pipeline/open_data_raw_material_price/core.py
meowpunch/bobsim-research
2
12782613
<reponame>meowpunch/bobsim-research import pandas as pd from data_pipeline.dtype import dtype, reduction_dtype from data_pipeline.translate import translation from data_pipeline.unit import get_unit from utils.handle_null import NullHandler from utils.logging import init_logger from utils.s3_manager.manage import S3Ma...
2.421875
2
shop.py
Veikkosuhonen/craftify
0
12782614
<gh_stars>0 from app import db from flask import abort from datetime import datetime import player import item class ShopItems(db.Model): __tablename__ = "shop_item" shopid = db.Column(db.Integer, db.ForeignKey("shop.id"), primary_key=True) itemid = db.Column(db.Integer, db.ForeignKey("item.id"), primary_k...
2.484375
2
modox/command.py
lukpazera/modox
11
12782615
""" This module is a wrapper for lxu.command.BasicCommand. It improves and simplifies command implementations including popups, sPresetText fields, and Form Command Lists. This is based on Adam O'Hern Commander code but is vastly enhanced. https://github.com/adamohern/commander """ import time impor...
2.75
3
sbin/autograder/grade_item_main_runner.py
scopeInfinity/Submitty
0
12782616
<reponame>scopeInfinity/Submitty import configparser import json import os import tempfile import shutil import subprocess import stat import time import dateutil import dateutil.parser import urllib.parse import string import random import socket import zipfile import traceback from submitty_utils import dateutils, g...
1.804688
2
tests/test_parsingtools.py
raymanP/matlab2python
49
12782617
<reponame>raymanP/matlab2python import numpy as np import unittest from matlabparser.parsing_tools import * # --------------------------------------------------------------------------------} # --- # --------------------------------------------------------------------------------{ class TestParsingTools(unitt...
2.78125
3
iotronic/wamp/functions.py
smartmeio/stack4things-openstack-iotronic
1
12782618
# Copyright 2017 MDSLAB - University of Messina # 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 # # U...
1.804688
2
test/test_encryption.py
tunapro1234/DBEX
0
12782619
<filename>test/test_encryption.py from dbex.encryption import DBEXMetaEncrypter from dbex.encryption import DebugEncrypter from dbex.__init__ import Decoder # sonunda from dbex.__init__ import Encoder import unittest import os enc, dec = Encoder(), Decoder() class TestEncryption(unittest.TestCase): test_file = ...
2.890625
3
examples/00-basic/07_composite.py
normanrichardson/section-properties
1
12782620
r""" .. _ref_ex_composite: Creating a Composite Section ---------------------------- Create a section of mixed materials. The following example demonstrates how to create a composite cross-section by assigning different material properties to various regions of the mesh. A steel 310UB40.4 is modelled with a 50Dx600W...
3.015625
3
leetcode/Array/1380. Lucky Numbers in a Matrix.py
yanshengjia/algorithm
23
12782621
""" Given a m * n matrix of distinct numbers, return all lucky numbers in the matrix in any order. A lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column. Example 1: Input: matrix = [[3,7,8],[9,11,13],[15,16,17]] Output: [15] Explanation: 15 is the only l...
3.9375
4
src/api_segura/data/__init__.py
PythonistaMX/py261
0
12782622
<gh_stars>0 CARRERAS = ['Arquitectura', 'Diseño', 'Sistemas', 'Derecho', 'Actuaría']
1.25
1
otree_manager/otree_manager/om/processors.py
chkgk/otree_manager
2
12782623
<filename>otree_manager/otree_manager/om/processors.py from django.conf import settings as django_conf def settings(request): """Provides easy access to settings stored in django conf""" return { 'DEMO': django_conf.DEMO, 'MIN_WORKERS': django_conf.MIN_WORKERS, 'MAX_WORKERS': django_con...
1.6875
2
disqus/get_posts.py
tonnpa/opleaders
1
12782624
<reponame>tonnpa/opleaders #!/usr/bin/env python3 """ This script retrieves all the posts pertaining to the threads in the .json files. Constraints 1. the files in the SRC_DIR_PATH has to follow a specific naming convention: FROM_DATE in (yyyy-mm-dd) _ file_number [0-9999] .json 2. the maximum number of...
2.59375
3
pylxd/deprecated/tests/utils.py
AdamIsrael/pylxd
0
12782625
# Copyright (c) 2015 Canonical Ltd # # 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.828125
2
asana/resources/project_memberships.py
FiyaFly/python-asana
266
12782626
<filename>asana/resources/project_memberships.py from .gen.project_memberships import _ProjectMemberships class ProjectMemberships(_ProjectMemberships): """Project Memberships resource""" def find_by_project(self, project, params={}, **options): """Returns the compact project membership records for t...
2.6875
3
Python_Arcade/Exercises/Platformer/platformer.py
npinak/Python-Projects
1
12782627
<reponame>npinak/Python-Projects """ https://learn.arcade.academy/en/latest/chapters/29_platformers/platformers.html """ import random import arcade SPRITE_SCALING = 0.5 TILE_SCALING = 0.5 GRAVITY = 0.5 DEFAULT_SCREEN_WIDTH = 800 DEFAULT_SCREEN_HEIGHT = 600 SCREEN_TITLE = "Sprite Move with Scrolling Screen Example...
3.890625
4
alembic/versions/71d46639309e_create_words_and_results_tables.py
TutorExilius/pyWordle
1
12782628
"""create_words_and_results_tables Revision ID: 71d46639309e Revises: Create Date: 2022-03-29 15:45:02.382574 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "71d46639309e" down_revision = None branch_labels = None depends_on = None def upgrade(): # ### co...
2
2
App/ui_updates.py
Wizard-collab/wizard
0
12782629
<filename>App/ui_updates.py # coding: utf8 # Import PyQt5 libraries from PyQt5 import QtWidgets, QtCore, QtGui # Import wizard gui libraries from gui.updates import Ui_Form # Import wizard core libraries from wizard.vars import defaults from wizard.prefs.main import prefs from wizard.tools import log from wizard.var...
2.3125
2
rtf.py
Rafiot/viper-modules
5
12782630
# -*- coding: utf-8 -*- ''' Code based on the python-oletools package by <NAME> 2012-10-18 http://www.decalage.info/python/oletools ''' import os import tempfile from viper.common.abstracts import Module from viper.core.session import __sessions__ try: from oletools.rtfobj import RtfObjParser from oletools ...
2.390625
2
papers/tests/test_views.py
anujmittal94/spiresearch
1
12782631
<reponame>anujmittal94/spiresearch from django.test import TestCase, Client from django.urls import reverse from papers.models import UserRead, UserProject from accounts.models import CustomUser class IndexViewTest(TestCase): def test_index(self): response = self.client.get(reverse('index')) self...
2.390625
2
phantasy/library/operation/lattice.py
archman/phantasy
0
12782632
<filename>phantasy/library/operation/lattice.py<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """Lattice operations, including: 1. loading lattice 2. creating lattice """ import logging import os import re import time from fnmatch import fnmatch from phantasy.facility.frib import INI_DICT from pha...
2.171875
2
aria/utils/process.py
enricorusso/incubator-ariatosca
1
12782633
# 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"); you may not use ...
2.109375
2
notes-n-resources/Data-Structures-N-Algo/_DS-n-Algos/Interview-Problems/LeetCode/ReverseBits.py
side-projects-42/INTERVIEW-PREP-COMPLETE
13
12782634
<reponame>side-projects-42/INTERVIEW-PREP-COMPLETE<filename>notes-n-resources/Data-Structures-N-Algo/_DS-n-Algos/Interview-Problems/LeetCode/ReverseBits.py class Solution: def reverseBits(self, n: int) -> int: s = str(bin(n)) s = s[2:] s = "0" * (32 - len(s)) + s s = int(s[::-1], 2) ...
3.609375
4
addons/network/model/digitalocean/Size.py
nhomar/odoo-network
0
12782635
class Size(object): def __init__(self, client_id="", api_key=""): self.client_id = client_id self.api_key = api_key self.name = None self.id = None self.memory = None self.cpu = None self.disk = None self.cost_per_hour = None self.cost_per_mon...
2.640625
3
backend/instruments/api/v1/urls.py
codepanda64/logs-and-metas-for-stations
0
12782636
<reponame>codepanda64/logs-and-metas-for-stations from django.urls import path, include from rest_framework.routers import DefaultRouter, SimpleRouter from . import views app_name = "instruments" router = SimpleRouter() router.register(r"models", views.InstrumentModelViewSet) router.register(r"entities", views.Instr...
2.109375
2
7-assets/past-student-repos/_Individual-Projects/Computer-Architecture-Notes-master/lectureII/beejMachine.py
eengineergz/Lambda
1
12782637
import sys PRINT_BEEJ = 1 HALT = 2 PRINT_NUM = 3 SAVE = 4 PRINT_REGISTER = 5 ADD = 6 ''' SAVE takes 2 arguments saves value in [ARG1] to register [ARG2] ''' register = [0] * 8 memory = [0] * 128 # 128 bytes of RAM def load_memory(filename): try: address = 0 ...
3.578125
4
authentik/outposts/migrations/0001_initial.py
BeryJu/passbook
15
12782638
<gh_stars>10-100 # Generated by Django 3.1 on 2020-08-25 20:45 import uuid import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ("authentik_core", "0008_auto_20200824_1532"), ] operations = [ ...
1.898438
2
juggling_management/config/juggling_management.py
geniusupgrader/juggling_management
1
12782639
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label":_("Juggling Management"), "items": [ { "type": "doctype", "name": "Jugglingtrick_juggling_management", "label": _("Juggl...
1.875
2
Enhance Main Window (877182321) by Arthur-Milchior/consts.py
kb1900/Anki-Addons
1
12782640
QUEUE_SCHED_BURIED = -3 QUEUE_USER_BURIED = -2 QUEUE_SUSPENDED = -1 QUEUE_NEW_CRAM = 0 QUEUE_LRN = 1 QUEUE_REV = 2 QUEUE_DAY_LRN = 3 QUEUE_PREVIEW = 4
1
1
n_factorial.py
leantab/algorithms
0
12782641
# find the Kth factorial of N n = 4 k = 22 def find_k_fact(n, k): k -= 1 # we are using base 0 permutation = [] unused = list(range(1, n+1)) fact = [1]*(n+1) for i in range(1, n+1): fact[i] = i*fact[i-1] # fact = 0: 1, 1:1, 2: 2*1=2, 3: 3*2=6, 4: 4*6=24, 5: 5*24=120.... while n > ...
3.3125
3
tests/adapters/event_store/message_db_event_store/tests.py
mpsiva89/protean
0
12782642
import pytest from protean import Domain from protean.adapters.event_store.message_db import MessageDBStore from protean.exceptions import ConfigurationError @pytest.mark.message_db class TestMessageDBEventStore: def test_retrieving_message_store_from_domain(self, test_domain): assert test_domain.event_s...
2.03125
2
pymeta/boot.py
set-soft/pymeta3
12
12782643
# -*- test-case-name: pymeta.test.test_grammar -*- """ The definition of PyMeta's language is itself a PyMeta grammar, but something has to be able to read that. Most of the code in this module is generated from that grammar (in future versions, it will hopefully all be generated). """ import string from pymeta.runtime...
2.953125
3
amlb/utils/serialization.py
PGijsbers/automlbenchmark
282
12782644
<filename>amlb/utils/serialization.py import logging import math import os import pickle import re from typing import Optional from .core import Namespace as ns, json_dump, json_load from .process import profile log = logging.getLogger(__name__) def _import_data_libraries(): try: import numpy as np ...
2.1875
2
nanak_customization/nanak_customization/sales_invoice.py
JitendraSAW/Nanak-Stores
0
12782645
import frappe def after_submit(self,method): if self.picklist_reference: frappe.db.set_value("Nanak Pick List", self.picklist_reference, "sales_invoice", self.name) frappe.db.set_value("Nanak Pick List", self.picklist_reference, "sales_invoice_status", "Created")
1.773438
2
src/main/python/transectdata/transectdata.py
boom-roasted/ImageWAO
1
12782646
import json from pathlib import Path from typing import Dict from countdata import CountData from drawingdata import DrawingDataList class TransectData: """ Manages transect save data in a primitive data state, such that it can be easily serialized. """ def __init__(self, transectData: Dict[...
3.171875
3
shorttext/metrics/wasserstein/wordmoverdist.py
trendmicro/PyShortTextCategorization
0
12782647
<gh_stars>0 from itertools import product import pulp from scipy.spatial.distance import euclidean from shorttext.utils.gensim_corpora import tokens_to_fracdict # use PuLP def word_mover_distance_probspec(first_sent_tokens, second_sent_tokens, wvmodel, distancefunc=euclidean, lpFile=None): """ Compute the Word...
2.921875
3
damera/cmd/conductor.py
klonhj2015/damera
0
12782648
from oslo_log import log as logging LOG = logging.getLogger(__name__) def main(): pass
1.070313
1
scripts/automation/trex_control_plane/interactive/trex/emu/emu_plugins/emu_plugin_ipv6.py
jmguzmanc/trex-core
0
12782649
<reponame>jmguzmanc/trex-core<gh_stars>0 from trex.emu.api import * from trex.emu.emu_plugins.emu_plugin_base import * from trex.emu.trex_emu_conversions import Ipv6 from trex.emu.trex_emu_validator import EMUValidator import trex.utils.parsing_opts as parsing_opts class IPV6Plugin(EMUPluginBase): '''Defines ipv6...
1.976563
2
src/quantrt/api/auth.py
ardieb/quantrt
0
12782650
import base64 import hashlib import hmac import json import time import quantrt.common.log from typing import Union, Dict __all__ = ["load_credentials", "sign_websocket_request"] def load_credentials(credentials: str) -> Dict: """Create an authenticated coinbasepro rest client api from a dictionary or json fi...
2.65625
3