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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
604354195 | import tushare as ts
import pandas as pd
from pymongo import MongoClient
import fushare,json
pd.set_option('display.width', None) # 设置字符显示宽度
pd.set_option('display.max_rows', None) # 设置显示最大行
pd.set_option('display.max_columns', None) # 设置显示最大行
client = MongoClient('localhost', 27017)
pro = ts.pro_api('c0cad8f56c... | null | futures/mainSubmainPosition.py | mainSubmainPosition.py | py | 837 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.set_option",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClien... |
319962469 | #!/usr/bin/env python3
import bs4
import requests
# SIGNS
# https://data.tfl.gov.uk/tfl/syndication/feeds/vms_feed.xml?app_id=8fcf97fe&app_key=2879d557ff39c0a5f15401f7b3a1fd3c
# at Sidcup RD
# <Sign><siteid>06/000714/</siteid><easting>541246.26</easting><northing>173790.24</northing><signtext> 16-21 AUGUST | 2300-... | null | traffin.py | traffin.py | py | 2,112 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"... |
315828988 | from flask import Flask
import pika
import os
import json
app = Flask(__name__)
host_name = os.getenv("RMQ_HOST")
@app.route('/')
def index():
if host_name:
return f"Hello from {host_name} running in a Docker container!"
return 'Couldn\'t grab host_name'
@app.route('/test/<cmd>')
def add(cmd):
... | null | gps-service/app.py | app.py | py | 910 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnection",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters... |
529798444 | # Django settings for maschaswebsite project.
import os
import dj_database_url
PROJECTDIR = os.path.abspath(os.path.dirname(__file__))
ROOTDIR = os.path.join(PROJECTDIR, os.pardir)
DEBUG = os.environ.get('DJANGO_DEBUG', False)
TEMPLATE_DEBUG = DEBUG
ADMINS = (('Dominic Looser', 'dominic.looser@gmail.com'))
MANAGERS ... | null | maschaswebsite/settings.py | settings.py | py | 4,521 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
375260750 | import subprocess
import os
import sys
import json
import codem.db_connect as db_connect
import numpy as np
from codem.query import acause_from_id, model_version_type_id
# grab the arguments passed into the python script
user, model_version_id, db_name, SITE = [
sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]]
... | null | gbd_2017/shared_code/central_comp/cod/codem/codem/prod/kick_off.py | kick_off.py | py | 4,113 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "codem.db_connect.query",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "codem.db_connect",
... |
254371016 | import multiprocessing
import json
import os
import random
from re import finditer
from wordsegment import load, segment
# Store the dataset files in the current directory.
work_dir = os.path.dirname(os.path.realpath(__file__))
# Directories storing functions JSON representation
json_dir = os.path.join(os.... | null | datasets/function_naming/function_naming_train.py | function_naming_train.py | py | 3,400 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_n... |
646916909 | # -*- coding: utf-8 -*-'''
'''
Creado el 20/1/2015
@author: Manuel Gonzalez 11-10390
@author: Leonardo Martinez 11-10576
'''
from datetime import datetime
def obtener_numero(mensaje,msj_invalido,resp_defecto):
'Le pide un numero al usuario, se repite hasta que el usuario lo introduzca'
... | null | Tarea 2[Ing Software]/utiles.py | utiles.py | py | 2,137 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.today",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "dat... |
633970590 | from onsset import *
import matplotlib.pylab as plt
import seaborn as sns
def tech_specifications(discount_rate, grid_generation_cost, grid_power_plants_capital_cost, grid_losses,
mg_hydro_capital_cost, sa_pv_capital_cost_1, sa_pv_capital_cost_2, sa_pv_capital_cost_3,
sa... | null | onsset/funcs.py | funcs.py | py | 10,014 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pylab.rcParams",
"line_number": 159,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pylab",
"line_number": 159,
"usage_type": "name"
},
{
"api_name": "matplotlib.pylab.subplots",
"line_number": 160,
"usage_type": "call"
},
{
"api_... |
216384786 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License... | null | odps/tunnel/tabletunnel/uploadsession.py | uploadsession.py | py | 15,455 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "enum.Enum",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "models.Schema",
"line_number": 48,
"usage_type": "argument"
},
{
"api_name": "six.string_types",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "errors.TunnelError.... |
155736498 | from django.contrib import admin
from django.conf.urls import url
from registry import views
app_name='registry'
urlpatterns = [
url(r'^$',views.index,name='index'),
url(r'^teacherlist/(?P<pk>\d+)/$',views.TeacherDetail.as_view(),name='teacherdetail'),
url(r'^teacherlist/delete/(?P<pk>\d+)/$',views.TeacherDele... | null | School/registry/urls.py | urls.py | py | 1,521 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "registry.views.index",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "registry.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.con... |
642214511 | import pygame
import random
#need the aliens firing bullets properly
#need to lose when aliens land or when lives == 0
#need start up screen
#better graphics - moving aliens
BLACK = (0,0,0)
RED = (255,0,0)
BLUE = (0,0,255)
GREEN = (0,255,0)
WHITE = (255,255,255)
pygame.init()
#######################################... | null | game.py | game.py | py | 9,116 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"... |
376185361 | import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
ch = connection.channel()
ch.exchange_declare(exchange='direct_log', exchange_type='direct')
result = ch.queue_declare(queue='', exclusive=True)
queue = result.method.queue
logs = ('info', 'warning', 'error')
for log in lo... | null | project/direct/info_receiver.py | info_receiver.py | py | 620 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pika.BlockingConnection",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 3,
"usage_type": "call"
}
] |
538611781 | import os
import bossimage
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def readme():
try:
import pypandoc
return pypandoc.convert(source='README.md', to='rst')
except:
with open('README.md') as f:
return f.read()
version ... | null | setup.py | setup.py | py | 1,035 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pypandoc.convert",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bossimage.__version__",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "distutils.core.setup",
"line_number": 45,
"usage_type": "call"
}
] |
386558891 | import json
import httpretty
import requests
from django.core.urlresolvers import reverse
from django.forms import model_to_dict
from model_mommy import mommy
from rest_framework import status
from rest_framework.test import APITestCase
from facefind.core.models import Person
from facefind.core.serializers import P... | null | facefind/core/tests/test_views.py | test_views.py | py | 3,916 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "model_mommy.mommy.make",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "model_mommy.mommy",
"line_number": 19,
"usage_type": "name"
},
{
"api_name... |
521707234 | #!/usr/bin/env python
# http://web.archive.org/web/*/store.steampowered.com/hwsurvey
# http://webcache.googleusercontent.com/search?q=cache:store.steampowered.com/hwsurvey
STEAM_SURVEY = "http://store.steampowered.com/hwsurvey"
def load(url):
from lxml.html import parse
return parse(url).getroot()
def select... | null | systeam.py | systeam.py | py | 1,574 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "lxml.html.parse",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "datetime.tim... |
41587591 | import os
import stat
from pathlib import Path
from typing import Optional, Union
from attr import attrib, attrs
from attr.validators import instance_of, optional
from vistautils.io_utils import CharSink
from vistautils.parameters import Parameters, YAMLParametersWriter
from vistautils.parameters_only_entrypoint impo... | null | pegasus_wrapper/conda_job_script.py | conda_job_script.py | py | 7,107 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "vistautils.parameters.Parameters",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "typing.Option... |
357695030 | # -*- coding:UTF-8 -*-
from sqlalchemy import func, and_, or_, distinct
from database.models import User, Status, Organization, PmsProject, ProjectProperty, ProjectType, PmsProRiskAndLevel, ProjectStage, Message,\
PmsProjectDev, PmsTeam, Menu, OrgType, Permission, FigurePermission, Role, UserRole, PmsUserTask,... | null | services/projectManager/projectMultiManager.py | projectMultiManager.py | py | 41,276 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "database.models.UserRole",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "database.models.Role",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "database.models.Menu",
"line_number": 16,
"usage_type": "argument"
},
{
"ap... |
503058512 | import argparse
from datetime import datetime as dt
import os
import pickle
import time
import api
from settings import (
SUPPORTED_INPUT_FORMATS,
SUPPORTED_OUTPUT_FORMATS,
CITATION_STYLE_HASH,
OUTPUT_FORMAT,
WAIT_FOR_RETRIEVE,
USER_EMAIL,
USER_PASSWORD,
FILES_PICKLE,
)
class ParsedFi... | null | xmlps.py | xmlps.py | py | 8,861 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
450744433 | import getpass
from distutils.util import strtobool
from TM1py.Services import TM1Service
from TM1py.Utils import Utils
## establish PA credentials
pTenant='ctpeu'
pServer='UnitCommitment'
base_url= 'https://' + pTenant + '.planning-analytics.ibmcloud.com/tm1/api/' + pServer
user= "user@what.com"
password= "mypassword... | null | UnitCommitment/model-tm1py.py | model-tm1py.py | py | 11,406 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "TM1py.Services.TM1Service",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "TM1py.Utils.Utils.build_pandas_dataframe_from_cellset",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "TM1py.Utils.Utils",
"line_number": 25,
"usage_type": "nam... |
101702733 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 6 12:58:58 2020
@author: eksalkeld
"""
from data_clean import *
from variable_encoding import *
from feature_selection.py import *
from modeling_fns.py import *
from constants import *
import pandas as pd
#import numpy as np
import xml.etree.ElementTree as ET
import lo... | null | analytics/model_driver.py | model_driver.py | py | 6,031 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHandler",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.Strea... |
78683291 | import urllib
import urllib2
import re
import types
import time, datetime
from django.core.management.base import BaseCommand
from madcrime.models import Incident
from mechanize import Browser
from BeautifulSoup import BeautifulSoup, Tag
from django.utils.encoding import smart_str, smart_unicode
from dateutil import pa... | null | madcrime/management/commands/scrapepd.py | scrapepd.py | py | 7,857 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "attribute"
},
{
... |
273086828 | import sys
import math
from collections import defaultdict
import random
class Factory:
def __init__(self, _id, _own, _cyb, _prod):
self.id = _id
self.owner = _own
self.cyborg_count = _cyb
self.production = _prod
class Troop:
def __init__(self, _id, _own, _cyb, _from, _to, _des... | null | GhostInTheCell_python/GhostInTheCell_v0.py | GhostInTheCell_v0.py | py | 2,669 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.defaultdict",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
... |
21051748 | import h5py
import pandas as pd
def cleanup(x):
if isinstance(x, float):
return "Unknown"
y = x.lower()
y = y.rstrip()
return y.capitalize()
PHI_PENALTY = snakemake.params.phi_penalty
coach_info = pd.read_csv(snakemake.input.csv)
coach_info["nation"] = coach_info.nation.apply(cleanup)... | null | scripts/compute_rankings.py | compute_rankings.py | py | 1,472 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"li... |
442965874 | from pyspark import SparkContext
from pyspark.streaming import StreamingContext
from pyspark.streaming.kafka import KafkaUtils
sc = SparkContext("local[2]", "KafkaWordCount")
ssc = StreamingContext(sc, 2)
zookeeper = "192.192.0.25:2181,192.192.0.26:2181,192.192.0.27:2181"
topics ={"topic6": 0, "topic6": 1, "topic6":... | null | Spark-Streaming/spark-kafka/kafka_streaming_receiver.py | kafka_streaming_receiver.py | py | 816 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyspark.SparkContext",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pyspark.streaming.StreamingContext",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyspark.streaming.kafka.KafkaUtils.createStream",
"line_number": 13,
"usage_type": ... |
123614359 |
from pymongo import MongoClient
client = MongoClient('172.31.17.181', 29031)
db = client.airstats
collection = db['flight']
def mainPrompt():
print('Welcome! What would you like to do today? Here are your choices:'
'\n1 - Find the number of flights coming from a specific state'
'\n2 - Lists... | null | Main.py | Main.py | py | 10,529 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 4,
"usage_type": "call"
}
] |
177254802 | from django.contrib import admin
# Register your models here.
from listings.models import Listing, Contact
class ListingAdmin(admin.ModelAdmin):
list_display =('id','title','is_published','price','list_date','realtor','sqft')
list_display_links = ('id','title')
list_filter = ('realtor',)
list_editable = ('is_pub... | null | listings/admin.py | admin.py | py | 514 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 15,
"usage_type": "call"
},... |
591574919 | import redisai as rai
from ml2rt import load_model
from cli import arguments
model = load_model("../models/sklearn/linear_regression/linear_regression.onnx")
if arguments.gpu:
device = rai.Device.gpu
else:
device = rai.Device.cpu
con = rai.Client(host=arguments.host, port=arguments.port)
con.modelset("sklea... | null | python_client/sklearn_linear_regression.py | sklearn_linear_regression.py | py | 810 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ml2rt.load_model",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cli.arguments.gpu",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cli.arguments",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "redisai.Device",
... |
199696100 | from django.shortcuts import render
from teacher.models import Teacher
from rest_framework.authentication import SessionAuthentication,TokenAuthentication
from teacher.serializers import teacherSerializer
from rest_framework import generics
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from... | null | teacher/views.py | views.py | py | 1,998 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "teacher.models.Teacher.objects.all",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "teacher.models.Teacher.objects",
"line_number": 19,
"usage_type": "attrib... |
217913210 | from twisted.internet import reactor
from twisted.internet.task import LoopingCall
class Countdown(object):
counters = {}
delay = {}
def __init__(self):
self.counters = {'counter1': 5, 'counter2': 5, 'counter3': 3}
self.delay = {'counter1': 3, 'counter2': 2, 'counter3': 1}
def count... | null | ch03/countdown_refactored.py | countdown_refactored.py | py | 1,747 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "twisted.internet.reactor.callLater",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "twisted.internet.reactor",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "twisted.internet.reactor.stop",
"line_number": 42,
"usage_type": "call"
},
... |
132364056 | # -*- coding: utf-8 -*-
import logging
import pprint
import werkzeug
from werkzeug.wrappers import Response
from odoo import http
from odoo.http import request
_logger = logging.getLogger(__name__)
class VisaNetController(http.Controller):
_return_url = '/payment/visanet/return'
@http.route(['/payment/visa... | null | controllers/payment.py | payment.py | py | 1,500 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "odoo.http.Controller",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "odoo.http",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pprint.pformat"... |
542217069 | from sklearn.gaussian_process import GaussianProcessRegressor
import sys
from sklearn.gaussian_process.kernels import RBF
import numpy as np
import matplotlib.pyplot as plt
import argparse
parser = argparse.ArgumentParser(description='Input parameters from CAMB')
parser.add_argument('--inired',metavar='zini', type=... | null | camb/GP.py | GP.py | py | 2,888 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
451318101 | """
Copyright (C) 2013-2019 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).
preprocess_checks.py
~~~~~~~~~~~~~~~~~~~~
Checks for model consistency and possible errors during preprocessing.
"""
import os
import logging
import numpy as np
import pandas as pd
from i... | null | calliope/preprocess/checks.py | checks.py | py | 2,871 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "calliope.core.attrdict.AttrDict.from_yaml",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "calliope.core.attrdict.AttrDict",
"line_number": 28,
"usage_type": "name"
}... |
259601074 | #!/usr/bin/env python3
from collections import namedtuple, deque, defaultdict
import random
import time
import imp
import sys
Point = namedtuple('Point', ['x', 'y'])
class Board(object):
def __init__(self, width=10, height=10):
self.width = width
self.height = height
self.fields = [['.'] ... | null | single.py | single.py | py | 6,035 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "collections.deq... |
641820653 | from PIL import Image, ImageDraw
import numpy as np
from torchvision.datasets import MNIST
from skimage.color import gray2rgb
# import skimage.io as io
# from skimage.draw import draw
import torch
import sys
sys.path.insert(0, '.')
sys.path.insert(0, '..')
sys.path.insert(0, '../..')
from torch_geometric.datasets im... | null | torch_geometric/visualization/mnist_graph.py | mnist_graph.py | py | 4,549 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.insert",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
21489960 | # Copyright (C) 2009-2019, Panagiotis Christopoulos Charitos and contributors.
# All rights reserved.
# Code licensed under the BSD License.
# http://www.anki3d.org/LICENSE
# keep methods in alphabetical order
# blender imports
import bpy
bl_info = {"author": "A. A. Kalugin Jr."}
def get_camera():
"""
Gets a camer... | null | tools/anki_scene_exporter/lib/objects.py | objects.py | py | 759 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "bpy.data",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops.object.camera_add",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "bpy.ops",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "bpy.data",
"... |
448887550 | import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
from .ops import conv2d, conv2d_transpose, pixelwise_accuracy
# example of using the vgg16 model as a feature extraction model
from keras.preprocessing.image import load_img
from keras.preprocessing.image import img_to_array
#from keras.appl... | null | Alternative models/Dense layers/src/networks.py | networks.py | py | 6,576 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.compat.v1.disable_v2_behavior",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "tensorflow.compat.v1.compat.v1.variable_scope",
"line_number": 33,
"usage_typ... |
270393134 | from __future__ import print_function
import pickle
import os
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.pickle.
SCOPES = ['https://www.googleapis.com/auth/spre... | null | grab&uploadZets.py | grab&uploadZets.py | py | 5,347 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "google.auth.transport.request... |
13243314 | from collections import deque
import sys
import copy
input = sys.stdin.readline
def bfs():
# 바이러스 퍼뜨리고, 안전영역 크기를 재라
virus = deque()
dx = [-1,1,0,0]
dy = [0,0,-1,1]
test_map = copy.deepcopy(array)
for i in range(N):
for j in range(M):
if test_map[i][j]==2:
... | null | Baekjoon/14502.py | 14502.py | py | 1,377 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 13,
"usage_type": "call"
}
] |
343160029 | import pygame as pg
import dirmestre
import os
SCREEN_WIDTH = 640
SCREEN_HEIGHT = 480
class Ball(pg.sprite.Sprite):
def __init__(self, pos):
super(Ball, self).__init__()
self.image = pg.image.load(os.path.join('img', 'grama.png'))
self.rect = self.image.get_rect()
sel... | null | teste.py | teste.py | py | 870 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.sprite",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
533895771 | from pymongo import MongoClient
from progressbar import *
from matplotlib.ticker import MaxNLocator
import matplotlib.pyplot as plt
import numpy as np
import json
from train import Train
from merlin import Merlin
client = MongoClient()
db = client.merlin
matches = db.matches
with open('heroes.json', 'r') as f:
re... | null | stats_lr.py | stats_lr.py | py | 2,095 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.xkcd",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplo... |
404440009 | """Create Web Application."""
import random
import os
import requests
from flask import Flask, render_template, abort, request
import shutil
# Import Ingestor and MemeEngine classes
from .QuoteEngine import Ingestor
from .MemeEngine import MemeEngine
app = Flask(__name__)
meme = MemeEngine('src/static')
def setup(... | null | src/app.py | app.py | py | 2,474 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "MemeEngine.MemeEngine",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "QuoteEngine.Ingestor.parse",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "QuoteEng... |
646537758 | import argparse
import json
import os
from django.apps import apps
from django.core.management.base import BaseCommand
from share.models import Subject, SubjectSynonym
from share.provider import ProviderAppConfig
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('--all', a... | null | share/management/commands/addsynonyms.py | addsynonyms.py | py | 2,595 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "argparse.FileType",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.apps.apps.get_app_configs",
"line_number": 25,
"usage_type": "call"
},... |
127970446 | """
实现一个 MyCalendar 类来存放你的日程安排,你可以一直添加新的日程安排。
MyCalendar 有一个 book(int start, int end)方法。它意味着在start到end时间内增加一个日程安排,注意,这里的时间是半开区间,即 [start, end), 实数 x 的范围为, start <= x < end。
当 K 个日程安排有一些时间上的交叉时(例如K个日程安排都在同一时间内),就会产生 K 次预订。
每次调用 MyCalendar.book方法时,返回一个整数 K ,表示最大的 K 次预订。
请按照以下步骤调用MyCalendar 类: MyCalendar cal = new My... | null | 732.py | 732.py | py | 2,340 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.Counter",
"line_number": 45,
"usage_type": "call"
}
] |
600885811 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" # ERROR
import numpy as np
import time
import sys
import pdb
import datetime
from absl import flags
from absl import app
import tensorflow as tf
import uti... | null | train.py | train.py | py | 3,907 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.__version__.startswith",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.__version__",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_... |
93758117 | """
Code for question 1 of the assignment.
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize as opt
import math as math
from scipy. stats import kstest
import scipy.stats as stats
from scipy.special import gamma
import pickle
# print(csv.reader(open('oxfordmanrealizedvol... | null | Q1.py | Q1.py | py | 3,134 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.average",
"line_num... |
279460639 | ############################################################################################
#
# The MIT License (MIT)
#
# Acute Myeloid Leukemia Detection System
# Copyright (C) 2018 Adam Milton-Barker (AdamMiltonBarker.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this ... | null | Chatbot/Classes/Model.py | Model.py | py | 5,783 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "Classes.Helpers.Helpers",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "Classes.Data.Data",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "tflearn.inp... |
394597896 | import json
import django_filters
from atom.ext.crispy_forms.views import FormSetMixin
from atom.ext.django_filters.filters import CrispyFilterMixin
from braces.views import (
PrefetchRelatedMixin,
SelectRelatedMixin,
SetHeadlineMixin,
UserFormKwargsMixin,
)
from django.contrib import messages
from dja... | null | poradnia/letters/views/cbv.py | cbv.py | py | 6,773 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "braces.views.SetHeadlineMixin",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "atom.ext.crispy_forms.views.FormSetMixin",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "braces.views.UserFormKwargsMixin",
"line_number": 32,
"usage_type"... |
503963624 | from django.http import HttpResponse
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from customer.models import Customer
from customer.serializers import CustomerSerializer
# noinspection PyMethodMayBeStatic,PyUnusedLocal,PyShadowingBuiltins
cl... | null | customer/views.py | views.py | py | 1,613 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "customer.models.Customer.objects.all",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "customer.models.Customer.objects",
"line_number": 20,
"usage_type": "at... |
364815303 | """A simple loss model based on a single loss scenario with
* label = An identifier for the scenario
* name = A descriptive name for the scenario
* p = Probability of occurring within one year
* low_loss = Low loss amount
* high_loss = High loss amount
The range low_loss -> high_loss should represent the 90% confidenc... | null | riskquant/simpleloss.py | simpleloss.py | py | 4,206 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scipy.stats.norm.ppf",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "scipy.stats.norm",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "math.log",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_n... |
560764084 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^simple_route/$', views.simple_route),
url(r'^slug_route/(?P<slug>[-_a-z0-9]+)/$', views.slug_route),
url(r'^sum_route/(?P<first>-?\d+)/(?P<second>-?\d+)/$', views.sum_route),
url(r'^sum_get_method/', views.sum_get_method),
... | null | web/coursera_assignment_tmp-master/routing/urls.py | urls.py | py | 373 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.co... |
355349990 | import grids
import numpy as np
import xarray as xr
import netCDF4 as nc
import pandas as pd
import datetime
import glob
files = list(sorted(glob.glob('/Users/rchales/data/gldas/*.nc4'))) * 100
times = {}
for engine in ('xarray', 'netcdf4'):
start = datetime.datetime.utcnow()
var = 'Tair_f_inst'
dim_orde... | null | publication_tests/speed/point.py | point.py | py | 1,673 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "glob.glob",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "grids.TimeS... |
367344124 | from django.shortcuts import render
from lib_collections.models import CollectionPage, CollectionPageFormatPlacement, CollectionPageSubjectPlacement, ExhibitPage, ExhibitPageSubjectPlacement, Format
from public.models import LocationPage
from staff.models import StaffPage, StaffPageSubjectPlacement
from subjects.models... | null | lib_collections/views.py | views.py | py | 10,446 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.connection.cursor",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.db.connection",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "django.core.cache.caches",
"line_number": 31,
"usage_type": "name"
},
{
"api_nam... |
319286327 | import pymongo
from util.config_parser import ConfigParser
import datetime
class MongoDbDriver:
# -- Public methods
# MongoDbDriver Constructor
def __init__(self):
super(MongoDbDriver, self).__init__()
self.__config = ConfigParser()
self.client = pymongo.MongoClient('mongodb://' ... | null | dagda/vulnDB/mongodb_driver.py | mongodb_driver.py | py | 7,332 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "util.config_parser.ConfigParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pymongo.DESCENDING",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_n... |
504719636 | from flask import Blueprint, render_template, request, session, g
from flask import current_app
from datetime import timedelta
import os, json,folium
import pandas as pd
from my_util.weather import get_weather
seoul_bp = Blueprint('seoul_bp', __name__)
def get_weather_main():
weather = None
try:
wea... | null | 03.DataAnalysisMoudule/bp1_seoul/seoul.py | seoul.py | py | 8,223 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.current_app.logger.info",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.curr... |
524449958 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 Fetch.AI Limited
#
# 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 ... | null | aea/cli/utils/generic.py | generic.py | py | 2,827 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Dict",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "yaml.safe_load",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "yaml.YAMLError",
"line_num... |
13584573 | import pickle
from collections import Counter
input_file = '../../data/morph/mpro_out.txt'
output_file = '../../data/morph/preproc_nopos.txt'
pickle_file = '../../data/morph/preproc_nopos.pk'
data = dict()
def bare(text):
text = text.strip('_()0123456789')
text = ''.join(text.split('$'))
tex... | null | src/morph/load_mpro_nopos.py | load_mpro_nopos.py | py | 2,170 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.Counter",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 76,
"usage_type": "call"
}
] |
79939362 | from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow
import sys
class MyWindow(QMainWindow):
def __init__(self):
super(MyWindow,self).__init__()
self.initUI()
def button_clicked(self):
self.user.setText("G???")
self.comando.setText("Comando ???")
... | null | Previsao/QT.py | QT.py | py | 1,262 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "PyQ... |
611833833 | import argparse
def sys_args_parser():
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--names_file", type=str, help="Path to file with names")
parser.add_argument("-dc", "--database_conf", type=str, help="Path to file with database connection data")
parser.add_argument("-s", "--site", t... | null | lib/general.py | general.py | py | 951 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
}
] |
268619088 | import os,io,sys
try:
import numpy as np
import matplotlib.pyplot as plt
import scipy.fftpack
except:
print("Uruchom inst.bat")
sys.exit(1)
if len(sys.argv)<2: print("Wywol~anie: python draw.py NAZWA_Pliku.csv")
#sys.exit(1)
def fx(x):
return float(x)
L=[]
with io.open(sys.argv[1]) as F:
for l ... | null | python/draw_csv.py | draw_csv.py | py | 1,255 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.exit",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "io.open",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 20,
"... |
258673653 | import numpy as np
import pandas as pd
import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import gridspec
import sys
from astropy import units as u
from astropy.coordinates import SkyCoord
from sunpy.coordinates import sun
# import matplotlib.tri as tri
from scipy.inter... | null | map_53day/plot_photon_power_v1.py | plot_photon_power_v1.py | py | 6,886 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.use",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "matplotlib.rc",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.get_cma... |
196303049 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "MambaHJ"
import pandas as pd
import os
def get_data(data_name=''):
current_path = os.getcwd()
parent_path = os.path.dirname(current_path)
data_dir = os.path.join(parent_path,'data')
for f in os.listdir(data_dir):
if f.endswith(data_name):
data_path ... | null | chapter3/code/ClusterAnalysis.py | ClusterAnalysis.py | py | 3,245 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number... |
429649163 | '''
Created on 2017年3月30日
@author: xixi
'''
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import unittest
from pydoc import browse
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Chrome()
... | null | functional_test.py | functional_test.py | py | 2,162 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "s... |
47756612 | import matplotlib.pyplot as plt
import NaoConnect
# read the orientaion of the robot
#(FsrLeft, FsrRight, robPos, robOrient, HeadTouch, HandTouchLeft, HandTouchRight) = NaoConnect.NaoGetSensors()
# robo_orientaion_x.append(robOrient[0])
# robo_orientaion_y.append(robOrient[1])
# robo_orientaion_z.append(robOrient[2])... | null | Project/5_alpha_swing/phase_diagram.py | phase_diagram.py | py | 874 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "mat... |
388457556 | from __future__ import absolute_import
import sys
if sys.version_info.major > 2:
# This is needed for python 2 as otherwise pyspark raises an exception for following command:
# data_type = input_df.schema[str(column_name)].dataType
# Pyspark checks if the input is a string, which does not work
# with th... | null | src/spooq2/transformer/threshold_cleaner.py | threshold_cleaner.py | py | 3,455 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.version_info",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "transformer.Transformer",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "builtins.str",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "builtins.st... |
362500019 | from django.urls import path
from . import views
app_name='stats'
urlpatterns = [
path('latest/', views.latest, name='latest'),
path('by-id/', views.byId ,name='by-id'),
path('by-id/<testSuiteId>/', views.byIdResult, name='by-id-result'),
path('compare/', views.compare, name='compare'),
path('co... | null | src/stats/urls.py | urls.py | py | 607 | 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"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
553682405 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render,redirect
# Create your views here.
from django.views.generic import View,ListView,TemplateView
from booking.forms import BookingReg,Hotel_Form,HotelReg,PhotoReg
from booking.models import Hotel1,HotelList,HList,Photo1... | null | booking/views.py | views.py | py | 3,812 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.generic.View",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "booking.forms.BookingReg",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 22,
"usage_type": "call"
},
{
"api_na... |
471470511 | import numpy as np
from scipy.integrate import odeint
import os
def set_up(example_name):
example_dir="./"+example_name
if not os.path.exists(example_dir):
os.mkdir(example_dir)
data_dir=example_dir+'/'+'Data'
if not os.path.exists(data_dir):
os.mkdir(data_dir)
return dat... | null | traffic_data_generator.py | traffic_data_generator.py | py | 3,099 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number"... |
341700371 | import sys
import random
from enum import IntEnum
from PyQt5.QtWidgets import QLabel, QWidget, QApplication, QGridLayout, QMessageBox
from PyQt5.QtGui import QFont, QPalette
from PyQt5.QtCore import Qt
# 用枚举类表示方向
class Direction(IntEnum):
UP = 0
DOWN = 1
LEFT = 2
RIGHT = 3
class Slider(QWidget):
... | null | 滑块游戏/slider_game.py | slider_game.py | py | 5,408 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "enum.IntEnum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QGridLayout",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "rando... |
333439319 | # © 2016 Julien Coux (Camptocamp)
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import calendar
import datetime
from odoo import models, fields, api, _
class GeneralLedgerReport(models.AbstractModel):
_name = 'report_general_ledg... | null | contabilidad_cfdi/report/general_ledger.py | general_ledger.py | py | 29,601 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "odoo.models.AbstractModel",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "odoo.api.model",
"line_number": 288,
"usage_type": "attribute"
},
{
"api_name": "odoo.... |
341830734 | import base64
import time
from PIL import Image
from pytesseract import image_to_string
from selenium import webdriver
def save_captcha(src):
base64data = src[len("data:image/jpg;base64,"):].replace(" ", "").replace("%0A", "")
image = base64.b64decode(base64data)
with open("captcha.jpg","wb") as f:
... | null | 0709/test02_Tesseract识别验证码实现知乎登陆 [基本无功能性].py | test02_Tesseract识别验证码实现知乎登陆 [基本无功能性].py | py | 2,211 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "base64.b64decode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "pytesseract.image_to_string... |
230319320 | from __future__ import unicode_literals
from django.db import models
from church.models import Church
# Create your models here.
class AttendanceActiveServiceLogs(models.Model):
id = models.AutoField(primary_key=True)
church_id = models.ForeignKey(Church, on_delete=None)
isActive = models.BooleanField()
... | null | attendanceServicesLogs/models.py | models.py | py | 482 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.AutoField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "... |
225291235 | #!/usr/bin/env python3
#
# Author:
# Tamas Jos (@skelsec)
#
import os
import logging
def main():
import argparse
import glob
from pypykatz.utils.crypto.cmdhelper import CryptoCMDHelper
from pypykatz.ldap.cmdhelper import LDAPCMDHelper
from pypykatz.kerberos.cmdhelper import KerberosCMDHelper
from pypykatz.ls... | null | pypykatz/__main__.py | __main__.py | py | 4,733 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pypykatz.lsadecryptor.cmdhelper.LSACMDHelper",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pypykatz.registry.cmdhelper.RegistryCMDHelper",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pypykatz.utils.crypto.cmdhelper.CryptoCMDHelper",
... |
111786111 | # -*- coding: utf-8 -*-
#importing required libraries
from flask import Flask, request, render_template
import numpy as np
import re
import requests
import pandas as pd
import json
from gevent.pywsgi import WSGIServer
import os
#initializing the flask app
app = Flask(__name__)
def check(user_inp):
... | null | app.py | app.py | py | 3,126 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.render_template",... |
172293060 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import smtplib
from email.mime.text import MIMEText
from threading import Thread
from email import encoders
from email.header import Header
from email.mime.text import MIMEText
from email.utils import parseaddr, formataddr
from markdown import Markdown
# 拼接站点地... | null | app/utils.py | utils.py | py | 4,593 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": ... |
89236896 | import os
import sys
from datetime import datetime
from os import execl
from telethon import TelegramClient, events
from telethon.sessions import StringSession
from telethon.tl.functions.account import UpdateProfileRequest
from Config import STRING, SUDO, BIO_MESSAGE, API_ID, API_HASH
import asyncio
a = API_ID... | null | bot.py | bot.py | py | 3,449 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "Config.API_ID",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "Config.API_HASH",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "Config.STRING",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "telethon.TelegramClient",... |
313787332 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.spiders import CrawlSpider
from bs4 import BeautifulSoup
__author__ = 'Daniel Abramov github.com/RiskofStorm'
class MarketPhonesSpider(CrawlSpider):
name = 'market_phones'
allowed_domains = ['market.yandex.ru']
start_urls = ["https://market.yandex.ru/cat... | null | yandex/6cap/NLP_Project/ScrapyCrawler_/crawlers/YandexNLP/yandexnlp/spiders/market_phones.py | market_phones.py | py | 1,129 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 29,
"usage_type": "call"
}
] |
22222174 | from flask import render_template, request, flash, redirect, Blueprint, url_for
from werkzeug import secure_filename
import os
import re
from flask import current_app
from spamfilter.models import db, File
import json
from collections import OrderedDict
from sklearn.model_selection import train_test_split
import pandas... | null | spamfilter_api.py | spamfilter_api.py | py | 20,759 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.current_app.config",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "flask.current_app",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "flask... |
112309446 | from fastapi.responses import JSONResponse, Response
from fastapi import Request, File, UploadFile, Body, Form
from model.audioModel import AudioModel
import hashlib
from pathlib import Path
from fastapi.staticfiles import StaticFiles
from tempfile import NamedTemporaryFile
import shutil
import os
from aip imp... | null | service/audioService.py | audioService.py | py | 3,069 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "aip.AipSpeech",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dao.audioDao.search_audioinfo",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "dao.audioDao... |
402284888 | # -*- coding: utf-8 -*-
import requests
import urllib
import time
import pymongo
client = pymongo.MongoClient('localhost',27017)
book_qunar = client['qunar']
sheet_qunar = book_qunar['qunar']
# 获取 出发地
url = "https://touch.dujia.qunar.com/depCities.qunar"
strhtml = requests.get(url)
dep_dict = strhtml.json()
for dep... | null | dongcai/dongcai/tools/crawl_qunar.py | crawl_qunar.py | py | 1,374 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.request.quote",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "urllib.request",... |
197545087 | """
File Name: MoReL/gat.py
Author: Xiaotian Duan (xduan)
Email: xduan7@uchicago.edu
Date: 4/16/2019
Python Version: 3.5.4
File Description:
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch_geometric.nn a... | null | network/gnn/gat/gat.py | gat.py | py | 7,884 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.nn.ModuleList",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
487594628 | #############################
# Import required libraries #
#############################
import pyglet, math, sys, os, random, time
from pyglet import window, image, font #get the window, image & font/text manipulation commands
from pyglet.window import key
from pyglet.gl import * #get the commands to manipulate grap... | null | exo.py | exo.py | py | 21,054 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "pyglet.window.Window",
"lin... |
413292685 | # lstsq/_tikhonov.py
"""Operator Inference least-squares solvers with Tikhonov regularization."""
__all__ = [
"L2Solver",
"L2SolverDecoupled",
"TikhonovSolver",
"TikhonovSolverDecoupled",
]
import abc
import warnings
import numpy as np
import scipy.linalg as la
import scipy.sparse as sparse
from ._ba... | null | src/opinf/lstsq/_tikhonov.py | _tikhonov.py | py | 18,875 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "_base._BaseSolver",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "_base._BaseSolver.fit",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "_base... |
584368723 | import json
import os
import glob
import random
import argparse
import uuid
from enum import Enum
from tkinter import *
from tkinter import filedialog
from tkinter import messagebox
from tkinter import ttk
from PIL import Image, ImageTk
class LabelMode(Enum):
plain = "plain"
json = "json"
json_single_file... | null | main.py | main.py | py | 22,344 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "enum.Enum",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "tkinter.ttk.Entry",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 115,
"usage_type": "name"
},
{
"api_name": "os.getcwd",
"line_numbe... |
38593668 | # Load packages.
import logging
import sys
from TimeIt import timeit
from itertools import takewhile, repeat
import mpi4py
mpi4py.rc.recv_mprobe = False
from mpi4py import MPI
# Load classes and functions from own files.
from ComputeNode import ComputeNode
from HeadNode import HeadNode
# Setup globals for each proce... | null | code/simulations/halted_forest_fire.py | halted_forest_fire.py | py | 2,829 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mpi4py.rc",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "itertools.takewhi... |
38804672 | import datetime
import logging
import github
from sqlalchemy.orm import validates
from api import gh, geo
from app import db
from cache import Cache
class GHUser(db.Model):
__tablename__ = 'ghuser'
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(40), unique=True, nullable=Fa... | null | models.py | models.py | py | 3,394 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "app.db.Model",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "app.db",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "app.db.Column",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "app.db",
"line_number": 15... |
452405634 | import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
import time
def main():
Notify.init('batteryd')
notified = False
while True:
capacity = int(open('/sys/class/power_supply/BAT0/capacity').read().strip())
if not notified and capacity <= 10:
n = Notify.Notification.new(
... | null | batteryd.py | batteryd.py | py | 619 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "gi.require_version",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "gi.repository.Notify.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "gi.repository.Notify",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "gi.rep... |
258875903 | import sqlite3
with sqlite3.connect("cars.db") as connection:
c = connection.cursor()
c.execute("""SELECT orders.make, orders.model, COUNT(orders.order_date), inventory.quantity
FROM orders, inventory WHERE orders.model = inventory.model
GROUP BY orders.make, orders.model, ... | null | flask-hello-world/11_sql.py | 11_sql.py | py | 513 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
}
] |
374121757 | #Create your views here.
# -.- encoding: utf-8 -.-
from Problem.models import Problem
from User.models import User
from django.http import HttpResponse
from hashlib import md5
from django.shortcuts import render_to_response, render, redirect
from kari.const import Const
from Problem.forms import addProblemForm
from dj... | null | kari/Statistic/views_test.py | views_test.py | py | 12,494 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "User.models.User.getSessionUser",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "User.models.User",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "co... |
155913463 | # add parent dir to find package. Only needed for source code build, pip install doesn't need it.
import os, inspect
import types
import gym
import tensorflow as tf
from gym import RewardWrapper, ObservationWrapper
from gym.spaces import Box
from pybullet_envs.bullet import KukaGymEnv
from rnr.util import mkchdir
imp... | null | x7.py | x7.py | py | 3,591 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "inspect.getfile",
"l... |
487141462 | __author__ = 'bruno'
from django.conf.urls import patterns, url, include
from team import views
urlpatterns = patterns('',
# url(r'^get_notifications/', 'team.views.get_notifications'),
url(r'^accept_invitation/', 'team.views.accept_invitation'),
url(r'^decline_invitation/', 'team.views.decline_invitation... | null | team/urls.py | urls.py | py | 655 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dja... |
637321367 | '''
Try using sorted lowercase word as mapping value, instead of Counter() object
'''
from collections import Counter
def detect_anagrams(n, words):
'''
Return sublist of words which are anagrams of `n` but not `n` itself
'''
counters = {}
lowercase_words = [x.lower() for x in words]
for word in lowercase_words:
... | null | assignments/python/anagram/src/416.py | 416.py | py | 571 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.Counter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 14,
"usage_type": "call"
}
] |
578265038 | # coding: utf-8
import nbformat
from nbconvert import NotebookExporter
from nbconvert.preprocessors import Preprocessor
from traitlets.config import Config
def all_tags(nb):
rv = set()
for cell in nb.cells:
tags = cell.metadata.get('tags')
if tags:
for tag in tags:
... | null | exercise.py | exercise.py | py | 1,556 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nbconvert.preprocessors.Preprocessor",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "nbconvert.NotebookExporter",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "nbformat.read",
"line_number": 43,
"usage_type": "call"
},
{
"api... |
634724333 | import boto3
def lambda_handler(event, context):
# Get list of regions
ec2_client = boto3.client('ec2')
regions = [region['RegionName'] for region in ec2_client.describe_regions()['Regions']]
# Iterate over each region
for region in regions:
ec2 = boto3.resource('ec2', region_name=region... | null | 20-learning/11-automating-aws-lambda-python-boto3/elastic-compute-cloud-ec2/start-stop-ec2-instances-nightly/StopEC2Instances.py | StopEC2Instances.py | py | 1,000 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "boto3.client",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "boto3.resource",
"line_number": 12,
"usage_type": "call"
}
] |
455296073 | # -*- coding: utf-8 -*-
"""
Google Scholar Trend
By Xinshuai Qi
Version: 0
"""
#
# Reference: https://docs.python.org/3.3/library/argparse.html
import argparse
parser = argparse.ArgumentParser(description='Google Scholar Trend.\n Example: XXXX')
parser.add_argument('-a',help='Find articles with All of the words')
p... | null | scholar_trend/scholar_trend0.2.py | scholar_trend0.2.py | py | 3,297 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 65,
"usage_type": "name"
},
{
"api_name": "ma... |
563926755 | import torch
from model_VGG import vgg
from PIL import Image
from torchvision import transforms
import matplotlib.pyplot as plt
import json
data_transform=transforms.Compose(
[transforms.Resize((224,224)),
transforms.ToTensor(),
transforms.Normalize((0.5,0.5,0.5),(0.5,0.5,0.5))]
)
#load image
img=Image.... | null | VGG/predict_VGG.py | predict_VGG.py | py | 998 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Resize",
"line_number": 9,
"usage_type": "call"
},
{
"... |
330098369 | from django.urls import path
from . import views
urlpatterns = [
path('places/user/<int:pk>', views.places, name='user_places'),
path('places/detail/<int:pk>/', views.place_detail, name='place_detail'),
path('places/new/', views.new_place, name='new_place'),
path('places/<int:pk>/edit/', views.place_e... | null | places/urls.py | urls.py | py | 653 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
234654021 | import torch
import numpy as np
import torch.utils.data
import torchvision.datasets as dset
import torchvision.transforms as transforms
import os
class Data_preparation():
def prepare_data(self, args, home_path):
dataset_name = args.dataset
is_train = not args.is_testing
self.data_folder ... | null | data_prepare/data_prepare.py | data_prepare.py | py | 6,094 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torchvision.transforms.Resize",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 30,
"usage_type": "call"
},
{
... |
572795840 | import os
import sys
from contextlib import contextmanager
class CherryPyServer(object):
"""
cherrypy is really practical to host a webpage. However it is one big
drawback: it is mostly intended to run a single server per process, as it
stores lots of its configuration in globals.
This can be tro... | null | qmxgraph/_cherrypy_server.py | _cherrypy_server.py | py | 4,189 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.platform.startswith",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "signal.signal",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "signal.SIGCON... |
441669311 | """empty message
Revision ID: 39f7913387f8
Revises:
Create Date: 2021-05-24 16:57:27.751142
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '39f7913387f8'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | null | migrations/versions/39f7913387f8_.py | 39f7913387f8_.py | py | 962 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
458321269 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# They are mainly adopted from
# https://github.com/facebookresearch/detectron2/blob/master/detectron2/utils/logger.... | null | graphgallery/utils/logger.py | logger.py | py | 3,973 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.Formatter",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "logging.WARNING",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "termcolor.colored",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "logging... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.