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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
247497733 | from __future__ import annotations
import sys
import traceback
import numpy as np
import cv2
from typing import List, Dict
from tqdm import tqdm
from logger import logger
from common_utils.check_utils import check_file_exists, check_required_keys, \
check_dir_exists
from common_utils.path_utils import get_filename,... | null | annotation_utils-master/build/lib/annotation_utils/ndds/structs/frame.py | frame.py | py | 17,026 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "common_utils.base.basic.BasicLoadableObject",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "annotation.NDDS_Annotation",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "common_utils.check_utils.check_required_keys",
"line_number": 44,
... |
548700570 | import pygame
import time
import random
'''
Importing pygame and initializing it.
making a layer
'''
pygame.init() # initializing pygame
display_width = 800
display_height = 600
block_colour=(0,0,255)
black = (0, 0, 0)
white = (255, 255, 255)
car_width = 73
gameDisplay = pygame.display.set_mode((display_width, dis... | null | completed basic game.py | completed basic game.py | py | 2,949 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
312979418 | import matplotlib.pyplot as plt
import numpy as np
class FindCenterPointState():
def __init__(self, background):
self.background = background
def __call__(self, grid):
xbackground = self.background[0][1]-self.background[0][0]
ybackground = self.background[1][1]-self.background[1][0]
xGridLine = [s... | null | PW/testingEnvironment/testingEnvironment/src/visualization/drawValueMap.py | drawValueMap.py | py | 1,557 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.meshgrid",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.pcolormesh",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "matplotlib.py... |
46583046 | # encoding: utf-8
'''
Created on 2013-5-26
@author: wolf_m
'''
from log.viper_log import ViperLogger
from twisted.internet import reactor
import time
CHECK_CONNECTOR_SERVER_INTERVAL = 60 * 5
logger = ViperLogger.getLogger()
class ConnectorGroup():
inst = None
def __init__(self):
self.connectorDic = ... | null | biz/ConnectorGroup.py | ConnectorGroup.py | py | 2,358 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "log.viper_log.ViperLogger.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "log.viper_log.ViperLogger",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 60,
"usage_type": "call"
},
{
"api_name"... |
146627175 | # -*- coding: utf-8 -*-
import json
import requests
from common_models import *
from core.common.plugin import AbstractPlugin
class Recover_service(AbstractPlugin):
def __init__(self, service_container, request_manager, database_url):
self.service_container = service_container
self.request_manag... | null | plugins/recover/recover.py | recover.py | py | 9,806 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "core.common.plugin.AbstractPlugin",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "requests.exce... |
90580596 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.tsa.api as tsa
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
from IPython.display import display
import seaborn as sns
from statsmodels.tsa.arima_model import ARMA
import statsmodels.api as sm
from statsmodels.tsa.... | null | time_series_functions.py | time_series_functions.py | py | 5,394 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "statsmodels.tsa.api.stattools.adfuller",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "statsmodels.tsa.api.stattools",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "statsmodels.tsa.api",
"line_number": 37,
"usage_type": "name"
... |
67120232 | from __future__ import annotations
from PySide2 import QtCore, QtWidgets
from ui.world.TileItem import TileItem
from battlefield.Cell import Cell
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ui.core.gameconfig.GameConfiguration import GameConfiguration
from battlefield.Battlefield import Battlefiel... | null | ui/world/GameWorld.py | GameWorld.py | py | 2,242 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PySide2.QtWidgets.QGraphicsItemGroup",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "PySide2.QtWidgets",
"line_number": 17,
"usage_type": "name"
},
{
"a... |
251002840 | import io
import logging
import textwrap
import traceback
from contextlib import redirect_stdout
import discord
from discord.ext import commands
from utils.functions import yes_or_no, create_default_embed
log = logging.getLogger(__name__)
class Admin(commands.Cog):
def __init__(self, bot):
self.bot = b... | null | cogs/admin.py | admin.py | py | 3,708 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "... |
543958908 | from collections import defaultdict
import chainer
import chainer.functions as F
import chainer.links as L
import numpy as np
from graph_learning.dataset.crf_pact_structure import CRFPackageStructure
from graph_learning.model.open_crf.cython.factor_graph import FactorGraph
from graph_learning.model.open_crf.cython.op... | null | graph_learning/model/st_attention_net/st_relation_net_plus.py | st_relation_net_plus.py | py | 9,679 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "chainer.initializers.LeCunUniform",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "chainer.initializers",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "chainer.Chain",
"line_number": 20,
"usage_type": "attribute"
},
{
"ap... |
69493098 | import openpyxl as xl
def working_with_excel(name_of_excel_file,name_of_excel_sheet):
wb = xl.load_workbook(name_of_excel_file)
sheet = wb[name_of_excel_sheet]
return sheet
#Make a function and start coding here (An example is given below)
def anyFunction(sheet):
BCcount = 0
Zcount = 0
Bcount ... | null | General code for all excel sheet.py | General code for all excel sheet.py | py | 1,308 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 4,
"usage_type": "call"
}
] |
7414596 |
import tensorflow as tf
import numpy as np
from keras.preprocessing.image import load_img
from keras.preprocessing.image import img_to_array
from keras.applications.inception_v3 import preprocess_input
from keras.models import load_model
from vggish_input import wavfile_to_examples
import vggish_postproces... | null | fdnn.py | fdnn.py | py | 4,625 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.pad",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "tensorflow.get_default_graph",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "vggish_slim... |
549024152 | import numpy as np
import pandas as pd
from gym.utils import seeding
import gym
from gym import spaces
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Agg')
# shares normalization factor
# 20 shares maximum per trade
HMAX_NORMALIZE = 20
# initial amount of money we have in our account
INITIAL_ACCOUNT... | null | trainEnv/multi_stock_env.py | multi_stock_env.py | py | 6,898 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gym.Env",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "gym.spaces.Box",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "gym.spaces",
"line_numb... |
528980462 | from sim_wrapper.scenario_runner import ScenarioRunner
import os
import json
import numpy as np
import rescue.dataset.scenario_manager as scn_manager
import random
def get_test_scenarios():
return ["test{}".format(i) for i in range(500)]
def combine_team_scores():
all_scores = {}
with open("team_scores_... | null | rescue/analysis/test_scenarios.py | test_scenarios.py | py | 4,921 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 35,
... |
582629197 | #!/usr/bin/env python
import os
import sys
from flask import Flask, jsonify, abort, request, make_response
# Get program libs
sys.path.append('%s/lib' % sys.path[0])
import m2secret
import backup_adauth
app = Flask(__name__)
############################################################
### Error handling
#########... | null | src/lib/api_lib.py | api_lib.py | py | 3,905 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.make_response",
"li... |
357786512 | """The down command."""
from dbmisvc_stack.commands.base import Base
from dbmisvc_stack.app import Stack
import logging
logger = logging.getLogger("stack")
class Down(Base):
def run(self):
# Build the command.
command = ["docker-compose", "down"]
# Check for flags
if self.opti... | null | dbmisvc_stack/commands/down.py | down.py | py | 949 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dbmisvc_stack.commands.base.Base",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dbmisvc_stack.app.Stack.run",
"line_number": 36,
"usage_type": "call"
},
{
"api... |
162290194 | import re
import sqlalchemy.orm
import zeeguu
db = zeeguu.db
from zeeguu.model.domain_name import DomainName
class Url(db.Model):
__table_args__ = {'mysql_collate': 'utf8_bin'}
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(2083))
path = db.Column(db.String(2083))
ur... | null | zeeguu/model/url.py | url.py | py | 1,892 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "zeeguu.db",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "zeeguu.model.domain_name.DomainName.find",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "zeeguu.model.domain_name.DomainName",
"line_number": 25,
"usage_type": "name"
},... |
221334342 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Firefox(executable_path='/home/cristian/Downloads/geckodriver-v0.26.0-linux64/geckodriver')
url = "http://158.69.76.135/level0.php"
driver.get(url)
for i... | null | level_0/level_0.py | level_0.py | py | 492 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 5,
"usage_type": "name"
}
] |
297480081 | #!/usr/bin/env/python
'''
ModelProp
-----------------
Command line program to query fragility/vulnerability data from a database/file
according to a given schema and (optinally) for a set of taxonomies
Author: Massimiliano Pittore, GFZ-Potsdam
'''
import argparse
import os
import pandas as pd
import json
class Main(... | null | modelprop.py | modelprop.py | py | 7,282 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "json.decoder",
"line_numb... |
122292531 | import cv2
import os
def sliding_window(img_path, save_dir, winW, winH, stepsize, dirname):
img = cv2.imread(img_path)
h, w, _ = img.shape
for y in range(0, h, stepsize):
for x in range(0, w, stepsize):
trim_img = img[y: y + winH, x: x + winW]
filename = str(dirname... | null | sliding__window.py | sliding__window.py | py | 1,573 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.imwrite",
"line_number": ... |
189533643 | #-*- coding:utf-8 -*-
import urllib
import json
from httphelper import loginmessage
from httphelper import beforeHtml
class login(object):
def postList(self):
"""
post请求,模拟浏览器中抓包工具抓取http请求
:return:
"""
listUrl = "http://zggd.nbdeli.net/MemberCenter/MemberCenterAll.asmx/Ge... | null | nbdeli/handhelper/nbdelilogin/login.py | login.py | py | 2,911 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "httphelper.loginmessage.userName",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "httphelper.loginmessage",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "httphelper.loginmessage.userPwd",
"line_number": 28,
"usage_type": "attribu... |
641113578 | from django.shortcuts import render
from django.views import generic
from django.db.models import Q
from .models import Jugadores
from .models import Estadios
from .models import Equipos
from .models import Fanaticos
from .models import Asientos
from .models import Palcos
from .models import Contrato_Palco
from .models... | null | reportes/views.py | views.py | py | 7,022 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 29,
"usage_type": "call"
},
{
"api_name"... |
76623153 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# A fuction to display a given index in the training data set
def drawNum(n):
if n < 60000:
image = data[n].reshape((28, 28))
plt.title('Class Label: {label}'.format(label=label[n]))
plt.imshow(image, cmap='gray... | null | naive_bayes_mnist.py | naive_bayes_mnist.py | py | 4,293 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.title",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.imshow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matp... |
570345593 | # -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.db.models import Min, Max, Sum, Count, Avg, Q, F, Func, Value, IntegerField, FloatField, CharField, Case, When, Window
from django.db.models.functions im... | null | shop/discountapp/templatetags/discounttag.py | discounttag.py | py | 4,080 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.template.Library",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "datetime.... |
254969407 | # Deep Q-learning Agent
import collections
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam
import tensorflow as tf
from keras import backend as K
import numpy as np
import random
class DQNAgent:
def __init__(self,
state_size,
... | null | agents/ddqn_agent.py | ddqn_agent.py | py | 6,878 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "keras.optimizers.Adam",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "tensorflow.get_default_graph",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "... |
575550230 | #!/usr/bin/env python
##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free software: you can redistribute it and/or modify
## it und... | null | src/sardana/tango/pool/Pool.py | Pool.py | py | 55,208 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyTango.Device_4Impl",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "taurus.core.util.log.Logger",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "PyTango.Device_4Impl.__init__",
"line_number": 55,
"usage_type": "call"
},
{
... |
333993064 |
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import *
metadata = sa.MetaData()
t_script = sa.Table('script', metadata,
sa.Column('script_id', INTEGER, primary_key=True, autoincrement=True, key=u'scriptId', doc=''),
sa.Column('script_word_code', CHAR(4), nullable=False, key=u'scriptCode', doc=''),
s... | null | db/schema.py | schema.py | py | 36,092 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.MetaData",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column... |
364106734 | """HelloWorld URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
... | null | HelloWorld/urls.py | urls.py | py | 2,248 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 44,
"usage_type": "call"
},
{
"api_nam... |
375866082 | import heapq
import time
import random
import json
import os
import sys
import inspect
import numpy as np
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from utils import (
analyze_pcc_emulator, get_emula... | null | pcc_emulator.py | pcc_emulator.py | py | 12,068 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "inspect.getfile",
"l... |
259001352 | from tkinter import *
from tkinter.filedialog import *
import os
from PIL import Image
import numpy as np
import cv2
import math
import time
from tkinter import messagebox
import random
#windows root.geometry('213x215')
#btn1=Button(frame,text='选择文件夹',command=askFile,width=28,height=8)
allFileNum = 0
fileList=[]
file... | null | picture.py | picture.py | py | 11,713 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox.showinfo",
"line_... |
381467713 | from selenium import webdriver
import re
class WebScrapper(object):
tags=["EUR_buy","EUR_sell","USD_buy","USD_sell","RUB_buy","RUB_sell"]
def __init__(self):
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--window-size=... | null | selenium_task/scrapper.py | scrapper.py | py | 1,612 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_n... |
180565067 | from flask import Flask, render_template, request, session, redirect, url_for, jsonify
import databaes
app = Flask(__name__)
app.config.from_object('config') # 读取配置文件
@app.route('/')
def index():
results = databaes.query_all('select * from t_article_type')
#try:
# return render_template('index.html', ... | null | run.py | run.py | py | 9,925 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "databaes.query_all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.meth... |
428211844 | #randomly sample a given number of regions from a bed file
import argparse
import pandas as pd
import pdb
def parse_args():
parser=argparse.ArgumentParser(description="randomly sample a given number of regions from a bed file")
parser.add_argument("--bed")
parser.add_argument("--n",type=int,default=None,hel... | null | seq_utils/sample_bed_file_randomly.py | sample_bed_file_randomly.py | py | 1,093 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
}
] |
184964356 | # ----------------------------------------------
# this code take an image path as an argument and runs a foreground subtraction on it
# based on the code here:
# https://debuggercafe.com/image-foreground-extraction-using-opencv-contour-detection/
# ----------------------------------------------
import numpy as n... | null | portableCode/extract_foreground.py | extract_foreground.py | py | 4,191 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.uint8",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "cv2.findContours",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cv2.RETR_TREE",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "cv2.CHAIN_APPROX... |
346533834 | #!/usr/bin/env python
'''
Created on 10-01-2013
@author: QRC768
'''
import re
import tiles
import utils
class World:
'''Configuration data needed for playing game.'''
SETTINGS_FILE = 'pyrogue.cfg'
WORLD_MAP_FILE = 'res/map0_land.dat'
def __init__(self):
'''Set default values for config... | null | PyRogue/world.py | world.py | py | 3,636 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.match",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 48,
"usa... |
152848950 | import gzip
import re
import sys
import glob
from bs4 import BeautifulSoup
print('Reading in the text metrics data...')
lps = r'..-[^g].' #ESIM
lps = r'en-((de)|(ru))' #USFD
lps = r'..-en' #WMDO
lps = r'..-..' #BEER
lps = r'..-en' #bertr
lps = r'(en-((de)|(ru)))|(((de)|(ru))-en)' #LP + L... | null | experiments/statistical-analysis/wmt/data/submissions-corrected/correction-scripts/LP.py | LP.py | py | 3,997 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "glob.glob",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 55... |
32977960 | import scrapy
import json
import re
from scrapy.spiders import CrawlSpider
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
class LinkProofArtSpider(CrawlSpider):
name = "imageProofArt"
def start_requests(self)... | null | image_art_crawler/image_art_crawler/spiders/image_proof_spider.py | image_proof_spider.py | py | 1,400 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.spiders.CrawlSpider",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 15,
"usage_type": "name"
},
{
"api_name"... |
322021202 | #
# Copyright 2015 Quantopian, Inc.
#
# 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 wr... | null | tests/test_versioning.py | test_versioning.py | py | 5,293 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "zipline.finance.trading.SimulationParameters",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pytz.UTC",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_... |
410869070 | from selenium import webdriver
from fake_useragent import UserAgent
import time
# user-agent
ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36"
# driver
chrome_driver = "C:\chromedriver.exe"
# 關閉通知提醒
chrome_options = webdriver.ChromeOptions()
pre... | null | Auto Test/CheckOpenUA.py | CheckOpenUA.py | py | 1,480 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "fake_useragent.UserAgent",
"line_number": 25,
"usage_type": "call"
},
{
"api_... |
253292564 | """Bayesian techniques for structure learning, parameter learning, inference and sampling."""
# ------------------------------------
# Name : bnlearn.py
# Author : E.Taskesen
# Contact : erdogant@gmail.com
# Licence : See licences
# ------------------------------------
# %% Libraries
import os
imp... | null | bnlearn/bnlearn.py | bnlearn.py | py | 19,031 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
156787548 | import requests
from bs4 import BeautifulSoup
from decouple import config
import urllib
import os
base_url = "https://cafe.naver.com/joonggonara"
headers = { # 헤더를 넣지 않아도 작동하는 것을 확인했습니다.
'Content-Type': 'application/json; charset=utf-8',
'Accept-Language': 'ko-KR,ko;q=0.9,en-US',
'User-Agent': 'Mozilla/5.0 (Macintosh; ... | null | Backend/boardcrawl.py | boardcrawl.py | py | 1,637 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
234675130 | from collections import deque
n,k=map(int,input().split()) #n: 수빈이가 있는 위치, k: 동생이 있는 위치
check=[0 for i in range(100001)] #이동 횟수 저장(중복 피하기 위함)
'''
모든 경우의 수를 따짐 -> 한 단계 더 갈 때(+1,-1,*2)가 모두 비용이 같으므로 BFS이용
'''
def BFS(n,k):
go=deque()
go.append(n) # 시작, 수빈이가 있는 시작 위치를 큐에 삽입
while(go): #go 큐가 존재하면
... | null | week4/1697_숨바꼭질_minji-o-j.py | 1697_숨바꼭질_minji-o-j.py | py | 1,161 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 10,
"usage_type": "call"
}
] |
39752989 | # Importing the libraries
import numpy as np
import geneticDicisionTree
import time
from tqdm import notebook
def generation(X_train,X_vali,y_train,y_vali):
numberOfParents = 1000
numberOfParentsMating = 200
numberOfParameters = 7
numberOfGenerations = 100
# define the population size
... | null | Implementation.py | Implementation.py | py | 3,774 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "geneticDicisionTree.initilialize_poplulation",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "... |
270309390 | """
Command line utility:
Spike sorting `yass sort`
Neural network training `yass train`
Phy integration `yass export`
"""
import os
import os.path as path
import logging
import logging.config
import shutil
import click
import numpy as np
from yass import set_config
from yass import preprocess
from yass import proc... | null | src/yass/command_line.py | command_line.py | py | 15,431 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "click.group",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "click.argument",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "click.Path",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "click.option",
"line_number... |
328031476 | from src import InventoryAllocator
from os import walk, path
import json
testDir = "./test"
def sameMembers(list_a: list, list_b: list) -> bool:
for entry in list_a:
if entry not in list_b:
return False
return True
def run():
tests = []
for root, _, files in walk(testDir):
... | null | inventory-allocator/runtest.py | runtest.py | py | 1,022 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.walk",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 23,
"... |
216131928 | #!/usr/bin/python
import fractions
# Script info
SCRIPTTITLE = 'Fraction Tests'
SCRIPTVERSION = '0.2.1'
SCRIPTINFO = 'Perform fraction calculations'
def lcm(a, b):
return (a * b) // fractions.gcd(a, b)
SIMPLIFYRESULT_UNCHANGED = 0
SIMPLIFYRESULT_WHOLENUMBER = 1
SIMPLYFYRESULT_NEW = 2
def simplify(a, b):
... | null | modules/fractiontests.py | fractiontests.py | py | 3,420 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "fractions.gcd",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "fractions.gcd",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "fractions.gcd",
"line_number": 111,
"usage_type": "call"
}
] |
400686604 | import ssl
import json
import re
import getopt
import socket
import sys
import pymysql.cursors
import OpenSSL
import nmap
import shodan
import datetime
SHODAN_API_KEY = ""
bannerKeywordList = ['honeypot']
vmKeywordList = ['VMware', 'Qemu', 'VirtualBox']
conpotKeywordList = ['Technodrome', 'Mouser Factory', '88111222',... | null | HoneyPotDiscovery.py | HoneyPotDiscovery.py | py | 13,375 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "nmap.PortScan... |
444233651 | #Source:
#https://docs.opencv.org/master/d8/d01/group__imgproc__color__conversions.html#ga397ae87e1288a81d2363b61574eb8cab
#Import OpenCV library
import cv2 as cv
#Read pictures
path = input("Write full path to the picture: ")
pic = cv.imread(path)
#Recolor
pic1 = cv.cvtColor(pic,cv.COLOR_BGR2GRAY)
pic2 = cv.cvtColo... | null | grayscale_hsv.py | grayscale_hsv.py | py | 453 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"li... |
337196584 | import sys
from helper import read_data
def cast_to_numeric(string):
if string.find('.') == -1:
return int(string)
return float(string)
def heapify(array, root, size):
left_index = 2 * root + 1
right_index = left_index + 1
top_index = root
if (left_index < size) and (array[top_index]... | null | simple_sorting/heap_sort.py | heap_sort.py | py | 1,300 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "helper.read_data",
"line_number": 49,
"usage_type": "call"
}
] |
592943992 | import io
import numpy as np
import os
import pandas as pd
import struct
from thriftpy.protocol.compact import TCompactProtocolFactory
from . import encoding
from .converted_types import convert
from .thrift_filetransport import TFileTransport
from .thrift_structures import parquet_thrift
from .compression import deco... | null | fastparquet/core.py | core.py | py | 9,142 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "thrift_filetransport.TFileTransport",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "thriftpy.protocol.compact.TCompactProtocolFactory",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "compression.decompress_data",
"line_number": 27,
"u... |
306422715 | import tensorflow as tf
from tensorflow import keras
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import random
model = keras.Sequential([
keras.layers.Dense(2, activation=tf.nn.relu, input_shape=[1]),
# keras.layers.Dense(2, activation=tf.nn.tanh, input_shape=[1]),
# keras.layers... | null | hello-tensor.py | hello-tensor.py | py | 1,577 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.keras.Sequential",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras.layers.Dense",
"line_number": 9,
"usage_type": "call"
},
{
"api_name"... |
271576338 | # -*- coding: utf-8 -*-
"""
从FY-4A标称数据提取指定范围指定通道
Created on 2018/11/14 12:46:47
"""
import netCDF4 as nc
import numpy as np
from projection import latlon2linecolumn
# 各分辨率文件包含的通道号
CONTENTS = {'0500M': ('Channel02',),
'1000M': ('Channel01', 'Channel02', 'Channel03'),
'2000M': tuple([f'Channel... | null | swsw-data/src/main/resources/python/statellite/fy4a.py | fy4a.py | py | 5,488 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_... |
289742244 | import cv2
from cv2 import cv
import numpy as np
hatImg=cv2.imread("Hat-fez-icon.png",-1)
def detect(img):
cascade = cv2.CascadeClassifier("haarcascade_frontalface_alt.xml")
rects = cascade.detectMultiScale(img, 1.3, 4, cv2.cv.CV_HAAR_SCALE_IMAGE, (20,20))
if len(rects) == 0:
return [], img
re... | null | graphics_programming/assingment_20/Face.py | Face.py | py | 2,257 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.float32",
"line_n... |
341173785 | import requests
import re
from typing import Dict, Union, List
from datetime import date
ejidelnicek_url ="http://php2.e-jidelnicek.cz/menu/?canteenNumber=11160"
def _get_html(url: str) -> str:
" Returns html code of the given url. "
r = requests.get(url)
return r.text
def _get_days(html: str) -> str:
... | null | ejidelnicek/ejidelnicek.py | ejidelnicek.py | py | 1,957 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 2... |
433719964 | '''
Sort Characters By Frequency
Solution
Given a string, sort it in decreasing order based on the frequency of characters.
Example 1:
Input:
"tree"
Output:
"eert"
Explanation:
'e' appears twice while 'r' and 't' both appear once.
So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer.
... | null | leetcode/Sort Characters By Frequency.py | Sort Characters By Frequency.py | py | 1,423 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.Counter",
"line_number": 67,
"usage_type": "call"
}
] |
528940915 | # CUDA_VISIBLE_DEVICES=2 python train.py --datase CASIA-WebFace.zip --bs 256
from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
torch.backends.cudnn.bencmark = True
import os,sys
import cv2
import r... | null | afastrcnn/train.py | train.py | py | 8,245 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.backends",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.warnings.filterwarnings",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.warnings",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": ... |
208564641 | """
Copyright (c) 2017 Dependable Systems Laboratory, EPFL
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | null | s2e_env/commands/code_coverage/basic_block.py | basic_block.py | py | 9,385 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "s2e_e... |
491935795 | from pathlib import Path
import pandas as pd
from h2o import h2o
import yaml
import os
with open("config/config.yml", 'r') as config_file:
config = yaml.load(config_file)
h2o.init(ip="localhost", port=54321)
h2o.remove_all()
exportedH2ODatasetPath = config['data-path']
exportedH2ODatasetFileName = "H2ODF.h2odat... | null | feature-extraction/extract-light-features.py | extract-light-features.py | py | 3,492 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "yaml.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "h2o.h2o.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "h2o.h2o",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "h2o.h2o.remove_all",
"line_number":... |
542110761 | import sys
import os
import pickle
import time
import numpy as np
import scipy.optimize
import scipy.interpolate
import matplotlib.pyplot as plt
from rvspecfit import make_ccf
class CCFCache:
""" Singleton caching CCF information """
ccf_info = {}
ccfs = {}
ccf_models = {}
def get_ccf_info(spec_setu... | null | py/rvspecfit/fitter_ccf.py | fitter_ccf.py | py | 5,294 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rvspecfit.make_ccf.CCF_PKL_NAME",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "rvspecfit.make_ccf",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "rvspecfit.make_ccf.CCF_DAT_NAME",
"line_number": 39,
"usage_type": "attribute"
... |
453843898 | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 6 14:17:48 2017
@author: Shivam P. Kumar
"""
from keras.models import Sequential
from keras.layers import Convolution2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense
from keras.layers import Dropout
from keras.pre... | null | emojify/training/Training.py | Training.py | py | 1,703 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.models.Sequential",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.layers.Convolution2D",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras.layers.MaxPooling2D",
"line_number": 19,
"usage_type": "call"
},
{
"api_... |
608983728 | """
fun.py - Just a collection of random commands
Copyright 2014 Max Gurela
Licensed under the Eiffel Forum License 2.
"""
from willie import module,web
from willie.formatting import color
import json
import os
import string
import random
import re
from random import randint, choice
@module.commands('cwd')
def cwd(b... | null | fun.py | fun.py | py | 10,557 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "willie.module.commands",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "willie.module",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "willie.module.commands... |
422202318 | '''
Created on 2012-11-17
@author: Administrator
'''
from tools import simpleclient
from webapp.handlers.common import jsonify
import logging
import simplejson as json
LOG = logging.getLogger(__name__)
CLIENT = simpleclient.CLIENT
class Routes(object):
def __init__(self):
self.... | null | myserver/openstack/webapp/handlers/menus.py | menus.py | py | 5,234 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tools.simpleclient.CLIENT",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "tools.simpleclient",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "n... |
433084950 | import requests
import pandas as pd
df = pd.DataFrame()
columns = [
'title', 'episode_id', 'opening_crawl',
'director', 'producer', 'release_date'
]
# https://swapi.co/api/films/
r = requests.get('https://swapi.co/api/films/').json()
query = r['results']
for element in range(len(query)):
records = [
... | null | scripts/films.py | films.py | py | 696 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.DataFrame",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_records",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.Dat... |
86218260 | from pyramid.view import (
view_config,
view_defaults
)
@view_defaults(route_name='hello')
class TutorialViews(object):
def __init__(self, request):
self.request = request
self.view_name = 'TutorialViews'
# Retrieving /howdy/first/last the first time
@view_config(renderer='hel... | null | tutorial/views.py | views.py | py | 695 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyramid.view.view_config",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyramid.view.view_config",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyramid.view.view_defaults",
"line_number": 7,
"usage_type": "call"
}
] |
474156759 |
from __future__ import absolute_import, division, print_function
from scipy.fftpack import dct
from scipy import signal
import numpy as np
def windower(x, M, N):
# M avance entre vetanas
# N windowsize
T = x.shape[0]
m = np.arange(0, T- N + 1, M) # comienzos de ventana
L = m.shape[0] # N ve... | null | src/cepstrum_dtw_utils.py | cepstrum_dtw_utils.py | py | 4,947 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.arange",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.expand_dims",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_nu... |
345223704 | import os, gzip
import sys
import mxnet as mx
import numpy as np
class Dictionary(object):
def __init__(self):
self.word2idx = {}
self.idx2word = []
self.word_count = []
def add_word(self, word):
if word not in self.word2idx:
self.idx2word.append(word)
... | null | MxnetExamples/RNN/Word_LM/Data.py | Data.py | py | 3,015 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.int32",
"line_numbe... |
492079894 | from PySide2 import QtCore, QtWidgets, QtWebEngineWidgets
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, parent=None):
super().__init__(parent)
self.m_view = QtWebEngineWidgets.QWebEngineView()
self.setCentralWidget(self.m_view)
page = self.m_view.page()
page.f... | null | examples/webenginewidgets/maps/main.py | main.py | py | 2,122 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PySide2.QtWidgets.QMainWindow",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "PySide2.QtWidgets",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PySide2.QtWebEngineWidgets.QWebEngineView",
"line_number": 7,
"usage_type": "call"
}... |
92640546 | import time
import unittest
import random
from selenium.webdriver.remote.webelement import WebElement
import locators as lc
import page as pg
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support import... | null | unittests.py | unittests.py | py | 2,299 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.sleep",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.C... |
216881140 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
from collections import deque
class Node:
"""
Represents a single node in keyword tree
"""
def __init__(self, ch=None):
self.char = ch
self.transitions = []
self.results = []
self.fail = None
class AhoCorasick:
... | null | rottoscraper/scraper/aho.py | aho.py | py | 3,309 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 42,
"usage_type": "call"
}
] |
448173144 | import ROOT
from itertools import product
from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer
from PhysicsTools.Heppy.analyzers.core.AutoHandle import AutoHandle
from PhysicsTools.HeppyCore.utils.deltar import deltaR
from PhysicsTools.Heppy.physicsobjects.L1Candidate import L1Candidate
from PhysicsTools.H... | null | python/analyzers/L1TriggerAnalyzer.py | L1TriggerAnalyzer.py | py | 3,471 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PhysicsTools.Heppy.physicsobjects.Jet.Jet",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PhysicsTools.Heppy.physicsobjects.Tau.Tau",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PhysicsTools.Heppy.physicsobjects.Muon.Muon",
"line_numbe... |
376355325 | from itertools import product
import pandas as pd
import pandas.util.testing as tm
import pytest
from dask.utils import raises
import dask.dataframe as dd
from dask.dataframe.utils import eq
@pytest.mark.parametrize(['npartitions', 'freq', 'closed', 'label'],
list(product([2, 5], ['30T', 'h'... | null | dask/dataframe/tseries/tests/test_resample.py | test_resample.py | py | 1,927 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.date_range",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.date_range",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "dask.dataframe.from... |
565310763 | import sqlite3
from sqlite3 import Error
from datetime import datetime
class UserDatabase:
def __init__(self):
self.conn = None
self.c = None
""" Creating DB Connection """
def create_conn(self, Path):
try:
self.conn = sqlite3.connect(Path)
se... | null | CustomCharacters/CharacterDatabase.py | CharacterDatabase.py | py | 2,397 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "sqlite3.Error... |
320939573 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2019 Kyoto University (Hirofumi Inaguma)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Self-attention encoder for Transformer."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
i... | null | neural_sp/models/seq2seq/encoders/transformer.py | transformer.py | py | 8,997 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "neural_sp.models.seq2seq.encoders.conv.ConvEncoder",
"line_number": 98,
"usage_type": "call"
},
{
"... |
388540445 | from config import mongoUrl
import pymongo
import csv
client = pymongo.MongoClient(mongoUrl)
db = client['circuitsortie']
EMAILS = db['email']
with open('./testing/mails.csv', 'r') as csvfile:
reader = csv.reader(csvfile)
# Ignore header
next(reader)
for row in reader:
email = row[0]
... | null | csv_to_db.py | csv_to_db.py | py | 610 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "config.mongoUrl",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "csv.reader",
"line_number": 10,
"usage_type": "call"
}
] |
213615425 | import time
import pandas as pd
import numpy as np
import datetime
CITY_DATA = { 'chicago': 'chicago.csv',
'new york city': 'new_york_city.csv',
'washington': 'washington.csv' }
months = ['january', 'february', 'march', 'april', 'may', 'june']
days = ['monday', 'tuesday', 'wednesday', 'thu... | null | bikeshare.py | bikeshare.py | py | 9,086 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_n... |
315399141 | from visual.IMPORT.IMPORT import * # Import all packages I need
# Import classes with Interface, styles and some activities
import sqlite3 as sql
from visual.mainWindow import MAIN
from visual.widgets.treeItem import TreeItem
from visual.widgets.errDialog import ErrorDialogue, HelpDialogue
DB_CLASSIC = ['*.db', '*.sq... | null | code/main.py | main.py | py | 25,280 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "visual.mainWindow.MAIN",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "visual.widgets.treeItem.TreeItem",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "visual.widgets.treeItem.TreeItem",
"line_number": 30,
"usage_type": "call"
},
... |
89021822 | import os,sys
import numpy as np
import pandas as pd
import xgboost as xgb
import re
from imblearn.ensemble import EasyEnsemble
from collections import Counter
import scipy.io as sio
import matplotlib.pyplot as plt
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import mutual_info_class... | null | Feature_selection/Feature_selection_evaluation.py | Feature_selection_evaluation.py | py | 5,872 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_num... |
131071257 | import base64
import hashlib
import os
import unittest
import fakeredis
import mock
import tornado.escape
import base
import imgrest.handlers
class UploadImageTest(base.BaseTest):
handler = imgrest.handlers.UploadImage
def __init__(self, *args, **kwds):
super(UploadImageTest, self).__init__(*args, *... | null | test/test_upload_image.py | test_upload_image.py | py | 5,360 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base.BaseTest",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "imgrest.handlers.handlers",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "imgrest.handlers",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "ba... |
444091157 | from django.conf.urls import patterns, include, url
from inicio.views import *
from inicio.views_login import *
from inicio.views_modal import *
urlpatterns = patterns('proyecto_colima.inicio',
#URL LOGOUT Y ADMINISTRACION
url(r'^$', administracion, name="index"),
url(r'^logout/$', logout_web, name="logou... | null | proyecto_colima/inicio/urls.py | urls.py | py | 10,169 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dja... |
3291460 | import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from sklearn.mixture import GaussianMixture
from sklearn.mixture import BayesianGaussianMixture
from csv_utils import decode_csv
pie = decode_csv('./spca_pie2_large.csv')
imagen = decode_csv('./spca_imagen_large.csv')
# pie =... | null | Clustering/spca.py | spca.py | py | 2,002 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "csv_utils.decode_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "csv_utils.decode_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.vstack"... |
264716209 | import requests
def get_src(name):
api_url = "https://csgoempire.com/api/v2/inventory/site/10"
r = requests.get(api_url).json()
details = []
for i in range(len(r)):
if r[i]["appid"] == 570:
details.append(r[i])
price = 10000000
src = "na"
name = name
for i in range(... | null | skin_details.py | skin_details.py | py | 588 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
}
] |
540568770 | #code to set and reset attenuator
import serial
#def set_attenuator():
class att:
def __init__(self, interface, arg1 , arg2):
s_att=serial.Serial(port='COM30', bauddrate=9600, bytesize=8, parity='N', stopbits=1,timeout=1)
def init_attenuator():
s_w1 = 'sa1 '+ str(0)+'\r'
s_att.write(s_w1)
s_att... | null | attenuator_control.py | attenuator_control.py | py | 569 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "serial.Serial",
"line_number": 8,
"usage_type": "call"
}
] |
281005113 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: /home/idle/projects/gitdev/oauthost/sandbox/oauthost/management/commands/syncscopes.py
# Compiled at: 2011-11-09 10:41:10
from os import path
from inspect import... | null | pycfiles/django_oauthost-1.1.0-py2.py3-none-any/syncscopes.py | syncscopes.py | py | 2,730 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.core.management.base.CommandError",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.INSTALLED_APPS",
"line_number": 21,
... |
57064324 | from django.shortcuts import render, redirect
from .forms import UserRegistration
from .models import Feedback, Comment
from django.views.generic import ListView, CreateView, DetailView, UpdateView, DeleteView, View
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
########################... | null | main/views.py | views.py | py | 12,862 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "forms.UserRegistration",
"line_number": 34,
"usage_type": "call"
},
{
"api_name":... |
101162227 | from PIL import Image
from icrawler.builtin import GoogleImageCrawler
import os
from colouring import Colour
def download_img(query):
google_crawler = GoogleImageCrawler(storage={'root_dir': './'})
google_crawler.crawl(keyword=query, max_num=1)
def get_pixels(image):
art = []
rgb_of_image = image.co... | null | main.py | main.py | py | 2,068 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "icrawler.builtin.GoogleImageCrawler",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "colouring.Colour.exact_rgb",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "colouring.Colour",
"line_number": 21,
"usage_type": "name"
},
{
"ap... |
233289704 | import json
# Ver1 , just dict type
each_task = dict()
each_task['Uri'] = "asdf"
each_task['Title'] = "okok"
each_task['Description'] = "it's fine"
each_task['Done'] = 1
# Turn python object to json format
json_format = json.dumps(each_task)
print(json_format)
print(type(json_format))
# Turn python object to json fo... | null | json_practice.py | json_practice.py | py | 580 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.dumps",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 25,
"usage_type": "call"
}
] |
65484286 | from capstone import *
from capstone.arm import *
from capstone.x86 import *
from abc import ABCMeta, abstractmethod
from ..smtlib import Expression, Bool, BitVec, Array, Operators, Constant
from ..memory import MemoryException, FileMap, AnonMap
from ...utils.helpers import issymbolic
from ...utils.emulate import Unico... | null | manticore/core/cpu/abstractcpu.py | abstractcpu.py | py | 19,473 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "abc.abstractmethod",
"line_number": 98,
"usage_type": "name"
},
{
"api_name": "smtlib.Operato... |
236029840 | import os
import datetime, time
import json
import itertools
from timeit import default_timer as timer
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Dense
import rinokeras as rk
from rinokeras.models.transformer import Transformer
from SketchformeExperiment import SketchformeExperi... | null | tf/scene_composer/train.py | train.py | py | 7,003 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.app",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "Sketchforme... |
305665517 | import os
import nltk
import numpy as np
import string
import sys
FILE_MATCHES = 1
SENTENCE_MATCHES = 1
def main():
# Check command-line arguments
if len(sys.argv) != 2:
sys.exit("Usage: python questions.py corpus")
# Calculate IDF values across files
files = load_files(sys.argv[1])
fil... | null | Questions/questions.py | questions.py | py | 7,189 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "nltk.sent_tokenize",
"line_n... |
173642248 | """
Plone Functional test for copy&paste, cut&paste, and rename.
"""
from unittest import defaultTestLoader
import transaction
from ore.contentmirror import schema
from ore.contentmirror.ptests.base import MirrorTestCase
class CopyPasteRemoveTest(MirrorTestCase):
def _create_content(self, id):
self.lo... | null | ore.contentmirror/branches/0.6/ore/contentmirror/ptests/test_copymove.py | test_copymove.py | py | 4,917 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ore.contentmirror.ptests.base.MirrorTestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "transaction.commit",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ore.contentmirror.schema.content.select",
"line_number": 19,
"usage_type"... |
245978774 | from unittest.mock import MagicMock
from requests import Response
import json
import os
from lizzy_client.lizzy import make_header, Lizzy
class FakeResponse(Response):
def __init__(self, status_code, text):
"""
:type status_code: int
:type text: ste
"""
self.status_code = ... | null | tests/test_lizzy.py | test_lizzy.py | py | 8,509 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.Response",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "unittest.mock.MagicMock",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "lizzy_client.lizz... |
648883508 | # -- ACCESS : methods for use by Gatekeeper and Dooropener
import logging
from flask import Blueprint, jsonify
from app_code.util import returns_text
from AccessDataStore import AccessDataStore
storage = AccessDataStore()
logger = logging.getLogger('access_api')
access_module = Blueprint('access', __name__)
# - li... | null | core/app_code/access/Access_api.py | Access_api.py | py | 1,942 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "AccessDataStore.AccessDataStore",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app_c... |
600458288 |
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.patches as mpatches
roundtriptimes= [107.41,138.55,97.8,78.32,138.55,104.51]
roundtriptimes2 = [115.34,109.28,118.32,104.25,93.82,136.73]
xerror = [129.17,152.42,76.98,99.24,63.35,121.23]
xerror2 = [118.54,106.53,117.08,115.71,99.79,103.8]... | null | DF/3g/bwm-3g.py | bwm-3g.py | py | 1,263 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.sort",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sort",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": ... |
46925351 | import unittest
from bpython.curtsiesfrontend import parse
from curtsies.fmtfuncs import yellow, cyan, green, bold
class TestExecArgs(unittest.TestCase):
def test_parse(self):
self.assertEquals(parse.parse(u'\x01y\x03print\x04'),
yellow(u'print'))
self.assertEquals(pars... | null | bpython/test/test_curtsies_parser.py | test_curtsies_parser.py | py | 804 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "bpython.curtsiesfrontend.parse.parse",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bpython.curtsiesfrontend.parse",
"line_number": 9,
"usage_type": "name"
},
... |
620879982 | import pandas as pd
import numpy as np
from datetime import datetime
# The purpose of this application is to keep my Bloemfontein property management in order..
# Basic data collection for future reference, if needed.
# - Lwazi Ndlovu, 28 May 2019
def view_current():
# For viewing current data on base.csv
try:
... | null | tenant_management.py | tenant_management.py | py | 6,316 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "datetime.da... |
164179987 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import numpy as np
import cv2
from scipy.optimize import linear_sum_assignment
from typing import Dict
import fvcore.nn.weight_init as weight_init
import torch
from torch import nn
from torch.nn import functional as F
from detectron2.layers import ... | null | SOLO/solo/arch.py | arch.py | py | 16,833 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "detectron2.modeling.backbo... |
232894530 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
#from django.db.models.signals import post_save
from djmoney.models.fields import MoneyField
from accountsApp.models import MyBaseUser as User
# Create your models here.
class Product(models.Model):
name = models.CharField(... | null | shopApp/models.py | models.py | py | 3,742 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 12,
"usage_type": "call"
},
{
"api_name"... |
14730698 | import os
import re
import tarfile
import collections
from hashlib import sha1
from pathlib import Path
from subprocess import check_output
from urllib.request import urlretrieve
from threading import Timer
from pkg_resources import resource_filename
from typing import Any
from typing import List
from typing import Dic... | null | markdownreveal/__init__.py | __init__.py | py | 10,781 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Dict",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "tarfile.TarInfo",
"line_number... |
646990397 | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.txt')) as f:
CHANGES = f.read()
requires = [
'thrift',
'python-dateutil',
'pytz',
]... | null | setup.py | setup.py | py | 918 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
64426677 | #!/usr/bin/env python
import os
import cv2
import numpy as np
import pandas as pd
from coordinates_merger import CoordinatesMerger
from poker.tools.mongo_manager import (StrategyHandler, UpdateChecker)
from poker import main
from table_tester import MyTableScreenBased
class ScrapingTester():
def __init__(self, ... | null | poker/tables/2-scraping_tester.py | 2-scraping_tester.py | py | 2,784 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "coordinates_merger.CoordinatesMerger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "poker.main.History",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "poke... |
545866294 | import csv
from io import StringIO
from collections import defaultdict
import lxml.etree as etree
import pyodbc as db
def xml_parser(xmlFile):
with open(xmlFile) as obj:
print('Starting Parse')
xmlTree = etree.parse(obj)
xmlRoot = xmlTree.getroot()
namespaces = {'x': 'http://schemas.d... | null | XMLParse.py | XMLParse.py | py | 3,727 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lxml.etree.parse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pyodbc.connect",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "pyodbc.connect",
"line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.