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
346578686
#!/usr/bin/python import pycurl try: from urllib.parse import urlencode except ImportError: from urllib import urlencode try: from StringIO import StringIO except ImportError: from io import StringIO from bs4 import BeautifulSoup URL = "https://bitcointalk.org/index.php?board=159.0" def get_m...
null
findMineCoins.py
findMineCoins.py
py
1,070
python
en
code
null
code-starcoder2
83
[ { "api_name": "io.StringIO", "line_number": 21, "usage_type": "call" }, { "api_name": "pycurl.Curl", "line_number": 30, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 34, "usage_type": "call" }, { "api_name": "pycurl.Curl", "line_num...
32315326
import sys from PyQt4 import QtGui, QtCore, QtWebKit import folium import io_geojson import tweet import point import random class Example(QtGui.QMainWindow): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): ...
null
view.py
view.py
py
3,005
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt4.QtGui.QMainWindow", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 9, "usage_type": "name" }, { "api_name": "folium.Map", "line_number": 22, "usage_type": "call" }, { "api_name": "PyQt4.QtGui.QAction...
324148864
# -*- coding:utf-8 -*- import requests import re res = requests.get('https://www.google.co.jp/search?q=%E6%B2%96%E7%B8%84%E3%80%80%E9%AB%98%E7%B4%9A%E3%83%9B%E3%83%86%E3%83%AB') res.raise_for_status() #print(res.text) pattTitle = re.compile('<h3 class="r"><a href="/url(.*?)">(.*?)</a></h3><div class="s">') pattUrl = re...
null
premiere02.py
premiere02.py
py
673
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 7, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 8, "usage_type": "call" } ]
116305201
# Python standard. import random from typing import List # Third-party. import numpy as np # Local. from scratch.activations import Activations class Perceptron: """ Single layer Neural Network. Linear classifier (binary). For Linearly separable problems.""" def __init__(self, inputs: List[float], activati...
null
scratch/perceptron.py
perceptron.py
py
1,642
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.List", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "random.random", "line_number": 19, "usage_type": "call" }, { "api_name": "scratch.activations.Activations...
168914108
import yfinance as yf def get_yahoo_stats_for_candidate(s, notification_callback): # notification_callback.emit("Downloading the data for: "+s) df=yf.download(s, period = "1y") # notification_callback.emit("Figuring average Drop and Change for: "+ s) df['drop']=df['Open']-df['Low'] df['dropP']=...
null
Research/UpdateCandidates.py
UpdateCandidates.py
py
552
python
en
code
null
code-starcoder2
83
[ { "api_name": "yfinance.download", "line_number": 9, "usage_type": "call" } ]
397024757
from django.urls import path from . import views urlpatterns = [ path('register/', views.registerPage, name="register"), path('', views.index, name='index'), path("update/<int:pk>/", views.update_task, name="update_task"), path('<int:pk>', views.delete_task, name="delete_task"), ]
null
todolist/urls.py
urls.py
py
312
python
en
code
null
code-starcoder2
83
[ { "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", ...
128730014
# -*- coding: utf-8 -*- """ networking.py ~~~~~~~~~~~~ This module implements Settings HP OneView REST API """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import range from future import standard_lib...
null
hpOneView/networking.py
networking.py
py
10,168
python
en
code
null
code-starcoder2
83
[ { "api_name": "future.standard_library.install_aliases", "line_number": 15, "usage_type": "call" }, { "api_name": "future.standard_library", "line_number": 15, "usage_type": "name" }, { "api_name": "builtins.range", "line_number": 155, "usage_type": "call" } ]
230333680
# -*- coding: utf-8 -*- """ ################################################################################ Cell Counting in Target Nuclei Script Author: Gerald M Version U-net (Python 3) This version uses a UNet to perform semantic segmentation of the images. Also updated, oversampling correction. Of cells which ...
null
cell_counting/cctn/cctn_unet.py
cctn_unet.py
py
25,778
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 49, "usage_type": "attribute" }, { "api_name": "warnings.simplefilter", "line_number": 50, "usage_type": "call" }, { "api_name": "PIL.Image.DecompressionBombWarning", "line_number": 50, "usage_type": "attribute" }, { "api...
268321940
from django.shortcuts import render, get_object_or_404, HttpResponse from courses import models from django.views.generic.base import View from pure_pagination import Paginator, EmptyPage, PageNotAnInteger from operation.models import UserFavorite, CourseComments, UserCourse from django.db.models import Q from utils.mi...
null
apps/courses/views.py
views.py
py
6,014
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.views.generic.base.View", "line_number": 12, "usage_type": "name" }, { "api_name": "courses.models.Course.objects.all", "line_number": 17, "usage_type": "call" }, { "api_name": "courses.models.Course", "line_number": 17, "usage_type": "attribute" }...
366480015
from flask import render_template, jsonify, request, flash from app import db from flask_login import login_required, current_user from app.main import bp import json import requests import time @bp.route('/') @bp.route('/index') @login_required def index(): user = current_user if user.achievement1 is None: ...
null
app/main/routes.py
routes.py
py
5,200
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask_login.current_user", "line_number": 14, "usage_type": "name" }, { "api_name": "app.db.session.add", "line_number": 27, "usage_type": "call" }, { "api_name": "app.db.session", "line_number": 27, "usage_type": "attribute" }, { "api_name": "app.d...
236750751
from django.db.models import Q from rest_framework import generics, mixins from omsApp.models import Product, ProductType from .serializers import ProductSerializer, ProductTypeSerializer from .permissions import IsOwnerOrReadOnly class ProductTypeRudView(generics.RetrieveUpdateDestroyAPIView): lookup_field = 'id...
null
omsApp/api/views.py
views.py
py
2,049
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.generics.RetrieveUpdateDestroyAPIView", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 8, "usage_type": "name" }, { "api_name": "serializers.ProductTypeSerializer", "line_number": 10, "u...
296619409
import os, logging, fileinput, subprocess, re from datetime import datetime, timedelta from .Switch import switch from . import is_a_cme, is_a_docker, docker_run def set_clock(newtime): ''' use the system 'date' command to set it format of newtime string: "%Y-%m-%dT%H:%M:%S.SSSSSS" TODO: parse/validate the ...
null
ClockUtils.py
ClockUtils.py
py
8,241
python
en
code
null
code-starcoder2
83
[ { "api_name": "subprocess.run", "line_number": 25, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 43, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 43, "usage_type": "attribute" }, { "api_name": "logging.getLogger"...
371221382
import cv2 import matplotlib.pyplot as plt import numpy import scipy.io mat = scipy.io.loadmat('./devkit/cars_train_annos.mat') annotations = mat['annotations'][0] scaled_size = 100 img_file = './cars_train/00001.jpg' original_img = cv2.imread(img_file, cv2.IMREAD_GRAYSCALE) scaled_img = cv2.resize(original_img, (sca...
null
test_bbox.py
test_bbox.py
py
754
python
en
code
null
code-starcoder2
83
[ { "api_name": "scipy.io.io.loadmat", "line_number": 6, "usage_type": "call" }, { "api_name": "scipy.io.io", "line_number": 6, "usage_type": "attribute" }, { "api_name": "scipy.io", "line_number": 6, "usage_type": "name" }, { "api_name": "cv2.imread", "line_num...
85438145
from scipy import signal from scipy.interpolate import interp1d import numpy as np import matplotlib.pyplot as plt import pandas as pd from config import INTERP_TYPE, FILTER_CONF def intervals_from_mask(mask, polarity=True): """ Convert bool mask to slices with given polarity Ex.: [0, 0, ...
null
height_correction/filtering.py
filtering.py
py
5,230
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.nonzero", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.argmin", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.argmin", "line_number...
250417890
"""A script for converting zero-filled examples into examples with raw morphophonemes Raw morphophonemes are named according to a set of principal forms (principal parts) which are assumed to reflect all morphophonemic alternations in a lexeme. The script assumes that the examples within a lexeme occur all in the sam...
null
zerofilled2raw.py
zerofilled2raw.py
py
5,450
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "orderedset.OrderedSet", "line_number": 62, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 72, "usage_type": "call" }, { "api_name": "collections....
557598148
from __future__ import division import pygame from pygame.locals import * import map import character import math import console class GG2: """ Central class """ # This is to replace the gmk "all" and also to update everything. GameObjectList = [] Xview = 0 Yview = 0 def __init__(self): # All drawing...
null
gg2.py
gg2.py
py
1,823
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.display.set_mode", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pygame.font.SysFont", "line_number": 27, "usage_type": "call" }, { "api_name": "pygam...
628916780
import requests import json import time from bs4 import BeautifulSoup from django.contrib.gis.geos import GEOSGeometry from routepang.model.LocationModel import Location from routepang.model.PreciousData import PreciousData # request에 해당하는 명소(영어명) # 최대 60개까지 가져옴 # json배열 형태로 return class LocationController: def ...
null
controller/LocalController.py
LocalController.py
py
3,357
python
en
code
null
code-starcoder2
83
[ { "api_name": "routepang.model.PreciousData.PreciousData.mapKey", "line_number": 16, "usage_type": "attribute" }, { "api_name": "routepang.model.PreciousData.PreciousData", "line_number": 16, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 32, "usage_...
463826422
# coding: utf-8 import os import timeit from collections import OrderedDict import meshio import numpy as np from mgmetis import metis __all__ = ['meshpart'] def meshpart(size, filename): if size > 1: paramesh(size, filename) else: seqmesh(filename) def seqmesh(filename): def load_gmsh_m...
null
manapy/ddm/meshpartitioning.py
meshpartitioning.py
py
12,132
python
en
code
null
code-starcoder2
83
[ { "api_name": "meshio.read", "line_number": 21, "usage_type": "call" }, { "api_name": "timeit.default_timer", "line_number": 77, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 88, "usage_type": "call" }, { "api_name": "os.path", "line_n...
344007750
from bs4 import BeautifulSoup as bs from selenium import webdriver import time import pandas as pd # setup url = 'http://fantasy.nfl.com/league/2785979/history/2015/teamhome?teamId=1' driver = webdriver.Firefox() # to be populated rosters = {} pages = [] # sign in with selenium driver driver.get(url) time.sleep(20) ...
null
FantasyRosters/getFantasyRosters.py
getFantasyRosters.py
py
1,105
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 8, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", ...
242383201
import argparse #define arguments parser = argparse.ArgumentParser(description='remove reads that map to contigs that arent part of cycles') parser.add_argument('ifn_pairedtable', metavar='<ifn_paired table reads', type=str, help='Input paired table of reads') parser.add_argument('ofn_pairedtable', metavar='<ifn_paire...
null
md/Python/rem_noncyc_reads.py
rem_noncyc_reads.py
py
1,459
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" } ]
447405634
import datetime import streamlit as st import pandas as pd from tools.data_tools import * @st.cache(allow_output_mutation=True) def get_removed(): removing_dates = {'start_date':[],'end_date':[]} return removing_dates def removing_dates(df): st.subheader("Removing data by period of time") ...
null
database_config.py
database_config.py
py
2,453
python
en
code
null
code-starcoder2
83
[ { "api_name": "streamlit.cache", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit.subheader", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 15, "usage_type": "call" }, { "api_name": "datetim...
212723893
############################################################################ # # # Copyright (c) 2022-2023 Carl Drougge # # # # Licensed u...
null
accelerator/shell/lined.py
lined.py
py
6,731
python
en
code
null
code-starcoder2
83
[ { "api_name": "accelerator.colourwrapper.colour.pre_post", "line_number": 32, "usage_type": "call" }, { "api_name": "accelerator.colourwrapper.colour", "line_number": 32, "usage_type": "name" }, { "api_name": "sys.stderr", "line_number": 48, "usage_type": "attribute" },...
380725390
import os import argparse import pdb from models.cgan.model import Generator from models.classifier.model import get_MNIST_model import models.classifier.train import models.classifier.evaluate import numpy as np import torch from torch.autograd import Variable import torch.utils.data from torch.utils.data import Da...
null
run_baseline.py
run_baseline.py
py
6,724
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 41, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 41, "usage_type": "attribute" }, { "api_name": "model...
241256279
import torch import torch.nn as nn import torch.utils.model_zoo as model_zoo import os import sys model_urls = { 'imagenet': 'http://webia.lip6.fr/~cadene/Downloads/inceptionv4-97ef9c30.pth' } class BasicConv2d(nn.Module): def __init__(self, in_planes, out_planes, kernel_size, stride, padding=0): sup...
null
model_zoo/inceptionv4/pytorch_load.py
pytorch_load.py
py
17,252
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
38227380
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.2.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- #...
null
test.py
test.py
py
6,512
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.exists", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.remove", "line_number": 30, "usage_type": "call" }, { "api_name": "heatrapy.single_object", "l...
89818221
############################ JSON representation ############################## import webapp2 import json from utilities.db_entities import * class JsonHandler(webapp2.RequestHandler): def get(self): posts = db.GqlQuery("SELECT * FROM Posts ORDER BY time_date DESC") posts_list = [] for ...
null
handlers/jsonHandler.py
jsonHandler.py
py
1,509
python
en
code
null
code-starcoder2
83
[ { "api_name": "webapp2.RequestHandler", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 18, "usage_type": "call" }, { "api_name": "webapp2.RequestHandler", "line_number": 22, "usage_type": "attribute" }, { "api_name": "jso...
357309904
import cv2 import numpy as np from webapp.GymTrainerComponents.PoseDetector import PoseDetector vCap = cv2.VideoCapture("videos/v5.mp4") pDetector = PoseDetector() count = 0 direction = 0 while True: success, img = vCap.read() result, img = pDetector.getPose(img, False) landMarksList = pDetector.getPoseLa...
null
webapp/GymTrainerComponents/BoxingTrainer.py
BoxingTrainer.py
py
1,618
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.VideoCapture", "line_number": 5, "usage_type": "call" }, { "api_name": "webapp.GymTrainerComponents.PoseDetector.PoseDetector", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.interp", "line_number": 17, "usage_type": "call" }, { ...
194219016
''' Req url base (taken from server object) endpoint (from path) parameters (copu of parameter object) name: parameter name location: query,header,path,cookie required: true/false value: fuzzable variable method (from path GET,PUT etc) headers dict? list? ...
null
req.py
req.py
py
31,495
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.info", "line_number": 176, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 178, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 227, "usage_type": "call" }, { "api_name": "logging.debug", "line_n...
549509363
import requests from bs4 import BeautifulSoup # import logging # from logging.handlers import RotatingFileHandler # import subprocess # import pymongo # from pymongo import MongoClient from datetime import datetime import re import csv # logger = logging.getLogger() # logger.setLevel(logging.DEBUG) # formatter = loggin...
null
debenham/debenham_rates.py
debenham_rates.py
py
2,676
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 26, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
117904183
import matplotlib.pyplot as plt def plot_data(data, name, file): plt.figure() plt.plot(range(len(data)), data[:,0], label="Training Set") plt.plot(range(len(data)), data[:,1], label="Validation Set") plt.plot(range(len(data)), data[:,2], label="Test Set") plt.legend(loc='best') plt.title("%s H...
null
ECE521-master/Assignment 2/plot.py
plot.py
py
977
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 6, "usage_type": "call" }, { "api_name": "matplo...
491590686
import glob import os import self_awareness as sf debug_mode = "off" def get_absolute_path(*args): fallback_output = "unable to get path" log = "" try: relative_path = args[0] if isinstance(relative_path, str): fallback_output = relative_path except Exception as e: ...
null
helper_funcs.py
helper_funcs.py
py
3,521
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.realpath", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.getcwd", "line_numb...
334226015
# encoding: UTF-8 import datetime import time import json import os import jpype from jpype import * from vnpy.trader.vtGateway import * from vnpy.trader.vtFunction import getJsonPath from language import text from vnpy.api.geya.geyaApi import GeyaBase SYMBOL_XAUUSD = 'XAUUSD' SYMBOL_XAGUSD = 'XAGUSD' SYMBOL_MAP = {...
null
vnpy/trader/gateway/geyaGateway/geyaGateway.py
geyaGateway.py
py
15,616
python
en
code
null
code-starcoder2
83
[ { "api_name": "vnpy.trader.vtFunction.getJsonPath", "line_number": 146, "usage_type": "call" }, { "api_name": "language.text.LOADING_ERROR", "line_number": 156, "usage_type": "attribute" }, { "api_name": "language.text", "line_number": 156, "usage_type": "name" }, { ...
306902335
try: import config_local as config except: import config from datetime import datetime from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import create_engine, ForeignKey from sqlalchemy import Column, Integer, String, DateTime, Text from sqlalchemy.orm import sessionmaker, scoped_sessio...
null
model.py
model.py
py
4,719
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.create_engine", "line_number": 15, "usage_type": "call" }, { "api_name": "config.DB_URI", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sqlalchemy.orm.scoped_session", "line_number": 16, "usage_type": "call" }, { "api_nam...
569380448
import A1_image_filtering import cv2 import numpy as np import time IMAGE_FILE_NAME_LIST = ["lenna.png", "shapes.png"] def compute_image_gradient(img): filtered_img = A1_image_filtering.cross_correlation_2d(img,A1_image_filtering.get_gaussian_filter_2d(7,1.5)) sovel_xx = [[-1,0,1]] sovel_xy = ...
null
CV_A1/A1_edge_detection.py
A1_edge_detection.py
py
3,455
python
en
code
null
code-starcoder2
83
[ { "api_name": "A1_image_filtering.cross_correlation_2d", "line_number": 9, "usage_type": "call" }, { "api_name": "A1_image_filtering.get_gaussian_filter_2d", "line_number": 9, "usage_type": "call" }, { "api_name": "A1_image_filtering.cross_correlation_1d", "line_number": 16, ...
183710655
#edit by Zhang Kun@20180527 #Graduate School at Shenzhen, Tsinghua University # -*- coding: UTF-8 -*- import h5py import numpy as np import tensorflow as tf import os import random from tensorflow.python import debug as tf_debug os.environ["CUDA_VISIBLE_DEVICES"] = "2" INITIAL_LEARNING_RATE = 0.0001 # Initial l...
null
reference/icassp2018_attention_based_std.py
icassp2018_attention_based_std.py
py
13,895
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "random.shuffle", "line_number": 85, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 86, "usage_type": "call" }, { "api_name": "random.shuffle", "l...
524313640
# This script contains the functions used for plotting different plots in # other scripts used for evaluation. # Author: Shweta Narkhede and Camilo Salcedo # Created on: Oct 24th, 2020 # Edited by: Benjamin Mitchell, Quinn Hull # Edited on: Nov 15th, 2020 # %% import pandas as pd import os import numpy as np import m...
null
evaluation_scripts/plot_functions.py
plot_functions.py
py
21,655
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 36, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 36, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 38, "usage_type": "call" }, { "api_name": "mat...
274023298
from tkinter import * from functools import partial def click(botao): print(botao['text']) janela = Tk() bt1 = Button(janela, width=20, text='Botão 1') bt1['command'] = partial(click, bt1) bt1.place(x = 100, y = 100) bt2 = Button(janela, width=20, text='Botão 2') bt2['command'] = partial(click, bt2) ...
null
aula7.py
aula7.py
py
411
python
en
code
null
code-starcoder2
83
[ { "api_name": "functools.partial", "line_number": 10, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 13, "usage_type": "call" } ]
100619939
import torch import torch.nn as nn import torch.nn.functional as F import math def convert2cpu(gpu_matrix): return torch.FloatTensor(gpu_matrix.size()).copy_(gpu_matrix) def bbox_iou(boxes1, boxes2, x1y1x2y2=True): if x1y1x2y2: mx = torch.min(boxes1[0], boxes2[0]) Mx = torch.max(boxes1[2], box...
null
ears_right/region_loss.py
region_loss.py
py
9,347
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.FloatTensor", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.min", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.max", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.min", "line_number": 1...
323408892
#coding: utf-8 from flask import Flask, request, g, render_template, redirect, url_for from datetime import datetime import sqlite3, os app = Flask(__name__) DATABASE = 'message.db' @app.route('/') def index(): cursor = get_db().cursor() cursor.execute('select * from message order by post_time desc, author')...
null
0023/0023.py
0023.py
py
1,683
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.request.form.get", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.request...
234501225
from django.shortcuts import render # Create your views here. from django.http import HttpResponse, HttpResponseRedirect from .models import Prisoner from django.template import loader from django.shortcuts import redirect from django.contrib.auth.decorators import login_required @login_required(login_url='/login/',...
null
prisoner_list/views.py
views.py
py
2,139
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.Prisoner.objects.order_by", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Prisoner.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "models.Prisoner", "line_number": 13, "usage_type": "name" }, { "api...
431578205
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns get_ipython().run_line_magic('matplotlib', 'inline') # ** Read in the Ecommerce Customers csv file as a DataFrame called customers.** customers = pd.read_csv('Ecommerce Customers') # **Check the head of customers, and check...
null
Linear_Regression_ECommerce.py
Linear_Regression_ECommerce.py
py
1,872
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "seaborn.jointplot", "line_number": 20, "usage_type": "call" }, { "api_name": "seaborn.set_style", "line_number": 21, "usage_type": "call" }, { "api_name": "seaborn.jointplot"...
57569841
from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.preprocessing import StandardScaler from sklearn.model_selection import cross_val_score from sklearn import svm import pandas as pd # Purpose: Use svm Classifier and k-fold cross-validation. ...
null
320180941841-wuyang/homework11/iris_process.py
iris_process.py
py
2,642
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn....
174409185
# # Usage: # import runtest # runtest.run(testcommands, outputfile, # menuprompt=None, default "OS/161 kernel [? for menu]: " # shellprompt=None, default "OS/161$ " # conf=None, default is sys161 default behavior # ram=None, default is per sys161 config # ...
null
root/testscripts/runtest.py
runtest.py
py
6,552
python
en
code
null
code-starcoder2
83
[ { "api_name": "pexpect.EOF", "line_number": 97, "usage_type": "attribute" }, { "api_name": "pexpect.TIMEOUT", "line_number": 98, "usage_type": "attribute" }, { "api_name": "pexpect.EOF", "line_number": 104, "usage_type": "attribute" }, { "api_name": "pexpect.TIMEO...
42089129
########################################### # # Example script to build a # pinout diagram. Includes basic # features and convenience classes. # ########################################### from pinout.core import Diagram, Group, Rect, Image from pinout.components.pinlabel import PinLabelGroup, PinLabel from pinout.com...
null
pinout/resources/quick_start/pinout_diagram.py
pinout_diagram.py
py
2,916
python
en
code
null
code-starcoder2
83
[ { "api_name": "pinout.core.Diagram", "line_number": 20, "usage_type": "call" }, { "api_name": "pinout.core.Rect", "line_number": 21, "usage_type": "call" }, { "api_name": "pinout.core.Group", "line_number": 27, "usage_type": "call" }, { "api_name": "pinout.core.Re...
233203497
import datetime from uuid import uuid1 import numpy as np from backend.models import Video, DjangoUser, VideoRating, UserInformation, UserPreferences, \ VideoRatingPrivacy from backend.rating_fields import VIDEO_FIELDS from helpers import login, logout, test_username, create_test_video, \ random_alphan...
null
integration_test/test_search_filter.py
test_search_filter.py
py
10,838
python
en
code
null
code-starcoder2
83
[ { "api_name": "backend.models.DjangoUser.objects.create", "line_number": 18, "usage_type": "call" }, { "api_name": "backend.models.DjangoUser.objects", "line_number": 18, "usage_type": "attribute" }, { "api_name": "backend.models.DjangoUser", "line_number": 18, "usage_typ...
515509084
import torch import numpy as np from torch.autograd import Variable from chinese import chinese from config import RESULT_FILE, IMPROVED_RESULT_FILE, TEST_GOLD, TEST_FILE, MAX_LEN, BIGRAM class Eval(object): def __init__(self, da_idx, BATCH_SIZE): self.da_idx = da_idx self.BATCH_SIZE = BATCH_SIZ...
null
evaluate.py
evaluate.py
py
10,496
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.asarray", "line_number": 119, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number": 119, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_number": 120, "usage_type": "call" }, { "api_name": "numpy.int32", "li...
99516730
#!/usr/bin/env python # coding: utf-8 # In[ ]: from flask import Flask, render_template, request, redirect, session, g, flash, url_for import sqlite3 import validators import os import requests app = Flask(__name__) app.config.from_object(__name__) app.config.update(dict( DATABASE=os.path.join(app.root_path, '...
null
bookcatalogue.py
bookcatalogue.py
py
6,120
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_num...
251233460
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals from datetime import datetime from typing import Text import pytest import six from pkg_resources import DistributionNotFound from pkg_resources import get_distribution def _version(): # type: () -> Text try:...
null
src/pytest_print/__init__.py
__init__.py
py
2,102
python
en
code
null
code-starcoder2
83
[ { "api_name": "six.text_type", "line_number": 16, "usage_type": "call" }, { "api_name": "pkg_resources.get_distribution", "line_number": 16, "usage_type": "call" }, { "api_name": "pkg_resources.DistributionNotFound", "line_number": 17, "usage_type": "name" }, { "a...
301673029
import discord import logging from self_chat import chatbot_response_b from random import randint client = discord.Client() step=0 @client.event async def on_ready(): print('We have logged in as {0.user}'.format(client)) @client.event async def on_message(message): global step if message.content.startswi...
null
Discord Bot NLP/bot.py
bot.py
py
777
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.Client", "line_number": 5, "usage_type": "call" }, { "api_name": "self_chat.chatbot_response_b", "line_number": 17, "usage_type": "call" } ]
413982278
from django.contrib.auth import authenticate from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from chat.models import Chat from django.contrib.auth.models import User from rest_framework.views import APIView from rest_framework.response import Response from rest_framework ...
null
chat/views.py
views.py
py
3,554
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "django.contrib.auth.authenticate", "line_number": 23, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects.all", "line_number": 25, "usage_type": "...
611315447
import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt from tristan_funcs_vecpot import vecpot2 import h5py from scipy.ndimage.filters import gaussian_filter plt.set_cmap('RdBu') plt.rcParams['mathtext.fontset'] = 'stix' plt.rcParams['font.family'] = 'STIXGeneral' plt.rcParams.upd...
null
smooth_xpoint_detect_rot90.py
smooth_xpoint_detect_rot90.py
py
6,016
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.use", "line_number": 2, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.set_cmap", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.p...
264163053
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint, cstr, flt from frappe import _ from frappe.model.document import Document from operator import itemgetter ...
null
formis/formis/doctype/formisbom/formisbom.py
formisbom.py
py
15,279
python
en
code
null
code-starcoder2
83
[ { "api_name": "frappe.model.document.Document", "line_number": 16, "usage_type": "name" }, { "api_name": "frappe.db.sql_list", "line_number": 18, "usage_type": "call" }, { "api_name": "frappe.db", "line_number": 18, "usage_type": "attribute" }, { "api_name": "frap...
416261428
""" KNN - Telecommunications Dataset KNN is a supervised learnig algorithm used for classification, based on the correpsonding points of a given data points. Once a point is to be predicted, it take into account the 'k' nearest points to determine its classification. """ import matplotlib.pyplot as plt import numpy as ...
null
KNN.py
KNN.py
py
2,847
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.preprocessing", "line_number": 23, "usage_type": "name" }, { "api_na...
133539001
# -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException...
null
facebook archived saves removal.py
facebook archived saves removal.py
py
2,447
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { "api_name": "...
270410244
""" fotochest.apps.photo_manager.urls ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :license: MIT, see LICENSE for more details. """ from django.conf.urls import patterns, url from fotochest.apps.photo_manager import views, feeds urlpatterns = patterns('', # Public URLS url(r'^$', views.HomepageListView.as_view(), na...
null
fotochest/apps/photo_manager/urls.py
urls.py
py
1,429
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.patterns", "line_number": 14, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 16, "usage_type": "call" }, { "api_name": "fotochest.apps.photo_manager.views.HomepageListView.as_view", "line_number": 16, "usage_ty...
376556241
from django.db import models from django.conf import settings from carro.models import Carro from django.contrib.auth.models import User from cliente.models import Direccion # Create your models here. class Orden(models.Model): ESTADO = ( ('1','Esperando Pago'), ('2','Cancelado'), ('3','Enviado'), ('4','Pago ...
null
orden/models.py
models.py
py
1,098
python
en
code
null
code-starcoder2
83
[ { "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": 17, "usage_type": "call" }, { "api_name": ...
418131302
import boto3 import time import json import logging from typing import Dict, Optional from botocore.exceptions import ClientError from config import CONFIG client = boto3.client("sqs", region_name="ap-northeast-2") logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s : %(message)s', ...
null
model_nlp/src/utils/sqs.py
sqs.py
py
4,390
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto3.client", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.getLogger"...
72917107
import collections from cffi import FFI from enum import IntEnum import os import sys __all__ = ['Options', 'Info', 'Entry', 'FTS'] def _cmp(x, y): if x < y: return -1 elif y < x: return 1 else: return 0 def key_to_cmp(key, reverse=False): if key: if reverse: ...
null
fts.py
fts.py
py
12,549
python
en
code
null
code-starcoder2
83
[ { "api_name": "enum.IntEnum", "line_number": 34, "usage_type": "name" }, { "api_name": "enum.IntEnum", "line_number": 49, "usage_type": "name" }, { "api_name": "enum.IntEnum", "line_number": 55, "usage_type": "name" }, { "api_name": "cffi.FFI", "line_number": ...
449547060
import pandas as pd import numpy as np import copy from ann2 import Net from replicate import replicate_data from sklearn.preprocessing import StandardScaler from sklearn.model_selection import KFold from train import train import csv # Load training data as pd dataframe and convert pd dataframe into numpy array. tra...
null
ANN_Stopping_kfold/2HL_k_fold_cross_validation_hn-e.py
2HL_k_fold_cross_validation_hn-e.py
py
5,098
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_excel", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 16, "usage_type": "call" }, { "api_name": "sk...
592019435
from lib.clients import Clients class Repository(Clients): def __init__(self, slug, sticky_branch): super().__init__() self.slug = slug self.sticky_branch = sticky_branch self.slug_encoded = slug.replace('/', '%2F') self.travis_url = self._Clients__travis_client.get_repo_ur...
null
lib/repository.py
repository.py
py
4,079
python
en
code
null
code-starcoder2
83
[ { "api_name": "lib.clients.Clients", "line_number": 4, "usage_type": "name" } ]
325779110
# -*- coding: utf-8 -*- # Copyright 2020 Minh Nguyen (@dathudeptrai) # # 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 req...
null
bin/dump_duration.py
dump_duration.py
py
14,545
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 29, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "tensorflow.config.list_physical_devices", "line_number": 31, "usage_type": "call" }, { "api_name": ...
240954815
from __future__ import print_function import torch import torch.backends.cudnn as cudnn from torch.autograd import Variable import torch.nn.functional as F from data import base_transform, VID_CLASSES, VID_CLASSES_name, MOT_CLASSES from ssd import build_ssd from layers.modules import AttentionLoss import os import t...
null
test_video.py
test_video.py
py
10,108
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 45, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 59, "usage_type": "call" }, { "api_name": "time.time", "li...
141011904
#!/usr/bin/env python # coding: utf-8 # In[2]: from xml.etree import ElementTree from lxml import etree import requests as rq def dfs(element, level, colors): level += 1 for child in element: if child.attrib['color'] == 'blue': colors[2] += level if child.attrib['color'] == 'red...
null
module3/xml(1).py
xml(1).py
py
782
python
en
code
null
code-starcoder2
83
[ { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 24, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 24, "usage_type": "name" } ]
74466009
import torch import torch.nn as nn import pandas as pd import numpy as np from useless_ids import useless_ids from collections import Iterable class SplitBaselineConfig: def __init__(self, atlas_roi_path="atlas_roi.csv", atlas=["AAL"], ctype="all", out_dim = 3, ...
null
code_sub/splitbaseline.py
splitbaseline.py
py
4,453
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.Iterable", "line_number": 16, "usage_type": "argument" }, { "api_name": "pandas.read_csv", "line_number": 47, "usage_type": "call" }, { "api_name": "useless_ids.useless_ids", "line_number": 66, "usage_type": "name" }, { "api_name": "nump...
571616389
import unittest from mock import MagicMock from troposphere import ( Base64, Ref, ) from stacker.blueprints.base import ( Blueprint, CFNParameter, build_parameter, get_local_parameters, ) from stacker.blueprints.variables.types import ( CFNString, EC2AvailabilityZoneNameList, ) from st...
null
stacker/tests/blueprints/test_base.py
test_base.py
py
12,254
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 30, "usage_type": "attribute" }, { "api_name": "stacker.blueprints.base.get_local_parameters", "line_number": 35, "usage_type": "call" }, { "api_name": "stacker.exceptions.MissingLocalParameterException", "line_number": 42, ...
414012672
#!/usr/bin/env python # See: https://github.com/fiedl/hole-ice-study/issues/57 # import code; code.interact(local=dict(globals(), **locals())) # like binding.pry import sys import pandas flasher_data_file = "~/icecube/flasher-data/oux.63_30" flasher_data = pandas.read_csv(flasher_data_file, delim_whitespace = True...
null
scripts/lib/plot_number_of_hits_on_all_neighbouring_strings.py
plot_number_of_hits_on_all_neighbouring_strings.py
py
2,428
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "glob2.glob", "line_nu...
252887051
import tensorflow as tf from gqn.gqn_model import gqn_draw_model_fn from gqn.gqn_params import GQN_DEFAULT_CONFIG, create_gqn_config from data_provider.gqn_tfr_provider import gqn_input_fn import matplotlib.pyplot as plt import numpy as np MODEL_DIR='/home/cylee/gqn/models' DATA_DIR='/home/cylee/gqn/gqn-dataset' DATAS...
null
www.py
www.py
py
1,137
python
en
code
null
code-starcoder2
83
[ { "api_name": "gqn.gqn_params.GQN_DEFAULT_CONFIG", "line_number": 13, "usage_type": "name" }, { "api_name": "tensorflow.estimator.Estimator", "line_number": 15, "usage_type": "call" }, { "api_name": "tensorflow.estimator", "line_number": 15, "usage_type": "attribute" },...
98556511
import torch import torch.nn.functional as F from torch_geometric.data import Data from gnn import Graph import json import string import pickle import random random.seed(1234) torch.manual_seed(1234) torch.cuda.manual_seed_all(1234) device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') import argpa...
null
code-BC5CDR/propagate.py
propagate.py
py
8,256
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.seed", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.cuda.manual_seed_all", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda",...
204629126
from db import db import datetime class RequestModel(db.Model): __tablename__ = 'requests' request_types = ["stub", "Coffee", "Lunch", "Movie","Beer","Game"] id = db.Column(db.Integer, primary_key=True) request_state = db.Column(db.Integer) request_type = db.Column(db.Integer) reques...
null
models/requests.py
requests.py
py
6,194
python
en
code
null
code-starcoder2
83
[ { "api_name": "db.db.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "db.db", "line_number": 5, "usage_type": "name" }, { "api_name": "db.db.Column", "line_number": 8, "usage_type": "call" }, { "api_name": "db.db", "line_number": 8, "u...
495713248
## we are going to create a simple protocol for our for actions # put - Put something into the space # get - Retrieve something from the space to be processed, i.e. nobody else # can then retrieve or read it # read - As for get, but a copy stays in the space for others to read, or get # get_wait - like get but wa...
null
client.py
client.py
py
3,345
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 27, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.stdout...
355548407
# -*- coding: utf-8 -*- # FeedCrawler # Projekt von https://github.com/rix1337 import configparser class CrawlerConfig(object): _DEFAULT_CONFIG = { 'FeedCrawler': [ ("auth_user", "str", ""), ("auth_hash", "str", ""), ("myjd_user", "str", ""), ("myjd_pass", ...
null
feedcrawler/config.py
config.py
py
5,812
python
en
code
null
code-starcoder2
83
[ { "api_name": "configparser.RawConfigParser", "line_number": 110, "usage_type": "call" }, { "api_name": "configparser.DuplicateSectionError", "line_number": 116, "usage_type": "attribute" } ]
503176092
from flask import Flask, redirect, url_for def created_app(config=None): app = Flask(__name__) if config is not None: app.config.from_object(config) from dashboard.views import dashboard app.register_blueprint(dashboard, url_prefix='/dashboard') @app.route('/') def home()...
null
app.py
app.py
py
362
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "dashboard.views.dashboard", "line_number": 10, "usage_type": "argument" } ]
325690417
import telebot import googletrans from googletrans import Translator import config bot = telebot.TeleBot(config.TOKEN) translator = Translator() @bot.message_handler(commands=['start']) def send_welcome(message): bot.reply_to(message, "Привет, я бот-переводчик с любого языка на английский, введи слово или фразу - и ...
null
bot.py
bot.py
py
882
python
en
code
null
code-starcoder2
83
[ { "api_name": "telebot.TeleBot", "line_number": 6, "usage_type": "call" }, { "api_name": "config.TOKEN", "line_number": 6, "usage_type": "attribute" }, { "api_name": "googletrans.Translator", "line_number": 7, "usage_type": "call" }, { "api_name": "googletrans.LAN...
38919193
import random from typing import Callable import pygame from text_surface_rectangle import Colors, TextRec from input_data import Answer, Question class Round: def __init__(self, setup: Callable, question: Question, answer: Answer): self.question = question self.answer = answer # For que...
null
rounds.py
rounds.py
py
3,737
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.Callable", "line_number": 11, "usage_type": "name" }, { "api_name": "input_data.Question", "line_number": 11, "usage_type": "name" }, { "api_name": "input_data.Answer", "line_number": 11, "usage_type": "name" }, { "api_name": "text_surface_re...
34551212
import base64 import time import os import cv2 from flask import Flask, request, render_template import re from ImageProcess.ImageProcess import ImageProcess , Calibration from ArduinoSerial import ArduinoSerial from PIL import Image from io import StringIO, BytesIO import numpy as np app = Flask(__name__) app.config[...
null
server.py
server.py
py
1,811
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 25, "usage_type": "call" }, { "api_name": "flask.render_...
582111206
from itertools import groupby import numpy as np from os import listdir, makedirs from os.path import exists, isdir, join import vtk from vtk.util.numpy_support import vtk_to_numpy, numpy_to_vtk from ramos.io.Base import DataSource, DataSink from ramos.utils.vectors import decompose from ramos.utils.vtk import mass_ma...
null
ramos/io/VTKTimeDirs.py
VTKTimeDirs.py
py
4,013
python
en
code
null
code-starcoder2
83
[ { "api_name": "ramos.io.Base.DataSource", "line_number": 13, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 18, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "vtk.vtkDataSetReader",...
59115259
import xml.etree.ElementTree as ET import urllib from bs4 import BeautifulSoup import urllib2 import ssl import json import eventlet import shelve def remove_non_ascii(text): return ''.join([i if ord(i) < 128 else ' ' for i in text]) d = shelve.open("thedictionary") bookset = set(); urllist = []; tree = ET.parse('...
null
Scrapper.py
Scrapper.py
py
1,266
python
en
code
null
code-starcoder2
83
[ { "api_name": "shelve.open", "line_number": 13, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.parse", "line_number": 16, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 16, "usage_type": "name" }, { "api_name": "urllib....
235407483
#!/usr/bin/python import datetime, openpyxl as xl, os from argparse import Namespace import code import operator, collections, re, argparse #Django Imports from django.core.management.base import BaseCommand, CommandError from django.db import transaction, connection import contacts.models as cont import backend.mode...
null
utils/management/commands/tools.py
tools.py
py
4,612
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 37, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 37, "usage_type": "attribute" }, { ...
12890024
import os from flask import send_file from openpyxl import Workbook from amdos import app from amdos.models import Time def get_stats(t: Time): wb = Workbook() wb.active.title = str(t.time_start.strftime('%d-%m-%Y %H-%M')) ws = wb.active ws['A1'] = "ID" ws['B1'] = "Type" ws['C1'] = "Seat" ...
null
amdos/routes/stats.py
stats.py
py
1,321
python
en
code
null
code-starcoder2
83
[ { "api_name": "amdos.models.Time", "line_number": 10, "usage_type": "name" }, { "api_name": "openpyxl.Workbook", "line_number": 11, "usage_type": "call" }, { "api_name": "amdos.models.Time.query.get_or_404", "line_number": 46, "usage_type": "call" }, { "api_name":...
389289717
import numpy as np from scipy.spatial import distance_matrix def pq(data, P, init_centroids, max_iter): data = np.array(data, dtype='float32') init_centroids = np.array(init_centroids, dtype='float32') N, M = data.shape K = 256 MP = int(M / P) result_centroids = np.array([]) for i in rang...
null
Project/submission.py
submission.py
py
3,700
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.spatial.distance_matrix", ...
573429282
#!/usr/bin/env python """ Created: Author: ??? Date: ??? Description: (LRP) EMIR ETC python main script. These routines consists of an underlying python script to claculate exposure times for EMIR Photometry and Spectroscopy with a wrapper (also in python) to make the scripts usable online The underlying python script...
null
etc_gui.py
etc_gui.py
py
36,461
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.use", "line_number": 68, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 74, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 76, "usage_type": "call" }, { "api_name": "optparse.OptionParser", "li...
187170802
import pygame LABELS = ['Название', 'Новая игра', 'Продолжить', 'Достижения', 'Настройки', 'Выход'] pygame.init() w, h = 800, 500 screen = pygame.display.set_mode((w, h)) clock = pygame.time.Clock() pygame.display.set_caption('Super Game') font = pygame.font.Font(None, 25) q = True while q: for event in pygame.ev...
null
Game/Game_Menu.py
Game_Menu.py
py
1,385
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.time.Cloc...
511306261
from django.urls import path from login import views urlpatterns = [ path('acceso/', views.acceso, name="acceso"), path('acceso/listadousuarios/', views.listaUsuarios, name="listadousuarios"), path('acceso/editarusuario/<str:id>/', views.editarusuario, name="editarusuario"), path('acceso/actualizarusu...
null
login/urls.py
urls.py
py
533
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "login.views.acceso", "line_number": 6, "usage_type": "attribute" }, { "api_name": "login.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path", ...
127055147
from django.core.management import BaseCommand from api.tasks import run_scrapers_nightly class Command(BaseCommand): help = 'Runs all of the scrapers. Good for setting up a development machine with new data.' def handle(self, *args, **options): self.stdout.write('Scraping Brigades and Projects fro...
null
api/management/commands/take_snapshot.py
take_snapshot.py
py
491
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.management.BaseCommand", "line_number": 6, "usage_type": "name" }, { "api_name": "api.tasks.run_scrapers_nightly", "line_number": 11, "usage_type": "call" } ]
501737759
import sqlalchemy def getDiffOfModelAgainstDatabase(model, conn, excludeTables=None): ''' Return differences of model against database. Returned object will evaluate to True if there are differences else False. ''' return SchemaDiff(model, conn, excludeTables) def getDiffOfModelAgainstModel(...
null
sqlalchemy-migrate/migrate/versioning/schemadiff.py
schemadiff.py
py
6,811
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.MetaData", "line_number": 30, "usage_type": "call" } ]
572848560
import os import pandas as pd import numpy as np import urllib.request import io import zipfile import json DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'data') def load_zip_get_file(url, file, decoder='utf-8'): """ Load a zipfile from a URL and extract a single file. Note that ...
null
pyseir/load_data.py
load_data.py
py
7,445
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_nu...
73492358
import re import urllib import httplib2 from urllib3.exceptions import TimeoutError from log import warning, stopped # MOST OF THE CODE WAS CODE TAKEN FROM YOUTUBE-DL AND OR CHANGED TO FIT HERE. CREDIT TO THE AUTHORS OF YOUTUBE-DL. # YOU WILL NEED PYTHON 3 FOR THIS. def download_website(url, Headers=None, RequestM...
null
CLIENT/PYTHON-FILES/utils.py
utils.py
py
2,331
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib.request.urlopen", "line_number": 17, "usage_type": "name" }, { "api_name": "urllib.request.Request", "line_number": 18, "usage_type": "name" }, { "api_name": "log.stopped", "line_number": 19, "usage_type": "call" }, { "api_name": "urllib.requ...
435063841
import os import sys from pygit2 import Repository from controller.main_loop import MainLoop from misc.events_dispatcher import EventsDispatcher from misc.pubsub import PubSub from config import * from drawer.drawer import Drawer class Main: def __init__(self): pubsub = PubSub() events_dispatcher...
null
controller/main.py
main.py
py
1,862
python
en
code
null
code-starcoder2
83
[ { "api_name": "misc.pubsub.PubSub", "line_number": 14, "usage_type": "call" }, { "api_name": "misc.events_dispatcher.EventsDispatcher", "line_number": 15, "usage_type": "call" }, { "api_name": "pygit2.Repository", "line_number": 17, "usage_type": "call" }, { "api_...
67963023
from django.db import models from django.contrib.auth.models import User # Create your models here. class Profile(models.Model): user = models.OneToOneField(User, blank=True, on_delete=models.CASCADE) phone = models.IntegerField(null=True, blank=True) designation = models.CharField(max_length=100, null=Tru...
null
employees/models.py
models.py
py
645
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.OneToOneField", "line_number": 6, "usage_type": "call" }, { "api_name...
150421507
###################################### # Authors: Nick Baquer, Paco Frantzen, Maximilian Meijkamp, Dario van Wagensveld, Mustafa Wahid and Andreas Zafiropoulos # TU Delft, March 2020, AE3212-II Simulation, Verification and Validation group A10 # Python Script. numericalmodel.py. retrieved from https://github.com/MaxMei...
null
numerical_tools.py
numerical_tools.py
py
1,810
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.asarray", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.vectorize", "line_n...
452811035
from toolchain import Recipe, shprint from os.path import join, exists import sh import os import fnmatch import shutil class HostSetuptools3(Recipe): depends = ["openssl", "hostpython3"] archs = ["x86_64"] url = "setuptools" def prebuild_arch(self, arch): hostpython = sh.Command(self.ctx.hos...
null
kivy-ios/recipes/host_setuptools3/__init__.py
__init__.py
py
1,243
python
en
code
null
code-starcoder2
83
[ { "api_name": "toolchain.Recipe", "line_number": 9, "usage_type": "name" }, { "api_name": "sh.Command", "line_number": 15, "usage_type": "call" }, { "api_name": "sh.curl", "line_number": 16, "usage_type": "call" }, { "api_name": "toolchain.shprint", "line_numb...
546977789
""" Write a function that merges integer from sorted files and returns an iterator file1.txt: 1 3 5 file2.txt: 2 4 6 >>> list(merge_sorted_files(["file1.txt", "file2.txt"])) [1, 2, 3, 4, 5, 6] """ from pathlib import Path from typing import Iterator, List, Union def merge_sorted_files(file_list: [str, str]) -> Iterat...
null
homework9/task1.py
task1.py
py
811
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 20, "usage_type": "call" }, { "api_name": "typing.Iterator", "line_number": 18, "usage_type": "name" } ]
610779244
'''loading and interpreting game data''' import sys from os.path import normpath from importlib import import_module from rpyg.world import * class Loader: def __init__(self, path='.', package='data'): self.path = path self.package = package self._data = None def load(self): ...
null
rpyg/data.py
data.py
py
1,428
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.insert", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.normpath", "line_number": 17, "usage_type": "call" }, { "api_name": "importlib.import_modul...
571199195
# importing required libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt from statsmodels.tsa.stattools import adfuller from statsmodels.tsa.seasonal import seasonal_decompose from statsmodels.tsa.arima_model import ARIMA from sklearn.model_selection import TimeSeriesSplit def tes...
null
WebSensor/project/testTS.py
testTS.py
py
3,704
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 18, "usage_type": "call" }, { "api_name": "matpl...
433313155
import time import miio import logging import io from datetime import timedelta from .xiaomi_cloud_connector import XiaomiCloudConnector from .const import * import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_NAME, CONF_TOKEN, CONF_USERNAME, CONF_PASSWORD from homeassistant.helpers import config_...
null
custom_components/xiaomi_cloud_map_extractor/camera.py
camera.py
py
5,583
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 16, "usage_type": "call" }, { "api_name": "voluptuous.Or", "line_number": 25, "usage_type": "call" }, { "api_name": "voluptuous.All", ...
419030188
import logging import discord from discord import RawReactionActionEvent from discord.ext import commands from cogs.utilities import credential_checks from model.model import * log = logging.getLogger(__name__) async def _get_roles_from_iterable(iterable, guild: discord.Guild): roles_to_provide = ...
null
cogs/admin.py
admin.py
py
23,231
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "discord.Guild", "line_number": 13, "usage_type": "attribute" }, { "api_name": "discord.Member", "line_number": 38, "usage_type": "attribute" }, { "api_name": "discord.Memb...
560996084
from os import path, makedirs from io import open from json import load, dump from .classes import TranslationDictionary from multiprocessing.managers import BaseManager dicFolder = "translations" def getDictionaries (manager): mainDict = {} for c in TranslationDictionary.contextNames: dictionary = ge...
null
lib/dictionaryLoader.py
dictionaryLoader.py
py
3,165
python
en
code
null
code-starcoder2
83
[ { "api_name": "classes.TranslationDictionary.contextNames", "line_number": 11, "usage_type": "attribute" }, { "api_name": "classes.TranslationDictionary", "line_number": 11, "usage_type": "name" }, { "api_name": "classes.TranslationDictionary.contextNames", "line_number": 19,...
140150669
# -*- coding: utf-8 -*- from collections import OrderedDict from django.conf import settings as django_settings from django.utils.translation import ugettext_lazy as _, get_language from django.utils.formats import date_format from django.utils.safestring import mark_safe from django.utils.translation import string_con...
null
sukutomo/magicollections.py
magicollections.py
py
43,280
python
en
code
null
code-starcoder2
83
[ { "api_name": "magi.magicollections.PrizeCollection", "line_number": 36, "usage_type": "name" }, { "api_name": "magi.magicollections.DonateCollection", "line_number": 42, "usage_type": "name" }, { "api_name": "magi.magicollections.AccountCollection", "line_number": 48, "u...
160087843
# Import necessary libraries from pyimagesearch.centroidtracker import CentroidTracker from imutils.video import VideoStream import imutils from picamera.array import PiRGBArray from picamera import PiCamera import time import numpy as np import argparse import cv2 import tkinter # Construct the argume...
null
charlie.py
charlie.py
py
8,395
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "pyimagesearch.centroidtracker.CentroidTracker", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.random.uniform", "line_number": 52, "usage_type": "call" },...
232810622
from binascii import unhexlify import requests from twisted.internet.defer import fail from dappcrowd.database import DAppCrowdDatabase from dappcrowd.tc_database import DAppCrowdTrustChainDatabase from pyipv8.ipv8.attestation.trustchain.community import TrustChainCommunity from pyipv8.ipv8.attestation.trustchain.lis...
null
dappcrowd/community.py
community.py
py
7,596
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyipv8.ipv8.attestation.trustchain.community.TrustChainCommunity", "line_number": 14, "usage_type": "name" }, { "api_name": "pyipv8.ipv8.peer.Peer", "line_number": 15, "usage_type": "call" }, { "api_name": "binascii.unhexlify", "line_number": 15, "usage_typ...