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
12413589703
# -*- coding: utf-8 -*- """ @author: Gallien FRESNAIS """ import pygame from pygame.locals import * # - Local - # from App.src.pygame_test.app_settings import * # pygame.mixer.init() """ Handles the events from the main pygame program """ def event_handler(): for event in pygame.event.get(): # if the...
gfresnais/Lucky_Number_AI
App/src/pygame_test/app_functions.py
app_functions.py
py
3,020
python
en
code
1
github-code
36
[ { "api_name": "pygame.event.get", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.event", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pygame.QUIT", "line_number": 23, "usage_type": "attribute" }, { "api_name": "pygame.KEYUP", ...
28672032992
import math import gym from gym import spaces, logger from random import seed from random import randint from PIL import Image from gym.utils import seeding import numpy as np from numpy import asarray import cv2 def init_map(size, num_obs, border_size): # Drawing a empty map global_map = np.one...
MetalEinstein/Projects
Map_Builder/custom_map_env.py
custom_map_env.py
py
8,308
python
en
code
0
github-code
36
[ { "api_name": "numpy.ones", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.rectangle", "line_number": 17, "usage_type": "call" }, { "api_name": "random.randint", "line_...
75127646504
import sys from cravat import BaseAnnotator from cravat import InvalidData import sqlite3 import os from functools import reduce class CravatAnnotator(BaseAnnotator): """ CravatAnnotator for the Denovo module. Querying attributes (input_data): chrom, pos, ref_base, alt_base Return attributes ...
KarchinLab/open-cravat-modules-karchinlab
annotators/denovo/denovo.py
denovo.py
py
2,269
python
en
code
1
github-code
36
[ { "api_name": "cravat.BaseAnnotator", "line_number": 8, "usage_type": "name" }, { "api_name": "functools.reduce", "line_number": 66, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 79, "usage_type": "attribute" } ]
24528496813
import torch import random import numpy as np from collections import deque from game import SnakeAI,NSWE from model import LinearQNet,QTrainer import matplotlib.pyplot as plt from IPython import display Block=20 MAX_MEM=100_000 Batch_Size=1000 Learning_Rate=0.001 class Agent: def __init__(self): self.n...
MakisEu/SnakeAI
agent.py
agent.py
py
5,158
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 22, "usage_type": "call" }, { "api_name": "model.LinearQNet", "line_number": 23, "usage_type": "call" }, { "api_name": "model.QTrainer", "line_number": 24, "usage_type": "call" }, { "api_name": "game.body", "li...
34358988987
import SECRETS import os import openai openai.organization = "org-0iQE6DR7AuGXyEw1kD4poyIg" # openai.api_key = os.getenv(SECRETS.open_ai_api_key) openai.api_key = SECRETS.open_ai_api_key # print(openai.Model.list()) print("starting test") def get_roast_str_from_username(username): completion = openai.Completio...
Brandon-Valley/tik_live_host
src/open_ai_api_test.py
open_ai_api_test.py
py
1,931
python
en
code
0
github-code
36
[ { "api_name": "openai.organization", "line_number": 7, "usage_type": "attribute" }, { "api_name": "openai.api_key", "line_number": 9, "usage_type": "attribute" }, { "api_name": "SECRETS.open_ai_api_key", "line_number": 9, "usage_type": "attribute" }, { "api_name":...
30181316679
""" This code allows to compute and evaluate optimal policies for the grid environments. These optimal values are used to normalize the rewards per task. """ import envs, gym, argparse from envs.water.water_world import Ball, BallAgent if __name__ == '__main__': # Examples # >>> python3 test_optimal_policies.py --e...
RodrigoToroIcarte/reward_machines
reward_machines/test_optimal_policies.py
test_optimal_policies.py
py
932
python
en
code
49
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 19, "usage_type": "call" } ]
72609543784
import requests from bs4 import BeautifulSoup import mysql.connector from mysql.connector import Error class ScraperBol(): lijstMetCategorien = ["video games", "nature", "photo", "sports", "tech", "beauty"] def __init__(self): self.connection = mysql.connector.connect(host='ID362561_suggesto.db.webhost...
ThiboVanderkam/Suggesto
v1/assets/python/scraperClass.py
scraperClass.py
py
5,843
python
en
code
2
github-code
36
[ { "api_name": "mysql.connector.connector.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 9, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 9, "usage_type": "name" }, { "api...
38650181804
import numpy as np import pandas as pd import matplotlib.pyplot as plt from math import pi, sin, cos, atan, degrees from sympy import * from matplotlib.ticker import MultipleLocator, AutoMinorLocator DF = True IS_SCATTER = False df = pd.read_csv('/Users/shetshield/Desktop/workspace/python_ws/sim_lin_bend/sim_res_1c...
shetshield/src
srm/kinematic_model.py
kinematic_model.py
py
8,580
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "math.atan", "line_number": 212, "usage_type": "call" }, { "api_name": "math.atan", "line_number": 217, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 2...
22784884700
from .common import * import numpy import scipy import scipy.special import scipy.sparse import scipy.sparse.linalg # Datatypes bool = bool float16 = numpy.float16 float32 = numpy.float32 float64 = numpy.float64 uint8 = numpy.uint8 int16 = numpy.int16 int32 = numpy.int32 int64 = numpy.int64 float_fmts.update({ '...
Microno95/desolver
desolver/backend/numpy_backend.py
numpy_backend.py
py
5,706
python
en
code
17
github-code
36
[ { "api_name": "numpy.float16", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.float32", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.float64", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.uint8"...
71017122023
from multiprocessing import Lock import dquality.common.constants as const from multiprocessing import Process import importlib from os import path import sys import dquality.realtime.pv_feedback_driver as drv if sys.version[0] == '2': import thread as thread else: import _thread as thread class Result: "...
bfrosik/data-quality
dquality/common/containers.py
containers.py
py
10,484
python
en
code
5
github-code
36
[ { "api_name": "sys.version", "line_number": 8, "usage_type": "attribute" }, { "api_name": "dquality.common.constants.DATA_STATUS_DATA", "line_number": 45, "usage_type": "attribute" }, { "api_name": "dquality.common.constants", "line_number": 45, "usage_type": "name" }, ...
25628607275
import numpy as np import matplotlib.pyplot as plt def plot(data, part): x = range(1, data[:, 0].size + 1) x2 = np.array(range(1, data[:, 0].size + 1)) mask = (data[:, 0] < 0.9196246) & (data[:, 1] > 0.919663) y_min = np.maximum(data[:, 1], 0.9196246) y_max = np.minimum(data[:, 0], 0.919663) i...
tronyaginaa/math_statistics
lab3/interval.py
interval.py
py
939
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.maximum", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.minimum", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.any", "line_number": 1...
28440101289
from tensorboardX import SummaryWriter from multiprocessing import current_process from .abstract_writer import AbstractWriter from .helpers import add_value_wrapper from ..helpers import concurrent class TensorboardWriter(AbstractWriter): def __init__(self, use_hdf_hook=True, **kwargs): AbstractWriter._...
martius-lab/cee-us
mbrl/allogger/writers/tensorboardwriter.py
tensorboardwriter.py
py
2,331
python
en
code
11
github-code
36
[ { "api_name": "abstract_writer.AbstractWriter", "line_number": 8, "usage_type": "name" }, { "api_name": "abstract_writer.AbstractWriter.__init__", "line_number": 11, "usage_type": "call" }, { "api_name": "abstract_writer.AbstractWriter", "line_number": 11, "usage_type": "...
74207610663
from turtle import title from flask import Blueprint, render_template, request, session, redirect, flash import mysql.connector from webappfiles import dbconnect from datetime import datetime import os views = Blueprint('views', __name__) cur, con = dbconnect.get_connection() #referring to the default page via the ...
yelenaM4/Mohandyman
webappfiles/views.py
views.py
py
7,945
python
en
code
0
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 10, "usage_type": "call" }, { "api_name": "webappfiles.dbconnect.get_connection", "line_number": 12, "usage_type": "call" }, { "api_name": "webappfiles.dbconnect", "line_number": 12, "usage_type": "name" }, { "api_na...
11844140747
import configparser import csv import os # Params: abs file path, file section and its key def get_config_value(conf_file, section, key): config = configparser.ConfigParser() config.read(conf_file) return config[section][key] def get_tickers(table, fn): dirname = os.path.dirname(__file__) path ...
xka155/PFF
core/utils/config.py
config.py
py
563
python
en
code
0
github-code
36
[ { "api_name": "configparser.ConfigParser", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "csv.reader", ...
75263417065
from dataminer.file import File from dataminer.processor import PROCESSORS, Processor from dataminer.extractor import EXTRACTORS from pathlib import Path from fnmatch import fnmatchcase import os import yaml import time CONFIG = {} def load_config(path: Path): global CONFIG with open(path, "rb") as fd: ...
ReplayCoding/tf2-dataminer
dataminer/build.py
build.py
py
2,671
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "name" }, { "api_name": "yaml.safe_load", "line_number": 17, "usage_type": "call" }, { "api_name": "fnmatch.fnmatchcase", "line_number": 21, "usage_type": "call" }, { "api_name": "pathlib.Path", "l...
8635247821
from django.urls import path from . import apis urlpatterns_api_tables = [ path('table-list/', apis.TableListAPI.as_view()), path('monthly-tables/', apis.MonthlyTableListAPI.as_view()), path('main-page/', apis.MainPageAPI.as_view()), path('make-log/', apis.MakeTableLogAPI.as_view()), path('search/'...
hanoul1124/healthcare2
app/tables/urls.py
urls.py
py
357
python
en
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
22766444587
from flask import Blueprint, render_template, url_for, request, redirect, flash, make_response from flask_login import login_required, current_user from models import * # import database details from sqlalchemy import or_ import matplotlib.pyplot as plt import io import base64 import sqlite3 # creating bluep...
Satyajay2020/College_Project
analytics.py
analytics.py
py
1,109
python
en
code
0
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
28833400649
import time from machine import Pin from discharge_stats import DischargeStats import logging log = logging.getLogger(__name__) log.setLevel(logging.DEBUG) AUTO_DISCHARGE = False class Channel: def __init__( self, channel, discharge_pin, leds_object=None, temperature_sens...
koalacreations/kCharge-firmware
kCharge-firmware/channel.py
channel.py
py
5,242
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "machine.Pin", "line_number": 35, "usage_type": "call" }, { "api_name": "machine.Pin.OUT", ...
74647178343
import logging import os from wafl.connectors.bridges.llm_task_extractor_bridge import LLMTaskExtractorBridge from wafl.extractors.dataclasses import Answer _path = os.path.dirname(__file__) _logger = logging.getLogger(__file__) class TaskExtractor: def __init__(self, config, interface, logger=None): se...
fractalego/wafl
wafl/extractors/task_extractor.py
task_extractor.py
py
1,268
python
en
code
6
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "wafl.connectors.bridges.l...
485015950
from PIL import Image import time from libsvm.svmutil import svm_predict, svm_train import numpy as np import sys import pandas as pd from libsvm.svm import * from libsvm.svmutil import * train_file = '/Users/aparahuja/Desktop/IITD/ML/Assignment 2/Q2/mnist/train.csv' test_file = '/Users/aparahuja/Desktop/IITD/ML/Assig...
AparAhuja/Machine_Learning
Naive Bayes and SVM/Q2/multi_c.py
multi_c.py
py
4,313
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_num...
74839486503
from lxml import etree import pandas def getdata(name , indx): allarr = [] f = open(name, encoding="utf-8") # 输出读取到的数据 text = f.read() f.close() htmll = etree.HTML(text) arr = [] arr.append(indx) name = htmll.xpath('//div[@class="Blockreact__Block-sc-1xf18x6-0 Flexreact__Flex-sc-1...
chenqiuying1023/opensea-supergucci
handletocsv.py
handletocsv.py
py
2,353
python
en
code
1
github-code
36
[ { "api_name": "lxml.etree.HTML", "line_number": 11, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 11, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 54, "usage_type": "call" } ]
33596607925
import sys import numpy as np import pandas as pd #from agents.policy_search import PolicySearch_Agent from agents.agent import DDPG from task import Task num_episodes = 1000 target_pos = np.array([0., 0., 100.]) task = Task(target_pos=target_pos) agent = DDPG(task) for i_episode in range(1, num_episodes+1): sta...
AndyClouder/ML
RL-Quadcopter-2/project.py
project.py
py
817
python
en
code
1
github-code
36
[ { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "task.Task", "line_number": 10, "usage_type": "call" }, { "api_name": "agents.agent.DDPG", "line_number": 11, "usage_type": "call" }, { "api_name": "task.step", "line_number":...
29613368843
import os,random,warnings,time,math import torch import torch.nn as nn from dataloader.data_loader import prepare_dataset, _collate_fn from base_builder.model_builder import build_model from dataloader.vocabulary import KsponSpeechVocabulary from omegaconf import OmegaConf from tensorboardX import SummaryWriter ...
jungwook518/WOOK_Challenge
test.py
test.py
py
2,663
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.cuda", ...
11747758050
import streamlit as st import numpy as np import pandas as pd st.title('Steamlit 基礎') st.write('Hello World!') st.write('I love World') df = pd.DataFrame({ '1列目': [1,2,3,4], '2列目': [10,20,30,40] }) st.dataframe(df.style.highlight_between(axis=1), width=300,height=150) df_1 = pd.DataFrame( np.random.rand(10...
tetsukira/iris_streamlit
main.py
main.py
py
1,489
python
ja
code
0
github-code
36
[ { "api_name": "streamlit.title", "line_number": 4, "usage_type": "call" }, { "api_name": "streamlit.write", "line_number": 5, "usage_type": "call" }, { "api_name": "streamlit.write", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "...
7810152186
import sys import argparse import random import time import numpy as np import server.common.compute.diffexp_generic as diffexp_generic from server.common.config.app_config import AppConfig from server.data_common.matrix_loader import MatrixDataLoader def main(): parser = argparse.ArgumentParser("A command to t...
chanzuckerberg/cellxgene
test/performance/run_diffexp.py
run_diffexp.py
py
3,548
python
en
code
528
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "server.common.config.app_config.AppConfig", "line_number": 30, "usage_type": "call" }, { "api_name": "server.data_common.matrix_loader.MatrixDataLoader", "line_number": 35, ...
14257608746
import csv, os, glob, google_trans_new from tqdm import tqdm # sweet progress bar #============================================================================== def get_lang(): """ Purpose: gets language to translate to from user Dependencies: google_trans_new Argument: None ...
mcheffer/xml_translator
xml_translator.py
xml_translator.py
py
4,817
python
en
code
0
github-code
36
[ { "api_name": "google_trans_new.LANGUAGES", "line_number": 18, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 48, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 53, "usage_type": "call" }, { "api_name": "os.remove", "...
20160442598
from superlink import security import mysql.connector as sqltor from tabulate import tabulate security.security_init() #Starts monitoring people by asking username/password secure = security.isSecured() #Boolean #_main_ if secure==True: conn = sqltor.connect(host="localhost", user="root", passwd="root"...
Project-CS-2022/ProjCS-2022-02-08-Final
CS Proj/Project/collaborators.py
collaborators.py
py
1,556
python
en
code
0
github-code
36
[ { "api_name": "superlink.security.security_init", "line_number": 5, "usage_type": "call" }, { "api_name": "superlink.security", "line_number": 5, "usage_type": "name" }, { "api_name": "superlink.security.isSecured", "line_number": 6, "usage_type": "call" }, { "api...
18291729121
from PIL import Image import numpy as np def calculate_apl(filename): """Calculate the average picture level (APL) from an image. Keyword arguments: filename -- path of image """ # load the image image = Image.open(filename) # convert image to numpy array data = np.asarray(image) ...
jdbremer/scripts
APL.py
APL.py
py
698
python
en
code
0
github-code
36
[ { "api_name": "PIL.Image.open", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 12, "usage_type": "name" }, { "api_name": "numpy.asarray", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.average", "line_numb...
1817846315
#! /bin/python # gsheet flask entry handler # # @file: gsheet # @time: 2022/01/26 # @author: Mori # import flask from service.gsheet import ( init_credentials, compelete_worksheet, reading_worksheet, read_wks_from_google_sheet, ) SHEET_ID = "1vXqHdA6RTD9cMMv8CvRQMW-jM9GSajAZOVcdJMwEFDM" WKS_TITLE = "...
moriW/auto_firebase
backend/web/gsheet.py
gsheet.py
py
1,147
python
en
code
0
github-code
36
[ { "api_name": "service.gsheet.init_credentials", "line_number": 26, "usage_type": "call" }, { "api_name": "service.gsheet.read_wks_from_google_sheet", "line_number": 27, "usage_type": "call" }, { "api_name": "service.gsheet.compelete_worksheet", "line_number": 28, "usage_...
20450214874
import singleRepoStats import datetime import pandas as pd import featureMakers def getPredictionsTrace(repoString, tend = datetime.date.today()): weeklyData = singleRepoStats.getRepoWeeklyData(repoString) weeklyTotal = weeklyData.pivot(index='week_start', columns='author_login', values='commits_num').sum(axis=1)...
gauthamnair/repopulse
predictionsVisualizer.py
predictionsVisualizer.py
py
1,069
python
en
code
1
github-code
36
[ { "api_name": "datetime.date.today", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 8, "usage_type": "attribute" }, { "api_name": "singleRepoStats.getRepoWeeklyData", "line_number": 9, "usage_type": "call" }, { "api_name": ...
1607792294
from pdfminer.converter import PDFPageAggregator from pdfminer.layout import LAParams from pdfminer.pdfparser import PDFParser, PDFDocument from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter # from pdfminer.pdfdevice import PDFDevice # 获取需要读取的PDF文档对象 pdfFile = open("一种折叠屏上使用的付款码使用方式.pdf", "rb...
BianDongLei/study_demo
Python/PythonDemo/PythonTest/pdfreader.py
pdfreader.py
py
1,196
python
zh
code
0
github-code
36
[ { "api_name": "pdfminer.pdfparser.PDFParser", "line_number": 10, "usage_type": "call" }, { "api_name": "pdfminer.pdfparser.PDFDocument", "line_number": 12, "usage_type": "call" }, { "api_name": "pdfminer.pdfinterp.PDFResourceManager", "line_number": 19, "usage_type": "cal...
2556587569
from bs4 import BeautifulSoup import requests from time import sleep import re from collections import OrderedDict from utils import save_csv , URL_RESOURCES # Separar chamadas de cada página usando asyncio def get_parsed_content(url): content = requests.get(url).content parsed_content = BeautifulSoup(co...
Marlysson/craw
core/resources/crawlers/countries_infos.py
countries_infos.py
py
1,950
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "...
34879164954
import pyvisa as visa import time from datetime import datetime import numpy as np import pandas as pd import matplotlib matplotlib.use("TkAgg") import matplotlib.pyplot as plt plt.rcParams['animation.html'] = 'jshtml' from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure impo...
DbIXAHUEOKEAHA/LPI_RAS
GPIB_window.py
GPIB_window.py
py
7,233
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 9, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "serial....
15685242927
import pygame import glob class Player(pygame.sprite.Sprite): def __init__(self): super().__init__() self.player_walk_right = [] self.player_walk_left = [] self.player_walk = self.player_walk_left for player_frame in glob.glob('Static/Character/walk_right/*.png'): ...
SlimeyTurtles/GameJam1
player.py
player.py
py
1,900
python
en
code
0
github-code
36
[ { "api_name": "pygame.sprite", "line_number": 4, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.image", "lin...
19088343099
from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.views.generic.simple import direct_to_template from django.template import RequestContext from images.models import Image from images.forms import ImageForm def images_a...
queensjournal/queensjournal.ca
apps/images/views.py
views.py
py
2,225
python
en
code
2
github-code
36
[ { "api_name": "django.http.HttpResponseRedirect", "line_number": 11, "usage_type": "call" }, { "api_name": "images.forms.ImageForm", "line_number": 14, "usage_type": "call" }, { "api_name": "images.models.Image", "line_number": 17, "usage_type": "call" }, { "api_n...
18924484365
import pytest from base.webdriverfactory import WebDriverFactory from pages.home.login_page import LoginPage @pytest.yield_fixture() def setUp(): print("Running method level setUp") yield print("Running method level tearDown") @pytest.yield_fixture(scope="class") def oneTimeSetUp(request, browser): p...
PacktPublishing/-Selenium-WebDriver-With-Python-3.x---Novice-To-Ninja-v-
CODES/S31 - Automation Framework -_ Practice Exercise/1_conftest.py
1_conftest.py
py
976
python
en
code
11
github-code
36
[ { "api_name": "pytest.yield_fixture", "line_number": 5, "usage_type": "call" }, { "api_name": "base.webdriverfactory.WebDriverFactory", "line_number": 15, "usage_type": "call" }, { "api_name": "pages.home.login_page.LoginPage", "line_number": 17, "usage_type": "call" },...
17453339669
import torch.nn as nn import torch.nn.functional as F import torch import numpy as np def get_fpn_sf_global(num_classes, mode): return FPN_SF(num_classes, expansion=4, mode=mode) def get_fpn_sf_local(num_classes, mode): return FPN_SF(num_classes, expansion=1, mode=mode) class FPN_SF(nn.Module): def _...
yida2311/OSCC_SF
models/fpn_semantci_flow.py
fpn_semantci_flow.py
py
8,230
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
2945906050
import streamlit as st import math st.title("Caesar Cipher") message = st.text_input("Enter the plaintext: ") key = math.floor(st.number_input("Enter the secret key: ")) def CaesarCipher(message: str, key: int) -> str: if not message: return "Please enter a message." key %= 26 val =...
GowthamNats/CaesarCipher
CaesarCipher.py
CaesarCipher.py
py
954
python
en
code
0
github-code
36
[ { "api_name": "streamlit.title", "line_number": 4, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 6, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit.number_input",...
4084437791
""" Start with streamlit run ./src/streamlit_app.py """ import datetime import logging import streamlit as st import numpy as np from models import train_model as tm import visualization.visualize as vis from preprocessing.pipeline import get_preprocessing_pipeline from filehandler.load_input import l...
BerndSaurugger/SaveBread
src/streamlit_app.py
streamlit_app.py
py
6,014
python
en
code
0
github-code
36
[ { "api_name": "streamlit.set_page_config", "line_number": 17, "usage_type": "call" }, { "api_name": "filehandler.load_input.load_file", "line_number": 26, "usage_type": "call" }, { "api_name": "filehandler.load_input.load_file", "line_number": 27, "usage_type": "call" }...
74267287785
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
line/line-bot-sdk-python
examples/fastapi-echo/main.py
main.py
py
2,424
python
en
code
1,739
github-code
36
[ { "api_name": "os.getenv", "line_number": 38, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 39, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 42, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 45, "u...
14980635082
import cv2 import os import Predict as p subjects = ["", "Ranbir", "Elvis Presley","Change it with your name"] #load test images test_img1 = cv2.imread("test-data/1.1.jfif") test_img2 = cv2.imread("test-data/1.2.jfif") test_img3 = cv2.imread("test-data/1.3.jpg") #perform a prediction predicted_img1 =...
ankitvarma604/Face-Detection
face_detection.py
face_detection.py
py
693
python
en
code
0
github-code
36
[ { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "Predict.predict", "line_number": ...
3195540576
import requests import re #Obtendo html nothing = 44827 divide = False while nothing: print(f'----------------------------------------\ncurrent nothing is: {nothing}') url = f"http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing={nothing}" html = requests.get(url).text print(html) numbers =...
TassioS/Python-Challenge
4.py
4.py
py
560
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 12, "usage_type": "call" } ]
13899195903
import pandas as pd import numpy as np import matplotlib.pyplot as plt from math import e import seaborn as sn from sklearn.metrics import confusion_matrix from pretty_confusion_matrix import pp_matrix_from_data # Ryan Filgas # Machine learning def get_distance(a,b,c,d): return pd.DataFrame((a-b)**2 + (c-d)**2)...
rfilgas/ML-AI-CV
ML-K-Means-Classification-Gaussian/kmeans.py
kmeans.py
py
3,690
python
en
code
1
github-code
36
[ { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.array", "line_...
139802964
import os import sys import logging from datetime import datetime from mongoengine.errors import ValidationError sys.path.insert(1, os.path.join(os.getcwd(), '../', 'src')) from flaskapp.model import User logger = logging.getLogger() def create_user(): new_user = User(lastAccess=datetime.utcnow(), documents=[]...
bangjh0730/asdf
src/flaskapp/user.py
user.py
py
2,029
python
en
code
0
github-code
36
[ { "api_name": "sys.path.insert", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
33512502317
from math import sqrt, fabs import numpy as np import pandas as pd from sklearn.preprocessing import StandardScaler import matplotlib.pyplot as plt from numpy import genfromtxt # Grid configurations plt.grid(True, linewidth=0.2, c='k') def get_near_psd(A_matrix): A_sym = (A_matrix + A_matrix.T) / 2 eigval, ...
optimization-for-data-driven-science/RIFLE
RIFLE_via_ADMM/ADMM_Synthetic.py
ADMM_Synthetic.py
py
17,963
python
en
code
8
github-code
36
[ { "api_name": "matplotlib.pyplot.grid", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.linalg.eigh", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.lina...
23115996703
import torch from NAQS import NAQS, intial_state from lnZ_2d import TensorSampling, HonNN import numpy as np from scipy.linalg import sqrtm from scipy import sparse import csv import time def learning(model, model0, optimizer, loss_func, epoch_start, epoch_end, batch_size, my_device, beta=1.0, memo='init', save...
Sixuan00/Free-Energy-NN
2D/New Method/main.py
main.py
py
15,844
python
en
code
0
github-code
36
[ { "api_name": "time.time", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 35, "usage_type": "call" }, { "api_name": "time.time", "line_number": ...
36505762158
import numpy as np import matplotlib.pyplot as plt print('Enter n') n = int(input()) print('Enter 0 if Left Riemann Sum') print('Enter 1 if Midpoint Riemann Sum') print('Enter 2 if Right Riemann Sum') i = int(input()) f = lambda x: x ** 2 a, b = 1, 2 dx = 1 / n x_left = np.linspace(a, b - dx, n) x_midpoint = np.linspa...
alekseevavlada/Laba_Math
main.py
main.py
py
1,871
python
en
code
0
github-code
36
[ { "api_name": "numpy.linspace", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.sum", "line_nu...
25364145372
import cv2 as cv import numpy as np ''' Tranformação geometrica: Rotação: >getRotationMatrix2D(center, angle, scale) -> Obtem uma matriz de rotação. ==>center -> Indica o centro da imagem (X, Y) ==>angle -> Define o ângulo desejado para rotacionar [0, 360] ==>scale -> Escala para imagem >warpAffine(src, matriz, dsize)...
abelsco/PyExerciciosOpencv
transformacaoGeo.py
transformacaoGeo.py
py
1,210
python
pt
code
0
github-code
36
[ { "api_name": "cv2.imread", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.getRotationMatrix2D", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.warpAffine", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.imshow", "l...
12233028834
from keras.models import Sequential from keras.layers import Dense, LSTM, Dropout import os import tensorflow as tf import pandas as pd import numpy as np import matplotlib.pyplot as plt import time from datetime import date from pandas_datareader import data as pdr import yfinance as yf yf.pdr_override() i...
markb2575/AI-Stock-Predicter
predict-weekly/weekly.py
weekly.py
py
4,674
python
en
code
0
github-code
36
[ { "api_name": "yfinance.pdr_override", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 33, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 46, "usage_type": "attribute" }, { "api_name": "datetime.date.today...
21150674567
from django.shortcuts import render, get_object_or_404, get_list_or_404 from django.http import HttpResponseRedirect, Http404 from django.urls import reverse from django.contrib import messages # import model from another module # import Users model from authentication module from authentication.models import Users, ...
Optisoftdev/S5
administrator/views.py
views.py
py
2,765
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Schools", "line_number": 18, "usage_type": "argument" }, { "api_name": "django.shortcuts.render", "line_number": 21, "usage_type": "call" }, { "api...
19036931812
import logging import zmq from cifsdk.actor.manager import Manager as _Manager from cifsdk.actor import Actor as Enricher from .constants import TRACE, ENRICHER_ADDR, ENRICHER_SINK_ADDR, \ LOGLEVEL logger = logging.getLogger(__name__) logger.setLevel(LOGLEVEL) if TRACE: logger.setLevel(logging.DEBUG) clas...
csirtgadgets/cif-v5
cif/enricher/manager.py
manager.py
py
765
python
en
code
61
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "constants.LOGLEVEL", "line_number": 11, "usage_type": "argument" }, { "api_name": "constants.TRACE", "line_number": 13, "usage_type": "name" }, { "api_name": "logging.DEBU...
33628626994
from django.http.response import HttpResponse from django.shortcuts import redirect, render from django.contrib import messages from .models import * # Create your views here. def index(request): #put in something to see if the user is already logged in if "user" in request.session: context ={ ...
chatbot6000/Troop44
forumapp/views.py
views.py
py
5,835
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 23, "usage_type": "call" }, { "api_name"...
36652176172
""" This is meant to be executed using mpirun. It is called as a subprocess to run an MPI test. """ if __name__ == '__main__': import sys import os import traceback from mpi4py import MPI from testflo.test import Test from testflo.cover import setup_coverage, save_coverage from testflo....
naylor-b/testflo
testflo/mpirun.py
mpirun.py
py
1,731
python
en
code
8
github-code
36
[ { "api_name": "testflo.qman.get_client_queue", "line_number": 22, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "testflo.cover.setup_coverage", "line_number": 25, "usage_type": "call" }, { "api_na...
4897008783
from django.contrib.auth.base_user import AbstractBaseUser from django.contrib.auth.models import Group from django.contrib.auth.models import PermissionsMixin from django.core.exceptions import ValidationError from django.core.validators import FileExtensionValidator from django.core.validators import RegexValidator f...
veresen01/django-shop
___shop___/app_users/models.py
models.py
py
2,768
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.auth.base_user.AbstractBaseUser", "line_number": 14, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.PermissionsMixin", "line_number": 14, "usage_type": "name" }, { "api_name": "django.core.validators.FileExtensionValidator", "l...
13989507368
from collections import deque class Solution: def averageOfLevels(self, root): queue = deque([(root, 0)]) prev_lev = -1 sum_lev = 0 cnt_lev = 0 avg_lev = [] while queue: node, lev = queue.popleft() if lev != prev_lev: if cnt_le...
dariomx/topcoder-srm
leetcode/zero-pass/facebook/average-of-levels-in-binary-tree/Solution.py
Solution.py
py
716
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" } ]
74572677542
# Implement user-defined window size for the play. For example, an user # could use a keyboard to input different values of widths and heights. # Accordingly, the screen will display in different sizes regarding the user's input. import cv2 print(cv2.__version__) cam = cv2.VideoCapture(0) width = int(input('Desired w...
Gabrielmbl/csci380
lab3/lab3b_gl.py
lab3b_gl.py
py
623
python
en
code
0
github-code
36
[ { "api_name": "cv2.__version__", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_FRAME_WIDTH", "line_number": 12, "usage_type": "attribute" }, { "api_name": "cv2...
22530241228
from itertools import zip_longest from typing import Optional import numpy as np import pytest import gym from gym.spaces import Box, Graph, utils from gym.utils.env_checker import data_equivalence from tests.spaces.utils import TESTING_SPACES, TESTING_SPACES_IDS TESTING_SPACES_EXPECTED_FLATDIMS = [ # Discrete ...
openai/gym
tests/spaces/test_utils.py
test_utils.py
py
3,718
python
en
code
33,110
github-code
36
[ { "api_name": "gym.spaces", "line_number": 59, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 59, "usage_type": "name" }, { "api_name": "gym.spaces.utils.flatdim", "line_number": 62, "usage_type": "call" }, { "api_name": "gym.spaces.u...
36860255897
__author__ = 'Jonny' __date__ = '2018-03-07' __location__ = '西安' # -*- coding: utf-8 -*- import time import login import check import requests import station import booking #---------------------------- 登录账户-------------------------------------------------- def logIn(request): state = 1 while(state != 0): ...
JonnyLe/Python-12306-
12306.py
12306.py
py
3,866
python
zh
code
0
github-code
36
[ { "api_name": "login.login", "line_number": 19, "usage_type": "call" }, { "api_name": "check.ticket_infor", "line_number": 24, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 39, "usage_type": "call" }, { "api_name": "station.sel_station", "...
3533175991
import gym from random import sample from keras import optimizers, Sequential from keras.layers import Dense from numpy import random, argmax import numpy as np from gym.spaces import Box, Discrete import logging from keras.utils import to_categorical import sys import pickle import logging from actor_evaluator impor...
nsragow/RlGym
dqn_frozen_categorical.py
dqn_frozen_categorical.py
py
6,297
python
en
code
0
github-code
36
[ { "api_name": "numpy.random.uniform", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 45, "usage_type": "name" }, { "api_name": "logging.debug", "line_number": 69, "usage_type": "call" }, { "api_name": "random.sample", "...
30467024197
from collections import deque class SnakeGame: def __init__(self, width: int, height: int, food: List[List[int]]): """ Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [...
dundunmao/LeetCode2019
353. Design Snake Game.py
353. Design Snake Game.py
py
2,425
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 20, "usage_type": "call" } ]
24549535365
import logging from pytest import raises, fixture from kiwi_keg.image_definition import KegImageDefinition from kiwi_keg.exceptions import KegError class TestKegImageDefinition: @fixture(autouse=True) def inject_fixtures(self, caplog): self._caplog = caplog def setup(self): self.keg_defi...
SUSE-Enceladus/keg
test/unit/image_definition_test.py
image_definition_test.py
py
3,122
python
en
code
8
github-code
36
[ { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "call" }, { "api_name": "kiwi_keg.image_definition.KegImageDefinition", "line_number": 14, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 19, "usage_type": "call" }, { "api_name...
15204139120
"""import os os.environ["KERAS_BACKEND"] = "theano" import keras""" import keras print(keras.backend.backend()) from flask import request, render_template, redirect, url_for, Flask import numpy as np import time, random from selenium import webdriver from tensorflow.keras.models import load_model from s...
siddhant230/Fun_Projects
activity_recognition/backend.py
backend.py
py
2,059
python
en
code
4
github-code
36
[ { "api_name": "keras.backend.backend", "line_number": 7, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 15, "usage_type": "call" }, { "api_n...
428329513
from django.shortcuts import render,redirect # importamos la libreria generic from django.views import View from .models import * from .forms import * # Create your views here. class AlumnoView(View): def get(self,request): listaAlumnos = TblAlumno.objects.all() formAlumno = AlumnoForm() ...
Angellvz/DAE-2022-02-LAVENTURA
djangoApp07/django_panel/web/views.py
views.py
py
689
python
en
code
0
github-code
36
[ { "api_name": "django.views.View", "line_number": 9, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 26, "usage_type": "call" } ]
72182864424
import Utils from KernelNPRegression import KernelNPRegression from RobustNPRegression import RobustNPRegression from matplotlib import pyplot as plt def draw_scatter(points, color): plt.scatter([point[0] for point in points], [point[1] for point in points], c=color) def draw_graphic(po...
DimaPhil/ML-Hometasks
HW5/main.py
main.py
py
1,815
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 13, "usage_type": "call" }, { "api_name": "matp...
8365518894
from enum import Enum from typing import Dict, TYPE_CHECKING, List, Union, cast from ..types import TealType, require_type from ..errors import TealInputError, verifyTealVersion from ..ir import TealOp, Op, TealBlock from .expr import Expr from .txn import TxnField, TxnExprBuilder, TxnaExprBuilder, TxnObject from .seq...
gconnect/voting-dapp-pyteal-react
venv/lib/python3.8/site-packages/pyteal/ast/itxn.py
itxn.py
py
8,116
python
en
code
6
github-code
36
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 11, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 15, "usage_type": "name" }, { "api_name": "ir.Op.itxn_begin", "line_number": 16, "usage_type": "attribute" }, { "api_name": "ir.Op", "lin...
4022925396
import requests from requests.structures import CaseInsensitiveDict import base64 import json from django.conf import settings requests.packages.urllib3.disable_warnings( requests.packages.urllib3.exceptions.InsecureRequestWarning ) GITHUB_TOKEN = getattr(settings, "GITHUB_TOKEN", None) def deploy_done( git...
kakaocloudschool/Multi_ojigo
api_utils/github_api.py
github_api.py
py
6,199
python
en
code
2
github-code
36
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.packages", "line_number": 7, "usage_type": "attribute" }, { "api_name": "requests.packages", "line_number": 8, "usage_type": "attribute" }, { ...
22226448679
import numpy as np import pandas as pd import argparse def get_tail(hmm, ncRNA, strict=False): expression = [int(x) for x in hmm.loc[ncRNA].score.split(',')] if (np.mean(expression) > 1.5) and (len(expression) > 1000): trim_length = trim_expression(expression, strict) return trim_length els...
bfairkun/ChromatinSplicingQTLs
code/scripts/NonCodingRNA/trim_ncRNAs.py
trim_ncRNAs.py
py
14,065
python
en
code
0
github-code
36
[ { "api_name": "numpy.mean", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24,...
70183489063
from decimal import Decimal, InvalidOperation from typing import TYPE_CHECKING, Any, List, Optional, TypedDict from django.db import models, transaction if TYPE_CHECKING: from senda.core.models.clients import ClientModel from senda.core.models.localities import LocalityModel, StateChoices from senda.core....
UNPSJB/SendaAlquiler
backend/senda/core/managers.py
managers.py
py
14,222
python
en
code
1
github-code
36
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.models.Manager", "line_number": 24, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 24, "usage_type": "name" }, { "api_name": "ty...
8380776575
import pandas as pd import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = (15, 5) def plot_temperature(m, a, b, min, max): """ This function will plot the temperatures for a given month m, within the time range a-b and temperature range min-max. m: The month the user chooses as a number...
cjiang94/INF3331-Python
assignment6/temperature_CO2_plotter.py
temperature_CO2_plotter.py
py
2,116
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 4, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "matpl...
29247518148
# Run 'discoronode.py' program to start processes to execute computations sent # by this client, along with this program. # This example is similar to 'discoro_client6.py', except it uses broadcasting # over Channel to send messages to remote coroutines to process, and uses # 'deque' module to implement circular buffe...
pgiri/asyncoro
examples/discoro_client6_channel.py
discoro_client6_channel.py
py
5,369
python
en
code
51
github-code
36
[ { "api_name": "collections.deque", "line_number": 21, "usage_type": "call" }, { "api_name": "asyncoro.disasyncoro.Channel", "line_number": 83, "usage_type": "call" }, { "api_name": "asyncoro.disasyncoro", "line_number": 83, "usage_type": "name" }, { "api_name": "a...
11168278407
import csv import json from collections import defaultdict import itertools import os import sys import argparse ## NB update relevant config file name here #from config2019 import * # Mr Gorbachev, tear down etc etc # Generate booth data structure (combinations hardcoded): NPP_FIELDS = ["ID", "Division", "Booth", "L...
alexjago/nPP-Senate
src/SA1s_Multiplier.py
SA1s_Multiplier.py
py
5,812
python
en
code
1
github-code
36
[ { "api_name": "sys.stderr", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sys.stderr.isatty", "line_number": 20, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 28, "usage_type": "call" }, { "api_name": "itertools.pe...
12534507732
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import datetime df = pd.read_csv("D-GROWTH.csv") df['Date'] = pd.to_datetime(df["Date"]) all_years = df['Date'].dt.year.unique() temp = {'Date': [], 'Growth': []} for i in all_years: for j in range(12, 0, -1): data = df[(df[...
icyboguyaman/Python-Small-Projects
hw1.py
hw1.py
py
1,139
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
30537139211
from tkinter import * from tkinter import messagebox from openpyxl import * import cv2 import pickle import cvzone import numpy as np import os root = Tk() root.title("ParkiN") root.geometry('925x500+300+200') root.configure(bg='#fff') root.resizable(False, False) def book(): vehicleno = user.ge...
FrostPrince003/Book2Park
parkin.py
parkin.py
py
8,405
python
en
code
0
github-code
36
[ { "api_name": "tkinter.messagebox.showerror", "line_number": 23, "usage_type": "call" }, { "api_name": "tkinter.messagebox", "line_number": 23, "usage_type": "name" }, { "api_name": "cv2.VideoCapture", "line_number": 105, "usage_type": "call" }, { "api_name": "os....
34145540015
msg = "good" import traceback import os try: import os import pickle import onnxruntime as rt from time import time from transformers import RobertaForSequenceClassification, RobertaTokenizer import numpy as np import urllib except Exception as e: msg = traceback.format_exc() tmp = "/tmp/" cold = True...
COS-IN/iluvatar-faas
src/load/functions/python3/gpu-functions/onnx-roberta/main.py
main.py
py
2,058
python
en
code
8
github-code
36
[ { "api_name": "traceback.format_exc", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.isfile", ...
43688718516
import torch from torch import nn from torch.nn import Sequential as Seq, Linear as Lin, Conv2d ############################## # Basic layers ############################## def act_layer(act, inplace=False, neg_slope=0.2, n_prelu=1): """ helper selecting activation :param act: :param inplace: :...
lightaime/sgas
gcn/gcn_lib/dense/torch_nn.py
torch_nn.py
py
2,774
python
en
code
157
github-code
36
[ { "api_name": "torch.nn.ReLU", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 21, "usage_type": "name" }, { "api_name": "torch.nn.LeakyReLU", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn", "line_number...
2303254132
import os import sys from os.path import join, dirname from dotenv import load_dotenv import datetime import time import schedule import logging import iso8601 from googleapiclient.discovery import build import functools logger = logging.getLogger('autosnap') logging.basicConfig(stream=sys.stdout, level=logging.INFO...
rehive/autosnap-docker
app.py
app.py
py
2,996
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.INFO", ...
20500455998
import mailbox from contextlib import contextmanager import tempfile from io import BytesIO import gzip import logging import requests from mlarchive2maildir.message import deobfuscate class MessageIdMaildir(mailbox.Maildir): """ An extension of the mailbox.Maildir class that you can ask whether a me...
flokli/mlarchive2maildir
mlarchive2maildir/mailbox.py
mailbox.py
py
3,148
python
en
code
2
github-code
36
[ { "api_name": "mailbox.Maildir", "line_number": 16, "usage_type": "attribute" }, { "api_name": "io.BytesIO", "line_number": 54, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 54, "usage_type": "call" }, { "api_name": "gzip.open", "line_nu...
15731209645
from __future__ import annotations from typing import Any from typing import Dict from typing import Set from sqlalchemy import CHAR from sqlalchemy import CheckConstraint from sqlalchemy import Column from sqlalchemy import event from sqlalchemy import ForeignKey from sqlalchemy import Index from sqlalchemy import i...
sqlalchemy/alembic
alembic/testing/suite/_autogen_fixtures.py
_autogen_fixtures.py
py
9,880
python
en
code
2,219
github-code
36
[ { "api_name": "typing.Set", "line_number": 34, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 34, "usage_type": "name" }, { "api_name": "sqlalchemy.event.listens_for", "line_number": 37, "usage_type": "call" }, { "api_name": "sqlalchemy.Table",...
13895020960
import matplotlib.pyplot as plt import numpy as np x = np.array([[1,0],[0,1],[0,-1],[-1,0],[0,2],[0,-2],[-2,0]]) y = np.array([-1,-1,-1,1,1,1,1]) def z(X): x1, x2 = X[0], X[1] t1 = x2**2 - 2*x1 - 2 t2 = x1**2 - 2*x2 - 1 return [t1,t2] T = np.array([z(i) for i in x]) for i in T: print(i) from sklearn import svm...
kevinliu726/MachineLearningTechnique
hw1/1.py
1.py
py
1,275
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.svm.SVC", "line_number"...
205686342
import tensorflow as tf import numpy as np import gym from gym.wrappers import Monitor import random import os import time def Policy(action_cnn,state,sess,epsilon, num_actions=4): preds = sess.run(action_cnn.preds,{action_cnn.input:state[np.newaxis,:]}) p = np.ones(num_actions)*epsilon/num_actions greedy_action =...
kabirahuja2431/DeepQLearning
dql.py
dql.py
py
3,990
python
en
code
3
github-code
36
[ { "api_name": "numpy.newaxis", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.ones", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.train.Saver", ...
33082220746
import detectron2 from detectron2.utils.logger import setup_logger import numpy as np import os, json, cv2, random from detectron2.data import MetadataCatalog, DatasetCatalog from detectron2.structures import BoxMode from detectron2.utils.visualizer import Visualizer setup_logger() # if your dataset is in COCO format...
sangminwoo/Temporal-Span-Proposal-Network-VidVRD
detectron/vidor_anno_to_coco_format.py
vidor_anno_to_coco_format.py
py
4,815
python
en
code
14
github-code
36
[ { "api_name": "detectron2.utils.logger.setup_logger", "line_number": 9, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path",...
10829381285
#!/usr/bin/env python import os, sys import json import messytables import subprocess from dgitcore.helper import cd from dgitcore.plugins.instrumentation import InstrumentationBase from dgitcore.config import get_config def run(cmd): output = subprocess.check_output(cmd, std...
pingali/dgit
dgitcore/contrib/instrumentations/executable.py
executable.py
py
3,917
python
en
code
15
github-code
36
[ { "api_name": "subprocess.check_output", "line_number": 13, "usage_type": "call" }, { "api_name": "subprocess.STDOUT", "line_number": 14, "usage_type": "attribute" }, { "api_name": "dgitcore.helper.cd", "line_number": 22, "usage_type": "call" }, { "api_name": "os....
21119796127
import heapq from math import inf from typing import List class Solution: def minimumTime(self, grid: List[List[int]]) -> int: m, n = len(grid), len(grid[0]) if grid[0][1] > 1 and grid[1][0] > 1: return -1 dis = [[inf] * n for _ in range(m)] dis[0][0] = 0 h = ...
plattanus/leetcodeDAY
python/2577. 在网格图中访问一个格子的最少时间.py
2577. 在网格图中访问一个格子的最少时间.py
py
961
python
en
code
0
github-code
36
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "math.inf", "line_number": 13, "usage_type": "name" }, { "api_name": "heapq.heappop", "line_number": 17, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_number":...
39853467321
import cv2 as cv import numpy as np im = cv.imread('car.png', 0) kernel = np.ones((5, 5), np.int16) * 1 / 25 out = cv.filter2D(im, -1, kernel) print(out) for i in range(len(out)): for j in range(len(out[0])): if out[i][j] < 128: out[i][j] = 255 else: out[i][j] = 0 cv.imsh...
RonaldCDO/Python
python_opencv/grayscale_images.py
grayscale_images.py
py
376
python
en
code
0
github-code
36
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.int16", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.filter2D", "line_number":...
4941442035
import requests import configparser import json cfg = configparser.ConfigParser() cfg.read("config.ini") _api_url = str(cfg["default"]["api_url"]) def test_post_scm_repo(): response = requests.post(f"{_api_url}/scm-repos", json={"url": "abc"}) assert response.status_code == 201 body = response.json() ...
shmenkins/acceptance-tests
shmenkins/at/api_test.py
api_test.py
py
378
python
en
code
0
github-code
36
[ { "api_name": "configparser.ConfigParser", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 11, "usage_type": "call" } ]
16103131667
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name='ISY994v5', version='0.9.7', description='ISY99 Controller Rest and Websocket client v5 firmware', author='Michael Cumming', author_email='mike@4831.com', long_description=long_descrip...
mjcumming/ISY994v5
setup.py
setup.py
py
804
python
en
code
4
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 17, "usage_type": "call" } ]
10514105287
import allure from selenium.webdriver.common.by import By from extensions import ui_actions from utilities.Base import Base @allure.step("Business Flow: Login") def login(email, password): ui_actions.update_text(Base.LOGIN_PAGE.textbox_user_email, email) ui_actions.update_text(Base.LOGIN_PAGE.textbox_passwor...
liorc955/Python-automation
workflows/web_flows.py
web_flows.py
py
3,153
python
en
code
0
github-code
36
[ { "api_name": "extensions.ui_actions.update_text", "line_number": 10, "usage_type": "call" }, { "api_name": "extensions.ui_actions", "line_number": 10, "usage_type": "name" }, { "api_name": "utilities.Base.Base.LOGIN_PAGE", "line_number": 10, "usage_type": "attribute" }...
41917076519
from flask import jsonify, make_response import src.flaskr.controllers.turn_logic as turn_logic from src.flaskr.controllers.uuid_supplier import UuidSupplier import src.flaskr.controllers.winner_logic as winner_logic from src.flaskr.models.game_model import Game, GameSchema, MoveSchema from src.flaskr.persistence.repos...
eriklong95/tiktak
src/flaskr/controllers/games_controller.py
games_controller.py
py
3,297
python
en
code
0
github-code
36
[ { "api_name": "src.flaskr.models.game_model.GameSchema", "line_number": 9, "usage_type": "call" }, { "api_name": "src.flaskr.models.game_model.MoveSchema", "line_number": 10, "usage_type": "call" }, { "api_name": "src.flaskr.persistence.repositories.game_repository_api.GameReposi...
70062828584
from flask import Blueprint, render_template, request, current_app,redirect from flask import url_for, flash from jobweb.decorators import admin_required from jobweb.models import db,User from jobweb.forms import UserRegisterForm, CompanyRegisterForm,UserEditForm, CompanyEditForm admin = Blueprint('admin', __name__, u...
LouPlus/jobplus3-9
jobweb/handlers/admin.py
admin.py
py
2,498
python
en
code
0
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "jobweb.decorators.admin_required", "line_number": 11, "usage_type": "name" }, { "api_name": ...
21325799107
from django_mongoengine.queryset import QuerySet from .config import ( HARD_DELETE, DELETED_INVISIBLE, DELETED_ONLY_VISIBLE, DELETED_VISIBLE, DELETED_VISIBLE_BY_FIELD, ) class SafeDeletionQuerySet(QuerySet): """Default queryset for the SafeDeletionQuerySetManager. Takes care of "lazily e...
ngocngoan/django-safedeletion-mongoengine
safedeletion_mongoengine/queryset.py
queryset.py
py
4,946
python
en
code
14
github-code
36
[ { "api_name": "django_mongoengine.queryset.QuerySet", "line_number": 12, "usage_type": "name" }, { "api_name": "config.DELETED_INVISIBLE", "line_number": 21, "usage_type": "name" }, { "api_name": "config.HARD_DELETE", "line_number": 41, "usage_type": "name" }, { "...
984949848
"""empty message Revision ID: dde24bfed677 Revises: 0c89b9c0a9cd Create Date: 2020-04-07 16:50:44.747914 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'dde24bfed677' down_revision = '0c89b9c0a9cd' branch_labels = None depends_on = None def...
torbjomg/pwa_flask_app
migrations/versions/dde24bfed677_.py
dde24bfed677_.py
py
1,867
python
en
code
0
github-code
36
[ { "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...
30337199579
import Gui import networkx as nx import random def ant(graph:nx.Graph, psize:int, node:tuple, pgraph, pherom, pheromcoef, update): ants = [] for i in range(psize): ants.append([set(),0]) findway(graph, pgraph , ants[-1], node, pheromcoef) update() s = node for n in ants[...
rawr-0/ants_algorithm_lab
main.py
main.py
py
1,524
python
en
code
0
github-code
36
[ { "api_name": "networkx.Graph", "line_number": 5, "usage_type": "attribute" }, { "api_name": "networkx.Graph", "line_number": 19, "usage_type": "attribute" }, { "api_name": "random.uniform", "line_number": 27, "usage_type": "call" }, { "api_name": "Gui.Window", ...
12607805013
from gevent import monkey monkey.patch_all() from bs4 import BeautifulSoup import requests from fake_useragent import UserAgent import gevent from gevent.queue import Queue import os def getPictures(): while not urls.empty(): item = urls.get_nowait() if not os.path.exists(f'F://meiziba//{item[1]}...
Kenny3Shen/CodeShen
Code/Python/Web Crawler/meiziba.py
meiziba.py
py
1,509
python
en
code
0
github-code
36
[ { "api_name": "gevent.monkey.patch_all", "line_number": 3, "usage_type": "call" }, { "api_name": "gevent.monkey", "line_number": 3, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "lin...
21809713879
import asyncio import logging from bleak import BleakClient, BleakScanner DEVICE_NAME = "iBobber" IBOBBER_ADDR = "34:14:B5:4B:B9:15" ACCEL_SERVICE_UUID = "1791FFA0-3853-11E3-AA6E-0800200C9A66" CUSTOM_SERVICE_UUID = "1791FF90-3853-11E3-AA6E-0800200C9A66" BATT_SERVICE_UUID = "0000180F-0000-1000-8000-00805F9B34FB" DEVIC...
limehouselabs/i.-bobba
ibobber/__main__.py
__main__.py
py
1,810
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 24, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.INFO...
36838033719
import os import sys from typing import List import yaml # Permit imports from "buildscripts". sys.path.append(os.path.normpath(os.path.join(os.path.abspath(__file__), '../../..'))) # pylint: disable=wrong-import-position from buildscripts.idl import lib from buildscripts.idl.idl import parser def gen_all_feature...
mongodb/mongo
buildscripts/idl/gen_all_feature_flag_list.py
gen_all_feature_flag_list.py
py
1,844
python
en
code
24,670
github-code
36
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.normpath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
24184494226
""" H4xton fake typing chat exploit """ import requests,os,sys,time,random class Discord(): def TypeExploit(token,channelid): url = f"https://canary.discord.com/api/v9/channels/{channelid}/typing" headers = { 'authority': 'canary.discord.com', 'content-length': '0', ...
lnfernal/Discord-Hearbeat-Exploit
main.py
main.py
py
1,350
python
en
code
0
github-code
36
[ { "api_name": "requests.request", "line_number": 31, "usage_type": "call" } ]
26383130759
import os os.environ["XLA_FLAGS"] = "--xla_force_host_platform_device_count=4" import sys from typing import Literal import pickle sys.path.append(snakemake.config['workdir']) import jax from jax.config import config config.update("jax_enable_x64", True) print(f"Jax device count: {jax.local_device_count()}") impor...
jarsba/gradu
scripts/create_models_for_linear_regression.py
create_models_for_linear_regression.py
py
4,405
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "jax.config.config.update",...
476311110
import json import clearskies from clearskies.handlers.exceptions import ClientError, InputError from clearskies.handlers.base import Base from .exceptions import ProducerError class NoInput(clearskies.handlers.SchemaHelper, Base): _configuration_defaults = { 'base_url': '', 'can_rotate': True, ...
cmancone/clearskies-akeyless-custom-producer
src/clearskies_akeyless_custom_producer/handlers/no_input.py
no_input.py
py
10,414
python
en
code
0
github-code
36
[ { "api_name": "clearskies.handlers", "line_number": 6, "usage_type": "attribute" }, { "api_name": "clearskies.handlers.base.Base", "line_number": 6, "usage_type": "name" }, { "api_name": "clearskies.authentication.public", "line_number": 27, "usage_type": "call" }, { ...
72975128425
from django import forms from crispy_forms.layout import Submit from core.forms.base_crispy_form import BaseCrispyForm from core.models.round import Round class WinnerForm(BaseCrispyForm, forms.ModelForm): SUBMIT_BUTTON_VALUE = "Declare Winner" SUBMIT_BUTTON_CSS_CLASSES = "btn-no-bg btn-outline-info" c...
lekjos/dailygroove
src/core/forms/winner_form.py
winner_form.py
py
1,864
python
en
code
2
github-code
36
[ { "api_name": "core.forms.base_crispy_form.BaseCrispyForm", "line_number": 9, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 9, "usage_type": "name" }, { "...
6788861571
import codecs from django.conf import settings from django.views.generic.edit import CreateView from django.contrib.auth.mixins import PermissionRequiredMixin from django.urls import reverse from django.http.response import HttpResponseRedirect from django.contrib import messages from achievement.models import Achiev...
tomasgarzon/exo-services
service-exo-core/consultant/views/network/bulk.py
bulk.py
py
3,853
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.auth.mixins.PermissionRequiredMixin", "line_number": 20, "usage_type": "name" }, { "api_name": "django.views.generic.edit.CreateView", "line_number": 21, "usage_type": "name" }, { "api_name": "django.conf.settings.CONSULTANT_FULL_PERMS_ADD_CONSULTANT...