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
670197752
import cv2 import argparse import numpy as np import time from datetime import datetime import mysql.connector import RPi.GPIO as GPIO db_connection = mysql.connector.connect( host="127.0.0.1", user="root", passwd="root", database="do_an" ) GPIO.setmode(GPIO.BCM) # GPIO.setwarnings(False) BUZZER= 23 # buzzS...
nguyenthinga-0206/Nhan-dien-dao-keo-bang-YoLo
Detection-object.py
Detection-object.py
py
5,643
python
en
code
0
github-code
21
[ { "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...
7291323317
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('core', '0011_auto_20150406_1529'), ] operations = [ migrations.AlterField( model_name='game', name='...
joshsamara/game-website
core/migrations/0012_auto_20150406_1611.py
0012_auto_20150406_1611.py
py
1,003
python
en
code
2
github-code
21
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
20114523901
import argparse from functools import partial import json import os import pickle from model_trainer.xgboost.xgboost_trainer import XGBoostTrainer from model_trainer.data.hold_out_data_box import HoldOutDataBox from model_trainer.data.kfold_data_box import KFoldDataBox from model_trainer.data import data_loader from tu...
erudic/mt-tabnet-xgboost-model-comparison
xgboost_tuning.py
xgboost_tuning.py
py
4,297
python
en
code
1
github-code
21
[ { "api_name": "tuning_config.base_class_weights_large.copy", "line_number": 19, "usage_type": "call" }, { "api_name": "tuning_config.base_class_weights_large", "line_number": 19, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 27, "usage_type": "call" ...
10417808272
import json from apache_ranger.model.ranger_base import RangerBase class RangerDataMaskDef: def __init__(self, maskTypes=None, accessTypes=None, resources=None): self.maskTypes = maskTypes if maskTypes is not None else [] self.accessTypes = accessTypes if accessTypes is not None else [] ...
dprophet/ranger_trino
intg/src/main/python/apache_ranger/model/ranger_service_def.py
ranger_service_def.py
py
6,197
python
en
code
3
github-code
21
[ { "api_name": "json.dumps", "line_number": 13, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 22, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 45, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 57, ...
73373244211
import logging from src.train_uni_self import MyDataset from src.train_uni_self import compute_accuracy from src.train_uni_self import GRUModel from config import NUM_ATTENTION_HEADS, NUM_HIDDEN_LAYERS, HIDDEN_SIZE from config import AUDIO_DIM, TEXT_DIM, GRU_DIM from config import USE_TEXT, USE_AUDIO, unimodal_folder, ...
Soumya-dutta/MELD_emotion_recognition
src/test_uni_self.py
test_uni_self.py
py
2,946
python
en
code
0
github-code
21
[ { "api_name": "torch.backends", "line_number": 15, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.get...
16653768786
import numpy as np import cv2 import pafy # live youtube video link url = "https://www.youtube.com/watch?v=X_EWYemclKA" vPafy = pafy.new(url) play = vPafy.getbest(preftype="mp4") cap = cv2.VideoCapture(play.url) # Check if camera opened successfully if (cap.isOpened() == False): print("Error opening...
SukruAlkan/YoutubeLiveVideoStreaming
App.py
App.py
py
1,015
python
en
code
0
github-code
21
[ { "api_name": "pafy.new", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_n...
73278220531
"""module for windy api requests--can be used to get images, livestreams, and videos by location (coordinates), date, and category""" import requests import os from functools import lru_cache key = os.environ.get('WINDY_KEY') header = {'x-windy-key': key} """caches category list""" @lru_cache(maxsize=1) def show_c...
qdaniel4/capstoneProject4
windy_module/windy_api_manager.py
windy_api_manager.py
py
2,153
python
en
code
1
github-code
21
[ { "api_name": "os.environ.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "functools.lru_cache", "...
40471112351
# -*- coding: utf-8 -*- from scrapy import Selector from util import DateUtil def parse(html, source_url=u''): response = Selector(text=html) content_html = response.xpath(u'//div[@class="texttit_m1"] | //div[@class="vp-article-cnt"]') if not len(content_html): return # 去除内部不需要的标签 conte...
MaGuiSen/url_catch
parse/JinRongJieParse.py
JinRongJieParse.py
py
3,352
python
en
code
0
github-code
21
[ { "api_name": "scrapy.Selector", "line_number": 8, "usage_type": "call" } ]
34977997851
# M. P. Hayes UCECE from ipywidgets import interact from matplotlib.pyplot import subplots from numpy import zeros, arange from .txreflect import txreflect def txline_demo2_plot(Z0=60, ZD=40, ZL=1e6): # Driver voltage. Vs = 4.0 # Delay along transmission line (samples). T = 100 # Duration of ex...
mph-/es-notebooks
intro/demos/txline_demo2.py
txline_demo2.py
py
1,762
python
en
code
0
github-code
21
[ { "api_name": "numpy.arange", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "txreflect.txreflect", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplo...
35915887875
import streamlit as st import cv2 import numpy as np import tensorflow as tf import time import os from patchify import patchify, unpatchify import matplotlib.pyplot as plt from PIL import Image import keras def main(): selected_box = st.sidebar.selectbox( 'Choose an option..', (...
sharathsolomon/ImageDenoising
model.py
model.py
py
3,443
python
en
code
8
github-code
21
[ { "api_name": "streamlit.sidebar.selectbox", "line_number": 13, "usage_type": "call" }, { "api_name": "streamlit.sidebar", "line_number": 13, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL...
7693666703
import torch import inspect import glob from pathlib import Path import re import datetime import math import os import json from utils.label_process import xyxy2xywh from utils.logger import print_log # def mkdir(path): # if not os.path.exists(path): # os.makedirs(path) def mkdir(path): p = Path(pa...
yyynbone/Multidet
utils/mix_utils.py
mix_utils.py
py
6,504
python
en
code
1
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 20, "usage_type": "call" }, { "api_name": "inspect.signature", "line_number": 28, "usage_type": "call" }, { "api_name": "inspect.Parameter", "line_number": 29, "usage_type": "attribute" }, { "api_name": "torch.tensor", ...
70040135094
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 15 11:31:25 2020 WPI CS539 spring 2020 Team Assignment 1 problem 1.2 """ import numpy as np from sklearn.neighbors import KNeighborsClassifier as KNN from sklearn.linear_model import LogisticRegression from sklearn.datasets import fetch_openml from...
kforti/machine_learning_project_1
problem_1_2/problem_1_2.py
problem_1_2.py
py
2,442
python
en
code
0
github-code
21
[ { "api_name": "sklearn.datasets.fetch_openml", "line_number": 17, "usage_type": "call" }, { "api_name": "time.time", "line_number": 39, "usage_type": "call" }, { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 41, "usage_type": "call" }, { "ap...
12094549
import boto3 #Enter your ACCESS_KEY and ACCESS_ID aws_region = "ap-south-1" access_id = "ACCESS_KEY" access_key = "ACCESS_ID" def PrepareItem(filedata, type): try: filedata = filedata.split('\n') print(filedata) filedata.remove('') data = [] for ele in filedata: ...
abhikarkamkar/aws
Emr_s3_DynamoDb/aggregationsPoc.py
aggregationsPoc.py
py
6,286
python
en
code
0
github-code
21
[ { "api_name": "boto3.Session", "line_number": 88, "usage_type": "call" } ]
1913047691
""" Takes given link and scrape relevant information from it. Relevant information includes: * Album name * Artist name * Album release date * Metascore * User score * Link to individual album page * Link to artist page * Publisher name * Link to publisher's Metacritic page * Link to image of album cover * Listed genre...
doronreiffman/web_scraper
metacritic_scraper.py
metacritic_scraper.py
py
24,930
python
en
code
0
github-code
21
[ { "api_name": "config.LOGFILE_DEBUG", "line_number": 40, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 41, "usage_type": "call" }, { "api_name": "config.LOGFILE_NAME", "line_number": 41, "usage_type": "attribute" }, { "api_name":...
7688544943
import numpy as np import tkinter as tk import matplotlib.pyplot as plt import seaborn as sns from matplotlib.backends.backend_agg import FigureCanvasAgg from .host_frame import HostF class FrameScalers(HostF): def __init__(self, master, width, height, master_canvas, master_host_canvas, master_object): ...
AddMELAB/pydrm_GUI
pydrm/app/frame_scalers.py
frame_scalers.py
py
5,433
python
en
code
0
github-code
21
[ { "api_name": "host_frame.HostF", "line_number": 9, "usage_type": "name" }, { "api_name": "host_frame.HostF.__init__", "line_number": 12, "usage_type": "call" }, { "api_name": "host_frame.HostF", "line_number": 12, "usage_type": "name" }, { "api_name": "tkinter.La...
9375451926
# Inspired by jsonrpc_websocket import random import asyncio import aiohttp # websockets require python >= 3.6.1 class JsonRpc(): def __init__(self, url: str): self._session = aiohttp.ClientSession() self._client = None self._url = url self._pending_messages = {} async def send...
dalcde/xopy
xo/jsonrpc.py
jsonrpc.py
py
2,239
python
en
code
0
github-code
21
[ { "api_name": "aiohttp.ClientSession", "line_number": 8, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 17, "usage_type": "call" }, { "api_name": "asyncio.get_running_loop", "line_number": 49, "usage_type": "call" }, { "api_name": "asyncio....
18380918261
import os import pytest import requests from wazuh_testing.tools.configuration import check_apply_test, get_api_conf # Marks pytestmark = pytest.mark.server # Configurations test_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data') configurations_path = os.path.join(test_data_path, 'conf....
wazuh/wazuh-qa
tests/integration/test_api/test_config/test_https/test_https.py
test_https.py
py
2,755
python
en
code
29
github-code
21
[ { "api_name": "pytest.mark", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line...
4713262376
# -*- coding: utf-8 -*- """ Created on Thu Jun 23 16:51:10 2016 @author: pawel.cwiek """ # ElementTree is the fastest and uses least memory for parsing xml (even better is cElementTree) #import xml.etree.ElementTree as ET # #cabs_xml = ET.parse('cabs.xml') # #cabs = cabs_xml.findall('type') #for item in cabs.iter('u...
simplynail/cfd_6sigma_rs
6sigma_results.py
6sigma_results.py
py
11,640
python
en
code
1
github-code
21
[ { "api_name": "pprint.PrettyPrinter", "line_number": 38, "usage_type": "call" }, { "api_name": "xml.sax.saxutils.XMLGenerator", "line_number": 41, "usage_type": "attribute" }, { "api_name": "xml.sax.saxutils", "line_number": 41, "usage_type": "name" }, { "api_name...
27485468049
import csv import instmatcher import argparse import pprint import json def classify(sample, url): pp = pprint.PrettyPrinter(indent=4) instmatcher.init(url) result = sample + '_classified' with open(sample, 'r') as s, open(result, 'w') as r: reader = csv.reader(s) writer = csv.writer(r) fieldnames = nex...
qtux/instmatcher
docs/analyse.py
analyse.py
py
4,328
python
en
code
1
github-code
21
[ { "api_name": "pprint.PrettyPrinter", "line_number": 8, "usage_type": "call" }, { "api_name": "instmatcher.init", "line_number": 9, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 13, "usage_type": "call" }, { "api_name": "csv.writer", "line...
24823731878
"""Scripts & operations for maintaining my Zotero library using Pyzotero.""" import re import argparse from itertools import chain from pyzotero import zotero from boltons.iterutils import remap import settings # Regex patterns for words in a title that shouldn't be lowercased # e.g. all-caps, CamelCase, etc. CONSER...
akokai/zotscripts
zotscripts.py
zotscripts.py
py
6,247
python
en
code
1
github-code
21
[ { "api_name": "re.compile", "line_number": 22, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 24, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 33, "usage_type": "call" }, { "api_name": "boltons.iterutils.remap", "...
29141125472
import argparse import cv2 import tensorflow as tf import numpy as np import scipy.misc import scipy.signal import pickle import json import os, glob import math import copy from utils import * import time from scipy import interpolate #notes # -did I mix up x and y again? always worth checking #debugging import ...
guoqi1123/focaltrack
extra/focaltrack_nooptics.py
focaltrack_nooptics.py
py
53,029
python
en
code
3
github-code
21
[ { "api_name": "threading.Condition", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.FONT_HERSHEY_DUPLEX", "line_number": 38, "usage_type": "attribute" }, { "api_name": "threading.Thread", "line_number": 57, "usage_type": "attribute" }, { "api_name":...
23998673907
# render template is to render the html file imported from flask from fileinput import filename from random import seed from flask import Flask, render_template, request, session, redirect # import flask sql Alchemy from flask_sqlalchemy import SQLAlchemy from datetime import datetime # import json file imp...
ngarg2k2/python-flask-blog
main.py
main.py
py
7,537
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 33, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 37, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 65, "usage_type": "call" }, { "api_name": "sympy.content", ...
23458720968
import logging from elasticsearch import Elasticsearch def connect_elasticsearch(): _es = None _es = Elasticsearch([{'host': 'elasticsearch', 'port': 9200}]) if _es.ping(): print('Yay Connect') else: print('Awww it could not connect!') return _es if __name__ == '__main__': lo...
nguyenthucquanghung/movies_crawler
test_es.py
test_es.py
py
503
python
en
code
0
github-code
21
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 16, "usage_type": "attribute" } ]
7553307970
import os from setuptools import setup from torch.utils.cpp_extension import BuildExtension, CUDAExtension from version import __version__ sources = [os.path.join('backend', f'pybind_cuda.cpp'), os.path.join('backend', f'spconv.cu'), os.path.join('backend', f'hash.cu')] setup( name='PCEngine', version=__versi...
hkeee21/PCEngine
setup.py
setup.py
py
618
python
en
code
2
github-code
21
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "version.__version__", "li...
4486551780
import numpy as np import torch from torch.utils.data import DataLoader, SequentialSampler from sklearn.metrics import f1_score, accuracy_score from transformers import AutoModelForSequenceClassification from tqdm import tqdm from utils.Logger import logger @torch.no_grad() def evaluate(model: AutoModelForSequenceCla...
fezateam/ftc_feza_text_classification
utils/Evaluation.py
Evaluation.py
py
3,268
python
en
code
3
github-code
21
[ { "api_name": "transformers.AutoModelForSequenceClassification", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 28, "usage_type": "call" }, { "ap...
28516399966
import datetime import pytest from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities @pytest.fixture def chrome_browser(request): d = DesiredCapabilities.CHROME opt = webdriver.ChromeOptions() opt.add_experimental_option('w3c', False) d['loggingPr...
SamVyazemsky/otus
PythonQA/Lesson12/test_performance_log.py
test_performance_log.py
py
675
python
en
code
1
github-code
21
[ { "api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities.CHROME", "line_number": 9, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities", "line_number": 9, "usage_type": "name" }, { "api_name": "s...
28684995716
import re import requests from lxml.html import fromstring, tostring def download(url, user_agent='wswp', num_retries=2, proxies=None): print('Downloading: ', url) headers = {'User-Agent': user_agent} try: resp = requests.get(url, headers=headers, proxies=proxies) html = resp.text i...
QTYResources/wswp
Chapter02/ScrapingArea04.py
ScrapingArea04.py
py
1,108
python
en
code
1
github-code
21
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 17, "usage_type": "attribute" }, { "api_name": "lxml.html.fromstring", "line_number": 24, "usage_type": "call" } ]
1749673150
import torch.nn as nn class FeedForwardBlock(nn.Module): def __init__(self, in_size, hidden_size, dropout_prob=0.1): super().__init__() self.lin1 = nn.Linear(in_size, hidden_size) self.relu = nn.ReLU() self.dropout = nn.Dropout(dropout_prob) self.lin2 = nn.Linear(hidden_si...
xiaodanhu/parsing
src_4/model/layers/feedforward_block.py
feedforward_block.py
py
481
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
19303741673
from flask import Flask from flask_restx import Api, Resource, reqparse import json import os from modules.model import read_data, fitting, predicting app = Flask(__name__) api = Api(app) params_to_fit = reqparse.RequestParser() params_to_fit.add_argument('model_id', help...
DSimonyan/MLops_HW1_public
app.py
app.py
py
6,314
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_restx.Api", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_restx.reqparse.RequestParser", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_re...
39364984177
from anytree import Node, RenderTree import uuid class MyNode(Node): def __init__(self, name, parent=None, start=None, end=None): super().__init__(name, parent) self.start = start self.end = end self.id = uuid.uuid4() self.suffix_link = None # Adding suffix link class Ukko...
StrikerG/Efficient-Algorithms-for-Text-Search-and-Retrieval
BasicAlgorithm/suffix_tree_ukkonen.py
suffix_tree_ukkonen.py
py
7,380
python
en
code
0
github-code
21
[ { "api_name": "anytree.Node", "line_number": 4, "usage_type": "name" }, { "api_name": "uuid.uuid4", "line_number": 9, "usage_type": "call" }, { "api_name": "anytree.RenderTree", "line_number": 80, "usage_type": "call" } ]
19394402830
# -*- coding:UTF-8 -*- """ 爬虫父类 @author: hikaru email: hikaru870806@hotmail.com 如有问题或建议请联系 """ import codecs import configparser import os import platform import sys import threading import time import traceback from typing import Any, Callable, Optional, Union, Type, Self from common import const, browser, file, log,...
yxw19870806/Py3Crawler
common/crawler.py
crawler.py
py
46,801
python
en
code
4
github-code
21
[ { "api_name": "platform.system", "line_number": 19, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 23, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 27, "usage_type": "name" }, { "api_name": "common.tool.remove_string_p...
18958880985
from app.models import db, Endorsement, environment, SCHEMA from sqlalchemy.sql import text def seed_endorsements(): all_endorsements = [ {'skill_id': 1, 'endorser_id': 3, 'endorsee_id': 1}, {'skill_id': 2, 'endorser_id': 3, 'endorsee_id': 1}, {'skill_id': 3, 'endorser_id': 3, 'endorsee_id'...
yhtay/EmployedIn-Capstone
app/seeds/endorsements.py
endorsements.py
py
1,451
python
en
code
0
github-code
21
[ { "api_name": "app.models.Endorsement", "line_number": 21, "usage_type": "call" }, { "api_name": "app.models.db.session.add", "line_number": 26, "usage_type": "call" }, { "api_name": "app.models.db.session", "line_number": 26, "usage_type": "attribute" }, { "api_n...
42825214566
from sqlalchemy import create_engine from databases import Database def run_sql_alchemy(sql: str): engine = create_engine("sqlite:///movies.db") res = engine.execute(sql) return [dict(i) for i in res] async def run_asql(sql: str): dbase = Database("sqlite:///movies.db") res = await dbase.fetch_a...
ipotemkin/coursework3
app/utils.py
utils.py
py
506
python
en
code
1
github-code
21
[ { "api_name": "sqlalchemy.create_engine", "line_number": 6, "usage_type": "call" }, { "api_name": "databases.Database", "line_number": 12, "usage_type": "call" }, { "api_name": "databases.Database", "line_number": 18, "usage_type": "call" } ]
2105366640
""" Train roberta model with counterfactuals """ import os import logging import json from typing import List, Tuple import collections import pandas as pd import numpy as np import torch from transformers import ( AutoTokenizer, AutoConfig, AutoModelForQuestionAnswering, TrainingArguments, Traine...
UKPLab/CATfOOD
src/cf_generation/baseline_generation/cartography/run_train.py
run_train.py
py
14,108
python
en
code
3
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "wandb.init", "line_number": 50, "usage_type": "call" }, { "api_name": "wandb.run", "line_number": 60, "usage_type": "attribute" }, { "api_name": "transformers.Trainer", ...
19122284951
import pygame import time import math class duck(): def __init__(self,spriteSet): self.x = 400 self.y = 400 self.dir = 0 self.moveSpeed =100 self.spriteSet =spriteSet self.renderIndex = 0 def playerMove(self,deltaT): keys=pygame.key.get_pressed() if keys[pyg...
itsvivianmill/GU-Hackathon-2023
src/playerObj.py
playerObj.py
py
2,797
python
en
code
0
github-code
21
[ { "api_name": "pygame.key.get_pressed", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.key", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pygame.K_UP", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pygame.K_w", ...
27792666045
import sqlite3 import datetime con = sqlite3.connect("../ProjectMgmt.db") cur = con.cursor() # cur.execute(""" # INSERT INTO Task_Card VALUES # (?, ?, ?, ?, ?, ?, ?) # """, (('54321', 'Card1', 'Card1 text', datetime.date.today(), datetime.date.today(), False, '77889'))) cur.execute(""" INSERT INTO us...
ZhiRongDev/ProjectMgmt
server/sql/test/add.py
add.py
py
482
python
en
code
0
github-code
21
[ { "api_name": "sqlite3.connect", "line_number": 4, "usage_type": "call" } ]
42679338563
import scipy.io.wavfile #import soundfile as sf from pydub import AudioSegment import numpy as np import matplotlib.pyplot as plt from numpy import fft as fft import librosa.core as librosa import librosa.display as librosa_display # files src ...
ldelecourt/music_recognition
v0/v0.py
v0.py
py
3,625
python
en
code
0
github-code
21
[ { "api_name": "pydub.AudioSegment.from_mp3", "line_number": 17, "usage_type": "call" }, { "api_name": "pydub.AudioSegment", "line_number": 17, "usage_type": "name" }, { "api_name": "scipy.io.wavfile.io.wavfile.read", "line_number": 20, "usage_type": "call" }, { "a...
1180625171
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 基于python docxtpl,word版报告自动化 """ # --------- # Change Logs: # # --------- __author__ = 'Li Pidong' __email__ = 'lipidong@126.com' __version__ = '1.0.1' __status__ = 'Production' import os import sys if sys.version < '3': # 兼容2/3 reload(sys) sys.setdefaultenc...
cangfengzhe/grandcamp
bootcamp/report/word_report.py
word_report.py
py
8,721
python
en
code
0
github-code
21
[ { "api_name": "sys.version", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sys.setdefaultencoding", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 33, "usage_type": "call" }, { ...
16709384628
import sys from time import * import datetime as dt from PyQt5.QtWidgets import QDialog, QMainWindow, QApplication, QPushButton, QLabel, QLineEdit from PyQt5 import uic from PyQt5.QtCore import QTimer, QTime class Stopwatch(QDialog): def __init__(self): self.history = [] super().__init__() ...
Medvedeva-J/PROJECT_QT
project_stopwatch.py
project_stopwatch.py
py
3,882
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 9, "usage_type": "name" }, { "api_name": "PyQt5.uic.loadUi", "line_number": 13, "usage_type": "call" }, { "api_name": "PyQt5.uic", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.datetime.n...
23549444081
import os import pandas as pd import matplotlib.pyplot as plt import numpy as np import gym import seaborn as sns import warnings warnings.filterwarnings('ignore') def save_graph(env_name = 'BipedalWalker-v2', episode = 3, called = 'state', dimension = 24, fig_width = 4, fig_height = 6,figsize = (20, 10)): #...
stoneshadows/DRL-coverage
LunarLander-v2/alg/TD3/plot_values.py
plot_values.py
py
7,586
python
en
code
0
github-code
21
[ { "api_name": "warnings.filterwarnings", "line_number": 8, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
31707054517
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # main page! url(r'^$', 'harvardplanner.views.home'), # url patterns for user authentication url(r'^login$', 'ha...
johnsturm/hplanner
harvardplanner/urls.py
urls.py
py
799
python
en
code
0
github-code
21
[ { "api_name": "django.conf.urls.patterns", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" }, { "api_name": "dja...
3982233272
import argparse from . import data def main(): parser = argparse.ArgumentParser( epilog="not for production usage!!!" ) commands = parser.add_subparsers(title='command', dest='command', required=True) init_parser = commands.add_parser('init') init_parser.set_defaults(func...
saymurrmeow/pygit
app/cli.py
cli.py
py
385
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" } ]
25909932448
# coding: utf8 """ 两边5像素间隔,图片中间10像素间隔 5 + 148 + 10 + 226 + 10 + 76 + 5 = 480 预留10像素buffer=490 最高的item29 + 间隔5 = 一个item的高度34 """ from PIL import Image from datetime import datetime def combine_image(item_count): new_img = Image.new("RGB", (490, item_count * 34)) x = 5 y = 5 for idx in range(1, item_count + 1): i...
Morisummer135/trader_data_catcher
image_combine.py
image_combine.py
py
849
python
en
code
0
github-code
21
[ { "api_name": "PIL.Image.new", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 12, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number":...
4110403700
import os import utils from PIL import Image from xml.dom.minidom import parse def makeAnnotationXML(file_name): xml_file_path = utils.XML_PATH + utils.get_name_no_ext(file_name) + '.xml' dom = parse(xml_file_path) # 修复高宽 width = int(dom.getElementsByTagName('width')[0].childNodes[0].data) height ...
f1amingo/Black-Smoke-Trucks-Detection
代码 Code/ImgPreProcess/do_transpose.py
do_transpose.py
py
1,946
python
en
code
22
github-code
21
[ { "api_name": "utils.XML_PATH", "line_number": 8, "usage_type": "attribute" }, { "api_name": "utils.get_name_no_ext", "line_number": 8, "usage_type": "call" }, { "api_name": "xml.dom.minidom.parse", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.re...
16842986162
from django.conf.urls import url from . import views handler404 = 'views.invalid page' urlpatterns = [ # ex: /library/ url(r'^$', views.index, name='index'), # ex: /library/user/login/ url(r'^user/loginoption/$', views.userloginoption, name='userloginoption'), # ex: /library/user/signup/ url(...
Arjun-Suresh/Online-book-mgmt
library/urls.py
urls.py
py
5,404
python
en
code
0
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 13, "usage_type": "call" }, { "api_name": "django....
42712482134
import twint import os import datetime from collections import Counter import re import nltk from nltk.tokenize import word_tokenize, sent_tokenize from nltk.stem import WordNetLemmatizer from nltk.corpus import stopwords from .upload import upload from utils.utils import calculate_time, save_date from config import ke...
louixp/CoroNow
twitter/scrape.py
scrape.py
py
2,791
python
en
code
2
github-code
21
[ { "api_name": "ssl._create_unverified_context", "line_number": 21, "usage_type": "attribute" }, { "api_name": "ssl._create_default_https_context", "line_number": 25, "usage_type": "attribute" }, { "api_name": "nltk.download", "line_number": 26, "usage_type": "call" }, ...
27315212652
#from crypt import methods from flask import Blueprint, render_template, redirect, request, current_app, session from flask.helpers import url_for import os from flask_mail import Message touristdestination = Blueprint("touristdestination", __name__, static_folder="static", template_fold...
itsaseemsharma/Explorehimachal
Explorehimachal/modules/TouristsDestination/TouristDestinationController.py
TouristDestinationController.py
py
11,871
python
en
code
0
github-code
21
[ { "api_name": "flask.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.session.get", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 20, "usage_type": "name" }, { "api_name": "User.UserServices.User...
71103910772
from sklearn.datasets import load_iris import torch import torch.nn as nn iris = load_iris() class Net(nn.Module): def __init__(self): super().__init__() self.linear = nn.Linear(4, 3) self.pool = nn.MaxPool1d(1) def forward(self, x): x = self.linear(x) # x = -self.po...
grahamannett/tellem
examples/k_means.py
k_means.py
py
552
python
en
code
0
github-code
21
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Linear...
580273833
import requests import json import os # retrieve Twitter bearer token # > export 'BEARER_TOKEN'='<your_bearer_token>' token = os.environ.get("BEARER_TOKEN") # Documentation: # https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-mentions def create_url(): """ Creat...
lucascorumba/study-projects
tweet-inverted-index/get_tweets.py
get_tweets.py
py
2,206
python
en
code
0
github-code
21
[ { "api_name": "os.environ.get", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "requests.request", "line_number": 47, "usage_type": "call" }, { "api_name": "json.dumps", "line_...
22926496575
# encoding: utf-8 # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import, divisio...
mozilla/jx-sqlite
vendor/mo_dots/objects.py
objects.py
py
4,387
python
en
code
35
github-code
21
[ { "api_name": "mo_future.Mapping", "line_number": 27, "usage_type": "name" }, { "api_name": "mo_dots.utils.OBJ", "line_number": 33, "usage_type": "argument" }, { "api_name": "mo_dots.utils.OBJ", "line_number": 36, "usage_type": "argument" }, { "api_name": "mo_dots...
7441000472
# -*- coding: utf-8 -*- """urls.py: Django """ from __future__ import unicode_literals import logging from django.conf.urls import url from company_registration import views __author__ = 'Steven Klass' __date__ = '4/3/12 8:59 PM' __copyright__ = 'Copyright 2012-2013 Pivotal Energy Solutions. All rights reserved.' _...
pivotal-energy-solutions/django-company-registration
company_registration/urls.py
urls.py
py
920
python
en
code
2
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 19, "usage_type": "call" }, { "api_name": "company_registration.views.Register.as_view", "line_number": 19, "usage_type": "call" }, { ...
24250783402
# Sampler Module # Obtains batches of samples from a specific environment for training # (c) 2018 Carson Eisenach import gym import torch import logging import random import copy logger = logging.getLogger(__name__) from utils import MultiRingBuffer from running_stat import ZFilter def _torch_from_float(val): ...
ceisenach/torchkit
sampler.py
sampler.py
py
4,309
python
en
code
3
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.FloatTensor", "line_number": 18, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 28, "usage_type": "call" }, { "api_name": "utils.MultiRingBuffer", ...
18998133375
#!/usr/bin/env python3 from gi.repository import Gtk from gi.repository import GObject import argparse class BreakWindow(Gtk.Window): def __init__(self, period_timer): Gtk.Window.__init__(self, title="Take a break") self.period_timer = period_timer self.rest = self.period_timer.break_tim...
violarium/mini_nap
mini_nap.py
mini_nap.py
py
3,765
python
en
code
0
github-code
21
[ { "api_name": "gi.repository.Gtk.Window", "line_number": 8, "usage_type": "attribute" }, { "api_name": "gi.repository.Gtk", "line_number": 8, "usage_type": "name" }, { "api_name": "gi.repository.Gtk.Window.__init__", "line_number": 10, "usage_type": "call" }, { "a...
9696705352
# -*- coding: utf-8 -*- """ ================================== Specify Spatial Grids ================================== Created on Mon Aug 22 14:42:26 2016 @author: xiaomuliu """ import numpy as np from shapely.geometry import Point def vectorized_grid(shpfile,cellsize,center=True): cellsize_x,...
xiaomuliu/SpatioTemporalPredictiveModeling
Grid/SetupGrid.py
SetupGrid.py
py
4,746
python
en
code
9
github-code
21
[ { "api_name": "numpy.arange", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.dstack", "line_num...
35375757397
from datetime import datetime, timedelta import json import os, glob import string import create_sql import csv import sys import pandas as pd from featureExtration import featureExtration, featureExtration4, getAllSite2 import numpy as np from nltk import word_tokenize, PorterStemmer from nltk.corpus import stopwords...
abhaygill338/Semantic_Web_Mining_Project
CODE/PreProcess/open_file.py
open_file.py
py
9,509
python
en
code
2
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 17, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.wo...
3474885901
import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg img = mpimg.imread('myface.jpg') R, G, B = img[:,:,0], img[:,:,1], img[:,:,2] imgGray = 0.2989 * R + 0.5870 * G + 0.1140 * B #모서리 부분 좌표 찾기 ang = (np.pi/180)*54 a = np.array([[0,599,599,0],[0,0,799,799]]) h0 = np.array([[np.cos(ang),-1...
seonginnnnn/Digital_Image_processing
image_interpolation.py
image_interpolation.py
py
2,541
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.image.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.image", "line_number": 5, "usage_type": "name" }, { "api_name": "numpy.pi", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.array", ...
3027869865
import os import pathlib from importlib.machinery import FileFinder from pkgutil import ModuleInfo from mock import patch from prowler.lib.check.check import ( exclude_checks_to_run, exclude_services_to_run, get_checks_from_input_arn, get_regions_from_audit_resources, list_modules, list_servic...
gopikrishna72/prowl
tests/lib/check/check_test.py
check_test.py
py
16,776
python
en
code
0
github-code
21
[ { "api_name": "pkgutil.ModuleInfo", "line_number": 23, "usage_type": "call" }, { "api_name": "importlib.machinery.FileFinder", "line_number": 24, "usage_type": "call" }, { "api_name": "pkgutil.ModuleInfo", "line_number": 30, "usage_type": "call" }, { "api_name": "...
2920767340
import requests import config def report_error_raw(order: dict, user_id: int): try: kwargs = { "chat_id": user_id, "text": "Произошла ошибка. Перешли это сообщение администатору бота, пожалуйста.\n\n" + order.get("error_type"), } r = requests.post( ...
chemradio/cta-gfx-helper
sender_engine/send_process/report_error.py
report_error.py
py
1,223
python
ru
code
2
github-code
21
[ { "api_name": "requests.post", "line_number": 14, "usage_type": "call" }, { "api_name": "config.SEND_MESSAGE_TELEGRAM_API_ENDPOINT", "line_number": 15, "usage_type": "attribute" } ]
6504264290
import sys from bs4 import BeautifulSoup, Comment, NavigableString import fire from pathlib import Path import pandas as pd import numpy as np import json import re from ast import literal_eval from collections import OrderedDict from dataclasses import dataclass from typing import Set from axcell.data.table import Ta...
paperswithcode/axcell
axcell/data/extract_tables.py
extract_tables.py
py
12,182
python
en
code
365
github-code
21
[ { "api_name": "pandas.io", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pandas.io", "line_number": 36, "usage_type": "attribute" }, { "api_name": "ast.literal_eval", "line_number": 54, "usage_type": "call" }, { "api_name": "re.compile", "line...
16636595916
import json import requests from bs4 import BeautifulSoup import re import time from datetime import datetime, timedelta from .. import db from ..model.Usage import UsageModel class Hospital(): name = None channel_secret = None channel_access_token = None redis_channel = None line_bot_api = None ...
img21326/LineBotWatchDoctor
app/_class/Hospital.py
Hospital.py
py
12,431
python
en
code
0
github-code
21
[ { "api_name": "model.Usage.UsageModel", "line_number": 48, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 71, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 71, "usage_type": "name" }, { "api_name": "json.l...
38440269951
from trytond.model import fields from trytond.pool import PoolMeta from trytond.transaction import Transaction from trytond.config import config from mimetypes import guess_type from PIL import Image import os import hashlib __all__ = ['User'] AVATAR_SIZE = 150 IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/gif'] ...
NaN-tic/trytond-user_avatar
user.py
user.py
py
4,305
python
en
code
0
github-code
21
[ { "api_name": "trytond.pool.PoolMeta", "line_number": 16, "usage_type": "name" }, { "api_name": "trytond.model.fields.Function", "line_number": 18, "usage_type": "call" }, { "api_name": "trytond.model.fields", "line_number": 18, "usage_type": "name" }, { "api_name...
74016453494
from flask import Flask from flask import render_template app = Flask(__name__) import utils from flask import jsonify from jieba.analyse import extract_tags @app.route('/') def cov_index_page(): # put application's code here return render_template("index.html") @app.route('/time') def get_time(): ...
hellotycoon/m_coivdMap
Cov_Map/Project/main.py
main.py
py
4,053
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.get_time", "line_number": 15, "usage_type": "call" }, { "api_name": "utils.get_cov_trend_c...
35247915140
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. """setuptools install script""" from pathlib import Path from setuptools import find_packages from setuptools import ...
nth10sd/bstrap
setup.py
setup.py
py
4,196
python
en
code
1
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 86, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 98, "usage_type": "call" } ]
70467862452
import sys from PyQt5.QtWidgets import QApplication, QMainWindow,QWidget,QGridLayout class Calculadora(QMainWindow): def __init__(self, parent=None): super().__init__(parent) self.setWindowTitle('Calculadora pica') self.setFixedSize(400,400) if __name__ == '__main__': qt = QApplicatio...
atico0/python
novo_curso/interfacegrafica2.py
interfacegrafica2.py
py
387
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 5, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" } ]
16641265666
from sklearn.linear_model import Perceptron from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score,confusion_matrix,classification_report import pandas as pd perceptron_train = pd.read_csv('../FeaturesCsvFile/featuresfile.csv') perceptron_test = pd.read_csv('../FeaturesCsvFile/...
bkommineni/Activity-Recognition-Using-Sensordata
NeuronBinaryClassification/Classification/perceptronClassification.py
perceptronClassification.py
py
973
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.linear_model.Perceptron", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn...
8297267733
import os from copy import deepcopy from imports import * from utils import * from data import * from args import * from collections import OrderedDict from itertools import combinations from matplotlib.lines import Line2D from matplotlib.patches import Rectangle import matplotlib.colors def get_var_info(axes, names, ...
kpedro88/evn_svj_public
analyze.py
analyze.py
py
12,939
python
en
code
0
github-code
21
[ { "api_name": "collections.OrderedDict", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 15, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 17, "usage_type": "call" }, { "api_name": "collect...
29016912035
import logging # create and configure logger logging.basicConfig(filename="C:\dev\practiceSelenium\log_files\log_file1.log", format= ('%(asctime)s: %(levelname)s: %(message)s:') ) # create logging object logger = logging.getLogger() # set the threshold of logger to debug logg...
manny121brooklyn/practiceSelenium
selenium_logging.py
selenium_logging.py
py
526
python
en
code
0
github-code
21
[ { "api_name": "logging.basicConfig", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.debug...
30244692683
from platypus import NSGAII, OMOPSO,Problem, Real import numpy as np def schaffer(x): print("x") print(x) print("x[0]") print(x[0]) return [x[0]**2, (x[0]-2)**2] problem = Problem(1, 2) problem.types[:] = Real(0, 1) problem.function = schaffer algorithm = NSGAII(problem) algorithm.run(10) for solu...
Project2017-18/Major-Project
Platypus-master/examples/custom_problem_1.py
custom_problem_1.py
py
652
python
en
code
0
github-code
21
[ { "api_name": "platypus.Problem", "line_number": 10, "usage_type": "call" }, { "api_name": "platypus.Real", "line_number": 11, "usage_type": "call" }, { "api_name": "platypus.NSGAII", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scat...
73888366452
from typing import List from collections import Counter class Solution: def findPairs(self, nums: List[int], k: int) -> int: count = Counter(nums) if k == 0: return sum(1 for key in count if count[key] >1) if k > 0: return sum(1 for key in count if key-k in count) return 0 ...
xiaofanc/leetcode
0532-k-diff-pairs-in-an-array.py
0532-k-diff-pairs-in-an-array.py
py
729
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "collections.Counter", "line_number": 6, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 11, "usage_type": "name" }, { "api_name": "collections.Counter", "...
42692145735
import sys, pygame pygame.init() LARG = 300 speed = [3, 1] CIANO = (0, 255, 255) BLACK = (0, 0, 0) screen = pygame.display.set_mode((LARG,LARG)) clock = pygame.time.Clock() FPS = 60 ball = pygame.Surface((30,30)).convert() ball.fill(CIANO) ballrect = ball.get_rect() while 1: for event in pygame.event.get(): ...
gabriellaec/desoft-analise-exercicios
backup/user_049/ch96_2019_11_27_18_49_26_560261.py
ch96_2019_11_27_18_49_26_560261.py
py
702
python
en
code
0
github-code
21
[ { "api_name": "pygame.init", "line_number": 2, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.time.Cloc...
71706221814
#!/usr/bin/env python3 import sys from pathlib import Path import geomlib import csv energies = list(csv.DictReader(sys.stdin, quotechar="'")) prefix = Path(sys.argv[1]) paths = map(Path, sys.argv[2:]) geoms = [] for path in paths: geom = geomlib.readfile(path) label = path.stem.split('_')[1] _, label, s...
jhrmnn/vdwsets
utils/s66x8/process.py
process.py
py
1,553
python
en
code
0
github-code
21
[ { "api_name": "csv.DictReader", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number":...
21885028015
from django.urls import path from . import views # urlpatterns map the url to a view # nfl/ urlpatterns = [ path('', views.index, name="nfl_index"), path('teams', views.teams, name="nfl_teams"), path('standings', views.standings, name="nfl_standings"), path('schedule', views.schedule, name="nfl_schedul...
hojohn2561/sports_hub
nfl/urls.py
urls.py
py
388
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
13894229600
#!/usr/bin/env python # -*- coding:utf-8 -*- from django.conf.urls import url, include from . import views from django.contrib.auth import views as auth_views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^search', views.search, name='search'), url(r'^new', views.new, name='new'), url(r...
karadaharu/betterresearch
reviewshare/urls.py
urls.py
py
546
python
en
code
0
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django....
6290269493
from setuptools import setup package_name = 'map_to_pic' setup( name=package_name, version='0.0.0', packages=[package_name], data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name, ['package.xml']), ], inst...
Fricodelco/map_to_pic
setup.py
setup.py
py
845
python
en
code
0
github-code
21
[ { "api_name": "setuptools.setup", "line_number": 5, "usage_type": "call" } ]
10450596592
# 2583 영역 구하기 import sys from collections import deque height , width , divide = map(int,sys.stdin.readline().split()) graph = [[0]*width for _ in range(height)] visited = [[False]*width for _ in range(height)] dirs = [(-1,0),(1,0),(0,-1),(0,1)] for _ in range(divide): # 직사각형의 왼쪽 아래 꼭짓점의 x, y좌표값과 오른쪽 위 꼭짓점의 x,...
inkyu0103/BOJ
DFS , BFS/2583.py
2583.py
py
1,827
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin.readline", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.stdin", "l...
6009239813
# Hyperparameter selection # - learning rate (0.001, 0.0005) # - batch size (64, 128) # - gamma (0.95, 0.99) # - replace target weight (10, 20) from tqdm import tqdm from D3QNAgent import Agent from kaggle_environments import evaluate, make, utils import numpy as np from IPython.display import clear_output import matp...
LiquidMethane/D3QN-Connect4
hyperparameter-gridsearch.py
hyperparameter-gridsearch.py
py
4,471
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 34, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.float32", "line_...
73043143092
import logging import random import re from lib import config from lib import irc class _Question: """Encapsulate a question and its answers.""" def __init__(self, question, answers, correct_answer_idx): self.question = question self.answers = tuple(answers) self.correct_answer_idx = c...
d1zzy/gogbot
plugins/trivia.py
trivia.py
py
6,906
python
en
code
3
github-code
21
[ { "api_name": "random.shuffle", "line_number": 23, "usage_type": "call" }, { "api_name": "lib.irc.HandlerBase", "line_number": 37, "usage_type": "attribute" }, { "api_name": "lib.irc", "line_number": 37, "usage_type": "name" }, { "api_name": "re.compile", "lin...
32137150726
from django.test import TestCase, Client from django.urls import reverse from main.models import Comment,Product,Person,Seller,Customer,mail_verification from django.contrib.auth.models import User,auth import json from django.contrib.auth.models import User,auth class TestMainViews (TestCase): def setUp(self): ...
AntwanEmil/ta3refa
main/test/test_views.py
test_views.py
py
3,296
python
en
code
0
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "django.test.Client", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects.create_user", "line_number": 11, "usage_type": "call" },...
6844998697
# This file runs the game using the pygamegame.py framework file import pygame import random from pygame import mixer from pygamegame import PygameGame from GameObject import GameObject from Button import Button from Player import Player from Wall import Wall from Floor import Floor from Obstacle import Obstacle from O...
AJ228/Term-Project-15112
Game.py
Game.py
py
14,850
python
en
code
0
github-code
21
[ { "api_name": "pygamegame.PygameGame", "line_number": 14, "usage_type": "name" }, { "api_name": "Player.Player.init", "line_number": 18, "usage_type": "call" }, { "api_name": "Player.Player", "line_number": 18, "usage_type": "name" }, { "api_name": "pygame.sprite....
330289441
import collections t=int(input()) def bfs(x, y): q = collections.deque() q.append([x, y]) visited=[False] * n while q: x, y = q.popleft() if abs(x - target_x) + abs(y - target_y) <= 1000: return True for i in range(n): if not visited[i]: ...
Lee-DaeSeong/algorithm_notes
BOJ_9205.py
BOJ_9205.py
py
765
python
en
code
0
github-code
21
[ { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" } ]
35305513421
import argparse from type.StatsNameEnum import StatsName from utils.io import load_tracking_gt, plot_hist from utils.stats_tool import ( compute_stat_by_name ) def main(): parser = argparse.ArgumentParser( description='Data statistics for object tracking') parser.add_argument('--data_dir', type=s...
zigonk/object-tracking-dataset-statistics-toolbox
main.py
main.py
py
1,853
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.io.load_tracking_gt", "line_number": 20, "usage_type": "call" }, { "api_name": "type.StatsNameEnum.StatsName.NUM_OBJ_PER_VIDEO", "line_number": 26, "usage_type": "attr...
31635551710
from __future__ import absolute_import, division, print_function __metaclass__ = type import sys import pytest from ansible_collections.sensu.sensu_go.plugins.module_utils import ( errors, utils, ) from ansible_collections.sensu.sensu_go.plugins.modules import secrets_provider_info from .common.utils import ( ...
sensu/sensu-go-ansible
tests/unit/plugins/modules/test_secrets_provider_info.py
test_secrets_provider_info.py
py
2,152
python
en
code
34
github-code
21
[ { "api_name": "pytest.mark.skipif", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 18, "usage_type": "attribute" }, { "api_name": "common.util...
73575823094
from attendance.models import HubstaffUser, WorkFromHome, UserAttendanceLog, UserAttendanceLogSummary from user.models import CustomUser from hubstaff.client_v1 import HubstaffClient import os from django.core.management.base import BaseCommand from datetime import date as datet, datetime , timedelta, time class Comm...
yogeshdmca/flickerp
geitpl_erp/apps/attendance/management/commands/sync_attendence_hubstaff.py
sync_attendence_hubstaff.py
py
3,234
python
en
code
1
github-code
21
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 8, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 26, "usage_type": "attribute" }, { "api_name": "hubstaff.client_v1", "line_number": 28, "usage_type": "name" }, { "api_nam...
70177092852
from distributed import apply_gradient_allreduce import time import IPython.display as ipd from numpy import finfo import sys sys.path.append('waveglow/') import numpy as np import torch from hparams import create_hparams from model import Tacotron2 from layers import TacotronSTFT, STFT from audio_processing import ...
Thien223/TTS_webservice
source/synthesis.py
synthesis.py
py
3,466
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "hparams.create_hparams", "line_number": 20, "usage_type": "call" }, { "api_name": "model.Tacotron2", ...
71925782772
"""Handles TAPIS functionaloty related to jobs.""" from datetime import datetime import json from core.TapisController import TapisController from tapipy.errors import InvalidInputError class Jobs(TapisController): """Contains all of the CRUD functions associated with jobs.""" def __init__(self): Ta...
nathandf/tapis-cli
src/controllers/Jobs.py
Jobs.py
py
4,053
python
en
code
0
github-code
21
[ { "api_name": "core.TapisController.TapisController", "line_number": 10, "usage_type": "name" }, { "api_name": "core.TapisController.TapisController.__init__", "line_number": 13, "usage_type": "call" }, { "api_name": "core.TapisController.TapisController", "line_number": 13, ...
23697991260
import numpy as np import matplotlib.pyplot as plt n_samples = 1000 n_test_sample = 10 X = np.random.normal(loc=[2, -1], scale=1, size=(n_samples, 2)) test_X = np.random.normal(0, 1, (n_test_sample, 2)) print(X) print(X[:, 0]) # 첫번째 column print(X[:, 1]) # 두번째 column print(X[0, :], X[0]) # 첫번째...
yeongun130/Python
knn.py
knn.py
py
654
python
en
code
0
github-code
21
[ { "api_name": "numpy.random.normal", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.random.normal", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random",...
39349834098
from collections import OrderedDict a = dict() a['one'] = 1 a['two'] = 2 a['three'] = 3 a['four'] = 4 print(a) print(a) b = OrderedDict() b['one'] = 1 b['two'] = 2 b['three'] = 3 b['four'] = 4 print(b) print(b)
salokesh99/practice
hackerrank/ordered_dicts.py
ordered_dicts.py
py
212
python
en
code
0
github-code
21
[ { "api_name": "collections.OrderedDict", "line_number": 11, "usage_type": "call" } ]
1871909614
import os import sys import cv2 import numpy as np skip_rate = 100 movie_path = 'movie.mp4' def calc_avg_color(img): avg_color = [0, 0, 0] for i in img: for pixel in i: avg_color[0] += pixel[0] avg_color[1] += pixel[1] avg_color[2] += pixel[2] avg_color[0] = ro...
dravolin/ColorOfMovies
colorofmovies.py
colorofmovies.py
py
1,523
python
en
code
0
github-code
21
[ { "api_name": "sys.argv", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 25, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
71099262452
"""product extended Revision ID: 154eefea79a6 Revises: 0a3e9554c008 Create Date: 2020-03-31 10:52:37.489195 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '154eefea79a6' down_revision = '0a3e9554c008' branch_labels = None depends_on = None def upgrade(): ...
vrcompugo/EV-Manager-Data-API
migrations/versions/154eefea79a6_product_extended.py
154eefea79a6_product_extended.py
py
827
python
en
code
0
github-code
21
[ { "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.Text", ...
30431443244
#importing the required modules import json #this one for wordlist import itertools #storing the words in he dictionary in data data = json.load(open("dictionary.json")) #main function def main(): ex = input("Enter the letters without spaces in any oder: \t") letters = ex.lower() possible_combinations = [] ...
sanjai21/word-connector
main.py
main.py
py
1,426
python
en
code
0
github-code
21
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 19, "usage_type": "call" } ]
30702748488
# # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
Tencent/TPAT
examples/example_tensorflow.py
example_tensorflow.py
py
8,447
python
en
code
354
github-code
21
[ { "api_name": "sys.path.append", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.chdir", "line_number": 27, "usage_type": "call" }, { "api_name": "os.environ", "line_number"...
35096190980
# coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import json import tensorflow as tf from tensorflow import metrics from tensorflow.python.ops import math_ops from bert import modeling from bert.run_squad import create_model from b...
dzorlu/natural_questions
run_nq.py
run_nq.py
py
14,143
python
en
code
5
github-code
21
[ { "api_name": "tensorflow.flags", "line_number": 19, "usage_type": "attribute" }, { "api_name": "jsonlines.open", "line_number": 47, "usage_type": "call" }, { "api_name": "tensorflow.logging.info", "line_number": 56, "usage_type": "call" }, { "api_name": "tensorfl...
34192143767
import logging from threading import Thread from cflib.utils.callbacks import Caller import time __author__ = 'Bitcraze AB' __all__ = ['PeriodicTimer'] logger = logging.getLogger(__name__) class PeriodicTimer: """Create a periodic timer that will periodically call a callback""" def __init__(self, period, c...
bitcraze/crazyflie-clients-python
src/cfclient/utils/periodictimer.py
periodictimer.py
py
1,384
python
en
code
287
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "cflib.utils.callbacks.Caller", "line_number": 16, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 38, "usage_type": "name" }, { "api_name": "time.s...
23598291617
from PIL import Image, ImageFilter, ImageEnhance from clientapp import static i = 1 # 초록색 부분 제거단위 ( i by j 만큼 ( = 브러쉬 크기 ) ) j = 1 # 2 """ foreground_path = 'foreground.png' #인물사진 ( with 크로마키 ) background_path = 'background.png' #배경사진 foreground = Image.open(foreground_path).convert('RGBA') background = Image.o...
jsrodela/life4cuts
utils/chroma.py
chroma.py
py
2,284
python
en
code
1
github-code
21
[ { "api_name": "PIL.Image.open", "line_number": 26, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 26, "usage_type": "name" }, { "api_name": "PIL.Image", "line_number": 40, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number"...
3712386001
import sys import os import re import curses from atig.migration import Migration, MigrationCollection class Atig(): def __init__(self): self.valid_migration = re.compile(r'[0-9a-f]{12}\_.*\.py') self.migrations = None self.migration_collection = None self.debug_message = 'Welcome ...
djentleman/atig
atig/main.py
main.py
py
7,648
python
en
code
0
github-code
21
[ { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "atig.migration.Migration", "line_number": 22, "usage_type": "call" }, { "api_name": "atig.migration.Migrati...
42627217292
from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from .serializers import BillSerializer, UploadSerializer from .models import Client, Organization, Bill from .utils.functions import excel_to_database class UploadFilesView(APIView): def post...
kropochev/excel-to-db-api
app/core/views.py
views.py
py
2,398
python
en
code
1
github-code
21
[ { "api_name": "rest_framework.views.APIView", "line_number": 10, "usage_type": "name" }, { "api_name": "serializers.UploadSerializer", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.functions.excel_to_database", "line_number": 18, "usage_type": "call" }...
19196757774
from selenium import webdriver driver = webdriver.Chrome() driver.get("https://testautomationpractice.blogspot.com/") var1 = driver.find_element_by_tag_name("h1") # Header print(var1.text) #result is "Automation Testing Practice"
sandeepbhutkar/SeleniumPython-and-RobotFramework-Multiple-Projects
SeleniumWithPython_2/6TagName.py
6TagName.py
py
236
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 3, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 3, "usage_type": "name" } ]
12508809746
import pygame WHITE = pygame.Color("white") class Ui(): def __init__(self, path_mng): self.font_mng = self.FontManager() self.font = "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf" self.font_size = 22 self.clock = pygame.time.Clock() self.dt = 0 self.elapsed_...
FlorianHuveteau/coding_game
training/mars_lander/pygame_test/ui.py
ui.py
py
2,657
python
en
code
0
github-code
21
[ { "api_name": "pygame.Color", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.Color", "li...
14271981009
#!/usr/bin/python # coding=utf8 import gi gi.require_version("Gtk", "3.0") gi.require_version("Gdk", "3.0") from gi.repository import GObject, Gio, Gdk, Gtk import gtkapp_portion class MyApplication(Gtk.Application): # Main initialization routine def __init__(self, application_id, flags): Gtk.Applica...
wickylee/PygtkTest
gtkapp.py
gtkapp.py
py
1,518
python
en
code
0
github-code
21
[ { "api_name": "gi.require_version", "line_number": 5, "usage_type": "call" }, { "api_name": "gi.require_version", "line_number": 6, "usage_type": "call" }, { "api_name": "gi.repository.Gtk.Application", "line_number": 11, "usage_type": "attribute" }, { "api_name":...
11077627444
import os import numpy as np from extract_feats import extract_model_fea from sklearn.linear_model import LogisticRegression from sklearn.multioutput import MultiOutputClassifier from sklearn import metrics from compute_metric import compute_auc, compute_ap def train_cls_model_multiclass(support_set, data_dir, model,...
wllfore/MedFMC_fewshot_baseline
baseline/baseline_func.py
baseline_func.py
py
5,082
python
en
code
5
github-code
21
[ { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "extract_feats.extract_model_fea...