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
16996506
from eatsat.models import Restaurant, Account, Eatsat, WaitTime from django.shortcuts import render from django.http.response import HttpResponseRedirect from django.core.urlresolvers import reverse import datetime import math from django.core import serializers def index(request): restaurant_List = Restaurant.ob...
null
eatsat/views.py
views.py
py
4,865
python
en
code
null
code-starcoder2
76
[ { "api_name": "eatsat.models.Restaurant.objects.order_by", "line_number": 11, "usage_type": "call" }, { "api_name": "eatsat.models.Restaurant.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "eatsat.models.Restaurant", "line_number": 11, "usage_type...
318489273
''' interpolate and fit data from optoforce and apriltag date: 23 Aug 2018 author: nouyang ''' import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import os, glob, sys import math from scipy.interpolate import interp1d from sklearn import linear_model from sklearn import me...
null
sensor_input_scripts/apriltag_python/python/interp_linear.py
interp_linear.py
py
7,331
python
en
code
null
code-starcoder2
76
[ { "api_name": "seaborn.set", "line_number": 22, "usage_type": "call" }, { "api_name": "seaborn.set", "line_number": 24, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 32, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 44, ...
532652166
#!/usr/bin/env python3 import re import os from flask_bootstrap import Bootstrap from flask import Flask, render_template, Response from flask_limiter import Limiter from flask_limiter.util import get_remote_address import calculator from forms import SequenceForm app = Flask(__name__) app.config['SECRET_KEY'] = os...
null
app.py
app.py
py
1,445
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 15, "usage_type": "call" }, { "api_name": "flask_bootstrap.Bootstrap", "line_number": 18, "usage_type": "call" }, { "api_name": "flask_limiter.Limite...
601591673
import serial port = '/dev/ttyACM0' brate = 9600 cmd = 'temp' ser = serial.Serial(port, baudrate=brate, timeout=None) print(ser.name) while True: if ser.in_waiting != 0: content = ser.readline() print(content)
null
StudySeries/PythonRasp/serial_read.py
serial_read.py
py
232
python
en
code
null
code-starcoder2
76
[ { "api_name": "serial.Serial", "line_number": 7, "usage_type": "call" } ]
175517910
# -*- coding: utf8 -*- from bs4 import BeautifulSoup import urllib2 page = 1 f = open("NewsTitleList.csv", 'w') f.write('제목,언론사,시간\n') for i in range(1,20): url = "http://news.search.naver.com/search.naver?ie=utf8&where=news&query=%EC%88%98%EB%8A%A5+%EA%B2%BD%EC%B0%B0&sm=tab_pge&sort=1&photo=0&field=0&reporter_ar...
null
NaverNewsTitleCrawler.py
NaverNewsTitleCrawler.py
py
1,196
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib2.Request", "line_number": 12, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 15, "usage_type": "call" } ]
106192635
import pytest import sys, os myPath = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, myPath + '/../') from ct_district_lookup.lookup import State, Town class TestState(): def test_create(self): s = State('Test State') assert isinstance(s, State) def test_name(self): s =...
null
tests/test_state.py
test_state.py
py
2,543
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path.insert", "line...
622806614
"""module docstring""" import os import json from ibm_watson import LanguageTranslatorV3 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator from dotenv import load_dotenv load_dotenv() apikey = os.environ['apikey'] url = os.environ['url'] authenticator = IAMAuthenticator(apikey) language_translator = La...
null
final_project/machinetranslation/translator.py
translator.py
py
1,106
python
en
code
null
code-starcoder2
76
[ { "api_name": "dotenv.load_dotenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "ibm_cloud_sdk_core....
189992197
import os.path from util.hdsconstants import * import json from collections import defaultdict #Global Declarations appl_props= {} payload_props = {} separator = "=" keys = {} s=[] d = defaultdict(list) def loadPayloadProps(): print(os.path.join(project_root,RESOURCES_FOLDER,PROPS_PAYLOAD)) ...
null
src/util/readprops.py
readprops.py
py
2,641
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path",...
175506477
"""Device manager.""" import asyncio import logging import async_timeout from ..address import Address from ..constants import AllLinkMode, DeviceAction from ..device_types.device_base import Device from ..device_types.modem_base import ModemBase from ..device_types.x10_base import X10DeviceBase from ..managers.saved...
null
pyinsteon/managers/device_manager.py
device_manager.py
py
13,780
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "subscriber_base.SubscriberBase", "line_number": 30, "usage_type": "name" }, { "api_name": "topics.DEVICE_LIST_CHANGED", "line_number": 35, "usage_type": "name" }, { "api_n...
425401247
#!/usr/bin/env python3 import statistics import matplotlib import random import matplotlib.pyplot as plt totals = [0,0,0,0,0,0] percents = [] dev = [] numRolls = 1000000 c = 1 while c < numRolls: roll = random.randrange(6) totals[roll] += 1 p = [i/c for i in totals] percents.append(p) dev.append(statistics.pst...
null
163e/roll.py
roll.py
py
626
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.randrange", "line_number": 14, "usage_type": "call" }, { "api_name": "statistics.pstdev", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 21, "usage_type": "call" }, { "api_name": "matplot...
349155749
from discord.ext import commands from discord.utils import get class WorryWarInfo(commands.Cog): @commands.command(name="skills") async def skills_info(self, ctx): """General information about the Worry War skills""" await ctx.send("Available attacks: \n" ":on...
null
Cogs/worry-war-info.py
worry-war-info.py
py
4,063
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Cog", "line_number": 5, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" }, { "api_name": "discord.ext.commands.command", "line_number": 7, "usage_type": "call" }, { "api_...
91146077
from routes import ( current_user, redirect, ) from routes import http_response from utils import log import os def route_index(request): """ 主页的处理函数, 返回主页的响应 """ index_path = os.path.join('html', 'index.html') with open(index_path, 'r', encoding='utf8') as f: body = f.read() r...
null
routes/routes_static.py
routes_static.py
py
897
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "routes.http_response", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "li...
279155270
import eventlet eventlet.monkey_patch() from flask import Flask, Response,render_template from flask_socketio import SocketIO, send, emit from subprocess import Popen, call import time import board import busio import adafruit_mpu6050 import json import socket import signal import sys from queue import Queue impor...
null
Lab 3/wizard/app.py
app.py
py
4,881
python
en
code
null
code-starcoder2
76
[ { "api_name": "eventlet.monkey_patch", "line_number": 2, "usage_type": "call" }, { "api_name": "busio.I2C", "line_number": 32, "usage_type": "call" }, { "api_name": "board.SCL", "line_number": 32, "usage_type": "attribute" }, { "api_name": "board.SDA", "line_n...
116836613
import sys sys.stdin = open('boj_3055.txt', 'r') import sys from collections import deque readlines = sys.stdin.readline R, C = map(int, input().split()) field = [input() for _ in range(R)] dy = [-1, 1, 0, 0] dx = [0, 0, -1, 1] waters = [] water_fields = [[-1] * C for _ in range(R)] me, goal = 0, 0 for r in range(...
null
정준현/08_BFSDFS_02/boj_3055_탈출.py
boj_3055_탈출.py
py
1,743
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.stdin", "line_number": 2, "usage_type": "attribute" }, { "api_name": "sys.stdin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 29, "usage_type": "call" } ]
408514036
#!/usr/bin/env python3 import os import logging import json import uuid import redis import requests import subprocess import time import hashlib LOG = logging REDIS_QUEUE_LOCATION = os.getenv('REDIS_QUEUE', 'localhost') QUEUE_NAME = 'queue:factoring' INSTANCE_NAME = uuid.uuid4().hex LOG.basicConfig( level=LOG...
null
worker/factor_worker.py
factor_worker.py
py
3,087
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getenv", "line_number": 15, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 18, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 44, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 56, ...
306750276
import yaml class Sequence(object): def __init__(self): self.header_info = { "goal_x": float, "goal_y": float, "goal_angle": float, "base_speed": float, "base_ang_v": float, "pos_tolerance": float, "angle_tolerance": float...
null
src/db_planning/src/db_planning/sequence.py
sequence.py
py
1,933
python
en
code
null
code-starcoder2
76
[ { "api_name": "yaml.safe_load", "line_number": 37, "usage_type": "call" } ]
123956570
import socket import sys import datetime import cv2 import pickle import numpy as np import struct ## new import zlib HOST='' PORT=8485 s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) print('Socket created') s.bind((HOST,PORT)) data = b"" encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), 90] payload_size = struct....
null
Final/RA_Server/imageprocessingserver/project/segmentation_image_server.py
segmentation_image_server.py
py
4,949
python
en
code
null
code-starcoder2
76
[ { "api_name": "socket.socket", "line_number": 13, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 13, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.IMWRITE...
87290341
from typing import Generator from users.models import User def test_user_create(user_dict): user = User.create_new(**user_dict) assert user assert user.username == user_dict["username"] assert User.check_password(user.password, user_dict["password"]) def test_user_create_from_list(ten_users_generat...
null
src/tests/users/test_user_model.py
test_user_model.py
py
814
python
en
code
null
code-starcoder2
76
[ { "api_name": "users.models.User.create_new", "line_number": 7, "usage_type": "call" }, { "api_name": "users.models.User", "line_number": 7, "usage_type": "name" }, { "api_name": "users.models.User.check_password", "line_number": 10, "usage_type": "call" }, { "api...
495123828
import matplotlib.pyplot as plt ''' Тест для функции решения уравнения переноса (TVD) Вычисляется u спустя время t_end ''' a = -0.5 left = 1.0 # пределы по оси x right = 2.0 dx = 0.01 cfl = 0.09 dt = cfl*dx/abs(a) t_end = 0.6 # Время (t_end / dt задает количество итераций) n = int((right - left) / dx) ...
null
utils/TVD_method/TVDMethod_test.py
TVDMethod_test.py
py
1,320
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 45, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 45, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ylabel", "line_number": 46, "usage_type": "call" }, { "api_name": "mat...
408426903
from socket import * import asyncio async def echo_server(address, loop): sock = await loop.socket(AF_INET, SOCK_STREAM) sock.bind(address) sock.listen(1) sock.setblocking(False) while True: client, addr = sock.accept() print(f"connection from: {addr}") #echo_handler(client)...
null
coroutines/async_sock.py
async_sock.py
py
834
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.get_running_loop", "line_number": 28, "usage_type": "call" } ]
178238444
from bs4 import BeautifulSoup import requests url = 'https://quotes.toscrape.com/' responce = requests.get(url) if responce.ok: soup = BeautifulSoup(responce.text, 'lxml') quotes = soup.select('div[class = "quote"]') for quote in quotes: text = quote.select_one('span[class = "text"]').te...
null
HT_8/text_scraper.py
text_scraper.py
py
873
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "li...
430037412
""" Tests for the thread pool. Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). """ from __future__ import with_statement, print_function import time import random import unittest from Pyro4.socketserver.threadpool import Pool, PoolError, NoFreeWorkersError import Pyro4.thre...
null
tests/PyroTests/test_threadpool.py
test_threadpool.py
py
3,202
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 23, "usage_type": "call" }, { "api_name": "random.random", "line_number": 23, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 31, "usage_type": "call" }, { "api_name": "random.random", "line_number"...
48230478
import json from jinja2 import Template, Markup import boto3 bucketname = "userportfolios" cdn = "d2c1dleky96i4z" def lambda_handler(event, context): data = json.loads(event['body'])['data'] for i in data['education']: i['summary'] = Markup(i['summary']) fobj = open('template_{}.html'.format(data...
null
generate_portfolio/lamda_function.py
lamda_function.py
py
872
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "jinja2.Markup", "line_number": 12, "usage_type": "call" }, { "api_name": "jinja2.Template", "line_number": 14, "usage_type": "call" }, { "api_name": "boto3.resource", "line_n...
230180417
#!/usr/bin/env python ###################################################################################################################### # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ...
null
source/lambda/layers/python_lambda_layer/shared_util/custom_logging.py
custom_logging.py
py
2,587
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 23, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.getLogger", ...
297982212
# This package will contain the spiders of your Scrapy project # # Please refer to the documentation for information on how to create and manage # your spiders. import scrapy from twisted.internet import reactor, defer from scrapy.crawler import CrawlerRunner from scrapy.utils.log import configure_logging # from scra...
null
tutorial/tutorial/run_script.py
run_script.py
py
4,854
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 23, "usage_type": "attribute" }, { "api_name": "scrapy_splash.SplashRequest", "line_number": 64, "usage_type": "call" }, { "api_name": "scrapy.utils.log.configure_logging", "line_number": 125, "usage_type": "call" }, { ...
298172082
import contextlib import importlib import json import logging import runpy import sys from typing import Any, Iterator, List, Optional, Tuple, Type, cast import determined as det from determined import horovod from determined_common import check def load_trial_implementation(entrypoint_spec: str) -> Type[det.Trial]:...
null
harness/determined/load/_load_implementation.py
_load_implementation.py
py
7,543
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.info", "line_number": 44, "usage_type": "call" }, { "api_name": "sys.modules", "line_number": 54, "usage_type": "attribute" }, { "api_name": "sys.modules.pop", "line_number": 55, "usage_type": "call" }, { "api_name": "sys.modules", "line...
269462225
import model import locate import analysis import numpy as np import matplotlib.pyplot as plt import tcc_python_scripts.tcc.wrapper as tw image = np.load('test_image.npy') lower, upper = 0, 213 image_box, box = [], [] for dim in range(3): image_box.append(slice(lower, upper)) box.append(slice(lower+10, upper-...
null
test/test_locator.py
test_locator.py
py
1,949
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.load", "line_number": 9, "usage_type": "call" }, { "api_name": "model.NormalModel", "line_number": 19, "usage_type": "call" }, { "api_name": "locate.Locator", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.load", "line_num...
578489981
# -*- coding: utf-8 -*- import inspect # noqa import json import logging from django.contrib.auth.mixins import UserPassesTestMixin from django.http import JsonResponse from django.views import View from django.views.generic import ListView from rest_framework import status as http_status from admin.rdm.utils import...
null
admin/rdm_custom_storage_location/export_data/views/location.py
location.py
py
9,486
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "admin.rdm.utils.RdmPermissionMixin", "line_number": 28, "usage_type": "name" }, { "api_name": "django.contrib.auth.mixins.UserPassesTestMixin", "line_number": 28, "usage_type": "n...
271416881
""" Definition of forms. """ from django import forms from django.contrib.auth.forms import AuthenticationForm from django.utils.translation import ugettext_lazy as _ from multiselectfield import MultiSelectField class BootstrapAuthenticationForm(AuthenticationForm): """Authentication form which uses boostrap CSS...
null
BEOperations/beweb/forms.py
forms.py
py
4,962
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.forms.AuthenticationForm", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 12, "usage_type": "call" }, { "api_name": "django.forms", "line_number": 12, "usage_type": "name" }, { "...
557515741
from def_system import FileDefinition, FolderDefinition, Debug from rpcbgen_interface import ReprCombGenInterface import shutil import json import sys import os debug_level_arg = 9 # ####################################################### ARGS ####################################################### # mode...
null
backend/model_3_0_scripts/python/libs/rpcbupd_hydrographmultiplesdot.py
rpcbupd_hydrographmultiplesdot.py
py
14,998
python
en
code
null
code-starcoder2
76
[ { "api_name": "rpcbgen_interface.ReprCombGenInterface.get_modelcomb_id", "line_number": 12, "usage_type": "call" }, { "api_name": "rpcbgen_interface.ReprCombGenInterface", "line_number": 12, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 12, "usage_type"...
150478651
########################################### # Autores: Daniel Cay (741066) # # Javier Fañanás (737987) # # David Solanas (738630) # # # # Fichero: plot_log.py # # Robótica - Práctica 3 # ############...
null
P3/sample_files/plot_log.py
plot_log.py
py
1,916
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
199950931
import numpy as np import matplotlib.pyplot as plt import datetime def get_alphabeth(): return "abcdefghijklmnopqrstuvwxyz" def read_file(filename): PATH = "/Users/espenhauglandmaeland/Google Drive/Privat/Skule/Høgskule/Høstsemester 2018/MAT102/Filer til statestikk/" filecontent = [] f = open(PATH +...
null
Compare_Letters.py
Compare_Letters.py
py
3,882
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 71, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 71, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 72, "usage_type": "call" }, { "api_name": "matplotlib....
316690481
#!/usr/bin/env python import os import copy from unittest.mock import Mock, MagicMock, call import pytest from sonic_package_manager.database import PackageEntry from sonic_package_manager.manifest import Manifest from sonic_package_manager.metadata import Metadata from sonic_package_manager.package import Package f...
null
tests/sonic_package_manager/test_service_creator.py
test_service_creator.py
py
8,099
python
en
code
null
code-starcoder2
76
[ { "api_name": "sonic_package_manager.manifest.Manifest.marshal", "line_number": 19, "usage_type": "call" }, { "api_name": "sonic_package_manager.manifest.Manifest", "line_number": 19, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 17, "usage_type":...
38974299
# -*- coding: utf-8 -*- from PIL import Image import numpy as np import matplotlib.pyplot as plt def sign(data, translate): # transform from 0 to -1, from 255 to 1 # or from -1 to 0, from 1 to 255 temp = np.array(data) return np.vectorize(lambda x: translate[x])(temp) def Energy(h, beta, eta, x, y): ...
null
BinaryGraphDenosing/ICM_denosing.py
ICM_denosing.py
py
2,941
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.vectorize", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_num...
370423978
from datetime import datetime import csv import os.path def event_handler_write(writer, utc_timestamps, calc_freq_both, calc_freq_1, calc_freq_2): for i in range(len(calc_freq_both)): writer.writerow([utc_timestamps[i], calc_freq_both[i], calc_freq_1[i], calc_freq_2[i]]) print("Wrote {} rows\n".format...
null
rec_sample.py
rec_sample.py
py
1,784
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.path.isfile", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 36, "usage_type": "name" }, { "api_name": "csv.writer", "line_...
37669633
from PIL import Image import glob import imageio import numpy as np import os from util import util a_path = 'datasets/cityscapes/train_A/00005.jpg' b_path = 'datasets/cityscapes/train_B/00005.jpg' # def list_files_in_dir(root_dir, out_filename, recursive=True): # out_f = open(out_filename, 'w+') # for file...
null
playground.py
playground.py
py
1,775
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.iglob", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_number": 38, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number...
42456081
#!/usr/bin/env python # coding: utf-8 # # 4. Significance Testing for Continuous Metrics (Bayesian Approach) # This chapter will discuss a method described by [Kruschke (2013)](https://pdfs.semanticscholar.org/dea6/0927efbd1f284b4132eae3461ea7ce0fb62a.pdf) known as BEST (Bayesian Estimation Supersedes the T-test), wh...
null
_build/jupyter_execute/4_Bayesian_Estimation_Supersedes_The_T_Test.py
4_Bayesian_Estimation_Supersedes_The_T_Test.py
py
9,394
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 57, "usage_type": "call" }, { "api_name": "statistics.stdev", "line_number": 84, "usage_type": "call" }, { "api_name": "numpy.r_", ...
97866913
# General LeNet class implementation # Import necessary packages from keras.models import Sequential from keras.layers.convolutional import Conv2D from keras.layers.convolutional import MaxPooling2D from keras.layers.core import Activation from keras.layers.core import Flatten from keras.layers.core import Dense from...
null
ConvNet/LeNet.py
LeNet.py
py
1,942
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.models.Sequential", "line_number": 25, "usage_type": "call" }, { "api_name": "keras.layers.convolutional.Conv2D", "line_number": 27, "usage_type": "call" }, { "api_name": "keras.layers.Dropout", "line_number": 28, "usage_type": "call" }, { "ap...
627602844
#!/bin/env python # -*- coding: utf-8 -*- # @package ABYSS_launch.py # @author Florian Charriat """ The forRNAseq_inPlanta script ============================= :author: CHARRIAT Florian :contact: florian.charriat@inra.fr :date: 21/03/2018 :version: 0.1 Script description ------------------ This program is ...
null
ClusterInra/forRNAseq_inPlanta.py
forRNAseq_inPlanta.py
py
5,548
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 75, "usage_type": "call" }, { "api_name": "os.path", "line_number": 75, "usage_type": "attribute" }, { "api_name": "os.path.abspath"...
246695110
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project # root for license information. from pathlib import Path import json from PIL import Image, ImageOps from dacite import from_dict from redact.redaction.image_redaction import ImageRedaction fr...
null
scripts/redact_cli_py/redact/__init__.py
__init__.py
py
2,856
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 18, "usage_type": "name" }, { "api_name": "PIL.ImageOps.exif_transpose", "line_number": 22, "usage_type": "call" }, { "api_name": "PIL.ImageOps", ...
568663838
# -*- coding: utf-8 -*- import itertools import logging import re import string try: maketrans = str.maketrans except AttributeError: maketrans = string.maketrans try: ascii_lowercase = str.ascii_lowercase ascii_uppercase = str.ascii_uppercase digits = str.digits except AttributeError: ascii_lo...
null
reheader/reheader.py
reheader.py
py
8,314
python
en
code
null
code-starcoder2
76
[ { "api_name": "string.maketrans", "line_number": 10, "usage_type": "attribute" }, { "api_name": "string.ascii_lowercase", "line_number": 16, "usage_type": "attribute" }, { "api_name": "string.ascii_uppercase", "line_number": 17, "usage_type": "attribute" }, { "api...
80705331
#!/usr/bin/python3 import sys import os import utils import pandas as pd from sklearn.model_selection import train_test_split, cross_val_score, cross_validate from sklearn.tree import DecisionTreeClassifier import numpy as np import argparse from sklearn.metrics import recall_score, precision_score, accuracy_score impo...
null
inst_analysis.py
inst_analysis.py
py
7,119
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 20, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
24860549
# -*- coding: utf-8 -*- """UPnP client module.""" import abc import asyncio import logging import urllib.parse from datetime import datetime from datetime import timezone from xml.etree import ElementTree as ET from xml.sax.saxutils import escape, unescape import voluptuous as vol NS = { 'soap_envelope': 'http:...
null
async_upnp_client/async_upnp_client.py
async_upnp_client.py
py
30,496
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "abc.abstractmethod", "line_number": 46, "usage_type": "attribute" }, { "api_name": "urllib.pa...
280920422
import torch import torchaudio import os import random import numpy as np import subprocess from pathlib import Path from collections import defaultdict from tqdm import tqdm import time from .dataset import Dataset from scripts.datasets.utils import write_statistics from utils import random_undersample_balanced from ...
null
data/audio/magnatagatune.py
magnatagatune.py
py
7,749
python
en
code
null
code-starcoder2
76
[ { "api_name": "tqdm.tqdm", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 47, "usage_type": "call" }, { "api_name": "dataset.Dataset", "line_number": 50, "usage_type": "name" }, { "api_name": "subprocess.call", "line_num...
501347985
from typing import Any, Dict, List, Optional import pandas as pd from sklearn.base import BaseEstimator, TransformerMixin from sklearn.utils.validation import check_is_fitted class BaselinePreprocessor(BaseEstimator, TransformerMixin): """ Base processor for movies classification """ def __init__( ...
null
modules/preprocessing/preprocessing.py
preprocessing.py
py
8,903
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.base.BaseEstimator", "line_number": 8, "usage_type": "name" }, { "api_name": "sklearn.base.TransformerMixin", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name":...
510142506
from flask import Flask def create_app(): app = Flask(__name__) app.config['semesters'] = [{'name': '1st'}, {'name': '2nd'}, {'name': '3rd'}, {'name': '4th'}, {'name': '5th'}, {'name': '6th'}, {'name': '7th'}, {'name': '8th'}] app.config['branch'] = [{'name': 'CSE'}, {'name': 'IT'}, {'name': 'ECE'}, {'nam...
null
app/__init__.py
__init__.py
py
616
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "dashboard.dashboard.create_dashboard", "line_number": 14, "usage_type": "call" } ]
386019111
"""Module is a grouping of Graph API authentication and helper classes.""" import configparser from typing import Union import urllib.parse import logging import msal import requests import saq from saq.extractors import RESULT_MESSAGE_NOT_FOUND, RESULT_MESSAGE_FOUND def read_private_key(key_path, **kwargs): "...
null
lib/saq/graph_api.py
graph_api.py
py
8,277
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.parse.parse.urljoin", "line_number": 29, "usage_type": "call" }, { "api_name": "urllib.parse.parse", "line_number": 29, "usage_type": "attribute" }, { "api_name": "urllib.parse", "line_number": 29, "usage_type": "name" }, { "api_name": "msal....
16176387
from django.shortcuts import render, get_object_or_404 , redirect from django.http import HttpResponse, JsonResponse from django.contrib.auth import authenticate,login from django.contrib.auth.forms import UserCreationForm from .forms import LoginForm , UserRegistrationForm, AddProjectForm,AddTicketForm, SignUpForm,Add...
null
bug/views.py
views.py
py
10,039
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 25, "usage_type": "call" }, { "api_name": "forms.LoginForm", "line_number": 30, "usage_type": "call" }, { "api_name": "django.contrib.auth.authenticate", "line_number": 33, "usage_type": "call" }, { "api_name...
79560653
from typing import List def isLanguage(l: str = "empty") -> bool: l = l.lower() if (l == "abyssal" or l == "aquan" or l == "auran" or l == "celestial" or l == "common" or l == "deep" or l == "draconic" or l == "druidic" or l == "dwarvish" or l == "elvish" or l == "giant" ...
null
Server/Utility/Languages.py
Languages.py
py
1,498
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 26, "usage_type": "name" } ]
12834853
""" This file starts the 'CARD GAME' """ import utils.player from utils.player import Deck import utils.card import utils.game import random print("Card Game") """ Start the game. You should only run this file to have the game running. """ """ask how many players there are and their names """ players_list = [] num...
null
main.py
main.py
py
1,291
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.player.Deck.fill_deck", "line_number": 47, "usage_type": "call" }, { "api_name": "utils.player.Deck", "line_number": 47, "usage_type": "name" } ]
318943935
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jul 11 14:51:37 2019 @author: ghitafilali """ from typing import List, Set def find_all_letters(dictionnary: List[str]) -> Set[str]: """ Finds all the letters used in a dictionnary. """ letters_set: Set[str] = set() for word in di...
null
group/assignment-5/unknown_alphabet_ghita.py
unknown_alphabet_ghita.py
py
3,103
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Set", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Set", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 22...
78037437
# few modules need to be included # pip install beautifulsoup4 # pip install pillow # pip install requests import requests from bs4 import BeautifulSoup from tkinter import Label from tkinter import Tk from PIL import ImageTk, Image # weather url # orlando base location url = "https://weather.com/weathe...
null
weather app using python.py
weather app using python.py
py
1,863
python
en
code
null
code-starcoder2
76
[ { "api_name": "tkinter.Tk", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 22, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 22, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoImage", "lin...
386181763
import importlib import logging from time import strftime from cvxopt import mul from andes import __version__ as version from ..formats import all_formats from ..utils import elapsed logger = logging.getLogger(__name__) class Report(object): """ Report class to store system static analysis reports """...
null
andes/variables/report.py
report.py
py
8,395
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "andes.__version__", "line_number": 46, "usage_type": "name" }, { "api_name": "time.strftime", "line_number": 51, "usage_type": "call" }, { "api_name": "cvxopt.mul", "l...
339362661
from urllib import request import re import time import random import pymysql from hashlib import md5 import pymongo import sys class CarSpider: def __init__(self): self.one_url = "https://www.che168.com/beijing/a0_0msdgscncgpi1lto1csp{}exx0/" self.headers = {"User-Agent": "Opera/9.80 (Windows NT ...
null
day02/07_carspider.py
07_carspider.py
py
3,625
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymysql.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib.request.Request", "line_number": 26, "usage_type": "call" }, { "api_name": "urllib.req...
538032970
""" A script that provides command-line interface to the Clock-In-Clock-Out module. Usage: ./python app.py [-h] [xml_filename SAMPLE.XML] [-s, --start 01-01-2000] [-e, --end 01-01-2000] [-n, --names] Required parameters: xml_filename: - name of the source time-sheet file to query, Optional paramete...
null
app.py
app.py
py
2,761
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.strptime", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 38, "usage_type": "name" }, { "api_name": "argparse.ArgumentTypeError", "line_number": 41, "usage_type": "call" }, { "api_name"...
363693459
import requests,ssl,os ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE url=input("Wordpress XMLRPC Exploit\nMade By Tolesh Kumar Jangid\nEnter the url: ") type(url) file_name= url+'.txt' data = '<?xml version="1.0"encoding="UTF-8"?><methodCall><methodName>wp.getU...
null
wordpress_xmlrpc_exploit.py
wordpress_xmlrpc_exploit.py
py
946
python
en
code
null
code-starcoder2
76
[ { "api_name": "ssl.create_default_context", "line_number": 2, "usage_type": "call" }, { "api_name": "ssl.CERT_NONE", "line_number": 4, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.po...
6173090
import sys import json import numpy from math import floor from typing import Tuple from PIL import Image from tuples import Color3, Color4, ChannelConfig from fmath import * if len(sys.argv) < 2: print('Usage: six mask diffuse config') sys.exit(1) mask_filename = sys.argv[1] diffuse_filename = sys.argv[2] config...
null
six/run.py
run.py
py
3,455
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 17...
529074435
#!/usr/bin/python # Flash access policy server based on gevent # Jan-Philip Gehrcke, June 2011 # Listen on port 843; send acess policy to client; disconnect. from gevent.server import StreamServer import datetime import socket # Should we log something? Where to? # LOG = 1 #LOGFILE = "flash_access_policy_server.l...
null
classes/crossdomainpolicyserver.py
crossdomainpolicyserver.py
py
1,885
python
en
code
null
code-starcoder2
76
[ { "api_name": "socket.timeout", "line_number": 44, "usage_type": "attribute" }, { "api_name": "gevent.server.StreamServer", "line_number": 56, "usage_type": "call" } ]
454210854
import tqdm import time listnya = input('input list : ') output = input('Output Destination : ') lists = open(listnya) cok = set(lists.readlines()) total = len(list(open(listnya))) print("[+] Found Total {} List".format(str(total))) print("[+] Start Remove Duplicate ...\n\n") time.sleep(1) count = 0 result = listnya.re...
null
remove-duplicate/clean.py
clean.py
py
564
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 10, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 15, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" } ]
211293307
#!/usr/bin/env python # from https://raw.githubusercontent.com/widdowquinn/scripts/master/bioinformatics/nucmer_to_crunch.py # # nucmer_to_crunch.py # # USAGE: Usage: nucmer_to_crunch.py [-h] [-o OUTFILENAME] [-i INFILENAME] [-v] # # optional arguments: # -h, --help show this help message and exit # -o O...
null
compare_fauzi_bins/support_files/parse_coords.py
parse_coords.py
py
9,998
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 88, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 105, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 195, "usage_type": "call" }, { "api_name": "sys.argv", "line_...
610632491
from twisted.internet import defer from txredis.testing import CommandsBaseTestCase class HashCommandsTestCase(CommandsBaseTestCase): """Test commands that operate on hashes. """ @defer.inlineCallbacks def test_blank(self): yield self.redis.delete('h') yield self.redis.hset('h', 'bla...
null
txredis/tests/client/test_hash.py
test_hash.py
py
3,955
python
en
code
null
code-starcoder2
76
[ { "api_name": "txredis.testing.CommandsBaseTestCase", "line_number": 6, "usage_type": "name" }, { "api_name": "twisted.internet.defer.inlineCallbacks", "line_number": 10, "usage_type": "attribute" }, { "api_name": "twisted.internet.defer", "line_number": 10, "usage_type":...
270847567
import tensorflow as tf import numpy as np import mnist_data import os import vae import plot_utils import glob import sys import time import scipy from sklearn.decomposition import PCA from skimage.feature import hog """ parameters """ # combined: # source activate tensorflow_p36 && pip install pillow && pip install...
null
Monte-Carlo-Attacks/Monte-Carlo-MNIST_CVAE/mc_attack_cvae_sample_size.py
mc_attack_cvae_sample_size.py
py
11,439
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.random.randint", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random", "...
165608661
import os import sys import tkinter from tkinter import Frame, Tk, BOTH, Text, Menu, END from tkinter.filedialog import Open, SaveAs import json import datetime import numpy as np import skimage.draw import cv2 stderr = sys.stderr sys.stderr = open(os.devnull, 'w') os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' from mrcnn.v...
null
Mask_RCNN_TraiCay_Final.py
Mask_RCNN_TraiCay_Final.py
py
3,484
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.stderr", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.devnull", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ", "lin...
96322565
from __future__ import print_function import pandas as pd import matplotlib.pyplot as plt import numpy as np #plot Col_ATPT_CPTP df1 = pd.read_csv('ATPT_CPTD_Freq.csv',names=["Status","Freq"]) df1["Status"] = df1["Status"].str[2:-1] df1["Status"][0] = "Null" df1["Freq"] = df1["Freq"].str[:-1].astype(int) y_pos1 = np....
null
part1_yc1228/Plot.py
Plot.py
py
2,637
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.bar", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot",...
77134489
from opal.core import metadata from lab.models import LabTest from opal.core.schemas import serialize_model class LabTestMetadata(metadata.Metadata): slug = "lab_test" @classmethod def to_dict(klass, **kw): result = {klass.slug: []} for lab_test in LabTest.list(): serialised ...
null
lab/metadata.py
metadata.py
py
551
python
en
code
null
code-starcoder2
76
[ { "api_name": "opal.core.metadata.Metadata", "line_number": 6, "usage_type": "attribute" }, { "api_name": "opal.core.metadata", "line_number": 6, "usage_type": "name" }, { "api_name": "lab.models.LabTest.list", "line_number": 13, "usage_type": "call" }, { "api_nam...
480961505
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.proxy import Proxy, ProxyType from bs4 import BeautifulSoup from fake_useragent import UserAgent import pandas as pd import time def get_all_niche_party_schools(): for i in range(1,65): drive...
null
scraper.py
scraper.py
py
8,447
python
en
code
null
code-starcoder2
76
[ { "api_name": "bs4.BeautifulSoup", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 45, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 64, "usage_type": "call" }, { "api_name": "bs4.BeautifulSo...
449395341
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File name : # Author : # Date created : # Date last modified : # Python Version : 3.* import os from django.shortcuts import render, get_object_or_404, redirect from django.conf import settings from django.utils.decorators import method_d...
null
views/admin.py
admin.py
py
2,378
python
en
code
null
code-starcoder2
76
[ { "api_name": "base.BaseView", "line_number": 20, "usage_type": "name" }, { "api_name": "django.utils.decorators.method_decorator", "line_number": 22, "usage_type": "call" }, { "api_name": "utils.requires_auth", "line_number": 22, "usage_type": "argument" }, { "ap...
420092132
import os import pandas as pd import time import re from flask import Flask, Response from flask import url_for, redirect app = Flask(__name__) def stream_template(template_name, **context): app.update_template_context(context) t = app.jinja_env.get_template(template_name) rv = t.stream(context) rv.e...
null
hackathon2017/app.py
app.py
py
1,809
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 30, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 31, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 32, ...
634722400
import typing from podcast.models import CancelledStatus from podcast.models import Channel from podcast.models import ChannelInfo from podcast.models import DeletedStatus from podcast.models import FinishedStatus from podcast.models import NewStatus from podcast.models import Podcast from podcast.models import Podcas...
null
tests/util/factory.py
factory.py
py
3,325
python
en
code
null
code-starcoder2
76
[ { "api_name": "podcast.models.ChannelInfo", "line_number": 33, "usage_type": "call" }, { "api_name": "podcast.models.ChannelInfo", "line_number": 32, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 40, "usage_type": "attribute" }, { "api_na...
26068770
from collections import defaultdict, namedtuple import re Dest = namedtuple('Dest', ['t', 'id']) def get_low_high(v1, v2): return min(v1, v2), max(v1, v2) bot_re = re.compile(r"bot (\d+) gives low to (bot|output) (\d+) and high to (bot|output) (\d+)") value_re = re.compile(r"value (\d+) goes to bot (\d+)") # Ha...
null
day10/solve.py
solve.py
py
2,056
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 4, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.defaultdict", ...
429878493
import numpy as np import pandas as pd from sklearn.model_selection import StratifiedShuffleSplit def read_x_y(): fruits = pd.read_table('fruit_data_my.txt') X = fruits[['mass', 'width', 'height', 'color_score']] #dataframe 4 columns y = fruits['fruit_label'] #series = 1 column...
null
data_science/7_kaggle/cookbook/1_cross_validation/2_full_working_cross_validation.py
2_full_working_cross_validation.py
py
1,306
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_table", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.model_selection.Stra...
634817068
import pytest import os import pandas as pd from boto3 import client from moto import mock_s3 from finanzen_base.Utils.extract_filename import extract_filename from EntgeltUtils.app import App @pytest.fixture def aws_credentials(): """Mocked AWS Credentials for moto.""" os.environ["AWS_ACCESS_KEY_ID"] = "te...
null
tests/test_integration.py
test_integration.py
py
2,388
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.environ", "lin...
638346564
#!/usr/bin/env python3 import logging import networkx as nx import pydot import itertools from scipy import interpolate import utils def add_node_attribute_to_graph(graph, attribute_name, dictionary): nx.set_node_attributes(graph, name=attribute_name, values=dictionary) def add_node_attribute_to_subgraphs(sub_g...
null
graph.py
graph.py
py
7,724
python
en
code
null
code-starcoder2
76
[ { "api_name": "networkx.set_node_attributes", "line_number": 12, "usage_type": "call" }, { "api_name": "pydot.graph_from_dot_file", "line_number": 22, "usage_type": "call" }, { "api_name": "utils.to_int", "line_number": 26, "usage_type": "call" }, { "api_name": "l...
203978355
import requests session = requests.session() def voidTraderInfo(): traderInfo = session.get("https://api.warframestat.us/pc/voidTrader").json() traderLocation = traderInfo['location'] traderActive = traderInfo['active'] traderTillActive = traderInfo['startString'] traderTillLeave = traderInfo['en...
null
baroData.py
baroData.py
py
1,780
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.session", "line_number": 3, "usage_type": "call" }, { "api_name": "main.Start", "line_number": 59, "usage_type": "call" } ]
6363941
# -*- coding: utf-8 -*- """ Created on Mon Apr 27 16:09:54 2020 @author: Seo """ import pyqtgraph as pg import pyqtgraph.opengl as gl from PyQt5.QtCore import Qt, QRectF import numpy as np import matplotlib.pyplot as plt from signalCreationRoutines import makeFreq from matplotlib import cm from pyqtgraph.graphicsIte...
null
plotRoutines.py
plotRoutines.py
py
4,853
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 38, "usage_type": "call" }, { "api_name": "pyqtgraph.mkPen", "line_number": 48, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.Qt.DashLine", "line_number": 48, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCor...
452702300
import sys import pygame from hero import Hero def run_game(): # Initialize game, settings, and screen object. pygame.init() screen = pygame.display.set_mode((800, 600)) bg_color = (191, 228, 251) pygame.display.set_caption("Blue Sky") # Instantiate a hero hero = Hero(screen) while ...
null
python_crash_course/12_a_ship_that_fires_bullets/12-1_blue_sky.py
12-1_blue_sky.py
py
633
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.display...
112003279
import socket import threading import pyDes from time import time from hashlib import sha256 from getpass import getpass from base64 import b64encode from base64 import b64decode class ClientConn(threading.Thread): def __init__(self, conn, id, K_s): self.conn = conn self.conn.settimeout(3) self.id = id self....
null
T04/service.py
service.py
py
3,878
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 11, "usage_type": "attribute" }, { "api_name": "socket.timeout", "line_number": 25, "usage_type": "attribute" }, { "api_name": "base64.b64decode", "line_number": 45, "usage_type": "call" }, { "api_name": "base64.b64...
622850165
import logging import emoji import urwid import subprocess import ast import gc import os import pyttsx3 from datetime import datetime from ansi_management import (warning, success, error, info, clear_screen, bold, yellow, muted, cleanfloat) from data import (btc_price_data, data_tor, data_...
null
dashboard.py
dashboard.py
py
12,435
python
en
code
null
code-starcoder2
76
[ { "api_name": "node_warden.load_config", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "node_warden.basedir", "line_number": 25, "usage_type": "argument" }, { "api_name": "os.path"...
218978381
from tools import * import pandas as pd import matplotlib.pyplot as plt from sklearn import neighbors from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error from math import sqrt from sklearn.model_selection import train_test_split import numpy as np import matplotlib.pyplot ...
null
knn_regression.py
knn_regression.py
py
3,891
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 33, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 39, "usage_type": "call" }, { "ap...
243281922
""" This code is partially derived from https://www.pyimagesearch.com/2016/10/03/bubble-sheet-multiple-choice-scanner-and-test-grader-using-omr-python-and-opencv/ """ import cv2 import numpy as np import imutils from imutils import contours colors = [ (255,255,0), (255,0,0), (0,255,0), (0,255,255), ] ...
null
src/electronics/teardowns/multiple_choice_test_omr/test1.py
test1.py
py
3,979
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 35, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 37, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 37, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "...
296497275
import datetime import re from csv import DictReader from datetime import date from typing import List class Weather: """Weather class.""" date: datetime.date description: str temperature_max: float temperature_min: float rainfall: float snowfall: float def __init__(self, date: datet...
null
Homework4/assignment_4_3.py
assignment_4_3.py
py
5,900
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date", "line_number": 11, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 18, "usage_type": "attribute" }, { "api_name": "datetime.date", "line_number": 34, "usage_type": "name" }, { "api_name": "typing.List", "lin...
71651797
import numpy as np import pandas as pd from intervaltree.intervaltree import IntervalTree from general.utils import Data def event_confusion_matrix2(r_activities, p_activities, labels): cm = np.zeros((len(labels), len(labels))) predicted = [p for i, p in p_activities.iterrows()] real = [p for i, p in r_...
null
metric/event_confusion_matrix2.py
event_confusion_matrix2.py
py
1,942
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.to_timedelta", "line_number": 20, "usage_type": "call" }, { "api_name": "intervaltree.intervaltree.IntervalTree", "line_number": 26, "usage_type": "call" }, { "api_name": ...
587220086
# -*- coding: utf-8 -*- from bs4 import BeautifulSoup import requests import pickle from itertools import cycle import time proxies = { 'http://162.144.220.192:80', 'http://167.215.240.121:5137', 'http://159.203.91.6:8080', 'http://157.230.232.130:80', } proxy_pool...
null
FlipKart.py
FlipKart.py
py
3,988
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.cycle", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 55, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 56, "usage_type": "call" }, { "api_name": "time.sleep", "line...
422389903
import json ''' Success: au ro vg es (10000 rows) no (10000 rows) Fail: ch is lv ''' jsonList = [] with open('no.geojson') as f: count = 0 for line in f: jsonList.append(json.loads(line)['properties']) count = count + 1 if (co...
null
DataImport.py
DataImport.py
py
830
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 22, "usage_type": "call" } ]
142106520
from functools import reduce from fuzix.draw_utils import draw_circle from fuzix.draw_utils import draw_line from fuzix.draw_utils import draw_rect from fuzix.utils import do_render_animation from fuzix.utils import RendererWidget from fuzix.utils import timed from IPython.display import display from ipywidgets import ...
null
fuzix/scene.py
scene.py
py
14,798
python
en
code
null
code-starcoder2
76
[ { "api_name": "sympy.Symbol", "line_number": 29, "usage_type": "call" }, { "api_name": "sympy.physics.mechanics.dynamicsymbols", "line_number": 37, "usage_type": "call" }, { "api_name": "sympy.sympify", "line_number": 41, "usage_type": "call" }, { "api_name": "sym...
619579515
from constants import * from info.resources import METAL, CRYSTAL, DEUTERIUM, ENERGY import re import time import datetime import threading import logging logger = logging.getLogger('ogame_bot.buildings.queue') class BuildQueue(threading.Thread): def __init__(self, planet): threading.Thread.__init__(sel...
null
buildings/queue.py
queue.py
py
4,856
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 13, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "thr...
4778367
import matplotlib.pyplot as plt import numpy as np import pandas as pd ################################## ###Import original data ###Basic sample information data_file_path = 'C:/Users/htian/Desktop/book in reading/WVU Share facility data/Bruker XRD data2.txt' ## read using ";" as seperator, and delete "," ...
null
Cu MOF SAXS.py
Cu MOF SAXS.py
py
2,228
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_table", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 73, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 73, "usage_type": "name" }, { "api_name": "matplotl...
564031101
import os.path import gc from hashlib import sha1 from itertools import chain import msgpack from dawg import BytesDAWG NAMES_DAWG = BytesDAWG().load( os.path.join(os.path.dirname(__file__), 'dict.dawg')) def batch_request(names): """ Map all name fragments in the array to name hashes. Takes an arr...
null
hasher.py
hasher.py
py
1,551
python
en
code
null
code-starcoder2
76
[ { "api_name": "dawg.BytesDAWG", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path", "line...
596102493
# coding: utf8 import nltk import pymorphy2 from tokenize1 import * import os from os import listdir from os.path import isfile, join from operator import itemgetter from json2html import * from gluon.serializers import json import collections # json structure # poem: # info: author (name, family), text (title, group_...
null
controllers/json.py
json.py
py
5,419
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.OrderedDict", "line_number": 44, "usage_type": "call" }, { "api_name": "json2html.convert", "line_number": 50, "usage_type": "call" } ]
446801889
from flask import Flask from flask import render_template, request, redirect, jsonify from tictactoe import TicTacToe from minesweeper import Minesweeper app = Flask(__name__, template_folder='') app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0 app.config['debug'] = True tictactoe = TicTacToe() minesweeper = Minesweeper() ...
null
application.py
application.py
py
2,496
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "tictactoe.TicTacToe", "line_number": 9, "usage_type": "call" }, { "api_name": "minesweeper.Minesweeper", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_te...
466515790
import os import sys sys.path.insert(0, os.getcwd()) import unittest from model import * import torch from torch import nn class Test(unittest.TestCase): def test_metakernel(self): x = torch.rand(4, 3, 64, 64) conv = Conv2dMetaKernel(3, 4, [1,3,5], stride=1) y = conv(x) loss = y.m...
null
ednas/tests/test_model.py
test_model.py
py
1,334
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 3, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_nu...
492660723
import sys from functools import reduce input = lambda: sys.stdin.readline().rstrip() T = int(input()) def loserSearch(avr, scores): temp = 0 for score in scores: if (avr < score): temp += 1 return temp while T > 0: n, *scoreList = map(int, input().split()) avrScore = reduce...
null
백준 단계별로 풀어보기/[1차원 배열] 백준 4344 - 평균은 넘겠지.py
[1차원 배열] 백준 4344 - 평균은 넘겠지.py
py
460
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.stdin.readline", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "functools.reduce", "line_number": 18, "usage_type": "call" } ]
301041410
import time import argparse import pprint import json import re import os ## Constants DEFAULT_DEBUG_LOG_FILE_PATH = "debug.log" DEFAULT_DEBUG_LOG_OUT_PATH = "debug_parsed.json" KEY_PROCESS_VERSIONS = "process.versions" KEY_RAISE_MANY_EVENTS = "raise-many-events" KEY_CREATE_APPLICATION = "create-application" KEY_CLOS...
null
diagnostics_parser.py
diagnostics_parser.py
py
14,952
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "time.time", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 70, "usage_type": "call" }, { "api_name": "os.path", "line...
395232048
#!python3 #encoding:utf-8 import requests import urllib.parse import json import datetime import web.http.Paginator import web.service.github.api.v3.Response import web.log.Log class Issues: def __init__(self, reqp, response, authData, repo): self.__reqp = reqp self.__response = response...
null
web/service/github/api/v3/issues/Issues.py
Issues.py
py
5,284
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 35, "usage_type": "call" }, { "api_name": "json.dumps", ...
55474532
#!/usr/bin/env python """Mobster is a command-line tool for profiling remote WebKit-based browsers via the WebKit remote debugging protocol. This script provides a simple way to use the tool to profile a single page and generate a HAR file containing the results""" ## import os, sys sys.path.insert(0, os.path.abspat...
null
mobster/bin/mobster.py
mobster.py
py
2,546
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number...
650301149
import requests from bs4 import BeautifulSoup import re from selenium import webdriver url = 'http://www.stats.gov.cn//tjsj/zxfb/index.html' browser = webdriver.Chrome() browser.get(url) browser.implicitly_wait(10) page = browser.page_source soup = BeautifulSoup(page,'html.parser') infos = soup.find('ul',{'class':'ce...
null
spider/实验区/实验区3.py
实验区3.py
py
1,117
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "re.match...
363879289
from collections import defaultdict, OrderedDict from glob import glob from os.path import splitext, basename import toml from bottle import Bottle, view, redirect from src.common.utils import md_page, title_to_page_name SPELLS = None SPELLS_BY_LEVEL = None def init(cfg): pass def load_spells(): global ...
null
src/onednd/endpoints.py
endpoints.py
py
2,300
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 23, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 29, "usage_type": "call" }, { "api_name": "toml.loads", "line_number": 32, "usage_type": "call" }, { "api_name": "collections.OrderedDict"...
200922565
from flask import Flask, render_template, jsonify, request,session,redirect,url_for from models import * from flask_socketio import SocketIO, join_room, leave_room import os #duong link anh PEOPLE_FOLDER = os.path.join('static', 'img') app = Flask(__name__) # app.config["SQLALCHEMY_DATABASE_URI"] = r"postgres://qgora...
null
Register/application.py
application.py
py
7,311
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_socketio.SocketIO", "lin...
307487109
import networkx as nx G = nx.DiGraph() G.add_nodes_from([1,2,3,4,5]) G.add_edges_from([(1,2),(1,3),(2,4),(4,3),(5,1), (5,1),(5,1)]) # G.node[1]['type'] = ['juicy', 'crunch'] G.node[2]['type'] = 'sour' G.node[3]['type'] = 'bitter' G.node[4]['type'] = 'juicy' # print G.node[1]['type'] print ['juicy', 'crunch'] nx.w...
null
Graph/test.py
test.py
py
360
python
en
code
null
code-starcoder2
76
[ { "api_name": "networkx.DiGraph", "line_number": 4, "usage_type": "call" }, { "api_name": "networkx.write_gexf", "line_number": 16, "usage_type": "call" } ]
260996557
from flask import request from flask import abort, flash, redirect, render_template, url_for from src.blueprint import bp_admin as admin from src.core.config import load_json_config, save_json_config from src.core.helpers import split_hashtags_into_list @admin.route("/") def index(): abort(404) @admin.route("/...
null
src/blueprint/admin.py
admin.py
py
1,972
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.abort", "line_number": 11, "usage_type": "call" }, { "api_name": "src.blueprint.bp_admin.route", "line_number": 9, "usage_type": "call" }, { "api_name": "src.blueprint.bp_admin", "line_number": 9, "usage_type": "name" }, { "api_name": "src.cor...