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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
215112485 | '''
@author: Dallas Fraser
@date: 2016-04-12
@organization: MLSB API
@summary: Tests all the imports classes
'''
from api.model import Team, Game, Player
from api import DB
from api.BaseTest import TestSetup
from api.advanced.import_league import LeagueList
from api.advanced.import_team import TeamList
from api.errors ... | null | api/advanced/testImporters.py | testImporters.py | py | 14,785 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "api.model.Game",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "api.model.Player",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "api.model.Team",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "api.DB.session.add",
... |
133940266 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 13 17:02:36 2016
@author: danielvillarreal
"""
from __future__ import print_function
import numpy as np
from PIL import Image
import imtools as it
import matplotlib.pyplot as pl
from sklearn import cluster,svm,metrics
import tabulate as tab
from sk... | null | Exercises/Exercise_8/Classify_CIFAR10.py | Classify_CIFAR10.py | py | 4,231 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cifar_test.load_cifar10",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "imtools.FastRegionHog",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.appen... |
314275452 | #!/usr/bin/env python
# -*- coding:gb18030 -*-
"""
File : test_bert_seq2seq_model_parallel.py
Author: zhanghao55@baidu.com
Date : 21/01/05 19:29:27
Desc :
"""
import os
import sys
import logging
import numpy as np
import torch
import unittest
from torch.utils.data import Dataset, DataLoader
from torch.util... | null | text_utils_v2/examples/torch/test_bert_seq2seq_model_parallel.py | test_bert_seq2seq_model_parallel.py | py | 8,387 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"l... |
634664353 | from sqlalchemy import Column, Integer, LargeBinary, Text
from sqlalchemy.orm import (
scoped_session,
sessionmaker,
)
from sqlalchemy.ext.declarative import declarative_base
from zope.sqlalchemy import ZopeTransactionExtension
from .ext import colander_ext
DBSession = scoped_session(sessionmaker(extension... | null | c2cgeoform/models.py | models.py | py | 622 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.orm.scoped_session",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "zope.sqlalchemy.ZopeTransactionExtension",
"line_number": 10,
"usage_type": "ca... |
110266249 | import numpy as np
from envs import GridWorldEnv, MGEnv, Agent
from config import get_config
import matplotlib
matplotlib.rc('xtick', labelsize=15)
matplotlib.rc('ytick', labelsize=15)
matplotlib.rc('axes', labelsize=15)
import matplotlib.pyplot as plt
plt.rcParams['agg.path.chunksize'] = 10000
def plot_error(error,... | null | FriendQ.py | FriendQ.py | py | 6,228 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.rc",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
... |
89240043 | #!/usr/bin/env python
import website.bigfoot.models as models
from website.bigfoot.utils import siteaction, ajaxian, dataplus, mailman, config
import datetime
def handle(request):
try:
myself = siteaction.getLoggedInUser(request)
if not myself:
return ajaxian.getFailureResp('not_logged... | null | website/bigfoot/ajax/me_joincommunity.py | me_joincommunity.py | py | 4,038 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "website.bigfoot.utils.siteaction.getLoggedInUser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "website.bigfoot.utils.siteaction",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "website.bigfoot.utils.ajaxian.getFailureResp",
"line_number":... |
430807402 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not... | null | horizon/openstack_dashboard/dashboards/monitor/operationDiary/views.py | views.py | py | 3,217 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "horizon.tables.DataTableView",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "horizon.tables",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "openstack_dashboard.dashboards.manage.operationDiary.tables.OperationDiaryTable",
"line_numb... |
381475658 | import torch
class Config(object):
def __init__(self):
self.embedding_size = 768
self.hidden_size = 1024
self.num_layers = 2
self.tag_size = 10
self.bert_path = "../chinese_wwm_ext_pytorch"
self.use_cuda = False
self.device = torch.device("cuda" if ... | null | config.py | config.py | py | 451 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.device",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
}
] |
601064815 | #!/usr/bin/env python
import pika
import os
import time
from .battle_server import BattleServer
from .query_server import QueryServer
from .pokedex import Pokedex
def setup(connection):
pokedex = Pokedex(os.getenv("REDIS_URL"))
battle_server = BattleServer(os.getenv("BATTLE_QUEUE"), pokedex)
query_server... | null | backend/backend/__main__.py | __main__.py | py | 1,133 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pokedex.Pokedex",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "battle_server.BattleServer",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
... |
478034144 | import sys,re
from collections import deque
t = int(input())
for _ in range(t):
query = list(input().strip())
n = int(input())
input_ = sys.stdin.readline()
l = re.split("\[|\]|,|\n", input_)
l = deque(l[1:-2])
#0처리
Error = False
if n==0:
for v in query:
if v=="D":
... | null | Gold5/AC.py | AC.py | py | 893 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stdin.readline",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "re.split",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line... |
198715359 | import boto3
from datetime import datetime
from pytz import timezone
pst = timezone('America/Los_Angeles')
time = datetime.now(pst)
region = 'us-east-1'
instances = ['i-0b96576b705bda04b']
ec2 = boto3.client('ec2', region_name=region)
def lambda_handler(event, context):
ec2.start_instances(InstanceIds=instances)
... | null | minecraftStart/lambda_function.py | lambda_function.py | py | 436 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pytz.timezone",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "boto3.client",
... |
601563132 | # Decode A Web Page
'''
This is the first 4-chili exercise of this blog!
We’ll see what people think, and decide whether or not to
continue with 4-chili exercises in the future.
Exercise 17 (and Solution)
Use the BeautifulSoup and requests Python packages to print out a list of all
the article titles on the web... | null | Exercise-17.py | Exercise-17.py | py | 710 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
}
] |
566297967 | import requests
import json
from dateutil.parser import parse as dateutil_parse
import datetime
from datetime import timezone
now_dt = datetime.datetime.now(tz=timezone.utc)
path_Dhkim = "Dhkim.txt"
path_Len = "Len.txt"
jw = "jw.txt"
with open(path_Dhkim, 'r') as fp:
data_Dhkim = fp.read().strip()
with open... | null | inform_fine.py | inform_fine.py | py | 1,697 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "datetime.timezone.utc",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "... |
480242516 | #!/usr/bin/python
##########################################################
#
# Top-level utility for creating/loading tweets,
# reviewing them, and deciding whether to actually
# send them out.
# Support to keep the current generated list saved offline
# to quickly pick up where you left off (vs generating
# a new li... | null | tweet_generater_top.py | tweet_generater_top.py | py | 3,958 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"li... |
12330934 | from keras import Model
from keras.applications import ResNet50
from keras.losses import categorical_crossentropy
from keras.optimizers import Adam
from src.parameters.metrics import all
class ResNet50Network:
def __init__(self):
self.classes = None
self.optimizer = Adam()
self.loss = cat... | null | src/keras_model/resnet50_network.py | resnet50_network.py | py | 1,130 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "keras.optimizers.Adam",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "keras.losses.categorical_crossentropy",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "src.parameters.metrics.all",
"line_number": 14,
"usage_type": "call"
},
{... |
442477154 | from functools import reduce
from multiprocessing import Pool
import requests
from html2markdown import convert
from pyquery import PyQuery
from readability import Document
from datetime import datetime
def pq(url):
try:
p = PyQuery(url)
except Exception:
print(f'{url} is broken down')
... | null | spider/main.py | main.py | py | 3,604 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyquery.PyQuery",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyquery.PyQuery",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "requests.get",
"... |
263478687 | #!/usr/bin/env python3
import argparse
import json
import os
import git
import pathlib
import shutil
import psutil
import logging
from datetime import datetime
from benchmarks.pgbench import PgBench
from benchmarks.runner import BenchmarkRunner
from collectors.collectd import CollectdCollector
from collectors.system... | null | client/perffarm-client.py | perffarm-client.py | py | 8,007 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3... |
279741365 | # ---------------------------------------------------------------------------------------
# Image Captioning using the Transformer network
# ---------------------------------------------------------------------------------------
from keras.layers import Embedding, TimeDistributed, Dense, Input, Lambda
import keras.back... | null | test.py | test.py | py | 1,062 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "keras.layers.Embedding",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "external.attention_is_all_you_need.transformer.GetPosEncodingMatrix",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "external.attention_is_all_you_need.transformer",
"... |
19547218 | import argparse
import abstract.exceptions as exceptions
import settings
parser = argparse.ArgumentParser(settings.COMMAND_HELP_TEXT)
sub_parser = parser.add_subparsers(dest='command')
registered_commands = {}
class BaseCommandMeta(type):
def __new__(mcs, name, bases, class_dict):
required_attributes =... | null | abstract/base_command.py | base_command.py | py | 1,712 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "settings.COMMAND_HELP_TEXT",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "abstract.exceptions.CommandException",
"line_number": 57,
"usage_type": "attribute"... |
599728283 | import json
import boto3
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Contact')
def lambda_handler(event, _):
return handle_rest(event, handle_get, handle_post)
def handle_rest(event, get_fun, post_fun):
if event.get("httpMethod") is not None:
if event.get("httpMethod") ==... | null | lambdas/contacts.py | contacts.py | py | 1,042 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "boto3.resource",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 4... |
228301231 | import pytest
import time
from pages.login_page import LoginPage
from .pages.product_page import ProductPage
from .pages.cart_page import CartPage
link = "http://selenium1py.pythonanywhere.com/catalogue/the-shellcoders-handbook_209/?promo=newYear"
class TestUserAddToCartFromProductPage(object):
@pytest.fixture(... | null | test_product_page.py | test_product_page.py | py | 2,531 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pages.login_page.LoginPage",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"... |
130950525 | """
Module for making rig controls
"""
import maya.cmds as mc
class Control():
"""
"""
def __init__(self, prefix = 'new', scale = 1.0, translateTo = '', rotateTo = '', parent = '', shape = 'circle', lockChannels = ['s', 'v']):
"""
:param prefix: str, prefix to name new o... | null | rigLib/base/control.py | control.py | py | 2,401 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "maya.cmds.circle",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "maya.cmds.group",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_numb... |
58281438 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlite3
import logging
from datetime import datetime
from circuits import Component
class UserManager(Component):
channel = "bot"
logger = None
bot = None
db_conn = None
def init(self, bot, dbfile):
"""Initializes the logging and set... | null | pancakesbot/users.py | users.py | py | 9,432 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "circuits.Component",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetim... |
482619083 | import time
import pygame
import numpy as np
class Window:
def __init__(self, number, block_size, speed=0.5, expansion=2):
pygame.init()
self.speed = speed
self.number = number
self.block_size = int(block_size * expansion)
self.background_size = (int(self.number + 4)*self.b... | null | snake/window.py | window.py | py | 3,510 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
642511767 | import pygame
from pygame.sprite import Sprite
class Bullet(Sprite):
def __init__(self, ai_setting, screen, ship):
super(Bullet, self).__init__()
self.screen = screen
# 先設定一個子彈地矩形框,再放置位置
self.rect = pygame.Rect(0,0,ai_setting.bullet_width,
ai_setti... | null | pygame/bullet.py | bullet.py | py | 1,016 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.sprite.Sprite",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pygame.Rect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.draw.rect",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"l... |
227620024 | # Put all dashboards in the current directory to tenant/environment specified via command line argument.
#
# CAUTIONS:
#
# Use PATH_PREFIX to reference the SOURCE path to files.
#
# The file name is assumed to be the dashboard id.
import requests, ssl, os, sys, glob
def putDashboard(env, token, id, payload):
... | null | put_all_dashboards.py | put_all_dashboards.py | py | 2,049 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.put",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "ssl.SSLError",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line... |
359295836 | ''' Write a program that takes a filename and a parameter n
and prints the n most common words in the file,
and the count of their occurrences, in descending order.
'''
# read the input file
def readfile(file):
dict = {}
with open('vshort.txt', 'r') as f:
lst = []
for line in f:
word... | null | albums/3/challenge70_easy/code.py | code.py | py | 1,318 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.OrderedDict",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 56,
"usage_type": "call"
}
] |
587422759 | from colorama import Fore
import random
START = 0
STOP = 9999
max_num = 50
comparisons = 0
while_loop_execute = []
def insertion_sort(numbers):
global comparisons
global while_loop_execute
if(numbers):
print(Fore.RED+"",end="")
print(*numbers,sep=" ")
for i in range(1,len... | null | Sortings Algorithms/InsertionSort/Python/Analysis/basic.py | basic.py | py | 1,145 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "colorama.Fore.RED",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "colorama.Fore.GREEN",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "coloram... |
650770003 | # Export data to MySQL
# Command line argument - Path of the file
import sys,pymysql
import GlobalConfiguration
#Database Credentials
db_name =GlobalConfiguration.db_name
db_host = GlobalConfiguration.db_host
db_port = 3306
db_user = GlobalConfiguration.db_user
db_password = GlobalConfiguration.db_password
# Connect t... | null | ExportToMySQL.py | ExportToMySQL.py | py | 1,941 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "GlobalConfiguration.db_name",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "GlobalConfiguration.db_host",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "GlobalConfiguration.db_user",
"line_number": 10,
"usage_type": "attribute... |
185931858 | '''
Created on Feb 6, 2014
@author: mendt
'''
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPFound
from vkviewer import log
from vkviewer.python.models.messtischblatt.Messtischblatt import Messtischblatt
from vkviewer.python.models.messtischblatt.MdCore import MdCore
from vkviewer.python.m... | null | vkviewer/python/views/utils/GetMapProfile.py | GetMapProfile.py | py | 2,048 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "vkviewer.log.info",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "vkviewer.log",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "vkviewer.python.views.utils.GetPermalink.createPermalink",
"line_number": 28,
"usage_type": "call"
},
... |
295969298 | __author__ = 'Bene'
from mininet.net import *
from mininet.node import OVSController, RemoteController
import requests
import json
from requests.auth import *
class ControllerSetup(object):
@classmethod
def returnController(cls, ip='127.0.0.1', port=6633):
return RemoteController('c0', ip, int(port))... | null | controllerHelper.py | controllerHelper.py | py | 2,113 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mininet.node.RemoteController",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.delete",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "requests.... |
489141439 | # Some imports - - -
import matplotlib.pyplot as plt # to plot figures
import numpy as np # for scientific computing
import pandas as pd # for data visualisation
from scipy.optimize import minimize # for training
# Settings - - -
plt.rcParams.update({'figure.max_open_warning': 0})
pd.set_option('display.max_rows', 30... | null | main.py | main.py | py | 7,641 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"... |
158462315 | # Create your views here.
from django.http import HttpResponse
#from utils.jinja import render_to_response
from sutton.settings import MEDIA_URL, CONTACT_EMAIL_RECIPIENTS
from django.shortcuts import render_to_response
# get the base URL from the Site model
from django.contrib.sites.models import Site
current_site... | null | apps/contact/views.py | views.py | py | 2,213 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.sites.models.Site.objects.get_current",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.contrib.sites.models.Site.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.sites.models.Site",
"line_n... |
80080988 | from statistics import mean
import matplotlib.pyplot as plt
import numpy as np
def separe(liste):
n = len(liste)
liste_rouge = np.zeros((n,2),dtype = int)
liste_verte = np.zeros((n,2),dtype = int)
liste_bleue = np.zeros((n,2),dtype = int)
liste_rouge[0] = 1
liste_verte[0] = 1
liste_bleue[0... | null | tracercarniv.py | tracercarniv.py | py | 3,586 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.zeros",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 28... |
355489016 | """Perform Geweke testing to verify correctness of inference.
Based on "Getting it right",
Geweke (2012), Journal of the American Statistical Association.
Useful insight about coding from Roger's and Jon's implementation.
"""
import possible_worlds_model as pwm
import setup_params
import numpy as np
import matplotl... | null | code/geweke.py | geweke.py | py | 5,583 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.show",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "mat... |
605509696 | import requests
url = "https://httpbin.org/headers"
headers = {
"accept": "application/json",
"x-foo": "Bar",
"x-bar": "Foo",
"quoted-value": "\"quoted\" 'string'"
}
response = requests.get(url, headers=headers)
print(response.text) | null | src/targets/python/requests/fixtures/headers.py | headers.py | py | 252 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
}
] |
542210032 | from rest_framework import viewsets, status, mixins
from rest_framework.decorators import detail_route, list_route
from rest_framework.response import Response
from apps.core.models import User
from apps.core.views import BaseLoginRequired
from .serializers import ConversationSerializer, MessageSerializer
from .models ... | null | pelin_api/apps/message/views.py | views.py | py | 3,964 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "apps.core.views.BaseLoginRequired",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "rest_framework.mixins.RetrieveModelMixin",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.mixins",
"line_number": 12,
"usage_type": ... |
504057263 | import sys
import scipy.io.wavfile
import numpy as np
import matplotlib.pyplot as plt
def pick_peak(data):
peaks_val = []
peaks_index = []
for i in range(2, data.size):
if data[i-1] - data[i-2] >= 0 and data[i] - data[i-1] < 0:
peaks_val.append(data[i-1])
peaks_index.append(i-1)
max_index = pea... | null | autocorrelation.py | autocorrelation.py | py | 770 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.wavfile.io.wavfile.read",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile.io",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name"... |
265470469 | # coding: utf-8
'''
Created on 06/09/2011
@author: eneldoserrata
'''
from django.template.context import RequestContext
from django.shortcuts import render_to_response
from django.http import HttpResponse
from marcos.decorators import ajax_login_required
from marcos.companias.models import Compania, Sucursal
from djan... | null | src/marcos/companias/views.py | views.py | py | 2,971 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.shortcuts.render_to_response",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.template.context.RequestContext",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "marcos.decorators.ajax_login_required",
"line_number": 20,
"us... |
103949515 | #!/usr/bin/env python
# coding: utf-8
import enlighten
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from os.path import join, exists
#from sklearn.experimental import enable_halving_search_cv
#from sklearn.model_selection import HalvingGridSearchCV#, train_test_split
fr... | null | 2.5SpectralBiclustering-nofmri.py | 2.5SpectralBiclustering-nofmri.py | py | 7,070 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.today",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "seaborn.set",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
319084125 | import contextlib
import os.path
import socket
import re
import sys
import traceback
from advocate import RequestsAPIWrapper
class DisallowedConnectException(Exception):
pass
class CheckedSocket(socket.socket):
CONNECT_ALLOWED_FUNCS = {"validating_create_connection"}
# `test_testserver.py` makes raw co... | null | test/monkeypatching.py | monkeypatching.py | py | 3,140 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "socket.socket",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "contextlib.contextmanager",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.basename",
"line_number": 32,
"usage_type": "call"
},
{
"api_name"... |
334896375 | # -*- coding: utf-8 -*-
import ast
import datetime
import itertools
import json
import re
from collections import deque, namedtuple
import pymysql
import redis
import requests
import scrapy
import yagmail
from new_spider.items import TbtmStockItemLoader, TbtmStockItem, NewSpiderOneItem, NewSpiderOneItemLoader
class... | null | new_spider/spiders/ali_add.py | ali_add.py | py | 8,500 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scrapy.Spider",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.DOTALL",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_n... |
265831302 | import torch
import torch.nn as nn
import SOC_Data
import random
import pickle
import Pytorch_Utils
class SOC_Loss():
def __init__(self,):
self.scale1 = 0
self.scale2 = 0
self.scale3 = 100
self.mse_loss = nn.MSELoss()
def criterion(self,soc_est,soc_gt):
# err = soc_est... | null | DDP/SOC_Network.py | SOC_Network.py | py | 5,934 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.MSELoss",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_n... |
154695807 | from PyQt5.QtWidgets import QMainWindow, QFileDialog
from window import Ui_MainWindow
from rec_sys.semantic import semantic_distance
from rec_sys.colaboratif import colaboratif_distance
from rec_sys.hybrid import WHybrid, MixHybrid
from rec_sys.read_csv import load_data
from rec_sys.metrics import save_dist_matrix, loa... | null | application.py | application.py | py | 4,685 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "window.Ui_MainWindow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QFileDialog.getOpenFileName",
"line_number": 41,
"usage_type": "call"
... |
285354580 | # -*- coding: utf-8 -*-
"""
a simple genetic algorithm
"""
import numpy as np
import time
from math import log
import logging
logger = logging.getLogger(__name__)
class GeneticAlgorithm():
"""a simple genetic algorithm used to select bespoke turbine locations
"""
def __init__(self, bits, bounds, variabl... | null | reV/bespoke/gradient_free.py | gradient_free.py | py | 12,015 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_num... |
605758674 | from flask import render_template
from flask import Markup
import base64
from app import *
@app.route("/")
def index():
var = Tools.getEnviromentVar()
user = Git.getGithubUser(var['GITSPEAKER_GH_USERNAME'], var['GITSPEAKER_GH_PASSWORD'])
repository = Git.getRepository(user, var['GITSPEAKER_GH_REPOSITORYNAME... | null | app/views.py | views.py | py | 1,241 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "base64.b64decode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.Markup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.route",
"... |
350623648 | from django.shortcuts import render,redirect
from django.shortcuts import HttpResponse
from django.contrib.auth import authenticate,login
from django.contrib.auth.decorators import login_required
from .forms import LoginForm,UserRegistrationForm
from .forms import LoginForm,ImageForm
from django.contrib import messages... | null | account/views.py | views.py | py | 2,161 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "forms.LoginForm",
"line_number": 15,
"usage_type": "call"
},
{
... |
57117235 | import numpy as N
import pandas as pd
import scipy.interpolate as I
import scipy.special as S
import scipy.optimize as O
#Linear correlation function with Planck cosmology at z=0.1
xifile = '/gpfs/data/nmccull/emocks/xilin_planck_z0.1_113016.txt'
wp_sdss=pd.DataFrame({'wp m1':[2615, 1189, 728, 491.4, 272.8, 154.4, 11... | null | analysis_tools_pd.py | analysis_tools_pd.py | py | 12,979 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.arctan",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "numpy.polyfit",
"line... |
591908933 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='IsStallOccupied',
fields=[
('IS... | null | wsgi/myproject/isstalloccupied/migrations/0001_initial.py | 0001_initial.py | py | 605 | python | en | code | null | code-starcoder2 | 83 | [
{
"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.CreateModel",
"line_number": 14,
"usage_type": "call"
},
... |
164800211 | import sys
from collections import deque
MAX_LENGTH = 1000000
N, K = map(int, sys.stdin.readline().split())
def bfs():
queue = deque()
queue.append([N, 0])
visited = [False for _ in range(MAX_LENGTH + 1)]
while queue:
n, count = queue.popleft()
visited[n] = True
left, right, du... | null | BOJ/hide_and_seek.py | hide_and_seek.py | py | 742 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stdin.readline",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 7,
"usage_type": "call"
}
] |
624318341 | import numpy as np
import cv2
import func as f
from matplotlib import pyplot as plt
img1 = cv2.imread('1.jpg',0) # queryImage
img2 = cv2.imread('2.jpg',0) # trainImage
H=f.findAffineTransform(img1,img2)
#NOT FINISHED!
cameraMatrix= np.zeros((3,3,1),np.uint8)
cameraMatrix[:]=1
(rows, cols) = img1.shape
R= ... | null | matching/test.py | test.py | py | 590 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "func.findAffineTransform",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_n... |
8059760 | # Copyright 2019 Lorna 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 appli... | null | gan_mnist.py | gan_mnist.py | py | 8,094 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"li... |
549552502 | # -*- coding: utf-8 -*-
import re
import pymysql
from os import path
import time
db = {
"host":"host",
"user":"user",
"password":"password",
"db":"db",
"charset":"utf8",
}
domain = "http://www.abc.com"
fileSize = path.getsize('1.log')
log = open('1.log','r',encoding='UTF-8')
connection = pymysql... | null | Python3/分析Web日志.py | 分析Web日志.py | py | 1,359 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.getsize",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pymysql.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.strptime",
"line_num... |
347985834 | import uuid
import json
from api.pg_utilities import execute_query, execute_non_query
from api.utilities import DuplicateInsertError, ObjectDoesNotExistError, DetailedValueError, DetailedIntegrityError, \
validate_uuid, validate_utc_datetime, get_correlation_id, get_logger, error_as_response_body, now_with_tz
from ... | null | api/user_task.py | user_task.py | py | 7,352 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "api.utilities.DetailedValueError",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "api.pg_utilities.execute_query",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "api.utilities.validate_uuid",
"line_number": 43,
"usage_type": "call"
}... |
293635634 | # Copyright (c) 2021 SUSE LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 3 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; witho... | null | harvester_e2e_tests/fixtures/network.py | network.py | py | 3,491 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "harvester_e2e_tests.utils.poll_for_update_resource",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "harvester_e2e_tests.utils",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 29,
"usage_type": "call"
}... |
115353057 | import pandas as pd
import aux
import code1_data as code1
import code0_parameter as code0
import pyprind,os
import sys
def read_asssistment2009_data_from_csv(dp):
if os.path.exists(dp.processedFileName):
print ("==> read ",dp.processedFileName)
data = pd.read_csv(dp.processedFileName)
secN... | null | uril_assistment2009.py | uril_assistment2009.py | py | 3,131 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.exists",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "aux.stastic_SecNumber_Use... |
582507851 |
# coding: utf-8
# In[30]:
import importlib
import sys
sys.path.insert(0, '/cndd/fangming/CEMBA/snmcseq_dev')
from __init__ import *
from __init__jupyterlab import *
from scipy import sparse
import collections
# import itertools
# import re
# import fbpca
# import pickle
# import scipy.cluster.hierarchy as sch
# fr... | null | fig4/cocluster-second-round.py | cocluster-second-round.py | py | 7,683 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.insert",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "importlib.reload",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "importlib.reload",
"... |
185919493 | from setuptools import setup, find_packages
import os, sys
# version = __import__('rtorrent').__version__
required_pkgs = []
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating Sys... | null | setup.py | setup.py | py | 1,017 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "setuptools.setup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 30,
"usage_type": "call"
}
] |
266916922 | # Copyright 2019 Regents of the University of Minnesota.
#
# 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 l... | null | python/mtap/io/serialization.py | serialization.py | py | 12,213 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "mtap.events.Event",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "mtap.events.Document"... |
252953348 | import jwt, datetime
class JWT:
@staticmethod
def get_secret():
return "81e2d601370a4e60a47f389757f4b06d"
@staticmethod
def get_algo():
return "HS256"
@staticmethod
def generate_token(payload):
secret = JWT.get_secret()
algo = JWT.get_algo()
payload["ex... | null | backend/util.py | util.py | py | 807 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "datetime.timedelta",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "jw... |
543239869 | import os
import math
import cv2
listing = os.listdir("dataset/2")
count = 1
for file in listing:
video = cv2.VideoCapture("dataset/2/" + file)
success,image = video.read()
count_frame = 0
success = True
os.makedirs("image/2/video_" + str(int(count)))
while success:
if (count_frame % 50... | null | video_frames_extractor.py | video_frames_extractor.py | py | 661 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number":... |
294478599 | # -*- coding: utf-8 -*-
from odoo import api, fields, models, _
import base64, datetime
from datetime import timedelta
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
HOURS_PER_DAY = 8
from odoo.exceptions import ValidationError
from dateutil.relativedelta import relativedelta
class ExtendLeave(models.Transient... | null | Medical_09122019/hr_leaves_solution/wizard/leave_extension.py | leave_extension.py | py | 7,185 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "odoo.models.TransientModel",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "odoo.fields",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "datetime.... |
605502486 | from j14 import data_read
import random
import matplotlib.pyplot as plt
class Instance():
def __init__(self):
self.successors=[]
self.job_num_successors=[]
self.job_predecessors = []
self.job_successors=[]
self.job_model_resource={1:{1:[0,0,0,0]},14:{1:[0,0,0,0]}}
sel... | null | 备份/Instance.py | Instance.py | py | 13,738 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "j14.data_read.dataStore",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "j14.data_read",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "random.choice",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "random.choice",
... |
82247976 | from constants import Urls
from constants import Keys
from tools import Tools
import urllib.parse
from logger import logger
class Twitch(object):
def __init__(self):
self.tool = Tools()
def get_featured(self):
featured = self.tool.get_json(Urls.FEATURED)
featured_list = featured["featu... | null | api.py | api.py | py | 3,235 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tools.Tools",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "constants.Urls.FEATURED",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "constants.Urls",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "constants.Urls... |
302653737 | import uuid
from twisted.python import components
from zope.interface import implements, classProvides
from feat.agencies import common
from feat.agents.base import replay
from feat.common import log, defer, time
from feat.common import container, serialization, error_handler
from feat.agencies.interface import *
fr... | null | src/feat/agencies/protocols.py | protocols.py | py | 6,469 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "zope.interface.implements",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "zope.interface.implements",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "feat.common.log.Logger",
"line_number": 57,
"usage_type": "attribute"
},
{
"a... |
170371865 | from .base import FunctionalTest
from selenium.webdriver.support.ui import Select
from .initialization import Initialization
class NewVisitorTest(FunctionalTest):
def setUp(self):
super().setUp()
Initialization.run()
def test_can_see_list_of_vehicles_and_visit_car_page(self):
url = ... | null | functional_tests/test_list.py | test_list.py | py | 1,283 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "base.FunctionalTest",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "initialization.Initialization.run",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "initialization.Initialization",
"line_number": 11,
"usage_type": "name"
},
{
... |
3086499 | import requests
import json
def make_gist(contents, time_string):
r = requests.post('https://api.github.com/gists',
data=json.dumps({
'description': 'Comments for entry on %s' % time_string,
'public': False,
'files... | null | post_gist.py | post_gist.py | py | 672 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.post",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
}
] |
295714766 | from parsel import Selector
import requests as req
import re
campeonatos = {
'paulista2019':'http://www.saopaulofc.net/equipe/temporada/campeonato-paulista-2019',
'brasileiro2019':'http://www.saopaulofc.net/equipe/temporada/campeonato-brasileiro-2019',
'paulista2020':'http://www.saopaulofc.net/equipe/temp... | null | project/scrapper.py | scrapper.py | py | 3,325 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "parsel.Selector",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 42,
... |
112092999 | """Provide dependency graph"""
import itertools
import miasm2.expression.expression as m2_expr
from miasm2.core.graph import DiGraph
from miasm2.core.asmbloc import asm_label
from miasm2.expression.simplifications import expr_simp
from miasm2.ir.symbexec import symbexec
from miasm2.ir.ir import irbloc
class Dependenc... | null | miasm2/analysis/depgraph.py | depgraph.py | py | 20,347 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "itertools.product",
"line_number": 194,
"usage_type": "call"
},
{
"api_name": "miasm2.core.graph.DiGraph",
"line_number": 218,
"usage_type": "call"
},
{
"api_name": "miasm2.core.graph.DiGraph",
"line_number": 230,
"usage_type": "call"
},
{
"api_name... |
469124958 | # Models
from coltrane.models import Photo
# Text and misc
import os
import sys
import urllib
import datetime
from coltrane import utils
from django.utils.encoding import smart_unicode
# Logging
import logging
logger = logging.getLogger(__name__)
class FlickrError(Exception):
def __init__(self, code, message):
... | null | coltrane/utils/flickr.py | flickr.py | py | 4,920 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib.urlencode",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "coltrane.utils.getjson",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "coltrane.ut... |
296500973 | # 当urllib.urlopen一个https的时候会验证一次SSL证书,当目标使用的是自签名的证书时就会爆出该错误消息
import ssl
import urllib.request
ssl._create_default_https_context = ssl._create_unverified_context
# 普通用法
# response = urllib.request.urlopen('https://www.python.org')
# print(type(response))
# print(response.status)
# print(response.getheaders())
# print... | null | 3_1_urllib.py | 3_1_urllib.py | py | 1,348 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ssl._create_default_https_context",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "ssl._create_unverified_context",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "http.cookiejar.cookiejar.CookieJar",
"line_number": 34,
"usage_t... |
215406760 | #!/usr/bin/python3
import sys
import json
import requests
import time
import socket
# need time for ngrok to start up before requesting data
time.sleep(15)
# acquires the Ngrok https url
def get_ngrok_url():
url = "http://localhost:4040/api/tunnels"
res = requests.get(url)
res_unicode = res.content.decod... | null | plexurl.py | plexurl.py | py | 1,552 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.sleep",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "socket.gethostbyname",
"line_n... |
362327223 | import random
from discord.ext import commands
class People:
"""Signature things we have said"""
def __init__(self, bot):
self.bot = bot
@commands.command(description="Something Ava says a lot",
brief="THE AVA THING")
async def ava(self):
possible_responses = [... | null | people.py | people.py | py | 6,853 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.choice",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.command",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "rando... |
234704620 |
# coding: utf-8
# ## Import fine SFH from files
# In[1]:
import numpy as np
import scipy.io as sio
import matplotlib.pyplot as plt
import os
import warnings
def import_sfh_fine(fname, sfh_res = 1e-4, vb = False):
full_fname = 'angst_sfhs_all/'+fname+'.angst.fine'
fulldat = np.genfromtxt(full_f... | null | import_sfh_fine.py | import_sfh_fine.py | py | 949 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.amax",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.zeros_like",
"line... |
635562561 |
import requests
import sys
import re
import pandas as pd
from bs4 import BeautifulSoup
from bs4.element import NavigableString, Tag
from u_def import get_tables as gtbl
from u_def import parse_table as ptbl
from u_def import keibaLab_CourseTable as klabtbl
from u_def import UrlRetry as urlget
collist = [
... | null | Strider/Tyokuten.py | Tyokuten.py | py | 4,498 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_... |
480015467 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: GPL-3.0
#
# GNU Radio Python Flow Graph
# Title: NOAA APT Decoder
# Author: Manolis Surligas, George Vardakis
# Description: A NOAA APT Decoder with automatic image synchronization
# GNU Radio version: 3.8.1.0
from gnuradio import analog
from... | null | station/recipes-satnogs/satnogs_noaa_apt_decoder.py | satnogs_noaa_apt_decoder.py | py | 19,272 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "gnuradio.gr.top_block",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "gnuradio.gr",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "gnuradio.gr.top_block.__init__",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": ... |
233675914 | import pickle
import ezgmail
from django.utils.timezone import make_aware
class Service:
def __init__(self, amount_of_letters=10):
self.latest_letters = ezgmail.recent(maxResults=amount_of_letters)
import os
os.environ["Mail_env"] = 'true'
from django.core.wsgi import get_wsgi_app... | null | mail_app/mail_service.py | mail_service.py | py | 2,055 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ezgmail.recent",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ.setdefault",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
... |
377224874 | import cv2
import utils
img = cv2.imread('../data/images/human/3.png')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
surf = cv2.xfeatures2d.SURF_create(400)
keypoints = surf.detect(gray, None)
utils.draw_percent_steps(keypoints, gray, 10)
| null | reid_background_sub_algorithm/features_task/studies/surf.py | surf.py | py | 242 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "cv2.xfeatures2d.SURF_cre... |
258655509 | '''
This file was provided in class and most of the methods were worked in during
class. The task consists of completing the methods for insertion, deletion and
display.
'''
from collections import deque
import numpy as np
import matplotlib.pyplot as plt
# import math
from scipy.interpolate import inte... | null | graph_AL.py | graph_AL.py | py | 10,320 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 102,
"usage_type": "name"
},
{
"api_name": "numpy.linspace",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "numpy.... |
400833592 | import requests
URL = 'https://gen-net.herokuapp.com/api/users/'
response = requests.get(URL)
resultado = response.json()
email = input('Digite o E-Mail do Usuário: ')
for user in resultado:
if user.get('email') == email:
print(user)
| null | aula_1/ex_5.py | ex_5.py | py | 242 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
}
] |
45159230 | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.views import View
from .models import SniperURL
from .forms import SubmitURL
class HomeView(View):
def get(self, request, *args, **kwargs):
submit_form = SubmitURL()
context = {
... | null | sniper/src/shortener/views.py | views.py | py | 1,315 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.views.View",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "forms.SubmitURL",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "forms.Submit... |
61146784 | from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from mock import patch
from bluebottle.payments_beyonic.tests.factory_models import BeyonicPaymentFactory
from bluebottle.test.utils import BluebottleTestCase
beyonic_settings = {
'MERCHANT_ACCOUNTS': [
{
... | null | bluebottle/payments_beyonic/tests/test_views.py | test_views.py | py | 2,346 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bluebottle.test.utils.BluebottleTestCase",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "bluebottle.payments_beyonic.tests.factory_models.BeyonicPaymentFactory.create",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "bluebottle.payments_beyoni... |
36888746 | #misc
from PIL import Image
import matplotlib.pyplot as plt
#torch relted
import torch
import torchvision.transforms as transforms
#imageLoader
def image_loader(image_name,device,imsize):
image = Image.open(image_name)
transform = transforms.Compose([
transforms.CenterCrop(imsize),
# transfo... | null | dataset.py | dataset.py | py | 1,047 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torchvision.t... |
175081827 | #!/usr/bin/python3.5
from flask import Flask, send_file, url_for, jsonify, request
from flask_sqlalchemy import SQLAlchemy
from flask_script import Manager, Shell
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy_searchable import make_searchable, search
from sqlalchemy_utils.types import TSVector... | null | app/models.py | models.py | py | 8,400 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlalchemy_searchable.make_searchable",
"line_number": 17,
"usage_type": "call"
... |
564587645 | # -*- coding: UTF-8 -*-
"""
FileName: serialtool.py
Author: jiaminbit@sina.com
Create date: 2017.6.20
description: 串口调试工具
Update date:2017.7.20
version 1.0.0
"""
from PyQt5.QtWidgets import QDialog
import serial
import serial.tools.list_ports
from serialwindow import *
import threading
import time
import log
class Se... | null | serialtool.py | serialtool.py | py | 3,736 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "serial.Serial",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "serial.tools.list_ports.comports",
"line_number": 31,
"usage_type": "call"
},
{
"api_name":... |
75760181 | # Copyright 2016 Capital One Services, LLC
#
# 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... | null | c7n/resources/vpc.py | vpc.py | py | 18,607 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "c7n.query.QueryResourceManager",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "c7n.query.ResourceQuery.resolve",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "c7n.query.ResourceQuery",
"line_number": 27,
"usage_type": "name"
},
{... |
367390357 | import shutil
import os
from decl_match_metric import calc_decl_match_one_pair, trunctate_json, dump_conflict
import argparse
from collections import defaultdict
import json
import csv
DATA_FOLDER = "data"
if os.path.exists(DATA_FOLDER):
shutil.rmtree(DATA_FOLDER)
os.mkdir(DATA_FOLDER)
#======================= c... | null | tools/DeclMatch/golden_check.py | golden_check.py | py | 4,346 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.exists",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "shutil.rmtree",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number... |
286095300 | from flask import Flask, render_template, request, redirect, url_for, flash, jsonify
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Base, Restaurant, MenuItem
import lotsofmenu
app = Flask(__name__)
engine = create_engine('sqlite:///restaurantmenu.db')
Base.me... | null | udacity_flask.py | udacity_flask.py | py | 5,103 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "database_setup.Base.metadata",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": ... |
53534425 | # https://atcoder.jp/contests/abc132/tasks/abc132_e
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
n,m=map(int,input().split())
E=[[] for _ in range(3*n)]
for _ in range(m):
u,v=map(int,input().split())
u-=... | null | ABC132/e_hopscotch_addict.py | e_hopscotch_addict.py | py | 781 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collections.dequ... |
177500236 | import pygame as pg
pg.init()
width = 640
height = 480
screen = pg.display.set_mode((width, height))
pg.display.set_caption("move with arrow keys (escape key to exit)")
white = (255, 255, 255)
background = pg.Surface(screen.get_size())
background.fill(white)
sprite = pg.image.load("speedship.png")
sprite_rect = spr... | null | soManyTests.py | soManyTests.py | py | 1,162 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
499225620 | # Author: Deepak Pathak (c) 2016
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# from __future__ import unicode_literals
import numpy as np
from numpy import newaxis
from PIL import Image
import time
import argparse
import pyflow
from matplotlib import pyp... | null | of.py | of.py | py | 2,013 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"l... |
356128131 | import torch
from torch import nn
import torchvision
from torch.nn.utils.rnn import pack_padded_sequence
from utils import selfAttention
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# 1st, we need a image feature extractor. Initial: out_image_size, Input: image, Output: image featur... | null | model_dual_lstm_7.py | model_dual_lstm_7.py | py | 20,668 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.device",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
... |
46218966 | import os
import decimal
from datetime import date, timedelta, datetime, time
from django import forms
from django.test import TestCase
from django.db.models import signals
from django.test.utils import override_settings
from django.core.cache import caches
from django.core.files.uploadedfile import SimpleUploadedFile... | null | tests/test_types.py | test_types.py | py | 10,566 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.core.cache.caches",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "django.test.TestCase",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "dynamic_preferences.types.IntPreference",
"line_number": 32,
"usage_type": "attribute"
},... |
367883699 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ClientからOpenCV画像データを受け取り、ライン検出して制御命令を送る
# Server: Jetson TX2
# Client: Jetson TX2/Raspberry Pi3 Docker
# 先にServerを起動する
'''
Python 3.6
送信するmessageは.encode('ascii')や.encode('utf-8')等でエンコードする必要がる
ここではClientから送られてくるOpenCV BGR画像データが'ascii'に変換されているので'ascii'で統一している
'''
... | null | site/07.level2_demo_socket/pc_server/server.py | server.py | py | 11,539 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "socket.socket",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",... |
84156454 | # Copyright (c) 2021 Chanjung Kim. All rights reserved.
# Licensed under the MIT License.
from absl import app
from absl import flags
from pathlib import Path
from os import path, listdir
from unet.model import UNet
from dataset import Provider
FLAGS = flags.FLAGS
flags.DEFINE_string("checkpoint", None,
... | null | main.py | main.py | py | 2,171 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "absl.flags.FLAGS",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "absl.flags",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "absl.flags.DEFINE_string",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "absl.flags"... |
573227252 | #!/usr/bin/python3.5
#
# Scope: Programma per ...........
# updated by Loreto: 16-10-2017 16.20.03
# -----------------------------------------------
import sys
import argparse
def ParseInput():
# =============================================
# = Parsing
# =============================================
... | null | _Batch/_defaultProject_Light/Functions/ParseInput.py | ParseInput.py | py | 926 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",... |
4761843 | # 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
# distributed under th... | null | openstackclient/tests/unit/volume/v3/fakes.py | fakes.py | py | 13,242 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cinderclient.api_versions.APIVersion",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cinderclient.api_versions",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 33,
"usage_type": "call"
},
{
... |
338777047 | import argparse
import numpy as np
import pandas as pd
from scipy.stats import spearmanr
from scipy.spatial.distance import cosine
def make_vocab(word_dict, low_threshold, high_threshold):
words = list([i[0] for i in sorted(word_dict.items(), key=lambda t: t[1])])
words = words[
int(low_threshold ... | null | make_pred_fixed.py | make_pred_fixed.py | py | 6,099 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
524816560 | '''
PICASSO PROJECT
---------------
Your job is to make a cool picture.
You must use multiple colors.
You must have a coherent picture. No abstract art with random shapes.
You must use multiple types of graphic functions (e.g. circles, rectangles, lines, etc.)
Somewhere you must include a WHILE or FOR loop to create a ... | null | 7.2_Picasso.py | 7.2_Picasso.py | py | 1,768 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "arcade.open_window",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "arcade.set_background_color",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "arcade.color",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "arca... |
247374414 | # -*- coding: utf-8 -*-
# created by inhzus
from pprint import pprint
from typing import Union, List
from juq.misc.decorators import necessary_params
from juq.misc.request import Request
from juq.serializer import RepoSerializer, RepoDetailSerializer, RepoTocSerializer
def get_user_repos(user_id: Union[int, str], *... | null | juq/handler/repo_handler.py | repo_handler.py | py | 4,390 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Union",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "juq.misc.request.Request.send",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "juq.misc.request.Request",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.