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
442510581
import pytest from openshift_checks.memory_availability import MemoryAvailability @pytest.mark.parametrize('group_names,is_active', [ (['oo_masters_to_config'], True), (['oo_nodes_to_config'], True), (['oo_etcd_to_config'], True), (['oo_masters_to_config', 'oo_nodes_to_config'], True), (['oo_mast...
null
openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/openshift_health_checker/test/memory_availability_test.py
memory_availability_test.py
py
3,297
python
en
code
null
code-starcoder2
83
[ { "api_name": "openshift_checks.memory_availability.MemoryAvailability", "line_number": 20, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 6, "usage_type": "attribute" ...
194769893
import json import re import numpy as np from boolean_search import build_inverted_index, dis_boolean_search_ordered, rank_places from google_place_detail import GooglePlaces import time from nltk.stem import PorterStemmer from flickr import FlickrPhotos import difflib from nltk.sentiment.vader import SentimentIntensit...
null
connect_api/api_combined.py
api_combined.py
py
6,090
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.abspath", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 30, "usage_type": "call" }, { "api_name": "nltk.data.path.append", ...
535641722
''' Template tags for the disease app. ''' from django import template from elastic.elastic_settings import ElasticSettings from elastic.search import ElasticQuery, Search from elastic.query import Query, BoolQuery from elastic.result import Document from disease.utils import Disease register = template.Library() @r...
null
pydgin/local_apps/disease/templatetags/disease_tags.py
disease_tags.py
py
1,389
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.template.Library", "line_number": 9, "usage_type": "call" }, { "api_name": "django.template", "line_number": 9, "usage_type": "name" }, { "api_name": "disease.utils.Disease.get_site_diseases", "line_number": 23, "usage_type": "call" }, { "api...
80200309
import os import os.path as op from nipype.interfaces.fsl.Info import standard_image import nibabel as nib import numpy as np from sklearn.cluster import AgglomerativeClustering def clustering_workflow(fnames, nclust, method): mni_img = nib.load(standard_image('MNI152_T1_2mm_brain_mask.nii.gz')) mni_img_data ...
null
clustering.py
clustering.py
py
938
python
en
code
null
code-starcoder2
83
[ { "api_name": "nibabel.load", "line_number": 10, "usage_type": "call" }, { "api_name": "nipype.interfaces.fsl.Info.standard_image", "line_number": 10, "usage_type": "call" }, { "api_name": "nibabel.load", "line_number": 14, "usage_type": "call" }, { "api_name": "n...
218791833
import keyboard texto_1='Oi, tudo bem? Este texto foi escrito automaticamente' #Define o texto atalho_1 = 'F9' #Define o atalho. Neste exemplo, é F7 do teclado. print('Hotkey:', atalho_1, 'de:', texto_1) texto_2='sudo su -' #Define o texto atalho_2 = 'F10' #Define o atalho. print('Hotkey:', atalho_2, 'de:', texto_2)...
null
hotkey.py
hotkey.py
py
900
python
en
code
null
code-starcoder2
83
[ { "api_name": "keyboard.write", "line_number": 17, "usage_type": "call" }, { "api_name": "keyboard.add_hotkey", "line_number": 18, "usage_type": "call" }, { "api_name": "keyboard.write", "line_number": 22, "usage_type": "call" }, { "api_name": "keyboard.add_hotkey...
392173817
import csv import sqlite3 from boltons.dictutils import OrderedMultiDict from collections import Counter """ Hace SQLite3 Exercise: Use the sqlite3 module to create a new database nutritional_status. The database should have two tables: students and bmi. The students table should have the following attributes: stude...
null
D13/sqlite3/hace.py
hace.py
py
4,366
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 55, "usage_type": "call" }, { "api_name": "sqlite3.OperationalError", "line_number": 78, "usage_type": "attribute" }, { "api_name": "csv.DictReader", "line_number": 82, "usage_type": "call" }, { "api_name": "boltons....
106444959
#!/usr/bin/env python # coding:utf-8 from logging.handlers import TimedRotatingFileHandler import time TIMEZONE_MODIFY = 60 * 60 * 8 class NatureTimedRotatingFileHandler(TimedRotatingFileHandler, object): def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False): ...
null
myloghandlers.py
myloghandlers.py
py
1,454
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.handlers.TimedRotatingFileHandler", "line_number": 9, "usage_type": "name" }, { "api_name": "time.time", "line_number": 18, "usage_type": "call" } ]
57912393
import psutil from model import Data, db import threading import time class RegisterTimer(threading.Thread): def __init__(self, seconds): threading.Thread.__init__(self) self.event = threading.Event() self.seconds = seconds psutil.cpu_percent() time.sleep(1) de...
null
A00239620/register_data.py
register_data.py
py
1,041
python
en
code
null
code-starcoder2
83
[ { "api_name": "threading.Thread", "line_number": 6, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 8, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 8, "usage_type": "attribute" }, { "api_name": "th...
365070569
""" Prompt Screen Button Class - Every game option available to player will have a this button """ import pygame from pygame.sprite import Sprite class PromptScreenButton(Sprite): def __init__(self, settings, screen, msg, active, pos_x, pos_y): super().__init__() #sets initial parameters ...
null
src/prompt_screen_button.py
prompt_screen_button.py
py
2,043
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.sprite.Sprite", "line_number": 7, "usage_type": "name" }, { "api_name": "pygame.font.SysFont", "line_number": 25, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 25, "usage_type": "attribute" } ]
642379338
# uncompyle6 version 3.7.4 # Python bytecode 2.5 (62131) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.linux-i686/egg/repoze/who/plugins/use_beaker.py # Compiled at: 2009-12-08 09:36:11 import os from paste.deploy.converters import asbool from paste.re...
null
pycfiles/repoze.who_use_beaker-0.3-py2.5/use_beaker.py
use_beaker.py
py
2,247
python
en
code
null
code-starcoder2
83
[ { "api_name": "zope.interface.implements", "line_number": 15, "usage_type": "call" }, { "api_name": "repoze.who.interfaces.IIdentifier", "line_number": 15, "usage_type": "argument" } ]
499568945
'''decorators for extended function definitions''' import numpy as np from inspect import signature from functools import wraps from astropy import units from astropy.cosmology import default_cosmology def broadcast_arguments(*broadcast_args): '''Decorator that broadcasts arguments. Parameters -------...
null
skypy/utils/_decorators.py
_decorators.py
py
4,312
python
en
code
null
code-starcoder2
83
[ { "api_name": "inspect.signature", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.broadcast_arrays", "line_number": 32, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 29, "usage_type": "call" }, { "api_name": "inspect.sign...
301141796
import jax import jax.numpy as jnp import tensorflow.keras as tfk from unittest import TestCase import elegy from elegy import utils class MeanAbsolutePercentageErrorTest(TestCase): # def test_basic(self): y_true = jnp.array([[1.0, 1.0], [0.9, 0.0]]) y_pred = jnp.array([[1.0, 1.0], [1.0, 0.0]...
null
elegy/losses/mean_absolute_percentage_error_test.py
mean_absolute_percentage_error_test.py
py
3,298
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "jax.numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "jax.numpy", "line_number": 13, "usage_type": "name" }, { "api_name": "jax.numpy.array", "li...
313511406
#!/usr/bin/python import boto3 import json import decimal dynamodb = boto3.resource('dynamodb', region_name='us-west-2') table = dynamodb.Table('SOME-TABLE-NAME') class DecimalEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, decimal.Decimal): if o % 1 > 0: retu...
null
Lambda/dynamodb/dynamopoll.py
dynamopoll.py
py
1,926
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto3.resource", "line_number": 6, "usage_type": "call" }, { "api_name": "json.JSONEncoder", "line_number": 9, "usage_type": "attribute" }, { "api_name": "decimal.Decimal", "line_number": 11, "usage_type": "attribute" }, { "api_name": "json.dumps", ...
77145943
# -*- coding: utf-8 -*- from django.conf.urls import url from ralph.admin.autocomplete import AutocompleteList from ralph.admin.sites import ralph_site urlpatterns = [ url( r'^(?P<app>\w+)/(?P<model>\w+)/(?P<field>\w+)/autocomplete$', ralph_site.admin_view(AutocompleteList.as_view()), name...
null
src/ralph/admin/autocomplete_urls.py
autocomplete_urls.py
py
350
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "ralph.admin.sites.ralph_site.admin_view", "line_number": 10, "usage_type": "call" }, { "api_name": "ralph.admin.sites.ralph_site", "line_number": 10, "usage_type": "name" }, ...
133402782
__author__ = 'ryan' import config import pandas as pd import os import copy import util from collections import OrderedDict import textwrap class Geography: def __init__(self): self.geographies = OrderedDict() self.geography_names = {} self.timezone_names = {} self.map_keys = [] ...
null
energyPATHWAYS/geography.py
geography.py
py
5,684
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.OrderedDict", "line_number": 13, "usage_type": "call" }, { "api_name": "config.cfg.cur.execute", "line_number": 24, "usage_type": "call" }, { "api_name": "config.cfg", "line_number": 24, "usage_type": "attribute" }, { "api_name": "textwr...
474991504
import os import json import sys from output import output def readXF(): global school global neiwaigong global xinfa global detail alldict = {} with open('../../school.json', 'r', encoding='utf-8') as f: alldict = json.loads(f.read()) school = dict((v,k) for (k,v) in alldict['s...
null
analytics/script/pie_tank_xf_ratio.py
pie_tank_xf_ratio.py
py
2,439
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.walk", "line_number": 32, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 39, ...
562009261
import sys from lxml import html, etree import csv import os from pprint import pprint current_dir = os.path.dirname(__file__) dir_of_sites = os.path.join(current_dir,'../data/program_data') OUTPUT_DELIMITER = '|' # Captures head tags: self::h2 or self::h3 or self::h4 ... head_tags = ' or '.join([f'self::h{i}' for i ...
null
processors/parse_for_openrefine.py
parse_for_openrefine.py
py
2,034
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8...
598129364
#!/usr/bin/env python # -*- coding: utf-8 -*- import csv import smtplib from email.mime.text import MIMEText from email.Header import Header def smtpconnect(): s.ehlo() s.starttls() s.login("dutt.department.it@gmail.com", "Q4fT1qOO") def test_conn_open(conn): try: status = conn.noop()[0] e...
null
sendmails.py
sendmails.py
py
1,628
python
en
code
null
code-starcoder2
83
[ { "api_name": "email.mime.text.MIMEText", "line_number": 22, "usage_type": "call" }, { "api_name": "email.Header.Header", "line_number": 23, "usage_type": "call" }, { "api_name": "smtplib.SMTPException", "line_number": 31, "usage_type": "attribute" }, { "api_name"...
55422307
from __future__ import annotations from functools import cached_property from typing import Optional, Type import numpy as np import numpy.typing as npt from sympy import Expr from slimfit.fitresult import FitResult from slimfit.loss import L2Loss, LogLoss, Loss from slimfit.minimizers import ScipyMinimizer, Minimiz...
null
slimfit/fit.py
fit.py
py
2,875
python
en
code
null
code-starcoder2
83
[ { "api_name": "slimfit.models.Model", "line_number": 35, "usage_type": "name" }, { "api_name": "slimfit.parameter.Parameter", "line_number": 36, "usage_type": "name" }, { "api_name": "slimfit.parameter.Parameters", "line_number": 36, "usage_type": "name" }, { "api...
628188659
import numpy as np import matplotlib.pyplot as plt from sklearn.gaussian_process import GaussianProcessRegressor a = np.random.random(50).reshape(50, 1) b = a * 2 + np.random.random(50).reshape(50, 1) plt.scatter(a, b, marker='o', color='r', label='3', s=15) plt.show() gaussian = GaussianProcessRegressor() fiting = ga...
null
GossRegssion.py
GossRegssion.py
py
507
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.random", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.random.random", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random",...
2362482
#!/usr/bin/env python import os import sys import csv import errno import signal import logging import argparse import tempfile import warnings from itertools import starmap from collections import OrderedDict import json # Don't warn about duplicate python bindings for opengm # (We import opengm twice, as 'opengm' 'o...
null
skeleton_synapses/locate_synapses.py
locate_synapses.py
py
26,016
python
en
code
null
code-starcoder2
83
[ { "api_name": "warnings.filterwarnings", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.NullHandler", "line_number": 21, "usage_type": "call" }, { "api_name": "logging...
63326793
""" Tests for the AWS CLI. This mostly provides error case coverage. We rely mostly on manual testing. This is because automated tests for this would be very slow. For developing help texts, it is useful to add a breakpoint on failure and then to capture what the help text actually is with: .. code: python ...
null
tests/test_cli/test_dcos_aws/test_cli.py
test_cli.py
py
18,983
python
en
code
null
code-starcoder2
83
[ { "api_name": "click.testing.CliRunner", "line_number": 34, "usage_type": "call" }, { "api_name": "cli.dcos_aws", "line_number": 36, "usage_type": "argument" }, { "api_name": "typing.List", "line_number": 49, "usage_type": "name" }, { "api_name": "click.testing.Cl...
572717726
#!/usr/bin/env python # Copyright (c) 2011-2021, wradlib developers. # Distributed under the MIT License. See LICENSE.txt for more info. """wradlib - An Open Source Library for Weather Radar Data Processing wradlib is designed to assist you in the most important steps of processing weather radar data. These may inclu...
null
setup.py
setup.py
py
6,690
python
en
code
null
code-starcoder2
83
[ { "api_name": "subprocess.check_output", "line_number": 61, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 62, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 63, "usage_type": "call" }, { "api_name"...
348948575
from django.conf.urls import url from freelancer import views app_name="freelancer" urlpatterns = [ #^ for starting matching and $ for matching at end url(r'^home$',views.freelancerhome), url(r'^completeprofile$',views.completesignup), ]
null
freelancer/urls.py
urls.py
py
255
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "freelancer.views.freelancerhome", "line_number": 10, "usage_type": "attribute" }, { "api_name": "freelancer.views", "line_number": 10, "usage_type": "name" }, { "api_na...
631632395
import csv from training import constants import numpy as np import cv2 from keras.models import Model, Sequential from keras.layers import Dense, Flatten, Conv2D, Lambda, Cropping2D, MaxPool2D, Dropout from keras.callbacks import EarlyStopping def read_training_data(file, mirror_input=True, multicam=True): imag...
null
model.py
model.py
py
3,552
python
en
code
null
code-starcoder2
83
[ { "api_name": "csv.reader", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 23, "usage_type": "call" }, { "api_name": "training.constants.IMAGE_CENTER", "line_number": 23, "usage_type": "attribute" }, { "api_name": "training.c...
551943415
from django.core.management.base import BaseCommand, CommandError from news.models import Article, Feed import newspaper import datetime import feedparser class Command(BaseCommand): help = 'Closes the specified poll for voting' # def add_arguments(self, parser): # parser.add_argument('poll_id', nar...
null
news/management/commands/check_feeds.py
check_feeds.py
py
2,699
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 9, "usage_type": "name" }, { "api_name": "news.models.Feed.objects.all", "line_number": 26, "usage_type": "call" }, { "api_name": "news.models.Feed.objects", "line_number": 26, "usage_type": "attribut...
11125491
import logging from tests import functions header_val = {'content-type': 'application/json'} name = input() position = input() if isinstance(name, str): if isinstance(position, str): if isinstance(header_val, dict): last_cand_before_post = functions.find_last() code = (functions.r...
null
REST_testing/tests/test_post_positive.py
test_post_positive.py
py
868
python
en
code
null
code-starcoder2
83
[ { "api_name": "tests.functions.find_last", "line_number": 12, "usage_type": "call" }, { "api_name": "tests.functions", "line_number": 12, "usage_type": "name" }, { "api_name": "tests.functions.response_code", "line_number": 13, "usage_type": "call" }, { "api_name"...
350696867
from flask import Flask, render_template, request, redirect, url_for from flask_sqlalchemy import SQLAlchemy import secrets import json import requests app = Flask(__name__) app.secret_key = secrets.token_urlsafe(25) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///myDatabase.db' app.config['SQLALCHEMY_TRACK_MODIFI...
null
main.py
main.py
py
1,997
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "secrets.token_urlsafe", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.ren...
263413361
import pytest from project.datastore.product import Product from project.datastore import storage import json import project.application_factory as app_fact ''' *---------------------------------------------------------------------------------------* | General Fixture function called during each tests function (depend...
null
tests/test_endpoints.py
test_endpoints.py
py
2,478
python
en
code
null
code-starcoder2
83
[ { "api_name": "project.application_factory.create_app", "line_number": 15, "usage_type": "call" }, { "api_name": "project.application_factory", "line_number": 15, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "call" }, { ...
279275958
from django.urls import include, path from rest_framework.routers import SimpleRouter from so.views import BoecProgress from user import views app_name = "user" router = SimpleRouter() urlpatterns = [ path("me/", views.ManageUserView.as_view(), name="me"), path("activity/", views.ActivityView.as_view({"get":...
null
app/user/urls.py
urls.py
py
702
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.routers.SimpleRouter", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "user.views.ManageUserView.as_view", "line_number": 11, "usage_type": "call" }, { ...
57022858
#GPIO Pins -I2C #imports import time import Adafruit_LSM303 import Adafruit_GPIO.SPI as SPI import Adafruit_SSD1306 from PIL import Image from PIL import ImageDraw from PIL import ImageFont #setting up OLED RST = 24 DC = 23 SPI_PORT = 0 SPI_DEVICE = 0 disp = Adafruit_SSD1306.SSD1306_128_64(rst=RST, i2c_address=0x3D...
null
Python/GPIO_I2C.py
GPIO_I2C.py
py
1,827
python
en
code
null
code-starcoder2
83
[ { "api_name": "Adafruit_SSD1306.SSD1306_128_64", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image.new", "line_number": 27, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 27, "usage_type": "name" }, { "api_name": "PIL.ImageDraw...
416967661
from math import sin, cos, ceil from math import radians as rad import pygame import pymunk # CLASS AND FUNCTION IMPORTS from bullet import Bullet from text import text class Tank: """Class for creating a Tank Arguments: pos {tuple} -- Starting position of the Tank. team {str} -- Team name o...
null
scripts/tank.py
tank.py
py
3,367
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymunk.Body", "line_number": 32, "usage_type": "call" }, { "api_name": "pymunk.moment_for_poly", "line_number": 33, "usage_type": "call" }, { "api_name": "pymunk.Poly", "line_number": 36, "usage_type": "call" }, { "api_name": "math.sin", "line_n...
325854893
import pygame def vertical_gradient(size, startcolor, endcolor): """ Draws a vertical linear gradient filling the entire surface. Returns a surface filled with the gradient (numeric is only 2-3 times faster). """ height = size[1] bigSurf = pygame.Surface((1, height)).convert_alpha() dd = 1...
null
src/utils.py
utils.py
py
791
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.Surface", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.transform.scale", "line_number": 25, "usage_type": "call" }, { "api_name": "pygame.transform", "line_number": 25, "usage_type": "attribute" } ]
86604388
""" 例子描述: 学校通过两门课的成绩来判断你是否能进入他们学校读书。 """ import numpy as np import pandas from matplotlib import pyplot as plt import time def sigmoid(X, theta): """ 假设函数 :param X: 样本 :param theta: 权重 :return: """ z = np.dot(X, theta) return 1 / (1 + np.exp(-z)) def cost(X, y, theta): """ 代价函数...
null
logistic_regression/simple_dmo/admitted_prediction.py
admitted_prediction.py
py
3,205
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.dot", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.squeeze", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 32, ...
51835902
import unittest import warnings import pynisher from mosaic.mosaic import Search from mosaic_ml.model_config.data_preprocessing.decomposition import * from sklearn import datasets, decomposition, linear_model from sklearn.model_selection import train_test_split from sklearn.pipeline import Pipeline digits = datasets....
null
test/test_decomposition.py
test_decomposition.py
py
10,043
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.datasets.load_digits", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 11, "usage_type": "name" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 14, "usage_type": "call" }, {...
443104329
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json import os import csv import getopt import sys import argparse if __name__ == '__main__': parser = argparse.ArgumentParser(description='Generate config.yml file with gestalt scores') parser.add_argument('-i', '--input', help='path to phenotype_to_gene...
null
helper/get_gestalt_yml.py
get_gestalt_yml.py
py
1,151
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 21, "usage_type": "call" } ]
136013620
from selenium import webdriver import plotly.graph_objects as go import plotly.express as px import pandas as pd import numpy as np class RaspagemCorona(): def __init__(self): self.driver = webdriver.Chrome() self.driver.get('https://www.worldometers.info/coronavirus/') def RasparDados(self, pa...
null
projeto_final/raspagem_corona.py
raspagem_corona.py
py
3,943
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.nan", "line_number": 51, "usage_type": "attribute" }, { "api_name": "pandas.Da...
104286867
from sqlalchemy import Column from sqlalchemy import String from sqlalchemy import DateTime from sqlalchemy.ext.declarative import declarative_base from django.conf import settings Base = declarative_base() class Feedback(Base): """A Data Access Object (DAO) for feedback submissions.""" __tablename__ = 'feed...
null
demo/models.py
models.py
py
972
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy.DateTime", "line_number": 14, "usage_type": "call" }, { "...
565984661
from django.conf.urls import patterns, url from .views import LeadsList, LeadAdd, LeadDetail, LeadEdit, LeadDelete, LeadsListDelete urlpatterns = patterns( '', url(r'^add/$', LeadAdd.as_view(), name='lead-add'), url(r'^edit/(?P<pk>[0-9]+)/$', LeadEdit.as_view(), name='lead-edit'), url(r'^delete/(?P<pk...
null
leads/urls.py
urls.py
py
578
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "views.LeadAdd.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "vie...
632469244
import numpy as np import pickle import cv2, os from glob import glob from keras import optimizers from keras.models import Sequential from keras.layers import Dense from keras.layers import Dropout from keras.layers import Flatten from keras.layers.convolutional import Conv2D from keras.layers.convolutional import Max...
null
Indian Sign Language Gesture/cnn_keras.py
cnn_keras.py
py
3,630
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.backend.common.image_dim_ordering", "line_number": 16, "usage_type": "call" }, { "api_name": "keras.backend.common", "line_number": 16, "usage_type": "attribute" }, { "api_name": "keras.backend", "line_number": 16, "usage_type": "name" }, { "a...
192211286
from tkinter import * from PIL import Image import os from pickle import load from numpy import asarray class Paint(object): def __init__(self, classifier): self.classifier = classifier self.root = Tk() self.root.title('Digit Estimator') self.c = Canvas(self.root, bg='white', widt...
null
main.py
main.py
py
2,766
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.system", "line_number": 55, "usage_type": "call" }, { "api_name": "os.system", "line_number": 56, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 57, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 57,...
653419229
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.dashboard, name='dashboard'), url(r'^eating/', views.eating, name='eating'), url(r'^listeningto/', views.listening, name='listing'), url(r'^record/', views.record, name='record'), ]
null
urls.py
urls.py
py
286
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.co...
157165443
"""Module contains routes, used for problem table.""" import json import hashlib import time import os import PIL from flask import request, jsonify, Response from flask_login import current_user from PIL import Image from ecomap import validator from ecomap.app import app, logger, auto from ecomap.db import util as...
null
ecomap/www/problem_views.py
problem_views.py
py
14,300
python
en
code
null
code-starcoder2
83
[ { "api_name": "ecomap.db.util.get_all_problems", "line_number": 38, "usage_type": "call" }, { "api_name": "ecomap.db.util", "line_number": 38, "usage_type": "name" }, { "api_name": "flask.Response", "line_number": 47, "usage_type": "call" }, { "api_name": "json.du...
629973659
import plotly import plotly.offline as offline import plotly.graph_objs as go from igraph import * class Artist: def __init__(self): plotly.tools.set_credentials_file("PeachCobbler", "rk7L2GC5hMeTZWOvpZsg") # init_notebook_mode(connected=True) return def draw_objects(self,...
null
gui/trees/artist.py
artist.py
py
5,836
python
en
code
null
code-starcoder2
83
[ { "api_name": "plotly.tools.set_credentials_file", "line_number": 9, "usage_type": "call" }, { "api_name": "plotly.tools", "line_number": 9, "usage_type": "attribute" }, { "api_name": "plotly.graph_objs.Scatter", "line_number": 14, "usage_type": "call" }, { "api_n...
541204861
# coding: utf-8 """ 3Di API 3Di simulation API (latest version: 3.0) Framework release: 1.0.16 3Di core release: 2.0.11 deployed on: 07:33AM (UTC) on September 04, 2020 # noqa: E501 The version of the OpenAPI document: 3.0 Contact: info@nelen-schuurmans.nl Generated by: https://openapi-gen...
null
openapi_client/models/aggregation_settings.py
aggregation_settings.py
py
11,090
python
en
code
null
code-starcoder2
83
[ { "api_name": "openapi_client.configuration.Configuration", "line_number": 63, "usage_type": "call" }, { "api_name": "six.iteritems", "line_number": 267, "usage_type": "call" }, { "api_name": "pprint.pformat", "line_number": 291, "usage_type": "call" } ]
606593213
# Strings A and B are K-similar (for some non-negative integer K) # if we can swap the positions of two letters in A exactly K times so that the resulting string equals B. # # Given two anagrams A and B, return the smallest K for which A and B are K-similar. # # Example 1: # # Input: A = "ab", B = "ba" # Output: 1 # Ex...
null
src/main/python/com/py/algo/graph/kSimilarityStrings.py
kSimilarityStrings.py
py
4,910
python
en
code
null
code-starcoder2
83
[ { "api_name": "itertools.combinations", "line_number": 35, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 44, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 112, "usage_type": "call" } ]
50563596
import os import logging from flask import Flask, url_for as _url_for from flask.ext.oauth import OAuth from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.migrate import Migrate from elasticsearch import Elasticsearch from celery import Celery from grano import default_settings logging.basicConfig(level=logg...
null
grano/core.py
core.py
py
1,314
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.WARN...
56008214
from math import sin import matplotlib; matplotlib.use("pdf") import matplotlib.pyplot as plt def integrateEuler(F,x0,t0,h,N): ''' (function, list, float, float, int) -> (list, list) uses the Euler method to solve arbritrary orinary differential equations ''' x = [t0] y = [x0] for i in ran...
null
A5.py
A5.py
py
1,330
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.use", "line_number": 2, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 45, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
106702444
import tkinter import pickle from PIL import Image from Tools import Flicker from Tools.Stickman import Part class Watering(Flicker.Flicker): def __init__(self): super().__init__() self.frame = 0 self.data = {} # pickle.load(open("./data/walkin.dat", "rb")) for i in self.data: ...
null
StickyCopy/Watering.py
Watering.py
py
1,473
python
en
code
null
code-starcoder2
83
[ { "api_name": "Tools.Flicker.Flicker", "line_number": 7, "usage_type": "attribute" }, { "api_name": "Tools.Flicker", "line_number": 7, "usage_type": "name" }, { "api_name": "Tools.Stickman.Part.HEAD", "line_number": 13, "usage_type": "attribute" }, { "api_name": "...
391558441
import matplotlib as mpl from matplotlib import pyplot as plt from matplotlib import gridspec from mpl_toolkits.axes_grid import inset_locator import os import fnmatch import numpy as np import scipy.ndimage as ndi import pandas as pd import palettable as pbl import h5py cmap7 = pbl.colorbrewer.get_map('Set1', 'Qual...
null
waveguide.test/waveguide/simulation_processing.py
simulation_processing.py
py
9,783
python
en
code
null
code-starcoder2
83
[ { "api_name": "palettable.colorbrewer.get_map", "line_number": 15, "usage_type": "call" }, { "api_name": "palettable.colorbrewer", "line_number": 15, "usage_type": "attribute" }, { "api_name": "palettable.colorbrewer.get_map", "line_number": 16, "usage_type": "call" }, ...
387394685
# uncompyle6 version 3.7.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.linux-x86_64/egg/ast2000tools/utils.py # Compiled at: 2019-11-12 17:41:01 """Module containing various utility functions.""" from __future__ import d...
null
pycfiles/ast2000tools-1.0.23-py27-none-any/utils.py
utils.py
py
10,452
python
en
code
null
code-starcoder2
83
[ { "api_name": "six.moves.urllib.request.urlopen", "line_number": 28, "usage_type": "call" }, { "api_name": "six.moves.urllib.request", "line_number": 28, "usage_type": "attribute" }, { "api_name": "six.moves.urllib", "line_number": 28, "usage_type": "name" }, { "a...
265173656
#!/usr/bin/env python import sqlite3 def open_db(): return sqlite3.connect('/home/krug/projects/strava/db/activity_data.db') def make_html_header(): s = '<html>' s += '<header>' s += '</header>' s += '<body>' return s def start_html_table(): s = '<table>' return s def end_html_t...
null
gen_site.py
gen_site.py
py
1,264
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" } ]
577148961
import socket import threading import json import select import time import mysql.connector from random import randint import sys sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) IP = socket.gethostbyname(socket.gethostname()) print(IP) sock.bind((IP, 4567)) sock.listen() FREE_PORTS = [x for x in range(7000...
null
multiplayer_server.py
multiplayer_server.py
py
22,349
python
en
code
null
code-starcoder2
83
[ { "api_name": "socket.socket", "line_number": 10, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 10, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM", "line_number": 10, "usage_type": "attribute" }, { "api_name": "socket.geth...
452212877
import subprocess from datetime import datetime from tqdm import tqdm from influxdb import InfluxDBClient import argparse import os import numpy as np import time import socket import sys def get_datetime(s): from datetime import datetime try: return (datetime.strptime(s, "%Y-%m-%dT%H:%M:%S"), "seco...
null
Databases/influx/dstree/generate_udf.py
generate_udf.py
py
7,112
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.strptime", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 19, "usage_type": "call" }, { "api_name"...
542838598
# -*- coding: utf-8 -*- import argparse import os import sys import numpy as np from chainer import cuda, serializers import h5py import pyprind import utils import models def create_image_references(model, corpora, path_image_names, path_vectors): # Count the number of images utils.logger.debug("[info] Ag...
null
scripts/main_create_references.py
main_create_references.py
py
5,851
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.logger.debug", "line_number": 18, "usage_type": "call" }, { "api_name": "utils.logger", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pyprind.prog_bar", "line_number": 21, "usage_type": "call" }, { "api_name": "utils.logger.de...
558676926
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: Mehdi Senoussi code adapted by tom verguts to extra exercise 1 (the jets and sharks gangs) """ import numpy as np import time from ch0_course_functions import plot_network, update_network import matplotlib.pyplot as pl # we have 4 input unit on the first lay...
null
AY 2018 - 2019/ch3_gang_detector_hebbian_learning_matrix_not.py
ch3_gang_detector_hebbian_learning_matrix_not.py
py
6,044
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": ...
504462010
# -*- coding: utf-8 -*- """ Created on Mon Jun 29 14:45:22 2015 @author: Antoine.Grappin """ ######################################## ######################################## # 1st part: Python and Pandas with Sentiment Analysis Database # http://pythonprogramming.net/python-and-pandas-for-sentiment-analysis-and-fin...
null
tutorial_finance_investing_with_sentiment.py
tutorial_finance_investing_with_sentiment.py
py
32,429
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 1069, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 1076, "usage_type": "attribute" }, { "api_name": "numpy.float64", "line_number": 1077, "usage_type": "attribute" }, { "api_name": "pandas.ex...
407735415
from first.models import * from django.test import TestCase from django.test import Client class SimpleTest(TestCase): def test_basic(self): title = '1' ingredients = '2' steps = '3' obj = Recipes.objects.create(title = title ,ingredients = ingredients ,steps = steps ) title...
null
first/tests.py
tests.py
py
1,229
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.test.TestCase", "line_number": 5, "usage_type": "name" }, { "api_name": "django.test.Client", "line_number": 14, "usage_type": "call" } ]
143886186
""" 时间API """ from datetime import date now = date.today() print(now) print(type(now)) birthday = date(1964, 7, 31) age = now - birthday print(age.days) yesterday = date(2018, 5, 2) age = now - yesterday print(age.days)
null
tutorial/chapter10_standard_library/10_8_dates_times.py
10_8_dates_times.py
py
228
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.date.today", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 6, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.date", "li...
310889356
import json import base64 from cproto import CProto def do_capture(): cp = CProto() payload = json.loads(cp.Page.captureScreenshot()) data = base64.b64decode(payload['result']['data']) with open('output.jpeg', 'wb') as f: f.write(data) if __name__ == '__main__': do_capture()
null
examples/screenshot.py
screenshot.py
py
309
python
en
code
null
code-starcoder2
83
[ { "api_name": "cproto.CProto", "line_number": 8, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 9, "usage_type": "call" }, { "api_name": "base64.b64decode", "line_number": 10, "usage_type": "call" } ]
344394468
# -*- coding: utf-8 -*- import scrapy class scrapysh1kmbab27Spider(scrapy.Spider): name = "scrapysh1kmbab27" allowed_domains = ["ganjoor.net"] if 1 == 1: start_urls = ["https://ganjoor.net/hojviri/kashfol-mahjoob/kmbab27/sh1"] else: start_urls = ["https://ganjoor.net/hojviri/kashfol-mah...
null
crawler/ganjoor/spiders/hojviri/kashfol-mahjoob/scrapysh1kmbab27.py
scrapysh1kmbab27.py
py
3,976
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.Spider", "line_number": 4, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 65, "usage_type": "call" } ]
493848275
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'Hardware.views.home', name='home'), # url(r'^blog/', include('blog.urls')),__author__ = 'andrzej' url(r'^$', 'baza.views.lista'), url(r'^lista/$', 'baza.views.l...
null
baza/urls.py
urls.py
py
922
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "dja...
165788396
import openpyxl import xlrd wb = openpyxl.load_workbook('Sample.xlsx') type(wb) sheet = wb.get_sheet_by_name('Sheet1') tuple(sheet['A1':'C3']) for rowOfCellObjects in sheet['A1':'C3']: for cellObj in rowOfCellObjects: if cellObj.value == 'Mango': print('Matches ') print(cellObj.coord...
null
helo.py
helo.py
py
467
python
en
code
null
code-starcoder2
83
[ { "api_name": "openpyxl.load_workbook", "line_number": 3, "usage_type": "call" } ]
112412008
from bs4 import BeautifulSoup from common import cache_request, normalize_state, diff_and_save from parse_pdf import parse_pdf EMAIL_LIST_URL = 'https://www.ok.gov/elections/County_Election_Board_Email_Addresses.html' def parse_email_list(): text = cache_request(EMAIL_LIST_URL) soup = BeautifulSoup(text, 'html...
null
states/oklahoma/main.py
main.py
py
934
python
en
code
null
code-starcoder2
83
[ { "api_name": "common.cache_request", "line_number": 11, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" }, { "api_name": "parse_pdf.parse_pdf", "line_number": 23, "usage_type": "call" }, { "api_name": "common.nor...
61618849
# Imports from flask import Flask, render_template, \ url_for, request, redirect,\ flash, jsonify, make_response from flask import session as login_session from sqlalchemy import create_engine, asc, desc from sqlalchemy.orm import sessionmaker from database_setup import * fro...
null
project.py
project.py
py
16,336
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 22, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 27, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 33, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.sessio...
133415540
import json import hashlib import requests import time print(int(time.time())) key = os.getenv("Problem_finder_key") # fetching from environment variables secret = os.getenv("Problem_finder_secret") # fetching from environment variables main="https://codeforces.com/api/problemset.problems?tags=math&apiKey="+key+"&...
null
problemfinder/fetchdata.py
fetchdata.py
py
630
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.time", "line_number": 6, "usage_type": "call" }, { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "hashlib.sha512", "line_number": 18, ...
323236400
from django.utils import timezone from . import ActionTest, SetSessionMenuOption import copy import mock import pytz class DisplayHoursAndCharge(SetSessionMenuOption): def setUp(self): super(DisplayHoursAndCharge, self).setUp() self.data = copy.deepcopy(self.data) self.data.update({'Seque...
null
core/tests/views/d_1_check_parking_charge/test_2_display_hours_and_charge.py
test_2_display_hours_and_charge.py
py
2,059
python
en
code
null
code-starcoder2
83
[ { "api_name": "copy.deepcopy", "line_number": 12, "usage_type": "call" }, { "api_name": "pytz.timezone", "line_number": 18, "usage_type": "call" }, { "api_name": "django.utils.timezone.datetime", "line_number": 18, "usage_type": "call" }, { "api_name": "django.uti...
636862508
#! /usr/bin/env python # -*- coding: utf-8 -*- import gc import math import os import pprint import re import time import unicodedata import warnings from shutil import rmtree import fitz import ujson as json from PyPDF2 import PdfFileReader from PyPDF2.utils import PdfReadError from pdfminer.pdfdocument import PDFE...
null
libraries_tests.py
libraries_tests.py
py
23,727
python
en
code
null
code-starcoder2
83
[ { "api_name": "gc.collect", "line_number": 28, "usage_type": "call" }, { "api_name": "warnings.simplefilter", "line_number": 30, "usage_type": "call" }, { "api_name": "unicodedata.normalize", "line_number": 52, "usage_type": "call" }, { "api_name": "unicodedata.ca...
106044476
import pytest import time import sys from os.path import dirname, abspath sys.path.insert(0, dirname(dirname(abspath(__file__)))) from page_obj.scg.scg_def_physical_interface import * from page_obj.scg.scg_def_vlan_interface import * from page_obj.scg.scg_def_bridge import * from page_obj.common.rail import * ...
null
pyautoTest-master(ICF-7.5.0)/test_case/scg/scg_DCHP_Server/test_c139267.py
test_c139267.py
py
2,082
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.insert", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.abspath", "lin...
106385252
# Cognitive Services Vision API mini-client import requests import time NumRetries = 4 # taken from https://github.com/Microsoft/Cognitive-Vision-Python/blob/master/Jupyter%20Notebook/Computer%20Vision%20API%20Example.ipynb def processRequest(url, json, data, headers, params): """ Helper function to process ...
null
photo-analysis/cogvision.py
cogvision.py
py
4,450
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.request", "line_number": 22, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 26, "usage_type": "call" } ]
73461107
# Copyright 2019 codeo # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
null
ytdl_options.py
ytdl_options.py
py
2,097
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.timedelta", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 51, "usage_type": "call" } ]
579741227
from django.db import models from django.contrib import admin from datetime import datetime class Program(models.Model): name = models.CharField(max_length=50) def __unicode__(self): return self.name class Student(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_len...
null
inventory/models.py
models.py
py
2,839
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 6, "usage_type": "call" }, { "api_name": "...
39993229
import pandas as pd import pprint, talib from binance import ThreadedWebsocketManager from binance.client import Client from binance.enums import * from src.config import API_KEY, API_SECRET import dask.array as da BBPB_PERIOD = 20 BBPB_OVERBOUGHT = .70 BBPB_OVERSOLD = .30 TRADE_SYMBOL = 'ALGOUSDT' TRADE_QUANTITY = 25...
null
src/boteu.py
boteu.py
py
4,668
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.DataFrame", "line_number": 23, "usage_type": "call" }, { "api_name": "binance.ThreadedWebsocketManager", "line_number": 29, "usage_type": "call" }, { "api_name": "src.config.API_KEY", "line_number": 29, "usage_type": "name" }, { "api_name": "...
191356047
from django.db import models from django.template.defaultfilters import slugify class HighCategories(models.TextChoices): FOOD_DRINK = 'food and drink' ENTERTAINMENT = 'entertainment' SHOPPING = 'shopping' EDUCATION = 'education' PROFESSIONAL_SERVICES = 'professional services' OTHER_BUSINESSES ...
null
skeleton/businesses/models.py
models.py
py
5,903
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.TextChoices", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.TextChoices", "line_number": 12, "usage_type": "attribute" }, { ...
11899536
#! /usr/bin/env python3 """ Database utilities. """ import os import sqlite3 CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) DATABASE = os.path.join(CURRENT_DIR, 'db.sqlite3') SCHEMA = os.path.join(CURRENT_DIR, 'schema.sql') def build_database() -> None: """ Use SCHEMA to build the database. """ ...
null
db/utils.py
utils.py
py
1,007
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
271354974
# -*- coding: utf-8 -*- """ This spider is a TalkWeb spider created on top of the ATSSpider scrapy crawl talkweb -a mining_job_id=9999 -a iteration=1 -a extract=1 -a url="http://www.talkweb.com.cn/postPublish/pageSearchPostPublish?type=0" sample job url: http://www.talkweb.com.cn/postPublish/showPo...
null
brightcorp/brightcorp/spiders/talkweb.py
talkweb.py
py
3,650
python
en
code
null
code-starcoder2
83
[ { "api_name": "brightcorp.base.atsspiders.ATSSpider", "line_number": 20, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 23, "usage_type": "call" }, { "api_name": "scrapy.selector.Selector", "line_number": 31, "usage_type": "call" }, { "api_name...
116909489
#!/usr/bin/env python3 import rospy, cv2, cv_bridge, math from sensor_msgs.msg import LaserScan, Image from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3 from nav_msgs.msg import Odometry import moveit_commander from q_learning_project.msg import RobotMoveDBToBlock from tf.transformations import ...
null
scripts/execute_robot_movement.py
execute_robot_movement.py
py
7,902
python
en
code
null
code-starcoder2
83
[ { "api_name": "rospy.init_node", "line_number": 34, "usage_type": "call" }, { "api_name": "rospy.Publisher", "line_number": 39, "usage_type": "call" }, { "api_name": "geometry_msgs.msg.Twist", "line_number": 39, "usage_type": "argument" }, { "api_name": "geometry_...
374761828
# -*- coding: utf-8 -*- import json, scipy.misc, os f = open(os.path.join('..', 'data', 'train.json')) j = json.loads(f.read()) f.close() labels = dict() for entry in j['annotations']: labels[int(entry['imageId'])] = map(int, entry['labelId']) # Now you can do... # In [1]: labels[3360] # Out[1]: [114, 66, 98, 21...
null
tools/indexlabels.py
indexlabels.py
py
333
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 5, "usage_type": "call" } ]
466402188
# Copyright European Organization for Nuclear Research (CERN) # # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # # Authors: # - Martin Barisits, <mar...
null
lib/rucio/daemons/abacus/rse.py
rse.py
py
3,337
python
en
code
null
code-starcoder2
83
[ { "api_name": "threading.Event", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 25, "usage_type": "attribute" }, { "api_name": "rucio.common.conf...
126280521
"""Exercise 9c""" import time import numpy as np import matplotlib.pyplot as plt from plot_results import plot_2d from run_simulation import run_simulation from simulation_parameters import SimulationParameters def exercise_9c(world, timestep, reset): """Exercise 9c""" n_joints = 10 Rhead = 0.44 ...
null
Lab9/Webots/controllers/pythonController/exercise_9c.py
exercise_9c.py
py
3,960
python
en
code
null
code-starcoder2
83
[ { "api_name": "simulation_parameters.SimulationParameters", "line_number": 20, "usage_type": "call" }, { "api_name": "run_simulation.run_simulation", "line_number": 42, "usage_type": "call" }, { "api_name": "simulation_parameters.SimulationParameters", "line_number": 66, ...
519478489
from collections import namedtuple, defaultdict TestCase = namedtuple('TestCase', 'case expected') def check_case(test_case, actual): if test_case.expected == actual: print("OK %s" % (test_case.case,)) else: print("FAIL %s, expected %s, got %s" % (test_case.case, test_case.expected, actual)) ...
null
d24/d24p1.py
d24p1.py
py
1,806
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.namedtuple", "line_number": 3, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 26, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 43, "usage_type": "call" } ]
435033188
import math, pygame, threading, polygon, circle, vector MAPWIDTH, MAPHEIGHT = 800, 600 class Perspective(threading.Thread): def setup(self, data, windowWidth, windowHeight, windowSurface): #Perspective reads the main data object self.data = data self.IMG_player_idle = pygame.transform.smoothscale(pygame.image.lo...
null
client/perspective.py
perspective.py
py
3,095
python
en
code
null
code-starcoder2
83
[ { "api_name": "threading.Thread", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.transform.smoothscale", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.transform", "line_number": 8, "usage_type": "attribute" }, { "api_name": ...
200723384
# Create your views here. def comparePage(request): item1, item2 = _selectItems() # display the compare page from django.template import RequestContext from django.shortcuts import render_to_response return render_to_response('compare_main.html', {'item1': item1, 'item2': item2}, ...
null
Compare/views.py
views.py
py
6,019
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.render_to_response", "line_number": 9, "usage_type": "call" }, { "api_name": "django.template.RequestContext", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.render_to_response", "line_number": 34, "usage_type": ...
99909326
## Copyright (C) 2016 Luca Massarelli ## 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 3 of the License, or ## (at your option) any later version. ##...
null
Crea_Grafo_Linee.py
Crea_Grafo_Linee.py
py
11,686
python
en
code
null
code-starcoder2
83
[ { "api_name": "string.split", "line_number": 74, "usage_type": "call" }, { "api_name": "snap.TIntStrH", "line_number": 86, "usage_type": "call" }, { "api_name": "snap.TUNGraph.New", "line_number": 87, "usage_type": "call" }, { "api_name": "snap.TUNGraph", "lin...
334274064
from collections import defaultdict import random from docopt import docopt import sys class PCFG(object): def __init__(self): self._rules = defaultdict(list) self._sums = defaultdict(float) def add_rule(self, lhs, rhs, weight): assert(isinstance(lhs, str)) assert...
null
Assignment2/generate.py
generate.py
py
2,232
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" }, { "api_name": "random.random", "line_number": 49, "usage_type": "call" }, { "api_name": "docopt.d...
253421076
from django import template from menu.models import MenuNode register = template.Library() @register.inclusion_tag('menu/menu.html', takes_context=True) def draw_menu(context, menu_name): max_level = context['page'].level + 1 nodes = MenuNode.objects.filter(belongs_to=menu_name).filter(level=0) return {'...
null
menu/templatetags/draw_menu.py
draw_menu.py
py
386
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.template.Library", "line_number": 4, "usage_type": "call" }, { "api_name": "django.template", "line_number": 4, "usage_type": "name" }, { "api_name": "menu.models.MenuNode.objects.filter", "line_number": 10, "usage_type": "call" }, { "api_nam...
50398689
from argparse import ArgumentParser import jsonlines from flask import Flask, render_template, request, redirect def read_sentences(input_fpath): sentences = [] print('Reading tokenized corpus from: ', input_fpath) with jsonlines.open(input, 'r') as reader: for sentence in reader: sen...
null
tagger-webapp/tagger.py
tagger.py
py
2,054
python
en
code
null
code-starcoder2
83
[ { "api_name": "jsonlines.open", "line_number": 10, "usage_type": "call" }, { "api_name": "jsonlines.open", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 23, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", ...
170137726
#-*- coding: utf-8 -*- from django.http import HttpResponse from django.shortcuts import render_to_response, get_list_or_404 from capife.models import Persona from capife.models import Curso from django.template import RequestContext from django.contrib.auth.decorators import login_required def index(request): pipol...
null
src/capife/views.py
views.py
py
1,158
python
en
code
null
code-starcoder2
83
[ { "api_name": "capife.models.Persona.objects.all", "line_number": 10, "usage_type": "call" }, { "api_name": "capife.models.Persona.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "capife.models.Persona", "line_number": 10, "usage_type": "name" },...
17666859
import logging import numpy as np from qcodes.instrument.parameter import Parameter, ManualParameter from qcodes.instrument.base import Instrument from qcodes.utils.validators import Enum from typing import NamedTuple log = logging.getLogger(__name__) LOW_NOISE_GAINS = (1e2, 1e3, 1e4, 1e5, 1e6, 1e7) HIGH_SPEED_GAI...
null
qcodes_contrib_drivers/drivers/FEMTO/FEMTO_OE300_base.py
FEMTO_OE300_base.py
py
2,188
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "typing.NamedTuple", "line_number": 27, "usage_type": "name" }, { "api_name": "qcodes.instrument.base.Instrument", "line_number": 34, "usage_type": "name" }, { "api_name": ...
484902918
# -*- coding: utf-8 -*- # 문제 2번의 실행 결과와 소스 코드 제출 # 실행 결과는 콘솔/이미지 import tensorflow as tf # 입력 데이터의 개수가 2개 이상인 경우의 처리방법 x1_data = [1.,2,3,4,5] x2_data = [5.,6,7,8,9] y_data = [35., 55, 77, 89, 100] X1 = tf.placeholder(tf.float32) X2 = tf.placeholder(tf.float32) Y = tf.placeholder(tf.float32) W1 = tf...
null
day_10/ml_04.py
ml_04.py
py
1,813
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.placeholder", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tensorflow.placeholder", "line_number": 14, "usage_type": "call" }, { "api_name": ...
382834578
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, ForeignKey, Integer, String, DateTime, Boolean from sqlalchemy.orm import relationship from flask_login.mixins import UserMixin Base = declarative_base() class Address(Base): __tablename__ = "addresses" id = Column(Intege...
null
src/db/models.py
models.py
py
1,666
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 12, "usage_type": "argument" }, { ...
55019598
import discord from discord.ext import commands from utils.checks import * import asyncio import datetime import random import traceback from cogs.classes import genstats from decimal import Decimal def in_raid(): def predicate(ctx): return ctx.author in ctx.bot.raid and ctx.channel.id == 506_133_354_874_...
null
cogs/raid.py
raid.py
py
16,649
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.ext.commands.check", "line_number": 16, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 16, "usage_type": "name" }, { "api_name": "discord.ext.commands.check", "line_number": 23, "usage_type": "call" }, { "api_na...
343534339
import cv2 import numpy as np import os from random import shuffle from tqdm import tqdm import tflearn import tensorflow as tf from tflearn.layers.conv import conv_2d, max_pool_2d from tflearn.layers.core import input_data, dropout, fully_connected from tflearn.layers.es...
null
training/training1.py
training1.py
py
3,753
python
en
code
null
code-starcoder2
83
[ { "api_name": "tqdm.tqdm", "line_number": 30, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, ...
435206125
from selenium import webdriver import urllib.request import xlwt import xlrd import time from lxml import etree user="18813295794" password="18898604973db" driver=webdriver.Firefox()#获取火狐驱动 driver.maximize_window()#窗口最大化 driver.get('https://movie.douban.com/')#模拟登陆豆瓣首页 time.sleep(2) def set_style(name, height, bo...
null
lx/yaoshen.py
yaoshen.py
py
3,287
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 9, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 12, "usage_type": "call" }, { "api_name": "xlwt.XFStyle",...
329998992
import os import sys import logging import base64 from xml.etree import ElementTree from pathlib import Path from qt_material.resources import ResourseGenerator, RESOURCES_PATH GUI = True if 'PySide2' in sys.modules: from PySide2.QtGui import QFontDatabase, QColor, QGuiApplication, QPalette from PySide2.QtWid...
null
qt_material/__init__.py
__init__.py
py
14,088
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.modules", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.modules", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.modules", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.modules", ...
298741727
from django.shortcuts import render from django.shortcuts import render, redirect from django.contrib.auth import get_user_model from django.http import HttpResponseRedirect, HttpResponse from users.models import Tenant, PropertyManager from django.template import loader from .models import Ticket User = get_user_model...
null
BackEnd/LeaseLordWeb/maintenance/views.py
views.py
py
2,589
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 8, "usage_type": "call" }, { "api_name": "users.models.Tenant.objects.get", "line_number": 20, "usage_type": "call" }, { "api_name": "users.models.Tenant.objects", "line_number": 20, "usage_type": "attribu...
124326
# -*- coding: utf-8 -*- """ Created on Thu Aug 15 07:35:07 2019 @author: seanm """ from pandas import DataFrame, Series import pandas as pd import numpy as np import os import matplotlib.pylab as plt from sklearn.model_selection import train_test_split from sklearn import preprocessing from sklearn.cluster import KMe...
null
Week 4/project 4.py
project 4.py
py
3,301
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.cluster.KMeans", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 25, "usage_type": "call" }, { "api_name": "scipy.spatial.distance.cdist", "line_number": 25, "usage_type": "call" }, { "api_name": "matplot...
330544531
import StrategyLearner as sl import marketsimcode as mc import numpy as np import datetime as dt import pandas as pd import util as ut # name: Ting Yan # id: tyan37 def impactEffects(symbol="JPM", sd=dt.datetime(2008, 1, 1), ed=dt.datetime(2008, 3, 1), sv=100000, impact = 0 ): imp = impac...
null
strategy_learner/experiment2.py
experiment2.py
py
1,918
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "call" }, { "api_name": "StrategyLearner.StrategyLearner", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_records", "line_number": 30, "usage_type": "call" }, { "a...
6440650
import sys import xml.etree.ElementTree as ET lsquig = "{" ; rsquig = "}" ; apos = "'" ; cr = "!!" parameters = dict() #------------- Process Input Parameters --------------# # grab the input parameter string and put them in a dictionary # The input in sys.argv[1] looks like: "shape:rectangle|sides:4|color:green" ...
null
Templates/poco.py
poco.py
py
1,533
python
en
code
null
code-starcoder2
83
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 17, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 17, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 20, "usage_type": "call" }, { ...
404294171
import pygame from mark import Mark, Score import game_functions as gf class TicTacToe: """Tic tac toe game model""" def __init__(self): """Initialize attributes and apply settings""" pygame.init() self.apply_settings() self.screen = pygame.display.set_mode((self.sn_width, self.sn_height)) self.flag...
null
main.py
main.py
py
2,785
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pygame.time.C...