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
111712553
import requests def down_image(): headers = {'user-agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Mobile Safari/537.36'} url = "hhttp://resource.ttplus.cn/publish/app/data/2017/05/11/54680/9f845bad-c400-4ec9-b12d-bb2c33d29271.jpg" ...
null
down_pic.py
down_pic.py
py
533
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" } ]
296945042
import asyncio import aiohttp from app import config import sentry_sdk import wand.exceptions as we from fastapi import FastAPI, Header, Request from fastapi.responses import JSONResponse from fastapi.openapi.utils import get_openapi from fastapi.openapi.docs import get_redoc_html, get_swagger_ui_html, get_swagger_ui_...
null
app/main.py
main.py
py
5,796
python
en
code
null
code-starcoder2
76
[ { "api_name": "sentry_sdk.init", "line_number": 20, "usage_type": "call" }, { "api_name": "app.config.sentry", "line_number": 20, "usage_type": "attribute" }, { "api_name": "app.config", "line_number": 20, "usage_type": "name" }, { "api_name": "asyncio.get_event_l...
66650744
import webbrowser from app import app, db from flask import render_template, redirect, url_for from app.models import Recipe, Ingredient, Step, Counter, GroceryList, SeasonalIngredients from app import ask from flask_ask import statement, question, session ########## FLASK ROUTES ########## @app.route('/home/') def ...
null
app/routes.py
routes.py
py
14,297
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.render_template", "line_number": 13, "usage_type": "call" }, { "api_name": "app.app.route", "line_number": 11, "usage_type": "call" }, { "api_name": "app.app", "line_number": 11, "usage_type": "name" }, { "api_name": "app.models.Recipe.query.a...
543763265
# -*- coding: utf-8 -*- from odoo import api, models import datetime import logging class report_planilla_pdf(models.AbstractModel): _name = 'report.rrhh.planilla_pdf' def buscar_partida_nominas(self,slip_ids): cantidad_nominas_partida = 0 partidas = {} for slip in slip_ids: ...
null
rrhh/wizard/planilla_pdf.py
planilla_pdf.py
py
9,677
python
en
code
null
code-starcoder2
76
[ { "api_name": "odoo.models.AbstractModel", "line_number": 7, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 7, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.ge...
218291714
from requirements import * import re from collections import defaultdict import time, functools import utils import mymethods import team from json import loads from os import path from datetime import date from flask import session, g, url_for, redirect import ast #from flask_compress import Compress #from flask_cache...
null
appInitial.py
appInitial.py
py
144,024
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 32, "usage_type": "call" }, { "api_name": "flask.session.pop", "line_number": 43, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 43, "usage_type": "name" }, { "api_name": "flask.session", "line_n...
25985671
import serial import time def toByte(data_string, base): """ Converts any type of data to a byte to be sent""" intArray = int(data_string, base), byteArray = bytes(intArray) return byteArray ## Setting up serial connection ser = serial.Serial('/dev/cu.usbmodem14101') ## Data to be sent data = [1,2,3...
null
ArduinoConnectV1.py
ArduinoConnectV1.py
py
713
python
en
code
null
code-starcoder2
76
[ { "api_name": "serial.Serial", "line_number": 12, "usage_type": "call" } ]
151213535
import os import matplotlib import numpy as np from matplotlib import pyplot as plt from skimage.filters import gaussian from mpl_toolkits.axes_grid1 import make_axes_locatable def minmax(x): mnx = x.min() mxx = x.max() return ((x - mnx) / (mxx - mnx)) - 0.5 def renorm(x, pos, neg): return (np.maxim...
null
utils/new_both_grad_plot_scratch.py
new_both_grad_plot_scratch.py
py
5,778
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.maximum", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.minimum", "line_number": 16, "usage_type": "call" }, { "api_name": "mpl_toolkits.axes_grid1.make_axes_locatable", "line_number": 28, "usage_type": "call" }, { "api_name"...
221973622
import scrapy from bs4 import BeautifulSoup from JobsEasyScrape.modules.GetJobKeywords import JobKeywords class HexawareSpider(scrapy.Spider): name = 'hexaware' start_urls = ['http://hexaware.com/careers/jobs/india/'] jobtitleList = [] kw = JobKeywords() def parse(self, response): bsObj ...
null
JobsEasyScrape/spiders/Hexaware.py
Hexaware.py
py
853
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" }, { "api_name": "JobsEasyScrape.modules.GetJobKeywords.JobKeywords", "line_number": 11, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" } ]
31070714
import os import shutil import tempfile from contextlib import contextmanager @contextmanager def TemporaryDirectory(): """The day we drop python 2.7 support we can use python 3 version of this""" name = tempfile.mkdtemp() try: yield name finally: shutil.rmtree(name) @contextmanager ...
null
tests/utils/file_utils.py
file_utils.py
py
741
python
en
code
null
code-starcoder2
76
[ { "api_name": "tempfile.mkdtemp", "line_number": 10, "usage_type": "call" }, { "api_name": "shutil.rmtree", "line_number": 14, "usage_type": "call" }, { "api_name": "contextlib.contextmanager", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.join"...
640172592
import sys import pytz import re import os from datetime import datetime from lxml import etree from lxml.etree import XMLSyntaxError class SiteCountersParserOld: """3GPP version: 32.401 V1.0.0 LTE xml parser to extract limited set of site counters. """ def __init__(self, file_path): self...
null
extraction/parser_utils.py
parser_utils.py
py
7,528
python
en
code
null
code-starcoder2
76
[ { "api_name": "lxml.etree.parse", "line_number": 20, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 20, "usage_type": "name" }, { "api_name": "lxml.etree.XMLSyntaxError", "line_number": 26, "usage_type": "name" }, { "api_name": "sys.stderr.writ...
425987848
import random from threading import Thread import cv2 import logging from utils import * from queue import Queue import os import shutil import numpy as np def get_finished(): finished = [] with open("finish.txt", 'r') as f: lines = f.readlines() for line in lines: finished.append...
null
download_video.py
download_video.py
py
8,032
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 22, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "queue.Queue"...
587837958
#!/usr/local/bin/python3 import datetime import os import signal import socket import subprocess import sys import threading import time import traceback from optparse import OptionParser from http.server import BaseHTTPRequestHandler, HTTPServer from queue import Empty, Queue from socketserver import ThreadingMixIn ...
null
python/proc/process_monitor.py
process_monitor.py
py
63,357
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 26, "usage_type": "attribute" }, { "api_name": "socketserver.ThreadingMixIn", "line_number": 118, "usage_type": "name" }, { "api_name": "http.server.HTTPServer", "line_number": 118, "usage_type": "name" }, { "api_name": "...
219578512
import openpyxl as xl wb = xl.load_workbook("test1.xlsx") sheet1 = wb["Sheet1"] # cell1 = sheet1["a1"] cell1 = sheet1.cell(1, 2) for row in range(2, sheet1.max_row + 1): price = sheet1.cell(row, 3).value correct_price = price * 0.9 sheet1.cell(row, 4).value = correct_price wb.save("test2.xlsx")
null
homework/app.py
app.py
py
311
python
en
code
null
code-starcoder2
76
[ { "api_name": "openpyxl.load_workbook", "line_number": 4, "usage_type": "call" } ]
127335079
from __future__ import absolute_import from datetime import datetime from rest_framework.response import Response from sentry.api.bases.organization import OrganizationPermission from sentry.api.bases import OrganizationMemberEndpoint from sentry.models import Project, ProjectStatus, OrganizationMemberTeam from sen...
null
src/sentry/api/endpoints/organization_discover.py
organization_discover.py
py
3,176
python
en
code
null
code-starcoder2
76
[ { "api_name": "sentry.api.bases.organization.OrganizationPermission", "line_number": 17, "usage_type": "name" }, { "api_name": "sentry.api.bases.OrganizationMemberEndpoint", "line_number": 23, "usage_type": "name" }, { "api_name": "sentry.utils.snuba.raw_query", "line_number"...
441041932
from torchvision import transforms from PIL import Image import numpy as np import torch import json import cv2 import sys import os import cut model_path = "/program/wf/data/final_green/result/Exp_final/model/shufflenetv2b_wd2_332.pt" #model_path = "/program/services/workers/utils/shufflenetv2b_wd2_302.pt" #model_p...
null
TeaClassify/classify1.py
classify1.py
py
7,481
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.device", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 16, "usage_type": "attribute" }, { "api_name": "json.load", ...
171530824
import spacy import PyPDF2 #load english library nlp=spacy.load("en_core_web_sm") #function to convert .pdf to .txt file. def pdftotxt(pdfname): pdfob=PyPDF2.PdfFileReader(pdfname) with open('G:/Pycharm/Pycharm Projects/CTYHP/nltk_testing/karhis.txt','w') as f: for i in range(pdfob.getNumPages()): ...
null
spacy.py
spacy.py
py
765
python
en
code
null
code-starcoder2
76
[ { "api_name": "spacy.load", "line_number": 5, "usage_type": "call" }, { "api_name": "PyPDF2.PdfFileReader", "line_number": 9, "usage_type": "call" } ]
130417378
# coding: utf-8 import picamera import time import datetime #picamera Object 생성 with picamera.PiCamera() as camera: #해상도 선택 camera.resolution = (320, 240) now = datetime.datetime.now() file_name = '{}{}{}{}{}{}{}.jpg'.format( now.year, now.month, now.day, now.hour, now.minute, now...
null
byebye/inClass/pythonJoon/camera/pica2.py
pica2.py
py
411
python
en
code
null
code-starcoder2
76
[ { "api_name": "picamera.PiCamera", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "attribute" } ]
285682457
import numpy as np from kivy.vector import Vector import pygame from time import sleep pygame.init() # Initialize the joysticks pygame.joystick.init() #........................................................................................ while True: sleep(4) # EVENT PROCESSING STEP for event in pygame...
null
test.py
test.py
py
2,066
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.joystick.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.joystick", "line_number": 8, "usage_type": "attribute" }, { "api_name": "time.sleep", "...
33867859
from flask import send_file, safe_join; from .packer import packFiles; from . import configuration; import json; import requests; from rhythmic import rhythmicDB; def deployModel(data): """ var data = { "deploy_url": window.actual_deploy_destination, "deploy_id": window.the_model_deploy_id...
null
src/rhml_client/rhml_client/UI/helpers/deploy.py
deploy.py
py
2,987
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.dumps", "line_number": 38, "usage_type": "call" }, { "api_name": "packer.packFiles", "line_number": 54, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 62, "usage_type": "call" }, { "api_name": "json.loads", "line_numb...
174433718
import sys from loguru import logger from os import system, getenv from paramiko import SSHClient, AutoAddPolicy, RSAKey from paramiko.auth_handler import AuthenticationException, SSHException from scp import SCPClient, SCPException logger.add( sys.stderr, format="{time} {level} {message}", filter="client...
null
python_core/app/core/vm_machine_client.py
vm_machine_client.py
py
4,316
python
en
code
null
code-starcoder2
76
[ { "api_name": "loguru.logger.add", "line_number": 9, "usage_type": "call" }, { "api_name": "loguru.logger", "line_number": 9, "usage_type": "name" }, { "api_name": "sys.stderr", "line_number": 10, "usage_type": "attribute" }, { "api_name": "loguru.logger.add", ...
379471749
#!/usr/bin/python import requests import json import argparse import os import logging import ConfigParser def OS_login(username, password, tenant,keystone): #Logs into provided Openstack with provided auth details. Returns login object. auth = {'auth': {"tenantName": tenant, "passwordCredentials": {"username...
null
kubernetes-ansible-metac/k8s-deployer/deploytools/pre-deploy/pre-deploy.py
pre-deploy.py
py
15,216
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.post", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 18, "usage_type": "attribute" }, { "api_name": "logging.log", "...
627187987
from dateutil.parser import parse from watson_jira_next.src import config from jira import JIRA from typing import Optional jira: Optional[JIRA] = None class JiraException(Exception): pass def invalidate(): global jira jira = None def connect(): global jira if jira is None: jiraconfig...
null
watson_jira_next/src/jira.py
jira.py
py
2,518
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Optional", "line_number": 6, "usage_type": "name" }, { "api_name": "jira.JIRA", "line_number": 6, "usage_type": "name" }, { "api_name": "watson_jira_next.src.config.jira", "line_number": 21, "usage_type": "call" }, { "api_name": "watson_jira_...
500088428
from sklearn import svm from sklearn import preprocessing import sklearn.metrics import matplotlib.pyplot as plt import numpy as np import scipy from scipy.io import wavfile from scipy.fftpack import dct import matplotlib.pyplot as plt import librosa import math import wave from scipy.signal import lfilter, hamming imp...
null
tradiational_sound/svm_plp.py
svm_plp.py
py
3,159
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.newaxis", "line_number": 20, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 21, "usage_type": "call" }, { "api_name": "m...
396113044
import asyncio import aiomysql import discord import tabulate import textwrap import traceback from discord.ext import commands, tasks from discord.utils import get from collections import defaultdict from bot.bot import Bot from bot.utils.checks import is_dev from bot.utils.roles import get_add_remove, get_rolemap fr...
null
bot/cogs/utility/database.py
database.py
py
5,305
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Cog", "line_number": 20, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 20, "usage_type": "name" }, { "api_name": "bot.bot.Bot", "line_number": 23, "usage_type": "name" }, { "api_name": "bot.bo...
52035417
from collections import defaultdict def create_sets(dataset): s = set() for _set in dataset: for item in _set: s.add(item) return map(lambda x:frozenset([x]), sorted(s)) def support(D, sets, min_support): set_count = defaultdict(int) for _set in D: for s in sets: ...
null
apriori.py
apriori.py
py
2,525
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" } ]
48838697
#Script to connect to the coinranking.com ticker API and store the data import requests from pandas import DataFrame import json,time #Requestdata coinrankingrequest = 'https://api.coinranking.com/v1/public/coins?base=USD&limit=100&sort=marketCap' #Table Columns coinrankingFactColumns = ['id','symbol','rank',...
null
API_connect_coinranking.py
API_connect_coinranking.py
py
1,685
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 28, "usage_type": "call" }, { "api_name": "time.time", "line_number...
590073805
# This code is imported from the following project: https://github.com/asmith26/wide_resnets_keras import logging import sys import numpy as np from keras.models import Model from keras.layers import Input, Activation, add, Dense, Flatten, Dropout from keras.layers.convolutional import Conv2D, MaxPooling2D from keras....
null
narrow_resnet.py
narrow_resnet.py
py
4,506
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setrecursionlimit", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 14, "usage_type": "attribute" }, { "api_name": "keras.backe...
172376089
# -*- coding: utf-8 -*- from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np fig = plt.figure(figsize=(6, 4)) # Custom adjust of the subplots plt.subplots_adjust(left=0.05, right=0.95, top=0.90, bottom=0.05, wspace=0.15, hspace=0.05) ax = plt.subplot(111) # Let's create a ba...
null
pygis_src/ch09_basemap/sec3_with_data/test_9_3_1_anno.py
test_9_3_1_anno.py
py
1,545
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplots_adjust", "line_number": 12, "usage_type": "call" }, { "api_...
346178558
from datetime import datetime from flask import render_template, session, redirect, url_for, request, flash from flask_login import login_user, logout_user, login_required, current_user,UserMixin from . import main from .. import db from .. models import User, Role from ..decorators import admin_required, permission_r...
null
app/main/views.py
views.py
py
1,845
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "models.User.query.filter_by", "line_number": 16, "usage_type": "call" }, { "api_name": "models.User.query", "line_number": 16, "usage_type": "attribute" }, { "api_name...
64614484
from django.contrib import admin from .models import Actividades, Normativa # Register your models here. class ActividadesAdmin(admin.ModelAdmin): readonly_fields = ['creado', 'actualizado'] list_display = ['normativa', 'actividad', 'creado', 'actualizado'] class NormativaAdmin(admin.ModelAdmin): readonly...
null
webpersonal/actividades/admin.py
admin.py
py
521
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 9, "usage_type": "attribute" }...
367889204
# 读excel文件 def readExcel(readExcelNameOrPath='', readSheets=None, contentType='json'): import xlrd, os, json # 参数说明 # readExcelNameOrPath 读取excel的文件名称(aa.xls)或文件的绝对路径(r"E:\test\aa.xls"),如果为文件名称,必须放到当前目录下 # readSheets 要读取的sheet表名称,如果不设置默认读取第一个表,如果设置为all代表读取全部的sheet的内容,注意:只有['all']这种情况下才读取全部sheet #...
null
Test2.py
Test2.py
py
4,153
python
en
code
null
code-starcoder2
76
[ { "api_name": "xlrd.open_workbook", "line_number": 30, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 73, "usage_type": "call" } ]
548222019
"""Plugin Template Module """ from abc import ABC, abstractmethod import json import logging from os import environ, path as ospath from signal import signal, SIGTERM from time import asctime, gmtime, time from brain import connect from brain.binary import get as brain_binary_get from brain.jobs import transition_succ...
null
src/controller_plugin.py
controller_plugin.py
py
20,205
python
en
code
null
code-starcoder2
76
[ { "api_name": "abc.ABC", "line_number": 29, "usage_type": "name" }, { "api_name": "logging.basicConfig", "line_number": 102, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 108, "usage_type": "call" }, { "api_name": "logging.StreamHandler...
133732200
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import Flask, Blueprint, request, session, redirect, url_for from flask_oauthlib.client import OAuth from logging import StreamHandler, DEBUG, INFO, Formatter from collections import defaultdict import base64 import datetime import redis import os imp...
null
app/web/__init__.py
__init__.py
py
4,165
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setdefaultencoding", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "lin...
27603186
from django.urls import path from django.contrib.auth.views import LoginView, LogoutView from .views import signup app_name='accounts' urlpatterns = [ path('', LoginView.as_view(template_name='accounts/login.html'), name='login'), path('logout', LogoutView.as_view(), {'next_p...
null
meusLivrosLidos/accounts/urls.py
urls.py
py
414
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.auth.views.LoginView.as_view", "line_number": 9, "usage_type": "call" }, { "api_name": "django.contrib.auth.views.LoginView", "line_number": 9, "usage_type": "name" ...
429928022
from acaisdk.utils.exceptions import * from cliutils import * from acaisdk.file import File from acaisdk.fileset import FileSet from acaisdk.project import Project from acaisdk.utils.utils import debug from acaisdk.job import Job from acaisdk.meta import Meta, Condition from prettyprint import PrettyPrint import os fro...
null
acaicli/commands.py
commands.py
py
11,367
python
en
code
null
code-starcoder2
76
[ { "api_name": "acaisdk.file.File.convert_to_file_mapping", "line_number": 33, "usage_type": "call" }, { "api_name": "acaisdk.file.File", "line_number": 33, "usage_type": "name" }, { "api_name": "acaisdk.file.File.upload", "line_number": 44, "usage_type": "call" }, { ...
14710538
#import numpy as np import random as rd import pandas as pd import matplotlib.pyplot as plt pd.set_option("display.max_rows", 15) location = 'data/' filename = 'nflqb2019.csv' # This is a function to return general # statistics about a data set def f_calcStats(data): v_stats = data.describe() return v_st...
null
EDA/EDA_QB.py
EDA_QB.py
py
3,009
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.set_option", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 41, "usage_type": "call" }, { "api_name": "matplotlib....
479589445
import discord from discord.ext import commands from .utils import helper_functions as hf from datetime import datetime, timedelta, timezone import re import os from .utils.timeutil import format_interval dir_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) SPAM_CHAN = 275879535977955330 class ...
null
cogs/stats.py
stats.py
py
28,414
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.ext.commands.Co...
126807687
from flask import Flask, render_template, jsonify, request, Blueprint from flask.views import MethodView import json cars = [ { 'id': 1, 'model': 'Mersedes CLK 500', 'description': 'Color - white', }, { 'id': 2, 'model': 'KIA Sorento', 'description': 'Color -...
null
Flask_3/api/__init__.py
__init__.py
py
854
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.views.MethodView", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.render_template", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 23, "usage_type": "call" }, { "api_name": "fl...
598777832
from json import dump from sys import argv, exit from os.path import isfile, splitext from ql.grammar import parse_file as parse_ql from ql.visitors.symbol_checker import SymbolChecker from ql.visitors.type_checker import TypeChecker from ql.visitors.dependency_checker import DependencyChecker from qls.grammar import ...
null
JurgenPeter/main.py
main.py
py
2,416
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.dump", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 34, "usage_type": "call" }, { "api_name": "ql.visitors.symbol_checker.Symbol...
525776720
import sys from distest import TestCollector from distest import run_dtest_bot from dotenv import load_dotenv from time import sleep import os load_dotenv() TESTER = os.getenv('Tester') # The tests themselves test_collector = TestCollector() created_channel = None @test_collector() async def test_scrum(interface):...
null
src/tests/test_basic.py
test_basic.py
py
1,026
python
en
code
null
code-starcoder2
76
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "distest.TestCollector", "line_number": 13, "usage_type": "call" }, { "api_name": "time.sleep", "l...
524387182
from django.contrib import admin from . models import (User, Counsellee, Counsellor, Counselling, Category) # Register your models here. class CounsellingAdmin(admin.ModelAdmin): list_display = ['counsellor', 'counsellee', 'date_contacted'] list_filter = ['date_contacted'] class CounselleeAdmin(admin.ModelAdmin): ...
null
users/admin.py
admin.py
py
752
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 9, "usage_type": "attribute" }...
558821315
import tweepy import json import pprint from ipdb import set_trace def main(): with open('details.txt') as details: CONSUMER_KEY = details.readline().rstrip() CONSUMER_SECRET = details.readline().rstrip() ACCESS_TOKEN = details.readline().rstrip() ACCESS_TOKEN_SECRET = details.read...
null
fetchTweets.py
fetchTweets.py
py
782
python
en
code
null
code-starcoder2
76
[ { "api_name": "tweepy.OAuthHandler", "line_number": 13, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 15, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 25, "usage_type": "call" } ]
440304983
import typing from ..controller import Controller class Players: __players_key: str __player_message_key: str def __init__(self, chat_id: int): self.__players_key = f'players:{chat_id}' self.__player_message_key = f'player:message:{chat_id}' async def get_players(self) -> typing.Lis...
null
cache/models/players.py
players.py
py
1,141
python
en
code
null
code-starcoder2
76
[ { "api_name": "controller.Controller.lrange", "line_number": 15, "usage_type": "call" }, { "api_name": "controller.Controller", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 14, "usage_type": "attribute" }, { "api_name": "c...
370401860
""" Usage: python3 ./test_cases.py [raw] Connects to the flask host and triggers cases. Outputs the response as either formatted(default) or raw data. Set the following environment variables to match your test setup: TEST_FLASK_HOST = example: http://127.0.0.1 TEST_FLASK_PORT = example: 5000 """ import sys import re...
null
dev-db/test_cases.py
test_cases.py
py
1,292
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getenv", "line_number": 16, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 29, ...
21859352
import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches import matplotlib.lines as mlines from matplotlib.ticker import FuncFormatter colors = ['#1f77b4', '#ff7f0e'] plt.style.use('seaborn-ticks') fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(15, 5.95)) # Creati...
null
scripts/compare_population_suicide.py
compare_population_suicide.py
py
2,488
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 9, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name"...
167035752
""" Assuming that physical state is described by a dict() """ import copy import deepdiff class BeliefStateSimple: def __init__(self, physical_state, prob=1): if isinstance(physical_state, dict): self.states = [ (physical_state, prob) ] elif isinstance(physi...
null
bsagr/bs_interface.py
bs_interface.py
py
6,455
python
en
code
null
code-starcoder2
76
[ { "api_name": "deepdiff.DeepDiff", "line_number": 33, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 84, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 85, "usage_type": "call" }, { "api_name": "copy.deepcopy", "li...
485828098
import sys import warnings try: import multiprocessing except: pass try: from notsetuptools import setup except ImportError: # If you are using namespaces you should **not** allow installation of your package without # using the ``notsetuptools`` package. warnings.warn('You are missing the ``n...
null
setup.py
setup.py
py
1,126
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.warn", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 20, "usage_type": "attribute" }, { "api_name": "setuptools.setup", "line_number": 40, "usage_type": "call" }, { "api_name": "setuptools.find_packages...
10909169
#!/usr/bin/env python """Script to load runinfo from the lims process: 'Illumina Sequencing (Illumina SBS) 4.0' into the flowcell database in statusdb. Maya Brandi, Science for Life Laboratory, Stockholm, Sweden. """ import sys import os import codecs import logging from optparse import OptionParser from pprint impo...
null
scripts/flowcell_summary_uppload_LIMS.py
flowcell_summary_uppload_LIMS.py
py
5,933
python
en
code
null
code-starcoder2
76
[ { "api_name": "genologics.config.BASEURI", "line_number": 21, "usage_type": "argument" }, { "api_name": "genologics.config.USERNAME", "line_number": 21, "usage_type": "argument" }, { "api_name": "genologics.config.PASSWORD", "line_number": 21, "usage_type": "argument" }...
47800239
import constant as c from bs4 import BeautifulSoup import sys import os def submission(session): print("started submission...") if os.path.exists(c.source_code_path): f = open(c.source_code_path) source_code = f.read() f.close() else: print("source code is not exist") ...
null
submit.py
submit.py
py
896
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "constant.source_code_path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "constant.s...
570126126
from flask import current_app, request, redirect, url_for, render_template, flash, abort from flask.ext.login import login_user, login_required, logout_user from itsdangerous import URLSafeSerializer from app.extensions import lm from app.user.models import User, UserProfile from app.user.forms import RegisterUserForm ...
null
app/auth/views.py
views.py
py
1,548
python
en
code
null
code-starcoder2
76
[ { "api_name": "app.user.models.User.get_by_id", "line_number": 13, "usage_type": "call" }, { "api_name": "app.user.models.User", "line_number": 13, "usage_type": "name" }, { "api_name": "app.extensions.lm.user_loader", "line_number": 11, "usage_type": "attribute" }, {...
430798980
"""Tests for pypackages' guessing features.""" import os import sys import mock import pytest from collections import OrderedDict from pypackage import guessing from pypackage.config import Config from pypackage.cmdline import get_options def test_ignored_data_files(with_data): """Ensure that files in ignored ...
null
test/test_guessing.py
test_guessing.py
py
2,763
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.mkdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": ...
408779145
__author__ = 'qherrero' import sys import resources_rc from os import path from PyQt4 import QtGui, QtCore, uic from PyQt4.QtCore import Qt from matplotlib.figure import Figure from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from numpy import genfromtxt, where, copy, gradient, amin, a...
null
main.py
main.py
py
7,367
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt4.QtCore.QCoreApplication.addLibraryPath", "line_number": 14, "usage_type": "call" }, { "api_name": "PyQt4.QtCore.QCoreApplication", "line_number": 14, "usage_type": "attribute" }, { "api_name": "PyQt4.QtCore", "line_number": 14, "usage_type": "name" ...
31288155
import argparse import csv import operator import os import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn import metrics ######################################### # Python 3.7.9 # # input = csv file # # output = 'ROC.pdf' ...
null
python/src/Step2_ROC_Plot.py
Step2_ROC_Plot.py
py
2,933
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.basename", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
592033730
#coding:utf-8 import random, sys, time, pygame from pygame.locals import * import time # 屏幕刷新率(在这里相当于贪吃蛇的速度) FPS = 5 # 屏幕宽度 WINDOWWIDTH = 640 # 屏幕高度 WINDOWHEIGHT = 480 # 小方格的大小 CELLSIZE = 20 # 断言,屏幕的宽和高必须能被方块大小整除 assert WINDOWWIDTH % CELLSIZE == 0, "Window width must be a multiple of cell size." assert WINDOWHEIGHT %...
null
python/snake/resources/test.py
test.py
py
1,318
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 33, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 34, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 34, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mod...
440630047
# ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (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.mozilla.org/MPL/ # # Softwa...
null
test/utils.py
utils.py
py
7,838
python
en
code
null
code-starcoder2
76
[ { "api_name": "twisted.trial.unittest.TestCase", "line_number": 58, "usage_type": "attribute" }, { "api_name": "twisted.trial.unittest", "line_number": 58, "usage_type": "name" }, { "api_name": "twisted.internet.defer.DeferredList", "line_number": 100, "usage_type": "call...
465650571
from django.shortcuts import render, redirect from .models import Reservation from users.models import * from django.contrib import messages from restaurants.models import Restaurant def home(request): context = { 'reservations': Reservation.objects.all() } return render(request, 'reservation/home....
null
main_project/reservation/views.py
views.py
py
1,434
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Reservation.objects.all", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Reservation.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.Reservation", "line_number": 9, "usage_type": "name" }, { "ap...
333544285
import sys import base64 import struct import binascii def KSA(key): keylength = len(key) S = list(range(256)) j = 0 for i in range(256): j = (j + S[i] + key[i % keylength]) % 256 S[i], S[j] = S[j], S[i] # swap return S def PRGA(S): i = 0 j = 0 while True: i ...
null
2020/CJ2020/Crypto/Crypto Checksum/crypto_checksum.py
crypto_checksum.py
py
1,368
python
en
code
null
code-starcoder2
76
[ { "api_name": "struct.pack", "line_number": 37, "usage_type": "call" }, { "api_name": "binascii.crc32", "line_number": 37, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 43, "usage_type": "call" }, { "api_name": "base64.b64decode", "l...
430107770
import discord, discord.ext, glob, os from discord.ext import commands client = discord.Client() client = commands.Bot(command_prefix = '!') @client.event async def on_ready(): print(f"Logged in as {client.user}") ###################################################################### # Load commands (DONT TOUCH) f...
null
bot/bot.py
bot.py
py
851
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.Client", "line_number": 4, "usage_type": "call" }, { "api_name": "discord.ext.commands.Bot", "line_number": 5, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" }, { "api_name": "glob.glob",...
539923320
# -*- coding: utf-8 -*- # In order to properly run this script: # 1) make sure to source it to the relevant virtual environment # 2) open terminal and run : python utusu.py import os, sys # work-around for having the parent directory added to the search path of packages. # to make `import mlx.pympt` to work, even ...
null
mlxdriver/mlx/main.py
main.py
py
13,729
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number...
489502002
import RPi.GPIO as GPIO import time import datetime import picamera import subprocess import dropbox import os # Setup PIR sensor #----------------- iPIN_PIR1 = 7 iPIN_PIR2 = 23 GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) # identify by pin numbers (as opposed to GPIO numbers) GPIO.setup(iPIN_PIR1, GPIO.IN, ...
null
04_pirCameraDropbox_simplified.py
04_pirCameraDropbox_simplified.py
py
2,838
python
en
code
null
code-starcoder2
76
[ { "api_name": "RPi.GPIO.setwarnings", "line_number": 15, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 15, "usage_type": "name" }, { "api_name": "RPi.GPIO.setmode", "line_number": 16, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_n...
72374951
import utils import os import numpy as np import matplotlib.pyplot as plt def draw_plot(save_path): # load log train_log = utils.Logger(os.path.join(save_path,'train.log')) test_log = utils.Logger(os.path.join(save_path, 'test.log')) # read log train_log = train_log.read() test_log...
null
forgetting_events/plot_curves.py
plot_curves.py
py
1,122
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.Logger", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "utils.Logger", "line_number":...
293804185
from keras.layers import Input, Dense, Conv1D, MaxPooling1D, UpSampling1D from keras.models import Model from keras import backend as K from keras.utils import plot_model from keras.callbacks import TensorBoard from keras.callbacks import EarlyStopping from keras.models import model_from_json import json import time im...
null
PredictRaw.py
PredictRaw.py
py
4,128
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 27, "usage_type": "call" }, { "api_name": "getopt.getopt", "line_number": 36, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 36, "usage_type": "attribute" }, { "api_name": "getopt.GetoptError", "line...
592742461
import platform import time from math import ceil from threading import Lock from threading import Thread from kivy.app import App from kivy.uix.button import Button from kivy.uix.gridlayout import GridLayout from kivy.uix.label import Label from kivy.uix.progressbar import ProgressBar from kivy.uix.textinput import T...
null
stack_pic.py
stack_pic.py
py
12,934
python
en
code
null
code-starcoder2
76
[ { "api_name": "kivy.app.App", "line_number": 18, "usage_type": "name" }, { "api_name": "platform.system", "line_number": 34, "usage_type": "call" }, { "api_name": "data_sender.DataSender", "line_number": 70, "usage_type": "call" }, { "api_name": "threading.Lock", ...
125803562
# 获取转发信息# -*-coding:utf-8 -*- from multiprocessing import Process, Manager from time import sleep, ctime from get_cookie import get_session from task.repost import get_all from logger.log import other if __name__ == '__main__': # is_sleep用来防止启动模拟登录失败,也会睡眠2个小时 is_sleep = 1 while 1: mgr = Manager()...
null
repost.py
repost.py
py
998
python
en
code
null
code-starcoder2
76
[ { "api_name": "multiprocessing.Manager", "line_number": 14, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 16, "usage_type": "call" }, { "api_name": "get_cookie.get_session", "line_number": 16, "usage_type": "name" }, { "api_name":...
443015200
# # snapc.py ## utility to handle incremental merge backups retention # By Itai Weisman, Solution Engineering team leader, INFINIDAT # iweisman@infinidat.com +972-54-6755444 # Who | When | What # --------------------------------------------- # Itai Weisman | November 30 2018 | Genesis # Itai Weism...
null
snapc2.py
snapc2.py
py
6,720
python
en
code
null
code-starcoder2
76
[ { "api_name": "arrow.now", "line_number": 28, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 34, "usage_type": "call" }, { "api_name": "json.load", "line_number": 47, "usage_type": "call" }, { "api_name": "prettytable.PrettyTable",...
372303413
import numpy as np import matplotlib.pyplot as plt from scipy import interp from sklearn.metrics import roc_curve, auc from ._private import convert __all__ = [ 'random_forest_feature_importance', 'roc_graph' ] _ROC_PLOT_COLORS = ['b', 'g', 'r', 'c', 'm', 'y', 'k', 'darkorange'] def _display_roc_plot(xlim, ...
null
dython/model_utils.py
model_utils.py
py
10,609
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlim", "line_number": 17, "usage_type": "call" }, { "api_name": "matpl...
42513392
import requests from bs4 import BeautifulSoup import json import re import sys def clean_data(data): regex=re.compile("\n{1,}(\s+)?") new_data=re.sub(regex,"",data) return new_data # class Movie: # def __init__(self,title,year,rating,user_reviews,rated,hours,genre,rdate,summary,cast): # self.t...
null
compare_movies/review.py
review.py
py
3,336
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 8, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 37, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 38, ...
250439213
#!/usr/bin/env python #coding:utf-8 """ 网络并发获取图片或者其他内容的一个线程池 """ #多线程 import threading from multiprocessing import Queue from log import * threading_log_file = 'THREAD ' + time.strftime("%Y-%m-%d",time.localtime()) #线程池 class Threading_pool(object): #theading_queue = Queue(20) #线程相关,最大线程数max_threading_size,队列满等...
null
threading_pool.py
threading_pool.py
py
2,287
python
en
code
null
code-starcoder2
76
[ { "api_name": "multiprocessing.Queue", "line_number": 22, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 64, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 67, "usage_type": "call" }, { "api_name": ...
243696673
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='doxybook', version='...
null
setup.py
setup.py
py
860
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": "name" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "codecs.open", "line_number":...
261188824
from traitlets import Integer, Unicode, Bool, List, validate, observe, TraitError from ipywidgets import DOMWidget, register, Output from IPython.core.display import Javascript, display @register class SentinelTable(DOMWidget): _view_name = Unicode('SentinelTable').tag(sync=True) _view_module = Unicode('senti...
null
Jupyter/UniversalDisplay/CustomWidgets/SentinelTable/SentinelTable.py
SentinelTable.py
py
3,294
python
en
code
null
code-starcoder2
76
[ { "api_name": "ipywidgets.DOMWidget", "line_number": 7, "usage_type": "name" }, { "api_name": "traitlets.Unicode", "line_number": 8, "usage_type": "call" }, { "api_name": "traitlets.Unicode", "line_number": 9, "usage_type": "call" }, { "api_name": "traitlets.Unico...
179580367
from sklearn import svm from sklearn.neural_network import MLPClassifier from sklearn import datasets import numpy as np from sklearn.model_selection import train_test_split from sklearn.metrics import classification_report from PIL import Image from sklearn.decomposition import PCA import time train_data_num = 60000 ...
null
mlp.py
mlp.py
py
1,841
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.fromfile", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.fromfile", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.uint8", "lin...
385933990
import ConfigParser import argparse from common import singleton @singleton class MarketConfigEntity: config_parser = None def get_parser(self): if not self.config_parser: cmd_args_parser = argparse.ArgumentParser() cmd_args_parser.add_argument('--config', dest = 'config', requ...
null
common/market_config.py
market_config.py
py
769
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "ConfigParser.ConfigParser", "line_number": 14, "usage_type": "call" }, { "api_name": "common.singleton", "line_number": 5, "usage_type": "name" } ]
298101157
import cv2 import numpy as np from matplotlib import pyplot as plt import os from six import string_types class cascadeFace(): def __init__(self): self.fileCasFace = '../haarcascades\\haarcascade_frontalface_default.xml' self.fileCasEye = '../haarcascades\\haarcascade_eye_tree_eyeglasses.xml...
null
src/detection/cascadeFace.py
cascadeFace.py
py
4,361
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.CascadeClassifier", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "six.string_ty...
419000559
import arxiv import maya import time """ Notes - This uses the classic Arxiv API which does not appear to support date range queries - Why is that? Reach out to make sure that's true. - According to blog posts they are revamping both search and the API right now - https://blogs.cornell.edu/arx...
null
query.py
query.py
py
3,421
python
en
code
null
code-starcoder2
76
[ { "api_name": "arxiv.query", "line_number": 40, "usage_type": "call" }, { "api_name": "maya.when", "line_number": 50, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 61, "usage_type": "call" }, { "api_name": "arxiv.query", "line_number": 64,...
93950238
#!/usr/bin/python3 import re import datetime from rtm.core.Helpers import simple_normalize_input, inline_entry_properties def parse_eri_2g(file, dict_counters): date_time = '' cell_name = '' data = [] index = 0 counters_index = {} with open(file, "r") as file: for line in file: line = simple_normalize_in...
null
scripts/rtm_old/rtm/parse/Ericsson2g.py
Ericsson2g.py
py
1,655
python
en
code
null
code-starcoder2
76
[ { "api_name": "rtm.core.Helpers.simple_normalize_input", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 38, "usage_type": "attribute" }, ...
289434178
""" https://leetcode.com/problems/optimize-water-distribution-in-a-village/discuss/472033/Python-Solution-Easy-to-Understand """ import collections import heapq class Solution: def minCostToSupplyWater(self, n: int, wells, pipes) -> int: graph = collections.defaultdict(list) for u, v, cost in pipe...
null
LeetcodeNew/python2/LC_1168.py
LC_1168.py
py
1,736
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 23, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_number": 30, "usage_type": "call" } ]
400162691
import matplotlib.pyplot as plt import random as rd import numpy as np plt.ion() t_list, m_list = [], [] #condição inicial def ic_04(i): r = rd.uniform(0.0,1.0) P = 0.4 if (i[...] == -1) and P > r: i[...] = 1 #criando o sistema def build_system(L): global time M = [[0 for x in r...
null
p1/votante/voter_singlerun.py
voter_singlerun.py
py
2,151
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.ion", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "random.uniform", "line_number": 10, "usage_type": "call" }, { "api_name": "random.randint",...
439906154
from typing import List class MergeIntervals: def merge(self, intervals: List[List[int]]) -> List[List[int]]: intervals.sort(key=lambda each: each[0]) mstart, mend=intervals[0] result=[] for i, interval in enumerate(intervals): cstart, cend=interval if men...
null
lastmile/leetcode/350/MergeIntervals.py
MergeIntervals.py
py
753
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
199021200
import pandas as pd from sklearn.cluster import KMeans from sklearn import metrics class Kmeans_Auto: def __init__(self, path_foot_print_detail, save_path_foot_print_detail): self.path_foot_print_detail = path_foot_print_detail self.save_path_foot_print_detail = save_path_foot_print_detail # d...
null
聚类K_MEANS_DBSCAN/自动化聚类/k_means_auto_screen_time.py
k_means_auto_screen_time.py
py
4,498
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_excel", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 48, "usage_type": "call" }, { "api_name": "sklearn.cluster.KMeans", "line_number": 58, "usage_type": "call" }, { "api_name": "sklearn.met...
441748115
from abc import ABC from copy import deepcopy from enum import Enum from typing import Callable, List, Union, Tuple import numpy as np from PartSegCore.algorithm_describe_base import ROIExtractionProfile, AlgorithmProperty, AlgorithmDescribeBase from PartSegCore.channel_class import Channel from PartSegCore.class_gen...
null
src/PartSeg_cellpose/cellpose_plugin.py
cellpose_plugin.py
py
5,115
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.Enum", "line_number": 18, "usage_type": "name" }, { "api_name": "PartSegCore.class_generator.enum_register.register_class", "line_number": 26, "usage_type": "call" }, { "api_name": "PartSegCore.class_generator.enum_register", "line_number": 26, "usage_...
64360363
#!usr/bin/env python ''' #-*- coding:utf-8 -*- @Author HardyYao @Time 2017/10/2 7:30 ''' import requests import xlwt import time import random from bs4 import BeautifulSoup from urllib.error import HTTPError, URLError from conn import headers class getZhengZhouFutures(object): def get_data(self, place_zhengzhou, ...
null
project/004 国内三大交易所数据爬虫程序/scraw_zhengzhou_data.py
scraw_zhengzhou_data.py
py
6,086
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "conn.headers", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.error.HTTPError", "line_number": 25, "usage_type": "name" }, { "api_name": "urllib.error.URLErro...
46158443
import math import pdb import sys import os.path import numpy as np import torch import torch.nn as nn import torchvision.transforms as transforms from torch.autograd import Variable import torchvision.models.vgg as models import json from PIL import Image import pickle from numpy.random import RandomState class Lea...
null
leave_out_grasps.py
leave_out_grasps.py
py
4,879
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.RandomState", "line_number": 26, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 37, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 43, "usage_type": "call" }, { "api_name": "pickle.load", "l...
78549010
import re from datetime import datetime from typing import Dict, List import requests from apps.logger.models import Log from django.core.management.base import BaseCommand from tqdm import tqdm class Command(BaseCommand): """Download command""" help = 'Download apache logs from external url' __pattern...
null
apps/logger/management/commands/download.py
download.py
py
3,323
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 11, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "apps.logger.models.Log.objects.all", "line_number": 38, "usage_type": "call" }, { ...
608745561
import pymysql import hashlib import re class Database_conductor(): def __init__(self, is_super_user): if is_super_user: pass self.database = 'rowdata' if is_super_user: self.connector = pymysql.connect(user='super_user', ...
null
Grapher/Database_conductor.py
Database_conductor.py
py
8,831
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymysql.connect", "line_number": 12, "usage_type": "call" } ]
156630018
# # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # from rlstructures.logger import Logger, TFLogger from rlstructures import DictTensor, TemporalDictTensor from rlstructures import logging...
null
tutorial/tutorial_reinforce/reinforce.py
reinforce.py
py
7,554
python
en
code
null
code-starcoder2
76
[ { "api_name": "rlstructures.logger.TFLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 46, "usage_type": "call" }, { "api_name": "rlstructures.batchers.EpisodeBatcher", "line_number": 47, "usage_type": "call" }, { "a...
183787552
# -*- coding: utf-8 -*- import logging import re import threading from zigbee_hub.telegesis.prompt_parsers import PROMPT_PARSERS class IncomingMessage(object): @staticmethod def is_incoming_message(message): """ :param message: the message :type message: unicode """ re...
null
zigbee_hub/serial_reader.py
serial_reader.py
py
3,155
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 62, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 77, "usage_type": "call" }, { "api_name": "zigbee_hub.telegesis.prompt_parsers.PROMPT_PARSERS.get", "line_number": 104, "usage_type": "call" }, ...
212608281
import numpy as np import matplotlib import matplotlib.pyplot as plt def calculateGradient(m, x, y, w0, w1, w2, w3, w4, w5): dw_0 = 1.0 / m * sum([(2 * (w0 - y[i])) for i in range(m)]) dw_1 = 1.0 / m * sum([(2 * ((w0 + w1 * x[i]) - y[i]) * x[i]) for i in range(m)]) dw_2 = 1.0 / m * sum([(2 * (...
null
HW1/assignment-1.py
assignment-1.py
py
5,617
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.power", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 11...
334507452
# # HTML code generator # import datetime import constants import structures import code_gen.templates.html as html_templates from .shared import indent class HtmlGenerator(): def __init__(self, module): # HTML overview list html_overview = indent(4) + '<table id="overview">\n' ...
null
code_gen/html.py
html.py
py
3,355
python
en
code
null
code-starcoder2
76
[ { "api_name": "shared.indent", "line_number": 15, "usage_type": "call" }, { "api_name": "shared.indent", "line_number": 18, "usage_type": "call" }, { "api_name": "shared.indent", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
589369281
""" Question: https://leetcode.com/problems/longest-line-of-consecutive-one-in-matrix/ Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be horizontal, vertical, diagonal or anti-diagonal. Example: Input: [[0,1,1,0], [0,1,1,0], [0,0,0,1]] Output: 3 Hint: The number of elemen...
null
python/coding_challenges/leet_code/longest_line_of_consecutive_one_in_matrix.py
longest_line_of_consecutive_one_in_matrix.py
py
1,730
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 18, "usage_type": "name" } ]
88414543
import cv2 import numpy as np img = cv2.imread(r'images\lotus.jpg', 0) out = [] for k in range(0, 7): # create an image for each k bit plane plane = np.full((img.shape[0], img.shape[1]), 2 ** k, np.uint8) # execute bitwise and operation res = cv2.bitwise_and(plane, img) # multip...
null
source/bitplane.py
bitplane.py
py
642
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.full", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.bitwise_and", "line_numbe...
191600708
from rllab.sampler.utils import rollout import argparse import numpy as np import joblib import uuid import tensorflow as tf from billiards_2D import Billiards_2D import json import matplotlib.pyplot as plt import os import pickle import IPython import imageio filename = str(uuid.uuid4()) root_dir = "Eval_Sequences/" m...
null
Experiment_4/Billiards/sim_policy.py
sim_policy.py
py
3,518
python
en
code
null
code-starcoder2
76
[ { "api_name": "uuid.uuid4", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number...
315418929
import os import pandas import base64 from flask import Blueprint, redirect, url_for, render_template, request, session, jsonify, json from flask_security import login_required, current_user from attrdict import AttrDict from ..connection import * from ..utils import empty_hydra_timeseries from OpenAgua import app...
null
OpenAgua/data_editor_advanced/views.py
views.py
py
7,548
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.session", "line_number": 28, "usage_type": "name" }, { "api_name": "flask.session", "line_number": 34, "usage_type": "name" }, { "api_name": "flask.session", "line_number": 61, "usage_type": "name" }, { "api_name": "flask.session", "line_n...
478866753
from setuptools import find_packages, setup with open("README.md", "r") as fh: long_description = fh.read() install_requires = [ "astunparse", "vyper @ git+https://github.com/vyperlang/vyper.git@8c925299833f6051fcf50ec3cdeef59c45346e45", ] dev_requires = ["ipdb", "ipython"] docs_requires = ["Sphinx"] tes...
null
setup.py
setup.py
py
1,481
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 28, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 47, "usage_type": "call" } ]
226162964
from Tkinter import * import tkMessageBox from datetime import datetime import struct from socket import * import socket import logging from tkFileDialog import * import csv #port scanner class class ScanPort : startAddress = "" #start IP address endAddress = "" #end IP address startPort = None #start por...
null
Information-Security/TermProject/portScanner.py
portScanner.py
py
6,293
python
en
code
null
code-starcoder2
76
[ { "api_name": "tkMessageBox.showerror", "line_number": 77, "usage_type": "call" }, { "api_name": "tkMessageBox.showerror", "line_number": 96, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 103, "usage_type": "call" }, { "api_name": "csv.QUOTE_A...
145404536
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /Users/jennyq/.pyenv/versions/venv_t12/lib/python3.7/site-packages/tendenci/apps/base/template_tags.py # Compiled at: 2020-02-26 14:47:57 # Size of source mod 2**...
null
pycfiles/tendenci-12.0.6-py3-none-any/template_tags.cpython-37.py
template_tags.cpython-37.py
py
7,950
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.Node", "line_number": 38, "usage_type": "name" }, { "api_name": "django.utils.translation", "line_number": 45, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 46, "usage_type": "attribute" }, { "api_nam...
531027132
from sqlalchemy import create_engine, Column, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///sample_db.sqlite3', echo=True) Base = declarative_base() class User(Base): __tablename__ = 'users' id = Column(Inte...
null
sample-Flask-SQLAlchemy/main.py
main.py
py
655
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.create_engine", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 13, "usage_type": "call" }, { ...
414848325
''' Virtual WhiteBoard by Rishikesh github : https://github.com/Rishikesh0005 linkedin: www.linkedin.com/in/rishikesh-n-27b927101 Full Stack Developer ''' import cv2 import numpy as np Width = 1080 #Set Width of the frame Height = 1080 ...
null
WhiteBoard.py
WhiteBoard.py
py
3,086
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 31, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 31, "usage_type": "attribute" }, { "api_name": "numpy.array", ...
38948473
''' BEGIN GPL LICENSE BLOCK This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it wi...
null
__init__.py
__init__.py
py
4,001
python
en
code
null
code-starcoder2
76
[ { "api_name": "importlib.reload", "line_number": 42, "usage_type": "call" }, { "api_name": "VTX.TCAutoVTX", "line_number": 62, "usage_type": "name" }, { "api_name": "V2X.TCVert2Intersection", "line_number": 63, "usage_type": "name" }, { "api_name": "XALL.TCInterse...
133922338
# __author: Igarashi # date: 2018/5/6 import pika credentials = pika.PlainCredentials("fuuka", "123456") connection = pika.BlockingConnection(pika.ConnectionParameters("192.168.80.133", credentials=credentials)) channel = connection.channel() channel.queue_declare("test") def callback(ch, method, properties, ...
null
PythonTest/pytest/test2.py
test2.py
py
465
python
en
code
null
code-starcoder2
76
[ { "api_name": "pika.PlainCredentials", "line_number": 7, "usage_type": "call" }, { "api_name": "pika.BlockingConnection", "line_number": 9, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 9, "usage_type": "call" } ]
449345818
from requests_html import HTMLSession import requests import os session = HTMLSession() import json import re import io def getDatalist(date, url, route, filename, name): today = date href = url + route r = session.get(href) sendData = [] # 只爬当天 items_a = r.html.find('ul.panel-list > li > a')...
null
function/common.py
common.py
py
2,011
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests_html.HTMLSession", "line_number": 4, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 36, "usage_type": "call" }, { "api_name": "io.open", "line_number": 54, "usage_type": "call" }, { "api_name": "json.dump", "line_num...