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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
348017272 | import os
import bpy
import shutil
import bge_netlogic
import bge_netlogic.utilities as utils
from bge_netlogic.ops.file_text_buffer import FileTextBuffer
from bge_netlogic.ops.abstract_text_buffer import AbstractTextBuffer
from bge_netlogic.ops.uid_map import UIDMap
class BLTextWrapper(AbstractTextBuffer):
_inde... | null | ops/tree_code_generator.py | tree_code_generator.py | py | 13,545 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bge_netlogic.ops.abstract_text_buffer.AbstractTextBuffer",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "bpy.data.texts.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bpy.data",
"line_number": 15,
"usage_type": "attribute"
},
... |
469784320 | import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import QPainter, QBrush, QPen, QColor
from PyQt5.QtCore import Qt, QPoint
FILL_COLOR = '#ff0000'
# https://www.learnpyqt.com/blog/implementing-qpainter-flood-fill-pyqt5pyside/
# https://www.learnpyqt.com/courses/custom-widgets/bitmap-graphics/
... | null | thomas/imageProcessing/qPainter.py | qPainter.py | py | 2,358 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QPixmap",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PyQt5... |
365035843 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import csv
import os
from tqdm import tqdm
from scipy import signal
from numpy import array, sign, zeros
from numpy import array, sign, zeros
from scipy.interpolate import interp1d
# envelope = abs(signal.hilbert(data))
threshold = 95
max_95_0 = ... | null | getdataEMGtest.py | getdataEMGtest.py | py | 16,698 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.loadtxt",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
591565202 | """
Support for AVM Fritz!Box fritzhome sensor devices.
For more details about this component, please refer to the documentation at
http://home-assistant.io/components/sensor.fritzhome/
"""
import logging
import requests
from custom_components.fritzhome import DOMAIN as FRITZHOME_DOMAIN
from homeassistant.helpers.en... | null | custom_components/sensor/fritzhome.py | fritzhome.py | py | 2,045 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "custom_components.fritzhome.DOMAIN",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "homeassistant.helpers.entity.Entity",
"line_number": 36,
"usage_type": "name"
},
... |
203476154 | #pip install -q -U "tensorflow-gpu==2.0.0b1"
#pip install -q -U tensorflow_hub
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
import tensorflow_hub as hub
import logging
import argparse
import sys
import json
from PIL imp... | null | predict.py | predict.py | py | 2,517 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tensorflow.get_logger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "argpa... |
394851607 | from os import listdir, mkdir
from os.path import join as pjoin, exists
import itertools
import pickle
from chainer.datasets import tuple_dataset
from malmopy.util import resize, rgb2gray
import shutil
import math
import numpy as np
import cv2
def preprocess(state, resize_shape=(84,84)):
# Resize state
state =... | null | webapp/notebooks/util.py | util.py | py | 18,448 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "malmopy.util.resize",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "malmopy.util.rgb2gray",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.fl... |
259339851 | #!/usr/bin/python
import cv2
import numpy as np
import collections
from scipy.stats import chi2
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
Pose = collections.namedtuple('Pose', ['rvec', 'tvec'])
Feature = collections.namedtuple('Feature', ['feature', 'cov_inv_depth', 'cov_xyz'])
# Pass a... | null | triangulation.py | triangulation.py | py | 7,000 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.namedtuple",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.trans... |
530446738 | # import libraries
import sys
# import image library
from PIL import Image
# check arguments
if len(sys.argv) != 4:
sys.exit("Usage: python resize.py n infile outfile")
# store arg data
n = int(sys.argv[1])
infile = sys.argv[2]
outfile = sys.argv[3]
# open image infile
inimage = Image.open(infile)
# store infile... | null | week6/resize.py | resize.py | py | 524 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
... |
271647744 | """This module provides a mixin base class for transports that
implements support for wakeupAfter() timed messages."""
from thespian.actors import *
from thespian.system.timing import ExpiryTime
from datetime import datetime
from thespian.system.transport import *
class wakeupTransportBase(object):
"""The wake... | null | thespian/system/transport/wakeupTransportBase.py | wakeupTransportBase.py | py | 4,223 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "thespian.system.timing.ExpiryTime",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 65,
"usage_type": "name"
},
{
"api_nam... |
557043913 | import pandas as pd
import numpy as np
import math
import os
import json
import random
class ItemCFRec:
def __init__(self, datafile, ratio):
# 原始数据
self.datafile = datafile
# 测试集与训练集的比例
self.ratio = ratio
self.data = self.loadData()
self.trainData ,self.testData = s... | null | jupyter项目/【推荐系统】/MovieLens & kaggle/recommed01/recommed01.py | recommed01.py | py | 3,648 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.seed",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
646199669 | from abaGEN import aba
from flask import Flask,request
from json import loads
import requests
bot_server = Flask(__name__)
@bot_server.route('/api/messages',methods = ['POST'])
def server():
data = request.get_data().decode('utf-8')
data = loads(data)
print(data)
message = data['message'] #由于不同版本,返回的... | null | SDQB_http.py | SDQB_http.py | py | 1,145 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.request.get_data",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "json.loads",
"lin... |
263145749 | """This module contains the function pdbfix, which is used to fix input PDB
files or retrieve them based on their PDB ID from the PDB"""
from pathlib import Path
from typing import Optional
from pdbfixer import PDBFixer
from openmm.app import PDBFile
def pdbfix(
receptor: Optional[str] = None,
pdbid: Optiona... | null | pyscreener/utils/pdbfix.py | pdbfix.py | py | 1,079 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Optional",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pdbfixer.PDBFixer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pdbfixer.PDBFixer",... |
33682848 | from __future__ import unicode_literals
import os
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
class PlaceholderImage(object):
"""
A class for configuring images to be used as 'placeholders' for
blank/empty VersatileImageField fields.
"""
... | null | versatileimagefield/placeholder.py | placeholder.py | py | 1,716 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.core.files.base.ContentFile",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "django.core.files.base.ContentFile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 38,
"usage_type": "call"
},
... |
395895716 | import operator
import random
import colorsys
import pylab
import getopt
import sys
import os
import coverage
import math
import fnmatch
from .treemap import Treemap
from .coverageutils import CoveredCode, CoveredModule
def example():
"""
Treemap demo!
This shows an example of creating a treemap... | null | src/treemap/scripts.py | scripts.py | py | 4,339 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "operator.add",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "colorsys.hsv_to_rgb",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "treemap.Treemap",... |
7845813 | #! /usr/bin/env python
from __future__ import print_function
from bigsi.graph import BIGSI
import os.path
import sys
import logging
import json
logger = logging.getLogger(__name__)
from bigsi.utils import DEFAULT_LOGGING_LEVEL
logger.setLevel(DEFAULT_LOGGING_LEVEL)
import numpy as np
from bitarray import bitarray
impo... | null | bigsi/cmds/build.py | build.py | py | 2,492 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bigsi.utils.DEFAULT_LOGGING_LEVEL",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "bitarray.bitarray",
"line_number": 20,
"usage_type": "call"
},
{
"api_name... |
222522909 | import matplotlib.pyplot as plt
import os
from dice.taxonomy import Taxonomy
from dice.reason import Grounder
from dice.reason import IlpGrounder
from dice.reason import MaxSat
from dice.reason import Ilp
from dice.misc import Report
from dice.kb import KnowledgeBase
from dice.constants import Parameters
class Assign... | null | dice/reason/assigner.py | assigner.py | py | 3,703 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dice.constants.Parameters.ASSIGNMENT_METHOD",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "dice.constants.Parameters",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 38,
"usage_type": "c... |
134750990 | #!/usr/bin/python
#this file change the imu data from perceptin to accomodate
#accelerometer and gyroscope bias
import rosbag
import os
import rospy
import argparse
def change_imu_data(inbag,outbag):
rospy.loginfo(' Processing input bagfile: %s', inbag)
rospy.loginfo(' Writing to output bagfile: %s', outbag... | null | imu-bias.py | imu-bias.py | py | 928 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rospy.loginfo",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rospy.loginfo",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "rosbag.Bag",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "rosbag.Bag",
"line_number"... |
137455801 | import datetime,easygui,math,os,sys,time #导入模块
while True: #循环
summer_holiday = datetime.datetime(2017, 8, 29) #暑假结束时间
summer_holiday_start = datetime.datetime(2017, 7, 8) #暑假开始时间
now_time = datetime.datetime.now() #现在的时间
today = datetime.date.today()
summer_holiday_last = (summer_holiday - now_time).days #暑假还剩下多少... | null | script/holiday-gui/holiday-gui.py | holiday-gui.py | py | 1,930 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datet... |
399542372 | import scrapy
from BossScrapy.items import BossscrapyItem
class bossDataSpider(scrapy.Spider):
name = "BossData"
start_urls = (
'https://www.zhipin.com/c101280600/h_101280600/?query=android&page=1&ka=page-1/',
)
def parse(self, response):
# print("获取到的值", response.body)
item = Bos... | null | BossScrapy/spiders/bossData.py | bossData.py | py | 1,531 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "BossScrapy.items.BossscrapyItem",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scrapy.Selector",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scr... |
524689689 | import os
import shutil
from .forms import EditorForm, ChkForm
from .utils import (
execute_python_exec, filename_and_filetype,
make_path_list, execute_cmd, url_replace,
url_replace_with_nodelete,
)
import logging
from django.conf import settings
from django.shortcuts import redirect
from django.shortcut... | null | JPHacks2019-final/JPHacks2019-demofinal/VMforBeginner/VMforBeginnerApp/views.py | views.py | py | 16,475 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.generic.FormView",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "forms.EditorForm",
"line_number": 28,
"usage_type": "name"
},
{
"api_name... |
527389281 | import random
from .base_class import Entity, Highlights
from .base_class import Action, EntityCont
from .utils import fill_template, number
# Entity
class Player_name(Entity):
def get_text(self):
spl = self._player_name.split()
c = ''
for i in spl[1:]:
c += i + ' '
retu... | null | code/notice_pipeline/notice_generator/stats_player.py | stats_player.py | py | 13,319 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base_class.Entity",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "base_class.Entity",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "random.choice",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "base_class.Entity",
... |
196386260 | #!/usr/bin/env python3
from argparse import ArgumentParser
from csv import reader
def greater_than(value):
if value.startswith('>'):
return int(value[1:])
elif value == 'None':
return 0
elif value == 'Norm':
return 1
else:
raise ValueError('Not part of category greather... | null | transform_into_numeric.py | transform_into_numeric.py | py | 2,372 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.reader",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 75,
"usage_type": "call"
}
] |
483222458 | import discord
import asyncio
import random
import os
import aiofiles
from discord.ext import commands
bot = commands.Bot(command_prefix = commands.when_mentioned)
bot.remove_command("help")
botnum = random.randint(1, 10000)
botid = 592843618763407372
doeid = 92792580948905984
minerid = 158928176054140929
bottoken = "... | null | mrping.py | mrping.py | py | 3,753 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.when_mentioned",
"line_number": 8,
"usage_type": "attribute"
},
{
... |
148118463 | import pygame
import sys
pygame.init()
fps = 30
fpsclock = pygame.time.Clock()
sur_obj = pygame.display.set_mode((400, 300))
pygame.display.set_caption("Keyboard_Input")
White = (255, 255, 255)
p1 = 10
p2 = 10
step = 5
while True:
sur_obj.fill(White)
pygame.draw.rect(sur_obj, (255, 0, 0), (p1, p2, 70, 65))
... | null | character_moving/move_cube.py | move_cube.py | py | 735 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",... |
464430439 | # -*- coding: utf-8 -*-
# Copyright 2018- Anssi Syrjäsalo
#
# 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 app... | null | src/REST/__init__.py | __init__.py | py | 21,406 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "compat.IS_PYTHON_2",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "keywords.Keywords",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "version.__version__",
"line_number": 279,
"usage_type": "name"
},
{
"api_name": "urllib.pars... |
246372009 | import main
from funciones_auxiliares import rango_intervalo
import excepciones
import os
def extraer_columna(nombre=None, columna=None, *args):
if nombre is None or columna is None:
raise excepciones.ArgumentoInvalido('extraer_columna({},{})'.format(nombre, columna))
if len(args) > 0:
raise ... | null | Tareas/T03/ComandosDatos.py | ComandosDatos.py | py | 8,549 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "excepciones.ArgumentoInvalido",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "excepciones.ArgumentoInvalido",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "excepciones.ErrorTipo",
"line_number": 15,
"usage_type": "call"
},
{
"... |
581860894 | import torch
import torch.nn as nn
from torchvision import models
from torch.nn.utils.rnn import pack_padded_sequence
class ResNet50LSTM(nn.Module):
def __init__(self, vocab_size, embedding_dim=300, hidden_dim=512):
super(ResNet50LSTM, self).__init__()
encoder_net = models.resnet50(pretra... | null | models/resnet50_lstm.py | resnet50_lstm.py | py | 5,537 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torchvision.models.resnet50",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torchvision.m... |
220997861 | #!/usr/bin/env python3
# Python 3.6
# Import the Halite SDK, which will let you interact with the game.
import hlt
# This library contains constant values.
from hlt import constants
# This library contains direction metadata to better interface with the game.
from hlt.positionals import Direction
from hlt.positional... | null | MyBot-bak.py | MyBot-bak.py | py | 4,984 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "hlt.Game",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "hlt.constants.MAX_TURNS",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "hlt.constants",
... |
118404512 | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 6 11:36:35 2018
@author: hejia
"""
import numpy as np
from statsmodels import regression
import fix_yahoo_finance as yf
import datetime
import matplotlib.pyplot as plt
#import mysql_object
#mysql=mysql_object.mysqlOperation()
start=datetime.date(2018,6,1)
stock='AMZN... | null | betaHedging.py | betaHedging.py | py | 1,437 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.date",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fix_yahoo_finance.download",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "fix_yahoo_finance.download",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "m... |
587686995 | #IN PYTHON3
import numpy as np
from load_dataset import mnist
import matplotlib.pyplot as plt
def relu(Z):
'''
computes relu activation of Z
Inputs:
Z is a numpy.ndarray (n, m)
Returns:
A is activation. numpy.ndarray (n, m)
cache is a dictionary with {"Z", Z}
'''
A =... | null | neural_networks/convolutional.py | convolutional.py | py | 7,196 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.maximum",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 46... |
391420226 | import numpy as np
import cv2
import matplotlib.pyplot as plt
from Lanes import *
# Read in a thresholded image
# warped = mpimg.imread('warped_example.jpg')
# window settings
window_width = 50
window_height = 80 # Break image into 9 vertical layers since image height is 720
margin = 100 # How much to slide left and ri... | null | locatelanelines.py | locatelanelines.py | py | 16,290 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros_like",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number... |
642588893 | import connection
import os
import json
connection = connection.conexao()
path = 'C:/Troca/gtin/python/eanGS1/'
j = os.listdir(path)
for i in range(len(j)):
arq = j[i]
with open(path + arq, 'r', encoding='utf-8') as f:
resposta = json.load(f)
try:
gtin = resposta
if g... | null | projeto v1/gpc.py | gpc.py | py | 2,645 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "connection.conexao",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "connection.cursor",
"line_n... |
298443474 | from openarticlegauge import config
from datetime import datetime
def record_provider_url(record, url):
if not "provider" in record:
record['provider'] = {}
if not "url" in record["provider"]:
record["provider"]["url"] = []
if url not in record['provider']['url']:
record['provider']... | null | openarticlegauge/recordmanager.py | recordmanager.py | py | 2,994 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "openarticlegauge.config.agent",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "openarticlegauge.config",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strftime",
"line_number": 39,
"usage_type": "call"
},
{
... |
463559267 | """
"""
from collections import OrderedDict as OD
import numpy as np
from infotopo.model.rxnnet import model, experiments
from infotopo import compare
reload(model)
reload(experiments)
reload(compare)
from infotopo.model.rxnnet.examples import get_mmr2
from infotopo.model.rxnnet.examples import get_mar2
reload(get... | null | comparison/cmp_models.py | cmp_models.py | py | 3,824 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "infotopo.model.rxnnet.model",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "infotopo.model.rxnnet.experiments",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "infotopo.compare",
"line_number": 12,
"usage_type": "argument"
},... |
205352550 | from keras import layers
from keras.models import Model
import numpy as np
# --------------------------------------------------
# ----------------DISCRIMINATOR---------------------
# --------------------------------------------------
class discriminator():
def __init__(self, optimizer, roll_size, image_s... | null | models/discriminator.py | discriminator.py | py | 2,395 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.layers.Input",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.layers",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "keras.layers.Dense",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras.layers",
... |
401574998 | #!/usr/bin/env python
import os
from setuptools import setup
import massmedia
try:
long_desc = open(os.path.join(os.path.dirname(__file__),'README')).read()
except (IOError, OSError):
long_desc = ''
try:
reqs = open(os.path.join(os.path.dirname(__file__),'requirements.txt')).read()
except (IOError, OSError... | null | setup.py | setup.py | py | 1,080 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
317051786 | import contextlib
from collections.abc import Iterable
from typing import Dict
from docutils import nodes
from sphinx.application import Sphinx
from sphinx.util.nodes import make_refnode
from sphinx_needs.errors import NoUri
from sphinx_needs.logging import get_logger
from sphinx_needs.nodes import Need
from sphinx_n... | null | sphinx_needs/roles/need_ref.py | need_ref.py | py | 5,794 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sphinx_needs.logging.get_logger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "docutils.nodes.Inline",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "docutils.nodes",
"line_number": 17,
"usage_type": "name"
},
{
"api_nam... |
31191595 | import itertools
import random
import math
iterations = 100
file_association_rules = open('out(.09-1).txt', 'r')
rule_lines = file_association_rules.readlines()
sd_dict = {}
file_spice_to_disease = open('Spice_disease.tsv', 'r')
sd_lines = file_spice_to_disease.readlines()
for sd_line in sd_lines:
temp = sd_line... | null | Spice_as_transactions_mining/Spice-Disease_association.py | Spice-Disease_association.py | py | 4,987 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.chain.from_iterable",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 107,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "m... |
556674205 | import graphene
from ...core.permissions import StorePermissions
from ..channel.types import ChannelContext
from ..core.fields import PrefetchingConnectionField
from ..decorators import permission_required
from .types import Store, StoreType
from ..account.types import User
from ..core.fields import FilterInputConnec... | null | saleor/graphql/store/schema.py | schema.py | py | 2,702 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "graphene.ObjectType",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "graphene.Field",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "types.Store",
"line_number": 33,
"usage_type": "argument"
},
{
"api_name": "graphene.Argu... |
271874317 | import connexion
from bson import ObjectId
from ibutsu_server.models.group import Group
from ibutsu_server.mongo import mongo
from ibutsu_server.util import merge_dicts
from ibutsu_server.util import serialize
def add_group(group=None):
"""Create a new group
:param body: Group
:type body: dict | bytes
... | null | backend/ibutsu_server/controllers/group_controller.py | group_controller.py | py | 2,108 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "connexion.request",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "ibutsu_server.models.group.Group.from_dict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "ibutsu_server.models.group.Group",
"line_number": 19,
"usage_type": "na... |
234297697 | from flask_sqlalchemy import SQLAlchemy
from flask import Flask
app = Flask(__name__)
# app.config['SQLALCHEMY_DATABASE_URL'] = DB_URI
# app.config.from_object('consts')
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:20Miqianlan@47.106.99.78:3306/r'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
db = SQ... | null | Python学习/app/SQL/flaskSql.py | flaskSql.py | py | 1,520 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 12,
"usage_type": "call"
}
] |
389798469 | from pyramid.view import view_config
from ..contentbase import (
Collection,
location,
)
from ..views.download import ItemWithDocument
def includeme(config):
config.scan(__name__)
@view_config(name='testing-user', request_method='GET')
def user(request):
from pyramid.security import (
authen... | null | src/encoded/tests/testing_views.py | testing_views.py | py | 1,554 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyramid.security.authenticated_userid",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pyramid.security.effective_principals",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pyramid.view.view_config",
"line_number": 13,
"usage_type": "... |
65444544 | import pyopencl
class cl_refs:
def __init__(self,c,d,q):
self.ctx = c
self.dev = d
self.q = q
def context(self):
return self.ctx
def device(self):
return self.dev
def queue(self):
return self.q
def setup_opencl(argv):
"""Process command line arguments and setup OpenCL
argv = command line argument li... | null | init.py | init.py | py | 3,669 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyopencl.VERSION",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pyopencl.get_platforms",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pyopencl.device_type",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name":... |
384860151 | # -*- coding: utf-8 -*-
# Standard library imports
from __future__ import unicode_literals
# Third party imports
from django.core.exceptions import ImproperlyConfigured
from django.core.exceptions import ValidationError
from django.test import TestCase
# Local application / specific library imports
from precise_bbco... | null | tests/unit/test_tags.py | test_tags.py | py | 10,162 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "precise_bbcode.tag_base.TagBase",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "precise_bbcode.tag_base.TagBase",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "precise_bbcode.tag_base.TagBase",
"line_number": 43,
"usage_type": "name"... |
403224009 | import pygame
from color import Color
import deng_lu
#游戏初始化
pygame.init()
#创建游戏窗口
window = pygame.display.set_mode((600,400))
#填充窗口
window.fill((200,255,200))
#加载图片
im_obj =pygame.image.load("files/111.jpg")
im_obj2 =pygame.image.load("files/222.jpg")
#图片缩放、旋转
im_obj2=pygame.transform.rotozoom(im_obj2,0,0.5)
im_obj =py... | null | Python1808/第一阶段/学生系统/系统页面.py | 系统页面.py | py | 1,768 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.loa... |
154581987 | # coding=utf-8
##################################################################
## http://wiki.programstore.ru/python-tensorflow-dlya-chajnikov-chast-1/
#
# Простейший пример использования обучения tensorflow-графа.
# Граф: константа (=1) умноженная на переменную (нач.знач. =0.8)
# Требуемое значение на выходе: 2
# ... | null | tests/tf_experiments/test_001.py | test_001.py | py | 2,049 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.get_default_graph",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.constant",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tensorflow.Variable",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "... |
619557090 | #!/usr/bin/env python
import os
import random
import re
import string
import youtube_dl
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from ricecooker.chefs import SushiChef
from ricecooker.classes import nodes, files, licenses
from ricecooker.config import LOGGER
from ricecooker.exceptions i... | null | sushichef.py | sushichef.py | py | 11,228 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"lin... |
4900537 | # -*- coding: utf-8 -*-
from qgis.core import *
from qgis.PyQt.QtGui import QProgressBar
from qgis.PyQt.QtCore import *
import numpy
import time
from processing.tools.vector import VectorWriter
import os
import json
import sys
MAX_FILE_NAME_SIZE=224
class StrictInit(object):
def __init__(self, ... | null | utils.py | utils.py | py | 9,296 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "qgis.PyQt.QtGui.QProgressBar",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 138,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
582961522 |
from pysnmp.entity import engine, config
from pysnmp.carrier.asyncore.dgram import udp
from pysnmp.entity.rfc3413 import ntfrcv
import base64
import json
import jsoncommon
import ipaddress
import traceback
import vmfunc
class Flow:
"""description of class"""
description_oid = ""
trend_val = ""
msgval... | null | SNMPTrapFlow/SNMPTrapFlow.py | SNMPTrapFlow.py | py | 3,630 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pysnmp.entity.engine.SnmpEngine",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pysnmp.entity.engine",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "pysnmp.entity.config.addTransport",
"line_number": 32,
"usage_type": "call"
},
{... |
518796815 | import pandas as pd
from pandas import DataFrame
import os
import re
from dateutil.parser import parse
from bs4 import BeautifulSoup
import selenium
import json
from random import randint
from datetime import datetime
from time import sleep
from selenium import webdriver
from selenium.webdriver.support.ui i... | null | Webscraping/ECB/Scraping/Factiva_Scraper/Interview_to_json_solans.py | Interview_to_json_solans.py | py | 9,456 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 40,
"usage_type": "call"
},
{
"api... |
219389110 | # import the necessary packages
from colordescriptor import ColorDescriptor
from searcher import Searcher
import argparse
import cv2
# construct the argument parser and parse the arguments
def search(index,query,result_path):
# initialize the image descriptor
cd = ColorDescriptor((8, 12, 3))
# load the query i... | null | LostAndFound/search1.py | search1.py | py | 909 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "colordescriptor.ColorDescriptor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "searcher.Searcher",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "searcher... |
70589587 | #!/usr/bin/python3
import discord
from discord.ext import commands
import asyncio
from os import environ, system, listdir, makedirs
from os.path import splitext, realpath, dirname
from random import shuffle
from time import time
zbot = commands.Bot(command_prefix='%')
data_folder = '{}/data/'.format(dirname(realpath... | null | zbot.py | zbot.py | py | 7,208 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path... |
35010847 | from pygame import draw
from drawable import Screen
from constants import Colors, gameFont
from gameState import state
class TaskListScreen(Screen):
def draw(self, canvas, deltatime):
canvas.fill(Colors.WHITE)
draw.rect(canvas, Colors.GOJIRA_BG_ACCENT, (0, 0, 320, 16))
draw.line(canvas, C... | null | taskListScreen.py | taskListScreen.py | py | 1,055 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "drawable.Screen",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "constants.Colors.WHITE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "constants.Colors",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pygame.draw... |
474988339 | import torch
import numpy
def load_models(args, model, t):
if t==0:
name = 'models/trained_model/{}_step_{}_nepochs_{}_{}'.format(args.dataset,
args.base_classes,
... | null | utils.py | utils.py | py | 1,518 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.load",
"line_number": 34,
"usage_type": "call"
}
] |
13276238 | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.conf import settings
from picke... | null | picker/views.py | views.py | py | 2,852 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "picker.models.Movie.objects.get_user_movies",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "picker.models.Movie.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "picker.models.Movie",
"line_number": 18,
"usage_type": "name... |
144512728 | # BNS Solo Ranking 1910
# Author: dbnryanc92 (玉蜂丷)
import requests
import lxml.html as lh
import pandas as pd
import os
import math
from datetime import date, timedelta
# Constants
classdict = {'class1': '劍士', 'class2': '拳士', 'class3': '氣功士', 'class5': '力士', 'class6': '召喚師', 'class7': '刺客',
'class8': '燐劍士... | null | bnssoloranking1910.py | bnssoloranking1910.py | py | 4,052 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.post",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "lxml.html",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "datetime.date",
"lin... |
70116970 | import tornado
import motor
import pymongo
import pandas as pd
import time
import functools
import logging
from tornado.gen import coroutine
from zBlackFireCapitalImportantFunctions.ConnectionString import TEST_CONNECTION_STRING
from zBlackFireCapitalImportantFunctions.SetGlobalsFunctions import CURRENCIES_EXCHANGE_... | null | a_blackfire_capital_class/data_from_mongodb.py | data_from_mongodb.py | py | 3,756 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.errors",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "logging.warning",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
... |
135909198 | import click
import os
from datetime import datetime
from sqlite3 import Cursor, connect
name = 'sqllogging'
db = connect('logs.sqlite3')
cursor = db.cursor()
initializedMessage = True
def disable_initializedMessage():
initializedMessage = False
def enable_initializedMessage():
initializedMessage = True
def... | null | sqllogging/__init__.py | __init__.py | py | 7,022 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "click.secho",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
... |
636280909 | # Copyright 2013 IBM Corp.
#
# 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 t... | null | nova_zvm/virt/zvm/utils.py | utils.py | py | 7,661 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "oslo_log.log.getLogger",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "oslo_log.log",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "oslo_config.cfg.CONF",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "oslo_co... |
431716357 | from django.shortcuts import render
from django.http import HttpResponseRedirect
from analytics.forms import DateRangeForm
from django.db.models import Q
from datetime import date
from datetime import datetime
from operator import itemgetter
from income.models import Income
from spending.models import Spending
from spe... | null | analytics/views.py | views.py | py | 7,560 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "analytics.forms.DateRangeForm",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "analytics.forms.DateRangeForm",
"line_number": 36,
"usage_type": "call"
... |
543068998 | from utils import Arc
from data import Entity
"""
A Covington style transition-based system.
"""
class Configuration:
def __init__(self, entities, document):
self.stack1 = [str(RootEntity())]
self.stack2 = list()
entities = list(entities)
# Sort based on order in text.
ent... | null | code/covington_transistion.py | covington_transistion.py | py | 5,187 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.Arc",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "data.Entity",
"line_number": 170,
"usage_type": "name"
}
] |
348080707 | import wikipedia
import pickle
import time
import re
if 'hy' in wikipedia.languages():
print ('ARMENIA')
wikipedia.set_lang("hy")
queue = set()
queue.add('Հայաստան')
visited = set()
num_pages_processed = 0
def process_and_save(content, title):
try:
content = re.sub('[\n]', ' ', content)
#cont... | null | wiki/wiki_arm_fetcher.py | wiki_arm_fetcher.py | py | 1,743 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wikipedia.languages",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "wikipedia.set_lang",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_nu... |
371042433 | import os
import cv2
images_file = '/home/xjyu/kgduan/Object_Detect/plate_detect/data/plate_list/plate_300.txt'
with open(images_file) as f:
images = f.readlines()
print(len(images))
for i in images:
img = cv2.imread(i.split(' ')[0])
height, width, channel = img.shape
print(i)
| null | plate_detect/tools/read_img_from_file.py | read_img_from_file.py | py | 299 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 11,
"usage_type": "call"
}
] |
88887766 | #!/usr/bin/python3
# Standard or external libraries
import sys
import threading
import socket
import argparse
from struct import pack
from Crypto.PublicKey import RSA
# Internal stuffs
from listener import Listener
from sender import Sender
from resource import Resource
from input import Input
from queue import Queue
... | null | Trab2/main.py | main.py | py | 2,824 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Crypto.PublicKey.RSA.importKey",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Crypto.PublicKey.RSA",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "Crypto.PublicKey.RSA.importKey",
"line_number": 20,
"usage_type": "call"
},
{
... |
345354205 | import torch.nn as nn
class pool_feature_model(nn.Module):
def __init__(self, num_features, hidden, num_class):
super(pool_feature_model, self).__init__()
self.classifier = nn.Sequential(
nn.Linear(num_features, hidden, bias=True),
nn.ReLU(True),
nn.Lin... | null | models/pool_feature_model.py | pool_feature_model.py | py | 1,017 | 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.nn.Sequential",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
86511280 | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 13 11:44:55 2020
@author: offic
"""
"""
Image Facial Expression Recognition
# Detect Facial Expressions From an Image
"""
import cv2
import numpy as np
from keras.preprocessing import image
from keras.models import model_from_json
import face_recognition
# ... | null | 07-Image-Facial-Expression-Detection.py | 07-Image-Facial-Expression-Detection.py | py | 3,085 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.models.model_from_json",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "face_recognition.face_locations",
"line_number": 34,
"usage_type": "call"
},
{
"api_name"... |
263309430 | from django.urls import path
from .views import EmpresaCreate, EmpresaEdit, EmpresaList, EmpresaDelete
urlpatterns = [
path('novo', EmpresaCreate.as_view(), name='create_empresa'),
path('editar/<int:pk>/', EmpresaEdit.as_view(), name='edit_empresa'),
path('empresa', EmpresaList.as_view(), name="lista_empre... | null | apps/empresas/urls.py | urls.py | py | 407 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.EmpresaCreate.as_view",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.EmpresaCreate",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.... |
439056820 | from django.urls import path
from django.contrib.auth import views as auth_views
from . import views
urlpatterns=[
path('home/',views.home,name="home"),
path('profile/',views.profile,name='profile'),
path('login/',auth_views.LoginView.as_view(template_name='user/login.html'),name='login'),
path('regi... | null | dummy/user/urls.py | urls.py | py | 537 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"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.contrib.auth.... |
652435334 | from django.http import HttpResponse
from django.shortcuts import render
def index(request):
context = {
'judul' : 'Scribees',
'subjudul' : 'your only platform to submit documents',
'footer' : 'img/BINUS_WEB.png',
}
return render(request, 'index.html', context)
#method view
#def a... | null | skripsi/views.py | views.py | py | 378 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 11,
"usage_type": "call"
}
] |
104057252 | # -*- coding: utf-8 -*-
from couchdb.design import ViewDefinition
endDate_view = ViewDefinition(
"auctions",
"by_endDate",
''' function(doc) {
var end = new Date(doc.endDate).getTime()
emit(end, null);
}
'''
)
def sync_design(db):
views = [endDate_view]
for vi... | null | openprocurement/auction/design.py | design.py | py | 355 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "couchdb.design.ViewDefinition",
"line_number": 5,
"usage_type": "call"
}
] |
55171784 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
'''
this code is based on official demo at:
https://cloud.tencent.com/document/product/1093/35734
一句话识别 python SDK
install SDK: pip install tencentcloud-sdk-python
'''
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile i... | null | models/tencent_api_zh/asr_api.py | asr_api.py | py | 3,237 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr.write",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_n... |
279729898 | #!/usr/bin/python3
import json # used to parse and prettyPrint events
import sys
import pika # rabbitmq client
broker_address = "localhost"
broker_port = 5672
lifetime_topic = "service_lifetime"
lifetime_filter = "random"
lifetime_event = "{\"eventStage\":0,\"customMessage\":\"\",\"source\":\"B42E99C14DDA\",\"time... | null | scripts/general/publish_startup_event.py | publish_startup_event.py | py | 1,009 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pika.BlockingConnection",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pika.ConnectionParameters",
"line_number": 16,
"usage_type": "call"
}
] |
235101248 | import cv2
import socket
import select
cap = cv2.VideoCapture(0)
width = 320
height = 240
cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
stream = None
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.setsockopt(socket.SOL_SOCKET, ... | null | misc_code/takepicture.py | takepicture.py | py | 674 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_HEIGHT",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_... |
653010468 | from django.contrib.auth import authenticate, login, logout, get_user_model
from django.contrib import messages
from django.http import JsonResponse
from django.urls import reverse
from django.contrib.auth.hashers import make_password
from django.shortcuts import render, redirect
from django.views import View
from djan... | null | app1/views.py | views.py | py | 7,805 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.views.View",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "models.Donation.objects.all",
"line_number": 23,
"usage_type": "call"
},
{
"... |
279717864 | # -*- coding: utf-8 -*-
import numpy as np
from tkinter import *
from tkinter import messagebox
import networkx as nx
import matplotlib.pyplot as plt
from matplotlib import rc
from math import sin, cos, pi
from functools import partial
#***classes**********************************************************************... | null | old code/together.py | together.py | py | 10,974 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.close",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "tkinter.messagebox.showinfo",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": ... |
316193115 | from django.views.generic import TemplateView
from tictactoe.game.game import Gameboard
def _fetch_gameboard(request):
"""
Check session for saved gameboard or instantiate new gameboard
"""
gameboard = request.session.get('gameboard', None)
if not gameboard:
gameboard = Gameboard()
... | null | tictactoe/game/views.py | views.py | py | 2,279 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tictactoe.game.game.Gameboard",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.views.generic.TemplateView",
"line_number": 15,
"usage_type": "name"
}
] |
378717244 | #!/usr/bin/env python3
"""
Check how our fees compare to other fees peers are charged
This script requires describegraph.json
"""
import numpy as np
import networkx as nx
import loadgraph
mynodekey = '02e2bf9e87c7ba0ea046882d9b3301ca9a3b049aa920dccbd836c4008eac32d4e5' # Gridflare
median_payment = 100e3 # sat, Payme... | null | relativefees.py | relativefees.py | py | 2,957 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "loadgraph.fromjson",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "networkx.freeze",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"lin... |
415049999 | #!/usr/bin/ python
import numpy as np
import random
import time
from numba import jit
@jit(nopython=True)
def main():
#========== Input Parameters ===========
Lx = 10.0 # System length in X
Ly = 10.0 # System length in Y
Lz = 10.0 # System length in Z
N = 500 # Numbe... | null | verlet_numba.py | verlet_numba.py | py | 4,266 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.seed",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.float64",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.empty",
"line_nu... |
407075550 | from django.conf.urls import patterns, url
from rest_framework.urlpatterns import format_suffix_patterns
from .rest_views import PickupViewSet
urlpatterns = patterns('',
url(r'get/(?P<pk>[0-9]+)$', PickupViewSet.as_view({'get': 'get'}), name='get_pickup'),
url(r'list$', PickupViewSet.as_view({'get': 'l... | null | pickups/rest_urls.py | rest_urls.py | py | 725 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "rest_views.PickupViewSet.as_view",
"line_number": 6,
"usage_type": "call"
},
{
"api_... |
240858502 | import os
from datapackage import Package, Resource
from .. import DataStreamProcessor
class load(DataStreamProcessor):
def __init__(self, path, name=None, **options):
super(load, self).__init__()
self.path = path
self.options = options
self.name = name
def process_datapacka... | null | dataflows/processors/load.py | load.py | py | 1,049 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datapackage.Package",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
... |
496291592 | from __future__ import absolute_import
import itertools
from . import compat
def do_push(client, images):
push_results = [push(client, image) for image in images]
for evt in itertools.chain.from_iterable(push_results):
yield evt
def push(client, image_tag):
image, tag = image_tag
extra = {... | null | shipwright/push.py | push.py | py | 482 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.chain.from_iterable",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "itertools.chain",
"line_number": 10,
"usage_type": "attribute"
}
] |
613149745 | from tkinter import *
import time
from datetime import datetime as dt
import pandas
"""
class DepositWindow(object):
def __init__(self,window,account_path):
top=self.top=Toplevel(window)
self.account_path=account_path
self.top.wm_title("Deposit")
self.top.resizable(0,0)
... | null | Bank Using Txt File/BABU.py | BABU.py | py | 8,065 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
131803509 | import komand
from .schema import DomainsInput, DomainsOutput
# Custom imports below
class Domains(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name='domains',
description='To gather the lists of domains already added to the shared customer’s do... | null | cisco_umbrella_enforcement/komand_cisco_umbrella_enforcement/actions/domains/action.py | action.py | py | 1,494 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "komand.Action",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "schema.DomainsInput",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "schema.DomainsOutput",
"line_number": 12,
"usage_type": "call"
}
] |
75776762 | from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QAction
from PyQt5.QtWidgets import QFileDialog
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QTextEdit
from gui.helper import append_file_extension
from gui.helper import check_errors
from gui.helper import warning
from gui.windo... | null | gui/windows/main.py | main.py | py | 5,229 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QTextEdit",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QAction",
"line_number": 39,
"usage_type": "call"
},
{
"api... |
371344504 | """Miscellaneous primitive ops."""
from typing import List
from mypyc.ops import (
EmitterInterface, PrimitiveOp, none_rprimitive, bool_rprimitive, object_rprimitive, ERR_NEVER,
ERR_MAGIC, ERR_FALSE
)
from mypyc.ops_primitive import name_ref_op, simple_emit, binary_op, unary_op, method_op
def emit_none(emit... | null | mypyc/ops_misc.py | ops_misc.py | py | 4,297 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mypyc.ops.EmitterInterface",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "mypyc.ops_primitive.name_ref_op",
"line_number": 17,
"usage_type": "call"
},
{
"api_name":... |
598451792 | #!/usr/bin/python3
import numpy as np
import pandas as pd
import pickle
from sklearn.metrics import mean_squared_error
from sklearn.metrics.scorer import make_scorer
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import GridSearchCV
fro... | null | predictor.py | predictor.py | py | 8,579 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.metrics.scorer.make_scorer",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.mean_squared_error",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
... |
487138774 | # Copyright 2022 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import annotations
from dataclasses import dataclass
import logging
import sys
import traceback as tb
from types import TracebackType
from typing import Dict, Lis... | null | third_party/crossbench/crossbench/exception.py | exception.py | py | 7,862 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Tuple",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Type",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"li... |
628250706 | import logging
from ophyd import Device
from typhon.tools import TyphonLogDisplay
def test_log_display(qtbot):
dev = Device(name='test')
log_tool = TyphonLogDisplay.from_device(dev)
qtbot.addWidget(log_tool)
dev.log.error(dev.name)
assert dev.name in log_tool.logdisplay.text.toPlainText()
de... | null | tests/test_log.py | test_log.py | py | 467 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ophyd.Device",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typhon.tools.TyphonLogDisplay.from_device",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "typhon.tools.TyphonLogDisplay",
"line_number": 10,
"usage_type": "name"
},
{
... |
251975994 |
# TODOs:
# - use TensorArray as training buffers instead of FIFOQueue
# - recombine without blowing up numbers (should fit in 64bit word)
# - gradient computation + SGD
# - compare performance if native type is float64 instead of int64
# - performance on GPU
# - better cache strategy?
# - does it make sense to cache a... | null | src/tensorflow_encrypted/ops.py | ops.py | py | 27,234 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.log",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.int32",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.float32",
... |
368271399 | import pytz
import logging
from datetime import datetime
from odoo import models, fields, api, registry, _
from odoo.exceptions import ValidationError, UserError
from odoo.addons.mail.models import mail_template
from odoo.osv import expression
from ..pyzk.zk import ZK
from ..pyzk.zk.user import User
from ..pyzk.zk.e... | null | to_attendance_device/models/attendance_device.py | attendance_device.py | py | 57,129 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "odoo.api.model",... |
125670707 | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 2 18:22:01 2018
@author: NH
"""
import os
from flask import Flask, request, redirect, url_for,jsonify,render_template,flash
from werkzeug.utils import secure_filename
from pred_image import Predict
UPLOAD_FOLDER = r'D:\TV'
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png'... | null | app.py | app.py | py | 2,244 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "flask.request.fil... |
223076601 | from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, Float
from sqlalchemy.orm import relationship
from .base import Base
from .cryptocurrency import Cryptocurrency
from .mark import Mark
class Exchange(Base):
__tablename__ = 'exchanges'
id = Column(Integer, primary_key=True)
time_exchan... | null | models/exchange.py | exchange.py | py | 963 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "base.Base",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "sqlalchemy.Column",... |
149783846 | import pygame
from Scenes.SceneBase import SceneBase
from Scenes.MoonGameScene import MoonGameScene
from ImageCache.ImageLoader import GetImage
from UI.Button import Button
from UI.Text import Text
class Level1Opening (SceneBase):
def __init__(self):
SceneBase.__init__(self)
self.startbutton = Bu... | null | Scenes/Levels/Level1Opening.py | Level1Opening.py | py | 1,164 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "Scenes.SceneBase.SceneBase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "Scenes.SceneBase.SceneBase.__init__",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "Scenes.SceneBase.SceneBase",
"line_number": 12,
"usage_type": "name"
},
... |
429438915 | from collections import Counter
import pickle
import numpy as np
import math
import os
#storing the inverted index.
#all_terms[term] is a list of all the DocId's of the documents that
#the term appears in.
all_terms = {}
#mp[docid] stores a dictionary of the form - 'term' : 'frequency'
mp = {}
#storing the DocID o... | null | generate_vectors.py | generate_vectors.py | py | 1,899 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_numbe... |
189214985 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('security', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='loggedrequest',
name='request_timestamp',
field=models.DateTimeField(verb... | null | security/migrations/0002_auto_20151014_2159.py | 0002_auto_20151014_2159.py | py | 383 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 11,
"usage_type": "call"
},
{... |
597654503 | from typing import List, Set, Dict, Tuple, Optional, Any, Iterable
import json
import os
class Config:
def __init__(self) -> None:
self.config: dict = self.__getConfig()
self.schedulers: dict = self.config['jobs']
def get(self) -> Tuple[dict, dict]:
return self.config, self.scheduler... | null | src/helpers/config.py | config.py | py | 1,058 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Tuple",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os._Environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_n... |
132568958 | import paramiko
import os
import re
import numpy as np
from tomongdb import clusterstomongodb
def readoszicar(sftp, path):
'''
:param sftp: sftp connection
:param path: the oszicar path
:return: total energy and mag
'''
with sftp.open(path + "/OSZICAR", "r") as oszicar:
content = os... | null | datatomongdb/utils.py | utils.py | py | 2,637 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.findall",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
... |
335709741 | import discord
import asyncio
import logging
import os
import random
from random import randint
import re
from ordsprak import ordsprok_list as ord_list
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
if os.path.exists('.env'):
logging.info('Importing environment from .env...')
... | null | bot.py | bot.py | py | 1,655 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.exis... |
389139247 | import sqlite3
class Banco():
def __init__(self):
conn = sqlite3.connect('logins.db')
c = conn.cursor()
c.execute('''CREATE TABLE IF NOT EXISTS Usuarios(
email VARCHAR(30) NOT NULL,
nome VARCHAR(20) NOT NULL,
senha VARCHAR(20) NOT NULL,
... | null | FlaskTrain/site/banco.py | banco.py | py | 953 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 23,
"usage_type": "call"
}
] |
280361143 | """Define an object to interact with programs."""
from typing import Awaitable, Callable
class Program:
"""Define a program object."""
def __init__(self, request: Callable[..., Awaitable[dict]]) -> None:
"""Initialize."""
self._request: Callable[..., Awaitable[dict]] = request
async def ... | null | regenmaschine/program.py | program.py | py | 1,903 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Callable",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Awaitable",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Awaitable",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.