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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
38004828445 | import pandas as pd
import numpy as np
import geopandas as gpd
import sys
import time
import requests
import category_encoders as ce
from urllib.parse import quote_plus
import folium
from shapely.geometry import box, mapping, polygon, multipolygon, Point
CLIENT_ID = '' # your Foursquare ID
CLIENT_SECRET = '' # your... | abcolb/Coursera_Capstone | foursquare.py | foursquare.py | py | 6,079 | python | en | code | 0 | github-code | 13 |
14727478338 | import requests
def get_luse(x_pos, y_pos):
# chatgpt_api_keys = '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'
url = f"https://lohas.taichung.gov.tw/arcgis/rest/services/Tiled3857/LandAdminNew3857/MapServer/2/query?f=json&geometry=%7B%22spatialReference%22%3A%7B%22wkid%22%3A4326%7D%2C%22x%22%3A{str(x... | DonLiao1207/LandCrawler | get_luse.py | get_luse.py | py | 1,996 | python | en | code | 0 | github-code | 13 |
14971006737 | '''
多层感知机
含dropout
训练过程中,使用Dropout,其实就是对部分权重和偏置在某次迭代训练过程中,不参与计算和更新而已,
并不是不再使用这些权重和偏置了(预测和预测时,会使用全部的神经元,包括使用训练时丢弃的神经元)
'''
import numpy as np
import torch
from softmax.softmax_regress import loadData, get_fashion_mnist_labels, show_fashion_mnist
# 输入层 输出层 隐含层两层节点个数
inputsn, outputsn, hiddensn1, hiddensn2 = 784, 10, 25... | Money8888/pytorch_learn | MLP/MLP.py | MLP.py | py | 5,133 | python | en | code | 1 | github-code | 13 |
2196777967 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
# url = "http://news.ifeng.com/a/20190104/60223969_0.shtml"
url = 'http://taiwan.huanqiu.com/article/2018-12/13943256.html'
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbo... | a289237642/companySpider | 1/hqw/hqw/test/3.py | 3.py | py | 625 | python | en | code | 0 | github-code | 13 |
1408134436 | import numpy as np
import neuralnetwork_ex9 as nn
# image = np.random.rand(32, 32)
# kernal = np.random.rand(5, 5)
# def subsample_layer(layer, pool_size, strides):
# layer_rows = ((layer.shape[0] - pool_size) / strides) + 1
# layer_cols = ((layer.shape[1] - pool_size) / strides) + 1
# feature_map = ... | colinsteidtmann/EngineeringApplication | ApproximatingSine/ApproxSine/testnn9.py | testnn9.py | py | 19,009 | python | en | code | 1 | github-code | 13 |
17746481672 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by lenovo on 2019/5/13
import time
import matplotlib
from traditional.SAX.sax_variant import notify_result,esax,original_sax,sax_sd,sax_td,tsax
from traditional.SAX.sax_knn import sax
import os
from collections import Counter
matplotlib.use('TkAgg')... | inkky/FinalCode | traditional/SAX/sax_main.py | sax_main.py | py | 2,825 | python | en | code | 0 | github-code | 13 |
71182814419 | import glob
import sys
import numpy as np
sys.path.append('..')
from multivar_lstm.models import baseline_model
from multivar_lstm.lstm_data_generator import get_lstm_sub_data
import time
def main():
dirpath = sys.argv[1]
modelpath = 'movie_w2v_mincount_model.model'
file_list = glob.glob(dirpath+'/*')
... | junwoopark92/2018-SK-TnB-CodeChallenge | multivar_lstm/04.train.py | 04.train.py | py | 1,616 | python | en | code | 1 | github-code | 13 |
42225949736 | ANSIBLE_METADATA = {'status': ['stableinterface'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: oneview_id_pools
short_description: Manage OneView Id Pools.
description:
- Provides an interface to manage Id pools. Can retrieve, upda... | HewlettPackard/oneview-ansible | library/oneview_id_pools_facts.py | oneview_id_pools_facts.py | py | 3,898 | python | en | code | 103 | github-code | 13 |
16128788303 | #!/usr/bin/python
"""
Purpose:
"""
import turtle
def drawLight(T, S, c):
T.speed(1000)
S.clear()
T.penup()
T.setpos(0, 0)
T.pensize(12)
if c == 1:
T.color("black", "orange")
else:
T.color("black", "gray")
T.pendown()
T.begin_fill()
T.circle(50)
T.end_fill()
... | udhayprakash/PythonMaterial | python3/10_Modules/15_turtle_module/traffic_light2.py | traffic_light2.py | py | 865 | python | en | code | 7 | github-code | 13 |
28989882654 | '''
https://practice.geeksforgeeks.org/problems/longest-even-length-substring/0/
'''
testCases = int(input())
for case in range(testCases):
digits = input()
size = len(digits)
sslen = size if size%2==0 else size-1
#print(sslen)
while sslen > 1:
i = 0
while i+sslen <= size:
... | riddheshSajwan/data_structures_algorithm | strings/longestEvenLengthSubstring.py | longestEvenLengthSubstring.py | py | 784 | python | en | code | 1 | github-code | 13 |
12584048870 | #! /usr/bin/env python
import tsys01
from time import sleep
from sensor_connect.msg import sensor
import rospy
sensor_data = tsys01.TSYS01()
if not sensor_data.init():
print("Error initializing sensor")
exit(1)
pub = rospy.Publisher('data12',sensor,queue_size=20)
rospy.init_node('sender',anonymous=True)... | pokasta/Thrustercontrol-via-python | ros.py | ros.py | py | 635 | python | en | code | 0 | github-code | 13 |
71067840978 | from win32com.client.gencache import EnsureDispatch, EnsureModule
from win32com.client import CastTo, constants
import os
import matplotlib.pyplot as plt
import numpy as np
# Notes
#
# The python project and script was tested with the following tools:
# Python 3.4.3 for Windows (32-bit) (https://www.pyt... | eseguraca6/slacecodes | SAMPLES ZEMAX/ZOSAPI Help-2/Python/e22_seq_spot_diagram.py | e22_seq_spot_diagram.py | py | 9,467 | python | en | code | 2 | github-code | 13 |
13520698806 | from __future__ import absolute_import
import re
from datetime import date
from mozregression.errors import UnavailableRelease
from mozregression.network import retry_get
def releases():
"""
Provide the list of releases with their associated dates.
The date is a string formated as "yyyy-mm-dd", and the... | mozilla/mozregression | mozregression/releases.py | releases.py | py | 4,023 | python | en | code | 165 | github-code | 13 |
34949074622 | import socket
import sys
import os
import select
address = ("3.134.100.18", 9999)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
os.system("clear")
usrname = input("CloudChat v0.0.1\n\nenter a username: ")
sock.connect(address)
connectMsg = usrname + " has connected.\n"
sock.send(connectMsg.encode('ascii')... | rcparent17/Cloud-Computing | chat/client.py | client.py | py | 721 | python | en | code | 0 | github-code | 13 |
8804434596 | """
숫자 맞추기 게임
1 부터 100까지의 임의의 수를 생성하고 내가 수를 입력하면 그 숫자가 up or down을 알려줘서 몇번만에 맞추는지 점수를 얻는 게임
"""
# 책 없이 도전
import random
def Rand_Game():
Try = 0
n = random.randint(0,100)
while True:
try:
m = int(input("100 이하의 숫자를 입력하세요: "))
except:
print("숫자가 아닙니다")
T... | Chung-SungWoong/Practice_Python | Project1_RanNum.py | Project1_RanNum.py | py | 1,414 | python | ko | code | 0 | github-code | 13 |
70370149138 | import json
import boto3
import os
from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities.data_classes import APIGatewayProxyEvent
from sklearn import linear_model
from sklearn.metrics import mean_squared_error, r2_score
import tempfile
import joblib
s3 = boto3.client('s3')
logger = Logger(serv... | aws-samples/aws-lambda-docker-serverless-inference | online-machine-learning-aws-lambda/app/lambda_training/app.py | app.py | py | 2,530 | python | en | code | 87 | github-code | 13 |
40144992634 | from copy import deepcopy
from multiprocessing import Pool
from autode.transition_states.base import get_displaced_atoms_along_mode
from autode.transition_states.base import TSbase
from autode.transition_states.templates import TStemplate
from autode.input_output import atoms_to_xyz_file
from autode.calculation import ... | Crossfoot/autodE | autode/transition_states/transition_state.py | transition_state.py | py | 13,375 | python | en | code | null | github-code | 13 |
7830888810 | from django.contrib.auth.models import User
from django.db import models
from cl.lib.model_helpers import make_path
from cl.lib.models import AbstractDateTimeModel, AbstractFile
from cl.lib.storage import IncrementingAWSMediaStorage, S3PrivateUUIDStorage
from cl.recap.constants import DATASET_SOURCES, NOO_CODES, NOS_C... | freelawproject/courtlistener | cl/recap/models.py | models.py | py | 30,102 | python | en | code | 435 | github-code | 13 |
19563003613 | # Laboratorium 1 Zadanie 1.1 Klient w Pythonie
# Autorzy: Mateusz Brzozowski, Bartłomiej Krawczyk, Jakub Marcowski, Aleksandra Sypuła
# Data ukończenia: 27.11.2022
import socket
import sys
from typing import List, Tuple
import random
import string
# Klient wysyła a serwer odbiera datagramy o stałym, niewielkim rozmia... | bartlomiejkrawczyk/PSI-22Z | lab_1/task_1/py/client.py | client.py | py | 3,174 | python | en | code | 1 | github-code | 13 |
33793345614 | import unittest
import pkg_resources
from os import chdir, path, getcwd, remove
from timus import OnlineJudje
class TestOnlineJudje(unittest.TestCase):
def setUp(self):
filename = pkg_resources.resource_filename('examples', 'example.py')
file_dir = path.dirname(path.abspath(filename))
sel... | Shedward/timus | tests/OnlineJudje_test.py | OnlineJudje_test.py | py | 1,534 | python | en | code | 1 | github-code | 13 |
34995694912 | import sys
from datetime import datetime, time, timedelta
import numpy as np, matplotlib.pyplot as plt
from matplotlib.patches import Patch
from matplotlib.cm import ScalarMappable
from timetable import (load_timetable, sum_timetable, datetime_range)
if __name__ == '__main__':
# Parse commandline arguments and ... | Ayan-Chowdhury/ComRade | venv/Lib/site-packages/timetable/plot/cumulative.py | cumulative.py | py | 1,973 | python | en | code | 1 | github-code | 13 |
3911849245 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import asyncio
import os
import re
import shutil
import sys
import Levenshtein
try:
import interval as itvl # https://pypi.python.org/pypi/pyinterval
except Exception as e:
print("pyinterval not installed. No coverage reports will be available", file=sys.stderr)
... | ikonovalova/Editor | df_visual_report/util.py | util.py | py | 4,500 | python | en | code | 0 | github-code | 13 |
31933581832 | from __future__ import annotations
from typing import Optional
from spotterbase.records.record import Record, RecordInfo, AttrInfo
from spotterbase.model_core.oa import OA_PRED
from spotterbase.rdf.literal import Uri
from spotterbase.rdf.vocab import XSD
from spotterbase.model_core.sb import SB, SB_PRED
class Simpl... | jfschaefer/spotterbase | spotterbase/model_core/tag_body.py | tag_body.py | py | 2,195 | python | en | code | 0 | github-code | 13 |
9088670940 | #https://www.acmicpc.net/problem/2503
#백준 2503번 숫자 야구 (순열)
#import sys
#input = sys.stdin.readline
from itertools import permutations
n = int(input())
nums = []
for _ in range(n):
a,b,c = input().split()
nums.append([list(map(int, a)),int(b),int(c)])
result = 0
base = [i for i in range(1,10)]
for num in permu... | MinsangKong/DailyProblem | 08-27/1-1.py | 1-1.py | py | 738 | python | en | code | 0 | github-code | 13 |
43167600289 | from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseRedirect
from .models import ScrumyUser, ScrumyGoals, GoalStatus
from .forms import addUserForm, addTaskForm, changeTaskStatusForm
from django.contrib.auth import authenticate, login
from django.contrib.auth.hashers imp... | olufekosamuel/scrumy | olufekoscrumy/views.py | views.py | py | 3,936 | python | en | code | 0 | github-code | 13 |
4007833831 | import os
import json
from flask import Flask
from flask import render_template
from flask import request
from flask import Flask, render_template, request, redirect, url_for, flash, make_response,session, current_app, jsonify
from flask_wtf import FlaskForm
from wtforms import Form, TextField, TextAreaField, validato... | u5ergen/test | main.py | main.py | py | 2,784 | python | en | code | 0 | github-code | 13 |
5886570181 | import sys
import random
random.seed()
T = 30
MINX = 1
MAXX = 512
MINY = 1
MAXY = 512
print(str(T))
for t in range(T):
n = random.randint(3, 512)
print( str(n) )
x, y = random.randint(MINX, MAXX), random.randint(MINY, MAXY)
print( str(x) + ' ' + str(y) )
for p in range(2, n):
x2, y2 = random.randint(MINX, M... | eric7237cire/CodeJam | uva/681 - geometry convex hull/gen_data.py | gen_data.py | py | 459 | python | en | code | 7 | github-code | 13 |
36581213382 | import os
borderstyle = "║"
def drawboxtext(dat):
height = len(dat)
y = 0
while y < height:
dat[y] = " "+dat[y]+" "
y += 1
width = len(max(dat, key=len))+1
counter = 0
x = 0
line = "╔"
while x < width-1:
line = line + "═"
x += 1
line = line + "╗"
... | hastagAB/Awesome-Python-Scripts | FramedText/FramedText.py | FramedText.py | py | 1,115 | python | en | code | 1,776 | github-code | 13 |
1398291815 | # Uses python3
import math
import sys
def binary_search(a, x, left=0, right=None):
if right is None:
right = len(a)-1
if left > right:
return -1
mid_key = math.floor(left + (right-left)/2)
if a[mid_key] == x:
return mid_key
elif a[mid_key] > x:
return binary_search... | AlexEngelhardt-old/courses | Data Structures and Algorithms/01 Algorithmic Toolbox/Week 4 - Divide-and-Conquer/assignment/1-binary_search/1-binary_search.py | 1-binary_search.py | py | 887 | python | en | code | 2 | github-code | 13 |
32490083752 | ## ----------------------------------------
## Mixed utilities
## ----------------------------------------
##
## ----------------------------------------
## Author: Dennis Bontempi, Michele Svanera
## Version: 2.0
## Email: dennis.bontempi@glasgow.ac.uk
## Status: ready to use
## Modified: 20 Feb 19
## ---------------... | denbonte/CER3BRUM | src/cer3brum_lib/utils.py | utils.py | py | 3,643 | python | en | code | 5 | github-code | 13 |
3133901334 | #!/usr/bin/env python
# coding: utf-8
# In[4]:
from qiskit import *
get_ipython().run_line_magic('matplotlib', 'inline')
from qiskit.tools.visualization import plot_histogram as hist
from qiskit.tools.monitor import job_monitor
import operator
IBMQ.load_account()
provider=IBMQ.get_provider('ibm-q')
def Xrot(ci... | Spirit-Guardian/Wandering-Salesman-Problem | Hack-Q-Thon Project Copy Clean.py | Hack-Q-Thon Project Copy Clean.py | py | 1,906 | python | en | code | 0 | github-code | 13 |
42570936762 | start = True
while start:
# reading the file
data = open("reservation_StudentID.txt", "r").read()
print(data)
#this input is to hold the display til the user is done checking reservation
done = input()
#this part is for testing
list = []
list = data.split("\n")
list.pop(-1)
... | kohisky/Prototype-Assignment | Display.py | Display.py | py | 370 | python | en | code | 0 | github-code | 13 |
21051004015 | from itertools import permutations
n = int(input())
nums = list(map(int, input().split()))
operators = []
a, b, c, d = map(int, input().split())
for i in range(a):
operators.append('+')
for i in range(b):
operators.append('-')
for i in range(c):
operators.append('x')
for i in range(d):
operators.appe... | jinho9610/py_algo | boj/14888.py | 14888.py | py | 790 | python | en | code | 0 | github-code | 13 |
71532342097 | from os import error
from Models import connection, record
from Schemas import schemas, record_schema
from flask import Flask, jsonify, request
#TODO calculate effective rate
app = Flask(__name__)
#setup and shortcut sqlalchemy models and db
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite+pysqlite:///interestapp.db'... | JuanpiCasti/InterestApp-API | interestapp_api/interestapp_api.py | interestapp_api.py | py | 4,990 | python | en | code | 0 | github-code | 13 |
2237563661 | import re
def Suffix(pattern, letter, word):
# letter: kaynaştırma harfi
# pattern: ekler
pattern = re.compile('('+pattern+')$', re.U)
if letter is None:
letterCheck = False
letterPattern = None
else:
letterCheck = True
letterPattern = re.compile('('+letter+')$'... | noeldar/cmpe-561-project-1 | stmr.py | stmr.py | py | 3,234 | python | en | code | 0 | github-code | 13 |
43982697181 | from blues.moves import MoveEngine, RandomLigandRotationMove, SideChainMove
from blues.settings import Settings
from blues.simulation import *
from blues.utils import get_data_filename
def ligrot_example(yaml_file):
# Parse a YAML configuration, return as Dict
cfg = Settings(yaml_file).asDict()
structure ... | MobleyLab/blues | blues/example.py | example.py | py | 2,468 | python | en | code | 31 | github-code | 13 |
36154347848 | #import sys
#print(sys.path)
#sys.path.append('/tmp/work/python-ftgl/build/lib.linux-armv7l-2.7')
#sys.path.append('/tmp/work/python-ftgl/build/lib.linux-armv7l-2.7/ftgl')
import ftgl
#from ftgl import ftgl
print(dir(ftgl))
#font = ftgl.FTGLPixmapFont("Arial.ttf")
font = ftgl.FTPixmapFont("/usr/share/fonts/truetype/vlg... | ytyaru/Build.python-ftgl.20200428161725 | src/main.py | main.py | py | 397 | python | fa | code | 1 | github-code | 13 |
7625929557 | import datetime
import subprocess
import time
from flask import jsonify
from flask.ext.login import current_user
import git_utils
import utils
from summer import db, app
from summer.models import Task, Record
def start_deploy(task_id):
if not task_id:
return jsonify(code=401, message='taskId必须填写')
... | youpengfei/summer | summer/deploy.py | deploy.py | py | 9,276 | python | en | code | 4 | github-code | 13 |
5211998964 |
delay = 2
flashes = 5
entity_id = data.get('entity_id')
hass.services.call('light', 'turn_on', { 'entity_id': entity_id })
time.sleep(delay/2)
now_state = hass.states.get(entity_id)
logger.info('current %s' % now_state)
state = now_state.state
logger.info('state %s' % state)
my_data = {}
for k,v in data.items():
... | jaredquinn/homeassistant-config | python_scripts/flash_light.py | flash_light.py | py | 1,538 | python | en | code | 22 | github-code | 13 |
29755836033 | import os
import argparse
import multiprocessing
import pandas as pd
import io
import progressbar
import time
flatten = lambda l: [item for sublist in l for item in sublist]
par = argparse.ArgumentParser()
par.add_argument("num",type=int)
par.add_argument("terrSize",type=int,nargs=2,metavar=("x","y"))
par.add_argument... | fedepaj/LoraWan-Multihop | run.py | run.py | py | 3,068 | python | en | code | 1 | github-code | 13 |
37203908034 | import warnings
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
import geomloss
from src.neighbour_op import pykeops_square_distance, cpu_square_distance
from emd import emdModule
from structural_losses import match_cost
# Chamfer Distance
def pykeops_chamfer(t1, t2):
# The fo... | nverchev/PCGen | src/loss_and_metrics.py | loss_and_metrics.py | py | 9,412 | python | en | code | 0 | github-code | 13 |
8424778749 | # -*- coding: utf-8 -*-
import pandas as pd
import os
import csv
from datetime import datetime
OpFolderPath = 'E:/Pycharm/data/option_data'
VolFolderPath = 'E:/Pycharm/data/option_vol'
AnalyzePath = 'E:/Pycharm/analyze'
FutureMap = pd.read_csv('E:/Pycharm/data/log/FutureMap.csv')
VolAnalyzePath = os.path.join(Analyz... | Lee052/huatai-intern | code/map_folder.py | map_folder.py | py | 4,825 | python | en | code | 0 | github-code | 13 |
70645888337 | import matplotlib.pyplot as plt
import numpy as np
def display_data():
data = []
file = open('data.txt', 'r')
for line in file.read().splitlines():
if line:
data.append(float(line))
file.close()
fig, ax = plt.subplots()
ax.plot(data, data, label='linear')
ax.plot(data, n... | jaikejennison/pi-miner-universal | Python/display.py | display.py | py | 568 | python | en | code | 0 | github-code | 13 |
31709308568 | from tkinter import *
class startscreen():
'''Deze class betreft het opstartscherm waarbij de speler de keuze krijgt of hij/zij de code wil bedenken
of raden'''
playerchoice = None
def createscreen(self, windowwidth, windowheight, windowtitle, title, bgcolor):
'''Maakt een scherm aan en geeft... | LukaHerrmann/ProjectC_Assignments | Mastermind/Graphical_Interface.py | Graphical_Interface.py | py | 10,294 | python | nl | code | 0 | github-code | 13 |
30842057947 | import copy
import os
import time
from ctypes import cdll
import numpy as np
import torch
from torch import device
from torch.utils.tensorboard import SummaryWriter
from option import args_parser
from utils import *
from models import MLP, CNNMnist, CNNFashion_Mnist, CNNCifar, MLPPurchase100, ResNetCifar
from proto_cli... | MJXXGPF/SecureAggregation_GPF | client/fl_main.py | fl_main.py | py | 5,876 | python | en | code | 0 | github-code | 13 |
3125433131 | from config import Config
from ibm_watson import AssistantV1
from ibm_watson import TextToSpeechV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_watson import IAMTokenManager
from ibm_cloud_sdk_core.authenticators import BearerTokenAuthenticator
class WatsonObjects:
def __init__(self, c... | IBM/watson-tts-python | watson_objects.py | watson_objects.py | py | 1,935 | python | en | code | 19 | github-code | 13 |
26692854081 | import json
import jwt
import os
import motorengine
import tornado.ioloop
import tornado.web
from models import Portfolio
class MainHandler(tornado.web.RequestHandler):
def get_user(self):
header = self.request.headers.get('Authorization')
try:
token = header.split()[1]
r... | icpetcu/StockTrainer | portfolio/service/main.py | main.py | py | 2,268 | python | en | code | 1 | github-code | 13 |
74220695059 | #! /usr/bin/env python3
# coding: UTF-8
import random
import mysql.connector
from database import MyDatabase
"""
Make requests in the database.
"""
class Category(MyDatabase):
""" This class performs operations in the table : Category """
def insert_category(self, category):
""" Insert a categ... | jeremy10000/API-OFF | tables.py | tables.py | py | 7,079 | python | en | code | 0 | github-code | 13 |
36529169764 | from . import endpoints
from ...api import _request_executor
def shard_data (service_platform,
api_key):
""" Get League of Legends status for the given shard.
References:
https://developer.riotgames.com/regional-endpoints.html
https://developer.riotgames.com/api-methods/#lol-s... | Alex-Weatherhead/riot_api | riot_api/api/get/lol_status_v3.py | lol_status_v3.py | py | 917 | python | en | code | 0 | github-code | 13 |
3348452953 | """
User Interface module
This module exposes a number of tools and class definitions for
interacting with IDA's user interface. This includes things such
as getting the current state of user input, information about
windows that are in use as well as utilities for simplifying the
customization of the interface.
Ther... | arizvisa/ida-minsc | misc/ui.py | ui.py | py | 78,036 | python | en | code | 302 | github-code | 13 |
2604119197 | from flask import Flask, render_template, request
app = Flask(__name__)
CLASS = [
"24/01",
"24/02",
"24/03",
"24/04",
"24/05",
"24/06",
"24/07",
"24/08",
"24/09",
"24/10",
"24/11",
"24/12",
"24/13",
"24/14",
"24/15",
"24/16",
"24/17",
"24/18",
"24/19",
"24/20",
"24/21",
"24... | fishdrowned174/Savingtheworld1 | main.py | main.py | py | 3,044 | python | en | code | 0 | github-code | 13 |
30049029892 | import math
import sys
import random
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as plt
import concurrent.futures
from id3alg import *
# Function takes votes from previous iterations of the bagging algorithm and adds on votes from the current tree
# the error is calcul... | danielwaldram/ml_6350 | EnsembleLearning/cs6350_hw2_p2d.py | cs6350_hw2_p2d.py | py | 6,174 | python | en | code | 0 | github-code | 13 |
12311186037 | from cProfile import label
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn import datasets
from matplotlib import pyplot as plt
X, Y = datasets.make_regression(n_samples=100, n_features=1, noise=20, random_state=4)
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size... | Malab12/MLMFS | Linear_Regression/linear_regression_tests.py | linear_regression_tests.py | py | 1,328 | python | en | code | 0 | github-code | 13 |
71401900819 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import numpy as np
import argparse
import logging
import sklearn.decomposition
import matplotlib.pyplot as plt
logging.basicConfig(level=logging.INFO)
np.set_printoptions(precision=3)
def _parse_args():
"""parse command line arguments
Args:
:none
... | jplotkin21/examples | example_pca.py | example_pca.py | py | 4,317 | python | en | code | 0 | github-code | 13 |
30285887085 | from testclasses.classleaf import ClassLeaf
class ClassLoopOneMethodCall:
def doB(self, p1):
'''
This class is used to test the handling of the :seqdiag loop and
:seqdiag loop end tags with a loop inside which only one method
is called.
:param p1:
:return:
''... | Archanciel/seqdiagbuilder | testclasses/classlooponemethodcall.py | classlooponemethodcall.py | py | 548 | python | en | code | 2 | github-code | 13 |
43052758699 | from common.common import update_user_infor, add_new_account, user_exist, is_email, logged_in_user, update, fetch_user_infor, get_user_being_paid, add_transaction, get_transactions
import datetime
def deposit(email, amount):
if(amount.isdigit() and amount.isnumeric()):
user, index, ... | brit01flo/Bank-App-Password-Generator | Deposit/deposit.py | deposit.py | py | 818 | python | en | code | 1 | github-code | 13 |
35794751445 | # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(S):
s_len = len(S)
if s_len == 0:
return 1
if s_len % 2 != 0 or S[0] not in '{([':
return 0
m = {
'{': '}'
, '}': '{'
, '[': ']'
, ']': '['
, '... | whitebluecloud/padp_ko | whitebluecloud/codewars/codility_stack_1.py | codility_stack_1.py | py | 629 | python | en | code | 5 | github-code | 13 |
14764775386 |
import speech_recognition as sr
import os
import time
import random
import vocabulary
import tensorflow
import keras
session = {
"feeling": "init",
"Bad":"init",
"Sleep": "init",
"outside": "init",
"eat": "init",
"burnout": "init",
"State": "init"
}
intent = "yesFeedback"
def main():
... | BilelSaid87/INSPIRITED | functions/speechRecognition.py | speechRecognition.py | py | 5,632 | python | de | code | 0 | github-code | 13 |
8815442076 | # main
# version :
# new :
# structure :
# target :
# 1.
import sys
from os.path import join as pth
sys.path.insert(1,pth('..','..'))
from datetime import datetime as dtm
from datetime import timedelta as dtmdt
from lidar.dt_handle import *
from lidar.plot import plot
import numpy as n
from pandas import re... | ChungChenWei/NDU_Sunsing_Lidar | function/yrr_project/ST_Lidar_comp/ST_Lidar.py | ST_Lidar.py | py | 10,478 | python | en | code | 1 | github-code | 13 |
36588226126 | class Solution:
def minMeetingRooms(self, intervals: List[List[int]]) -> int:
if len(intervals) < 2:
return len(intervals)
rooms = []
intervals.sort(key=lambda x: x[0])
for cur in intervals:
if rooms and cur[0] >= rooms[0]:
earliest_end_sameroo... | ysonggit/leetcode_python | 0253_MeetingRoomsII.py | 0253_MeetingRoomsII.py | py | 484 | python | en | code | 1 | github-code | 13 |
9255612258 | from admin import Admin
from manager import Manager
from user import User
from systemgui import System_Gui
class EstateSystem:
def __init__(self):
self.estates = []
self.thoroughfare = []
self.property = []
self.household = []
self.users = []
self.users.append(Admin... | cwilson98/projects | Estate Management System/estate_system.py | estate_system.py | py | 721 | python | en | code | 0 | github-code | 13 |
36933135133 | from karel.stanfordkarel import *
def main():
color_fill(GREEN)
white_fill()
color_fill(ORANGE)
def color_fill(color):
for i in range(4):
while front_is_clear():
paint_corner(color)
move()
paint_corner(color)
back_to_position()
... | imhariprakash/Courses | python/Code_In_Place-2021/INDIA.py | INDIA.py | py | 1,460 | python | en | code | 4 | github-code | 13 |
72833323219 | # written to test break points
import random
heads = 0
tails = 0
for i in range(1, 1001):
toss = random.randint(0,1)
if toss == 1:
heads = heads + 1
elif toss == 0:
tails = tails + 1
if i == 500:
print('Halfway done!')
print('Heads came up ' + str(heads) + ' t... | rodrickaheebwa/automate-the-boring-stuff | py/coinFlip.py | coinFlip.py | py | 379 | python | en | code | 0 | github-code | 13 |
17876978951 | # imports
# subroutines
def calculate_flashes(i, r, xs):
sx = len(xs)
c = 0
if xs[i] > 9:
xs[i] = 0
c += 1
if i+1 < sx:
xs[i+1] = xs[i+1] + 1
if i-1 > -1:
xs[i-1] = xs[i-1] + 1
if i+r < sx:
xs[i+r] = xs[i+r] + 1
if i-r >... | rodfer0x80/aoc2021py | src/day11.py | day11.py | py | 1,209 | python | en | code | 0 | github-code | 13 |
71082162897 | from multiprocessing import Pool
from typing import Union, Tuple
from predictor.common.file_and_folder_operations import *
def convert_trainer_plans_config_to_identifier(
trainer_name, plans_identifier, configuration
):
return f"{trainer_name}__{plans_identifier}__{configuration}"
def convert_identifier_to_... | weihuang-cs/nnUNet-Deploy | src/predictor/common/file_path_utilities.py | file_path_utilities.py | py | 1,877 | python | en | code | 1 | github-code | 13 |
26860432925 | import json
import boto3
from boto3.dynamodb.types import TypeDeserializer
from boto3.dynamodb.conditions import Key
import time
def lambda_handler(event, context):
startTime = time.time()
queryStr = event["queryStringParameters"]
type = queryStr["type"]
token = queryStr["token"]
cognito = boto3.... | sentiment-analysis-cc/DiarAI | lambda/getDiaryEntrty.py | getDiaryEntrty.py | py | 1,928 | python | en | code | 0 | github-code | 13 |
14600704214 | # -*- coding: utf-8 -*-
"""
The Combat Maneuvers static maneuver table.
Classes:
CombatManeuversManeuverTable
"""
from __future__ import absolute_import
import sys
from maneuvers.static_maneuver_table import StaticManeuverTable
from maneuvers.static_maneuver_table import BLUNDER, ABSOLUTE_FAILURE, FAILURE
from ma... | AidanCopeland/merp | maneuvers/combat_maneuvers_maneuver_table.py | combat_maneuvers_maneuver_table.py | py | 6,037 | python | en | code | 1 | github-code | 13 |
33947606455 | #!/usr/bin/python3
import unittest
import datetime
import os
from models.base_model import BaseModel
from models import storage
class TestBaseModel(unittest.TestCase):
def setUp(self):
self.model = BaseModel()
def test_id_is_string(self):
self.assertIsInstance(self.model.id, str)
def te... | F1R3BLAZ3/AirBnB_clone | tests/test_models/test_base_model.py | test_base_model.py | py | 4,661 | python | en | code | 0 | github-code | 13 |
42873768899 | from flask import Flask,jsonify,request
app = Flask(__name__)
data = {
"1" : {
"username" : "rajeev",
"caption" : "Hello world rajeev"
},
"2" : {
"username" : "shashi",
"caption" : "Hello world shashi"
}
}
@app.route("/")
def hello_world():
return "Hello Instagram... | Raaz2/GenerativeAI | PythonProblemInterview/instagramapp/app.py | app.py | py | 698 | python | en | code | 0 | github-code | 13 |
41563948608 | from Crypto.PublicKey import RSA
from Crypto.Random import get_random_bytes
from Crypto.Cipher import AES, PKCS1_OAEP
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA256
import hashlib
BUF_SIZE = 65536 # lets read stuff in 64kb chunks!
def generate_rsa_key():
key = RSA.generate(2048)
return... | ImDoneWithThisUsername/PRJ1-Encryption | accounts/encryption.py | encryption.py | py | 4,080 | python | en | code | 1 | github-code | 13 |
23949573251 | import os
import logging
import message
import asyncio
import aioredis
from telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes, MessageHandler, filters
from telegram.ext.filters import BaseFilter
BOT_TOKEN = os.getenv("BOT_TOKEN")
logging.basicConfig(level=logging.INFO)
... | akinfina-ulyana/sade22 | bot.py | bot.py | py | 1,373 | python | en | code | 0 | github-code | 13 |
38466838822 | import json
import os
import sys
from github import Github
fields_config = ['token', 'owner', 'repository', 'login']
def get_config():
config = {}
gh_proc = os.popen('gh api user')
for source in (os.environ['HOME'] + '/.push.json', gh_proc.name):
try:
config.update(json.loads(open(so... | 1frag/ForcePusher | Sources/PythonForcePusher/force_push.py | force_push.py | py | 2,029 | python | en | code | 0 | github-code | 13 |
37677891224 | import chess
from definitions import INFINITE, MAX_PLY, MATE
from search.base import BaseSearch
def is_drawn(board: chess.Board):
return board.is_fivefold_repetition() \
or board.is_stalemate() \
or board.is_seventyfive_moves() \
or board.is_insufficient_material()
class Minima... | Mk-Chan/python-chess-engine-extensions | search/minimax.py | minimax.py | py | 2,423 | python | en | code | 13 | github-code | 13 |
27667933266 | import sys
import os
import json
import xml.etree.ElementTree as ET
import yaml
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QLineEdit, QPushButton, QFileDialog, QMessageBox
class DataConverter(QMainWindow):
def __init__(self):
super().__init__()
... | kkseniaaa/Narzedzia-w-branzy-IT | main.py | main.py | py | 5,581 | python | en | code | 0 | github-code | 13 |
86459024387 | import warnings
from abc import abstractmethod
from pathlib import Path
from typing import Union, List
import numpy as np
from tqdm import tqdm
import torch
from torch.utils.data.dataset import Dataset
from flair.datasets import DataLoader
from flair.datasets import SentenceDataset
import flair
flair.device = 'cuda:1... | wuqi0704/MasterThesis_Tokenization | flair/tokenizer_model.py | tokenizer_model.py | py | 19,063 | python | en | code | 0 | github-code | 13 |
11967395773 | '''
Computational Physics Project
A log-likelihood fit for extracting neutrino oscillation parameters
Part 2: 1D Minimisation
'''
# importing variables and functions from previous .py file
from The_Data import events, sim, p, x, np, plt
# defining NLL in 1D
def likelihood(theta):
'''Ret... | sk6817/Computational-Physics-2019 | Project/1D_Minimisation.py | 1D_Minimisation.py | py | 11,913 | python | en | code | 0 | github-code | 13 |
24690969446 | from flask import Flask, render_template, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from json import JSONEncoder
import json
import os
app = Flask(__name__, instance_relative_config=False)
app.config["SQLALCHEMY_DATABASE_URI"] = os.environ.get("DATABASE_URL")
app.config["SQLALCHEMY_ECHO"] = False
app.c... | ritza-co/demo-flask-mysql | app.py | app.py | py | 1,971 | python | en | code | 0 | github-code | 13 |
43031147343 | #sv-classifier.py
####
# This file identifies instances of Single Ventricle using the Levenshtein.
# Believe a simple tool like this could aid medical workers in finding the majority of cases in unstructured data.
import sys
import os
import pandas as pd
import math
import re
from pandas import ExcelFile
GOLD_STA... | uabinf/nlp-fall-2019-project-textmania | sv-add-gold.py | sv-add-gold.py | py | 2,008 | python | en | code | 1 | github-code | 13 |
1676397467 | import numpy as np
def binary_search(l, r, arr, val):
if r >= l:
m = (l+r) // 2
if arr[m] == val:
return m
elif val > arr[m]:
return binary_search(m+1, r, arr, val)
elif val < arr[m]:
return binary_search(l, m-1, arr, val)
else:
p... | farzan-dehbashi/toolkit | algorithms/interview_questions.py/array/item_is_unique_in_list.py | item_is_unique_in_list.py | py | 770 | python | en | code | 5 | github-code | 13 |
41880373500 | from phonenumbers import geocoder, carrier, timezone
#رساله ترحيبية
print(" Welcome to the phone data knowledge program \n BY Muhammad Alaa " "\n M.A" )
print ("""
░░█████████
░░▒▀█████▀░
░░▒░░▀█▀
░░▒░░█░
░░▒░█
░░░█
░░█░░░░███████
░██░░░██▓▓███▓██▒
██░░░█▓▓▓▓▓▓▓█▓████
██░░██▓▓▓(◐)▓█▓█▓█
███▓▓▓█▓▓▓▓▓█▓█▓▓▓▓█
▀██... | DARKGITHUBPRO/Number | NUmber.py | NUmber.py | py | 3,253 | python | ar | code | 0 | github-code | 13 |
14818841691 | # implement hash tables
# we store data inside the hash map as Key : value pairs
## handling collisions in hash table using list
class HashTable:
def __init__(self):
"""initialization hash table"""
self.max = 20 #length of list
self.arr = [[None] for i in range(self.max)] # or [None]*se... | saadoundhirat/data-structures-and-algorithms | python/code_challenges/hash-tables/hash_tables/demo.py | demo.py | py | 1,527 | python | en | code | 2 | github-code | 13 |
7712017627 | from flask_jwt import jsonify
from sqlalchemy.sql.functions import user
from flask_restful import Resource,reqparse
from models.pets_model import PetModel
from models.user_model import UserModel
from models.category_model import CategoryModel
class Pet(Resource):
parser = reqparse.RequestParser()
parser.add_ar... | HtetO2Ko/pet_shop | resource/pets_resource.py | pets_resource.py | py | 2,684 | python | en | code | 0 | github-code | 13 |
24660193049 | """Модуль запуска приложения."""
import uvicorn
from core.app import setup_app
app = setup_app()
if __name__ == "__main__":
uvicorn.run(
app=app, host=app.settings.host, port=app.settings.port, use_colors=True
)
| VIVERA83/derbit | external_service/main.py | main.py | py | 253 | python | en | code | 1 | github-code | 13 |
6441939399 | import pytest
import pytest_asyncio
import secret_wiki.schemas.wiki as schemas
from secret_wiki.models.wiki.section import Section, SectionPermission
from tests.resources.factories import UserFactory
@pytest_asyncio.fixture
async def other_user(db, fake):
user = UserFactory()
db.add(user)
await db.commit... | raymondberg/secret_wiki | tests/unit/models/test_section.py | test_section.py | py | 2,061 | python | en | code | 5 | github-code | 13 |
33060363753 | import argparse
import functools as ft
import itertools as it
import logging
import os
import re
import jsonschema
import pkg_resources
import yaml
from .. import util
class Plugin:
"""
Abstract base class for plugins.
"""
ENABLED = True
SCHEMA = {}
ORDER = None
COMMANDS = None
def ... | spotify/docker_interface | docker_interface/plugins/base.py | base.py | py | 14,861 | python | en | code | 34 | github-code | 13 |
70045596179 | # -*- coding: utf-8 -*-
# Import modules
from setuptools import find_packages, setup
with open("README.md", encoding="utf8") as readme_file:
readme = readme_file.read()
with open("requirements-lib.txt") as f:
requirements = f.read().splitlines()
with open("requirements-test.txt") as f:
test_requiremen... | jelambrar96/pyconway | setup.py | setup.py | py | 888 | python | en | code | 1 | github-code | 13 |
40026939295 | # -*- coding: utf-8 -*-
"""
Advent of Code 2021
@author marc
"""
import numpy as np
with open("input-day25") as f:
lines = f.readlines()
lines = [l.split()[0] for l in lines]
grid = np.zeros((len(lines), len(lines[0])), dtype=int)
for row, l in enumerate(lines):
for col, c in enumerate(l... | masebs/adventOfCode2021 | day25.py | day25.py | py | 1,492 | python | en | code | 0 | github-code | 13 |
16637566639 | # -*- coding: utf-8 -*-
import os
import re
import random
import hashlib
import hmac
from string import letters
from time import strftime
from google.appengine.ext import db
import webapp2
import jinja2
import datetime
from handler import *
from user import *
from menu import *
from order import *
from personalord... | WillyChen123/drinkorder | main.py | main.py | py | 42,562 | python | en | code | 0 | github-code | 13 |
13726588524 | import numpy as np
import torch
import pandas as pd
import atom_features
import molecule_features
import edge_features
import torch.utils.data
import util
from atom_features import to_onehot
class MoleculeDatasetMulti(torch.utils.data.Dataset):
def __init__(self, mols, pred_vals, whole_records,
M... | stefhk3/nmrfilter | respredict/netdataio.py | netdataio.py | py | 9,071 | python | en | code | 1 | github-code | 13 |
35210660984 | # Uses python3
import sys
def get_max(a, b):
ab = a + b
ba = b + a
if int(ab) >= int(ba):
return a
elif int(ba) >= int(ab):
return b
def largest_number(a):
max_lis = []
l = len(a)
while len(max_lis) < l:
max = str(a[0])
for i in a:
max = get_m... | vinaykudari/data-structures-and-algorithms | algorithmic-toolbox/week3_greedy_algorithms/7_maximum_salary/largest_number.py | largest_number.py | py | 543 | python | en | code | 0 | github-code | 13 |
27882971950 | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
import gc
import networkx as nx
import time
import pickle
import os
from sklearn.preprocessing import LabelEncoder
import seaborn as sns
import deepwalk as dw
pd.set_option('display.max_rows',1000)
pd.set_option('display.max_columns',100)
s... | Susanna333/black-industry-recognition-based-on-user-behavior | graph_embedding.py | graph_embedding.py | py | 8,756 | python | en | code | 2 | github-code | 13 |
8163299989 | """
File: Leaderboard.py
Authors: Spencer Wheeler, Benjamin Paul, Troy Scites
Description: Provides a get method to retrieve leaderboard data
"""
import sqlite3
from sqlite3 import Error
from flask_restful import Resource, reqparse
#using reqparse despite its depreciated status
class leaderboard(Resource):... | benp23/Spazzle-clone | Spazzle/leaderboard.py | leaderboard.py | py | 1,431 | python | en | code | 0 | github-code | 13 |
71166501139 | #spatial smoothing helper file
import numpy as np
from scipy.stats import expon
import matplotlib.pyplot as plt
def SmoothArray(array, window_size = 27):
sigma = 0.1
mu = 0.5
window_size = 27
kernel = np.exp(-(np.linspace(0,1,window_size,endpoint = True) - mu) **2 / (sigma**2*2))
... | eort/AMPM | analUtils.py | analUtils.py | py | 3,882 | python | en | code | 0 | github-code | 13 |
27806355288 | from django.shortcuts import render,redirect
from .models import User, Friend
from django.http import JsonResponse
# Create your views here.
def index(request):
user = User.objects.all().exclude(id = request.session['user_id'])
friend = Friend.objects.filter(user_id = request.session['user_id'])
if friend:
req_fr... | Sunil178/Laravel | fb/fbapp/views.py | views.py | py | 4,184 | python | en | code | 0 | github-code | 13 |
16179871215 | import tempfile, os
import numpy as np
import mdtraj as md
from mdtraj.formats import MDCRDTrajectoryFile
from mdtraj.testing import eq
fd, temp = tempfile.mkstemp(suffix='.mdcrd')
def teardown_module(module):
"""remove the temporary file created by tests in this file
this gets automatically called by pytest... | mdtraj/mdtraj | tests/test_mdcrd.py | test_mdcrd.py | py | 3,348 | python | en | code | 505 | github-code | 13 |
5067806892 | import sys, os, time, datetime
import numpy as np
import pandas as pd
import folium
# https://mapsplatform.google.com/pricing/?_gl=1*1s4atal*_ga*MTQwMzE0MzgxOC4xNjY3NDgyMjQx*_ga_NRWSTWS78N*MTY2NzQ4MjI0MS4xLjEuMTY2NzQ4MjI0Ni4wLjAuMA..
from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QTabWidget, QVB... | PlaidDragon/Dashboards-GUIs | EllisGUI_v_0_7.py | EllisGUI_v_0_7.py | py | 50,719 | python | en | code | 0 | github-code | 13 |
20746455559 | #Usando parametro em uma função
nome = 'João'
def saudacao_com_parametro(nome_da_pessoa):
print(f'Olá {nome_da_pessoa}')
saudacao_com_parametro(nome)
###############################################################
#Condicional
#Verificar a idade se é possível dirigir
idade = 20
def verificaDirigir(idade_pesso... | HenryJKS/Python | Conhecendo Python/Parâmetro.py | Parâmetro.py | py | 888 | python | pt | code | 0 | github-code | 13 |
10591194568 | from typing import List
class Solution:
def dfs(self, node: int, adj: dict[int, list], visited: List[bool]) -> int:
visited[node] = True
minimum = int(10 ** 9)
for road in adj[node]:
minimum = min(minimum, road[1])
if visited[road[0]]:
continue
... | harshraj9988/LeetCode-solutions | Leetcode-solution-python/minimumScoreOfAPathBetweenTwoCities.py | minimumScoreOfAPathBetweenTwoCities.py | py | 1,039 | python | en | code | 0 | github-code | 13 |
22043901849 | from selenium import webdriver
import time
import requests as req
from bs4 import BeautifulSoup
import re
import os
import cv2
import numpy as np
def img_process(img_path, tags):
w_font, h_font = 22, 15
alpha = 0.3
img = cv2.imread(img_path)
w_img, h_img = (img.shape[1]*7, img.shape[0]*7)
img = cv... | TerryYeh54147/Python-Workshop | 0805/3.py | 3.py | py | 2,570 | python | en | code | 0 | github-code | 13 |
39131338671 | final_result = {}
# sales_sum 委托生成器 k 子生成器
def sales_sum(k):
total = 0
nums = []
while True:
x = yield
print(k + '销量:', x)
# 循环结束条件
if not x:
break
total += x
nums.append(x)
return total, nums
# middle 调用方
def middle(k):
while True:
... | dsdcyy/python- | python进阶/生成器进阶/02-2 yelid_from.py | 02-2 yelid_from.py | py | 893 | python | en | code | 0 | github-code | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.