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
app/waterQual/CQ/legacy/carts.py
fkwai/geolearn
0
12768351
import sklearn.tree import os import pandas as pd import numpy as np from hydroDL import kPath from hydroDL.data import usgs, gageII from hydroDL.post import axplot import matplotlib.pyplot as plt dirCQ = os.path.join(kPath.dirWQ, 'C-Q') dfS = pd.read_csv(os.path.join(dirCQ, 'slope'), dtype={ 'siteNo': str}).set_i...
2.328125
2
examples/showcase/src/demos_panels/horizontalPanel.py
certik/pyjamas
1
12768352
<filename>examples/showcase/src/demos_panels/horizontalPanel.py """ The ``ui.HorizontalPanel`` class is a panel that lays out its contents from left to right. It is often useful to call ``setSpacing(spacing)`` to add space between each of the panel's widgets. You can also call ``setHorizontalAlignment(alignment)`` an...
3.53125
4
gaze-test.py
gbazo/gazetracking
0
12768353
import cv2 from gaze_tracking import GazeTracking from imutils.video import VideoStream import imutils import argparse import time ap = argparse.ArgumentParser() ap.add_argument("-v", "--video", help="path to the (optional) video file") args = vars(ap.parse_args()) gaze = GazeTracking() # if a video path was not su...
2.8125
3
tlds/__init__.py
critical-path/py-tlds
0
12768354
"""util that retrieves and validates a list of top-level domains from the internet assigned names authority.""" from tlds.lib import TopLevelDomainGetter from tlds.utils import write_results __version__ = "1.0.0" __author__ = "critical-path" __all__ = [ "TopLevelDomainGetter", "write_results" ]
1.898438
2
paraml/localDocker.py
yadudoc/ParaML
0
12768355
<reponame>yadudoc/ParaML<filename>paraml/localDocker.py<gh_stars>0 localDockerIPP = {
1.328125
1
garecovery/tests/test_recovery_scan.py
LeoComandini/garecovery
61
12768356
#!/usr/bin/env python3 import decimal import mock import wallycore as wally import garecovery.two_of_three from garecovery.clargs import DEFAULT_SUBACCOUNT_SEARCH_DEPTH from gaservices.utils import txutil from .util import AuthServiceProxy, datafile, get_output, parse_summary, raise_IOError garecovery.bitcoin_confi...
1.914063
2
tests/test_e2e_03_Reporting_vertical.py
blue-monk/csv-diff-python2
0
12768357
import sys import textwrap from src.csvdiff2 import csvdiff def test_show_difference(lhs, rhs, capfd): lhs.write(textwrap.dedent(''' head1, head2, head3, head4, head5, head6 1, value1-2, key2-2, 1002, 20210921T035902, value4-2 1, value1-3, key2-3, 1003, 20210921T035904, value4-3 ...
2.265625
2
Chapter07/basic_svm.py
AIHZP/ROS-Robotics-Projects-published-by-Packt
85
12768358
from sklearn import svm import numpy as np X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]]) y = np.array([1, 1, 2, 2]) model = svm.SVC(kernel='linear',C=1,gamma=1) model.fit(X,y) print(model.predict([[-0.8,-1]]))
3.078125
3
Python/Tests/TestData/AstAnalysis/Functions.py
techkey/PTVS
695
12768359
def f(): '''f''' pass def f1(): pass f2 = f if True: def g(): pass else: def h(): pass class C: def i(self): pass def j(self): def j2(self): pass class C2: def k(self): pass
2.921875
3
D_Network_analysis/solutions/ex1_2.py
oercompbiomed/CBM101
7
12768360
<filename>D_Network_analysis/solutions/ex1_2.py print(G.number_of_edges()) print(len(G.edges())) # both are equally valid solutions
1.492188
1
rantlib/core_application/ui/parts/page.py
AlgoRythm-Dylan/qtpy-rant
1
12768361
from types import SimpleNamespace class Page: def __init__(self): self.root = None self.ui = SimpleNamespace()
2.171875
2
malcolm/modules/scanning/hooks.py
dinojugosloven/pymalcolm
0
12768362
<reponame>dinojugosloven/pymalcolm from annotypes import Anno, Any, Array, Mapping, TYPE_CHECKING, NO_DEFAULT, \ Sequence, Union from scanpointgenerator import CompoundGenerator from .infos import ParameterTweakInfo, Info from malcolm.compat import OrderedDict from malcolm.core import VMeta from malcolm.modules i...
2.25
2
baekjoon/python/im_going_to_meet_18235.py
yskang/AlgorithmPractice
0
12768363
<filename>baekjoon/python/im_going_to_meet_18235.py<gh_stars>0 # Title: 지금 만나러 갑니다 # Link: https://www.acmicpc.net/problem/18235 import sys from collections import deque sys.setrecursionlimit(10 ** 6) read_list_int = lambda: list(map(int, sys.stdin.readline().strip().split(' '))) def bfs(n: int, b: int): que...
3.046875
3
rest_framework_simplejwt/state.py
SPKorhonen/django-rest-framework-simplejwt
0
12768364
<gh_stars>0 from django.contrib.auth import get_user_model from .backends import TokenBackend from .settings import api_settings User = get_user_model() token_backend = TokenBackend( algorithm=.ALGORITHM, signing_key=api_settings.SIGNING_KEY, verifying_key=api_settings.VERIFYING_KEY, secret_key=api_se...
1.78125
2
microlib/matcher/adaptergen_faster.py
Daniele/microtrim
0
12768365
''' Faster brute-force adapter matcher ''' import time VERBOSE = False BASES = ('A', 'C', 'G', 'T') def addNewAdapterToSet(ad, adSet): adSet.add(ad) if VERBOSE: print(f'Adding {ad}') time.sleep(.1) return adSet def makeAdapters(adapter): adapters = set() adapters.add(adapter[:-8]...
3.21875
3
Functions/token_manipulation.py
VatsalGala/Semantic-Tree
0
12768366
<reponame>VatsalGala/Semantic-Tree<gh_stars>0 # Token Manipulation Functions ---> from collections import defaultdict, OrderedDict import spacy from . import global_variables as gv from .logging import log, log_return # Indexing of Tokens to a private system. def set_index(): """No-param function. Sets index <cu...
2.625
3
qubiter/adv_applications/setup_autograd.py
yourball/qubiter
3
12768367
""" The purpose of this file is to install autograd and its dependencies and to provide utility functions that are used when it is used in conjunction with Qubiter. When using autograd, one declares np to be the alias to module numpy.autograd. If another file later declares np to be alias to numpy, all sorts of error...
2.546875
3
home/admin.py
mysteriousCoder9991/To-Do-List-Rahul
0
12768368
<reponame>mysteriousCoder9991/To-Do-List-Rahul from django.contrib import admin from home.models import Task # Register your models here. admin.site.register(Task)
1.195313
1
csi.py
purbe/Reinforcement_Learning_Team_Q_learnig_MARL_Multi_Agent_UAV_Spectrum_task
20
12768369
################################# # CSI function ################################# ######################################################### # import libraries import scipy.spatial.distance as ssd import numpy as np import scipy.io as sio ######################################################### # Function...
2.84375
3
ena-dts/framework/gdb.py
amzn/amzn-ec2-ena-utilities
7
12768370
<gh_stars>1-10 # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 from exception import TimeoutException from utils import GREEN, RED, BLUE class GDB(object): PROMPT = "(gdb)" def __init__(self, host, app, app_prompt): self.host = host self...
2.46875
2
rqalpha/core/strategy_universe.py
terencehk/rqalpha
1
12768371
<reponame>terencehk/rqalpha<filename>rqalpha/core/strategy_universe.py # -*- coding: utf-8 -*- # # Copyright 2019 Ricequant, Inc # # * Commercial Usage: please contact <EMAIL> # * Non-Commercial Usage: # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compli...
1.921875
2
spydrnet/parsers/verilog/parser.py
ganeshgore/spydrnet
34
12768372
# Copyright 2021 <NAME>, BYU CCL # please see the BYU CCl SpyDrNet license file for terms of usage. from spydrnet.parsers.verilog.tokenizer import VerilogTokenizer import spydrnet.parsers.verilog.verilog_tokens as vt from spydrnet.ir import Netlist, Library, Definition, Port, Cable, Instance, OuterPin from spydrnet.p...
2.25
2
scripts/vrf_scripts/request_randomness.py
coozebra/chainlink-mix
9
12768373
#!/usr/bin/python3 import os from brownie import VRFConsumer, accounts, config STATIC_SEED = 123 def main(): dev = accounts.add(os.getenv(config['wallets']['from_key'])) # Get the most recent PriceFeed Object vrf_contract = VRFConsumer[len(VRFConsumer) - 1] vrf_contract.getRandomNumber(STATIC_SEED, {...
2.09375
2
furnace/datasets/voc/voc.py
Yongjin-colin-choi/TorchSemiSeg
1,439
12768374
<filename>furnace/datasets/voc/voc.py #!/usr/bin/env python3 # encoding: utf-8 # @Time : 2017/12/16 下午8:41 # @Author : yuchangqian # @Contact : <EMAIL> # @File : mclane.py from datasets.BaseDataset import BaseDataset class VOC(BaseDataset): @classmethod def get_class_colors(*args): return [[0,...
2.390625
2
examples/shared/dqn/networks.py
MushroomRL/mushroom-rl-meta
0
12768375
<reponame>MushroomRL/mushroom-rl-meta import torch import torch.nn as nn import torch.nn.functional as F import numpy as np class AtariNetwork(nn.Module): n_features = 512 def __init__(self, input_shape, _, n_actions_per_head, use_cuda, n_games, features, dropout): super().__init__(...
2.34375
2
ANNClassification.py
UniqueSud/AffectiveFilmStimuliDataset
0
12768376
<filename>ANNClassification.py import pandas as pd import numpy as np import matplotlib.pyplot as plt #import tensorflow as tf #from tensorflow import keras #from tensorflow.keras.layers import Dense, Dropout, GaussianNoise #from tensorflow.keras import regularizers import random from sklearn.metrics import confusion_m...
2.640625
3
src/solve_all_sudokus.py
Lgt2x/PIT_doku
0
12768377
#!/usr/bin/env python3 from grid import SudokuGrid from solver import SudokuSolver import os.path import time import multiprocessing def solve_all(running_times): for l in range(1, 245): g = SudokuGrid.from_file(os.path.join(os.path.dirname(__file__), "..", "sudoku_db.txt", l) start = time.monoto...
3.125
3
respa_o365/sync_operations.py
tansionline/respa
0
12768378
<gh_stars>0 import logging from enum import Enum logger = logging.getLogger(__name__) class SyncOperations: def __init__(self, changes, sync_actions): self._changes = changes self.sync_actions = sync_actions def get_sync_operations(self): """Returns list of operations that would sync...
3.015625
3
allmychanges/auth/pipeline.py
AllMyChanges/allmychanges.com
46
12768379
<gh_stars>10-100 from ..models import Changelog def add_default_package(strategy, is_new=None, user=None, *args, **kwargs): if is_new: try: changelog = Changelog.objects.get( namespace='web', name='allmychanges') except Changelog.DoesNotExist: changelog = Cha...
1.734375
2
setup.py
mahinlma/PYNQ-experiment
69
12768380
<gh_stars>10-100 # Copyright (c) 2019, Xilinx, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # ...
1.21875
1
pyiacsun/util/wigner.py
aasensio/pyiacsun
5
12768381
<gh_stars>1-10 from __future__ import division from scipy.misc import factorial#, floor, sqrt from numpy import arange, floor, sqrt, round __all__ = ['wigner3j', 'wigner6j'] def TriaCoeff(a,b,c): # Calculating the triangle coefficient return factorial(a+b-c)*factorial(a-b+c)*factorial(-a+b+c)/(factorial(a+b+c...
3.578125
4
copy_crop_weights.py
kerryvernebegeman/Kerry-Verne-Begeman
0
12768382
<reponame>kerryvernebegeman/Kerry-Verne-Begeman # ~~~ aydao ~~~~ 2020 ~~~ # # import warnings warnings.filterwarnings('ignore', category=FutureWarning) warnings.filterwarnings('ignore', category=DeprecationWarning) import tensorflow as tf tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) import sys, geto...
2.078125
2
pydhs/controller_stored_procedures.py
00krishna-tools/pydhs
0
12768383
""" Controller Class ----------------- This class contains the controller logic for the application. This takes input from the table and other interface objects and then manages change of state for the database. It will also pass the state changes to the table objects. """ __author__ = 'krishnab' __version__ = '0.1....
3.328125
3
source-code/Delete_Node_in_a_BST.py
ttungl/Coding-Interview-Challenge
0
12768384
# 450. Delete_Node_in_a_BST # <EMAIL> # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def deleteNode(self, root, key): """ :type root: TreeNode :...
4
4
applications/physbam/physbam-lib/External_Libraries/Archives/boost/tools/build/v2/test/bad_dirname.py
schinmayee/nimbus
20
12768385
#!/usr/bin/python # Copyright (C) <NAME> 2003. Permission to copy, use, modify, sell and # distribute this software is granted provided this copyright notice appears in # all copies. This software is provided "as is" without express or implied # warranty, and with no claim as to its suitability for any purpose. ...
1.578125
2
koku/api/common/permissions/test/test_ocp_all_access.py
rubik-ai/koku
157
12768386
# # Copyright 2021 Red Hat Inc. # SPDX-License-Identifier: Apache-2.0 # from itertools import chain from itertools import combinations from unittest.mock import Mock from django.test import TestCase from api.common.permissions.openshift_all_access import OpenshiftAllAccessPermission from api.iam.models import User fr...
2.40625
2
lifelong_rl/trainers/multi_trainer.py
nakamotoo/lifelong_rl
67
12768387
<reponame>nakamotoo/lifelong_rl<filename>lifelong_rl/trainers/multi_trainer.py from collections import OrderedDict from lifelong_rl.core.rl_algorithms.torch_rl_algorithm import TorchTrainer class MultiTrainer(TorchTrainer): """ Interface for combining multiple trainers into one trainer. """ def __i...
2.234375
2
precourse.py
cdhorn515/ML-Precourse
0
12768388
# Machine Learning/Data Science Precourse Work # ### # LAMBDA SCHOOL # ### # MIT LICENSE # ### # Free example function definition # This function passes one of the 11 tests contained inside of test.py. Write the rest, defined in README.md, here, # and execute python test.py to test. Passing this precourse work will g...
3.859375
4
climateeconomics/tests/l2_test_witness_coarse_cache.py
os-climate/witness-core
1
12768389
<reponame>os-climate/witness-core ''' Copyright 2022 Airbus SAS 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.507813
2
main.py
jack-cummings/cleanmytweets
0
12768390
import tweepy import pandas as pd import re import json import os import datetime import stripe import time from fastapi import FastAPI, Request, BackgroundTasks, Response, Cookie from fastapi.templating import Jinja2Templates from fastapi.staticfiles import StaticFiles from fastapi.responses import RedirectResponse fr...
2.1875
2
src/PlugIns/PE/ResourceEntriesPlug.py
codexgigassys/codex-backend
161
12768391
<gh_stars>100-1000 # Copyright (C) 2016 <NAME>. # This file is part of CodexGigas - https://github.com/codexgigassys/ # See the file 'LICENSE' for copying permission. from PlugIns.PlugIn import PlugIn from Modules.PEFileModule import PEFileModule import pefile from Utils.InfoExtractor import * class ResourceEntriesPl...
1.976563
2
Aula 19/ex095.py
alaanlimaa/Python_CVM1-2-3
0
12768392
<reponame>alaanlimaa/Python_CVM1-2-3 from random import randint jogador = {} listagols = [] time = [] while True: jogador['Nome'] = str(input('Nome: ')).title() jogos = int(input('Quantidades de partidas: ')) somagols = 0 for p in range(1, jogos + 1): gols = randint(1, 3) listagols.appen...
3.671875
4
main.py
Pyzekiel/Pygame-Line-Graph
0
12768393
<reponame>Pyzekiel/Pygame-Line-Graph<filename>main.py<gh_stars>0 import pygame import json import asset import random with open('settings.json', 'r') as src: prp = json.load(src) pygame.init() screen_size = screen_width, screen_height = prp['window']['screen']['width'], prp['window']['screen']['height'] sc...
2.78125
3
setup.py
Zwork101/engage
0
12768394
<reponame>Zwork101/engage from setuptools import setup setup( name="engage", description="Sphinx autodoc templater", author="<NAME>", author_email="<EMAIL>", url="https://github.com/Zwork101/engage", license="MIT", packages=['engage'], version="1.0.0", install_requires=["astor"] )
1.03125
1
PART06/12_df_merge.py
arti1117/python-machine-learning-pandas-data-analytics
1
12768395
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 11 22:19:36 2020 @author: arti """ import pandas as pd pd.set_option('display.max_columns', 10) pd.set_option('display.max_colwidth', 20) pd.set_option('display.unicode.east_asian_width', True) df1 = pd.read_excel('./stock price.xl...
3.0625
3
utils/utils.py
bvy007/vae
92
12768396
<reponame>bvy007/vae import os import numpy as np import theano import theano.tensor as T ### Misc ### def sharedX(value, name=None, borrow=True, keep_on_cpu=False): """ Transform value into a shared variable of type floatX """ if keep_on_cpu: return T._shared(theano._asarray(value, dtype=theano.confi...
2.59375
3
JR.py
samsalemi/OpenSim-Python-Simulation
2
12768397
# August 21st 2018 # Author: <NAME> # University of Guelph Masters Graduate # This module is an OpenSim tool created for Static optimization and Computed Muscle Control data to achieve Joint Reaction forces and loads in model def run(setup,resultsDirectory): import os import re import shutil i...
2.15625
2
rlgym/envs/__init__.py
syKevinPeng/rocket-league-gym
63
12768398
from .environment import Environment from .match import Match
1.171875
1
novelsave/migrations/commands.py
mHaisham/novelsave
15
12768399
from pathlib import Path from alembic.command import upgrade from alembic.config import Config def make_config(dir_: Path, url_: str, config_='alembic.ini'): """ :param dir_: migrations script directory :param url_: sqlalchemy database url :param config_: config :return: """ # retrieves c...
2.59375
3
powParse.py
johnrobisoniv/powDayTexter
0
12768400
# Opens file with OTS.com's "resBox" table data created by powScrape.py # Parse through data - append relevant data and resort to dictionary? # Save dictionary as data file named resData-DATE.txt
2.140625
2
tests/test_api.py
billyweinberger/nightfall-python-sdk
1
12768401
import json import os from freezegun import freeze_time import pytest import responses import time from nightfall.api import Nightfall, NightfallUserError from nightfall.detection_rules import DetectionRule, Detector, LogicalOp, Confidence, ExclusionRule, ContextRule, \ WordList, MatchType, RedactionConfig, MaskC...
2.09375
2
parameters/COVID-19 Mobility Germany.py
buaacjw/Epidemic-Modeling-survey
0
12768402
import datetime import os import wget from parameters.GraphData import GraphData import ssl ssl._create_default_https_context = ssl._create_unverified_context def get_germany_mobility(graph_en: str): out = 'Germany/mobility_counties_2019_baseline.csv' url = 'https://files.de-1.osf.io/v1/resources/n53cz/provid...
2.734375
3
Day08/part1.py
NORXND/AdventOfCode2021
0
12768403
""" Day 8 - Part 1 https://adventofcode.com/2021/day/8 By NORXND @ 08.12.2021 (C) NORXND 2021 - Under The MIT License """ input_file = open('Day8/input.txt', 'r') entries = [] for entry in input_file.readlines(): entry = entry.strip().split(" | ") patterns = entry[0].split(" ") output = entry[1].split("...
2.96875
3
etk/knowledge_graph/knowledge_graph.py
donaq/etk
77
12768404
import json from typing import Dict, List from etk.knowledge_graph.schema import KGSchema from etk.knowledge_graph.graph import Graph from etk.knowledge_graph.subject import Subject from etk.knowledge_graph.node import URI, Literal from etk.utilities import deprecated class KnowledgeGraph(Graph): """ This cla...
2.265625
2
dmr/sdmr.py
taylorshin/dmr
43
12768405
<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import scipy.special as special import scipy.optimize as optimize import scipy.misc as misc from .dmr import DMR class SDMR(DMR): ''' Simple Topic Model with Dirichlet Multinomial Regression ''' def get_alpha_n_m_z(self, ...
2.421875
2
sevdesk/client/models/get_communication_ways_type.py
HpLightcorner/SevDesk-Python-Client
0
12768406
from enum import Enum class GetCommunicationWaysType(str, Enum): PHONE = "PHONE" EMAIL = "EMAIL" WEB = "WEB" MOBILE = "MOBILE" # The SevDesk API might use "0" for null-enums NULL = "0" def __str__(self) -> str: return str(self.value)
3.171875
3
src/apps/users/models/client_address.py
leonardon473/my-dinner-backend
0
12768407
# ----------------------------------------------------------------------------- # Libraries # ----------------------------------------------------------------------------- # Core libs from typing import TYPE_CHECKING # Third party libs from django.db import models # Project libs # If type checking, __all__ if TYPE_C...
1.9375
2
collector/basic.py
ninjadq/Windows-Agent
60
12768408
""" Collect Host's basic metric Thanks to Feng_Qi a lot of code in this file was borrow from him. """ import psutil import time import json import copy import logging from rpc.transfer import send_data_to_transfer from utils import g def collect(): logging.debug('enter basic collect') push_inte...
2.484375
2
dudoku.py
Bojidarist/dudoku
0
12768409
<filename>dudoku.py<gh_stars>0 import arcade import random class Dudoku(): def __init__(self): self.cell_width = 60 self.cell_height = 60 self.cells = [] # x[y[]] self.cells_count = 30 pass def new_game(self): # create 9x9 field with values of 0 for x in ra...
3.546875
4
lafs/matrix_generators.py
james-akl/pylafs
0
12768410
import lafs import random import math # Returns an Identity Matrix of dimensions (n, n_col) def I(n, n_col = None): if type(n) == lafs.matrix.Matrix: n_col = n.dim(1) n = n.dim(0) elif n_col == None: n_col = n ret = lafs.matrix.Matrix(n, n_col) for i in range(min(n, n_col)): ...
3
3
result/pymus_image.py
pgarapon/pymus
11
12768411
import h5py import tools.pymus_utils as pymusutil import numpy as np import matplotlib.pyplot as plt import logging logging.basicConfig(level=logging.DEBUG) class ImageFormatError(Exception): pass class EchoImage(object): ''' Echogeneicity grayscale image ''' def __init__(self,scan): self.scan = scan self.d...
2.4375
2
dnn_inference/BBoxTest.py
StatML-dAI/dnn-inference
0
12768412
<gh_stars>0 """ Significance testing based on black-box models """ # Author: <NAME> <<EMAIL>> from tensorflow.keras.models import load_model import numpy as np from scipy.stats import norm, mode from sklearn.model_selection import train_test_split from tensorflow.keras.callbacks import EarlyStopping import warnings i...
2.265625
2
tests/mztab_m_io/test_main.py
lifs-tools/pymzTab-m
4
12768413
''' Created on 11.12.2018 @author: mirandaa ''' import unittest import pytest from mztab_m_swagger_client.api_client import ApiClient import json from collections import namedtuple from pprint import pprint from mztab_m_io import mztab_parser from pathlib import Path, PurePath class MzTabParseTestCase(unittest.TestC...
1.96875
2
src/settings.py
nathanielcompton/publix-tenders
0
12768414
<reponame>nathanielcompton/publix-tenders<gh_stars>0 import os TENDERS_SALE_URL = os.getenv( "TENDERS_SALE_URL", "http://arepublixchickentendersubsonsale.com/" ) ONSALE_STRING = os.getenv( "ONSALE_STRING", "onsale:yes" ) ONSALE_YES = "Oh yeah they are!" ONSALE_NO = "Sorry, not today!"
1.5
2
{{cookiecutter.repo_name}}/src/{{cookiecutter.django_project_name}}/apps.py
ionelmc/cookiecutter-django-docker
1
12768415
<filename>{{cookiecutter.repo_name}}/src/{{cookiecutter.django_project_name}}/apps.py from django.contrib.admin.apps import AdminConfig class CustomAdminConfig(AdminConfig): default_site = '{{cookiecutter.django_project_name}}.admin.CustomAdminSite'
1.421875
1
src/apialchemy/service/__init__.py
homedepot/apialchemy
1
12768416
<filename>src/apialchemy/service/__init__.py import importlib import re def parse_uri(uri): pattern = re.compile( r'^(?P<vendor>\w+)(?:\+(?P<scheme>http|https))?://(?P<conn_str>.*)', re.X, ) m = pattern.match(uri) if m is not None: components = m.groupdict() return S...
2.546875
3
36.Notepad.py
sarincr/GUI-With-Tkinter-using-Python
0
12768417
<gh_stars>0 from tkinter import * import tkinter as tks from tkinter import IntVar tk = Tk() tk.geometry('500x500') tk.title('Notepad') main_menu = tks.Menu() file = Menu(main_menu, tearoff = False) edit = Menu(main_menu, tearoff = False) view = Menu(main_menu, tearoff = False) theme = Menu(main_menu, tearoff = Fals...
2.609375
3
clothing/forms.py
AmitAharoni/iWear2021
0
12768418
from django.utils import timezone from django import forms from clothing.models import ClothingItem, WornEvent from users.models import User class ItemCreationForm(forms.ModelForm): name = forms.CharField(label='Item Name') owner = forms.ModelChoiceField(widget=forms.HiddenInput(), queryset=User.objects.all())...
2.390625
2
third-party-synthetic/active-gate-extensions/extension-third-party-sftp/src/sftp_extension.py
ruxit/ruxit-api
1
12768419
import logging from typing import List from datetime import datetime from sftp_client import SFTPClient from ruxit.api.base_plugin import RemoteBasePlugin from dynatrace import Dynatrace from dynatrace.environment_v1.synthetic_third_party import SYNTHETIC_EVENT_TYPE_OUTAGE, SyntheticTestStep, SyntheticMonitorStepResul...
2
2
pythonforandroid/recipes/pyicu/__init__.py
ht-thomas/python-for-android
19
12768420
from os.path import join from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe class PyICURecipe(CppCompiledComponentsPythonRecipe): version = '1.9.2' url = ('https://pypi.python.org/packages/source/P/PyICU/' 'PyICU-{version}.tar.gz') depends = ["icu"] patches = ['locale.pat...
2.3125
2
optixrap/cu/boolean_solid.py
hanswenzel/opticks
11
12768421
# # Copyright (c) 2019 Opticks Team. All Rights Reserved. # # This file is part of Opticks # (see https://bitbucket.org/simoncblyth/opticks). # # 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.945313
2
openslides/agenda/migrations/0002_item_duration.py
swilde/OpenSlides
3
12768422
<reponame>swilde/OpenSlides<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-22 11:08 from __future__ import unicode_literals from django.db import migrations, models def convert_duration(apps, schema_editor): """ Converts the values of the old duration CharField to new duration ...
2.1875
2
projects/password-generator/test_password_generator.py
duttashi/learnpy
0
12768423
# -*- coding: utf-8 -*- """ Created on Tue Aug 24 11:53:24 2021 @author: Ashoo """ from password_generator import generate_simple_password def test_generate_simple_password(): assert generate_simple_password()=='abcd'
2.6875
3
drivelink/_diskdict.py
cdusold/DriveLink
0
12768424
from collections import MutableMapping from os.path import expanduser, join from glob import glob from drivelink import Link from drivelink.hash import hash class _page(dict): currentDepth = 0 class Dict(Link, MutableMapping): """ A dictionary class that maintains O(1) look up and write while keeping R...
2.984375
3
sqlalchemy_ydb/__init__.py
blinkov/sqlalchemy-ydb
0
12768425
<filename>sqlalchemy_ydb/__init__.py from __future__ import absolute_import from __future__ import unicode_literals from kikimr.public.dbapi.errors import NotSupportedError try: from sqlalchemy.engine.default import DefaultDialect, DefaultExecutionContext from sqlalchemy.sql.compiler import DDLCompiler, Iden...
2.140625
2
manage.py
tydonk/blogful
1
12768426
import os from flask_script import Manager from blog import app from blog.database import session, Entry manager = Manager(app) @manager.command def run(): port = int(os.environ.get('PORT', 8080)) app.run(host='0.0.0.0', port=port) @manager.command def seed(): content = """TEST TEST TEST, these entries ...
2.578125
3
conpaas-services/src/conpaas/services/taskfarm/agent/agent.py
bopopescu/conpaas-1
5
12768427
<reponame>bopopescu/conpaas-1 # -*- coding: utf-8 -*- """ :copyright: (C) 2010-2013 by Contrail Consortium. """ from subprocess import Popen from conpaas.core.expose import expose from conpaas.core.https.server import HttpJsonResponse from conpaas.core.agent import BaseAgent class TaskFarmAgent(BaseAgent): ...
2.296875
2
python3_cron_scripts/libs3/ZoneManager.py
utkarshiam/Marinus
0
12768428
#!/usr/bin/python3 # Copyright 2019 Adobe. All rights reserved. # This file is licensed to you 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 requir...
2.3125
2
environment.py
zhangvwk42/modified-snake-reinforcement-learning
0
12768429
<filename>environment.py import random import math from initialization import * # random.seed(40) class Directions: UP = 'UP' DOWN = 'DOWN' RIGHT = 'RIGHT' LEFT = 'LEFT' ALL = [UP, DOWN, LEFT, RIGHT] REVERSE = {UP: DOWN, DOWN: UP, LEFT: RIGHT, RIGHT: LEFT} class Setup: # Initial snake coordinat...
3.15625
3
resumeapi/main.py
ericrochow/resumeapi
2
12768430
<gh_stars>1-10 #!/usr/bin/env python3 from datetime import timedelta import os import logging from typing import Dict, List, Optional from dotenv import load_dotenv from fastapi import Body, Depends, FastAPI, HTTPException, status from fastapi.responses import FileResponse, JSONResponse, RedirectResponse from fastapi...
2.671875
3
idcardquery/idcardquery.py
troubleforme/Tools
1
12768431
''' Function: 身份证信息查询小工具 Author: Charles 微信公众号: Charles的皮卡丘 ''' import sys from PyQt5 import * from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5 import QtWidgets, QtGui from id_validator import validator '''身份证信息查询小工具''' class IDCardQuery(QWidget): def __ini...
2.625
3
friends.py
auscompgeek/perfectgift
0
12768432
#!/usr/bin/env python3 # perfectgift: a tornado webapp for creating wish lists between friends # Copyright (C) 2014, NCSS14 Group 4 # 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 re...
2.140625
2
python/dgl/model_zoo/chem/mgcn.py
vipermu/dgl
6
12768433
# -*- coding:utf-8 -*- # pylint: disable=C0103, C0111, W0621 """Implementation of MGCN model""" import torch import torch.nn as nn from .layers import AtomEmbedding, RBFLayer, EdgeEmbedding, \ MultiLevelInteraction from ...nn.pytorch import SumPooling class MGCNModel(nn.Module): """ `Molecular Property ...
2.546875
3
reversi/strategies/AlphaBetaMethods/GetScore.py
y-tetsu/othello
10
12768434
<filename>reversi/strategies/AlphaBetaMethods/GetScore.py<gh_stars>1-10 """Get Score of AlphaBeta strategy """ import time from reversi.strategies.common import Timer, Measure def get_score(alphabeta, color, board, alpha, beta, depth, pid): """get_score """ return _get_score(_get_score, alphabeta, color...
2.328125
2
course/migrations/0005_coursesmodel_slug.py
dewale005/whitefieldcoursesite
0
12768435
# Generated by Django 3.2.6 on 2021-08-25 17:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('course', '0004_coursesmodel_thumbnail'), ] operations = [ migrations.AddField( model_name='coursesmodel', name='slug...
1.570313
2
iplist.py
fritzdenim/python-codes
0
12768436
IPlist = ['172.16.31.10','172.16.58.3','192.168.127.12','172.16.17.32','172.16.31.10'] # for address in range(len(IPlist)): # IPlist[address] = '%3s.%3s.%3s.%3s' % tuple(IPlist[address].split('.')) # IPlist.sort(reverse=False) # for address in range(len(IPlist)): # IPlist[address] = IPlist[address].repla...
3.1875
3
invoice/apps.py
AhmedElmawary/erp
0
12768437
<filename>invoice/apps.py from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class InvoiceConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'invoice' verbose_name = _("Invoice") def ready(self): import invoice.signals
1.398438
1
train.py
bubbliiiing/facenet-tf2
20
12768438
from functools import partial import numpy as np import tensorflow as tf from tensorflow.keras.callbacks import EarlyStopping, TensorBoard from tensorflow.keras.optimizers import Adam from nets.facenet import facenet from nets.facenet_training import FacenetDataset, LFWDataset, triplet_loss from utils.callbacks impor...
2.09375
2
Python/Crawling/naver/article_connectDB.py
zionhan/TIL
1
12768439
import urllib.request as req import pyodbc import requests from bs4 import BeautifulSoup as bs import time import random import json def sqlquote( value ): """Naive SQL quoting All values except NULL are returned as SQL strings in single quotes, with any embedded quotes doubled. """ if value is No...
2.984375
3
test/core/diagnosticstore.py
SabineEmbacher/xcube
0
12768440
<reponame>SabineEmbacher/xcube<filename>test/core/diagnosticstore.py import time from collections import MutableMapping from types import MethodType from typing import TypeVar, Iterator, List, Callable, Any, Tuple _KT = TypeVar('_KT') _VT = TypeVar('_VT') _T_co = TypeVar('_T_co') _VT_co = TypeVar('_VT_co') class Dia...
2.0625
2
lino_book/projects/avanti1/fixtures/demo.py
lino-framework/lino_book
3
12768441
# -*- coding: UTF-8 -*- # Copyright 2017-2020 Rumma & Ko Ltd # License: BSD (see file COPYING for details) """General demo data for Lino Avanti. - Course providers and courses """ # from django.conf import settings # from lino.utils import mti from lino.utils import Cycler # join_words from lino.utils.mldbc import ...
1.75
2
billtitles/crud.py
aih/billtitles-py
2
12768442
<reponame>aih/billtitles-py<filename>billtitles/crud.py from datetime import datetime from typing import List, Optional from sqlalchemy.orm import aliased, Session from sqlalchemy import func, desc from sqlalchemy.sql.elements import literal_column from . import models from typing import TypedDict bill_to = aliased(m...
2.6875
3
2019/## Python/TADs e Classes/TAD_ponto_heranca.py
ed1rac/AulasEstruturasDados
8
12768443
class Ponto(object): def __init__(self, x, y): #método construtor (cria ponto) self.x = x self.y = y def exibe_ponto(self): print('Coordenadas -> x: ', self.x, ', y: ', self.y) def set_x(self, x): self.x = x def set_y(self, y): self.y = y def dis...
3.984375
4
ya3_report/daily.py
ecoreuse/ya3-report
0
12768444
<reponame>ecoreuse/ya3-report # Copyright 2022 <NAME>. All rights reserved. from pathlib import Path from datetime import date, datetime from typing import Optional import pandas as pd import numpy as np from ya3_report import environ def get_data(dt: Optional[date] = None) -> pd.DataFrame: # pragma: no cover ...
2.71875
3
Chapter04-Inheritance/Multiple.py
elephantscale/python-oop-labs-solutions
0
12768445
class Base1: def FuncA(self): print("Base1::FuncA") class Base2: def FuncA(self): print("Base2::FuncA") class Child(Base1, Base2): pass def main(): obj=Child() obj.FuncA() if __name__ == "__main__": main()
3.078125
3
bot_python_sdk/activation_service.py
ShanavazJs/BoT-Python-SDK
0
12768446
<reponame>ShanavazJs/BoT-Python-SDK import time from bot_python_sdk.bot_service import BoTService from bot_python_sdk.configuration_store import ConfigurationStore from bot_python_sdk.logger import Logger LOCATION = 'Activation Service' RESOURCE = 'status' DEVICE_ID = 'deviceID' POLLING_INTERVAL_IN_SECONDS = 5 MAXIMU...
2.515625
3
data_analysis/subsidy_distribution.py
Bermuhz/DataMiningCompetitionFirstPrize
128
12768447
root_loc = "/Users/mac/Documents/contest/data/original_data/" file_name = "subsidy_train.txt" count_0 = 0 count_1000 = 0 count_1500 = 0 count_2000 = 0 lines = open(root_loc + file_name).readlines() for line in lines: temps = line.strip("\n").split(",") subsidy = int(temps[1]) if subsidy == 0: count_...
2.828125
3
data_construction/neg_mask_regen/generated_json_to_text.py
launchnlp/cliff_summ
14
12768448
import argparse import json from tqdm import tqdm def align_ws(old_token, new_token): # Align trailing whitespaces between tokens if old_token[-1] == new_token[-1] == " ": return new_token elif old_token[-1] == " ": return new_token + " " elif new_token[-1] == " ": return new_t...
2.625
3
custom_model_runner/datarobot_drum/drum/memory_monitor.py
amperie/user-models
0
12768449
<filename>custom_model_runner/datarobot_drum/drum/memory_monitor.py import os import psutil from mlpiper.common.byte_conv import ByteConv from datarobot_drum.drum.common import ArgumentsOptions import collections MemoryInfo = collections.namedtuple( "MemoryInfo", "total avail free drum_rss drum_info nginx_rss...
2.109375
2
posts/OppositeDay/anti_amtrak.py
capecchi/capecchi.github.io
0
12768450
<filename>posts/OppositeDay/anti_amtrak.py def main(): import json import glob import coords2geojson local = 'C:/Python34/America_By_Train/finished_routes/' webdir = 'C:/Users/Owner/Documents/GitHub/capecchi.github.io/posts/OppositeDay/' rts = glob.glob(local+'*.geojson') rts = [rts[3],rts...
2.734375
3