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
86483699
import json, pika from django.http import JsonResponse from student.models import Student from course.models import Course from django.db import transaction def choosecourse(request): connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) channel = connection.channel() channel.queu...
null
course-select-system-bakend/student/producer.py
producer.py
py
1,879
python
en
code
null
code-starcoder2
76
[ { "api_name": "pika.BlockingConnection", "line_number": 9, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 9, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "django.db....
275983406
import tkinter as tk import sqlite3 import time import random import os class cell(): #each cell is it's own object def __init__(self, curYInd, curXInd, grid, IsEdge, CellNum, window): self.Window = window self.__alive = False self.mygrid = grid self.__Edge = IsEdge ...
null
Final Ver (v2).py
Final Ver (v2).py
py
44,337
python
en
code
null
code-starcoder2
76
[ { "api_name": "tkinter.Frame", "line_number": 151, "usage_type": "call" }, { "api_name": "tkinter.Frame", "line_number": 155, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_number": 169, "usage_type": "call" }, { "api_name": "tkinter.Label", "lin...
148977674
import os import io from setuptools import find_packages, setup # Utility Function to read the README file # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below # Read in the README for the long de...
null
setup.py
setup.py
py
998
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.open", "line_number": 12, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 16, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 23, "usage_type": "call" } ]
280919751
import cv2 import time import numpy as np import module as m import autopy wCam, hCam = 640, 480 pTime = 0 smoothenImg = 7 plocX, plocY = 0, 0 clocX, clocY = 0, 0 detector = m.handDetector(maxHands=1) frameR = 100 # frame Reduction cap = cv2.VideoCapture(0) cap.set(3, wCam) cap.set(4, hCam) cap.set(10...
null
ControlMouse.py
ControlMouse.py
py
2,214
python
en
code
null
code-starcoder2
76
[ { "api_name": "module.handDetector", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 14, "usage_type": "call" }, { "api_name": "autopy.screen.size", "line_number": 18, "usage_type": "call" }, { "api_name": "autopy.screen...
530664784
# -*- coding: utf-8 -*- from docx import Document import numpy from wordcloud import WordCloud from functools import reduce import matplotlib.pyplot as plt doc = Document("../data/nuevoacuerdo.docx") #lee documento parrafos = doc.paragraphs #saca parrafos parra = [] for p in parrafos: parra.append(p.text) parrafos...
null
backend/pintar_nube.py
pintar_nube.py
py
2,700
python
en
code
null
code-starcoder2
76
[ { "api_name": "docx.Document", "line_number": 8, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 75, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 75, "usage_type": "name" }, { "api_name": "nltk.c...
459904055
# This file is associated with the book # "Machine Learning Refined", Cambridge University Press, 2016. # by Jeremy Watt, Reza Borhani, and Aggelos Katsaggelos. import numpy as np import matplotlib.pyplot as plt import csv import pandas as pd # import training data def load_data(csvname): # load in data data...
null
mlrefined_hw_solutions_backup/mlrefined_hw_coding_solutions/Python2_solutions/Chapter_4/Exercise_4_19/exercise_4_19_solution.py
exercise_4_19_solution.py
py
4,269
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.asarray", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.shape", "line_numb...
374422231
import sys import os import maya.mel as mel path = 'T:/dwtv/hub/Tools/Rig/scripts/bb/mel/' melFiles = os.listdir('T:/dwtv/hub/Tools/Rig/scripts/bb/mel') for file in melFiles: mel.eval( 'source "%s%s"'%(path,file)) file = __file__ filePath = os.path.split(file) bb = os.path.split(filePath[0]) s...
null
dwScripts/BB_toolBox.py
BB_toolBox.py
py
751
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "maya.mel.eval", "line_number": 12, "usage_type": "call" }, { "api_name": "maya.mel", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.split", "line_number": 1...
587410325
try: from termcolor import colored except ImportError: DISABLE_COLORS = True else: DISABLE_COLORS = False #: Red color constant for :func:`.ievv_colorize`. COLOR_RED = 'red' #: Blue color constant for :func:`.ievv_colorize`. COLOR_BLUE = 'blue' #: Yellow color constant for :func:`.ievv_colorize`. COLOR_Y...
null
ievv_coderefactor/colorize.py
colorize.py
py
1,348
python
en
code
null
code-starcoder2
76
[ { "api_name": "termcolor.colored", "line_number": 56, "usage_type": "call" } ]
563585153
import argparse import os import sys import torch from net import N2N from torch.autograd import Variable from torch.nn.utils import clip_grad_norm from util import long_tensor_type from util import process_data, get_batch_from_batch_list, generate_batches def train_network(train_batch_list, val_batch_list, test_bat...
null
memory_network_n2n/main.py
main.py
py
7,867
python
en
code
null
code-starcoder2
76
[ { "api_name": "net.N2N", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 16, "usage_type": "attribute" }, { "api_name": "net.cuda", "line_...
520567531
import json import logging from checkov.common.models.enums import CheckResult, CheckCategories from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck class BatchJobIsNotPrivileged(BaseResourceCheck): def __init__(self): name = "Batch job does not define a privileged containe...
null
checkov/terraform/checks/resource/aws/BatchJobIsNotPrivileged.py
BatchJobIsNotPrivileged.py
py
1,235
python
en
code
null
code-starcoder2
76
[ { "api_name": "checkov.terraform.checks.resource.base_resource_check.BaseResourceCheck", "line_number": 8, "usage_type": "name" }, { "api_name": "checkov.common.models.enums.CheckCategories.GENERAL_SECURITY", "line_number": 13, "usage_type": "attribute" }, { "api_name": "checkov....
17179473
import os, logging import yaml default_config = os.path.join("config", "configuration.yml") class Configuration: def __init__(self, config_file=default_config): self.config_file = config_file self.reload() def reload(self): with open(self.config_file, "r") as f: conf =...
null
pytid/utils/configuration.py
configuration.py
py
491
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "yaml.safe_load", "line_number": 17, "usage_type": "call" } ]
581366069
from flask import Flask, render_template, request, jsonify # 'render_template' renders templates and 'request' handles http requests import sqlite3 app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') @app.route('/movie', methods = ['POST']) def movie(): connection = sqlite...
null
blog.py
blog.py
py
1,278
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.form",...
518724681
from sklearn import datasets from sklearn.linear_model import LinearRegression import matplotlib.pyplot as plt import matplotlib.patches as mpatches from sklearn.decomposition import PCA from mpl_toolkits.mplot3d import Axes3D iris = datasets.load_iris() #以花瓣作为:2,:3 #以花蕊作为:0:1 x = iris.data[:,1]#x-axis - sepal length ...
null
ML_1/org_ml_test/test_2.py
test_2.py
py
1,568
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 7, "usage_type": "name" }, { "api_name": "sklearn.decomposition.PCA", "line_number": 43, "usage_type": "call" }, { "api_name": "m...
586681869
from autoprotocol.protocol import Protocol import json p = Protocol() src_plate= p.ref("src_plate", None, "96-pcr", discard=True) dest_plate= p.ref("dest_plate", None, "384-flat", discard=True) xfer_vol = [10]*96; shape_format='SBS96'; # common parameters for all stamps performed stamp_kwargs = { 'new_defaults': T...
null
example_run3.py
example_run3.py
py
946
python
en
code
null
code-starcoder2
76
[ { "api_name": "autoprotocol.protocol.Protocol", "line_number": 4, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 35, "usage_type": "call" } ]
533340307
#coding:utf-8 #cython:language_level=2 import forward import numpy as np import pandas as pd import os, time, glob import tensorflow as tf import PIL.Image as Image import matplotlib.pyplot as plt from skimage.measure import compare_psnr, compare_ssim sigma = 25.0 BATCH_SIZE = 1 out_dir = "./data/output/" test_dir = "...
null
ADMM_L1/validate.py
validate.py
py
2,578
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.Session", "line_number": 20, "usage_type": "call" }, { "api_name": "tensorflow.global_variables_initializer", "line_number": 21, "usage_type": "call" }, { "api_name": "tensorflow.local_variables_initializer", "line_number": 22, "usage_type": "cal...
410544278
''' This program helps troubleshooting netmiko by obtaining the logging file from the router and displaying it. http://ktbyers.github.io/netmiko/COMMON_ISSUES.html ''' from netmiko import ConnectHandler import time import logging logging.basicConfig(filename='test.log', level=logging.DEBUG) logger = logging...
null
Netmiko/nemiko_troubleshooting.py
nemiko_troubleshooting.py
py
944
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "netmiko.Conn...
124375739
#%% import requests import io import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np import scipy.stats as stats url = 'http://www.minethatdata.com/Kevin_Hillstrom_MineThatData_E-MailAnalytics_DataMiningChallenge_2008.03.20.csv' res = requests.get(url).content df: pd.DataFrame = p...
null
section1.py
section1.py
py
1,948
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "io.StringIO", ...
419939251
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division import math import numpy as np import scipy as sp import pandas import matplotlib.pyplot as plt from progressbar import ProgressBar from scipy.sparse import csr_matrix from scipy.sparse import linalg as sparse_linalg import sys file_dir = '/...
null
projects/FSA_various/approximate_su2_lie_algebra_pxp_fsa_pxxxp.py
approximate_su2_lie_algebra_pxp_fsa_pxxxp.py
py
2,882
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
464296159
from multiprocessing import Process, Queue, current_process import queue, time # worker de traitement de tâches def do_job(to_do, jobs_done): # cuurent_process renvoie() dess information sur le processus courant p_name = current_process().name print(f"{p_name} waiting for queue to get elem") while True...
null
process/queues.py
queues.py
py
1,133
python
en
code
null
code-starcoder2
76
[ { "api_name": "multiprocessing.current_process", "line_number": 7, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "queue.Empty", "line_number": 14, "usage_type": "attribute" }, { "api_name": "multiproce...
168879428
import torch import math import numpy as np def load_data(): datanum=500 X = np.linspace(-2., 2., datanum) y = np.ones(datanum) for i in range(datanum): if X[i]>0.: #y[i] = 2.*np.sin(X[i] * (2 * math.pi)) *np.sin(X[i] * (2 * math.pi)) y[i] = 2.*X[i] + 1. else:...
null
develop5/load_data.py
load_data.py
py
1,491
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linspace", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random.randn", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random", "line...
51858732
from urllib.request import urlopen from bs4 import BeautifulSoup import pyexcel from collections import OrderedDict from youtube_dl import YoutubeDL url = "https://www.apple.com/itunes/charts/songs/" conn = urlopen(url) html_content = conn.read() soup = BeautifulSoup(html_content,"html.parser") section = soup.find("s...
null
Session 1/Excercise1.py
Excercise1.py
py
1,006
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.urlopen", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 27, "usage_type": "call" }, { "api_name": "youtu...
26674952
import os import sys import json import numpy as np import pandas as pd from pathlib import Path import tensorflow as tf from solutions.ThirtyMusic import stabr_tf from solutions.ThirtyMusic import data_handling_tf def eval_mrr(network, test_data, k=10): cumulative_rank = 0 total = 0 for step, data in enu...
null
solutions/ThirtyMusic/train_and_eval_tf.py
train_and_eval_tf.py
py
9,788
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.nn.log_softmax", "line_number": 18, "usage_type": "call" }, { "api_name": "tensorflow.nn", "line_number": 18, "usage_type": "attribute" }, { "api_name": "tensorflow.nn.top_k", "line_number": 21, "usage_type": "call" }, { "api_name": "tens...
337881138
from selenium.webdriver.common.by import By from Hogwarts_po1.po_work.base_page import BasePage class ContactPage(BasePage): def get_department_list(self): # ele_list = self.driver.find_element(By.CSS_SELECTOR, '.jstree-ocl').click() ele_list = self.driver.find_elements(By.CSS_SELECTOR, '.jstree-...
null
cekai/Hogwarts_po_selenium/po_work/getlist.py
getlist.py
py
866
python
en
code
null
code-starcoder2
76
[ { "api_name": "Hogwarts_po1.po_work.base_page.BasePage", "line_number": 6, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR", "line_number": 9, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.common.by.By", "line_number": 9, ...
341931566
import numpy as np import pandas as pd from functools import reduce from copy import deepcopy import matplotlib.pyplot as plt from sklearn import preprocessing from sklearn.datasets import make_classification import pickle import os from HelperFunc import project_dir #==================================================...
null
DataFunc.py
DataFunc.py
py
10,575
python
en
code
null
code-starcoder2
76
[ { "api_name": "copy.deepcopy", "line_number": 16, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.intersect1d", "line_number": 17, "usage_type": "attribute" }, { "api_name": "copy.deepcopy",...
582129023
import os import numpy as np import matplotlib.pyplot as plt def sliding_mean(data_array, window=10): # data_array = np.array(data_array) new_list = [] for i in range(data_array.shape[0]): indices = range(max(i - window + 1, 0), min(i + window + 1, data_array.shape[...
null
plot.py
plot.py
py
2,544
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.asarray", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 43, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 43, "usage_type": "name" }, { "api_name": "matplotlib.p...
130254112
import numpy as np import matplotlib.pyplot as plt import matplotlib import imageio import os from components import DataManager as dm def mov_mean(x, N): r = np.convolve(x, np.ones((N,))/N)[(N-1):] r[-1] = x[-1] for i in range(0, int(np.ceil(N))): r[-i] = x[-i] return r def RGB(R, G, B): ...
null
accuracy_error_curves.py
accuracy_error_curves.py
py
3,923
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.convolve", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.ceil", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "...
35210802
import time import threading import json from jetracer.nvidia_racecar import NvidiaRacecar import numpy as np import sys project_path = "/home/jetson/MyWorkspace/jetracer" sys.path.append(project_path) import utils.ipaddress as ip import utils.power as pw from utils.display import Oled from sensor.distance import Di...
null
jetracer3/AI_Rover2.py
AI_Rover2.py
py
5,775
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "jetracer.nvidia_racecar.NvidiaRacecar", "line_number": 20, "usage_type": "call" }, { "api_name": "u...
91955369
from django_redis import get_redis_connection from rest_framework import serializers class ImageCodeCheckSerialize(serializers.Serializer): image_code_id = serializers.UUIDField() text = serializers.CharField(max_length=4, min_length=4) def validate(self, attrs): """ 1. 根据image_code_id从re...
null
meiduo_mall/meiduo_mall/apps/verifications/serializers.py
serializers.py
py
1,538
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.Serializer", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 5, "usage_type": "name" }, { "api_name": "rest_framework.serializers.UUIDField", "line_number": 6, "usage_type"...
110677483
# Copyright 1999-2020 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
null
mars/learn/contrib/pytorch/tests/test_dataset.py
test_dataset.py
py
2,620
python
en
code
null
code-starcoder2
76
[ { "api_name": "mars.utils.lazy_import", "line_number": 23, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 27, "usage_type": "attribute" }, { "api_name": "mars.session.new_session", "line_number": 29, "usage_type": "call" }, { "api_name":...
329567235
import sys import skimage.io import skimage.viewer import skimage.draw import numpy as np from matplotlib import pyplot as plt from PIL import Image import imageio import scipy.ndimage as ndimage # open image and indicate petri dish img_0 = Image.open('results_L3.jpg') row = 1 col = 1 # making grayscale image and sav...
null
bacteria_A.py
bacteria_A.py
py
1,534
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 12, "usage_type": "name" }, { "api_name": "skimage.io.io.imread", "line_number": 22, "usage_type": "call" }, { "api_name": "skimage.io.io", "li...
613326021
import json import requests from django.contrib.auth.decorators import login_required from django.core import serializers from django.http import JsonResponse from django.shortcuts import get_object_or_404 from process.models import Steps, StepsForms def index(request, sections_id): forms_id = request.GET.get('i...
null
csidjango/process/controllers/forms.py
forms.py
py
1,722
python
en
code
null
code-starcoder2
76
[ { "api_name": "process.models.StepsForms.objects.filter", "line_number": 15, "usage_type": "call" }, { "api_name": "process.models.StepsForms.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "process.models.StepsForms", "line_number": 15, "usage_typ...
377071218
import string import random from werkzeug.utils import secure_filename from app.main import db from app.main.model.picture import Picture from .auth_helper import Auth from ..utils.util import Util def upload_new_picture(request): resp = Auth.get_user_id_with_token(request) file = request.files["file"] ...
null
app/main/service/picture_service.py
picture_service.py
py
3,066
python
en
code
null
code-starcoder2
76
[ { "api_name": "auth_helper.Auth.get_user_id_with_token", "line_number": 14, "usage_type": "call" }, { "api_name": "auth_helper.Auth", "line_number": 14, "usage_type": "name" }, { "api_name": "werkzeug.utils.secure_filename", "line_number": 17, "usage_type": "call" }, ...
13543533
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import itertools SEMANTICS = {'base' : ['fire', 'ice', 'stone'], 'color' : ['','red', 'blue', 'green'], 'number' : ['', 'two', 'many']} VOWELS = ['a', 'e', 'i', 'o', 'u'] CONSONANTS = ['p', 't', 'k', 'b', 'd', 'g', 's', 'z', 'm', 'n', 'l', 'h'] ORD...
null
morfala.py
morfala.py
py
4,273
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.product", "line_number": 26, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 65, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 66, "usage_type": "call" }, { "api_name": "random.choice", "...
514394553
from sklearn import metrics from s_dbw import S_Dbw from sklearn import preprocessing from sklearn.cluster import KMeans import csv import os from sklearn.metrics import mean_squared_error #from relative_criteria import Dunn_index, Davies_Bouldin, silhouette_index import numpy complexity2_path = os.path.join(os.getcwd...
null
artificial code/complexity2_dataset_gen.py
complexity2_dataset_gen.py
py
7,685
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number"...
566117357
import numpy as np import cv2 import random #k=int(input("enter the dimension of kernal >>")) k=3 p=k q=k filtr=[[1,1,1],[1,1,1],[1,1,1]] filtr=np.array(filtr)/9 print(filtr) img=cv2.imread('c:/users/girishhegde/dog.jpg') cv2.imshow("img",img) m,n,c=img.shape for e in range(0,m,random.randint(5,20)): for f in...
null
q13box.py
q13box.py
py
1,044
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 15, "usage_type": "call" }, { "api_name": "random.randint", "line_number":...
532138812
from __future__ import absolute_import, division, print_function from librosa import load, feature import os import numpy as np import pandas as pd from scipy.io import savemat def partition(data,parts=10,overlap=.3): out= [] size = len(data) window_size = int(np.floor(size/(1+(parts-1)*(1-overlap)))) ...
null
featGen/FBANK/FBANK.py
FBANK.py
py
2,599
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.floor", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number...
43616700
import os signals = None try: if not 'DJANGO_SETTINGS_MODULE' in os.environ: from django.conf import settings settings.configure() from django.db.models import signals SIGNAL_SUPPORT = True except ImportError: SIGNAL_SUPPORT = False def exec_hook(hook_name, self, *args, **kwargs): ...
null
neomodel/signals.py
signals.py
py
872
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.conf.settings.configure", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.settings", "line_number": 6, "usage_type": "name" }, { "api_name": "djan...
491875602
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created by sundazhong on 2019/11/15 14:17. """ import pika connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) channel = connection.channel() # 创建一个名为"hello"的队列用来将消息投递进去 队列持久化 channel.queue_declare(queue='demo_queue', durable=True) # 在RabbitMQ...
null
demo1/send.py
send.py
py
893
python
en
code
null
code-starcoder2
76
[ { "api_name": "pika.BlockingConnection", "line_number": 8, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 8, "usage_type": "call" }, { "api_name": "pika.BasicProperties", "line_number": 17, "usage_type": "call" } ]
521981458
from pyrandall.kafka import KafkaConn from pyrandall.types import Assertion from .common import Executor class BrokerKafka(Executor): def __init__(self, spec, *args, **kwargs): super().__init__() self.execution_mode = spec.execution_mode self.spec = spec def execute(self, reporter): ...
null
pyrandall/executors/broker_kafka.py
broker_kafka.py
py
912
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.Executor", "line_number": 7, "usage_type": "name" }, { "api_name": "pyrandall.kafka.KafkaConn", "line_number": 16, "usage_type": "call" }, { "api_name": "pyrandall.types.Assertion", "line_number": 19, "usage_type": "call" } ]
355076371
import unittest from mock import MagicMock from clarity_ext.domain.artifact import Artifact import os from clarity_ext.service.file_service import UploadFileService class TestUploadFileService(unittest.TestCase): def test_run_driver_file_service(self): artifact_service = MagicMock() shared_files ...
null
test/unit/clarity_ext/service/test_file_service.py
test_file_service.py
py
1,033
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "mock.MagicMock", "line_number": 11, "usage_type": "call" }, { "api_name": "mock.MagicMock", "line_number": 14, "usage_type": "call" }, { "api_name": "mock.MagicMock", ...
438514181
# Skrypt odczytujacy dane z tematu kafki i zapisujący do bucketu AWS S3 # Skrypt wykorzystuje zewnętrzny plik parametrów o nazwie: airly_param.json w formacie: # # { # "broker": "...", # "api_key": "...", # "url": "..." # } # from os import environ environ['PYSPARK_SUBMIT_ARGS'] = '--packages org.apa...
null
python/write_s3.py
write_s3.py
py
4,212
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 11, "usage_type": "name" }, { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 35, "usage_type": "call" }, { "api_name": "pyspark...
106256812
import mtcnn.mtcnn as mt import time, cv2, os # ========== Face Detection use MTCNN library ========== # CV_STREAM = 'rtsp://root:xxxx@169.254.53.146/axis-media/media.amp?videocodec=H264&resolution=800x450' CV_WINTTL = 'Face Detection by XIAOLI 201806' os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' os.environ["CUDA_V...
null
fd030.py
fd030.py
py
2,217
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imshow", "line...
141068455
# -*- coding: utf-8 -*- """View providing a listing of events Suitable for folders or collections Also includes a viewlet which will show the "featured_item" returned by the method on the view. """ from DateTime import DateTime from zope.component import queryUtility from zope.interface import implements from Produ...
null
src/isaw.theme/isaw/theme/browser/event_listing.py
event_listing.py
py
2,400
python
en
code
null
code-starcoder2
76
[ { "api_name": "isaw.theme.browser.tiled_view.TiledListingView", "line_number": 23, "usage_type": "name" }, { "api_name": "zope.interface.implements", "line_number": 25, "usage_type": "call" }, { "api_name": "isaw.theme.browser.interfaces.IEventListingView", "line_number": 25,...
295524187
from flask import Flask, render_template, request, json, jsonify import os import json import numpy as np import io from PIL import Image import math import base64 from watson_machine_learning_client import WatsonMachineLearningAPIClient from wiotp.sdk.application import ApplicationClient app = Flask(__name__) app.c...
null
app.py
app.py
py
4,880
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 16, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 18, "usage_type": "attribute" }, { "api_name": "wiotp.sdk.application.ApplicationC...
529678465
import aiml import pandas as pd from datetime import datetime from datetime import timedelta from nltk.corpus import wordnet as wn import nltk # Construct a database as a pandas dataframe def init_data(): df = pd.read_csv('database_treinen.csv') df.departure = df['departure'].apply(change_time) df.arrival ...
null
chatbot.py
chatbot.py
py
8,367
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 43, "usage_type": "argument" }, { "api_name": "datetime.time...
397915707
''' Created on 11.12.2017 @author: Anna-Liisa ''' import argparse import socket import random from scapy.layers.inet import IP, TCP, send, sr1 import sys from logging import Logger parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('--shared-key', type=int) parser...
null
Uebung5ALNew/sectubs/client.py
client.py
py
2,252
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 25, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 25, "usage_type": "attribute" }, { "api_name": "socket.SOCK...
365582232
#!/usr/bin/env python3 # -*- coding:utf-8 -*- import os, errno, json import jieba def text2cws(jsonFilePath: str) -> list: if os.path.isfile(jsonFilePath): with open(jsonFilePath, encoding="utf-8") as f: txt = f.read() data = json.loads(txt) try: inputSTR = data["B...
null
week07/week07_Peter_40940112S.py
week07_Peter_40940112S.py
py
1,452
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isfile", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "jieba.cut", "line_number": 1...
89028022
from django.shortcuts import render from rest_framework.views import APIView from rest_framework.response import Response from .models import Project, Pledge from .serializers import ProjectSerializer, PledgeSerializer, ProjectDetailSerializer, PledgeDetailSerializer from django.http import Http404 from rest_framework ...
null
crowdfunding/projects/views.py
views.py
py
4,361
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.permissions.IsAuthenticatedOrReadOnly", "line_number": 12, "usage_type": "attribute" }, { "api_name": "rest_framework.permissions", "line_number": 12, "usage_type": "name" }, { "api_name": "permissions.IsOwnerOrReadOnly", "line_number": 12, "...
644337823
''' This directory contains classes for connecting to and controlling devices over a network. ''' import os import sys import glob import inspect import pexpect import termcolor # insert tests lib so devices and tests can share the same libraries sys.path.insert(0, os.path.dirname(__file__) + '/../tests') b...
null
devices/__init__.py
__init__.py
py
4,662
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_num...
179309683
from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging import os import re import sys from tqdm import tqdm from urllib3 import HTTPResponse from lab_api.swagger_client import LabFile from lab_client.commons import text_utils, file_utils, request_u...
null
services/lab-workspace/docker-res/duplicated-resources/ml-lab-py/lab_client/handler/lab_file_handler.py
lab_file_handler.py
py
22,086
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "lab_client.commons.event_listener.Event", "line_number": 40, "usage_type": "call" }, { "api_name": "...
288403357
# -*- coding: utf-8 -*- from django import forms from django.core.mail import send_mail from dosaaf_pogran.models import Course from dosaaf_pogran.settings import EMAIL_HOST_USER __author__ = 'egregors' class ContactForm(forms.Form): name = forms.CharField(label=u'Ваше имя:') email = forms.EmailField(label=u...
null
dosaaf_pogran/forms.py
forms.py
py
2,935
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.Form", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 11, "usage_type": "call" }, { "api_name": "django.for...
338995796
import numpy as np import sklearn from sklearn.neighbors import NearestNeighbors import bigfloat from decimal import * from pytictoc import TicToc from numpy import linalg as LA def build_shadow_M (X,tau,E,T): '''Build the shadow manifold of the time series signal X, with E variables and sampling tau''' shad...
null
methods.py
methods.py
py
7,703
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": ...
221515189
import pandas as pd import numpy as np import altair as alt import pickle import streamlit as st import altair as alt from vega_datasets import data import time from xgboost import XGBRegressor import xgboost as xgb from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error imp...
null
IdeaProjects/hemnet/sold_items/sold_items/display.py
display.py
py
5,998
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_pickle", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 49, "usage_type": "call" }, { "api_name": "pandas.to_numeric",...
214488310
from collections import Counter from os import listdir from os.path import isfile import random import csv import datetime import numpy as np import tensorflow as tf EVENTS_SENT_DIR = "../eventos_sent/" PREPROCES_DIR = "../JavaPreprocesamiento/" SAVE_DIR = "../store/" PRED_DIR = SAVE_DIR + "pred/" DIR = "../database...
null
src/sentPrediction.py
sentPrediction.py
py
14,273
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 51, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 51, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 60, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number":...
267865215
import pytest from cx_const import ActionFunctionWithParams, TypeAction from cx_core.action_type.predefined_action_type import _get_action from tests.test_utils import fake_fn @pytest.mark.parametrize( "test_input, expected", [ (fake_fn, (fake_fn, tuple())), ((fake_fn, tuple()), (fake_fn, tup...
null
tests/unit_tests/cx_core/action-types/predefined_action_type_test.py
predefined_action_type_test.py
py
550
python
en
code
null
code-starcoder2
76
[ { "api_name": "cx_const.TypeAction", "line_number": 17, "usage_type": "name" }, { "api_name": "cx_const.ActionFunctionWithParams", "line_number": 18, "usage_type": "name" }, { "api_name": "cx_core.action_type.predefined_action_type._get_action", "line_number": 20, "usage_...
382680553
import matplotlib.pyplot as plt import numpy as np data = { "a": np.arange(50), # Return random integers from low (inclusive) to high (exclusive). # "c": np.random.randint(0, 50, 50), "d": np.random.randn(50)} data["b"] = data['a'] + 10 * np.random.randn(50) data['d'] = np.abs(data['d']) * 100 plt....
null
matloptlib_test.py
matloptlib_test.py
py
749
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random.randint", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.random.randn",...
139164019
# -*- coding: UTF-8 -*- # @Time : 2018/4/28 # @File : queue_dataset.py # @Author: Jian <jian@mltalker.com> from __future__ import division from __future__ import unicode_literals from __future__ import print_function from antgo.dataflow.dataset.dataset import Dataset import os import sys import zmq from antgo.utils.se...
null
antgo/dataflow/dataset/queue_dataset.py
queue_dataset.py
py
2,586
python
en
code
null
code-starcoder2
76
[ { "api_name": "antgo.dataflow.dataset.dataset.Dataset", "line_number": 19, "usage_type": "name" }, { "api_name": "zmq.Context", "line_number": 22, "usage_type": "call" }, { "api_name": "zmq.REP", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.ge...
371451280
# -*- coding: utf-8 -*- """ Created on Wed Oct 5 13:57:06 2016 @author: Alexandre """ import numpy as np import scipy.optimize as opt import time import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator import os # Question 1 S = 3 nvec = np.array([1., 1., 0.2]) A = 1. alpha = 0.35 delta = 0....
null
Students/SollaciA/PS2/code/PSet2.py
PSet2.py
py
8,246
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.append", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number":...
490677101
import spotipy from collections import deque import spotipy.util as util import networkx as nx from networkx.readwrite import json_graph import re import time import json def crear_grafo(token, g, spotify, artista_ini, max_artistas=10): # Numero de Artistas a extraer print('Analizando ', max_artis...
null
AccesoAPI.py
AccesoAPI.py
py
6,055
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 26, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 64, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 65, ...
37583367
#! python3 # dataComplete.py - Completa um CSV de Startups com informações presentes em outro, sem substituí-las # Uso: python dataComplete.py [csv mestre] [csv de enriquecimento] [Opcional: coluna-chave (padrão: "Site")] # Exemplo: python dataComplete.py base.csv Startup import sys, csv, re from collections import Or...
null
dataComplete.py
dataComplete.py
py
1,506
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.ddmdata.readcsv", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.ddmdata", "line_number": 12, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "utils.ddmdata.readc...
450365150
""" Debugging FAST fatigue calculations """ import sys libpath = 'C:\\Users\\jrinker\\Documents\\GitHub\\dissertation' if (libpath not in sys.path): sys.path.append(libpath) import JR_Library.main as jr import os import numpy as np import scipy.io as scio # =========== inputs =========== # path to turbine direc...
null
fast_analysis/WISDEM_rainflow/process_stats/proc-fatigue_calcs.py
proc-fatigue_calcs.py
py
3,030
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
416902496
#!/usr/bin/env python # -*- coding: UTF-8 -*- __author__ = 'RemiZOffAlex' __copyright__ = '(c) RemiZOffAlex' __license__ = 'MIT' __email__ = 'remizoffalex@mail.ru' import sys from myapp import app from flask import Flask, render_template, request, escape, redirect, jsonify @app.route('/', methods=['GET']) def inde...
null
Flask-CGI/myapp/views.py
views.py
py
1,320
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.render_template", "line_number": 20, "usage_type": "call" }, { "api_name": "myapp.app.route", "line_number": 15, "usage_type": "call" }, { "api_name": "myapp.app", "line_number": 15, "usage_type": "name" }, { "api_name": "flask.render_template...
594913812
# coding=utf-8 # @Author : bamtercelboo # @Datetime : 2018/07/10 16.03 # @File : train.py # @Last Modify Time : 2018/07/10 16.03 # @Contact : bamtercelboo@{gmail.com, 163.com} """ FILE : Instance.py FUNCTION : Data Instance """ import torch import random from DataUtils.Common import * torch.manual_seed(seed...
null
Dataloader/Instance_Base.py
Instance_Base.py
py
576
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.manual_seed", "line_number": 17, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 18, "usage_type": "call" } ]
182314709
from functools import wraps import logging logger = logging.getLogger('fam') logger.setLevel(logging.DEBUG) LOG_FUNCTION_ARGS = True LOG_FUNCTION_RESULT = True def log_call(name=None): name = f'{name}:: ' if name else '' def decorator(f): @wraps(f) def wrapper(*args, **kwargs): ...
null
chalicelib/fam/common/logger.py
logger.py
py
659
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 5, "usage_type": "attribute" }, { "api_name": "functools.wraps", "line_number": 16, "usage_type": "call" } ]
503309732
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ stdinfile.py Reads stdin, writes to a temp file, and prints the temp file name. For use with bash's process substitution: pygments -l python -f html -O full stdinfile.py | google-chrome "$(stdinfile)" -Christopher Welborn 07-11-2015 """ import os import...
null
stdinfile.py
stdinfile.py
py
3,589
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.split", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.argv", "line_numbe...
538401547
from django.urls import path from . import views app_name = "main" urlpatterns = [ path('', views.IndexView.as_view(), name='home'), path('to_do/', views.add_todo, name='add_todo'), path('<int:todo_id>/delete', views.delete_todo, name="delete") ]
null
main/urls.py
urls.py
py
260
python
en
code
null
code-starcoder2
76
[ { "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" } ]
607198851
import imghdr import numpy as np from PIL import Image def preprocess_image(img_path, model_image_size): """ :param img_path: :param model_image_size: :return: """ image_type = imghdr.what(img_path) image = Image.open(img_path) resized_image = image.resize(tuple(reversed(model_image_...
null
CD_Cars/preprocess_image.py
preprocess_image.py
py
524
python
en
code
null
code-starcoder2
76
[ { "api_name": "imghdr.what", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 15, "usage_type": "name" }, { "api_name": "PIL.Image.BICUBIC", "line_nu...
24987216
from django.db import models from datetime import datetime from django.contrib.auth.models import User from phonenumber_field.modelfields import PhoneNumberField # Create your models here. class Clients(models.Model): First_Name = models.CharField(max_length=50) Last_Name = models.CharField(max_length=50) ...
null
django/API/CRM_APP/models.py
models.py
py
894
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 9, "usage_type": "call" }, { "api_name": "...
607439231
# -*- coding: utf-8 -*- # @Author : Albert Lau # @Email : 571079699@qq.com # @Time : 2019/8/28 17:09 # @File : RF_model.py import time import pickle import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split, GridSearchCV fr...
null
lesson-06/RF_model.py
RF_model.py
py
1,789
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.decomposition.PCA", ...
582849560
"""The count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3. 21 4. 1211 5. 111221 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as "one 2, then one 1" or 1211. Given an integer n where 1 ≤ n ≤ 30, generate the nt...
null
python/leetcode_questions/count_and_say_usingGroupBy.py
count_and_say_usingGroupBy.py
py
1,161
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.groupby", "line_number": 44, "usage_type": "call" }, { "api_name": "{'groupby': 'itertools.groupby'}", "line_number": 50, "usage_type": "call" } ]
298188686
"""File table Revision ID: 0389adc26cce Revises: 208c09863ab4 Create Date: 2018-11-10 22:15:06.516132 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '0389adc26cce' down_revision = '208c09863ab4' branch_labels = None depends_on = None def upgrade(): # ###...
null
migrations/versions/0389adc26cce_file_table.py
0389adc26cce_file_table.py
py
738
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
521796897
from gen import utils import torch from torch import nn, Tensor import torch.nn.functional as F class VAE(nn.Module): """Variational Auto Encoder Largely based on https://github.com/AntixK/PyTorch-VAE/blob/master/models/vanilla_vae.py with some random alterations for the layers. """ def __init__...
null
gen/vae.py
vae.py
py
3,055
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "gen.utils.logger.info", "line_number": 16, "usage_type": "call" }, { "api_name": "gen.utils.logger", ...
343382223
#!/usr/bin/python3 import time import logging import argparse from deviceListener import DeviceListenerThread, DeviceThread from localListener import LocalCommListener def getArgs(): p = argparse.ArgumentParser() p.add_argument("-r", action='store_true') p.add_argument("-p", type=int, default=8888) ...
null
bnx/embd/main.py
main.py
py
660
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 22, "usage_type": "attribute" }, { "api_name": "loggin...
424643975
from celery import Celery,chain from app import app,celery,db import redisearch import time,sys import pandas as pd import billiard as mp #multiprocessing substitute to enable daemon import scipy.stats import numpy as np import os sys.path.insert(0, 'app') import controller.utils as utils from timeit import defaul...
null
website/app/controller/celerytask_redis_old.py
celerytask_redis_old.py
py
15,390
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_...
256964083
import matplotlib.pyplot as plt import numpy as np overs = np.arange(11) indrun = np.array([0, 5, 13, 20, 30, 38, 50, 63, 72, 86, 102]) ausrun = np.array([0, 10, 23, 30, 40, 58, 60, 63, 68, 74, 80]) fig = plt.figure() ax = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # this is standard location of plotting # define locati...
null
ML Day 13/matplotlib2.py
matplotlib2.py
py
637
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "lin...
626933656
""" TCRpiper - a pipeline for TCR sequence treatment. Copyright (C) 2020 D. Malko """ from django.contrib import admin from django.urls import include, path, re_path from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path(r'', include(...
null
backend/backend/urls.py
urls.py
py
930
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 11, "usage_type": "name" }, { "api_name": "...
277255207
# -*- coding:utf-8 -*- ''' Created on 2018年12月14日 解析blk.dat文件 @author: user ''' import os, sys, datetime, time import logging, json from logging.handlers import RotatingFileHandler # from importlib import reload from blockchain_parser.blockchain import Blockchain, get_files, get_blocks from blockchain_parser.block impo...
null
src/com/scott/dev/demo/btc/parseblock_to_file.py
parseblock_to_file.py
py
4,154
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setdefaultencoding", "line_number": 17, "usage_type": "call" }, { "api_name": "os.sep", "line_number": 20, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.DEBUG", ...
294852448
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Factory method for easily getting imdbs by name.""" __sets = {} im...
null
faster_rcnn/datasets/factory.py
factory.py
py
4,678
python
en
code
null
code-starcoder2
76
[ { "api_name": "datasets.pascal_voc.pascal_voc", "line_number": 21, "usage_type": "call" }, { "api_name": "datasets.pascal_voc", "line_number": 21, "usage_type": "name" }, { "api_name": "datasets.pascal_voc.dental", "line_number": 29, "usage_type": "call" }, { "api...
638570919
from tests.factories import ( ApplicationFactory, PortfolioFactory, TaskOrderFactory, CLINFactory, random_future_date, random_past_date, ) import datetime def test_portfolio_applications_excludes_deleted(): portfolio = PortfolioFactory.create() app = ApplicationFactory.create(portfolio...
null
tests/models/test_portfolio.py
test_portfolio.py
py
2,490
python
en
code
null
code-starcoder2
76
[ { "api_name": "tests.factories.PortfolioFactory.create", "line_number": 13, "usage_type": "call" }, { "api_name": "tests.factories.PortfolioFactory", "line_number": 13, "usage_type": "name" }, { "api_name": "tests.factories.ApplicationFactory.create", "line_number": 14, "...
560389158
''' Created on 8 Ara 2020 @author: user ''' from PyQt5.QtWidgets import QGroupBox, QGridLayout, QTableView, QFrame,\ QVBoxLayout, QSplitter, QHBoxLayout, QLabel, QLineEdit, QAction,\ QAbstractItemView from Cest_Factory.Cest_Factory_classes import barisTableViewModel from Cest_Factory.Ekle_Cikar_UI imp...
null
CEST Factory/Cest_Factory/Stok_SağFrame.py
Stok_SağFrame.py
py
8,613
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QTableView", "line_number": 29, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QAbstractItemView.SelectRows", "line_number": 31, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets.QAbstractItemView", "line_number": 31, "usag...
419411979
from setuptools import setup, find_packages from os.path import join, dirname with open('requirements.txt', 'r') as file: requirements = [x.strip() for x in file.readlines()] setup(name='textaugH', version='0.2.6', description='Little package for text augmentation', author_email='comptechaugteam...
null
pypi_install_script/textaugH-0.2.6.tar/setup.py
setup.py
py
564
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 7, "usage_type": "call" } ]
68546774
''' Created on Jan 17, 2012 @author: spengler ''' from models import Usuario from models import Projetos from models import Tipo_de_Habilidade from models import Habilidades from models ...
null
PyProject_FreelaTI/src/PyProject_FreelaTI/cadastro/tests.py
tests.py
py
13,378
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 27, "usage_type": "name" }, { "api_name": "controle.Controle", "line_number": 31, "usage_type": "call" }, { "api_name": "projeto.controle.Controle", "line_number": 32, "usage_type": "call" }, { "api_name": "mode...
496425808
#!/usr/bin/env python # coding: utf-8 # Import library used in this script # In[ ]: get_ipython().system(u'pip install --user geopandas==0.3.0') get_ipython().system(u'pip install --user pyshp==1.2.10') get_ipython().system(u'pip install --user shapely==1.6.3') get_ipython().system(u'pip install --user plotly') get...
null
Nutrition.py
Nutrition.py
py
3,929
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 92, "usage_type": "call" }, { "api_name": "plotly.figure_factory.create_choropleth", "line_number": 139, "usage_type": "call" }, { "api_name...
496755819
import cv2 import numpy as np cap = cv2.VideoCapture(0) panel = np.zeros([100, 700], np.uint8) cv2.namedWindow("panel") def nothing(x): pass cv2.createTrackbar("L - h", "panel", 0, 179, nothing) cv2.createTrackbar("U - h", "panel", 179, 179, nothing) cv2.createTrackbar("L - s", "panel", 0, 255, nothing) cv2....
null
main-video.py
main-video.py
py
1,340
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.namedWindow", "lin...
434622952
# C-python 3.6.2, Windows. import requests import sys def main(argv): input_value = str(argv) url = 'http://services.groupkt.com/state/get/USA/all' found = 'false' # flag to track search success. # Determine key from user input. if input_value.__len__() > 2: my_key = 'name' else: ...
null
stateScript.py
stateScript.py
py
1,850
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.Session", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.argv.__len__", "line_number": 49, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 49, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_...
151578409
# import pdb import src.question as question import src.db as db from time import time, ctime from re import sub, findall, match, IGNORECASE from os import path, environ from contextlib import suppress from unidecode import unidecode from json import decoder import difflib import editdistance # initialize dictionary e...
null
src/host.py
host.py
py
26,145
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isfile", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "name" }, { "api_name": "time.ctime", "line_number": 50, "usage_type": "call" }, { "api_name": "time.time", "line_number": 50, ...
61421957
import pickle from galpy import potential from galpy.df import dehnendf, evolveddiskdf from astropy import units as u import warnings warnings.filterwarnings('ignore') def pickle_data(filename, data): output = open(filename, 'wb') pickle.dump(data, output) output.close() tform = -10 * u.Gyr lp = potentia...
null
cold_axi.py
cold_axi.py
py
1,425
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 6, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 10, "usage_type": "call" }, { "api_name": "astropy.units.Gyr", "line_number": 13, "usage_type": "attribute" }, { "api_name": "astropy.uni...
361932175
from nltk.tokenize import sent_tokenize, regexp_tokenize import re from nltk.corpus import stopwords def openAndRead(infilePathAndName): """ opens a file and returns a long long long string Parameters ---------- infilePathAndName : str `infilePathAndName` is the string containing the ...
null
preFunctions.py
preFunctions.py
py
4,198
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.tokenize.sent_tokenize", "line_number": 59, "usage_type": "call" }, { "api_name": "nltk.tokenize.regexp_tokenize", "line_number": 84, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 95, "usage_type": "call" }, { ...
443046912
#!/usr/bin/env python # coding: utf-8 # In[3]: from nltk.tree import * from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer from nltk.corpus import wordnet import nltk from nltk.tokenize import RegexpTokenizer from pattern.en import conjugate, PRESENT import speech_recognition as sr from vosk ...
null
ISL benepar.py
ISL benepar.py
py
26,053
python
en
code
null
code-starcoder2
76
[ { "api_name": "spacy.load", "line_number": 23, "usage_type": "call" }, { "api_name": "benepar.spacy_plugin.BeneparComponent", "line_number": 24, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 317, "usage_type": "call" }, { "a...
265706030
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier from sklearn.tree import DecisionTreeClassifier, export_graphviz from sklearn import metrics from ...
null
myproject/web/ML/project.py
project.py
py
4,334
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 39, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 43, "usage_type": "call" }, { "api_name": "pandas.Series", "l...
155980583
#!/usr/bin/env python """ Module for organizing SPH, STM files from a corpus """ import glob import os from concurrent.futures import ThreadPoolExecutor from functools import partial from tqdm import tqdm from asrtoolkit.data_structures.audio_file import audio_file from asrtoolkit.data_structures.time_aligned_text i...
null
asrtoolkit/data_structures/corpus.py
corpus.py
py
8,415
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "glob.glob", "line_number": 24, "usage_type": "call" }, { "api_name": "asrtoolkit.data_structures.audi...
358171146
import chess import chess.pgn import chess.engine import pandas as pd from datetime import date from dateutil.relativedelta import relativedelta import requests import json import io pd.set_option('display.max_rows', 15) pd.set_option('display.max_columns', 500) pd.set_option('display.width', 1000) pd.set_option('displ...
null
read_pgn.py
read_pgn.py
py
6,317
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.set_option", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.set_opti...
330787906
from Morpheme import Morpheme from collections import defaultdict import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties def main(): file_name = 'materials/neko.txt.mecab' morph = Morpheme(mecab_file_name=file_name) result = morph.read_mecab_file() # 辞書のリスト count_dict = de...
null
knock39.py
knock39.py
py
1,587
python
en
code
null
code-starcoder2
76
[ { "api_name": "Morpheme.Morpheme", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 18, "usage_type": "call" }, { "a...
422067105
# -*- coding: utf-8 -*- """ Created on Thu Oct 15 20:04:12 2020 @author: tomvc """ import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import dash_bootstrap_components as dbc import datetime as dt import pandas as pd import dash_...
null
app.py
app.py
py
15,781
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 21, "usage_type": "call" }, { "api_name": "dash.Dash", "line_number": 23, "usage_type": "call" }, { "api_name": "dash_bootstrap_components.themes", "line_number": 23, "usage_type": "attribute" }, { "api_name"...
229905359
# -*- coding: utf-8 -*- import cv2 import numpy as np import cv2.cv as cv import serial import time from time import sleep seadmed = [] def saaseadmed(): # saab id´d ainult siis kui aku toide on peal!!!!! global parem, vasak, coil ## parem = serial.Serial('/dev/ttyACM2') ## vasak = serial.Serial('/dev/ttyA...
null
hunt2.py
hunt2.py
py
6,091
python
en
code
null
code-starcoder2
76
[ { "api_name": "serial.Serial", "line_number": 18, "usage_type": "call" }, { "api_name": "serial.PARITY_NONE", "line_number": 18, "usage_type": "attribute" }, { "api_name": "serial.SerialException", "line_number": 30, "usage_type": "attribute" }, { "api_name": "tim...
557392389
# coding=utf-8 from django.contrib.gis import admin from ordered_model.admin import OrderedModelAdmin from django import forms from bims.models import ( LocationType, LocationSite, IUCNStatus, Taxon, Survey, LocationContext, Boundary, BoundaryType, Cluster, CarouselHeader ) cl...
null
bims/admin.py
admin.py
py
1,685
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 20, "usage_type": "name" }, { "api_name": "django.contrib.gis.admin.GeoModelAdmin", "line_number": 28, "usage_type": "attribute" }, { ...
106137292
from django.shortcuts import render from .securetube import fetch, watch, fetch_meta from feed.models import Channels def index(request): #request.session['proxy'] = anonymous() return render(request, 'securetube/index.html') def results(request): if request.method == 'POST': query = request....
null
securetube/views.py
views.py
py
1,204
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 7, "usage_type": "call" }, { "api_name": "securetube.fetch", "line_number": 17, "usage_type": "call" }, { "api_name": "feed.models.Channels", "line_number": 20, "usage_type": "call" }, { "api_name": "feed.mod...
186845500
import os import pickle import errno from requests import Session from .config import CONFIG_DIR SESSIONS_DIR = os.path.join(CONFIG_DIR, 'sessions') def get_response(name, request_kwargs): session = load(name) session_kwargs, request_kwargs = split_kwargs(request_kwargs) headers = session_kwargs.pop('h...
null
httpie/sessions.py
sessions.py
py
1,503
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "config.CONFIG_DIR", "line_number": 9, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_...
23597542
#!/usr/bin/env python3 from common import * import matplotlib.pyplot as plt import numpy as np import random from tqdm import tqdm def get_func(A, b, c): A = np.array(A) b = np.array(b) def f(*x): return 1/2 * A.dot(x).dot(x) + b.dot(x) + c return f METHODS = [ Method.STEEPEST_DESCENT, ...
null
scripts/lab2/main.py
main.py
py
4,916
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.arrow", "line_number": 71, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
245044351
import os from setuptools import setup, find_packages with open(os.path.join(os.path.dirname(__file__), 'requirements.txt')) as fh: requires = fh.read().splitlines() setup( name='pywarehouse', install_requires=requires, version="0.0.8", description="", author="Kieran Bacon", author_email=...
null
setup.py
setup.py
py
768
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_n...