seq_id
string
text
string
repo_name
string
sub_path
string
file_name
string
file_ext
string
file_size_in_byte
int64
program_lang
string
lang
string
doc_type
string
stars
int64
dataset
string
pt
string
api
list
21773433414
import cv2 as cv import numpy as np video=cv.VideoCapture(0) windowClose = np.ones((5, 5), np.uint8) windowOpen = np.ones((2, 2), np.uint8) windowErode = np.ones((2, 2), np.uint8) face_cascade = cv.CascadeClassifier('D:/opencvextracted/opencv/sources/data/haarcascades/haarcascade_frontalface_default.xml') eye_...
dixitakhil/OpencvPython
projects/pupils/pupildetection.py
pupildetection.py
py
3,606
python
en
code
0
github-code
18
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.ones", "line_numb...
14592214696
import datetime import uuid from py4web import request, URL from pydal.validators import * from .my_validators import IS_ISO_DATETIME, IS_REAL_LIST_OF_EMAILS, IS_DOMAIN from .components.vueform import VueForm from .constants import * from .common import db, session, auth, Field from .util import random_id from .comm...
lucadealfaro/notebookgrader-app
api_assignment_form.py
api_assignment_form.py
py
6,203
python
en
code
1
github-code
18
[ { "api_name": "common.Field", "line_number": 19, "usage_type": "call" }, { "api_name": "common.Field", "line_number": 22, "usage_type": "call" }, { "api_name": "my_validators.IS_DOMAIN", "line_number": 23, "usage_type": "call" }, { "api_name": "common.Field", ...
4306889332
import re import csv import requests from bs4 import BeautifulSoup from random import choice COUNTER = 0 def get_proxy(): html = requests.get('https://free-proxy-list.net/').text soup = BeautifulSoup(html, 'lxml') trs = soup.find('table', id='proxylisttable').find_all('tr')[50:100] proxies = [] f...
jurgeon018/scraping
blezer/blezer.py
blezer.py
py
10,283
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.get", "line...
2053476407
import json from database import ForumDB import requests TOKEN = "5466989984:AAHIwjOaHUMHPkMNlGqRtta_T8oWx9L_1bg" URL = "https://api.telegram.org/bot{}/".format(TOKEN) DB = ForumDB() last_msg = 'none' def send_msg(msg): url = URL + 'sendMessage?chat_id=224133650&text={}'.format(msg) + '&parse_mode=HTML&reply_ma...
MSabitjanov/cs50-final_project
tgforum.py
tgforum.py
py
3,735
python
en
code
2
github-code
18
[ { "api_name": "database.ForumDB", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.post", "line...
12887263206
import datetime current_Date_Time = datetime.datetime.now() date = current_Date_Time.date() year = date.strftime("%Y") print(f"Current Year -> {year}") year = int(year) username = input("What is your username? ") print(f"Wow that is a nice name {username}") user_age = input("What is your age? ") print(f"Dear {userna...
AndrisKatkovskisHomeWork/TietoEvry_Febr_23
febr_23.py
febr_23.py
py
1,440
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 3, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 3, "usage_type": "attribute" } ]
17820558944
"""empty message Revision ID: 34a42af4014a Revises: Create Date: 2023-09-06 17:37:29.581281 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '34a42af4014a' down_revision = None branch_labels = None depends_on = None def up...
MhmmdKcrl/StudentsApp-Flask
migrations/versions/34a42af4014a_.py
34a42af4014a_.py
py
2,453
python
en
code
0
github-code
18
[ { "api_name": "alembic.op.batch_alter_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.drop_table", "line_number": 24, "usage_type": "call" }, { "api_name": "alembic...
37758064394
""" ASGI config for optima project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ """ import os import dotenv from channels.routing import ProtocolTypeRouter, URLRouter from django.cor...
Eukip/oms
backend/optima/asgi.py
asgi.py
py
889
python
en
code
0
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "l...
22081742286
import sys from functools import partial from defect.circuit import load_circuit from defect import analysis import defect.filetypes.internal as fileio import networkx as nx EATTR_CHANGE = 'delta' # float - change in current EATTR_SOURCE = 'src' # node - positive-sign source for EATTR_CHANGE EATTRS = [EATTR...
ExpHP/defect
defect/scripts/plotting/currents.py
currents.py
py
7,193
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 25, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sys.exit", ...
5352963252
# -*- coding: cp1252 -*- ######################################################################################################## ######################################################################################################## """ Code_2_Downscaling_and_Bias_Correcting_CM...
refewster/Imminent-loss-of-climate-space-for-Eurasian-permafrost-peatlands-
Code_2_Downscaling_and_Bias_Correcting_CMIP6_climate_projections.py
Code_2_Downscaling_and_Bias_Correcting_CMIP6_climate_projections.py
py
67,966
python
en
code
1
github-code
18
[ { "api_name": "xarray.open_mfdataset", "line_number": 59, "usage_type": "call" }, { "api_name": "xarray.open_mfdataset", "line_number": 61, "usage_type": "call" }, { "api_name": "xarray.open_mfdataset", "line_number": 63, "usage_type": "call" }, { "api_name": "xar...
11112495354
from rsa import * from hashlib import sha256 from Crypto.Util.number import long_to_bytes, bytes_to_long import gmpy2 import sys sha256_asn1 = b'\x30\x31\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x01\x05\x00\x04\x20' # matches the c impl def verify_sig(signature,message,pk): #generate clearsig e,n = pk ...
o-o-overflow/dc2021f-barb-metal-public
service/src/expl/fakesign.py
fakesign.py
py
1,957
python
en
code
1
github-code
18
[ { "api_name": "Crypto.Util.number.long_to_bytes", "line_number": 15, "usage_type": "call" }, { "api_name": "hashlib.sha256", "line_number": 30, "usage_type": "call" }, { "api_name": "hashlib.sha256", "line_number": 41, "usage_type": "call" }, { "api_name": "Crypto...
1806846451
from DistGNN.dataloading import load_dataset import argparse import os import time import torch if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--root', default='dataset/', help='Path of the dataset.') parser.add_argument("-...
CommediaJW/Graph-Part-bench
graph_process/weighted_metis_format.py
weighted_metis_format.py
py
3,700
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "DistGNN.dataloading.load_dataset", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 24, "usage_type": "call" }, { "api_name": "ti...
38858268918
import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split import seaborn as sn from sklearn import metrics from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import StandardScaler import pandas as pd from sklearn.utils import shuffle #--...
AmitaiBiton/OneVsAll-One
main.py
main.py
py
4,865
python
en
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LogisticRegression", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy...
100224365
#!/usr/bin/python # -*- coding: utf-8 -*- # import sys # import getpass # import os # import json as _JSON # import uharfbuzz as HB ### NOTE import after ctx available ### #----------------------------------------------------------------------------------------------------------- def _get_cache( ctx ): R = c...
loveencounterflow/intershop-intertext
intershop_modules/myharfbuzz.py
myharfbuzz.py
py
5,024
python
en
code
0
github-code
18
[ { "api_name": "uharfbuzz.Face", "line_number": 30, "usage_type": "call" }, { "api_name": "uharfbuzz.Font", "line_number": 31, "usage_type": "call" }, { "api_name": "uharfbuzz.ot_font_set_funcs", "line_number": 34, "usage_type": "call" }, { "api_name": "uharfbuzz.B...
42674900097
import numpy as np import matplotlib.pyplot as plt N = 50 nilai_x = np.linspace(-5, 5, N) nilai_y = np.linspace(-5, 5, N) def function_z (x, y): z = 50 - (x**2 + y**2) return z x, y = np.meshgrid(nilai_x, nilai_y) z = function_z(x, y) print(z) ax = plt.axes(projection = '3d') ax.plot_su...
iqram1337/praktikum-komputasi-geofisika
plot 3d pt2.py
plot 3d pt2.py
py
376
python
en
code
0
github-code
18
[ { "api_name": "numpy.linspace", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.axes", ...
197067150
from copy import deepcopy import os import subprocess from tempfile import NamedTemporaryFile from librarian import OutputFile def transform(wldoc, verbose=False, sample=None, cover=None, use_kindlegen=False, flags=None, hyphenate=True, ilustr_path=''): """ produces a MOBI file wldoc: a WLDocu...
quiris11/librarian
librarian/mobi.py
mobi.py
py
1,584
python
en
code
null
github-code
18
[ { "api_name": "copy.deepcopy", "line_number": 19, "usage_type": "call" }, { "api_name": "tempfile.NamedTemporaryFile", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", ...
73234170601
''' Contains module to Login in Instagram and return user_id of an instagram profile ''' import pickle from bs4 import BeautifulSoup import json import random import re import os import requests def test_login(session): return session.get('https://www.instagram.com/data/shared_data/').json()['config']['viewer'] ...
TH3-MA3STRO/ig-dler_cli
login.py
login.py
py
2,662
python
en
code
1
github-code
18
[ { "api_name": "random.randrange", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 35, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 39, "usage_type": "call" }, { "api_name": "re.compile", ...
32480940653
import json from flask import Flask, render_template, redirect, session, url_for from auth.route import blueprint_auth from blueprint_query.route import blueprint_query from blueprint_report.route import blueprint_report from blueprint_edit.route import blueprint_edit from basket.route import blueprint_order #'''_cach...
NovokshanovE/DB_kurs
with_report/app.py
app.py
py
2,225
python
ru
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "auth.route.blueprint_auth", "line_number": 13, "usage_type": "argument" }, { "api_name": "blueprint_report.route.blueprint_report", "line_number": 14, "usage_type": "argument" }, { ...
30008273748
#!/usr/bin/env python # coding=utf-8 # Authors: John Stowers <john@loopbio.com>, Santi Villalba <santi@loopbio.com> # Licence: BSD 3 clause import os.path as op from setuptools import setup, find_packages this_directory = op.abspath(op.dirname(__file__)) with open(op.join(this_directory, 'README.md'), 'rb') as f: ...
loopbio/imgstore
setup.py
setup.py
py
1,877
python
en
code
6
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_numb...
1873943038
from typing import Any, Dict from app.funcs.query_processors import ( NetworkPlotSchemaInput, TopicQueryProcessor, ) from app.utils.data_table import NodeCol, RelCol from app.utils.url_helpers import data_table_node_link, data_table_rel_link from .diagram import cypher_diagram from .graph import create_edge_s...
MRCIEU/epigraphdb_web
backend/app/apis/topic_views/confounder/functions.py
functions.py
py
3,249
python
en
code
2
github-code
18
[ { "api_name": "app.utils.url_helpers.data_table_node_link", "line_number": 14, "usage_type": "call" }, { "api_name": "app.utils.url_helpers.data_table_node_link", "line_number": 15, "usage_type": "call" }, { "api_name": "app.utils.url_helpers.data_table_node_link", "line_numb...
16998815049
# 문자열 배열을 받아 애너그램 단위로 그룹핑하라. import collections test_cases = [ ["eat", "tea", "tan", "ate", "nat", "bat"] ] def main(strs): anagrams = collections.defaultdict(list) for word in strs: anagrams[''.join(sorted(word))].append(word) return anagrams.values() def start(test_cases): for idx, ...
plzprayme/study-python-algorithm-interview
ch6_string/q5.py
q5.py
py
454
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" } ]
21395725041
import pygame class Bird: def __init__(self, sets, screen): """初始化bird设置""" self.screen = screen self.sets = sets # 加载鸟儿 self.image = pygame.image.load('images/bird.png') self.rect = self.image.get_rect() self.screen_rect = self.screen.get_rect() ...
juer-joker/Bird-game
bird.py
bird.py
py
1,108
python
en
code
0
github-code
18
[ { "api_name": "pygame.image.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 11, "usage_type": "attribute" } ]
441458860
#!/usr/bin/python3 import time import requests from bs4 import BeautifulSoup as bs def mul_scrape(url, out_path): """ Description: creates a csv of a multiplication table from url of online calculator (lazy) Input: url, url to scrape out_path, where to write csv Output: None, writes file to out_path """ ...
kyler-harrison/erasure-coding
scrape/scrape_all.py
scrape_all.py
py
3,235
python
en
code
0
github-code
18
[ { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "time.time", "line_number...
8172252550
from sympy import solve_triangulated import torch from torch import nn from torch_geometric.nn import MessagePassing, TopKPooling from torch_geometric.data import Data from torch_geometric.utils import remove_self_loops, add_self_loops from synthetic_data import datagen#, sourced import numpy as np import matplotlib.py...
obfasina/Inverse_Problems_GNN
old_codes/train.py
train.py
py
6,667
python
en
code
1
github-code
18
[ { "api_name": "torch.load", "line_number": 141, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 142, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 143, "usage_type": "call" }, { "api_name": "Granola_GNN.NodeClassifier", ...
2716410859
from django.shortcuts import render from mainattendance.models import StudentAttendance,CurrentAttendance,Batch,Student # Create your views here. def page(request): # batchs = CurrentAttendance.objects.values('batch','date') # if request.method == "GET": # xbatch = request.GET.get('batch') # params = {'batchs':ba...
Abhishek3024/manage-attendence
viewattendance/views.py
views.py
py
1,654
python
en
code
0
github-code
18
[ { "api_name": "mainattendance.models.Batch.objects.all", "line_number": 27, "usage_type": "call" }, { "api_name": "mainattendance.models.Batch.objects", "line_number": 27, "usage_type": "attribute" }, { "api_name": "mainattendance.models.Batch", "line_number": 27, "usage_...
42837101713
from typing import Optional from httpx import Client from .responses import ( InfoResponse, LoginResponse, SeasonObject, SeasonResponse, SeasonsObject, SeasonsResponse, ) class Api: def __init__(self, client: Optional[Client] = None) -> None: """ Creates an API instance. ...
Nearata/vvvvid-downloader
vvvvid_downloader/api.py
api.py
py
1,852
python
en
code
2
github-code
18
[ { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" }, { "api_name": "httpx.Client", "line_number": 16, "usage_type": "name" }, { "api_name": "httpx.Client", "line_number": 21, "usage_type": "call" }, { "api_name": "typing.Optional", "line...
22217073420
import json from django.http import JsonResponse from django.views import View from movies.models import Actor, Movie class ActorsView(View): def get(self, request): results = [ { 'first_name' : actor.first_name, 'last_name' : actor.last_name, ...
jhwang0801/Django_CRUD2
movies/views.py
views.py
py
994
python
en
code
0
github-code
18
[ { "api_name": "django.views.View", "line_number": 9, "usage_type": "name" }, { "api_name": "movies.models.Actor.objects.all", "line_number": 20, "usage_type": "call" }, { "api_name": "movies.models.Actor.objects", "line_number": 20, "usage_type": "attribute" }, { ...
9779648603
from functools import cached_property from typing import Dict, List, Sequence from .column_names import COLUMN_NAME from .events_factory import EventsFactory from .lttng_info import LttngInfo from .ros2_tracing.data_model import Ros2DataModel from .value_objects import TimerCallbackValueLttng, TimerControl, TimerInit...
azu-lab/CARET_Executor_Evaluation
CARET_Executor_Evaluation/src/CARET/CARET_analyze/caret_analyze/infra/lttng/records_source.py
records_source.py
py
24,526
python
en
code
1
github-code
18
[ { "api_name": "ros2_tracing.data_model.Ros2DataModel", "line_number": 22, "usage_type": "name" }, { "api_name": "lttng_info.LttngInfo", "line_number": 23, "usage_type": "name" }, { "api_name": "ros2_tracing.data_model.Ros2DataModel", "line_number": 30, "usage_type": "name...
6554836424
import cv2 import torch import sys import os sys.path.append('yolov5') from models.experimental import attempt_load from utils.general import non_max_suppression, xyxy2xywh from utils.torch_utils import select_device # Load YOLOv5 model weights = 'yolov5s.pt' device = select_device('') model = attempt_load(weights, de...
williammw/yolov5-realtime-object-detection
app.py
app.py
py
2,099
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "utils.torch_utils.select_device", "line_number": 12, "usage_type": "call" }, { "api_name": "models.ex...
8041158089
import data_util import correlation import pandas as pd import numpy as np import datetime import pickle import itertools import time import sys import math import warnings import multiprocessing as mp import os warnings.simplefilter("error") ctr = 0 tot = 0 NUM_CORES = 8 def analyse_corr(corr_pkl_file): wit...
adithyaphilip/stocks-analysis
verification.py
verification.py
py
1,746
python
en
code
1
github-code
18
[ { "api_name": "warnings.simplefilter", "line_number": 17, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 29, "usage_type": "call" }, { "api_name": "os.getpid", "line_nu...
15577739237
# %% from os import path import struct import png from lief import PE from utils import align, compile, windres src_dir = path.dirname(__file__) # %% # compile origin demo program compile(path.join(src_dir, 'example.c'), '-m32 -O2 -o example.exe') binary = PE.parse('example.exe') print('[+] compile origin demo prog...
nnnewb/learning-packer
packer5/build.py
build.py
py
1,197
python
en
code
18
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "name" }, { "api_name": "utils.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number...
154705036
# -*- coding: utf-8 -*- """ Created on 2021/4/7 20:51 Author: ff_wang E-mail: 1105936347@qq.com Zhihu : https://www.zhihu.com/people/1105936347 Github: https://github.com/AFei19911012 ------------------------------------------------- """ # Source: https://github.com/spmallick/learnopencv from imutils import persp...
AFei19911012/PythonSamples
a_demos/cv_contour.py
cv_contour.py
py
1,666
python
en
code
12
github-code
18
[ { "api_name": "cv2.imread", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
28293269804
'''Trie.''' class Trie: def __init__(self): self.root = _Node(None) def insert(self, word): current = self.root for char in word: if not current.has_child(char): current.add_child(char) current = current.get_child(char) current.is_end_of_...
jwbat/python-datastructures
d2/trie.py
trie.py
py
5,047
python
en
code
1
github-code
18
[ { "api_name": "functools.reduce", "line_number": 84, "usage_type": "call" }, { "api_name": "{'reduce': 'functools.reduce'}", "line_number": 153, "usage_type": "call" }, { "api_name": "{'reduce': 'functools.reduce'}", "line_number": 162, "usage_type": "call" } ]
69923987560
# # Linear Regression # ## Importing the libraries # In[61]: import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn import linear_model import seaborn as sns sns.set() from sklearn.model_selection import train_test_split # ## Importing the data and preprocessing # In[62]: # Import...
danalytixx/Machine-Learning
ML1 Linear Regression.py
ML1 Linear Regression.py
py
1,466
python
en
code
5
github-code
18
[ { "api_name": "seaborn.set", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 31, "usage_type": "call" }, { "api_name": "...
20546680258
from django.shortcuts import render from main.models import Message from django.contrib.auth.decorators import login_required, user_passes_test from main.forms import MessageForm from django.http import HttpResponse import user_auth from user_auth import is_admin @login_required def front(request): # posts = Po...
azuretower/message_board
main/views.py
views.py
py
1,702
python
en
code
0
github-code
18
[ { "api_name": "main.forms.MessageForm", "line_number": 29, "usage_type": "call" }, { "api_name": "user_auth.is_admin", "line_number": 31, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 40, "usage_type": "call" }, { "api_name": "dja...
34780619060
import csv import datetime import os.path import json from os import listdir # directory of tsv files inputdir = os.path.join(os.getcwd(), 'inputfiles') # Input start date from the user startDateInput = input("Enter start date in the format yyyy/mm/dd: ") startDateInputArray = startDateInput.split("/") startDate = da...
amans330/DataEngineeringWebsite
scripts/test_data_files.py
test_data_files.py
py
1,891
python
en
code
0
github-code
18
[ { "api_name": "os.path.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.getcwd", "line_n...
25216431572
# https://leetcode.com/problems/median-of-two-sorted-arrays/ # tags: #array, #binary_search, #divide_and_conquer # # Optimal solution (if you dare): # https://leetcode.com/problems/median-of-two-sorted-arrays/discuss/2481/Share-my-O(log(min(mn)))-solution-with-explanation # # Solution: Find the median by traversing # T...
ronelzb/leetcode
array/0004_median_of_two_sorted_arrays.py
0004_median_of_two_sorted_arrays.py
py
1,189
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 13, "usage_type": "name" } ]
71426775080
import numpy as np import pandas as pd from subprocess import check_output #print(check_output(["ls", "../input"]).decode("utf8")) import datetime import time destinations = pd.read_csv("../input/destinations.csv") train1 = pd.read_csv("../input/train.csv", nrows=100000) test1 = pd.read_csv("../input/test.csv", nrows ...
aorursy/new-nb-3
gautamsihag_pred1-3.py
gautamsihag_pred1-3.py
py
4,500
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "l...
3895069234
import pandas as pd import numpy as np from sklearn.linear_model import LinearRegression import statsmodels.api as sm from statsmodels.stats.outliers_influence import variance_inflation_factor import scipy.stats as stats import matplotlib.pyplot as plt import seaborn as sns #%% independent variables path_csv = pd.rea...
makaylazheng/Capstone-Kickstarter
code/04-regression.py
04-regression.py
py
8,905
python
en
code
2
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
15459946831
''' I used Newspaper 3k for further scraping data from the URL's collected in the reddit post scraping. Newspaper 3k does a great job at scraping the relevant info from news articles. For more info on Newspaper 3k, check out this link: https://github.com/codelucas/newspaper This script pri...
mgraci/ControverSee_Classifier
Newspaper_scraper.py
Newspaper_scraper.py
py
1,792
python
en
code
0
github-code
18
[ { "api_name": "newspaper.Article", "line_number": 28, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 40, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict", "line_number": 44, "usage_type": "call" }, { "api_name": "pandas.D...
24725334328
import github as gthb inst = gthb.Github() languages = ['Python', 'Ruby', 'Javascript', 'Haskell'] extensions = ['.py', '.rb', '.js', '.hs'] with open('urls.txt','w') as f: for ind, lang in enumerate(languages): repos = inst.search_repositories(lang, language=lang, sort='stars', order='desc') size = 0 i =...
neal-o-r/code_cnn
get_data/gthb_dwld.py
gthb_dwld.py
py
458
python
en
code
0
github-code
18
[ { "api_name": "github.Github", "line_number": 3, "usage_type": "call" } ]
71722759719
import torch from torch.autograd import Variable batch_n = 100 hidden_layer = 100 input_data = 1000 output_data = 10 x = Variable(torch.randn(batch_n, input_data),requires_grad = False) y = Variable(torch.randn(batch_n, output_data),requires_grad = False) # 使用Sequential自动生成和初始化对应维度的权重参数 # 是一种序列容器, 嵌套各种实现神经网络的中具体功能相关的类...
jayphone17/SOMETHIN-BOUT-CNN
src/torch.nn.Sequential.py
torch.nn.Sequential.py
py
1,854
python
en
code
0
github-code
18
[ { "api_name": "torch.autograd.Variable", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.randn", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.autograd.Variable", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.randn"...
19642124893
from __future__ import annotations from typing import Dict class GameState: """ This class represent game state. Attributes: current_scene (str): Id of the current scene in game variables (dict): Dictionary containing all the variables of the game. Default: {} """ def __init__( ...
Zlopez/QAdventure
qadventure/domain/game_state.py
game_state.py
py
1,740
python
en
code
0
github-code
18
[ { "api_name": "typing.Dict", "line_number": 17, "usage_type": "name" } ]
41170364196
''' app 新建 urls.py 文件 ''' from django.conf.urls import url import book.views as views app_name = 'book' # 设置 app namespace urlpatterns = [ url(r'^index/$', views.index, name='index'), # url函数的name参数:设置 URL name # http://127.0.0.1:8000/book/分类id/书籍id/ # http://127.0.0.1:8000/book/category_id/book_id/ ...
LiuJGit/mysite
book/urls.py
urls.py
py
638
python
en
code
0
github-code
18
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "book.views.index", "line_number": 10, "usage_type": "attribute" }, { "api_name": "book.views", "line_number": 10, "usage_type": "name" }, { "api_name": "django.conf.url...
29491656735
import pytest from cygorithms.arrays import ( OneDArray, DynamicOneDArray, selection_sort, merge_sort, quick_sort ) @pytest.mark.parametrize( "array_type", [ OneDArray, DynamicOneDArray ] ) @pytest.mark.parametrize( "dtype, container, filler", [ ( ...
gittasche/cygorithms
tests/test_arrays.py
test_arrays.py
py
1,896
python
en
code
0
github-code
18
[ { "api_name": "pytest.mark.parametrize", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cygorithms.arrays.OneDArray", "line_number": 15, "usage_type": "name" }, { "api_name": "...
31645937685
import os import json import utils import interfaces.terraform.hetzner_provider_mapper from abc import ABC from commands.command import Command from commands.validators.command_validators import KubesprayPatchesValidator from exceptions.exceptions import UnexpectedTerraformFailureException, CommandConfirmationExceptio...
pablintino/hetzner-k8s-generator
commands/terraform_based_commands.py
terraform_based_commands.py
py
4,685
python
en
code
0
github-code
18
[ { "api_name": "commands.command.Command", "line_number": 15, "usage_type": "name" }, { "api_name": "abc.ABC", "line_number": 15, "usage_type": "name" }, { "api_name": "commands.validators.command_validators.KubesprayPatchesValidator", "line_number": 18, "usage_type": "nam...
23842605455
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ ====================== Laplacian segmentation ====================== This notebook implements the laplacian segmentation method of `McFee and Ellis, 2014 <http://bmcfee.github.io/papers/ismir2014_spectral.pdf>`_, with a couple of minor stability improvements. This impleme...
gamaievsky/DescripteursHarmoniquesAudio
spectral_clustering_audio.py
spectral_clustering_audio.py
py
27,043
python
en
code
0
github-code
18
[ { "api_name": "warnings.filterwarnings", "line_number": 49, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 67, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 67, "usage_type": "attribute" }, ...
36530697923
# 5_chart_1.py import streamlit as st import pandas as pd import plotly.express as px # 데이터 불러오기 data = 'data/gdp_by_country.csv' df = pd.read_csv(data) # 원본 데이터에서 국가명 리스트 가져오기 clist = df['country'].unique() # 사이드바에서 국가명 선택 country = st.sidebar.selectbox("국가를 선택하세요:",clist) # 메인화면 st.subheader('GDP per Capita over ...
HeejinChung/kwater-lecture
streamlit/5_chart_1.py
5_chart_1.py
py
784
python
ko
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.sidebar.selectbox", "line_number": 14, "usage_type": "call" }, { "api_name": "streamlit.sidebar", "line_number": 14, "usage_type": "attribute" }, { "api_name": "str...
1966912300
from itertools import cycle with open("Data\Day03.txt") as file: input = [line.strip() for line in file] def getitem(index, iterable): for idx, val in enumerate(iterable): if idx == index: return val def istree(row, rowidx, rowStep, colStep): if rowidx % rowStep != 0: return F...
JanDotNet/AdventOfCode
AdventOfCode2020/Python/Day03.py
Day03.py
py
1,034
python
en
code
5
github-code
18
[ { "api_name": "itertools.cycle", "line_number": 15, "usage_type": "call" } ]
18708961034
from flask import Flask, Markup, render_template from datetime import timezone, datetime import database db = database.connect() app = Flask(__name__) @app.route("/") def hello_world(): (temp_values,temp_labels) = get_temp_data() (fan_values,fan_labels) = get_fan_data() return render_template('line_chart....
JanRunge/FanController
web.py
web.py
py
1,314
python
en
code
0
github-code
18
[ { "api_name": "database.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "database.select", ...
1939124600
import collections import time from .neo import neo from .options import options __all__ = ['logger'] class __Logger: def create_reset_log_history(self): self.max_history = options.get('max_log_history', cache=False) or None self.log_history = collections.deque(maxlen=self.max_history) #...
serversidesquid/bugg
rplugin/python3/bugg/logger.py
logger.py
py
1,733
python
en
code
0
github-code
18
[ { "api_name": "options.options.get", "line_number": 12, "usage_type": "call" }, { "api_name": "options.options", "line_number": 12, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 13, "usage_type": "call" }, { "api_name": "neo.neo.vim.cal...
39053116378
""" An example submitit script for running multiple jobs in parallel on a SLURM cluster. """ import datetime import shlex import sys import time from pathlib import Path try: import submitit from tap import Tap except Exception as e: print('Please install submitit with `pip install submitit`') print('P...
lukemelas/projection-conditioned-point-cloud-diffusion
experiments/scripts/example-slurm.py
example-slurm.py
py
1,897
python
en
code
114
github-code
18
[ { "api_name": "tap.Tap", "line_number": 19, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 34, "usage_type": "call" }, { "api_name": "submitit.AutoExecutor", "line_number": 35, "usage_type": "call" }, { "api_name": "sys.exit", "line_numbe...
16838466844
from django.http import HttpResponse from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from base.models import UserProfile from base.serializers import ProfileSerializer from rest_framework.decorators import api_view from rest_framework.response import Response from...
pertile/testmap
base/views.py
views.py
py
1,804
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "forms.UpdateProfileForm", "line_number": 19, "usage_type": "call" }, { "api_name": "django.contrib.messages.success", "line_number": 23, "usage_type": "call" }, { "a...
14210218649
from typing import List # Approach 1 -> Slicing Method def reverseList(inputList: List) -> List: if(len(inputList) <= 1): return inputList return inputList[:: -1] # Approach 2 -> Inbuilt Method def reverseList2(inputList: List) -> List: if(len(inputList) <= 1): return inputList i...
kmanadkat/leetcode-101
01 List/Problems/08_reverse_list.py
08_reverse_list.py
py
1,183
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 24, "usage_type": "name" } ]
70040228842
import kivy from kivy.app import App from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.uix.textinput import TextInput from kivy.uix.button import Button from kivy.uix.widget import Widget from kivy.properties import ObjectProperty from kivy.config import Config from kivy.core.window ...
ManoJoey/Scorro
testing/test.py
test.py
py
15,602
python
nl
code
0
github-code
18
[ { "api_name": "kivy.uix.screenmanager.Screen", "line_number": 24, "usage_type": "name" }, { "api_name": "kivy.uix.screenmanager.Screen", "line_number": 26, "usage_type": "name" }, { "api_name": "kivy.uix.screenmanager.Screen", "line_number": 28, "usage_type": "name" }, ...
31141517030
from django.db.models.signals import post_save, pre_delete from user_accounts.models import UserAccount from django.dispatch import receiver from .models import UserProfile, Connection @receiver(post_save, sender=UserAccount) def post_save_profile_create(sender, instance, created, **kwargs): profile, created = Use...
iamenochchirima/Exodt
exodt-backend/user_profiles/signals.py
signals.py
py
1,201
python
en
code
0
github-code
18
[ { "api_name": "models.UserProfile.objects.get_or_create", "line_number": 8, "usage_type": "call" }, { "api_name": "models.UserProfile.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.UserProfile", "line_number": 8, "usage_type": "name" }, ...
1074684939
# Programmers 탐욕법(Greedy) 4. 구명보트 # 시간복잡도: O(NlogN) from collections import deque def solution(people, limit): answer = 0 queue = deque(sorted(people)) while queue: heavy = queue[-1] light = queue[0] if len(queue) == 1: answer += 1 break if heavy + l...
JiSuMun/Algorithm-Study
W08/KimGyuri/42885_구명보트.py
42885_구명보트.py
py
888
python
ko
code
3
github-code
18
[ { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" } ]
4402602299
"""empty message Revision ID: b22e5138a938 Revises: e6210176f55c Create Date: 2020-10-29 13:52:55.784625 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'b22e5138a938' down_revision = 'e6210176f55c' branch_labels = None depends_on = None def upgrade(): # ...
app-sre/dashdotdb
migrations/versions/b22e5138a938_.py
b22e5138a938_.py
py
1,763
python
en
code
8
github-code
18
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
29083091295
__author__ = "Mark Sattolo" __author_email__ = "epistemik@gmail.com" __created__ = "2021-01-21" __updated__ = "2021-01-21" import csv import sys from argparse import ArgumentParser from datetime import datetime as dt from cwLibWrappers import chadwick, cwlib from cwTools import * class PrintPlayerStats: de...
EpistemikPython/chadwick
src/printPlayerStats_2021-01-22.py
printPlayerStats_2021-01-22.py
py
13,275
python
en
code
0
github-code
18
[ { "api_name": "cwLibWrappers.cwlib.cw_box_get_starter", "line_number": 142, "usage_type": "call" }, { "api_name": "cwLibWrappers.cwlib", "line_number": 142, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 180, "usage_type": "call" }, { ...
36797925283
import os import matplotlib.pyplot as plt os.chdir('C:\\Users\\oscar\\OneDrive\\Bureau\\IF29\\Tweet Worldcup\\raw') os.getcwd() import json import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn.cluster import KMeans os.chdir('C:\\U...
Oscarben1/tweet_classification_inPython
oscar.py
oscar.py
py
7,282
python
fr
code
0
github-code
18
[ { "api_name": "os.chdir", "line_number": 5, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 6, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, ...
40690177844
import sys sys.path.append("/media/alesya/381A50EF72E26C1A/Yandex-disk/KLayout-python-shamil_dev_sfs/") import pya from math import sqrt, cos, sin, atan2, pi, copysign from pya import Point, DPoint, DSimplePolygon, SimplePolygon, DPolygon, Polygon, Region, Instance, CellInstArray from pya import Trans, DTrans, CplxTra...
AlesyaSokol/KLayout-python
ClassLib/AlignmentMarks.py
AlignmentMarks.py
py
6,900
python
en
code
null
github-code
18
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "pya.DPoint", "line_number": 40, "usage_type": "call" }, { "api_name": "pya.DPoint", "line_number"...
29288378641
import numpy as np import nibabel as nib from scipy import ndimage def read_nifti_file(filepath): """Read and load volume""" # Read file scan = nib.load(filepath) # Get raw data scan = scan.get_fdata() return scan def normalize(volume): """Normalize the volume""" min = np.min(volume...
krishnaShreedhar/wpi_cs539_ml_proj
src/utils.py
utils.py
py
1,988
python
en
code
0
github-code
18
[ { "api_name": "nibabel.load", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.ndimage.rotate", "line_num...
40648999324
import bpy import os import numpy #from .config import IMAGES_DIR #References: # https://docs.blender.org/api/blender_python_api_2_71_release/bpy.types.Image.html # https://blender.stackexchange.com/questions/13422/crop-image-with-python-script/13516#13516 # https://blender.stackexchange.com/questions/3673/why-i...
Beskamir/BlenderDepthMaps
src/loadImage.py
loadImage.py
py
5,496
python
en
code
3
github-code
18
[ { "api_name": "bpy.data", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "bpy.data.images.remove", ...
2439604316
from collections import defaultdict import json from PIL import Image from nonebot import on_command, on_message, on_notice, on_regex, get_driver from nonebot.typing import T_State from nonebot.adapters import Event, Bot from nonebot.adapters.cqhttp import Message from aiocqhttp import MessageSegment import aiohttp, os...
Europix/Eurobot
src/plugins/akatsuki.py
akatsuki.py
py
15,405
python
en
code
7
github-code
18
[ { "api_name": "math.ceil", "line_number": 24, "usage_type": "call" }, { "api_name": "time.time", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 35, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 36...
159049287
from django.urls import path from . import views app_name = "home" urlpatterns = [ path("", views.index, name="index"), path("login/", views.login, name="login"), path("logout/", views.logout, name="logout"), path("setting/", views.setting, name="setting"), path("search/", views.search, name="sear...
sounmind/minuteChecker
home/urls.py
urls.py
py
1,098
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
73558369000
"""populate_reconcile_queue""" import json import logging import os from cbers2stac.layers.common.utils import get_client # Get rid of "Found credentials in environment variables" messages logging.getLogger("botocore.credentials").disabled = True LOGGER = logging.getLogger() LOGGER.setLevel(logging.INFO) def popul...
fredliporace/cbers-2-stac
cbers2stac/populate_reconcile_queue/code.py
code.py
py
1,569
python
en
code
12
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cbers2stac.laye...
28959321871
# -*- coding: utf-8 -*- import json import re import time from ..base.multi_downloader import MultiDownloader class AlldebridCom(MultiDownloader): __name__ = "AlldebridCom" __type__ = "downloader" __version__ = "0.66" __status__ = "testing" __pattern__ = r"https?://(?:\w+\.)?(?:alldebrid\.com|d...
pyload/pyload
src/pyload/plugins/downloaders/AlldebridCom.py
AlldebridCom.py
py
6,004
python
en
code
3,038
github-code
18
[ { "api_name": "base.multi_downloader.MultiDownloader", "line_number": 10, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 58, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 70, "usage_type": "call" }, { "api_name": "re.search...
35771407934
import pandas as pd import matplotlib.pyplot as plt # Read the spreadsheet df = pd.read_csv("downloads.csv", header=None, names=["Date", "Downloads"]) df["Date"] = pd.to_datetime(df["Date"]) # Plot the download data plt.figure(figsize=(10, 6)) plt.plot(df["Date"], df["Downloads"]) plt.title("Downloads Over Time") plt...
micahflee/hacks-leaks-and-revelations
.github/workflows/downloads/plot.py
plot.py
py
389
python
en
code
50
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.p...
24772164617
import requests, json from bs4 import BeautifulSoup from datetime import datetime def get_cs_notice(row, logger): _id, last_num = row['id'], row['last_num'] result = [] URL_list = ["http://cs.skku.edu/ajax/board/view/notice/", "http://cs.skku.edu/ajax/board/view/news/", "http://cs.skku.edu/aj...
dlsrb6342/crawl_notice
cs.py
cs.py
py
1,883
python
en
code
1
github-code
18
[ { "api_name": "requests.post", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.codes", "line_number": 18, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 24, "usage_type": "call" }, { "api_name": "json.loads", "line_n...
5653715918
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 14 11:51:09 2020 @author: apurvabadithela """ import networkx as nx from networkx.algorithms.flow import shortest_augmenting_path, edmonds_karp import sys sys.path.append('../') from src.milp_functions import augment_paths, min_cut_edges from src.r...
abadithela/NFM2021_Static_Test_Synthesis
examples/simple_automaton.py
simple_automaton.py
py
1,362
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "networkx.DiGraph", "line_number": 18, "usage_type": "call" }, { "api_name": "src.milp_functions.aug...
73310028519
from __future__ import print_function import httplib2 import os from apiclient import discovery import oauth2client from oauth2client import client from oauth2client import tools import json courses_filename = "courses.json" courseCalendarID = "ucdavis.edu_t1v777vkdgdrrd1s1doltuvtd4@group.calendar.google.com" try: ...
calvin-li/course-adder
adder.py
adder.py
py
3,150
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "oauth2client.tools.argparser", "line_number": 17, "usage_type": "attribute" }, { "api_name": "oauth2client.tools", "line_number": 17, "usage_type": "name" }, { "api_...
16129821314
#!/usr/bin/env python3 from argparse import ArgumentParser from functools import reduce import json import os def add(a, b): return a + b def get_file_statistics(file): with open(file, 'r') as f: content = json.loads(f.read()) return { 'filename': os.path.basename(file), ...
kbence/d3-playground
scripts/generate-index.py
generate-index.py
py
1,120
python
en
code
0
github-code
18
[ { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "functools.reduce", "line...
12119615040
import socket import threading import argparse def receive_messages(client_socket): while True: try: message = client_socket.recv(1024).decode('utf-8') print(message) except ConnectionResetError: print("Disconnected from the server.") break def mai...
vladsendrix/gochat
client/client.py
client.py
py
1,120
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 27, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 27, "usage_type": "attribute" }, { "api_name": "socket.SOCK...
16052319795
#!/usr/bin/env python3 ''' ***************************************************************************************** * * =============================================== * HolA Bot (HB) Theme (eYRC 2022-23) * =============================================== * * This script should be us...
Dhruvacube/task0
src/eYRC-2022_HolA_Bot/eyrc-2022_holabot/scripts/task_0.py
task_0.py
py
7,965
python
en
code
0
github-code
18
[ { "api_name": "rospy.init_node", "line_number": 47, "usage_type": "call" }, { "api_name": "rospy.Publisher", "line_number": 50, "usage_type": "call" }, { "api_name": "geometry_msgs.msg.Twist", "line_number": 50, "usage_type": "argument" }, { "api_name": "rospy.Sub...
39065043759
import pygame import random from pygame.locals import ( K_UP, K_DOWN, K_RIGHT, K_LEFT, K_ESCAPE, QUIT, KEYDOWN, ) pygame.init() myfont = pygame.font.Font("freesansbold.ttf", 60) myfont40 = pygame.font.Font("freesansbold.ttf", 40) myfont80 = pygame.font.Font("freesansbold.tt...
ShrihanSolo/personalprojects
mancala.py
mancala.py
py
11,111
python
en
code
0
github-code
18
[ { "api_name": "pygame.init", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.font.Font", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pygame.font.Font", ...
34850744501
""" Module containing the SinusoidalPositionalEmbedding option, which creates a sinusoidal relationship between a token and its position """ import logging from rich.logging import RichHandler LOG_FORMAT = "%(message)s" logging.basicConfig(level="INFO", format=LOG_FORMAT, datefmt="[%X] ", handlers=[RichHandler()]) LO...
yext/annotated-mpnet
annotated_mpnet/transformer_modules/sinusoidal_positional_embedding.py
sinusoidal_positional_embedding.py
py
5,431
python
en
code
2
github-code
18
[ { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "rich.logging.RichHandler", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "torch....
30916762238
import base64 import hashlib import hmac import requests import time import json from rest_framework.exceptions import ValidationError from Troy.settings import base from apps.oauth.models import Auth class GoogleService(object): def __init__(self): self.google_id_token_info_url = 'https://www.googleapi...
soheeeeP/troy-ptservice-drf-backend
api/oauth/services.py
services.py
py
3,737
python
en
code
0
github-code
18
[ { "api_name": "requests.post", "line_number": 25, "usage_type": "call" }, { "api_name": "rest_framework.exceptions.ValidationError", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 41, "usage_type": "call" }, { "api_name": ...
20014138269
from django.db import models from tumblr.base_model import BaseManager, BaseModel from apps.blog.models import Post class TagsManager(BaseManager): def posts_with_tags(self, tags, post_count, user=False): end_count = post_count + 10 tag_list = [] split_tags = tags.replace('+', ' ').split(' ') for ...
DimosGu/tumblr
apps/search/models.py
models.py
py
1,500
python
en
code
0
github-code
18
[ { "api_name": "tumblr.base_model.BaseManager", "line_number": 5, "usage_type": "name" }, { "api_name": "apps.blog.models.Post.objects.exclude", "line_number": 22, "usage_type": "call" }, { "api_name": "apps.blog.models.Post.objects", "line_number": 22, "usage_type": "attr...
6093676175
import numpy as np from numpy.random.mtrand import f from scipy.spatial.transform import Rotation as R # function for the identification of closest center of atoms within a 7Å radius def find_closest_centroid(mol, i_point, rad=7): neigh = [] for e in mol: rf = np.linalg.norm(e-i_point) if rf <...
micheleassante/ESPlace
explicit_solv_mod.py
explicit_solv_mod.py
py
3,835
python
en
code
0
github-code
18
[ { "api_name": "numpy.linalg.norm", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "li...
18807321050
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from torchvision import datasets, transforms from utils import weights_init_xavierUniform as weights_init import math class Flatten(nn.Module): def forward(self, input): return input.view(input.size(0), -1) ...
EKELE-NNOROM/Augmenting-DAgger-with-Recurrence-and-Attention
blocks.py
blocks.py
py
4,457
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "li...
41458525230
# -*- coding: utf-8 -*- """ Created on Fri Dec 9 22:35:50 2022 @author: RJ """ import pandas as pd import numpy as np import matplotlib.pyplot as plt def read_file(fname): """This function is used to read the file and return the transpose the file and data.""" data = pd.read_excel(fname) dtranspos...
rosejipson/ADS1-Assignment-2
Assignment 2.py
Assignment 2.py
py
4,086
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_excel", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 64, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 64, "usage_type": "name" }, { "api_name": "matplotl...
3858049378
from cgi import test from tkinter.ttk import Progressbar from tkinter import * from PIL import ImageTk, Image from numpy import imag w=Tk() #Indicamos las dimensiones y posicion inicial del la pantalla de carga width_of_window = 427 height_of_window = 250 screen_width = w.winfo_screenwidth() screen_height = w.winfo_s...
NestorGH/Face_mask_detector
splash_screen_gui.py
splash_screen_gui.py
py
2,477
python
en
code
0
github-code
18
[ { "api_name": "tkinter.ttk.Progressbar", "line_number": 25, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 58, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 82, "usage_type": "call" }, { "api_name": "PIL.Image", "li...
26544419930
import os import torch import torch.nn as nn import torch.optim as optim from torch.optim.lr_scheduler import ReduceLROnPlateau from .models.Graph2Search import Graph2Search from .utils.vocab_utils import VocabModel from .utils import constants as Constants from .utils.generic_utils import create_mask, to_cuda from .la...
shangqing-liu/GraphSearchNet
graph-based-search/graph_search_nn/src/core/model.py
model.py
py
11,576
python
en
code
25
github-code
18
[ { "api_name": "models.Graph2Search.Graph2Search", "line_number": 21, "usage_type": "name" }, { "api_name": "utils.vocab_utils.VocabModel.build", "line_number": 26, "usage_type": "call" }, { "api_name": "utils.vocab_utils.VocabModel", "line_number": 26, "usage_type": "name...
22493702431
import numpy as np from matplotlib import pyplot as plt from multiprocessing import Pool import time def timestep_i(args): """Computes the next position and velocity for the ith mass """ i, x0, v0, G, m, dt = args a_i0 = a(i, x0, G, m) v_i1 = a_i0 * dt + v0[i] x_i1 = a_i0 * dt**2 + v0[i] * dt + x0[i] return i, ...
jieyanzhu/codes-effective-computation-in-physics
chap_12/n-body-multiprocessing.py
n-body-multiprocessing.py
py
1,873
python
en
code
1
github-code
18
[ { "api_name": "numpy.sum", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.newaxis", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.empty", "line_number...
27100615168
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('skills', '0001_initial'), ] operations = [ migrations.AddField( model_name='skill', name='alias', ...
infojasyrc/my-agenda
apps/skills/migrations/0002_skill_alias.py
0002_skill_alias.py
py
400
python
en
code
0
github-code
18
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
8009822355
from __future__ import annotations import typing as t from django.http import HttpResponseRedirect from django.utils import timezone from django.shortcuts import render, get_object_or_404 from django.urls import reverse as reverse_url from django.db.models import F if t.TYPE_CHECKING: from django.http import Htt...
LEv145/django-polls
polls/views.py
views.py
py
2,063
python
en
code
0
github-code
18
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.http.HttpRequest", "line_number": 18, "usage_type": "name" }, { "api_name": "models.Question.objects.filter", "line_number": 23, "usage_type": "call" }, { "...
2444537775
from bs4 import BeautifulSoup import requests, openpyxl excel = openpyxl.Workbook() sheet = excel.active sheet.title = 'F1 Drivers 2022' sheet.append(['Given Name', 'Family Name', 'Permanent Number', 'Nationality']) try: source = requests.get('http://ergast.com/api/f1/2022/drivers') source.raise_for_status() ...
AsifSyeed/ScrapF1
scrapf1.py
scrapf1.py
py
782
python
en
code
0
github-code
18
[ { "api_name": "openpyxl.Workbook", "line_number": 4, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" } ]
6219234617
from common.log import logger from datahub.access.exceptions import CollectorError, CollerctorCode from datahub.access.handlers import CcHandler from datahub.access.models import ( AccessManagerConfig, AccessScenarioConfig, AccessScenarioStorageChannel, DatabusChannelClusterConfig, ) from datahub.access...
Tencent/bk-base
src/api/datahub/access/utils/init.py
init.py
py
3,395
python
en
code
85
github-code
18
[ { "api_name": "datahub.access.models.DatabusChannelClusterConfig.objects.filter", "line_number": 15, "usage_type": "call" }, { "api_name": "datahub.access.models.DatabusChannelClusterConfig.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "datahub.access.mo...
21298941452
import gmsh import argparse import math parser = argparse.ArgumentParser(description="Input arguments") parser.add_argument("input", metavar="input", type=str, help="Path to mesh") parser.add_argument("output", metavar="output", type=str, help="Output path") parser.add_argument(...
gerrygralton/consistent_stl
consistent_stl.py
consistent_stl.py
py
1,074
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "gmsh.initialize", "line_number": 18, "usage_type": "call" }, { "api_name": "gmsh.clear", "line_number": 19, "usage_type": "call" }, { "api_name": "gmsh.option.setNumb...
9468528753
from app.constants import SEASON from app.enums import CharacterClass, Server from app.extensions import db from app.models import (FinishedMatch, FinishedMatchParticipant, Player, PlayerStatistics, RunningMatch) from flask import Blueprint, abort, request, jsonify from flask.globals import cur...
HealYouDown/flo-league
app/blueprints/main/views.py
views.py
py
7,230
python
en
code
1
github-code
18
[ { "api_name": "flask.Blueprint", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.templating.render_template", "line_number": 19, "usage_type": "call" }, { "api_name": "flask_babel.gettext", "line_number": 20, "usage_type": "call" }, { "api_name": "...
40430802494
from flask import Flask, render_template, request from textblob import TextBlob app = Flask(__name__) @app.route('/', methods = ['GET', 'POST']) def index(): if(request.method == 'GET'): return render_template('sentiment.html') else: text = request.form.get('text') polarity = TextBlob...
mukulvain/Attendance-System
app.py
app.py
py
529
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.render_templat...
4038279456
# Jamie Pospishil # Version 3.6 # 2019-04-08 import pygame import glob import os debug = False class SFX: mixer_channels = 16 # starting with 16 for mixer_channels, this can be increased if we need to number_of_reserved_sound_channels = 2 # channels 0 - 1 are reserved for possible future use # ...
fiercepatty/Illuminate
Illuminate/audio_sfx_player.py
audio_sfx_player.py
py
15,648
python
en
code
0
github-code
18
[ { "api_name": "pygame.mixer", "line_number": 47, "usage_type": "attribute" }, { "api_name": "pygame.mixer.music.load", "line_number": 53, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 53, "usage_type": "attribute" }, { "api_name": "pygame.mi...
32581576341
import math from random import choice import pygame import pygame.draw as p import numpy as np from random import randint RED = (255, 0, 0)#блок задания цветовой гаммы мячей BLUE = (0, 0, 255) YELLOW = (255, 255, 0) GREEN = (0, 255, 0) MAGENTA = (255, 0, 255) CYAN = (0, 255, 255) BLACK = (0, 0, 0) WHITE = (255, 255, 2...
infa2021Chikalkin/infa_2021_Chikalkin
lab5/lab5part2.py
lab5part2.py
py
34,907
python
ru
code
0
github-code
18
[ { "api_name": "pygame.Surface", "line_number": 39, "usage_type": "attribute" }, { "api_name": "numpy.cos", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 46, "usage_type": "attribute" }, { "api_name": "pygame.draw.circle", ...
22437373735
# -*- coding: utf-8 -*- """ Created on Mon Sep 7 19:21:21 2020 @author: joamat """ import pandas as pd import json import requests import functions.videos as videos def callAPI(key, channelId, order): return requests.get('https://www.googleapis.com/youtube/v3/search', params={ ...
jose-amat/python-youtube-comments
functions/search.py
search.py
py
1,460
python
en
code
3
github-code
18
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "functions.videos.statistics", "line_number": 35, "usage_type": "call" }, { "api_name": "functions.videos", "line_number": 35, "usage_type": "name" }, { "api_name": "pandas.Data...
7108091415
import matplotlib.pyplot as plt import numpy as np from sklearn import linear_model from sklearn.metrics import mean_squared_error np.random.seed(0) linear_dataset = range(1000000, 2000001) normal_dataset = np.random.normal(0, 1, 1000000) dataset = {index: value for index, value in enumerate(sorted(normal_dataset))}...
tools4origins/pyli
model.py
model.py
py
749
python
en
code
0
github-code
18
[ { "api_name": "numpy.random.seed", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.random.normal", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", ...
12358409109
import os import os.path import random import sys import logging import time import tornado.websocket import tornado.web import tornado.ioloop from datetime import date, datetime from perspective import Table, PerspectiveManager, PerspectiveTornadoHandler class StaticHandler(tornado.web.StaticFileHandler): def se...
sc1f/perspective-python-editable
server.py
server.py
py
2,255
python
en
code
1
github-code
18
[ { "api_name": "tornado.websocket.web", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tornado.websocket", "line_number": 13, "usage_type": "name" }, { "api_name": "tornado.websocket.web", "line_number": 20, "usage_type": "attribute" }, { "api_name"...
75430919080
import cv2 as cv import numpy as np import time # 이미지 불러오기 path = "C:/Users/DELL/PycharmProjects/Object-detection/image/test_shelf_resized.jpg" img = cv.imread(path, cv.IMREAD_COLOR) img_gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) # shape : (600, 900) ret,thresh4 = cv.threshold(img_gray,127,255,cv.THRESH_TOZERO) # 책장 ...
flashwoman/Object-detection
Reference/Bookshelf/OpenCV_HarrisCornerDetection.py
OpenCV_HarrisCornerDetection.py
py
3,983
python
en
code
1
github-code
18
[ { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "...
40135478318
from jax._src.prng import _bit_stats from jax._src.tree_util import tree_structure from jax.experimental.stax import Dense import neural_tangents as nt from neural_tangents import stax import matplotlib.pyplot as plt import jax.numpy as np from seaborn.utils import saturate from tqdm import tqdm from jax import rando...
kitakou0313/jaxStudy
ntk.py
ntk.py
py
10,546
python
en
code
0
github-code
18
[ { "api_name": "seaborn.set_style", "line_number": 22, "usage_type": "call" }, { "api_name": "seaborn.set", "line_number": 23, "usage_type": "call" }, { "api_name": "jax.numpy.reshape", "line_number": 28, "usage_type": "call" }, { "api_name": "jax.numpy", "line...
8330080405
#======================================================================================================================= # This file traines a Convolutional neural network (CNN) and a Multi layer perceptron (MLP) neural network # using training features generated in script 02 # Model weights will be saved in weights/ f...
smg478/UrbanRadiation
03_train_ANN_CNN.py
03_train_ANN_CNN.py
py
6,637
python
en
code
10
github-code
18
[ { "api_name": "numpy.random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 30, "usage_type": "attribute" }, { "api_name": "sys.argv", "lin...
24101695572
import asyncio from typing import List, Optional from sqlalchemy import ForeignKey, String, select from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine from sqlalchemy.orm import Mapped, joinedload, mapped_column, relationship from sqlorm.core import Base engine = create_async_engine("sqlite+ai...
codemation/sqlantic
tests/test_models.py
test_models.py
py
2,597
python
en
code
0
github-code
18
[ { "api_name": "sqlalchemy.ext.asyncio.create_async_engine", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.asyncio.async_sessionmaker", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlorm.core.Base", "line_number": 17, "usage_type": ...
28085908364
import unittest from selenium import webdriver import os import time # (十五)文件上传 class baiduSearch(unittest.TestCase): def setUp(self): # self.driver = webdriver.PhantomJS(executable_path="C:\\phantomjs.exe") self.driver = webdriver.Chrome(executable_path="C:\\chromedriver.exe") self.drive...
wallaceok/python3_test
org/web/test11.py
test11.py
py
1,242
python
zh
code
0
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "os...