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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7512054 | from django.conf.urls import patterns, url
urlpatterns = patterns('gallery.views',
url(r'^$', 'index', name='index'),
url(r'^my-gallery/$', 'my_gallery', name='my_gallery'),
url(r'^user/(\d)/$', 'person_gallery', name='person_gallery'),
url(r'^image/(\d+)/$', 'image', name='image'),
url(r'^send-gal... | null | gallery/urls.py | urls.py | py | 674 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "djan... |
525714316 | import matplotlib.pyplot as plt
import numpy as np
from ctaAnalysis.dmspectrum.dmflux import dmflux_anna
mass = 1.e+4
z = 0.018
channel = 'Tau'
emin = 30.0
emax = 0.9 * mass
#sigmav = 3.6e-26
sigmav = 1.e-28
jfactor = 9.31e+17
dmflux = dmflux_anna( sigmav , jfactor , mass , emin , emax , channel , z ... | null | examples/dmflux_example.py | dmflux_example.py | py | 930 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ctaAnalysis.dmspectrum.dmflux.dmflux_anna",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 22,
"usage_type": "name"
},
{... |
394545570 | # Copyright 2009 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 | google_appengine/main.py | main.py | py | 2,734 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "google.appengine.ext.webapp.WSGIApplication",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.webapp",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.webapp.RequestHandler",
"line_number": 31,
"... |
635655071 | import sys
import simpleaudio as sa
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLineEdit, QVBoxLayout, QFormLayout, QLabel
from PyQt5.QtMultimedia import QSound
from PyQt5 import QtGui
import os
import math
import numpy as np
import tensorflow as tf
import scipy.io.wavfile as wav
from sklearn imp... | null | non_target_fgsm_demo/fgsm_demo.py | fgsm_demo.py | py | 8,318 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.Session",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tensorflow.train.import_meta_graph",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tensorflow.train",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_n... |
571707162 | from udacidrone.frame_utils import global_to_local, local_to_global
from enum import Enum
from queue import PriorityQueue
import numpy as np
import matplotlib.pyplot as plt
import math
def create_grid(data, drone_altitude, safety_distance):
"""
Returns a grid representation of a 2D configuration space
bas... | null | fcnd.projects/FCND-Motion-Planning/pathplan.py | pathplan.py | py | 7,731 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.floor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.ceil",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 18,
... |
507563478 | # Radade organiseerija
# Nimetab rajad ümber vastavalt asukohale
import os,gpxpy,time,shutil
from urllib.request import urlopen
di='C:\\Users\\kalle\\Desktop\\Sportstracker (139 tk)'#'C:\\Users\\kalle\\Desktop\\Sportstracker (30 tk)'
l=os.listdir(di)
t_format='%Y-%m-%d'# %H:%M'
n_format='alg+\' \'+out+\' \'+aeg'
val_di... | null | Kood/Koodi muutused/17.02.20/organiseerija.py | organiseerija.py | py | 4,243 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "gpxpy.parse",
"line_n... |
323135631 | import argparse
import os
import sys
from nxrefine.nxwatcher import NXWatcher
def main():
parser = argparse.ArgumentParser(
description="Launch watcher to monitor new files")
parser.add_argument('-c', '--cwd', default='/data/user6idd/dm',
help='directory containing GUP direct... | null | src/nxrefine/scripts/nxwatcher.py | nxwatcher.py | py | 1,284 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "nxrefine.nxwatcher.NXWatcher",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.p... |
325904808 | template = """BEGIN:VCARD
VERSION:2.1
N;CHARSET=utf-8:{lastname};{firstname}
ORG;CHARSET=utf-8:{company}
TEL;CELL;VOICE:{phonenumber}
LABEL;WORK;CHARSET=utf-8:{address}
EMAIL;PREF;INTERNET:{email}
END:VCARD"""
import sys
import codecs
import xlrd,datetime
from time import strftime,gmtime
sys.stdout = codecs.getwriter... | null | raw/excel_to_vcard_tjuv.py | excel_to_vcard_tjuv.py | py | 2,147 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.stdout",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "codecs.getwriter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.stdout.detach",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook... |
215048798 | import datetime
import re
from StringWords.data_words import Gender
from StringWords import tags
class BaseHorseObject(object):
def __init__(self, html_data):
self.html_data = html_data
class Horse(BaseHorseObject):
def __init__(self, html_data):
super(Horse, self).__init__(html_data)
... | null | Horse/get_horse_data.py | get_horse_data.py | py | 4,278 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "StringWords.tags.Target",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "StringWords.tags",... |
3617836 | """
paper
Huifeng Guo et all. "DeepFM: A Factorization-Machine based Neural Network for CTR Prediction," In IJCAI,2017.
"""
import tensorflow as tf
import numpy as np
from config import *
from model.DeepFM.preprocess import build_features
from utils import tf_estimator_model, add_layer_summary, build_estimator_helper... | null | model/DeepFM/DeepFM.py | DeepFM.py | py | 2,503 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "model.DeepFM.preprocess.build_features",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.feature_column.input_layer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tensorflow.feature_column",
"line_number": 17,
"usage_type":... |
472512600 | from collections import Counter
from operator import itemgetter
from constants import (DEVELOPER_MATCH,
GENRE_MATCH,
TAG_MATCH)
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render
from django.views import View
from game.models imp... | null | game_recommendation/views.py | views.py | py | 9,039 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.View",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "forms.ChooseTagsForm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "forms.... |
101750857 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 9 14:01:25 2017
@author: drsmith
"""
import os
import pathlib
import re
import tkinter as tk
import tkinter.filedialog as fd
import numpy as np
import matplotlib.pyplot as plt
pattern = r'^.*\|\s(?P<ky>.*)\s\|\s+(?P<omi>\S*)\s+(?P<omr>\S*).*$'
r... | null | pygene/launcher/spectra.py | spectra.py | py | 3,679 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tkinter.file... |
516574438 | from flask import Flask
import ssl
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context.load_cert_chain('new/certA.crt', 'new/privkeyA.pem')
app.run(ssl_context=context) | null | Lista5/site.py | site.py | py | 295 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "ssl.SSLContext",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ssl.PROTOCOL_TLSv1_2",
"line_number": 10,
"usage_type": "attribute"
}
] |
320021019 | import ptvalidator.scripts.sentence_analyzer as sa
from ptvalidator.scripts.data_manager import DataManager
from ptvalidator.scripts.datarecievier import DataReceiver
def validate(query, key, verbose_log=True):
import logging
if verbose_log:
logging.basicConfig(level=logging.INFO,
... | null | ptvalidator/checkit.py | checkit.py | py | 714 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.FATAL... |
251474125 | import numpy as np
from datetime import datetime
import torch
import torch.nn as nn
from model import CNN
from preprocessing import make_env
from utils import get_test_acc, make_matrix
# Hyper params -- for pref
batch_size = 128
n_epochs = 30
# Training loop
def train(model, criterion, optimizer, train_loader, test_... | null | CIFAR-10/main.py | main.py | py | 2,041 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
630858101 | import uuid
import src.models.folders.constants as FolderConstants
from src.common.database import Database
import src.models.folders.errors as FolderErrors
__author__ = 'team_project_2015'
class Folder(object):
def __init__(self, title, description, user_id, _id=None):
self.title = title
self.de... | null | src/models/folders/folder.py | folder.py | py | 1,338 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "uuid.uuid4",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "src.common.database.Database.insert",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "src.common.database.Database",
"line_number": 25,
"usage_type": "name"
},
{
"api_n... |
33954355 | from bayes_opt import BayesianOptimization
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import make_classification
from sklearn.model_selection import cross_val_score
def get_data():
"""Synthetic binary classification dataset."""
data, targets = make_classification(
n_samp... | null | basic_bayesopt.py | basic_bayesopt.py | py | 1,080 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.datasets.make_classification",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.cross_val_score",
"line_number": 24,
... |
367924645 | from scipy import linalg
import numpy as np
def three_sigma_over_grid(mu, P):
"""Create 3 sigma ellipse over a grid based on a mean and covariance.
in: mu (np.array), P (np.array)
out: three_sigma (np.array)
"""
n = 100; # Number of grid points
phi = np.linspace(0,2*... | null | 190616_kalman_intuition/lib/three_sigma_over_grid.py | three_sigma_over_grid.py | py | 519 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.linspace",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.tile",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scipy.linalg.sqrtm",
"lin... |
24134602 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import plotly.graph_objs as go
from plotly.offline import init_notebook_mode,iplot
init_notebook_mode(connected=True)
import chart_studio.plotly as py
# In[2]:
import pandas as pd
# In[3]:
df = pd.read_csv('2014_World_Power_Consumption')
# In[5]:
df.head()... | null | Geo Plotting.py | Geo Plotting.py | py | 1,502 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "plotly.offline.init_notebook_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs.Figure",
"line_number": 53,
"usage_type": "call"
},
{
"api_nam... |
209070575 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import io
from mynlu.trainers import Message
ent_regex = re.compile('\[(?P<value>[^\]]+)]\((?P<entity>[^:)]+)\)') # [restaurant](what)
ent_regex_with_value = ... | null | mynlu/utils/md_to_json.py | md_to_json.py | py | 3,924 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 13,
... |
183976823 | from flask import Blueprint, render_template, redirect, url_for, flash
from app.forms import UpdateForm
from app.extensions import db
from app.models import TestCase, JobHistory
from datetime import datetime
from flask import request, abort, jsonify
from git import Repo
from os import walk
from os.path import join
impo... | null | app/blueprints/history.py | history.py | py | 5,634 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "app.models.JobHistory.query.order_by",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.models.JobHistory.query",
"line_number": 21,
"usage_type": "attribute"
},
{
... |
171357793 | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
import datetime
from app import db
Base = declarative_base()
class Session(db.Model):
__tablename__ = "sessions"
id = db.Column(db.Integer, primary_key=True)
user = relationship("Member", uselist=False, bac... | null | models.py | models.py | py | 2,957 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "app.db.Model",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "app.db",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "a... |
111566482 | import logging
import time
import numpy as np
from utils.control import RobotControl
import utils.simulator_library as lib
def velocity_test(pb, objects, object_states, robots, robot_fsms):
controller = RobotControl(pb)
pb.resetDebugVisualizerCamera(2, 0, -89, [0, 0, 0])
robot = lib.load_robots(pb, [[0,... | null | sequences/velocity_test.py | velocity_test.py | py | 975 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.control.RobotControl",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "utils.simulator_library.load_robots",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.simulator_library",
"line_number": 13,
"usage_type": "name"
},
{... |
594500313 | import re
from datetime import datetime, date
from uuid import UUID
from enum import Enum, IntEnum
from typing import Optional, Union, Literal, List, TypeVar, Dict
from pydantic import BaseModel, Field, Extra, constr, conlist, \
conint, PositiveInt, PositiveFloat, EmailStr
class BaseRegexType(str):
pattern = ... | null | models/general.py | general.py | py | 5,574 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.fullmatch",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 62,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 70,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line... |
319144366 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.selector import Selector
from myspiders.items import MyspidersItem
class MaoyanSpider(scrapy.Spider):
name = 'maoyan'
allowed_domains = ['maoyan.com']
start_urls = ['http://maoyan.com/']
# 自定义入口
def start_requests(self):
# for i in range(0... | null | week01/maoyan/myspiders/myspiders/spiders/maoyan.py | maoyan.py | py | 1,759 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scrapy.selector.Selector",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "myspiders.i... |
329786512 | import time
import ccxt
from settings import KEY_SECRET, BTC_VALUE, ETH_VALUE, USDT_VALUE
from utils import logger
class BinanceClient(object):
def __init__(self):
self.name = 'binance'
self.client = ccxt.binance()
self.client.apiKey = KEY_SECRET['binance'][0]
self.client.secret... | null | trade_rate_info/client/binance.py | binance.py | py | 9,096 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ccxt.binance",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "settings.KEY_SECRET",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "settings.KEY_SECRET",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "utils.logger.err... |
612830003 | from build import build_all
def parse_cmd(cmd):
words = cmd.split()
if words[0] == 'build':
if len(words) == 2:
if words[1] == 'all':
build_all()
else:
print('ignored ...')
if __name__ == '__main__':
isOn = 1
while isOn:
cmd = inp... | null | docs/main.py | main.py | py | 464 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "build.build_all",
"line_number": 8,
"usage_type": "call"
}
] |
599794003 | #!/usr/bin/python
# -*- coding:utf-8 -*-
from time import sleep
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from my_python.my_selenium.project_one.util import util
import pytest
class TestAdminLogin(object... | null | my_python/my_selenium/project_one/testcases/c_ddt/test_admin_login.py | test_admin_login.py | py | 2,516 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "my_python.my_selenium.project_one.util.util.get_code",
"line_number": 38,
"usage_type": "cal... |
248078343 | import random
from loader.data_loader import load_data_wrapper
from neuron.network_large import Network
def get_value(output):
max_index = 0
for i in range(len(output)):
if output[i] < output[max_index]:
max_index = i
if output[i] > 1.0:
print("bad mapping: ", output[i... | null | recognition/test_recog.py | test_recog.py | py | 1,008 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "loader.data_loader.load_data_wrapper",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "neuron.network_large.Network",
"line_number": 38,
"usage_type": "call"
}
] |
187151488 | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... | null | tests/workflow_tests/test_rest_service_pagination.py | test_rest_service_pagination.py | py | 3,761 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "testenv.TestCase",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "testenv.utils.get_resource",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "testenv.utils.deploy",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "test... |
284573921 | import os, sys, MySQLdb, shutil, glob, re
from django.conf import settings
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.http import Http404, HttpResponse, FileResponse
from django.shortcuts import get_object_or_404, redirect, render
from django... | null | opin_pr_bak/audio/views.py | views.py | py | 1,671 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "forms.UploadFileForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.db.connection.cursor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.db.connection",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": ... |
495925409 | from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from torch.autograd import Variable
from torchvision import models
class Encoder(nn.Module):
def __init__(self, D_in, H, D_out):
super(Encoder, self).__init__()
# s... | null | Models.py | Models.py | py | 2,136 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
402862920 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '5'
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
import numpy as np
import pickle as pkl
import argparse
import sys
import warnings
from tqdm import trange
from mdn import MDN
from utils import rmse, rmsle, add_identity, line_messages
from sklea... | null | product_estimation.py | product_estimation.py | py | 18,691 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.logging.set_verbosity",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tensorflow.logging",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": ... |
43866923 | from django.core.management.base import BaseCommand, CommandError
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
import logging, os, csv
from random import uniform
from time import sleep
from datetime import datetime
from rest_api.settings import BASE_DIR
import argparse
csv_home... | null | rest_api/api_app/management/commands/scrape_daily_box_score_csvs.py | scrape_daily_box_score_csvs.py | py | 9,850 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rest_api.settings.BASE_DIR",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join... |
393966072 | # uncompyle6 version 3.6.7
# Python bytecode 3.5 (3351)
# Decompiled from: Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: /Users/runner/runners/2.166.2/work/1/s/build/lib.macosx-10.9-x86_64-3.5/pycraf/antenna/ras.py
# Compiled at: 2020-04-16 04:29:51
# Size o... | null | pycfiles/PyCraft-1503040.tar/ras.cpython-35.py | ras.cpython-35.py | py | 2,847 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "astropy.units.percent",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "astropy.units",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "numpy.abs",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.log10",
... |
520124617 | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import argparse
from mica.stats import update_guide_stats
import mica.stats.guide_stats
# Cheat and pass options directly. Needs entrypoint scripts
opt = argparse.Namespace(datafile=mica.stats.guide_stats.TABLE_FILE,
... | null | scripts/update_guide_stats.py | update_guide_stats.py | py | 813 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.Namespace",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mica.stats.stats",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "mica.stats",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "mica.stats.update... |
348496158 | import argparse
import numpy as np
import pandas as pd
import os
import cv2
from tqdm import tqdm
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
import torchvision.models
from torchvision import transforms
from torch.utils.data import Dataset, DataLoader
import torch
from apex import amp
... | null | trainval/seresnext101/train0.py | train0.py | py | 7,250 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.clip",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Dataset",
"line_n... |
527740193 | # user_database.py
# Judgemental Mom
# CS411 A2 Group 8 Project
# Created by corey on 11/5/16
# Last updated by nlouie on 12/01/16
# Description: Creates a database
# ------------------ Imports --------------------- #
import dataset
import sqlalchemy
# ------------------ Params ---------------------- #
DB_URL = 'sq... | null | user_database.py | user_database.py | py | 3,566 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dataset.connect",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "dataset.connect",
"line_number": 123,
"usage_type": "call"
}
] |
382534035 | from custom_utils.utils import *
from transformers import *
import pandas as pd
import numpy as np
from tqdm import tqdm
from keras.preprocessing.sequence import *
from torch.utils.data import *
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.metr... | null | fine_tune_cola.py | fine_tune_cola.py | py | 21,702 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
... |
283268387 | import numpy as np
from peach.fuzzy import *
# First, create the domain in wich we will represent the functions.
x = np.linspace(0.0, 1.0, 500)
# Create a trapezoid, starting in x = 0, ending in x = 0.8, with maximum
# from x = 0 to x = 0.8
low_value = DecreasingRamp(0.8, 0.9)
# Create another trapezoid, starting i... | null | fuzzy_test.py | fuzzy_test.py | py | 1,991 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.linspace",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
93217476 | import datetime
class AskDateDialogManager():
slot = {
'TIME' : "วันไหนคะ วันนี้ พรุ่งนี้ เมื่อวาน"
}
def transformWordOfDay(self, day):
day_number = {
'วันนี้': datetime.datetime.today().weekday(),
'พรุ่งนี้' : datetime.datetime.today().weekday()+1,
'เ... | null | ask_date_dialog_manager.py | ask_date_dialog_manager.py | py | 1,189 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.today",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.today",
"line_number": 12,
"usage_type": "call"
},
{
"api_name":... |
46775096 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import io
import os
import sys
import markdown
reload(sys)
sys.setdefaultencoding('utf8')
CONTENT_ROOT = "./sites"
OUTPUT_ROOT = "./out"
TEMPLATE_FILE = "./template.html"
#
# Methode zur Umwandlung eines einzelnen Markdown-Files in eine Seite
#
def convert(root, out, fi... | null | main.py | main.py | py | 1,127 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"... |
583860955 | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""Runs RSA operations based on bignum binary.
Runs RSA operations based on the primitives contained in the binary blob of
the generic bignum library. Hence these are wrap... | null | sim_rsa_tests.py | sim_rsa_tests.py | py | 23,944 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bignum_lib.sim_helpers.ins_objects_from_hex_file",
"line_number": 176,
"usage_type": "call"
},
{
"api_name": "bignum_lib.machine.Machine",
"line_number": 201,
"usage_type": "call"
},
{
"api_name": "bignum_lib.machine.Machine",
"line_number": 226,
"usage_typ... |
383003960 | # Helper functions for Normals Editor
import bpy
import bmesh
import bgl
import math
from mathutils import Vector
import sys
from . import normals_data
# Math:
def in_distance(p1, p2, checkdist):
tempdist = math.sqrt((p1[0] - p2[0]) ** 2) + (((p1[1] - p2[1]) ** 2) + (p1[2] - p2[2]) ** 2)
return (tempdist < ... | null | scripts/addons_extern/udk_fbx_tools/editorfunctions.py | editorfunctions.py | py | 22,488 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.sqrt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bmesh.new",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "bmesh.from_edit_mesh",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bpy.ops.object.mode_set",
... |
212260676 | __author__ = 'ykhutarniuk'
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException, WebDriverException, TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdr... | null | worker.py | worker.py | py | 5,686 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.common.prox... |
567632021 | import click
from datetime import datetime
from project.clockin import ClockIn
@click.command()
@click.option("--year", prompt="Year", type=int, default=datetime.now().year)
@click.option("--month", prompt="Month", type=int, default=datetime.now().month)
@click.option("--day", prompt="Day (leave empty for entire mon... | null | project/commands.py | commands.py | py | 544 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "project.clockin.ClockIn",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "click.option",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.no... |
434737148 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | null | gpudb/packages/avro/avro_py2/protocol.py | protocol.py | py | 7,957 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "avro.schema.AvroException",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "avro.schema",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "avro.schema.make_avsc_object",
"line_number": 52,
"usage_type": "call"
},
{
"api_name"... |
118818622 | from typing import Any, Dict, List, Tuple, Union
from lambda_handlers.errors import LambdaError
from lambda_handlers.validators.validator import Validator
try:
import marshmallow
except ImportError:
marshmallow = None
NO_FIELD_NAME = '__no_field_name__'
class MarshmallowValidator(Validator):
def valid... | null | lambda_handlers/validators/marshmallow_validator.py | marshmallow_validator.py | py | 1,125 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lambda_handlers.validators.validator.Validator",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "lambda_handlers.errors.LambdaError",
"line_number": 23,
"usage_type": "call"
... |
212525228 | #libs
from django.contrib import admin
#local
from models import Album, Artist, Category, Image, Song
class ArtistAdmin(admin.ModelAdmin):
list_display = ('full_name', 'is_private', 'likes', 'born', 'known_as')
prepopulated_fields = {"slug": ("first_name", "last_name")}
search_fields = ['first_name', 'la... | null | albums/admin.py | admin.py | py | 3,712 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 19,
"usage_type": "attribute"
... |
429475147 | from django.db import models
from django.contrib.auth.models import User
from django import forms
from django.core.validators import MaxValueValidator, MinValueValidator
import rtiapp.constantes as Globales
# tipo de prueba
IPAL = 'IPAL'
IPAM = 'IPAM'
IPAE = 'IPAE'
# islas
NINGUNA = 'NINGUNA'
TENERIFE = 'TENERIFE'
PAL... | null | rtiapp/models.py | models.py | py | 23,903 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 167,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 167,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 170,
"usage_type": "call"
},
{
"api_n... |
518793659 | import os
import sys
import random
from collections import deque
################# tree.py #########################
class Node:
def __init__(self, index):
self._index = index
self._left_node = None
self._right_node = None
self._depth = 1
self._weight = None
self._p... | null | path_rotation/generators/squashed_generator.py | squashed_generator.py | py | 8,830 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "random.choice",
... |
274012685 | # 1. AWS KEY SETUP
# 2. /anaconda3/envs/sentinel/lib/python<>/site-packages/sentinelhub/config.json
# "instance_id": "f600d465-c324-4f84-9da0-8889353edfbe"
# 3. https://portal.creodias.eu/register.php Create an account
# 4. Setup the LINE 41 and LINE 42 creodias_user creodias_password or either set appropriate valu... | null | GunjanFiles/main_modify.py | main_modify.py | py | 1,683 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.parse_config_params",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.create_config",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "download_s2.DownloadSentinelS2",
"line_number": 18,
"usage_type": "call"
},
{
"api_... |
470953502 | import unittest
import os
from mock import Mock
from click.testing import CliRunner
from shub import login
class LoginTest(unittest.TestCase):
VALID_KEY = 32 * '1'
def setUp(self):
login.auth.NETRC_FILE = ''
self.runner = CliRunner()
def test_login_validates_api_key(self):
resul... | null | tests/test_login.py | test_login.py | py | 2,608 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "shub.login.auth",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "shub.login",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "click.testing.C... |
380906806 | import numpy as np
import matplotlib as mpl
from matplotlib import pyplot as plt
from matplotlib.animation import FuncAnimation
import yaml
######## read in .yaml parameters #######
with open("params.yaml",'r') as yf:
yaml_dict = yaml.safe_load(yf)
radius = float(yaml_dict["particleRadius"])
n_particles = ... | null | animation.py | animation.py | py | 1,523 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "yaml.safe_load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "matplotli... |
514126167 | #
# @lc app=leetcode id=764 lang=python3
#
# [764] Largest Plus Sign
#
# @lc code=start
# dp 1988 ms 81.25%
from typing import List
class Solution:
def orderOfLargestPlusSign(self, N: int, mines: List[List[int]]) -> int:
banned = {tuple(mine) for mine in mines}
dp = [[0] * N for _ in range(N)]
... | null | 764.largest-plus-sign.py | 764.largest-plus-sign.py | py | 1,282 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
}
] |
333514636 | #!/usr/bin/env python
# pylint: disable=R0904,W0142,C0103
"""Unit Tests for the core data structures"""
import datetime
import decimal
import unittest
try:
# Help bootstrap (If PYTHONPATH isn't set); pylint: disable=W0611
from bootstrap import lemonade
except ImportError:
pass
from lemonade import models... | null | tests/line_entry_tests.py | line_entry_tests.py | py | 4,202 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "lemonade.models.JournalEntry",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "lemonade.models",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "l... |
440486892 | # -*- coding: utf-8 -*-
from datetime import datetime
from FundNavSpiders import GGFundNavSpider
from FundNavSpiders import GGFundNavItem
class JiShengInvestSpider(GGFundNavSpider):
name = 'FundNav_JiShengInvest'
sitename = '季胜投资'
channel = '投顾净值'
allowed_domains = ['www.jishengtouzi.com']
start_... | null | FundNavSpiders/JiShengInvest.py | JiShengInvest.py | py | 1,792 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "FundNavSpiders.GGFundNavSpider",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 40,
"usage_type": "name"
},
{
"api_na... |
550231970 | #!/usr/bin/env python3
"""
Author : Eriberto Mendz <erimendz@gmail.com>
Date : 2023-06-06
Purpose: Chapter 3: Working with Lists
"""
import argparse
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description="... | null | 03_picnic/picnic.py | picnic.py | py | 1,828 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 17,
"usage_type": "attribute"
}
] |
626949629 | from typing import Any, Dict
import pytest
from openslides.agenda import projector
@pytest.fixture
def all_data():
all_data = {
"agenda/item": {
1: {
"id": 1,
"item_number": "",
"title_information": {"title": "item1"},
"comment"... | null | tests/unit/agenda/test_projector.py | test_projector.py | py | 3,983 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.fixture",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 89,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 89,
"usage_type": "name"
},
{
"api_name": "openslides.agenda.projector... |
355574056 | import pytest
from common.date_and_time_handling import format_start_date_historical, format_end_date_historical
from common.settings import DATE_FORMAT
pytestmark = pytest.mark.unit
@pytest.mark.parametrize('start_date, expected', [
('2020', '2020-01-01'),
('2020-01', '2020-01-01'),
('2020-09', '2020-0... | null | tests/unit_tests/test_date_format_historical.py | test_date_format_historical.py | py | 1,880 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "common.date_and_time_handling.format_start_date_historical",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 9,
"usage_type": "cal... |
435731367 | import io
import os
from setuptools import find_packages, setup
NAME = 'music modifier'
DESCRIPTION = 'Simple script for modifying and viewing music files.'
URL = 'https://github.com/louislefevre/music-modifier'
EMAIL = 'louislefev@gmail.com'
AUTHOR = 'Louis Lefevre'
REQUIRES_PYTHON = '>=3.6.0'
VERSION = '0.1.0'
REQUI... | null | setup.py | setup.py | py | 1,384 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_numb... |
120561370 |
import numpy as np
import matplotlib.pyplot as plt
# th0,th1 = 4,3
X = 2 * np.random.rand(100,1)
y = 14 +3 * X+np.random.randn(100,1)
plt.plot(X,y,'bo')
plt.xlabel("$x$", fontsize=18)
plt.ylabel("$y$", rotation=0, fontsize=18)
_ =plt.axis([0,2,10,35])
X_b = np.c_[np.ones((100,1)),X] # concationation, X dizisin... | null | 1_linear regression/4_linreg_cross_deviation_1var.py | 4_linreg_cross_deviation_1var.py | py | 506 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.rand",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randn",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
610807277 | import logging
import re
from aiogram.types import Message, CallbackQuery
from keyboards.inline.choice_buttons import choice
from loader import dp
from array import *
@dp.message_handler()
async def echo_bot(message: Message):
alphabet = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r',... | null | users/echo.py | echo.py | py | 2,172 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "aiogram.types.Message",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "keyboards.inline.choice_buttons.choice",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "loader.dp.message_handler",
"line_number": 12,
"usage_type": "call"
},
{... |
545000052 | import torch
import torch.nn as nn
import torch.nn.functional as F
class BaseDRGCN(nn.Module):
def __init__(self, num_nodes, h_dim, out_dim, num_rels, num_bases,
num_rgcn_hidden_layers=1, #num_dkrl_hidden_layers=1,
dropout=0, use_self_loop=False, use_cuda=False,
d... | null | 5_drgcn_weight_cnn/drgcn_model.py | drgcn_model.py | py | 5,240 | 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.nn.ModuleList",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
75139137 | import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from torch import optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from tqdm import tqdm
device = 'cuda' if torch.cuda.is_available() else 'cpu'
def select_model(data_loader, batch_size, images,
... | null | src/Recursive_Symmetry_Aware_Materials_Microstructure_Explorer/select_model.py | select_model.py | py | 5,826 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.hub.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.hub",
... |
505592698 | # Copyright (c) 2013 Potential Ventures Ltd
# Copyright (c) 2013 SolarFlare Communications Inc
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the... | null | cocotb/__init__.py | __init__.py | py | 11,396 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.fdopen",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "cocotb.handle.log.default_config",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "cocotb.handle.log",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "coc... |
547407879 | #!/usr/bin/env python3
'''Khronos lock-surface extension for EGL.
Surface locking is defined in a pair of extension specifications. This
wrapper has been designed for version 2 of the second extension, which
claims backwards compatibility with the first extension.
http://www.khronos.org/registry/egl/extensions/KHR/E... | null | pegl/ext/khr_locksurface.py | khr_locksurface.py | py | 8,279 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "native.c_ibool",
"line_number": 45,
"usage_type": "argument"
},
{
"api_name": "native.c_display",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "native.c_surface",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "native.c_attr_li... |
300686393 | from numpy import loadtxt
from keras.models import load_model
import tkinter as tk
from tkinter import filedialog
# open saved model with filedialog and use it #
def main():
# open file dialog for .csv data file:
root = tk.Tk()
root.withdraw()
file_path = filedialog.askopenfile(title = "Select .csv da... | null | Load_Model_Diabetes.py | Load_Model_Diabetes.py | py | 878 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tkinter.Tk",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog.askopenfile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tkinter.filedialog",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.lo... |
374061621 | #FLASK
from flask import Flask, jsonify, render_template, request
from db import DB
app = Flask(__name__)
import os,optparse
db = DB("redis_docker")
db.connect()
db.getMovies()
db.setKeys()
print(int(db.redis_db.get('475557')))
popular = db.popular
now = db.now
top = db.top
movie_discovered = db.movie_discovered
''... | null | app/app.py | app.py | py | 2,656 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "db.DB",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "db.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "db.getMovies",
"line_number": 9,
"u... |
644513160 | from typing import Callable, Tuple
# from gpxpy.gpx import GPXTrack, GPXTrackPoint
from gpx_lite.gpxtrack import GPXTrack
from gpx_lite.gpxtrackpoint import GPXTrackPoint
from shapely.geometry import LineString, Point
def track_to_linestring(track: GPXTrack, coordinate_convertor: Callable[[float, float], Tuple[float,... | null | roadmaptools/gpx_shp.py | gpx_shp.py | py | 1,078 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gpx_lite.gpxtrack.GPXTrack",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "shapely.geometry... |
619343112 | import csv
from collections import Counter
with open('HW.csv', newline='') as f:
reader = csv.reader(f)
file_data = list(reader)
file_data.pop(0)
new_data = []
for i in range(len(file_data)):
n_num = file_data[i][1]
new_data.append(float(n_num))
n = len(new_data)
total = 0
for i in new_data:
t... | null | statistic.py | statistic.py | py | 1,327 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.reader",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 45,
"usage_type": "call"
}
] |
639629980 | from selenium import webdriver
import time
driver = webdriver.Chrome()
with open('sites.txt') as sites:
sites_list = [line.strip() for line in sites]
sites_list.sort(key=lambda s: len(s))
print('### OPENING SITES ###')
for index, line in enumerate(sites_list):
print(f'{index} : {line}')
... | null | lab4.py | lab4.py | py | 788 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 23,
"usage_type": "call"
}
] |
638084129 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-x86_64/egg/ScoutSuite/providers/azure/facade/securitycenter.py
# Compiled at: 2020-04-02 05:37:10
# Size of source mod 2**32: 4740 bytes
from az... | null | pycfiles/ScoutSuite-5.8.1-py3.7/securitycenter.cpython-37.py | securitycenter.cpython-37.py | py | 5,854 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "azure.mgmt.security.SecurityCenter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ScoutSuite.providers.utils.run_concurrently",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "ScoutSuite.core.console.print_exception",
"line_number": 29,
... |
317136620 | # add necessary import statements
import numpy as np
import pandas as pd
import sqlite3
# ADD input validation to make sure an integer between 1 and 20 is provided
howmany=int(input("How many earthquake locations to show? "))
while 1:
if howmany >= 1 and howmany <= 20: #assuming this is the right answer
... | null | stats.py | stats.py | py | 3,257 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "numpy.median",
"line_number"... |
74494786 | from django.db import models
from django.core.files import File
# Create your models here.
class trackInfo(models.Model):
filePath = models.CharField(max_length=255)
title = models.CharField(max_length=127)
danceability = models.FloatField()
energy = models.FloatField()
loudness = models.FloatFiel... | null | mashmaker/models.py | models.py | py | 3,111 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "... |
11610270 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 19 14:20:58 2018
@author: Harsh Kava
"""
from bs4 import BeautifulSoup
import re
import os
import csv
review_data=open('review.txt','w')
def fetchReview(soup):
reviewChunk=soup.find('div',{'class':(re.compile("_5pbx userContent"))})
print(revie... | null | extract_reviews.py | extract_reviews.py | py | 649 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 26,
"usage_type": "call"
}
] |
191372739 | import xlrd
import json
from lxml import etree
def read_exl(file_name):
exl = xlrd.open_workbook(file_name)
exl_sheet = exl.sheet_by_name('student')
data = {}
for i in range(exl_sheet.nrows):
data[exl_sheet.row_values(i)[0]] = exl_sheet.row_values(i)[1:]
return json.dumps(data, ensure_asc... | null | hw-0017-19.py | hw-0017-19.py | py | 791 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lxml.etree.Element",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"lin... |
526763828 | import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import os
from constants.constants import *
# from mpl_toolkits.mplot3d import axes3d # this says it is unused but it is actually being used by the 3d plot section
# TABLE OF CONTENTS (in order of being called)
# #parameters#
# main
# get_command
# e... | null | Main_old.py | Main_old.py | py | 67,151 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.colors.BASE_COLORS",
"line_number": 256,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.colors",
"line_number": 256,
"usage_type": "name"
},
{
"api_name": "matplotlib.colors.CSS4_COLORS",
"line_number": 256,
"usage_type": "attribute"
},... |
493461801 | from pyramid.config import Configurator
from pyramid.session import SignedCookieSessionFactory
from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from .security import groupfinder
import os
from sqlalchemy import engine_from_config
from .models impor... | null | learning_journal/__init__.py | __init__.py | py | 2,239 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
65463317 | from scipy.fft import fft, fftfreq
import matplotlib.pyplot as plt
import numpy as np
from scipy.fftpack import fft
from modbusManage import mdbs
def rangePeak(arr, freqIncreaseNumber, startFreq, FinishFreq):
startingN = int(float(startFreq) / freqIncreaseNumber)
print(" İstenen freqansın başlang... | null | rotAnalysis.py | rotAnalysis.py | py | 2,474 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.argmax",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "scipy.fftpack.fft",
... |
419662242 | #!/usr/bin/env python3
from CANAPI import *
from time import sleep
import argparse
import sys
# CAN API V3 driver library
if platform.system() == 'Darwin':
# macOS dynamic library
lib = 'libUVCANPCB.dylib'
elif platform.system() != 'Windows':
# shared object library
lib = 'libuvcansoc.so.1'
else:
... | null | Examples/Python/can_send.py | can_send.py | py | 4,305 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "CANAPI.version",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_... |
497847355 | from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext, loader
from django.views.generic import View
from .forms import RecipeForm
from django.http import HttpResponseRedirect
class CalculateCalories(View):
units = [
'tsp',
'teaspoon',
'heape... | null | CalculateRecipe/views.py | views.py | py | 2,855 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.generic.View",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.views.generic.View",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "forms.RecipeForm",
"line_number": 69,
"usage_type": "name"
},
{
"api_name": "d... |
576461672 | # Copyright (c) Facebook, Inc. and its affiliates.
import io
import unittest
import warnings
import torch
from torch.hub import _check_module_exists
from detectron2 import model_zoo
from detectron2.config import get_cfg
from detectron2.export import STABLE_ONNX_OPSET_VERSION
from detectron2.export.flatten import Trac... | null | tests/test_export_onnx.py | test_export_onnx.py | py | 6,247 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "warnings.catch_warnings",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "detectron2.utils.testing.skipIfOnCPUCI",
"line_number": 40,
"usage_type": "name"
},
{
... |
316818421 | from common.misc import banner, out, errorBanner
from exception.not_a_text_file_ex import NotATextFileException
from model.node_type import NodeType
def handleWrite(root, cmdParts):
try:
if len(cmdParts) != 3:
banner("WRITE takes 3 parameters, including the command, not '{}'.".format(cmdParts.... | null | InterviewCodingQuestions/oofilesystem/python/service/cmd_write.py | cmd_write.py | py | 1,019 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "common.misc.banner",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "common.misc.banner",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "common.misc.banner",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "model.node_ty... |
643690032 | from django.conf.urls.defaults import *
from django.conf.urls import patterns, url
urlpatterns = patterns('app.userprofile.views',
url(r'^$', 'main', name='main_page'),
url(r'^create_event/$', 'personal_event', name='create_events'),
url(r'^my-grades/$', 'my_grades', name='my_grades'),
url(r'^add_inte... | null | app/userprofile/urls.py | urls.py | py | 1,208 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 5,
"usage_type": "call"
},
{
"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": "djan... |
143674635 | from datetime import datetime
import numpy as np
from numpy import random
from scipy import misc
from skimage import color
from skimage import filter
from skimage import io
from sklearn.externals import joblib
from sklearn import cross_validation
from sklearn import grid_search
from sklearn.ensemble import RandomFores... | null | py/classifier_dirty.py | classifier_dirty.py | py | 4,375 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.median",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 2... |
160450065 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
"""Module to creates and manage workers"""
from PyQt5 import QtWidgets
from PyQt5 import QtGui
from PyQt5 import QtCore
import time
import sys
import traceback
import logging
import logging.config
class BasicWorker(QtCore.QObject):
"""
Creates a worker object. P... | null | classWorker.py | classWorker.py | py | 1,736 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtCore.QObject",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sys.exc_info... |
280422341 | import matplotlib.pyplot as plt
import numpy as np
def create_gist(counts):
#max_x= (count%10)+1
x=[]
#Самый бессмысленный цикл в мире
for i in range(len(counts)):
x.append(i)
# i=1
# for i in range(max_x):
# x.append(i*10)
er=range(len(counts))
ax=plt.gca()
ax.bar... | null | gist.py | gist.py | py | 613 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.gca",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplo... |
260599147 | from augmentator import FRCNNAugmentation
from loss import MultiBoxLoss
from data import VOCDetection, detection_collate
from net import build_model
from params import voc_config, FRCNN_train, VOC_ROOT
import torch.nn.functional as F
from box_utils import match, log_sum_exp
import time
import torch
import torch.optim ... | null | test.py | test.py | py | 4,775 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "params.FRCNN_train",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "data.VOCDetection",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "params.VOC_ROOT",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "augmentator.FRCN... |
182451988 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import random
import sys
import torch
from aiohttp import web
from torch.utils.data import DataLoader, SequentialSampler
from tr... | null | legacy/modelservers/qa/run_round1.py | run_round1.py | py | 6,251 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "transformers.AutoConfig.from_pretrained",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": ... |
380972402 | import os
import pickle
import argparse
import tensorflow as tf
import gym
import seaborn as sns
import matplotlib.pyplot as plt
from policy_model import policy_model
from load_policy import load_policy
from imitation_algorithms import behavior_cloning, dagger
"""
Code for HW1 of Fall 2018 CS229-112 Deep Reinforcemen... | null | hw1/run_imitation.py | run_imitation.py | py | 4,515 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.ConfigProto",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path"... |
158947693 | ##########################################################################
# NSAp - Copyright (C) CEA, 2016
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for details.
##########... | null | zeijemol/views/triplanar.py | triplanar.py | py | 6,667 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cubicweb.view.View",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 79,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_nu... |
516771788 | import copy
import json
import os
import contextlib2
from requests_toolbelt import MultipartEncoder
from six import string_types
import trafaret as t
from datarobot.enums import DEFAULT_MAX_WAIT, NETWORK_EGRESS_POLICY
from datarobot.models.api_object import APIObject
from datarobot.models.job import filter_feature_im... | null | datarobot/models/custom_model_version.py | custom_model_version.py | py | 30,558 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datarobot.models.api_object.APIObject",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "trafaret.Dict",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "trafaret.Key",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "traf... |
81906018 | import abc
import urllib
import urlparse
import warnings
from .helpers import is_valid_encoded_query_key
from .helpers import is_valid_encoded_query_value
from .helpers import fix_encoding
from .multidict import OneDimensionalOrderedMultidict
from .stringlike import StringLikeObject
class Query(StringLikeObject):
... | null | furl/query.py | query.py | py | 8,959 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "stringlike.StringLikeObject",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "multidict.OneDimensionalOrderedMultidict",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "helpers.fix_encoding",
"line_number": 139,
"usage_type": "call"
},... |
191053367 | from sklearn import linear_model
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.datasets import load_iris
# 加载数据
iris = load_iris()
# 使用前两列作为原始数据
X = iris.data[:, :2]
y = iris.target
# 将原始数据分为训练和测试数据
X_train, X_test, y_train, y_test = train_test_split(X,y... | null | MachineLearning/ML_Notebook/classification_example.py | classification_example.py | py | 723 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LogisticRegression",
"line_number": 20,
"usage_ty... |
36528913 | import numpy as np
import tensorflow as tf
from sklearn.metrics import precision_recall_curve, roc_curve
from sklearn.metrics import average_precision_score, auc
from load_data import load_data
from model import build_model, compileModel, build_model_CNN
from numpy import interp
from itertools import cycle
import matpl... | null | auto_plot_curve.py | auto_plot_curve.py | py | 3,735 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "load_data.load_data",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "model.build_model",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "model.build_mode... |
561583914 | from django.shortcuts import render, HttpResponseRedirect, HttpResponse
from django.http import JsonResponse
from .models import *
from core.decorators import *
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from collections import deque
# Create your views here.
def goods(g):
# 传进来一个g... | null | backend_api/df_goods/views.py | views.py | py | 7,191 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.HttpResponse",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 93,
"usage_type": "call"
},
{
"ap... |
8242889 | import os
import logging
import click
import cv2
from pathlib import Path
field_bounds = {
'top': 105,
'left': 185,
'bottom': 585,
'right': 445
}
width = int((field_bounds['right'] - field_bounds['left']) / 6)
height = int((field_bounds['bottom'] - field_bounds['top']) / 12)
def crop_puyo_images(im... | null | commentator/recognition/puyo_classifier/crop_puyo_images.py | crop_puyo_images.py | py | 1,661 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line... |
225781548 | import cv2
#載入偵測人臉模組
face_cascade = cv2.CascadeClassifier('c://haarcascades//haarcascade_frontalface_default.xml')
#打開攝影機
cap = cv2.VideoCapture(0)
print(cap)
#假如攝影機已經打開,則執行while迴圈
while(cap.isOpened()):
ret, img = cap.read() # 輸入一張圖像
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # 將圖像轉為灰階, 降低運算複雜度
face... | null | PyAI_class/9_opencv_test/opencv_faceTrace.py | opencv_faceTrace.py | py | 1,585 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY"... |
406585464 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pansurg",
version=0.1,
author="Maxwell Flitton",
author_email="maxwellflitton@gmail.com",
description="Basic pip module for accessing coronavirus resources",
long_description=long_des... | null | pypi_install_script/pansurg-0.1.tar/setup.py | setup.py | py | 857 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 16,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.