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
244727991
# -*- coding:utf-8 -*- import pymysql db = pymysql.connect("192.168.1.4", "zsbusiness", "3cF8ST", "zzss_audit", charset='utf8') cursor = db.cursor() year_list_sql = "SELECT * FROM `zs_audit_data` WHERE DATE >= '2018-02-14' AND DATE <= '2018-02-27';" cursor.execute(year_list_sql) year_list = cursor.fetchall()
null
20190214/概率变动产品编号.py
概率变动产品编号.py
py
316
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymysql.connect", "line_number": 5, "usage_type": "call" } ]
121935351
import torch from torch.optim.optimizer import Optimizer, required class MDNesterov(Optimizer): r""" (batch, mini-batch)Stochastic gradient descent: $$ \theta \gets \theta - \eta \sum_{i=1}^{B} \frac{\partial l_i}{\partial \theta}. $$ """ def __init__(self, params, lr=required, ...
null
MDNesterov.py
MDNesterov.py
py
6,352
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.optim.optimizer.Optimizer", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.optim.optimizer.required", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.optim.optimizer.required", "line_number": 12, "usage_type": "name" ...
220364480
import argparse import codecs import copy import logging import sys import dockercloud import requests from dockercloudcli import commands from dockercloudcli import parsers from dockercloudcli.exceptions import InternalError from . import __version__ requests.packages.urllib3.disable_warnings() sys.stdout = codecs...
null
dockercloudcli/cli.py
cli.py
py
15,720
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.packages", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 17, "usage_type": "attribute" }, { ...
415160161
from functools import wraps from authutils.errors import JWTError, JWTExpiredError import flask from flask_sqlalchemy_session import current_session from fence.errors import Unauthorized, InternalError from fence.jwt.validate import validate_jwt from fence.models import User, IdentityProvider from fence.user import g...
null
fence/auth.py
auth.py
py
5,929
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_sqlalchemy_session.current_session.query", "line_number": 35, "usage_type": "call" }, { "api_name": "fence.models.User", "line_number": 36, "usage_type": "argument" }, { "api_name": "flask_sqlalchemy_session.current_session", "line_number": 35, "usage...
358368988
from os import environ from typing import Tuple, Union from src.utils.response import UJSONResponse, to_response from .service import API, APIService class UserAPI: api_url = environ.get('USER_API') request = APIService(API(api_url)) @classmethod def find_user( cls, email: str, ...
null
src/services/user_api.py
user_api.py
py
821
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "name" }, { "api_name": "service.APIService", "line_number": 10, "usage_type": "call" }, { "api_name": "service.API", "line_nu...
287557647
from django.shortcuts import render from django.http import HttpResponse from django.http.response import HttpResponseRedirect, HttpResponseRedirectBase from django import forms import time from bootstrap3_datetime.widgets import DateTimePicker class LogcmdForm(forms.Form): customer_id = forms.IntegerField(requir...
null
j_app/logcmd_view.py
logcmd_view.py
py
4,481
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.Form", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "django.forms.IntegerField", "line_number": 9, "usage_type": "call" }, { "api_name": "django.for...
374222520
from selenium import webdriver from selenium.webdriver.firefox.options import Options import time import numpy as np import pandas as pd import sys def create_browser(start_url): o = Options() o.add_argument('-private') o.headless = True #o.add_argument("--headless"); browser = webdriver.Firefox(options=o) br...
null
selenium_nba.py
selenium_nba.py
py
1,754
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.firefox.options.Options", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, ...
530404318
r""" Show numerical precision of $2 J_1(x)/x$. """ import sys; sys.path.insert(0, '..') import numpy as np try: from mpmath import mp except: # CRUFT: mpmath split out into its own package from sympy.mpmath import mp #import matplotlib; matplotlib.use('TkAgg') import pylab SHOW_DIFF = True # True if show...
null
explore/lgamma.py
lgamma.py
py
3,045
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sympy.mpmath.mp.workprec", "line_number": 26, "usage_type": "call" }, { "api_name": "sympy.mpmath.mp"...
113230167
from palm_roi_detection_SVM import * from utils import * def demo_handsegment_method(): full_mask = cv2.imread('image_demo/compare/02.png',0) full_mask = cv2.resize(full_mask, (640,480)) from utils import hand_mask_segmentation_choose_max_roi from wrist_line import detectHandByWristCrop hand_mask, ...
null
demo_everything.py
demo_everything.py
py
6,445
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.hand_mask_segmentation_choose_max_roi", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.apply_brightness_contrast", "line_number": 55, "usage_type": "call" } ]
474221628
import os import sys import time import glob import logging import argparse import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data as data import torch.backends.cudnn as cudnn import torchvision.transforms as transforms from utils import AverageMeter, EMA, Logger...
null
train_base.py
train_base.py
py
16,739
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 74, "usage_type": "call" }, { "api_name": "os.path", "line_number": 74, "usage_type": "attribute" }, { "api_name": "utils.create_exp_di...
10195016
from turtle import Screen from paddle import Paddle from ball import Ball from scoreboard import Scoreboard import time #screen details screen = Screen() screen.bgcolor('black') screen.setup(width = 800, height = 600) screen.title("Fun With POGO") screen.tracer(0) #objects r_paddle = Paddle(350,0) l_paddle = Paddle(-...
null
main.py
main.py
py
1,187
python
en
code
null
code-starcoder2
76
[ { "api_name": "turtle.Screen", "line_number": 8, "usage_type": "call" }, { "api_name": "paddle.Paddle", "line_number": 15, "usage_type": "call" }, { "api_name": "paddle.Paddle", "line_number": 16, "usage_type": "call" }, { "api_name": "ball.Ball", "line_number...
12492720
import lxml import bs4 from bs4 import BeautifulSoup as bs from lxml import etree class ParseXml: @staticmethod def html_to_xml(html, xslt): """ 此方法将网页经过xslt文件筛选 :param html: 网页源码,需要经过编码 :param xslt_name: xslt文件路径 :return: 解析过后的xml内容 """ try: ...
null
jiangsu/conf/parsexml.py
parsexml.py
py
6,322
python
en
code
null
code-starcoder2
76
[ { "api_name": "lxml.etree.HTML", "line_number": 19, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 19, "usage_type": "name" }, { "api_name": "lxml.etree.XSLT", "line_number": 20, "usage_type": "call" }, { "api_name": "lxml.etree", "line_num...
482367633
from flask import Blueprint, jsonify, request, redirect, current_app, render_template from flask.helpers import send_file from zipfile import ZipFile import io from os.path import basename from werkzeug.exceptions import InternalServerError #import py-fasta-validator # for validating fasta files from api.utils import ...
null
website-glen/api/api/views.py
views.py
py
5,712
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 32, "usage_type": "call" }, { "api_name": "werkzeug.exceptions.InternalServerError", "line_number": 23, "usage_type": "argument" }, { ...
351011397
#!/usr/bin/env python #-*- coding:utf-8 -*- from torchvision import datasets, models, transforms from torch.utils.data import DataLoader import torch.optim as optim import torch, torchvision import torch.nn as nn import matplotlib.pyplot as plt import numpy as np import time import os root_dir = "/program/wf/data/Br...
null
modelsearch/train.py
train.py
py
8,090
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.device", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torchvision.tran...
648843829
from bs4 import BeautifulSoup import requests,os,shutil,time headers = { 'User-Agent': "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", 'Accep...
null
main.py
main.py
py
2,634
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_...
200915418
import os import shutil from typing import Union, List from app.file_utils import make_dir_with_chmod from app.services.storage_service.acl import Acl from app.services.storage_service.exceptions import StorageServiceException from app.services.storage_service.file_manager import FileManager class MountedVolumeFileM...
null
app/services/storage_service/mounted/local_file_manager.py
local_file_manager.py
py
4,531
python
en
code
null
code-starcoder2
76
[ { "api_name": "app.services.storage_service.file_manager.FileManager", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { "ap...
541778334
import time import pickle import numpy as np import torch import torch.nn.utils import json from baseline_lstm import LSTM_Model from datetime import datetime import sys sys.path.append('../') # needed to access functions in the parent directory from constituency_preprocess import WVC #with open('../trainlist.txt',...
null
models_in_progress/constituency_lstm_main.py
constituency_lstm_main.py
py
7,850
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 20, "usage_type": "call" }, { "api_name": "pickle.load", "line_num...
625570479
import os import numpy as np from PIL import Image import random from datetime import datetime import matplotlib.pyplot as plt from matplotlib import cm os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # set TF logging to ERROR, needs to be done before importing TF import tensorflow as tf from tensorflow.keras.preprocessing.i...
null
a2ndl-hw/2-img_segmentation/vgg_base.py
vgg_base.py
py
12,900
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "dataset_types.Subdataset.ROSEAU", "line_number": 27, "usage_type": "attribute" }, { "api_name": "dataset_types.Subdataset", "line_number": 27, "usage_type": "name" }, { "api_...
359062465
#!/usr/bin/env python import logging from zk_transformation import ZKTransformation def add_parsers(zk_tran, parser): new_list = [] for parserStage in parser["parserStages"]: if parserStage["type"] == "text": new_list.append({"type": "xml", "enabled": True}) logging.info("Fo...
null
transformations/zk_add_parsers.py
zk_add_parsers.py
py
771
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.info", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 15, "usage_type": "call" }, { "api_name": "zk_transformation.ZKTransformation", "line_number": 22, "usage_type": "call" } ]
523098869
# coding: utf-8 from flask.ext.script import Command, Option from .models import Campaign class ListCampaign(Command): "prints a list of campaigns" command_name = 'list_campaigns' option_list = ( Option('--title', '-t', dest='title'), ) def run(self, title=None): campaigns = C...
null
commands.py
commands.py
py
473
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.ext.script.Command", "line_number": 7, "usage_type": "name" }, { "api_name": "flask.ext.script.Option", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Campaign.objects", "line_number": 18, "usage_type": "attribute" }, { "api_...
619113190
import speech_recognition as speech from googletrans import Translator #initialise audio recogniser audio_recogniser = speech.Recognizer() #initialise translator translator = Translator() #initialise audio source with speech.Microphone() as source: print('Say something into the microphone!') #takes input fro...
null
basic_speechrecog.py
basic_speechrecog.py
py
950
python
en
code
null
code-starcoder2
76
[ { "api_name": "speech_recognition.Recognizer", "line_number": 5, "usage_type": "call" }, { "api_name": "googletrans.Translator", "line_number": 8, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 11, "usage_type": "call" }, { "...
209906364
import urllib2 from bs4 import BeautifulSoup url = "http://scores.nbcsports.msnbc.com/cbk/scoreboard.asp" page = urllib2.urlopen(url) soup = BeautifulSoup(page) scores = soup("table", { 'class':'shsTable shsLinescore'}) game_counter = 0 for score in scores: game_counter += 1 box = score.first("table") ...
null
jordan_madness.py
jordan_madness.py
py
456
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib2.urlopen", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 6, "usage_type": "call" } ]
392906415
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import cv2 import torch from torch import nn from torch.autograd import Function # from torch.autograd.function import once_differentiable import _C def nms_rotate...
null
my_tools/rotate_ops.py
rotate_ops.py
py
9,239
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 24, "usage_type": "attribute" }, { "api_name": "cv2.rotatedRectangleIntersection", "line_number": 42, "usage_type": "call" }, { "api_name": "cv2.conve...
458451166
import json import pandas as pd # Open JSON files containing countries and US ROIs with open('countries.json') as country_file, open('USrois.json') as US_file: countries = json.load(country_file) US = json.load(US_file) # Instantiate DataFrame df = pd.DataFrame (columns = ['roi','region', 'subregion']) # Fi...
null
niddk_covid_sicr/rois_to_csv.py
rois_to_csv.py
py
982
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "json.load", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 11, "usage_type": "call" } ]
218776157
#!/usr/bin/env python import threading from queue import Queue import time import socket import argparse import sys # a print_lock is what is used to prevent "double" modification of shared variables. # this is used so while one thread is using a variable, others cannot access # it. Once done, the thread releases the p...
null
scan.py
scan.py
py
2,269
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Lock", "line_number": 12, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.exit", "...
183049265
# -*- coding: utf-8 -*- """ CSCI-GA.3033-003 - Project: Finding Napa R. Feng, C. Gilbert, G. Ng Contains Python wrappers for various Hadoop tools function impRunClass: Unpickles and returns an existing runHadoop class class runHadoop: contains execution and testing methods for MapReduce """ import subprocess import ...
null
tools/HadoopTools.py
HadoopTools.py
py
21,319
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 23, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 40, "usage_type": "call" }, { "api_name": "os.devnull", "line_number": 71, "usage_type": "attribute" }, { "api_name": "pickle.dump", "...
199425788
from typing import List, Dict, Any import pandas as pd import torch from torch.utils.data import Dataset from transformers import DataCollatorWithPadding as HfDataCollatorWithPadding from .utils import from_config class CustomDataset(Dataset): """Dataset for CZ4034 - Money, Food and Service Aspects Extraction ta...
null
utils/data.py
data.py
py
4,028
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.utils.data.Dataset", "line_number": 10, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 40, "usage_type": "call" }, { "api_name": "utils.from_con...
140321152
# -*- coding: utf-8 -*- """ Created on Wed Jun 12 13:48:29 2019 @author: laure """ import sys, pygame, random pygame.init() SIZE = [1200, 800] width, height = SIZE WHITE = [255, 255, 255] BLACK = [ 0, 0, 0] RED = [255, 0, 0] screen = pygame.display.set_mode(SIZE) class Voyageur: def __init__(self,sur...
null
projet_prog_objet/projet_foule.py
projet_foule.py
py
2,315
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pygame.draw.ci...
416560059
__author__ = 'aditrugman' from questions import * import json from room import * import client import competitor import time import BaseHTTPServer from urlparse import urlparse, parse_qs from SocketServer import ThreadingMixIn import cgi import sys from questions import Question, Questions class RequestHandler(BaseH...
null
server/web_service.py
web_service.py
py
15,187
python
en
code
null
code-starcoder2
76
[ { "api_name": "BaseHTTPServer.BaseHTTPRequestHandler", "line_number": 17, "usage_type": "attribute" }, { "api_name": "client.clients.get", "line_number": 51, "usage_type": "call" }, { "api_name": "client.clients", "line_number": 51, "usage_type": "attribute" }, { ...
242798919
import re import time import numpy as np import pandas as pd from collections import Counter from helper import trans, is_english_letters, sub_space, flow data_dir = 'Urdu datasets/' regex_chars = '[\'".-`]' regex_alphabets = '[^a-zA-z]' base_filename = 'Roman urdu datasets/Roman_Urdu_Words.csv' timestamp = str(time.t...
null
words_compilation.py
words_compilation.py
py
4,608
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 20, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 34, "usage_type": "call" }, { "api_name": "helper.is_english_letters", "line_number"...
308502237
# -*- coding: utf-8 -*- # --------------------------------------------------------------------------- # CRS_Main7_Add_Attr_Index_CONTEXT.py # Created on: 2018-06-08 # # Usage: # Description: copy Connect_Property from assets.gdb to pre-prod SSREPORT sde database # ---------------------------------------------------...
null
crs_scripts/3x/CRS_Main7_Add_Attr_Index_CONTEXT.py
CRS_Main7_Add_Attr_Index_CONTEXT.py
py
6,998
python
en
code
null
code-starcoder2
76
[ { "api_name": "arcpy.env", "line_number": 18, "usage_type": "attribute" }, { "api_name": "config.Settings.CONTEXT_SDE_PATH", "line_number": 24, "usage_type": "attribute" }, { "api_name": "config.Settings", "line_number": 24, "usage_type": "name" }, { "api_name": "...
5058515
""" This example evaluates the volume potential over [-1,1]^2 with the Laplace kernel. """ from __future__ import absolute_import, division, print_function __copyright__ = "Copyright (C) 2017 - 2018 Xiaoyu Wei" __license__ = """ Permission is hereby granted, free of charge, to any person obtaining a copy of this ...
null
examples/laplace2d.py
laplace2d.py
py
13,089
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 34, "usage_type": "attribute" }, { "api_name": "logging.basic...
338677469
#%% # -*- coding: utf-8 -*- import pickle import os import numpy as np import matplotlib from matplotlib import pyplot as plt with open(os.path.join(os.getcwd(), '..', 'results', 'mnist_5layer_mlff', 'e99.pickle'), 'rb') as F: Results = pickle.load(F) mlff_dW = Results['mean dW'] with open(os.path.join(os.get...
null
scripts/mnist_5layer_dw.py
mnist_5layer_dw.py
py
1,230
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 10, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": ...
146257061
from random import expovariate, normalvariate, uniform, triangular from queue import Queue from channel import Channel from task import Task from globals import * from matplotlib import pyplot as plot class Phase: def __init__(self, channels_count, generator, queue_length, next_phase, function_log_callba...
null
sixth/phases.py
phases.py
py
5,690
python
en
code
null
code-starcoder2
76
[ { "api_name": "channel.Channel", "line_number": 15, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 16, "usage_type": "call" }, { "api_name": "channel.is_available", "line_number": 22, "usage_type": "attribute" }, { "api_name": "channel.update"...
580263108
#!/usr/bin/env python3 import sys if sys.version_info.major < 3: print('python3 required!') exit() import gadget import ChaNGa import tipsy import argparse import math import numpy as np parser = argparse.ArgumentParser(description='Convert GADGET2 files to ChaNGa files') parser.add_argument('gadget_file', ...
null
gadget2changa.py
gadget2changa.py
py
6,737
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 5, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "gadget.parameter_file", "line_number": 29, "usage_type": "call" }, { "api_name": "ga...
261811306
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Chop up multiple GDC SVS files into tiles. Some of the behaviour here is pretty cranky, designed around some particular constraints in the storage & compute setup for the Kidney project. You probably want to run with the --no_cache option, at least. ''' import sys, ...
null
bulk_tile.py
bulk_tile.py
py
9,093
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2...
106792369
if __name__ == "__main__": import os, sys from collections import defaultdict sys.path.append(os.path.join(os.environ['EBB'],'IlluminaPE/simerr')) from miscBowTie import BowTieReader, BowTieWriter from cPickle import * from optparse import OptionParser from c_composite import compose2 # the cython version of com...
null
simerr/run_composite.py
run_composite.py
py
1,873
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
247128730
# -*- coding=utf-8 -*- ''' Created on 2013-12-10上午10:44:10 @author: lingjun.gong(jialan) ''' import gevent from gevent import Timeout seconds = 2 timeout = Timeout(seconds) timeout.start() def wait(): gevent.sleep(2) try: gevent.spawn(wait).join() except Timeout: print('Could not complete')
null
test_gevent/test_timeout_1.py
test_timeout_1.py
py
313
python
en
code
null
code-starcoder2
76
[ { "api_name": "gevent.Timeout", "line_number": 13, "usage_type": "call" }, { "api_name": "gevent.sleep", "line_number": 17, "usage_type": "call" }, { "api_name": "gevent.spawn", "line_number": 20, "usage_type": "call" }, { "api_name": "gevent.Timeout", "line_n...
435852300
from flask import Flask, escape, request, render_template, redirect, flash, url_for from flask_sqlalchemy import SQLAlchemy import jinja2 import os app = Flask(__name__) app.config['DEBUG']= True app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://build-a-blog:lc101@localhost:8889/build-a-blog' app.config...
null
main.py
main.py
py
2,649
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 33, "usage_type": "call" }, { "api_name": "flask.re...
85877923
# uncompyle6 version 3.7.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.macosx-10.11-x86_64/egg/djblets/privacy/tests/test_consent_tracker.py # Compiled at: 2019-06-12 01:17:17 """Unit tests for djblets.privacy.consent.tr...
null
pycfiles/Djblets-1.0.12-py2.7/test_consent_tracker.py
test_consent_tracker.py
py
9,745
python
en
code
null
code-starcoder2
76
[ { "api_name": "djblets.privacy.consent.BaseConsentTracker", "line_number": 20, "usage_type": "name" }, { "api_name": "djblets.privacy.consent.BaseConsentRequirement", "line_number": 24, "usage_type": "name" }, { "api_name": "djblets.privacy.consent.BaseConsentRequirement", "l...
447394360
"""690. Employee Importance Time Complexity -O(N) Space Complexity - O(N) Approach ->BFS and hashmap""" """ # Definition for Employee. class Employee: def __init__(self, id: int, importance: int, subordinates: List[int]): self.id = id self.importance = importance self.subordinates = subord...
null
Employeeimp.py
Employeeimp.py
py
885
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" } ]
503877727
from flask import abort, Blueprint, g, request, render_template from gitmostwanted.models.repo import Repo, RepoMean from gitmostwanted.models.user import UserAttitude from gitmostwanted.models import report from gitmostwanted.app import db repo_trending = Blueprint('repo_trending', __name__) @repo_trending.route('/...
null
gitmostwanted/blueprints/repo_trending.py
repo_trending.py
py
1,317
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "gitmostwanted.models.report", "line_number": 14, "usage_type": "argument" }, { "api_name": "gitmostwanted.models.repo.Repo", "line_number": 17, "usage_type": "argument" }, { ...
45820687
#!/usr/bin/python # -*- coding: UTF-8 -*- # # # L_Zealot # May 1, 2017 # # import scipy.io as sio from netCDF4 import Dataset import numpy as np import json import datetime import time # Time settings start_time='2015-01-01 00:00:00' end_time='2015-01-01 00:00:00' # Integration step in Hour int_step=24 #...
null
HKUST-yeq-2016/script/170530-restime-debug-algrithm.py
170530-restime-debug-algrithm.py
py
4,991
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.strptime", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 26, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 27, "usage_type": "call" }, { "api_...
194243397
import bs4 import requests import csv url = 'https://www.melon.com/chart/index.htm' headers = {'User-Agent': '0:)'} # 대신 요청을 보낼 User-Agent Key Value를 만듦(딕셔너리) response = requests.get(url, headers=headers).text text = bs4.BeautifulSoup(response, 'html.parser') rows = text.select('.lst50') writer = csv.writer(open('...
null
00_startcamp/day02/melon50.py
melon50.py
py
761
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 15, "usage_type": "call" } ]
355186796
# encoding: utf-8 import asyncio from aiohttp import web from routes import setup_routes async def test(): return 'test' async def test2(): await test() return 'test2' async def main(): a = await test() b = await test2() print(a, b) if __name__ == '__main__': app = web.Application()...
null
app.py
app.py
py
393
python
en
code
null
code-starcoder2
76
[ { "api_name": "aiohttp.web.Application", "line_number": 24, "usage_type": "call" }, { "api_name": "aiohttp.web", "line_number": 24, "usage_type": "name" }, { "api_name": "routes.setup_routes", "line_number": 25, "usage_type": "call" }, { "api_name": "aiohttp.web.r...
150835603
from collections import defaultdict import pytest def solve(input): all_seen_dict = defaultdict(int) next_arrangement = tuple(input) while True: next_arrangement = get_gext_arrangement(next_arrangement) if next_arrangement in all_seen_dict: return len(all_seen_dict) + 1 ...
null
day_6/test_part1.py
test_part1.py
py
1,096
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 32, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 32, "usage_type": "attribute" } ]
322749812
import threading import queue import cv2 as cv import numpy as np from image_processing.image_to_oled import re_sample class VideoProcess(object): def __init__(self): self.videoThread = threading.Thread(target=self.videoThreading) self.videoThread_run = False self.readFram...
null
python_gui/video_process.py
video_process.py
py
3,701
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 12, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 15, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 16, "usage_type": "call" }, { "api_name": "queue.Queue", "line_numb...
115894297
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import torch import torch.nn as nn import torch.utils.model_zoo as model_zoo import math BN_MOMENTUM = 0.01 model_urls = { 'mobilenet_v2': 'https://download.pytorch.org/models/mobil...
null
src/lib/models/networks/mobilenetv2_det.py
mobilenetv2_det.py
py
10,914
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Sequential", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 19, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
509579613
#!/usr/bin/env python # Load modules import errno import sys import os import argparse import glob from pathlib import Path import re # -------------------- Arguments -------------------- # Parse arguments parser = argparse.ArgumentParser(description='Expand full list of images from an image stack.') parser.add_arg...
null
expand_image_stacks.py
expand_image_stacks.py
py
1,671
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.stdin.readlines", "line_number": 41, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 41, "usage_type": "attribute" }, { "api_name": "glob.glob"...
314009416
#!/usr/bin/env python # encoding: utf-8 #============================================================ # [API] # The HTTP API takes GET requests in the following schema: # freegeoip.net/{format}/{IP_or_hostname} # # <csv> # freegeoip.net/csv/8.8.8.8 # <xml> # freegeoip.net/xml/4.2.2.2 # <json> # freegeoip.net/json/gith...
null
scripts/where_ip_from.py
where_ip_from.py
py
1,268
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "csv.DictWriter", "line_number": 39, "usage_type": "call" } ]
532660274
#referencia em https://makersportal.com/blog/2018/2/25/python-datalogger-reading-the-serial-output-from-arduino-to-analyze-data-using-pyserial import serial def read(directory, eot=0x00000100, baudrate=1200, databits=serial.SEVENBITS, parity=serial.PARITY_EVEN, stopbits=serial.STOPBITS_TWO): '''(str, int, bit_count, b...
null
python/data.py
data.py
py
1,171
python
en
code
null
code-starcoder2
76
[ { "api_name": "serial.SEVENBITS", "line_number": 3, "usage_type": "attribute" }, { "api_name": "serial.PARITY_EVEN", "line_number": 3, "usage_type": "attribute" }, { "api_name": "serial.STOPBITS_TWO", "line_number": 3, "usage_type": "attribute" }, { "api_name": "s...
646214633
#!/usr/bin/env python3 import subprocess import os import sys import time import argparse wfile = os.environ["HOME"]+"/.windowlist" def get(command): return subprocess.check_output(["/bin/bash", "-c", command]).decode("utf-8") def check_window(w_id): w_type = get("xprop -id "+w_id) if " _NET_WM_WINDOW_TY...
null
arrange.py
arrange.py
py
3,212
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "subprocess.check_output", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 22, "usage_type": "call" }, { "api_name": "subpro...
290215892
import os import aiopg demo_data = """ CREATE TABLE users ( id UUID PRIMARY KEY, login VARCHAR(127) NOT NULL UNIQUE ); CREATE TABLE configs ( id UUID PRIMARY KEY, path VARCHAR(255) NOT NULL UNIQUE ); CREATE TABLE user_configs ( id SERIAL PRIMARY KEY, user_id UUID, config_id UUID, CO...
null
cfgbroker/db.py
db.py
py
2,892
python
en
code
null
code-starcoder2
76
[ { "api_name": "aiopg.create_pool", "line_number": 56, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 72, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 93, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
269856922
import chardet import logging import os import pandas as pd import sys as sys def main(argv=None): """ Utilize Pandas library to read in both UNSD M49 country and area .csv file (tab delimited) as well as the UNESCO heritage site .csv file (tab delimited). Extract regions, sub-regions, intermediate regions, count...
null
scripts/met_inspector.py
met_inspector.py
py
11,610
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 39, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 39, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
602021518
import os,inspect,argparse, datetime, copy, itertools, time currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) os.sys.path.insert(0, parentdir) os.sys.path.insert(0, os.path.dirname(currentdir)) import json from b3px_gym.b3px_e...
null
src/distributed_train/mujoco_parallel_batch.py
mujoco_parallel_batch.py
py
6,796
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 2, "usage_type": "call" }, { "api_name": "os.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 2, "usage_type": "call" }, { "api_name": "inspect.getfile", "line...
353063150
import urllib3 import pandas as pd def api_call_request(url): http = urllib3.PoolManager() r = http.request('GET', url) return str(r.data).replace("\\t", "\t").replace("\\n", "\n") def marker_request(api_server, data_version, samples, locations): samples_query = samples.replace(",", "+OR+") url =...
null
src/genomagic_utils/api_server_utils.py
api_server_utils.py
py
1,387
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib3.PoolManager", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 28, "usage_type": "call" } ]
101580893
# uncompyle6 version 3.6.7 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] # Embedded file name: build/bdist.linux-x86_64/egg/pymic/train_infer/get_optimizer.py # Compiled at: 2019-12-07 03:31:59 # Size of source mod 2**32: 1348 bytes...
null
pycfiles/pymica-0.0.19.tar/get_optimizer.cpython-36.py
get_optimizer.cpython-36.py
py
1,564
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.optim.SGD", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.optim", "line_number": 15, "usage_type": "name" }, { "api_name": "torch.optim.Adam", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.optim", "line_...
220503989
import json import numpy as np import scipy.stats as stats import matplotlib.pyplot as plt DIFFICULTY = ['simple', 'easy', 'intermediate', 'expert'] def find_rank(data, correct=False): m = len(data) # Test whether any two samples are from the same distribution. p_values = np.zeros(m - 1) for idx in...
null
analyze_results.py
analyze_results.py
py
4,534
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.stats.mannwhitneyu", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 17, "usage_type": "name" }, { "api_name": "scipy.stats.kruskal"...
83295742
from django.test import TestCase # Create test for Home Page class TestViews(TestCase): def test_get_homepage(self): response = self.client.get('/') self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, 'home/index.html')
null
home/tests.py
tests.py
py
277
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 5, "usage_type": "name" } ]
583196344
from common_config import MAPPED_WINDOWS, FOREGROUND_THREAD, SAVE_MAPPING import os from os.path import sep as separator from src.models.pantalla import Pantalla from loggin.app_logger import AppLogger from src.controllers.dnd_daemon import WinAppHandler import threading import json from src.controllers.document_pars...
null
src/controllers/win_mapper.py
win_mapper.py
py
5,205
python
en
code
null
code-starcoder2
76
[ { "api_name": "loggin.app_logger.AppLogger.create_log", "line_number": 33, "usage_type": "call" }, { "api_name": "loggin.app_logger.AppLogger", "line_number": 33, "usage_type": "name" }, { "api_name": "src.helpers.screen_mapper.load_json_skel", "line_number": 36, "usage_t...
495779778
from django.urls import path from . import views from django.contrib.auth import views as auth_views from django.conf.urls.static import static from django.conf import settings urlpatterns = [ path('', views.first_page, name='first_page'), path('admin', views.dashboardAdmin, name='dashboardAdmin'), path('...
null
montesory/urls.py
urls.py
py
2,538
python
en
code
null
code-starcoder2
76
[ { "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", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", ...
88517035
import pymysql from app import mysql from config import Config def query(db=Config.MYSQL_DATABASE_DB, statement="required", vars="", dictResults=False): """ Executes the statement and then returns the result as a list Statement - SQL Query Vars - List of variables in Query to prevent SQL Injection ...
null
app/db.py
db.py
py
2,468
python
en
code
null
code-starcoder2
76
[ { "api_name": "config.Config.MYSQL_DATABASE_DB", "line_number": 7, "usage_type": "attribute" }, { "api_name": "config.Config", "line_number": 7, "usage_type": "name" }, { "api_name": "config.Config.SHOW_QUERIES", "line_number": 18, "usage_type": "attribute" }, { "...
10611378
#Code is for python 3.4.3 import json, re import urllib,urllib.request import os,sys os.chdir('C:/Users/Tin Yun/Dropbox/Stanford/CS 221/Final Project/ScienceQA') api_key = open("freebase_api_key.txt").read() queryResultLimit = 100000 # Usage: Must provide a valid freebase MID. For example to get San Francisco triples...
null
FreebaseExtractor.py
FreebaseExtractor.py
py
3,237
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 6, "usage_type": "call" }, { "api_name": "urllib.parse.urlencode", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 18, "usage_type": "attribute" }, { "api_name": "json.loads", "li...
279096531
# 哪个罩杯的女性对黑色胸罩的需求量最大 from pandas import * from matplotlib.pyplot import * import sqlite3 import sqlalchemy engine = sqlalchemy.create_engine('sqlite:///bra.sqlite') rcParams['font.sans-serif'] = ['SimHei'] options.display.float_format = '{:,.2f}%'.format sales = read_sql('select source,size1,color1 from t_sales',engine...
null
mybra/src/analyze/demo08.py
demo08.py
py
891
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.create_engine", "line_number": 6, "usage_type": "call" } ]
620756082
import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import pickle import json import sqlite3 import datetime import ast from sklearn import preprocessing from sklearn.preprocessing import Normalizer import datetime import operator import mf_algo_py_param def cr...
null
covalent/model-factory/backend/flask_api/algo_py/mf_algo_py_char_to_index.py
mf_algo_py_char_to_index.py
py
3,137
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 33, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 51, "usage_type": "call" }, { "api_name": "pickle.HIGHEST_PROTOCOL", "line_number": 51, "usage_type": "attribute" }, { "api_name": "pickle.dump...
523688173
from typing import Any, Dict, Optional, Union from pydantic import BaseModel, Field from .encoding import Encoding from .example import Example from .reference import Reference from .schema import Schema class MediaType(BaseModel): """Each Media Type Object provides schema and examples for the media type identi...
null
openapi_python_client/schema/openapi_schema_pydantic/media_type.py
media_type.py
py
2,903
python
en
code
null
code-starcoder2
76
[ { "api_name": "pydantic.BaseModel", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 14, "usage_type": "name" }, { "api_name": "reference.Reference",...
583235528
import pandas as pd from sklearn.preprocessing import StandardScaler from sklearn.svm import SVR data_set = pd.read_csv('/home/aamir/Desktop/diabetes.csv') x = data_set.iloc[:, 1:-1].values y = data_set.iloc[:, -1].values y = y.reshape(len(y), 1) sc_X = StandardScaler() sc_Y = StandardScaler() x = sc_X.fit_transform...
null
examples/testML.py
testML.py
py
584
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 12, "usage_type": "call" }, ...
94991084
from PIL import Image import pytesseract import cv2 import os preprocess = 'thresh' #thresh image = cv2.imread('scan.jpg') gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) if preprocess == 'thresh': gray = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)[1] if preprocess == 'blur': gray = cv2....
null
实战2_光学字符识别/test.py
test.py
py
568
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "lin...
191606625
from django.conf.urls.defaults import * from .feeds import RecentSubmissionsFeed, FeaturedSubmissionsFeed from .feeds import TagSubmissionsFeed, ProfileSubmissionsFeed from .feeds import SearchSubmissionsFeed from utils import JingoTemplateLoader template_loader = JingoTemplateLoader() urlpatterns = patterns('demos...
null
apps/demos/urls.py
urls.py
py
2,891
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.JingoTemplateLoader", "line_number": 8, "usage_type": "call" }, { "api_name": "feeds.RecentSubmissionsFeed", "line_number": 52, "usage_type": "call" }, { "api_name": "feeds.FeaturedSubmissionsFeed", "line_number": 54, "usage_type": "call" }, { ...
444186875
"""上海证券""" import requests import json import pymysql import urllib3 urllib3.disable_warnings() conn = pymysql.connect( host="localhost", port=3306, user="root", password="123456", database="goods", charset="utf8", ) cursor = conn.cursor() for i in range(1, 1721, 10):...
null
11/1127/上海证券.py
上海证券.py
py
1,626
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib3.disable_warnings", "line_number": 6, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 32, "usage_type": "call" }, { "api_name": "json.loads", ...
35642083
import cs689_utils import psycopg2 import pandas as pd import random entriesInDatabase = 0 connDB = psycopg2.connect("dbname=postgres user=postgres host=localhost port=54321 password=bitnami") dbCur = connDB.cursor() file = "Energy Census and Economic Data US 2010-2014.csv" #Reading the provided CSV file using pand...
null
Assignment 2 - ETL/B. ETL/ETL.py
ETL.py
py
3,826
python
en
code
null
code-starcoder2
76
[ { "api_name": "psycopg2.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 16, "usage_type": "call" }, { "api_name": "cs689_utils.log", ...
534968125
from pyspark.sql import SparkSession from pyspark.sql.functions import explode from pyspark.sql.types import IntegerType, StringType, StructType from pyspark.sql.functions import explode from pyspark.sql.functions import split from pyspark.sql.functions import desc, col #import org.apache.spark.sql.functions._ spark = ...
null
adminmgr/media/code/A3/task2/BD_543_565_624_oEbQuTH.py
BD_543_565_624_oEbQuTH.py
py
2,143
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 8, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 8, "usage_type": "...
577901505
import pygame def doRender(main): black = 0, 0, 0 main.screen.fill(black) main.backgroundScroller.draw(main.screen) #DrawScore main.screen.blit(main.scoreSurface, main.fontScorePos) #Draw projectiles for projectile in main.projectilesList: projectile....
null
src/render.py
render.py
py
590
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.display.flip", "line_number": 27, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 27, "usage_type": "attribute" } ]
476631368
# ----------------------------- # # --- Setup the environment --- # # ----------------------------- # # --- Create the agents and the environment --- # # Import the simulation environment and agents from abmarl.sim.components.examples.hunting_and_foraging import HuntingForagingEnv, \ HuntingForagingAgent, FoodAg...
null
examples/hunting_foraging_demo.py
hunting_foraging_demo.py
py
7,046
python
en
code
null
code-starcoder2
76
[ { "api_name": "abmarl.sim.components.examples.hunting_and_foraging.FoodAgent", "line_number": 17, "usage_type": "call" }, { "api_name": "abmarl.sim.components.examples.hunting_and_foraging.HuntingForagingAgent", "line_number": 20, "usage_type": "call" }, { "api_name": "abmarl.sim...
497865891
import argparse import json import os import sys import datetime import time import database as db import tornado.httpserver import tornado.ioloop import tornado.web from tornado import gen APP_DIRECTORY = os.path.dirname(os.path.abspath(__file__)) STATIC_DIRECTORY = os.path.abspath(os.path.join(APP_DIRECTORY, 'stat...
null
archive_api_server/server.py
server.py
py
20,546
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.abspath", "l...
581376946
from PyQt5.QtCore import Qt vkeyToAndroidMaps = { Qt.Key_Escape: 'KEYCODE_ESCAPE', Qt.Key_Backspace: 'KEYCODE_DEL', Qt.Key_Tab: 'KEYCODE_TAB', Qt.Key_Return: 'KEYCODE_DPAD_CENTER', Qt.Key_Shift: 'KEYCODE_SHIFT_LEFT', Qt.Key_Up: 'KEYCODE_DPAD_UP', Qt.Key_Down: 'KEYCODE_DPAD_DOWN', Qt.Key...
null
keymap.py
keymap.py
py
390
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtCore.Qt.Key_Escape", "line_number": 4, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore.Qt", "line_number": 4, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.Qt.Key_Backspace", "line_number": 5, "usage_type": "attribute" }, { "a...
324626753
""" Extraction of raw text from lxml tree and text summarization """ from itertools import combinations import snowballstemmer import networkx as nx from wanish import lang_identifier from wanish.tokenizers import PunktSentenceTokenizer, RegexpTokenizer LANG_CODES = { 'da': 'danish', 'de': 'german', 'en'...
null
wanish/summarizer.py
summarizer.py
py
3,031
python
en
code
null
code-starcoder2
76
[ { "api_name": "wanish.tokenizers.PunktSentenceTokenizer", "line_number": 41, "usage_type": "call" }, { "api_name": "wanish.tokenizers.PunktSentenceTokenizer", "line_number": 66, "usage_type": "call" }, { "api_name": "wanish.tokenizers.RegexpTokenizer", "line_number": 68, ...
35930012
"""Widgets for QtRender. These were created for QtRender, but they are generic. Maybe we could switch from these to something more napari-standard. These were just created naively without knowing too much about napari's Qt code. """ from typing import Callable from qtpy.QtCore import Qt from qtpy.QtWidgets import ( ...
null
napari/_qt/experimental/render/qt_render_widgets.py
qt_render_widgets.py
py
5,279
python
en
code
null
code-starcoder2
76
[ { "api_name": "qtpy.QtWidgets.QWidget", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 47, "usage_type": "name" }, { "api_name": "qtpy.QtWidgets.QHBoxLayout", "line_number": 52, "usage_type": "call" }, { "api_name": "qtp...
332571014
import numpy as np import keras import tensorflow from keras.models import Sequential from keras.layers import Dense, Dropout, Activation from keras.optimizers import SGD, Adam import matplotlib.pyplot as plt from args import parser import os import time from sklearn.model_selection import train_test_split, StratifiedK...
null
NN_train_Xception_features.py
NN_train_Xception_features.py
py
2,321
python
en
code
null
code-starcoder2
76
[ { "api_name": "args.parser.parse_args", "line_number": 13, "usage_type": "call" }, { "api_name": "args.parser", "line_number": 13, "usage_type": "name" }, { "api_name": "args.Save_model_path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "keras.__...
383702016
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> from datetime import datetime import collections import logging from sqlalchemy.sql.expression import tuple_ from ggrc import db from ggrc import models from ggrc.automapper.rules import rules from ggrc.log...
null
src/ggrc/automapper/__init__.py
__init__.py
py
9,739
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 21, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 36, "usage_type": "call" }, { "api_name": "ggrc.utils.benchmark", "line_number": 40, "usage_type": "name" }, { "api_name": "g...
10623096
from recipient_object import recipientTypes import json from currency_functions import getCurrencies def ApiPersonalDetails(): personalDetails = { 'orderNumber': 'Order number', 'email': 'Email', 'firstName': 'First name', # 'middleName': 'Middle name(s)', 'lastName': 'Last...
null
recipient_model.py
recipient_model.py
py
72,843
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 22, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 24, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 26, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 28, ...
109080771
import logging from logging.handlers import RotatingFileHandler http_formatter = logging.Formatter( "%(asctime)-15s - %(user)-10s - %(levelname)s %(message)s") try: http_handler = RotatingFileHandler("pppoe_worker.log", maxBytes=1024 * 1024 * 100, ...
null
pppoe-checker/Modules/logger.py
logger.py
py
658
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.Formatter", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.handlers.RotatingFileHandler", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 12, "usage_type": "attribute" }, { "api_name":...
254826567
from PIL import Image import os src='Data/' #源文件夹 dst='CropData/'#目的文件夹 size=32#单张图片大小(32*32) cnt=0 imgs=os.listdir(src) for opath in imgs: path=src+opath print(path) img=Image.open(path) sz=img.size print(sz) for i in range(sz[0]//size): for j in range(sz[1]//size): crop_b...
null
cropImage.py
cropImage.py
py
587
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 7, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 11, "usage_type": "name" } ]
607285360
import multiprocessing import threading class PeaType(type): """Type of :class:`Pea`, metaclass of :class:`BasePea`.""" _dct = {} def __new__(cls, name, bases, dct): """ Create and register a new class with this meta class. :param name: name of the :class:`Pea` :param ...
null
.history/gRPC_jina/blueprint/basepea_20210415232510.py
basepea_20210415232510.py
py
1,501
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 34, "usage_type": "attribute" }, { "api_name": "multiprocessing.Process", "line_number": 35, "usage_type": "attribute" } ]
202214703
import cv2 import numpy as np img = cv2.imread('/home/manju/Downloads/MSIL/ushas_Mastic_Sealant_04_16/img6_msil_14_5_16_04_2021_26 (cp).jpg') img = cv2.imread('/home/manju/Downloads/MSIL/Ex/break4.jpg') img = cv2.resize(img,(800,500)) gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) ret,thr = cv2.threshold(gray,55,255,...
null
demo2.py
demo2.py
py
415
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 10, ...
336755080
import cv2 import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt # from matplotlib import pyplot as plt img = cv2.imread('challan.png', 0) edges = cv2.Canny(img,100,200) plt.subplot(121),plt.imshow(img,cmap = 'gray') plt.title('Original Image'), plt.xticks([]), plt.yticks([]) p...
null
text_kaggle/edge_detection.py
edge_detection.py
py
1,294
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.Canny", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", "li...
336505034
# -*- coding:utf-8 -*- ''' 功能说明:SQL查询分析处理实现 创建者:fujunwei 创建时间:2011-4-18 ''' import logging.config import Pyro.core import uuid, time from Queue import Queue from com.zctt.dmp import sys from com.zctt.dmp.query import IQueryService, QueryStatus, ResultSet from com.zctt.dmp.sql.sqlutils import SQLParser from com.zctt.d...
null
service/com/zctt/iaap/paf/contrib/sql/query.py
query.py
py
10,730
python
en
code
null
code-starcoder2
76
[ { "api_name": "Pyro.core.core", "line_number": 18, "usage_type": "attribute" }, { "api_name": "Pyro.core", "line_number": 18, "usage_type": "name" }, { "api_name": "Pyro.core.core.ObjBase.__init__", "line_number": 22, "usage_type": "call" }, { "api_name": "Pyro.co...
312150967
from django.conf.urls import url from .views import ( ThirdPartyList, ClientCreate, ClientDetail, ClientUpdate, ArtistCreate, ArtistDetail, ArtistUpdate, CharityCreate, CharityDetail, CharityUpdate, VenueCreate, VenueDetail, VenueUpdate ) app_name = 'thirdparty' url...
null
thirdparty/urls.py
urls.py
py
1,415
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 21, "usage_type": "call" }, { "api_name": "views.ThirdPartyList.as_view", "line_number": 21, "usage_type": "call" }, { "api_name": "views.ThirdPartyList", "line_number": 21, "usage_type": "name" }, { "api_name":...
197118048
import datetime import sys import pandas as pd import csv import os import sqlite3 from sqlite3 import Error def crearTabla(): try: with sqlite3.connect("Evidencia.db") as conn: c = conn.cursor() c.execute("CREATE TABLE IF NOT EXISTS cosmetiqueria (clave INTEGER PRIMAR...
null
evidencia 3 definitivo en trabajo.py
evidencia 3 definitivo en trabajo.py
py
5,982
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlite3.Error", "line_number": 16, "usage_type": "name" }, { "api_name": "sys.exc_info", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlite3.connect", "lin...
342086537
from django.conf.urls import url from django.contrib import admin from .views import ( AnswerListAPIView, AnswerCreateAPIView, AnswerDetailAPIView, AnswerDeleteAPIView, AnswerUpdateAPIView, ) urlpatterns = [ url(r'^$', AnswerListAPIView.as_view(), name="Answers"), url(r'^create/$', ...
null
src/answer/api/urls.py
urls.py
py
609
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 14, "usage_type": "call" }, { "api_name": "views.AnswerListAPIView.as_view", "line_number": 14, "usage_type": "call" }, { "api_name": "views.AnswerListAPIView", "line_number": 14, "usage_type": "name" }, { "api_...
371514256
#!/usr/bin/env python ''' @author Luke Campbell <LCampbell@ASAScience.com> @file test_index_bootstrap.py @date 05/03/12 10:26 @description DESCRIPTION ''' from pyon.core.exception import BadRequest from pyon.util.containers import DotDict from pyon.core.bootstrap import get_sys_name from pyon.util.unit_test import Pyon...
null
ion/processes/bootstrap/test/test_index_bootstrap.py
test_index_bootstrap.py
py
3,743
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyon.public.CFG.get_safe", "line_number": 24, "usage_type": "call" }, { "api_name": "pyon.public.CFG", "line_number": 24, "usage_type": "name" }, { "api_name": "pyon.util.unit_test.PyonTestCase", "line_number": 28, "usage_type": "name" }, { "api_nam...
459509652
from builtins import print from PySide2 import QtCore, QtWidgets, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtWidgets.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtWidgets.QApplicatio...
null
Final.py
Final.py
py
11,918
python
en
code
null
code-starcoder2
76
[ { "api_name": "PySide2.QtCore.QString", "line_number": 6, "usage_type": "attribute" }, { "api_name": "PySide2.QtCore", "line_number": 6, "usage_type": "name" }, { "api_name": "PySide2.QtWidgets.QApplication", "line_number": 12, "usage_type": "attribute" }, { "api_...
428386292
from __future__ import division from kivy.lang import Builder from kivy.properties import StringProperty from kivy.app import App # for the main app from kivy.clock import Clock # clock to schedule a method from jnius import autoclass from android.runnable import run_on_ui_thread PythonActivity = autoclass('org.kivy....
null
main old.py
main old.py
py
5,128
python
en
code
null
code-starcoder2
76
[ { "api_name": "jnius.autoclass", "line_number": 8, "usage_type": "call" }, { "api_name": "kivy.app.App", "line_number": 24, "usage_type": "name" }, { "api_name": "kivy.properties.StringProperty", "line_number": 25, "usage_type": "call" }, { "api_name": "kivy.prope...
338727617
import numpy as np import pydicom import cv2 from FeatureExtraction.ImageExtraction import * from DicomIO.Image import * class MetaImage: def writeMetaimage(self,imageFiles): slices = [] for imageFile in imageFiles: data = pydicom.dcmread(imageFile) imageExtracti...
null
FeatureExtraction/MetaImage.py
MetaImage.py
py
5,561
python
en
code
null
code-starcoder2
76
[ { "api_name": "pydicom.dcmread", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2BGR", "lin...
591826997
import flask_restful from webargs import fields from webargs.flaskparser import use_kwargs from bookie import app from bookie import dm from bookie import models class Api: _api_path = '/api/' def __init__(self, app): self.api = flask_restful.Api(app) self.setup_resources() def setup_re...
null
bookie/routing/api.py
api.py
py
3,936
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_restful.Api", "line_number": 14, "usage_type": "call" }, { "api_name": "bookie.app", "line_number": 14, "usage_type": "argument" }, { "api_name": "flask_restful.Resource", "line_number": 24, "usage_type": "attribute" }, { "api_name": "bookie.d...
1060293
# -*- coding: utf-8 -*- from celery.task import task import urllib.request from bs4 import BeautifulSoup from crawler.models import Url_list import time class Crawler(object): titles_and_urls = [] def __init__(self): pass def jubge_url(self, url): if url[0:4] == 'http' and url[-5:] == '....
null
crawler/crawl.py
crawl.py
py
3,099
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.request.urlopen", "line_number": 24, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 24, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 24, "usage_type": "name" }, { "api_nam...
317060846
from django.shortcuts import get_object_or_404, render, redirect from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from .choices import price_choices, bedroom_choices, state_choices from django.contrib.auth.decorators import login_required from .models import Listing, Eproof, Product from members...
null
listings/views.py
views.py
py
18,669
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.response.Response", "line_number": 23, "usage_type": "call" }, { "api_name": "rest_framework.decorators.api_view", "line_number": 14, "usage_type": "call" }, { "api_name": "members.models.Member.objects.filter", "line_number": 28, "usage_type...
321181610
from django.test import TestCase from mock import patch from notifications import models class SimpleTest(TestCase): def test_send_notification(self): with patch('requests.post') as requests_post: requests_post.return_value.status_code = 200 ret = models.send_notification( ...
null
badges/notifications/tests.py
tests.py
py
1,606
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "mock.patch", "line_number": 10, "usage_type": "call" }, { "api_name": "notifications.models.send_notification", "line_number": 13, "usage_type": "call" }, { "api_name": ...
496932528
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jan 8 15:49:55 2021 @author: ikaheia1 Function wrapper for plotting the figure or saving it to the destined folder. """ import matplotlib.pyplot as plt import functools def plot_decorator(func): @functools.wraps(func) def wrappe...
null
Source/Utils/plot_decorator.py
plot_decorator.py
py
1,276
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.show", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 27, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 35, "usage_type": "call" }, { "api_name": "ma...
126233257
from django import forms from django.forms import widgets from app_manage.models import Project,Module class ProjectForms(forms.Form): """ 添加项目 """ name = forms.CharField(label='项目名称', max_length=100, widget=widgets.TextInput(attrs={'class':'form-control'})...
null
mysite/app_manage/forms.py
forms.py
py
1,137
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.Form", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 7, "usage_type": "call" }, { "api_name": "django.forms"...