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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
40784756 | from django.contrib import admin
from basket.models import Category, ProductList
class ProductAdmin(admin.ModelAdmin):
"""Отображение продуктов в админке"""
list_display = ('user', 'item', 'category', 'date',)
prepopulated_fields = {"slug": ("item",)}
admin.site.register(Category)
admin.site.register(Pr... | null | basket/admin.py | admin.py | py | 373 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 11,
"usage_type": "call"
},... |
648192685 | #!/usr/bin/env /usr/bin/python3
import os
from functools import lru_cache, partial
from hashlib import md5
from math import sqrt
from multiprocessing.dummy import Pool
from subprocess import call
from typing import Any, Callable, Dict, Iterator, List, Tuple
from image_wrapper import ImageWrapper, aspects_roughly_equa... | null | duplicate.py | duplicate.py | py | 4,851 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Callable",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
18359664 | #!/usr/bin/env python
#
#
from setuptools import setup
import glob
import os
upload = []
def uploadlist(dir):
upl = []
for file in os.listdir(dir):
if not file or file.startswith('.'):
continue
d = dir + os.sep + file
if os.path.isdir(d):
#upload.append(di... | null | pypi_install_script/feedprovider-0.2.1.tar/setup.py | setup.py | py | 3,212 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.sep",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,... |
198957747 | # Copyright (C) 2013, Maxime Biais <maxime@biais.org>
from .marketnofiat import MarketNoFiat, TradeException, GetInfoException
from arbitrage import config
import time
import hashlib
import json as complex_json
import requests
class RequestClient(object):
__headers = {
'Content-Type': 'application/json; c... | null | arbitrage/private_markets/coinexbch.py | coinexbch.py | py | 4,072 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "arbitrage.config.coinex_api_id",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "arbitrage.config",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "arbitrage.config.coinex_api_key",
"line_number": 19,
"usage_type": "attribute"
},
... |
18429206 | import json
import scrapy
from hyspider.items.city import CityLM
class CityLMSpider(scrapy.Spider):
name = 'city_lm'
allowed_domains = ['baidu.com']
start_urls = ['http://dianying.baidu.com/common/city/citylist?hasLetter=false&isjson=true']
# lm会对scray agent返回301 redirect
custom_settings = {
... | null | hyspider/spiders/city/lm.py | lm.py | py | 820 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "hyspider.items.city.CityLM",
"line_number": 24,
"usage_type": "call"
}
] |
411396707 | #Simple script for poking around CovCountyHospitalTimeSeries.csv
#Jacob Zahn
import sys
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy import stats
sys.path.append('..')
import lib
CCH = lib.loadCCHTimeSeries()
beds = CCH['beds'].to_numpy()
population = CCH['p... | null | pythonScripts/dataExploration.py | dataExploration.py | py | 3,006 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "lib.loadCCHTimeSeries",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scipy.stats.zscor... |
486530838 | from django import forms
import tweepy
from django.core.exceptions import ValidationError
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Submit
from SMAapp.models import User
from django.core.urlresolvers import reverse_lazy
def get_usernames():
options = ()
options = list(... | null | oldSlowSma/SocialMediaAnalysis/SMAapp/forms.py | forms.py | py | 1,382 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "SMAapp.models.User.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "SMAapp.models.User",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.forms.Form",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_nam... |
651752479 | from mongoengine.errors import DoesNotExist
from nightowl.plugins.connection import aws as aws_connection
from nightowl.models.nom.aws import AWSCloud
from nightowl.plugins.driver.base import DriverBase
from nightowl.utils.datetime import utc_now
from nightowl.utils.model import import_model
class DriverPlugin(Drive... | null | nightowl/plugins/driver/aws/aws.py | aws.py | py | 1,554 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nightowl.plugins.driver.base.DriverBase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "nightowl.models.nom.aws.AWSCloud",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "nightowl.plugins.connection.aws.ConnectionPlugin",
"line_number": 14... |
200418448 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from setuptools import setup, find_packages
import quokka
kwargs = {}
try:
from babel.messages import frontend as babel
kwargs['cmdclass'] = {
'extract_messages': babel.extract_messages,
'update_catalog': babel.update_catalog,
'compile_cata... | null | setup.py | setup.py | py | 2,444 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "babel.messages.frontend.extract_messages",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "babel.messages.frontend",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "babel.messages.frontend.update_catalog",
"line_number": 13,
"usage_... |
223761343 | from sys import exit
from typing import Callable, Iterable, TypeVar, Optional
from . import T
from .player import Player
from .items.ring import Ring
from .interactions import Inspectable, Useable
TType = TypeVar('TType')
NAME = ''' _ __ __ _ __ __
| |\/| / /\ / /`_ | | / /` ( (`
|_| ... | null | __main__.py | __main__.py | py | 4,603 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.TypeVar",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typing.Iterable",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "player.Player.get_of_ty... |
159737347 | #!/usr/bin/env python2
#
# Desc
#
from __future__ import division # Python 3 forward compatibility
from __future__ import print_function # Python 3 forward compatibility
import logging
import sys
import threading
import time
import timer
import util
import udp_listener
class Manager(threading.Thread):
def __... | null | nodechecker/nodechecker/lib/python/nodechecker/manager.py | manager.py | py | 15,484 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "threading.Thread",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": ... |
123905935 | import logging
log = logging.getLogger(__name__)
from functools import partial
import operator as op
import threading
import numpy as np
from atom.api import Enum, Bool, Typed, Property
from enaml.application import deferred_call
from enaml.qt.QtCore import QTimer
from enaml.workbench.api import Extension
from enaml... | null | psi/controller/plugin.py | plugin.py | py | 19,299 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "input.children",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "output.children",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "device.Devi... |
4119510 | from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from rest_framework import status
from model_mommy.recipe import Recipe
from app.pkg.shortener.models import ShortenedUrl
from app.pkg.shortener.services import ShortedUrlService
class ShortenerTestCase(APITestCase):
create_sh... | null | app/pkg/shortener/tests.py | tests.py | py | 2,670 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "rest_framework.reverse.reverse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rest_framework.reverse.reverse",
"line_number": 12,
"usage_type": "call"
... |
183133371 | from tqdm import tqdm
from PIL import Image
import pandas as pd
import sys
import os
if len(sys.argv) < 5:
print('Not enough arguments!')
print('MAX_WIDTH', 'MAX_HEIGHT', 'INPUT_DIRECTORY', 'OUTPUT_DIRECTORY')
exit()
MAX_WIDTH = int(sys.argv[1])
MAX_HEIGHT = int(sys.argv[2])
INPUT_DIRECTORY = sys.argv[3]... | null | documentation/demo_tools/splitter_csv_tool/splitter.py | splitter.py | py | 3,002 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number"... |
129616444 | import sys
sys.getdefaultencoding()
import pandas as pd
from bs4 import BeautifulSoup
import re
import codecs
max_length = 0
def read_data():
train_data = pd.read_csv(
'../Data_Source/labeledTrainData.tsv', header=0, delimiter='\t', quoting=3)
# test_data = pd.read_csv('../Data_Source/testData.tsv'... | null | Bag_of_Words_Meets_Bags_of_Popcorn/DeepLearning/Data_Sort.py | Data_Sort.py | py | 2,402 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.getdefaultencoding",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.sub",
... |
287734697 | # -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from django.conf import settings
import pika
def make_connection():
if settings.RABBITMQ_CRED:
c... | null | PaasTA-25HOURS/python-sample-app/appsample/rabbitmq_views.py | rabbitmq_views.py | py | 2,533 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.settings.RABBITMQ_CRED",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.RABBITMQ_CRED",
"line_number": 12,
"usage_type": "attri... |
176843236 | # Written by SparkFun Electronics June 2019
# Author: Wes Furuya
# *Shell scripts were taken from original jetbot robot.py code.
#
# Do you like this code?
#
# Help support SparkFun and buy a SparkFun jetbot kit!
# https://www.sparkfun.com/products/15365
#
# This program is distributed in the hope that it will... | null | jetbot/robot.py | robot.py | py | 3,143 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "traitlets.config.configurable.SingletonConfigurable",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "traitlets.Instance",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "motor.Motor",
"line_number": 28,
"usage_type": "argument"
},
{... |
84840555 | from typing import List
class Solution:
def maxProfit(self, k: int, prices: List[int]) -> int:
n = len(prices)
if n < 2:
return 0
if 2 * k >= n:
return sum(i-j for i, j in zip(prices[1:], prices[:-1]) if i - j > 0)
profits = [0] * n
for transaction_... | null | LeetCode31DaysChallenge-202010/Best Time to Buy and Sell Stock IV.py | Best Time to Buy and Sell Stock IV.py | py | 735 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
338639791 | """AWS Version 4 signing Python module.
Implements the signing algorithm as described here:
http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
However:
- specific to micropython; uses micropython modules
"""
try:
from uhashlib import sha256 as _sha256
except Im... | null | node/ambi/aws.py | aws.py | py | 8,605 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "hmac_ltd.new",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"line_number": 41,
"usage_type": "argument"
},
{
"api_name": "hmac_ltd.new",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"li... |
416405412 | import mock
import pytest
from .. import Retry, RetryError, truncated_delay_generator
from ..retry import _DEFAULT_DELAY_INITIAL
class FakeException(Exception):
pass
def fake_delay_generator(*args, **kwargs):
while True:
yield 0
def fake_func(x):
return x
def fake_failing_func():
raise E... | null | descarteslabs/common/retry/tests/test_retry.py | test_retry.py | py | 4,493 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "retry._DEFAULT_DELAY_INITIAL",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": ... |
62198922 | import variables as v
from variables import *
from utils import dialog
import io
# runs through the bookmarks file to fill the download list :
# the first element of each line is the video title,
# the second is the video url
# the bookmarks format is the following :
# <DT><A href="link">TITLE</A>
# <DD>DESCRIPTION
#... | null | htmlprocessor.py | htmlprocessor.py | py | 2,192 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "variables.bookmarks",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "variables.videos",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "variables.bookmarksFile",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_n... |
329789004 | import xml.etree.ElementTree as ET
import os
import numpy as np
import csv
DATASET_DIR = 'all_data/'
WHITELIST = ["man", "woman", "table", "side_table", "chair", "towel",
"bottle", "picture", "painting", "plant", "mirror"]
mypath = os.path.dirname(os.path.abspath(__file__))
print(mypath)
annotations = []
classes =... | null | xml_to_csv.py | xml_to_csv.py | py | 1,754 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_n... |
301777160 | import numpy as np
from sklearn import preprocessing
__author__ = 'Shahars'
class BaseLearningEnsemble(object):
def __init__(self, logger, classifier):
self.logger = logger
self.classifier = classifier
def run(self, whites, scores_arr, pop):
scorer_count = scores_arr.shape[1]
... | null | source/query/ml_phase/bag_worker/ensemble/base_learning_ensemble.py | base_learning_ensemble.py | py | 3,163 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.in1d",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.scale",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocess... |
271454662 | import pygame
from pygame.locals import *
from globals import *
class Menu():
def __init__(self, screen, game):
self.game = game
self.screen = screen
self.choices = ["Start", "Opcje", "Wyjdź"]
self.active = 0
with open("options.txt") as file:
opts = file.readline... | null | menu.py | menu.py | py | 4,096 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.font.SysFont",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pygame.event.clear",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pygame.event"... |
626653219 | """
An offline training example that uses SingleNetwork and FixedDataset.
The SingleNetwork uses training patches to train a super-resolution model.
Each patch consists of a low-resolution portion (40, 40) and a corresponding high-resolution one (80, 80).
If training data haven't been prepared, use FakeDataset to see w... | null | offline.py | offline.py | py | 5,327 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.utils.data.dataset.Dataset",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 27,
"usage_type": "call"... |
143346697 | # uncompyle6 version 3.7.4
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-x86_64/egg/catchbot/message/content/dynamic.py
# Compiled at: 2018-06-23 13:58:03
# Size of source mod 2**32: 578 bytes
import logging
def _get... | null | pycfiles/catchbot-0.7.0-py3.6/dynamic.cpython-36.py | dynamic.cpython-36.py | py | 890 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
}
] |
479843411 | import logging
logging.basicConfig(level=logging.INFO)
path = 'train_text'
with open(path,'r') as fid:
for line in fid:
char_text = []
parts = line.strip().split(' ')
utt = parts[0]
text = parts[1:]
text = "".join(text)
char = " ".join(text)
char = char.split... | null | word2char.py | word2char.py | py | 538 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 2,
"usage_type": "attribute"
}
] |
633414457 | import wave
import numpy as np
import matplotlib.pyplot as plt
def get(num:int=1,frame_sep:bool=True,plotting:bool=False,verbose=False)->np.ndarray:
with wave.open('../sound/'+str(num)+'.wav') as f:
params = f.getparams()
nchannels, sampwidth, framerate, framenums = params[:4]
data_... | null | audiolab1/audiolab/lab1/get.py | get.py | py | 1,001 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wave.open",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.frombuffer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.short",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.plot",
... |
15402042 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2020/7/4 下午4:54
# @Author : Boyka
# @Email : upcvagen@163.com
# @Software: PyCharm
import argparse
import json
import logging
import math
import os
import time
import cv2
import matplotlib.pyplot as plt
import numpy as np
from sklearn import neighbors
logge... | null | dataset/heat_map/ShanghaiTech/a_train.py | a_train.py | py | 7,192 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "argparse.Argu... |
360455656 | import pandas as pd
from sqlalchemy import create_engine
import json
cred = "credentials.json"
data = "nba_data.csv"
# loading credentials
with open(cred) as f:
cred = json.load(f)
def load_data_dataframe(data):
''' loads data from local directory to the dataframe.
insert those rows to a postgres ... | null | load.py | load.py | py | 667 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
471404211 | import os
import time
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from django.template import loader
from django.http import Http404
from django.urls import reverse
from django.utils import timezone
from django.http import HttpRequest
from io import BytesIO
from reportlab... | null | climamega/core/views.py | views.py | py | 15,228 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "models.Cliente.objects.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "models.C... |
439183572 | from . import session, vode_item, login_item, batch_item
from . import setting
from . import item
import json
import os
def get_vode():
response = session.get(setting.VODE_URL, headers=setting.HEADERS)
json_data = json.loads(response.text)
print(json_data['msg'])
data = json_data['data']
vode_it... | null | YourLesson/login.py | login.py | py | 3,682 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number... |
32992288 |
import argparse
from togglu.config import Config, CFG_FILE
from togglu.constants import TOGGL_URL, REPORTS_URL
from togglu.timesheet_console_renderer import TimesheetConsoleRenderer
from togglu.workspaces_console_renderer import WorkspacesConsoleRenderer
from togglu.list_timesheet import ListTimesheet
from togglu.tim... | null | togglu/togglu.py | togglu.py | py | 2,527 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "togglu.config.CFG_FILE",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "togglu.constants.TOGGL_URL",
"line_number": 21,
"usage_type": "name"
},
{
"api_nam... |
587005519 | from datetime import datetime
robot_name = '小麦'
def show_time():
dt = datetime.now()
print(dt.strftime('今天是:%Y年%m月%d日 %H:%M:%S'))
#定义1个函数
def hello(name):
print('---------------')
print(f'你好,{name},我是{robot_name}')
print(f"天地之间,{name}最帅!")
print(f'我对{name}的敬仰之情,犹如黄河之水一发而不可收拾!')
print(f'帅归帅,{name}出门别忘记带口罩!')
... | null | python/hard_python/robot/order.py | order.py | py | 886 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.loads",
"... |
615233897 | from flask import Flask
from injector import Injector
from edu_loan.config.default import Config
from edu_loan.config.dependencies import ApplicationRegister, Application
from edu_loan.config.main_module import MODULES, create_injector
def create_app(injector: Injector) -> Flask:
"""
Creates a Flask app
... | null | edu_loan/api/app.py | app.py | py | 986 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "injector.Injector",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "injector.binder.bind",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "edu_loan.config.de... |
414190822 | #!/usr/bin/env python3
# vim: set tabstop=4 noexpandtab shiftwidth=4:
import misaka as m
import os
import sys
import shutil
import re
import functools
BUILDDIR = "html"
BUILDTYPE = "local"
if len(sys.argv) > 1:
BUILDTYPE = sys.argv[1]
if os.path.exists(BUILDDIR):
shutil.rmtree(BUILDDIR)
os.mkdir(BUILDDIR)
@func... | null | build.py | build.py | py | 1,303 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
235488758 | from time import sleep
from selenium import webdriver
serverUrl = "http://tester01:bfa52857-a0ee-4412-b634-e25fcdfaf6e8@api-test.kobiton.com:80/wd/hub"
desired_caps = {
'browserName': 'Chrome',
'platformName': 'Android',
'platformVersion': '4.4.2',
'deviceName': 'Nexus 6'
}
driver = webdriver.Remote(
comman... | null | python/SampleTests.py | SampleTests.py | py | 586 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Remote",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
}
] |
578531674 | import numpy as np
import argparse
import cv2
import time
import torch
from torch.utils.serialization import load_lua
from inpaint.glcic.inpaint import gl_inpaint
from inpaint.glcic.utils import *
from inpaint.glcic.completionnet_places2 import completionnet_places2
from detection.ssd.ssd512 import detect
from utils.p... | null | ganonymizer.py | ganonymizer.py | py | 14,545 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "cv2.dnn.readNetFromCaffe",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "inpaint... |
232810264 | import sys, time, os, getopt, argparse
start_time = time.time()
from modules.main import GetOpts
from modules import process as k8s
from modules import logging as logger
from modules.get_ingress import K8sIngress
from modules.get_ns import K8sNameSpace
class _Ingress:
def __init__(self,ns):
global k8s_obje... | null | objects/ingress.py | ingress.py | py | 2,144 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "modules.get_ingress.K8sIngress.get_ingress",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "modules.get_ingress.K8sIngress",
"line_number": 16,
"usage_type": "name"
},
{
... |
8654088 | #!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@Author: billx
@Date: 2018/8/22
@Descript:
"""
import yaml
import json
config_data = {
'HEC': {
'Host': '127.0.0.1',
'Port': 80,
'Method': 'GET',
'Admin': [
'zhangsan',
'lisi'
]
},
'DT': {
... | null | day14_yaml.py | day14_yaml.py | py | 789 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "yaml.safe_load_all",
"line_number": 33,
"usage_type": "call"
}
] |
196494863 | from flask_restful import Api, Resource, reqparse
from flask_sqlalchemy import sqlalchemy
from model import db, reading_schema, readings_schema, Reading
from scipy import mean
from scipy.stats import shapiro, sem, t
from statsmodels.tsa.stattools import adfuller
import numpy as np
parser = reqparse.RequestParser()
pa... | null | app/api/statistics.py | statistics.py | py | 2,383 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask_restful.reqparse.RequestParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask_restful.reqparse",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask_restful.Resource",
"line_number": 14,
"usage_type": "name"
},
{
... |
394332634 | import math
import sys
import time
import torch
import torchvision.models.detection.mask_rcnn
import torch.nn.utils.prune as prune
from coco_utils import get_coco_api_from_dataset
from coco_eval import CocoEvaluator
import utils
import io
def train_one_epoch(model, optimizer, data_loader, device, epoch, print_f... | null | engine.py | engine.py | py | 7,058 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.MetricLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.SmoothedValue",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "utils.warmup_lr_scheduler",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torc... |
581917237 | print('started running python script')
import astropy
from astropy.io import ascii, fits
import pylab as plt
from astropy import wcs
from astropy.table import Table,Column,join,hstack
from astropy.coordinates import SkyCoord
from astropy import units as u
import pymoc
import glob
from time import sleep
import os
import... | null | Ian/lofar/deep_fields/ELAIS-N1/XID+_run_SPIRE.py | XID+_run_SPIRE.py | py | 7,242 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.int",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "astropy.table.Table.read",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "astropy.table.Tabl... |
191324781 | """Robot Framework Jenkins plugin collector."""
from abc import ABC
from typing import cast, List
from base_collectors import JenkinsPluginCollector, JenkinsPluginSourceUpToDatenessCollector
from source_model import SourceMeasurement, SourceResponses
class RobotFrameworkJenkinsPluginBaseClass(JenkinsPluginCollector... | null | components/collector/src/source_collectors/api_source_collectors/robot_framework_jenkins_plugin.py | robot_framework_jenkins_plugin.py | py | 1,172 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base_collectors.JenkinsPluginCollector",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "source_model.SourceResponses",
"line_number": 19,
"usage_type": "name"
},
{
"api_n... |
209425010 | import math
import random
from typing import List
from typing import Tuple
from .stats import Stats
def gen_numbers(count: int, points: int, seed: int = None) -> List[float]:
if count < 1:
raise Exception
if points < 1:
raise Exception
random.seed(seed)
numbers = [random.randrange(... | null | game/monster/generator.py | generator.py | py | 1,790 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_numb... |
403284353 | import numpy as np
import matplotlib.pyplot as plt
import os
from gen_var import rp, rc, pel_pot, lp, sig, t_start
import gauss_test_pot as gtp
direc = os.getcwd()
#sub_dir = '/one_iteration_phic/analysed_outputs/'
sub_dir = os.path.join(direc, 'one_iteration_phic', 'analysed_outputs') + os.sep
r_int = np.linspace(... | null | PLOT_2D_gen.py | PLOT_2D_gen.py | py | 1,672 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.sep",
"line_number": 9,
"... |
455166346 | from django.db import models
from django.core.exceptions import ObjectDoesNotExist
import requests
import datetime
import pytz
from haversine import haversine
class BikeRackManager(models.Manager):
def connect(self):
url = "http://www.poznan.pl/mim/plan/map_service.html?mtype=pub_transport&co=stacje_rower... | null | bikes/models.py | models.py | py | 3,377 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Manager",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.da... |
550223595 | import gym
import gym_pendrogone
import json
from ppo import rollouts_generator, add_vtarg_adv, render, Sensei
from agent import Agent
import tensorflow as tf
from os import path as path
# import gym_pendrogone
def load(exp_dir):
# exp_dir = 'experiments/PPO-00_Pendulum-v0_25-10-2018_20-12-37'
ckpt_path = path... | null | load.py | load.py | py | 1,516 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
... |
123951464 | from typing import Dict, List, Any
def setup(
name: str,
version: str,
author: str,
packages: List[str],
install_requires: List[str],
python_requires: str,
cmdclass: Dict[str, Any],
) -> None: ...
def find_namespace_packages() -> List[str]: ...
| null | stubs/setuptools/__init__.pyi | __init__.pyi | pyi | 274 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 10,... |
285937520 | from collections import deque
H, W = map(int, input().split())
chart = [input() for _ in range(H)]
start = None
end = None
for h, line in enumerate(chart):
for w, s in enumerate(line):
if s == 's':
start = (h, w)
if s == 'g':
end = (h, w)
que = deque([start])
visited = [[F... | null | AtCoder/atc/001a_2.py | 001a_2.py | py | 822 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 15,
"usage_type": "call"
}
] |
202664982 | from __future__ import print_function
from pyhive import hive
from TCLIService.ttypes import TOperationState
from scipy.sparse import coo_matrix, csr_matrix, csc_matrix
from files import *
import json
import pandas as pd
import numpy as np
import os
import csv
import itertools
def load_data_from_hive(config, correct_b... | null | updater/mule.py | mule.py | py | 5,174 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyhive.hive",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pyhive.hive.update_interactions",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyhive.hive",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.array",... |
478288179 | from __future__ import absolute_import, print_function
import logging
from django.core.urlresolvers import reverse
from requests.exceptions import RequestException
from sentry.http import safe_urlopen
from sentry.tasks.base import instrumented_task, retry
from sentry.utils.http import absolute_uri
from sentry.models... | null | src/sentry/tasks/sentry_apps.py | sentry_apps.py | py | 2,855 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.Logger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sentry.models.SentryApp.objects.get",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "sentry.models.SentryApp.objects",
"line_number": 40,
"usage_type": "attribute"
},
... |
534554924 | # %matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.cm
from mpl_toolkits.basemap import Basemap
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
from matplotlib.colors import Normalize
import pandas as pd
import numpy as np
def doplot(plotWhat, title):
... | null | maps/drawMap.py | drawMap.py | py | 4,768 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.get_cmap",
"line_number": 17,
"usage_type": "call"
},
{
"api_name"... |
215793352 | import pandas as pd
from datetime import datetime, timedelta
import random
def df_init(row_num, start_date="20180101"):
"""
Initialise dataframe with random integer (1-50 inclusive) assigned to each day
:param row_num: Max number of rows
:type row_num: int
:param start_date: First date
:type ... | null | main.py | main.py | py | 972 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "rando... |
202840354 | import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_jwt_extended import JWTManager
from flask_apispec.extension import FlaskApiSpec
import logging
from config import Config
def create_app(test_config=None):
_app = Flask(__name__)
_app.config... | null | app/__init__.py | __init__.py | py | 1,701 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "config.Config",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "app.registration.bp_reg",
"line_number": 28,
"usage_type": "argument"
},
{
"api_name": "app.authent... |
504207327 | # exiftool-mdt: exiftool modify dateTimeOriginal,
# it through command line exiftool( https://sno.phy.queensu.ca/~phil/exiftool/)
# python prg:batch modify picture exif dateTimeOriginal by difference
# between old datetime and new datetime
# path format is: G:\picture
# if run in windows ,please run in minGW64 or in ... | null | py-exif/exiftool-mdto.py | exiftool-mdto.py | py | 2,506 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetim... |
246997528 | """
Copyright 2018 Skyscanner Ltd
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 dis... | null | cfripper/rules/SecurityGroupOpenToWorldRule.py | SecurityGroupOpenToWorldRule.py | py | 2,282 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cfripper.model.rule.Rule",
"line_number": 22,
"usage_type": "name"
}
] |
602631268 | import torch
import torch.nn as nn
import torch.nn.functional as F
class SLSTM(nn.Module):
def __init__(self, emb_size, hidden_size, window_size=1, gpu=False):
super(SLSTM, self).__init__()
self.hidden_size = hidden_size
self.window_size = window_size
self.device = torch.device("cuda... | null | SRNN.py | SRNN.py | py | 6,205 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear",
"line_n... |
182572143 | from django.urls import path
from . import views
urlpatterns = [
path('', view=views.index, name='index'),
path('start', view=views.start, name='start'),
path('finish', view=views.finish, name='finish'),
path('register', view=views.register, name='register'),
path('leaderboard', view=views.leaderbo... | null | core/urls.py | urls.py | py | 420 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"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",
... |
498411926 | from base64 import b64encode
from config import config
from service import IServiceProtocol
from twisted.conch.error import ConchError
from twisted.internet import reactor, defer
from twisted.internet.protocol import ProcessProtocol
from twisted.python import log
from twisted.web.client import getPage
from twisted.web.... | null | service/protocols.py | protocols.py | py | 3,492 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "config.config.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "config.config",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "config.config.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "config.config",
... |
517738911 | import re
import logging
import math
# 3rd Party
import defusedxml.ElementTree as ET
# Self
import util
import logger
import stat_parsing
from gem import gem_t
# Base Item Class
class item_t(object):
re_implicits = re.compile("^Implicits: \d+")
re_any_curly_tag = re.compile("{.+}")
re_range = re.compile("\{range... | null | item_base.py | item_base.py | py | 4,282 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 20,
... |
418429402 | #!/usr/bin/env python
import argparse
from Bio import SeqIO
parser = argparse.ArgumentParser(description='''Select sequences from the ncbi-parks-ribosomal.fa that are found in the fasta file of functional gene hits (hmm) to the same genome''')
parser.add_argument('-phylo' , help = 'The single copy concatenated genes f... | null | nrfA/find-ribosomal-hits.py | find-ribosomal-hits.py | py | 972 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO.parse",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "Bio.SeqIO.parse",
... |
238085278 | """
=====================
`geoutil.polylistxml`
=====================
Interface |Geoset| instances with files in polylist XML format.
This module defines the polylist XML format, an XML representation of the
geoset data structure, and provides functionality for interfacing with the
|Geoset| class. See the |Geoset| c... | null | geoutil/polylistxml.py | polylistxml.py | py | 9,602 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits.Header",
"line_number": 152,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 152,
"usage_type": "name"
},
{
"api_name": "sha... |
259577606 | from abc import abstractmethod
import os
os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices'
import learnrl as rl
import tensorflow as tf
import tensorflow.keras.backend as K
import math
import gym
from carl.agents.tensorflow.memory import Memory
class DdpgAgent(rl.Agent):
def __init__(self, action_space:... | null | carl/agents/tensorflow/DDPG.py | DDPG.py | py | 20,795 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.environ",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "learnrl.Agent",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "gym.spaces",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "carl.agents.tensorf... |
555261768 | # coding=utf-8
# 主-商品管理-我的商品-单个商品-修改-删除
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import unittest, time, shop_login, shop_info
class Delegoods(unittest.TestCase):
def setUp(self):
# chromedriver = "c:\Program Files (x86)\Google Chrome\chromed... | null | blibao-project/test_case/cloudshop_case/delete_goods.py | delete_goods.py | py | 3,407 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sh... |
277678346 | import os
import time
from collections import Counter
from tntfl.player import Player, Streak
from tntfl.caching_game_store import CachingGameStore
from tntfl.game import Game
from tntfl.skill_change import Elo
import tntfl.transforms.transforms as PresetTransforms
class TableFootballLadder(object):
# Number of ... | null | tntfl/ladder.py | ladder.py | py | 5,397 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tntfl.skill_change.Elo",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tntfl.caching_game_store.CachingGameStore",
"line_number": 27,
"usage_type": "call"
},
{
"api_na... |
422357638 | """
@author: Gerardo Cervantes
"""
#First star counter appearance is 49.27 seconds into the run (English version of Mario 64 NSTC)
import numpy as np
from load_images import resize_image, pil_imgs_to_numpy
import time
from threading import Thread
from win32com.client import Dispatch
from pythoncom import CoInitial... | null | src/star_classifier.py | star_classifier.py | py | 9,177 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.backend.clear_session",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "keras.models.load_model",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "pyt... |
321605813 | from apis.models import Event, EventRegistration,User
import datetime
from django.core.mail import send_mail
from decouple import config
def notassignedtoabsent(self):
for event in Event.objects.all():
end_date=event.end_datetime
hour = int(end_date.hour)
day = int(end_date.day)
y... | null | cron.py | cron.py | py | 2,596 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "apis.models.Event.objects.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "apis.models.Event.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "apis.models.Event",
"line_number": 9,
"usage_type": "name"
},
{
"api_n... |
259925813 | import tqdm
import random
from sklearn.dummy import DummyClassifier
from sklearn import metrics
from collections import Counter
import pprint as pp
import numpy as np
from multiprocessing.pool import ThreadPool
def numpify(_data):
X = []
Y = []
for story, entity_indexes, entities, label in tqdm.tqdm(_data, "nump... | null | eeg/eeg-report-annotations/src/main/python/relation/relnet/random_classifier.py | random_classifier.py | py | 2,073 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tqdm.tqdm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
"line... |
346603907 | #!/usr/bin/env python3
import mysql.connector
import tkinter
import tkinter.messagebox
from calendar import monthrange
from PIL import Image, ImageTk
# Database methods
def add_emp(emp_no, first_name, last_name, gender, birth_date, salary, title, dept_no, db):
cursor = db.cursor()
create_emp = "INSERT INTO e... | null | Manager.py | Manager.py | py | 21,555 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.open",
"line_number": 120,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 120,
"usage_type": "name"
},
{
"api_name": "PIL.Image.ANTIALIAS",
"line_number": 128,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
... |
456024183 | import logging
from jsonformatter import JsonFormatter
# `format` can be `json`, `OrderedDict`, `dict`.
# If `format` is `dict` and python version < 3.7.0, the output order is sorted keys, otherwise will same as defined order.
# key: string, can be whatever you like.
# value: `LogRecord` attribute name.
STRING_FORMAT... | null | logger_config.py | logger_config.py | py | 1,186 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "jsonformatter.JsonFormatter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "logg... |
9864659 | from django.shortcuts import render,redirect
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseRedirect
from django.db.models import Q
from app1 import models
from datetime import datetime,date
from reportlab.pdfgen import canvas
from django.http import HttpResponse
@csrf_exempt
d... | null | proj1/app1/views.py | views.py | py | 9,521 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 17,
"usage_type": "call"
},
{
"api... |
395375202 | import gdal
import os
import shutil
BAND_NUM = 3
POST_EVENT_DIR = "/Volumes/My Book/Harvey/postevent/images"
POST_EVENT_SORT3BAND = '/Volumes/My Book/Harvey/postevent/sorted_images/3_band/'
POST_EVENT_SORT1BAND = '/Volumes/My Book/Harvey/postevent/sorted_images/1_band/'
for date in os.listdir(POST_EVENT_DIR):
pri... | null | band_sorting/sort_images.py | sort_images.py | py | 1,045 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 14,
... |
333072510 | import os
import cv2
FILMED_VIDEOS_DICT = './videos/filmed'
PRINTS_DICT = './prints'
filmed_videos_list = os.listdir(FILMED_VIDEOS_DICT)
for filmed_video in filmed_videos_list:
vidcap = cv2.VideoCapture(os.path.join(FILMED_VIDEOS_DICT, filmed_video))
vidcap_folder = os.path.join(PRINTS_DICT, filmed_video.rep... | null | extract_frames.py | extract_frames.py | py | 769 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
225138718 | from apiclient import discovery
from oauth2client.service_account import ServiceAccountCredentials
SCOPES = ['https://www.googleapis.com/auth/analytics.readonly']
KEY_FILE_LOCATION = 'g_an_key.json'
VIEW_ID = '161387953'
def initialize_analyticsreporting():
credentials = ServiceAccountCredentials.from_json_keyfi... | null | commands/commands_analytics.py | commands_analytics.py | py | 1,549 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "apiclient.di... |
113201017 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 11 16:28:03 2020
@author: eli
"""
import cv2
import imutils
import skimage
import numpy as np
import matplotlib.pyplot as plt
def rgb2gray(image):
R = image[:, :, 0]
G = image[:, :, 1]
B = image[:, :, 2]
gray = 0.2989*R + 0.5870*G + 0.1140*B
return n... | null | pos_extract.py | pos_extract.py | py | 3,511 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_COUNT",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "numpy.arra... |
307273908 | # Imports:
from PIL import Image
import os.path, sys
def crop(inputPath, outFolder, newWidth, newHeight):
"""
Crops images contained in specified folders to specified size.
Equally crops all sides.
Parameter: crop(inputPath, outFolder, newWidth, newHeight)
inputPath eg './train/'
outFolder eg './train256/'
newW... | null | crop39.py | crop39.py | py | 1,976 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.listdir",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_nu... |
522024587 | import ar_keyboard
import cv2
import numpy as np
import matplotlib
import math
kb_layout = (('Q','W','E','R','T','Y','U','I','O','P'),
('A','S','D','F','G','H','J','K','L','.'),
('Z','X','C','V','B','N','M',' ','!','?'))
kb = ar_keyboard.Keyboard()
cap = cv2.VideoCapture(0)
ret, video_fram... | null | kb_class_test.py | kb_class_test.py | py | 1,858 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ar_keyboard.Keyboard",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.putText",
... |
470990812 | from abc import ABC, abstractmethod
from utils import InputFeatures, InputExample
from pvp import AgnewsPVP, MnliPVP, YelpPolarityPVP, YelpFullPVP, \
YahooPVP, PVP, XStancePVP, _prepare ### NEW (_prepare)
import random ### NEW (_prepare)
PVPS = {
'agnews': AgnewsPVP,
'mnli': MnliPVP,
'yelp-polarity':... | null | preprocessor.py | preprocessor.py | py | 6,119 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pvp.AgnewsPVP",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pvp.MnliPVP",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pvp.YelpPolarityPVP",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pvp.YelpFullPVP",
"... |
648303839 | import threading, re, os
from typing import List, Dict, Union
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
_LINKEDIN_EMAIL = os.getenv("LI... | null | restapi/services/libs/ScrapingProfile.py | ScrapingProfile.py | py | 14,051 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "threading.local",
"line_number": 3... |
69388538 | from functools import cmp_to_key
s1=input()
N,M = [int(x) for x in s1.split()]
jobs=[]
friends=[]
for i in range(N):
s1=input()
i1,i2 = [int(x) for x in s1.split()]
jobs.append((i1,i2))
s1=input()
i1 = [(int(x),-1) for x in s1.split()]
jobs.extend(i1)
jobs=sorted(jobs,key=cmp_to_key(lambda x,y:x[0]-y[0]))... | null | 2019/w1.py | w1.py | py | 429 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "functools.cmp_to_key",
"line_number": 15,
"usage_type": "call"
}
] |
528665273 | import json
from math import ceil
from django.template import RequestContext
from django.shortcuts import render_to_response, render
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import logout_then_login
from django.db... | null | cmdb/views.py | views.py | py | 3,704 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.views.logout_then_login",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 26,
"u... |
202428559 | from matplotlib import pyplot as plt
from matplotlib import collections as mc
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
import warnings
from time import time
from textwrap import wrap
from sys import maxsize
#######################
#letter gen
#######################
def letter_gen():
... | null | metatlas/helpers/chromplotplus.py | chromplotplus.py | py | 11,590 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.maxsize",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "sys.maxsize",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "numpy.amin",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number":... |
97219949 | #!/usr/bin/python3
import os
import time
import sys
import json
import sqlite3
from urllib.request import urlretrieve
from urllib.parse import unquote
import django
from celery import Celery
from decouple import config
from django.utils import timezone
from settings import FILE_HASHES, enginedir, staticdir, engine_path... | null | OJExec-Python/tasks.py | tasks.py | py | 5,767 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.dont_write_bytecode",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.environ.setdefault",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "dj... |
424544624 | # coding=utf-8
import datetime
import logging
import os
import subprocess
import time
import yaml
# 必要モジュールのインストール
# pip install pypiwin32
# pip install wmi
# ログ出力設定
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(message)s')
# このスクリプトが配置されているディレクトリのパスを取得
script_dir = os.path.dirname(__file__)
# 設定フ... | null | mcpe-crash-restart-win32.py | mcpe-crash-restart-win32.py | py | 1,575 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
447111292 | from elasticsearch import Elasticsearch, NotFoundError,helpers
from datetime import date,datetime
from dateutil import parser
from uuid import uuid4
import json
import types
import copy
#from .config import dsn,default_index,bulk_chunk_size,logger
from . import config
from .config import logger
import elasticsearch
fro... | null | velociwrapper/base.py | base.py | py | 12,352 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "config.dsn",
"line_number": 93,
"usage_type": "attribute"
},
{
"api_name": "config.default_index",
"line_number": 97,
"usage_type": "attribute"
},
{
"api_name": ... |
513031596 | import multiprocessing
import DBTool
import BeautifulSoupTool
import CommonResource
def saveTxt(name: str, dataList: list):
name = CommonResource.rename(name)
try:
file = open(file=CommonResource.tmpDownloadTxt + name + ".txt", mode='w+')
for oneData in dataList:
file.write(oneData... | null | Python爬虫/CaoLiu/downloadTxt.py | downloadTxt.py | py | 1,273 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "CommonResource.rename",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "CommonResource.tmpDownloadTxt",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "BeautifulSoupTool.getURLListFromURL",
"line_number": 20,
"usage_type": "call"
}... |
638141560 | import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
from os import listdir
from os.path import isfile, join
import pandas as pd
def get_all_topics():
url_base = "https://gistbok.ucgis.org/all-topics?term_node_tid_depth=All&page="
url_list = [url_base + str(i) for i in range(0, 30)]
topic_s... | null | crawler/spider.py | spider.py | py | 2,861 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tqdm.tqdm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number... |
9826906 | import os
import time
from subprocess import check_output
from subprocess import check_output
import socket
import requests
import psutil
ips = check_output(['hostname', '--all-ip-addresses'])
ip = str(ips.decode())
#ip = ip[2:-4]
ip = ip.split(' ')[0]
#print(len(ip))
print("Instances's IP: " + ip)
init_flag = 0
whi... | null | MonitorInstances_low.py | MonitorInstances_low.py | py | 1,662 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "subprocess.check_output",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "psutil.cpu_percent",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "psutil.virtual_memory",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "psuti... |
160780716 | import numpy as np
from abc import ABCMeta, abstractmethod
from .target_funcs import TargetFunc
import matplotlib.pyplot as plt
# from .constraints import Constraint
class Search:
__metaclass__ = ABCMeta
def __init__(self):
self.target_func = None
self.name = self.__class__.__name__
... | null | src/searches.py | searches.py | py | 8,810 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "abc.ABCMeta",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "target_funcs.TargetFu... |
38983530 | from selenium import webdriver
opt = webdriver.ChromeOptions()
opt.add_argument("--start-maximized")
opt.add_argument("headless")
opt.add_argument("--ignore certificate errors")
driver = webdriver.Chrome(executable_path="C:\\Users\\Haroon\\Downloads\\chromedriver.exe", options=opt)
driver.get("https://rahulshettyaca... | null | PythonSelenium/chromoptionDemo.py | chromoptionDemo.py | py | 368 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 8,
"usage_type": "call"
},
{
"api_na... |
371140258 | import itertools
import numpy as np
from scipy.spatial.distance import cdist
from PIL import Image
import streamlit as st
from utils import FlowerArc, load_prec_embs
def main(top_k):
flower_arc = FlowerArc()
st.title("Flower retrieval")
train_img_fps, train_embs, train_labels = load_prec_embs()
up... | null | flower_st.py | flower_st.py | py | 1,217 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.FlowerArc",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "utils.load_prec_embs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "streamlit.file_u... |
127252964 | from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.python import PythonOperator
import sqlite3
import pandas as pd
import snowflake as sn
import time
import logging
import xlsxwriter
from snowflake.connector.pandas_tools import write_pandas
import xlsxwriter
import ... | null | dagsnew.py | dagsnew.py | py | 2,033 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.info",
"... |
418107547 | #!/usr/bin/env python
import cv2
from matplotlib import pyplot as plt
def getHSVHistogram(image, mask=None):
"""
function that gets the HSV histogram of a bgr8 image, optinaly can include
a mask for the image
returns in the form of a dictionary with H: S: V:
"""
hsv_image = cv2.cvtColor(image, cv2.COLOR_... | null | hist_utils.py | hist_utils.py | py | 1,094 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.cvtColor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.calcHist",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.calcHist",
"... |
302699864 | import os
import sys
import argparse
import pkg_resources
import importlib
import warnings
import csv
# numpy warnings because of tensorflow
warnings.filterwarnings("ignore", category=FutureWarning, module='tensorflow')
warnings.filterwarnings("ignore", category=UserWarning, module='gym')
import gym
import numpy as n... | null | script_experiment/test_rl_with_ground_truth_reward.py | test_rl_with_ground_truth_reward.py | py | 5,773 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.modules",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "stab... |
175461800 | #----------------------------------------------------------------------------#
# Imports
#----------------------------------------------------------------------------#
import json
import sys
import dateutil.parser
import babel
from flask import Flask, render_template, request, Response, flash, redirect, url_for, json... | null | projects/01_fyyur/starter_code/app.py | app.py | py | 12,769 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask_moment.Moment",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask_mig... |
181202949 | from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
(r'^blog/$', include('blog.urls')),
(r'^acc... | null | urls.py | urls.py | py | 828 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 10,
"usage_type": "attribute"
},
{
... |
161925330 | from . import catalogs
from . import importers
from babel.messages import extract
from babel.messages import pofile
from grow.common import utils
from grow.pods import messages
import os
import tokenize
_TRANSLATABLE_EXTENSIONS = (
'.html',
'.md',
'.yaml',
'.yml',
)
class Catalogs(object):
root = '/trans... | null | grow/pods/catalogs/catalog_holder.py | catalog_holder.py | py | 5,714 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "babel.messages.pofile.read_po",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "babel.message... |
608108049 | import sqlite3
class Search():
def __init__(self):
db = sqlite3.connect('voyager.db')
self.cursor = db.cursor()
## 地區搜尋條件
def search_area(self, county, township):
try:
areaStr = {
'0': ['', ''],
'1': ['', '安樂區', '信義區', '中正區', '暖暖區', '仁愛... | null | models/search.py | search.py | py | 10,504 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
}
] |
188279006 | """
A module for strategies.
NOTE: Make sure this file adheres to python-ta.
Adjust the type annotations as needed, and implement both a recursive
and an iterative version of minimax.
"""
from typing import Union
from copy import deepcopy
from game import Game
from game_state import GameState
def interactive_strateg... | null | strategy.py | strategy.py | py | 8,779 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "game.Game",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "game.str_to_move",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "game.Game",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "game.current_state",
"line_n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.