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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21712356796 | # version Python 3.6.4
# 데이터 파씽 parsing 하는 test
# 명령행 인자를 받아서 실행되는 프로그램에서 인자를 파싱할때 사용.
# 옵션인자를 추가 옵션값 제한. [0, 1, 2]번의 선택 옵션.
import argparse
parser = argparse.ArgumentParser() # 이용자에게 데이터 파싱을 받음.
parser.add_argument("square", type=int, help="T... | lyj911111/OpenCV_Project | _testcodes/Argparse 연습/4_옵션인자 제한.py | 4_옵션인자 제한.py | py | 1,899 | python | ko | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
}
] |
14242089682 | from pm4py.util.business_hours import BusinessHours
import datetime
from workalendar.europe import Italy
def execute_script():
ts1 = 100000000
ts2 = 110000000
d1 = datetime.datetime.fromtimestamp(ts1)
d2 = datetime.datetime.fromtimestamp(ts2)
print(ts2-ts1)
# default business hours: all the da... | giacomodiguida96/eGovRA-v2-master-local | parsingbpmn/pm4py-core-release/examples/workalendar_example.py | workalendar_example.py | py | 715 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 10,
"usage_type": "call"
},
{
... |
357487989 | from tkinter import *
import tkinter.messagebox
from PIL import Image, ImageTk
import socket, threading, sys, traceback, os
import time
import functools
from RtpPacket import RtpPacket
CACHE_FILE_NAME = "cache-"
CACHE_FILE_EXT = ".jpg"
class Client:
INIT = 0
SWITCH = 1
READY = 2
PLAYING = 3
sta... | hungle2002/implement_RTP | full_extend/Client.py | Client.py | py | 15,670 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.remove",
"line_number": 142,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 178,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 180,
"usage_type": "call"
},
{
"api_name": "threading.Event",
"line_n... |
4646461651 | import torch
import utils
def torch_eval(val_fn):
@torch.no_grad()
def decorated(self, gen, *args, **kwargs):
gen.eval()
ret = val_fn(self, gen, *args, **kwargs)
gen.train()
return ret
return decorated
class Evaluator:
def __init__(self, writer):
torch.backe... | clovaai/mxfont | trainer/evaluator.py | evaluator.py | py | 1,361 | python | en | code | 128 | github-code | 18 | [
{
"api_name": "torch.no_grad",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.backends",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "utils.make_comparable_grid",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.cat... |
3676140827 | '''plot.py: Plots data using seaborn and matplotlib'''
# Author: Luke Henderson
__version__ = '1.2'
import math
import time
import numpy as np
import config as cfg
import colors as cl
import utils as ut
import debugTools as dt
PLOT_COLORS = [
"b", # blue
"g", # green
"r", # red
... | lukehenderson1996/cmosSim | scripts/plot.py | plot.py | py | 21,206 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "config.plotEn",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 98,
"usage_type": "name"
},
{
"api_name": "seaborn.lineplot",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "seaborn.line... |
39778759941 | #!/usr/bin/env python3
"""Test whether routing is (more or less) deterministic (https://github.com/r5py/r5py/issues/240)."""
import itertools
import pandas.testing
import pytest
import r5py
@pytest.fixture(scope="module")
def intermediate_results():
# will be modified in each iteration,
# used to compar... | r5py/r5py | tests/test_deterministic_behaviour.py | test_deterministic_behaviour.py | py | 2,104 | python | en | code | 90 | github-code | 18 | [
{
"api_name": "pytest.fixture",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "itertools.pairwise",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "itertools.tee",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "r5py.TravelTimeMatrix... |
38493077129 | # !/usr/bin/python2
# Author: jiangtao
#Project: no_tfrecords_using_slim
#File: test_batch.py
#Ide: PyCharm
# _*_ coding: utf-8 _*_
import tensorflow as tf
import tools
import math
import numpy as np
from tensorflow.contrib import slim
from tensorflow.contrib.slim.nets import inception,vgg,resnet_v2
from gen_test_batc... | zhangrongen/vehicle-classification | test_batches.py | test_batches.py | py | 2,728 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "gen_test_batch.get_file",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tensorflow.Graph",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "gen_test_batch.get_batch",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ten... |
13332538805 | from __future__ import division
__author__ = 'ShanthiS'
import numpy
import csv
from numpy import *
from scipy import stats
# Load data from csv
filename = "../digitsDataset/trainFeatures.csv"
training_features = numpy.loadtxt(filename, delimiter=',')
filename = "../digitsDataset/trainLabels.csv"
training_labels =... | shanthistyle/Number-Classifier | code/classifyDigits.py | classifyDigits.py | py | 3,175 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.loadtxt",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_n... |
15274928631 | from flask import Flask, request, g, url_for
import sqlite3
import json
import requests
app = Flask(__name__)
DATABASE = "report"
class Report:
def __init__(self, type, date, time, description, latitude, longitude):
self.type = type
self.date = date
self.time = time
self.descripti... | bmedeir1/Sanctum_Server | app.py | app.py | py | 2,241 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.g",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "flask.g._database",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_num... |
38210995834 | import os
import pandas as pd
import numpy as np
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
import time
import pickle
def unix_time(dt):
timeArray = time.strptime(dt, "%Y-%m-%d %H:%M:%S")
timestamp = int(time.mktime(timeArray... | IanWE/SideNetModel | process.py | process.py | py | 3,298 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "time.strptime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.mktime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.ses... |
38954465933 | """
Skylar Koroluk
Some pieces borrowed from Irene
Obstacle Avoidance Plan B for USST rover 2018
This process needs to be run on the Nvidia Jetson
(or other machine with the ZED sdk installed and working).
"""
import pyzed.camera as zcam
import pyzed.defines as sl
import pyzed.types as tp
import pyzed.core as core
im... | UofSSpaceTeam/rover-processes | Avoiding.py | Avoiding.py | py | 5,681 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "config.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "robocluster.Device",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "config.network",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "time.time",
... |
37419256030 | from sklearn.tree import DecisionTreeRegressor
from sklearn.metrics import mean_squared_error
import matplotlib.pyplot as plt
import pandas as pd
from preprocess import *
# for decision tree regressor exp
def DecisionTree(X_train, X_test, y_train, y_test):
regressor = DecisionTreeRegressor(criterion = 'squared_e... | bigdraw715/IML_Assignment | a4.py | a4.py | py | 2,377 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sklearn.tree.DecisionTreeRegressor",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.mean_squared_error",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeRegressor",
"line_number": 29,
"usage_type... |
9040011656 | # -*- coding: utf-8 -*-
"""
@author: julian
"""
#pip install -i https://pypi.anaconda.org/ranaroussi/simple yfinance
# pip install TA-Lib
# pip install numpy --upgrade --ignore-installed
# pip install --upgrade mplfinance
# https://github.com/TA-Lib/ta-lib-python
import yfinance as yf
import talib
from t... | JvpCode7/algoTrading | yf_talib.py | yf_talib.py | py | 3,285 | python | es | code | 0 | github-code | 18 | [
{
"api_name": "yfinance.Ticker",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "talib.SMA",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "talib.SMA",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "talib.SMA",
"line_number": 35... |
14761071381 | import requests
import json
my_req = requests.get('https://swapi.dev/api/people/3/')
if my_req.status_code == 200:
json_dict = json.loads(my_req.text)
json_dict['name'] = 'New name'
with open('change_name.json', 'w') as file:
json.dump(json_dict, file, indent=4)
res_homeworld = requests.get(js... | Elfateru/self_test_python_basic | 31/33.4/1. Звёздные войны/main.py | main.py | py | 372 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 11,
... |
11125283515 | import pandas as pd
import numpy as np
import math
from dataset import datasetSiap, n_fiturDataset, n_fiturKlasifikasi, dataklasifikasiSiap, data_klasifikasi
csv_bobotAwal = pd.read_csv("dataset/bobot_modal.csv", delimiter=',', header=0)
bobotAwal = np.array(csv_bobotAwal) #konversi bobot csv m... | riskids/Basic-LVQ | maintrain.py | maintrain.py | py | 5,473 | python | id | code | 3 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "dataset.n_fiturDataset",
"line_number": 18,
"usage_type": "argument"
},
{
"api_name": "math.sqrt",
... |
26419846198 | from statistics import mode
response_key = {
'A': ['Outside playing tag or trying a new move on the monkey bars', 'Red', 'Basketball', 'Hot fudge sundae', 'Doing any type of physical activity', 'You start experimenting with household items for fun', 'You bravely decide to climb the tree and free the cat yourself'... | laurenanne/Capstone1 | quiz.py | quiz.py | py | 7,208 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "statistics.mode",
"line_number": 70,
"usage_type": "call"
}
] |
27762540778 | from .db import db, environment, SCHEMA, add_prefix_for_prod
from datetime import datetime
class Backing(db.Model):
__tablename__ = 'backings'
if environment == "production":
__table_args__ = {'schema': SCHEMA}
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer, db.ForeignKey(add... | andrew-khai/StickKarter | app/models/backing.py | backing.py | py | 1,982 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "db.db.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "db.db",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "db.environment",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "db.SCHEMA",
"line_number": 8,
... |
37417714740 | import googlemaps
from datetime import datetime
import json
import pandas as pd
gmaps = googlemaps.Client(key='REMOVED')
cities = {"Albany" : 104,
"Atlanta" : 122,
"Birmingham, AL" : 142,
"Boston" : 148,
"Buffalo" : 160,
"Charlotte" : 172,
"Chigago" : 176,
... | ttaylorok/us_transportation | get_city_coords.py | get_city_coords.py | py | 3,851 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "googlemaps.Client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 89,
"usage_type": "call"
}
] |
29088075935 | """post
Revision ID: f03e9a1b5629
Revises: 8d124d3047bf
Create Date: 2023-12-05 14:14:50.322337
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f03e9a1b5629'
down_revision = '8d124d3047bf'
branch_labels = None
depends_on = None
def upgrade():
# ### comma... | Gar1s/python | main_project/Partyka_project/migrations/versions/f03e9a1b5629_post.py | f03e9a1b5629_post.py | py | 1,939 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
9103294000 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Bruce Frank Wong'
"""
本模块负责下载数据。
"""
from typing import List
import csv
import os.path
from datetime import datetime, date, timedelta
from contextlib import closing
from dotenv import find_dotenv, load_dotenv
import pandas as pd
from tqsdk import TqApi,... | BruceFrankWong/QuantWorkshop-TQ | src/QuantWorkshopTq/download.py | download.py | py | 4,025 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "dotenv.find_dotenv",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path.environ.get",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path.env... |
41774906726 | '''
@Author: Max Nícolas de Oliveira Lima
'''
import psycopg2
import json
import os
from lib.json_to_sql import jsonToSql
from perceval.backends.core.github import GitHub
from perceval.backends.core.git import Git
def getCommits(user_owner, repo_name):
repo = Git(f"https://github.com/{user_owner}/{repo_name}.git... | SERG-UFPI/max_project | script.py | script.py | py | 4,281 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "perceval.backends.core.git.Git",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "perceval.backends.core.github.GitHub",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "perceval.backends.core.github.GitHub",
"line_number": 28,
"usage_type... |
527294246 | #!/usr/bin/python3
# ------------------------------------------------------------------------------
"""@package wss.py
WebSocket server for providing access and control over the Xiaomi temperature
and humidity sensors.
"""
# ------------------------------------------------------------------------------
# ... | ippie52/XiaomiMijiaReader | wss.py | wss.py | py | 19,662 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "asyncio.Queue",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "threading.Lock",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "threading.Lock",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "threading.Lock",
"lin... |
32332936950 | from flask import Flask, render_template, url_for, redirect, request, jsonify, session, flash
from flask_uploads import UploadSet, configure_uploads, IMAGES
from data_manager import *
import os
app = Flask(__name__)
photos = UploadSet('photos',IMAGES)
app.config["UPLOADED_PHOTOS_DEST"] = 'static/pics'
configure_uploa... | MenesiZoltan/ChristmasMemoryG | server.py | server.py | py | 2,404 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_uploads.UploadSet",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_uploads.IMAGES",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "flask_uploa... |
40256832193 | # -*- coding: utf-8 -*-
from regression import *
import matplotlib.pyplot as plt
import numpy as np
# Oppgave A
#x = [0, 1, 1, 2]
#y = [3, 2, 4, 5]
# Oppgave B
#x = [-2, -1, 0, 1, 2]
#y = [4.2, 0.8, -0.3, 0.7, 3.7]
# Oppgave C
x = [2, 3, 5, 7]
y = [3.4, 4.3, 8.6, 10]
plt.scatter(x, y)
[a_lin, b_lin] = linearRegr... | trulsmartinsen/MAT102 | Kapittel18/oppgave1.py | oppgave1.py | py | 996 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "numpy.mean",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
... |
73811668840 | import json
import logging
import math
import os
import re
import subprocess
from datetime import datetime
from random import randint
from typing import Dict, List, Optional, Union
from dateutil.parser import parse
from dateutil.tz import tzlocal
from toil.batchSystems.abstractBatchSystem import BatchJobExitReason
fr... | DataBiosphere/toil | src/toil/batchSystems/lsf.py | lsf.py | py | 15,931 | python | en | code | 856 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "toil.batchSystems.abstractGridEngineBatchSystem.AbstractGridEngineBatchSystem",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "toil.batchSystems.abstractGridEngineBatchSystem.A... |
43309750858 | import pygame
from Ship import Ship
from Alien import Alien
from Bullet import Bullet
from Barrier import Barrier
from EnemyBullet import EnemyBullet
from time import sleep
from random import choice
import ctypes
ctypes.windll.user32.SetProcessDPIAware() #to negate Windows' 125% stretching
score = 0
BLACK = (0,0,0)
... | lazarchitect/Space-Invaders | si.py | si.py | py | 5,078 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "ctypes.windll.user32.SetProcessDPIAware",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ctypes.windll",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
45641512794 | import pandas as pd
import tensorflow as tf
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
import cv2
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
TLDir = 'Military and Civilian Vehi... | FellowPhilosopher/Vehicle-Differentiation | LeNet v0.8.py | LeNet v0.8.py | py | 3,578 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 22,
"usage_type": "call"
},
{
"api_... |
69926783399 | import requests
from bs4 import BeautifulSoup
from bs4.element import Comment
from collections import deque
import nltk
from nltk.corpus import stopwords
import re
from nltk.stem import PorterStemmer #For Porter Stemmer function
import pickle
from copy import deepcopy
from urllib.parse import urlparse
stop_words = set... | abhay-krishna/BM25-search | preprocess.py | preprocess.py | py | 5,733 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "nltk.stem.PorterStemmer",
"line_number": 14,
"usage_type": "call"
},
{
"api_nam... |
35399388911 | import csv
import requests
import json
key = "UZK46uo1msG53MNLgANhGi4PjSbvrnJi5HjG7qVp"
url = "https://api.data.gov/ed/collegescorecard/v1/schools.json?"
pages = [39,40,62,68,71,88,92,138,150,166,187,193,214,229,235,262,266,301,308,309,322,328]
counter = 0
for page in pages:
names = []
urls = []
... | EulerQuantum/App | Review.py | Review.py | py | 1,245 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 37,
"usage_type": "call"
}
] |
1872982788 | import numpy
from astropy.io import fits
import re
def loadParams(config):
headim = fits.getheader(config['ImageName'])
# get resolution in ALMA image
celldata = numpy.abs(headim['CDELT1'] * 3600)
#--------------------------------------------------------------------------
# Define the number of... | sbussmann/uvmcmcfit | setuputil.py | setuputil.py | py | 10,662 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "astropy.io.fits.getheader",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.abs",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.findall",
"l... |
12475636622 | import sys
import os
import time
import gc
import csv
from pathlib import Path
import pymysql.cursors
PDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.abspath(PDIR))
from settings import SmartAlphaPath, debug
SETT = SmartAlphaPath()
sys.path.append(os.path.abspath(SETT.get_path... | taatuco/sa_data_collection | r_quantmod/insert_db_price_data.py | insert_db_price_data.py | py | 3,674 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line... |
5399182833 | import cv2
import numpy as np
import matplotlib.pyplot as plt
def random_mask(image_tensor, p=0.5, kernel_size=2):
"""对图像张量进行随机边缘模糊
Args:
image_tensor: 图像张量,可以是三维(单张图像)或四维(批量图像)
p: 遮挡概率,默认为0.5
kernel_size: 模糊核大小,默认为3
Returns:
处理后的图像张量
"""
masked_tensor = np.copy(i... | dlcg-Lab/Data-and-Channel-efficient-vision-Transformer | edge_blur_reference.py | edge_blur_reference.py | py | 2,716 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.copy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.expand_dims",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.Canny",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_numbe... |
70029230759 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('voucher', '0008_auto_20160127_0512'),
... | cybernetisk/internsystem | voucher/migrations/0009_uselog_issuing_user.py | 0009_uselog_issuing_user.py | py | 594 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 11,
"usage_type": "call... |
37356920660 | from selenium.webdriver.common.by import By
from selenium_project.pages import BasePage
class UserAddPage(BasePage):
_username = (By.NAME, 'username')
_account_id = (By.ID, 'memberAdd_acctid')
_email = (By.ID, 'memberAdd_mail')
_save_btn = (By.CSS_SELECTOR, 'a.qui_btn.ww_btn.js_btn_save')
def add... | whitexie/workwechatuitest | selenium_project/pages/add_user.py | add_user.py | py | 646 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "selenium_project.pages.BasePage",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.NAME",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 6,
"usage_type":... |
74595650918 | """comments
Revision ID: a08a72570392
Revises: f7962a3dc9eb
Create Date: 2023-06-27 14:22:20.012402
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a08a72570392'
down_revision = 'f7962a3dc9eb'
branch_labels = None
depends_on = None
def upgrade():
# ### c... | rysiekpol/instagram_clone | migrations/versions/a08a72570392_comments.py | a08a72570392_comments.py | py | 1,325 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
13932443774 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from .models import Question, Choice
def index(request):
latestQuestionList = Question.objects.order_by('-pubDate')[:5]
context = {
'latestQues... | HanhKieu/polls2016 | myProject/mysite/polls/views.py | views.py | py | 1,372 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "models.Question.objects.order_by",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Question.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "models.Question",
"line_number": 8,
"usage_type": "name"
},
{
"api_na... |
74863364841 | import datetime
import logging
import requests
from apps.currencies.models import CurrencyModel
from apps.currencies.serializers import CurrencySerializer
from configs.celery import app
# class CurrencyService:
# @staticmethod
# @app.task
# def fetch_data():
# date = datetime.date.today() - dateti... | regvud/autoria-clone | backend/core/services/currency_service.py | currency_service.py | py | 1,838 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.date.today",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.ge... |
1590086174 | """ A plugin that gets weather info about set city. """
import requests
from sys import exit
from bs4 import BeautifulSoup
from fake_useragent import UserAgent
from modules.errors import Warning
from modules.config_reader import ConfigReader
from modules.paths import get_path
from modules.logger import logger
class... | doopath/doondler | modules/synoptic.py | synoptic.py | py | 5,031 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "modules.config_reader.ConfigReader",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "modules.paths.get_path",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "fake_useragent.UserAgent",
"line_number": 76,
"usage_type": "call"
},
{
... |
70460218920 | """
Tools for analysing the results of GA/MC Assignment programs.
"""
from collections import Counter
def keep_pareto_order(scores, order=1):
"""
Returns a bool array of len group size. The value is True if
the the Pareto order is less then order
:param scores: list of `base.scores`
:param order:... | kfritzsc/nmrassign-nsgaII | nmrassign/analysis.py | analysis.py | py | 2,506 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "collections.Counter",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 81,
"usage_type": "call"
}
] |
35394035904 | import copy
from xml.etree import ElementTree
Element = ElementTree.Element
SubElement = ElementTree.SubElement
import svgwrite
import svgling.core
from svgling.core import TreeOptions, px
def html_split_fallback(t):
return (to_html(t), tuple())
# override core version because we want to handle Elements special... | rawlins/svgling | svgling/html.py | html.py | py | 17,133 | python | en | code | 56 | github-code | 18 | [
{
"api_name": "xml.etree.ElementTree.Element",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree.SubElement",
"line_number": 4,
"usage_type": "attribute"
}... |
42511934445 | import pytest
from main import Vigenere
@pytest.mark.parametrize("lang, str, key, is_encr, ans",
[('АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ', 'ПРАВИТЕЛЬСТВОМ', 'ЖИЗНЬ', '1', 'ЦЩЗПЕЩНУЙНЩКЦЪ'),
('АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ', 'ЦЩЗПЕЩНУЙНЩКЦЪ', 'ЖИЗНЬ', '2', 'ПРА... | D0R1K/Ciphers | test_vigenere_cipher.py | test_vigenere_cipher.py | py | 1,470 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "main.Vigenere",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "main.Vigenere",
... |
69947133799 | #!/usr/bin/python
from __future__ import print_function
from Bio.PDB import PDBParser
parser = PDBParser()
structure = parser.get_structure('3cxc', './mcsearch/output/3cxc_model_1.pdb')
header = parser.get_header()
trailer = parser.get_trailer()
for model in structure:
print('----------------------')
print('... | dbujold/rna-psyclic | parse_pdb.py | parse_pdb.py | py | 485 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Bio.PDB.PDBParser",
"line_number": 5,
"usage_type": "call"
}
] |
15866241664 | #!/usr/bin/env python
# coding: utf-8
# # Part 1:
# Use this CSV of AirBNB data from NYC [original source]
# - Use some of the cleaning techniques we used this week: write in a comment what could be some uses for this dataset (1pt), use a seaborn map to find all the NaN values (1pt), replace those NaN values (1pt), i... | ethanyattaw/Lab-Exercises | Lab9/Lab9.py | Lab9.py | py | 5,920 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "seaborn.heatmap",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "seaborn.heatmap",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "requests.get",
"l... |
21108645644 | import argparse
import io
import re
import shutil
import sys
import typing
from pathlib import Path
import op_registration_utils
from logger import get_logger
# directory containing the reduced op files, relative to the build directory
OP_REDUCTION_DIR = "op_reduction.generated"
# add the path to tools/python so we ... | microsoft/onnxruntime | tools/ci_build/reduce_op_kernels.py | reduce_op_kernels.py | py | 14,371 | python | en | code | 9,700 | github-code | 18 | [
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logger.get_logger",
"l... |
8857177659 | import os
import pickle
import streamlit as st
from streamlit_option_menu import option_menu
import numpy as np
import pandas as pd
import psycopg2
#remove space at top of page
st.cache(suppress_st_warning=True)
def top():
topstyle = """
<style>
.css-18e3th9 {
... | saldanhad/freecodecampmlapp | pagestyle.py | pagestyle.py | py | 3,519 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "streamlit.cache",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "streamlit.cache",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown... |
14649320636 | import tornado.web
import tornado.auth
from tornado import escape
from core import base
try:
import urllib.parse as urllib_parse # py3
except ImportError:
import urllib as urllib_parse # py2
class LoginOAuth(base.BaseHandler):
"""docstring for LoginOAuth"""
@tornado.gen.coroutine
def geter(self):
next = sel... | santatic/getmovie | core/login.py | login.py | py | 13,380 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "core.base.BaseHandler",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "core.base",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "tornado.web.gen",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tornado.web... |
15218680723 | import requests
import datetime
import json
import time
import boto3
import uuid
import io
import pandas as pd
def createBucketName(bucketPrefix):
"""
Creates and returns a globally unique bucket name from the prefix provided using a uuid4.
The generated bucket name must be between 3 and 63 chars long.
... | mbahra/AWS_Data_Engineer | datalakeDeployment.py | datalakeDeployment.py | py | 10,158 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "uuid.uuid4",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "boto3.session.Session",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "boto3.session",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "requests.request"... |
4001057924 | from absl.testing import parameterized
import numpy as np
from tensorflow.python.compat import compat as tf_compat
from tensorflow.python.data.kernel_tests import checkpoint_test_base
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.dat... | tensorflow/tensorflow | tensorflow/python/data/kernel_tests/sample_from_datasets_test.py | sample_from_datasets_test.py | py | 12,931 | python | en | code | 178,918 | github-code | 18 | [
{
"api_name": "tensorflow.python.framework.combinations.combine",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.framework.combinations",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "tensorflow.python.framework.ops.convert_to_tensor",
... |
31191865854 | """
Test for Bounty model
"""
from model_mommy import mommy
from kaznet.apps.main.tests.base import MainTestBase
class TestBounty(MainTestBase):
"""
Test class for Bounty mdoels
"""
def setUp(self):
super().setUp()
def test_bounty_str(self):
"""
Test Bounty String Repres... | onaio/kaznet-web | kaznet/apps/main/tests/models/test_bounty.py | test_bounty.py | py | 630 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "kaznet.apps.main.tests.base.MainTestBase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "model_mommy.mommy.make",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "model_mommy.mommy",
"line_number": 22,
"usage_type": "name"
},
{
"... |
25777293799 | import argparse
from fastai.vision.all import *
from dvclive.fastai import DvcLiveCallback
from load_params import load_params
def train_model(data_path, model_pickle_path, params_path):
params = load_params(params_path)
dls = ImageDataLoaders.from_folder(data_path,
trai... | alex000kim/iterative-hackathon | src/train.py | train.py | py | 1,258 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "load_params.load_params",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dvclive.fastai.DvcLiveCallback",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
}
] |
10499586752 | import urllib.request
import urllib.error
import urllib.parse
import json
import logging
import datetime
from .market import Market
class GDAX(Market):
def __init__(self):
super().__init__()
self.get_api_url_orderbook='https://api.gdax.com/products/{ticker:s}/book?level=2'
def get_exchange_de... | zhengyx04/BTCDataDownloader | public_markets/gdax.py | gdax.py | py | 1,284 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "market.Market",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "urllib.... |
3910281192 | from __future__ import absolute_import,division,print_function,unicode_literals
#Tensorflow and tf.keras
import tensorflow as tf
from tensorflow import keras
# Helper libraries
import numpy as np
import matplotlib.pyplot as plt
print(tf.__version__)
##Import tje Fashion MNIST dataset
#导入fashion mnist 的数据文件,有70000个... | stevenzhao8721/tf2Study | LearnStep1/BasicClassification.py | BasicClassification.py | py | 3,344 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tensorflow.__version__",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.datasets",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 19,
"usage_type": "name"
},
{
"api_n... |
2654223444 | """empty message
Revision ID: dc067ead6762
Revises:
Create Date: 2020-04-24 20:14:16.045232
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'dc067ead6762'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | arukavina/baking-lyrics | migrations/versions/dc067ead6762_.py | dc067ead6762_.py | py | 2,524 | python | en | code | 14 | github-code | 18 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
6218962927 | import json
from common.base_crypt import BaseCrypt
from common.base_utils import model_to_dict
from common.log import logger
from datahub.common.const import ACCESS_CONF_INFO, PASSWORD, RESOURCE, SCOPE, TYPE
from django.utils.translation import ugettext as _
from ...exceptions import CollectorError, CollerctorCode
f... | Tencent/bk-base | src/api/datahub/access/collectors/queue_collector/access.py | access.py | py | 8,415 | python | en | code | 85 | github-code | 18 | [
{
"api_name": "base_collector.BaseAccessTask",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "base_collector.BaseAccess",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "serializers.QueueResourceSerializer",
"line_number": 25,
"usage_type": "name"
}... |
7253582755 | import sqlite3
import sys
class Employee:
def __init__(self):
mydb = sqlite3.connect('Employee_DB')
self.c = mydb.cursor()
self.file_path = sys.argv[1]
# creating table
try:
self.c.execute('''CREATE TABLE Employee_Info (Name VARCHAR(20),ID INT,Salary INT,City VA... | tamtamohit/iitbassignmentspython | labQ4.py | labQ4.py | py | 1,491 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
}
] |
4380490595 | import pygame
import sys
window_height = 1000
window_width = 1000
colour_black = (0,0,0)
colour_white = (255,255,255)
colour_red = (255,0,0)
colour_green = (0,255,0)
colour_teal = (0,255,255)
colour_purple = (255,0,255)
block_size = 25
clicked_pos = []
quit_clicked = False
go_clicked = False
start_pos = (1,1)
end_pos ... | OllieRelph/InteractiveShortestPath | ShortestPath.py | ShortestPath.py | py | 4,149 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.init",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
32788240970 | import evaluation
from tqdm import tqdm
import numpy as np
# from IPython.display import clear_output
from os import system
from data.datasets import TokenClassificationDataset
from transformers import TrainingArguments, Trainer, DataCollatorForTokenClassification, EarlyStoppingCallback
def get_trainer(
model,... | Dagobert42/Prompt-Based-Data-Augmentation-for-Semantic-Frames | helpers/training.py | training.py | py | 2,821 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "transformers.DataCollatorForTokenClassification",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "transformers.TrainingArguments",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "transformers.Trainer",
"line_number": 36,
"usage_type": "c... |
29016416955 | '''
=======================================================================================
A general utility module that contains functions for data exploration, visulizations,
modeling preparation, feature scaling, sampling imbalanced data, model report ...
Henry (Huanwang) Yang (started 2016-06-12, modi... | huanyang123/ML_tune | ML_tune/ml_utility.py | ml_utility.py | py | 89,919 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.set_option",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 165,
"usage_type": "call"
},
{
"api_name": "numpy.datetime6... |
19389558103 | from transformers import AutoTokenizer, AutoConfig
usePretrainedModelDebug = False
if(usePretrainedModelDebug):
from transformers import GPT2LMHeadModel
else:
from modeling_gpt2 import GPT2LMHeadModel
from collections import defaultdict
from tqdm import tqdm
from datasets import Dataset
from datasets import load_data... | bairesearch/SBNLPpt | GPT2ptRecursive/GPT2pt.py | GPT2pt.py | py | 16,213 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "modeling_gpt2.recursiveLayers",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "modeling_gpt2.sharedLayerWeightsMLPonly",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "modeling_gpt2.sharedLayerWeightsMLPonly",
"line_number": 60,
"usage... |
33007591642 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index,name="index1"),
path('login/', views.log_in, name="login"),
path('logout/', views.log_out, name="logout"),
path('home/', views.home, name="home"),
path('signup/', views.signup, name= "signup"),
path('... | Fabihno/maize-prediction-project | project/urls.py | urls.py | py | 358 | python | en | code | 1 | github-code | 18 | [
{
"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",
... |
20792123929 | #!/usr/bin/env python
# coding: utf-8
# ### Keras and Tensorflow 2.0
# In[4]:
# data collection
# 1. Collect the stock data -- AAPL (APPLE)
# 2. Preprocess the data - Train and Test
# 3. Create the stacked LSTM model (Long-short term memory)
# 4. Then we will train the model
# 5. Predict the test data and plot th... | ksharpit/Stock-Prediction | main.py | main.py | py | 9,077 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas_datareader.get_data_tiingo",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 99,
"usage_type": "call"
},
{
"api_name... |
21150614924 | from django.shortcuts import render
# Create your views here.
import json
import pandas as pd
import yfinance as yf
from concurrent.futures import ThreadPoolExecutor
from django.http import JsonResponse
def fetch_stock_table(request):
symbols = ['AAPL', 'MSFT', 'GOOG', 'GOOGL', 'AMZN', 'BRK-B', 'UNH', 'NVDA', '... | Cesartwothousands/RU-MARKET-MOGUL | Back-end/overview/views.py | views.py | py | 2,511 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "concurrent.futures.ThreadPoolExecutor",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 28,
"usage_type": "call"
},
{
"api_nam... |
20303049650 | from io import BytesIO
import xlrd
from django.test import TestCase
from django.utils import translation
from model_bakery import baker
from evap.contributor.views import export_contributor_results
from evap.evaluation.models import (
Contribution,
Course,
CourseType,
Degree,
Evaluation,
Quest... | e-valuation/EvaP | evap/results/tests/test_exporters.py | test_exporters.py | py | 26,870 | python | en | code | 93 | github-code | 18 | [
{
"api_name": "django.test.TestCase",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "evap.results.exporters.ResultsExporter",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "model_bakery.baker.make",
"line_number": 45,
"usage_type": "call"
},
{
... |
26948675990 | import pytest
from turncoats.bag import Bag
from turncoats.stone import Stone
def test_init():
bag = Bag()
assert bag.stones.count(Stone.RED) == 19
assert bag.stones.count(Stone.BLUE) == 19
assert bag.stones.count(Stone.BLACK) == 19
assert len(bag.stones) == 57
def test_get():
"""Test the r... | Paolo-Fermin/AlphaTurncoats | tests/test_bag.py | test_bag.py | py | 1,849 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "turncoats.bag.Bag",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "turncoats.stone.Stone.RED",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "turncoats.stone.Stone",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "t... |
35489807973 | import boto3
import os
import botocore.exceptions
client = boto3.client('cognito-idp')
user_pool_id = os.environ['user_pool_id']
def handler(event, context):
print(event)
print('inside Create New User')
name = event['name']
email = event['email']
try:
response = client.admin_create_user... | prabhleennannar/eLibraryManagementSystem | lambdas/register_new_member/register_new_member.py | register_new_member.py | py | 1,368 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "boto3.client",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "botocore.exceptions.exceptions",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "botoco... |
12684555465 | from collections import namedtuple
metro_areas = [
('Tokyo','JP',36.933,(35.689722,139.691667)),
('Delhi NCR', 'IN', 21.935, (28.613889, 77.208889)),
('Mexico City', 'MX', 20.142, (19.433333, -99.133333)),
('New York-Newark', 'US', 20.104, (40.808611, -74.020386)),
('Sao Paulo', 'BR', 19.649, (-23.547778, -46.635833)... | adfoke/Some-Python | tulple_demo.py | tulple_demo.py | py | 812 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.namedtuple",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 19,
"usage_type": "call"
}
] |
40527898210 | from locust import HttpUser, TaskSet, task
import csv
class WebsiteUser(HttpUser):
host = "https://api.jyfwyun.com"
def on_start(self):
print("start")
def read_item_CSV(self):
'''读取条目编码'''
items=[]
with open(r'C:/Users/ZL-52S8FFG/Desktop/新建文件夹/压力测试所需数据(1)/条目数据2.csv',encod... | wangli-wangli/locustProject | locustfile5.py | locustfile5.py | py | 878 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "locust.HttpUser",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "csv.reader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "locust.task",
"line_number": 20,
"usage_type": "name"
}
] |
12801581156 | import json
import random
import pyperclip as Pc
import textwrap
from DirIndexLoad import *
Card = {}
UserInput = ""
print("Welcome to Accessible Flashcards!\nTo stay up to date on updates and bug fixes, be sure to check the Github repo at:\nhttps://github.com/RossMinor/Accessible-Flashcards\nor follow me on Twitter:... | RossMinor/Accessible-Flashcards | Program.py | Program.py | py | 5,872 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "json.dump",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "textwrap.wrap",
"line_number": ... |
2562913992 | # coding: utf-8
import math
import copy
import torch
from torch import nn
from torch.nn import functional
from .pretrained import resnet18, resnet18_pre, resnet34, resnet34_pre, resnet50, resnet50_pre
from .BasicModule import BasicModule
class ResNet18(BasicModule):
def __init__(self, num_classes):
supe... | BolinLai/Vertebrae_Collapse | models/ResNet.py | ResNet.py | py | 11,945 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "BasicModule.BasicModule",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pretrained.resnet18.conv1",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pretrained.resnet18",
"line_number": 18,
"usage_type": "name"
},
{
"api_na... |
3273291971 | from jax import numpy as np
import jax.numpy as jnp
from jax import device_put
from bench.core.executer import Executer
def tblr2bboxes(priors,
tblr,
normalizer=4.0,
normalize_by_wh=True,
max_shape=None):
"""Decode tblr outputs to prediction boxes.
... | DeepLink-org/DLOP-Bench | bench/samples/long_tail/tblr2bbox/jax_impl.py | jax_impl.py | py | 2,800 | python | en | code | 38 | github-code | 18 | [
{
"api_name": "jax.numpy.tensor",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "jax.numpy.split",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_numb... |
24170250315 | import torch
import torch.nn as nn
from torch.nn import functional as F
class SemanticEmbedding(nn.Module):
def __init__(self, args, mesh_dim=71, report_dim=761, embed_size=512):
super(SemanticEmbedding, self).__init__()
self.mesh_tf = nn.Sequential( # 输入的是视觉嵌入
nn.Linear(embed_size, e... | LijunRio/A-Self-Guided-Framework | KMVE_RG/modules/new_model_utils.py | new_model_utils.py | py | 2,325 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
21533643948 | from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
# Create your views here.
from .models import Article
from .forms import ArticleForm
from .forms import ArticleFormNew
from django.http import Http404
from django.db.models import Q #for the sake of complex search... | devaditya12345/TryDjango_3.2 | articles/views.py | views.py | py | 6,013 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "models.Article.objects.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.Article.objects",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "models.Article",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": ... |
5981086323 | #!/usr/bin/env python3
import time
from sys import path
from os import system
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GLib
def timefmt(sc):
sign = '-' if sc < 0 else ''
hr = abs(sc) / 3600
mn = hr % 1 * 60
sc = mn % 1 * 60
return f'{sign}{int(hr)}:{int(mn):02d}:{int(sc):02... | myQwil/time-tracker | timer.py | timer.py | py | 3,706 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "gi.require_version",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk.Window",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "gi.... |
70221625000 | import os
import json
filepath = os .getcwd()
with open(os.path.join(filepath, 'data', 'concept_text.json'), 'r', encoding='utf-8') as f:
data = json.load(f)
def get_keyword_profile(o_name):
s = ''
name = o_name.replace(' ', '_')
try:
for i in data[name]:
dir = {}
st ... | crond-jaist/CyATP | scripts/show_profile.py | show_profile.py | py | 656 | python | en | code | 13 | github-code | 18 | [
{
"api_name": "os.getcwd",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 7,
... |
6176159740 | # encoding:utf-8
from . import app
# from yunpian.SmsOperator import SmsOperator
from flask import request
from app import db
from app.models.Progress import Progress
from app.models.BankCard import BankCard
from app.models.User import User
from app.models.ConsumeRecord import ConsumeRecord
from datetime import *
from... | LittleLittleLittleBoy/financeApp | app/credit/BasicInfo.py | BasicInfo.py | py | 7,901 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.request.form",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "flask.request.form",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "flask.r... |
86596774678 | #!/usr/bin/env python
"""
Wait command for all workers join to a master. It returns 0, or 1 on
error. It checks responses from HTTP UI (http://master:8080/). It
retries in 600 seconds by default.
"""
import sys
import urllib2
import time
import argparse
import logging
import itertools
import xml.etree.ElementTree ... | RIKEN-RCCS/spark-k | scripts/spark-k-wait-start.py | spark-k-wait-start.py | py | 4,199 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "logging.basicConfig",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "argpars... |
35892285771 | import itertools
import networkx as nx
from tqdm import tqdm
import logging
import collections
import constants as keys
import services
from supermatch.docs_to_sku.promoted import promoted_match
from supermatch.docs_to_sku.set_match import set_match
from supermatch.docs_to_sku.same_names import exact_name_match
clas... | selimslab/entrophy | supermatch/docs_to_sku/sku_matching.py | sku_matching.py | py | 2,521 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "services.GenericGraph",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "networkx.Graph",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "collections.de... |
8395269864 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 5 23:41:04 2020
@author: hao
"""
from datetime import datetime, timedelta
import pandas as pd
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
import numpy as np
import matplotlib.pyplot as plt
def file_... | wenhaohsu/undergrade | sleep_data_process/posture/for_ju.py | for_ju.py | py | 3,120 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.plotting.register_matplotlib_converters",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 25,
"usage_type": "call"
},
{
... |
30322137739 | from torchvision import transforms
from torch.utils.data import dataset, dataloader
from torchvision.datasets.folder import default_loader
from utils.RandomErasing import RandomErasing
from utils.RandomSampler import RandomSampler
from PIL import Image
from opt import opt
import os
import re
import numpy as np
class ... | PPatrickGU/ROB313 | TP2_Deep_learning/Ex2_Re_identification_using_Siamese_Neural_Networks/Code/data.py | data.py | py | 5,005 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Resize",
"line_number": 16,
"usage_type": "call"
},
{
... |
10914686034 | # Code by Lilie Boizumault, for QI Informatique, France
# 2020
# files needed :
# ardSerial.py written by Rongzhong Li, Petoi
# many thanks to David Amos for his great tutorial on Speech Recognition
# https://realpython.com/python-speech-recognition/#installing-speechrecognition
####################################... | LilieBoizu/OpenCatDEV | speech_recog.py | speech_recog.py | py | 4,273 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "speech_recognition.Recognizer",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "speech_recognition.RequestError",
"line_number": 85,
"usage_type": "attribute... |
7721115510 | import os
import cv2
import numpy as np
import random
import matplotlib.pyplot as plt
import lpips
import torch
import torch.nn as nn
import torchvision
from torch.distributions.normal import Normal
from skimage.metrics import structural_similarity as ssim
from model import resnet34
from utils import foveat_img
clas... | comp755-improved-foveation-using-ml/optimized_foveation_using_rl | dirty_RL/eval.py | eval.py | py | 5,335 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "model.resnet34",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn.Sequential",
... |
23220585996 | #@JejakCheat
""" Userbot module for getting info about any user on Telegram(including you!). """
import os
from telethon.tl.functions.photos import GetUserPhotosRequest
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.types import MessageEntityMentionName
from telethon.utils import ... | risecid/Auto | userbot/modules/siapa.py | siapa.py | py | 5,868 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.isdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "userbot.TEMP_DOWNLOAD_DIRECTORY",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.mak... |
11436322764 | import requests
def sort_parm(parm: {}):
"""
将字典中的key排序,转换为地址参数字符串,往往API参数签名都需要使用到
:param parm:
:return:
"""
str_parm = ''
for p in sorted(parm):
# 每次排完序的加到串中
# str类型需要转化为url编码格式
# if isinstance(parm[p], str):
# str_parm = f"{str_parm}{p}={parm[p]}&" # ... | yibo7/ebsite-for-vercel | eb_utils/http_utils.py | http_utils.py | py | 4,996 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 58,
"usage_type": "call"
}
] |
15255065665 | #****************************************************************
"""
### THE BELOW TEXT IS OUTDATED and needs to be updated
#This replaces a previous version of gcard_helper.py by using the HTMLParser class
#This allows for more robust parsing of the html mother directory to find gcard files
#Even better would ... | pmoran3/utils | lund_helper.py | lund_helper.py | py | 6,482 | python | en | code | null | github-code | 18 | [
{
"api_name": "fs.lund_identifying_text",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "utils.printer",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "html_reader.html_reader",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "u... |
71813732520 | # coding: utf-8
"""
Test module for the entity.files module
"""
import unittest
from lxml import etree
import reader.smreader as smreader
class TestFinders(unittest.TestCase):
""" TestCase for all the functions in the reader.smreader module """
def shortDescription(self):
return None
def tes... | cutty853/PySMAnalyzer | test/test_reader/test_smreader.py | test_smreader.py | py | 2,188 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "reader.smreader.function_abs_path",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "reader.smreader",
"line_number": 23,
"usage_type": "name"
},
{
"api_name... |
14231184418 | import os
import pickle
import typing
import numpy as np
import torch
from torch.utils import data
from config import Config
from logger import Logger
def putOnDevice ( t: torch.Tensor ):
if Config.useCuda ():
return t.cuda ()
return t.cpu ()
def logTensorInfo ( t: torch.Tensor, name: str ):
Logger.log ( "Da... | Duke02/PoseNet | util.py | util.py | py | 9,180 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "torch.Tensor",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "config.Config.useCuda",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "config.Config",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
... |
21108715584 | import argparse
import inspect
import itertools
from abc import ABC, abstractmethod
from typing import Callable, List
import numpy as np
import onnx
from onnx import helper, numpy_helper
from onnx.onnx_ml_pb2 import GraphProto, ModelProto, NodeProto
from tensorboard.compat.proto.attr_value_pb2 import AttrValue
from te... | microsoft/onnxruntime | tools/python/onnx2tfevents.py | onnx2tfevents.py | py | 13,717 | python | en | code | 9,700 | github-code | 18 | [
{
"api_name": "onnx.onnx_ml_pb2.GraphProto",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "onnx.onnx_ml_pb2.NodeProto",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "onnx.onnx_ml_pb2.GraphProto",
"line_number": 57,
"usage_type": "name"
},
{
... |
8188949384 | import os
import re
import argparse
import random
def crossval_files(prefix, numfolds):
cvfiles = []
for i in range(numfolds):
trainfile = '{}train{}.types'.format(prefix, i)
testfile = '{}test{}.types'.format(prefix, i)
cvfiles.append((trainfile, testfile))
return cvfiles
def re... | gnina/scripts | reduce_data.py | reduce_data.py | py | 2,008 | python | en | code | 19 | github-code | 18 | [
{
"api_name": "re.match",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "random.seed",
"li... |
4116819389 | from django.urls import path
from .views import EquationHome,Detect,Blob,EquationImage,DetectI,FileUploadView,test
urlpatterns = [
path('EqHome',EquationHome),
path('EqI',EquationImage),
path('detect',Detect),
path('detectI',DetectI),
path('<str:a>',Blob),
path('ui', FileUploadView.as_view()),
... | avinashkatariya/handwrittenecognize | main/urls.py | urls.py | py | 349 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.EquationHome",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "views.EquationI... |
44353852758 | #
# (c) 2008 Mandriva, http://www.mandriva.com/
#
# $Id$
#
# This file is part of Pulse 2, http://pulse2.mandriva.org
#
# Pulse 2 is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License... | medulla-tech/medulla | services/mmc/plugins/xmppmaster/querymanager/__init__.py | __init__.py | py | 2,584 | python | en | code | 17 | github-code | 18 | [
{
"api_name": "mmc.plugins.glpi.config.GlpiQueryManagerConfig",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 74,
"usage_type": "call"
},
{
... |
29691631162 | import base64
import subprocess
import time
from functools import partial
from urllib.parse import quote
from Crypto.PublicKey import RSA
from examples.useful_python.examples.spiders.utils.decoder import USE_RSA
subprocess.Popen = partial(subprocess.Popen, encoding="utf-8")
import execjs
import requests
YUANRENXUE_... | kylezb/useful | examples/useful_python/examples/spiders/练习/猿人学/第6题/main.py | main.py | py | 2,655 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "subprocess.Popen",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "functools.partial",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.session",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "examples.use... |
1683972549 | # calculates time dependent concordanane index
import abc
from collections import defaultdict
from typing import Tuple
from easydict import EasyDict
import numpy as np
from sksurv.metrics import concordance_index_ipcw
from src.utils.utils import df_to_event_time_array
from src.utils.data_class import Data
class Evalu... | Bbold72/survtrace | src/utils/evaluator.py | evaluator.py | py | 9,684 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "src.utils.data_class.Data",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "easydict.EasyDict",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "s... |
37982625497 | import numpy as np
import gpflow
import matplotlib.pyplot as plt
import matplotlib.pylab as pl
from mpl_toolkits.mplot3d import axes3d, Axes3D
from BoManifolds.Riemannian_utils.sphere_utils import logmap
from BoManifolds.kernel_utils.kernels_sphere_tf import SphereGaussianKernel, SphereLaplaceKernel
from BoManifolds.p... | NoemieJaquier/GaBOflow | examples/kernels/sphere/sphere_kernels.py | sphere_kernels.py | py | 8,239 | python | en | code | 8 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 12,
"usage_type": "attribute"
},
{
... |
29533943530 | """
Dockenv - Run untrusted python in Docker
"""
import argparse
import os
import sys
import shutil
import tempfile
import subprocess
import logging
import traceback
import shlex
import docker
ROOT_FOLDER = os.path.abspath(os.path.dirname(__file__))
CLIENT = docker.from_env()
LOGGER = logging.getLogger(__name__)
LOGG... | pathtofile/dockenv | dockenv/dockenv.py | dockenv.py | py | 21,128 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "os.path.abspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "docker.from_env",
"l... |
22502487971 | import scrapy
from jdproject.items import JdprojectItem
class JDImageSpider(scrapy.Spider):
name = 'jdimage'
start_urls = [
'https://www.jd.com'
]
def parse(self, response):
item = JdprojectItem()
item['name'] = response.css('.cate_menu_item a::text').extract()
item['... | jieYW/jdproject | jdproject/spiders/jdimage_spider.py | jdimage_spider.py | py | 406 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "scrapy.Spider",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "jdproject.items.JdprojectItem",
"line_number": 13,
"usage_type": "call"
}
] |
28308059422 | import sys
import os
import time
import json
import datetime
import logging
from onedrive import onedrive_simple_sdk
from image_processing import process_image
from datetime import timezone
from video_processing import video_creation_datetime
############## Classes - Data Objects ####################
class PhotoInfo... | hugomcruz/onedrive-picture-processor | show_files.py | show_files.py | py | 3,316 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.basename",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number"... |
26283672932 | from django.shortcuts import render,HttpResponse,redirect
from RBAC.models import User,Permission,Role
# Create your views here.
from RBAC.service.permission import initial_permission
def login(request):
if request.method == "POST":
username=request.POST.get('username')
pwd=request.POST.get('pwd')
... | liangxinxin5102/webRestframework | 63279-Python Django Web典型模块开发实战_源代码/63279 Python Django Web典型模块开发实战源代码/第六章/6-23.py | 6-23.py | py | 599 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "RBAC.models.User.objects.filter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "RBAC.models.User.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "RBAC.models.User",
"line_number": 9,
"usage_type": "name"
},
{
"api_n... |
12271360704 | # IYPT 2022/23 Problem #17 Arrester Bed.
# Tracker for the centers of moving objects with
# writing the results into a file and building a chart.
#
# Made by @topIXItop 14.02.2023 for BNTU Lyceum team.
# Under the GNU General Public License v3.0
import cv2
import ox_graph
filename = 'src_vids/new/big/8_215.mp4'
out_... | 1IxI1/arrester-bed-tracker | stop-tracker/__main__.py | __main__.py | py | 2,459 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FPS",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "cv2.selectROI",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.legacy.Track... |
27379231838 | from django.urls import path
from . import views
app_name = 'news'
urlpatterns = [
path('',views.index,name='index'),
path('<int:id>',views.demo),
path('news/',views.NewsListView.as_view(),name='news_list'),
path('news/<int:news_id>/', views.News_detail.as_view(), name='news_detail'),
path('news/ban... | suyj1103/news_information | apps/news/urls.py | urls.py | py | 460 | python | en | code | 0 | github-code | 18 | [
{
"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",
... |
3843948576 | import sqlite3
#Создаем БД
conn = sqlite3.connect('name.db')
# или так - with sqlite3.connect('name.db')as conn: - тогда не нужно вручную закрывать БД
# Создаем курсор, который будет взаимодействовать с нашей БД
cursor = conn.cursor()
#создадим таблицу с двумя текстовыми колонками
cursor.execute('''CREATE TABLE IF ... | AntonPerehrest/Data-1 | Data_1.py | Data_1.py | py | 1,315 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.