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
483443285
from flask import Flask, render_template from flask import request import MySQLdb import os db = MySQLdb.connect(host="sl-us-south-1-portal.51.dblayer.com", user="admin", passwd="OQSHOASFABTZULZH", port=19864 ) cur = db.cursor() cur.execute("SHOW DATABASES") cur.execute("USE StudentDatabase") cur.execute("SELECT * FRO...
null
flaskapp.py
flaskapp.py
py
948
python
en
code
null
code-starcoder2
76
[ { "api_name": "MySQLdb.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.request.form",...
122097611
from .models import Noticia, MensagemDeContato from django.shortcuts import render, get_object_or_404 from django.views.generic import ListView from django.http import HttpResponse from django.shortcuts import render from django.http import Http404 from django.urls import reverse from django.views.generic import FormVi...
null
app_noticias/views.py
views.py
py
1,806
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.ListView", "line_number": 11, "usage_type": "name" }, { "api_name": "models.Noticia", "line_number": 12, "usage_type": "name" }, { "api_name": "models.Noticia.objects.get", "line_number": 21, "usage_type": "call" }, { "api_name"...
65692826
""" Demonstrates using the .move_to() method. """ # Import from lab.cnc import CNC # Initialize cnc = CNC() cnc.home() # Set points to go travel to points = [(100, 200, 0), (200, 100, 100), (300, 400, 0), (400, 200, 100)] # Move CNC to points for point in points: ...
null
jetson/examples/cnc/basic_move.py
basic_move.py
py
382
python
en
code
null
code-starcoder2
76
[ { "api_name": "lab.cnc.CNC", "line_number": 10, "usage_type": "call" } ]
286939555
import numpy as np import matplotlib.pyplot as plt #载入数据 def loadDataSet(fileName): numFeat=0 dataMat,labelMat=[],[] with open(fileName,'r',encoding='utf8') as fr: lines=fr.readlines() for line in lines: lineArr=[] curLine=line.strip().split() numFeat=len(...
null
智能算法/回归/岭回归.py
岭回归.py
py
2,011
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.mat", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.mat", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 21, ...
287907775
# coding: utf-8 """ IMDb-API The IMDb-API Documentation. You need a <a href='/Identity/Account/Manage' target='_blank'><code>API Key</code></a> for testing APIs.<br/><a class='link' href='/API'>Back to API Tester</a> # noqa: E501 OpenAPI spec version: 1.5 Contact: support@imdb-api.com Generated ...
null
swagger_client/models/wikipedia_data.py
wikipedia_data.py
py
9,960
python
en
code
null
code-starcoder2
76
[ { "api_name": "six.iteritems", "line_number": 330, "usage_type": "call" }, { "api_name": "pprint.pformat", "line_number": 355, "usage_type": "call" } ]
544262392
import numpy as np from skimage.segmentation import find_boundaries from skimage.morphology import binary_dilation, disk def make_boundary_image(L, A, thickness=1, color=(255,255,85), rescale_hist=True): ''' Marks borders of segmentation on the original image so that borders can be evaluated. Similar to sk...
null
imagemks/visualization/borders.py
borders.py
py
1,415
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.stack", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.interp", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.amin", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.amax", "line_number": 3...
478286374
#!/usr/bin/python import telebot import logging import os import subprocess logger = telebot.logger telebot.logger.setLevel(logging.ERROR) # Outputs debug messages to console. TOKEN = '' bot = telebot.TeleBot(TOKEN) updates = bot.get_updates() updates = bot.get_updates(1234,100,20) def stat(text): cmd = text.spli...
null
teleapprestart.py
teleapprestart.py
py
1,138
python
en
code
null
code-starcoder2
76
[ { "api_name": "telebot.logger", "line_number": 7, "usage_type": "attribute" }, { "api_name": "telebot.logger.setLevel", "line_number": 8, "usage_type": "call" }, { "api_name": "telebot.logger", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging....
483481424
from collections import OrderedDict s = input().split() count = OrderedDict() # init for s_i in s: count[s_i] = 0 # count for s_i in s: count[s_i] += 1 for k, v in count.items(): print(k, v)
null
paiza/tC02.py
tC02.py
py
206
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.OrderedDict", "line_number": 3, "usage_type": "call" } ]
435721061
import spacy import random import pandas as pd import requests import wikipedia from bs4 import BeautifulSoup from flask import Flask, request from datetime import datetime app = Flask(__name__) @app.route('/') def home(): return HOME_HTML HOME_HTML = """ <html><body> <h2>Welcome to A.I. Testing<br>...
null
torah_test.py
torah_test.py
py
5,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 37, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 37, "usage_type": "attribute" }, { "api_name": "flask.requ...
326601117
import tensorflow as tf import numpy as np import sys from PIL import Image from keras.utils import np_utils def LoadVGG16(): return tf.keras.applications.vgg16.VGG16(include_top=False, weights='imagenet', input_shape=(224,224,3)) def CheckImgData(img): print(img.format, img.size, img.mode) img.show() def BuildMo...
null
vgg16/transfer_vgg16.py
transfer_vgg16.py
py
1,274
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.keras.applications.vgg16.VGG16", "line_number": 8, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.models.Sequential", "line_number": 16, "usage_type": "call...
215421800
from keras.models import Model from keras.layers import Input, Dense, Embedding, SpatialDropout1D, concatenate from keras.layers import GRU, Bidirectional, GlobalAveragePooling1D, GlobalMaxPooling1D from keras.optimizers import Adam from keras.preprocessing import text, sequence import numpy as np def get_model(op...
null
sentiment_analysis/models/PooledGru.py
PooledGru.py
py
1,495
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.layers.Input", "line_number": 13, "usage_type": "call" }, { "api_name": "keras.layers.Embedding", "line_number": 14, "usage_type": "call" }, { "api_name": "keras.layers.SpatialDropout1D", "line_number": 16, "usage_type": "call" }, { "api_name"...
652355172
#!/usr/bin/env python # -*- coding: utf-8 -*- from conf import headers import requests import re from conf import proxies #proxies = {"http": "http://127.0.0.1:8080"} from conf import host def utf2gbk(istring): return istring #return istring.decode("utf8").encode("gbk") def login2evalu(zjh, zgpj): sessio...
null
vendor/evaluation.py
evaluation.py
py
1,892
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.Session", "line_number": 16, "usage_type": "call" }, { "api_name": "conf.host", "line_number": 17, "usage_type": "name" }, { "api_name": "conf.headers", "line_number": 17, "usage_type": "name" }, { "api_name": "conf.proxies", "line_numb...
609783032
# uses the curses library to make a terminal screen that allows # the user to communicate with Atlas Scientific boards import curses, curses.ascii # needed to allow seperate terminal displays import serial # required for communication with boards import time import os import glob import subprocess from time import st...
null
pH_to_adafruit.py
pH_to_adafruit.py
py
1,855
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.system", "line_number": 13, "usage_type": "call" }, { "api_name": "os.system", "line_number": 14, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 17, "usage_type": "call" }, { "api_name": "Adafruit_IO.Client", "line_number":...
514403464
import numpy as np import os, glob from keras.models import Sequential from keras.layers.convolutional import Conv2D, Convolution2D from keras.layers.core import Activation, Dropout, Flatten, Dense from keras.layers.pooling import MaxPooling2D # 카테고리 지정하기 #categories = ["chair", "camera", "butterfly", "elephant"] cate...
null
imageHandle/test_image/caltech101_keras_02.py
caltech101_keras_02.py
py
1,969
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.load", "line_number":...
467844391
from Engine3D import Engine from GeometricShapes import Sphere import pygame from random import uniform from opensimplex import OpenSimplex from data.vector import Vector b_map = { (10, 10, 166): [-1, -.75], # Water 3 (34, 34, 189): [-.75, -.5], # Water 2 (67, 67, 222): [-.5, -.25], # Water 1 ...
null
Sample7.py
Sample7.py
py
1,861
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.display.set_mode", "line_number": 33, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 33, "usage_type": "attribute" }, { "api_name": "Engine3D.Engine", "line_number": 34, "usage_type": "call" }, { "api_name": "Geometric...
526450817
import hunspell import pandas as pd import nltk import sys train = pd.read_csv('train.csv.zip',encoding='utf-8').iloc[::2] test = pd.read_csv('test.csv.zip',encoding='utf-8').iloc[::2] data = pd.concat([train,test]) data['comment_text'] = data['comment_text'].fillna('') tknzr = nltk.TreebankWordTokenizer() data['tweet...
null
toxi_comments/spell_check.py
spell_check.py
py
3,023
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 8, "usage_type": "call" }, { "api_name": "nltk.TreebankWordTokenizer...
414454737
from firebase import * # from attentionguage import gauge from flask import Flask, request, make_response from flask import render_template import pyautogui from time import gmtime, strftime from threading import Event, Thread import sys, os import tempfile import uuid from fastai.tabular import * import numpy as np im...
null
app/flask-screenshot.py
flask-screenshot.py
py
4,135
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getcwd", "line_number": 22, "usage_type": "call" }, { "api_name": "threading.Event", "line_number": 33, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 37, "usage_type": "call" }, { "api_name": "flask.Flask", "line_nu...
334762051
# -*- coding: utf-8 -*- """ Created on Mon Apr 12 17:31:34 2021 @author: Sanket """ import boto3 ec2=boto3.resource('ec2') for instance in ec2.instances.all(): print( "Id: {0}\nPlatform: {1}\n Type: {2}\n Public Ipv4: {3}\nAMI: {4}\nState: {5}\n".format( instance.id,instance.platform...
null
que2ec2.py
que2ec2.py
py
421
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto3.resource", "line_number": 10, "usage_type": "call" } ]
426428004
#!/usr/bin/env python # coding: utf-8 import numpy as np import math import vertica_python import psycopg2 import datetime import time import sys import os import shutil import argparse import json from matplotlib import pyplot as plt import logging logging.basicConfig( filename='/tmp/mldev-vert-model-creator.lo...
null
scripts/get-vert-metrics.py
get-vert-metrics.py
py
8,762
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 21, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.argv", "li...
598500456
# WindowNode is a prototype 2 player view of a single map by @mr_w # This file is a demonstration of WindowNode # # map templated from jsbain # https://gist.github.com/jsbain/7a1a3c1b0d28c752cba8f5420255dfe6 # basic scrolling example was by Dalorbi on the forums at: # http://omz-software.com/pythonista/forums/discu...
null
mapgame2p.py
mapgame2p.py
py
18,127
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.choice", "line_number": 47, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 56, "usage_type": "call" }, { "api_name": "random.random", "line_number": 76, "usage_type": "call" }, { "api_name": "numpy.clip", "line_numb...
141526437
#!/usr/bin/env python3 from flask import Flask, render_template, request, redirect, url_for, jsonify from flask_sqlalchemy import SQLAlchemy from sqlalchemy import Table, Column, Integer, ForeignKey from sqlalchemy.orm import relationship import json import sys app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI...
null
app.py
app.py
py
2,909
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.ForeignKey", "line_number": 26, "usage_type": "call" }, { "api_name": "flask.re...
516076362
import os import numpy as np import pandas as pd from tqdm import tqdm import logging from datetime import datetime from src.pipeline.streamPipeline import StreamPipeline from dataset.randomstream import create_random_stream from util.util import get_stream, get_norms, get_analyze_pd, get_rList,get_cList # DATADIR ='/...
null
symnorm/pipeline/sketchPipeline.py
sketchPipeline.py
py
5,437
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.random.manual_seed", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.random", "line_number": 18, "usage_type": "attribute" }, { "api_name": "src.pipeline.streamPipeline.StreamPipeline", "line_number": 20, "usage_type": "name" }, { ...
580205493
import pytest import dice_ml from dice_ml.utils import helpers class TestBaseModelLoader: def _get_model(self, backend): ML_modelpath = helpers.get_adult_income_modelpath(backend=backend) m = dice_ml.Model(model_path=ML_modelpath, backend=backend) return m def test_tf(self): ...
null
tests/test_model.py
test_model.py
py
1,126
python
en
code
null
code-starcoder2
76
[ { "api_name": "dice_ml.utils.helpers.get_adult_income_modelpath", "line_number": 9, "usage_type": "call" }, { "api_name": "dice_ml.utils.helpers", "line_number": 9, "usage_type": "name" }, { "api_name": "dice_ml.Model", "line_number": 10, "usage_type": "call" }, { ...
587004727
import json import random import translate import string import secrets import pandas as pd from ast import literal_eval from datetime import datetime import os from tqdm import tqdm punct = '!"#$%&\'()*+-/:;<=>?@[\\]^_`{|}~' def cleaning(txtFile): cleaned = [] for line in txtFile: if line != '\n': ...
null
convert_from_sample.py
convert_from_sample.py
py
5,860
python
en
code
null
code-starcoder2
76
[ { "api_name": "tqdm.tqdm", "line_number": 45, "usage_type": "call" }, { "api_name": "secrets.token_hex", "line_number": 70, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 101, "usage_type": "call" }, { "api_name": "json.load", "line_number":...
152483947
import argparse import json def build_parser(): parser = argparse.ArgumentParser() parser.add_argument('-coco', '--coco-file', required=True, type=str) parser.add_argument('-out', '--out-file', required=True, type=str) return parser def get_new_categories(old_categories): new_categories = [{"sup...
null
retinanet/correct_annotations.py
correct_annotations.py
py
2,634
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "json.load", "line_number": 55, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 68, "usage_type": "call" } ]
630084261
from django.shortcuts import render # Create your views here. from rest_framework.views import APIView from orders.models import OrderInfo from rest_framework.response import Response from rest_framework import status from alipay import AliPay from mall import settings from pay.models import Payment # 支付订单 class Pay...
null
meiduo04/mall/apps/pay/views.py
views.py
py
3,328
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.views.APIView", "line_number": 14, "usage_type": "name" }, { "api_name": "orders.models.OrderInfo.objects.get", "line_number": 19, "usage_type": "call" }, { "api_name": "orders.models.OrderInfo.objects", "line_number": 19, "usage_type": "attr...
84415965
import os import time import markovify import tweepy import random from apscheduler.schedulers.blocking import BlockingScheduler # schedule tweets for every 6 hours sched = BlockingScheduler() @sched.scheduled_job('interval', minutes=360) def timed_job(): # authenticate to twitter consumer_key = 'xxxx' co...
null
bot.py
bot.py
py
1,332
python
en
code
null
code-starcoder2
76
[ { "api_name": "apscheduler.schedulers.blocking.BlockingScheduler", "line_number": 9, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 18, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 20, "usage_type": "call" }, { "a...
521514891
#!/usr/bin/env python3 """ Report generator """ import os import sys from yaml import load, dump try: from yaml import CLoader as Loader, CDumper as Dumper except ImportError: from yaml import Loader, Dumper import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from han...
null
reports/2015-06/make_report.py
make_report.py
py
4,799
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "numpy.arange", ...
92567574
import numpy as np import matplotlib.pyplot as pl import os import sys data_GR = np.loadtxt("./GR_monopole.dat") data_F5 = np.loadtxt("./F5_monopole.dat") data_GR_resc = np.loadtxt("./GR_rescaled_test.dat") #data = np.loadtxt("GR_1fold.txt") pl.title("GR -> F5 attempt") pl.loglog(data_GR[:,0], data_GR[:,1], lab...
null
plots/rescaling/compare.py
compare.py
py
895
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.loadtxt", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", ...
406604691
import functools from torch import nn from tools.esr import RRDB, make_layer class RRDBNet(nn.Module): def __init__(self, in_nc=3, out_nc=3, nf=64, nb=23, gc=32): super(RRDBNet, self).__init__() RRDB_f = functools.partial(RRDB, nf=nf, gc=gc) self.conv_first = nn.Conv2d(in_nc, nf, 3, 1, 1,...
null
models/rrdbnet.py
rrdbnet.py
py
1,190
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "functools.partial", "line_number": 9, "usage_type": "call" }, { "api_name": "tools.esr.RRDB", "li...
623642361
from django.db.models import F, Sum from usaspending_api.accounts.serializers import FederalAccountByObligationSerializer from usaspending_api.common.exceptions import InvalidParameterException from usaspending_api.common.views import DetailViewSet from usaspending_api.financial_activities.models import FinancialAccou...
null
usaspending_api/accounts/views/federal_obligations.py
federal_obligations.py
py
2,502
python
en
code
null
code-starcoder2
76
[ { "api_name": "usaspending_api.common.views.DetailViewSet", "line_number": 10, "usage_type": "name" }, { "api_name": "usaspending_api.accounts.serializers.FederalAccountByObligationSerializer", "line_number": 12, "usage_type": "name" }, { "api_name": "usaspending_api.common.excep...
497697067
from .GraphicWindowSpectrum import Ui_GraphicWindowSpectrum from pyqtgraph import SignalProxy, LinearRegionItem, InfiniteLine from pyqtgraph.Point import Point from numpy import sin, cos, fft, arange, pi, savetxt, linspace, zeros from scipy import signal from scipy.signal import square, sawtooth, gausspulse from scipy....
null
src/main/python/utils/GraphicWindowSpectrumLogic.py
GraphicWindowSpectrumLogic.py
py
4,263
python
en
code
null
code-starcoder2
76
[ { "api_name": "GraphicWindowSpectrum.Ui_GraphicWindowSpectrum", "line_number": 13, "usage_type": "name" }, { "api_name": "GraphicWindowSpectrum.Ui_GraphicWindowSpectrum.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "GraphicWindowSpectrum.Ui_GraphicWindowSpec...
20858358
""" :filename: heuristics.py :summary: Stores all heuristic and evaluation function related functions. :authors: Akira Wang (913391), Callum Holmes (899251) """ ########################### IMPORTS ########################## # Standard modules from math import inf from copy import deepcopy from collections import defa...
null
Chexers/Part B/code/Chexers_STATE/algorithms/heuristics.py
heuristics.py
py
6,729
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 32, "usage_type": "call" }, { "api_name": "state.exits", "line_number": 32, "usage_type": "attribute" }, { "api_name": "state.PLAYER_NAMES", "line_number": 32, "usage_type": "name" }, { "api_name": "state.pieces", "l...
492436949
import numpy as np import pickle import datetime import random import matplotlib.pyplot as plt from sklearn.metrics import roc_auc_score from torch.utils.data import DataLoader from sklearn.metrics import precision_score from sklearn.metrics import recall_score from sklearn.metrics import f1_score import torch import t...
null
BRL/tension_DI/load_data.py
load_data.py
py
4,379
python
en
code
null
code-starcoder2
76
[ { "api_name": "dgl.batch", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line_number...
376891034
import numpy as np import matplotlib.pyplot as plt from numpy import newaxis as na import multiprocessing import threading import time def smart_start(XX, YY, ZZ, N_WT, min_space, radius=None, random_pct=0, plot=False, seed=None): """Selects the a number of gridpoints (N_WT) in the grid defined by x and y, wh...
null
topfarm/utils.py
utils.py
py
3,971
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.sort", "line_number": 49...
65689204
import operator from django.contrib import comments from django.contrib.comments import signals from django.contrib.comments.views.comments import CommentPostBadRequest from django.utils.html import escape from django.template import RequestContext from django.shortcuts import get_object_or_404, render_to_response fro...
null
ella_comments/views.py
views.py
py
12,036
python
en
code
null
code-starcoder2
76
[ { "api_name": "ella.core.views.get_templates_from_publishable", "line_number": 26, "usage_type": "call" }, { "api_name": "ella.core.custom_urls.resolver.reverse", "line_number": 30, "usage_type": "call" }, { "api_name": "ella.core.custom_urls.resolver", "line_number": 30, ...
129248633
import numpy as np import math import copy from sklearn.model_selection import KFold # calculating the mean def mean(data_set): np_arr = np.array(data_set).astype(np.float64) return np.mean(np_arr, axis=0) # calculating the standard deviation def std_dev(data_set): np_arr = np.array(data_set).a...
null
project3/Code/Naive_Bayes/naive_bayes.py
naive_bayes.py
py
7,101
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.mean", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number...
575020405
# uncompyle6 version 3.7.4 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /Users/shimul/Projects/django-hyper-editor/hypereditor/settings.py # Compiled at: 2019-04-10 07:52:53 # Size of source mod 2**32: 782 bytes from django.conf impor...
null
pycfiles/hypereditor-0.1.0-py3-none-any/settings.cpython-36.py
settings.cpython-36.py
py
846
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.apps.apps.is_installed", "line_number": 11, "usage_type": "call" }, { "api_name": "django.apps.apps", "line_number": 11, "usage_type": "name" }, { "api_name": "hypereditor.utils.merge_dict", "line_number": 14, "usage_type": "call" }, { "api_n...
83743981
#!/usr/bin/env python import datetime import re from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from bumscrape.items import BumscrapeItem def get_search_url(subdomain, query): return ("http://%s.craigslist.org/search?" + "areaID=1&subAreaID=&query=%s&catAbb=sss") %...
null
bumscrape/spiders/craigslist.py
craigslist.py
py
2,468
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.spider.BaseSpider", "line_number": 19, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 32, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 37, "usage_type": "call" }, { "api_name": "datetime.datetime.strp...
278873076
from helper import wait_until, mail_indexes_of from pages.base import Page class MailerMainPage(Page): def __init__(self, driver): self.delete_xpath = "//span[@class='mail-Toolbar-Item-Text js-toolbar-item-title js-toolbar-item-title-delete']" self.compose_email_xpath = "//div[@class='mail-Compose...
null
pages/mailer_main_page.py
mailer_main_page.py
py
2,936
python
en
code
null
code-starcoder2
76
[ { "api_name": "pages.base.Page", "line_number": 5, "usage_type": "name" }, { "api_name": "helper.wait_until", "line_number": 40, "usage_type": "call" }, { "api_name": "helper.mail_indexes_of", "line_number": 40, "usage_type": "call" }, { "api_name": "helper.mail_i...
167350989
# Ignote TF Deprecation warnings (for TF < 2) & User Warnings import tensorflow as tf if type(tf.contrib) != type(tf): tf.contrib._warning = None tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) import warnings warnings.simplefilter("ignore", UserWarning) import torch import numpy as np import gym from s...
null
pkg_SAC.py
pkg_SAC.py
py
7,056
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.contrib", "line_number": 3, "usage_type": "attribute" }, { "api_name": "tensorflow.compat.v1.logging.set_verbosity", "line_number": 4, "usage_type": "call" }, { "api_name": "tensorflow.compat", "line_number": 4, "usage_type": "attribute" }, {...
606377524
import graphene from django.db.models import Q from .types import HumanType, Gender from .models import Human from .resolvers import resolver_human, resolver_humans, resolver_create_human, resolver_update_human, resolver_delete_human class Query(graphene.ObjectType): humans = graphene.List( HumanType, ...
null
cookbook/cookbook/swapi/schema.py
schema.py
py
2,386
python
en
code
null
code-starcoder2
76
[ { "api_name": "graphene.ObjectType", "line_number": 8, "usage_type": "attribute" }, { "api_name": "graphene.List", "line_number": 9, "usage_type": "call" }, { "api_name": "types.HumanType", "line_number": 10, "usage_type": "argument" }, { "api_name": "graphene.Str...
180087597
import pandas as pd from sklearn.preprocessing import StandardScaler from sklearn.svm import SVC from sklearn.pipeline import Pipeline from sklearn.ensemble import RandomForestClassifier # Slides and resources can be found at: https://github.com/cianadeveau/BIOF509-Final # Download Basic School Stats and Basic Oppone...
null
04fc554f169b8720f3d8822f2bdd8762/NCAA.py
NCAA.py
py
4,728
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_excel", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 64, "usage_type": "call" }, { "api_name": "pandas.DataFram...
348547186
# coding: utf-8 import six from huaweicloudsdkcore.sdk_response import SdkResponse from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class CreateRecordRuleResponse(SdkResponse): """ Attributes: openapi_types (dict): The key is attribute name and th...
null
huaweicloud-sdk-cloudrtc/huaweicloudsdkcloudrtc/v2/model/create_record_rule_response.py
create_record_rule_response.py
py
10,704
python
en
code
null
code-starcoder2
76
[ { "api_name": "huaweicloudsdkcore.sdk_response.SdkResponse", "line_number": 9, "usage_type": "name" }, { "api_name": "six.iteritems", "line_number": 287, "usage_type": "call" }, { "api_name": "six.PY2", "line_number": 313, "usage_type": "attribute" }, { "api_name"...
199066482
from django.shortcuts import render_to_response from django.http import JsonResponse, HttpResponse import csv import locale from apps.listings_by_region.models import GlobalClassification from .utils import filter_data def index(request): empty_maker = lambda x, y: 'empty' if len(x) == 1 and x[0] == y else x ...
null
apps/granular_screener/views.py
views.py
py
12,479
python
en
code
null
code-starcoder2
76
[ { "api_name": "apps.listings_by_region.models.GlobalClassification.objects.all", "line_number": 13, "usage_type": "call" }, { "api_name": "apps.listings_by_region.models.GlobalClassification.objects", "line_number": 13, "usage_type": "attribute" }, { "api_name": "apps.listings_by...
381945639
from itertools import islice import re def parse(text): return [ tuple(map(int, re.findall(r"([\-\d]+)", line))) for line in text.strip().split("\n") ] def h(x): return x[1] + x[3] * 2 + x[5] * 30 + x[7] ** 200 def search(bp): print(bp) ( _, ore_cost, cl...
null
misc/advent/2022/19/d.py
d.py
py
3,952
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.findall", "line_number": 7, "usage_type": "call" }, { "api_name": "itertools.islice", "line_number": 35, "usage_type": "call" } ]
526701849
from mpi4py import MPI import sys import numpy as np import matplotlib.pyplot as plt import time t0 = time.time() comm = MPI.COMM_WORLD size = MPI.COMM_WORLD.Get_size() rank = MPI.COMM_WORLD.Get_rank() name = MPI.Get_processor_name() def circle(theta, omega, K): return (theta + omega - K * np.sin(2 * np.pi * th...
null
Project/copy_tongue.py
copy_tongue.py
py
1,996
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 7, "usage_type": "call" }, { "api_name": "mpi4py.MPI.COMM_WORLD", "line_number": 9, "usage_type": "attribute" }, { "api_name": "mpi4py.MPI", "line_number": 9, "usage_type": "name" }, { "api_name": "mpi4py.MPI.COMM_WORLD.Ge...
174664863
import dateutil from custom.succeed.reports import OUTPUT_DATE_FORMAT, CM2 from django.utils.translation import ugettext as _, ugettext_noop from custom.succeed.utils import get_form_dict EMPTY_FIELD = "" class PatientInfoDisplay(object): def __init__(self, case): self.case = case super(PatientIn...
null
custom/succeed/reports/patient_Info.py
patient_Info.py
py
9,209
python
en
code
null
code-starcoder2
76
[ { "api_name": "dateutil.parser.parse", "line_number": 18, "usage_type": "call" }, { "api_name": "dateutil.parser", "line_number": 18, "usage_type": "attribute" }, { "api_name": "django.utils.translation.ugettext", "line_number": 20, "usage_type": "call" }, { "api_...
260301388
import os from collections import defaultdict from typing import Dict, List import numpy as np import orjson import pandas as pd from numba import types from numba.typed import Dict as TypedDict from numba.typed import List as TypedList from .common import ( add_and_sort, create_and_sort, sort_dict_by_key...
null
ranx/data_structures/run.py
run.py
py
10,158
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Dict", "line_number": 45, "usage_type": "name" }, { "api_name": "numba.typed.Dict.empty", "line_number": 48, "usage_type": "call" }, { "api_name": "numba.typed.Dict", "line_number": 48, "usage_type": "name" }, { "api_name": "numba.types.unico...
110133961
#-*- coding: utf-8 -*- import maya.cmds as rig def resetClusterPos(): CLS = rig.ls(sl = True) if CLS: for CL in CLS: CLSShape = rig.listRelatives(CL,s = True)[0] pos = rig.xform(CL,q = True,piv = True,ws = True) rig.setAttr(CLSShape+'.originX',pos[0]) rig...
null
OLD/COMMON/set/RIG/tools/base.py
base.py
py
607
python
en
code
null
code-starcoder2
76
[ { "api_name": "maya.cmds.ls", "line_number": 5, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": 5, "usage_type": "name" }, { "api_name": "maya.cmds.listRelatives", "line_number": 8, "usage_type": "call" }, { "api_name": "maya.cmds", "line_num...
110705501
from model import Model import itertools import keras.optimizers import numpy as np from utils import get_train_test, reshape_data from paths import get_dummy_path, get_small_path class GridSearch: def __init__(self, path, input_shape, verbose=1, **kwargs): self.input_shape = input_shape self.verb...
null
gridsearch.py
gridsearch.py
py
3,442
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.reshape_data", "line_number": 17, "usage_type": "call" }, { "api_name": "utils.get_train_test", "line_number": 17, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 21, "usage_type": "call" }, { "api_name": "model.Model...
100660593
import aiohttp import asyncio from bs4 import BeautifulSoup async def bilgicek(session, url): async with session.get(url) as response: return await response.text() async def basla(): async with aiohttp.ClientSession() as session: html = await bilgicek(session, 'https://www.doviz.com/') ...
null
doviz.py
doviz.py
py
1,498
python
en
code
null
code-starcoder2
76
[ { "api_name": "aiohttp.ClientSession", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 34, "usage_type": "call" } ]
321267777
# -*- coding: utf-8 -*- ''' Written by Daniel M. Aukes and CONTRIBUTORS Email: danaukes<at>asu.edu. Please see LICENSE for full license. ''' #from setuptools import setup from cx_Freeze import setup, Executable import sys import shutil import os import importlib import idealab_tools.setup_tools as st sys.path.append('...
null
setup.py
setup.py
py
4,340
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": "shutil.rmtree", "line_number": 18, "usage_type": "call" }, { "api_name": "shutil.rmtree", "line...
145424040
from lib.config.config import FLAGS, KITTI_classes, RGB_list import numpy as np import os import cv2 class kitti: def __init__(self): self.batch_size = FLAGS.batch_size self.indexes = {"train": 0, "val": 0, "test": 0} self.img_name_list = [] for img_name in os.listdi...
null
lib/datasets/kitti.py
kitti.py
py
2,673
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.config.config.FLAGS.batch_size", "line_number": 11, "usage_type": "attribute" }, { "api_name": "lib.config.config.FLAGS", "line_number": 11, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_na...
511642068
#!/usr/bin/env python3 import os import datetime from flask import Flask, request, abort RESULT_FOLDER = 'resultados' LOGFILE = 'log.txt' app = Flask(__name__) def salvar_arquivo(nome, result): os.makedirs(RESULT_FOLDER, exist_ok=True) filename = os.path.join(RESULT_FOLDER, nome) + '.csv' with open(file...
null
scripts/server.py
server.py
py
817
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, ...
164360250
# Karl Gemayel # Georgia Institute of Technology # # Created: import os import logging import argparse import pandas as pd from typing import * import random # noinspection PyUnresolvedReferences from Bio.Seq import Seq import pathmagic # add path to custom library # Custom library imports im...
null
code/python/driver/create_hq_start_dataset.py
create_hq_start_dataset.py
py
9,126
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "sbsp_general.Environment", "line_number": 56, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 61, "usage_type": "call" }, { "api_name": "...
109931460
from enum import Enum from rest_framework import serializers from rest_framework.response import Response def error_response(serializer, key='UNKNOWN', code=400): """Return an HTTP response with the error.""" return Response(serializer(key).data, status=code) def error_serializer(name=None, erro...
null
backend/backend/api_v2/error_serializer.py
error_serializer.py
py
2,247
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.response.Response", "line_number": 9, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 30, "usage_type": "argument" }, { "api_name": "rest_framework.serializers.Serializer", "line_number": 46, "usage_type": "attribute" }, ...
481772711
from django.shortcuts import render from django.urls import reverse_lazy from django.views.generic import DetailView, ListView, CreateView, UpdateView, DeleteView from books.forms import BookModelForm, AuthorModelForm from books.models import * def index(request): num_books = Book.objects.all().count() books...
null
books/views.py
views.py
py
4,273
python
en
code
null
code-starcoder2
76
[ { "api_name": "books.forms", "line_number": 11, "usage_type": "name" }, { "api_name": "books.forms", "line_number": 15, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 17, "usage_type": "call" }, { "api_name": "django.views.generic....
366279656
import cv2 import numpy #face_cascade = cv2.CascadeClassifier('D:/programfile/opencv/opencv/sources/data/haarcascades/haarcascade_frontalface_default.xml') #face_cascade = cv2.CascadeClassifier('D:/programfile/opencv/opencv/sources/data/haarcascades/haarcascade_fullbody.xml') face_cascade = cv2.HOGDescriptor() face_ca...
null
facial_recognition.py
facial_recognition.py
py
1,396
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.HOGDescriptor", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.HOGDescriptor_getDefaultPeopleDetector", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 9, "usage_type": "call" }, { "api_na...
567721106
from django.http import Http404 from django.template.response import TemplateResponse from django.views.decorators.csrf import csrf_protect @csrf_protect def main(request, job_id=None, template_name='job/main.html'): if request.method == 'POST': job_id = request.POST.get('job_id', None) if job_id == None: ...
null
website/job/views.py
views.py
py
449
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.Http404", "line_number": 10, "usage_type": "name" }, { "api_name": "django.template.response.TemplateResponse", "line_number": 12, "usage_type": "call" }, { "api_name": "django.views.decorators.csrf.csrf_protect", "line_number": 5, "usage_type":...
32003545
""" Total ASEAN countries population for the years 2005 to 2014 """ # importing the required libraries import csv from collections import defaultdict import numpy as np import matplotlib.pyplot as plt def total_asean_population(): """ Total ASEAN countries population for the years 2005 to 2014 """ wit...
null
total_asean_population.py
total_asean_population.py
py
2,695
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.DictReader", "line_number": 16, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.arange", ...
36531779
import torch.nn as nn import time import sys from utils import * from evaluate import evaluate from SASRecModules import * class SASRec(nn.Module): def __init__(self, hidden_size, item_num, state_size, dropout, device, num_heads=1): super(SASRec, self).__init__() self.state_size = state_size ...
null
RetailRocket/SASRec.py
SASRec.py
py
5,995
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.nn.Dropout", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
450364311
import argparse import os import sys import cv2 as cv import numpy as np #################### Preparation #################### # Parsing variables parser = argparse.ArgumentParser() parser.add_argument( 'filename', help='Image filename used for conversion and saving.', type=str ) args = parser.parse_args...
null
computervision/03-unsharp_masking.py
03-unsharp_masking.py
py
1,517
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.exit", "l...
355349378
#!/usr/bin/python # encoding: utf-8 import math import numpy import scipy import scipy.signal import matplotlib.pyplot as plt ''' Non-coherent 1-bit differential phase detection ''' class DiffPhaseDetect: def __init__(self, bps=9600, # Bits per second overs...
null
detector.py
detector.py
py
2,558
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.pi", "line_number": 35, "usage_type": "attribute" }, { "api_name": "numpy.angle", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 36, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", ...
223306743
""" File dialog for opening/importing/referencing """ from PySide2 import QtCore from PySide2 import QtGui from PySide2 import QtWidgets from shiboken2 import wrapInstance import maya.OpenMaya as om import maya.OpenMayaUI as omui import maya.cmds as mc def mayaMainWindow(): """ Return the Maya main window as...
null
Maya/OpenImportDialog/openImportDialog.py
openImportDialog.py
py
4,926
python
en
code
null
code-starcoder2
76
[ { "api_name": "maya.OpenMayaUI.MQtUtil.mainWindow", "line_number": 18, "usage_type": "call" }, { "api_name": "maya.OpenMayaUI.MQtUtil", "line_number": 18, "usage_type": "attribute" }, { "api_name": "maya.OpenMayaUI", "line_number": 18, "usage_type": "name" }, { "a...
199652931
# -*- coding: utf-8 -*- import requests from bs4 import BeautifulSoup import sqlite3 import re from urllib.parse import urljoin import dateparser import sys import os import traceback __location__ = os.path.realpath( os.path.join( os.getcwd(), os.path.dirname(__file__) ) ) def find_parent(e...
null
automation/abstimmungsparolen/scraper.py
scraper.py
py
5,819
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.realpath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number...
197194528
# -*- coding: utf-8 -*- from EtudeDQN.dqn_agent import DQNAgent from MAPE.multiagent.environment import MultiAgentEnv import MAPE.multiagent.scenarios as scenarios import torch import numpy as np def make_env(scenario_name='simple_tag'): scenario = scenarios.load(scenario_name + '.py').Scenario() world = sc...
null
EtudeDQN/test_mape.py
test_mape.py
py
2,928
python
en
code
null
code-starcoder2
76
[ { "api_name": "MAPE.multiagent.scenarios.load", "line_number": 12, "usage_type": "call" }, { "api_name": "MAPE.multiagent.scenarios", "line_number": 12, "usage_type": "name" }, { "api_name": "MAPE.multiagent.environment.MultiAgentEnv", "line_number": 15, "usage_type": "ca...
23567975
# This module contains a single overworld area, consisting of several Tiles. # It manages the tiles, communicates with them and holds several booleans # determining whether the user can use certain overworld actions. from readdata import AREADATA from typing import List from Tile import Tile class Area: def __ini...
null
Area.py
Area.py
py
2,877
python
en
code
null
code-starcoder2
76
[ { "api_name": "readdata.AREADATA", "line_number": 27, "usage_type": "name" }, { "api_name": "Tile.Tile", "line_number": 42, "usage_type": "call" }, { "api_name": "Tile.Tile", "line_number": 45, "usage_type": "call" }, { "api_name": "Tile.Tile", "line_number": ...
32629174
# uncompyle6 version 3.7.4 # Python bytecode 3.8 (3413) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: D:\djangoarticle\src\djangoarticle\migrations\0005_auto_20200330_0747.py # Compiled at: 2020-03-29 22:17:42 # Size of source mod 2**32: 1204 bytes from django.db ...
null
pycfiles/djangoarticle-1.0.20.2-py3-none-any/0005_auto_20200330_0747.cpython-38.py
0005_auto_20200330_0747.cpython-38.py
py
1,303
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterModelOptions", "line_number": 15, "usage_type": "call"...
30373088
import json import requests from .exceptions import Bugger def search(keyword, sort_by='stars', page=1): cache_path = 'github.{0}.{1}.{2}'.format(keyword, sort_by, page) try: response = requests.get( 'https://api.github.com/legacy/repos/search/:{0}' '?sort={1}&start_page={2}'.f...
null
talk/github.py
github.py
py
944
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "exceptions.Bugger", "line_number": 19, "usage_type": "call" }, { "api_name": "exceptions.Bugger", "line_number": 29, "usage_type": "call" }, { "api_name": "json.loads", "lin...
479128596
# There is an integer array nums sorted in ascending order (with distinct # values). # # Prior to being passed to your function, nums is possibly rotated at an # unknown pivot index k (1 <= k < nums.length) such that the resulting array is [nums[k] # , nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (...
null
leetcode/editor/en/[33]Search in Rotated Sorted Array.py
[33]Search in Rotated Sorted Array.py
py
2,129
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 44, "usage_type": "name" } ]
467916081
# -*- coding: utf-8 -*- from flask import Flask, render_template import requests import json app = Flask(__name__) from utils import get_names def calc_attend_grade(data): rate = data['attend']/float(len(data['attendance'])) if 0.95 < rate: return 'A+' elif 0.90 < rate: return 'A' el...
null
app.py
app.py
py
1,266
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 29, "usage_type": "call" }, { "api_name": "utils.get_names", "line_number": 29, "usage_type": "call" }, { "api_name": "json.load", "lin...
12361920
from wemark.commons.response import Schema from django.conf import settings TIME_HOUR_UNIT = 24 TIME_MINUTE_UNIT = 60 TIME_SECOND_UNIT = 60 TIME_MILLIS_UNIT = 1000 CLIENT_ID = 'dd055109e309a4c8' CLIENT_SECRET = '83eb90109062909b03ceb2efa13016f9' CLIENT_CALLBACK_URI = '/oauth2/callback' OAUTH2_SCHEMA = Schema.HTTP OA...
null
spoonlake-master-0982e8056a154c66a547832533c9624fde1dd108/wemark/commons/constants.py
constants.py
py
1,477
python
en
code
null
code-starcoder2
76
[ { "api_name": "wemark.commons.response.Schema.HTTP", "line_number": 13, "usage_type": "attribute" }, { "api_name": "wemark.commons.response.Schema", "line_number": 13, "usage_type": "name" }, { "api_name": "django.conf.settings.LOCAL_TEST", "line_number": 26, "usage_type"...
161073050
from graphene import ObjectType, String, Field, Schema, List, Int from fastapi import FastAPI, Request from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import FileResponse from starlette.graphql import GraphQLApp import json import os import urllib.request from sqlalchemy import create_engine f...
null
app/main.py
main.py
py
30,983
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 18, "usage_type": "call" }, { "api_name": "os.environ", "line_...
141244597
#配置文件 import datetime import configparser import os import importlib import pkgutil import dfdata.source from dfdata import default_config #所有数据源包下包的名称 all_sources = [] for module_info in pkgutil.iter_modules(dfdata.source.__path__): all_sources.append(module_info.name) allowable_config_sections = all_sources...
null
dfdata/util/config.py
config.py
py
18,109
python
en
code
null
code-starcoder2
76
[ { "api_name": "pkgutil.iter_modules", "line_number": 13, "usage_type": "call" }, { "api_name": "dfdata.source.source", "line_number": 13, "usage_type": "attribute" }, { "api_name": "dfdata.source", "line_number": 13, "usage_type": "name" }, { "api_name": "dfdata.d...
431463295
# -*- coding: utf-8 -*- """ Taken from https://github.com/fotonicaOrg/daq commit 387c7c3 """ import numpy as np import nidaqmx import collections from matplotlib import pyplot as plt import nidaqmx.stream_readers import nidaqmx.system import time #system = nidaqmx.system.System.local() # #for device in system.devices: ...
null
DeOtresCompas/daq.py
daq.py
py
5,466
python
en
code
null
code-starcoder2
76
[ { "api_name": "nidaqmx.system.System.local", "line_number": 21, "usage_type": "call" }, { "api_name": "nidaqmx.system", "line_number": 21, "usage_type": "attribute" }, { "api_name": "nidaqmx.constants", "line_number": 31, "usage_type": "attribute" }, { "api_name":...
434117342
import torch.nn as nn import torch class ListenerModel(nn.Module): def __init__(self, embed_dim, hid_dim, img_dim, att_dim, dropout_prob): super().__init__() self.dropout = nn.Dropout(dropout_prob) self.relu = nn.ReLU() self.tanh = nn.Tanh() self.softmax = nn.Softmax(dim=1)...
null
dialogue_manager/models/listener/model.py
model.py
py
3,033
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Dropout", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
415912806
import collections import re from itertools import takewhile def build_tree(log): is_tab = '\t'.__eq__ log = log.replace(" ","\t").replace("*","") lines = iter(log.split("\n")) tree = [] stack = [] for line in lines: indent = len(list(takewhile(is_tab, line))) stack[indent:] ...
null
servers/pso/src/plan.py
plan.py
py
4,071
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.takewhile", "line_number": 12, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 28, "usage_type": "call" }, { "api_name": "re.DOTALL", "line_number": 29, "usage_type": "attribute" }, { "api_name": "re.sub", "line_numb...
620088664
#! /usr/local/bin/python3 # _*_ encoding=utf-8 _*_ from PIL import Image from PIL import ImageColor import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter from mpl_toolkits.mplot3d import Axes3D def down(x, pos): return '%d'%(x//10) all_random_array = [] for i in range(0,31):...
null
plot_surface.py
plot_surface.py
py
1,983
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.randint", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.uint8", "line_number": 18, "usage_type": "attribute" }, { "api_name": "PIL.Image.new...
268045125
import datetime from typing import Dict, List from elastalert.exceptions import EAConfigException from elastalert.queries.elasticsearch_query import ( ElasticsearchQuery, ElasticsearchSpikeCountQuery, ElasticsearchSpikeTermQuery, ) from elastalert.queries.query_factory import QueryFactory from elastalert.r...
null
elastalert/ruletypes/spike_rule.py
spike_rule.py
py
8,702
python
en
code
null
code-starcoder2
76
[ { "api_name": "elastalert.ruletypes.RuleType", "line_number": 18, "usage_type": "name" }, { "api_name": "elastalert.utils.util.new_get_event_ts", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 27, "usage_type": "call" }, ...
490124270
#!/usr/bin/python3 import spidev # `ls` your /dev/ directory to get spi bus and device numbers # e.g. `ls /dev/spi*` gets on my pi these two devices on bus 0: # #/dev/spidev0.0 #/dev/spidev0.1 SPI_BUS = 0 SPI_DEVICE = 0 spi = spidev.SpiDev() spi.open(SPI_BUS, SPI_DEVICE) spi.max_speed_hz = 1000000 # spi.mode, see ...
null
Embedded_Linux/raspberry_pi/peripherals/spidev/00_spi_send.py
00_spi_send.py
py
504
python
en
code
null
code-starcoder2
76
[ { "api_name": "spidev.SpiDev", "line_number": 14, "usage_type": "call" } ]
194585841
import telegram from time import sleep from time import gmtime, strftime import urllib.request import json from lxml import html import requests BOT_TOKEN = '631816802:AAHA1zbx1p03b4m1cjT5cgy5lrJr-S5s6GE' Bot = telegram.Bot(BOT_TOKEN) def getText(Update): return Update["message"]["text"] def getMessageId(Upda...
null
Echobot.py
Echobot.py
py
1,448
python
en
code
null
code-starcoder2
76
[ { "api_name": "telegram.Bot", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 37, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", "line_number": 38, "usage_type": "call" }, { "api_name": "lxml.html", "line_...
114286165
import os from PIL import Image def gif_ratio(filename): png_path = 'C:/Users/jelte/Desktop/researchtool/img_eval/images/'+filename+'.png' gif_path = 'C:/Users/jelte/Desktop/researchtool/img_eval/images/results/'+filename+'.gif' Image.open(png_path).save(gif_path) statinfoPNG = os.stat(png_path) ...
null
DashboardTool/GIF.py
GIF.py
py
423
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 9, "usage_type": "name" }, { "api_name": "os.stat", "line_number": 10, "usage_type": "call" }, { "api_name": "os.stat", "line_number": 11, "...
463902650
import System import Professor import json import pytest def test_drop_student(grading_system): grading_system.login('goggins', 'augurrox') grading_system.usr.drop_student('hdjsr7', 'software_engineering') with open('Data/users.json') as f: data = json.load(f) assert "software_engineering" no...
null
assignments/05-testing/test_drop_student.py
test_drop_student.py
py
481
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "System.System", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 15, "usage_type": "attribute" } ]
127132264
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('myblog', '0002_auto_20151204_0508'), ] operations = [ migrations.AlterField( model_name='profile', n...
null
myblog/migrations/0003_auto_20151204_0825.py
0003_auto_20151204_0825.py
py
444
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
557999678
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright David Lilien 2016 # # Distributed under terms of the MIT license. """ Produce a tif showing where the bottom is at the melting point """ import os.path import numpy as np from modeltools.bin.grid_maker import proc_regs from modeltools.lib.g...
null
modeltools/bin/melting_pt_bot.py
melting_pt_bot.py
py
3,128
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.hstack", "line_number": 37, "usage_type": "call" }, { "api_name": "modeltools.bin.grid_maker.proc_regs", "line_number": 39, "usage_type": "call" }, { "api_name...
562155117
import random from django.http import JsonResponse from systems.DBase import DBase from systems.Fetch import Fetch from systems.Mongo import Mongo from services.Funny import Funny fetch = Fetch() dbase = DBase(fetch.load('./server/config/mysql.json')) mongo = Mongo(fetch.load('./server/config/mongo.json')) funny =...
null
consumer/server/server/Recommend.py
Recommend.py
py
774
python
en
code
null
code-starcoder2
76
[ { "api_name": "systems.Fetch.Fetch", "line_number": 8, "usage_type": "call" }, { "api_name": "systems.DBase.DBase", "line_number": 9, "usage_type": "call" }, { "api_name": "systems.Mongo.Mongo", "line_number": 10, "usage_type": "call" }, { "api_name": "services.Fu...
634683989
import flask from flask import jsonify, request app = flask.Flask(__name__) app.config["DEBUG"] = True baseUrl = '/api/v1/' bonjours = [ {'id': 1, 'description': 'Bonjour!', 'language': 'fr'}, {'id': 2, 'description': 'Hallo!', 'language': 'nl'}, {'id': 3, 'description': 'Hello!', 'language': 'en'} ] @...
null
application.py
application.py
py
995
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 23, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 29, "usage_type": "attribute" }, { "api_name": "flask.request", ...
102682983
"""Definition of the SampleFolder content type """ from zope.interface import implements, directlyProvides from zope.component import adapter, getUtility, getMultiAdapter from zope.app.container.interfaces import INameChooser from zope.schema.interfaces import IVocabularyFactory from zope.schema.vocabulary import Simp...
null
src/weka.content/weka/content/content/samplefolder.py
samplefolder.py
py
3,456
python
en
code
null
code-starcoder2
76
[ { "api_name": "Products.ATContentTypes.content.folder.ATFolderSchema.copy", "line_number": 19, "usage_type": "call" }, { "api_name": "Products.ATContentTypes.content.folder.ATFolderSchema", "line_number": 19, "usage_type": "attribute" }, { "api_name": "Products.ATContentTypes.con...
408773859
###切记切记 扫描顺序是左上->右下 import os from PIL import Image G_BOX = (8,160,36,184) #x,y,x1,y2 G_BOX_SIZE = (G_BOX[2]-G_BOX[0],G_BOX[3]-G_BOX[1]) #(宽,高) G_BOX_PIXEL_AMOUNT = (G_BOX_SIZE[0]+1)*(G_BOX_SIZE[1]+1) #区域的像素数量,+1是因为包含区域边界 G_BOX_Z = 0 ...
null
色差计算/mh.py
mh.py
py
3,493
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 20, "usage_type": "name" }, { "api_name": "os.listdir", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number"...
507115442
from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib.auth.decorators import login_required from accounts.models import CustomUser from .forms import EditCustomUserForm # Check which user type and redirect to respective homes @login_required(login_url='/login/') def ho...
null
main/views.py
views.py
py
7,410
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.redirect", "line_number": 21, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 29, "usage_type": "call" }, { "api_name": "accounts.models.CustomUser.objects.all", "line_number": 34, "usage_type": "call" }, ...
519835645
from django.urls import path from . import views urlpatterns = [ path('', views.index), path('register', views.register), path('login', views.login), path('success', views.success), path('logout', views.logout), path('process_message', views.process_message), path('add_comment/<int:id>', ...
null
Gallery/urls.py
urls.py
py
860
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
477703765
import torch import torch.nn as nn import utils filename = 'audios/mix.wav' nb_seconds = 3 nb_epoch = 200 audio, sample_rate = utils.load(filename) audio = audio[:, :sample_rate * nb_seconds] nb_mixtures, T = audio.size() nb_sources = nb_mixtures B = nn.Linear(nb_mixtures, nb_sources, bias=False) estim_function = ...
null
online.py
online.py
py
908
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.load", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn.Linear", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "name" }, { "api_name": "utils.H", "line_number": 17, ...
172237284
import xlwt import pymysql from xlwt import XFStyle from xlwt import Font from django.shortcuts import render from django.contrib import messages from ..models.directory import * from ..src.validator import Validator from ..models.directory import * from ..src.xls_generator import * from django.shortcuts import redirec...
null
hound_app/hound/views/directory_view.py
directory_view.py
py
10,883
python
en
code
null
code-starcoder2
76
[ { "api_name": "src.validator.Validator.validate_view", "line_number": 31, "usage_type": "call" }, { "api_name": "src.validator.Validator", "line_number": 31, "usage_type": "name" }, { "api_name": "django.shortcuts.redirect", "line_number": 32, "usage_type": "call" }, ...
310878649
from flask import Flask, render_template, request, jsonify,redirect from model4 import * from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from collections import defaultdict app = Flask(__name__) engine = create_engine('sqlite:///new_file', echo=False) Base = declarative_base() @app.rout...
null
Homework10_4/homework10_4.py
homework10_4.py
py
2,347
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.sessionmaker", "line_number": 15, "usage_type": "call" }, { "api_name": "flask....
645117991
# -*- coding: utf-8 -*- """ requests_toolbelt.multipart =========================== This holds all of the implementation details of the MultipartEncoder """ from requests.utils import super_len from requests.packages.urllib3.filepost import (iter_field_objects, encode...
null
requests_toolbelt/multipart.py
multipart.py
py
6,906
python
en
code
null
code-starcoder2
76
[ { "api_name": "uuid.uuid4", "line_number": 47, "usage_type": "call" }, { "api_name": "requests.utils.super_len", "line_number": 86, "usage_type": "call" }, { "api_name": "requests.packages.urllib3.filepost.encode_multipart_formdata", "line_number": 97, "usage_type": "call...
268485973
from __future__ import division import operator import math from src.corpus import Corpus import tokenizer import util import document def count_words(w, word_map): if w in word_map: word_map[w] += 1 else: word_map[w] = 1 class CorpusBuilder(object): """Initializes a Corpus from a list ...
null
lda/py/src/corpusbuilder.py
corpusbuilder.py
py
3,332
python
en
code
null
code-starcoder2
76
[ { "api_name": "operator.itemgetter", "line_number": 39, "usage_type": "call" }, { "api_name": "util.take", "line_number": 40, "usage_type": "call" }, { "api_name": "src.corpus.Corpus", "line_number": 55, "usage_type": "call" }, { "api_name": "document.Document", ...
101761317
from __future__ import print_function import sys sys.path.insert( 1, 'C:/Users/seand/OneDrive/Documents/University/Autonomous Drone Navigation/Implementation/AirSimAPI') import time import numpy as np import cv2 from tensorflow import keras import tensorflow as tf from numpy.lib.function_base import average import ...
null
src/nav_ai.py
nav_ai.py
py
5,646
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "airsim.YawMode", "line_number": 19, "usage_type": "call" }, { "api_name": "airsim.DrivetrainType", ...
90141766
# -*- coding: utf-8 -*- """ Created on Wed Mar 25 10:15:18 2020 @author: Daniel """ from qgis.core import QgsLayerTreeGroup, QgsVectorLayer, QgsProject, QgsTask, QgsApplication, QgsRendererRange, QgsStyle, QgsGraduatedSymbolRenderer import os, glob, traceback, fnmatch, time, qgis from osgeo import ogr from qgis.utils i...
null
preprocessing/bulk_add_shapefiles_and_screenshot.py
bulk_add_shapefiles_and_screenshot.py
py
5,598
python
en
code
null
code-starcoder2
76
[ { "api_name": "qgis.core.QgsLayerTreeGroup", "line_number": 12, "usage_type": "name" }, { "api_name": "qgis.core.QgsLayerTreeGroup", "line_number": 16, "usage_type": "argument" }, { "api_name": "qgis.core.QgsLayerTreeGroup", "line_number": 21, "usage_type": "argument" }...
421426449
import os import shutil import logging import subprocess from tempfile import mkdtemp log = logging.getLogger(__name__) # other formats: http://opengrok.libreoffice.org/s?n=25&start=0&q=PreferredFilter&sort=relevancy&project=core, def document_to_pdf(path): """ OK, this is weird. Converting LibreOffice-supported...
null
extractors/soffice.py
soffice.py
py
1,043
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "tempfile.mkdtemp", "line_number": 14, "usage_type": "call" }, { "api_name": "tempfile.mkdtemp", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ.get", ...