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
429762600
from matplotlib import pyplot as plt import json import os from filters import kalman kalmanR = 0.008 kalmanQ = 1.0 final_readings_dir = os.getcwd() + "/final-readings/" f = open(os.path.join(final_readings_dir, "myReading_7_18.json"),"r") data = json.load(f) f.close() save_path = os.getcwd() + "/Graphs/rssi_vs_sam...
null
BTP/Library/WKNN/rssi_vs_sampling_times_graph.py
rssi_vs_sampling_times_graph.py
py
1,337
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getcwd", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 11,...
451882327
#! /usr/bin/python # coding=utf-8 # author: zhouyou """ desc: time封装类 """ import datetime import time class SfTime(object): """ desc: time封装类 """ @staticmethod def transform_date2datetime(o_date): """ 将date对象转化为datetime对象 """ str_time = o_date.strftime("%Y%m%d") ...
null
src/lib/time_utils.py
time_utils.py
py
3,192
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.strptime", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "attribute" }, { "api_name": "datetime.date.today", "line_number": 31, "usage_type": "call" }, { "api_name": ...
426120922
import sys from PyQt5 import QtGui, QtCore, QtWidgets, uic #include <QStyle> from PyQt5.QtCore import QObject, pyqtSlot from QT_Assignment.toolbox import Preprocessing, Feature_Building, Feature_Selection, Classifier, \ Output, Evaluation_Metric, Feature_Scaling, Loading, gui_Instance # put testUI.py in th...
null
main.py
main.py
py
5,788
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.uic.loadUiType", "line_number": 14, "usage_type": "call" }, { "api_name": "PyQt5.uic", "line_number": 14, "usage_type": "name" }, { "api_name": "PyQt5.uic.loadUiType", "line_number": 19, "usage_type": "call" }, { "api_name": "PyQt5.uic", "...
198892233
# Input is any string. The idea is to find the first non-repeating character in it, and return its position # Input is lowercase. If it doesn't exist, it will return -1. # First solution def character(s): freq = {} for i in s: if i not in freq: freq[i] = 1 else: freq[i] ...
null
Python/firstUniqueCharacter.py
firstUniqueCharacter.py
py
720
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 22, "usage_type": "call" } ]
649990655
from arm.servicebus.servicebus import Servicebus from arm.servicebus.topic import Topic from arm.servicebus.queue import Queue from arm.servicebus.authorizationRules import AuthorisationRules from arm.servicebus.subscriptions import Subscriptions import json import os from jinja2 import Template def get_sb_resource()...
null
python/serviceBus/gen_AZ_SB_SeS/python/run.py
run.py
py
1,792
python
en
code
null
code-starcoder2
76
[ { "api_name": "arm.servicebus.servicebus.Servicebus", "line_number": 17, "usage_type": "call" }, { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "arm.servicebus.queue.Queue", "line_number": 25, "usage_type": "call" }, { "api_nam...
599902745
import discord from discord.ext import commands import json #got the Token this way because Python was being stupid and wouldn't import another file and I was too lazy to figure it out XD with open('config.json') as f: file = json.load(f) TOKEN = file["TOKEN"] bot = commands.Bot(command_prefix="~") @bot.event async ...
null
bot.py
bot.py
py
715
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 9, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "discord.__versio...
47692005
# # -*- coding: utf-8 -*- import py2neo from pymongo import MongoClient db = MongoClient("mongodb://localhost:27017") col = db.zhiwang['paper'] #从Mongodb中删选出需要的数据 papers = col.find({"authors":{"$elemMatch":{"author_name":"汤庸","author_orgn_name":"华南师范大学"}}}) paper_list = [] for paper in papers: paper_list.append(pap...
null
untitled/00ll/2017-5/ruizhang.py
ruizhang.py
py
2,080
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 4, "usage_type": "call" }, { "api_name": "py2neo.Graph", "line_number": 14, "usage_type": "call" }, { "api_name": "py2neo.ogm.GraphObject", "line_number": 21, "usage_type": "name" }, { "api_name": "py2neo.ogm.Pro...
462305275
#! /usr/bin/env python # -*- coding: utf-8 -*- from django.shortcuts import render, get_object_or_404, render_to_response from django.http import HttpResponse from .models import * from django import forms import requests import urllib from lxml import html import urllib.request from datetime import * import time # Cr...
null
fightdata/views.py
views.py
py
2,907
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 44, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 90, "usage_type": "call" } ]
510939317
import os import re from collections import defaultdict import six from Bio import SeqIO from tracerlib.tracer_func import process_chunk, find_possible_alignments def makeOutputDir(output_dir_path): if not os.path.exists(output_dir_path): os.mkdir(output_dir_path) def is_exe(fpath): return os.path...
null
tracerlib/io.py
io.py
py
3,291
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_numbe...
616609697
import numpy as np import cv2 import os from managed_threading import ManagedThread class Visualizer(ManagedThread): def step(self, r, grabber): frame = np.rot90(cv2.cvtColor(r.frame.reshape((4320, 640, 2)), cv2.COLOR_YUV2BGR_YUYV), 3) # Approx 2ms field_mask = np.rot90(np.repeat(r.field_mask, 2, ...
null
robovision/visualization.py
visualization.py
py
5,307
python
en
code
null
code-starcoder2
76
[ { "api_name": "managed_threading.ManagedThread", "line_number": 6, "usage_type": "name" }, { "api_name": "numpy.rot90", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_YUV2B...
481785621
print("start!") #from unicodedata import bidirectional import torch print("import torch ended(1)") import torch.nn as nn print("import torch ended(2)") import time print("import time ended") import os print("import os ended") print("import ended") #torch.set_default_dtype(torch.bfloat16) torch.set_grad_enabled(False)...
null
contrib/pim/mlapp/past/ds2_cur3.py
ds2_cur3.py
py
8,554
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.set_grad_enabled", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.load", "line_n...
128204166
# -*- coding: utf8 -*- import numpy as np import gym class DescriptionWrapper(gym.Wrapper): """ Wrapper that mantains a description of the environment in its metadata. """ changeable_parameters: list = [] def __init__(self, env, **kwargs): super(DescriptionWrapper, self).__init__(env...
null
environment/wrappers.py
wrappers.py
py
1,791
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.Wrapper", "line_number": 6, "usage_type": "attribute" }, { "api_name": "gym.ObservationWrapper", "line_number": 30, "usage_type": "attribute" }, { "api_name": "gym.spaces", "line_number": 39, "usage_type": "attribute" }, { "api_name": "gym.space...
124297015
from dataclasses import dataclass @dataclass class Position: x: int y: int @dataclass class Slope: right: int down: int area_map = [] # read input data with open("input.txt", "r") as data: for line in data: area_map.append(tuple(line.strip())) slope = Slope(3, 1) trees = 0 pos = Posi...
null
day_03/task_1.py
task_1.py
py
556
python
en
code
null
code-starcoder2
76
[ { "api_name": "dataclasses.dataclass", "line_number": 4, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 10, "usage_type": "name" } ]
538351078
#!/bin/env python # -*- coding:utf8 -*- import tornado.web import tornado.gen import tornado.httpclient from tornado.escape import utf8 import json import re from common import web_handler from common import mylog from common import error_msg from common import conf from common import utility from purchase_summary_s...
null
wood-erp/handler/purchase_summary/purchase_summary_list.py
purchase_summary_list.py
py
1,612
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.web_handler.WebHandler", "line_number": 20, "usage_type": "attribute" }, { "api_name": "common.web_handler", "line_number": 20, "usage_type": "name" }, { "api_name": "common.error_msg.SUCCESS", "line_number": 24, "usage_type": "attribute" }, { ...
174287352
__author__ = 'anyul' from django.conf.urls import patterns, url from Quiniela.views import * urlpatterns = patterns('', url(r'^usuarios/$', ListadoUsuarios.as_view(), name="listado_usuarios"), url(r'^usuarios/(?P<pk>\d+)$', DetalleUsuario.as_view(), name="detalle_usuario"...
null
Quiniela/urls.py
urls.py
py
1,803
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "djan...
446622338
from flask import Flask, render_template, request import pickle import numpy as np import pandas as pd import pandas model = pickle.load(open("linear.pkl", "rb")) app = Flask(__name__) @app.route('/') def hello_world(): return render_template("index.html") @app.route('/', methods=['POST']) def my_form_post...
null
app.py
app.py
py
696
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.request.form", ...
116451150
from django import forms class SettingsForm(forms.Form): """ A base form for loading/saving settings for an extension. This is meant to be overridden by extensions to provide configuration pages. Any fields defined by the form will be loaded and saved automatically. """ def __init__(self, exte...
null
djblets/extensions/forms.py
forms.py
py
798
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.Form", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 4, "usage_type": "name" }, { "api_name": "django.forms.Form.__init__", "line_number": 11, "usage_type": "call" }, { "api_name": "django.f...
598553773
#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl mpl.rcParams.update({'font.size': 20/1.25}) colors = plt.rcParams['axes.prop_cycle'].by_key()['color'] r_rec = np.load("../data/r_rec_rate_dynamics_step.npy") u_rec = (r_rec[:,0] + r_rec[:,1])/2.**.5 n_t = u_rec.shap...
null
Poster/figures/code/u_dyn_rate_illustr.py
u_dyn_rate_illustr.py
py
1,225
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.rcParams.update", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 9, "usage_type": "attribute" }, { "...
78203348
import cv2 from darkflow.net.build import TFNet from PIL import Image import glob options = { 'model' : 'yolo.cfg', 'load' : 'yolov2.weights', 'threshold' : 0.3, } tfnet = TFNet(options) for filename in glob.glob('photos/*.jpg'): img = cv2.imread(filename, cv2.IMREAD_UNCHANGED) result = tfnet.return_predict(i...
null
YOLO-Image-labelling/yolo_process_image.py
yolo_process_image.py
py
682
python
en
code
null
code-starcoder2
76
[ { "api_name": "darkflow.net.build.TFNet", "line_number": 13, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.IMREAD_UNCHANGED", ...
35952661
import absim.agent as agent import absim.world as world import torch import numpy as np from tianshou_policies import * policy_net = 'Mlp16x2' state_dict_path = './results/DQN_3_0_withmap_2020_07_27_00_14/dqn.pth' class DQNMapAgent(agent.Agent): """The probability-greedy agent visits the location with the highes...
null
bwi_scavenger/scripts/absim/dqn_map_agent.py
dqn_map_agent.py
py
1,877
python
en
code
null
code-starcoder2
76
[ { "api_name": "absim.agent.Agent", "line_number": 11, "usage_type": "attribute" }, { "api_name": "absim.agent", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.load", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.tensor", "lin...
383831126
from flask import Blueprint, request, abort, jsonify, current_app from API.template.ctrl_template import ControlTemplate import API.utils as utils import json from API.decorators import parse_args # from API.error import Message template = Blueprint('template', __name__, url_prefix='') @template.route('/template/<...
null
API/template/webtemplate.py
webtemplate.py
py
2,714
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 10, "usage_type": "call" }, { "api_name": "API.utils.get_user_name", "line_number": 15, "usage_type": "call" }, { "api_name": "API.utils", "line_number": 15, "usage_type": "name" }, { "api_name": "API.template.ctrl_t...
638817796
import re from server.models import get_flatten,get_munis from tree import Tree from bson.objectid import ObjectId from settings import MAX_LEVEL # from server.utils import profile def search_code(muni,year,code): # TODO : rewrite this code dataset = get_flatten() results = [] code_rex = re.compile("...
null
visualization/api.py
api.py
py
3,159
python
en
code
null
code-starcoder2
76
[ { "api_name": "server.models.get_flatten", "line_number": 12, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "settings.MAX_LEVEL", "line_number": 24, "usage_type": "name" }, { "api_name": "settings.MAX_...
544739361
import pandas as pd from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, roc_auc_score from sklearn.metrics import precision_recall_curve classification = pd.read_csv('classification.csv') ClfErrorTable = {'TP': 0, #true positive 'FP': 0, #false positive ...
null
ClassificationMetrics.py
ClassificationMetrics.py
py
3,780
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "sklearn.metrics.accuracy_score", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.metrics.precision_score", "line_number": 26, "usage_type": "call" }, { "api...
626898333
import matplotlib.pyplot as plt import numpy as np def freq_response(a,p,f): ax = plt.subplot(211) ax.set_title("freq_char") plt.plot(f,a); plt.xscale('log') plt.title('Magnitude',fontsize=10) plt.xlabel('Frequency [Hz]') plt.ylabel('Amp') plt.margins(0, 0.1) plt.xlim(20, 20000) ...
null
display.py
display.py
py
3,498
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.subplot", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 6, "usage_type": "call" }, { "api_name": "matpl...
339712498
import astropy.units as u from einsteinpy.bodies import Body, Earth, Sun from einsteinpy.coordinates import CartesianDifferential, SphericalDifferential def test_sun_base_properties(): assert Sun.parent is None assert Sun.R == 695510 * u.km assert Sun.mass == 1.9891e30 * u.kg def test_sun_extras(): ...
null
src/einsteinpy/tests/test_bodies.py
test_bodies.py
py
1,990
python
en
code
null
code-starcoder2
76
[ { "api_name": "einsteinpy.bodies.Sun.parent", "line_number": 8, "usage_type": "attribute" }, { "api_name": "einsteinpy.bodies.Sun", "line_number": 8, "usage_type": "name" }, { "api_name": "einsteinpy.bodies.Sun.R", "line_number": 9, "usage_type": "attribute" }, { ...
214544039
import numpy as np import random import time import math import matplotlib.pyplot as plt ''' num_dim = number of variables = 50 number of epochs = 500, no.generation search agents = number of f(x) lb = -10, lower bound of variable ub = 10, upper bound of variable T_dim is the best value_set of the dim_th d...
null
nguyen_thieu/week_7-tut_optimization/models/goa/GOA_OBL.py
GOA_OBL.py
py
4,378
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.uniform", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 23, "usage_type": "attribute" }, { "api_name": "math.sqrt", "line_number": 38, "usage_type": "call" }, { "api_name": "math.exp", "line...
344500677
from django.shortcuts import render from django.contrib.auth.models import User # from .models import DeveloperRepository, Technology, Domain from django.contrib import messages from django.shortcuts import render from django.shortcuts import render,redirect from editinfo.models import Developer, Q_A, Technology, Domai...
null
editinfo/views.py
views.py
py
6,938
python
en
code
null
code-starcoder2
76
[ { "api_name": "editinfo.models.Developer.objects.get", "line_number": 16, "usage_type": "call" }, { "api_name": "editinfo.models.Developer.objects", "line_number": 16, "usage_type": "attribute" }, { "api_name": "editinfo.models.Developer", "line_number": 16, "usage_type":...
366966352
import os import sys from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'readme')).read() requires = [ 'Shapely', 'rpy2' ] setup(name='SpatialUtils', version='0.0', description='Spatial Utilties', long_descripti...
null
spatial_utils/setup.py
setup.py
py
640
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
578172527
import torch from torch import nn from torch.nn.functional import softmax from patchify import patchify from WeavedMLP import WeavedMLP from datetime import datetime as dt class MLP(nn.Module): def __init__(self, in_dim=49, hidden_dim=64, dropout=0.0): super(MLP, self).__init__() self.lin...
null
transformer.py
transformer.py
py
6,429
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
266232541
import csv import datetime from os.path import basename, join, exists import tempfile import shutil import unittest from vixen.tests.test_directory import make_data, create_dummy_file from vixen.project import Project, TagInfo, get_non_existing_filename, INT class TestProjectBase(unittest.TestCase): def setUp(s...
null
vixen/tests/test_project.py
test_project.py
py
13,324
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tempfile.mkdtemp", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "vixen.tests.test...
235854511
# coding=UTF-8 # ********************************************************************** # Copyright (c) 2013-2020 Cisco Systems, Inc. All rights reserved # written by zen warriors, do not modify! # ********************************************************************** from cobra.mit.meta import ClassMeta from cobra.m...
null
venv/Lib/site-packages/cobra/modelimpl/dbg/epgtoiprslt.py
epgtoiprslt.py
py
9,026
python
en
code
null
code-starcoder2
76
[ { "api_name": "cobra.mit.mo.Mo", "line_number": 22, "usage_type": "name" }, { "api_name": "cobra.mit.meta.ClassMeta", "line_number": 28, "usage_type": "call" }, { "api_name": "cobra.model.category.MoCategory.REGULAR", "line_number": 32, "usage_type": "attribute" }, { ...
431414679
# Graphically import matplotlib.pyplot as plt import math import numpy as np import array import random import datetime # ============================================================================= # First I'll implement merge sort. This algorithm uses both recursive and non-recursive techniques. # It is a...
null
HW/HW4_Ped.py
HW4_Ped.py
py
6,421
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.sample", "line_number": 93, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 105, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 105, "usage_type": "attribute" }, { "api_name": "datetime...
370642524
#! /usr/bin/python # ./parse-annotations.py --output_dir path/to/output/folder path/to/vatic-dump # to make elan files, add the options: --make_elan --videos_location ../path/to/video/files/ import csv, sys, os, re, argparse, shutil, tempfile, json, pandas import pyelan from itertools import izip, groupby def group...
null
parse-annotations.py
parse-annotations.py
py
13,895
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.izip", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.splitext", "...
148266353
"""media URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
null
media/urls.py
urls.py
py
2,106
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 26, "usage_type": "call" }, { "api_name": "store.views.home", "line_number": 26, "usage_type": "attribute" }, { "api_name": "store.views", "line_number": 26, "usage_type": "name" }, { "api_name": "django.conf.ur...
88761390
############################################################################## # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright 2014 by F5 Networks and/or i...
null
neutron/services/loadbalancer/drivers/f5/bigip/icontrol_driver.py
icontrol_driver.py
py
140,978
python
en
code
null
code-starcoder2
76
[ { "api_name": "neutron.openstack.common.log.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "neutron.openstack.common.log", "line_number": 34, "usage_type": "name" }, { "api_name": "oslo.config.cfg.StrOpt", "line_number": 43, "usage_type": "call" },...
489016978
import numpy as np from keras.datasets import cifar10 from keras.models import load_model import os import sys import collect_data import argparse import stl_model import unet_model as um ap = argparse.ArgumentParser() ap.add_argument("-a", "--autoencoder_path", required=True, help="Relative path to model", default...
null
evaluate_classifer_autoencoder.py
evaluate_classifer_autoencoder.py
py
2,584
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 37, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 41, "usage_type": "call" }, { "api_name": "keras.m...
609488509
# -*- coding: utf-8 -*- __author__ = '小逗比' from aiohttp import web async def index(request): return web.Response(text='hello world') app = web.Application() app.add_routes([web.get('/', index)]) web.run_app(app, host='127.0.0.1', port=9090)
null
www/app.py
app.py
py
254
python
en
code
null
code-starcoder2
76
[ { "api_name": "aiohttp.web.Response", "line_number": 7, "usage_type": "call" }, { "api_name": "aiohttp.web", "line_number": 7, "usage_type": "name" }, { "api_name": "aiohttp.web.Application", "line_number": 9, "usage_type": "call" }, { "api_name": "aiohttp.web", ...
537589859
import torch.nn as nn import torch import torch.nn.functional as F from torch.autograd import Function class DiffClamp(Function): @staticmethod def forward(ctx, x, min, max): return x.clamp(min, max) @staticmethod def backward(ctx, grad_output): return grad_output.clone(), None, None ...
null
kamal/models/ae/blocks.py
blocks.py
py
3,133
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.autograd.Function", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.autograd.F...
232344205
__AUTHOR__ = 'Reverier Xu' import requests properties = { 'name': 'GET', 'categories': 'Web', 'input': {0: '地址', 1: '参数'}, 'output': {0: '应答'}, 'properties': { 'http代理': str, 'https代理': str, 'time out': str } } defaults = { 'http代理': '', 'https代理': '', 'time...
null
Modules/DataFlow/GetMethodModule.py
GetMethodModule.py
py
895
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 36, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 38, "usage_type": "call" } ]
521328743
# CSS selector form: tagName[attribute='value'] # e.g a[id='signup'] from selenium import webdriver import time driver = webdriver.Firefox() driver.get("http://kennethhutw.github.io/demo/Selenium/") # Sign up driver.find_element_by_css_selector('a[id="signup"]').click() print(driver.title) time.sleep(2) driver.ba...
null
.vscode/CSSselector.py
CSSselector.py
py
489
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 15, "usage_type": "call" }, { "api_name": "time.sleep", ...
108049578
# tests.py from unittest import TestCase, main as unittest_main, mock from bson.objectid import ObjectId from app import app #throws error when reading pymongo unless pymongo is installed in the (env) sample_playlist_id = ObjectId('5d55cffc4a3d4031f42827a3') sample_playlist = { 'title': 'Cat Videos', 'descrip...
null
tests.py
tests.py
py
3,441
python
en
code
null
code-starcoder2
76
[ { "api_name": "bson.objectid.ObjectId", "line_number": 7, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 22, "usage_type": "name" }, { "api_name": "app.app.test_client", "line_number": 28, "usage_type": "call" }, { "api_name": "app.app",...
125464478
# -*- coding: utf-8 -*- """ This module handles the OAuth2 authentication process and maintains the session (/token) information that is required to communicate with the OSF API It is also responsible for constructing the correct API calls/uris as specified by the OSF for the various types of information that can be r...
null
QOpenScienceFramework/connection.py
connection.py
py
6,209
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 41, "usage_type": "call" }, { "api_name": "QOpenScienceFramework.dirname", "line_number": 41, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 41, "usage_type": "attribute" }, { "api_name": "json.load...
115156999
import ast import json import typing import kfp import mlrun import mlrun.api.api.utils import mlrun.api.schemas import mlrun.errors import mlrun.kfpops import mlrun.utils.helpers import mlrun.utils.singleton from mlrun.utils import logger class Pipelines(metaclass=mlrun.utils.singleton.Singleton,): def list_pi...
null
mlrun/api/crud/pipelines.py
pipelines.py
py
7,767
python
en
code
null
code-starcoder2
76
[ { "api_name": "mlrun.utils", "line_number": 17, "usage_type": "attribute" }, { "api_name": "mlrun.api", "line_number": 25, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 26, "usage_type": "attribute" }, { "api_name": "mlrun.mlconf", ...
315887420
import easypycurl import logger import time import zipfile import os def login(username, password, curl): url = 'https://www.fedex.com/fcl/logon.do?appName=fclfsm&locale=us_en&step3URL=https%3A%2F%2Fwww.fedex.com%2Fship%2FshipEntryAction.do?method=doRegistration%26locale=en_us%26urlparams=us%26sType=F%26action=fsmre...
null
fedex/fedex_get_0.1.py
fedex_get_0.1.py
py
7,909
python
en
code
null
code-starcoder2
76
[ { "api_name": "zipfile.ZipFile", "line_number": 124, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 174, "usage_type": "call" }, { "api_name": "os.path", "line_number": 174, "usage_type": "attribute" }, { "api_name": "os.makedirs", "lin...
457044724
''' Created on 2017年9月25日 @author: moonlit python Z:\StockAnalysis\sourceCode\TuShare\test\src\importAlpha101data.py ''' # import numpy as np import pandas as pd # from Alpha101 import WQ_Alphas_Analysis as aa from Alpha101 import Alpha101_from_ricequant as ar import cx_Oracle import getStockData as gsd import mat...
null
sourceCode/TuShare/test/src/importAlpha101data_21_40.py
importAlpha101data_21_40.py
py
5,128
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.to_dateti...
630578404
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'gamble.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^orig', 'gambleapp.views.original', n...
null
gamble/gamble/urls.py
urls.py
py
391
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 4, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 9, "usage_type": "call" }, { "api_name": "...
423550556
from darksky.abstract_io.redis import RedisCache import mock from nose.tools import assert_equals, assert_dict_equal, assert_raises def test_RedisCache(): mock_strictredis = mock.Mock() internal_table = {} def mock_set(key, value): internal_table[key] = value mock_strictredis.set.side_effect =...
null
tests/unit/test_RedisCache.py
test_RedisCache.py
py
1,542
python
en
code
null
code-starcoder2
76
[ { "api_name": "mock.Mock", "line_number": 6, "usage_type": "call" }, { "api_name": "darksky.abstract_io.redis.RedisCache", "line_number": 19, "usage_type": "call" }, { "api_name": "nose.tools.assert_equals", "line_number": 23, "usage_type": "name" }, { "api_name":...
254137663
#!/usr/bin/env python import os import psycopg2 import matplotlib matplotlib.use('4Agg') import pylab from scipy import stats genre = 'horror' conn = psycopg2.connect("dbname=movielens") cur = conn.cursor() cur.execute(''' SELECT movie_id, rating FROM ratings WHERE EXISTS(SELECT * from movie_genre WHERE...
null
duke/cs216/hw5/movielens/histo-movies.py
histo-movies.py
py
786
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 6, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.py...
286213262
# Copyright 2016, 2017 Peter Zybrick and others. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
null
iote2e-pyclient/src/iote2epyclient/process/processpilldispenser.py
processpilldispenser.py
py
6,720
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 36, "usage_type": "call" }, { "api_name": "iote2epyclient.pilldispenser.handlepilldispenser.HandlePillDispenser", "line_number": 52, "usage_type": "call" }, { "api_name": "picamera.PiCamera", "line_number": 53, "usage_type...
232629064
from __future__ import print_function from pyspark.sql import SparkSession import sys from pyspark.sql import types, functions def zip_sort(delays, fractions): return sorted(zip(delays, fractions)) def quartiles(distribution): cumulative = 0.0 result = [] for delay, percentage in distribution: ...
null
19_Spark/scriptSpark.py
scriptSpark.py
py
3,001
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 39, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 40, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession.builder.getOrCreate", "line_number": 42, "usage_type": "call" }, { "api_name...
460713247
#!/usr/bin/ env python # coding:utf-8 __author__ = 'Administrator' from sqlalchemy import func class BaseEntity(object): def __init__(self): pass def get_by_id(self, session, id, columns = None, lock_mode = None): if hasattr(self.entity, 'id'): scalar = False if column...
null
code/web/app/core/baseentity.py
baseentity.py
py
2,734
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.func.count", "line_number": 34, "usage_type": "call" }, { "api_name": "sqlalchemy.func", "line_number": 34, "usage_type": "name" } ]
64437124
from sklearn.ensemble import RandomForestRegressor import tensorflow as tf import _pickle as cPickle import numpy as np import pickle from sklearn.model_selection import train_test_split with open('features', 'rb') as fp: features=pickle.load(fp) with open('labels', 'rb') as fp: labels=pickle.load(fp) with ...
null
Crime_Prediction_using_MachineLearningAlgorithms/rnd_frst.py
rnd_frst.py
py
1,820
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 10, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 13, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_tes...
433161458
#!/usr/bin/python3 import settings import socket import os import logging #dados para criacao de log logging.basicConfig( filename= settings.file_logs, level=logging.DEBUG, format='%(asctime)s %(levelname)s %(funcName)s => %(message)s' ) itens = settings.itens fail_status = settings.fail_status logging.debug('par...
null
ini.py
ini.py
py
2,996
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "settings.file_logs", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "settings....
53262366
#!/usr/bin/env python3 import json import sys import subprocess import datetime cname = sys.argv[1] year = datetime.datetime.now().year schedule = json.loads(sys.stdin.read()) subprocess.run(['sh', '-c', "yes y | gcalcli --calendar="+cname+" delete '*' 00:00"]) for date, lectures in schedule.items(): for lectu...
null
modules/mai2google.py
mai2google.py
py
953
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "attribute" }, { "api_name": "json.loads"...
355935693
#-*- coding;utf-8 -*- __author__ = 'TAOQIN001' import datetime class GetDate(): def __init__(self): pass def get_date(self, wantday=None): day=datetime.date.today() oneday=datetime.timedelta(days=1) try: if wantday > 0: for i in range(wantday): ...
null
common/getdate.py
getdate.py
py
767
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date.today", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 11, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 12, "usage_type": "call" } ]
588055042
from django.urls import path from . import views urlpatterns = [ path('u/', views.users, name='users'), path('t/', views.themes, name='themes'), path('c/', views.comments, name='comments'), path('', views.index, name='index'), path('delete/<int:id>/', views.deleteUser, name='deleteUser'), path...
null
django/myproject/myapp/urls.py
urls.py
py
376
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
354021296
import pandas as pd from sqlalchemy import create_engine from sqlalchemy import Column, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.dialects import mysql import os import datetime # # 適当なDataFrameを作成する(ただし、カラム名は必ずデータベースのものと同じにする) # df = pd.Data...
null
psqltest.py
psqltest.py
py
4,700
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 29, "usage_type": "call" }, { "api_name": "sqlalchemy.dialects.mysql.INTEGER", "line_number": 29, "usage_type": "attri...
163861171
""" Code to download raw images for classification """ import csv import pandas as pd from tools.image_url_loader import ImageUrlLoader from tools.predictor_external import PredictorExternal2 from config.config import cfg_model, cfg_path import os # Parameters # path = 'D:\\Studium_GD\\Zooniverse\\Data\\transfer_learn...
null
transfer_learning/experiments/camera_catalogue_south_africa_4/get_images.py
get_images.py
py
2,359
python
en
code
null
code-starcoder2
76
[ { "api_name": "config.config.cfg_path", "line_number": 14, "usage_type": "name" }, { "api_name": "config.config.cfg_path", "line_number": 15, "usage_type": "name" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pandas.rea...
77487064
import subprocess import threading import gi gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') from gi.repository import GObject from gi.repository import GLib from gi.repository import Gtk from gi.repository import Gdk # pulsectl 18.12.5 from pulsectl import Pulse # relative units VOLUME_WIDTH = 2...
null
volume_tray.py
volume_tray.py
py
11,381
python
en
code
null
code-starcoder2
76
[ { "api_name": "gi.require_version", "line_number": 5, "usage_type": "call" }, { "api_name": "gi.require_version", "line_number": 6, "usage_type": "call" }, { "api_name": "gi.repository.Gdk.Screen.get_default", "line_number": 33, "usage_type": "call" }, { "api_name...
544885023
import re from django import template from django.template.defaultfilters import stringfilter register = template.Library() @register.filter @stringfilter def short_title(text_blob): if len(text_blob) > 28: blurb = text_blob[:24] blurb = blurb[:blurb.rfind(' ')] + ' ...' return blurb ...
null
sfm_pc/templatetags/facets.py
facets.py
py
880
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.Library", "line_number": 6, "usage_type": "call" }, { "api_name": "django.template", "line_number": 6, "usage_type": "name" }, { "api_name": "django.template.defaultfilters.stringfilter", "line_number": 10, "usage_type": "name" }, { ...
569695516
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging import time from pn532pi import Pn532, pn532 from pn532pi import Pn532I2c from odoo import _ from odoo.addons.hw_drivers.event_manager import event_manager from odoo.addons.hw_drivers.driver import Drive...
null
nfc_iot/iot_handlers/drivers/PN532Driver.py
PN532Driver.py
py
3,448
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "odoo.addons.hw_drivers.driver.Driver", "line_number": 17, "usage_type": "name" }, { "api_name": "pn532pi.Pn532I2c", "line_number": 29, "usage_type": "call" }, { "api_name"...
322364422
import cv2 import numpy as np from DetectDigit import detect_digit from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.models import load_model def ClassifyDigits(sudoku_gray): stepX = sudoku_gray.shape[1] // 9 stepY = sudoku_gray.shape[0] // 9 board = np.zeros((9, 9), d...
null
src/ClassifyDigits.py
ClassifyDigits.py
py
2,124
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "DetectDigit.detect_digit", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.float32", "...
293181654
import enchant import string from functools import reduce d = enchant.Dict("en_US") ALPHABET = string.ascii_lowercase # ASSUMPTIONS: # The grammarian orb allows for the user to "change one letter" in the spell name # Changing is assumed to take three forms: # - altering the value # - moving the locati...
null
grammarian.py
grammarian.py
py
6,198
python
en
code
null
code-starcoder2
76
[ { "api_name": "enchant.Dict", "line_number": 5, "usage_type": "call" }, { "api_name": "string.ascii_lowercase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "functools.reduce", "line_number": 124, "usage_type": "call" } ]
193018590
# -*- coding:utf-8 -*- import time from FireDynamics.FurnaceModel import main_function import sys import os from PyQt5 import uic, QtGui, QtCore from PyQt5.QtWidgets import QApplication, QMessageBox from matplotlib.backends.backend_qt5agg import ( FigureCanvasQTAgg as FigureCanvas, NavigationToolbar2QT as Navig...
null
project/zone_model_1/UI/main 2.py
main 2.py
py
8,151
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "PyQt5.uic.loadUiType", ...
275956631
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright 2011-2020, Nigel Small # # 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 # # Unle...
null
py2neo/client/packstream.py
packstream.py
py
24,910
python
en
code
null
code-starcoder2
76
[ { "api_name": "struct.pack", "line_number": 30, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 31, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": 34, "usage_type": "call" }, { "api_name": "struct.pack", "line_number": ...
484233194
import os import pandas as pd from os import path import multiprocessing from multiprocessing import Process import threading import matplotlib from matplotlib import pyplot as plt import statsmodels.api as sm import seaborn as sns from model.abstract_classes.dgp_sanity_check import DGP_Sanity_Check from datetime impor...
null
GENERATOR/model/utilities/sanity_check.py
sanity_check.py
py
14,329
python
en
code
null
code-starcoder2
76
[ { "api_name": "model.abstract_classes.dgp_sanity_check.DGP_Sanity_Check", "line_number": 16, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "name" }, { "a...
501899599
__author__ = 'joelwhitney' # SIE 558 - Final Take - Insert into DB # this file: # 1) opens connection to mysql db and sets up insert statement # 2) set up pi serial connection # 3) opens file to write results to and start reading from serial # imports import serial import time import datetime import pymysql # 1) open...
null
SIE558_FinalWriteCSVwPlotly_JoelWhitneyV2a.py
SIE558_FinalWriteCSVwPlotly_JoelWhitneyV2a.py
py
2,878
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymysql.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 30, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
642911028
"""empty message Revision ID: b56a84863d22 Revises: e3aa9f7201ed Create Date: 2017-12-22 15:17:59.643533 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = 'b56a84863d22' down_revision = 'e3aa9f7201ed' branch_labels = None depe...
null
migrations/versions/b56a84863d22_.py
b56a84863d22_.py
py
1,830
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.alter_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.String", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op.add_c...
308328171
''' Created on Apr 20, 2011 @author: SAM FENDELL ''' from PyQt4 import QtGui, QtCore from sympy import sympify, Symbol, lambdify class Fit: def __init__( self, name, description, function, params, autofit = None ): self.name = name self.description = description self.function = function ...
null
old_files/grapher/fitter.py
fitter.py
py
6,713
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt4.QtGui.QDialog", "line_number": 67, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 67, "usage_type": "name" }, { "api_name": "PyQt4.QtGui.QVBoxLayout", "line_number": 70, "usage_type": "call" }, { "api_name": "PyQt4.Qt...
417620465
from django.http import JsonResponse from rest_framework import generics, permissions from rest_framework.response import Response from .serializers import ( UserSerializer, RegisterSerializer, LoginSerializer) from rest_framework.views import APIView from rest_framework.permissions import IsAuthenticated from rest...
null
users/views.py
views.py
py
1,818
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework_jwt.settings.api_settings.JWT_PAYLOAD_HANDLER", "line_number": 10, "usage_type": "attribute" }, { "api_name": "rest_framework_jwt.settings.api_settings", "line_number": 10, "usage_type": "name" }, { "api_name": "rest_framework_jwt.settings.api_settin...
484829311
#!/usr/bin/env python import random import os from pyfirmata import Arduino, INPUT, PWM from time import sleep PORT = os.environ['ARDUINO_PORT'] board = Arduino(PORT) pin = 11 def get_pwm_pin(): return board.digital[11] get_pwm_pin().mode = PWM for _ in xrange(99): get_pwm_pin().write(random.randint(1, 100) / ...
null
src/pwm_led.py
pwm_led.py
py
412
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pyfirmata.Arduino", "line_number": 9, "usage_type": "call" }, { "api_name": "pyfirmata.PWM", "line_number": 15, "usage_type": "name" }, { "api_name": "random.randint", "l...
484967100
# -*- coding: utf-8 -*- """ Utility functions to plot words frequencies over time. """ import matplotlib.pyplot as plt import numpy as np import pandas as pd import re from db_connection import server_name, db_name, fetch_dataframe def process_cases(): query_case = open('Z:/Andre Bittar/Projects/eHOST-IT/Andre_...
null
plot_word_feature_counts.py
plot_word_feature_counts.py
py
11,690
python
en
code
null
code-starcoder2
76
[ { "api_name": "db_connection.fetch_dataframe", "line_number": 17, "usage_type": "call" }, { "api_name": "db_connection.server_name", "line_number": 17, "usage_type": "argument" }, { "api_name": "db_connection.db_name", "line_number": 17, "usage_type": "argument" }, { ...
335872653
''' Flask application to manipulate images Deployed on Amazon Web Services EC2 Initial fork from Flask Tutorial by: Author: Scott Rodkey - rodkeyscott@gmail.com https://medium.com/@rodkey/deploying-a-flask-application-on-aws-a72daba6bb80 ''' # flask imports from flask import Flask, render_template, request, jsonify f...
null
application.py
application.py
py
3,026
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_restful.fields.Integer", "line_number": 21, "usage_type": "attribute" }, { "api_name": "flask_restful.fields", "line_number": 21, "usage_type": "name" }, { "api_name": "flask_restful.fields.String", "line_number": 22, "usage_type": "attribute" }, ...
487168126
from django.shortcuts import render from inventory.models import Inventory from inventory.forms import InventoryForm from django.http import HttpResponseRedirect def post_inventories(request): template_name = 'inventory.html' posts = Inventory.objects.all() return render(request, template_name, {'posts': p...
null
inventory/views.py
views.py
py
658
python
en
code
null
code-starcoder2
76
[ { "api_name": "inventory.models.Inventory.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "inventory.models.Inventory.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "inventory.models.Inventory", "line_number": 8, "usage_type":...
321448148
import json from app import app from app.db.comments import Comment from app.db.categories import Category from app.db.galleries import Gallery from app.db.subscriptions import Subscription from app.db.subscriptions import SubscriptionCategory from app.utils.aws import s3_change_image_resolutions from app.utils.dateti...
null
app/apis.py
apis.py
py
4,000
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.request.data", "line_number": 19, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 19, "usage_type": "name" }, { "api_name": "json.dumps", "li...
244450896
import re import pytest from dagster.check import CheckError from dagster.seven import mock from dagster.utils.backcompat import canonicalize_backcompat_args def is_new(old_flag=None, new_flag=None, include_additional_warn_txt=True): actual_new_flag = canonicalize_backcompat_args( new_val=new_flag, ...
null
python_modules/dagster/dagster_tests/general_tests/utils_tests/test_backcompat.py
test_backcompat.py
py
1,593
python
en
code
null
code-starcoder2
76
[ { "api_name": "dagster.utils.backcompat.canonicalize_backcompat_args", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.warns", "line_number": 33, "usage_type": "call" }, { "api_name": "re.escape", "line_number": 35, "usage_type": "call" }, { "api_...
331466985
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging import uuid from django.db import models from django.utils import timezone from django.contrib.auth.models import User, Group import benchmark.configurations.task_conf as CONF logger = logging.getLogger(__name__) choice_filter = lambda ...
null
benchmark/models/task_models.py
task_models.py
py
4,586
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "benchmark.configurations.task_conf.PROTOCOL_INFO.values", "line_number": 18, "usage_type": "call" }, { "api_name": "benchmark.configurations.task_conf.PROTOCOL_INFO", "line_number": 1...
487568986
import sys sys.path.append('data_processing') from config import prefix import bridge from tqdm import tqdm import numpy as np import pandas as pd import os from pretraining import DualEventModel import random from sklearn.decomposition import TruncatedSVD import json from dictionaries import possible_labels from PIL i...
null
backup/svd.py
svd.py
py
3,769
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "dictionaries.possible_labels", "line_number": 18, "usage_type": "argument" }, { "api_name": "pandas.r...
271053523
from django.views.generic import TemplateView from deals.models import Deal from main.const import DEFAULT_PAGE_LIMIT, DEFAULT_PAGE_OFFSET from main.converters import to_int, to_positive from statistics.models import Statistic from traders.models import Trader from transactions.const import TransactionType from transa...
null
main/views.py
views.py
py
2,851
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.TemplateView", "line_number": 13, "usage_type": "name" }, { "api_name": "main.converters.to_positive", "line_number": 19, "usage_type": "call" }, { "api_name": "main.const.DEFAULT_PAGE_OFFSET", "line_number": 24, "usage_type": "argument...
633546545
import numpy as np import matplotlib.pyplot as plt # x = [1, 5, 10, 10, 25, 50, 70, 75, 300 ] # y = [0, 0, 0, 0, 0, 1, 1, 1, 1] # # colors = np.random.randn(len(x)) # plt.plot(np.unique(x), np.poly1d(np.polyfit(x, y, 1))(np.unique(x))) # plt.ylabel("Fever") # plt.xlabel("Temperature") # # plt.scatter(x, y, c=colors, a...
null
Practical_Deep_Learning_With_Pytorch/LogisticRegression.py
LogisticRegression.py
py
4,570
python
en
code
null
code-starcoder2
76
[ { "api_name": "torchvision.datasets.MNIST", "line_number": 20, "usage_type": "call" }, { "api_name": "torchvision.datasets", "line_number": 20, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 22, "usage_type": "call" }, { "a...
138084554
#-*- coding: utf-8 -*- #MLP.py import numpy as np import tensorflow as tf import matplotlib.pyplot as plt #자료를 불러옵니다. data_file_name = 'x_square.txt' xy = np.genfromtxt(data_file_name, dtype='float32') # x값과 y값을 불러와서 임시로 저장한다 temp_x = xy[:, 0] # 첫째 칼럼을 x_temp로 저장 temp_y = xy[:, 1] # 둘째 칼럼을 y_temp로 ...
null
ch 09 Multi Layer Perceptron/MLP.py
MLP.py
py
1,614
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.genfromtxt", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.placeholder", ...
10480677
from collections import Counter import pickle import string from unidecode import unidecode if __name__ == '__main__': # Open and normalize text to extract usual vocabulary with open('data/les_miserables.txt', 'r') as text: fantine = text.read().replace('\n', ' ') fantine = unidecode(fantine).lowe...
null
src/build_usual_words.py
build_usual_words.py
py
856
python
en
code
null
code-starcoder2
76
[ { "api_name": "unidecode.unidecode", "line_number": 11, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 15, "usage_type": "attribute" }, { "api_name": "collections.Counter", "line_number": 22, "usage_type": "call" }, { "api_name": "pickl...
456594526
import threading from common import pattern class Thing(object): def __init__(self, name): self._name = name self._attributes = {} @property def name(self): return self._name def __getitem__(self, name): if name in self._attributes: return self._attributes[name].value else: ...
null
utils/universe.py
universe.py
py
3,693
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.pattern.Logger", "line_number": 65, "usage_type": "attribute" }, { "api_name": "common.pattern", "line_number": 65, "usage_type": "name" }, { "api_name": "threading.Thread", "line_number": 92, "usage_type": "call" }, { "api_name": "common.pat...
609597373
from flask import ( render_template, request, redirect, session, url_for, Blueprint, ) from bson.objectid import ObjectId from models.topic import Topic from models.reply import Reply from models.board import Board from models.user import User from .bbs import login_require from .bbs import c...
null
routes/topic.py
topic.py
py
1,854
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 25, "usage_type": "call" }, { "api_name": "models.board.Board.find_all", "line_number": 34, "usage_type": "call" }, { "api_name": "models.board.Board", "line_number": 34, "usage_type": "name" }, { "api_name": "flask....
366184731
""" """ import json import sys import click from planemo.cli import pass_context from planemo import options from planemo import shed from planemo.io import error from planemo.io import info from planemo.io import shell tar_path = click.Path( exists=True, file_okay=True, dir_okay=False, resolve_path...
null
planemo/commands/cmd_shed_upload.py
cmd_shed_upload.py
py
3,353
python
en
code
null
code-starcoder2
76
[ { "api_name": "click.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "planemo.shed.for_each_repository", "line_number": 63, "usage_type": "call" }, { "api_name": "planemo.shed", "line_number": 63, "usage_type": "name" }, { "api_name": "sys.exit", ...
621268390
from allennlp.modules.scalar_mix import SumMix import torch if __name__ == "__main__": indices = [-1, -2] mixer = SumMix([-1, -2]) tensors = [torch.randn([32, 10, 1024])] * 12 merged = mixer(tensors) test_tensor = tensors[-1] + tensors[-2] assert torch.sum(test_tensor != merged).item() == 0
null
tests/mixer_test.py
mixer_test.py
py
316
python
en
code
null
code-starcoder2
76
[ { "api_name": "allennlp.modules.scalar_mix.SumMix", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.randn", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.sum", "line_number": 10, "usage_type": "call" } ]
106893274
import kfp from kfp import components from kfp import dsl from kfp import gcp # dataflow_tf_transform_op = 'gcr.io/celerates-playground/dock-img@sha256:e8935c4e00ce2a6d938b8349e8d03c59aadfbeca3d1022936641708494b89a92' # kubeflow_tf_training_op = components.load_component_from_url('https://raw.githubusercontent.com/ku...
null
generatetf-coba.py
generatetf-coba.py
py
1,895
python
en
code
null
code-starcoder2
76
[ { "api_name": "kfp.gcp.use_gcp_secret", "line_number": 41, "usage_type": "call" }, { "api_name": "kfp.gcp", "line_number": 41, "usage_type": "name" }, { "api_name": "kfp.dsl.pipeline", "line_number": 11, "usage_type": "call" }, { "api_name": "kfp.dsl", "line_n...
503715406
from __future__ import unicode_literals import math from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from auths.models import Customer, Organization, OrganizationUsers from commons.exceptions import (AccessAuthenticationError, ObjectDoesNotExist, ...
null
epad/projects/services/projects.py
projects.py
py
14,230
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Project.objects.filter", "line_number": 41, "usage_type": "call" }, { "api_name": "models.Project.objects", "line_number": 41, "usage_type": "attribute" }, { "api_name": "models.Project", "line_number": 41, "usage_type": "name" }, { "api_name...
571279745
import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import Dataset, DataLoader import torch import math import copy import logging import numpy as np from lightwood.mixers.nn.helpers.default_net import DefaultNet from lightwood.mixers.nn.helpers.transformer import T...
null
lightwood/mixers/nn/nn.py
nn.py
py
7,916
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.MSELoss", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 28, "usage_type": "name" }, { "api_name": "torch.optim.Adadelta", "line_number": 30, "usage_type": "attribute" }, { "api_name": "torch.optim", ...
169564486
import re, sys, nltk, pprint, pickle, csv, math, numpy, word_category_counter selected_features = None def get_story_clauses(csv_name): story_clauses = [] with open('{0}.csv'.format(csv_name), newline='', encoding="ISO-8859-1") as csvfile: reader = csv.reader(csvfile) story = [] for re...
null
Assignment4/Part2-train.py
Part2-train.py
py
9,326
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.reader", "line_number": 8, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", "line_number": 43, "usage_type": "call" }, { "api_name": "word_category_counter.score_text", "line_number": 66, "usage_type": "call" }, { "api_name": "nltk.Fr...
603901449
import json from bson.objectid import ObjectId from sanic.log import logger from sanic.exceptions import ServerError from model.user import User class UserService(): async def register_user(self, user_param): try: logger.info(self.register_user.__name__+' Inserting a new user.') n...
null
examples/sanic/service/user_service.py
user_service.py
py
1,435
python
en
code
null
code-starcoder2
76
[ { "api_name": "sanic.log.logger.info", "line_number": 12, "usage_type": "call" }, { "api_name": "sanic.log.logger", "line_number": 12, "usage_type": "name" }, { "api_name": "model.user.User", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", ...
653355361
# GNU MediaGoblin -- federated, autonomous media hosting # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either versio...
null
media_types/audio/processing.py
processing.py
py
5,888
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 28, "usage_type": "call" }, { "api_name": "mediagoblin.media_types.audio.transcoders.AudioTranscoder", "line_number": 33, "usage_type": "call" }, { "api_name": "mediagoblin.processing.BadMediaFail", "line_number": 35, "usa...
148587695
import os, grp, daemon, signal, lockfile from com.port8.core.scheduler import Scheduler #with daemon.DaemonContext(): # do_main_program() #More complex example usage: print('instantiating scheduler') sched = Scheduler() print('in context') context = daemon.DaemonContext( working_directory='/home/anil/app/src/d...
null
com/port8/core_old/daemon02.py
daemon02.py
py
951
python
en
code
null
code-starcoder2
76
[ { "api_name": "com.port8.core.scheduler.Scheduler", "line_number": 9, "usage_type": "call" }, { "api_name": "daemon.DaemonContext", "line_number": 11, "usage_type": "call" }, { "api_name": "lockfile.FileLock", "line_number": 14, "usage_type": "call" }, { "api_name...
565711806
import uuid import random import asyncio import aio_pika AMQP_URL = 'amqp://guest:guest@localhost:5672/' async def consumer(sourceQ, channel): async with sourceQ.iterator() as queue_iter: # Cancel consuming after __aexit__ async for message in queue_iter: async with message.proce...
null
consumer.py
consumer.py
py
1,695
python
en
code
null
code-starcoder2
76
[ { "api_name": "aio_pika.Message", "line_number": 18, "usage_type": "call" }, { "api_name": "aio_pika.connect_robust", "line_number": 25, "usage_type": "call" }, { "api_name": "aio_pika.exchange", "line_number": 33, "usage_type": "attribute" }, { "api_name": "uuid....
498592247
from setuptools import setup readme = open('README.rst').read() history = open('HISTORY.rst').read() # Loading the version with ``from facepy import __version__`` will # cause setuptools to attempt to import dependencies that we have no # guarantee exist on the system yet, so we'll have to use ``execfile`` to # impor...
null
uccface/build/facepy/setup.py
setup.py
py
1,159
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 12, "usage_type": "call" } ]
287759403
import sys import Levenshtein import pickle from urllib.parse import urlparse from typing import List, Tuple g = {} def check_typosquatting(longest_section: str) -> str: TYPOSQUATTING_THRESHOLD: float = 0.7 tmp_max_longest_section: str = "" tmp_max_score: float = -1.0 tmp_max_index: int = -1 f...
null
sechuv_chve/src/engine/core/fake_url.py
fake_url.py
py
3,076
python
en
code
null
code-starcoder2
76
[ { "api_name": "Levenshtein.distance", "line_number": 19, "usage_type": "call" }, { "api_name": "Levenshtein.jaro_winkler", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse", "line_number": 57, "usage_type": "call" }, { "api_name": "t...
645654240
# -*- coding: utf-8 -*- #/usr/bin/python3 ''' Feb. 2019 by kyubyong park. kbpark.linguist@gmail.com. https://www.github.com/kyubyong/transformer. Preprocess the iwslt 2016 datasets. ''' import os import errno import multiprocessing as mp from tqdm import tqdm import sentencepiece as spm from hparams im...
null
prepro.py
prepro.py
py
4,186
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.isfile", ...
472304834
''' Dan Adler, Farhan Damani Computational Genomics Final Library for consensus sequencing Goes through all reads and creates a counter for reads in a certain offset with most frequent position Returns new contig list based upon that. Methods: 1. consensus_sequence() 2. compute_new_contigs() 3. run_consensus() USES...
null
PROGRAMS/Consensus_Sequence.py
Consensus_Sequence.py
py
2,441
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 45, "usage_type": "call" } ]
337526740
from seleniumwire import webdriver from selenium.webdriver.firefox.options import Options as Firefox_Options from .utils import check_and_create_file from time import sleep from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import Sel...
null
detaspider/browser_firefox.py
browser_firefox.py
py
5,858
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.firefox.options.Options", "line_number": 32, "usage_type": "call" }, { "api_name": "seleniumwire.webdriver.FirefoxProfile", "line_number": 39, "usage_type": "call" }, { "api_name": "seleniumwire.webdriver", "line_number": 39, "usage_type"...
151462833
import os import cv2 import utils import random import numpy as np from RAP_script import utils from RAP_script import rap_data_loading as rap import time def get_head_area(img, mask, keypoints): assert img is not None and mask is not None head_point = keypoints[rap.kp_head] neck_point = keypoints[rap.kp...
null
RAP_script/generate_synthetic_images.py
generate_synthetic_images.py
py
23,830
python
en
code
null
code-starcoder2
76
[ { "api_name": "RAP_script.rap_data_loading.kp_head", "line_number": 14, "usage_type": "attribute" }, { "api_name": "RAP_script.rap_data_loading", "line_number": 14, "usage_type": "name" }, { "api_name": "RAP_script.rap_data_loading.kp_neck", "line_number": 15, "usage_type...