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
285001864
import torch import torch.nn.functional as F from torch.autograd import Variable import torch.utils.data as data import numpy as np import os from datetime import datetime from models.model import UNet from data import TrainSet from tools import adjust_lr,clip_gradient lr=1e-4 path_root='/home/dave/DataSet/bi-train-...
null
ResEncoder/train.py
train.py
py
1,979
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.model.UNet", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.optim...
298148172
import pandas as pd from LogisticRegression import * from SoftmaxRegression import * from NeuralNetwork import * import matplotlib.pyplot as plt '''Dado um arquivo csv (name), le os dados e adiciona a coluna x0 a matriz de features''' def le_dados(name): #Le os dados do arquivo csv data = pd.read_csv(name) ...
null
Trabalho2/Entrega/Main.py
Main.py
py
16,890
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 36, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 36, "usage_type": "name" }, { "api_name": "matplotlib.p...
59730907
import hashlib import os import re import time import grequests from openpyxl import Workbook, load_workbook #生成待翻译的url链接 def get_fanyi(q): pattern = re.compile(r'[\u4e00-\u9fa5]') salt = '1122' appid = '20180115000115453' secret = 'AHYyafcYLzm3q0fkfQ7z' s = appid + q + salt + secret...
null
fanyi_excel.py
fanyi_excel.py
py
3,340
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 11, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 32, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 37, "usage_type": "call" }, { "api_name": "os.listdir", "line_...
632182222
# To run this test, you must be at the package root directory and run: # pytest tests/test_modules.py import pytest import shutil testid='ci37511872' configfile='tests/testconfig.yml' def test_config(): from dyfi import Config import os conf=Config(configfile) # conf should have at least 'db' and '...
null
tests/test_modules.py
test_modules.py
py
12,203
python
en
code
null
code-starcoder2
66
[ { "api_name": "dyfi.Config", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "dyfi.Config", "line_numbe...
383881758
import json import requests from django.conf import settings from django.contrib.gis.geos import Point from django.core.management.base import BaseCommand from django.utils import timezone from django.utils.text import Truncator from furl import furl from dora.core import utils from dora.core.models import Moderation...
null
dora/core/management/commands/import_data_inclusion.py
import_data_inclusion.py
py
12,965
python
en
code
null
code-starcoder2
66
[ { "api_name": "furl.furl", "line_number": 37, "usage_type": "call" }, { "api_name": "django.conf.settings.DATA_INCLUSION_URL", "line_number": 37, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 37, "usage_type": "name" }, { "api_n...
509264968
''' Created on Jan 14, 2020 @author: Andrew Song ''' import flask from flask import request, jsonify results = [ {'id':0, 'x-axis':123, 'y-axis':234, 'confidence':0.8}, {'id':1, 'x-axis':321, 'y-axis':654, 'confidence':1.0} ] # Setting up the Flask application object app = ...
null
OptionsAnalysis/src/sp/api/FlaskProject.py
FlaskProject.py
py
979
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 22, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 32, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 36, "usage_type": "attribute" }, { "api_name": "flask.request", ...
264760443
from bpy.props import (StringProperty, BoolProperty, EnumProperty) from ...rfb_utils import scene_utils from ...rfb_utils import shadergraph_utils from ...rfb_logger import rfb_log from ... import rfb_icons from ...rman_operators.rman_operators_collections import return_empty_list from ...rman_config import __RFB_C...
null
rman_operators/rman_operators_editors/rman_operators_editors_lightlink.py
rman_operators_editors_lightlink.py
py
12,472
python
en
code
null
code-starcoder2
66
[ { "api_name": "bpy.types", "line_number": 12, "usage_type": "attribute" }, { "api_name": "rfb_utils.shadergraph_utils.get_light_node", "line_number": 19, "usage_type": "call" }, { "api_name": "rfb_utils.shadergraph_utils", "line_number": 19, "usage_type": "name" }, { ...
291290755
#! /usr/bin/python ''' /****************************************************/ // Filename: comnwithxbee.py // Created By: Amit Pathania,Manjunath K, Goutam // Creation Date: 23-10-2016 // Purpose/Description: For serial communication between bot and Xigbee and sending/recieving data to/from Xigbee. It reads table numbe...
null
2016-cs684-Auto Serving Bot/Code/UI Code/php_server/comnwithxbee.py
comnwithxbee.py
py
8,413
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.asctime", "line_number": 60, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 60, "usage_type": "call" }, { "api_name": "time.time", "line_number": 60, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 6...
241187541
'''A module to create and update an inventory CSV file using closures and currying''' # Create and update a CSV dile that lsits which furniture is rented to which customer # Create functionalities that will load individual customers rentals import csv from functools import partial def add_furniture(invoice_file, cust...
null
students/chelsea_nayan/lesson08/inventory.py
inventory.py
py
2,204
python
en
code
null
code-starcoder2
66
[ { "api_name": "csv.writer", "line_number": 12, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 25, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 29, "usage_type": "call" } ]
493983227
import sys sys.path.append('src') import scipy.sparse as sparse import numpy as np import scipy as sc from numpy.linalg import inv, pinv from utils.utils import log_filter, binary_filter import pdb """def RWTM(matrix, logger, args): try: transform = args['transform'] threshold = args['threshold'] ...
null
src/proxi_methods/RWTM.py
RWTM.py
py
2,473
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "numpy.vectorize", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_nu...
197022038
import matplotlib.image as mpimg import matplotlib.pyplot as plt import numpy as np import pickle import cv2 import glob from vehicle_det_main_funcs import * from adv_lane_lines import * from sklearn.svm import LinearSVC from sklearn.preprocessing import StandardScaler import random import time from scipy.ndimage.measu...
null
veh_det_main.py
veh_det_main.py
py
11,005
python
en
code
null
code-starcoder2
66
[ { "api_name": "glob.glob", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number": 67, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 67, "usage_type": "attribute" }, { "api_name": "sklearn.preprocessing.Stand...
69944899
import sys from PyQt5 import QtCore, QtGui, QtWidgets from gui import Ui_Form def egcd(v, w): #теорема Евкліда, знаходження мультиплікативної інверсії if v == 0: return (w, 0, 1) else: gcd, x, y = egcd(w % v, v) return (gcd, y - (w//v) * x, x) def...
null
choice/main.py
main.py
py
2,279
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 18, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets", "line_number": 18, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWi...
292446166
print('-- ') print('-- Read data files in different formats') print('-- ') # Modules import matplotlib.pyplot as plt import numpy as np import pandas as pd from astropy.io import fits import matplotlib.cm as cm import pdb as pdb # Close all windows plt.close('all') print('ascii files!') # (spectrum.dat is a spectru...
null
code_from_meetings/reading_data.py
reading_data.py
py
2,871
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.close", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.loadtxt", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.read_t...
124425346
import argparse import readline from pynet import Encryptor, Node, MessageState from pynet.util import send_data, to_bytes, to_address class Client(object): """A client object holds the information needed to send data to a node.""" def __init__(self, private_key, name, server_address): self.private_key = pri...
null
client.py
client.py
py
2,798
python
en
code
null
code-starcoder2
66
[ { "api_name": "pynet.util.to_address", "line_number": 13, "usage_type": "call" }, { "api_name": "pynet.Node.construct_message", "line_number": 17, "usage_type": "call" }, { "api_name": "pynet.Node", "line_number": 17, "usage_type": "name" }, { "api_name": "pynet.u...
278737474
# Import your custom models from .models import Post, Comment from django.contrib.auth.forms import UserCreationForm, UserChangeForm from django.contrib.auth.models import Group, User from rest_framework.relations import PrimaryKeyRelatedField import djadmin2 from djadmin2.models import ModelAdmin2 from djadmin2.api...
null
example/blog/admin2.py
admin2.py
py
1,093
python
en
code
null
code-starcoder2
66
[ { "api_name": "djadmin2.apiviews.Admin2APISerializer", "line_number": 14, "usage_type": "name" }, { "api_name": "rest_framework.relations.PrimaryKeyRelatedField", "line_number": 15, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.Group", "line_number": 18, ...
195548159
import os import util import argparse def parserCommad(): ''' Get the command line parameter and return them. ''' parser = argparse.ArgumentParser() parser.add_argument('--mutant_root', action='store', default="./_SBFL_randomization_higher_order_mutant_set/", ...
null
SBFL_randomization_higher_order_MBFL/create_all_execute_mutants.py
create_all_execute_mutants.py
py
1,282
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" } ]
287880723
from environment.base import Base import json from tqdm import tqdm import math import os def main(cfg, model_path): """ main function to run everything """ base = Base(epsilon=cfg['base']['epsilon'], eps_dec=cfg['base']['eps_dec'], padding=cfg['main']['padding'],\ eps_min=cfg['base']['eps...
null
main.py
main.py
py
1,540
python
en
code
null
code-starcoder2
66
[ { "api_name": "environment.base.Base", "line_number": 11, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 23, "usage_type": "call" }, { "api_name": "math.log10", "line_number": 27, "usage_type": "call" }, { "api_name": "json.load", "line_numb...
79385174
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_sqlalchemy_test_cache ---------------------------------- Tests for `sqlalchemy_test_cache` module. """ from __future__ import unicode_literals import collections import datetime import json import unittest try: from unittest import mock except ImportError: ...
null
tests/unit/test_sqlalchemy_test_cache.py
test_sqlalchemy_test_cache.py
py
15,402
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 26, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 27, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 28, "usage_type": "call" }, { "api_name": "...
155244507
import numpy as np from action import Action from collections import defaultdict import random # Q-learning algorithm import numpy as np from action import Action from collections import defaultdict import random # Question 1 # # It is interesting to give a negative reward to the default event to incite the agents ...
null
wumpus/agents/q_learning_agent.py
q_learning_agent.py
py
3,511
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.defaultdict", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.random.uniform", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 33, "usage_type": "attribute" }, { "api_name": "action...
632726150
# -*- coding: utf-8 -*- import os import sys import argparse # env os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djmapache.settings.shell') from django.conf import settings # informix environment os.environ['INFORMIXSERVER'] = settings.INFORMIXSERVER os.environ['DBSERVERNAME'] = settings.DBSERVERNAME os.environ['...
null
djmapache/bin/class_year.py
class_year.py
py
2,969
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ.setdefault", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.conf.setti...
645571197
import sys traindata = sys.argv[1] trainlabels = sys.argv[2] testdata = sys.argv[3] filedata = open(traindata).readlines() lst = [] for line in filedata: lst.append([ float(x) for x in line.split()]) cols = len(lst[1]) rows = len(lst) #print(rows, cols) trainlabels = open(trainlabels).readlines() trainlst = [...
null
main.py
main.py
py
3,769
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 3, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.random.shuffle", "li...
421589539
#!/usr/bin/env python3 import requests import time epoch = datetime.datetime(2012,4,1,0,0).timestamp() def get_author_comments(**kwargs): r = requests.get("https://api.pushshift.io/reddit/comment/search/",params=kwargs) data = r.json() return data['data'] before = None while True: comments = get_aut...
null
_projlab/reddit-comment/rdt-pushshift.py
rdt-pushshift.py
py
943
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 28, "usage_type": "call" } ]
609259569
import json import os import sys import soundfile def _path(x): return os.path.join(os.path.dirname(__file__), '../%s' % x) sys.path.append(_path('rhino/binding/python')) from rhino import Rhino LIB_PATH = _path('rhino/lib/linux/x86_64/libpv_rhino.so') MODEL_PATH = _path('rhino/lib/common/rhino_params.pv') C...
null
benchmark/picovoice.py
picovoice.py
py
2,524
python
en
code
null
code-starcoder2
66
[ { "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": "sys.path.append", "line_nu...
471486972
import nltk import numpy as np import random import string import re ######################## # Prelucrarea textului # ######################## # citirea textului din fisier with open('corpus.txt', 'r', encoding="utf-8") as f: text_articol = f.read() # curatarea textului - stergerea caracterelor spec...
null
fotbal-bot.py
fotbal-bot.py
py
2,653
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.sub", "line_number": 16, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 17, "usage_type": "call" }, { "api_name": "nltk.sent_tokenize", "line_number": 20, "usage_type": "call" }, { "api_name": "nltk.stem.WordNetLemmatizer", "l...
204754555
# -*- coding: utf-8 -*- from glob import glob import sys import gettext from path import path from dealer.git import git BASE_ROOT = path('/edx/app/edxapp/') # folder where edx-platform main repository and our stuffs are sys.path.append('/edx/app/edxapp/fun-apps') # Add the fun-apps repo to sys.path: PLATFORM_NAM...
null
fun/envs/common.py
common.py
py
7,329
python
en
code
null
code-starcoder2
66
[ { "api_name": "path.path", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "path.path.split", "line_n...
308577258
import pandas as pd from sklearn.preprocessing import LabelEncoder, OneHotEncoder dataset = pd.read_csv('data/insurance1.csv') # ------------ Trying model with all features ----------------------------- X = dataset.iloc[:, 1:9].values y = dataset.iloc[:, 9].values # Label Encoder for region le_1 = LabelEncoder() X[:...
null
src/RandomForestNew.py
RandomForestNew.py
py
4,413
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 15, "usage_type": "call" }, { ...
126190431
from flask import Flask, after_this_request, request app = Flask(__name__) app.debug = True @app.route('/', methods=['POST']) def aiMove(): @after_this_request def add_header(response): response.headers['Access-Control-Allow-Origin'] = '*' return response payload = request.get_json(force=...
null
server/server.py
server.py
py
3,988
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.after_this_request", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.request.get_json", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.reque...
324121733
import pygame # pygame is a gaming module with things built in to make game coding easier import time import random pygame.init() width = 800 height = 600 score=0 gameDisplay = pygame.display.set_mode((width,height)) # creates a display and returns a surface object white = (255,255,255) black = (0,0,0) icon ...
null
FlappyBird.py
FlappyBird.py
py
8,473
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.image.loa...
106535042
#!/usr/bin/env python # Author:Hank ''' 队列:满足特点 --> 先进先出,类似于我们生活中的买票、安检 【注意】 对于队列而言:python中有为其封装特定的函数,在collections模块中的deque函数就可以获取一个队列对象; 操作步骤: 步骤一:导入collections模块 步骤二:collections.deque() --> 返回队列对象 步骤三:使用队列对象调用其存和取的函数,完成需求 ''' ''' 演示队列存取数据的特点:先进先出 ''' # import collections # # #获取队列对象:dequ...
null
第31-35课/python第三十三课——队列(难).py
python第三十三课——队列(难).py
py
2,298
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 57, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 64, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 68, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
371920672
from gssutils import * import json info = json.load(open('info.json')) etl_title = info["Name"] etl_publisher = info["Producer"][0] print("Publisher: " + etl_publisher) print("Title: " + etl_title) scraper = Scraper(seed="info.json") scraper
null
datasets/HM-Land-Registry-Price-Paid-Data/main.py
main.py
py
256
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 4, "usage_type": "call" } ]
97785374
import configparser import os class ConfigPathUtils(): def __init__(self, group, root_dir, base_path_item='base_path'): """ root_dir = os.path.dirname(os.path.abspath(__file__)) """ # Drive のパスを読み込み: _settings/BiDAF.cfg から デフォルト設定を読み込み self.cfg = configparser.ConfigParser()...
null
_settings/config_path_utils.py
config_path_utils.py
py
1,192
python
en
code
null
code-starcoder2
66
[ { "api_name": "configparser.ConfigParser", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
360879461
# Copyright Anoop Kumar Narayanan 2010-* "anoop at kn dot gmail at com" try the same with "live at in" as well # To repeat it, "anoop at kn dot gmail at com" try the same with "live at in" as well # License : send me a mail and I'll let you know # Website : lotsofpipes.googlecode.com # Blog : techistan.blogspot....
null
python-related/python-project-manager/ProjectManager.py
ProjectManager.py
py
21,808
python
en
code
null
code-starcoder2
66
[ { "api_name": "wx.App", "line_number": 49, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", "line_number": 64, "usage_type": "call" }, { "api_name": "os.path", "line_number": 64, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", ...
480759558
import numpy as np from player import Player from tabulate import tabulate as table class Team(): """ teamData['teams'][teamId] rosterData['schedule'][matchupNum]['home' or 'away'] """ def __init__(self, teamData): self.teamId = teamData['id'] self.teamAbbrev = teamData['abbrev'] ...
null
old_code/team.py
team.py
py
10,879
python
en
code
null
code-starcoder2
66
[ { "api_name": "player.Player", "line_number": 60, "usage_type": "call" }, { "api_name": "player.eligibleSlots", "line_number": 71, "usage_type": "attribute" }, { "api_name": "player.score", "line_number": 78, "usage_type": "attribute" }, { "api_name": "player.scor...
25997564
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponseRedirect, HttpResponse import json from inventory.models import Asset, Spec, Value, Model, Category, AssetForm # # Basic views # # Lists all assets def index(request): return render(request, 'inventory/index.html', {}) #...
null
inventory/views.py
views.py
py
8,937
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 18, "usage_type": "call" }, { "api_name": "inventory.models.Asset", "line_number": 18, "usage_type": "argument" }, { ...
38441050
import requests import os import bs4 import re import openpyxl from download import download from openpyxl.drawing.image import Image urlbase = 'http://www.playtech.com.br/categoria/1/130/304//Preco/Crescente/63/1//0/0/.aspx' if __name__ == "__main__": wb = openpyxl.load_workbook(filename='base.xlsm', read_only=F...
null
playtech.py
playtech.py
py
2,372
python
en
code
null
code-starcoder2
66
[ { "api_name": "openpyxl.load_workbook", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 17, "usage_type": "call" }, { "api_name": "download.downlo...
341358759
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import os import weakref import ast as ast_module import types import logging import pprint import collections import llvm.core from numba import pipeline, naming, error, reporting, PY3 from numba.utils import TypedProperty, Wri...
null
oldnumba/environment.py
environment.py
py
31,749
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 32, "usage_type": "call" }, { "api_name": "numba.PY3", "line_number": 34, "usage_type": "name" }, { "api_name": "types.NoneType", "line_number": 38, "usage_type": "attribute" }, { "api_name": "numba.utils.WriteOnce...
521202191
from django.shortcuts import render from django.http import JsonResponse from Poker_algorithm import Function as Fun import DataManager.BaseInfo as Bi import DataManager.StatusRecord as Sr import DataManager.Action as Ac from my_web.models import * from django.forms.models import model_to_dict from Poker_algorithm.Func...
null
djangoProject/my_web/views.py
views.py
py
11,221
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 18, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 34, "usage_type": "call" }, { "api_name...
196992623
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys import unitTestUtil import pxssh import time import subprocess import os import logging currentPath = os.getcwd() try: testPath = currentPath[0:currentPath....
null
tests/common/watchdogResetTest.py
watchdogResetTest.py
py
4,139
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "pxssh.pxssh", "line_number": 27, "usage_type": "call" }, { "api_name": "unitTestUtil.Login", "line_number": 28, "usage_type": "call" }, { "api_name": "pxssh.pxssh", "line_numb...
228238815
import os import csv import math import random import numpy as np import os.path as Path import tables as tb from keras.utils import to_categorical from typing import Dict, List, Tuple from zk.visual import Visual LABEL = { '1': 'Ramnit', '2': 'Lollipop', '3': 'Kelihos_ver3', '4': 'Vundo', '5': 'S...
null
src/python/zk/dataset/mcc2015.py
mcc2015.py
py
9,395
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path", "line_number": 80, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 82, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 83, "usage_type": "name" }, { "api_name": "zk.visual.Visual", "line_number...
84085904
import cv2 import os from cam_image_process import lanes_detection_polyfit as ldsw # Step1: Input the image and Preview img1 = cv2.imread("./test_images/straight_lines1.jpg") # Step2: Initialize the container FeatureCollector object. name_list = [] cal_imgs_list = [] for path, dir_list, file_list in os.walk(r".\came...
null
img_test_lane_polyfit.py
img_test_lane_polyfit.py
py
1,199
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, ...
632767044
#!/usr/bin/python # Author: Mania Abdi, Trevor Nogues import entry import uuid import utils.status as status from entry import Entry ''' NOTES: - On eviction we cannot evict partially, because we dont know future strides - On pin/unpin we cannot pin partially. but we should support it in the future ''' #FIX...
null
code/d3n/worker.py
worker.py
py
11,791
python
en
code
null
code-starcoder2
66
[ { "api_name": "uuid.uuid1", "line_number": 24, "usage_type": "call" }, { "api_name": "utils.status.FILE_NOT_FOUND", "line_number": 66, "usage_type": "attribute" }, { "api_name": "utils.status", "line_number": 66, "usage_type": "name" }, { "api_name": "utils.status...
619281337
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Loads '.edf' data format in the data shape of EEGNet """ import numpy as np # pyEDFlib is a python library to read/write EDF+/BDF+ files based on EDFlib. import pyedflib as edf import os # to calculate mean and the standard deviation import statistics as stats impor...
null
get_data.py
get_data.py
py
10,213
python
en
code
null
code-starcoder2
66
[ { "api_name": "statistics.stdev", "line_number": 88, "usage_type": "call" }, { "api_name": "statistics.mean", "line_number": 89, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 136, "usage_type": "call" }, { "api_name": "numpy.array", "line...
593299678
import pandas as pd import os import spacy from spacy.matcher import Matcher from spacy.tokens import Doc import numpy as np from numpy import array from sklearn.feature_extraction.text import CountVectorizer from collections import Counter from matplotlib import pyplot as plt import seaborn as sb import re # Objecti...
null
covid_19.py
covid_19.py
py
5,603
python
en
code
null
code-starcoder2
66
[ { "api_name": "spacy.load", "line_number": 24, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 68, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 77, "usage_type": "call" }, { "api_name": "spacy.tokens.Doc", "line_numb...
584740248
# Licensed to Modin Development Team under one or more contributor license agreements. # See the NOTICE file distributed with this work for additional information regarding # copyright ownership. The Modin Development Team licenses this file to you under the # Apache License, Version 2.0 (the "License"); you may not u...
null
modin/experimental/cloud/rpyc_proxy.py
rpyc_proxy.py
py
27,221
python
en
code
null
code-starcoder2
66
[ { "api_name": "cloudpickle.loads", "line_number": 29, "usage_type": "call" }, { "api_name": "cloudpickle.dumps", "line_number": 38, "usage_type": "call" }, { "api_name": "rpyc.Connection", "line_number": 41, "usage_type": "attribute" }, { "api_name": "collections....
350906974
#Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
null
fluid/PaddleRec/ssr/train.py
train.py
py
3,747
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 25, "usage_type": "attribute" }, { "api_name": "argparse.Argu...
299097509
# Create your views here. from django.db.models import Q from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from rkmndObjects.serializers import rkmndSerializer, commentSerializer from django.contrib.auth.models import User from rkmndObjects.mod...
null
rkmndBack/rkmndObjects/views.py
views.py
py
8,312
python
en
code
null
code-starcoder2
66
[ { "api_name": "rkmndObjects.models.RkmndObj.objects.filter", "line_number": 23, "usage_type": "call" }, { "api_name": "rkmndObjects.models.RkmndObj.objects", "line_number": 23, "usage_type": "attribute" }, { "api_name": "rkmndObjects.models.RkmndObj", "line_number": 23, "...
258982147
import re import subprocess import traceback from datetime import datetime from typing import List, Dict, Set from bauh.api.exception import NoInternetException from bauh.commons.system import new_subprocess, run_cmd, new_root_subprocess, SimpleProcess, ProcessHandler RE_SEVERAL_SPACES = re.compile(r'\s+') def get_...
null
bauh/gems/flatpak/flatpak.py
flatpak.py
py
12,873
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 13, "usage_type": "name" }, { "api_name": "re.findall", "line_number": 19, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 43...
164978588
#!/usr/bin/python3 import pandas as pd import numpy as np import matplotlib.pyplot as plt import openpyxl file = 'mybigdf.xlsx' book = openpyxl.load_workbook(file) #print(book.get_sheet_names()) sheet = book.get_sheet_by_name('Sheet1') for i in range(4,123): for j in range(4,75): if( not sheet.cell(row =i, colum...
null
aux_scripts/min_max.py
min_max.py
py
736
python
en
code
null
code-starcoder2
66
[ { "api_name": "openpyxl.load_workbook", "line_number": 10, "usage_type": "call" } ]
600068504
import numpy as np import matplotlib.pyplot as plt np.random.seed(1) files = ["/home/bmumey/wh/chr22-full/output.txt.dist-0.0-500000.txt", "/home/bmumey/wh/chr22-full/output.txt.dist-0.05-500000.txt", "/home/bmumey/wh/chr22-full/output.txt.dist-0.1-500000.txt"] colors = ["red", "orange", "blue"] fi...
null
wildcard/create_3_scatter.py
create_3_scatter.py
py
1,144
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 4, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotl...
369371340
from app import * from forms import GenreForm, SongForm, SearchForm from flask import request, redirect, render_template, url_for, flash, make_response import random from utils import get_url """ Views for the Flask app. Contains the routes for the page routing """ @app.route('/') def home(): """ Homepage. S...
null
views.py
views.py
py
6,323
python
en
code
null
code-starcoder2
66
[ { "api_name": "forms.SearchForm", "line_number": 17, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 23, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 32, "usage_type": "call" }, { "api_name": "app.route", ...
531689210
import csv import random from functools import partialmethod from pathlib import Path import numpy as np import torch from torch import device class AverageMeter(object): """Computes and stores the average and current value""" def __init__(self): self.reset() def reset(self): self.val =...
null
utils.py
utils.py
py
1,864
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.no_grad", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.initial_seed", "line_number": 46, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.random.seed", ...
206496036
import requests from requests import RequestException from bs4 import BeautifulSoup import csv class Item: """ An Item object represents the signature of an HTML tag. """ def __init__(self, name: str, tag: str, attribute={'': ''}): # pragma: no cover """ Constructor. ...
null
module/web_scraper.py
web_scraper.py
py
6,883
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 97, "usage_type": "call" }, { "api_name": "requests.RequestException", "line_number": 99, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 101, "usage_type": "call" }, { "api_name": "requests.Re...
423914652
from collections import defaultdict import os, sys import argparse from lxml import etree as et import re import gc import logging import math import moviepy.editor as mp from svglib.svglib import svg2rlg #, find_font, _registered_fonts from reportlab.graphics import renderPM #from reportlab.pdfbase.p...
null
svg_to_mp4.py
svg_to_mp4.py
py
6,887
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 41, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 48, "usage_type": "call" }, { "api_name": "moviepy.editor.ImageSequenceClip", "line_number": 60, "usage_type": "call" }, { "api_name": "moviepy.edi...
377133217
import cv2 import os def image_resize(image, width = None, height = None, inter = cv2.INTER_AREA): # initialize the dimensions of the image to be resized and # grab the image size dim = None (h, w) = image.shape[:2] # if both the width and height are None, then return the # original image ...
null
crolo-web-testing/cypress/fixtures/non-transparent/resize_image.py
resize_image.py
py
1,650
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.INTER_AREA", "line_number": 4, "usage_type": "attribute" }, { "api_name": "cv2.resize", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 50, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_numb...
151932185
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
null
analysis/webservice/algorithms/doms/insitu.py
insitu.py
py
3,294
python
en
code
null
code-starcoder2
66
[ { "api_name": "webservice.algorithms.doms.config.getSchemaEndpoint", "line_number": 31, "usage_type": "call" }, { "api_name": "webservice.algorithms.doms.config", "line_number": 31, "usage_type": "name" }, { "api_name": "logging.info", "line_number": 32, "usage_type": "ca...
214318516
import socket import time from multiprocessing import Process, Queue, Value import threading import pickle import mysql.connector as mysql # configuration file HOST = '127.0.0.1' REQUESTS_PORT = 65439 #make it inside ports_dict? ports_dict = {} def update_server_database(changes): print("inside update_server") re...
null
server.py
server.py
py
5,425
python
en
code
null
code-starcoder2
66
[ { "api_name": "socket.socket", "line_number": 26, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 26, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 26, "usage_type": "attribute" }, { "api_name": "threading.T...
169501918
import curses import os from src.telegramApi import client from src import npyscreen class MessageInfoForm(npyscreen.ActionForm): def create(self): self.name = "Upload File (Press TAB)" new_handlers = { # exit "^Q": self.exit_func, 155: self.exit_func, ...
null
src/MessageInfoForm.py
MessageInfoForm.py
py
592
python
en
code
null
code-starcoder2
66
[ { "api_name": "src.npyscreen.ActionForm", "line_number": 7, "usage_type": "attribute" }, { "api_name": "src.npyscreen", "line_number": 7, "usage_type": "name" }, { "api_name": "curses.ascii", "line_number": 15, "usage_type": "attribute" } ]
193942143
import cv2 import numpy as np cap = cv2.VideoCapture(0) # real sense divece #cap = cv2.VideoCapture(3) #flags = [i for i in dir(cv2) if i.stratswith('COLOR_RGRG')] #pinrt(flags) while True: ret,frame = cap.read() gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) cv2.imshow('frame',frame) cv2.imshow('gray',gray) if c...
null
opencv/01web_camera/cvWebcam.py
cvWebcam.py
py
401
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.VideoCapture", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 10, "usage_type": "attribute" }, { "api_name": "cv2.imshow", ...
172516363
from flask import Flask,render_template, request, url_for, redirect from pymongo import MongoClient from bson import ObjectId # For ObjectId to work app = Flask(__name__) #mongodb client = MongoClient('mongodb://localhost:27017/') #uri db = client.mywebsite_crud #database name mongo = db.buku #collection @app...
null
server.py
server.py
py
2,082
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.render_temp...
103312408
# coding=utf-8 #导入需要使用的模块 #import itertools import urllib import sys,io sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')#为了防止有时候输出产生中文乱码的问题 import requests from lxml import etree import json from docx import Document from docx.shared import Inches from docx.oxml.ns import qn from docx.shared import Pt ...
null
QSBK_Python_Spider.py
QSBK_Python_Spider.py
py
3,298
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.stdout", "line_number": 6, "usage_type": "attribute" }, { "api_name": "io.TextIOWrapper", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 29, "usage_type": "call" }, { "api_name": "lxml.etree.HTML", "li...
242376379
import requests import hashlib import json import re class Epay: def __init__(self): from service.util.pay.pay_config import get_config config = get_config('易支付') self.API = config['API'] self.ID = config['ID'] self.KEY = config['KEY'] self.JUMP_URL = 'you_retur...
null
service/util/pay/epay/common.py
common.py
py
2,377
python
en
code
null
code-starcoder2
66
[ { "api_name": "service.util.pay.pay_config.get_config", "line_number": 10, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 31, "usage_type": "call" }, { "api_name": "re.s...
466000160
import numpy as np from skimage.io import imread, imshow import matplotlib.pyplot as plt from copy import copy from math import pi, cos, sin import time ''' The pixel being looked at is the one that is in the middle. The ray will go both "back and forth". ''' def restorate(img_data, pixel_radius = 40, directions = 40)...
null
carl/road_renovation_singlecore.py
road_renovation_singlecore.py
py
3,476
python
en
code
null
code-starcoder2
66
[ { "api_name": "copy.copy", "line_number": 12, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 30, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 50, ...
527344147
import logging import os from typing import Optional import click import dagster._check as check import uvicorn from dagster._cli.utils import get_instance_for_service from dagster._cli.workspace import ( get_workspace_process_context_from_kwargs, workspace_target_argument, ) from dagster._cli.workspace.cli_ta...
null
python_modules/dagit/dagit/cli.py
cli.py
py
6,709
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 155, "usage_type": "attribute" }, { "api_name": "dagster._utils.log.configure_loggers", "line_number": 157, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 158, "usage_type": "call" }, { "api_nam...
133413342
import cv2 as cv import numpy as np from matplotlib import pyplot as plt img = cv.imread('Test_Images/V2/img1.jpeg',0) thr = 240 ret,thresh1 = cv.threshold(img,thr,255,cv.THRESH_BINARY) ret,thresh2 = cv.threshold(img,thr,255,cv.THRESH_BINARY_INV) ret,thresh3 = cv.threshold(img,thr,255,cv.THRESH_TRUNC) ret,thresh4 = cv....
null
Pi/Vision/simple.py
simple.py
py
1,110
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.threshold", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.THRESH_BINARY", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "lin...
487301536
from django.db import models class TaskStatus(models.TextChoices): IN_PROGRESS = 'IN_PROGRESS' DONE_SUCCESS = 'DONE_SUCCESS' DONE_FAILED = 'DONE_FAILED' class BookGenerationTask(models.Model): task_status = models.CharField( max_length=16, choices=TaskStatus.choices ) celery_...
null
app/models.py
models.py
py
537
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.TextChoices", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_...
606842343
#!/usr/bin/env python import datetime import hashlib import os import os import re import sqlite3 import sys import time import timeit from FileUtils import * from datetime import datetime, date from sys import platform as _platform class DBFileListing: def __init__(self, dblocation=None,local=False): p...
null
DBToolsClass.py
DBToolsClass.py
py
50,211
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isfile", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 36, "usage_type": "call" }, { "api_name": "sys.stdout.write", "l...
516209735
from goose import Goose from happynewsflash.extraction.models import Story from happynewsflash.sentiment.classifier_framework import get_happy_probability SENTIMENTS_THRESHOLD = 0.5 def find_sentiment(url): goose = Goose() article = goose.extract(url=url) cleaned_article = article.cleaned_text score ...
null
happynewsflash/extraction/importer/common.py
common.py
py
800
python
en
code
null
code-starcoder2
66
[ { "api_name": "goose.Goose", "line_number": 8, "usage_type": "call" }, { "api_name": "goose.extract", "line_number": 9, "usage_type": "call" }, { "api_name": "happynewsflash.sentiment.classifier_framework.get_happy_probability", "line_number": 12, "usage_type": "call" }...
264154889
from rest_framework import serializers from .models import Team from player.models import Manager, Player from player.serializers import ManagerFullSerializer, ManagerSerializer, RosterFullSerializer, RosterSerializer from song.models import Song, Review class TeamSerializer(serializers.HyperlinkedModelSerializer): ...
null
server/team/serializers.py
serializers.py
py
2,124
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.serializers.HyperlinkedModelSerializer", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 8, "usage_type": "name" }, { "api_name": "player.serializers.ManagerSerializer", "line_number": 9, ...
235741037
from django.shortcuts import render from .serializers import LogSerializer from rest_framework import generics from .models import DeviceLogs from django.conf import settings from django.core.mail import send_mail import smtplib # Create your views here. class Logs(generics.ListCreateAPIView): queryset = DeviceLogs...
null
monitoring/api/views.py
views.py
py
1,489
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.generics.ListCreateAPIView", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 9, "usage_type": "name" }, { "api_name": "models.DeviceLogs.objects.all", "line_number": 10, "usage_type": "ca...
442560107
from twilio.rest import TwilioRestClient import twilio.twiml from flask import Flask, request, redirect import json import re import googlemaps from datetime import datetime gmaps = googlemaps.Client(key='AIzaSyAOHs5bYxYRWtFkBCOHAFkcS3-nrMd91BE') app = Flask(__name__) myDictionary = {} listOfStarbucks = ["105 14th...
null
app.py
app.py
py
6,077
python
en
code
null
code-starcoder2
66
[ { "api_name": "googlemaps.Client", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.datetime...
594119042
from django.shortcuts import render from .forms import CommitForm from django.contrib import messages from django.urls import reverse from .models import Commit from django.contrib.auth.models import User import random import string from django.core.cache import cache from django.contrib.auth.decorators import login_re...
null
github/commit/views.py
views.py
py
1,783
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name": "forms.CommitForm", "line_number": 27, "usage_type": "call" }, { "api_name": "string.ascii_letters", "line_number": 32, "usage_type": "attribute" }, { "api_name": "st...
1090824
import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities import common_pb2 as common__pb2 import service_pb2 as service__pb2 class HelloWorldStub(object): def __init__(self, channel): """Constructor. Args: channel: A grpc.Chann...
null
python/service_pb2_grpc.py
service_pb2_grpc.py
py
1,292
python
en
code
null
code-starcoder2
66
[ { "api_name": "common_pb2.Identifier", "line_number": 19, "usage_type": "attribute" }, { "api_name": "service_pb2.SayHelloToResponse", "line_number": 20, "usage_type": "attribute" }, { "api_name": "grpc.StatusCode", "line_number": 27, "usage_type": "attribute" }, { ...
570103371
#!/usr/bin/python3 import db_connect import json client = db_connect.get_client() test_db_name = "test" db = client[test_db_name] def expand_test_professors(): profs = db['professor'].find() for prof in profs: print(json.dumps(expand(prof), indent=4)) input() def expand_test_courses(): co...
null
gateway_poc/gateway_poc/DB_PoC/query_db/expansion.py
expansion.py
py
1,366
python
en
code
null
code-starcoder2
66
[ { "api_name": "db_connect.get_client", "line_number": 5, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 18, "usage_type": "call" } ]
542021589
import logging #log to file #logging.basicConfig(filename = 'log.txt', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') #notice the 'string formating' #log to screen logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') #notice the 'string formating' #di...
null
Projects/Intro_and_ATBSwPy/logging_examples.py
logging_examples.py
py
1,091
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.disable", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.CRITICAL...
639490532
#!/usr/bin/env python import subprocess import locale import json from conf import conf encoding = locale.getdefaultlocale()[1] if conf['type'] == 'bareos': command="echo show jobs | timeout %d bconsole -c %s | grep -i name | cut -d \'\"\' -f 2" % (conf['bconsole_wait'], conf['bconsole_conf_file']) elif conf['t...
null
get-jobs.py
get-jobs.py
py
823
python
en
code
null
code-starcoder2
66
[ { "api_name": "locale.getdefaultlocale", "line_number": 9, "usage_type": "call" }, { "api_name": "conf.conf", "line_number": 11, "usage_type": "name" }, { "api_name": "conf.conf", "line_number": 12, "usage_type": "name" }, { "api_name": "conf.conf", "line_numb...
156065828
from bs4 import BeautifulSoup import requests import pandas as pd #Extract the text (if any) from a set of links def gettext(urls, textlength): finaltexts=pd.DataFrame() for u in list(urls.values): try: #Get the website res=requests.get(u[1]) ...
null
geturltext.py
geturltext.py
py
1,431
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.DataFrame", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.Series", "l...
84380716
import unittest # This has to occur post ClickTestCase import click from biolinkml.generators.jsonschemagen import cli from tests import source_yaml_path from tests.test_scripts.clicktestcase import ClickTestCase class GenJSONSchemaTestCase(ClickTestCase): testdir = "genjsonschema" click_ep = cli prog_na...
null
tests/test_scripts/test_gen_json_schema.py
test_gen_json_schema.py
py
820
python
en
code
null
code-starcoder2
66
[ { "api_name": "tests.test_scripts.clicktestcase.ClickTestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "biolinkml.generators.jsonschemagen.cli", "line_number": 12, "usage_type": "name" }, { "api_name": "tests.source_yaml_path", "line_number": 20, "usage_...
5847776
#!/usr/bin/env python import numpy as np import pandas as pd import keras import timeit import copy import gc import scipy as sp import cv2 import os import random import sys from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from keras.models import Sequential from ker...
null
FacesKinship/kin_neural_network-VGGFace-vgg16.py
kin_neural_network-VGGFace-vgg16.py
py
7,709
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.py_func", "line_number": 35, "usage_type": "call" }, { "api_name": "sklearn.metrics.roc_auc_score", "line_number": 35, "usage_type": "argument" }, { "api_name": "tensorflow.double", "line_number": 35, "usage_type": "attribute" }, { "api_n...
165900793
import numpy as np import argparse import logging import scipy import os, glob from matplotlib import pyplot import matplotlib as mpl import matplotlib.pyplot as plt from constants import k from IPython import embed import math import sys from whamutils import get_negloghist, extract_and_reweight_data from work_...
null
scratch/protein_analysis/wham_ni_v_phi.py
wham_ni_v_phi.py
py
4,380
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "work_managers.environment.default_env.add_wm_args", "line_number": 35, "usage_type": "call" }, { "api_name": "work_managers.environment.default_env", "line_number": 35, "usa...
44842438
# Copyright (c) 2015 Cloudera, Inc. All rights reserved. # Validates table stored on the LocalFileSystem. # import pytest from subprocess import check_call, call from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIf from tests.common.test_dimensions import create_single_exec_o...
null
tests/query_test/test_multiple_filesystems.py
test_multiple_filesystems.py
py
2,326
python
en
code
null
code-starcoder2
66
[ { "api_name": "tests.common.impala_test_suite.ImpalaTestSuite", "line_number": 13, "usage_type": "name" }, { "api_name": "tests.common.test_dimensions.create_single_exec_option_dimension", "line_number": 25, "usage_type": "call" }, { "api_name": "subprocess.call", "line_numbe...
178029186
import base64 import os from werkzeug import secure_filename from werkzeug.datastructures import FileStorage from wtforms import SubmitField from flask_wtf.file import FileField, FileRequired, FileAllowed from flask_wtf import FlaskForm from app import application from .helpers import * from .config import * from flask...
null
code/app/routes.py
routes.py
py
5,352
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask_wtf.FlaskForm", "line_number": 15, "usage_type": "name" }, { "api_name": "flask_wtf.file.FileField", "line_number": 19, "usage_type": "call" }, { "api_name": "flask_wtf.file.FileRequired", "line_number": 20, "usage_type": "call" }, { "api_name...
610462861
import numpy as np import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import systems_fun as sf from scipy.integrate import solve_ivp import os def saveHeteroclinicsDataAsTxt(HeteroclinicsData, pathToDir, fileName ): """ (i, j, a, b, r, dist) """ if HeteroclinicsData: header...
null
plotFun.py
plotFun.py
py
6,477
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "numpy.savetxt", "line_num...
296340451
from typing import TYPE_CHECKING from rotkehlchen.chain.evm.accounting.airdrop import BaseAirdropsAccountant if TYPE_CHECKING: from rotkehlchen.chain.evm.node_inquirer import EvmNodeInquirer from rotkehlchen.user_messages import MessagesAggregator class AirdropsAccountant(BaseAirdropsAccountant): def _...
null
rotkehlchen/chain/arbitrum_one/modules/airdrops/accountant.py
accountant.py
py
657
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 5, "usage_type": "name" }, { "api_name": "rotkehlchen.chain.evm.accounting.airdrop.BaseAirdropsAccountant", "line_number": 10, "usage_type": "name" } ]
537851598
# -*- coding:utf-8 -*- import re import copy import sqlite3 import os from util import * def split_by_element(lyst, split_flg): ret = [] cur_lyst = [] for x, b in zip(lyst, split_flg): if b: ret.append(cur_lyst) cur_lyst = [] else: cur_lyst.append(x) ...
null
parser_k.py
parser_k.py
py
14,004
python
en
code
null
code-starcoder2
66
[ { "api_name": "copy.deepcopy", "line_number": 41, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 52, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 53, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 5...
396148333
import time import gevent import pytest from relay.network_graph.graph import CurrencyNetworkGraph def link_graph(proxy, graph, full_sync_interval=None): if full_sync_interval is not None: proxy.start_listen_on_full_sync(_create_on_full_sync(graph), full_sync_interval) proxy.start_listen_on_balance(...
null
tests/chain_integration/test_graph_integration.py
test_graph_integration.py
py
3,519
python
en
code
null
code-starcoder2
66
[ { "api_name": "relay.network_graph.graph.CurrencyNetworkGraph", "line_number": 46, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 44, "usage_type": "call" }, { "api_name": "relay.network_graph.graph.CurrencyNetworkGraph", "line_number": 54, "usage_...
602671035
import logging import scrapelib from document import Document, get_new_urls from .base_scraper import BaseScraper from lxml import html from concurrent.futures import ThreadPoolExecutor from urllib.parse import urljoin from utils import ensure_absolute_url # Logger object for this module log = logging.getLogger(__nam...
null
bidwire/scrapers/boston_notice_scraper.py
boston_notice_scraper.py
py
3,237
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "base_scraper.BaseScraper", "line_number": 15, "usage_type": "name" }, { "api_name": "scrapelib.Scraper", "line_number": 20, "usage_type": "call" }, { "api_name": "concurre...
526941802
#------------------------------------------------------------------------------ # Name: eMAS (SEAC4RS) vs. MODIS & Aeronet Plotting # Description: NASA Aerosol Project # # Author: Robert S. Spencer # # Created: 6/28/2016 # Python: 3.5 #---------------------------------------------------------------...
null
eMAS_vs_Aeronet/eMAS_Aeronet_Plotting_Individual_Merged.py
eMAS_Aeronet_Plotting_Individual_Merged.py
py
3,288
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 39, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 39, "usage_type": "name" }, { "api_name": "matplotlib...
78446758
''' Function: Multi-head Attention Module Author: Zhenchao Jin ''' import torch import torch.nn as nn from ..dropout import BuildDropout '''Multi-head Attention''' class MultiheadAttention(nn.Module): def __init__(self, embed_dims, num_heads, attn_drop=0., proj_drop=0., dropout_cfg=None, batch_first=False...
null
ssseg/modules/backbones/bricks/transformer/mha.py
mha.py
py
2,088
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.MultiheadAttention", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", ...
379292006
import json from . import url from . import user class Message: def __init__(self, url, time, user, message, pm, data): """ :param url: A URL, this essentially points to a protocol and channel/host :param time: The time this message was recieved or sent :param user: The user this m...
null
pyfork/message.py
message.py
py
1,053
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dumps", "line_number": 25, "usage_type": "call" } ]
262987850
from rest_framework import response from ..models import PurchaseOrder, PurchaseOrderItem from ..serializers import PurchaseOrderSerializer from ..forms import PurchaseOrderForm, PurchaseOrderItemForm from .base_viewset import BaseViewSet class PurchaseOrderViewSet(BaseViewSet): queryset = PurchaseOrder.objects.al...
null
stock_manager/viewsets/purchase_order_viewset.py
purchase_order_viewset.py
py
1,102
python
en
code
null
code-starcoder2
66
[ { "api_name": "base_viewset.BaseViewSet", "line_number": 7, "usage_type": "name" }, { "api_name": "models.PurchaseOrder.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.PurchaseOrder.objects", "line_number": 8, "usage_type": "attribute" }, ...
318516216
from django.conf import settings from django.conf.urls.static import static from . import views from django.urls import path urlpatterns = [ path('', views.index, name='acount/index'), #Редактирование профиля path('hotels/', views.hotels, name='acount/hotels'), #...
null
acount/urls.py
urls.py
py
1,424
python
en
code
null
code-starcoder2
66
[ { "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", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
575019561
import unittest from django.core.urlresolvers import reverse from django.test import Client from .models import Provider from django.contrib.auth.models import User from django.contrib.auth.models import Group from django.contrib.contenttypes.models import ContentType def create_django_contrib_auth_models_user(**kwar...
null
wheresyourtrash/apps/email2sms/tests.py
tests.py
py
2,233
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.models.User.objects.create", "line_number": 15, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.contrib.auth.models.User", "line_number": ...
126633108
# -*- coding: utf-8 -*- import scrapy from ..items import SlickscraperItem from datetime import date class SlickdealsSpider(scrapy.Spider): name = 'slickdeals' allowed_domains = ['slickdeals.net'] start_urls = ['http://www.slickdeals.net/'] def parse(self, response): items=SlickscraperItem() ...
null
slickscraper-SQLite/slickscraper/spiders/slickdeals.py
slickdeals.py
py
1,045
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "items.SlickscraperItem", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime...
201287217
from recognize import recognize from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.select import Select import openpyxl, os, re, sys, time RunFromIDLE = None # True если скрипт запущен из IDLE ...
null
SIpON addr/SIpONaddr headless No Captcha.py
SIpONaddr headless No Captcha.py
py
12,598
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 21, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 21, "usage_type": "name" }, { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 23, "usage_type": "call" }, {...
160851203
import time import cv2 # source of video output camera = cv2.VideoCapture("conv2B test3.avi") # camera = cv2.VideoCapture("vtest.avi") # camera = cv2.VideoCapture(0) # background subtraction method---- MOG2 bs = cv2.createBackgroundSubtractorMOG2(history=250, detectShadows=True) # Duration of screen to sleep mode (...
null
Store image Simple_object_detection_with_MOG.py
Store image Simple_object_detection_with_MOG.py
py
4,376
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.createBackgroundSubtractorMOG2", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.getStructuringElement", "line_number": 17, "usage_type": "call" }, { "api_...
403019223
from django.test import TestCase from rest_framework.test import APIClient from django.core.urlresolvers import reverse from .models import Company class CompanyTest(TestCase): def setUp(self): self.client = APIClient() def test_api_can_create_team(self): old_count = Team.objects.count() ...
null
api/companies/tests.py
tests.py
py
652
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "rest_framework.test.APIClient", "line_number": 10, "usage_type": "call" }, { "api_name": "django.core.urlresolvers.reverse", "line_number": 17, "usage_type": "call" } ]
455006682
# Problem [5656] : [모의 SW 역량테스트] 벽돌 깨기 from collections import deque from copy import deepcopy import sys sys.stdin = open('input.txt') dx = [-1, 0, 1, 0] dy = [0, 1, 0, -1] def BFS(n, arr): copy_Arr = deepcopy(arr) queue = deque() for i in range(H): if copy_Arr[i][n]: if copy_Arr[i][n...
null
SWEA/SW_TEST/SWEA_5656/SWEA_5656.py
SWEA_5656.py
py
1,893
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.stdin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "copy.deepcopy", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 12, "usage_type": "call" } ]
420465578
import pandas as pd import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from sklearn import neighbors from sklearn import gaussian_process # Import dataset data = pd.read_csv('datasetA.csv', header=None) data = data.as_matrix() L1,L2 = data.shape L2...
null
knn-GP-model.py
knn-GP-model.py
py
2,394
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 26, "usage_type": "name" }, { "api_name": "numpy.aran...
480646478
#!/usr/bin/env python # -*- coding:utf-8 -*- from flask import Flask from flask import render_template import pymysql app = Flask(__name__,template_folder='app/templates') #主页 @app.route('/', methods=['GET', 'POST']) def index(): conn = pymysql.connect(host='127.0.0.1', user='root', password='123456', db='stu...
null
app.py
app.py
py
802
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 22, "usage_type": "call" }, { "api_name": "flask.render_templa...
306694471
#!/usr/bin/env python3 # -*-coding: utf-8-*- # Author : Chris # Blog : http://blog.chriscabin.com # GitHub : https://www.github.com/chrisleegit # File : server.py # Date : 16-7-12 # Version: 0.1 # Description: import socketserver, time from datetime import datetime class RequestHandler(socketserver.BaseReques...
null
ch12/socketserver/server.py
server.py
py
951
python
en
code
null
code-starcoder2
66
[ { "api_name": "socketserver.BaseRequestHandler", "line_number": 15, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "name" }, { "api_...