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
classify.py
yangbang18/video-classification-3d-cnn
2
12786151
<reponame>yangbang18/video-classification-3d-cnn import torch from dataset import Video from spatial_transforms import (Compose, Normalize, Scale, CenterCrop, ToTensor) from temporal_transforms import LoopPadding def classify_video(video_dir, model, opt): spatial_transform = Compose([ Scale(opt.sample_siz...
2.546875
3
tests/update_results.py
ethanio12345/OpenMC
0
12786152
<gh_stars>0 #!/usr/bin/env python from __future__ import print_function import os import re from subprocess import Popen, call, STDOUT, PIPE from glob import glob from optparse import OptionParser parser = OptionParser() parser.add_option('-R', '--tests-regex', dest='regex_tests', help="Run tests m...
2.59375
3
15059 Hard choice.py
jangThang/Baekjoon-problem
0
12786153
# 입력 available = list(map(int, input().split())) needs = list(map(int, input().split())) # 수요 예측 res = 0 # 못 먹는 사람 수 for i, j in zip(available, needs): if i-j < 0: res += (j-i) print(res)
2.9375
3
util/__init__.py
alexansari101/deep-rl
0
12786154
from .general import update_target_graph, process_frame, discount,\ normalized_columns_initializer
0.992188
1
vulyk/blueprints/gamification/models/task_types.py
mrgambal/ner_trainer
33
12786155
<reponame>mrgambal/ner_trainer<filename>vulyk/blueprints/gamification/models/task_types.py # -*- coding: utf-8 -*- from typing import Dict, Optional, Union from vulyk.models.task_types import AbstractTaskType from vulyk.models.tasks import Batch POINTS_PER_TASK_KEY = 'points_per_task' COINS_PER_TASK_KEY = 'coins_per_...
2.171875
2
kicadsearch/kicadsearch_index.py
arvjus/kicad-search
3
12786156
#!/usr/bin/python # -*- coding: utf-8 -*- import os import os.path from whoosh import index from whoosh.fields import Schema, ID, TEXT, NUMERIC from whoosh.analysis import StemmingAnalyzer from .kicadsearch_parser import LibDocCreator, ModDocCreator, KicadModDocCreator def list_files(rootdirs, sufix): for rootdi...
2.4375
2
src/system/settings/development.py
securedirective/django-site-template
0
12786157
<gh_stars>0 from .base import * CONFIG_FILE_IN_USE = get_file_name_only(__file__) # Custom setting # Debug mode will help troubleshoot errors DEBUG = True # Custom settings for dynamically-generated config files PROJECT_NAME = PROJECT_NAME+'-development' # Must have some key, so we'll just use bogus one SECRET_KEY ...
1.820313
2
projects/migrations/0122_reportcolumn_custom_display_mapping.py
SuviVappula/kaavapino
0
12786158
<gh_stars>0 # Generated by Django 2.2.13 on 2021-08-17 07:46 import django.contrib.postgres.fields.jsonb import django.core.serializers.json from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('projects', '0121_projectcardsectionattribute_show_on_mobile'), ] ...
1.945313
2
src/app.py
andersonvmachado/PyCRUD
0
12786159
<reponame>andersonvmachado/PyCRUD from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from src.settings import URI_CONNECTION, PORT from src.routes import init_resources from src.models import * app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = URI_CONNECTION...
2.171875
2
lechef/lechef/qstk_tester.py
r2k0/fe4retail
1
12786160
<reponame>r2k0/fe4retail<filename>lechef/lechef/qstk_tester.py """ QSTK utils """ import QSTK.qstkutil.qsdateutil as du import QSTK.qstkutil.tsutil as tsu import QSTK.qstkutil.DataAccess as da import datetime as dt import matplotlib.pyplot as plt import pandas as pd def main(): ls_symbols = ["SPY"] dt_start = d...
2.015625
2
utils/timer.py
anilpai/leetcode
0
12786161
<gh_stars>0 import time def timing(given_function): ''' Outputs the time a function takes to execute. ''' def wrapper(*args, **kwargs): t1 = time.time() given_function(*args, **kwargs) t2 = time.time() return "Time it took to run the function : " + str(round(((t2-t1)*1...
3.453125
3
course-2/session-7/pandas/process_traffic.py
robmarano/nyu-python
2
12786162
#!/usr/bin/env python import pandas as pd import numpy as np import matplotlib.pyplot as plt import re gis_file = 'Annual_Average_Daily_Traffic__AADT___Beginning_1977.csv' df = pd.read_csv(gis_file) print(df.head()) # remove spaces from column names cols = df.columns cols = cols.map(lambda x: x.replace(' ', '_') i...
3
3
tests/test_coor_trans.py
PrincetonUniversity/ASPIRE-Python
7
12786163
import os.path from unittest import TestCase import numpy as np from aspire.utils import ( Rotation, crop_pad_2d, get_aligned_rotations, grid_2d, grid_3d, register_rotations, uniform_random_angles, ) DATA_DIR = os.path.join(os.path.dirname(__file__), "saved_test_data") class UtilsTestCa...
2.53125
3
setup.py
clchiou/boot
0
12786164
from setuptools import setup try: from g1.devtools import buildtools except ImportError: buildtools = None import startup if buildtools: cmdclass = { 'bdist_zipapp': buildtools.make_bdist_zipapp(main_optional=True), } else: cmdclass = {} setup( name = 'startup', version = start...
1.515625
2
bis/worms.py
bgotthold-usgs/bis
0
12786165
<filename>bis/worms.py def getWoRMSSearchURL(searchType,target): if searchType == "ExactName": return "http://www.marinespecies.org/rest/AphiaRecordsByName/"+target+"?like=false&marine_only=false&offset=1" elif searchType == "FuzzyName": return "http://www.marinespecies.org/rest/AphiaRecordsBy...
2.625
3
words.py
mkous/kouspy
0
12786166
import sys import re help = 'usage: words.py "<your phrase>"' if len(sys.argv) < 2: print help else: sentence = sys.argv[1] special_characters = ";!,?.:'1234567890" words = [] def arghify(word): first_letter = word[0] last_letter = word[len(word)-1] ...
3.71875
4
datas/utils.py
xindongzhang/ELAN
34
12786167
import os from datas.benchmark import Benchmark from datas.div2k import DIV2K from torch.utils.data import DataLoader def create_datasets(args): div2k = DIV2K( os.path.join(args.data_path, 'DIV2K/DIV2K_train_HR'), os.path.join(args.data_path, 'DIV2K/DIV2K_train_LR_bicubic'), os.path.join...
2.21875
2
code/plotaiff.py
parrt/data-acquisition
7
12786168
<filename>code/plotaiff.py import aifc import numpy import matplotlib.pyplot as plt from array import * import sys if len(sys.argv)>1: f = aifc.open(sys.argv[1]) else: print "please provide a filename" exit() nsamples = f.getnframes() params = f.getparams() print params shorts = f.readframes(nsamples) signal = num...
2.921875
3
djangoproj/djangoapp/csc/nl/ja/debug.py
pbarton666/buzz_bot
0
12786169
<filename>djangoproj/djangoapp/csc/nl/ja/debug.py #python-encoding: UTF-8 from csc.nl.ja.util import * import re class JaDebug(): ''' Handles Debug Output for csc.nl.ja Note: Not pretty. Probably never will be. ''' def __init__(self, colorize = True): self.colors = {} self.colors['h...
2.0625
2
test/integration/targets/module_utils/module_utils/sub/bam.py
Container-Projects/ansible-provider-docs
37
12786170
#!/usr/bin/env python bam = "BAM FROM sub/bam.py"
1
1
gtrends_scraper/spiders/gtrends_spider.py
ralphqq/trending_business_news_scraper
1
12786171
# -*- coding: utf-8 -*- # Google Trends (Business Stories) Spider import datetime import logging import time import scrapy from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC...
2.40625
2
stage/standard/test_pulsar_producer_destination.py
streamsets/datacollector-tests
14
12786172
# Copyright 2020 StreamSets Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
1.742188
2
update.py
jeffrypaul37/Hospital-Management-System
0
12786173
<filename>update.py from tkinter import * import tkinter.messagebox import sqlite3 import tkinter as tk from tkinter import ttk from tkinter.messagebox import askyesno def buildupdate(): conn = sqlite3.connect('database copy.db') c = conn.cursor() class Application: def __init__(self, master): self....
3.53125
4
scripts/wmt_ranking_task.py
yuyang-huang/Appraise
68
12786174
<reponame>yuyang-huang/Appraise #!/usr/bin/env python # -*- coding: utf-8 -*- """Project: Appraise evaluation system Author: <NAME> <<EMAIL>> This script takes a set of parallel files (source, reference, and system translations) and writes out the XML file used to setup the corresponding Appraise tasks for WMT rerank...
2.25
2
toggl/sandbox.py
cowen314/web-tools
0
12786175
# import pyautogui # # pyautogui.typewrite('akasjhaks') from pathlib import Path unique = [] with open(Path("C:/Users/christiano/Downloads/Untitled-AB.txt"), 'r') as f: for line in f: line = line.strip() if line not in unique: unique.append(line) print(line)
3.078125
3
src/compas_blender/inspectors/__init__.py
yijiangh/compas
1
12786176
""" ******************************************************************************** compas_blender.inspectors ******************************************************************************** .. currentmodule:: compas_blender.inspectors .. autosummary:: :toctree: generated/ MeshInspector NetworkInspecto...
1.421875
1
DataProcess/config.py
zhangupkai/RFID_Script
0
12786177
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ @Project :DataProcess @File :config.py @Author :<NAME> @Date :2021/11/8 13:21 """ READ_PRINT_FILES_PATH = "../data/read_print" HOP_FILES_PATH = "../data/hop" DELTA = 0 REFER_CHANNEL = 923.125 HAMPEL = 8
1.570313
2
smart_mpls/mpls_manager/migrations/0003_auto_20200729_1241.py
ib-sang/smartMPLS-with-djqngo
0
12786178
<gh_stars>0 # Generated by Django 3.0.6 on 2020-07-29 11:41 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mpls_manager', '0002_auto_20200729_1220'), ] operations = [ migrations.RemoveField( model_name='device', ...
1.640625
2
2015/06/06.py
tut-tuuut/advent-of-code-shiny-giggle
5
12786179
import re grid = [] size = 1000 class Grid: def __init__(self, size): self.size = size self.grid = [ [0]*size for e in range(size) ] print(f'Initiated a {size}*{size} grid.') def turnOn(self, xstart, ystart, xend, yend): for x in range(xstart, xend+1): for y in...
3.359375
3
src/public/management/commands/init_data.py
mine-archived/dinner
0
12786180
<filename>src/public/management/commands/init_data.py<gh_stars>0 # coding=utf-8 # Initial table import datetime import calendar from django.core.management import BaseCommand from django.conf import settings from public.models import Calendar, User from public.models import Org, Conf from dinner.models import Calendar...
2.140625
2
TutorialFiles/classes.py
moh-amiri/contacts_django
1
12786181
<reponame>moh-amiri/contacts_django class Dog(): # attribute of class attOne='oneAtt' def __init__(self,breed,poww): self.breed=breed self.poww=poww objectDog=Dog('something1','something2') anotherdog=Dog('one','two') # print("Class of Dog()"+str(objectDog)) # print("Class of Dog():arg1=> ...
2.859375
3
tests/test_tomba.py
andrewsmedina/tomba
31
12786182
<gh_stars>10-100 import pytest from tomba.tomba import get_locations @pytest.mark.parametrize( "text,expected_locations", [ ( "A disputa pelo Acre n\u00e3o limitou-se \u00e0 esfera jur\u00eddica da " "aplica\u00e7\u00e3o de tratados e teve uma dimens\u00e3o de intere...
2.015625
2
python/gdrivers/bag_test.py
schwehr/gdal-autotest2
0
12786183
<reponame>schwehr/gdal-autotest2 #!/usr/bin/env python # Copyright 2014 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/license...
1.726563
2
envs/__init__.py
addy1997/Grid
21
12786184
<gh_stars>10-100 from Grid.envs.GridEnvironment import *
1.195313
1
WebServiceToolUI.py
BloodElf-X/WebServiceTestTool
0
12786185
<filename>WebServiceToolUI.py<gh_stars>0 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'WebServiceToolUI.ui' # # Created by: PyQt5 UI code generator 5.8.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): ...
1.773438
2
src/backend/opus/order.py
DTG-FRESCO/opus
0
12786186
# -*- coding: utf-8 -*- ''' Module containing classes related to enforcing orderings upon messages. ''' from __future__ import (absolute_import, division, print_function, unicode_literals) import Queue import threading import time from .exception import QueueClearingException def _cur_time()...
2.859375
3
app/atlas/squaremap.py
mikkohei13/havistin2
0
12786187
from dataclasses import replace import atlas.common as common import json def observation_coordinates(square_id): url = f"https://api.laji.fi/v0/warehouse/query/unit/list?selected=gathering.conversions.wgs84CenterPoint.lat%2Cgathering.conversions.wgs84CenterPoint.lon%2Cgathering.coordinatesVerbatim&pageSize=1000...
2.703125
3
sinks/my_app/sentiments/tests/test_models.py
zkan/streaming-data-pipeline-with-kafka
3
12786188
from django.test import TestCase from ..models import Tweet class TestTweet(TestCase): def test_it_should_have_defined_fields(self): Tweet.objects.create( text='This is my first tweet!', search_term='<NAME>', sentiment='positive' ) tweet = Tweet.object...
2.875
3
Coursera/Week.5/Task.7.py
v1nnyb0y/Coursera.BasePython
0
12786189
''' Лесенка ''' def ladder(n): string = '' for i in range(1, n + 1): string += str(i) print(string) n = int(input()) ladder(n)
3.6875
4
dataset.py
trichtu/Recurrent_Attention_U_net
2
12786190
#!/usr/bin/python # -*- coding: utf-8 -*- # created by <NAME> # contact with <EMAIL> import numpy as np import datetime import os import pandas as pd import random import time import threading import multiprocessing def check_file(tt,datelist,hour): ''' chech file at the time of 'tt' and its continuous 24 h...
2.671875
3
setup.py
RullDeef/MarkovAlgorifms
2
12786191
import setuptools setuptools.setup( name="math-algorithm-models", version="0.0.1", author="<NAME>", author_email="<EMAIL>", license="MIT", description="simple algorithms executor", long_description=open("README.md", "rt").read(), long_description_content_type="text/markdown", url="h...
1.070313
1
chatbot/mech.py
edunham/toys
8
12786192
from cite import Book from obj import God_Obj, Emo_Obj, Offtopic import random class Converser(object): def __init__(self, triggers, objections, outputs, DEBUG): """ Unpack tuple of triggers into useful little tuples... eventually Triggers in form: - Greetings - Agrees - Disagrees - Cite outputs ...
3.3125
3
Basic Progrom python/largest_among_n_digit.py
manish1822510059/Python-1000-program
1
12786193
arr = [] num = int(input("Enter the n Number:= \t")) for n in range(num): number = int(input("Enter number:")) arr.append(number) print("Maximum element in the list is :",max(arr)) print("Maximum element in the list is :",min(arr))
4.1875
4
exercises/es/test_03_14_03.py
Jette16/spacy-course
2,085
12786194
<reponame>Jette16/spacy-course def test(): assert ( "patterns = list(nlp.pipe(people))" in __solution__ ), "¿Estás usando nlp.pipe envuelto en una lista?" __msg__.good( "¡Buen trabajo! Ahora continuemos con un ejemplo práctico que usa nlp.pipe " "para procesar documentos con metadat...
2.234375
2
netmiko/checkpoint/__init__.py
mostau1/netmiko
1
12786195
from __future__ import unicode_literals from netmiko.checkpoint.checkpoint_gaia_ssh import CheckPointGaiaSSH __all__ = ['CheckPointGaiaSSH']
1.09375
1
src/pyon/datastore/postgresql/pg_query.py
scionrep/scioncc_new
2
12786196
<filename>src/pyon/datastore/postgresql/pg_query.py #!/usr/bin/env python """Datastore query mapping for Postgres""" __author__ = '<NAME>' from pyon.core.exception import BadRequest from pyon.datastore.datastore import DataStore from pyon.datastore.datastore_query import DQ, DatastoreQueryBuilder class PostgresQue...
2.171875
2
fts.py
telescreen/Full-Text-Search
1
12786197
#!/usr/bin/env python3 import time import cmd import sys import gzip import functools import re import xml.etree.ElementTree as ElementTree from typing import List, Set, Dict, Iterator from tqdm import tqdm class Document: def __init__(self, doc_id, title, url, abstract): self.doc_id = doc_id se...
2.703125
3
custom_components/ui_lovelace_minimalist/base.py
robbinonline/UI
0
12786198
<filename>custom_components/ui_lovelace_minimalist/base.py """Base UI Lovelace Minimalist class.""" from __future__ import annotations from dataclasses import asdict, dataclass, field from typing import Any from .const import ( DEFAULT_INCLUDE_OTHER_CARDS, DEFAULT_LANGUAGE, DEFAULT_SIDEPANEL_ICON, DEF...
2.1875
2
imageflow/migrations/0009_remove_imageanalysis_target_name.py
typpo/astrokit
8
12786199
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2018-03-16 05:46 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('imageflow', '0008_remove_reduction_image_companion'), ] operations = [ migrations.Re...
1.304688
1
torchgeometry/losses/__init__.py
Wizaron/torchgeometry
1
12786200
from .ssim import SSIM, ssim
0.984375
1
tensorbay/opendataset/VOC2012Detection/loader.py
machearn/tensorbay-python-sdk
73
12786201
#!/usr/bin/env python3 # # Copyright 2021 Graviti. Licensed under MIT License. # # pylint: disable=invalid-name """Dataloader of VOC2012Detection dataset.""" import os from tensorbay.dataset import Dataset from tensorbay.opendataset._utility import get_boolean_attributes, get_voc_detection_data DATASET_NAME = "VOC2...
2.328125
2
src/ddpg_evo/evo.py
kklipski/ALHE-projekt
3
12786202
from src.ddpg.train import Trainer from src.ddpg.buffer import MemoryBuffer from statistics import mean import gym import numpy as np import random import scipy.stats class EvolutionaryDDPG: def __init__(self, n_networks, max_buffer, max_episodes, max_steps, episodes_ready, explore_prob, explore_factors): ...
2.5
2
spea/minimum_clique_cover/clique_cover.py
heyaroom/spea_echo
0
12786203
from collections import defaultdict import numpy as np import networkx as nx import networkx.algorithms.approximation as approx import networkx.algorithms.coloring as coloring import pulp def clique_random_sequential(graph : nx.Graph) -> list: """Perform minimum clique cover with random sequential greedy...
3.390625
3
data/preprocess/ISICPreprocess_2017.py
qgking/CKDNet
2
12786204
<reponame>qgking/CKDNet import numpy as np from tqdm import tqdm from skimage import transform as sktransform import os from skimage import io import inspect def mkdir_if_not_exist(dir_list): for directory in dir_list: if not os.path.exists(directory): os.makedirs(directory) curr_filename = ...
2.25
2
tests/test_shell.py
rbrich/pwlockr
1
12786205
import shutil import time from pathlib import Path from threading import Event import pytest from keybox.main import main as keybox_main from keybox.ui import BaseUI from keybox.shell import ShellUI, BaseInput from .expect import Expect, ExpectCopy, Send, DelayedSend config_filename = 'test_keybox.conf' safe_filen...
2.03125
2
ginger/forms/fields.py
vivsh/django-ginger
0
12786206
import re import warnings import mimetypes # import urllib2 from functools import total_ordering from django.utils.encoding import force_text from django.utils import six import os from django.utils.six.moves.urllib.request import urlopen from django.utils.six.moves.urllib.parse import urlparse from django import for...
2.21875
2
Practica 4 E2.py
pardo13/python
0
12786207
a=int(input("ingresa un numero\n")) b=int(input("ingresa un numero\n")) c=int(input("ingresa un numero\n")) d=int(input("ingresa un numero\n")) e=int(input("ingresa un numero\n")) if(a > b > c > d > e): print(a,",",b,",",c,",",d,",",e," Estan en orden decreciente") elif(a < b < c < d < e): print(a,",",b,",",c,"...
3.828125
4
src/modules/wifi.py
hirusha-adi/Ultimate-USB
0
12786208
<filename>src/modules/wifi.py<gh_stars>0 import os import subprocess import src.utils.errors as error class Wifi: def __init__(self, file=None, error_file=None): self.output = "" self.file = file self.error_file = error_file def runCommand(self): try: return subpro...
2.734375
3
pandatools/MiscUtils.py
junggjo9/panda-client
0
12786209
import re import json import commands SWLISTURL='https://atlpan.web.cern.ch/atlpan/swlist/' # wrapper for uuidgen def wrappedUuidGen(): # check if uuidgen is available tmpSt,tmpOut = commands.getstatusoutput('which uuidgen') if tmpSt == 0: # use uuidgen return commands.getoutput('uuidgen 2...
2.515625
3
lclpy/localsearch/move/__init__.py
nobody1570/lspy
3
12786210
"""This package contains everything related to move functions, classes who are used to alter the state of the problems and are able to generate valid "moves" in the neighbourhood. """
1.421875
1
code/reader.py
Arghyadatta/Universal_data_processor
0
12786211
from common import * import itertools from scipy.sparse import csr_matrix def nested_to_sparse(df, num_columns, index=None): if not (index is None): df = df.reindex(index) assert len(df.columns) == 1 series = df[df.columns[0]] N = num_columns series.loc[series.isnull()] = series[series.isnull(...
2.5
2
torchglyph/nn/attention.py
speedcell4/torchglyph
11
12786212
<filename>torchglyph/nn/attention.py from typing import Tuple, Optional import torch from einops.layers.torch import Rearrange from torch import Tensor from torch import nn __all__ = [ 'att_mask', 'cas_mask', 'MultiHeadAttention', ] @torch.no_grad() def att_mask(mask: Optional[Tensor] = None) -> Optiona...
2.28125
2
modsel/command_line.py
danieleds/modsel
1
12786213
<reponame>danieleds/modsel<filename>modsel/command_line.py import sys import modsel def main(): r = modsel.main() if r != 0: sys.exit(r)
2.0625
2
rl/metrics/ListMetric.py
mahkons/Lottery-ticket-hypothesis
7
12786214
<reponame>mahkons/Lottery-ticket-hypothesis import torch import json from logger.Logger import log from metrics.Metric import Metric # save lists using torch class ListMetric(Metric): def add(self, value): log().add_plot_point(self.name, json.dumps([x.item() for x in value])) def add_barrier(self, va...
2.234375
2
mlhiphy/tests/test_kernel.py
ratnania/mlhiphy
6
12786215
<reponame>ratnania/mlhiphy<gh_stars>1-10 # coding: utf-8 from mlhiphy.calculus import dx, dy, dz from mlhiphy.calculus import Constant from mlhiphy.calculus import Unknown from mlhiphy.kernels import compute_kernel, generic_kernel from sympy import expand from sympy import Lambda from sympy import Function, Derivative...
2.59375
3
setup.py
garym/wakeywakey
0
12786216
<filename>setup.py # Copyright 2016 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
1.484375
1
lrrbot/storage.py
andreasots/lrrbot
24
12786217
<gh_stars>10-100 import json import os from common import utils from common.config import config """ Data structure: data = { 'spam_rules': [ { 're': '<regular expression>', 'message': '<ban description>', }, ], } For example: data = { 'spam_rules': [ { 're': '^I am a spambot!$', 'message': "cl...
2.78125
3
map.py
highflyer910/mapping
2
12786218
import folium map = folium.Map(location = [40.7864, 17.2409], zoom_start=6, tiles = "OpenStreetMap") fgv = folium.FeatureGroup(name="To Visit") fgv.add_child(folium.Marker(location = [40.7864, 17.2409], popup = "Arbelobello,Italy", icon = folium.Icon(color="cadetblue", icon="briefcase"))) fgv.add_child(fo...
1.734375
2
py/jpy/ci/appveyor/dump-dlls.py
devinrsmith/deephaven-core
210
12786219
import psutil, os p = psutil.Process(os.getpid()) for dll in p.memory_maps(): print(dll.path)
1.851563
2
odoo_social_security/models/__init__.py
joytao-zhu/odooExtModel
2
12786220
<gh_stars>1-10 # -*- coding: utf-8 -*- ################################################################################### # Copyright (C) 2019 <NAME> ################################################################################### from . import insured_scheme from . import insured_scheme_emp from . import insur...
1.140625
1
runfiles/internal/common.bzl
fmeum/rules_runfiles
7
12786221
# Copyright 2021 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
1.875
2
curator_api/actions/restore.py
untergeek/curator_api
0
12786222
<filename>curator_api/actions/restore.py # import logging # import re # from curator.actions.parentclasses import ActionClass # from curator.exceptions import CuratorException, SnapshotInProgress, FailedRestore # from curator.helpers.index import get_indices # from curator.helpers.repository import check_repo_fs # from...
2.015625
2
rkn-check/usr/bin/rkn-check.py
hotid/roskomtools
0
12786223
<reponame>hotid/roskomtools #!/usr/bin/python3 # -*- coding: utf-8 -*- # Импорты Python import time, sys, threading, signal, ipaddress # Сторонние пакеты import requests import datetime from lxml import etree from pprint import pprint from socket import timeout as SocketTimeout from socket import error as SocketErr...
2.03125
2
ndsdevelserver/src/ndsdevelserver/ui/controls/listeditor.py
mlunnay/nds_rpc
0
12786224
<gh_stars>0 # Copyright (c) 2008, <NAME> <<EMAIL>> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR...
1.898438
2
traceflow/__main__.py
eracle/traceflow
68
12786225
<reponame>eracle/traceflow #!/usr/bin/env python3 # -*- coding: utf-8 -*- import traceflow import time import logging import socket import traceflow.helpers as helpers logger = logging.getLogger() def main(): # ha ha ha args = helpers.get_help() daddr = resolve_address(args.destination) tot_runs = a...
2.453125
2
test_paste/admin.py
Spansky/django-paste_image
2
12786226
from django.contrib import admin from .models import MyModel @admin.register(MyModel) class MyModelAdmin(admin.ModelAdmin): list_display = ["id", "image"]
1.65625
2
config/hooks/tk-multi-publish2/python/tk_multi_publish2/publish_tree_widget/tree_node_context.py
JoanAzpeitia/lp_sg
0
12786227
<reponame>JoanAzpeitia/lp_sg<filename>config/hooks/tk-multi-publish2/python/tk_multi_publish2/publish_tree_widget/tree_node_context.py<gh_stars>0 # Copyright (c) 2017 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code Licens...
1.96875
2
pixget/pixget.py
jkubaile/pixget
0
12786228
# -*- coding: utf-8 -*- import os from urlparse import urlparse import validators import requests class PixGet(object): def __init__(self, infile, output): self.infile = infile self.output = output self.valid_lines = [] self.invalid_lines = [] self.filenames = {} de...
3.296875
3
src/cron_serv/job_runner/remote_celery_runner.py
windperson/docker-crontab
0
12786229
<reponame>windperson/docker-crontab<gh_stars>0 # TODO: add mechanism to init celery worker for given celery queue.
1.070313
1
src/proxyhttp.py
sancau/ivelum_test_task
0
12786230
# -*- coding: utf-8 -*- import traceback from urllib.parse import urlparse import falcon import fire import requests import waitress from transformer import Transformer class Proxy: """ A falcon middleware acting as a proxy server """ def __init__(self, target): """ :param target: ...
2.828125
3
challenges/4.C.Absolute_Value/lesson_tests.py
pradeepsaiu/python-coding-challenges
141
12786231
import unittest from main import * class AbsoluteValueTests(unittest.TestCase): def test_main(self): self.assertIsInstance(absolute_value, int) self.assertEqual(absolute_value, 42)
2.859375
3
connectivity/utils/flash_firmware.py
nakata5321/sensors-connectivity
0
12786232
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import shutil import tempfile import nacl.signing import os import sys import yaml import logging.config from config.logging import LOGGING_CONFIG logging.config.dictConfig(LOGGING_CONFIG) logger = logging.getLogger("utils") def write_array(arr: list) ->...
2.375
2
app/utils/decorators.py
AlexLaur/TradeHelper
2
12786233
def busyindicator(func): def wrapper(*args, **kwargs): args[0].busy_indicator.show(center_from=args[0]) try: result = func(*args, **kwargs) finally: args[0].busy_indicator.hide() return result return wrapper
2.484375
2
run.py
donzthefonz/ftx-rebalancer
2
12786234
# -*- coding: utf-8 -*- """ * Pizza delivery prompt example * run example by writing `python example/pizza.py` in your console """ from __future__ import print_function, unicode_literals import regex from pprint import pprint from PyInquirer import style_from_dict, Token, prompt from PyInquirer import Validator, Vali...
3.3125
3
startup/common/v1/services/config_service.py
nimeshkverma/Django-REST-Framework-Boilerplate
1
12786235
from django.conf import settings class Config(object): def __init__(self): self.data = self.__get_data() def __get_base_url(self): return settings.BASE_URL def __get_versions(self): return settings.VERSIONS def __get_versioned_base_url(self): return settings.VERSION...
2.140625
2
maximum_sum_of_array.py
kasyap1234/codingproblems
1
12786236
def sum_largest(array): sum=0 for i in array: if i>0: sum=sum+i return sum
3.34375
3
colt/presets.py
xiki-tempula/colt
1
12786237
<filename>colt/presets.py from .generator import Generator from .slottedcls import slottedcls Preset = slottedcls("Preset", {"default": None, "choices": None}) class PresetGenerator(Generator): """Generate Presets automatically""" leafnode_type = Preset def __init__(self, questions): Generator...
2.734375
3
machine_learning/stock_trading/stock_trading.py
JASTYN/pythonmaster
3
12786238
import webbrowser import numpy as np import pandas as pd from pandas_datareader import data as web from sklearn import linear_model webbrowser.open("https://github.com/philliphsu/BottomSheetPickers") class ScikitBacktest(object): def __init__(self, sys): self.data = d self.matrix = m sel...
3.046875
3
main.py
git9527/tvsou-egp-generator
0
12786239
<filename>main.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- from bs4 import BeautifulSoup import requests import datetime from pytz import timezone import os from pathlib import Path def writeLine(lines): with open("/tmp/epg-assets/epg.xml", "a") as file: file.writelines(lines) file.write("\n...
2.96875
3
ActionController.py
Lilly7777/GRobot---Server
0
12786240
<reponame>Lilly7777/GRobot---Server<filename>ActionController.py import requests class ActionController: def __init__(self): pass def take_action(self, objects, left_border, right_border): if len(objects) < 0: return for (x,y,w,h) in objects: ...
3.21875
3
The_Watch/watch/urls.py
Kipngetich33/The-Watch
1
12786241
from django.conf.urls import url from . import views urlpatterns=[ url('^$',views.landing,name = 'landingUrl'), url(r'^profile/create',views.create_profile,name = 'create_profileUrl'), url(r'^post/create',views.post,name = 'postUrl'), url(r'^business/create',views.business,name = 'businessUrl'), ur...
1.617188
2
chimu/v1/app.py
chaosmac1/chimu-api
2
12786242
<filename>chimu/v1/app.py<gh_stars>1-10 from chimu.v1.routes.search import search from chimu.shared.utils.meili import InitializeMeili from chimu.shared.utils.mysql import InitializeMySQL from chimu.shared.utils.datadog import InitializeDatadog from chimu.v1.routes.get_set import get_set from chimu.v1.routes.get_m...
1.835938
2
central_erros/api/models.py
MarioGN/aceleradev-python-central-de-erros
1
12786243
from django.db import models from django.core.validators import MinValueValidator from django.contrib.auth import get_user_model User = get_user_model() class ErrorLogModelManager(models.Manager): search_fields = ('level', 'description', 'source') ordering_fields = ('level', '-level', 'events', '-events') ...
2.09375
2
mypackage/model/RRDB_net.py
GHzytp/AtomSegNet
0
12786244
import math import torch import torch.nn as nn from collections import OrderedDict import torchvision from torch.nn.utils import spectral_norm #################### # Basic blocks #################### def act(act_type, inplace=True, neg_slope=0.2, n_prelu=1): # helper selecting activation # neg_slope: for lea...
2.4375
2
deepxde/icbcs/__init__.py
blutjens/deepxde
0
12786245
"""Initial conditions and boundary conditions.""" from .boundary_conditions import * from .initial_conditions import *
0.945313
1
{{cookiecutter.project_slug}}/{{cookiecutter.initial_app_slug}}/models.py
City-of-Helsinki/drf-cookiecutter
0
12786246
<reponame>City-of-Helsinki/drf-cookiecutter from django.db import models class {{ cookiecutter.initial_model_name }}(models.Model): name = models.CharField(max_length=100)
2.0625
2
day15/p2.py
Seralpa/Advent-of-code-2021
0
12786247
import os import networkx as nx def add_n_mat(mat, n): new_mat = [] for l in mat: new_mat.append(list(map(lambda x: ((x + n - 1) % 9) + 1, l))) return new_mat def add_n_list(l, n): return list(map(lambda x: ((x + n - 1) % 9) + 1, l)) cwd = os.getcwd() with open(f"{cwd}/input.txt") as f: data = [[int(c) for...
2.90625
3
miuitask.py
codetiger666/miui-auto-tasks
89
12786248
# -- coding:UTF-8 -- import requests import time import json import hashlib from urllib import request from http import cookiejar from utils.utils import system_info, get_config, w_log, s_log, check_config, format_config class MIUITask: def __init__(self, uid, password, user_agent, board_id, device_id): ...
2.453125
2
mindinsight/mindconverter/graph_based_converter/mapper/base.py
lvyufeng/mindconverter_standalone
0
12786249
<filename>mindinsight/mindconverter/graph_based_converter/mapper/base.py # Copyright 2020-2021 Huawei Technologies Co., Ltd.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 a...
1.953125
2
ckanext/metadata/tests/test_organization_actions.py
SAEONData/ckanext-metadata
0
12786250
# encoding: utf-8 from ckan import model as ckan_model from ckan.tests import factories as ckan_factories from ckan.tests.helpers import call_action from ckanext.metadata import model as ckanext_model from ckanext.metadata.tests import ( ActionTestBase, assert_error, factories as ckanext_factories, as...
1.960938
2