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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41873337753 | import sys
from firebaseConfig import firebase
from config import CLAN_CODE, CLAN_INFO_FILE_PATH, CLAN_QUEST_INFO_FILE_PATH
from clanDatabase import ClanDatabase
def main():
db = ClanDatabase(
CLAN_CODE,
CLAN_INFO_FILE_PATH,
CLAN_QUEST_INFO_FILE_PATH,
firebase.database()
)
process_command(db)
def process_... | ygongdev/FishBotScripts | main.py | main.py | py | 1,424 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "clanDatabase.ClanDatabase",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "config.CLAN_CODE",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "config.CLAN_INFO_FILE_PATH",
"line_number": 9,
"usage_type": "argument"
},
{
"api_na... |
36193733670 | from graftm.graftm_package import GraftMPackage, GraftMPackageVersion3
import dendropy
import logging
import tempfile
from Bio import SeqIO
import extern
from .singlem_package import SingleMPackageVersion2
import shutil
import os
import tempdir
class PackageCreator:
def create(self, **kwargs):
input_graftm... | ye00ye/singlem | singlem/package_creator.py | package_creator.py | py | 5,879 | python | en | code | null | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtree",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "graftm.graftm_package.Graft... |
8331020218 | import os
import datetime
import mysql.connector
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet
# pip install mysql-connector-python
# pip install reportlab
... | IgnaciodeJesusMedinaUrrunaga/Attendance-Registration-with-Facial-Recognition | Attendance_Registration_CIA/Attendance-list-with-facial-recognition-using-Python/transfer_today_records_to_pdf.py | transfer_today_records_to_pdf.py | py | 2,145 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector.connector.connect",
"line_number": 18,
"usage_type": "call"
},
{
"ap... |
3520676139 | import json
import os
import time
import pytest
from src.rss_config_io import RssConfigIO
from src.rss_configuration import RssConfiguration
class TestRssConfiguration:
rss = "http://g1.globo.com/dynamo/rss2.xml"
timestamp = [2019, 8, 24, 2, 56, 52, 5, 236, 0]
temp = "missing_file.json"
base_content... | maxpeixoto/rss_filterer | test/test_rss_configuration.py | test_rss_configuration.py | py | 2,655 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "src.rss_configuration.RssConfiguration._timestamp_field",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "src.rss_configuration.RssConfiguration",
"line_number": 15,
"usag... |
28914738818 | import os
import unittest
import json
from functools import wraps
from flask_sqlalchemy import SQLAlchemy
from app import create_app
from models import setup_db, Movie, Actor
class CapstoneTestCase(unittest.TestCase):
"""This class represents the trivia test case"""
def setUp(self):
"""Define test v... | steffaru/FSND_CaptionProject | test_flaskr.py | test_flaskr.py | py | 9,453 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "app.create_app",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "models.setup_db",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchem... |
30217328394 | # Libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
#Import all datasets
df_customers=pd.read_csv('olist_customers_dataset.csv')
df_geolocation=pd.read_csv('olist_geolocation_dataset.csv')
df_order_items=pd.read_csv('olist_order_items_dataset.csv')
df_order_pay=pd.r... | ThePeziBear/MyPythonLibrary | Masterthesis/Olist/Data_Manipulation_V2.py | Data_Manipulation_V2.py | py | 6,260 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"... |
37303345220 | # Superposition of 2 spirals
import tkinter
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, NavigationToolbar2Tk)
from matplotlib.figure import Figure
import matplotlib.animation as animation
import numpy as np
from matplotlib.patches import Circle
import mpl_toolkits.mplot3d.art3d as art3d
def chan... | marukatsutech/superposition_of_2_spirals | superposition_of_2_spirals.py | superposition_of_2_spirals.py | py | 8,121 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.patches.Circle",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "mpl_toolkits.mplot3d.art3d",
"line_number": 98,
"usage_type": "na... |
3828632722 | from collections import Counter
from data import SentimentDataset
import json
class Preprocessor:
def __init__(self, max_vocab):
self.max_vocab = max_vocab
self.vocab2enc = None
self.enc2vocab = None
self.max_len = 0
def fit(self, dataset):
words = list()
for i... | yuvalofek/NLP | DeepLearning/prepro.py | prepro.py | py | 3,090 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "data.SentimentDataset",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "data.SentimentDataset",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "data.... |
27984628392 | from scipy.io.wavfile import read, write
import io
import matplotlib.pyplot as plt
## This may look a bit intricate/useless, considering the fact that scipy's read() and write() function already return a
## numpy ndarray, but the BytesIO "hack" may be useful in case you get the wav not through a file, but trough some w... | Hrithik0the0research/gan-discrimator | gan/synthetic-data-generator-main/audio_read.py | audio_read.py | py | 1,017 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "scipy.io.wavfile.read",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.py... |
29867399693 | import os
import csv
import sqlite3
DATA_DIR="data"
DATABASE="database.db"
sensors = {
"dht22": {
"table": "temperaturUndLuftdruck",
"mapping": {
"sensor_id": "SensorID",
"timestamp": "datetime",
"humidity": "luftwert",
"temperature": "tempwert"
... | Jan200101/feinstaub-projekt | import.py | import.py | py | 1,971 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isdir",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sqlite3.OperationalError",... |
6246195016 | def set_font():
import platform
import matplotlib.font_manager as fm
system_name = platform.system()
if system_name == 'Windows':
return 'Malgun Gothic'
elif system_name == 'Darwin':
return 'AppleGothic'
elif system_name == 'Linux':
path = '/usr/share/font/truetype/nanum... | cheesecat47/ML_DL_Jan2020 | Jan16/matplot_font.py | matplot_font.py | py | 588 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "platform.system",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.font_manager.FontProperties",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.font_manager",
"line_number": 12,
"usage_type": "name"
}
] |
19523144511 | from celery import shared_task
from time import sleep
from .models import Movie
@shared_task
def increase_ranking():
# increase_ranking: This task increases the ranking of upcoming movies by 10 every 5 minutes. It gets a list of
# all upcoming movies from the database, iterates over them, and adds 10 to each ... | Optimustprime/cinema_program | app/movies/tasks.py | tasks.py | py | 853 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Movie.objects.filter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Movie.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.Movie",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "ce... |
12634573747 | import pygame
import sys
from snake_object import Snake
from setting import Setting
from apple import Apple
def press_keydown(snake, event):
if event.key == pygame.K_LEFT:
snake.go_x = -1
snake.go_y = 0
elif event.key == pygame.K_RIGHT:
snake.go_x = 1
snake.go_y = 0
elif eve... | BarSerhey/Python | snake/snake.py | snake.py | py | 1,770 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.K_LEFT",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_RIGHT",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_UP",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.K_DOWN"... |
24276436490 | #!/usr/bin/env python3
import os
import requests
from fmiopendata.wfs import download_stored_query
import datetime
import json
import pandas as pd
import json
def give_prediction(stationId, month, day, hour):
place = "latlon=60.3267,24.95675" # default place is Veromiehenkylä
stationShortCode = ''
weathe... | millalin/Train-predictor | application/helpers/weather_for_model.py | weather_for_model.py | py | 2,255 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_nu... |
29841696751 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 8 16:09:50 2022
@author: Owner
"""
from Hamiltonian import Hamiltonian
import numpy as np
import math
import matplotlib.pyplot as plt
import copy
from Hamiltonian import Hamiltonian
from Fock_vector import fock_vector
import Ryser_Algorithm as ryser
import config as con... | ahadriaz99/MSci-Project | NonRotatingDisc.py | NonRotatingDisc.py | py | 16,186 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 32,
"usage_type": "name"
},
{
... |
17419658730 | import json
import os
from pyui.geom import Size
from .base import View
DATA_DIR = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "data"
)
class Text(View):
def __init__(self, text, **options):
super().__init__(**options)
self.text = str(text)
self._min_c... | dcwatson/pyui | pyui/views/text.py | text.py | py | 1,649 | python | en | code | 21 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9... |
74918974586 | from dataclasses import dataclass
from collections import defaultdict
import math
@dataclass
class Punto:
x: int
y: int
owner: int
def distancia(p1,p2):
return abs(p1.x-p2.x)+abs(p1.y-p2.y)
def day6(file):
with open(file) as f:
lines = f.readlines()
puntosControl = list()
xlist = ... | aarroyoc/advent-of-code-2018 | python/day6/day6.py | day6.py | py | 2,152 | python | es | code | 1 | github-code | 6 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "math.inf",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "collection... |
19072626002 | import requests
import json
import logging
import sys
import json
import pandas as pd
from pathlib import Path
from requests_html import HTMLSession
def parse_and_download_files(servicetags_public, msftpublic_ips, officeworldwide_ips):
# URL for Feeds
azurepublic = "https://www.microsoft.com/en-us/download/co... | microsoft/mstic | .script/get-msftpubliip-servicetags.py | get-msftpubliip-servicetags.py | py | 2,873 | python | en | code | 87 | github-code | 6 | [
{
"api_name": "requests_html.HTMLSession",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.get",
... |
73252316348 | """"
Для заданного набора N точек на плоскости найти прямоугольник минимальной площади,
содержащий все указанные точки.
Стороны прямоугольника не обязаны быть параллельными координатным осям
"""
# important functions: MinimumBoundingBox
from scipy.spatial import ConvexHull
from math import sqrt,atan2
import numpy as... | ded-evsey/TandACG | 21.py | 21.py | py | 6,002 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.sqrt",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 47,
"u... |
4930731104 | # -*- coding: utf-8 -*-
"""
Description: Deep Patch Learning Model
Author: wondervictor
"""
import math
import torch
import torch.nn as nn
import numpy as np
import layers
import basenet
class PatchHeadNetwork(nn.Module):
def __init__(self, use_cuda, num_classes, use_relation=False):
super(PatchHeadNet... | wondervictor/dpl.pytorch | models/dpl.py | dpl.py | py | 3,460 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "layers.ROIAlign",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn.Sequential",
... |
10036308173 | """
Input pipeline (tf.dataset and input_fn) for GQN datasets.
Adapted from the implementation provided here:
https://github.com/deepmind/gqn-datasets/blob/acca9db6d9aa7cfa4c41ded45ccb96fecc9b272e/data_reader.py
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_fun... | ogroth/tf-gqn | data_provider/gqn_provider.py | gqn_provider.py | py | 9,919 | python | en | code | 189 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "... |
5522014624 | import openpyxl
def get_exl(file,Sheet):
exl = openpyxl.load_workbook(file)
table = exl[Sheet]
max_rows = table.max_row
max_column = table.max_column
# print(max_rows,max_column)
data = []
for row in range(1, max_rows):
rowdata = []
for column in range(3, max_column-1):
... | commiting/TEST | Tools/getexcel.py | getexcel.py | py | 541 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 5,
"usage_type": "call"
}
] |
23920525234 | import threading
import tkinter as tk
from motor import Motor
motor = Motor()
thread_motor = threading.Thread(target=motor.inicia_motor, args=(True,))
thread_motor.daemon = True
thread_motor.start()
def update_value():
# Função para atualizar o valor
# Aqui você pode implementar a lógica desejada para atual... | PotatoMexicano/sistema-controle-eletrico | sistema_controle_eletrico/screen.py | screen.py | py | 1,354 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "motor.Motor",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "motor.inicia_motor",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "motor.rotacoes",
... |
15598838122 | import torch
from torch import nn
import torch.nn.functional as F
from ssd.utils_ssd.box_utils import match, log_sum_exp
# evaluate conf_loss and loc_loss
class MultiBoxLoss(nn.Module):
def __init__(self, cfg):
super(MultiBoxLoss, self).__init__()
self.num_classes = cfg.num_classes
self.t... | AceCoooool/detection-pytorch | ssd/utils_ssd/multiloss.py | multiloss.py | py | 2,399 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.LongTensor",
"line... |
12570656588 | import discord
import requests
client = discord.Client()
tokenFile = open('secret.secret','r')
token = tokenFile.readline()
@client.event
async def on_message(msg):
if msg.content.startswith('$$$$'):
name = msg.content[4::]
apiCall = 'https://na.whatismymmr.com/api/v1/summoner?name=' + name
... | gpulia/kitchenSync | server.py | server.py | py | 790 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.Client",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
}
] |
31014267679 | from transformers import (
BlenderbotSmallForConditionalGeneration,
BlenderbotSmallTokenizer,
BlenderbotForConditionalGeneration,
BlenderbotTokenizer,
)
from transformers import GPT2LMHeadModel, GPT2Tokenizer
from transformers import AutoTokenizer, AutoModelForCausalLM
import sys
download_type = sys.ar... | DariuszO/openchat | model_download.py | model_download.py | py | 1,690 | python | en | code | null | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "transformers.GPT2LMHeadModel.from_pretrained",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "transformers.GPT2LMHeadModel",
"line_number": 15,
"usage_type": "name"
},
... |
34346397693 | """
Exercises of the book "Think python"
2.10 Exercises
"""
import math
import datetime
import decimal
# Exercise 2
# Using the Python as a calculator
# 1. The volume of a sphere with radius r is 4/3 π r3. What is the volume of a sphere with radius 5?
radius = 5
print("The volume of a sphere: ", (4 / 3 * math.pi * r... | LiliiaMykhaliuk/think-python | chapter2/2.10.2.py | 2.10.2.py | py | 1,916 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.pi",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "decimal.Decimal",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"l... |
74888826427 | from rest_framework.serializers import CharField, ModelSerializer
from .models.base import CanadianCommonCv
from .models.employment import AcademicWorkExperience, Employment
from .models.personal_information import Identification, Email, Website
from .models.recognitions import AreaOfResearch
from .models.user_profile... | c3g/ccv_api | ccv/serializers.py | serializers.py | py | 2,733 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "models.recognitions.AreaOfResearch",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 20,... |
33810339763 | import os
from random import shuffle
import tensorflow as tf
import glob
from config import config
# all functions except init and create_iterators should be empty
class Preprocessing:
def __init__(self):
print('preprocessing instance creation started')
self.dir_name = config['data_dir']
s... | ashnik777/Audio-Classification | preprocessing.py | preprocessing.py | py | 3,788 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "config.config",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "config.config",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number... |
73183731388 | import numpy as np
import cv2
img = cv2.imread('/Users/macbookair/PycharmProjects/PR/homework2/unpro.jpg')
bg = cv2.imread('/Users/macbookair/PycharmProjects/PR/homework2/back2.png')#---->3750*2500
mask = np.zeros(img.shape[:2],np.uint8)
bgdModel = np.zeros((1,65),np.float64)
fgdModel = np.zeros((1,65),np.float64)
re... | xubinchen-very6/Pattern-recognition | prml/homework2/背景变变变.py | 背景变变变.py | py | 855 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 7,
... |
30938963931 | import pandas as pd
from config import CONFIG_DICT
import networkx as nx
import matplotlib.pyplot as plt
import random
import cv2
import numpy as np
import math
from MplCanvas import MplCanvas
import Equirec2Perspec as E2P
new_min = -100
new_max = 100
lat_min = 40.42524817 ## this is for first 500 in pittsb... | klekkala/usc_navigate | src/data_helper.py | data_helper.py | py | 14,529 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "networkx.Graph",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "MplCanvas.MplCanvas",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "MplCanvas.MplCanvas",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "config.CONFIG_... |
13239474097 | from __future__ import division
from __future__ import print_function
from builtins import range
from past.utils import old_div
from numpy import *
from matplotlib.pyplot import *
import sys
def solver(I, a, T, dt, theta):
"""Solve u'=-a*u, u(0)=I, for t in (0,T]; step: dt."""
dt = float(dt) # avoid ... | hplgit/doconce | doc/src/slides/src/solver.py | solver.py | py | 4,682 | python | en | code | 305 | github-code | 6 | [
{
"api_name": "past.utils.old_div",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "builtins.range",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "sys.argv",
... |
23391816430 | import os
import shutil
import subprocess
import time
import pylab
import imageio
import numpy as np
from tqdm import tqdm
from skimage.io import imread, imsave
def create_options(model, epoch):
opts_test = {
"loadSize": 512,
"fineSize": 512,
"how_many": 'all',
"phase": 'test',
... | chang/DeepPainting | train/test_cyclegan.py | test_cyclegan.py | py | 6,948 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.realpath",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
26552246319 | #!/usr/bin/env python3
import fnmatch
import os
import re
import ntpath
import sys
import argparse
def get_private_declare(content):
priv_declared = []
srch = re.compile('private.*')
priv_srch_declared = srch.findall(content)
priv_srch_declared = sorted(set(priv_srch_declared))
priv_dec_str = ''... | acemod/ACE3 | tools/search_privates.py | search_privates.py | py | 4,143 | python | en | code | 966 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 30,
... |
30798123556 | # -*- coding: UTF-8 -*-
# 百度人脸识别:https://ai.baidu.com/ai-doc/FACE/ek37c1qiz#%E4%BA%BA%E8%84%B8%E6%A3%80%E6%B5%8B
from aip import AipFace
from config import BAIDU_ID, BAIDU_KEY, BAIDU_SECRET_KEY
'''
百度人脸识别
优点:可免费使用,个人账户的限制为2QPS,企业账户的限制为10QPS
'''
""" 你的 APPID AK SK """
APP_ID = BAIDU_ID
API_KEY = BAIDU_KEY
SECRET_KEY ... | bobcjxin/rank_face | base_baidu.py | base_baidu.py | py | 1,773 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "config.BAIDU_ID",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "config.BAIDU_KEY",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "config.BAIDU_SECRET_KEY",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "aip.AipFace"... |
10192615887 |
import numpy as np
import matplotlib.pyplot as plt
# data I/O
filename = 'dataset.txt'
file = open(filename, 'r')
data = file.read()
# use set() to count the vacab size
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
print ('data has %d characters, %d unique.' % (data_size, vocab_size))
# dictio... | shesikiran03/science-fiction-writer | Task-1 .py | Task-1 .py | py | 7,092 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.randn",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randn",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random"... |
8215468580 | import cv2
import numpy as np
from PIL import Image
# Load the image
img = cv2.imread('ParkingLot.jpg')
# Convert to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Apply edge detection
edges = cv2.Canny(gray, 50, 150, apertureSize=3)
# Apply Hough line detection
lines = cv2.HoughLines(edges, rho=1, theta=np... | TongshenH/AuE8200_perception | hw3/test.py | test.py | py | 2,541 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.Canny",
"line_nu... |
40960795543 | import pytest
from collections import Counter
from ottoscript.base import OttoBase, OttoContext
from ottoscript.datatypes import (Number,
String,
Var,
Entity,
List,
... | qui3xote/otto | tests/test_datatypes/datatype_test.py | datatype_test.py | py | 6,300 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "ottoscript.datatypes.Number",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "ottoscript.datatypes.String",
"line_number": 28,
"usage_type": "call"
},
{
"api_name... |
27855486756 | import numpy as np
import torch
import os
from collections import OrderedDict
from torch.autograd import Variable
import itertools
import util.util as util
from util.image_pool import ImagePool
from .base_model import BaseModel
from . import networks
import sys
# TODO (1) remove CycleLoss?
# We have feat_loss_Ar... | amandaullvin/CycleGAN_destreak_MRI | models/cycle_wgan_model.py | cycle_wgan_model.py | py | 23,263 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.sum",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "base_model.BaseModel",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "base_model.BaseModel.initialize",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "base_m... |
3492737799 | """Provides functional layers for the model"""
import numpy as np
import torch
import torch.nn.functional as F
from common_types import Tensor, Union, _float, _int
from torch.types import Device, _size
_opt_arg = Union[_int, _size]
_opt_tensor = Union[Tensor, None]
def conv2d(x: Tensor,
weight: Tensor,
... | RashedDoha/meta-drn-pytorch | model/layers.py | layers.py | py | 1,647 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "common_types.Union",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "common_types._int",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.types._size",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "common_types.Unio... |
11307160967 | from django.conf.urls import url
from .views import Discount_view, Category_view, Product_view, Product_detail_view, Category_detail_view
#These two added for viewsets
# from django.conf.urls import include
from rest_framework.routers import DefaultRouter
from django.urls import path, include
from django.contrib impor... | wjbarng/INFO441-Wholesale | wholesale/urls.py | urls.py | py | 1,708 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "views.Discount_view",
"line_number": 13,
"usage_type": "argument"
},
{
"api... |
3345686330 | import argparse
import subprocess
import os.path
import math
def dispatch(out_file, err_file, cmd, go, num_cores=1, num_nodes=1, max_hours=1, memory_in_gb=16):
"""
Populates 'runscript.sh' file to run 'dqn_original.py' file
on cluster's GPU partition for 'max_hours' hours with 1 node, 1 core, and 32GB mem... | osiajod/cs205_project | singlenode_parallel/src/cluster_serialtrain.py | cluster_serialtrain.py | py | 4,870 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "subprocess.call",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "math.modf",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"li... |
8765175527 | import bpy
import csv
import os
from bpy import context
import builtins as __builtin__
def console_print(*args, **kwargs):
for a in context.screen.areas:
if a.type == 'CONSOLE':
c = {}
c['area'] = a
c['space_data'] = a.spaces.active
c['region'] = a.regions[-1... | baehs1989/blender-script | K_LEAGUE.py | K_LEAGUE.py | py | 15,516 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bpy.context.screen",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "bpy.context",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "bpy.context.window",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "bpy.context... |
8978366140 | import os
import pandas as pd
from darts import TimeSeries
from darts.models import LightGBMModel
from enfobench import AuthorInfo, ModelInfo, ForecasterType
from enfobench.evaluation.server import server_factory
from enfobench.evaluation.utils import periods_in_duration
class DartsLightGBMModel:
def __init__(se... | attila-balint-kul/energy-forecast-benchmark-examples | models/dt-lightgbm-direct/src/main.py | main.py | py | 1,933 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "enfobench.ModelInfo",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "enfobench.AuthorInfo",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "enfobench.ForecasterType.point",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_... |
18399278652 | # SPDX-License-Identifier: GPL-2.0-only
import threading
from pprint import pprint
import pytest
from flask import url_for
import libeagle
from tests.simulator import eagle200sim
import re
@pytest.fixture(scope="session", autouse=True)
def app():
app = eagle200sim.create_app()
return app
@pytest.mark.use... | lrusak/py-eagle-200 | tests/test_eagle200.py | test_eagle200.py | py | 1,240 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tests.simulator.eagle200sim.create_app",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tests.simulator.eagle200sim",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 14,
"usage_type": "call"
},
{
... |
43417946445 | import cv2
import matplotlib.pyplot as plt
import pandas as pd
img1_path = 'U14.png'
csv_path = 'colours.csv'
img2 = cv2.imread(img1_path)
img2 = cv2.resize(img2, (800, 600))
plt.figure(figsize=(20, 8))
plt.imshow(img2)
grid_RGB = cv2.cvtColor(img2, cv2.COLOR_BGR2RGB)
plt.figure(figsize=(20, 8))
pl... | AnupCloud/Color_Detection | color_detection.py | color_detection.py | py | 1,604 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
73829193786 | # Usage:
import asyncio
from starknet_py.net.gateway_client import GatewayClient
from starknet_py.net.networks import TESTNET
from starknet_py.net import AccountClient, KeyPair
from starknet_py.contract import Contract
from starknet_py.net.models.chains import StarknetChainId
uuid = '2f530e87-a2c5-47c9-8ebf-e704dc06e9d... | feltroidprime/CTF-starknet-cc | challenges/solve-me/deploy.py | deploy.py | py | 1,531 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "starknet_py.net.gateway_client.GatewayClient",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "starknet_py.net.networks.TESTNET",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "starknet_py.net.AccountClient",
"line_number": 20,
"usa... |
19130670937 | from datetime import datetime
import docker
import mock
import unittest
from infra.services.android_docker import containers
class FakeDevice(object):
"""Mocks a usb_device.Device"""
def __init__(self, serial, physical_port):
self.serial = serial
self.physical_port = physical_port
self.major = 0
... | mithro/chromium-infra | infra/services/android_docker/test/containers_test.py | containers_test.py | py | 10,531 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "docker.errors.NotFound",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "docker.errors",
"line_number": 94,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 97,
"usage_type": "attribute"
},
{
"api_name": "infr... |
73814975546 | from abc import ABCMeta, abstractmethod
from asyncio.queues import Queue as AioQueue
from queue import Queue
from bonobo.constants import BEGIN, END
from bonobo.errors import AbstractError, InactiveReadableError, InactiveWritableError
from bonobo.nodes import noop
BUFFER_SIZE = 8192
class Readable(metaclass=ABCMeta... | python-bonobo/bonobo | bonobo/structs/inputs.py | inputs.py | py | 2,922 | python | en | code | 1,564 | github-code | 6 | [
{
"api_name": "abc.ABCMeta",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "bonobo.errors.AbstractError",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "abc.abstractmethod",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "abc.ABCMet... |
16199644126 | ############################################################################
## Django ORM Standalone Python Template
############################################################################
# Turn off bytecode generation
from datetime import time
import sys
sys.dont_write_bytecode = True
# Django specific setti... | barrydaniels-nl/crypto-api | ctimanager/scripts/update_news_items.py | update_news_items.py | py | 15,028 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.dont_write_bytecode",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.path.a... |
27980959232 | import glob
import sqlite3
import csv
import time;
conn = sqlite3.connect('gdax_0.1.db')
cur = conn.cursor()
cur.execute("SELECT * FROM quotes_BTC_LTC") # WHERE start >?", (1420160461, ))
results1 = cur.fetchall()
conn2 = sqlite3.connect('gdaxLTC.db')
cur2 = conn2.cursor()
cur2.execute("SELECT * FROM quotes_BTC_LTC"... | HristoHr/backTestEngine | CheckDataCompletenessDB.py | CheckDataCompletenessDB.py | py | 1,226 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 11,
"usage_type": "call"
}
] |
36781902171 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
__author__ = 'ktulhy'
# TODO: убрать дублирование кода
ERROR = "\x1b[31m[---ERROR--] \x1b[0m"
SYSTEM = "\x1b[34m[--SYSTEM--] \x1b[0m"
INFO = "[---INFO---] "
WARNING = "\x1b[33m[--WARNING-] \x1b[0m"
test_types = []
from lxml import etree
de... | AzaubaevViktor/c_tested | lib_tested.py | lib_tested.py | py | 6,966 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "lxml.etree.parse",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "lxml.etree.XMLSyntaxError",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "lxml.etree... |
25389647152 | import nltk
import numpy as np
import pandas as pd
import re
"""This code aims to perform text preprocessing and save processed texts as a new file"""
def utils_preprocess_text(text, flg_stemm=False, flg_lemm=True, lst_stopwords=None):
"""Text processing: remove stopwords, stem or lemma"""
## clean (convert ... | nogibjj/Suicide-Text-Classification | a_01_text_preprocessing.py | a_01_text_preprocessing.py | py | 1,659 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.sub",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.stem.porter.PorterStemmer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nltk.stem",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "nltk.stem.wordne... |
20665108806 | import os
from dataclasses import dataclass, field
from pathlib import Path
from .file_utils import CsvWriter, JsonWriter, PickleWriter
@dataclass
class File:
""" Класс, представляющий файл. """
name: str
size: int
parent: 'Directory'
path: str
def __str__(self):
return f"File: {self... | nadia3373/GeekBrains-Python-Developer | Diving into Python/s10/directory_traversal/directory_traversal.py | directory_traversal.py | py | 3,249 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "dataclasses.field",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "dataclasses.... |
14138130461 | from flask_wtf import FlaskForm
from wtforms import SelectField, SubmitField
class Rate(FlaskForm):
rating = SelectField('Выберите оценку',
choices=[(None, 'Не завершено'), (10, 'Шедевр(10)'), (9, 'Великолепно(9)'),
(8, 'Очень хорошо(8)'), (7, 'Хорошо(7)'... | DmitriyDog/WEB | Rate.py | Rate.py | py | 714 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "flask_wtf.FlaskForm",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "wtforms.SelectField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "wtforms.SubmitField",
"line_number": 12,
"usage_type": "call"
}
] |
30522562696 | from django.urls import path
from django.views.generic import TemplateView
import mainapp.views as views
app_name = 'mainapp'
urlpatterns = [
path('',
views.WorkoutListView.as_view(),
name='index'),
path('about/',
TemplateView.as_view(template_name='mainapp/about.html'),
... | galla-okto/otus_training_site | mainapp/urls.py | urls.py | py | 969 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mainapp.views.WorkoutListView.as_view",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mainapp.views.WorkoutListView",
"line_number": 10,
"usage_type": "attribute"
},
... |
33255293229 | from typing import Optional
from fastapi.routing import APIRouter
from pydantic.main import BaseModel
from mongo import user_col, list_col
from auth_repo import ar
from dependencies import verify_token_dependency
from bson.objectid import ObjectId
from fastapi import Depends
from fastapi.routing import APIRouter
user_... | snokpok/listlive | backend/src/routers/user.py | user.py | py | 2,432 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "fastapi.routing.APIRouter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "fastapi.Depends",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dependencies.verify_token_dependency",
"line_number": 12,
"usage_type": "argument"
},
{
... |
43491211360 | from rest_framework.serializers import ModelSerializer, SlugRelatedField
from products.models import (
Product,
ProductTag
)
class ProductSerializer(ModelSerializer):
'''
Make output appear as an array of strings:
"tags": ["first", "second", "third"]
Rather than an array of objects:
... | skeithtan/iris | products/serializers.py | serializers.py | py | 768 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.SlugRelatedField",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "products.models.Product",
"line_number": 27,
"usage... |
27215234475 | import os
import sys
import click
import pytest
from click.exceptions import ClickException
CONTEXT_SETTINGS = dict(
help_option_names=['-h', '--help']
)
class _CustomClickException(ClickException):
exit_code = 0x20
@pytest.fixture()
def cli1():
@click.command('cli1', help='CLI-1 example', context_set... | HansBug/hbutils | test/testing/simulate/conftest.py | conftest.py | py | 955 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "click.exceptions.ClickException",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "os.environ.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "sys.st... |
39712277768 | import json
import sqlite3
from sqlite3 import Error
import requests
from lxml import html
def get_popular_drinks():
url = 'https://www.esquire.com/food-drink/drinks/a30246954/best-alcohol-bottles-2019/'
page = requests.get(url)
tree = html.fromstring(page.content)
alcohol = tree.xpath('/... | advaa123/cocktailcloset | models/basic.py | basic.py | py | 4,432 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_... |
8424293393 | from bs4 import BeautifulSoup
import spacy
import os
#nlp = spacy.load("nl_core_news_lg")
nlp = spacy.load("en_core_web_lg")
import regex as re
from nltk import ngrams
import pickle
import json
from augment.replace import BertSampler
from sacremoses import MosesDetokenizer
md = MosesDetokenizer(lang='en')
def position... | TallChris91/Neural-Data-to-Text-Small-Datasets | Data_Augmentation/Mark_Words_E2E.py | Mark_Words_E2E.py | py | 14,690 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "spacy.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sacremoses.MosesDetokenizer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
3975243099 | # -*- coding:utf-8 -*-
import torchvision
import torch.nn as nn
# def load_model(pretrained=True, num_classes=None):
# """加载model
# Parameters
# pretrained: bool
# True: 加载预训练模型; False: 加载未训练模型
# num_classes: int
# Alexnet最后一层输出
# Returns
# alexnet_model: model
... | ray0809/pytorch | retrieval/DeepHash/DSDH_PyTorch/models/alexnet.py | alexnet.py | py | 1,578 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torchvision.models.resnet34",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "torchvision.models",
"line_number": 63,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 67,
"usage_type": "call"
},
{
"api_name"... |
73817524986 | # This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
import json
import os
import re
import tests
import tests.mockbackend
import tests.utils
#################################
# 'bugzilla query' mock testing #
#################################
def test_query(run_... | python-bugzilla/python-bugzilla | tests/test_cli_query.py | test_cli_query.py | py | 7,747 | python | en | code | 120 | github-code | 6 | [
{
"api_name": "tests.mockbackend.make_bz",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tests.mockbackend",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "tests.mockbackend.make_bz",
"line_number": 27,
"usage_type": "call"
},
{
"api_na... |
2908367696 | from __future__ import annotations
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Union
from httpx import AsyncClient
from supertokens_python.recipe.thirdparty.provider import Provider
from supertokens_python.recipe.thirdparty.types import (
AccessTokenAPI, AuthorisationRedirectAPI, UserInfo, UserIn... | starbillion/supertokens_python | supertokens_python/recipe/thirdparty/providers/github.py | github.py | py | 3,505 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "supertokens_python.recipe.thirdparty.provider.Provider",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 17,
"usage_type": "name"
},
... |
30172432184 | #!/usr/bin/env python3
import io
import time
import serial
from serial.tools.list_ports import comports
class Arduino(object):
def __init__(self, port):
self.port= serial.Serial(port, 115200, timeout=0.1)
self.iow= io.TextIOWrapper(
io.BufferedRWPair(self.port, self.port, 1),
... | ComNets-Bremen/GDI-Tutorials | target/examples/21_atuino.py | 21_atuino.py | py | 2,069 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "serial.Serial",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "io.TextIOWrapper",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "io.BufferedRWPair",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"li... |
9273208977 | from flask import Flask, render_template, request
import joblib
import numpy as np
import pandas as pd
app = Flask(__name__)
# Load your model here
model = joblib.load('C:/Users/Dylan/exoplanets/models/exoplanet_classifier.joblib')
@app.route('/', methods=['GET', 'POST'])
def home():
prediction = Non... | DylanBerger/ExoplanetClassifier | app.py | app.py | py | 1,739 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"... |
26898344474 | # Autor: David Martínez Acha
# Fecha: 04/02/2023 14:30
# Descripción: Permite cargar datasets
# Version: 1.2
from os.path import isfile
import numpy as np
import pandas as pd
from pandas import DataFrame
from pandas.api import types
from scipy.io import arff
from algoritmos.utilidades.filetype import Fi... | dma1004/TFG-SemiSupervisado | algoritmos/utilidades/datasetloader.py | datasetloader.py | py | 4,948 | python | es | code | 5 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "algoritmos.utilidades.filetype.FileType.CSV",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "algoritmos.utilidades.filetype.FileType",
"line_number": 32,
"usage_type"... |
4785215660 | from collections import deque,defaultdict
n,m = map(int,input().split())
d = defaultdict(list)
for i in range(m):
u,v = map(int,input().split())
d[u].append(v)
d[v].append(u)
visited = [0]*n
ans = 0
for i in range(1,n+1):
if visited[i-1] == 1:
continue
q = deque()
q.append(i)
visited... | K5h1n0/compe_prog_new | VirtualContest/022/06.py | 06.py | py | 541 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
}
] |
19887674480 | #
# -*- coding: utf-8 -*-
# OpenPGPpy OpenPGPcard : OpenPGP smartcard communication library for Python
# Copyright (C) 2020-2022 BitLogiK
#
# This program 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 Foundati... | bitlogik/OpenPGPpy | OpenPGPpy/openpgp_card.py | openpgp_card.py | py | 22,169 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "smartcard.util.toBytes",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "smartcard.util.toBytes",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "sma... |
17177402704 | """
Kaming Yip
CS677 A1 Data Science with Python
Apr 3, 2020
Assignment 9.3: Random Forest
"""
from pandas_datareader import data as web
import os
import pandas as pd
import numpy as np
from tabulate import tabulate
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics imp... | KamingYip/Trading_Strategies_with_Stock_Data | Random Forest.py | Random Forest.py | py | 18,943 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "pandas_datareader.data.get_data_yahoo",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas_datareader.data",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "pandas.to_datetime",
"line_number": 31,
"usage_type": "call"
},
{
"a... |
23907212429 | #!/usr/bin/env python
# -*- coding:utf-8 -*
import pickle
import sys
import pandas as pd
from utils.change_column_names import changeToName
from utils.feature_engineering import *
from utils.labels import *
from utils.pipelines import transformation_pipeline
from utils.strategy import Strategy
input_path = sys.argv[... | TheLohia/Sultans | myModel_demo.py | myModel_demo.py | py | 1,090 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_n... |
35848910596 | from fastapi import Depends, FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from sqlalchemy.orm import Session
import crud
import models
import schemas
from db_handler import SessionLocal, engine
models.Base.metadata.create_all(bind=engine)
app = FastAPI(
title="FDFC Server",
version="... | chris-vill/fdfc-server | main.py | main.py | py | 2,151 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Base.metadata.create_all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Base",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "db_handler.engine",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "fa... |
42510851613 | import sys, pathlib
import pytest
sys.path.insert(0,str(pathlib.Path(__file__).parent.parent.joinpath("src").resolve()))
#import pytest
from certauth2.__main__ import main
from certauth2 import CertificateAuthority, Encoding
from certauth2.creds_store import ondiskPathStore, ondiskCredentialStore
from cryptography i... | jose-pr/pypki | tests/test_certauth2.py | test_certauth2.py | py | 2,188 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_nu... |
53220412 | from datetime import date
from zohocrmsdk.src.com.zoho.api.authenticator import OAuthToken
from zohocrmsdk.src.com.zoho.crm.api import Initializer
from zohocrmsdk.src.com.zoho.crm.api.dc import USDataCenter
from zohocrmsdk.src.com.zoho.crm.api.record import RecordOperations, ConvertBodyWrapper, LeadConverter, Record, ... | zoho/zohocrm-python-sdk-5.0 | samples/records/ConvertLead.py | ConvertLead.py | py | 4,997 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "zohocrmsdk.src.com.zoho.crm.api.dc.USDataCenter.PRODUCTION",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "zohocrmsdk.src.com.zoho.crm.api.dc.USDataCenter",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "zohocrmsdk.src.com.zoho.api.authentica... |
27280445528 | from aiogram import types
from aiogram.dispatcher.filters import BoundFilter
import config
import dispatcher
class IsOwnerFilter(BoundFilter):
"""
Custom filter "is_owner".
"""
key = "is_owner"
def __init__(self, is_owner):
self.is_owner = is_owner
async def check(self, message: type... | YarikATM/Metall | tg_bot/filters.py | filters.py | py | 819 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "aiogram.dispatcher.filters.BoundFilter",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "aiogram.types.Message",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "aiogram.types",
"line_number": 16,
"usage_type": "name"
},
{
"ap... |
3372040192 | import jieba
from os import path
import os
from wordcloud import WordCloud
def jieba_processing_txt(text, user_dict=[]):
for word in user_dict:
jieba.add_word(word)
mywordlist = []
seg_list = jieba.cut(text, cut_all=False)
liststr = "/ ".join(seg_list)
for myword in liststr... | gewas/VChaCha | wc.py | wc.py | py | 877 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "jieba.add_word",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "jieba.cut",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
74977715387 | import csv
import re
import logging
import gzip
import io
import sys
import os
import yaml
from dipper.sources.ZFIN import ZFIN
from dipper.sources.WormBase import WormBase
from dipper.sources.Source import Source
from dipper.models.assoc.Association import Assoc
from dipper.models.assoc.G2PAssoc import G2PAssoc
from... | monarch-initiative/dipper | dipper/sources/GeneOntology.py | GeneOntology.py | py | 24,532 | python | en | code | 53 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "csv.field_size_limit",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "dipper.source... |
30489056010 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 4 16:13:47 2021
@author: Roman
"""
from spektral.transforms import AdjToSpTensor
from spektral.data import Dataset
from spektral.transforms.normalize_one import NormalizeOne
import numpy as np
import pandas as pd
from scipy.sparse import coo_matrix
from astropy.coordin... | FusRoman/Alert-Association-previous-work | src/graph/motgraphdataset.py | motgraphdataset.py | py | 9,253 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.lib.stride_tricks.as_strided",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.lib",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "platform.system",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "pla... |
38943946635 | import wx
import sys
from datetime import date
import webbrowser
from pbalance_c import pbalance_c as balance_c
from pincome_c import pincome_c as income_c
from pportfolio_c import pportfolio_c as portfolio_c
from padddata_c import padddata_c as adddata_c
from praw_c import praw_c as raw_c
from puseradd_c import puser... | tomluvoe/frugal | src/gui_c.py | gui_c.py | py | 11,466 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "wx.Frame",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "wx.Frame.__init__",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "wx.Frame",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pbalance_c.pbalance_c",... |
7967036430 | """aiohttp-based client to retrieve web pages.
"""
import asyncio
from contextlib import closing
import time
import aiohttp
async def fetch_page(session, host, port=8000, wait=0):
"""Get one page.
"""
url = '{}:{}/{}'.format(host, port, wait)
with aiohttp.Timeout(10):
async with session.get(... | asyncio-docs/asyncio-doc | examples/aiohttp_client.py | aiohttp_client.py | py | 1,359 | python | en | code | 196 | github-code | 6 | [
{
"api_name": "aiohttp.Timeout",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "contextlib.closing",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "asyncio.get_even... |
36849230183 | from google.cloud import bigquery
import pandas as pd
import os
def ReadAlreadyProcessedData():
vAR_client = bigquery.Client()
vAR_table_name = "DMV_ELP_GPT4_RECOMMENDATION"
vAR_sql =(
"select REQUEST_ID,REQUEST_DATE,ORDER_CONFIGURATION,ORDER_PAYMENT_DATE from `"+ os.environ["GCP_PROJECT_ID"]+"."+... | Deepsphere-AI/https-github.com-Deepsphere-AI-DMV_ELP_GPT4_Recommendation | DMV_Bigquery_Utility.py | DMV_Bigquery_Utility.py | py | 454 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "google.cloud.bigquery.Client",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "google.cloud.bigquery",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
}
] |
22550276830 | #!/usr/bin/env python3
import argparse
import logging
import rdflib
import rdflib_util as ru
import re
import sys
# Implementation of "list study group members" query directly in Python using
# rdflib API calls.
# ------------------------------------------------------
# main()
# ------------------------------------... | dcppc/crosscut-metadata | sparql/v0.5/rdflib_list_study_group_members.py | rdflib_list_study_group_members.py | py | 8,716 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "rdflib_... |
43095853918 | from tython.main import run
from colorama import init
init(autoreset=True)
while True:
text = input("> ")
if text.strip() == "":
continue
result, error = run("<stdin>", text)
if error:
print(f"\033[31merror \033[0m" + f"{error}")
elif result:
if len(result.elements) == 1:... | traceover/tython | shell.py | shell.py | py | 411 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "colorama.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "tython.main.run",
"line_number": 11,
"usage_type": "call"
}
] |
10230251745 | import json
import numpy as np
from eval_list import eval_list
import evals.data
from evals.registry import registry
np.random.seed(42)
min_samples_per_dataset = 50
n_test_samples = 10
seen = set()
datarows = []
for eval in registry.get_evals("*"):
if eval.key not in eval_list or eval.key in seen:
conti... | openai/evals | evals/elsuite/self_prompting/scripts/dataset/compile_data.py | compile_data.py | py | 2,868 | python | en | code | 12,495 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "evals.registry.registry.get_evals",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "e... |
31165098736 | from torch.utils.data import Dataset, DataLoader
from albumentations.pytorch import ToTensorV2
from augmix import RandomAugMix
from utils import in_colab
import albumentations as A
import torchvision.io as io
import pytorch_lightning as pl
import torch
import cv2
def get_default_transforms(img_size):
transform = ... | mtenenholtz/petfinder-pawpularity-score | dataset.py | dataset.py | py | 4,274 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "albumentations.Compose",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "albumentations.HorizontalFlip",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "albumentations.ColorJitter",
"line_number": 16,
"usage_type": "call"
},
{
"a... |
14542676756 | import requests as rq
from bs4 import BeautifulSoup
import json
#-------------------------------------------
#Variables a utilizar
#-------------------------------------------
iLetras = 0 # variable para recorrer arreglo letras
aLetras=[
'a','b','c','d','e','f','g','h','i','j',
'k','l','m','n','ñ','o','p','q'... | CamiloFerreira/Traductor-Esp-Mapuzungun | Obtener_palabras.py | Obtener_palabras.py | py | 9,734 | python | es | code | 1 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 320,
"usage_type": "call"
}
] |
22330842884 | import numpy as np
import matplotlib, gc
import matplotlib.pyplot as plt
from tensorflow import gradients
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops, math_ops
def hessian_vector_product(ys, xs, v):
""" Multiply the Hessian of `ys` wrt `xs` by `v` """
# Validate t... | jasjeetIM/AdversarialDetector | models/util.py | util.py | py | 4,254 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tensorflow.gradients",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.ops.math_ops.multiply",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.ops.math_ops",
"line_number": 21,
"usage_type": "name"
}... |
6422355002 | from django.urls import path
from . import views
urlpatterns = [
path('account', views.account, name="account"),
path('profile', views.prifile, name="profile"),
path('signup', views.sign_up, name="signup"),
path('signin', views.sign_in, name="signin"),
path('signout', views.sign_out, name="signout"),
] | aposgial/Project_E3 | happy_traveller/register/urls.py | urls.py | py | 315 | python | en | code | 0 | github-code | 6 | [
{
"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",
... |
4992730292 | import torch
import numpy as np
import math
import torch.nn.functional as F
import re
import nltk, json
from fairseq import pybleu, options, progress_bar, tasks, tokenizer, utils, strategies
from fairseq.meters import TimeMeter
from fairseq.strategies.strategy_utils import duplicate_encoder_out
def getSubstitutePair... | microsoft/SmartWordSuggestions | code/baselines/CMLM/updates/generate_cmlm.py | generate_cmlm.py | py | 12,369 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "re.sub",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 84,
"usage_ty... |
12441870149 | import redis
from redis_lru import RedisLRU
from connect import connect
from models import Quote
client = redis.StrictRedis(host="localhost", port=6379, password=None)
cache = RedisLRU(client)
quotes = Quote.objects()
@cache
def find_by_name(value):
finding_quotes = []
full_name = value.spli... | DanielDDZ/web_modul_8 | MongoDB/main.py | main.py | py | 1,218 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "redis.StrictRedis",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "redis_lru.RedisLRU",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Quote.objects",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Quote"... |
1775721628 | import datetime
EXISTING_TYPES = (
(0, "Пионер"),
(1, "Педсостав"),
)
SIGN_SET = (
('dining_services+', "Дежурный в столовой"),
('activity+', "Активность"),
('salary+', "Зарплата"),
('fee+', "Гонорар"),
('purchase-', "Покупка"),
('fine-', "Штраф"),
)
SIGN_SET_ALL = (
('p2p+', "Лич... | RegSirius06/SWBM | constants/bank/forms.py | forms.py | py | 810 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.date",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 28,
"usage_type": "call"
}
] |
26038625786 | from __future__ import annotations
import logging
import os
from dataclasses import dataclass
from typing import Iterable
from pants.backend.cc.subsystems.compiler import CCSubsystem, ExternalCCSubsystem
from pants.backend.cc.target_types import CCLanguage
from pants.core.util_rules.archive import ExtractedArchive
fr... | pantsbuild/pants | src/python/pants/backend/cc/util_rules/toolchain.py | toolchain.py | py | 7,547 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pants.backend.cc.target_types.CCLanguage",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 31,
"usage_type": "call"
},
{
"... |
81653711 | import json
import os
from corai_util.tools.src.function_json import zip_json, unzip_json
def list_of_dicts_to_txt(parameter_options, column_size=15, file_name="config.txt"):
"""
Writes the parameter options in a formatted file, the header of the file contains the parameter names,
each following ... | Code-Cornelius/CorAI | corai_util/tools/src/function_writer.py | function_writer.py | py | 3,449 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "corai_util.tools.src.function_json.zip_json",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name... |
74025598587 | import arcade
from src.characters.model import Player
class LuffyPlayer(Player):
life = 100
basic_attack = 5
special_attack = 15
speed = 5
def __init__(self, x, y, direction):
super().__init__()
self.x = x
self.y = y
self.direction = direction
self.animatio... | anthonykgross/One-fight | src/characters/luffy/model.py | model.py | py | 4,704 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "src.characters.model.Player",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "arcade.SpriteList",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "arcade.AnimatedTimeSprite",
"line_number": 43,
"usage_type": "call"
},
{
"api_name":... |
30296220599 | # -*- encoding: utf-8 -*-
'''
@File : alien.py
@Time : 2021/10/25 23:48:17
@Author : James
@Version : 1.0
@Desc : 外星人类
'''
import pygame
from pygame.sprite import Sprite
class Alien(Sprite):
'''表示单个外星人'''
def __init__(self, ai_game):
'''初始化外星人并设置其初始位置'''
super().__init__()... | heisenberg000/python_practice | alien_invasion/alien.py | alien.py | py | 830 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "pygame.sprite.Sprite",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pygame.image.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 21,
"usage_type": "attribute"
}
] |
13525657769 | #1bc test code against sklearn - optimizer
# import necessary packages
import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from random import random, seed
import numpy as np
from sk... | gery2/FYS-STK-4155---Project-2 | Codes/1bcMLPReg2.py | 1bcMLPReg2.py | py | 3,760 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"... |
69887984508 | import nltk
import gensim
import cleantext
import re
import xlrd
import sys
from gensim.models import word2vec
from data_treatment import data_treatment
from nltk.corpus import reuters
from nltk.corpus import wordnet as wn
from sklearn.externals import joblib
from nltk.stem import WordNetLemmatizer
class Synonyms_sugge... | caffe-in/TQLwriter | 后端/Synonyms_suggestion.py | Synonyms_suggestion.py | py | 7,026 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gensim.models.KeyedVectors.load_word2vec_format",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "gensim.models",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "nltk.sent_tokenize",
"line_number": 26,
"usage_type": "call"
},
{
... |
70647233789 | """
This is the simplest example of training NER (named entity recognizer).
NER is responsible for recognizing "Apple" as a 'company', "George Bush" as a 'person', and so on.
THE GOAL for training model is to recognize in text 'iPhone' as a 'GADGET' (for example), and so on.
How do we learn the model to recognizing spe... | koualsky/dev-learning | spacy/train_model/full_example.py | full_example.py | py | 4,664 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "spacy.load",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "spacy.blank",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "warnings.catch_warnings",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarning... |
2122328128 | import stripe
from celery import task
from django.conf import settings
from users.models import Buyer
@task
def create_customer(card_token, buyer_id):
stripe.api_key = settings.STRIPE_API_KEY
buyer = Buyer.objects.get(id=buyer_id)
customer = stripe.Customer.create(
email=buyer.email,
... | HackBulgaria/Web-Development-with-Django | week11/stripe_integration/payments/tasks.py | tasks.py | py | 420 | python | en | code | 25 | github-code | 6 | [
{
"api_name": "stripe.api_key",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings.STRIPE_API_KEY",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 12,
"usage_type": "name"
},
{
... |
9437207469 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import glob
file_path_th = '.\data_processing\ex\*through_E*.csv'
file_path_cr = '.\data_processing\ex\*cross_E*.csv'
csv_1 = []
csv_2 = []
x_axis = []
th_sum = []
cr_sum = []
# through
for filename_1 in glob.glob(file_path_th, recursive=True):
... | jordan-kim/r_k_graph_fitting | src/fitting_r_k.py | fitting_r_k.py | py | 2,885 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_numbe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.