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
27188462283
from collections import deque import sys input = sys.stdin.readline def dfs(s): visited = [0] * (N + 1) stack = [] visited[s] = 1 ans_dfs.append(s) while True: for w in range(1, N + 1): if w in connection[s] and visited[w] == 0: stack.append(s...
Nam4o/Algorithm
백준/Silver/1260. DFS와 BFS/DFS와 BFS.py
DFS와 BFS.py
py
1,331
python
en
code
1
github-code
13
13230514965
# You are given an array A of size N, and a number K. You have to find the sum of all the prime numbers in the array, whose value is strictly lesser than K. def isPrime(n): if(n==1): return False for i in range(2,n): if(n%i==0): return False return True tests=int(input()) for i in range(test...
muskaan190/Python-Codes
Sum Of Files.py
Sum Of Files.py
py
515
python
en
code
1
github-code
13
7733836214
import tensorflow as tf tf.compat.v1.disable_eager_execution() tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) import logging import os import numpy as np import pandas as pd pd.options.mode.chained_assignment = None import json import random from collections import defaultdict # import s3fs import h...
AI4EPS/PhaseNet
phasenet/data_reader.py
data_reader.py
py
40,501
python
en
code
190
github-code
13
5845511
import pytest from django.shortcuts import get_object_or_404 from django.urls import reverse from pytest_django.asserts import assertTemplateUsed from apps.notes.models import Note # This flags all tests in the file as needing database access # Once setup, the database is cached to be used for all subsequent tests # ...
jamescrg/minhome
apps/notes/tests/test_notes.py
test_notes.py
py
2,864
python
en
code
0
github-code
13
16131472923
from gazpacho import get url = "https://en.wikipedia.org/wiki/Gazpacho" html = get(url) print(html[:50], "\n\n") # get, with optional params url = "https://httpbin.org/anything" html2 = get( url, params={"foo": "bar", "bar": "baz"}, headers={"User-Agent": "gazpacho"} ) print(html2, "\n\n")
udhayprakash/PythonMaterial
python3/16_Web_Services/d_web_scraping/c_gazpacho/b_get_data.py
b_get_data.py
py
297
python
en
code
7
github-code
13
2097272083
from logging import root import functools from typing import List # Definition for a Node. class Node: def __init__(self, val=None, children=None): self.val = val self.children = children class Solution: def preorder(self, root: 'Node') -> List[int]: return (root and [root.val] + func...
atlanmatrix/Algorithm-Py3
leetcode/_589_n_ary_tree_preorder_traversal.py
_589_n_ary_tree_preorder_traversal.py
py
419
python
en
code
0
github-code
13
855234526
import unittest from httmock import all_requests, HTTMock from apihelper import Api url = 'http://cool-site.com' @all_requests def response_content(url, request): if request.method == 'GET': return get_response elif request.method == 'POST': return post_response elif request.method == 'HEA...
naiyt/api-wrapper-helper
test.py
test.py
py
4,446
python
en
code
0
github-code
13
69850294419
""" Proszę zaimplementować algorytm Prima """ from queue import PriorityQueue import sys def Prim(g): n=len(g) parent=[None]*n dist=[sys.maxsize]*n dist[0]=0 q=PriorityQueue() q.put((0,0)) taken=[False]*n taken[0]=True while not q.empty(): d,u=q.get() taken[u]=Tru...
rogzan/ASD
graphs/019 - MST Prim.py
019 - MST Prim.py
py
805
python
en
code
0
github-code
13
28441641829
from __future__ import print_function import torch import torch.nn as nn import torch.nn.parallel import torch.utils.data from torch.autograd import Variable import numpy as np import torch.nn.functional as F class FNN(nn.Module): def __init__(self, d, n): super(FNN, self).__init__() self.d = d ...
hsack6/BMNN_exp
FNN/model.py
model.py
py
1,459
python
en
code
0
github-code
13
636965235
from abc import ABC, abstractmethod from exceptions import NoPatientInLineException, LogNotFoundException class BaseController(ABC): @abstractmethod def __init__(self, view, controller=None): self.__view = view self.__controller = controller def open_view(self, options: dict): se...
p-schlickmann/hospital
controller/base_controller.py
base_controller.py
py
1,040
python
en
code
0
github-code
13
29523441465
import re import urllib.parse import logging import ijson import json import sqlite3 from helpers import * BASE_PATH = 'parsed' logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s', handlers=[logging.FileHandler("logs/parser.log"), ...
in-rolls/ration_bihar
scripts/parser/main.py
main.py
py
6,412
python
en
code
1
github-code
13
12861196800
import os import random from kivy.clock import Clock from kivy.uix.anchorlayout import AnchorLayout from kivy.graphics.context_instructions import Color from kivy.graphics.vertex_instructions import Rectangle from kivy.uix.button import Button from kivy.uix.gridlayout import GridLayout from kivy.uix.widget import Widg...
brainnotincluded/kivy_puzzle
widgets.py
widgets.py
py
6,697
python
en
code
0
github-code
13
71412266579
#! /usr/bin/python import feedparser name = 'FML' desc = 'Display FML entries' types = ['PUBMSG'] fml_url = 'http://feedpress.me/fmylife' def FetchFreshEntries(): feed = feedparser.parse(fml_url) entries = feed.entries entries.reverse() return entries def init(server, storage): storage[name] = {'entries':...
IsaacG/python-projects
ircbot/FML.py
FML.py
py
1,494
python
en
code
3
github-code
13
29028018869
import os import pandas ########################################################################### # Take HIVE1314 data, aggregate same birth year, get average pre and post Texas titer firstY = 1937 lastY = 1999 ### read hive data hivefName = os.path.normpath("../data/HIVE1314.CSV") hiveoutfName = os.path.normpath(...
kangchonsara/HIVE1314
src/serology_similarity.py
serology_similarity.py
py
3,715
python
en
code
0
github-code
13
24631474610
""" The module and class MXKarma is the communication between the API and the Karma class. """ import datetime from pyplanet.contrib.setting import Setting from pyplanet.apps.contrib.karma.mxkarmaapi import MXKarmaApi class MXKarma: """ The MX Karma sub-app of the Karma app. """ def __init__(self, app): self...
15009199/PyPlanet-F8-F9-rebind
pyplanet/apps/contrib/karma/mxkarma.py
mxkarma.py
py
5,515
python
en
code
null
github-code
13
34076476185
from brownie import accounts, Disgufu REQUIRED_CONFIRMATIONS = 2 admin = accounts.load('p7m') def tx_params(gas_limit: int = None): return { "from": admin, "required_confs": REQUIRED_CONFIRMATIONS, "gas_limit": gas_limit } def main(): digufu = Disgufu.deploy(10, tx_params())
perpetuum7/tx-flex-contracts
scripts/deploy.py
deploy.py
py
318
python
en
code
0
github-code
13
8480954124
import sys sys.stdin = open("피시방 알바_input.txt") N = int(input()) # 손님 수 A = list(map(int, input().split())) # 앉으려는 자리 x = len(list(set(A))) # 앉으려는 자리 중복 제거 후 갯수 print(N-x) # 손님 수 빼기 앉으려는 자리 중복 제거 후 갯수 print(x)
kimheekimhee/TIL
python/20220808/피시방 알바.py
피시방 알바.py
py
304
python
ko
code
1
github-code
13
39110039342
import os import json import tensorflow as tf import numpy as np from run_scripts.run_sweep import run_sweep_serial from asynch_mb.utils.utils import set_seed, ClassEncoder from asynch_mb.baselines.linear_baseline import LinearFeatureBaseline from asynch_mb.envs.mb_envs import * from asynch_mb.envs.normalized_env impor...
zzyunzhi/asynch-mb
run_scripts/sequential_exp/trpo_run_sweep.py
trpo_run_sweep.py
py
3,531
python
en
code
12
github-code
13
21580463356
from ietf.settings import * # pyflakes:ignore ALLOWED_HOSTS = ['*'] DATABASES = { 'default': { 'HOST': 'db', 'PORT': 3306, 'NAME': 'ietf_utf8', 'ENGINE': 'django.db.backends.mysql', 'USER': 'django', 'PASSWORD': 'RkTkDPFnKpko...
ietf-tools/old-datatracker-branches
docker/configs/settings_local.py
settings_local.py
py
1,937
python
en
code
5
github-code
13
42549126241
# -*-coding:UTF-8-*- import os import re import torch import scipy.io import pickle import numpy as np import glob import fnmatch import torch.utils.data as data import scipy.misc from PIL import Image import cv2 from .transforms import Mytransforms from .standard_legends import std_legend_lst, idx_MHP from dataset.fre...
ZJULiHongxin/HRNet-Hand-Pose-Estimation
lib/dataset/MHP_CPMDataset.py
MHP_CPMDataset.py
py
10,056
python
en
code
1
github-code
13
35658629375
#!/usr/bin/python3 from wifi import Cell iface = "wlp2s0" for cell in Cell.all(iface): output = "%s\t(%s)\tchannel %d\tsignal %d\tmode %s " % \ (cell.ssid, cell.address, cell.channel, cell.signal, cell.mode) if cell.encrypted: output += "(%s)" % (cell.encryption_type.upper(),) else: ...
balle/python-network-hacks
wlan-scanner.py
wlan-scanner.py
py
367
python
en
code
135
github-code
13
31900734349
################## # django imports # ################## from django.urls import path, include ########################################## # import modules from current directory # ########################################## from . import views from accounts import views as AccountViews ##################### # url p...
rtactayjr/Online-Food-Web-App
merchant/urls.py
urls.py
py
1,990
python
en
code
1
github-code
13
38002084744
from tkinter.ttk import Frame, Button from tkinter_gui.game_state import GameState class ControlsFrame(Frame): def __init__(self, game_state: GameState, *args, **kwargs): super().__init__(*args, **kwargs) self._game_state = game_state self.columnconfigure(0, weight=1) self.column...
Shtepser/chess
tkinter_gui/controls_frame.py
controls_frame.py
py
595
python
en
code
0
github-code
13
23027885102
#!/usr/bin/env python3 def split_long_utt(text, maxchars): parts = [] splits_to_be_made = len(text) // maxchars while splits_to_be_made > len(parts): parts.append(text[len(parts)*maxchars:(len(parts)+1)*maxchars]) parts.append(text[len(parts)*maxchars:]) return parts if __name__ == "__main...
Gastron/omstart-net
preprocessing/split_long_utts.py
split_long_utts.py
py
823
python
en
code
0
github-code
13
24987991177
"""Container for each experiment, has a dataframe and metadata""" import os import re from datetime import datetime import traceback import pandas as pd from . import _version class UserData: def __init__(self, recno=None, datafile=None, runno=1, searchno=1, no_taxa_redistrib=0, addedby='', in...
malovannaya-lab/gpgrouper
gpgrouper/containers.py
containers.py
py
6,171
python
en
code
6
github-code
13
72688758417
class SimpleDate: def __init__(self, day: int, month: int, year: int): self._day = day self._month = month self._year = year def __str__(self): return f"{self._day}.{self._month}.{self._year}" def __eq__(self, another): if self._year != another._year : ...
crawwwler/mooc-python
part 10/simple date/src/simple_date.py
simple_date.py
py
2,300
python
en
code
0
github-code
13
25162623182
from bs4 import BeautifulSoup import requests Title = "" def tread_spider(page_num): s=120 while s <= page_num: url = 'https://sfbay.craigslist.org/search/bia?s=' + str(s) response = requests.get(url) plain_responce = response.text soup = BeautifulSoup(plain_responce) fo...
tpatil2/Python
Web Crawler/main_crawl.py
main_crawl.py
py
1,031
python
en
code
0
github-code
13
9520934927
from __future__ import absolute_import from django.core.exceptions import ValidationError from rest_framework import serializers from silver.api.serializers.common import MeteredFeatureSerializer from silver.api.serializers.product_codes_serializer import ProductCodeRelatedField from silver.models import Provider, P...
silverapp/silver
silver/api/serializers/plans_serializer.py
plans_serializer.py
py
2,413
python
en
code
292
github-code
13
36266986413
import sqlite3 from random import randint, choice from faker import Faker import pandas as pd conn = sqlite3.connect('social_network.db') #creating a query to get list of all married couples as asked in the lab married_couple = """ SELECT person1.name, person2_name, beginning_date FROM relationships JOIN p...
kunjthakkar/Lab_008
Script2.py
Script2.py
py
709
python
en
code
0
github-code
13
43460315413
# File: MagicSquare.py # Description: A n x n matrix that is filled with the numbers 1, 2, 3, ..., n² is a magic square if the sum of the elements in each row, in each column, and in the two diagonals is the same value. # I just copied the description from the Assignment, not too sure if we create our own or not...
jasoncsonic/CS313E
MagicSquare.py
MagicSquare.py
py
6,255
python
en
code
0
github-code
13
7318067026
import matplotlib.pyplot as plt import pandas as pd import statsmodels.api as sm # create some data # # N.B. In linear regression, there is a SINGLE y-value for each data point, but there # may be MULTIPLE x-values, corresponding to the multiple factors that might affect the # experiment, i.e. y = b_1 * x...
brash99/cpsc250
Week4_Examples/linear_regression_statsmodels.py
linear_regression_statsmodels.py
py
1,161
python
en
code
1
github-code
13
32170038212
''' UE20CS302 (D Section) Machine Intelligence Week 3: Decision Tree Classifier Mitul Joby PES2UG20CS199 ''' import numpy as np '''Calculate the entropy of the enitre dataset''' # input:pandas_dataframe # output:int/float def get_entropy_of_dataset(df): entropy = 0 colLast = df.columns[-1] vals = df[colL...
Mitul-Joby/Machine-Intelligence-Lab
Week 3/PES2UG20CS199.py
PES2UG20CS199.py
py
1,905
python
en
code
0
github-code
13
24289643055
import numpy as np import multiprocessing as mt if __name__ == "__main__": from voronoi import _voronoi_analysis else: import _voronoi_analysis class VoronoiAnalysis: """This class is used to calculate the Voronoi polygon, which can be applied to estimate the atomic volume. The calculation is conduct...
mushroomfire/mdapy
mdapy/voronoi_analysis.py
voronoi_analysis.py
py
3,333
python
en
code
15
github-code
13
37385160040
import random import logging import statistics import pandas as pd from src.utils.custom_decorators import time_func from nltk.sentiment.vader import SentimentIntensityAnalyzer logger = logging.getLogger(__name__) class SentimentAnalysis: @staticmethod def scale_compound_score(compound_score, text): ...
dstambler17/Social-Media-Post-Stock-Pipeline
src/machine_learning/SentimentAnalysis.py
SentimentAnalysis.py
py
1,749
python
en
code
1
github-code
13
43508374866
from dsmpy import root_resources from dsmpy.event import Event, MomentTensor from dsmpy.spc.stf import SourceTimeFunction from obspy import read_events import numpy as np import warnings from datetime import date import re import requests def convert_catalog(cat): #cat = read_events(root_resources + 'gcmt.ndk') ...
afeborgeaud/dsmpy
dsmpy/utils/cmtcatalog.py
cmtcatalog.py
py
3,145
python
en
code
10
github-code
13
45034293405
from book_packer import get_book_data_from_file, sort_books_by_weight, \ sort_books_into_boxes, export_boxes_to_json, extract_book_data, \ Book, Box, OUTPUT_FILE import unittest import json class TestGetBookDataFromFile(unittest.TestCase): def test_get_book_data_from_file(self): # Ideally we'd moc...
almosteverywhere/psychic-fortnight
tests/test_book_packer.py
test_book_packer.py
py
4,619
python
en
code
0
github-code
13
20584305048
from django.test import TestCase from django.contrib.auth import get_user_model from django.db.utils import IntegrityError from django.utils import timezone import datetime from core.models import Address from order.models import Cart, CartItem, Order, OrderItem, Transaction from shop.models import Product class Car...
mejomba/django_shop_m89_final
order/tests/test_model.py
test_model.py
py
4,104
python
en
code
0
github-code
13
40672619995
import json import os import matplotlib from matplotlib.backends.backend_pdf import PdfPages from src.general import create_dir from sys_config import AL_RES_DIR, RES_DIR, BASE_DIR matplotlib.use('Agg') import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np def read_results_js...
mourga/transformer-uncertainty
src/plotting_al.py
plotting_al.py
py
17,432
python
en
code
37
github-code
13
19577365615
import json from unittest import mock from rest_framework import status from rest_framework.reverse import reverse from rest_framework.test import APITestCase from companies.tests.factories import fake, UserFactory, CompanyUserFactory class CompaniesAPITestCase(APITestCase): @mock.patch('companies.serializers.C...
ktryber/aljex-sync-api
api/companies/tests/views/test_companies.py
test_companies.py
py
3,010
python
en
code
0
github-code
13
17643823205
# import subprocess import os from argparse import ArgumentParser script_name = "daily_schedule.py" code_folder_path = "C:/Users/67311/OneDrive/Reference/bash_functions/schedule_alarm/" parser = ArgumentParser() parser.add_argument("-code", help="show code", action = 'store_true') parser.add_argument("-code_...
CCYChongyanChen/Daily_schedule
daily_schedule2.py
daily_schedule2.py
py
4,122
python
en
code
0
github-code
13
7328515176
import os from turtle import back import pandas as pd import numpy as np from sklearn.linear_model import Perceptron as per from sklearn.metrics import accuracy_score, mean_squared_error, r2_score from sklearn import linear_model from sklearn.decomposition import PCA as pca_reduction import joblib class reg: def ...
OpenXLab-Edu/OpenBaseLab-Edu
BaseML/Regression.py
Regression.py
py
4,867
python
en
code
5
github-code
13
43227049186
# Use of booleans and comparision operator n1 = int(input('enter first number')) n2 = int(input('enter second number')) n3 = int(input('enter third number')) # We will be checking if n1 is greater than n2 and n3 or not print (n1 > n2 and n1 > n3) print (n1 > n2 or n1 > n3) # In the above program we are using co...
mukes137/Python
control flow/day3.py
day3.py
py
1,219
python
en
code
0
github-code
13
17113643034
""" reference_mod_md5sum_model.py =============== """ from datetime import datetime import pytz from sqlalchemy import (Column, ForeignKey, Integer, String, DateTime) from sqlalchemy.orm import relationship from agr_literature_service.api.database.base import Base from sqlalchemy.schema import Index c...
alliance-genome/agr_literature_service
agr_literature_service/api/models/reference_mod_md5sum_model.py
reference_mod_md5sum_model.py
py
1,654
python
en
code
1
github-code
13
14758736144
import json import os from Library.core import Database from Library import constants import sqlite3 class DAO: TABLE = None SCHEMA = None def __init__(self, database_file_path, volatile=False): self._database = Database(database_file_path) self.volatile = volatile self.database...
joshnic3/StreamGuide
src/Library/data.py
data.py
py
7,086
python
en
code
0
github-code
13
42725684397
from __future__ import print_function, absolute_import import os import argparse import time import matplotlib.pyplot as plt import torch import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim import torchvision.datasets as datasets import _init_paths from pose import Bar from pose.utils.lo...
bearpaw/pytorch-pose
example/main.py
main.py
py
17,704
python
en
code
1,087
github-code
13
25018622208
import logging from datetime import timedelta import voluptuous as vol import requests from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.helpers.entity import Entity import homeassistant.helpers.config_validation as cv from homeassistant.util import Throttle from requests.exceptions import ...
code-geeker/heweather
custom_components/heweather/sensor.py
sensor.py
py
12,850
python
en
code
0
github-code
13
41643857939
from django.conf import settings from django.conf.urls import patterns, url from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.generic.simple import redirect_to admin.autodiscover() urlpatterns = patterns('', # serving static files (r'^favico...
mattsnider/vet24seven
urls.py
urls.py
py
1,223
python
en
code
0
github-code
13
39151900935
from __future__ import print_function import os.path import argparse import numpy as np import sys from types import SimpleNamespace sys.path.insert(0,'..') from download_owncloud_tray_imgs import download_from_oc from helpers import get_config from experiment_runner import ExperimentRunner from training_ml.pull_labels...
sidguptacode/ML_AT_Interpretation
agglutination-detection/training_ml/get_labels_dist.py
get_labels_dist.py
py
5,242
python
en
code
0
github-code
13
15478935225
from flask import request, jsonify from .. import db from .models import Homework def get_all_homeworks(): homework = Homework.query.all() homework_list = [] for h in homework: hw = { "id": h.id, "homework_name": h.homework_name, "subject": h.subject, ...
diegorramos84/homeworkheroes-api
homework/controllers.py
controllers.py
py
2,409
python
en
code
0
github-code
13
20254863438
from PyQt5 import QtCore, QtGui, QtWidgets import pandas as pd def importBtnHandler(self): self.fromImport = True data=pd.read_csv('inputs.csv') r=data.shape[0] r=int(r) data.set_index('Jobs',inplace=True) i=0 j=0 rows = r self.JobNo.setValue(rows) #self.previousRows = rows...
ParthPrajapati43/OS-Algorithms
ProcessScheduler/src/Buttons/Import.py
Import.py
py
3,062
python
en
code
7
github-code
13
12310448785
from flask import Flask, render_template, request from flask_paginate import Pagination, get_page_args from firebase_admin import db import db_init import asyncio import concurrent.futures import time pages_ref = db.reference('/pages') ranks_ref = db.reference('/ranks') idx_ref = db.reference('/indexes') app = Flask(...
sharon1160/buscape
app.py
app.py
py
4,413
python
en
code
1
github-code
13
17055116704
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class KoubeiServindustryNatatoriumWaterqualityUploadModel(object): def __init__(self): self._commodity_id = None self._current_num = None self._currentnum_update_time = None ...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/KoubeiServindustryNatatoriumWaterqualityUploadModel.py
KoubeiServindustryNatatoriumWaterqualityUploadModel.py
py
17,237
python
en
code
241
github-code
13
73883149778
import numpy as np import matplotlib.pyplot as plt LR = 0.1 epochs = 6 BATCH_SIZE = 1000 LAMBDA = 1 def accuracy(h, y): m = y.shape[0] h[h >= 0.5] = 1 h[h < 0.5] = 0 c = np.zeros(y.shape) c[y == h] = 1 return c.sum() / m def shuffle(x, y): r_indexes = np.arange(len(x)) np.random.shuff...
marianavargas2002/machine-learning-.
regresion_logistica/optimizacion.py
optimizacion.py
py
3,176
python
en
code
0
github-code
13
26854019865
import json import os import datetime import jwt from datetime import timedelta from conf.base import SPE_CH def http_response(self, msg, code): """ response: "data":{type1:{},type2:{}} 对象转成的字典,以type为key区分并访问每一行 "code":code """ self.write(json.dumps({"data": {"msg": msg, "code...
xiaoyuerova/questionnaireServer
common/commons.py
commons.py
py
3,356
python
en
code
0
github-code
13
35196067740
#Conversor de medidas metro = float(input('DIgite um valor para ser convertido: ')) km = metro / 1000 hec = metro / 100 dam = metro / 10 dm = metro * 10 cm = metro * 100 mm = metro * 1000 print(f' em metro: {metro} \n , em km: {km} \n , em hec {hec} \n , em dam {dam} \n , em dm {dm} \n em cm {cm,} \n em mm {mm}')
Kaykynog/exercicios_guanabara
exercicios/011.py
011.py
py
318
python
pt
code
1
github-code
13
31332668114
import torch import torch.nn as nn import torch.nn.functional as F from .tile_target_masks import make_target_images_and_loss_masks class TileObjective(nn.Module): """ Args: - images_to_match - List [ List [ Tensor ] ]: e.g. [[img0], [img1, img2], ..., [img0, img3]] A list of l...
ClaartjeBarkhof/roaming-the-black-box
tiling/tile_objective.py
tile_objective.py
py
9,659
python
en
code
0
github-code
13
70600225937
import turtle as t import random as r import datetime screen = t.Screen() screen.setup(height=500, width=600) t.Turtle(visible=False) t.up() t.speed(0) t.goto(-250, 200) for i in range(21): t.write(i) t.forward(25) x = -250 t.goto(-250, 200) t.right(90) for i in range(21): for j in range(1...
mark3000-010701/python_base
bt_list_tuple.py
bt_list_tuple.py
py
1,789
python
en
code
0
github-code
13
24283348455
import pytest from models.jellynote import UserId from persist import users, UpdateError, InsertionError from datetime import datetime from random_utils import * from fixtures import new_user def test_user_insert(): req = random_user_creation_request() user = users.insert(req) assert user is not None ...
whisust/jellynote-backend
tests/test_persist_users.py
test_persist_users.py
py
2,149
python
en
code
1
github-code
13
7783759926
#Importing necessary libraries. import socket import subprocess import time import sys import pyfiglet subprocess.call('clear', shell=True) #Creating a script banner. Port_Scan_Banner = pyfiglet.figlet_format("PORT SCANNER") print(Port_Scan_Banner) time.sleep(1) #Use of sockets module to take user input and use in ...
H4mm3r0fG0d/ITP270_FALL2022
ITP270/Python Scripts/Security Scripts/PortScanner.py
PortScanner.py
py
1,328
python
en
code
0
github-code
13
4766847001
import sys import os from cx_Freeze import setup, Executable # ADD FILES files = ['icon.ico','themes/'] # TARGET target = Executable( script="main.py", base="Win32GUI", icon="icon.ico" ) # SETUP CX FREEZE setup( name = "Prroject Python", version = "1.0", description = "XỬ LÝ TÌNH HUỐNG KHUẨN ...
NinhLuong/Emergency-Management-System
XuLyTinhHuongKhanCap/setup.py
setup.py
py
458
python
en
code
0
github-code
13
12250585520
""" # Definition for a Node. class Node: def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = None, next: 'Node' = None): self.val = val self.left = left self.right = right self.next = next """ class Solution: def connect(self, root: 'Node') -> 'Node': i...
wellslu/LeetCode-Python
medium/Populating_Next_Right_Pointers_in_Each_Node.py
Populating_Next_Right_Pointers_in_Each_Node.py
py
833
python
en
code
3
github-code
13
8543095907
''' 时间序列模型:ARIMA ''' import pandas as pd import numpy as np from statsmodels.tsa.stattools import adfuller from statsmodels.tsa.seasonal import seasonal_decompose from statsmodels.tsa.stattools import acf, pacf import statsmodels.tsa.stattools as st from statsmodels.tsa.arima_model import ARIMA import statsmodels.api a...
privateEye-zzy/ARIMA
arima.py
arima.py
py
6,505
python
en
code
1
github-code
13
26562964553
# pylint: disable=maybe-no-member import base64 import json from models import session, ElectionRound, Person, Choice import api.response_helper as Response #Helper def model_as_dict(self): return {c.name: getattr(self, c.name) for c in self.__table__.columns} def _get_electionround_by_id(elec_ro...
consultINCode/digitales_Abstimmtool
Backend/api/voteapi.py
voteapi.py
py
6,455
python
en
code
2
github-code
13
74461853777
import datetime from behave import * from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait @when(u'I click on "Sort by" filed') def step_impl(context): sort_by = WebDriverWait(context.driver...
LeviSforza/TraWell
TraWell-tests/features/steps/sorting_found_rides.py
sorting_found_rides.py
py
2,912
python
en
code
0
github-code
13
12880605144
import pickle from nltk.tokenize import word_tokenize from nltk.corpus import stopwords import string import pickle import os import pickle import nltk from nltk import word_tokenize,sent_tokenize nltk.download('punkt') nltk.download('stopwords') os.chdir(here = os.path.dirname(os.path.abspath(__file__))) pickle_of...
impatientwolf/CSE508_Winter2023_A1_67
q2.py
q2.py
py
3,494
python
en
code
0
github-code
13
38240545176
# coding=utf-8 # 本工具用于紧凑数据库id,使之连续。 # 本工具基本没用,只用于防备出现极端情况。 # 需要安装sqlalchemy import sys import os from sqlalchemy import create_engine from sqlalchemy import Table, Column, Integer, String, MetaData from sqlalchemy.sql import select def doit(src, desc): # read engine = create_engine('sqlite://...
animalize/infopi
src/compact_db_id.py
compact_db_id.py
py
3,173
python
zh
code
73
github-code
13
6660690302
################################################################### ## Written by Eli Pugh and Ethan Shen ## ## {epugh}, {ezshen} @stanford.edu ## ## This file contains tools to make computing directed ## ## information faster with matrices. ...
elipugh/directed_information
directed_information/fast_mat_DI.py
fast_mat_DI.py
py
2,692
python
en
code
2
github-code
13
7524223349
from django.urls import include, path from django.conf.urls.static import static from django.conf import settings from . import views app_name = 'opensim-viewer' urlpatterns = [ # Get list of users. path("users/", views.UserViewSet.as_view({'get': 'list'}), name="UserViewSet"), # Get specific model recor...
opensim-org/opensim-viewer
src/backend/backend/backend/urls.py
urls.py
py
1,840
python
en
code
7
github-code
13
47944432344
import requests # import yagmail from pyquery import PyQuery from mymodule import stats_word def stats(url): response = requests.get(url) document = PyQuery(response.text) content = document('#js_content').text() statList = stats_word.stats_text(content,100) statString = ''.join(str(i) for i i...
heima2019/selfteaching-python-camp
19100101/lidong2119/d11_training1.py
d11_training1.py
py
355
python
en
code
null
github-code
13
72571426577
from datetime import datetime from sqlalchemy import select, and_, func, desc, null from schema import * class DBException(Exception): pass async def select_or_insert(connection, query_select, field, query_insert, create_if_none=True): ds = await connection.execute(query_select) if ds.rowcount: ...
bashkirtsevich/macaque
db_api.py
db_api.py
py
11,805
python
en
code
0
github-code
13
38058633930
"""HARSHAD NUMBER A number is said to be Harshad if it's exactly divisible by the sum of its digits. Create a function that determines whether a number is a Harshad or not. Examples: is_harshad(75) ➞ False 7 + 5 = 12 75 is not exactly divisible by 12 is_harshad(171) ➞ True 1 + 7 + 1 = 9 9 exactly divides 171 """ ...
unitinguncle/PythonPrograms
HARSHAD NUMBER.py
HARSHAD NUMBER.py
py
562
python
en
code
0
github-code
13
34241755267
count=int(input()) words=dict() for i in range(count): word=input() if word not in words: words.update({word:1}) else: words[word]= words[word]+1 print(len(words.keys())) for i in words.values(): print(i,end=' ')
CodeWithRushi/Hackerrank_Solutions
Collections/Words_Order.py
Words_Order.py
py
232
python
en
code
0
github-code
13
2074538797
'''Record data from the API to file. PARTIALLY DEVELOPED / UNTESTED ''' import os import io import glob import time import asyncio from .. import util import tqdm # __bind__ = ['store'] import ptgctl ptgctl.log.setLevel('WARNING') def tqprint(*a, **kw): tqdm.tqdm.write(' '.join(map(str, a)), **kw) class Dis...
VIDA-NYU/ptgctl
ptgctl/tools/local_record.py
local_record.py
py
6,578
python
en
code
0
github-code
13
26454907353
from collections import OrderedDict def ordered_dict(n): dict_value = OrderedDict() for i in range(n): items = input().split() item_name = " ".join(items[:-1]) item_price = int(items[-1]) if dict_value.get(item_name): dict_value[item_name] += item_price else...
Eyakub/Problem-solving
HackerRank/Python/collections_orderDict.py
collections_orderDict.py
py
510
python
en
code
3
github-code
13
21434509336
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Cavern', fields=[ ('id', models.AutoField(verbo...
dlb8685/abstract_caving
game/migrations/0001_initial.py
0001_initial.py
py
1,656
python
en
code
0
github-code
13
20891193803
a = [1234, 'valid', 'ball', 'nice', 'man', 'quick', 123, 'one', 'two', 'alpha', 'alone', 'dark', 'night', 'tiger'] del a[5] # this will delete the 6th item from the list. print(a) a = [1234, 'valid', 'ball', 'nice', 'man', 'quick', 123, 'one', 'two', 'alpha', 'alone', 'dark', 'night', 'tiger'] a.remove(123) # thi...
Sayed-Tasif/my-programming-practice
removing items from the list.py
removing items from the list.py
py
932
python
en
code
0
github-code
13
36725308420
from selenium import webdriver from django.test import LiveServerTestCase from polls.models.question import Question from polls.models.choice import Choice from django.contrib.auth.models import User from django.test.client import Client from decouple import config class FrontendTest(LiveServerTestCase): @classm...
plumest/django-polls
polls/tests/test_client_sites.py
test_client_sites.py
py
2,749
python
en
code
0
github-code
13
19383465034
from tkinter import * import tkinter.messagebox class Patient: def __init__(self,name, location, gender, age): self.name = name self.location = location self.gender = gender self.age = age self.temperature = 0 self.fever = 0 self.cough = 0 self.vomit ...
KelMHunt/ai-project
PatientExpertSystem/test.py
test.py
py
6,844
python
en
code
0
github-code
13
27637054757
from datetime import date, datetime import time import math from wechatpy import WeChatClient from wechatpy.client.api import WeChatMessage, WeChatTemplate import requests import os import random today = datetime.now() #start_date = '2019-08-14' start_date = '2022-10-31' ending_date = '2023-07-01' city0 = 'wuhan' birt...
Alpha521/wechat
main.py
main.py
py
4,978
python
en
code
0
github-code
13
70148019857
import io import os from typing import Callable, Optional import h5py from PIL import Image from torch.utils.data import Dataset from tqdm import tqdm class H5Dataset(Dataset): def __init__( self, h5_path: str, transform: Optional[Callable] = None, ): """H5 Dataset. Th...
NJU-LHRS/official-CMID
Pretrain/Dataset/h5_dataset.py
h5_dataset.py
py
2,896
python
en
code
48
github-code
13
3021704123
#!/usr/bin/python3 def roman_to_int(roman_string): """roman to integer""" if not isinstance(roman_string, str) or not roman_string: return 0 roman_num = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} num = 0 prev_value = 0 for symbol in roman_string[::-1]: va...
JozeSIMAO/alx-higher_level_programming
0x04-python-more_data_structures/12-roman_to_int.py
12-roman_to_int.py
py
488
python
en
code
0
github-code
13
11818081945
import json birthday = "C:\\Users\\Banerjea-PC\\Documents\\Python_saved\\birthdays.json" birthdays_dump = { 'Albert Einstein': '03/14/1879', 'Benjamin Franklin': '01/17/1706', 'Ada Lovelace': '12/10/1815', 'Donald Trump': '06/14/1946', 'Rowan Atkinson': '01/6/1955'} with open(birthday, 'w') as op...
PranabBandyopadhyay/Tutorial1
EX34.py
EX34.py
py
1,274
python
en
code
0
github-code
13
21119246518
""" Script para variar os octetos de um endereço IP """ """ import subprocess subprocess.Popen("ssh {user}@{host} {cmd}".format(user=user, host=host, cmd='ls -l'), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() """ try: from os import sep from os import getenv from dotenv...
rico2290/generate_octect_ip
ip_address_changer.py
ip_address_changer.py
py
4,014
python
en
code
0
github-code
13
20052669589
#!/usr/bin/env python import cv2 import numpy as np import rospy from std_msgs.msg import Int32MultiArray def send_corners(): result = np.array([]) pub = rospy.Publisher('corner_topic',Int32MultiArray,queue_size = 10) rospy.init_node('corner_node',anonymous=True) rate=rospy.Rate(10) msg=Int32Multi...
Lazar-Wolfe/ARK-CV-Ros-Task
scripts/feature_detector_2.py
feature_detector_2.py
py
1,400
python
en
code
0
github-code
13
46395003104
import time from locust import HttpUser, task, between class QuickstartUser(HttpUser): # wait_time = between(1, 5) @task(3) def ready(self): self.client.get("/api/v1/ready") @task def microservice(self): for item_id in range(10): self.client.get("/api/v1/microservice")...
abnerjacobsen/fastapi-mvc-loguru
locust/test1.py
test1.py
py
349
python
en
code
1
github-code
13
17143173855
import scrapy from conifer.items import ConiferItem class ConfierSpider(scrapy.Spider): name = 'conifer' start_urls = ['http://www.greatplantpicks.org/plantlists/by_plant_type/conifer',] # def parse(self, response): # filename = response.url.split("/")[-2] + ".html" # with open(filename,...
subbuwork/WebScraping_Scrapy
conifer/spiders/conifer_spider.py
conifer_spider.py
py
920
python
en
code
0
github-code
13
73196056017
import math import numpy as np import os import pylab from numpy import linspace from scipy import pi plt = pylab.matplotlib.pyplot mpl = pylab.matplotlib.mpl import random as rand zLabel='zlabel' xLim=False yLim=False xLabel='xLabel' yLabel='yLabel' xData=[] yData=[] zData=[] xData.append(1) yData.append(1) zData....
kylemede/SMODT
sandbox/pythonSandbox/plotTESTER.py
plotTESTER.py
py
501
python
en
code
0
github-code
13
16007498700
import tqdm import argparse import numpy as np import matplotlib.pyplot as plt import cv2 def save_fig(std): #std = 0.01 print(std) center = np.array([0.2, 0.3, 0.8]) height = np.array([0.15, 0.15, 0.23]) def f(x): return (np.exp(-(x[:, None] - center)**2/0.04) + height).max(axis=-1) ...
haosulab/RPG
solver/exps/misc/draw_gaussian.py
draw_gaussian.py
py
1,156
python
en
code
18
github-code
13
21794848096
''' 1. A METHOD FOR FACE DETECTION PERPOSED BY : VIOLA AND JONES 2. Earlist method for realtime object detection 3. [Postive Image] + => [Model Train] => [XML File(Cascade File)] [Negitive Image] 4. We are going to use PRETRAIN cascade file provide files 5. OpenCV provide some default cascade for ...
8Bit1Byte/openCV-projects
Face Detection/face-detection.py
face-detection.py
py
826
python
en
code
2
github-code
13
38637145222
"""Routine for decoding the CIFAR-10 binary file format.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import gzip import re import sys import tarfile import numpy as np from six.moves import urllib import tensorflow as tf import os from datetime import...
fengziyue/Lane-Detection
myeval_class.py
myeval_class.py
py
25,303
python
en
code
13
github-code
13
17033957164
from ...backend_config.converters import safe_text_to_bool from ...backend_config.environment import EnvEntry ENV_HOST = EnvEntry("CLEARML_API_HOST", "TRAINS_API_HOST") ENV_WEB_HOST = EnvEntry("CLEARML_WEB_HOST", "TRAINS_WEB_HOST") ENV_FILES_HOST = EnvEntry("CLEARML_FILES_HOST", "TRAINS_FILES_HOST") ENV_ACCESS_KEY = ...
allegroai/clearml-agent
clearml_agent/backend_api/session/defs.py
defs.py
py
1,963
python
en
code
205
github-code
13
42926603186
from django.shortcuts import render from django.shortcuts import HttpResponse from site_youwu.models import Album from site_youwu.models import Star from .view_common import paging from .view_common import getAlbumPageUrl from .view_common import recommend from .view_common import recom_albums from .view_common import ...
youwu360/youwu
youwu-src/site_youwu/view_list/view_star.py
view_star.py
py
2,448
python
en
code
0
github-code
13
17050659374
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class CropsHarvestProgressInfo(object): def __init__(self): self._actual_date = None self._addition_info = None self._crop_code = None self._harvest_progress_value = Non...
alipay/alipay-sdk-python-all
alipay/aop/api/domain/CropsHarvestProgressInfo.py
CropsHarvestProgressInfo.py
py
3,685
python
en
code
241
github-code
13
69970213138
import discord import json import munch import os import typing from dotenv import load_dotenv from glob import glob from traceback import format_exception import colorama as colour colour.init(autoreset=True) def loadjson(file: str) -> munch.Munch: """Attempts to load a JSON file and returns it as a Munch obje...
ThatOtherAndrew/ThatOtherBot-Old
assets/functions.py
functions.py
py
7,861
python
en
code
0
github-code
13
11705037488
#John O'Neill 01/04/2018 #Euler Problem 5... Finding Lowest common multiple for a range 1-20 #'''Used much of logic from https://www.youtube.com/watch?v=Km36RkQToqo and adjusted some variable inputs based on other knowledge on LCM from other sources''' # https://stackoverflow.com/questions/147515/least-common-mult...
JohnONeillGMIT/Programming-and-Scripting
ExerciseWeek4.py
ExerciseWeek4.py
py
863
python
en
code
0
github-code
13
20919769766
#!/usr/bin/env python3 import itertools import typing def validate(numbers:list, index:int, lookback:int=25): """ Return true if numbers[index] is the sum of two numbers in the lookback slice """ if index >= lookback: try: preamble = numbers[index-lookback:index] number = numbers[index] return any(list...
colematt/advent-code
2020/9/day9.py
day9.py
py
1,503
python
en
code
0
github-code
13
12804905941
import data_common appliance_ip = '15.245.131.12' RACK = 'AR51' ENC_1 = 'CN754406W7' ENC_2 = 'CN7544044C' ENC_3 = 'CN754406WT' ENCLOSURE_URIS = ['ENC:' + ENC_1, 'ENC:' + ENC_2, 'ENC:' + ENC_3] frame = 3 # Interconnect Bay Set IBS = 3 ENC_CLTYPE = data_common.CHLORIDE10 REDUNDANCY = 'AB' LE = 'LE' + '-' + REDUNDAN...
richa92/Jenkin_Regression_Testing
robo4.2/fusion/tests/wpst_crm/feature_tests/TBIRD/FC_POTASH/data_F117_AR51_ab.py
data_F117_AR51_ab.py
py
20,021
python
en
code
0
github-code
13
38701156465
""" Contains classes that provide sets of API views for all models of the project. """ from django.db.models import Count from django_filters.rest_framework import DjangoFilterBackend from rest_framework import status, mixins, viewsets from rest_framework.decorators import action from rest_framework.generics import get...
Lalluviadel/interview_quiz
api_rest/api.py
api.py
py
6,957
python
en
code
0
github-code
13
15247928778
import json import os import rtree from shapely import geometry DEFAULT_DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data") SHAPES_FILE = "shapes.json" METADATA_FILE = "metadata.json" cached_country_database = None class CountryDatabase: @staticmethod def load(root_dir = DEFAULT_D...
amhellmund/azure-function-country-query
common/countries.py
countries.py
py
1,870
python
en
code
0
github-code
13
2167378760
from typing import Optional, Dict, List from genie_common.utils import safe_nested_get from genie_datastores.postgres.models import Artist from data_collectors.consts.google_consts import RESULTS, ADDRESS_COMPONENTS, TYPES, GEOMETRY, LOCATION, LATITUDE, \ LONGITUDE from data_collectors.contract import ISerializer...
nirgodin/radio-stations-data-collection
data_collectors/logic/serializers/google_geocoding_response_serializer.py
google_geocoding_response_serializer.py
py
3,616
python
en
code
0
github-code
13