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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
150244481 | #Multiple Linear Regression
#Import the Libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
#Import the dataset
dataset = pd.read_csv('50_Startups.csv')
X = dataset.iloc[:,:-1].values
y = dataset.iloc[:,4].values
#Encoding categorical data
#Enconding the Independant Variable
from sklear... | null | S5_C42_MLR_Backward_Elimination.py | S5_C42_MLR_Backward_Elimination.py | py | 2,219 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.OneHotEncoder",
"line_number": 19,
"usage_type": "call"
},
{... |
529617860 | from datetime import datetime
from threading import Thread
import random
import socket
import time
import sys
# Inicializações globais
isLeader = False
leader = -1
isParticipant = False
pid = int(sys.argv[1])
print('Processo PID: ' + sys.argv[1])
dest = ('localhost', (pid + 1) % 6 + 9000)
r = socket.socket(socket.AF_I... | null | node.py | node.py | py | 4,042 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "socket.socket",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_... |
246005940 | #!/usr/bin/python3
import random, fractions, math, sys
def brent(n):
y, c, m = random.randint(1, n - 1), random.randint(1, n - 1), random.randint(1, n - 1)
g, r, q = 1, 1, 1
while g == 1:
x = y
for i in range(r):
y = ((y * y) % n + c) % n
k = 0
while (k < r and ... | null | reference.py | reference.py | py | 5,767 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.randint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "fractions.gcd",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "fractions.gcd",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_numbe... |
483223311 | from typing import Dict, Any
import datetime
import jwt
key = (
b"\x83\x9f\x99\xd9\xc1\xa0\x9c\xea\xf2\x2b\x49\x51\xba\x22\x1e\x26"
b"\x23\x18\x39\xa2\xfc\x01\x84\x88\x1d\x70\x84\x7a\x8d\x2a\xca\x7b"
)
algorithm = "HS384"
class ParseError(Exception):
pass
async def create(data: Dict[str, Any]) -> str... | null | tools/tokens/main.py | main.py | py | 740 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Dict",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
617370959 | import os
import pygame
BALL_IMAGES = 'balls.png' # 792 x 480
IMAGES_DIRECTORY = 'images'
class Ball(pygame.sprite.Sprite):
WIDTH = 20
HEIGHT = 20
STEP_SIZE = 5
crop_offsets = {'lightblue': 0,
'blue': 1,
'red': 2,
'green': 3,
... | null | pygame/diamonds/ball.py | ball.py | py | 1,949 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.sprite",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "py... |
343733938 | import setuptools
import pathlib
# The text of the README file
README = (pathlib.Path(__file__).parent / 'README.md').read_text()
setuptools.setup(
name='customhys',
version='1.0.0',
packages=setuptools.find_packages(),
url='https://github.com/jcrvz/customhys',
license='MIT License',
author='J... | null | setup.py | setup.py | py | 584 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 10,
"usage_type": "call"
}
] |
257782414 | import json
import pandas as pd
from .application_scaling_model import ApplicationScalingModel
from .platform_scaling_model import PlatformScalingModel
from autoscalingsim.deltarepr.group_of_services_delta import GroupOfServicesDelta
from autoscalingsim.deltarepr.node_group_delta import NodeGroupDelta
from autoscali... | null | autoscalingsim/scaling/scaling_model/scaling_model.py | scaling_model.py | py | 2,280 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.Timedelta",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "platform_scaling_model.PlatformScalingModel",
"line_number": 29,
"usage_type": "call"
},
{
"api_n... |
417854081 | import psycopg2
import pytest
import time
from docker import Client as DockerClient
from aioframe.models import Model
@pytest.yield_fixture(scope='session')
def docker():
cli = DockerClient(base_url='unix:///var/run/docker.sock')
container = cli.create_container(image='test_db_aioframe')
container_id = c... | null | tests/conftest.py | conftest.py | py | 910 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "docker.Client",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.yield_fixture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "aioframe.models.Model",
... |
502352691 | from flask import request, Blueprint, jsonify,render_template
from jobwork.constants import Constants
from jobwork.models.city import CityCollections
from jobwork.models.jobbids import JobBids
from jobwork.models.jobs import Jobs
from jobwork.models.locations import Locations
from jobwork.models.user import User
from j... | null | jobwork/routes/jobs.py | jobs.py | py | 19,562 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "jobwork.models.city.CityCollections.find",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "jobwork.models.city.CityCollections",
"line_number": 19,
"usage_type": "name"
... |
545334494 | import sqlite3
from statistics import mean
dtb='data_files/medSched.sqlite'
conn=sqlite3.connect(dtb)
c=conn.cursor()
c.execute('Delete from OutZipDT')
c.execute( '''
select out_key,
zip1,
zip2,
dist,
time
from OutZipDT0
''')
recs=c.fetchall(... | null | medSched/old/outZipFix.py | outZipFix.py | py | 821 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
}
] |
378920594 | import time
import logging
import os
from flask import Flask
from flask_ask import Ask, request, session, question, statement
from bluepy import btle
app = Flask(__name__)
ask = Ask(app, "/")
logging.getLogger('flask_ask').setLevel(logging.DEBUG)
global tx_char, dev
DEVICE_ADDR = "D0:E0:99:0B:B1:C2"
UART_UUID = ... | null | skill/easehand.py | easehand.py | py | 4,282 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_ask.Ask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line... |
397987537 | print('import')
import pickle
import random
from sklearn.tree import DecisionTreeClassifier
from sklearn.feature_extraction import DictVectorizer
from sklearn.pipeline import Pipeline
from sklearn import metrics
from sklearn.metrics import average_precision_score
from sklearn.metrics import confusion_matrix
classifi... | null | pos/classifier_DecisionTree.py | classifier_DecisionTree.py | py | 2,730 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.pipeline.Pipeline",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.DictVectorizer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 14,
"usage_type"... |
391577803 | import matplotlib.pyplot as plt
import numpy as np
delta = [99, 50, 10, 1, 0.1, 0.01]
delta = np.array(delta)/100
success = [53, 97.8, 99.1, 99.5, 100, 100]
time = [0.48, 2.54, 3.53, 3.71, 3.84, 4.07]
time = np.array(time) + 4.8
fig, ax1 = plt.subplots()
ax1.plot(delta, success, 'b')
ax1.set_xlabel('Upper Risk Bound'... | null | RAOStar/plot_left_turn_results.py | plot_left_turn_results.py | py | 790 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
581102163 | # -*- coding: utf-8 -*-
# See LICENSE file for full copyright and licensing details.
from datetime import datetime
from odoo import models, fields, api
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
production_lot_id = fields.Many2one('stock.production.lot',
... | null | library/models/sale.py | sale.py | py | 8,401 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "odoo.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Many2one",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "odoo.fields",
... |
245923066 | from PyQt5 import QtCore, QtGui, QtWidgets, _QOpenGLFunctions_2_0
from main import StoveControl
class InputGuiValues(QtWidgets.QWidget, StoveControl):
input_values = StoveControl()
def __init__(self):
super().__init__()
self.btn = QtWidgets.QPushButton("Podaj moc na której ma pracować piec",... | null | gui_input.py | gui_input.py | py | 1,532 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "main.StoveControl",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "main.Stov... |
653651545 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('festival', '0013_art_project_x'),
]
operations = [
migrations.AlterModelOptions(
name='festival',
op... | null | festival/migrations/0014_auto_20170517_2351.py | 0014_auto_20170517_2351.py | py | 683 | 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.AlterModelOptions",
"line_number": 14,
"usage_type": "call"
... |
537171865 | # Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import stix
import stix.utils as utils
import stix.bindings.exploit_target as exploit_target_binding
import stix.bindings.stix_common as stix_common_binding
from stix.common import DateTimeWithPrecision, StructuredT... | null | stix/exploit_target/vulnerability.py | vulnerability.py | py | 13,686 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "stix.Entity",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "stix.bindings.exploit_target",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "stix.common.StructuredTextList",
"line_number": 100,
"usage_type": "call"
},
{
"api... |
282027472 | import nltk
import glob
from nltk.corpus import floresta
from nltk import FreqDist
from nltk.tokenize import RegexpTokenizer
import pickle
from nltk.util import ngrams
def simplify_tag(t):
if "+" in t:
return t[t.index("+")+1:]
else:
return t
''' train PT tagger'''
'''
tsents = floresta.tagg... | null | datasets/nVivo/data_stats.py | data_stats.py | py | 2,677 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nltk.tokenize.RegexpTokenizer",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "n... |
328956313 | from __future__ import print_function
import sys
from operator import add
from pyspark import SparkContext
from pyspark.sql import SparkSession
import json
from pyspark.sql.functions import col
from csv import reader
from pyspark.sql.functions import desc
from dateutil.parser import parse
import datetime
import pytz
im... | null | Section A/group6/task3/test.py | test.py | py | 3,320 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyspark.SparkContext",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 29,
"usage_type": "attrib... |
82092122 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
import os
import sys
import traceback
import unittest
LIB_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if LIB_PATH not in sys.path:
sys.path.append(LIB_PATH)
from common.tasking import MultiTask
from common.telepho... | null | MILAN_MTBF/stability/13_Multi_Tasking.py | 13_Multi_Tasking.py | py | 3,473 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_num... |
432438058 | # Title: vxxtopng
# Author: Robert Caine
# Last Revised: August 2015
# Purpose: To convert Wing Commander image files to PNG format.
import sys
import struct
import os
from PIL import Image
# one block consists of a table entry followed by RLE data
class lv2Table:
def __init__(self, blockLen):
self.blockL... | null | vxxtopng.py | vxxtopng.py | py | 4,787 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "struct.unpack",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_n... |
114804970 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import datetime
import db
class TencentVarietyItemPipeline(object):
def open_spider(self, spider):
self.connect = ... | null | base_data/tencent_variety_item/tencent_variety_item/pipelines.py | pipelines.py | py | 4,993 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "db.mysqlConnect",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "dat... |
159215780 | from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from functools import partial
from isingEngine import IsingEngine
from pottsEngine import PottsEngine
from conwayEngine import ConwayEngine
from latticeCanvas import Canvas
import random as ra
import re
# Draws the main window and con... | null | latticeGUI.py | latticeGUI.py | py | 14,529 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "latticeCanvas.Canvas",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "functools.pa... |
518935664 | #!/usr/bin/env python3
import os
import json
import sys
import templates
print("Content-Type: text/html\r\n\r\n")
print("<!doctype html><title>Hello</title>\r\n<h2>hello world</h2>\r\n")
#Q1
jsonObject = json.dumps(dict(os.environ), indent=4)
#print(jsonObject)
print("\r\n")
#Q2
for keys, value in os.environ.items():... | null | hello.py | hello.py | py | 841 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.dumps",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ.items",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_nu... |
127525347 | from django.conf.urls import url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
# Site pages redirecting
url(r'^$', views.home, name='home'), # Home page
url(r'^about$', views.about, name='about-us'), # Abo... | null | inkmor_web/home/urls.py | urls.py | py | 813 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": ... |
404419713 | # BG_Image.py - A module for loading background images and blitting them easily onto a surface.
# Created: 18/07/2013
# Author: Jannik Haberbosch
# Modules
import pygame
pygame.init()
from game.components import helpers
class BG_Image( pygame.sprite.Sprite ):
"""
A class for loading background images. ... | null | game/classes/BG_Image.py | BG_Image.py | py | 861 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.sp... |
87287929 | # https://zhuanlan.zhihu.com/p/32025746
import visdom
import numpy as np
viz = visdom.Visdom()
# contour
x1 = np.arange(-50,50,0.5)
x2 = np.arange(-50,50,0.5)
x1, x2 = np.meshgrid(x1, x2)
Z = x1**2 - 2*x1+1+x2**2+4*x2+4
g1 = 10-x1-10*x2
g2 = 10*x1-x2-10
viz.contour(X=Z, win = 'surface',opts=dict(colormap='Viridis'))... | null | 工具与技巧/Visdom可视化/等高线图.py | 等高线图.py | py | 514 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "visdom.Visdom",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_numbe... |
77716346 | """ This module imports .csv files and creates a relational database using MongoDB"""
import os
import csv
import time
from pymongo import MongoClient
class MongoDBConnection():
"""MongoDB Connection"""
def __init__(self, host='127.0.0.1', port=27017):
""" be sure to use the ip address not name for lo... | null | students/kevin_t/Lesson7/linear.py | linear.py | py | 4,181 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
345547084 | # This script pulls from a job website and stores positions into a database. If there is a new posting it notifies the user.
# Fall 2019 CNA 330
# Robin Cunanan, rtcunanan@student.rtc.edu
import mysql.connector
import sys
import json
import urllib.request
import os
import time
# Connect to database
# You may need to e... | null | JobHunter/TestCode/JobHunter - Copy.py | JobHunter - Copy.py | py | 4,249 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 14,
"usage_type": "name"
},
{
"... |
490392446 | import pygame
from square import Square
from node import Node
import time, random
from collections import deque
pygame.init()
class NotFound(Exception): pass
class Grid:
def __init__(self, squares_per_row, surf):
self.squares_per_row = squares_per_row
self.surface = surf
self.grid = se... | null | grid.py | grid.py | py | 7,043 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "square.Square",
"line_nu... |
42334818 | import hddm
from patsy import dmatrix # for generation of (regression) design matrices
import numpy as np # for basic matrix operations
from pandas import Series # to manipulate data-frames generated by hddm
n_subjects = 10
trials_per_level = 200 # and per stimulus
LOld = {'v': .5, 'a': 3, 't': .3, 'sv': 0... | null | HDDM Testing/Simulated Data.py | Simulated Data.py | py | 2,736 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "hddm.generate.gen_rand_data",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "hddm.generate",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "hddm.generate.gen_rand_data",
"line_number": 19,
"usage_type": "call"
},
{
"api_na... |
487569829 | import cx_Oracle
import os
import time
os.putenv("NLS_LANG", ".UTF8")
connection = cx_Oracle.connect("scott", '1234', 'localhost/company')
start = time.time()
cursor = connection.cursor()
cursor.execute("SELECT * FROM MEMBER")
res = cursor.fetchall()
print(res)
elapsed = (time.time() - start)
print(elapsed, "secondes... | null | Python/0529/oracle_samples/06.query_arraysize.py | 06.query_arraysize.py | py | 357 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.putenv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cx_Oracle.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 13,... |
70641148 | #!/usr/bin/python3
import argparse
import logging
import glob
import os
import re
import io
from gen_keyphrase_core_bounds import gen_keyphrases
def extract_keyph(fpath):
logger = logging.getLogger("extract_keyph")
keyphs = []
contents = io.open(fpath,encoding="utf-8").read()
return gen_keyphrases(cont... | null | scix_eke-2.0.py | scix_eke-2.0.py | py | 2,573 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "gen_keyphrase_core_bounds.gen_keyphrases",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lo... |
124144132 | import requests
from bs4 import BeautifulSoup
headers = {'user-agent': 'googlebot'}
sitemap_link = 'http://www.site.com.ua/product-sitemap.xml' # Link for sitemap.xml file
s = requests.get(sitemap_link, headers=headers)
sitemap = BeautifulSoup(s.content, 'lxml')
links = [link.find("loc").text for link in sitemap.fin... | null | urls_from_xml.py | urls_from_xml.py | py | 576 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
}
] |
561978821 | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member, invalid-name
"""Test request import and updates."""
import datetime
from collections import OrderedDict
import ddt
import freezegun
from ggrc import db
from ggrc import... | null | test/integration/ggrc/converters/test_import_assessments.py | test_import_assessments.py | py | 25,974 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "integration.ggrc.TestCase",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "ggrc.models.Assessment.query.filter",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "ggrc.models.Assessment",
"line_number": 44,
"usage_type": "attribute"
},
... |
230734656 | import plotly
import plotly.plotly as py
import plotly.tools as tls
import plotly.graph_objs as go
plotly.tools.set_credentials_file(username='microsilicon', api_key='ekrc27ruwb')
plotly.tools.set_config_file(world_readable=False,
sharing='private')
stream_ids = tls.get_credentials_file()[... | null | Res502_VaractorIII/plotly_settings.py | plotly_settings.py | py | 2,413 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "plotly.tools.set_credentials_file",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "plotly.tools",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "plotly.tools.set_config_file",
"line_number": 7,
"usage_type": "call"
},
{
"api... |
133619488 | from utils.helper_functions.src_folder_path import src_folder_path
from keras import optimizers
glove_location = '/home/mint/Documents/Glove_data/glove.6B.100d.txt'
word2vec_location = '/home/mint/Documents/word2vec/GoogleNews-vectors-negative300.bin'
crisis_word2vec_location = '/home/mint/Downloads/crisisNLP_word2vec... | null | crisis_map_backend/properties/properties.py | properties.py | py | 5,732 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.helper_functions.src_folder_path.src_folder_path",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "utils.helper_functions.src_folder_path.src_folder_path",
"line_number": 72,
"usage_type": "name"
},
{
"api_name": "utils.helper_functions.src_folder_p... |
521799538 | # project/__init__.py
from flask import Flask, request,jsonify, session
from flask.ext.bcrypt import Bcrypt
from flask.ext.sqlalchemy import SQLAlchemy
from project.config import BaseConfig
from flask.ext.jsontools import jsonapi
import decimal, datetime, json
def alchemyencoder(obj):
"""JSON encoder function fo... | null | project/__init__.py | __init__.py | py | 2,729 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.date",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "decimal.Decimal",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "project.config.Ba... |
166947305 | # This script is a compilation of all functions needed for data preprocessing, cleaning and feature engineering
# Modified and added feature date --> month, year, day; added lagged feature (1,3,5,8,12) from weather data
# Fixed leakage in data, added closest station to train and test files
# Created dummies of species ... | null | utils.py | utils.py | py | 6,495 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
517317523 | import mari
import xml.etree.ElementTree as ET
import time
from functools import wraps
HASH_SUFFIX = "nodeHash"
def timer(function):
"""Prints the time a function took to run"""
@wraps(function)
def wrapper(*args, **kwargs):
start = time.time()
result = function(*args, **kwar... | null | snap.py | snap.py | py | 3,764 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.fromstring"... |
54984481 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: /home/kevin/virtualenvs/kd/src/chalk/chalk/tests.py
# Compiled at: 2013-08-19 21:02:57
from django.test import TestCase
from django.core.urlresolvers import reve... | null | pycfiles/django-chalk-0.2.1.tar/tests.py | tests.py | py | 3,744 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.Article.objects.filter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "models.Article.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"ap... |
581560447 | import logging
from sqlalchemy.exc import SQLAlchemyError, IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from model.mapping.gym import Gym
from model.dao.dao import DAO
from exceptions import Error, ResourceNotFound
from sqlalchemy.exc import SQLAlchemyError
logging.basicConfig(filename="log_file.log"... | null | GLPOO_Project/model/dao/gym_dao.py | gym_dao.py | py | 3,774 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "model.dao.dao.DAO",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "logging.debug",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "model.mapping.gym... |
55175890 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2018-12-25 20:23
# @Author : Pan Xuelei
# @FileName: test.py
# @Eamil : 317118173pxl@gmail.com
# @Description:
from PIL import Image
import matplotlib.pyplot as plt
if __name__ == '__main__':
stamp_path = 'E:\\NewFolder\\code\\Python\stamp\\测试\\test.P... | null | stamp/test.py | test.py | py | 565 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",... |
103350299 | from bs4 import BeautifulSoup
from urllib import request
import os
# 全局变量
global bookName
global bookChapter
global savePath
savePath = "C:\\Users\\SF\\Desktop\\Book"
# 书籍选择
def bookMarkList(url):
req = request.Request(url)
result = request.urlopen(req).read()
soup = BeautifulSoup(result, "html5lib")
... | null | SF/crawlerBook.py | crawlerBook.py | py | 2,723 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.Request",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib.r... |
109267105 | #! /usr/bin/env python
# Songwrite 3
# Copyright (C) 2001-2016 Jean-Baptiste LAMY -- jibalamy@free.fr
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at... | null | pypi_install_script/Songwrite3-0.1.tar/setup.py | setup.py | py | 5,303 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_num... |
418501974 | import numpy as np
import matplotlib.pylab as plt
lons = np.zeros(0)
lats = np.zeros(0)
for i in range(8):
lo = np.load('locs%d.npz'%i)
lons = np.append(lons,lo['lons'])
lats = np.append(lats,lo['lats'])
plt.scatter(lons,lats)
plt.show()
| null | figures/figure1/ParticleTracking/HR/releaselocs/plot_locs.py | plot_locs.py | py | 255 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number": 9,
... |
150797398 | import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import multiprocessing
import time
import requests
from matplotlib.testing.compare import compare_images
imp... | null | test/test_demos.py | test_demos.py | py | 7,660 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number"... |
448770967 | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from helpdesk.models import Queue, Ticket, FollowUp, PreSetReply, KBCategory
from helpdesk.models import EscalationExclusion, EmailTemplate, KBItem
from helpdesk.models import TicketChange, Attachment, IgnoreEmail
from helpdesk.mod... | null | helpdesk/admin.py | admin.py | py | 3,929 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.register",
"line_number": 10,
"usage_type": "call"
},
... |
148837321 | #!/usr/bin/env python3
from setuptools import setup, find_packages
# Get the long description from the README file
with open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(
name='flask-rest-api',
version='0.17.1',
description='Build a REST API with Flask',
long_descriptio... | null | setup.py | setup.py | py | 1,463 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 39,
"usage_type": "call"
}
] |
192271489 | #coding=utf-8
#Author: Jiangtian
#Create Date:2018/07/30
#Last Edited:2018/09/29
#从dotamax网站获取今日/本周英雄的胜率和使用次数,并生成版头文本
from bs4 import BeautifulSoup
import requests
import datetime
class hero(object): #定义hero类用以存放数据
def __init__(self, name, rate, number):
self.name = name
self... | null | project1/heropick.py | heropick.py | py | 4,238 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.today",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "bs4.Beaut... |
103135915 | # Copyright 2017 Google Inc.
#
# 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 in writing, ... | null | simulation/configuration.py | configuration.py | py | 4,569 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "simpy.Environment",
"line_number": 48,
"usage_type": "call"
},
{
"api_name"... |
396664182 | import os
import sys
import xml.etree.ElementTree as ET
import febio
import numpy as np
import vtk
from scipy.linalg import eigh
from vtk.util import numpy_support
def __indent(elem,level):
i = '\n' + level*' '
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + ' '... | null | src/bioMultiScale/read_cell_plot.py | read_cell_plot.py | py | 10,674 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "febio.FebPlt",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"lin... |
185280934 | import numpy as np
import h5py
import os
from scipy.misc import imread, imresize
class IMG(object):
def __init__(self, filename):
self.filename = filename
self.l8, self.l2 = self.get_label()
def get_label(self):
emotion = ['amusement', 'anger', 'awe', 'contentment',
... | null | prepo/create_dataset.py | create_dataset.py | py | 2,052 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.misc.imread",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "scipy.misc.imresize",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line... |
28085214 |
"""kulshankomkastkiller.py
Copyright 2021 David Jagoe.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... | null | kulshankomkastkiller.py | kulshankomkastkiller.py | py | 8,192 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "logging.handlers.RotatingFileHandler",
"line_number": 58,
"usage_type": "call"
},
{
"api_name... |
459840824 | from basic.generic_training_manager import GenericTrainingManager
from torch.nn import CrossEntropyLoss, CTCLoss
import torch
from basic.utils import edit_cer_from_list, edit_wer_from_list, nb_chars_from_list, nb_words_from_list, LM_ind_to_str
import numpy as np
import editdistance
class Manager(GenericTrainingManage... | null | OCR/document_OCR/v_attention/trainer_pg_va.py | trainer_pg_va.py | py | 7,922 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "basic.generic_training_manager.GenericTrainingManager",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn.CTCLoss",
"line_number": 20,
"usage_type": "call"
},
{
... |
355247930 | from django.shortcuts import render, get_object_or_404, redirect
from django.views import View
from django.contrib.auth import login, authenticate
from django.contrib.auth.forms import UserCreationForm
from .models import Trip, Reservation, Country
from .forms import SearchForm, ReservationForm
from django.db.models im... | null | core/views.py | views.py | py | 4,563 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 22,
"usage_type": ... |
475380520 | """
Since there're missing values in the dataset, I'll replace them with mean values.
20180627: Replace missing values with median, because some features are norminal.
Another moral: MinMaxScaler works significantly better than StandardScaler.
"""
import numpy as np
import csv
import math
import matplotlib.pyplot as ... | null | logistic_regression/hcc_survival.py | hcc_survival.py | py | 7,279 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.Imputer"... |
90837082 | # -*- coding: utf-8 -*-
# Copyright (c) 2020. Distributed under the terms of the MIT License.
from pymatgen.electronic_structure.core import Spin
from pathlib import Path
import tempfile
import unittest
import warnings
from vise.analyzer.dos_plotter import get_dos_plot, max_density
from vise.util.testing import Vise... | null | vise/analyzer/tests/test_dos_plotter.py | test_dos_plotter.py | py | 2,965 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "vise.util.testing.ViseTest",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "warnings.simplefilter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "warning... |
172783880 | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 13 15:29:57 2020
@author: incog
"""
import tensorflow.keras as keras
import numpy as np
import glob
from IPython.display import clear_output
class TrainingPlot(keras.callbacks.Callback):
# This function is called when the training begins
def on_train_begin(... | null | util.py | util.py | py | 8,889 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.keras.callbacks",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "IPython.display.clear_output",
"line_number": 38,
"usage_type": "call"
},
{
"api... |
454591390 | #
#
# voice-skill-sdk
#
# (C) 2021, Deutsche Telekom AG
#
# This file is distributed under the terms of the MIT license.
# For details see the file LICENSE in the top directory.
#
#
# Skill responses
#
from typing import Text
from skill_sdk.responses.info import SkillInfoResponse
from skill_sdk.responses.error impo... | null | skill_sdk/responses/__init__.py | __init__.py | py | 1,516 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Text",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "skill_sdk.responses.response.SkillInvokeResponse",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "skill_sdk.responses.response.ResponseType.TELL",
"line_number": 58,
"usage_t... |
576246917 | from kafka import KafkaProducer
from kafka.errors import KafkaError
import json
topic = 'test'
producer = KafkaProducer(bootstrap_servers=['localhost:9092'])
# produce json messages
jsonData = {'key': 'first'}
jsonMessage = json.dumps(jsonData).encode('ascii')
producer.send(topic, jsonMessage)
def on_send_success(... | null | 08-apache-kafka-client/03-publish-message.py | 03-publish-message.py | py | 796 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "kafka.KafkaProducer",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "kafka.KafkaProducer",
"line_number": 31,
"usage_type": "call"
}
] |
268836732 | import platform
import os
import socket
from notebook.base.handlers import IPythonHandler
from ._version import __version__
class ping(IPythonHandler):
def get(self):
data = dict(
os = platform.system(),
arch = platform.architecture(),
platform = platform.platform(),
... | null | notebook_snippets/ping.py | ping.py | py | 662 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "notebook.base.handlers.IPythonHandler",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "platform.system",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "platform.architecture",
"line_number": 12,
"usage_type": "call"
},
{
"api_na... |
258380156 | # -*- coding: utf-8 -*-
#
# This file is part of Istex_Mental_Rotation.
# Copyright (C) 2017 SSbE ERIC Laboratory.
#
# This is a free software; you can redistribute it and/or modify it
# under the terms of the Revised BSD License; see LICENSE file for
# more details.
# Load and transform ISTEX and wiki articles into b... | null | embedding.py | embedding.py | py | 4,413 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.Lemmatizer",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "utils.Paragraphs",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "pickle.dump... |
161547349 | import numpy as np
from pathlib import Path
from sentence_transformers import SentenceTransformer
from typing import Literal
import openai
class TextEmbedder:
def __init__(
self,
model: Literal[
"text-embedding-ada-002",
"all-distilroberta-v1",
"msmarco-bert-bas... | null | semantic-search/src/embed.py | embed.py | py | 2,514 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Literal",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "sentence_transformers.SentenceTransformer",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": ... |
271730036 | from transformation_utilities import *
import logging
"""A list of all possible status of the projects. Any status not covered will be assumed as False."""
IMPORT_STATUS = {
'Published': True,
'Archived': True,
'Incomplete new': False,
'Incomplete': False,
'Archive (internal use only)': False,
... | null | projects.py | projects.py | py | 3,347 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 26,
"usage_type": "attribute"
}
] |
142331512 | import subprocess
import urllib
import paramiko
import json
from constants import *
result = subprocess.run([(
"az vmss list-instance-public-ips --resource-group %s --name %s --query [].{ip:ipAddress} -o tsv" % (
ResourceGroup, VMSSname))], stdout=subprocess.PIPE, shell=True)
publicIPs = result.stdout.deco... | null | scripts/pull.py | pull.py | py | 976 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "subprocess.run",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "paramiko.SSHClient",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "paramiko.AutoAdd... |
529158103 | import numpy as np
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import RBF, ConstantKernel as Ccd
import matplotlib.pyplot as plt
from utilities import BiddingEnvironment, Subcampaign, MultiChoiceKnapsack, Experiment, print_clairvoyants
from functions import get_f... | null | adv-main.py | adv-main.py | py | 8,270 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.linspace",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "functions.get_functions",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utilities.Subcampaign",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "utilitie... |
603413435 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import Group
from django.db.models.signals import post_save, pre_delete
from django.dispatch import receiver
# Create your models here.
class City(models.Model):
name = models.CharField(d... | null | service/src/pollen/models.py | models.py | py | 2,615 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 13,
"usage_type": "call"
},
{
"api_name"... |
463036909 | #!/usr/bin/env python
import os
from pathlib import Path
import requests
import tomlkit
from foxcross import __version__
PYPI_URL = "https://pypi.org/pypi/foxcross/json"
def main():
pyproj_dir = os.path.abspath(os.path.join(__file__, "../.."))
with Path(f"{pyproj_dir}/pyproject.toml").open() as f:
... | null | scripts/validate_version.py | validate_version.py | py | 951 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_nu... |
56790042 | from autologin_middleware import ExposeCookiesMiddleware
from scrapy.exceptions import NotConfigured
class CookiesMiddlewareIfNoSplash(ExposeCookiesMiddleware):
@classmethod
def from_crawler(cls, crawler):
if crawler.settings.getbool('USE_SPLASH'):
raise NotConfigured
return super(... | null | undercrawler/middleware/cookies.py | cookies.py | py | 344 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "autologin_middleware.ExposeCookiesMiddleware",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "scrapy.exceptions.NotConfigured",
"line_number": 9,
"usage_type": "name"
}
] |
455346452 | ## 2_exoCnn
## includes only the independent features
import argparse
import math
import keras
import numpy as np
import pandas as pd
import tensorflow as tf
from keras import backend as K
from keras.callbacks import EarlyStopping, CSVLogger, LearningRateScheduler
from keras.layers import Conv1D, Dense, Flatten, Inp... | null | Codes/DeepLearning/2_exoCnn.py | 2_exoCnn.py | py | 9,484 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "sklearn.preproces... |
485037362 | import torch
import torch.nn as nn
class VotingLayer(nn.Module):
def __init__(self, num_iterations=10, num_nodes=16):
super(VotingLayer, self).__init__()
self.num_iterations = num_iterations
self.num_nodes = num_nodes
def forward(self, v):
batch_size = v.shape[0]
S = v... | null | model/modules/voting_layer.py | voting_layer.py | py | 2,766 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.ones",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.diag_embed",
"line_n... |
316573974 |
'''
Spam prevention. Finally.
'''
import time
import itertools
import collections
import weakref
realtimes = ['spamd']
commands = ['ignore', 'unignore']
postprocessors = ['outspamd']
## Eventually, I'll add configuration and such. For now, this is
## specifically designed to allow CrabBot to conform to Esper's ne... | null | ext/spam.py | spam.py | py | 5,156 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "weakref.WeakKeyDictionary",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "weakref.WeakKeyDictionary",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "weakref.WeakKeyDictionary",
"line_number": 23,
"usage_type": "call"
},
{
"api... |
511984329 | #!/usr/bin/env python
#coding=utf-8
"""
paraExtractLayer
~~~~~~~~~~~~~~~~~~
This module implements parallel extracting segment's 256
dimension and saved the total segments' dimension into
a matrix;
one core to handle several drivers' extracting work
one driver's segments's features saved one npy file
Written by Kai ... | null | paraExtractLayer.py | paraExtractLayer.py | py | 4,020 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "keras.layers.Input",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "keras.layers.GRU",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "keras.layers.RepeatVect... |
531147941 | try:
import triton
import triton.language as tl
HAS_TRITON = True
except ImportError:
HAS_TRITON = False
print("please install triton from https://github.com/openai/triton")
if HAS_TRITON:
'''
softmax kernel is modified based on
https://github.com/openai/triton/blob/34817ecc954a6f4ca7b... | null | colossalai/kernel/triton/softmax_kernel.py | softmax_kernel.py | py | 1,953 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "triton.language.constexpr",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "triton.language",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "triton.language.program_id",
"line_number": 23,
"usage_type": "call"
},
{
"api_nam... |
278347182 | """
Created by Benjamin Bowes, 4-19-19
This script records depth and flood values at each swmm model time step and plots them.
"""
import matplotlib.pyplot as plt
import sys
import subprocess
import datetime
import math
import pandas as pd
from pyswmm import Simulation, Nodes, Links, Subcatchments
from swmmtoolbox imp... | null | passive/hague_passive_gwl.py | hague_passive_gwl.py | py | 15,962 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pyswmm.Simulation",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "dateti... |
204440726 | import math
import os
import numpy as np
import torch
from torch import nn
from torch import distributed as dist
import pytorch_lightning as pl
from pytorch_lightning.callbacks import (
EarlyStopping,
ModelCheckpoint,
LearningRateMonitor,
)
from torchmetrics import Accuracy
from models import DeepClusterV... | null | single_cell/deepcluster/train.py | train.py | py | 15,138 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytorch_lightning.LightningModule",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "models.DeepClusterV2",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 74,
"usage_type": "call"
},
{
... |
2180984 | """Registry for models.
Makes it possible to register a model declared outside of ``vak``
with a decorator, so that the model can be used at runtime.
"""
from __future__ import annotations
import inspect
from typing import Any, Type
from .base import Model
MODEL_FAMILY_REGISTRY = {}
def model_family(family_class:... | null | src/vak/models/registry.py | registry.py | py | 4,150 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Type",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "base.Model.__subclasses__",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "base.Model",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "base.Model.__subclas... |
7332015 | #The Almighty Imports
import csv
import requests
from bs4 import BeautifulSoup
import pandas as pd
import urllib.request
############################################### URL's of Interest ##############################################
Ufc_Events_Url = urllib.request.urlopen("http://www.ufcstats.com/statistics/events/co... | null | UFC_Webscrape_v1.py | UFC_Webscrape_v1.py | py | 2,884 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 9,
"usage_type": "name"
},
{
"api_name":... |
616029706 | import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_sample_image
from tensorflow import keras
# 加载样本图片
china = load_sample_image("china.jpg") / 255
flower = load_sample_image("flower.jpg") / 255
images = np.array([china, flower])
batch_size, height, width, chann... | null | 强化学习/RL/other/deep_learning/CNN/filter.py | filter.py | py | 922 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.datasets.load_sample_image",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.load_sample_image",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"a... |
195182886 | import pygame
pygame.init()
screen = pygame.display.set_mode([640, 480])
screen.fill([255, 255, 255])
my_ball = pygame.image.load("beach_ball.png")
x = 50
y = 50
x_speed = 10
y_speed = 10
running = True
# ball moves from side to side after putting code into the endlees while loop
while running:
for event in pygame... | null | Listing 16.15.py | Listing 16.15.py | py | 1,002 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.loa... |
145843635 | import datetime
import pandas as pd
from model.helper.SensorDataHelper import SensorDataHelper
from model.util.DBMgr import DBMgr
class SensorHelper():
dbmgr = DBMgr()
SENSOR_LIST = SensorDataHelper.get_sensor_from_db()
# TODO: 若資料庫出錯是否要印出或做其他處置
@staticmethod
def get_new_record_id(promotor='system... | null | model/helper/SensorHelper.py | SensorHelper.py | py | 10,006 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "model.util.DBMgr.DBMgr",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "model.helper.SensorDataHelper.SensorDataHelper.get_sensor_from_db",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "model.helper.SensorDataHelper.SensorDataHelper",
"line... |
140791468 | import numpy as np
import unicodedata
from spacy.lang.fr import French
from spacy.lang.fr.stop_words import STOP_WORDS
from spacy.util import compile_infix_regex,compile_prefix_regex
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.preprocessing import LabelBinarizer
from sklearn.feature_extraction... | null | categorisation_mvt/train/outil.py | outil.py | py | 4,975 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.NaN",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.NaN",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "spacy.lang.fr.stop_words.STOP_WORDS",
"line_number": 26,
"usage_type": "argument"
},
{
"api_name": ... |
253282313 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 17 14:27:07 2019
@author: pierre
"""
import requests
from bs4 import BeautifulSoup
import re
import json
from fuzzywuzzy import fuzz
from unidecode import unidecode
from fractions import Fraction
import copy
from math import ceil
CONSTANTE_CS=1.5
S... | null | Source/function_marmiton.py | function_marmiton.py | py | 6,955 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.codes",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
... |
179148727 | # -*- coding: cp1252 -*-
#Hoja de Trabajo 5
#Daniel Rodriguez 15796
#Alejandro Vasquez 09284
import simpy
import random
import math
import pylab
def proceso(env, nombre, CPU, memoriaRAM, inputOutput, memoria, instrucciones):
global tiempoDelProceso
global tiempoInicio
global tiempoTotal
#Crea un ... | null | HDT5Grafica.py | HDT5Grafica.py | py | 3,373 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.randint",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "random.expovariate",
... |
350749323 | from bingads.bulk.entities import PerformanceData
from bingads.service_client import _CAMPAIGN_OBJECT_FACTORY
from bingads.internal.bulk.string_table import _StringTable
from bingads.internal.bulk.entities.single_record_bulk_entity import _SingleRecordBulkEntity
from bingads.internal.bulk.mappings import _SimpleBulkMap... | null | bingads/bulk/entities/bulk_ads.py | bulk_ads.py | py | 12,905 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bingads.service_client._CAMPAIGN_OBJECT_FACTORY.create",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bingads.service_client._CAMPAIGN_OBJECT_FACTORY",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "bingads.service_client._CAMPAIGN_OBJECT_FACT... |
204588537 | import os
import urllib.parse as up
import psycopg2, datetime
from flask import Flask, render_template, request, redirect, session, jsonify
from flask_restx import Api, Resource
from mapboxgl.utils import df_to_geojson
import json
import uuid
import logging, time
from apscheduler.schedulers.background import Background... | null | Backend.py | Backend.py | py | 14,513 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask_restx.Api",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "urllib.parse.uses_netlo... |
232497056 | import logging
import sys
from indic_transliteration import sanscript, language_code_to_script
from jyotisha import custom_transliteration
from jyotisha.util import default_if_none
from sanskrit_data.schema import common
logging.basicConfig(
level=logging.DEBUG,
format="%(levelname)s: %(asctime)s {%(filename)s:... | null | jyotisha/panchaanga/temporal/festival/__init__.py | __init__.py | py | 4,272 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sanskrit_data.schema.common.JsonObject",
"line_number": 19,
"usage_type": "attribute"
},
{
... |
176211921 | import re
import copy
from collections import deque
import time
# ToDo: make sure this is 60
time_limit = 1*60 # 1 minute of each query
class Predicate:
pass
class Variable(Predicate):
def __init__(self, val):
self.val = val
def __str__(self):
return self.val
def __repr__(self):
... | null | homework3.py | homework3.py | py | 13,467 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.split",
"line_number": 198,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 350,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 360,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_num... |
450618860 | """
Type annotations for codeguruprofiler service client paginators.
[Open documentation](https://vemel.github.io/boto3_stubs_docs/mypy_boto3_codeguruprofiler/paginators.html)
Usage::
```python
import boto3
from mypy_boto3_codeguruprofiler import CodeGuruProfilerClient
from mypy_boto3_codeguruprofil... | null | typings/mypy_boto3_codeguruprofiler/paginator.pyi | paginator.pyi | pyi | 1,969 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "botocore.paginate.Paginator",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "literals.A... |
629011343 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import logging
import datetime
from concurrent.futures import ThreadPoolExecutor
import tornado.web
import tornado.ioloop
import tornado.options
import tornado.httpserver
from tornado import gen, escape
from tornado.options import define, options
from tornado.c... | null | elastipass.py | elastipass.py | py | 8,110 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "elasticsearch_dsl.query.Term",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "elasticsearch_dsl.query.Match",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "elasticsearch_dsl.query.Fuzzy",
"line_number": 30,
"usage_type": "name"
},
... |
586872982 | """ plot waveform for checking the difference between natural speech and analysis-synthesis speech.
usage: mkfig_waveform_comp_for_document.py [-h|--help] (-n <natural>) (-w <world_anasyn>) (-m <modified_anasyn>) (-l <label>) (-o <outdir>)
options:
-h, --help Show this help message and exit.
-n ... | null | tool/mkfig_waveform_comp_for_slide.py | mkfig_waveform_comp_for_slide.py | py | 5,985 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "docopt.docopt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_n... |
257436362 | from tkinter.filedialog import *
import glob as g
import cv2 as oc
import os
from pandas import DataFrame
import xlrd
from skimage.feature import greycomatrix, greycoprops
import numpy as n
def openfile():
print('Open File Button Clicked')
global folder_path
folder_path = askdirectory()
print('Selecte... | null | DMLab3b/Detection.py | Detection.py | py | 6,320 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "glob.glob",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_numb... |
411057354 | #!/usr/bin/python
import os
import pickle
import sys
from sklearn.feature_extraction.text import TfidfVectorizer
sys.path.append("../tools/")
from parse_out_email_text import parseOutText
"""
Starter code to process the emails from Sara and Chris to extract
the features and get the documents ready for classif... | null | text_learning/vectorize_text.py | vectorize_text.py | py | 2,372 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
511013058 | from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import (
UserChangeForm,
UserCreationForm,
)
from django.utils.translation import ugettext_lazy as _
from kanisa.conf import KANISA_ADMIN_THUMBS_SIZE
from kanisa.models import... | null | kanisa/admin/account.py | account.py | py | 3,313 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "kanisa.models.RegisteredUser",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.forms.ValidationError",
"line_number": 29,
"usage_type": "... |
474310243 | from django import forms
from datasets.models import Dataset
class DatasetForm(forms.ModelForm):
"""
After a while I might try and move away from boostrap, but that may never
happen. If I do move away from bootstrap then all of these widgets will
be changed
Until after the initial deployment i a... | null | datasets/forms.py | forms.py | py | 836 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "datasets.models.Dataset",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django... |
50102885 | import webapp2
import jinja2
import os
import re
from google.appengine.api import users
PATH_ROOT = os.path.join(os.path.dirname(__file__), '..')
PATH_TEMPLATES = os.path.join(PATH_ROOT, "templates")
jinja_environment = jinja2.Environment(
loader=jinja2.FileSystemLoader(PATH_TEMPLATES))
class Display(webapp2.Re... | null | app/handlers/map.py | map.py | py | 888 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
399829547 | # -*- coding: utf-8 -*-
"""
Created on 2014-3-17
@author: cheng.li
"""
import pandas as pd
import numpy as np
import matplotlib
from matplotlib import pylab
from matplotlib.font_manager import FontProperties
import platform
from sys import version_info
if version_info >= (3, 0, 0):
import http.client as httplib
... | null | quantlib/CAL-SWIG/Python/CAL/DataAPIs/APIs.py | APIs.py | py | 6,029 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.version_info",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"... |
284020067 | from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
def dados(corrigir, chuva):
previsao = corrigir['corrigido']
previsao = previsao.drop(['hora'], axis=1)
X = chuva.drop(['Chuv'], axis=1)
y = chuva['Chuv']
X_train, X_test, y_train, y_test = trai... | null | Estacao/mysite/templates/prepro.py | prepro.py | py | 680 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 15,
"usage_type": "call"
}
] |
161282619 |
from django.shortcuts import render
#from django.core.mail import send_mail
from django.shortcuts import render_to_response
from django.views.decorators.csrf import csrf_exempt
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.shortcuts import render
import datetime
from birthdays.for... | null | mysite/birthdays/views.py | views.py | py | 1,956 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "birthdays.forms.ContactForm",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.core.mail.send_mail",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 31,
"usage_type": "call"
},
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.