seq_id
stringlengths
4
11
text
stringlengths
113
2.92M
repo_name
stringlengths
4
125
sub_path
stringlengths
3
214
file_name
stringlengths
3
160
file_ext
stringclasses
18 values
file_size_in_byte
int64
113
2.92M
program_lang
stringclasses
1 value
lang
stringclasses
93 values
doc_type
stringclasses
1 value
stars
int64
0
179k
dataset
stringclasses
3 values
pt
stringclasses
78 values
27806818049
from typing import Self, Any from dataclasses import dataclass, field from hashlib import md5 import numpy as np import numpy.typing as npt from collections import deque from queue import PriorityQueue input = "pxxbnzuo" target = np.array([3, 3], dtype=np.int8) movements: tuple[str, npt.NDArray[np.int_], int] = [ ...
matthiasBender/adventofcode_python
matthias/2016/day17.py
day17.py
py
1,913
python
en
code
0
github-code
13
39133022700
# training worker, accepts input from the oracle cacher # this is baseline no caching and no prefetch import os import sys import time import copy import queue import logging import argparse import threading import numpy as np import torch import torch.nn as nn import torch.optim as optim import torch.distributed.rpc ...
uw-mad-dash/bagpipe
distributed_trainer_baseline.py
distributed_trainer_baseline.py
py
21,335
python
en
code
1
github-code
13
23551211156
# You are climbing a staircase. It takes n steps to reach the top. # Each time you can either climb 1 or 2 steps. # In how many distinct ways can you climb to the top? class Solution: memory= {0 : 0} def climbStairs(self, n: int) -> int: if n in self.memory: return self.memory[n] ...
nichitatrifan/leet_code_python
easy/climbing_stairs.py
climbing_stairs.py
py
1,382
python
en
code
0
github-code
13
34375114796
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import argparse import json import sys __version__ = '0.1.0' def decode_switchy_omega(backup_text): """ :type backup_text: unicode :rtype: unicode """ data = json.loads(backup_text, encoding='utf-8') return ...
Nemoleoliu/dotfiles
switchy-sharp/clean_omega.py
clean_omega.py
py
1,331
python
en
code
null
github-code
13
74697023376
import unittest from datCrawl import * from test.requirements import * URL = 'http://en.wikipedia.org/wiki/Python' class datCrawlBaseTests(unittest.TestCase): def test_instance_check(self): core = datCrawl() self.assertTrue(isinstance(core, datCrawl)) def test_register_urls(self): c...
fmartingr/datCrawl
test/test_base.py
test_base.py
py
1,028
python
en
code
19
github-code
13
8384447684
import os import sys import argparse from statistics import mean from prettytable import PrettyTable from elasticsearch6 import Elasticsearch INDEX_NAME = 'LR3' def arg_parse(): """Обработка аргументов командной строки Возвращаемые значения: argument: введенные аргументы """ argument = arg...
Docik99/ot1p
LR_3/LR3.py
LR3.py
py
3,895
python
ru
code
0
github-code
13
1491844447
import os import tictactoe from datetime import datetime from flask import ( Flask, flash, render_template, redirect, request, session, url_for) from flask_pymongo import PyMongo from bson.objectid import ObjectId from werkzeug.security import generate_password_hash, check_password_hash if os.path.exists("env.p...
JonathanDelaney/TryTrickThatThough
app.py
app.py
py
16,230
python
en
code
0
github-code
13
6636332254
import base64 import logging import os from aiohttp import web from marshmallow.exceptions import ValidationError from ..helpers.api_schema import ( normalize_message, UploadNew, UploadStatus, VersionMinimized, ) from ..helpers.enums import Status from ..helpers.web_routes import ( in_header_autho...
OpenTTD/bananas-api
bananas_api/web_routes/new.py
new.py
py
6,372
python
en
code
1
github-code
13
30589894742
#!/usr/bin/env python import cv2 import math import numpy as np from matplotlib import pyplot as plt def getRGBS(img, PLOT = False): image = cv2.cvtColor(img,cv2.COLOR_BGR2RGB) # grab the image channels, initialize the tuple of colors, # the figure and the flattened feature vector features = [] featuresSobel ...
tyiannak/recognizeFitExercise
featuresColor.py
featuresColor.py
py
1,193
python
en
code
9
github-code
13
72026462738
import abc import collections import inspect import json import os import re from absl import logging import gin import numpy as np from t5.data import sentencepiece_vocabulary import tensorflow.compat.v1 as tf import tensorflow_datasets as tfds from mesh_tensorflow.transformer.utils import _filter_features _DEFAULT_...
jzbjyb/lm-calibration
t5/data/utils.py
utils.py
py
42,503
python
en
code
26
github-code
13
40038159199
import tensorflow as tf import tensorbayes as tb import numpy as np from codebase.args import args from tensorbayes.tfutils import softmax_cross_entropy_with_two_logits as softmax_xent_two from tensorflow.contrib.framework import add_arg_scope @add_arg_scope def normalize_perturbation(d, scope=None): with tf.name_...
RuiShu/dirt-t
codebase/models/extra_layers.py
extra_layers.py
py
2,249
python
en
code
173
github-code
13
32771984992
# -*- coding: utf-8 -*- import os import sys import h5py import yaml import numpy as np from PIL import Image import matplotlib.pyplot as plt import matplotlib as mpl import cartopy.crs as ccrs # import cartopy.feature as cfeature # from mpl_toolkits.axes_grid1 import make_axes_locatable, axes_size from cartopy.mpl.ti...
NingAnMe/snow_cover_of_remote_sensing
ndsi_b01_check_orbit.py
ndsi_b01_check_orbit.py
py
5,366
python
en
code
0
github-code
13
1448183161
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: Zhoutao #create_date:2017-02-05-13:26 # Python 3.5 def person(name,age,sex,job): def walk(p): print('person %s is walking...'%p['name']) date = { 'name':name, 'age':age, 'sex':sex, 'job':job, 'walk':walk ...
248808194/python
M3/笔记例子等/class引子.py
class引子.py
py
644
python
en
code
0
github-code
13
36916551284
# coding: utf8 from __future__ import unicode_literals, print_function, division from collections import defaultdict from lingpy3.ops.base import operation from lingpy3.interfaces import IWordlist from lingpy3.util import product2, chained_values from lingpy3 import log def get_score(wl, ref, mode, taxA, taxB, ignor...
lingpy/lingpy3
lingpy3/ops/wordlist.py
wordlist.py
py
2,401
python
en
code
0
github-code
13
36275435617
n=int(input()) k=int(input()) a=[] for _ in range(n): a.append(input()) from itertools import permutations b=[] for v in permutations(list(range(n)),k): temp="" for i in range(k): temp+=a[v[i]] if temp not in b: b.append(temp) print(len(b))
syagi/atcoder_training
ant/17_jol2020d.py
17_jol2020d.py
py
278
python
en
code
0
github-code
13
36297671050
from flask_app.config.mysqlconnection import connectToMySQL import re from flask import flash EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$') class User: db = "email_validation" def __init__(self,data): self.id = data["id"] self.first_name = data["first_name"] ...
Matthew-Luk/Python-Bootcamp
Flask_MySQL/Validation/email_validation/flask_app/models/user.py
user.py
py
2,159
python
en
code
0
github-code
13
42804426077
import os from setuptools import setup, find_packages # This reads the __version__ variable exec(open('src/qclassify/_version.py').read()) # README file as long_description long_description = open('README.md').read() # Read in requirements.txt requirements = open('requirements.txt').readlines() requirements = [r.st...
zapatacomputing/QClassify
setup.py
setup.py
py
980
python
en
code
26
github-code
13
5395795712
import argparse import lab.torch as B import matplotlib.pyplot as plt import numpy as np import torch from wbml.experiment import WorkingDirectory from wbml.plot import tweak from convcnp import DualConvCNP, GPGenerator # Enable GPU if it is available. if torch.cuda.is_available(): device = "cuda" else: devi...
wesselb/gabriel-convcnp
train.py
train.py
py
6,214
python
en
code
0
github-code
13
28233761216
import json import datetime import natsort import os from django.shortcuts import render from django.db import transaction from django.http import HttpResponse, JsonResponse from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.mixins import LoginRequiredMixin from django.db.models import Q fr...
avjves/becky_gui
backend/backups/views.py
views.py
py
10,897
python
en
code
0
github-code
13
73737688656
import cv2 import os import random def GetFileList(dir, fileList): newDir = dir if os.path.isfile(dir): fileList.append(dir) elif os.path.isdir(dir): for s in os.listdir(dir): #if s == "xxx": #continue newDir=os.path.join(dir,s) GetFileLis...
UMJCS/NTU-recipeAndhaze
haze/divide.py
divide.py
py
1,938
python
en
code
0
github-code
13
18862508788
from logging import getLogger from io import BytesIO from base64 import b64encode from pandas import read_csv, to_datetime import matplotlib matplotlib.use('Agg') from matplotlib import pyplot from flask import Flask, render_template, request from ..modeling.predictor import Predictor L = getLogger(__name__) pyplot...
vayesy/stock_split_test
src/stocks/server/app.py
app.py
py
2,012
python
en
code
0
github-code
13
36267847213
import requests, json url = 'https://data.epa.gov.tw/api/v2/aqx_p_432?api_key=e8dd42e6-9b8b-43f8-991e-b3dee723a52d&limit=1000&sort=ImportDate%20desc&format=JSON' data = requests.get(url).json() ### a = input("城市") a = "臺南市" ### b = input("站名") b = "臺南" for i in data['records']: if i['county'] == "臺南市" and i['si...
kunglin930111/pm2.5_line
2.Filter specific data.py
2.Filter specific data.py
py
416
python
en
code
0
github-code
13
1986780232
import tkinter as tk window = tk.Tk() window.title('my window') window.geometry('500x300') var = tk.StringVar() label = tk.Label(window,bg='yellow',width=40,text='empty') label.pack() var1 = tk.IntVar() var2 = tk.IntVar() def print_selection(): if (var1.get() == 1) & (var2.get() == 0): label.config(tex...
Llunch4w/Tired-Driver
code/GUI_exercise/checkButton.py
checkButton.py
py
871
python
en
code
5
github-code
13
11975823542
from requests_tor import RequestsTor import sys rt = RequestsTor(tor_ports=(9050,), tor_cport=9051) with open(sys.argv[1], "r") as fh: with open(f"{sys.argv[1]}.csv", "w") as fw: for line in fh: line = line.rstrip() try: http = str(rt.get(f'http://{line}')) ...
h3b4r1/httptortest
httptortest.py
httptortest.py
py
753
python
en
code
0
github-code
13
21251172292
##Name: Shezan Alam #Email: shezan.alam48@myhunter.cuny.edu #Date: September 4th, 2019 #This program draws a red equilateral triangle and a black square on a blue background. import turtle wn = turtle.Screen() # Set up the window and its attributes wn.bgcolor("blue") tess = turtle.Turtle() # cr...
shezalam29/simple-python-projects
BlueScreenShezanA.py
BlueScreenShezanA.py
py
934
python
en
code
0
github-code
13
43298823869
# OpenGL procedural texture shader explanation # https://stackoverflow.com/questions/67672873/opengl-procedural-texture-shader-explanation from OpenGL.GLUT import * from OpenGL.GLU import * from OpenGL.GL import * import OpenGL.GL.shaders import numpy as np from ctypes import c_void_p import glm import math sh_vert =...
Rabbid76/graphics-snippets
example/python/opengl_minimal_example/minimal_example_wood_shader.py
minimal_example_wood_shader.py
py
7,166
python
en
code
172
github-code
13
38186685892
from easydict import EasyDict as edict # make training faster # our RAM is 256G # mount -t tmpfs -o size=140G tmpfs /train_tmp # 在/train_tmp目录下挂载大小为140GB的tmpfs文件系统。tmpfs文件系统是一个临时文件存储系统 config = edict() # 点表示法 config.margin_list = (1.0, 0.0, 0.4) # config.network = "vit_b_dp005_mask_005" # vit_b模型,使用Mask RCNN在CO...
chenqian57/insightface1
recognition/arcface_torch/configs/wf42m_pfc03_40epoch_8gpu_vit_b.py
wf42m_pfc03_40epoch_8gpu_vit_b.py
py
1,418
python
zh
code
0
github-code
13
30230069494
# To-Do List application in Python using a graphical user interface (GUI) with the Tkinter library: import tkinter as tk from tkinter import messagebox # Function to create a new task def create_task(): task_name = task_name_entry.get() due_date = due_date_entry.get() priority = priority_entr...
Godfaithpython/CODSOFT
To_do_List1.py
To_do_List1.py
py
2,827
python
en
code
0
github-code
13
71497031699
# 언어 : Python # 날짜 : 2022.2.19 # 문제 : BOJ > 지뢰 찾기 (https://www.acmicpc.net/problem/4396) # 티어 : 실버 5 # ========================================================================= moves = [[0, 1], [1, 0], [-1, 0], [0, -1], [-1, -1], [-1, 1], [1, -1], [1, 1]] def solution(): result = [["." for _ in range(N + 2)] for...
eunseo-kim/Algorithm
BOJ/코딩테스트 대비 문제집 with Baekjoon/구현/03_지뢰 찾기.py
03_지뢰 찾기.py
py
1,576
python
en
code
1
github-code
13
12502208123
#! /usr/bin/env python3 import sys import html import requests import re import time def get_html(): with open('page-examples/istituto.html') as f: return f.read() def get_word_definition(word): first_letter = word[0].upper() try: url = f'https://dizionari.corriere.it/dizionario_italiano/{first_letter...
danoan/word-detective
source/dictionaries/it/italian_dictionary.py
italian_dictionary.py
py
1,663
python
en
code
0
github-code
13
73781036498
# -*- coding: utf-8 -*- """Check Python. This module will run on changed files to check for Python linting. """ # Add Native Libraries import subprocess import shlex def check_pycodestyle(python_files_changed): """Function will check changed python files to see if there an linter errors/warnings. Args: ...
anirudhmungre/sneaky-lessons
.travis/checks/pycodestyle.py
pycodestyle.py
py
946
python
en
code
1
github-code
13
74970641938
from setuptools import setup, find_packages # used by meta.yaml, do not forget space requirements = [ "geopandas >=0.10.2", "requests >=2.26.0", "numpy >=1.21.3", "geojson >=2.5.0", "python-dateutil >=2.8.2", "graph-tool >=2.43", "cairo >=1.16.0", "scipy >=1.7.1", "more-itertools >=...
amauryval/OsmGT
setup.py
setup.py
py
1,119
python
en
code
4
github-code
13
12051076392
#!/usr/bin/env python # coding: utf-8 # In[10]: import numpy as np import matplotlib.pyplot as plt #defining linear_model from sklearn.linear_model import LinearRegression #mse & r2 errors from sklearn.metrics import mean_squared_error,r2_score # In[23]: #generate random no set np.random.seed(0) #with help of s...
sawantprajakta/Machine_Learning
MachineLearning/Supervised_Algorithms/Linear_Regression_Sklearn_withoutscratch.py
Linear_Regression_Sklearn_withoutscratch.py
py
1,335
python
en
code
0
github-code
13
32059734761
import csv from abbreviations import us_state_abbrev states = {} with open('covid-19-dataset-1.csv') as f: reader = csv.reader(f) next(reader) # skip the first line with the column heads for row in reader: state_name = row[2] confirmed = int(row[7]) if state_name in us_state_abb...
1000monkeys/CoronaDashboard
edit_data.py
edit_data.py
py
892
python
en
code
0
github-code
13
42804436837
from pyquil.gates import * from pyquil.quil import Program def x_product(input_vec, qubits_chosen): """ Encoding circuit which represents a classical vector (t1, t2, ..., tn) with an n-qubit product state Rx(t1)|0> Rx(t2)|0> ... Rx(tn)|0>. Args: input_vec: list[float] Classical input vector. qubits_c...
zapatacomputing/QClassify
src/qclassify/encoding_circ.py
encoding_circ.py
py
601
python
en
code
26
github-code
13
39315003703
""" DefaultDotDict - Yet another dictionary with dot notation. Supports loading from JSON. Acts as defaultdict recursively adding more DefaultDotDicts when non-existent items are requested. See main() for a demo. Master copy lives here: https://gist.github.com/tbnorth/61d3b75f26637d9f26c1678c5d94cb8e Terry N. Brow...
tbnorth/defaultdotdict
defaultdotdict.py
defaultdotdict.py
py
2,947
python
en
code
0
github-code
13
10374867540
import datetime as dt from typing import Any, Text, Dict, List import pymongo import re from sklearn.cluster import KMeans from io import BytesIO import base64 import numpy as np import difflib import nltk from nltk.sentiment import SentimentIntensityAnalyzer import numpy as np from scipy import stats from pymongo impo...
FaycelSassi/Chatbot
actions/actions.py
actions.py
py
29,960
python
en
code
1
github-code
13
73726270418
# dead simple file-as-nosql thingie. import json import logging logger = logging.getLogger(__name__) class JsonFile(object): def __init__(self, _json, _existing_ids, _cmp_key, _filename): self._json = _json # list self._existing_ids = _existing_ids # set self._cmp_key = ...
benediktkr/wohnen
jsonfile.py
jsonfile.py
py
2,333
python
en
code
1
github-code
13
32591181921
import datetime import requests from tqdm import tqdm from typing import Dict from .globals import SPARK_URL, SPARK_TOKEN, bitcoin from .onchain import onopen def listchannels(db): now = int(datetime.datetime.now().timestamp()) r = requests.post( SPARK_URL, headers={"X-Access": SPARK_TOKEN}, json={"...
fiatjaf/lnchannels
getdata/listchannels.py
listchannels.py
py
3,489
python
en
code
23
github-code
13
17919050365
import json import requests from ._config import QueryOptions from requests.models import HTTPError from skyflow.errors._skyflow_errors import SkyflowError, SkyflowErrorCodes, SkyflowErrorMessages from skyflow._utils import InterfaceName interface = InterfaceName.QUERY.value def getQueryRequestBody(data, options): ...
skyflowapi/skyflow-python
skyflow/vault/_query.py
_query.py
py
2,572
python
en
code
8
github-code
13
7601208456
""" GenomicVariantSet =================== GenomicVariantSet represents list of GenomicVariant. """ from __future__ import print_function from .GenomicVariant import GenomicVariant from .GenomicRegionSet import GenomicRegionSet import vcf class GenomicVariantSet(GenomicRegionSet): """*Keyword arguments:* ...
mguo123/pan_omics
src/rgt/GenomicVariantSet.py
GenomicVariantSet.py
py
7,440
python
en
code
0
github-code
13
9040651565
from django.shortcuts import render,redirect from home.models import Blog from django.contrib import messages from django.contrib.auth.decorators import login_required # Create your views here. ######################################################################## @login_required def blog(request): if request.m...
kamaru-x/AdminPanel
blog/views.py
views.py
py
2,687
python
en
code
0
github-code
13
25182249426
##!/usr/bin/env python #Python 3.2 on Microsoft OS #Also for Python 3.3 # CLASSES #global variables max_indid = [-1] divisor_beta_1 = [-1,-1] divisor_beta_2 = [-1,-1] amount_topurge = -1 wished_rr = .28 univ = [None] purged = [None] week = 0 exposure_rate = 0 pbe = 0 class Panelist3(object): ''' # De...
evaristoc/Online_Panel_Simulation
phase01/panelsimulation_dem_v1.2.py
panelsimulation_dem_v1.2.py
py
45,181
python
en
code
0
github-code
13
74675936658
from collections import namedtuple from decimal import Decimal from unittest.mock import patch from django.test import TestCase from factory.fuzzy import FuzzyText, FuzzyInteger, FuzzyDecimal from oauth2_provider.contrib.rest_framework import OAuth2Authentication from oauth2_provider.models import Application from res...
diegorocha/bringel
src/store/api/tests.py
tests.py
py
12,467
python
en
code
0
github-code
13
41599596598
import os import ast def unique_variables(directory): for filename in os.listdir(directory): if filename.endswith(".py"): with open(os.path.join(directory, filename), "r") as f: code = f.read() try: tree = ast.parse(code) ...
ranjit7858/Fine_Code
Finereview/review/unique.py
unique.py
py
784
python
en
code
0
github-code
13
30795286917
"""empty message Revision ID: e596d1ca7402 Revises: 5c4d7e80737e Create Date: 2023-07-26 00:13:11.241798 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'e596d1ca7402' down_revision = '5c4d7e80737e' branch_labels = None depends_on = None def upgrade() -> None...
bullbulk/vk-notifications
alembic/versions/e596d1ca7402_.py
e596d1ca7402_.py
py
999
python
en
code
0
github-code
13
10313306705
from itertools import permutations f = open('day7input.txt', "r") lines = f.readlines() numbers = list(map(int, lines[0].split(','))) def getValues(input, pos, opcode, mode1, mode2, mode3): values = [] if opcode in ["01", "02", "04", "05", "06", "07", "08"]: if mode3 == "0": values.append(input[input[po...
wolframalexa/AdventOfCode
2019/day7.py
day7.py
py
2,328
python
en
code
1
github-code
13
39686428332
"""Base class for constructing an analytic engine with analytics.""" from collections import namedtuple from .schema import EVENT_TYPE_GENERIC from .utils import is_string class Event(namedtuple('Event', ['type', 'time', 'data'])): """Event for python engine in EQL.""" @classmethod def from_data(cls, da...
endgameinc/eql
eql/events.py
events.py
py
1,443
python
en
code
203
github-code
13
16022213005
import pathlib, subprocess, os, psutil from tbtamr.CustomLog import logger class Tbtamr(object): """ A base class for setting up tbtamr return a valid input object for subsequent steps """ def __init__(self): self.one,self.five,self.fifteen = psutil.getloadavg() self.tota...
MDU-PHL/tbtamr
tbtamr/TbTamr.py
TbTamr.py
py
3,002
python
en
code
2
github-code
13
6758081757
import csv import re #Create a List of Dicts containing Mac and Port def get_switch_arp(switch_arp): with open(switch_arp) as file: reader = csv.reader(file, skipinitialspace=True) header = next(reader) connects = [dict(zip(header, row)) for row in reader] #convert mac format from x...
kysevenle/work_package
scripts/update_lines.py
update_lines.py
py
2,425
python
en
code
0
github-code
13
16847351670
# -*- coding: utf-8 -*- # @Time : 2019/05 # @Author : XiaoXi # @PROJECT : Aff_service # @File : read_param.py import json from json import JSONDecodeError from bin.unit.replaceRelevance import replace def read_param(test_name, param, _path, relevance=None): """ 读取用例中参数parameter :param test_name: ...
wangxiaoxi3/API_service
bin/unit/readParameter.py
readParameter.py
py
1,490
python
en
code
156
github-code
13
15912035985
# -*- coding: utf-8 -*- # (c) 2017 Andreas Motl <andreas@ip-tools.org> import os import sys import logging import slugify import pathvalidate from datetime import datetime def to_list(obj): """Convert an object to a list if it is not already one""" # stolen from cornice.util if not isinstance(obj, (list, t...
jasmine2000/ri-bio-project
env/lib/python3.8/site-packages/uspto/util/common.py
common.py
py
2,492
python
en
code
0
github-code
13
17052319104
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class Gavintest(object): def __init__(self): self._newid = None @property def newid(self): return self._newid @newid.setter def newid(self, value): self._newid...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/Gavintest.py
Gavintest.py
py
800
python
en
code
241
github-code
13
372056814
from triangle import Triangle import genetic_algorithm from PIL import Image import sys import os import gc def command_line_arg(target_img, population_size, num_of_triangles, crossover_rate, mutation_rate, mutation_amount): if float(crossover_rate) > 1.0 or float(crossover_rate) < 0.0: print("Crossover r...
WinstonShields/Genetic_Algorithm
main.py
main.py
py
2,758
python
en
code
0
github-code
13
43262802072
def main(): if A == B: return print('1.000') res = 10000*B // A if res % 10 > 4: res += 10 return print('0.' + str(res//10).zfill(3)) if __name__ == '__main__': A, B = map(int, input().split()) main()
Shirohi-git/AtCoder
abc271-/abc274_a.py
abc274_a.py
py
245
python
en
code
2
github-code
13
26379089709
#Declare a new int list sumlist = [0]; #We want the multiples of 3 to 999 for i in range(1,334): #Add the product to the sumlist sumlist.append(i*3); #We want the multiples of 5 to 995 for j in range(1,200): #Store the value and check to see if we already have it in the list temp = 5*j; #If the su...
mjgoldman16/Euler-Coding-Projects
q1 - 3s and 5s.py
q1 - 3s and 5s.py
py
520
python
en
code
0
github-code
13
6798469502
import xcp_get if __name__ == "__main__": # My wallet address pubkey = "1EWFR9dMzM2JtrXeqwVCY1LW6KMZ1iRhJ5" # Get wallet contents wallet_data = xcp_get.address(pubkey) # Create wallet asset list wallet = [] for asset in wallet_data: # Check for dispenser disp_result = xcp...
burstMembrane/Counterview
json_updater/OG_PEPES/wallet_check.py
wallet_check.py
py
415
python
en
code
0
github-code
13
15266818152
from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render, get_object_or_404 from django.views.decorators.csrf import csrf_exempt from django.utils import timezone from sys import stdout import datetime from pastebin.models import Paste, Lang, Ban from pastebin.forms import PasteF...
oddstr13-openshell-no/django-app-pastebin
views.py
views.py
py
2,705
python
en
code
0
github-code
13
9949473632
# Write a python program to print all prime numbers between given range start = int(input("Enter the starting number : ")) end = int(input("Enter the ending number : ")) for i in range(start,end+1): for j in range(2,i): if i==0: print(f"{i} is not a prime number") elif i % j == 0...
MR-VAGRAWAL/My_Initial_Python_Learning
prime_number_range.py
prime_number_range.py
py
409
python
en
code
5
github-code
13
1467384379
#%% from airflow import DAG from airflow.operators.python import PythonOperator from airflow.operators.bash import BashOperator from datetime import datetime import numpy as np from pathlib import Path simulation_data_path = Path(__file__).parents[1] / "data" /"dice_simulations" #%% # https://betterdatascience.co...
kokchun/Data-engineering-AI22
Lecture-code/Lec4-Airflow_intro/dags/4.1_python_operator.py
4.1_python_operator.py
py
1,450
python
en
code
1
github-code
13
14327572288
import re from AE.Display.time import * from AE.Display.Animation.Animation_2d import * from AE.Display.Animation.Items_2d import * class Information(Animation_2d): # ======================================================================== def __init__(self, disp_time=True): # Parent contructor ...
CandelierLab/Toolbox_AE
AE/Display/Animation/Information.py
Information.py
py
1,240
python
en
code
0
github-code
13
18074346749
import inspect import string from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from django.core.exceptions import FieldError from django.db import IntegrityError from django.core.management import call_command from fixtureless import Factory import hayst...
greenelab/django-genes
genes/tests.py
tests.py
py
26,144
python
en
code
2
github-code
13
17763097802
from config import Chats from functools import wraps from fuzzywuzzy import process def restricted(func): @wraps(func) def wrapped(update, context, *args, **kwargs): user_id = update.effective_user.id if user_id not in Chats: return return func(update, context, *args, **kwa...
Derafino/goods_scrap
methods.py
methods.py
py
685
python
en
code
0
github-code
13
19702063255
#!/usr/local/bin/python3 # coding: utf-8 import voluptuous as vol from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_platform from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import ( DOMAIN ) from ...
Nemiroff/hassio-r4s
custom_components/ready4sky/water_heater.py
water_heater.py
py
2,052
python
en
code
null
github-code
13
34090413265
#!/usr/bin/env python import rospy from mavros_msgs.msg import State from mavros_msgs.srv import CommandBool, SetMode, CommandBoolRequest, SetModeRequest, SetModeResponse from mavros_msgs.srv import CommandBoolResponse from mavros_msgs.msg import GlobalPositionTarget from sensor_msgs.msg import NavSatFix current_stat...
pranitzope24/Flipkart-Grid-4.0-Robogenerals
scripts/sex.py
sex.py
py
2,549
python
en
code
0
github-code
13
30979794105
from flask import Flask from flask_cors import CORS from flask_jwt_extended import JWTManager import logging import os from uCube_interface import uCube_interface from Store import Store, MockStore class PrefixMiddleware(object): def __init__(self, app, prefix=''): self.app = app self.prefix = ...
uscope-platform/uscope_server
app_factory.py
app_factory.py
py
3,479
python
en
code
0
github-code
13
38011373208
import AthenaPoolCnvSvc.ReadAthenaPool from AthenaCommon.AthenaCommonFlags import athenaCommonFlags from AthenaCommon.AppMgr import ServiceMgr from AthenaCommon import CfgMgr from RecExConfig.RecFlags import rec from glob import glob filelist = glob("/atlas/data1/userdata/khoo/Data16/AOD_r21/valid1.361108.PowhegPythi...
rushioda/PIXELVALID_athena
athena/Reconstruction/MET/METReconstruction/share/RunMETReco_Associator.py
RunMETReco_Associator.py
py
6,245
python
en
code
1
github-code
13
24550793443
import os import sys, time import argparse import logging import importlib import threading import Airplane, Globals import pyavtools.fix as fix args = None wpchanged_time = None def WAYPOINTS_changed(v): global wpchanged_time wpchanged_time = time.time() def SELECTED_WAYPOINT_changed(v): craft.SetWay...
Maker42/openEFIS
FixIntf.py
FixIntf.py
py
15,437
python
en
code
13
github-code
13
5915716414
import tensorflow as tf from Dataset import ImageDataset import os from FileManagement import * import time class SwapModel(tf.keras.Model): def __init__(self): super().__init__() self.const_layer_1 = tf.keras.layers.Conv2D(64, 3, 1, 'same', activation='relu', name='const1') self.swap_lay...
dkoleber/nas
src/scripts/sandbox.py
sandbox.py
py
5,370
python
en
code
0
github-code
13
18744030323
# THIS IS IN PROD ENVIRONMENT from flask import Flask, request import boto3 import os import time import redis import subprocess import psycopg2 # We used this in the DEV and not for PROD #ACCESS_KEY = os.environ['AWS_ACCESS_KEY_ID'] # This needed for the Dev testing, and not with elasticbeanstalk #SECRET_KEY = os.en...
kunwarluthera/jenkins-python
app.py
app.py
py
5,251
python
en
code
2
github-code
13
17115402100
import numpy as np import plotly.express as px import pandas as pd rng = np.random.default_rng() def bubble_diameter(): n_samples = 1 n_points = 100 u_mf = rng.normal(1.8, 0.7, n_samples) # 0.5 - 20 cm/s # u_mf = np.array([1.8, 1.8]) u_mf[u_mf < 0.5] = 0.5 u_mf[u_mf > 20] = 20 u_0 = u_mf + rng.normal(24, 24/2,...
plutonium-239/btp-project
main.py
main.py
py
1,916
python
en
code
0
github-code
13
41847297173
import pygame import time import random # Inicializar o Pygame pygame.init() # Definir as cores RGB white = (255, 255, 255) yellow = (255, 255, 102) black = (0, 0, 0) red = (213, 50, 80) green = (0, 255, 0) blue = (50, 153, 213) # Configurações da tela dis_width = 600 dis_height = 400 dis = pygame....
gabfguimaraes/Jogo-da-Cobrinha
cobrinha.py
cobrinha.py
py
2,768
python
pt
code
0
github-code
13
32501900929
notas_100 = notas_50 = notas_20 = notas_10 = notas_5 = notas_2 = moeda_1 = 0 saque = int(input('Digite a quantia em R$ do saque: R$')) if saque < 10 or saque > 600: print('Valor inválido, Digite um Valor entre R$10,00 e R$600,00') exit() else: print(f'Para receber o valor de \033[32mR${saque}\033[m, o banco...
Elton-Gustavo/PythonBrasilExercicios-
Estruturas de Decisão/21 - caixa eletrônico.py
21 - caixa eletrônico.py
py
3,036
python
es
code
0
github-code
13
41057954425
''' 本节视频 https://www.bilibili.com/video/BV18M4y1k7H8/ “Python”高级教程 类的静态字段的作用是什么?如何定义和使用类的静态字段 本节文章 https://learnscript.net/zh/python/advanced/define-and-access-class-static-fields/ 如何定义和访问类的静态字段 ''' ### import random class Unit: # 类 Unit,表示游戏中的单位 # 静态字段 count,表示存活单位的个数 count = 0 def __init__(self,...
codebeatme/python
src/zh/advanced/static_fields.py
static_fields.py
py
1,791
python
zh
code
1
github-code
13
31726059094
import pandas as pd from kabutobashi.domain.errors import KabutobashiMethodError from .method import Method, MethodType, ProcessMethod class IndustryCategoriesProcess(ProcessMethod): """ 株のvolumeやPBR, PSR, PERなどの値を返す。 parameterizeのみに利用される。 """ method_name: str = "industry_categories" method...
gsy0911/kabutobashi
kabutobashi/domain/services/method/industry_cat.py
industry_cat.py
py
3,182
python
en
code
0
github-code
13
11349338875
# PyTorch has two primitives to work with data: torch.utils.data.DataLoader and torch.utils.data.Dataset. # Dataset stores the samples and their corresponding labels, and DataLoader wraps an iterable around the Dataset. import torch from torch import nn from torch.utils.data import DataLoader from torchvision import ...
liangyuxuan1/phasefunction2
Code_Using_MOSE/Step6_Regression_PhaseOnly_ResNet18_v5Data_CrossVal.py
Step6_Regression_PhaseOnly_ResNet18_v5Data_CrossVal.py
py
9,539
python
en
code
3
github-code
13
31342397838
import sqlite3 import requests import logging import os num_quotes_in_db = 10 log_to_file = True log_location = "chuck_logs.log" db_location = "quotes.db" logger = logging.getLogger(str(os.getpid())) if log_to_file: logging.basicConfig(format=f'%(asctime)s: [%(name)s] %(message)s', datefmt='%d/%m/%y %H:%M:%S', ...
nickhendo/chuck-terminal
runner.py
runner.py
py
1,472
python
en
code
1
github-code
13
20358894000
from celluloid import Camera import matplotlib.pyplot as plt def visualize_simulation( simulator, savename='particles.gif', timesteps=10, fps=10, dpi=400): # Get true path radius for each particle paths = {id(p): (p.x ** 2 + p.y ** 2) ** 0.5 for p in simulator.particles} fig, ax = plt.subplo...
particle1331/high-performance-python
hp/utils.py
utils.py
py
1,151
python
en
code
0
github-code
13
70141781137
# Group: Michael Phelps # Name: Ethan Lansangan # Name: Jake Pielage # Name: James Keen # Name: Branden McKinney # Assignment Title: Assignment 10 # Course: IS 4010 # Semester/Year: Spring 2023 # Brief Description: This demonstrates our ability to use APIs # Citations: # Anything else that's ...
eLasagna/Michael_Phelps_Assignment10
Michael_Phelps_Assignment10/mainPackage/main.py
main.py
py
1,926
python
en
code
0
github-code
13
11340295093
# -*- coding: utf-8 -*- import re from datetime import datetime from scrapy import Spider, Request from kylx.items import KylxItem class HuakeSpider(Spider): name = "huake" allowed_domains = ["job.hust.edu.cn"] start_urls = ['http://job.hust.edu.cn/'] pre_url = 'https://job.hust.edu.cn/searchJob_' ...
jinyaozhuzhu/kylx-crawl
kylx/spiders/huake.py
huake.py
py
1,886
python
en
code
0
github-code
13
41161863744
string_list = input().split() while True: command = input() list_to_add = [] if command == "3:1": break command_list = command.split() if command_list[0] == "merge": start_index = int(command_list[1]) end_index = int(command_list[2]) if len(string_list) - 1 < end_ind...
lefcho/SoftUni
Python/SoftUni - Python Fundamentals/Lists_Advanced/anonymous_threat.py
anonymous_threat.py
py
1,654
python
en
code
0
github-code
13
26648267244
# coding: utf-8 import copy import tushare as ts import numpy as np import wbdata import pandas as pd import math from datetime import datetime, timedelta import requests import json import random import scipy.stats as stats import matplotlib.pyplot as plt from datetime import datetime from dateutil.relativedelta impor...
patrickying/long_term_stock_prediction
data/get_data.py
get_data.py
py
4,001
python
en
code
1
github-code
13
16277408115
import random Deckplayer=[1,2,3,4,5,6,7,8,9,10,11,12,13,14] Deckpc=[1,2,3,4,5,6,7,8,9,10,11,12,13,14] deck2=(Deckplayer, Deckpc) handPlayer= (str(Deckplayer[-1]) + str(Deckplayer[-2])) handNPC= (str(Deckpc[-1]) + str(Deckpc[-2])) def translateDeck (deck): translateDeck = [] for card in deck: if card =...
DanF04/Card-Game
Cardgame.py
Cardgame.py
py
2,656
python
en
code
0
github-code
13
22195601602
import os import pytest import yaml from linkml.generators.sssomgen import SSSOMGenerator @pytest.fixture def schema_path(input_path) -> str: return str(input_path("kitchen_sink_sssom.yaml")) @pytest.fixture def sssom_path(schema_path, tmp_path) -> str: output_path = str(tmp_path / "test_sssom.tsv") g...
linkml/linkml
tests/test_generators/test_sssomgen.py
test_sssomgen.py
py
2,118
python
en
code
228
github-code
13
31436647479
class Solution: def gameOfLife(self, board: List[List[int]]) -> None: """ Do not return anything, modify board in-place instead. """ changed = [] for r in range(len(board)): for c in range(len(board[0])): cnt = 0 # 1 ...
wangjue2020/LeetCode
289-game-of-life/289-game-of-life.py
289-game-of-life.py
py
1,367
python
en
code
0
github-code
13
19964615234
import csv from random import randrange from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import rsa, dsa import pandas as pd for c in range(10): cle = rsa.generate_private_key(backend=default_backend(),p...
Jennyyyfer/CHEN_RMILI-RIOU
code_cryptosujet3.py
code_cryptosujet3.py
py
1,014
python
en
code
0
github-code
13
32336686508
""" Project Euler Problem 31 ======================== In England the currency is made up of pound, -L-, and pence, p, and there are eight coins in general circulation: 1p, 2p, 5p, 10p, 20p, 50p, -L-1 (100p) and -L-2 (200p). It is possible to make -L-2 in the following way: 1 * -L-1 + 1 * 50p + 2 * 20p + 1 * 5p ...
mseibt/ProjectEuler
031.py
031.py
py
676
python
en
code
1
github-code
13
29861388857
import json import unittest import requests_mock import intelmq.lib.test as test from intelmq.bots.outputs.restapi.output import RestAPIOutputBot def request_callback(expected): def callback(request, context): if json.loads(request.text) == expected: context.status_code = 200 else: ...
certtools/intelmq
intelmq/tests/bots/outputs/restapi/test_output.py
test_output.py
py
2,119
python
en
code
856
github-code
13
18697810843
__author__ = 'John Buttigieg' from kivy.uix.button import Button from kivy.properties import StringProperty from kivy.app import App from kivy.lang import Builder import csv ### This program is incomplete but loads data from a csv file ### and displays the data in buttons ### new entries are able to be writting from t...
johnbuttigieg/Code
Assignment 2 GUI ItemsForHire/JohnButtigiegA2.py
JohnButtigiegA2.py
py
4,737
python
en
code
0
github-code
13
72478845137
from tkinter import * from DAO_Module.CustomerDAO import CustomerDAO from DAO_Module.DeviceDAO import DeviceDAO from Models import Customer, Device def registerCustomer(): def save(): company = companyEntry.get() street = streetEntry.get() location = locationEntry.get() postal_code...
Edmond22-prog/GUI_interface
Button_functions.py
Button_functions.py
py
9,908
python
en
code
2
github-code
13
38591350662
import turtle import sys print("Let's play pool!") wn=turtle.Screen() wn.bgcolor("DarkSeaGreen4") wn.title("Pool!") start = 0 from tkinter import * # Importing gui module def button_function(): # The function that the button will run sys.exit() def play(): # The function that the button will run start == 1 screen ...
kaden-daughenbaugh-11882/CSP
PoolGameProject.py
PoolGameProject.py
py
11,302
python
en
code
0
github-code
13
20807981243
import logging from datetime import datetime from db.models import LogMessage import traceback from sqlalchemy.orm import sessionmaker class LogDBHandler(logging.Handler): """ Modified logging handler that writes to provided database session """ def __init__(self, session): super().__init__() ...
andreero/Amazon_advertising
db/logger.py
logger.py
py
1,646
python
en
code
0
github-code
13
74675206736
import itertools import copy import numpy as np from mstk import logger from mstk.chem.rdkit import create_mol_from_smiles from mstk.chem.element import Element from mstk.forcefield.ffterm import * from .atom import Atom from .virtualsite import * from .connectivity import * from .unitcell import UnitCell from .residue...
z-gong/mstk
mstk/topology/molecule.py
molecule.py
py
52,348
python
en
code
7
github-code
13
14645654025
from sqlalchemy import ARRAY, Column, Identity, Integer, String, Table from . import metadata FinancialReportingFinanceReportRunRunParametersJson = Table( "financial_reporting_finance_report_run_run_parametersjson", metadata, Column( "columns", ARRAY(String), comment="The set of ou...
offscale/stripe-sql
stripe_openapi/financial_reporting_finance_report_run_run_parameters.py
financial_reporting_finance_report_run_run_parameters.py
py
2,140
python
en
code
1
github-code
13
73285316179
# 1.当内部作用域想修改外部作用域的变量时,就要用到 global 和 nonlocal 关键字了。 # 修改全局变量 num # !/usr/bin/python3 num = 1 def fun1(): global num # 需要使用 global 关键字声明 print(num) num = 123 print(num) fun1() print(num) # 输出结果 # 1 # 123 # 123 print('\n') # 2. 修改嵌套作用域(enclosing 作用域,外层非全局作用域)中的变量则需要 nonlocal 关键字了 def outer()...
zhengjiaao/Python3-Basic
24 Python3 命名空间和作用域/4 Python3 (global 和 nonlocal关键字).py
4 Python3 (global 和 nonlocal关键字).py
py
927
python
zh
code
0
github-code
13
38314245799
''' Created on Nov 13, 2014 @author: mikael ''' from scripts_inhibition import effect_dopamine kwargs={'data_path':('/home/mikael/results/papers/inhibition/network/' +'supermicro/simulate_beta_ZZZ_dop_effect_perturb/'), 'from_diks':1, 'script_name':(__file__.split('/')[-1][0:-3]+'/...
mickelindahl/bgmodel
python/scripts_inhibition/old_fig_script/fig2_effect_beta_dopamine.py
fig2_effect_beta_dopamine.py
py
409
python
en
code
5
github-code
13
22756706205
from decimal import Decimal N, X = list(map(int,input().split())) alc = Decimal(0) ans = -1 X = Decimal(X) for i in range(N): VP = list(map(Decimal,input().split())) alc += VP[0] * (VP[1] / Decimal(100)) if alc > X: ans = i+1 break print(ans)
tenten0727/AtCoder
AtCoder Beginner Contest 189/B.py
B.py
py
275
python
en
code
0
github-code
13
70523849299
from aip import AipOcr import json """ 你的 APPID AK SK """ APP_ID = '24057924' API_KEY = 'Yrj7dIv17nHQ9hy23KZ1XWTT' SECRET_KEY = 'iEK567uchrXyrTeFZCj7wHhsO8f1rucu' client = AipOcr(APP_ID, API_KEY, SECRET_KEY) """ 读取图片 """ def get_file_content(filePath): with open(filePath, 'rb') as fp: return...
CUG-LXY/undergraduateproject
pyfor软件工程/a.py
a.py
py
1,506
python
zh
code
0
github-code
13
39228297124
from bs4 import BeautifulSoup import operator import string import urllib.request import math import re def freqFourLetterWords(url): r = urllib.request.urlopen(url).read() soup = BeautifulSoup(r, "lxml") paragraphs = soup.find_all('p') fourWordDict = {} for p in paragraphs: pT...
ccrupp/PageStatistics
PageTextAnalysis.py
PageTextAnalysis.py
py
8,750
python
en
code
0
github-code
13
5795629246
""" Calculate edge betweenness Jin Sun """ import random import sys # function to perform BFS, from a selected root # [INPUT] edges: network stored in edge list format # r: root node # [OUTPUT] Np, parents, d as in lecture example def bfs(edges, r): N = len(edges) d = [-1]*N # all...
jinsungit/PHYS615
ps3/calBetweenness.py
calBetweenness.py
py
2,436
python
en
code
0
github-code
13