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
25805315433
import socket # 运行在腾讯云 # 使用socket扫描端口,并获取占用,可能会被防火墙屏蔽 def connScan(tgtHost, tgtPort): try: connSkt = socket.socket(socket.AF_INET, socket.SOCK_STREAM) connSkt.connect((tgtHost, tgtPort)) connSkt.send('ViolentPython\r\n'.encode()) results = connSkt.recv(100) print('[+]%d/tc...
wujunwei/PythonTest
No.2/conn.py
conn.py
py
1,918
python
en
code
0
github-code
1
11237128073
""" Author: Venkata Yellapragada, vyellapr@purdue.edu Assignment: 01.2 - Interest Date: 01/26/2022 Description: Performs the amount of money after a certain time given principal, interest rate, number of years, and compounding frequency. Contributors: NA My contributor(s) helped me: [ ] understand th...
nyellapragada/Purdue_EBEC_101
interest_vyellapr.py
interest_vyellapr.py
py
1,818
python
en
code
0
github-code
1
73146219235
import warnings import matplotlib.pyplot as plt from utils.utils import * from utils.objective import * if __name__ == '__main__': warnings.simplefilter('ignore') asset_list = ['VTI', 'VEA', 'VWO', 'IAU', 'DBC', 'XLB', 'XLE', 'XLF', 'XLI', 'XLK', 'XLP', 'XLU', 'XLV', 'XLY'] price_df = get_price_df(...
hobinkwak/Stock2Vec-Inverse-Volatility
main.py
main.py
py
1,977
python
en
code
3
github-code
1
38662625123
""" A shop will give discount of 10% if the cost of purchased quantity is more than 1000. Ask user for quantity Suppose, one unit will cost 100. Judge and print total cost for user. """ quantity = int(input("Enter Quatity here :")) cost = quantity*100 if cost > 1000 : price_to_pay = cost - ((cost*10)/100) pr...
dharm-singh-au26/Dsa-in-python
shop_discount.py
shop_discount.py
py
430
python
en
code
0
github-code
1
25156253486
import re import os import copy from collections import defaultdict from collections import Counter dir_path = os.path.dirname(os.path.realpath(__file__)) file = open(dir_path + '/inputs/day_15.txt', 'r') lines = file.read().strip().split('\n') input = [16,1,0,18,12,14,19] keys = range(0, 30000000) spoken = {key: No...
jonfriskics/advent_of_code2020
day_15.py
day_15.py
py
1,195
python
en
code
0
github-code
1
5222667356
import sys from main_window import * from solver import * from file_saver import * from logger_impl import * VERSION = (0, 1, "alfa") class AppSupervisor(QObject): def __init__(self, main_window: QWidget, ui: Ui_MainWindow, solver: Solver, parent: QObject=None): super().__init__(parent) self....
davarabinovich/power_tree_solver
main.py
main.py
py
7,287
python
en
code
0
github-code
1
27933091980
from __future__ import absolute_import from __future__ import division from __future__ import print_function from sklearn.model_selection import train_test_split import numpy as np import tensorflow as tf import pickle import scipy.ndimage as img tf.logging.set_verbosity(tf.logging.INFO) def cnn_model_fn(f...
mrosen95/COMP551_A3
CNN1.py
CNN1.py
py
9,960
python
en
code
0
github-code
1
21979960588
from flask import Flask from flask import request from flask import jsonify from flask.json import dumps from flask.wrappers import Response from flask_pymongo import MongoClient from datetime import datetime import os #import sys #from pymongo import collection, mongo_client from flask_cors import CORS CON_STR=f"{os....
Al3xDiaz/api-rest
backend/main.py
main.py
py
2,390
python
en
code
0
github-code
1
24901354288
from hvac import Client client = Client( url='Your-Cluster-URL', namespace='admin', verify=False ) client.auth.approle.login( role_id='Your-Role-Id', secret_id='Your-Secret-Id' ) secret = client.read('Your-Secret-Path') print(secret)
AbdulManan10/hvac
main.py
main.py
py
260
python
en
code
0
github-code
1
8043127155
import socket import anvil.server import servicemanager import win32event import win32service import win32serviceutil from abc import ABCMeta, abstractmethod class AnvilWindowsService( win32serviceutil.ServiceFramework, metaclass=ABCMeta ): _svc_name_ = "AnvilWindowsService" _svc_display_name_ = "Anvil ...
meatballs/AnvilUplinkWindows
src/anvil_uplink_windows/service.py
service.py
py
1,525
python
en
code
10
github-code
1
26398245315
from test import * from file_reader import * from config import * from math_tools import * def width_search(start, end, allowed_cities=cities_names[:]): levels = [[start]] while not (end in levels[-1]): next_width_step(levels, allowed_cities) return get_result(lambda x, y: x + SEPARATOR + y, end, ...
buffer404/university
year3/Artificial intelligence systems/lab2/main.py
main.py
py
2,816
python
en
code
1
github-code
1
4185758536
from PIL import Image, ImageTk import tkinter from . import battleship from .battleshipconfig import * from .errortypes import BadLocationError, PlacementError from .gamecanvas import GameCanvas from .targetgridcanvas import TargetGridCanvas from .startmenucanvas import StartMenuCanvas from .imageloader import instanc...
jtaylorsoftware/pyships
pyships/oceangridcanvas.py
oceangridcanvas.py
py
22,728
python
en
code
0
github-code
1
43050332464
from services.helper import helper helper() from services.routing.routing import Routing from services.mapping.mapping import Mapping r = Routing() m = Mapping() result1 = r.create(1, "meisam", 27) result2 = m.test() final = {} final.update(result1) final.update(result2) print(final)
meisam2236/rabbit-handler
main.py
main.py
py
287
python
en
code
0
github-code
1
73111182754
# -*- coding: utf-8 -*- import scrapy import time import re import datetime from scrapy.http import Request from loguru import logger from SafetyInformation.items import SafeInfoItem from SafetyInformation.settings import SLEEP_TIME, TOTAL_PAGES class SecpulseSpider(scrapy.Spider): name = 'secpulse' allowed_...
Silentsoul04/SafetyInformation
SafetyInformation/spiders/secpulse.py
secpulse.py
py
2,422
python
en
code
0
github-code
1
24421756975
from django.urls import path from .views import* from .views import delete_user, accept_user,pause_client urlpatterns = [ path('controle/', controle, name="control"), path('log', login_admin, name="log"), path('index2', index2_admin, name="index2_admin"), path('pause', pause_client, name="pause_client"), ...
SeikaLamproug/Gestion-epargne
controle/urls.py
urls.py
py
1,683
python
en
code
0
github-code
1
38663862525
# ------------------------------------------------------- # Assignment 1 # Written by Raghav Sharda # For COMP 472 Section ABJX – Summer 2020 # -------------------------------------------------------- import numpy as np import shapefile as shp import matplotlib as mpl import matplotlib.pyplot as plt import time from i...
raghavsharda/Rover
index.py
index.py
py
5,764
python
en
code
0
github-code
1
34144549460
import numpy as np from typing import Union from sklearn.metrics import mutual_info_score def mutual_info( dataX: Union[str, bytes, list, tuple], dataY: Union[str, bytes, list, tuple], base=2, ): """ Return the mutual information of given dataX and dataY. Parameters ---------- dataX: ...
Jim137/Entropy
src/mutual_info.py
mutual_info.py
py
1,365
python
en
code
2
github-code
1
6685906309
from song import Song from date_parser import TimeParser from functools import reduce import random from prettytable import PrettyTable import json from collections import OrderedDict class Playlist: def __init__(self, name='', repeat=False, shuffle=False): self.name = name self.repeat = repeat ...
Nimor111/MusicPlayer
src/playlist.py
playlist.py
py
4,384
python
en
code
1
github-code
1
18158377114
''' Implemente un programa que lea 6 valores enteros de teclado y calcula la suma de ellos ''' def main(): suma = 0 n = int(input("Ingrese cantidad de valores a leer: ")) for i in range(n): valor = int(input("Ingrese valor: ")) suma = suma + valor print("La suma es: ", suma) if __name__...
restvo/ulima-intro210-clases
s031-repetitivas/ejemplo.py
ejemplo.py
py
346
python
es
code
0
github-code
1
11506375548
import tcod from random import randint from random_utils import random_choice_from_dict, from_dungeon_level from entity import Entity from map_objects.tile import Tile from map_objects.rect import Rect from components.ai import Brute from components.combatant import Combatant from components.item import Item from compo...
propfeds/project-regular
map_objects/game_map.py
game_map.py
py
7,788
python
en
code
1
github-code
1
27666434875
import numpy as np import os import cv2 from sklearn.feature_extraction import image import random import csv import shutil def colors_new_train_patches_to_npy_file(): path = '/Users/eloymarinciudad/Downloads/colors_new/train' label = {'black': 0, 'blue': 1, 'brown': 2, 'green': 3, 'grey': 4, 'orange': 5, '...
eloymc98/ClusterGAN
util.py
util.py
py
14,002
python
en
code
2
github-code
1
25314578639
import uuid from config import USR_ORG_MONGO_COLLECTION, USR_MONGO_COLLECTION import db from models.response import post_error import logging log = logging.getLogger('file') class OrgUtils: def __init__(self): pass #orgId generation @staticmethod def generate_org_id(): """UUID gener...
ishudahiya2001/ULCA-IN-ulca-Public
backend/api/ulca-ums-service/user-management/utilities/orgUtils.py
orgUtils.py
py
2,852
python
en
code
0
github-code
1
43130217397
def partitions(list, low, high): #将最左侧的值赋值给参考值k k = list[low] i = low j = high #当i下标,小于j下标的情况下,此时判断二者移动是否相交,若未相交,则一直循环 while i < j: #当i对应的值小于k参考值,就一直向右移动 while list[i] <= k: i += 1 # 当j对应的值大于k参考值,就一直向左移动 while list[j] > k: j = j - 1 ...
greatming/datastructure
quicksort.py
quicksort.py
py
1,010
python
en
code
0
github-code
1
32485295501
import sys from math import cos, sin, asin, radians def arc_hav(p1, p2, l1, l2): h = hav(p2 - p1) + cos(radians(p1)) * cos(radians(p2)) * hav(l2 - l1) return asin(h**.5) def hav(t1): return sin(radians(t1)/2)**2 r = 6371009 N = int(sys.stdin.readline().strip()) for _ in range(N): lat1, lon1, lat2,...
CrimsonTheLegoBuilder/MyBaekjoonSolve
Python_/bj4167.py
bj4167.py
py
549
python
en
code
0
github-code
1
2218690737
#Cristina Chu #cchu43@gatech.edu #"I worked on the homework assignment alone, using only this semester's course materials." #Part 1 from myro import * #init() from random import randrange def avgObstacleValues(aNum): right = [] center = [] left = [] count = 0 while timeRemaining(aNum): ...
cristina-chu/PythonRobot
fileSystem.py
fileSystem.py
py
2,182
python
en
code
0
github-code
1
8337571690
import time import os import hashlib from absl import app, flags, logging from absl.flags import FLAGS import tensorflow as tf import lxml.etree import tqdm flags.DEFINE_string('data_dir', './my_data/voc2020_raw/VOCdevkit/VOC2020/', 'path to raw PASCAL VOC dataset') flags.DEFINE_enum('...
christos-vasileiou/yolov3tiny-edgetpu
tools/fire_smoke_tfrecord.py
fire_smoke_tfrecord.py
py
5,359
python
en
code
0
github-code
1
74934231074
from tools import ToolsCmd import time from rich.console import Console import re console = Console() def init_mysql(port, db_v): console.print('\n7-开始初始化MySQL', style="bold yellow", highlight=True) if '5.6' in db_v: init_result = ToolsCmd('/dbs/mysqls/mysql{0}/service/scripts/mysql_install_db --def...
xxyhhd/my_scripts
agent/install_mysql/h_init_mysql.py
h_init_mysql.py
py
1,581
python
en
code
0
github-code
1
8828340848
#!/usr/bin/env python # coding: utf-8 # # Resumen de los datos: dimensiones y estructuras # In[1]: import pandas as pd # In[12]: get_ipython().run_line_magic('cd', "'/home/jovyan/python/dataset'") # In[14]: ls # In[15]: dir = '/home/jovyan/python/dataset/{}'.format('data3.csv') # In[16]: data = pd.r...
afnarqui/python
Dummies.py
Dummies.py
py
2,533
python
es
code
1
github-code
1
17398511199
from math import * from random import * import pygame pygame.init() win=pygame.display.set_mode((1800,900)) S1=pygame.Surface((200,100)) S2=pygame.image.load("MAP.xcf") run=True font=pygame.font.SysFont("papyrus",20) Sags=pygame.Surface((1,100)) Sags.set_colorkey((0,0,0)) Sags.set_alpha(100) Glassground=pyg...
makazis/Five-Nights-at-AVG
FNAG.py
FNAG.py
py
6,701
python
en
code
0
github-code
1
71660254754
#! /usr/bin/python3 import sys import serial, time import os, stat from os.path import exists from os import access, R_OK, W_OK import paho.mqtt.client as mqtt import configparser import argparse parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, des...
xn--nding-jua/pv_mqtt_controller
dpm86xx2mqtt.py
dpm86xx2mqtt.py
py
7,771
python
en
code
0
github-code
1
30129412325
from pymongo import MongoClient # mongodb instance where database is running connection_string = "mongodb://localhost:27017" client = MongoClient(connection_string) db = client.get_database("idk") # similar to mysql tables to store data collection = db.get_collection("information") # document to insert inside of m...
MasoudKarimi4/MenuMate
server/test.py
test.py
py
502
python
en
code
1
github-code
1
27592099596
import sys input = sys.stdin.readline n, m = map(int, input().split()) arr = [list(map(int, input().split())) for x in range(m)] def bead(arr): mid = (n + 1) // 2 anw = 0 # key : vertex # value : 0 - vertex보다 무거운 다른 vertex 리스트 # 1 - vertex보다 가벼운 다른 vertex 리스트 graph = {x: [[], []] for...
ChoHon/Algorithm
week 03/2617.py
2617.py
py
1,460
python
ko
code
0
github-code
1
15866997363
import base64 import os import json def encode64_file(file_path): with open(file_path, "rb") as content_file: content = content_file.read() # print(content) encoded = base64.b64encode(content) return encoded.decode() def read_allfile(file_path): with open(file_path, "r") as c...
quydx/acme-client-restapi
apiserver/djangorest/rest/filelib.py
filelib.py
py
645
python
en
code
0
github-code
1
11037745361
"""Script that starts a P300 Speller. Run with 'python p300_speller' to show config window. Default configuration loaded at startup is stored in /config_files/default.cfg. Creates an LSL stream of type 'P300_Marker' with one channel of 'int8' sending a marker every time an image flashes. The script consists of three ...
bstadlbauer/lsl-p300-speller
src/bstadlbauer/p300speller/p300_speller.py
p300_speller.py
py
21,451
python
en
code
0
github-code
1
7662295610
import pygame, functions, sys class Button(pygame.Rect): List = [] def __init__(self, action, x, y, width, height, text, textcolor=(0,0,0), color=(255,255,255)): self.text = text self.textcolor = textcolor self.x = x self.y = y self.width = width self.height = height self.action = action self.colo...
shhmon/PointBlocks
menuC.py
menuC.py
py
632
python
en
code
1
github-code
1
19157644863
import json from enum import Enum """ Innehåller funktioner för att serialisera paket. Alla paket skapas och skickas som ett JSON objekt. """ class Types(Enum): """ En lista med de olika packettyper, detta är en hårdkodad lista """ time = 0 play = 1 pause = 2 def serializeCreateRoom(_alias, ...
Simpag/PythonVideoPlayer
packet.py
packet.py
py
6,890
python
sv
code
0
github-code
1
30416561761
"""Identify RC4 compared to random and RC4A output with the ciphertext's second byte""" import secrets import RC4 # random zeroes = 0 for i in range(65536): secret = secrets.token_bytes(4) if int(secret[1]) == 0: zeroes += 1 print("Random") print(f"Expected: 256") print(f"Reality: {zeroes}") print(f"D...
slightlyskepticalpotat/rc4-variants
identify.py
identify.py
py
1,047
python
en
code
2
github-code
1
72495892835
import torch def drmsd(structure_1, structure_2, mask=None): def prep_d(structure): d = structure[..., :, None, :] - structure[..., None, :, :] d = d ** 2 d = torch.sqrt(torch.sum(d, dim=-1)) return d d1 = prep_d(structure_1) d2 = prep_d(structure_2) drmsd = d1 - d2 ...
aqlaboratory/openfold
openfold/utils/validation_metrics.py
validation_metrics.py
py
1,442
python
en
code
2,165
github-code
1
73751347235
# Recupera las ofertas de la página de Amazon. # Usamos herramientas de manipulación de strings para no entrar en selenium. # Al ser una web dinámica y descargarla sin que se ejecute JavaScrip, nos limita solo a # 8 ofertas, aunqe se puedan recuperar más Ids # # EJEMPLO DE USO # # app = Amazon() # data = app.get_data()...
alfonsoma75/web_scraping
amazon.py
amazon.py
py
6,764
python
es
code
1
github-code
1
10786577457
#!/usr/bin/env python # -*- coding: utf-8 -*- from projects.dianping.common.constants import EX_CITIES from projects.dianping.common.file_path import FilePath from projects.dianping.utils.clear_file_util import ClearFile from projects.dianping.utils.shoplist_datum_util import ShoplistDatum def get_avg_price_by_city()...
missweetcxx/fragments
projects/dianping/executor/ex_food_avg_price.py
ex_food_avg_price.py
py
1,079
python
en
code
0
github-code
1
72387697954
from collections import defaultdict import heapq def solution(gems: list[str]): answer = [] # 우선순위큐 : 데이터를 담을 temp array 생성 temp = [] collected_gem = [] collected_gem = defaultdict(int) # 최소 스타트 [0] => 보석이름,[1] => 보석 위치 min_start = '' for idx,gem in enumerate(gems): collec...
cafe-jun/codingTest-Algo
programmers/2020카카오인턴십/보석쇼핑.py
보석쇼핑.py
py
2,236
python
ko
code
0
github-code
1
75082514912
import os from collections import Counter from string import punctuation import glob import re class Transcript: """This class is a representation of a transcript following the norm from the CHILDES database. As long as the raw transcript file follows that norm, all kinds of informations and extractions f...
KasperFyhn/ChildLangAcqui
src/childes_transcripts.py
childes_transcripts.py
py
10,751
python
en
code
0
github-code
1
16778834904
datos = [ '37572991#Shauna Romanov#137345#Villa María', '43666785#Brenden Raynard#48176#Villa María', '33950484#Ronna Massingham#187725#Villa María', '31735292#Mirabella Fitzpayn#111838#Sampacho', '44444776#Amabelle Dominetti#39495#Villa María', '42872667#Grady Aronsohn#34119#La Carlota', '36482697#Kalinda Lampl...
pablokan/23prog1
parciales/B/Casanova_Examen_01.py
Casanova_Examen_01.py
py
2,046
python
es
code
0
github-code
1
7014879956
''' Created on 02/feb/2014 @author: Marco ''' import socket # Import socket module import threading import re import winsound threads = [] stopClient = False class receiveThread (threading.Thread): def __init__(self, threadID, name, conn): threading.Thread.__init__(self) self.thread...
skimdz86/Utilities
Python/ChatClient/client/ChatClient.py
ChatClient.py
py
3,575
python
en
code
0
github-code
1
7447934892
# -*- coding: utf-8 -*- from OFS.Image import Image from zope.interface import implements from zope.component import getUtility from zope.publisher.interfaces import IPublishTraverse, NotFound from zope.component import getUtilitiesFor from Products.Five import BrowserView from Products.Five.browser.pagetemplatefile im...
UPCnet/ulearn.theme
ulearn/theme/browser/user_profile.py
user_profile.py
py
4,468
python
en
code
0
github-code
1
5409197519
from copy import deepcopy from flask_camp.models import DocumentVersion, User from flask_camp import current_api from sqlalchemy.orm.attributes import flag_modified from c2corg_api.models import ARTICLE_TYPE, XREPORT_TYPE class DocumentRest: # on v6, a document can be created and exists without a version. ...
c2corg/c2c_api-poc
c2corg_api/legacy/views/document.py
document.py
py
1,673
python
en
code
0
github-code
1
10053148775
from typing import Any, Dict, Optional, Tuple import xml.etree.ElementTree as ET import chc.util.IndexedTable as IT def has_control_characters(s: str) -> bool: for c in s: if ord(c) < 32 or ord(c) > 126: return True else: return False def byte_to_string(b: int) -> str: retu...
static-analysis-engineering/CodeHawk-C
chc/util/StringIndexedTable.py
StringIndexedTable.py
py
4,513
python
en
code
20
github-code
1
35574494185
from convert_descriptor_to_swagger.mn_tasks import ( add_mn_schemas, add_mn_responses, add_mn_request_bodies, add_mn_paths, ) from convert_descriptor_to_swagger.reference.full_output import ( component_schemas_mn, component_responses_mn, component_request_bodies_mn, paths_people_team_mn,...
brighthive/convert_descriptor_to_swagger
tests/test_mn_tasks.py
test_mn_tasks.py
py
762
python
en
code
0
github-code
1
19596765848
""" Making a trie of the dictionary of words Example : >>> python3 #11.py apple mango man beer ma ma ['man', 'mango'] """ class Trie: """Class to make a new trie Example : >>> obj = Trie() >>> obj.root {'#':False} """ def __init__(self): """ Initialise function to make a new trie node ...
SaxenaKartik/Competitive-Coding
dailycodingproblem/#11.py
#11.py
py
2,299
python
en
code
1
github-code
1
7492597053
import re import os def check(hostsfile, hostname): with open(hostsfile) as fp: line = fp.readline() while line: if re.match(r'^127.0.0.1([\s\t]+)'+hostname+'$', line, re.M | re.I): return line line = fp.readline() return False def delete(hostsfile, hos...
srustamov/virtual-host-creator
modules/host.py
host.py
py
666
python
en
code
0
github-code
1
73501757154
""" Author: Brian Mascitello Date: 12/16/2017 Websites: http://adventofcode.com/2017/day/14 Info: --- Day 14: Disk Defragmentation --- --- Part Two --- """ import copy from functools import reduce def construct_dense_hash(sparse_hash): constructed_hash = list() groups_of_sixteen...
Brian-Mascitello/Advent-of-Code
Advent of Code 2017/Day 14 2017/Day14Q2 2017.py
Day14Q2 2017.py
py
4,323
python
en
code
0
github-code
1
32196464996
""" Scraper for fire alerts in Los Angeles http://groups.google.com/group/LAFD_ALERT/ RSS: http://groups.google.com/group/LAFD_ALERT/feed/rss_v2_0_msgs.xml?num=50 """ from ebdata.retrieval.scrapers.base import ScraperBroken from ebdata.retrieval.scrapers.list_detail import RssListDetailScraper, SkipRecord from ebdata...
brosner/everyblock_code
everyblock/everyblock/cities/la/fire_alerts/retrieval.py
retrieval.py
py
4,793
python
en
code
130
github-code
1
33653947346
# encoding: utf-8 import argparse import os import sys import torch from torch.backends import cudnn sys.path.append('.') from config import cfg from data import make_data_loader from engine.trainer import do_train, do_train_with_center from modeling import build_model from layers import make_loss, make_loss_with_ce...
CASIA-IVA-Lab/ISP-reID
tools/train.py
train.py
py
3,739
python
en
code
90
github-code
1
40471160368
import cv2 from cv2 import HOUGH_GRADIENT import numpy as np from matplotlib import pyplot as plt sct_img = cv2.imread('coins.png') def nothing(x): pass H = 103 S = 255 V = 255 Hl = 0 Sl = 191 Vl = 119 while True: hsv = cv2.cvtColor(sct_img, cv2.COLOR_RGB2HSV) cv2.imshow('image',hsv) lower_bl...
GitRekton/EETAC-Applied-Image-Processing
otherMethod.py
otherMethod.py
py
1,289
python
en
code
0
github-code
1
3497911991
#Fonksiyon okur yazarlığı # ============================================================================= # bir fonksiyon tanımlamak için "def" kullanılır # ============================================================================= def kare_al(x) : print(x**2) kare_al(5) #Bilgi notu ile çıktı almak...
BoraBakcilar/BoraBakcilar
Fonksiyonlar .py
Fonksiyonlar .py
py
2,973
python
tr
code
0
github-code
1
44508944524
#Условие задачи - автоматизирйте расчёт квадрата Пифагора по дате рождения. #Алгоритм расчёта квадрата Пифагора на конкретном примере (если дата рождения - 16 октября 1991 года), выглядит следующим образом: #1.Выпишите цифры дня и месяца рождения: 1610. Сложите цифры, получится первое число: 1+6+1+0 = 8. #2.Точно такж...
ChristinaPokareva/Mini-project_2
Main.py
Main.py
py
3,532
python
ru
code
0
github-code
1
30130945625
from ExtendDT import ext_dt from Sequence import * #> Find the optimal sequence for a single node when its children are optimized def PruneOptimalSingle(xdt, main_seq, root_id): current_seq = copy.copy(main_seq[root_id]) #* if optimized is not available, make it if not current_seq.optimized: #* Be...
masoudinejad/dt_pruning
orapMethod.py
orapMethod.py
py
5,353
python
en
code
0
github-code
1
27474072980
#!/usr/bin/env python3 import pprint, argparse, pickle, json import maze def fail(message): return { 'score' : 0, 'output' : message, 'visibility': 'visible', } if __name__ == "__main__": parser = argparse.ArgumentParser( description = 'CS440 MP1 Autograder',...
xxxfzxxx/AI-MPs
maze search/grade.py
grade.py
py
6,537
python
en
code
1
github-code
1
43110373172
""" Contains functions for common support adjustments. Created on Thu May 11 16:30:11 2023 @author: MLechner # -*- coding: utf-8 -*- """ from copy import deepcopy import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection im...
MCFpy/mcf
mcf/mcf_common_support_functions.py
mcf_common_support_functions.py
py
21,725
python
en
code
12
github-code
1
42165658616
#!/usr/bin/python3 # # Script for dumping/programming SPI flash chips with Hydrabus. # Based on HydraBus BBIO documentation: https://github.com/hydrabus/hydrafw/wiki/HydraFW-Binary-SPI-mode-guide # # Author: MrKalach [https://github.com/MrKalach] # License: GPLv3 (https://choosealicense.com/licenses/gpl-3.0/) # import...
hydrabus/hydrafw
contrib/SPI_flasher/HydraSPI.py
HydraSPI.py
py
12,969
python
en
code
305
github-code
1
9536429374
import subprocess from itertools import product, combinations import numpy as np def runner(): SEQ = 'MQYKLILNGKTLKGETTTEAVDAATAEKVFKQYANDNGVDGEWTYDDATKTFTVTE' AA = ['A', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'Y'] AA_dict = dict((k,v) for v,k ...
leerang77/UniRep_Epistasis_Prediction
Utils/run_main.py
run_main.py
py
3,208
python
en
code
0
github-code
1
10107712739
# 一些常量 target = 'nt' # 取3000个nt词和7000个非nt值 Length_nt = 3000 Length_other = 7000 Length = Length_nt + Length_other # 文件位置 train_set = 'Train.txt' train_out = 'train_pair.txt' test_set = 'Test.txt' test_out = 'test_pair.txt' Validation_set = 'Validation.txt' Validation_out = 'validation_pair.txt' # 学习率和迭代次数 alpha = ...
HavEWinTao/BIT-CS
知识工程/1/Const.py
Const.py
py
385
python
en
code
1
github-code
1
19612913911
import os from os import listdir from zipfile import ZipFile import img2pdf #Get Current Working Directory zipfolder = os.getcwd() # read all zip files in folder for zip_files in os.listdir(zipfolder):# 這三行可以用來避免'.DS_Store' problem in Mac if not zip_files.endswith(".zip"): if not zip_files.endswith(".rar"...
jeddstudio/Qunzip
Qunzip.py
Qunzip.py
py
1,877
python
en
code
0
github-code
1
19774523735
''' LeetCode #701 - Insert Into a Binary Search Tree prompt: You are given the root node of a binary search tree (BST) and a value to insert into the tree. Return the root node of the BST after the insertion. It is guaranteed that the new value does not exist in the original BST. Notice that there may exist multip...
Reddimus/LeetCode_Notes
Trees/LeetCode #701 - Insert into a Binary Search Tree.py
LeetCode #701 - Insert into a Binary Search Tree.py
py
3,225
python
en
code
0
github-code
1
5037552319
import xml.etree.ElementTree as ET import subprocess import asyncio import sys class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' async def execu...
delyura/FindSameCert
FindSameCert.py
FindSameCert.py
py
2,909
python
en
code
0
github-code
1
19686256761
######################################## #Author: Gentry Atkinson #Date: 05 Feb 2020 #Organization: Texas State University #Description: randomly alter several labels in the MNIST CSVs ######################################## PLAIN_TRAIN_LABELS = "MNIST/Extracted Data/train_labels.csv" PLAIN_TEST_LABELS = "MNIST/Extr...
gentry-atkinson/mislabeled_data
mislable_data.py
mislable_data.py
py
1,797
python
en
code
0
github-code
1
4407500695
import scrapy import re from competition.items import CompetitionItem class CiasiSpider(scrapy.Spider): name = 'ciasi' allowed_domains = ['ciasi.org.cn'] # start_urls = ['http://www.ciasi.org.cn/Home/safety/index?sid=15&bid=&cid=&sss=1&year=51,50'] start_urls = ['http://www.ciasi.org.cn/Home/safety/ind...
caojikeai/spider
competition/competition/spiders/ciasi.py
ciasi.py
py
6,386
python
en
code
0
github-code
1
33489243945
from dotenv import load_dotenv from logging import error import telegram import requests import os import logging from telegram.ext import CommandHandler, Updater, Filters, MessageHandler from telegram.message import Message from pprint import pprint load_dotenv() logging.basicConfig( level=logging.INFO, form...
Mikhail-Kushnerev/kittybot
kittybot.py
kittybot.py
py
2,076
python
en
code
0
github-code
1
31660008971
import socket import os import multiprocessing def send_message(s_socket, client_address): message = 'Hi ' + client_address[0] + ':' + str(client_address[1]) + '. This is server ' + str( os.getpid()) s_socket.sendto(str.encode(message), client_address) print('Sent to client: ', message) ...
digitalhhz/DSTutorial_Programmierprojekt
simplepoolserver.py
simplepoolserver.py
py
1,094
python
en
code
3
github-code
1
23845569811
condicion = input('True or False: ') if condicion == 'True': condicion = True print ('La condicion es Verdadera') elif condicion == 'False': condicion = False print ('La condicion es Falsa') else: print ('Parámetro no válido') condicion = input('Ingresa un parámetro válido (True/False): ') pri...
RMG-hub2209/cursos
elseif.py
elseif.py
py
348
python
es
code
0
github-code
1
38752247683
""" CP1404/CP5632 Practical """ import shutil import os def main(): """Demo os module functions.""" print("Starting directory is: {}".format(os.getcwd())) # Change to desired directory os.chdir('FilesToSort') # Print a list of all files in current directory print("Files in {}:\n{}\n".format(...
PhyuCin/CP1404PRAC
Prac_09/os_for_filestosort.py
os_for_filestosort.py
py
860
python
en
code
0
github-code
1
2209668303
from rest_framework import serializers from . import twitterhelper from .register import register_social_user import os from rest_framework.exceptions import AuthenticationFailed class TwitterAuthSerializer(serializers.Serializer): """Handles serialization of twitter related data""" access_token_key = seriali...
charlesDavid009/tweety
python_tips/social_auth/serializers.py
serializers.py
py
1,295
python
en
code
2
github-code
1
40138305248
#!/usr/bin/env python3 # Created by Marwan Mashaly # Created on October 2019 # This program tells user the month afte typing the number def mailing(name, last_name, st_address, city, province, postal_code, apt_number=None): # This function organizes the mailing address to standardized name_addre...
Marwan-Mashaly/ICS3U-Unit5-05-python
mail.py
mail.py
py
1,602
python
en
code
0
github-code
1
37080385953
from flask import request from flask.json import jsonify from . import habits from .models import Habit from .dbmodel import Habitdb import json from bson import json_util from flask_jwt_extended import get_jwt_identity,jwt_required @habits.route('/',methods=['POST']) @jwt_required() def create(): current_user = ...
isaac152/APIHabitsTracker
app/habits/views.py
views.py
py
1,684
python
en
code
0
github-code
1
36292377175
from PIL import Image im1 = Image.open("lena.png") im2 = Image.open("lena_modified.png") #im.show() width, height = im1.size print(width) print(height) for y in range(height): for x in range(width): rgba1 = im1.getpixel( (x, y) ) rgba2 = im2.getpixel( (x, y) ) #print(rgba) if rgb...
Zrump159/ML2017
hw0/HW0_Q2.py
HW0_Q2.py
py
593
python
en
code
0
github-code
1
20741888168
from typing import Annotated, List, Optional from mypy_extensions import TypedDict RaiderDictionary = TypedDict("RaiderDictionary", {"address": str, "ranking": int}) RaiderWithAgentDictionary = TypedDict( "RaiderWithAgentDictionary", {"address": str, "ranking": int, "agent_address": str} ) CurrencyDictionary = Ty...
planetarium/world-boss-service
world_boss/app/stubs.py
stubs.py
py
1,112
python
en
code
2
github-code
1
1620437423
import spacy import re import pickle from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer from sklearn.linear_model import LogisticRegression from sklearn.naive_bayes import MultinomialNB from sklearn.neural_network import MLPClassifier from sklearn.linear_model import SGDClassifier from sklearn...
EdiZ935/Clasificaci-n-de-20-noticias
clasification.py
clasification.py
py
7,032
python
en
code
0
github-code
1
38940687657
import stripe from stripe.error import AuthenticationError, InvalidRequestError from django.conf import settings # from .models import StripeConfig, SillyStripeConfig # color parameters: style;background (30 is none);foreground color = { "end": "\x1b[0m", "info": "\x1b[0;30;36m", "success": "\x1b[0;30;3...
byoso/django-silly-stripe
django_silly_stripe/conf.py
conf.py
py
1,495
python
en
code
0
github-code
1
32361975236
# Project I. Drawing turtle # Problem 3. Draw a 5 x 8 dot grid with a nested loop. import turtle # create a turtle bob = turtle.Turtle() # define the shape of the grid dot_distance = 20 width = 5 height = 8 # pen up so we don't draw when moving between dots bob.penup() for row in range(8): row_width = 0 f...
0liu/teaching
python/proj1sol.py
proj1sol.py
py
647
python
en
code
0
github-code
1
42426994810
""" ░░░░░░░░░░░██╗░░░░░░░██╗██╗░░░██╗██████╗░██████╗░███████╗░░░░░░██████╗░░█████╗░██████╗░██████╗░░░░░░░░░░░░ ░░░░░░░░░░░██║░░██╗░░██║██║░░░██║██╔══██╗██╔══██╗╚════██║░░░░░░██╔══██╗██╔══██╗██╔══██╗██╔══██╗░░░░░░░░░░░ ░░░░░░░░░░░╚██╗████╗██╔╝██║░░░██║██║░░██║██║░░██║░░███╔═╝█████╗██║░░██║███████║██████╔╝██████╔╝░░░░░░░...
wuddz-devs/wuddz-dapp
wuddz_dapp/dapp.py
dapp.py
py
42,733
python
en
code
0
github-code
1
170180414
# -*- coding: utf-8 -*- ''' /************************************************************************************************************************** SemiAutomaticClassificationPlugin The Semi-Automatic Classification Plugin for QGIS allows for the supervised classification of remote sensing images, provid...
jem0101/BigSwag-SQA2022-AUBURN
TestOrchestrator4ML-main/resources/Data/supervised/GITHUB_REPOS/semiautomaticgit@SemiAutomaticClassificationPlugin/maininterface/reclassificationTab.py
reclassificationTab.py
py
11,351
python
en
code
2
github-code
1
43421033376
#!/usr/bin/env python2 ''' Cron's runner with integrated Sentry monitor ''' __version__ = '0.2.2' import os import sys import contextlib import raven client = raven.Client( dsn=(os.getenv('SENTRY_DSN') or None), transport=raven.transport.http.HTTPTransport) @contextlib.contextmanager def args(): sys.ar...
RebelMouseTeam/cronwatch
cronwatch.py
cronwatch.py
py
611
python
en
code
0
github-code
1
38782305735
import logging from datetime import datetime, timedelta import random import pytest import pytz from show_my_solutions.dbmanager import Submission OJS = ['POJ', 'LeetCode', 'Codeforces', 'TopCoder', 'HackerRank', 'ACM'] MAX_ROW = 100 LOGGER = logging.getLogger(__name__) def setup_module(module): from show_my_s...
yehzhang/Show-My-Solutions
tests.py
tests.py
py
3,816
python
en
code
0
github-code
1
25888909951
from django import forms from django.shortcuts import render, redirect from .forms import DetailForm from datetime import datetime import string import csv # Create your views here. def index(request): print("HELLO") if request.method == 'POST': form = DetailForm(request.POST) if form.is_valid...
rupenchitroda/hackathon
DocOnGo/views.py
views.py
py
3,266
python
en
code
2
github-code
1
19323421402
number_dict = { "zero": "0", "one": "1", "two": "2", "three": "3", "four": "4", "five": "5", "six": "6", "seven": "7", "eight": "8", "nine": "9" } def isIntStr(s): try: int(s) return True except ValueError: return False def isNumberStr(s): ...
hanameee/Algorithm
Programmers/2021_카카오_인턴십/src/숫자_문자열과_영단어.py
숫자_문자열과_영단어.py
py
712
python
en
code
2
github-code
1
25160213168
## objectives ## # objective - build dashboard using 'OldFaithful.csv' # display as a scatterplot # D = data of recordings in month (August) # X duration of current eruptions in minutes # Y waiting time until the next eruption import dash import dash_html_components as html import dash_core_components as dc...
eugeniosp3/udemy_plotly_course
simple_dash exercise.py
simple_dash exercise.py
py
1,476
python
en
code
0
github-code
1
31900400729
# -*- coding: utf-8 -*- """ @File : findTargetSumWays.py @Author : wenhao @Time : 2023/2/20 15:55 @LC : 494 """ from typing import List from functools import cache class Solution: # dp 递推写法 优化:使用 1 个数组 # 为了避免覆盖掉前面的数据,要从右向左更新数组 def findTargetSumWays3(self, nums: List[int], target: int) -> int:...
callmewenhao/leetcode
基础算法精讲/动态规划/01背包 完全背包 多重背包/findTargetSumWays.py
findTargetSumWays.py
py
3,772
python
zh
code
0
github-code
1
8999728817
from sklearn.base import BaseEstimator, TransformerMixin import pandas as pd from data_processing.helpers.check_if_nans_exist import check_if_nans_exist from data_processing.helpers.columns_that_contain_lists import columns_that_contain_lists class RemoveNan(BaseEstimator, TransformerMixin): def __init__(self, k...
arctic-source/game_recommendation
data_processing/transformers/RemoveNan.py
RemoveNan.py
py
1,550
python
en
code
0
github-code
1
34468081224
import pyarrow.compute as pc import pyarrow as pa import numpy as np from typing import Iterator, Tuple, List from ..model.types import ( SubjectSymbol, SourceSymbol, ExchangeSymbol, InstrumentSymbol, MarketSymbol, Timestamp, FileId, ) DAY_NANOSECONDS = 24 * 60 * 60 * 10 ** 9 PARTITION_COLU...
walling/trading
lib/datatool/write/partitioning.py
partitioning.py
py
2,619
python
en
code
1
github-code
1
20667423581
# 프로그래머스 lv1 # 구현 numbers=[2,1,3,4,1] def solution(numbers): answer = set() n=len(numbers) for i in range(n): for j in range(i+1,n): answer.add(numbers[i]+numbers[j]) answer=list(answer) answer.sort() return answer solution(numbers)
jeongkwangkyun/algorithm
Programmers/두개 뽑아서 더하기.py
두개 뽑아서 더하기.py
py
295
python
en
code
0
github-code
1
16711232336
from helium import * from bs4 import BeautifulSoup import pandas as pd from sqlalchemy import create_engine import time links = [] data = [] start = time.time() def lin(): url = 'https://www.amarstock.com/latest-share-price' browser = start_firefox(url, headless=True) s = BeautifulSoup(brow...
Nadimul2/Stock-prices
stock.py
stock.py
py
3,099
python
en
code
0
github-code
1
3215553627
from django.db import models from django.contrib.auth import get_user_model from django.utils import timezone from datetime import datetime from django.utils.translation import gettext_lazy as _ from service.models import Skill User = get_user_model() class Expert(models.Model): user = models.OneToOneField(User,...
amoo-sajad/arp-project
expert/models.py
models.py
py
2,825
python
en
code
0
github-code
1
1704389554
from LoadData import * import statsmodels.api as sm import pandas as pd import numpy as np from diagnosticTests import * data = loadAll() #just returns the database data['GDP_lag1'] = data['GDP_perCap'].shift(1) #lag column for GDP variable data['CO2_lag1'] = data['Annual_CO2_emissions_TperCap'].shift(1) #lag column ...
SalFin99/CO2_GPD
OLSmodels/LinearOLS_fixed.py
LinearOLS_fixed.py
py
964
python
en
code
0
github-code
1
5169905792
from PIL import Image from django.shortcuts import render import os def papaya_find_ripe_raw(): path = 'webs/color/papaya/' directory= os.listdir(path) if len(directory) == 2: img = Image.open('webs/color/papaya/raw_papaya.png') black = 0 papaya_raw = 0 for pixel in...
LoneWolf1999-Th/Fruit_Detect
webs/controller/papaya_ripe_or_raw.py
papaya_ripe_or_raw.py
py
1,228
python
en
code
0
github-code
1
21245458777
from models import * from dataset import * import argparse import os import glob import tqdm from torchvision.utils import make_grid from PIL import Image, ImageDraw import skvideo.io import ssl import cv2 import json import matplotlib.pyplot as plt import numpy as np import av def extract_frames(video_path): fra...
LeoYin/Course-Project-Action-Recognition
test_on_video.py
test_on_video.py
py
6,161
python
en
code
0
github-code
1
36974547726
"""add auto-votes Revision ID: 4c8b06ae0ef5 Revises: c3d959bce883 Create Date: 2023-05-20 18:22:06.916821 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '4c8b06ae0ef5' down_revision = 'c3d959bce883' branch_labels = Non...
jperrino/example_fastapi
alembic/versions/4c8b06ae0ef5_add_auto_votes.py
4c8b06ae0ef5_add_auto_votes.py
py
2,697
python
en
code
0
github-code
1
20011805852
ip = '192.168.100.118' port = 2295 updPort = 2296 usrIdSpl = ';' endMsgSpl = ' END&MSG ' endFrSpl = ' FRAG&END ' metaDataSpl = ' META&DATA ' #Database information dbName = 'chatdb' dbUser = 'admin' dbPw = 'hect0r1337' dbIp = 'localhost' msgTable = 'messages'
PunchyArchy/chatServer
wchat_config.py
wchat_config.py
py
301
python
en
code
0
github-code
1
3649536709
#!/bin/python """Stastics of GC information, GCskew / GCratio / Nratio""" __date__ = "2023-4-11" __author__ = "Junbo Yang" __email__ = "yang_junbo_hi@126.com" __license__ = "MIT" """ The MIT License (MIT) Copyright (c) 2022 Junbo Yang <yang_junbo_hi@126.com> <1806389316@pku.edu.cn> Permission is here...
joybio/custom_scripts
GC_information_for_circos/GC_infor_for_circos.py
GC_infor_for_circos.py
py
5,210
python
en
code
1
github-code
1
5542013576
from django.shortcuts import redirect, render from core.models import Jornada from django.views.generic import ListView, CreateView, UpdateView, DeleteView from django.core.serializers import serialize from django.utils.decorators import method_decorator from django.contrib.auth.decorators import login_required from dj...
AdolfoCunquero/Colegio
core/views/jornada/views.py
views.py
py
3,662
python
en
code
0
github-code
1
33177367940
import rospy import smach from suturo_planning_plans import utils class ScanShadow(smach.State): # _ctr = 0 def __init__(self): smach.State.__init__(self, outcomes=['success', 'fail'], input_keys=['yaml'], output_keys=[]) def execute(sel...
SUTURO/euroc_planning
suturo_planning_plans/src/suturo_planning_plans/statescanshadow.py
statescanshadow.py
py
1,189
python
en
code
0
github-code
1