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
43395551195
#ncat listener to open a socket and get the words from pyspark.sql import SparkSession from pyspark.sql.functions import expr if __name__ == "__main__": spark = SparkSession \ .builder \ .appName("streaming word count") \ .config("spark.streaming.stopGracefullyOnShutdown","true") \ ...
pchavan14/spark-structured-streaming
spark_word_count.py
spark_word_count.py
py
1,411
python
en
code
0
github-code
18
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 7, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 7, "usage_type": "...
71426681000
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV fil...
aorursy/new-nb-3
fraserew_fork-of-covid-week-3-lstm.py
fraserew_fork-of-covid-week-3-lstm.py
py
7,858
python
en
code
0
github-code
18
[ { "api_name": "os.walk", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number"...
71427314600
# This Python 3 environment comes with many helpful analytics libraries install # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in import numpy as np # linear algebra import pandas as pd # data processing, CSV file ...
aorursy/new-nb-3
ignotus09_house-price-prediction.py
ignotus09_house-price-prediction.py
py
7,636
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 54, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.int64", "line_nu...
30794923903
import argparse import socket def scan_port(host, port): # Create a socket object sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(1) # Connect to the server result = sock.connect_ex((host, port)) # Close the socket sock.close() return result == 0 # Parse com...
philocypher/Port-Scanner
port_scanner.py
port_scanner.py
py
933
python
en
code
0
github-code
18
[ { "api_name": "socket.socket", "line_number": 6, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 6, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 6, "usage_type": "attribute" }, { "api_name": "argparse.Argum...
29136073603
"""empty message Revision ID: 757b49c77662 Revises: 6af3389a2870 Create Date: 2018-12-03 11:40:36.775188 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '757b49c77662' down_revision = '6af3389a2870' branch_labels = None depends_on = None def upgrade(): # ...
ochi96/biashara-hub
migrations/versions/757b49c77662_.py
757b49c77662_.py
py
678
python
en
code
0
github-code
18
[ { "api_name": "alembic.op.create_index", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.f", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op.drop_index...
7213853975
from models.rnn import Zhang import utils.functions as f import numpy as np import cupy as cp import matplotlib.pyplot as plt from models.runner import test from utils.visualize import calc_ratemap, plot_ratemap dim = 1 B = 100 T = 1000 joystick = False visualize = True # env and agent if dim == 1: from envs.env...
liuyuezhang/nsi
cann.py
cann.py
py
2,668
python
en
code
2
github-code
18
[ { "api_name": "envs.env.Env", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 19, "usage_type": "attribute" }, { "api_name": "envs.agent.GaussMomentumAgent", "line_number": 23, "usage_type": "call" }, { "api_name": "envs.arena.A...
8485110388
"""Upload img in Blog Revision ID: c2c7704dbc13 Revises: d1add5e3e65e Create Date: 2017-06-27 10:41:26.856029 """ # revision identifiers, used by Alembic. revision = 'c2c7704dbc13' down_revision = 'd1add5e3e65e' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import JSON field = ...
Scifabric/pybossa
alembic/versions/c2c7704dbc13_upload_img_in_blog.py
c2c7704dbc13_upload_img_in_blog.py
py
559
python
en
code
730
github-code
18
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
28316312342
from helpers.http_wrapper import https_get from helpers.payload import Payload import json import time import logging URL_TEMPLATE = "https://graph.microsoft.com/v1.0/me/drive/root:{0}:/children" RETRY_WAIT = 5 #In case of potentially recoverable error the time lapse between tries ## This will list all the files def...
hugomcruz/onedrive-simple-sdk-python
src/operations/list.py
list.py
py
4,875
python
en
code
1
github-code
18
[ { "api_name": "logging.debug", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 17, "usage_type": "call" }, { "api_name": "helpers.http_wrapper.https_get", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.de...
34907915148
import argparse parser = argparse.ArgumentParser() parser.add_argument('--input_pdb', metavar='PATH', default=None, help='initialize first 2 GNN layers with pretrained weights') parser.add_argument('--output_pt', metavar='PATH', default=None, help='evaluate a trained mod...
iobio-zjut/PAthreader
PAthreader_main/Run_file/Read_SS.py
Read_SS.py
py
1,276
python
en
code
3
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.set_printoptions", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 15, "usage_type": "attribute" } ]
3138154350
import requests from flask import Flask, render_template, request from bs4 import BeautifulSoup """ When you try to scrape reddit make sure to send the 'headers' on your request. Reddit blocks scrappers so we have to include these headers to make reddit think that we are a normal computer and not a python script. How ...
RainDrop-100603/JustStudy
study/nomad-coder/python-web_scarpper/challenge/chg11-12/main.py
main.py
py
2,508
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 42, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 43, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 75, "usage_type": "call" }, { "api_name": "flask.render_template", ...
15814561386
from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass import logging from typing import Final from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, BinarySensorEntityDescription, ) from homeassistant.config_ent...
BHSPitMonkey/homeassistant-garmin-mapshare
custom_components/garmin_mapshare/binary_sensor.py
binary_sensor.py
py
3,233
python
en
code
1
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "homeassistant.components.binary_sensor.BinarySensorEntityDescription", "line_number": 25, "usage_type": "name" }, { "api_name": "collections.abc.Callable", "line_number": 28, "usa...
32020302462
import platform from configparser import ConfigParser import os from os.path import dirname, abspath # Settings parser = ConfigParser() fileConfig = os.path.join(dirname(abspath(__file__)), "settings.ini") parser.read(fileConfig) ffmpegConf = parser["GENERAL"]["ffmpeg"] DemConf = parser["GENERAL"]["DTM_fil...
All4Gis/QGISFMV
code/QgsFmvConstants.py
QgsFmvConstants.py
py
1,641
python
en
code
130
github-code
18
[ { "api_name": "configparser.ConfigParser", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", ...
42571364616
import tabulator import json import re from pathlib import Path fp = re.compile('\w+', re.UNICODE) def fingerprint(x): return ''.join(fp.findall(x.upper())) if __name__ == '__main__': # How to get places.csv from a nominatim server? # # kubectl exec -it nominatim-5d6889fd59-lxps7 -- su nominatim -c "psql...
hasadna/avid-covider
tools/process_places.py
process_places.py
py
2,483
python
en
code
23
github-code
18
[ { "api_name": "re.compile", "line_number": 6, "usage_type": "call" }, { "api_name": "re.UNICODE", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tabulator.Stream", "line_number": 17, "usage_type": "call" }, { "api_name": "tabulator.Stream", "lin...
20805711199
import sys import paho.mqtt.client as mqtt import time import threading from Crypto.Cipher import AES import base64 # https://www.itread01.com/content/1547711886.html class prpcrypt(): def __init__(self, key): self.key = key self.mode = AES.MODE_CBC def encrypt(self,...
Yukinarii/Wireless-Sensor-Network
Lab6/downlink/publish.py
publish.py
py
1,702
python
en
code
0
github-code
18
[ { "api_name": "Crypto.Cipher.AES.MODE_CBC", "line_number": 13, "usage_type": "attribute" }, { "api_name": "Crypto.Cipher.AES", "line_number": 13, "usage_type": "name" }, { "api_name": "Crypto.Cipher.AES.new", "line_number": 20, "usage_type": "call" }, { "api_name"...
41944524670
import warnings import numpy from ..utilities.extractParams import * from datetime import datetime def getSampleMetadataFromWatersRawFiles(rawDataPath): """ Get acquisition metadata from Waters RAW files and returns them as a dataframe :param str rawDataPath: Path to folder of raw data """ # Get the paramters a...
vallywu/Study3
nPYc-Toolbox-master_small molecules/nPYc/utilities/_getMetadataFromWatersRaw.py
_getMetadataFromWatersRaw.py
py
1,560
python
en
code
0
github-code
18
[ { "api_name": "numpy.nan", "line_number": 20, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "name" }, { "api_name": "warnings....
28418744849
from django.db import models from django.utils.translation import gettext_lazy as _ from django.contrib.auth.models import AbstractUser # custom user model class User(AbstractUser): first_name = models.CharField( _("first name"), max_length=30, ) last_name = models.CharField( _("...
paulgirmes/P13
frontpage/models.py
models.py
py
2,506
python
en
code
0
github-code
18
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 10, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { ...
26652628039
import numpy as np import tensorflow as tf import random import time from sklearn.metrics import confusion_matrix from models.CNNModels import Net from utils import log, extract_minibatch from config.config import DEFAULT_LOG_ENV, NB_OF_EPOCHS_FOR_BAYESIAN def train_model(X, Y, valX, valY, net: Net, ...
echo5india/DeepLearningAllocationCNN
models/training.py
training.py
py
8,756
python
en
code
0
github-code
18
[ { "api_name": "models.CNNModels.Net", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 60, "usage_type": "call" }, { "api_name": "tensorflow.reset_default_g...
25101302259
#!/usr/bin/python3 import glob, hashlib, json, yaml bishop_working_dict = {"all": []} wordlist_working_dict = {"all": []} files = glob.glob("./sources/**/*.yml", recursive=True) def bishop_append(title, entry, source_class): global bishop_working_dict # allow for unvalidate-able sources to be added to word...
tweedge/websights
compile.py
compile.py
py
2,551
python
en
code
4
github-code
18
[ { "api_name": "glob.glob", "line_number": 7, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 26, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 27, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 6...
22098815815
import json from typing import Sequence from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardRemove, ReplyKeyboardMarkup from telegram.ext import ContextTypes, CallbackContext, ConversationHandler, CommandHandler, CallbackQueryHandler, MessageHandler, filters from Constants.NumericCon...
leonardof02/guagua-uci-pr
Controllers/ReservationController/ReservationController.py
ReservationController.py
py
6,959
python
en
code
0
github-code
18
[ { "api_name": "telegram.Update", "line_number": 20, "usage_type": "name" }, { "api_name": "telegram.ext.ContextTypes.DEFAULT_TYPE", "line_number": 20, "usage_type": "attribute" }, { "api_name": "telegram.ext.ContextTypes", "line_number": 20, "usage_type": "name" }, { ...
40254881873
# vizualizace vzorkovaci frekvence import numpy as np import matplotlib.pyplot as plt # vytvoreni datovych vektoru x = np.linspace(0, 10 * np.pi, 1000) y = np.sin(x) # pole nasobku pi pro upraveni f_vz consts = [2.1, 1, 0.2] # smycka pro vypocet a vykresleni 3 datovych rad for i in range(3): f_x = [] f_y = [...
pavelkulich/vut_python
200401_microgeometry/aliasing.py
aliasing.py
py
946
python
en
code
0
github-code
18
[ { "api_name": "numpy.linspace", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.sin", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 20...
24469816616
from flask import Flask,redirect,url_for,render_template,request import numpy as np import pickle import sklearn import os file_path = 'amit.pkl' if os.path.isfile(file_path): print("File exists") else: print("File does not exist") model = pickle.load(open('amit.pkl', 'rb')) app = Flask(__name__) @app....
yuvraj-solanki-2406/cure-for-sure
ml-devprohets/app.py
app.py
py
936
python
en
code
0
github-code
18
[ { "api_name": "os.path.isfile", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number"...
39121165405
try: import os import json import glob import argparse import random import numpy as np from scipy import signal as sg from scipy.ndimage.filters import maximum_filter import matplotlib.pyplot as plt import matplotlib.image as mpimg import scipy.misc from PI...
channamakover/Mobileye-Project
part_2.py
part_2.py
py
3,624
python
en
code
0
github-code
18
[ { "api_name": "random.sample", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 35, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": ...
23087560183
import sys import numpy as np import matplotlib.pyplot as matplot def main(): user_input = sys.stdin.read() global MEM global PC global EE global RF global x_list global y_list global cycle x_list = [] y_list = [] cycle=0 # Memory contains (code + variables) ...
prakhar20394/Assembler_Simulator
SimpleSimulator/main.py
main.py
py
16,490
python
en
code
0
github-code
18
[ { "api_name": "sys.stdin.read", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 8, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 667, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
8254410704
import pandas import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import time # 1 Загрузите набор данных ex1data1.txt из текстового файла. dataFrame = pandas.read_csv("ex1data1.txt", header=None, names=["population", "incomes"]) print(dataFram...
zhyshkevich/ml
zhyshkevich_858341_ml_labs/lab1/lab1.py
lab1.py
py
11,430
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.array"...
18463342509
import matplotlib.pyplot as plt import numpy as np def check(B, y, x): #если мы в пределах картинки и в соседе объект, то возвращаем True if not 0 <= x < B.shape[1]: return False if not 0 <= y < B.shape[0]: return False if B[y, x] != 0: return True return False def neighbo...
L140-beep/two_pass
in.py
in.py
py
4,298
python
ru
code
0
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 72, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_numb...
22746704832
import numpy as np import matplotlib.pyplot as plt import matplotlib LW = 3 MS = 8 FS = 22 lightGray = "#D0D0D0" lightOrange = '#FFC29B' matplotlib.rcParams['axes.linewidth'] = 3.5 #set the value globally targ_dir = ['211123_lstm_tskone_direct_0_05hu_lr2.00e-2','211123_lstm_tskone_context_0_05hu_lr9.00e-4'] ccs = [] ...
liukts/tskone-eeg
plot_data.py
plot_data.py
py
504
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.rcParams", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.load", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib...
10160703320
import numpy as np import pyaudio # Set up the audio stream p = pyaudio.PyAudio() stream = p.open(format=pyaudio.paFloat32, channels=1, rate=44100, output=True) # Define the pentatonic scale frequencies pentatonic_scale = [261.63, 293.66, 329.63, 392.00, 440.00, 523.25]...
adamstirtan/pypentatonic
pentatonic.py
pentatonic.py
py
691
python
en
code
0
github-code
18
[ { "api_name": "pyaudio.PyAudio", "line_number": 5, "usage_type": "call" }, { "api_name": "pyaudio.paFloat32", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.sin", "...
27249022564
import os import shutil import unittest from http.server import HTTPServer from threading import Thread from tests.sandbox_server import RequestHandler from sitemap_generator.crawler import SitemapGenerator from tests.variables import host, port, expected_sitemap class TestCase(unittest.TestCase): def setUp(se...
eteamin/sitemap-generator
tests/test_crawler.py
test_crawler.py
py
1,221
python
en
code
1
github-code
18
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "threading.Thread", "line_number": 16, "usage_type": "call" }, { "api_name": "tests.variables.host", "line_number": 18, "usage_type": "argument" }, { "api_name": "test...
33269538294
import os import cv2 import math import operator import numpy as np import pandas as pd from matplotlib import image from numpy.random import randint # GLCM libs from skimage.feature import greycoprops from skimage.feature import greycomatrix from sklearn.model_selection import StratifiedShuffleSplit from sklearn.sv...
marcin-jasinski/uczenie_maszyn
um_svm.py
um_svm.py
py
6,274
python
en
code
0
github-code
18
[ { "api_name": "sklearn.metrics.f1_score", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.metrics", "line_number": 26, "usage_type": "name" }, { "api_name": "imblearn.metrics.geometric_mean_score", "line_number": 30, "usage_type": "call" }, { "ap...
34544915714
import argparse import cv2 from matplotlib import pyplot as plt ap = argparse.ArgumentParser() ap.add_argument("-i", "--image", required=True, help="input image's path") args = vars(ap.parse_args()) # load the image image = cv2.imread(args["image"]) # convert to grayscale gray = cv2.cvtColor(image,...
appknox/imager
imager.py
imager.py
py
1,512
python
en
code
8
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", ...
37619020889
from flask import Flask, render_template,request import socket app = Flask(__name__) @app.route('/') def mainfunc(): hostName = socket.gethostname() return render_template('response.html', hostname=hostName, content_type='application/json') if __name__ == '__main__': app.run(host='0.0.0.0', debug=...
saadnaeem-dev/Haproxy-Docker-Flask-Application
flaskApp.py
flaskApp.py
py
325
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "socket.gethostname", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" } ]
18825309080
import json # define the username of the user whose visits we want to increment def update_user_in_file(username): # read the data from the file with open('./data/users.json', 'r') as f: users = json.load(f) # find the user in the list for user in users: if user["username"] == userna...
Daniel-Modilevsky/devops_practice_ex
utils/utils.py
utils.py
py
638
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 20, "usage_type": "call" } ]
19640537622
from typing import Dict, Optional, Tuple import torch from transformers import TransfoXLLMHeadModel from archai.nlp.models.hf_transfo_xl.config_hf_transfo_xl import HfTransfoXLConfig from archai.nlp.models.model_base import ArchaiModel class HfTransfoXL(ArchaiModel): """Huggingface's Transformer-XL standard arc...
Dhruvi-Lodhavia/ECE226-Project
archai/nlp/models/hf_transfo_xl/model_hf_transfo_xl.py
model_hf_transfo_xl.py
py
2,740
python
en
code
0
github-code
18
[ { "api_name": "archai.nlp.models.model_base.ArchaiModel", "line_number": 10, "usage_type": "name" }, { "api_name": "archai.nlp.models.hf_transfo_xl.config_hf_transfo_xl.HfTransfoXLConfig", "line_number": 22, "usage_type": "call" }, { "api_name": "transformers.TransfoXLLMHeadModel...
13915077233
import requests import json def scrape_func(term,offset,limit): api_url = f"https://api.yelp.com/v3/businesses/search?term={term}&location=manhattan&limit={limit}&offset={offset}" payload={} headers = { 'Authorization': '<api-key>' } response = requests.request("GET", api_url, headers=headers...
ramanarayanan-98/cloud-aws-assignment1
other_utilities/scrape-yelp-restaurants.py
scrape-yelp-restaurants.py
py
1,263
python
en
code
0
github-code
18
[ { "api_name": "requests.request", "line_number": 12, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "json.dump", "line_number": ...
24206011004
import logging __author__ = "Miguel Angel Muñoz González (magonzalez at fortinet.com)" __copyright__ = "Copyright 2018, Fortinet, Inc." __credits__ = "Miguel Angel Muñoz" __license__ = "Apache 2.0" __version__ = "0.6" __maintainer__ = "Miguel Ángel Muñoz" __email__ = "magonzalez at fortinet.com" __status__ = "Developm...
fortinet-solutions-cse/netconf-rest
yang2rest/yang2restconverter.py
yang2restconverter.py
py
4,992
python
en
code
6
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" } ]
24703287094
############################################ #author : Debajyoti0-0 #version: 1.0.0 #Github : https://github.com/Debajyoti0-0/ ############################################ import nmap import requests import os import socket import subprocess from urllib.pars...
Debajyoti0-0/Brahmastra
Brahmastra.py
Brahmastra.py
py
24,262
python
en
code
6
github-code
18
[ { "api_name": "os.system", "line_number": 24, "usage_type": "call" }, { "api_name": "banner.banner", "line_number": 25, "usage_type": "call" }, { "api_name": "colorizor.COLOR.YELLOW", "line_number": 26, "usage_type": "attribute" }, { "api_name": "colorizor.COLOR",...
10434755233
import pdb import shutil import argparse from glob import glob from tqdm import tqdm from typing import Tuple from copy import deepcopy from collections import OrderedDict from multiprocessing.pool import Pool import numpy as np import nibabel as nib import SimpleITK as sitk import scipy.stats as ss from skimage impor...
Tabrisrei/ISLES22_SEALS
recover_softmax.py
recover_softmax.py
py
5,622
python
en
code
6
github-code
18
[ { "api_name": "glob.glob", "line_number": 33, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 34, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 35, "usage_type": "call" }, { "api_name": "SimpleITK.sitkLinear", "line_number...
12177783769
# https://leetcode.com/problems/majority-element/submissions/ from collections import defaultdict class Solution: def majorityElement(self, nums: List[int]) -> int: cache = defaultdict(lambda: 0) for x in nums: cache[x] += 1 if cache[x] > len(nums) / 2: retu...
mathurk29/leetcode
array/majority-element.py
majority-element.py
py
485
python
en
code
0
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" } ]
10321726720
"""Handles communication on the backend side between frontend and backend Please keep this file Python 2.7 compatible. See https://tox.readthedocs.io/en/rewrite/development.html#code-style-guide """ from __future__ import print_function import importlib import json import os import sys import traceback class Missin...
tox-dev/pyproject-api
src/pyproject_api/_backend.py
_backend.py
py
4,666
python
en
code
19
github-code
18
[ { "api_name": "importlib.import_module", "line_number": 23, "usage_type": "call" }, { "api_name": "sys.stderr.flush", "line_number": 55, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 55, "usage_type": "attribute" }, { "api_name": "sys.stdout.f...
34541039420
from tkinter import * from selenium import * from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.chrome.webdriver import WebDriver from selenium.webdriver.common.keys import Keys import time from plyer import notification root = Tk() root.title("Ani...
pxlymxrph/Animedoro
animedoro.py
animedoro.py
py
2,052
python
en
code
0
github-code
18
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 18, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 18, "usage_type": "name" }, { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, { "api_name": "plyer.notifica...
18697875712
import collections class Solution: def maxSlidingWindow(self, nums: List[int], k: int) -> List[int]: if not nums or k == 0: return [] deque = collections.deque() # 形成窗口前(无需删除左端元素) for i in range(k): # 维护单调队列的递减性 while deque and deque[-1] < nums[i]...
HiHarryOvO/leetCode
Offer 59 - I. 滑动窗口的最大值.py
Offer 59 - I. 滑动窗口的最大值.py
py
875
python
en
code
0
github-code
18
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
35982556790
import numpy as np import matplotlib.pyplot as plt N=100 dt=0.1 ##stanje [q,p] def kin(stanje,koef): return np.array([stanje[0]+stanje[1]*dt*koef,stanje[1]]) def pot(stanje,koef): return np.array([stanje[0],stanje[1]-stanje[0]*dt*koef]) def s2(stanje): a1=0.5 stanje = kin(stanje,a1) # stanje=...
rahneklemen/vrm
02/1del/01.py
01.py
py
1,210
python
sh
code
1
github-code
18
[ { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 65, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
26988073560
import sys, os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+"/src") import networkx as nx import numpy as np import seaborn as sns import matplotlib.pyplot as plt import pandas as pd from sklearn.linear_model import LogisticRegression import scipy.sparse as sp from models import Snore f...
smeznar/ontology-completion-with-graph-learners
examples/global_explanation.py
global_explanation.py
py
2,292
python
en
code
4
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": "os.path.dirname", "line_number": 2, "usage_type": "call" }, { "api_name": "os.path", "line_number...
24230430825
import subprocess import sys import json from tqdm import tqdm from multiprocessing import Pool # print("Installing necessary libs..") # # Install nltk # subprocess.check_call([sys.executable, "-m", "pip", "install", "nltk"]) # # Install pymystem3 # subprocess.check_call([sys.executable, "-m", "pip", "install", "pymys...
Baltsat/users-rosatom
processing.py
processing.py
py
3,365
python
en
code
1
github-code
18
[ { "api_name": "pymystem3.Mystem", "line_number": 20, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 26, "usage_type": "call" }, { "api_name": "re.UNICODE", "line_number": 31, "usage_type": "attribute" }, { "api_name": "nltk.corpus.stopwords.wor...
8394877124
# -*- coding: utf-8 -*- """ Created on Wed Aug 5 16:29:29 2020 @author: kylab """ import pandas as pd import numpy as np from datetime import datetime class SA_report(): def __init__(self): self.Total_Record_time=0 self.Record_start='' self.Record_end='' self.baseline=0 ...
wenhaohsu/undergrade
py_osa_screening-master/SA_estimate.py
SA_estimate.py
py
7,341
python
en
code
0
github-code
18
[ { "api_name": "pandas.ExcelFile", "line_number": 47, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 65, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 65, "usage_type": "name" }, { "api_name": "pandas....
74604336681
from selenium import webdriver from urllib.request import urlretrieve import requests from lxml import etree from time import sleep import random import string options = webdriver.ChromeOptions() options.add_argument('headless') driver = webdriver.Chrome(chrome_options=options) driver.implicitly_wait(10) headers =...
xietalent/work_code
test/15xigua.py
15xigua.py
py
1,506
python
en
code
0
github-code
18
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 9, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 12, "usage_type": "call" }, { "api_n...
43987719631
# -*- coding: utf-8 -*- from player.parser import * from player.player import * from base.configuration_parser import * from r2a.ir2a import IR2A import timeit import http.client class R2ASara(IR2A): def __init__(self, id): IR2A.__init__(self, id) self.parsed_mpd : mpd_node = '' ...
maldisco/ABR_Sara
r2asara.py
r2asara.py
py
6,523
python
en
code
0
github-code
18
[ { "api_name": "r2a.ir2a.IR2A", "line_number": 9, "usage_type": "name" }, { "api_name": "r2a.ir2a.IR2A.__init__", "line_number": 12, "usage_type": "call" }, { "api_name": "r2a.ir2a.IR2A", "line_number": 12, "usage_type": "name" }, { "api_name": "http.client.client....
6691275744
import socket import struct from collections import defaultdict from conf.const import MAX_TCP_CONNS, UDP_BROADCAST_ADDR def ip2int(addr): return struct.unpack("!I", socket.inet_aton(addr))[0] def int2ip(addr): return socket.inet_ntoa(struct.pack("!I", addr)) def id2str(conn_id): #return int2ip(conn_id ...
NetSys/scl
lib/socket_utils.py
socket_utils.py
py
9,476
python
en
code
3
github-code
18
[ { "api_name": "struct.unpack", "line_number": 8, "usage_type": "call" }, { "api_name": "socket.inet_aton", "line_number": 8, "usage_type": "call" }, { "api_name": "socket.inet_ntoa", "line_number": 11, "usage_type": "call" }, { "api_name": "struct.pack", "line...
5866476013
from tensorflow.keras.preprocessing.image import ImageDataGenerator import numpy as np import pandas as pd from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Conv2D, Flatten from tensorflow.keras.callbacks import EarlyStopping from sklearn.metrics import accuracy_score from tensor...
mkim9002/AIA
keras/keras58_9_dog_breed1_flow_save_npy.py
keras58_9_dog_breed1_flow_save_npy.py
py
2,250
python
en
code
1
github-code
18
[ { "api_name": "tensorflow.keras.preprocessing.image.ImageDataGenerator", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.keras.preprocessing.image.ImageDataGenerator", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_tes...
71926640041
import pymysql import time def ConnectToDB(): return pymysql.connect( host='127.0.0.1', user='root', password='passwd17', port=3306, db='NFL', local_infile=1 ) def getTable(fname): temp = fname.split('/') temp1 = temp[-1] temp = temp1.split('.') ...
Ivan-Nieto/CS482Project
DatabaseMethods.py
DatabaseMethods.py
py
6,816
python
en
code
0
github-code
18
[ { "api_name": "pymysql.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "time.time", "line_number": 32, "usage_type": "call" }, { "api_name": "time.time", "line_number": 38, "usage_type": "call" }, { "api_name": "time.time", "line_number": 56,...
20958852993
#!/usr/bin/env python """ celcombiller AGI: * Consult the user balance and authorize a call * Save the call CDRs * Update the user balance """ # pylint: disable=C0103 from datetime import datetime import asterisk.agi from asterisk.agi import AGIAppError from models import session, User, CDR agi = asterisk....
pedosb/celcombiller
celcombiller.py
celcombiller.py
py
1,059
python
en
code
3
github-code
18
[ { "api_name": "asterisk.agi.agi.AGI", "line_number": 14, "usage_type": "call" }, { "api_name": "asterisk.agi.agi", "line_number": 14, "usage_type": "attribute" }, { "api_name": "asterisk.agi", "line_number": 14, "usage_type": "name" }, { "api_name": "models.sessio...
33078828054
from __future__ import absolute_import from rest_framework.response import Response from sentry import integrations from sentry.api.bases.organization import OrganizationEndpoint from sentry.api.serializers import serialize, IntegrationProviderSerializer from sentry import features from django.conf import settings ...
fictional-tribble-2/getsentry--sentry
src/sentry/api/endpoints/organization_config_integrations.py
organization_config_integrations.py
py
1,924
python
en
code
1
github-code
18
[ { "api_name": "sentry.api.bases.organization.OrganizationEndpoint", "line_number": 13, "usage_type": "name" }, { "api_name": "sentry.features.has", "line_number": 15, "usage_type": "call" }, { "api_name": "sentry.features", "line_number": 15, "usage_type": "name" }, {...
24880039092
from thop import profile from thop import clever_format from torch import nn import torch import torch.nn.functional as F class VIT(nn.Module): """ the full GPT language models, with a context size of block_size """ def __init__(self, d_model, h=8, block_exp=4, n_layer=8, vert_an...
diadestiny/DGT-Faster-RCNN
derain/utils/cal_net_param_flops.py
cal_net_param_flops.py
py
6,904
python
en
code
1
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.Parameter", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
43331789949
from django.urls import path from .views import sudoku_list_view, sudoku_detail_view, home_view, about_view app_name = 'posts' urlpatterns = [ path('home/', home_view, name='home'), path('listall/', sudoku_list_view, name='list'), path('detail/<uuid:pk>/', sudoku_detail_view, name='detail'), path('ab...
mayavy/sudoku
posts/urls.py
urls.py
py
355
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "views.home_view", "line_number": 8, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "views.sudoku_list_...
74608241640
from django.shortcuts import render, get_object_or_404 # Logic operation OR in queries from django.db.models import Q # Paginator Functionality from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator # Local Models from .models import Product # External Models from applications.category.models import C...
kgarmtz/Django-Ecommerce
applications/store/views.py
views.py
py
3,783
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 23, "usage_type": "call" }, { "api_name": "applications.category.models.Category", "line_number": 23, "usage_type": "argument" }, { "api_name": "models.Product.objects.filter", "line_number": 25, "usage_ty...
70645606761
# coding: utf-8 import numpy as np import cv2 import os import random def motion_blur(image, degree=20, angle=45): image = np.array(image) # 这里生成任意角度的运动模糊kernel的矩阵, degree越大,模糊程度越高 M = cv2.getRotationMatrix2D((degree / 2, degree / 2), angle, 1) motion_blur_kernel = np.diag(np.ones(degree)) ...
huangxiao1234/Cascade-Att-DetNet
add_movingNoise.py
add_movingNoise.py
py
1,155
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.getRotationMatrix2D", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.diag", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.ones", "line_...
33237559744
import re import os import sqlite3 import pyttsx3 import subprocess import speech_recognition as sr from scrapy.crawler import CrawlerProcess from required_data.corona_cases.corona.corona.spiders.corona_crawler import CoronaCases def text_to_speech(text): engine = pyttsx3.init() engine.say(text) ...
RaswanthUtham/COVID-19-APP
app/main.py
main.py
py
5,447
python
en
code
0
github-code
18
[ { "api_name": "pyttsx3.init", "line_number": 12, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 18, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 19, "usage_type": "call" }, { "api_name...
11033844965
#!/Users/fynn/.pyenv/eth/bin/python import sys import matplotlib import matplotlib.pyplot as plt import numpy as np def get_moves_per_partition(latencies_path): moves_per_partition = {'1': {}} with open(latencies_path, 'r') as f: for line in f: line = line.split() if line[1] ==...
enriquefynn/move-protocol
burrow-client/logs-processing/plot_tp_synth.py
plot_tp_synth.py
py
7,007
python
en
code
1
github-code
18
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 73, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 73, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ylim", "line_number": 87, "usage_type": "call" }, { "api_name": "m...
14101386459
import datetime # 获取今天日期 n_days = datetime.datetime.now() print(n_days) while True: # 从今天起往前减一天循环 n_days -= datetime.timedelta(days=1) # 获得格式化的时间 str_time = n_days.strftime('%Y%m%d') # 判断数字是否有重复 if len(set(str_time)) == 8: print(str_time) break
Florapie/green-hand
ex_specialBirthday.py
ex_specialBirthday.py
py
353
python
zh
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" }, { "api_name": "datetime.timedelta", "line_number": 7, "usage_type": "call" } ]
14381044238
#!/usr/bin/env python """ setup.py file for SWIG """ from setuptools import setup from setuptools.command.build_ext import build_ext from distutils.core import setup, Extension class BuildExt(build_ext): def build_extensions(self): super(BuildExt, self).build_extensions() test_module = Extensi...
kkhuang81/NIGCN
src/swig_setup.py
swig_setup.py
py
900
python
en
code
0
github-code
18
[ { "api_name": "setuptools.command.build_ext.build_ext", "line_number": 9, "usage_type": "name" }, { "api_name": "distutils.core.Extension", "line_number": 13, "usage_type": "call" }, { "api_name": "distutils.core.setup", "line_number": 19, "usage_type": "call" } ]
70406850601
from django.urls import path, re_path from django.contrib.auth.decorators import login_required # 用于判断用户是否登录的方法 from apps.user.views import RegisterView, ActivateView, LoginView, UserInfoView, UserOrderView, AddressView, LogoutView urlpatterns = [ path('register', RegisterView.as_view(), name="register"), # 注册...
RyanLin1995/python
django/dailyfresh/apps/user/urls.py
urls.py
py
1,734
python
zh
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "apps.user.views.RegisterView.as_view", "line_number": 8, "usage_type": "call" }, { "api_name": "apps.user.views.RegisterView", "line_number": 8, "usage_type": "name" }, { "a...
14170016505
from collections import namedtuple import csv from parsers import * #importa todas las bibliotecas de parsers contenido = namedtuple("contenido","type,title,director,country,co_production,date_added,release_year,duration,description") #type;title;director;country;co_production;date_added;release_year;duration;descript...
tomcrufer/proyecto-de-lectura-del-csv
src/plataforma.py
plataforma.py
py
1,089
python
es
code
0
github-code
18
[ { "api_name": "collections.namedtuple", "line_number": 5, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 10, "usage_type": "call" } ]
13423538745
"""This programe checks whether the input function is continuous at a given point.""" from sympy import Symbol, Limit, sympify, S from sympy.core.sympify import SympifyError def is_continuous(f, var, value): """Checks whether a function is continuous at a point.""" var = Symbol(var) right_limit = Limit(f, var, va...
JullyH0506/Little_programs
Continuous_function.py
Continuous_function.py
py
1,091
python
en
code
0
github-code
18
[ { "api_name": "sympy.Symbol", "line_number": 8, "usage_type": "call" }, { "api_name": "sympy.Limit", "line_number": 10, "usage_type": "call" }, { "api_name": "sympy.Limit", "line_number": 11, "usage_type": "call" }, { "api_name": "sympy.S.Infinity", "line_numb...
17551811876
from django.views.decorators.csrf import csrf_exempt from django.utils.decorators import method_decorator # Layers from ..base_controller import BaseController from src.routes.alarm.alarm_service import AlarmService # Modules from src.modules.factory.dto_factory import DtoFactory # Middleware from src.common.middlew...
MyRefrigerator/server
src/routes/alarm/expired_ingredient_alarm_controller.py
expired_ingredient_alarm_controller.py
py
1,322
python
en
code
0
github-code
18
[ { "api_name": "base_controller.BaseController", "line_number": 15, "usage_type": "name" }, { "api_name": "src.modules.factory.dto_factory.DtoFactory", "line_number": 20, "usage_type": "call" }, { "api_name": "src.routes.alarm.alarm_service.AlarmService", "line_number": 21, ...
15952787110
import pathlib class Orbit: def __init__(self, name, count, parent): self.name = name self.count = count self.parent = parent self.orbiters = [] self.visited = False self.dist = 0 print('Orbit', name) def add_orbiter(self, orbit): print('add_or...
brothhaar/advent-of-code
2019/aoc2019/day06/part1.py
part1.py
py
2,109
python
en
code
0
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 65, "usage_type": "call" } ]
74678341158
from bs4 import BeautifulSoup from prettytable import PrettyTable import re import locale import sys def execute(path): locale.setlocale( locale.LC_ALL, 'en_US.UTF-8' ) team_id = path.split("/")[1] #assumes the caller of this is in cfb_parsers soup = BeautifulSoup(open(path)) tbl = soup.find("table", {"class": ...
alexolsen03/CFB_Analyzer
python/cfb_parsers/parse_index.py
parse_index.py
py
1,522
python
en
code
0
github-code
18
[ { "api_name": "locale.setlocale", "line_number": 8, "usage_type": "call" }, { "api_name": "locale.LC_ALL", "line_number": 8, "usage_type": "attribute" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "locale.atoi", ...
72298285481
import pygame from Config import ANIMATIONSPEED, TRAPSPIKES, TRAPTEST from colors import GREEN from spriteSheet import loadSprites class Platform (pygame.sprite.Sprite): """ Represents a platform in the game. Args: groups (list of pygame.sprite.Group): The groups to add the platform to. ...
MateoBarbato/Lab2Entrega
src/models/Platform.py
Platform.py
py
3,492
python
en
code
0
github-code
18
[ { "api_name": "pygame.sprite", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.Surface", "line_number": 42, "usage_type": "call" }, { "api_name": "pygame.SRCALPHA", "line_number": 42, "usage_type": "attribute" }, { "api_name": "pygame.time.get...
13669455926
#!/usr/bin/env python3 # _*_ coding: utf-8 _*_ import os import numpy as np from time import gmtime from time import strftime from scipy.io import wavfile from python_speech_features import mfcc # make a directory under dir_ if no directory exists for device_id_ # The created directory is dir_/device_i...
aimldl/python
code_samples-ML/ec2-oregon-lid_make_tfrecord/utils.py
utils.py
py
2,099
python
en
code
0
github-code
18
[ { "api_name": "time.strftime", "line_number": 21, "usage_type": "call" }, { "api_name": "time.gmtime", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2...
74873849000
# imports from os.path import join from datetime import date, datetime from argparse import ArgumentParser # third party imports import numpy as np import torch # project imports from src import losses, models, datasets from src.utils.io import DebugWriter, ResultsWriter, create_results_dir, ExperimentWriter, worker_...
acasamitjana/SynthByReg
scripts/Registration/Allen_labels/train.py
train.py
py
4,622
python
en
code
7
github-code
18
[ { "api_name": "src.utils.io.DebugWriter", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 23, "usage_type": "name" }, { "api_name": "datetime.d...
852961687
import argparse import os from tlv.lexer import LEXERS from tlv.tokens import TOKENS RUNARGS = None def ArgParser(): parser = argparse.ArgumentParser( prog="tlv", description='Find code duplications across various languages') parser.add_argument("--minlines", type=int, default=5, ...
priv-kweihmann/tlv
tlv/arg_parser.py
arg_parser.py
py
2,136
python
en
code
9
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "tlv.lexer.LEXERS", "line_number": 19, "usage_type": "name" }, { "api_name": "tlv.tokens.TOKENS", "line_number": 21, "usage_type": "name" }, { "api_name": "os.path.ab...
73396060839
from django.shortcuts import render from overwatch import models from django.shortcuts import render from django.core.urlresolvers import reverse from util import bbc_strip from django.http import HttpResponse, HttpResponseBadRequest import json def label(request): id, factbook, tags, embassies = _get_region() nex...
chheisler/Northeastern-Classwork
cs5100/project/defender/overwatch/views.py
views.py
py
1,581
python
en
code
1
github-code
18
[ { "api_name": "django.core.urlresolvers.reverse", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" }, { "api_name": "django.http.HttpResponseBadRequest", "line_number": 32, "usage_type": "call" }...
13140768711
import argparse import concurrent.futures import csv import json import logging import sys import time from concurrent.futures import ALL_COMPLETED from datetime import datetime import lusid as lu import pytz as pytz from lusid.utilities import ApiClientFactory def setup_logging(): root_logger = logging.getLogge...
rizwansaeed/lusid-parallel
main_thread.py
main_thread.py
py
5,470
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 18, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.stdout"...
31192129474
""" Test for UserProfile model """ import random import statistics import pytz from model_mommy import mommy from rest_framework.authtoken.models import Token from kaznet.apps.main.tests.base import MainTestBase from kaznet.apps.users.models import UserProfile from kaznet.apps.main.models import Submission from kazne...
onaio/kaznet-web
kaznet/apps/users/tests/test_models.py
test_models.py
py
10,059
python
en
code
4
github-code
18
[ { "api_name": "kaznet.apps.main.tests.base.MainTestBase", "line_number": 17, "usage_type": "name" }, { "api_name": "model_mommy.mommy.make", "line_number": 29, "usage_type": "call" }, { "api_name": "model_mommy.mommy", "line_number": 29, "usage_type": "name" }, { ...
5441595967
# -*- coding: utf-8 -*- # @Time : 18-9-25 下午5:54 # @Author : Gold_py # @Site : # @File : AuthViews.py # @Software: PyCharm from django.http import HttpResponse from django.shortcuts import render from django.core.urlresolvers import reverse from django.contrib.auth.models import User, Permission, Group from ...
GITliyanfeng/phone-shop-django
myadmin/views/AuthViews.py
AuthViews.py
py
5,943
python
en
code
0
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "django.contrib.auth.authenticate", "line_number": 26, "usage_type": "call" }, { "api_name": "django.contrib.auth.login", "line_number": 28, "usage_type": "call" }, { ...
39469100664
import numpy as np import zarr import h5py import voi import rand import iou import sys import glob import os from skimage import io, morphology, measure import glob import csv #from matplotlib import pyplot as plt from datetime import datetime def evaluate(pred_folder, data_folder, dataset, output_folder, small_obje...
maisli/neurolight_experiments
flylight/04_evaluate/evaluate.py
evaluate.py
py
4,244
python
en
code
0
github-code
18
[ { "api_name": "h5py.File", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 24...
24626369235
import json filename="text_files/favorite_number.json" try: number=int(input("Write your favorite number: ")) except: print("That's not a number!") else: with open(filename, 'w') as f: json.dump(number, f)
Guillermo-Ramirez-Jimenez/Python-exercises
Chapter 10/favorite_number.py
favorite_number.py
py
223
python
en
code
0
github-code
18
[ { "api_name": "json.dump", "line_number": 11, "usage_type": "call" } ]
36658828080
#! /usr/bin/env python3 # -*- coding: utf-8 -*- """ Find publication title, DOI or PMID based on either the DOI or the PMID as the query term by using the Europe PMC API (http://europepmc.org/RestfulWebService#!/Europe32PMC32Articles32RESTful32API/search). """ __author__ = "Ray Stefancsik" __version__ = "0.01" ####...
rays22/curation-tools
doi2pmid_interactive_EuropePMC.py
doi2pmid_interactive_EuropePMC.py
py
3,073
python
en
code
1
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "argparse.RawTextHelpFormatter", "line_number": 23, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 50, "usage_type": "call" }, { "api_name"...
37424079275
import hashlib import cloudinary import cloudinary.uploader import cloudinary.api from src.conf.config import settings class CloudPicture: cloudinary.config( cloud_name=settings.cloudinary_name, api_key=settings.cloudinary_api_key, api_secret=settings.cloudinary_api_secret, secur...
AleksandrRevuka/photoapp
src/services/cloud_picture.py
cloud_picture.py
py
2,266
python
en
code
0
github-code
18
[ { "api_name": "cloudinary.config", "line_number": 11, "usage_type": "call" }, { "api_name": "src.conf.config.settings.cloudinary_name", "line_number": 12, "usage_type": "attribute" }, { "api_name": "src.conf.config.settings", "line_number": 12, "usage_type": "name" }, ...
15380599990
import os from time import sleep import discord import random TOKEN = os.environ['TOKEN'] PREFIX = ";" client = discord.Client() rare_crate_items = ["octane", "fennec", "takumi", "masamune", "jäger 619"] paints = ["Titanium white ", "Burnt sienna ", "Crimson ", "Cobalt ", "Purple ", "Forest green ", "Pink ", "Grey ", "...
X0AM/RLDrop
old.py
old.py
py
1,179
python
en
code
0
github-code
18
[ { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "discord.Client", "line_number": 7, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 20, "usage_type": "call" }, { "api_name": "time.sleep", "line_num...
37689743774
import logging from copr.v3 import Client as CoprClient from packit_service.constants import ( COPR_API_FAIL_STATE, COPR_API_SUCC_STATE, COPR_SUCC_STATE, ) from packit_service.models import CoprBuildModel from packit_service.service.events import AbstractCoprBuildEvent, EventData, FedmsgTopic from packit_...
RaiLokesh/packit-service
packit_service/worker/build/babysit.py
babysit.py
py
2,707
python
en
code
null
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "packit_service.models.CoprBuildModel.get_all_by_build_id", "line_number": 28, "usage_type": "call" }, { "api_name": "packit_service.models.CoprBuildModel", "line_number": 28, "usa...
9054658706
from os import PathLike import random from typing import Optional, List import pytorch_lightning as pl import torch import torchmetrics from clip.simple_tokenizer import SimpleTokenizer from torch.nn.functional import cross_entropy from pgn.lr_schedulers.cosine_with_warmup import CosineWithWarmup from pgn.pgn_models.i...
jochemloedeman/PGN
pgn/lightning/pgn_dino.py
pgn_dino.py
py
6,851
python
en
code
38
github-code
18
[ { "api_name": "pytorch_lightning.LightningModule", "line_number": 17, "usage_type": "attribute" }, { "api_name": "clip.simple_tokenizer.SimpleTokenizer", "line_number": 18, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 26, "usage_type": "name" ...
14370690506
import pygame import random import animation class Monster(animation.AnimateSprite): def __init__(self, game, name, size, offset=0): super().__init__(name, size) self.game = game self.velocity = 4 self.health = 78 self.max_health = 100 self.attack = 0.1 self....
0BAB1/training-pygame
monster.py
monster.py
py
2,059
python
en
code
0
github-code
18
[ { "api_name": "animation.AnimateSprite", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 13, "usage_type": "attribute" }, { "api_name": "rando...
5746838337
import pytest from click.testing import CliRunner import brain.server.__main__ import brain.server.mq_agent.rabbitmq_agent import brain.server.parsers_agent import brain.server.server from brain.server.__main__ import cli from brain.server.client_agent import load_client_agent from brain.server.server import construct...
ntalmon/brain
tests/test_server.py
test_server.py
py
2,364
python
en
code
0
github-code
18
[ { "api_name": "data_generators.gen_snapshot_for_server", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 15, "usage_type": "attribute" }, { "api_name": "brain.server.__main__.server", "line_number": 33, "usage_type": "attribute" ...
74098137641
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat May 12 18:17:24 2018 @author: vivekkalyanarangan """ # For Genrating test images #from PIL import Image #from keras.datasets import mnist #import numpy as np # #(X_train, y_train), (X_test, y_test) = mnist.load_data() #for i in np.random.randint(0, 100...
dazhigulov/Histopathological_classification_of_cancer_via_Deep_Learning
Web-app/img-reco-test.py
img-reco-test.py
py
3,992
python
en
code
0
github-code
18
[ { "api_name": "tensorflow.ConfigProto", "line_number": 33, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 42, "usage_type": "call" }, { "api_name": "tensorflow.keras.backend.set_session", "line_number": 44, "usage_type": "call" }, { "ap...
4339040385
import sys from cv2 import threshold sys.path.append('core') import argparse import os import cv2 import glob import numpy as np import torch from PIL import Image import matplotlib.pyplot as plt from raft import RAFT from utils import flow_viz from utils.utils import InputPadder DEVICE = 'cuda' def load_image(i...
frankye1000/CV_Final_Project
RAFT/demo.py
demo.py
py
3,564
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_nu...
32273132869
import tensorflow as tf import numpy as np from tensorflow.keras import layers from tensorflow.keras import Model from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.optimizers import RMSprop from tensorflow.keras.applications.inception_v3 import InceptionV3 import matplotlib.pyplo...
toushi100/Tensorfow-in-Practice
CNN coursera week3.py
CNN coursera week3.py
py
3,525
python
en
code
0
github-code
18
[ { "api_name": "tensorflow.keras.applications.inception_v3.InceptionV3", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.Flatten", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers", "line_number": 25, "usag...
648731510
from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense, Dropout from tensorflow.keras.models import Sequential from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint import matplotlib.pyplot as plt imgWidth = 256 imgHe...
reylio06/Weather_Project
CNN_Model.py
CNN_Model.py
py
3,344
python
en
code
0
github-code
18
[ { "api_name": "tensorflow.keras.preprocessing.image.ImageDataGenerator", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.keras.preprocessing.image.ImageDataGenerator", "line_number": 23, "usage_type": "call" }, { "api_name": "tensorflow.keras.callbacks.EarlyS...
17733849553
#!/usr/bin/env python3 from http.server import BaseHTTPRequestHandler,HTTPServer import argparse, os, random, sys, requests from socketserver import ThreadingMixIn import threading hostname = 'en.wikipedia.org' def merge_two_dicts(x, y): return x | y def set_header(): headers = { 'Host': hostname ...
MollardMichael/python-reverse-proxy
proxy.py
proxy.py
py
3,720
python
en
code
74
github-code
18
[ { "api_name": "http.server.BaseHTTPRequestHandler", "line_number": 21, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 35, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 56, "usage_type": "call" }, { "api_name": "sys.arg...
3602636645
import sys,pygame from collections import deque #Queues __author__ = 'Kodex' pygame.init() size = width, height = 1280,840 speed = [2, 2] black = 0, 0, 0 screen = pygame.display.set_mode(size) # STARTGAME-------------------------- screen.fill(black) textLine1 = "Welcome to the survival games." te...
rytai/ReStart
Backup/01 tiles moveing and messagelog.py
01 tiles moveing and messagelog.py
py
4,321
python
en
code
0
github-code
18
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.font.ge...
71426828840
import sys sys.path.append('./fastai/') from Fastai.structured import * from Fastai.column_data import * np.set_printoptions(threshold=50, edgeitems=20) import warnings warnings.filterwarnings("ignore", category=sklearn.exceptions.UndefinedMetricWarning) from sklearn.model_selection import train_test_split, StratifiedK...
aorursy/new-nb-3
gilesstrong_dnn-ensemble-cat-embeddings-pretrain-class-bal.py
gilesstrong_dnn-ensemble-cat-embeddings-pretrain-class-bal.py
py
13,878
python
en
code
0
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": "warnings.filterwarnings", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.model_sele...
70463274921
import os import yaml from common.request_util import RequestHandler from common.yaml_util import read_yaml_key, get_object_data_path # 拼接url def get_url(path): """ :param path: 请求接口路径 :return: 返回完整的接口Url """ url = read_yaml_key('config/config.yaml', 'baseURL') + path return url # 获取header d...
zyl140640/qdmh-requests
common/public_function.py
public_function.py
py
3,771
python
en
code
0
github-code
18
[ { "api_name": "common.yaml_util.read_yaml_key", "line_number": 13, "usage_type": "call" }, { "api_name": "common.request_util.RequestHandler", "line_number": 23, "usage_type": "call" }, { "api_name": "common.yaml_util.read_yaml_key", "line_number": 24, "usage_type": "call...
36900790816
# For reading and writing csv files import csv import sklearn.linear_model as sklin import sklearn.metrics as skmet import sklearn.cross_validation as skcv import numpy as np MAX_TRAIN_SAMPLES = None # 10427 def get_features(row): return np.array([row]).astype(np.float) def read_data(inpath, get_features_fun):...
TobiasNorlund/LIS-Classification
classification_base.py
classification_base.py
py
2,181
python
en
code
0
github-code
18
[ { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 13, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.empty", "line_numbe...
35864019155
import matplotlib.pyplot as plt def SEIRS_Plot(results: dict, save_location: str, show: bool = False) -> None: """ Produces plot from results of SEIRS Model and saves the plot as a png in the save_location Args: results: results from SEIRS Model save_location: location to save plo...
FAIRDataPipeline/pySimpleModel
simpleModel/common/SEIRS_Plot.py
SEIRS_Plot.py
py
1,114
python
en
code
1
github-code
18
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 21, "usage_type": "call" }, { "api_name": "matpl...
23098979233
import numpy as np import pandas as pd from keras.models import Sequential from keras.layers import Dense from keras.wrappers.scikit_learn import KerasRegressor from sklearn.model_selection import cross_val_score from sklearn.model_selection import KFold from sklearn.preprocessing import StandardScaler from sklearn.pip...
olcole/GunViolencePrediction_ML
regressionKERAS.py
regressionKERAS.py
py
2,100
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 29, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 30, "usage_type": "call" }, { "api_name": "keras.laye...
8880952051
import os import json from pathlib import Path from google.cloud import bigquery from tabulate import tabulate # CONFIG FILES base_path = Path(__file__).resolve().parent.parent gcp_json = os.path.join(base_path, 'config/gcp_pro.json') gcp_file = json.load(open(gcp_json)) # GCP CLIENT BQ_client = bigquery.Client.from_...
rrpizzano/business_intelligence
general_code/dataframes/remove_line_break.py
remove_line_break.py
py
831
python
en
code
1
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 10...
37603149891
import json from bot_config import KEYS_FILE import time from datetime import datetime import jwt from utils.bot_logger import logger from requests import post from utils.meta_singleton import MetaSingleton class IAMToken(metaclass=MetaSingleton): encoded_jwt_token = None iam_token_value = None def __ini...
kpkovale/transcription_bot
utils/token_generator.py
token_generator.py
py
3,090
python
en
code
0
github-code
18
[ { "api_name": "utils.meta_singleton.MetaSingleton", "line_number": 11, "usage_type": "name" }, { "api_name": "utils.bot_logger.logger.info", "line_number": 19, "usage_type": "call" }, { "api_name": "utils.bot_logger.logger", "line_number": 19, "usage_type": "name" }, ...
13565936586
from django.shortcuts import ( render, redirect, ) from django.db import transaction from django.contrib import messages from django.http import JsonResponse from django.conf import settings from django.template.loader import get_template from django.core.mail import EmailMultiAlternatives from Modelos.models...
HenryGP14/EmprendeMacara
Cliente/views.py
views.py
py
10,357
python
es
code
0
github-code
18
[ { "api_name": "Cliente.carrito.Carrito", "line_number": 31, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 34, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 36, "usage_type": "call" }, { "api_n...
12645593505
""" Just a set of helper functions that I use often VERY miscellaneous! """ from __future__ import print_function, absolute_import import os import logging from astropy import units as u, constants from astropy import convolution from scipy.optimize import bisect from scipy.stats import scoreatpercentile from...
kgullikson88/gullikson-scripts
kglib/utils/HelperFunctions.py
HelperFunctions.py
py
47,749
python
en
code
4
github-code
18
[ { "api_name": "os.path.dirname", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path", "line_number": 47, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
6201093355
from itertools import permutations ''' # 에라토스테네스의 체 n = 9999999 numbers = [False, False] + [True] * (n-1) primes = [] for i in range(2, n+1): if numbers[i] == True: primes.append(i) for j in range(2 * i, n+1, i): numbers[j] = False # primes에 소수 집합 저장.. ''' def is_prime(num): if nu...
chris9390/Algorithm
programmers/brute_force_search/bf_2.py
bf_2.py
py
1,171
python
en
code
0
github-code
18
[ { "api_name": "itertools.permutations", "line_number": 37, "usage_type": "call" } ]
41304791560
print('Hello World!') lis = [2, 5, 7, 8, 12] for i in lis: if i % 2 == 0: print('the number is even') else: print('the number is odd') def say_hello(): print('hello!') set1 = {7, 8, 9} set2 = {5, 6, 7, 8, 9, 10} set2.issuperset(set1) set1.issuperset(set2) set1 = {1, 3, 5} set2 = {1, 2, ...
mustafagermec/miuul
01_week/bioinformatic.py
bioinformatic.py
py
7,342
python
tr
code
0
github-code
18
[ { "api_name": "seaborn.load_dataset", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 61, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 62, "usage_type": "call" }, { "api_name": "seaborn.load...