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
98726534
from PIL import Image from os import listdir from os.path import isfile, join, splitext m_q_size = (480, 360) h_q_size = (640, 480) xh_q_size = (960, 720) output_sizes = [m_q_size, xh_q_size] quality = 70 _path = "C:/Users/Lukasz/Python/ErroresBuenos/assets/\ photos/resizing/resize_queue/" files = [f for f in listd...
null
lalang/auxil/png_to_webp.py
png_to_webp.py
py
796
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.listdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_n...
300266135
from torch_geometric.datasets import Planetoid import torch import torch.nn.functional as F from torch_geometric.nn import GCNConv from torch_geometric.data import DataLoader class Net(torch.nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = GCNConv(dataset.num_features, 16...
null
src/gcn_first.py
gcn_first.py
py
1,513
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch_geometric.nn.GCNConv", "line_number": 13, "usage_type": "call" }, { "api_name": "torch_geometric.nn.GCNConv", "line_number": 14, "usage_type": "call" }, { "api_name": "t...
14211568
from flask import Flask, jsonify, abort, make_response, request import json import numpy as np import shapefile import pymongo myclient = pymongo.MongoClient("mongodb://localhost:27017/") mydb = myclient["mongo_1"] app = Flask(__name__) @app.route('/dogis/api/v1.0/getusers', methods=['POST']) def upload_info(): ...
null
dogis-api/app.py
app.py
py
2,110
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.MongoClient", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request",...
401122694
import pywt import math import time # 导入所需的第三方库文件 import numpy as np #对应numpy包 from PIL import Image #对应pillow包 from scipy.misc import imsave import cv2 def comprase(image,lie,hang,sampleRate): #sampleRate=0.01 #采样率 Phi=np.random.randn(hang,hang) u, s, vh = np.linalg.svd(Phi) Phi = u[:int(hang*sa...
null
smallbo.py
smallbo.py
py
2,506
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.randn", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.linalg.svd", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.linalg", ...
535148961
import os import cv2 import pickle from PIL import Image import numpy as np image_dir ="C:\\Users\\Omen\\Desktop\\AI\\Project\\images" face_cascade=cv2.CascadeClassifier('C:\\Users\\Omen\\Desktop\\AI\\Project\\haarcascade_frontalface_alt2.xml') recognizer =cv2.face.LBPHFaceRecognizer_create() x_train = [] y_...
null
trainer.py
trainer.py
py
1,356
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.CascadeClassifier", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.face.LBPHFaceRecognizer_create", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.face", "line_number": 9, "usage_type": "attribute" }, { "api_name": "o...
218076694
from typing import Optional, Tuple from numpy import floor import gdsfactory as gf from gdsfactory.component import Component from gdsfactory.components.compass import compass from gdsfactory.components.via import via1, via2, via3 from gdsfactory.tech import LAYER from gdsfactory.types import ComponentOrFactory, Laye...
null
gdsfactory/components/via_stack.py
via_stack.py
py
2,576
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Tuple", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 16, "usage_type": "name" }, { "api_name": "gdsfactory.types.Layer", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Optional", ...
285384305
#coding:utf-8 #使用lstm 老办法 ,placeholder那种 # TARGET_PATH = "../../data/Train&Test/C1S4_newlabel_hybrid_timestep3/"#竖着拼四个 # TRAIN_FILE_NAME="hybrid_train_set.csv" # VALID_FILE_NAME="hybrid_validate_set.csv" TARGET_PATH = "../../data/Train&Test/C4S1_newlabel/"#横着拼4个 TRAIN_FILE_NAME="full_train_set.csv" VALID_FILE_NAME="fu...
null
code_step1/model2/lstm_keras.py
lstm_keras.py
py
9,529
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 39, "usage_type": "call" }, { "api_name": "sklearn.preproces...
545168708
from bigram_model import BigramModel from threading import Thread import multiprocessing as mp from tqdm import trange from queue import Queue from tqdm import tqdm import numpy as np class TopicModel: def __init__(self, y_axis_count, y_axis_length, threshold): self.bigram_model = BigramModel(threshold)...
null
notebooks/topic_model.py
topic_model.py
py
7,280
python
en
code
null
code-starcoder2
66
[ { "api_name": "bigram_model.BigramModel", "line_number": 14, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 28, "usage_type": "call" }, { "api_name": "tqdm.trange", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.array", "lin...
618700495
import pygame import os from .Font import Font from .Mouse import Mouse from .. import settings class CheckBox: click_sound = None @staticmethod def _load_resources(): if CheckBox.click_sound is None: CheckBox.click_sound = pygame.mixer.Sound(os.path.join(settings.music_folder, 'klick...
null
Game/UI/CheckBox.py
CheckBox.py
py
1,828
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.mixer.Sound", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line...
247202483
import cv2 import numpy as np import copy ############ Asking user ###################### print("Choose Tag Video") print("press 0 for Tag0") print("press 1 for Tag1") print("press 2 for Tag2") ent = int(input("Your input: ")) if ent == 0: vid = cv2.VideoCapture('Tag0.mp4') elif ent == 1: vid = cv2....
null
Computer Vision/Detection of Custom AR Tag/part2.py
part2.py
py
9,017
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.VideoCapture", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.imread", "...
398317803
import pygame, sys pygame.init() # COULEURS COULEUR_BLANCHE = pygame.Color(255, 255, 255) COULEUR_NOIRE = pygame.Color(0, 0, 0) COULEUR_ROUGE = pygame.Color(255, 0, 0) COULEUR_VERTE = pygame.Color(0, 255, 0) COULEUR_BLEUE = pygame.Color(0, 0, 255) # FENETRE DE 400 SUR 400 ECRAN = pygame.display.set_mode((400,400)) E...
null
DESSIN.py
DESSIN.py
py
1,494
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 3, "usage_type": "call" }, { "api_name": "pygame.Color", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.Color", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.Color", "line_number": ...
319310299
# pylint: disable=protected-access,no-self-use import time import re from collections import OrderedDict from logging import getLogger from flask import request, g from werkzeug.routing import RequestRedirect, MethodNotAllowed, NotFound from ._version import __version__ WHITESPACE_RE = re.compile(r'\s') _logger = ...
null
cachish/middleware.py
middleware.py
py
3,605
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.g._canonical_start_time", "line_number": 35, "usage_type": "attribute" }, { "api_name": "flask...
133746209
import asyncio import json import os import random import sys import requests import discord from helpers.pekofy import pekofy from helpers.extractstring import extract_string from helpers.replied_reference import replied_reference from helpers.bank_methods import Bank from discord.ext import commands from operator imp...
null
cogs/game.py
game.py
py
5,825
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isfile", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 17, "usage_type": "call" }, { "api_name": "json.load", "line_number": 2...
597366177
#!/usr/bin/env python #=============================================================================== # GetHubOpenPortsAll # # Description: # Script to open processed file (*pyInv.json) of Cisco hardware inventory and # calculate quantities of used/available/total slots/cards/ports for every # element (TID) inc...
null
src/GetHubOpenPortsAll.py
GetHubOpenPortsAll.py
py
10,073
python
en
code
null
code-starcoder2
66
[ { "api_name": "src.GetHubOpenPorts.getOpenSlotsFromJSON", "line_number": 54, "usage_type": "call" }, { "api_name": "src.GetHubOpenPorts", "line_number": 54, "usage_type": "name" }, { "api_name": "src.GetSlotProducts.getSlotProductIDFromJSON", "line_number": 55, "usage_typ...
534716954
# -*- coding: utf-8 -*- """ Created on Sun Sep 15 19:40:35 2019 @author: zephyrus """ import tweepy # input user_id, key, secret, token, token_secret , max tweets num is 50 by default def twitter_text(user_id,key,secret,token,token_secret,max_num=50): auth = tweepy.OAuthHandler(key, secret) auth....
null
tweet_text.py
tweet_text.py
py
933
python
en
code
null
code-starcoder2
66
[ { "api_name": "tweepy.OAuthHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 14, "usage_type": "call" } ]
606473353
# -*- coding: utf-8 -*- import random import telebot TOKEN = '311637383:AAFS1-pZNsec0ZUIZjqyq_n8A2KiHOkR5nU' bot = telebot.TeleBot(TOKEN) @bot.message_handler(commands=['start']) def start(message): bot.send_message(message.chat.id, 'Hey') first_answers = ['Привет-привет, как жизнь?','Какие люди, ...
null
telegbot/bot.py
bot.py
py
1,576
python
en
code
null
code-starcoder2
66
[ { "api_name": "telebot.TeleBot", "line_number": 7, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 19, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 34, "usage_type": "call" } ]
650430548
# coding=utf-8 # created by msgi on 2020/4/10 10:15 上午 import torch from transformers import BertForQuestionAnswering from transformers import BertTokenizer model = BertForQuestionAnswering.from_pretrained('bert-large-uncased-whole-word-masking-finetuned-squad') tokenizer = BertTokenizer.from_pretrained('bert-large-u...
null
tutorials/06.transformers_tutorial/02.question_answer.py
02.question_answer.py
py
2,441
python
en
code
null
code-starcoder2
66
[ { "api_name": "transformers.BertForQuestionAnswering.from_pretrained", "line_number": 8, "usage_type": "call" }, { "api_name": "transformers.BertForQuestionAnswering", "line_number": 8, "usage_type": "name" }, { "api_name": "transformers.BertTokenizer.from_pretrained", "line_...
629103900
import itchat import json import requests from itchat.content import * tuling = True def tuling_msg(msg): data = { "reqType":0, "perception": { "inputText": { "text": msg } }, "userInfo": { "apiKey": "5ba9610c7db546b4b63fe8ab500...
null
source_code/wechat_auto_reply/wechat_control.py
wechat_control.py
py
1,885
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 24, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 24, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 34, "usage_type": "call" }, { "api_name": "itchat.msg_register", "line...
173467421
import sklearn import numpy as np import pandas as pd from sklearn.utils import shuffle from sklearn import linear_model, preprocessing from sklearn.neighbors import KNeighborsClassifier data = pd.read_csv('car.data') print(data.head()) # we got too many string values and we are dealing with numbers so we have to con...
null
2_KNN_(K_Nearest_Neighbour)/KNN.py
KNN.py
py
1,279
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 12, "usage_type": "name" }, { "api_name"...
635498324
import numpy as np import pandas as pd import math import matplotlib.pyplot as plt from sklearn import model_selection from sklearn import svm from sklearn import neighbors from sklearn import ensemble from sklearn import neural_network from sklearn import linear_model import sys def main(): pgs2015, pgs2016, pgs20...
null
predictFromGameStats.py
predictFromGameStats.py
py
4,920
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 75, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 76, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 77, "usage_type": "call" }, { "api_name": "numpy.concatenate", ...
377902940
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('aristotle_dse', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='dssdeinclusion', ...
null
aristotle_dse/migrations/0002_auto_20150510_0249.py
0002_auto_20150510_0249.py
py
677
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.RemoveField", "line_number": 14, "usage_type": "call" }, ...
534827377
from pandas import DataFrame from pandas import concat from sklearn.metrics import mean_squared_error from math import sqrt from numpy import concatenate import numpy as np import tensorflow as tf import datetime as dt from utility import timeseries_to_3d, size_train_to_batch_size from utility import scale from utility...
null
LSTM/g04_full_model/g042_training_fit_assessment/experiment.py
experiment.py
py
12,124
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 22, "usage_type": "attribute" }, { "api_name": "tensorflow.__version__", "line_number": 23, "usage_type": "attribute" }, { "api_name...
498791803
""" 合并 k 个排序链表,返回合并后的排序链表。请分析和描述算法的复杂度。 示例: 输入: [   1->4->5,   1->3->4,   2->6 ] 输出: 1->1->2->3->4->4->5->6 """ from typing import List # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def mergeKLists(self, lists: Li...
null
merge_k_sorted_lists.py
merge_k_sorted_lists.py
py
1,843
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 26, "usage_type": "name" } ]
288402308
""" Flask web app connects to Mongo database. Keep a simple list of dated memoranda. Representation conventions for dates: - We use Arrow objects when we want to manipulate dates, but for all storage in database, in session or g objects, or anything else that needs a text representation, we use ISO date ...
null
flask_main.py
flask_main.py
py
4,692
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 48, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 51, "usage_type": "call" }, { "api_name": "CONFIG.MONGO_URL", "line_number": 51, "usage_type": "attribute" }, { "api_name": "uuid.uuid4", ...
477978090
#TODO: Pozostałe metody obliczania odległości #TODO: Poprawić wczytywanie dla arythmii #TODO: Żeby działało na obiektach a nie tablicach #TODO: Usprawnienie wyświetlania #TODO: Zliczenie poprawnie sklasyfikowanych obiektów ( potrzeba obiektów lub przypisania współrzędnych do klasy ) #TODO: testy i raport import csv i...
null
LBG/LBG.py
LBG.py
py
7,322
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 137, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 137, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 176, "usage_type": "attribute" }...
231903027
#! /usr/bin/env python import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import pandas as pd import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # 1) Load the data def load_space_csv_data(file_name): # Panda function defined for easy data reading df = pd.read_csv(file_name, delim_whitesp...
null
PM_week_1.py
PM_week_1.py
py
2,354
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.asarray", "lin...
578814993
import matplotlib.pyplot as plt import numpy as np def rk4(r, t, h): """ Runge-Kutta 4 method """ k1 = h * func(r, t) k2 = h * func(r + 0.5 * k1, t + 0.5 * h) k3 = h * func(r + 0.5 * k2, t + 0.5 * h) k4 = h * func(r + k3, t + h) return (k1 + 2 * k2 + 2 * k3 + k4) / 6 def func(r, t): x, y...
null
test.py
test.py
py
926
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "li...
547971126
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Manually encrypt a fragmented wep message given the WEP key""" __author__ = "Remi Poulard, Caroline Monthoux" __copyright__ = "Copyright 2019, HEIG-VD" __license__ = "GPL" __version__ = "1.0" __email__ = "remi.poulard@heig-vd.ch, caroline.monthoux@heig-vd.ch" __status...
null
files/manual-encryption-fragment.py
manual-encryption-fragment.py
py
1,831
python
en
code
null
code-starcoder2
66
[ { "api_name": "Crypto.Random.get_random_bytes", "line_number": 22, "usage_type": "call" }, { "api_name": "zlib.crc32", "line_number": 37, "usage_type": "call" }, { "api_name": "rc4.RC4", "line_number": 43, "usage_type": "call" }, { "api_name": "scapy.layers.dot11....
24274696
# Louis Wang. For OPD medical record. # Ver 1.01,add moore general NE from tkinter import * from tkinter.ttk import * from PIL import Image, ImageTk main = Tk() main.geometry('900x700') main.title('理學檢查') tabControl = Notebook(main) tab1 = Frame(tabControl) tab2 = Frame(tabControl) tabControl.add(tab1, t...
null
medical_record.py
medical_record.py
py
8,933
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.Image.open", "line_number": 193, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 193, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 194, "usage_type": "call" }, { "api_name": "PIL.ImageTk", ...
352372007
# djangotemplates/example/urls.py from django.urls import path from . import views urlpatterns=[ path('', views.index, name='index'), path('single/', views.single, name='single'), path('contact/', views.contact, name='contact'), path('test/', views.test, name='test' ) ]
null
news/urls.py
urls.py
py
290
python
en
code
null
code-starcoder2
66
[ { "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", ...
499853246
""" Routes and views for the flask application. """ # https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior # Use the above link if you would like to change the formatting of date or time from datetime import datetime from flask import render_template, g, request from Prototype import app import sq...
null
Prototype/Prototype/Prototype/views.py
views.py
py
5,297
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.g", "line_number": 36, "usage_type": "argument" }, { "api_name": "flask.g._database", "line_number": 38, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 38, "usage_type": "name" }, { "api_name": "sqlite3.connect", "lin...
294284835
# coding=utf-8 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------------------------...
null
azext_iot/_factory.py
_factory.py
py
5,494
python
en
code
null
code-starcoder2
66
[ { "api_name": "azure.cli.core.commands.client_factory.get_mgmt_service_client", "line_number": 45, "usage_type": "call" }, { "api_name": "azure.mgmt.iothub.iot_hub_client.IotHubClient", "line_number": 45, "usage_type": "argument" }, { "api_name": "azure.cli.core.commands.client_f...
83805035
''' name: skincluster.py Author: Ehsan Hassani Moghaddam History: 04/24/16 (ehassani) first release! ''' import maya.cmds as cmds from ...third_party import bSkinSaver reload(bSkinSaver) from ...lib import string reload(string) from ...lib import transform reload(transform) class Skincluster(object): ...
null
dev/maya/python/rig/template/skincluster.py
skincluster.py
py
2,116
python
en
code
null
code-starcoder2
66
[ { "api_name": "third_party.bSkinSaver", "line_number": 15, "usage_type": "argument" }, { "api_name": "lib.string", "line_number": 18, "usage_type": "argument" }, { "api_name": "lib.transform", "line_number": 21, "usage_type": "argument" }, { "api_name": "lib.trans...
509423052
import argparse,sys,os,re import json import logging import random import time import yaml import pandas as pd sys.path.append('..') from utils import * #from DialogueConfig import DialogueConfig sys.path.append('/Users/jdlopes/multisensoryprocessing/src/python') from farmi import FarmiUnit, farmi from FlowState imp...
null
src/python/dialogue_flow/flow.py
flow.py
py
27,031
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
209231089
import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "0,1,2,3,4,5" import csv import numpy as np import random import pandas as pd from datasets import load_dataset, load_metric, Dataset from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_s...
null
ocr_correction/trainer_t5.py
trainer_t5.py
py
4,231
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "transformers.utils.check_min_version", "line_number": 22, "usage_type": "call" }, { "api_name": "tr...
137882485
from elasticsearch import Elasticsearch import json import numpy as np import re import time from multiprocessing.dummy import Pool as ThreadPool import io import math # 1. Goal: Represent the raw content of the query/table as a set of terms, where terms are entities from a knowledge base. {q1, ...., 1n} for query q a...
null
main.py
main.py
py
7,221
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "re.search", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 29, "usage_type": "call" }, { "api_name": "re.search", "line_number": 39,...
46180890
from django.shortcuts import render,redirect from django.http import HttpResponse from .forms import ImageForm import pyrebase import shutil import os from .models import Image firebaseConfig = { 'apiKey': "AIzaSyBHn-PVdt-neRToPoZIEVcsR-eMc0565NU", 'authDomain': "web-face-recognition.firebaseapp.com", 'dat...
null
add_image/views.py
views.py
py
2,430
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyrebase.initialize_app", "line_number": 19, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 24, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 43, "usage_type": "call" }, { "api_name": "forms.Image...
154748866
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import django import argparse import json # python path sys.path.append('/usr/lib/python2.7/dist-packages/') sys.path.append('/usr/lib/python2.7/') sys.path.append('/usr/local/lib/python2.7/dist-packages/') sys.path.append('/data2/django_1....
null
djequis/schoology/get_grading_scale.py
get_grading_scale.py
py
2,379
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
525134415
#!encoding utf-8 from csv import DictWriter from django.core.management.base import BaseCommand import requests import json class Command(BaseCommand): def handle(self, *args, **options): print('Start.') res = self.request_holidays_for_date('now', 'x') holidays = res.copy() holid...
null
kikar_hamedina/reporting/management/commands/get_shabbat_dates.py
get_shabbat_dates.py
py
1,666
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "json.dump", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 45, "usage_type": "call" } ]
50983295
from tqdm import tqdm import numpy as np import tensorflow as tf from . import util # note: coordinates are assumed to be such that "y" increases "downwards", # and "x" increases "rightwards". # arrays will generally be indexed as array[y][x]. # directions are as indexed in arrays, # defined as pseudo-constants here...
null
disparity/crf.py
crf.py
py
14,337
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.exp", "line_number": 23, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 58, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 68, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 70,...
540289844
import datetime import json import logging import os import threading import time try: from urllib.parse import urlencode except ImportError: from urllib import urlencode # N.B. the cryptography library is required when calling jwt.encrypt() with # algorithm='RS256'. It does not need to be imported here, but t...
null
gcloud/rest/auth/token.py
token.py
py
2,985
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 31, "usage_type": "call" }, { "api_name": "threading.RLock", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
560381047
import logging from discord.ext import commands from core.models import PermissionLevel logger = logging.getLogger("Modmail") def has_permissions_predicate( permission_level: PermissionLevel = PermissionLevel.REGULAR ): async def predicate(ctx): return await check_permissions(ctx, ctx.command.quali...
null
core/checks.py
checks.py
py
3,017
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "core.models.PermissionLevel", "line_number": 11, "usage_type": "name" }, { "api_name": "core.models.PermissionLevel.REGULAR", "line_number": 11, "usage_type": "attribute" }, { ...
340286749
from cratis.settings import CratisApplication from cratis_angular.remote import RpcView, remote from cratis_profile.models import UserProfile from cratis_webshop.attrs.models import FilterSet from cratis_webshop.cart.models import ShoppingCart, ShoppingCartItem from cratis_webshop.features import WebShop, WebshopCart f...
null
cratis_webshop/views.py
views.py
py
7,464
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.paginator.Paginator", "line_number": 16, "usage_type": "call" }, { "api_name": "django.core.paginator.PageNotAnInteger", "line_number": 20, "usage_type": "name" }, { "api_name": "django.core.paginator.EmptyPage", "line_number": 23, "usage_type":...
422749302
# coding:utf-8 import xmltodict import time import json from lxml import etree # 将指定tag的对象提取,写入json文件。 def process_element(elem): elem_data = etree.tostring(elem) elem_dict = xmltodict.parse(elem_data, attr_prefix="", cdata_key="") # print(elem_dict) if (elem.tag == "node"): elem_jsonStr = j...
null
open_street_map/exchange_json.py
exchange_json.py
py
2,097
python
en
code
null
code-starcoder2
66
[ { "api_name": "lxml.etree.tostring", "line_number": 11, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 11, "usage_type": "name" }, { "api_name": "xmltodict.parse", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dumps", "line...
218911372
from PIL import Image import os def flip_image(image_path, saved_location): """ Flip or mirror the image @param image_path: The path to the image to edit @param saved_location: Path to save the cropped image """ image_obj = Image.open(image_path) rotated_image = image_obj.transpose(Image....
null
flip_images.py
flip_images.py
py
1,362
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.Image.open", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 12, "usage_type": "name" }, { "api_name": "PIL.Image.FLIP_LEFT_RIGHT", "line_number": 13, "usage_type": "attribute" }, { "api_name": "PIL.Image", ...
128280338
# -*- coding: UTF-8 -*- from django.conf.urls import url from areatest import views urlpatterns =[ url(r'^area/$', views.area), url(r'^pro/$', views.pro), url(r'^city/(\d+)/$', views.city), url(r'^dis/(\d+)/$', views.dis), url(r'^editor/$', views.editor), url(r'^editorhandle/$', views.editorha...
null
areatest/urls.py
urls.py
py
414
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "areatest.views.area", "line_number": 7, "usage_type": "attribute" }, { "api_name": "areatest.views", "line_number": 7, "usage_type": "name" }, { "api_name": "django.conf...
384516554
#在类里面有一个__iter__方法和__next__这个方法创建的对象就是迭代器 #作用:根据数据的位置获取下一个位置的值 #用迭代器的好处是及其节省内存 from collections import Iterable # my_list = [1,2,3] class MyIterable(object): def __init__(self): self.mylist = [4,5,9] self.current_index = 0 def __iter__(self): #返回的是可迭代对象 return self def __next__(self): if self.current_inde...
null
Python exercises/第十天/day10/08-迭代器.py
08-迭代器.py
py
1,079
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.Iterable", "line_number": 26, "usage_type": "argument" } ]
206534264
import torch import torch.nn.functional as F from sklearn.model_selection import train_test_split from torch.utils.data import Subset def train_val_dataset(dataset, val_split=0.5): train_idx, val_idx = train_test_split(list(range(len(dataset))), test_size=val_split) datasets = {} datasets['train'] = Subse...
null
utils.py
utils.py
py
2,068
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.model_selection.train_test_split", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.utils.data.Subset", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.utils.data.Subset", "line_number": 11, "usage_type": "call" }, ...
243376436
from django.urls import path from . import views app_name = 'blog' urlpatterns = [ path('', views.index), path('home/', views.index), path('login/', views.login), path('register/', views.register), path('new_post/', views.new_post), path('<int:pk>/', views.single), # path('<int:pk>/', views...
null
blog/urls.py
urls.py
py
360
python
en
code
null
code-starcoder2
66
[ { "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", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
82219058
from __future__ import unicode_literals from django.db import models from django.shortcuts import render from wagtail.wagtailcore.models import Page from wagtail.wagtailadmin.edit_handlers import FieldPanel from saleor.product.models import Product class HomePage(Page): def serve(self, request, *args, **kwarg...
null
home/models.py
models.py
py
864
python
en
code
null
code-starcoder2
66
[ { "api_name": "wagtail.wagtailcore.models.Page", "line_number": 12, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "wagtail.wagtailcore.models.Page", "line_number": 20, "usage_type": "name" }, ...
320047766
# Program Name: HREF Calibrated Thunder # Affiliation: NOAA/NWS/Storm Prediction Center # Contacts: matthew.elliott@noaa.gov (703-887-2332 cell) # Abstract: Driver script for HREF Calibrated Thunder part of SPC POST # History Log: # # Usage: # Parameters: # run_date --> e.g., $PDY # run --> e.g., cyc # ...
null
ush/href_calib_thunder/forecast_href_cal_thunder.py
forecast_href_cal_thunder.py
py
3,798
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 32, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.environ", "line_...
350862890
import sys import requests import json import datetime def main(dict): response = requests.get('https://api.us.apiconnect.ibmcloud.com/tmedemousibmcom-dev/sb/api/UsageConsumptionReports?filter={"where":{"bucket.product.id":"mobile999"}}') res = response.json() buckets = res[0]['bucket'] data = [] f...
null
IBMFunctions/getUsageReport.py
getUsageReport.py
py
683
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 17, "usage_type": "call" } ]
59212559
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Apr 24 01:58:09 2019 @author: yiwenzhang """ import tensorflow as tf import numpy as np from utils_1 import Indexing, getIndex, loadnew import sys from keras.models import Model from keras.layers import Dense, Input, Embedding, Reshape, Concatenate, La...
null
NLP homework/Programming Homework/yz3310_HW4_codes/src/train_3.py
train_3.py
py
2,548
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils_1.getIndex", "line_number": 17, "usage_type": "call" }, { "api_name": "utils_1.getIndex", "line_number": 18, "usage_type": "call" }, { "api_name": "utils_1.getIndex", "line_number": 19, "usage_type": "call" }, { "api_name": "utils_1.getIndex",...
18743271
# uncompyle6 version 3.7.4 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /usr/local/lib/python3.6/dist-packages/pyproffit/power_spectrum.py # Compiled at: 2019-11-19 08:35:18 # Size of source mod 2**32: 19715 bytes import numpy as np f...
null
pycfiles/pyproffit-0.4.1.linux-x86_64.tar/power_spectrum.cpython-36.py
power_spectrum.cpython-36.py
py
16,525
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.pi", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.power", "line_number": 18, "usage_type": "call" }, { "api_name": "scipy.special.gamma", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.zeros", "line...
88716961
from gi.repository import Gtk from os import path import ui import models import json class Application(object): def __init__(self): self.settings = Settings() self.window = ui.MainWindow(self) self.add_connection_list() self.add_query_page() self.window.set_position(Gtk.Win...
null
controls.py
controls.py
py
2,174
python
en
code
null
code-starcoder2
66
[ { "api_name": "ui.MainWindow", "line_number": 10, "usage_type": "call" }, { "api_name": "gi.repository.Gtk.WindowPosition", "line_number": 13, "usage_type": "attribute" }, { "api_name": "gi.repository.Gtk", "line_number": 13, "usage_type": "name" }, { "api_name": ...
431201150
import os import traceback import logging import threading import time import json import requests from flask import Blueprint,request,Response,send_file,render_template,redirect,jsonify from framework.logger import get_logger from framework import app,db,scheduler,socketio,check_api,path_app_root,path_data from framew...
null
lib/system/plugin.py
plugin.py
py
13,655
python
en
code
null
code-starcoder2
66
[ { "api_name": "framework.logger.get_logger", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.Blueprint", "line_number": 27, "usage_type": "call" }, { "api_name": "logic.SystemLogic.plugin_load", "line_number": 31, "usage_type": "call" }, { "api_nam...
54392429
#!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages from igel import __version__, __email__, __author__ with open('docs/README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ ...
null
setup.py
setup.py
py
2,669
python
en
code
null
code-starcoder2
66
[ { "api_name": "setuptools.setup", "line_number": 23, "usage_type": "call" }, { "api_name": "igel.__author__", "line_number": 24, "usage_type": "name" }, { "api_name": "igel.__email__", "line_number": 25, "usage_type": "name" }, { "api_name": "igel.__email__", ...
106137633
#工具文件,遍历所有数据找出所有段的持续时间和开始节点,找出最小的段和最小的帧长 import librosa import librosa.core import librosa.display import matplotlib.pyplot as plt import os import numpy as np import json import math from sklearn.preprocessing import StandardScaler fps = 25 hop_length = 512 resample_rate = hop_length * fps data_dir = './data/M2D_se...
null
hmmr/utils.py
utils.py
py
4,802
python
en
code
null
code-starcoder2
66
[ { "api_name": "librosa.core.load", "line_number": 34, "usage_type": "call" }, { "api_name": "librosa.core", "line_number": 34, "usage_type": "attribute" }, { "api_name": "librosa.beat.beat_track", "line_number": 37, "usage_type": "call" }, { "api_name": "librosa.b...
220219088
"""Server for forever app.""" from flask import (Flask, render_template, request, flash, session, redirect, jsonify) import random import crud from jinja2 import StrictUndefined import model from datetime import datetime, date app = Flask(__name__) app.secret_key = "dev" app.jinja_env.undefined = ...
null
server.py
server.py
py
9,557
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "jinja2.StrictUndefined", "line_number": 14, "usage_type": "name" }, { "api_name": "flask.render_template", "line_number": 35, "usage_type": "call" }, { "api_name": "flask.render...
564446851
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import urllib import django.dispatch from dj.choices import Country from django.core.urlresolvers import reverse from django.test.utils import o...
null
src/ralph_assets/tests/functional/tests_transitions.py
tests_transitions.py
py
5,211
python
en
code
null
code-starcoder2
66
[ { "api_name": "ralph_assets.tests.utils.MessagesTestMixin", "line_number": 37, "usage_type": "name" }, { "api_name": "ralph.ui.tests.global_utils.login_as_su", "line_number": 40, "usage_type": "call" }, { "api_name": "ralph_assets.tests.utils.transitions.TransitionFactory", "...
435865534
import cv2 import sys import time from os import walk def _abrir_archivo(dir): imagen = cv2.imread(dir) if imagen == None: print('No se puede abrir imagen') sys.exit(1) return imagen def prueba(): imagen = cv2.imread("images/1.jpg") cv2.imshow("ventana", imagen) cv2.waitKey(0)...
null
PYT_DOC/reco_patron/algoritmo.py
algoritmo.py
py
342
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 16, ...
617883472
from django.conf.urls.defaults import patterns, url from django.contrib.auth.decorators import login_required from restful import administrator_restful from views import (MainView, RestfulSimplifiedView, RestfulSimplifiedViewWithGradeEditors, AdminCompressedFileDownloadView) urlp...
null
devilry/apps/administrator/urls.py
urls.py
py
1,589
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.defaults.patterns", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.defaults.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 11, "usage...
614958187
import argparse import numpy as np ap = argparse.ArgumentParser() ap.add_argument("--instance", required=True, help="Path to instance file") ap.add_argument("--algorithm", required=True,type=str, help="Algo to use") ap.add_argument("--randomSeed", required=False,type=int, help="seed...
null
cs747-pa1/submission/bandit.py
bandit.py
py
6,012
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 33, "usage_type": "attribute" }, { "api_name": "numpy.rand...
256416730
import os import PIL import torch import torch.utils.data as data import torchvision.transforms as transforms def default_loader(path): return PIL.Image.open(path).convert('RGB') class CarDataset(data.Dataset): def __init__(self, lists, label_dict, transform=None, loader=default_loader): ...
null
data_generator.py
data_generator.py
py
2,230
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.Image.open", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.utils.data.Dataset", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.utils...
561370192
from functools import partial from django import forms from django.conf import settings from django.contrib import admin from django.contrib.admin.widgets import FilteredSelectMultiple from django.db.models import TextField from django.contrib.gis.db.models import ManyToManyField from django.contrib.admin.utils import...
null
democracy/admin/__init__.py
__init__.py
py
11,020
python
en
code
null
code-starcoder2
66
[ { "api_name": "parler.forms.TranslatableModelForm", "line_number": 28, "usage_type": "name" }, { "api_name": "django.utils.encoding.force_text", "line_number": 42, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 42, "usage_ty...
586798271
import os from typing import Any, Optional import gspread import pandas as pd from oauth2client.service_account import ServiceAccountCredentials import socket from datetime import datetime from time import sleep import traceback _current_experiment = None # type: Optional[ExperimentParams] def _check_experiment():...
null
spreaduler.py
spreaduler.py
py
8,825
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Any", "line_number": 55, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 88, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 88, "usage_type": "attribute" }, { "api_name": "socket.gethostname", "l...
264772371
""" MIT License Copyright (c) 2021 TheHamkerCat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, ...
null
wbb/modules/spam.py
spam.py
py
5,830
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyrogram.types.Message", "line_number": 59, "usage_type": "name" }, { "api_name": "wbb.SUDOERS", "line_number": 67, "usage_type": "name" }, { "api_name": "wbb.modules.trust.get_spam_data", "line_number": 69, "usage_type": "call" }, { "api_name": "wb...
228451515
""" Return image sizes """ import argparse from tqdm import tqdm import numpy as np import pandas as pd import SimpleITK as sitk def print_images_with_sizes(file_list): file_size_df = pd.DataFrame(columns=['image', 'image_size', 'array_size']) reader = sitk.ImageFileReader() with tqdm(total=len(file_list...
null
get_sizes.py
get_sizes.py
py
1,573
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame", "line_number": 10, "usage_type": "call" }, { "api_name": "SimpleITK.ImageFileReader", "line_number": 11, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 13, "usage_type": "call" }, { "api_name": "SimpleITK.ReadIm...
367250731
from neo4j import GraphDatabase import pandas as pd import seaborn as sns from sklearn.cluster import KMeans from sklearn.metrics import calinski_harabasz_score, silhouette_score, davies_bouldin_score import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler driver = GraphDatabase.driver("bolt://l...
null
code/embed_ML_twitter.py
embed_ML_twitter.py
py
2,778
python
en
code
null
code-starcoder2
66
[ { "api_name": "neo4j.GraphDatabase.driver", "line_number": 9, "usage_type": "call" }, { "api_name": "neo4j.GraphDatabase", "line_number": 9, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 31, "usage_type": "call" }, { "api_name": "sklearn...
579036530
""" Copyright (c) 2017 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import os import pytest from flexmock import flexmock import yaml from atomic_reactor.inner import DockerBuildWorkflow from atomic_reactor....
null
tests/plugins/test_add_flatpak_labels.py
test_add_flatpak_labels.py
py
3,221
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_number": 38, "usage_type": "attribute" }, { "api_name": "osbs.utils.ImageName", "line_number": 44, "usage_type": "call" }, { "api_name": "atomic_reactor.inner.D...
15083340
# from kivy.app import App from kivy.uix.button import Button class FirstKivy(App): def build(self): return Button(text="Welcome to LikeGeeks!",background_color=(0,2,21,1)) #FirstKivy().run from kivy.uix.button import Button from kivy.app import App from functools import partial...
null
GUI/newfile.py
newfile.py
py
3,122
python
en
code
null
code-starcoder2
66
[ { "api_name": "kivy.app.App", "line_number": 7, "usage_type": "name" }, { "api_name": "kivy.uix.button.Button", "line_number": 11, "usage_type": "call" }, { "api_name": "kivy.app.App", "line_number": 21, "usage_type": "name" }, { "api_name": "kivy.uix.button.Butto...
344828688
from config import ServerParameters,logging,datafilepath import asyncio from dateutil import parser import datetime #from motor.motor_tornado import MotorClient,MotorGridFSBucket,MotorGridOut,MotorGridOutCursor from motor.motor_asyncio import AsyncIOMotorClient from asyncio.coroutines import coroutine from pymongo.erro...
null
tiger_python_tools/test1.py
test1.py
py
1,690
python
en
code
null
code-starcoder2
66
[ { "api_name": "motor.motor_asyncio.AsyncIOMotorClient", "line_number": 14, "usage_type": "call" }, { "api_name": "config.ServerParameters.mongodbpath", "line_number": 14, "usage_type": "attribute" }, { "api_name": "config.ServerParameters", "line_number": 14, "usage_type"...
295533603
# -*- coding: utf-8 -*- """ Created on Tue Sep 12 20:08:23 2017 @author: danjr """ import fluids2d.piv as piv import fluids2d.spectra as spectra import matplotlib.pyplot as plt import matplotlib.patches import matplotlib.gridspec as gridspec import pickle import numpy as np import pandas as pd import scipy.ndimage im...
null
scripts/OLD/umd_poster_piv.py
umd_poster_piv.py
py
10,109
python
en
code
null
code-starcoder2
66
[ { "api_name": "fluids2d.piv.load_processed_PIV_data", "line_number": 30, "usage_type": "call" }, { "api_name": "fluids2d.piv", "line_number": 30, "usage_type": "name" }, { "api_name": "comps.cf", "line_number": 30, "usage_type": "call" }, { "api_name": "comps.cf",...
251623718
from __future__ import absolute_import, unicode_literals from celery import Celery, shared_task from PIL import Image app = Celery(broker='redis://localhost:6379/0', backend='redis://localhost:6379/1') @app.task() def resize_image(file_image, height_im, width_im): original_image = Image.open(file_image) new_...
null
images/tasks.py
tasks.py
py
496
python
en
code
null
code-starcoder2
66
[ { "api_name": "celery.Celery", "line_number": 6, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 10, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 10, "usage_type": "name" }, { "api_name": "PIL.Image.ANTIALIAS", "line...
535072855
# -*- coding: utf-8 -*- __author__ = 'ildar' from app import app from flask import render_template, redirect, session, url_for, request, g, jsonify from flask.ext.login import login_user, logout_user, current_user, login_required from app import db, models, lm from models import Users, ROLE_ADMIN, ROLE_USER, Posts, Fo...
null
app/views.py
views.py
py
37,195
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.g.user", "line_number": 26, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 26, "usage_type": "name" }, { "api_name": "flask.ext.login.current_user", "line_number": 26, "usage_type": "name" }, { "api_name": "app.app.before...
451771392
"""Lock file utilities.""" import os import sys import fcntl import logging class AlreadyLockedError(IOError): """Lockfile already locked error.""" def __init__(self, *args, **kwargs): """Initialise.""" super(AlreadyLockedError, self).__init__(*args, **kwargs) class PIDLockFile(object): ...
null
src/pdm/utils/lockfile.py
lockfile.py
py
2,762
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 36, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 57, "usage_type": "call" }, { "api_name": "os.fsync", "line_number": 59, "usage_type": "call" }, { "api_name": "fcntl.flock", "line_number":...
214136547
import numpy as np from scipy.misc import imread from scipy.misc import toimage # returns approximate 1-D gaussian kernel of the size kernel_size def buildkernel(kernel_size): mid = kernel_size // 2 + 1 # gives floor integer value # initializing the 1D gaussain kernel with dummy values gauslist = range(ke...
null
HW1/Solution/Sadhwani_Yash_a1/Answer1.py
Answer1.py
py
2,358
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.convolve", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.array", "line_number...
529482587
import pickle import numpy as np from flask import Flask, request, jsonify, render_template app = Flask(__name__) model = pickle.load(open('pickle_model.pkl', 'rb')) @app.route('/') def home(): return render_template('index.html') @app.route('/predict', methods = ['POST']) def predict(): double_features = [...
null
app.py
app.py
py
688
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.form.values...
199310096
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError from core.models import Company, CompanyShare class Command(BaseCommand): help = 'Gives a company shares in a company' def add_arguments(self, parser): parser.add_argument('owner') parser.add_argument('c...
null
accountant/core/management/commands/createcompanyshare.py
createcompanyshare.py
py
989
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 6, "usage_type": "name" }, { "api_name": "core.models.Company.objects.get", "line_number": 16, "usage_type": "call" }, { "api_name": "core.models.Company.objects", "line_number": 16, "usage_type": "at...
177533235
from flask import Flask, make_response, render_template, redirect, request, send_from_directory from gevent.pywsgi import WSGIServer from .Database import Database from .Builder import Builder class Server(object): srv = None def __init__(self, database: Database, builder: Builder, login=False): sel...
null
carpi_server/libs/Server.py
Server.py
py
3,549
python
en
code
null
code-starcoder2
66
[ { "api_name": "Database.Database", "line_number": 11, "usage_type": "name" }, { "api_name": "Builder.Builder", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.make_response", ...
397635441
from sio import sio from app.models.user import User from app.models.contact import Contact from flask_socketio import join_room from sqlalchemy import or_ from flask import session def find_contacts_for(user): return Contact.query.filter( or_(Contact.initiator_id == user.id, Contact.acceptor_id == user.i...
null
src/app/event_handlers/self_introduction.py
self_introduction.py
py
748
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.models.contact.Contact.query.filter", "line_number": 10, "usage_type": "call" }, { "api_name": "app.models.contact.Contact.query", "line_number": 10, "usage_type": "attribute" }, { "api_name": "app.models.contact.Contact", "line_number": 10, "usage_type...
326559672
import numpy as np import pandas as pd import sys sys.path.append("..") from helpers import * from utils.globals import * def get_distribution_quantiles(arr, quantiles, **kwargs): return np.quantile(arr, q=quantiles, axis=1, **kwargs).T def get_distribution_characteristics(arr, truncate_dist=False): """ ...
null
utils/distribution_statistics.py
distribution_statistics.py
py
5,515
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.quantile", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.clip", "line_num...
648224432
from flask_restful import Resource, reqparse from ..schemas import PostSchema from ..models import Post from datetime import datetime class UserPostResource(Resource): def get(self, username): posts = Post.scan(username__eq=username) return PostSchema().dump(posts, many=True).data, 200 class Pos...
null
backend/src/resources/post_resource.py
post_resource.py
py
1,280
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask_restful.Resource", "line_number": 8, "usage_type": "name" }, { "api_name": "models.Post.scan", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Post", "line_number": 10, "usage_type": "name" }, { "api_name": "schemas.PostSchema...
104028564
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from flask import Flask, request, jsonify from flask_sqlalchemy import SQLAlchemy from sqlalchemy import create_engine from sqlalchemy_utils import database_exists, create_database from loguru import logger from config import ConfigClass from sqlalchemy.dialects....
null
backend/src/app.py
app.py
py
9,016
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.create_engine", "line_number": 24, "usage_type": "call" }, { "api_name": "sqlalchemy_utils.database_exists", "line_number": 28, "usage_type": "call" }, { "api_name": "loguru.logger.info", "line_number": 29, "usage_type": "call" }, { "api_...
229926564
import base64 from django.db import models try: from django.utils.encoding import force_bytes except: pass class Base64Field(models.TextField): def contribute_to_class(self, cls, name): if self.db_column is None: self.db_column = name self.field_name = name + '_base64' ...
null
mcfeely/fields.py
fields.py
py
1,169
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.TextField", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "base64.b64decode", "line_number": 20, "usage_type": "call" }, { "api_name": "djang...
218081523
#!/usr/bin/env python """The Discovery service supports finding resources and events by metadata attributes, potentially applying semantic reasoning""" __author__ = 'Luke Campbell <LCampbell@ASAScience.com>, Michael Meisinger' from collections import deque import heapq from pyon.util.containers import DotDict, get_...
null
ion/services/dm/presentation/discovery_service.py
discovery_service.py
py
13,392
python
en
code
null
code-starcoder2
66
[ { "api_name": "interface.services.dm.idiscovery_service.BaseDiscoveryService", "line_number": 21, "usage_type": "name" }, { "api_name": "pyon.public.CFG.get_safe", "line_number": 22, "usage_type": "call" }, { "api_name": "pyon.public.CFG", "line_number": 22, "usage_type":...
62512550
import logging import glob import numpy as np import tensorflow as tf from PIL import Image from sklearn.model_selection import StratifiedShuffleSplit, train_test_split from sklearn.metrics import accuracy_score import math from models.cnn_2conv import create_cnn_2conv_model from models.cnn_2conv_fc2 import create_cnn_...
null
dogs_vs_cats_training.py
dogs_vs_cats_training.py
py
12,643
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "logging.DEBUG",...
330525214
""" Problem Description Given a matrix of integers A of size N x M describing a maze. The maze consists of empty locations and walls. 1 represents a wall in a matrix and 0 represents an empty location in a wall. There is a ball trapped in a maze. The ball can go through empty spaces by rolling up, down, left or right...
null
graph/day_5/shortest_distance_in_maze.py
shortest_distance_in_maze.py
py
3,156
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 27, "usage_type": "call" } ]
160355110
from selenium import webdriver from taseCase1 import TestCase_ import os, time class Test_zh(TestCase_): def setUpClass(self): self.imgs = [] self.driver = webdriver.Chrome() def tearDownClass(self): self.driver.quit() def tear_flows(self): # 加载启动项 option = webdr...
null
MZ/runmain/test02.py
test02.py
py
654
python
en
code
null
code-starcoder2
66
[ { "api_name": "taseCase1.TestCase_", "line_number": 6, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "selen...
217365166
from PyQt5.QtWidgets import QApplication, QWidget import xml.etree.ElementTree as ET from PyQt5.QtWidgets import QPushButton, QLabel, QLineEdit, QRadioButton, QVBoxLayout, QHBoxLayout, QCheckBox, QComboBox from PyQt5.QtCore import Qt, pyqtSignal, QPoint from src.DataProcessor import DataProcessor, CONFIG_PATH, prepare_...
null
src/MainMenu.py
MainMenu.py
py
8,068
python
en
code
null
code-starcoder2
66
[ { "api_name": "src.utils.log_method_name", "line_number": 17, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.Qt.FramelessWindowHint", "line_number": 18, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore.Qt", "line_number": 18, "usage_type": "name" }, { ...
508204536
from stackoverflow import StackOverflow from superhero import SuperHero from ya import YaUploader import sys import datetime sys.stdin.reconfigure(encoding='utf-8') sys.stdout.reconfigure(encoding='utf-8') if __name__ == '__main__': # Поиск самого умного супергероя hulk = SuperHero('Hulk') hulk.get_id_by_n...
null
main.py
main.py
py
1,241
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.stdin.reconfigure", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.stdout.reconfigure", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.stdout",...
414852815
from django.urls import path from . import views urlpatterns=[ path('',views.index,name='index.html'), path("register", views.register, name="register"), path("login", views.login, name="login"), path("about", views.about, name="about"), path("contact", views.contact, name="contact"), path("da...
null
UniversityApp/UniversityApp/U2H/urls.py
urls.py
py
1,031
python
en
code
null
code-starcoder2
66
[ { "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", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
406875
import logging.config import numpy as np from flask import Flask from flask import render_template, request, redirect, url_for from src.train import get_model, predict_ind from src.createdb import VaccineSentiment, ResponseManager # Initialize Flask app app = Flask(__name__, template_folder="app/templates", static_fo...
null
app.py
app.py
py
4,190
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.config.config.fileConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.config.config", "line_number": 16, "usage_type": "attribute" }, { "api_name"...
338407984
from allauth.account import app_settings from allauth.account.models import EmailAddress from allauth.account.views import SignupView, PasswordResetView from allauth.account.utils import complete_signup from django.conf import settings from django.core import mail from django.contrib.auth import login from django.contr...
null
core/views.py
views.py
py
23,233
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 36, "usage_type": "call" }, { "api_name": "rest_framework.views.APIView", "line_number": 40, "usage_type": "name" }, { "api_name": "rest_framework.decorators.permission_classes", "line_number": 41, "usage_type": "name" }...
52041752
class Solution: def isValid(self, s): """ :type s: str :rtype: bool """ symbol_stack = [] for c in s: if c == '(' or c == '[' or c == '{': symbol_stack.append(c) else: if c == ')' or c == ']' or c == '}': ...
null
020-ValidParentheses/python30/valid_parentheses.py
valid_parentheses.py
py
1,325
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.loads", "line_number": 32, "usage_type": "call" }, { "api_name": "io.TextIOWrapper", "line_number": 39, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 39, "usage_type": "attribute" } ]
594043261
import pypsa import pytest import pandas as pd import sys import os from numpy.testing import assert_array_almost_equal as equal @pytest.fixture def target_gen_p(): target_path = os.path.join( os.path.dirname(__file__), "..", "examples", "opf-storage-hvdc", "opf-storage-dat...
null
test/test_opf_storage.py
test_opf_storage.py
py
1,134
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
296306789
import os import gym import numpy as np import argparse import time import pickle import math from tensorboardX import SummaryWriter from datetime import datetime from collections import OrderedDict import torch import torch.nn as nn import torch.optim as optim import torch.utils.data from torch.autograd import Varia...
null
CEM_AH_continuousAction_reacher.py
CEM_AH_continuousAction_reacher.py
py
38,965
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Softmax", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 25, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 28, "usage_type": "call" }, { "api_name": "time.time", "li...
217515484
from app.extensions import db from datetime import datetime class BaseExtension(db.MapperExtension): """Base extension class for all sa model entities""" def before_insert(self, mapper, connection, target): now = datetime.utcnow() target.created_at = now target.updated_at = now ...
null
app/models/extensions.py
extensions.py
py
498
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.extensions.db.MapperExtension", "line_number": 5, "usage_type": "attribute" }, { "api_name": "app.extensions.db", "line_number": 5, "usage_type": "name" }, { "api_name": "datetime.datetime.utcnow", "line_number": 9, "usage_type": "call" }, { "ap...
518294679
import serial import matplotlib import matplotlib.pyplot as plt import numpy as np from matplotlib.animation import FuncAnimation import time # cria base de dados sensors = {"sensor_1": "b", "sensor_2": "r", "sensor_3": "g"} datas = [] size = 10 for i in range(len(sensors)): row = [] for i in range(size): ...
null
serial_master.py
serial_master.py
py
1,908
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.axis", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 31, "usage_type": "name" }, { "api_name": "matplotlib.pyplot....
429699121
# coding: utf-8 # @author: Abhishek Thakur # Beating the benchmark in Kaggle AFSIS Challenge. # v02: take top 15 and bottom 15 and retrain import pandas as pd import numpy as np from sklearn import svm, cross_validation from sklearn.linear_model import Ridge from sklearn.linear_model import Lasso from sklearn.linear...
null
afsis.soil/scripts/afsis.svm.v08b.py
afsis.svm.v08b.py
py
3,757
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 40, "usage_type": "call" }, { "api_name": "sklearn.svm.SVR", "li...