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
15180463
from datetime import datetime, date import calendar from django.shortcuts import render, get_object_or_404, redirect from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from cart.cart import Cart from .models import OrderItem, Order from .tasks import send_mail_order fr...
null
boardure_django/orders/views.py
views.py
py
2,236
python
en
code
null
code-starcoder2
76
[ { "api_name": "cart.cart", "line_number": 15, "usage_type": "name" }, { "api_name": "cart.cart.Cart", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.get_object_or_404", "line_number": 18, "usage_type": "call" }, { "api_name": "boardure_...
198888697
import sys, pygame from db.setup import * from db.workouts import * # Pygame setup pygame.init() pygame.font.init() black = 0, 0, 0 white = 255, 255, 255 screen = pygame.display.set_mode((0,0)) width = screen.get_width(); height = screen.get_height(); # The database connection conn = setupDb() workouts = listWorkout...
null
workouts.py
workouts.py
py
917
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.font.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode", ...
202165295
from mitmproxy import http import json # wow bold of you to let me handle money def handleMoney(flow): endpoint = flow.request.path.replace('/magica/api/money', '') if endpoint.startswith('/shop/list'): with open('data/commonMoneyList.json', encoding='utf-8') as f: userCommonMoneyList = jso...
null
api/money.py
money.py
py
553
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "mitmproxy.http.HTTPResponse.make", "line_number": 10, "usage_type": "call" }, { "api_name": "mitmproxy.http.HTTPResponse", "line_number": 10, "usage_type": "attribute" }, { "api_na...
435091437
# Copyright 2020 John Reese # Licensed under the MIT license import logging from pathlib import Path from typing import Optional import click from attribution import __author__, __version__ from .generate import Changelog from .helpers import sh from .project import Project from .tag import Tag from .types import Ve...
null
attribution/main.py
main.py
py
3,048
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 23, "usage_type": "attribute" }, { "api_name": "logging.WARNING", "line_number": 23, "usage_type": "attribute" }, { "api_name": "click.gro...
60302766
# -*- coding: utf-8 -*- """ Final_Year_Project.ipynb """ import numpy as np from sklearn.model_selection import train_test_split ''' IV. Preparing the Inception v3 output for input to the LSTM ''' ''' Shuffle and split the data into the train and test set. ''' # Load saved features extract...
null
lstm.py
lstm.py
py
5,968
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.load", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 20, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy....
106910059
import math import numpy as np from tensorflow.python.keras.utils.np_utils import to_categorical from tensorflow.keras import datasets from tensorflow.keras import layers, models, Input from tqdm import tqdm def CNN(): model = models.Sequential() model.add(layers.Conv2D(32, kernel_size=(5, 5), activation='re...
null
FL.py
FL.py
py
2,748
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.keras.models.Sequential", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.keras.models", "line_number": 11, "usage_type": "name" }, { "api_name": "tensorflow.keras.layers.Conv2D", "line_number": 12, "usage_type": "call" }, ...
100793178
''' Created on Feb 28, 2012 @author: antoniopenta ''' import simplejson import geoUtility as geo import dataBaseMongo as dbMongo import utils import geojson import crimeRetrieve; import os from CrimeAnalytics import settings def computeContextfromPostCode(request): context={} time=laodTimePeriod(); c...
null
src/CrimeAnalytics/crimeStat/code/controlCrimeStat.py
controlCrimeStat.py
py
5,376
python
en
code
null
code-starcoder2
76
[ { "api_name": "simplejson.dumps", "line_number": 23, "usage_type": "call" }, { "api_name": "geoUtility.getcompiledREPostCode", "line_number": 26, "usage_type": "call" }, { "api_name": "geoUtility.isvalidPostCode", "line_number": 27, "usage_type": "call" }, { "api_...
20673067
from .__plugin__ import Plugin as _P from .__plugin__ import publicFun import logging import sys from PySide2 import QtCore, QtWidgets, QtGui from functools import partial app = QtCore.QCoreApplication.instance() class Plugin(_P): log2Bar = QtCore.Signal(str) log2Wid = QtCore.Signal(str) def __init__(sel...
null
app/plugins/log.py
log.py
py
3,594
python
en
code
null
code-starcoder2
76
[ { "api_name": "PySide2.QtCore.QCoreApplication.instance", "line_number": 9, "usage_type": "call" }, { "api_name": "PySide2.QtCore.QCoreApplication", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PySide2.QtCore", "line_number": 9, "usage_type": "name" }, ...
291006904
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('blog', '0009_auto_20150810_0838'), ] operations = [ migrations.CreateModel( name='cooler', fields=[ ...
null
blog/migrations/0010_cooler.py
0010_cooler.py
py
585
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
126729815
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2016 Luca Chiodini <luca@chiodini.org> import csv import io import MySQLdb import requests import sys import tempfile from config import * def main(): response = requests.get( "https://spreadsheets.google.com/tq?tqx=out:csv&key=" + ...
null
updater.py
updater.py
py
2,408
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "tempfile.NamedTemporaryFile", "line_number": 22, "usage_type": "call" }, { "api_name": "MySQLdb.connect", "line_number": 27, "usage_type": "call" }, { "api_name": "io.open", ...
176420742
# -*- coding: UTF-8 -*- from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name="django_ltree_fork", version="0.4.4", python_requires=">=2.7", url="https://github.com/boryszef/django-ltree", author="Borys Szefczyk", author_e...
null
setup.py
setup.py
py
1,081
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 9, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 20, "usage_type": "call" } ]
634147610
import numpy as np from keras.applications.resnet50 import ResNet50 from keras.layers import Conv2D, MaxPooling2D, Dense, LeakyReLU, BatchNormalization from keras.models import Model def buildYolo(): # Loading pretrained ResNet50 resnet = ResNet50(weights = 'imagenet') # Removing the last 3 layers resnet.laye...
null
network.py
network.py
py
1,043
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.applications.resnet50.ResNet50", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.layers.Conv2D", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.layers.BatchNormalization", "line_number": 21, "usage_type": "call" }, ...
200523533
from connection import fetch_one, fetch_all from cachetools.func import ttl_cache from caching import hashable_cache from util import parse_inputs, preload_outputs, quantize_outputs, set_if_unset import math import timeit class Gh_Grow: @staticmethod def info(): return { "name": "gh_grow",...
null
models/gh/capex/grow.py
grow.py
py
8,682
python
en
code
null
code-starcoder2
76
[ { "api_name": "connection.fetch_all", "line_number": 63, "usage_type": "call" }, { "api_name": "connection.fetch_all", "line_number": 66, "usage_type": "call" }, { "api_name": "connection.fetch_all", "line_number": 69, "usage_type": "call" }, { "api_name": "cachin...
196532131
import requests from django.shortcuts import render def weather(request): api_url = "http://api.openweathermap.org/data/2.5/forecast" city = False # если city пустое значение, то блок с талбицей и городом выводится не будет if request.method == "POST": # если метод POST, то присваеваем city город, кот...
null
weather/views.py
views.py
py
2,245
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 24, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 47, "usage_type": "call" } ]
391704159
#! /usr/bin/python print("Content-type: text/html\n") import cgi import random form = cgi.FieldStorage() # if "name" in form: # print form.getvalue("name"); # else: # print("No name provided") reds = 0 whites = 0 if "guess" in form: guess = form.getvalue("guess") else: guess = "" if "answer" in fo...
null
12-python/mastermind.py
mastermind.py
py
1,620
python
en
code
null
code-starcoder2
76
[ { "api_name": "cgi.FieldStorage", "line_number": 7, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 27, "usage_type": "call" } ]
629560198
#!/usr/bin/env python import numpy as np import theano from theano import tensor as T from theano_layer import theano_layer class fully_connected_layer(theano_layer): def __init__(self, previous_layer, rng, training_log, empty_shared_var, layer_parameters, model_directory = None): self.layer_type = 'full...
null
code/theano_cnn/fully_connected_layer.py
fully_connected_layer.py
py
2,738
python
en
code
null
code-starcoder2
76
[ { "api_name": "theano_layer.theano_layer", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.prod", "line_number": 15, "usage_type": "call" }, { "api_name": "theano.tensor.dot", "line_number": 48, "usage_type": "call" }, { "api_name": "theano.tensor",...
439906305
#exec(open('distributions\\expon.py').read()) # ---------------------------------------------------------------------- # # Reference Material Montgomery & Runger: Applied statistics and Probability # for Engineers 7ed # # ---------------------------------------------------------------------- import subprocess as sp imp...
null
distributions/expon.py
expon.py
py
5,140
python
en
code
null
code-starcoder2
76
[ { "api_name": "subprocess.call", "line_number": 19, "usage_type": "call" }, { "api_name": "importlib.reload", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.close", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.p...
623387630
# coding: utf-8 # Copyright 2013 The Font Bakery Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
null
bakery_cli/scripts/encode_glyphs.py
encode_glyphs.py
py
2,755
python
en
code
null
code-starcoder2
76
[ { "api_name": "fontTools.ttLib.ttLib.getTableModule", "line_number": 49, "usage_type": "call" }, { "api_name": "fontTools.ttLib.ttLib", "line_number": 49, "usage_type": "attribute" }, { "api_name": "fontTools.ttLib", "line_number": 49, "usage_type": "name" }, { "a...
462892579
from .vpython import GlowWidget, baseObj, vector from http.server import BaseHTTPRequestHandler, HTTPServer import os import platform import threading import json import webbrowser as _webbrowser import asyncio from autobahn.asyncio.websocket import WebSocketServerProtocol, WebSocketServerFactory import copy import s...
null
vpython/no_notebook.py
no_notebook.py
py
7,932
python
en
code
null
code-starcoder2
76
[ { "api_name": "os._exit", "line_number": 21, "usage_type": "call" }, { "api_name": "signal.signal", "line_number": 24, "usage_type": "call" }, { "api_name": "signal.SIGINT", "line_number": 24, "usage_type": "attribute" }, { "api_name": "socket.socket", "line_n...
197004668
# -*- coding: utf-8 -*- """ Created on Tue Mar 13 13:30:47 2018 @author: sarth """ import pandas as pd from sklearn.neighbors import KNeighborsClassifier from sklearn import preprocessing from sklearn import utils pd.set_option('display.float_format', lambda x: '%.6f' % x) def knn_predict(k, concentration, pH): ...
null
SAFMI/ImageDisorderPrediction/UserPrediction.py
UserPrediction.py
py
2,863
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.set_option", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 43, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 50, "usage_type": "call" }, { "api_name": "sklearn.preprocess...
560955483
import pandas as pd from selenium import webdriver from selenium.webdriver.common.keys import Keys from datetime import datetime import os os.system('set PATH=%PATH%;D:\\Users\\50047924\\Desktop\\Combustivel') chr_options = webdriver.ChromeOptions() caminho = "D:\\Users\\50047924\\Desktop\\Combustivel" prefs ...
null
busca_dados.py
busca_dados.py
py
1,032
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.system", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 8, "usage_type": "name" }, { "api_name": "selenium.w...
355609466
from django.urls import path from . import views urlpatterns = [ path('',views.login), path('register/',views.register,name='register'), path('customer/',views.customer,name='customer'), path('summary/',views.summary,name='summary'), path('place/',views.place,name='place'), path('logout/',views...
null
broker/urls.py
urls.py
py
723
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
311034996
import collections from graphviz import Digraph from graphviz import Graph as Graphviz from lib_tools import aristas from lib_tools import nodos import sys DIRECTED = "DIRECTED" DISCOVERED = "DISCOVERED" RENDER = False class Grafo: def __init__(self, num_nodos=None, num_aristas=None, atrbt={}): ...
null
lib_tools/grafo.py
grafo.py
py
15,416
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib_tools.nodos.Nodo", "line_number": 33, "usage_type": "call" }, { "api_name": "lib_tools.nodos", "line_number": 33, "usage_type": "name" }, { "api_name": "lib_tools.nodos", "line_number": 38, "usage_type": "name" }, { "api_name": "lib_tools.nodos....
642424391
import os import os.path import platform from argparse import ArgumentParser from functools import wraps import logging logging.captureWarnings(True) logger = logging.getLogger('') logger.setLevel(logging.DEBUG) handler = logging.StreamHandler() formatter = logging.Formatter(fmt='%(message)s',datefmt='%Y-%m-%d %H:%M:%...
null
libojclient/cmd.py
cmd.py
py
3,914
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.captureWarnings", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.St...
432432260
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import logging import numpy as np from scipy import sparse logger = logging.getLogger() def exponential_decay(value, max_val, half_life): """Compute decay factor for a given value based on an exponential decay Va...
null
2019/6-azureml-movie-recommendation/reco_utils/common/python_utils.py
python_utils.py
py
3,111
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.minimum", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.expand_dims", "...
6601991
import tensorflow as tf import os import sys import argparse import numpy as np import pickle import math import time import traceback import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.patheffects as patheffects from avod.core import box_3d_encoder from avod.core import evaluato...
null
predict.py
predict.py
py
27,261
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "li...
139522028
#!/usr/bin/env python # coding=utf-8 import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.image import MIMEImage from email.header import Header class SendMessage: def __init__(self): return def send(self, to_msg, to_add): mail_hos...
null
test_dir/邮箱测试!!!!/mailbox.py
mailbox.py
py
1,969
python
en
code
null
code-starcoder2
76
[ { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 20, "usage_type": "call" }, { "api_name": "email.header.Header", "line_number": 24, "usage_type": "call" }, { "api_name": "email.mime.text.MIMEText", "line_number": 25, "usage_type": "call" }, { "a...
538499468
# L07-2-KMeans.py import numpy as np import pandas as pd import matplotlib.pyplot as plt # Create Points to cluster Points = pd.DataFrame() Points.loc[:,0] = [1.91,0.9,1.26,0.61,1.25,1.04,0.53,0.99,1.11,0.1,-0.15,0.83,0.72,0.69,0.74, 0.72,1.09,0.68,0.67,0.82,0.74,0.94,0.64,1.44,0.76,1.06,0.79,0.88,0.76...
null
lab/07/L07-2-KMeans.py
L07-2-KMeans.py
py
4,269
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_...
76056180
import torch from data_generator import data_gen from transformer import (make_model, LabelSmoothing, get_scheduler, Loss, Transformer) from run_epoch import run_epoch from utils import subsequent_mask def decode(model: Transformer, source: torch.Tensor, source_mask: torch.Tensor,...
null
test/test.py
test.py
py
1,630
python
en
code
null
code-starcoder2
76
[ { "api_name": "transformer.Transformer", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.ones", "line_number": 14, "usage_type": "call" }, { "api_name": "utils.subsequent...
445417408
import pika import json import json_api connection = pika.BlockingConnection(pika.ConnectionParameters( host='localhost')) channel = connection.channel() channel.queue_declare(queue='signal') def callback(ch, method, properties, body): data = json.loads(body) for key, value in data.items(): part...
null
worker.py
worker.py
py
1,010
python
en
code
null
code-starcoder2
76
[ { "api_name": "pika.BlockingConnection", "line_number": 5, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 5, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "json_api.t...
288754513
# -*- coding: utf-8 -*- from flask import Flask from flask import render_template from flask import redirect from flask import request from flask import abort from flask import make_response from flask import url_for from flask import flash from sqlalchemy import sql import uuid from models import User from models i...
null
app.py
app.py
py
5,069
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.request.cookies.get", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.request.cookies", "line_number": 24, "usage_type": "attribute" }, { "api_name": "flas...
622875789
#coding=UTF-8 import json import tkinter as menu import time import random import math class Inspermon(): def __init__(self): def mostra_jogadorprincipal(jog_principal): print("Inspermon : {0}".format(jog_principal["nome"])) time.sleep(1) p...
null
debugando.py
debugando.py
py
32,047
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 22, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 24, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 26, ...
98317149
import networkx as nx import scipy as sc import matplotlib.pyplot as p def GenRdmAdjList(N = 2, C = 0.5): """ define a """ Ids = range(N) ALst = [] for i in Ids: if sc.random.uniform(0,1,1) < C: Lnk = sc.random.choice(Ids,2).tolist() if Lnk[0] != Lnk[1]: #avoid ...
null
Week7/Code/DrawFW.py
DrawFW.py
py
1,263
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.random.uniform", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "scipy.random.choice", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.rand...
510795018
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np #Buka JSON FILE df = pd.read_json("PUT JSON FILE HERE!! json/YOUR JSON FILE") #Ganti Semua nama TimeStamp yang ada di JSON dengan Date df.rename(columns={'timestamp': 'date'}, inplace=True) #Buang Parameter/Argu...
null
Analyze.py
Analyze.py
py
1,306
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_json", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 17, "usage_type": "call" }, { "api_name": "seaborn.set", "line_number": 26, "usage_type": "call" }, { "api_name": "seaborn.set", "lin...
319979856
import time, pandas as pd, numpy as np from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer from sklearn import svm t1=time.time() train = pd.read_csv('../data/train_set.csv') test = pd.read_csv('../data/test_set.csv') test_id = test["id"].copy() column = "word_seg" vec = TfidfVectorizer(ngr...
null
tfidf+svm.py
tfidf+svm.py
py
816
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.tex...
70451638
import tensorflow as tf from tensorflow.keras import Model, Input from tensorflow.keras.layers import Conv2D, MaxPooling2D, Conv2DTranspose, Lambda, Layer, BatchNormalization, Activation from tensorflow.keras import backend as K from tensorflow.keras.models import load_model, save_model from tensorflow.keras.preproces...
null
tofNetRgb/model/facedeconv.py
facedeconv.py
py
11,280
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.keras.layers.Layer", "line_number": 14, "usage_type": "name" }, { "api_name": "tensorflow.keras.backend.cast", "line_number": 26, "usage_type": "call" }, { "api_name": "tensorflow.keras.backend", "line_number": 26, "usage_type": "name" }, { ...
357592973
""" === Module Description === This module contains a new class, PaperTree, which is used to model data on publications in a particular area of research. """ import csv from typing import List, Dict, Optional from tm_trees import TMTree # Filename for the dataset DATA_FILE = 'cs1_papers.csv' class PaperTree(TMTree)...
null
papers.py
papers.py
py
5,403
python
en
code
null
code-starcoder2
76
[ { "api_name": "tm_trees.TMTree", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 58, "usage_type": "name" }, { "api_name": "tm_trees.TMTree", "line_number": 58, "usage_type": "name" }, { "api_name": "tm_trees.TMTree.__init__"...
447263896
import os from pywps import Process, LiteralInput, LiteralOutput import logging LOGGER = logging.getLogger("PYWPS") class Hello(Process): def __init__(self): inputs = [ LiteralInput('name', 'Your name', data_type='string')] outputs = [ LiteralOutput('output', 'Output resp...
null
twitcher/processes/wps_hello.py
wps_hello.py
py
969
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "pywps.Process", "line_number": 9, "usage_type": "name" }, { "api_name": "pywps.LiteralInput", "line_number": 12, "usage_type": "call" }, { "api_name": "pywps.LiteralOutput"...
283318867
from __future__ import print_function import argparse import os,sys import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data # import torchvision.transforms as transforms # import torchvision.utils as vutils from t...
null
pointnet6DV2.py
pointnet6DV2.py
py
7,704
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 96, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 96, "usage_type": "name" }, { "api_name": "torch.nn.Conv1d", "line_number": 100, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
392311116
import os import json import cv2 import time from functools import cmp_to_key import random #把train.txt转换为coco标注文件 os.chdir(os.path.join('..', 'datasets', 'coco_mocod','obstruct')) os.makedirs('annotations', exist_ok=True) def convert(name): with open(os.path.join(f"2007_{name}.txt"), 'r') as f: ...
null
lh_trainval_txt_gen_coco_label.py
lh_trainval_txt_gen_coco_label.py
py
2,681
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 9, ...
408909157
# -*- coding: utf-8 -*- """ Created on Wed Oct 9 09:35:30 2019 Foundations of Data Mining Linear Regression @author: GargyaGokhale """ import pandas as pd import numpy as np import matplotlib.pyplot as plt """Data Acquisition""" data = pd.read_excel('HW2data.xlsx') grp_num = 2 n = ((grp_num - 1)*5 + 2) - 2 x = n...
null
HW2_script1.py
HW2_script1.py
py
1,167
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_excel", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.reshape", "line...
172952452
from __future__ import print_function import os import shutil import sys import time import argparse from datetime import datetime import imp import lasagne import numpy as np import theano import theano.tensor as T from lasagne.regularization import regularize_network_params from lasagne.layers import get_output fr...
null
train.py
train.py
py
11,629
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.categorical_kl_div", "line_number": 48, "usage_type": "call" }, { "api_name": "utils.categorical_kl_div", "line_number": 51, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 54, "usage_type": "call" }, { "api_name": "sy...
628232128
import unittest import datetime from django.test import TestCase, TransactionTestCase from django.utils import timezone, formats from django.core.exceptions import ValidationError from django.db import models as dbmodels from scarlet.versioning.models import VersionView from scarlet.versioning import manager import ...
null
tests/version_models/tests.py
tests.py
py
33,271
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 15, "usage_type": "attribute" }, { "api_name": "scarlet.versioning.models.VersionView", "line_number": 18, "usage_type": "name" }, { "api_name": "scarlet.versioning.models.VersionView", "line_number": 23, "usage_type": "na...
531970658
'''KNN is used to group data with simmilar atributes in higher dimensions. We decide the number of K, which means we find the K closest neighbors to our new data point and from there deduce where it "belongs". We measure the eucledian distance of our new data point from it's neighbors. It runs more efficient ...
null
KNN Classifier.py
KNN Classifier.py
py
3,762
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linalg.norm", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 59, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 59, "usage_type": "call" }, { "api_name": "collections.Counter",...
425267660
from django.shortcuts import render, redirect from django.http import JsonResponse from django.urls import reverse from profiles.models import (Rider, Staff, Supplier, Customer) from .models import (Dish, Payments, Order, OrderItem, Delivery) from django.contrib.auth.models import User f...
null
src/store/views.py
views.py
py
6,499
python
en
code
null
code-starcoder2
76
[ { "api_name": "paystack.resource", "line_number": 30, "usage_type": "name" }, { "api_name": "paystackapi.paystack.Paystack", "line_number": 30, "usage_type": "call" }, { "api_name": "models.Dish.objects.get", "line_number": 35, "usage_type": "call" }, { "api_name"...
69827600
import attr import random class Error(BaseException): def __init__(self, issue): super().__init__(issue) self.rule_error = issue class State(object): EMPTY = 0 P1 = 1 CPU = 2 @attr.s class Rules(object): map = attr.ib() def check(self): forwardslash = [0, 4 , ...
null
examples/to_replace/tictactoe/game.py
game.py
py
3,213
python
en
code
null
code-starcoder2
76
[ { "api_name": "attr.ib", "line_number": 19, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 76, "usage_type": "call" }, { "api_name": "attr.s", "line_number": 16, "usage_type": "attribute" }, { "api_name": "attr.ib", "line_number": 100, ...
379697078
from collections import namedtuple from PySide import QtGui, QtCore from pyrf.gui import labels from pyrf.gui import colors from pyrf.gui.util import hide_layout from pyrf.gui.fonts import GROUP_BOX_FONT from pyrf.gui.widgets import (QCheckBoxPlayback, QDoubleSpinBoxPlayback) import numpy as np REMOVE_BUTTON_WIDTH = ...
null
pyrf/gui/trace_controls.py
trace_controls.py
py
15,940
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 41, "usage_type": "call" }, { "api_name": "PySide.QtGui.QWidget", "line_number": 59, "usage_type": "attribute" }, { "api_name"...
557564258
# Copyright 2018 GoDaddy # # 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 agreed to ...
null
octavia_tempest_plugin/tests/scenario/v2/test_member.py
test_member.py
py
9,534
python
en
code
null
code-starcoder2
76
[ { "api_name": "tempest.config.CONF", "line_number": 26, "usage_type": "attribute" }, { "api_name": "tempest.config", "line_number": 26, "usage_type": "name" }, { "api_name": "octavia_tempest_plugin.tests.test_base.LoadBalancerBaseTest", "line_number": 29, "usage_type": "a...
352703087
from django.db import models from django.conf import settings class BaseShadowAccount(models.Model): user = models.OneToOneField( settings.AUTH_USER_MODEL, null=True, blank=True, on_delete=models.SET_NULL ) email = models.EmailField( blank=True, null=True, ...
null
babik_shadow_accounts/models.py
models.py
py
493
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.OneToOneField", "line_number": 6, "usage_type": "call" }, { "api_name...
237007505
import pygame import sys import math from board import Board from ship import Ship import motion_manager import csv import drag_manager def in_range(first, last, radius): if math.sqrt((first[0] - last[0]) ** 2 + (first[1] - last[1]) ** 2) < radius: return True return False pygame.init() width = 810 ...
null
main.py
main.py
py
2,530
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.sqrt", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 25, "usage_type": "call" }, { "api_name": "pygame.display", "l...
371461921
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
null
src/python/pants/engine/isolated_process.py
isolated_process.py
py
10,227
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "pants.util.contextutil.temporary_file_path", "line_number": 30, "usage_type": "call" }, { "api_name": "pants.util.contextutil.open_tar", "line_number": 31, "usage_type": "call" ...
514756674
import os import json import hashlib import requests import better_exceptions from dateutil import parser from datetime import datetime from bs4 import BeautifulSoup better_exceptions.MAX_LENGTH = None THIS_DIR = os.path.dirname(os.path.abspath(__file__)) def grab_cn(url): # Parse the XML from CN cn_list = ...
null
getschedule.py
getschedule.py
py
3,804
python
en
code
null
code-starcoder2
76
[ { "api_name": "better_exceptions.MAX_LENGTH", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.pat...
303374244
import datetime from api.controller import Controller from api.decorators import requires, get, post from sc import models from web.ldap_wrapper import LDAP from django.contrib.auth.models import User as AuthUser from api import exceptions from io import TextIOWrapper import csv import json def requires_superuser(fun...
null
web/controllers.py
controllers.py
py
14,309
python
en
code
null
code-starcoder2
76
[ { "api_name": "api.exceptions.HttpForbidden", "line_number": 16, "usage_type": "call" }, { "api_name": "api.exceptions", "line_number": 16, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.get", "line_number": 23, "usage_type": "call" }, ...
587922480
from direct.directnotify import DirectNotifyGlobal from direct.gui.DirectGui import * from direct.task.Task import Task from panda3d.core import * from src.toontown.distributed import ToontownDistrictStats from src.toontown.hood import ZoneUtil from src.toontown.shtiker import ShtikerPage from src.toontown.coghq import...
null
src/toontown/shtiker/ShardPage.py
ShardPage.py
py
27,638
python
en
code
null
code-starcoder2
76
[ { "api_name": "src.toontown.suit.SuitDNA.suitDeptModelPaths", "line_number": 46, "usage_type": "attribute" }, { "api_name": "src.toontown.suit.SuitDNA", "line_number": 46, "usage_type": "name" }, { "api_name": "src.toontown.suit.SuitDNA.suitDeptModelPaths", "line_number": 47,...
511003896
import os from flask import jsonify, redirect, render_template, request, url_for from flask_login import current_user, login_user, login_required, logout_user import requests from app import app, db from app.models import User, SigninImage NN_KEY_DIFFERENCE = 10 NN_SEARCH_KEY = 1 class InvalidUsage(Exception): ...
null
app/views.py
views.py
py
4,380
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.jsonify", "line_number": 32, "usage_type": "call" }, { "api_name": "app.app.errorhandler", "line_number": 30, "usage_type": "call" }, { "api_name": "app.app", "line_number": 30, "usage_type": "name" }, { "api_name": "app.app.route", "line_...
374769261
import firebase_admin from firebase_admin import credentials from firebase_admin import firestore import os path = os.path.dirname(os.path.realpath(__file__)) cred = credentials.Certificate(os.path.join(path ,"sistema-caixa-firebase-adminsdk-o6faa-77b6d40db9.json")) firebase_admin.initialize_app(cred) def ...
null
db.py
db.py
py
524
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 6, "usage_type": "call" }, { "api_name": "firebase_admin.credentials...
404191250
"""Preprocessor functions for ancillary variables and cell measures.""" import logging import warnings from pathlib import Path from typing import Iterable import dask.array as da import iris.coords import iris.cube from esmvalcore.cmor.check import cmor_check_data, cmor_check_metadata from esmvalcore.cmor.fix impor...
null
esmvalcore/preprocessor/_supplementary_vars.py
_supplementary_vars.py
py
9,892
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "iris.coords.cube.CubeList", "line_number": 55, "usage_type": "call" }, { "api_name": "iris.coords.cube", "line_number": 55, "usage_type": "attribute" }, { "api_name": "iri...
578399857
import requests import json # put your keys in the header headers = { "app_id": "5b8b9491", "app_key": "51d177e8f5316049ae4a5d209c5af117" } payload = '{"image":"images/shravan.jpg"}' url = "http://api.kairos.com/detect" # make request r = requests.post(url, data=payload, headers=headers) data = r.json() p...
null
test_kairos.py
test_kairos.py
py
331
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.post", "line_number": 16, "usage_type": "call" } ]
453740327
#!/usr/bin/env Python # coding=utf-8 import unittest from BSTestRunner import BSTestRunner import time import smtplib #发送邮件模块 from email.mime.text import MIMEText #定义邮件内容 from email.header import Header #定义邮件标题 import os def send_mail(latest_report): f=open(latest_report,'rb') mai...
null
webdriver/6-1~6-15/Test_Baidu/runtest_email.py
runtest_email.py
py
2,136
python
en
code
null
code-starcoder2
76
[ { "api_name": "email.mime.text.MIMEText", "line_number": 30, "usage_type": "call" }, { "api_name": "smtplib.SMTP_SSL", "line_number": 35, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path.getatime...
352253625
#!/usr/bin/env python from typing import Any, Callable, Dict, Generator, Iterable, Iterator, List, Match, Optional, Set, Tuple, TypeVar from git_machete import __version__ import datetime import getopt import io import itertools import os import re import shutil import subprocess import sys import textwrap # Core u...
null
git_machete/cmd.py
cmd.py
py
187,631
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.TypeVar", "line_number": 20, "usage_type": "call" }, { "api_name": "typing.Iterable", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.Callable", "lin...
1719089
import pdb """ Created on Apr 22 2014 @author: rkp Test the ability of the algorithm to segment a couple control trajectories. """ import SVAR.datagen as datagen import SVAR.model as SV import matplotlib.pylab as plt import numpy as np import pickle FNAME_mosq = '/Users/rkp/Data/Real_Data/trajectories/mosquito/long_...
null
wind_tunnel/old/SVAR/test_suite/segment.py
segment.py
py
2,185
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pylab.close", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pylab", "line_number": 20, "usage_type": "name" }, { "api_name": "pickle.load", "line_number": 46, "usage_type": "call" }, { "api_name": "SVAR.model.Model"...
625262577
""" A character is unique in string S if it occurs exactly once in it. For example, in string S = "LETTER", the only unique characters are "L" and "R". Let's define UNIQ(S) as the number of unique characters in string S. For example, UNIQ("LETTER") = 2. Given a string S with only uppercases, calculate the sum of ...
null
leetcode/uniqueLetterString/solution.py
solution.py
py
1,980
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 38, "usage_type": "call" }, { "api_name": "bisect.bisect_left", "line_number": 63, "usage_type": "call" } ]
618403955
from sqlalchemy import ( Column, Integer, VARCHAR, ) from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Routers(Base): __tablename__ = "routers" id = Column(Integer, primary_key=True, nullable=False, autoincrement=True) router_name = Column(VARCHAR(80)) ...
null
models.py
models.py
py
1,040
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 8, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 14, "usage_type": "argument" }, { ...
166974889
""" eligibilitycheck.py Extends the EDI processing workflow to add a simple FHIR R4 translation. """ import datetime import json import logging import ssl from asyncio import get_running_loop from edi.core.models import EdiOperations from edi.core.support import perf_counter_ms from edi.core.workflows import EdiProce...
null
edi/extensions/eligibilitycheck.py
eligibilitycheck.py
py
10,272
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "edi.core.workflows.EdiProcessor", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 31, "usage_type": "name" }, { "api_name": "edi.core...
427873575
"""P-Roc hardware platform devices.""" import logging from mpf.platforms.interfaces.light_platform_interface import LightPlatformSoftwareFade from mpf.platforms.interfaces.switch_platform_interface import SwitchPlatformInterface from mpf.platforms.interfaces.driver_platform_interface import DriverPlatformInterface, Pu...
null
mpf/platforms/p_roc_devices.py
p_roc_devices.py
py
4,551
python
en
code
null
code-starcoder2
76
[ { "api_name": "mpf.platforms.interfaces.switch_platform_interface.SwitchPlatformInterface", "line_number": 10, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "mpf.platforms.interfaces.driver_platform_interface.D...
325631996
import json from parse_url import parse_url class DouBanSpider(): def __init__(self): self.url_temp = ["https://movie.douban.com/j/search_subjects?type=tv&tag=热门&page_limit=20&page_start={}", "https://movie.douban.com/j/search_subjects?type=tv&tag=美剧&page_limit=20&page_start={}", ...
null
doubanspider.py
doubanspider.py
py
1,291
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "parse_url.parse_url", "line_number": 32, "usage_type": "call" } ]
177796523
from collections import namedtuple class ListNode: def __init__(self, x): self.val = x self.next = None class LinkedList: def __init__(self, l): assert(l, list) prev = None for i in l[::-1]: curr = ListNode(i) curr.next = prev prev = ...
null
leetcode/easy_reverse_list.py
easy_reverse_list.py
py
1,141
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 31, "usage_type": "call" } ]
429604081
"""Tests for messaging_service_util.py.""" import unittest import mock from perfkitbenchmarker import messaging_service_util from tests import pkb_common_test_case class MessagingServiceUtilTest(pkb_common_test_case.PkbCommonTestCase): @mock.patch('perfkitbenchmarker.providers.gcp.gcp_pubsub.GCPCloudPubSub') de...
null
tests/messaging_service_util_test.py
messaging_service_util_test.py
py
1,092
python
en
code
null
code-starcoder2
76
[ { "api_name": "tests.pkb_common_test_case.PkbCommonTestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "tests.pkb_common_test_case", "line_number": 9, "usage_type": "name" }, { "api_name": "perfkitbenchmarker.messaging_service_util.get_instance", "line_num...
460780765
import sys, os, threading, re, datetime, time, pprint, subprocess from pathlib import Path import acmacs from acmacs_py import utils, mapi_utils # ====================================================================== def get_chart(request, filename :Path, populate_seqdb: bool = True): filename_s = str(filename) ...
null
web/chains-202105/py/chart.py
chart.py
py
11,998
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "name" }, { "api_name": "acmacs.Chart", "line_number": 10, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 39, "usage_type": "name" }, { "api_name": "acmacs.Chart", "line_number...
378786824
# -*- test-case-name: tests.test_ttc -*- import re import sys import traceback from twisted.internet.defer import Deferred, inlineCallbacks import pymongo from bson.objectid import ObjectId from vumi.application import ApplicationWorker from vumi.message import TransportUserMessage from vumi import log from vumi.uti...
null
vusion/garbadge_worker.py
garbadge_worker.py
py
4,017
python
en
code
null
code-starcoder2
76
[ { "api_name": "vumi.application.ApplicationWorker", "line_number": 20, "usage_type": "name" }, { "api_name": "vumi.log.msg", "line_number": 23, "usage_type": "call" }, { "api_name": "vumi.log", "line_number": 23, "usage_type": "name" }, { "api_name": "pymongo.Conn...
356330122
import torch from torch import nn """ Code to test LSTM implementation with Lam et.al. Our implementation use vectorization and should be faster... but need to be verified. """ def encoder_blk(in_channels, out_channels): return nn.Sequential( nn.Conv2d(in_channels, out_channels, 3, padding=1, stride=1...
null
tests/verify_mri_lstm.py
verify_mri_lstm.py
py
4,183
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Sequential", "line_number": 11, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_num...
142547017
import gym import numpy as np import os import random from keras import backend from keras.models import Sequential, load_model, model_from_json from keras.layers import Flatten, Dense, Conv2D, Activation from collections import deque from keras.optimizers import Adam, RMSprop import json class DQN: def __init__...
null
Implementation/Breakout_DQN/breakout_dqn.py
breakout_dqn.py
py
6,305
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 26, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 42, "usage_type": "call" }, { "api_name": "keras.models.Se...
500842738
import os import multiprocessing def copy_file(queque,f_name,new_folder_path,old_folder_path): """完成文件的复制""" new_path = os.path.join(new_folder_path,f_name) origin_path = os.path.join(old_folder_path,f_name) origin_file = open(origin_path,"rb") # print(f"正在复制{origin_path}") # 如果要拷贝大文件,这里就换成whi...
null
socket/ubuntu_py/多任务-多进程/04多任务拷贝文件夹.py
04多任务拷贝文件夹.py
py
1,757
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, ...
524329964
"""Tests related to the authorization of api calls. NOTE: while all of these are conceptually authorization related, some illegal operations will raise exceptions other than AuthorizationError. This usually happens when the operation is illegal *in principle*, and would not be fixed by authenticating as someone else. ...
null
tests/unit/api/auth.py
auth.py
py
21,010
python
en
code
null
code-starcoder2
76
[ { "api_name": "haas.auth.get_auth_backend", "line_number": 39, "usage_type": "call" }, { "api_name": "haas.rest.local.db.query", "line_number": 42, "usage_type": "call" }, { "api_name": "haas.rest.local.db", "line_number": 42, "usage_type": "attribute" }, { "api_n...
363416902
import os from collections import ( namedtuple, defaultdict ) from typing import List infile_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'input.txt') class Coord: def __init__(self, x: int, y: int): self.x = x self.y = y def __eq__(self, other): return sel...
null
2018/day3/rectangular.py
rectangular.py
py
3,016
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_n...
603223816
from django.test import TestCase from .models import Enterprise, Driver, Vehicle from .factories import EnterpriseFactory, DriverFactory, VehicleFactory, GpsTrackFactory from rest_framework.test import APITestCase from .serializers import EnterpriseSerializer, VehicleSerializer import json class EnterpriseTestCase(Tes...
null
django/core/tests.py
tests.py
py
4,497
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "factories.EnterpriseFactory", "line_number": 10, "usage_type": "call" }, { "api_name": "factories.DriverFactory", "line_number": 11, "usage_type": "call" }, { "api_name"...
86471403
import json import os import shutil from pathlib import Path from typing import Any, Dict, List, Union import pandas as pd import pendulum import prefect from prefect import Flow, Task, apply_map, task from prefect.backend import set_key_value from prefect.tasks.secrets import PrefectSecret from prefect.utilities impo...
null
viadot/flows/supermetrics_to_adls.py
supermetrics_to_adls.py
py
13,931
python
en
code
null
code-starcoder2
76
[ { "api_name": "prefect.utilities.logging.get_logger", "line_number": 30, "usage_type": "call" }, { "api_name": "prefect.utilities.logging", "line_number": 30, "usage_type": "name" }, { "api_name": "tasks.SupermetricsToDF", "line_number": 32, "usage_type": "call" }, { ...
338560728
import time import re from odoo.osv import expression from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT from odoo import api, fields, models, SUPERUSER_ID, _ from odoo.exceptions import UserError, except_orm, Warning, RedirectWarning, ValidationError from datetime import datetime from dateutil.relativedelta import ...
null
v12_bsc_beacukai/model/stock_picking.py
stock_picking.py
py
42,019
python
en
code
null
code-starcoder2
76
[ { "api_name": "odoo.models.Model", "line_number": 13, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 13, "usage_type": "name" }, { "api_name": "odoo.fields.Many2one", "line_number": 16, "usage_type": "call" }, { "api_name": "odoo.fields",...
368496809
import pytest from talentmap_api.common.serializers import PrefetchedSerializer @pytest.mark.django_db() def test_prefetched_child_fields(): override_fields = [ "id", "long_description", "banana", "post", "post__banana", "post__danger_pay", "post__randr__de...
null
talentmap_api/common/tests/test_prefetched_serializer.py
test_prefetched_serializer.py
py
1,024
python
en
code
null
code-starcoder2
76
[ { "api_name": "talentmap_api.common.serializers.PrefetchedSerializer.parse_child_overrides", "line_number": 46, "usage_type": "call" }, { "api_name": "talentmap_api.common.serializers.PrefetchedSerializer", "line_number": 46, "usage_type": "name" }, { "api_name": "pytest.mark.dja...
294598641
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Toolbar Container. """ # Standard library imports from collections import OrderedDict # Third party imports from qtpy.QtCore import QSize, Slot ...
null
spyder/plugins/toolbar/container.py
container.py
py
10,265
python
en
code
null
code-starcoder2
76
[ { "api_name": "spyder.api.translations.get_translation", "line_number": 28, "usage_type": "call" }, { "api_name": "spyder.api.widgets.main_container.PluginMainContainer", "line_number": 44, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 48, ...
542736010
#-*- coding:cp949 -*- __author__ = 'naseil' import random from pylab import plot from pylab import show import matplotlib.pyplot as plt class kmeans: n = 100 k = 0 p = [] means = [] label = [None] * n #label[i] = j -> i번 점의 그룹이 j이다 # n개의 랜덤 좌표를 생성하여 p배열에 저장한다 def setRandomPoint(self): ...
null
kMeans.py
kMeans.py
py
2,440
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.random", "line_number": 23, "usage_type": "call" }, { "api_name": "random.random", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot"...
584248994
""" Predictive text T9 using trie tree for tast suggestions search Author: Elias J. Perez """ from itertools import product """ create a list of the dial pad, index will correspond to the number dialed and value to the options """ key_pad = {1:["'"], 2:["a", "A", "b", "B", "c", "C"], 3:["d", "D...
null
challenges/predictive_text.py
predictive_text.py
py
3,170
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.product", "line_number": 53, "usage_type": "call" } ]
199230891
# -*- coding: utf-8 -*- """ Visualize financial instruments Created on Sat Oct 31 14:15:43 2020 @author: ryanar """ import math from stock_analysis import Technical import matplotlib.pyplot as plt import matplotlib.dates as mdates import mplfinance as mpf import numpy as np import pandas as pd impo...
null
stock_analysis/stock_visualizer.py
stock_visualizer.py
py
32,074
python
en
code
null
code-starcoder2
76
[ { "api_name": "stock_analysis.Technical", "line_number": 49, "usage_type": "call" }, { "api_name": "utils.validate_df", "line_number": 33, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 163, "usage_type": "attribute" }, { "api_name": "pan...
643729414
import sys, json, re, requests from puhu import getPlist from bs4 import BeautifulSoup pageID = re.search(r"item_id: ?\"(?P<id>\d+)\"", requests.get("https://puhutv.com/yabanci-filmler").text).groupdict()["id"] endpoint = "https://puhutv.com/ajax/widget/render?cms_design_widget_id=4121&content_pool_id_page_no={}&info_...
null
interface.py
interface.py
py
1,690
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.search", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_numbe...
577374835
from django.conf.urls import url from .views import * from django.contrib.auth.views import login, logout_then_login urlpatterns = [ url(r'^$',index_view,name='index_view'), url(r'^signup/$',signup.as_view(),name='signup'), url(r'^admin/$',admin,name='admin'), url(r'^Crear_Categoria/$',Crear_Categoria.as_view(),na...
null
apps/voto/urls.py
urls.py
py
1,001
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "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": "django.co...
544905512
# only run for csvs that don't exist already # get list of all playerId's on playerboxscores data # Scrape teams for every playerid greater than 2015 season # Match name + team + season to get player Id's # Match salary by date + playerId to playerBoxScores # -------see if any playerId doesn't have a match # Fill in ...
null
web scraping/player salaries.py
player salaries.py
py
5,058
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.strptime", "line_number": 77, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 77, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 78, "usage_type": "call" }, { "api_name"...
22605112
''' Created on 15 Feb 2018 @author: Geoffroy Noel ''' from ._kdlcommand import KDLCommand from django.db import connection from django.db import transaction from django.conf import settings class Command(KDLCommand): ''' ''' help = 'KDL toolbox' def action_flush(self): '''Django flush comma...
null
kdl_wordpress2wagtail/management/commands/kdltools.py
kdltools.py
py
1,311
python
en
code
null
code-starcoder2
76
[ { "api_name": "_kdlcommand.KDLCommand", "line_number": 13, "usage_type": "name" }, { "api_name": "django.conf.settings.DATABASES", "line_number": 23, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 23, "usage_type": "name" }, { "a...
110639600
import logging import ftplib import os import re from flexget import plugin from flexget.event import event from flexget.entry import Entry log = logging.getLogger('ftp_list') class InputFtpList(object): """ Generate entries from a ftp listing Configuration: ftp_list: config: na...
null
flexget/plugins/input/ftp_list.py
ftp_list.py
py
5,685
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "flexget.validator.factory", "line_number": 36, "usage_type": "call" }, { "api_name": "flexget.validator", "line_number": 36, "usage_type": "name" }, { "api_name": "ftplib....
144894804
# -*- coding: utf-8 -*- """ Contains the cosmic rays base class which allows to store arbitrary properties for the cosmic rays and makes them accesseble via key or getter function. The second class describes sets of cosmic rays as needed for larger studies. """ import matplotlib.pyplot as plt import numpy as np from a...
null
astrotools/cosmic_rays.py
cosmic_rays.py
py
26,321
python
en
code
null
code-starcoder2
76
[ { "api_name": "astrotools.skymap.scatter", "line_number": 37, "usage_type": "call" }, { "api_name": "astrotools.skymap", "line_number": 37, "usage_type": "name" }, { "api_name": "numpy.bincount", "line_number": 56, "usage_type": "call" }, { "api_name": "astrotools...
54746075
from typing import List, Tuple, Dict from heapq import heappop, heappush from collections import defaultdict class Graph: children: defaultdict weight: Dict[Tuple[int, int], int] def __init__(self, edges) -> None: self.children = defaultdict(list) self.weight = {} for i, j, w in e...
null
1334.py
1334.py
py
1,248
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 8, "usage_type": "name" }, { "api_name": "collections.defaultdict...
233435151
import os,configparser,pymysql from pymysql.cursors import DictCursor from DBUtils.PooledDB import PooledDB class Config(object): def __init__(self,config_filename="dbMysqlConfig.cnf"): print(os.path.dirname(__file__)) file_path=os.path.join(os.path.dirname(__file__),config_filename) self.c...
null
venv/Include/04/msyql_DButils.py
msyql_DButils.py
py
6,546
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8...
297637982
from django.shortcuts import render, redirect, get_object_or_404 from .forms import PostForm, CommentForm from .models import Post, HashTag, Comment from django.core.paginator import Paginator from accounts.models import User from django.contrib.auth.decorators import login_required @login_required def index(request)...
null
posts/views.py
views.py
py
3,816
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Post.objects.all", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 11, "usage_type": "name" }, { "api_name": "django.c...
140617256
import os import keras from keras_bert import get_model model = get_model( token_num=30000, pos_num=512, transformer_num=12, head_num=12, embed_dim=768, feed_forward_dim=768 * 4, ) model.summary(line_length=120) current_path = os.path.dirname(os.path.abspath(__file__)) output_path = os.path.jo...
null
demo/visualization/vis.py
vis.py
py
733
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras_bert.get_model", "line_number": 6, "usage_type": "call" }, { "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", ...
4460912
import json import os dir = os.path.dirname(os.path.abspath(__file__)) def get_link(obj): return "https://vk.com/id"+str(obj["id"]) with open(dir + "\\" + "skeleton_interests_cleaned.json", encoding='utf-8') as fh: skeleton = json.load(fh) cities = {} for item in skeleton: if "city" in item: c...
null
links_printer.py
links_printer.py
py
594
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "json.load", "line_numbe...
304258261
import requests import json url="http://127.0.0.1:8005/courses" post_url="http://127.0.0.1:8005/course" #response = requests.get(url) course_json=json.dumps({ "course_name": "New course 20", "author_name": "futurex", "course_section": { "section1":"Value", "section2":"Value3" }, "creation_date": "2021-03-20" }) r...
null
ss/RestClient/main.py
main.py
py
412
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.dumps", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 7, "usage_type": "call" } ]
218362082
#!/usr/bin/env python2 """Bitcoincharts modules, interacts and builds data feed from JSON file""" import logging import feedparser import monitoring import events import sys def init_logging(): logging.basicConfig( level=logging.DEBUG, filename='log.txt', filemode='w', format='%(asc...
null
main.py
main.py
py
923
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.stdo...
653442880
import torch import torch.nn as nn from torch.autograd import Variable as V from MatrixLSTM_lr.MatrixLSTMCell import MatrixLSTMCell from MatrixLSTM_lr.MatrixGrMul import MatrixGrMul import torch.nn.functional as F class MatrixLSTM_lr(nn.Module): def __init__(self, input_size,output_size): super(MatrixLSTM_...
null
Grassmann_PCA/MatrixLSTM_lr/MatrixLSTM.py
MatrixLSTM.py
py
1,165
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": "MatrixLSTM_lr.MatrixLSTMCell.MatrixLSTMCell", "line_number": 12, "usage_type": "call" }, { "api_name"...
175813701
from PIL import Image,ImageFilter import importlib.util as import_utils import random import numpy as np import unittest spec = import_utils.spec_from_file_location("utils", "dfstego/utilities/myutils.py") utils = import_utils.module_from_spec(spec) spec.loader.exec_module(utils) myconstants = utils.import_module("myc...
null
test/methodEMD/test_methodEMDEncodeMessageToPicture.py
test_methodEMDEncodeMessageToPicture.py
py
3,607
python
en
code
null
code-starcoder2
76
[ { "api_name": "importlib.util.spec_from_file_location", "line_number": 7, "usage_type": "call" }, { "api_name": "importlib.util", "line_number": 7, "usage_type": "name" }, { "api_name": "importlib.util.module_from_spec", "line_number": 8, "usage_type": "call" }, { ...
288797230
from rest_framework import permissions from schedule.models import College from user.models import Teacher, User SUPER_ADMIN = '超级管理员' COLLEGE_ADMIN = '学院管理员' ADMIN_LIST = [SUPER_ADMIN, COLLEGE_ADMIN] def is_admin(user): for i in user.groups.values(): if i['name'] in ADMIN_LIST: return True ...
null
utils/permissions.py
permissions.py
py
4,701
python
en
code
null
code-starcoder2
76
[ { "api_name": "user.models.groups.values", "line_number": 12, "usage_type": "call" }, { "api_name": "user.models.groups", "line_number": 12, "usage_type": "attribute" }, { "api_name": "user.models", "line_number": 12, "usage_type": "name" }, { "api_name": "user.mo...
346304499
import importlib import importlib import os import sys from setuptools import find_packages from setuptools import setup here = (os.path.abspath(os.path.dirname(__file__))) src = os.path.join(here, "src/use") sys.path.insert(0, src) import use meta={ "name":"justuse", "description":"A beautiful, simple and...
null
setup.py
setup.py
py
1,477
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line...