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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
576372871 | import os
import shutil
import tensorflow as tf
from absl import flags
from tensorflow import io
FLAGS = flags.FLAGS
def load_img(img_path):
img = io.read_file(img_path)
img = tf.image.decode_image(img, channels=3)
img = tf.image.convert_image_dtype(img, dtype=tf.float32)
shape = tf.cast(tf.shape(i... | null | NeuralStyleTransfer/1/utils.py | utils.py | py | 974 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "absl.flags.FLAGS",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "absl.flags",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tensorflow.io.read_file",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.io"... |
585712248 | from developers import models, serializers
from rest_framework import viewsets
from django.contrib.gis.geos import Point
from django.contrib.gis.measure import Distance
class DeveloperViewSet(viewsets.ModelViewSet):
serializer_class = serializers.DeveloperSerializer
def get_queryset(self):
queryset =... | null | developers/views.py | views.py | py | 1,138 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "developers.serializers.DeveloperSerializer",
"line_number": 8,
"usage_typ... |
189947640 | # GCT634 (2018) HW1
#
# Mar-18-2018: initial version
#
# Juhan Nam
#
import xgboost as xgb
import matplotlib.pyplot as plt
import seaborn as sns
from feature_summary import *
from sklearn.linear_model import SGDClassifier
from sklearn.ensemble import VotingClassifier
FEATURE_NAMES = ([f'mfcc0_{i:02}' for i in range(... | null | hw1/train_test.py | train_test.py | py | 5,206 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.linear_model.SGDClassifier",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "xgboost.XGBClassifier",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "xgboost.XGBClassifier",
"line_number": 126,
"usage_type": "call"
},
{
"a... |
15941880 | from collections import deque
from datetime import datetime
from pybots.configurations.configuration_provider import configuration_provider
from pybots.game.actions import Action
from pybots.game.fields.block_field import BlockField
from pybots.game.fields.bot_field import BotField
from pybots.game.fields.treasure_fie... | null | pybots/game/game.py | game.py | py | 5,058 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pybots.game.utils.Exportable",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pybots.game.map.Map",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "name"
},
{
"api_name":... |
229136209 | ''' AppFactoryFactory
Centralize app object creation.
'''
import logging
from inspect import signature
from parsl.app.bash_app import BashApp
from parsl.app.python_app import PythonApp
from parsl.app.errors import InvalidAppTypeError
logger = logging.getLogger(__name__)
class AppFactory(object):
''' AppFactory ... | null | parsl/app/app_factory.py | app_factory.py | py | 3,785 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "inspect.signature",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "parsl.app.bash_app.BashApp",
"line_number": 90,
"usage_type": "name"
},
{
"api_name": "parsl.... |
483626962 | '''
Controllers in this file
RawTableController returns the response on the get request
Other classes in this files are inherited from RawTableController
and override the select, filter, order and paginate methods if required
'''
import sys
import csv
import json
from flask import Blueprint
from flask.views import Me... | null | app/controllers/raw_tables.py | raw_tables.py | py | 13,311 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask.views.MethodView",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "flask_sqlalchemy_session.current_session",
"line_number": 32,
"usage_type": "argument"
},
{
... |
213400780 | from pollutionbrowser_test_ui import Ui_Dialog
from pollutionbrowser import PollutionBrowserDialog
from PyQt5 import QtWidgets, QtCore, QtGui
class PollutionbrowserTestWindow(Ui_Dialog):
def __init__(self, dialog, dap):
super().__init__()
self.setupUi(dialog)
global DEFAUT_APP_PATH
... | null | src/pollutionbrowser/pollutionbrowser_test.py | pollutionbrowser_test.py | py | 583 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pollutionbrowser_test_ui.Ui_Dialog",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 19,
"usage_type": "name"
},
{
"api_nam... |
314444467 | from ...command import SubCommand
from ...wsgi import WSGIApplication
from ...loggingconf import init_logging
from fs.path import dirname
from fs.opener import fsopendir
from os.path import join as pathjoin
import sys
import thread
from wsgiref.simple_server import WSGIRequestHandler, make_server
import logging
log... | null | moya/command/sub/serve.py | serve.py | py | 1,861 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "wsgiref.simple_server.WSGIRequestHandler",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "command.SubCommand",
"line_number": 25,
"usage_type": "name"
},
{
"api... |
408875148 | # python3 -- set path
import numpy as np
import numpy.linalg as LA
import matplotlib.pyplot as plt
# 3D plot
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
# draw a vector
#from matplotlib.patches import FancyArrowPatch
#from mpl_toolkits.mplot3d import proj3d
from... | null | nonlinearObstacle_3d.py | nonlinearObstacle_3d.py | py | 11,118 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "math.pi",
"line_numbe... |
223375290 | #-*- coding:cp949 -*-
import tweepy
CONSUMER_KEY = 'zK3V0gXkDN8bOW5atMQ1vlYgR'
CONSUMER_SECRET = 'knpXhblGnJSZDwe6WKuzxNgEO2RKdo4MuyOpIjt0bd3X98SZV2'
ACCESS_KEY = '704954012194447361-D6eydjL8hXW71jmiuJEcKo4oeQGWyq5'
ACCESS_SECRET = 'xW6BhHSvh2jFCSzFWoGsSKLnBwrq5o2iDXSuuTUKJ3o0z'
auth = tweepy.OAuthHandler(CONSUMER_K... | null | tweepy_practice/tweepy_hello.py | tweepy_hello.py | py | 489 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 12,
"usage_type": "call"
}
] |
336717592 | from json.decoder import JSONDecodeError
from subprocess import check_output, CalledProcessError, TimeoutExpired
from os import path
from urllib.parse import urlparse
import concurrent.futures
from itertools import product
import json
class Explotacion():
'''
Clase para copiar los exploits y poderlos modif... | null | modules/explotacion/explotacion.py | explotacion.py | py | 18,985 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.abspath",
"line_number": 138,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 138,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 138,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"l... |
69701071 | from django.conf.urls import url
from django.contrib import auth
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^lti_entry$', views.lti_entry, name='lti_entry'),
url(r'^login$', auth.views.login, name='login'),
url(r'^create-superuser$', views.CreateSuper... | null | numbas_lti/urls.py | urls.py | py | 4,051 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.c... |
328624804 | from pyspark import SparkConf, SparkContext
conf = SparkConf().setAppName('KubernetesSpark').setMaster('spark://YOUR_SERVER_IP:7077')
sc = SparkContext(conf=conf)
words = 'the quick brown fox jumps over the lazy dog the quick brown fox jumps over the lazy dog'
seq = words.split()
data = sc.parallelize(seq)
counts =... | null | job.py | job.py | py | 419 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyspark.SparkConf",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 5,
"usage_type": "call"
}
] |
241454394 | from django import forms
from django.conf import settings
from django.core.validators import MinValueValidator
from django.urls import reverse, reverse_lazy
from django.utils.translation import npgettext_lazy, pgettext_lazy
from ...account.i18n import (
AddressForm as StorefrontAddressForm, PossiblePhoneNumberForm... | null | remote_works/dashboard/task/forms.py | forms.py | py | 22,434 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "django.forms.BooleanField",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "dj... |
219851308 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
('propertytracker', '0009_auto_20151023_1607'),
]
operations = [
migrations.AddFiel... | null | propertytracker/migrations/0010_auto_20151024_2347.py | 0010_auto_20151024_2347.py | py | 1,030 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 15,
"usage_type": "call"
},
{
... |
13269820 | from NeuralEvolutionFlappy.network import Network
import FlapPyBird.flappy as flpy
import os, pickle, datetime
os.chdir(os.getcwd() + '/FlapPyBird/')
class Species(object):
def __init__(self, topology, num_generations, num_networks_per_gen, s_id):
# Create class variables from the passed in parameters
... | null | dummyGUI/NeuralEvolutionFlappy/species.py | species.py | py | 6,761 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.chdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "NeuralEvolutionFlappy.network.Network",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "NeuralEvolutio... |
200844736 | import cv2
import sys
import shutil
import numpy as np
import pandas as pd
from pathlib import Path
from urllib.request import urlopen
__all__ = [
'show_image_scaled',
'pixel_index',
'tree',
'calculate_PSNR',
]
def show_image_scaled(filename,img,width=608,height=608):
"""
Show image in resized window. Default r... | null | pykit/utils/functions.py | functions.py | py | 1,882 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.namedWindow",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cv2.WINDOW_NORMAL",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "cv2.resizeWindow",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
... |
262289914 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 12 13:43:23 2016
@author: jinzhenwang
"""
# Crawl by city name
import requests
import os
from bs4 import BeautifulSoup
root_url='https://www.redfin.com/'
root_filename='redfin.html'
#path='/Users/jinzhenwang/python/WebCrawling/Pages/'
path='Pages_city'
# -------------... | null | WebCrawling/Mining USA/CityCrawl.py | CityCrawl.py | py | 2,361 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number... |
393598946 | '''
Example
game = Game('Player A', 'Player B')
while not game.winner:
game.player['Player A'].throw = 'rock'
game.player['Player B'].throw = 'scissors'
game.judge()
print('{0} wins!'.format(game.winner))
'''
import logging
logger = logging.getLogger("Views")
logger.setLevel(logging.DEBUG)
THROWS = {... | null | app/rpsgame/game.py | game.py | py | 3,613 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 17,
"usage_type": "attribute"
}
] |
336416589 | import discord
import youtube_dl
import os
#import ffprobe
from discord.ext import commands
from discord.utils import get
from discord import FFmpegPCMAudio
from os import system
from packages.CRITICAL.CLIENT import client
from commands.data import FOOTER, BOT_CHANNELS
@client.command(pass_context=True, aliases=["Paus... | null | commands/pause.py | pause.py | py | 1,307 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "commands.data.BOT_CHANNELS.channels",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "commands.data.BOT_CHANNELS",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "discord.utils.get",
"line_number": 16,
"usage_type": "call"
},
{
... |
418030345 | import discord
import os
import asyncio
from discord.ext import commands
# Custom modules
import db
import tfidf_summarizer
client = commands.Bot(command_prefix = '!')
# This takes a while and should be run only once on startup
mongo_client = db.connect_to_mongo(db.user, db.pswd)
# Get the keyword lis... | null | bot.py | bot.py | py | 11,524 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "db.connect_to_mongo",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "db.... |
4311494 | import collections
data_file = '/home/ke/back-match-testing/sorted_diff.diff'
data = collections.defaultdict(list) # initiate all fields as lists
with open(data_file, "r") as f: # open the file for reading
for line in f: # read the file line by line
value, key = line.split() # split the line to value an... | null | newtest.py | newtest.py | py | 517 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.defaultdict",
"line_number": 3,
"usage_type": "call"
}
] |
529734132 | import random
import warnings
from typing import List, Iterable, Iterator
from itertools import islice
from tqdm import trange
from torch.utils.data import Dataset, DataLoader
from .. import TypeTuple
from .images import ImagesDataset
from .sampler import ImageSampler
class Queue(Dataset):
def __init__(
... | null | torchio/data/queue.py | queue.py | py | 4,811 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "images.ImagesDataset",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sampler.ImageSampler",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "ty... |
364994150 | #!/usr/bin/env python
import sys
import os
import argparse
R_code="""
library(Seurat)
library(dplyr)
library(glue)
library(ggplot2)
library(patchwork)
library(cowplot)
library(stringr)
library(tidyr)
library(DAseq)
library(reshape2)
library(ggrepel)
library(corrplot)
library(scales)
library(cluster)
library(misc3d)
l... | null | bin/seurat_DEG_pairwise.py | seurat_DEG_pairwise.py | py | 2,286 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 73,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 91,
"usage_type": "call"
}
] |
300586236 | from icecream import ic
import numpy as np
# import pandas as pd
from sklearn.datasets import load_diabetes
from sklearn.metrics import r2_score
from sklearn.model_selection import train_test_split
#1. 데이터
datasets = load_diabetes()
x = datasets.data
y = datasets.target
ic(x.shape, y.shape) # (442, 10), (442,)
ic(... | null | keras/keras17-33/keras17_func4_diabets.py | keras17_func4_diabets.py | py | 3,523 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.datasets.load_diabetes",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "icecream.ic",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "icecream.ic",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "icecream.ic",
... |
475704631 | # coding=utf-8
import json
import time
from flask import session
from db_interface import db_model_action
from db_interface import db_model_action_type
from db_interface import db_model_private_message
from db_interface import db_model_user
from Logger import *
default_page_no = 1
default_num_perpage = 10
def serv... | null | modules/mod_private_message.py | mod_private_message.py | py | 4,176 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.session.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "flask.session.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "flask.session",
... |
420450358 | import numpy as np
import cv2
face_cascade = cv2.CascadeClassifier('cascade.xml')
img = cv2.imread('D:/GITHUB/MyFiles-master/Python/Major project/RGB_thermal/thermal_6.jpg')
img = cv2.resize(img, (500, 500))
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray,1.01,7)
flag=0
for ... | null | Python/Major project/Thermal/Test_GUI/TestCode.py | TestCode.py | py | 615 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_num... |
34197003 | from network import Node, Device, Network
import utils
import marriages as mg
#crea i nodi
nodes = utils.create_n_nodes(25)
n_count = len(nodes)
#crea i dispositivi
devices = utils.create_n_devices_with_random_priority(25)
d_count = len(devices)
print('nodi della rete:')
for node in nodes:
print(node)
print('\n\n... | null | 25_test.py | 25_test.py | py | 942 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.create_n_nodes",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "utils.create_n_devices_with_random_priority",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "network.Network",
"line_number": 19,
"usage_type": "call"
},
{
"ap... |
304803088 | from collections import deque
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# BFS
def minDepth(self, root):
"""
:type root: TreeNode
:rtype: int
"""
... | null | 111_min_depth_BT.py | 111_min_depth_BT.py | py | 1,231 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.deque",
"line_number": 19,
"usage_type": "call"
}
] |
140698557 | from vectorformats.Feature import Feature
from vectorformats.Formats.Format import Format
from Cheetah.Template import Template
class HTML (Format):
"""Uses Cheetah to format a list of features."""
template_file = "template/default.html"
"""Default template file to use."""
def encode(self, result, *... | null | Formats/HTML.py | HTML.py | py | 546 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "vectorformats.Formats.Format.Format",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "Cheetah.Template.Template",
"line_number": 14,
"usage_type": "call"
}
] |
177884525 | import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 10)
plt.plot(x, np.sin(x), linewidth=2,label="sine")
plt.plot(x, np.cos(x), linewidth=2,label="cosine")
plt.legend()
plt.xlabel("x")
plt.ylabel("y")
plt.title("an example plot")
plt.savefig("example.png")
plt.show()
| null | 02_Modelling_Neurons_1/python_code/plot_example_labels.py | plot_example_labels.py | py | 295 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.linspace",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.sin",
... |
135232019 | # -*- coding: utf-8 -*-
__all__ = ["RadiusFromOccAreaOp"]
import numpy as np
import theano
import theano.tensor as tt
from scipy.optimize import bisect
from theano import gof
def kite_area(r, b):
abc = tt.sort(tt.stack((r, b, tt.ones_like(r)), axis=0), axis=0)
A = abc[0]
B = abc[1]
C = abc[2]
re... | null | src/exoplanet/theano_ops/starry/radius_from_occ_area.py | radius_from_occ_area.py | py | 3,935 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "theano.tensor.sort",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "theano.tensor",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "theano.tensor.stack",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "theano.tensor.on... |
114168860 | import xml.dom.minidom
import re
import inspect
import sys
# constants
_gmlNS = "http://www.opengis.net/gml/3.2"
_imaerNS = "http://imaer.aerius.nl/1.0"
_imaerSchemaLocation = "http://imaer.aerius.nl/1.0/IMAER.xsd"
class ImaerWrite():
'''The class that wraps up all features created by the other classes'''
def... | null | AeriusTools/imaerwrite.py | imaerwrite.py | py | 16,335 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.compile",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.DOTALL",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "xml.dom.minidom.dom.minidom.Document",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "xml.do... |
549462043 | import nbformat
def load_cells(variables, nb_path, cell_indexes=None):
"""
Jupyter Notebook:
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": ["num = 8"]
}
],
cla... | null | nbtester/loader.py | loader.py | py | 1,119 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nbformat.read",
"line_number": 26,
"usage_type": "call"
}
] |
261395080 | # -*- coding: utf-8 -*-
#################################################
# Bibliothèques #
#################################################
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw
#################################################
# ... | null | 6_11.py | 6_11.py | py | 6,516 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_number": 147,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_nu... |
335937503 | import numpy as np
from matplotlib import pyplot as plt
X = np.array([[2104, 5, 1, 45], [1416, 3, 2, 40], [1534, 3, 2, 30], [852, 2, 1, 36]])
X = (X - np.mean(X, axis=0)) / np.std(X, axis=0)
X = np.c_[np.ones(X.shape[0]), X] # 给X第一列增加一列1,X维度变为m*(d+1)
y = np.array([460, 232, 315, 172])
# 请按照题目要求完成代码
m, n = X.shape[0]... | null | file/course/experiment6/实验六/201866590050_陈宇驰_第六次作业/源代码/Q3.py | Q3.py | py | 707 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.c_",
"line_number": 6,
"u... |
136771164 | #!/usr/bin/env python
from random import randrange
import time
import requests
import os
with open('symbols.list') as symbol_list:
symbols = [v.rstrip("\n") for v in symbol_list.readlines()]
symbol_list.close()
with open('types.list') as types_list:
types = [v.rstrip("\n") for v in types_list.readlines()]
ty... | null | autoclient/autoclient.py | autoclient.py | py | 1,409 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"lin... |
508237775 | from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth import login,authenticate
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import Arriendo
f... | null | cacharritos/core/views.py | views.py | py | 3,060 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 21,
"usage_type": "call"
},
{
"api_name"... |
20961467 | from django.urls import reverse
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework_jwt import utils
from app.models import Product, Order
class BaseTest(APITestCase):
def setUp(self):
self.email = 'admin@example.com... | null | backend/tests/tests.py | tests.py | py | 3,860 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.User.objects.create_user",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 1... |
363625345 | # -*- coding: utf-8 -*-
import matplotlib
from matplotlib import pyplot as plt
import numpy as np
import os
import sys
from PIL import Image
from sklearn.manifold import TSNE
from sklearn.decomposition import PCA
import random
import unicodedata
import time
import pickle
import pygame as pg
from pydub import AudioSegm... | null | spec2map.py | spec2map.py | py | 5,665 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "unicodedata.normalize",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
... |
21538834 | from django import forms
from django.utils.translation import ugettext as _
from edumanage.models import (
MonLocalAuthnParam,
InstRealmMon,
InstitutionDetails,
InstServer,
Contact,
InstRealm,
ServiceLoc
)
from accounts.models import UserProfile
from edumanage.fields import MultipleEmailsFie... | null | edumanage/forms.py | forms.py | py | 7,036 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "edumanage.models.MonLocalAuthnParam",
"line_number": 26,
"usage_type": "name"
},
{
"api_... |
196850088 | #!/usr/bin/env python
# encoding: utf-8
# to run : python db/importBringOut.py @../
# before use: clean the db
# drop all tables and redo: python manage.py syncdb
"""
importBringOut.py
Created by Holbrook on 2012-01-19.
Copyright (c) 2012 __MyCompanyName__. All rights reserved.
"""
import sys,os,re
import random
fr... | null | db/genProj.py | genProj.py | py | 1,523 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
236991770 | from Configs.Configs import INIT_PARAMS
import numpy as np
import matplotlib.pyplot as plt
from UtilsService.UtilsService import UtilsService
LOGGER = UtilsService.get_logger()
class RiskManager:
def __init__(self):
self.pnl_records = {}
def evaluate_pnl(self, account, params):
for portfolio... | null | RiskManager/RiskManager.py | RiskManager.py | py | 5,635 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "UtilsService.UtilsService.UtilsService.get_logger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "UtilsService.UtilsService.UtilsService",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "Configs.Configs.INIT_PARAMS",
"line_number": 20,
"... |
128487702 | import pandas as pd
import numpy as np
import tensorflow as tf
import torch
from torch.nn import BCEWithLogitsLoss, BCELoss
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
from keras.preprocessing.sequence import pad_sequences
from sklearn.model_selection import train_test_split... | null | scripts/downstream/multiLabelClassification/train_legalBert.py | train_legalBert.py | py | 14,843 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_numb... |
266912378 | from unittest.mock import Mock
from accounts.journal import Journal
from common.test import PacsTestCase
from currencies.money import Balance, Money
class BalanceTestCase(PacsTestCase):
pass
class TestJournal(PacsTestCase):
def gen_transaction_mock(self, money_for_account):
transaction = Mock()
... | null | accounts/tests/test_accounts_journal.py | test_accounts_journal.py | py | 1,003 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "common.test.PacsTestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "common.test.PacsTestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "u... |
404417509 | '''
This is a script that comprises several small experiments/demos in the paper.
The best to use this is to comment/uncomment certain lines depending on the purpose.
'''
import sys
import json
from diffco import DiffCo, MultiDiffCo
from diffco import kernel
from matplotlib import pyplot as plt
import numpy as np
impo... | null | scripts/distest_error_vis.py | distest_error_vis.py | py | 18,007 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "seaborn.set",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
185866289 | # Javier Mariño
## UPWIND ##
import matplotlib.pyplot as plt
import numpy as np
dimt = 100 # número de iteraciones temporales
deltat = 0.01; deltax = 0.5; C = 1.0; u = C*deltax/deltat
N = 200 # parámetros naturales de la discretización
T = np.zeros(N+1); T[5:30]=np.ones(25)*1; #T[N]=10 # vector inicial, con las c.i. ... | null | bol9/bol9_ex2_Mariño_Villadamigo_Javier.py | bol9_ex2_Mariño_Villadamigo_Javier.py | py | 854 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.close",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
1194663 | import logging
import yaml
import os
log = logging.getLogger('WFLOWSERVICELOG')
def workflow_options(ctx,workdir):
log.info('running workflow on context %s',ctx)
initdata = ctx.get('fixed_pars',{})
initdir = os.path.join(workdir,'inputs')
if not os.path.exists(initdir):
os.makedirs(initdir)... | null | wflowyadageworker/simple_workflow.py | simple_workflow.py | py | 825 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line... |
194256287 | import panel as pn
import FlankerExperiment
import DataWrangling
import PersonalSummary
# button texts -> primary panel
EXPERIMENT_TEXT = "Run the FLanker Task experiment and collect your own data points"
DATA_ANALYSIS = "Have a glimpse at some plots constructed with the yet collected data"
PERSONAL_RESULTS = "Look at... | null | menu.py | menu.py | py | 9,189 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "panel.extension",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "panel.widgets.Button",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "panel.widgets",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "panel.widgets... |
97992883 | import torch
import torch.nn as nn
import torch.nn.functional as F
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class GaussianEncoder(nn.Module):
"""Gaussian encoder module for VAE"""
def __init__(self, latent_dim, dataset):
"""
Constructor for the GaussianEncoder cl... | null | Implementations/Conditional-Variational-Autoencoder/model.py | model.py | py | 12,260 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.device",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
... |
399774390 | # -*- coding: utf-8 -*-
from werkzeug.exceptions import NotFound
from nereid import abort, render_template, route, url_for, request
from nereid.helpers import slugify, context_processor
from nereid.contrib.pagination import QueryPagination
from nereid.contrib.sitemap import SitemapIndex, SitemapSection
from trytond.mo... | null | tree.py | tree.py | py | 12,352 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "trytond.pool.PoolMeta",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "trytond.model.fields.One2Many",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "trytond.model.fields",
"line_number": 26,
"usage_type": "name"
},
{
"api_name... |
507345370 | import numpy as np
from sklearn.base import BaseEstimator, RegressorMixin
class RandomRegressor(BaseEstimator, RegressorMixin):
def __init__(self, strategy="uniform", seed=42):
"""
:param strategy: One of 'uniform', 'normal' or 'gmm'.
"""
self.allowed_strategies = ("uniform", "norm... | null | sklego/dummy.py | dummy.py | py | 1,248 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sklearn.base.RegressorMixin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "numpy.min",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.... |
300026832 | # Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed
# under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | null | test/ci/util_test.py | util_test.py | py | 4,132 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "test._test_utils.capture_out",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "ci.util.info",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "ci.util",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "ctx.args",
"lin... |
41839524 | from collections import namedtuple
import os
Config = namedtuple('Config', [
'VERSION',
'NAME',
'AUTHOR',
'AUTHOR_EMAIL',
'URL',
'LICENSE',
'KEYWORDS',
'DESCRIPTION',
'fs',
'input',
'generator',
'spark',
'concatenator'
])
Fs = namedtuple('Fs', [
'FILE_PATTERN'
... | null | slagg/config.py | config.py | py | 1,649 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "c... |
392874424 | # Karl Gemayel
# Georgia Institute of Technology
#
# Created: 3/19/20
import logging
import argparse
import pandas as pd
from typing import *
# noinspection All
import pathmagic
# noinspection PyUnresolvedReferences
import sbsp_log # runs init in sbsp_log and configures logger
# Custom imports
from sbsp_general im... | null | code/python/driver_deprecated/easy_clean.py | easy_clean.py | py | 1,806 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sbsp_general.Environment",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "... |
643786333 | import torch
import numpy as np
def bwLoss(expls, gts):
cntZero = 0
cntOne = 0
remember = []
zero = torch.tensor([0.0]).double()
for gt, expl in zip(gts, expls):
for zero_xy in (gt == 0).nonzero().tolist():
row, column = zero_xy
result = torch.max(zero, (expl[row,col... | null | loss/delu.py | delu.py | py | 776 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.tensor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 16,... |
520640068 | from django.db import models
from django.conf import settings
from django.template import Context, Template
from cabot.cabotapp.alert import AlertPlugin
from os import environ as env
import requests
logstash_alert_url = env['LOGSTASH_URI']
logstash_create_services = env.get('LOGSTASH_CREATE_SERVICES') or False
logs... | null | cabot_alert_logstash/models.py | models.py | py | 3,609 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": ... |
200756890 | from some_libs import *
from jreftran_rt import *
import cmath
import argparse
import pickle
from datetime import datetime
import gzip
def N_maters_dict(args,materials = ['au', 'ag', 'al', 'cu']):
dict = {}
for mater in materials:
N_r_path, N_i_path = '{}/{}_n1.txt'.format(args.mater_file_dir,mater), '... | null | surface_plasmon/sp_spectrum.py | sp_spectrum.py | py | 8,952 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "gzip.open",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 32... |
588678702 | import cv2
import random
def diff(img1, img2, window_name=''):
df = img1 - img2
cv2.imshow(window_name, df)
cv2.imwrite(window_name + '.jpg', df)
def main():
img0 = cv2.imread('/media/cory/c_disk/Project/KITTI_Dataset/data_tracking_image_2/training/image_02/0003/000035.png')
img1 = cv2.imread('/... | null | flow/img_diff.py | img_diff.py | py | 717 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imshow",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 13,
... |
107363517 | import os
from openpyxl import load_workbook
from openpyxl import Workbook
import requests
import urllib
url_template = "http://localhost:8080/search/press-releases?query="
headers = {'Content-Type': 'application/json'}
data = {"query": "Colima"}
wb = load_workbook(filename='sdn.xlsx')
ws = wb.active
new_wb = Workbo... | null | pr_match.py | pr_match.py | py | 962 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "openpyxl.Workbook",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib.quote_plus",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.g... |
519212001 | import numpy as np
import matplotlib.pyplot as plt
from skimage import io
import cPickle as pickle
import custom_image_toolkit as C
import pandas as pd
# This script takes the .npy outputs from track_localization_1 and assigns these points to individual cells at the
# timepoint in question for the cell outputs from po... | null | track_localization_2.py | track_localization_2.py | py | 2,747 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cPickle.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "custom_image_toolkit.assign_labels... |
599324147 | """Chatbot API URL."""
from django.urls import path
from . import views
app_name = "chatbot"
urlpatterns = [
path("", views.AboutView.as_view(), name="index"),
path("epl", views.EPLView.as_view(), name="epl"),
]
| null | dashboard/chatbot/urls.py | urls.py | py | 223 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
}
] |
361330144 | import requests
import json
import logging
from econtextclient.keywords.search import Search
log = logging.getLogger('econtext')
class CategorySearch(Search):
def add_category(self, category_id, include_branch=True):
self.data['query'][category_id] = bool(include_branch)
return self
... | null | econtextclient/keywords/category_search.py | category_search.py | py | 2,834 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "econtextclient.keywords.search.Search",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "econtextclient.keywords.search.Search.SEARCH_PAGE_LIMIT",
"line_number": 16,
"usag... |
586361531 | #!/usr/bin/python3
import argparse
import json
import os
import re
import time
import urllib.error
import urllib.request
# Number of seconds to sleep after each request
TIMEOUT = 1
user_agent = "Mozilla/5.0 (X11; Linux i686; rv:22.0) Gecko/20100101 " \
"Firefox/22.0 Iceweasel/22.0"
profile_url = "http://statigr.am/... | null | statigram-dl.py | statigram-dl.py | py | 2,693 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "urllib.error.request.build_opener",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "urllib.error.... |
528069189 | # -*- coding: utf-8 -*-
"""Run module for TD3 on LunarLanderContinuous-v2.
- Author: whikwon
- Contact: whikwon@gmail.com
"""
import torch
import torch.optim as optim
from algorithms.common.networks.mlp import MLP
from algorithms.common.noise import GaussianNoise
from algorithms.td3.agent import Agent
device = torc... | null | scripts/config/agent/reacher-v1/td3.py | td3.py | py | 3,590 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.device",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "algorithms.commo... |
192883785 | from django.contrib.auth.models import User,Group
from django.shortcuts import render,redirect
from accounts.decorators import unauthenticated_user, allowed_users, admin_only
from user.models import Profile
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from .models import... | null | controller/views.py | views.py | py | 2,617 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "accounts.decorators.admin_only",
"line_number": 14,
"usage_type": "... |
144416522 | import cv2
import name as nmi
import os
#import speech
import trainer
import pyodbc
db = pyodbc.connect(
r'DRIVER={ODBC Driver 17 for SQL Server};'
r'SERVER=localhost\sqlexpress;'
r'DATABASE=mine;'
r'UID=sa;'
r'PWD=6461'
)
cur = db.cursor()
cur.execute("SELECT * from face")
favail=cur.fetchall... | null | dataSetGenerator.py | dataSetGenerator.py | py | 1,654 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyodbc.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.join",
... |
122055528 | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 7 20:00:17 2018
@author: Administrator
"""
#coding=utf-8
from PIL import Image
import cv2
import numpy as np
picsrc="E:\\project\\digital_image_process\\图像处理大作业\\数据集\\100.jpg"
def rotateimg(num):
i=0
for i in range(0,num):
im1 = Image.open(picsrc)
... | null | 10.py | 10.py | py | 3,453 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.open",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "cv2.pyrDown",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": ... |
366881713 | from django.core.management.base import BaseCommand, CommandError
from blog.models import OrdenCorrplan as OrdenCorrplan
from blog.models import FotoCorrplan as FotoCorrplan
from blog.models import Cartones as Cartones
from blog.models import Maquinas as Maquinas
from blog.models import ConsumoRollos as ConsumoRollos
f... | null | mysite/blog/management/commands/update_datos_cons_bob OLD.py | update_datos_cons_bob OLD.py | py | 3,747 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 31,
"usage_type": "name"
},
{
"a... |
651777494 | import os
from datetime import datetime
from cached_property import cached_property
from airflow.configuration import conf
from airflow.utils.log.logging_mixin import LoggingMixin
from airflow.utils.log.gcs_task_handler import GCSTaskHandler
class BQTaskHandler(GCSTaskHandler, LoggingMixin):
"""
BQTaskHandle... | null | bigquerylogger/BQTaskHandler.py | BQTaskHandler.py | py | 4,871 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "airflow.utils.log.gcs_task_handler.GCSTaskHandler",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "airflow.utils.log.logging_mixin.LoggingMixin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "airflow.configuration.conf.get",
"line_number"... |
343720644 | #!/usr/bin/python
import optparse
import os
import re
import sys
from typing import List
from gaphor.application import Session
from gaphor.core.modeling import Diagram
from gaphor.storage import storage
def pkg2dir(package):
"""Return directory path from package class."""
name: List[str] = []
while pac... | null | gaphor/plugins/diagramexport/gaphorconvert.py | gaphorconvert.py | py | 3,736 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "optparse.OptionParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"lin... |
70919766 | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from .models import Order, OrderItem, DeliveryAddress
from menu.models import MenuItems, Toppings
from django.http import JsonResponse
import json
@login_required(login_url='/login/')
def cart(request):
if request.user.is... | null | restaurant/order/views.py | views.py | py | 2,147 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Order.objects.get_or_create",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Order.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.Order",
"line_number": 12,
"usage_type": "name"
},
{
"api_nam... |
65826319 | from datetime import datetime
import random
import os
import sys
import numpy as np
import h5py
from skimage.filters import threshold_otsu
from matplotlib import pyplot as plt
from preprocessing.datamodel import SlideManager
from preprocessing.processing import split_negative_slide, split_positive_slide, create_tumo... | null | preprocess/generate_tiles.py | generate_tiles.py | py | 5,153 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
154043022 | import sys
import argparse
import datetime
import numpy as np
import pandas as pd
import pet_box_functions as pbf
import antea.reco.reco_functions as rf
import antea.elec.shaping_functions as shf
import antea.reco.mctrue_functions as mcf
import antea.io .mc_io as mcio
import antea.database.load_db... | null | pet_box/tile5_centered/2_pet_box_reco_info_both_planes_teflon_block_jitter_peak_evts_wider_holes.py | 2_pet_box_reco_info_both_planes_teflon_block_jitter_peak_evts_wider_holes.py | py | 16,818 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"li... |
329141931 | from functools import wraps
from flask import request, session, current_app as app
from flask.ext import restful
def sanitize_response(response):
data = None
status = 200
headers = {}
if isinstance(response, tuple) and len(response) is 3:
(data, status, headers) = response
else:
... | null | smart_recruiting_server/utils/resource.py | resource.py | py | 2,525 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.session.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "flask.current_app.logger.error",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "flask.... |
360819119 | from datetime import datetime, timedelta
import itertools
import json
import webapp2
import handlers
from models import Datum, Dosable, Measurement, ParallelSwitch
class MainHandler(handlers.BaseHandler):
def get(self):
pass
def post(self):
pass
class SummaryHandler(handlers.BaseHandler):
... | null | app.py | app.py | py | 3,751 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "handlers.BaseHandler",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "handlers.BaseHandler",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 20,
"usage_type": "call"
},
{
"api_nam... |
381408801 | import time
from flask import Flask, send_from_directory, request
from .model.excel_processing.ExcelOutput import ExcelOutput
from .model import storage, file_importing, guttman_analysis
from werkzeug.utils import secure_filename
app = Flask(__name__, static_url_path='')
@app.route('/export/<int:file_id>')
def expo... | null | app.py | app.py | py | 5,971 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "model.storage.get_export_path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "model.storage",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.send_fro... |
268128723 | # Copyright 2014 Google Inc. 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 required by applicable law or ag... | null | google-cloud-sdk/lib/googlecloudsdk/api_lib/compute/firewalls_utils.py | firewalls_utils.py | py | 11,363 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.compile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.VERBOSE",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "googlecloudsdk.core.exceptions.Error",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "... |
646288764 | #!/bin/python3
import os
from collections import deque
import resource
import sys
# Will segfault without this line.
class Node:
def __init__(self, data, left=None, right=None, height=1):
self.data = data
self.lt = left
self.rt = right
self.ht = height
def get_inorder(node, ioar... | null | Competitive Coding/HackerRank/Data Structures/Stack/swap_nodes.py | swap_nodes.py | py | 2,246 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.deque",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 50,
"usage_type": "call"
}
] |
603832434 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | null | official/benchmark/models/resnet_cifar_main.py | resnet_cifar_main.py | py | 19,784 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pprint.PrettyPrinter",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "official.vision.image_classification.resnet.common.BASE_LEARNING_RATE",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "official.vision.image_classification.resnet.commo... |
280178501 | import re
from inspect import Parameter, Signature, signature
from collections import OrderedDict
def make_signature(names):
return Signature(
Parameter(name, Parameter.POSITIONAL_OR_KEYWORD)
for name in names)
class Descriptor:
def __init__(self, name=None):
self.name = name
def... | null | meta.py | meta.py | py | 2,471 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "inspect.Signature",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "inspect.Parameter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "inspect.Parameter.POSITIONAL_OR_KEYWORD",
"line_number": 8,
"usage_type": "attribute"
},
{
"api... |
300029083 | #p1 = [[3, 0], [0, 2]] #row player
#p2 = [[2, 0], [0, 3]] #col plaryer
##P1A0=00 P1A1=01,P1B0=10,P1B1=11
##P2A0=00 P2B0=01,P2A1=10,P2B1=11
#
#def get_eq_from_two_players(row_player,col_player):
# equ = [2, 2]#set default equ as no equ
# p1 = row_player
# p2 = col_player
# #p1 choose A
# if p2[0][0] >= ... | null | test.py | test.py | py | 1,848 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.suptitle",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": ... |
246290377 | import matplotlib.pyplot as plt
import numpy as np
import cmath
import copy
def conv(func1, func2):
func1List = copy.copy(func1)
func2List = copy.copy(func2)
resultFuncList = []
len1 = len(func1List)
len2 = len(func2List)
# свёртываем два сигнала в третий
for n in range (len1 ... | null | Filter/Butterworth.py | Butterworth.py | py | 3,287 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "copy.copy",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 45,
... |
507623468 | from django.shortcuts import render
# Create your views here.
from .models import RequestExercise, Trainer, ExerciseType
def index(request):
"""
Функция отображения для домашней страницы сайта.
"""
# Генерация "количеств" некоторых главных объектов
num_request_exercise = RequestExercise.objects.... | null | sport/views.py | views.py | py | 977 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.RequestExercise.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.RequestExercise.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "models.RequestExercise",
"line_number": 13,
"usage_type": "name"
... |
146670353 | # -*- coding: utf-8 -*-
"""
"""
# standard library imports
import logging
# related imports
# project imports
from .__init__ import Model
from .twitter_slave import TwitterSlave
class SlavesModel(Model):
def __init__(self):
Model.__init__(self, TwitterSlave)
self._slaves = self._container # jus... | null | twittator/model/slaves_model.py | slaves_model.py | py | 934 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "__init__.Model",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "__init__.Model.__init__",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "twitter_slave.TwitterSlave",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": ... |
369742377 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | null | src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/api_properties_py3.py | api_properties_py3.py | py | 1,035 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "msrest.serialization.Model",
"line_number": 15,
"usage_type": "name"
}
] |
626077006 | import xml.etree.ElementTree as ET
import requests
import csv
#parse xml file from tfl site for santander bikes
req = requests.get(".....", stream=True)
req.raw.decode_content = True # ensure transfer encoding is honoured
data = ET.parse(req.raw)
root = data.getroot()
bike_data = open('tflbikes.csv', 'w'... | null | xml_parser.py | xml_parser.py | py | 1,399 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "csv.write... |
386502976 | # -*- coding: utf-8 -*-
"""
Plot data produced during Trust Model simulations
Created on Sat Oct 13 18:33 2018
@author: Cara Lynch
"""
import numpy as np
import os
import matplotlib.pyplot as plt
import sys
import math
def read_olddata(infile):
"""
Reads files and puts data into arrays
:param infil... | null | simplotter.py | simplotter.py | py | 24,041 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 8... |
13388888 | import email.mime.text
import email.utils
import smtplib
from email.mime.text import MIMEText
self_user = '1617491825@qq.com'
def mail(self_user):
ret = True
try:
sender = '13020207396@163.com' # 发件人邮箱(最好写全, 不然会失败)
receivers = ['1617491825@qq.com'] # 接收邮件,可设置为你的QQ邮箱或者其他邮箱
msg = M... | null | src/learn/sendmail.py | sendmail.py | py | 1,186 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "email.mime.text.MIMEText",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "smtplib.SMTP_SSL",
"line_number": 27,
"usage_type": "call"
}
] |
307378501 | # 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, software
# d... | null | neutronclient/tests/functional/adv-svcs/test_readonly_neutron_vpn.py | test_readonly_neutron_vpn.py | py | 2,453 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "neutronclient.tests.functional.base.ClientTestBase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "neutronclient.tests.functional.base",
"line_number": 16,
"usage_type": "name"
}
] |
416726734 | import serial
import sqlite3
import datetime
import time
import re
z1data = serial.Serial("COM13", 115200)
def add_db(time,t1,t2,t3,t4,t5,t6,t7,t8,t9,dt):
conn = sqlite3.connect('falsedata112.db')
c = conn.cursor()
c.execute("""CREATE TABLE IF NOT EXISTS data(Time TEXT,Temperature48 TEXT,Temperature31 TEXT... | null | data_extraction_from_all_9_mote_to_sqlite_database.py | data_extraction_from_all_9_mote_to_sqlite_database.py | py | 2,251 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "serial.Serial",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": ... |
189040752 | import logging
import pathlib
from pybloom_live import ScalableBloomFilter
from .basefilter import BaseFilter
logger = logging.getLogger('Scheduler.Filter')
class BlumeFilter(BaseFilter):
def __init__(self, settings):
self._blumeclosed = False
super().__init__(settings)
path = settings.... | null | acrawler/filterlib/blumefilter.py | blumefilter.py | py | 1,603 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "basefilter.BaseFilter",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pybloom_live.Scal... |
123137497 | from django.http import HttpResponse
from django.template import Template,Context
def index(request):
return HttpResponse("hello word")
def demo(request,year,month,day):
year = int(year)
month = int(month)
day = int(day)
m, n, sum = 0,0,0
for i in range(1,month+1):
if (year%4 == 0 or ye... | null | demo/views.py | views.py | py | 2,610 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.template.Template",
"line_number": 30,
"usage_type": "call"
},
{
"api_nam... |
535649512 | #!/usr/bin/python3 env
# -*- coding: UTF-8 -*-
"""
store stations index in mongodb
"""
from selenium import webdriver
from lxml import html
import re
import redis
browser = webdriver.Chrome()
# 首页
browser.get("https://kyfw.12306.cn/otn/leftTicket/init")
browser.find_element_by_xpath("//input[contains(@id,'fromStat... | null | stations.py | stations.py | py | 2,403 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "redis.StrictRedis",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "lxml.h... |
592784084 | import os
import sys
from collections import defaultdict
from pathlib import Path
def main():
directory = get_directory_from_arguments()
if not directory:
exit('Try again with right format "$ python duplicates.py {directory}"')
file_name_size_paths = collect_files_information_from_directory(dire... | null | duplicates.py | duplicates.py | py | 2,157 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.walk",
"li... |
181672861 | import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
# args = mass, drag coeff., undamped ang. freq., ext. initial force, exponential const.
def spring(state, t, m, r, w0, F0, c):
disp, vel = state
state_deriv = [vel, -np.square(w0) * disp - r * vel + (F0/m) * np.exp(-c * t)]
... | null | models/main_exp-force.py | main_exp-force.py | py | 1,417 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.square",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 15,
... |
291926346 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import Profile,Posts,Comments,Likes
class SignUpForm(UserCreationForm):
first_name = forms.CharField(max_length=40)
last_name = forms.CharField(max_length=40)
class Meta:... | null | awwards/forms.py | forms.py | py | 1,487 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.auth.forms.UserCreationForm",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_n... |
346422289 | #!flask/bin/python
from flask import Flask, jsonify, request
from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()
app = Flask(__name__)
@app.route('/api/v1.0/thing', methods=['GET'])
def get_things():
res = es.search(index="avacat", doc_type='thing', q='*')
return jsonify... | null | app.py | app.py | py | 976 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
... |
334697759 | '''
test_parse.py: Test parse module
'''
import os
import os.path
from nose.tools import with_setup
from .utils import check_fusion
from circ2.parse import parse
def setup_function():
'''
Enter data directory
'''
print('#%s: Moving to data directory' % __name__)
os.chdir('data')
def teardown_fu... | null | test/test_parse.py | test_parse.py | py | 3,391 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.chdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "circ2.parse.parse",
"line_number": 37... |
597536984 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Project Euler Problem 148
=======================
We can easily verify that none of the entries in the first seven rows of
Pascal's triangle are divisible by 7:
1
1 1
... | null | project-euler/solvers/euler148.py | euler148.py | py | 1,426 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ntpath.basename",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "common.shared_functions.verify_so... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.