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
327130920
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # See file LICENSE for terms. # This file is a copy of what is available in a Cython demo + some additions from __future__ import absolute_import, print_function import os from distutils.sysconfig import get_config_var, get_python_inc import versioneer ...
null
setup.py
setup.py
py
3,097
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "distutils.sysconfig.get_python_inc", "line_number": 21, "usage_type": "call" }, { "api_name": "distu...
448593215
import matplotlib.pyplot as plt import numpy as np import vpython from Object import point, object from matplotlib import animation massE = 5.972 * 10 ** 24 massS = 1.99 * 10 ** 30 radiusE = 6371 * 1000000 radisuS = 695510 * 10000 G = 6.67 * 10 ** -11 t = 86400 earth = object(point(150*10**9, 0), massE, point(0, 30...
null
simulation.py
simulation.py
py
1,707
python
en
code
null
code-starcoder2
76
[ { "api_name": "Object.object", "line_number": 14, "usage_type": "call" }, { "api_name": "Object.point", "line_number": 14, "usage_type": "call" }, { "api_name": "Object.object", "line_number": 15, "usage_type": "call" }, { "api_name": "Object.point", "line_num...
526929630
# uncompyle6 version 3.6.7 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] # Embedded file name: build/bdist.macosx-10.7-x86_64/egg/airflow/contrib/sensors/emr_base_sensor.py # Compiled at: 2019-09-11 03:47:34 # Size of source mod 2**...
null
pycfiles/apache_ariatosca-0.2.0-py2-none-any/emr_base_sensor.cpython-36.py
emr_base_sensor.cpython-36.py
py
1,536
python
en
code
null
code-starcoder2
76
[ { "api_name": "airflow.sensors.base_sensor_operator.BaseSensorOperator", "line_number": 11, "usage_type": "name" }, { "api_name": "airflow.utils.apply_defaults", "line_number": 15, "usage_type": "name" }, { "api_name": "airflow.exceptions.AirflowException", "line_number": 35,...
473458867
from init import * from data import * from tokens import * from train import * from model import * from evaluate import * import numpy as np import random import time import datetime import math import importlib def as_minutes(s): m = math.floor(s / 60) s -= m * 60 return '%dm %ds' % (m, s) def time_since...
null
main.py
main.py
py
4,920
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.floor", "line_number": 15, "usage_type": "call" }, { "api_name": "time.time", "line_number": 20, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 81, "usage_type": "call" }, { "api_name": "time.time", "line_nu...
575227912
import matplotlib.pyplot as plt from math import sqrt import numpy as np from scipy.interpolate import interp1d def cubic_interp1d(x0, x, y): x = np.asfarray(x) y = np.asfarray(y) size = len(x) xdiff = np.diff(x) ydiff = np.diff(y) Li = np.empty(size) Li_1 = np.empty(size - 1) z = np...
null
LAB3.py
LAB3.py
py
2,374
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.asfarray", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.asfarray", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number"...
453307011
# coding: utf-8 import mock from the_tale.common.utils import testcase from the_tale.game.balance import constants as c from the_tale.game.logic import create_test_map from the_tale.game.prototypes import TimePrototype from the_tale.game.roads.storage import waymarks_storage from the_tale.game.persons import mode...
null
the_tale/game/persons/tests/test_logic.py
test_logic.py
py
9,732
python
en
code
null
code-starcoder2
76
[ { "api_name": "the_tale.common.utils.testcase.TestCase", "line_number": 28, "usage_type": "attribute" }, { "api_name": "the_tale.common.utils.testcase", "line_number": 28, "usage_type": "name" }, { "api_name": "the_tale.game.logic.create_test_map", "line_number": 33, "usa...
554477311
# -*- coding: utf-8 -*- from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cellsamples', '0004'), ] operations = [ migrations.AlterModelOptions( name='celltype', options={'ordering': ('species', 'cell_type'), 'verb...
null
cellsamples/migrations/0005.py
0005.py
py
735
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterModelOptions", "line_number": 14, "usage_type": "call" ...
514777387
from pathlib import Path import os from datetime import datetime class Reporter: def __init__(self): self.date = datetime.now().date() self.time = datetime.now().time() p = str(Path(__file__).parent) i = p.index("\\tests") self.new_dir = p[:i]+f"\\bug-reports\\log({self.date}...
null
qa-e2e-template-master/tests/features/lib/pages/reporter.py
reporter.py
py
498
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.d...
383092408
import requests from config import HOST from lib.loginLib import loginlib #新增课程 def addcourse(name,desc,display_idx,SessionID): dict = { 'Content-Type': 'application/x-www-form-urlencoded' } payload = { 'action': 'add_course', 'data': f"""{{ "name":"{name}", "desc":"{desc...
null
lib/courseLib.py
courseLib.py
py
2,701
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.post", "line_number": 19, "usage_type": "call" }, { "api_name": "config.HOST", "line_number": 19, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "config.HOST", "line_number...
213168
import hashlib import json import os import random import string from cStringIO import StringIO import pytest from django.core.files.storage import default_storage from le_utils.constants import format_presets from mixer.backend.django import mixer from contentcuration import models as cc pytestmark = pytest.mark.dja...
null
contentcuration/contentcuration/tests/testdata.py
testdata.py
py
8,560
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytest.mark", "line_number": 14, "usage_type": "attribute" }, { "api_name": "mixer.backend.django.mixer.blend", "line_number": 21, "usage_type": "call" }, { "api_name": "mixer.backend.django.mixer", "line_number": 21, "usage_type": "name" }, { "api_...
227286301
from collections import Counter doubles = 0 triples = 0 with open('data/day-2-input') as file: for line in file.readlines(): c = Counter(line) for element in c.elements(): if c[element] == 2: doubles += 1 break for element in c.elements(): ...
null
2018/src/day-2.py
day-2.py
py
1,161
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 8, "usage_type": "call" } ]
285559514
#!/usr/bin/python3 import json from random import choice #would uses choices(words,k=25) in 3.6 def getWords(n=25): with open('words/nouns.json', mode='r') as f: # At first, read the JSON file and store its content in an Python variable # By using json.load() function json_data = json.load...
null
vocab.py
vocab.py
py
558
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 16, "usage_type": "call" } ]
320748422
import pyglet from GameObject import GameObject from pyglet.window import key class GameWindow(pyglet.window.Window): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.set_location(400, 100) self.frame_rate = 1/60 self.player = GameObject(500, 200, "PlayerS...
null
Valerio/Python/space_invaders/space_invaders/GameWindow.py
GameWindow.py
py
943
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyglet.window", "line_number": 5, "usage_type": "attribute" }, { "api_name": "GameObject.GameObject", "line_number": 10, "usage_type": "call" }, { "api_name": "pyglet.window.key.RIGHT", "line_number": 13, "usage_type": "attribute" }, { "api_name": "...
62122655
from django.dispatch import receiver from django.db.models import Q from django.db.models.signals import post_save, m2m_changed from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User import sys import logging from danceschool.core.models import EventStaffMember, E...
null
danceschool/financial/handlers.py
handlers.py
py
7,033
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 22, "usage_type": "attribute" }, { "api_name": "models.ExpenseItem.objects.filter", "line_number": 29, "usage_type": "call" }, { "api_name": "mod...
526145195
"""Calculate gradients for scalars, vectors, products of vectors Assumes dimensions lat and lon in degrees, pfull in hPa""" import numpy as np import xarray as xr from finite_difference import cfd_old as cfd def ddx(field, a = 6376.0e3): """Calculate d/dx of a given DataArray. DataArray must include lat and lo...
null
python_bin_updates/physics_updates/old/gradients.py
gradients.py
py
3,569
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.cos", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 20, "usage_type": "attribute" }, { "api_name": "finite_difference.cfd_old", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.pi", "lin...
422074353
import json from collections import namedtuple import unittest from solariat_bottle.tests.social.twitter_helpers import FakeTwitterAPI from solariat.tests.base import LoggerInterceptor from solariat_bottle.app import get_api_url from solariat_bottle.db.account import Account, AccountType from solariat_bottle.db.channe...
null
tests/api/test_api_user_relations.py
test_api_user_relations.py
py
11,140
python
en
code
null
code-starcoder2
76
[ { "api_name": "solariat_bottle.tests.social.twitter_helpers.FakeTwitterAPI", "line_number": 16, "usage_type": "name" }, { "api_name": "collections.namedtuple", "line_number": 28, "usage_type": "call" }, { "api_name": "solariat_bottle.tests.base.RestCase", "line_number": 69, ...
307491955
from sklearn.datasets import fetch_20newsgroups # load data from sklearn dataset import preprocess as pre import nltk import pandas as pd import seaborn as sn import matplotlib.pyplot as plt import time from heapq import nlargest from random import randrange nltk.download("stopwords") nltk.download('punkt') nltk.downl...
null
HW2/hw2.py
hw2.py
py
7,561
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.download", "line_number": 10, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 11, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 12, "usage_type": "call" }, { "api_name": "time.time", "line_numbe...
212954233
""" Convert .png image to .txt to avoid using PIL, which causes problems when compling to .app. from PIL import Image def maketxt(path): image = Image.open(path) data = image.tobytes() f = open(path[0:-4]+".txt","wb") f.write(data) f.close """ import pygame as pg """colors""" BLACK = (0 , 0 , 30 )...
null
segway_jump_libraries/settings.py
settings.py
py
810
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.image.fromstring", "line_number": 47, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 47, "usage_type": "attribute" } ]
597126892
#!/usr/bin/env python # coding: utf-8 # In[25]: import streamlit as st import pandas as pd import numpy as np import pickle import sklearn import nltk nltk.download('stopwords') import streamlit as st import pandas as pd import numpy as np import time import re import pickle from nltk.corpus import stopwords from ...
null
test_App.py
test_App.py
py
4,062
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.download", "line_number": 13, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 23, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 23, "usage_type": "name" }, { "api_name": "pickl...
502093970
from lib.base import PowerDNSClient from powerdns import RRSet class RecordsCreate(PowerDNSClient): """ Create resource record sets. """ def run( self, server_id, zone_name, record_name, record_type, record_ttl, change_type, records=[], ...
null
actions/records_create.py
records_create.py
py
721
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.base.PowerDNSClient", "line_number": 5, "usage_type": "name" }, { "api_name": "powerdns.RRSet", "line_number": 23, "usage_type": "call" } ]
259487827
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
null
scripts/diff.py
diff.py
py
1,880
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 30, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_numb...
115135044
# Copyright 2019 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
null
pytest/frontend/test_engine.py
test_engine.py
py
12,154
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 21, "usage_type": "attribute" }, { "api_name": "strawberryfields.Engine", "line_number": 33, "usage_type": "call" }, { "api_name": "strawberry...
530606366
from django.contrib.auth.models import User from django.db import models import random import string from django.core.mail import send_mail from lu_pet.settings import EMAIL_HOST_USER class SessionManager(models.Manager): @staticmethod def authentificate(username, password): if User.objects.filter(use...
null
lu_pet/models.py
models.py
py
3,858
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Manager", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.filter", "line_number": 12, "usage_type": "call" }...
375433017
from pyexcel_xls import save_data from collections import OrderedDict import json def TxtSaveXls(path1, path2): order = OrderedDict() sheet = [] with open(path1, 'r',encoding='utf-8')as f: all_data = json.loads(f.read()) for key, value in all_data.items(): sheet.appe...
null
每天练习/0015.py
0015.py
py
480
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.OrderedDict", "line_number": 7, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "pyexcel_xls.save_data", "line_number": 14, "usage_type": "call" } ]
141899793
#Stokes, Jeff #CS5730 - Artificial Neural Networks #Final - Train/Test import numpy as np import matplotlib.pyplot as plt #Activation function (sigmoid): def nonlin(x, deriv=False): if(deriv==True): return(x*(1-x)) return(1/(1+np.exp(-x))) #Retrieve datasets from file data_train = np.loadtxt('breast_cancer_train...
null
Test-Train/Final_FFNN_train-test.py
Final_FFNN_train-test.py
py
1,881
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.exp", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number"...
475790905
import cv2 ''' cap = cv2.VideoCapture(0) cap.set(3, 720) cap.set(4, 1080) while True: ret, frame = cap.read() cv2.imshow('test', frame) k = cv2.waitKey(1) if k == 27: break cap.release() cv2.destroyAllWindows() ''' cap = cv2.VideoCapture(0) #cap = cv2.VideoCapture("resources/test_video...
null
opencv/opencv.py
opencv.py
py
1,120
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.createBackgroundSubtractorMOG2", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.flip", "line_number": 29, "usage_type": "call" }, { "api_name": "cv2.imsh...
241018512
# BSD 2-Clause License # # Copyright (c) 2021, Hewlett Packard Enterprise # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright noti...
null
smartsim/entity/dbnode.py
dbnode.py
py
5,102
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.get_logger", "line_number": 36, "usage_type": "call" }, { "api_name": "entity.SmartSimEntity", "line_number": 39, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 70, "usage_type": "call" }, { "api_name": "os.path", "li...
246237254
import argparse from typing import NewType, Tuple, Iterable import urllib3 from bs4 import BeautifulSoup """ This module contains code to bring back info about rocket launches. You can have this display on your Macbook Pro Touchbar using BetterTouchTool > TouchBar > Add Widget > Run Applescript > code like this: ...
null
launches.py
launches.py
py
3,247
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib3.disable_warnings", "line_number": 18, "usage_type": "call" }, { "api_name": "typing.NewType", "line_number": 35, "usage_type": "call" }, { "api_name": "typing.NewType", "line_number": 36, "usage_type": "call" }, { "api_name": "typing.NewType...
402223152
import sys, time from twisted.internet import defer from twisted.trial.unittest import TestCase from subprocess import Popen, PIPE from scrapy.spider import BaseSpider from scrapy.http import Request from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.utils.test import get_crawler class Follow...
null
scrapy/tests/test_crawl.py
test_crawl.py
py
1,824
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.spider.BaseSpider", "line_number": 10, "usage_type": "name" }, { "api_name": "scrapy.contrib.linkextractors.sgml.SgmlLinkExtractor", "line_number": 13, "usage_type": "call" }, { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, ...
76854118
# -*- encoding: utf-8 -*- """ @Author : zYx.Tom @Contact : 526614962@qq.com @site : https://zhuyuanxiang.github.io --------------------------- @Software : PyCharm @Project : introduction_to_ml_with_python @File : C020303_linear_model.py @Version : v0.1 @Time : 2019-1...
null
C02/C020303_linear_model.py
C020303_linear_model.py
py
23,307
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.set_printoptions", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 23, "usage_type": "attribute" }, { "api_name": "mglearn.plots.plot_linear_regression_wave", "line_number": 38, "usage_type": "call" }, { "a...
402013590
import keras from keras import models from keras.models import load_model import random from preprocessing import get_kmer_from_santi,DataGenerator_from_realdata,get_kmer_from_realdata from voting import get_final_result from generate_report import save_report #path for testing file filepath_train="./data/HIV-1-Datase...
null
evaluation_on_simulated_HIV.py
evaluation_on_simulated_HIV.py
py
1,597
python
en
code
null
code-starcoder2
76
[ { "api_name": "preprocessing.get_kmer_from_santi", "line_number": 18, "usage_type": "call" }, { "api_name": "preprocessing.DataGenerator_from_realdata", "line_number": 19, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 21, "usage_type": "c...
187564756
import pybullet as p import pybullet_data import time class CubliEnv: def __init__(self, urdf_path="/home/xin/codes/bullet3/pybullet/new_examples/model/cubli.urdf", ini_pos=[0, 0, 0.5], ini_quat=[0, 0, 0, 1]): # set env physicsClient = p.connect(p.GUI) # or p.DIR...
null
pybullet/new_examples/cubli.py
cubli.py
py
4,357
python
en
code
null
code-starcoder2
76
[ { "api_name": "pybullet.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "pybullet.GUI", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pybullet.setAdditionalSearchPath", "line_number": 12, "usage_type": "call" }, { "api_name": "p...
233018090
"""Process a dataset with authors only. Format raw datapoints into feature vectors to be used with the WarOfWords instances. You can optionally filter out dossiers and MEPs with less than a given number of edits. You can also optionally shuffle the data and split them into training and validation set. In this case, th...
null
data/meps_only.py
meps_only.py
py
3,290
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "_common.load_dataset", "line_number": 21, "usage_type": "call" }, { "api_name": "_common.filter_data...
189241135
# 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: /usr/local/lib/python2.7/site-packages/canteen_tests/test_rpc/test_msgpack.py # Compiled at: 2014-09-26 04:50:19 """ msgpack protocol tests ~~~~~~~~~~~~~~~~...
null
pycfiles/canteen-0.4-alpha.macosx-10.10-x86_64.tar/test_msgpack.py
test_msgpack.py
py
4,391
python
en
code
null
code-starcoder2
76
[ { "api_name": "canteen.core.Library", "line_number": 24, "usage_type": "call" }, { "api_name": "canteen.core.Library", "line_number": 26, "usage_type": "call" }, { "api_name": "canteen.model.Model", "line_number": 43, "usage_type": "name" }, { "api_name": "canteen...
495811725
# Multiple Linear Regression # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('50_Startups.csv') X = dataset.iloc[:, :-1].values y = dataset.iloc[:, 4].values # Encoding categorical data from sklearn.preprocessing import La...
null
Part 2 - Regression/Section 5 - Multiple Linear Regression/multiple_linear_regression.py
multiple_linear_regression.py
py
4,099
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.OneHotEncoder", "line_number": 17, "usage_type": "call" }, { ...
67180135
"""histoclin URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
null
histoclin/urls.py
urls.py
py
2,090
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 39, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 39, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 39, "usage_type": "name" }, { "api_name...
608568014
# Copyright 2017 BBVA # # 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 writing, softwar...
null
setup.py
setup.py
py
1,563
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_numb...
446049503
from collections import OrderedDict from string import ascii_uppercase from django import template register = template.Library() @register.simple_tag(takes_context=True) def ascii_letters(context): """ Inserts the ASCII uppercase letters into the context under the name 'letters;. """ context["letter...
null
seeds/plants/templatetags/grouper.py
grouper.py
py
2,662
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.Library", "line_number": 6, "usage_type": "call" }, { "api_name": "django.template", "line_number": 6, "usage_type": "name" }, { "api_name": "string.ascii_uppercase", "line_number": 14, "usage_type": "name" }, { "api_name": "collecti...
226977412
import rfc3987 URL_REGEX=rfc3987.get_compiled_pattern('%(URI)s') def extract_urls(text): '''Extract urls from given text :text: (str) Text to extract urls from :returns: List of urls extracted ''' return URL_REGEX.findall(text) def extract_sites(text): '''Extract sites from urls in given ...
null
htetl/extract/sites.py
sites.py
py
570
python
en
code
null
code-starcoder2
76
[ { "api_name": "rfc3987.get_compiled_pattern", "line_number": 3, "usage_type": "call" }, { "api_name": "rfc3987.parse", "line_number": 24, "usage_type": "call" } ]
534371108
# import time # import pickle import sympy as sym from api.approximation_tools import ControlSystem # from calc_indeces import calculate_indeces sym.init_printing() x1, x2, x3, x4, x5, x6, x7, x8, c6, c7, c8, t = sym.symbols( 'x_{1} x_{2} x_{3} x_{4} x_{5} x_{6} x_{7} x_{8} c_{6} c_{7} c_{8} t') # Пример 1 # a =...
null
api/main.py
main.py
py
2,031
python
en
code
null
code-starcoder2
76
[ { "api_name": "sympy.init_printing", "line_number": 6, "usage_type": "call" }, { "api_name": "sympy.symbols", "line_number": 8, "usage_type": "call" }, { "api_name": "sympy.Matrix", "line_number": 16, "usage_type": "call" }, { "api_name": "sympy.Matrix", "line...
528760506
from flask import Flask, request, jsonify from flask_sqlalchemy import SQLAlchemy from flask_marshmallow import Marshmallow import os import requests import json app = Flask(__name__) basedir = os.path.abspath(os.path.dirname(__file__)) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'icea...
null
iceandfire_crud.py
iceandfire_crud.py
py
3,923
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_num...
108938303
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d import gym import rl_agent as rl import tensorflow as tf class Program(): def __init__(self): self.env = None self.logger = None self.plotter = None def on_step_end(self, agent, reward, obser...
null
marcin/rl_agent/examples/mountain_car.py
mountain_car.py
py
6,298
python
en
code
null
code-starcoder2
76
[ { "api_name": "rl_agent.util.parse_common_args", "line_number": 51, "usage_type": "call" }, { "api_name": "rl_agent.util", "line_number": 51, "usage_type": "attribute" }, { "api_name": "rl_agent.util.try_freeze_random_seeds", "line_number": 52, "usage_type": "call" }, ...
323887742
# coding: utf-8 from modAL.models import ActiveLearner from sklearn.ensemble import RandomForestClassifier import numpy as np import h5py import pickle from sklearn.ensemble import RandomForestClassifier import random import os.path from datetime import datetime features = h5py.File('/scratch/yw3004/sonyc/sonyc_dis...
null
data_preparation/sample_unlabeled_pool_random.py
sample_unlabeled_pool_random.py
py
2,592
python
en
code
null
code-starcoder2
76
[ { "api_name": "h5py.File", "line_number": 15, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime.fromtimestamp", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime...
429525818
#!/usr/bin/env python import os import sagemaker import sagemaker.tensorflow import sys import time govuk_environment = os.environ["GOVUK_ENVIRONMENT"] role = os.environ["ROLE_ARN"] model_name = os.getenv("SCRIPT_INPUT_DATA") model_tag = os.getenv("MODEL_TAG") if not model_name and not model_tag: raise Exception(...
null
ltr/concourse/deploy.py
deploy.py
py
3,219
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number...
651792187
import torch from torch import nn from ..base import Base, ConvBatchNormRelu class AppearanceCueFiltration(Base): def __init__(self): super().__init__() self.high_conv3x3 = ConvBatchNormRelu( 256, 256, kernel_size=3, padding=1) self.path_1 = nn.Sequential( nn.Conv2...
null
model/hierarchical_attention/appearance_cue_filtration.py
appearance_cue_filtration.py
py
1,369
python
en
code
null
code-starcoder2
76
[ { "api_name": "base.Base", "line_number": 7, "usage_type": "name" }, { "api_name": "base.ConvBatchNormRelu", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn.Sequential", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "l...
220023085
import numpy as np class UnitTestMessage: # Test the WheelEncoderStamped messages def __init__(self, callback): from duckietown_msgs.msg import WheelEncoderStamped from std_msgs.msg import Header # creating a dummy wheel encoder message to allow testing how to read fields hea...
null
oakd/solution/unit_test.py
unit_test.py
py
13,094
python
en
code
null
code-starcoder2
76
[ { "api_name": "std_msgs.msg.Header", "line_number": 12, "usage_type": "call" }, { "api_name": "duckietown_msgs.msg.WheelEncoderStamped", "line_number": 19, "usage_type": "call" }, { "api_name": "duckietown_msgs.msg.WheelEncoderStamped.ENCODER_TYPE_INCREMENTAL", "line_number":...
232979151
#-*-coding: utf-8-*- # Version: 0.1 # Author: Don Li <don.li@mai.tipcat.com> # License: Copyright(c) 2015 Don.Li # Summary: import asyncio import time import redis from config_parser import config from log import log from rpc import listen, load_all_routes, connect from protocol_ma...
null
src/game/server.py
server.py
py
2,632
python
en
code
null
code-starcoder2
76
[ { "api_name": "rpc.listen", "line_number": 25, "usage_type": "call" }, { "api_name": "config_parser.config.get", "line_number": 25, "usage_type": "call" }, { "api_name": "config_parser.config", "line_number": 25, "usage_type": "name" }, { "api_name": "config_parse...
124984428
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Vodafone España, S.A. # Author: Pablo Martí # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your o...
null
attic/VodafoneMobileConnectCard/build/opt/vmc/lib/python2.5/site-packages/Vodafone_Mobile_Connect_Card_driver_for_Linux-1.99.19-py2.5.egg/vmc/gtk/models/application.py
application.py
py
9,914
python
en
code
null
code-starcoder2
76
[ { "api_name": "vmc.gtk.models.base.BaseWrapperModel", "line_number": 39, "usage_type": "name" }, { "api_name": "twisted.internet.defer.fail", "line_number": 76, "usage_type": "call" }, { "api_name": "twisted.internet.defer", "line_number": 76, "usage_type": "name" }, ...
10372169
#/usr/bin/env python from setuptools import setup from xero import VERSION try: readme = open("README.rst") long_description = str(readme.read()) finally: readme.close() setup( name='pyxero', version=VERSION, description='Python API for accessing the REST API of the Xero accounting tool.', ...
null
setup.py
setup.py
py
1,155
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 11, "usage_type": "call" }, { "api_name": "xero.VERSION", "line_number": 13, "usage_type": "name" } ]
295591349
# 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/xanalogica/tumbler/tests.py # Compiled at: 2008-08-31 04:10:13 import os, re, unittest, pkg_resources from zope.testing import doctest...
null
pycfiles/xanalogica.tumbler-0.2dev-py2.5/tests.py
tests.py
py
702
python
en
code
null
code-starcoder2
76
[ { "api_name": "pkg_resources.resource_string", "line_number": 12, "usage_type": "call" }, { "api_name": "zope.testing.doctest.DocTestSuite", "line_number": 13, "usage_type": "call" }, { "api_name": "zope.testing.doctest", "line_number": 13, "usage_type": "name" }, { ...
624601325
""" polls """ from multiprocessing import Process import subprocess class PoolScrub(Process): def __init__(self, mnt_pt, force=False): self.mnt_pt = mnt_pt self.force = force super(PoolScrub, self).__init__() def run(self): cmd = ['btrfs', 'scrub', 'start', '-B', self.mnt_pt] if (self.force): cmd.ins...
null
services/storage/fs/pool_scrub.py
pool_scrub.py
py
436
python
en
code
null
code-starcoder2
76
[ { "api_name": "multiprocessing.Process", "line_number": 9, "usage_type": "name" }, { "api_name": "subprocess.Popen", "line_number": 19, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 19, "usage_type": "attribute" }, { "api_name": "subproce...
314692178
import fnmatch from conans.errors import ConanException class BuildMode(object): """ build_mode => ["*"] if user wrote "--build" => ["hello*", "bye*"] if user wrote "--build hello --build bye" => ["hello/0.1@foo/bar"] if user wrote "--build hello/0.1@foo/bar" ...
null
conans/client/graph/build_mode.py
build_mode.py
py
2,991
python
en
code
null
code-starcoder2
76
[ { "api_name": "conans.errors.ConanException", "line_number": 43, "usage_type": "call" }, { "api_name": "fnmatch.fnmatchcase", "line_number": 62, "usage_type": "call" }, { "api_name": "fnmatch.fnmatchcase", "line_number": 63, "usage_type": "call" } ]
564573277
from hpro_automation.identity import credentials import pymysql class DBConnection(object): def __init__(self): super(DBConnection, self).__init__() self.user = str(input("DB name:: ")) def db_connection(self): self.DB_data = credentials.db_details[self.user] self.connection...
null
hpro_automation/db_login.py
db_login.py
py
402
python
en
code
null
code-starcoder2
76
[ { "api_name": "hpro_automation.identity.credentials.db_details", "line_number": 13, "usage_type": "attribute" }, { "api_name": "hpro_automation.identity.credentials", "line_number": 13, "usage_type": "name" }, { "api_name": "pymysql.connect", "line_number": 14, "usage_typ...
313376682
from SPARQLWrapper import SPARQLWrapper, JSON # , TURTLE, RDF from typing import Dict from mediawikitools.wiki.actions import edit useragent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) ' \ 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 ' \ 'Safari/537.36' def sparql(sparql...
null
wikidata_countries.py
wikidata_countries.py
py
1,195
python
en
code
null
code-starcoder2
76
[ { "api_name": "SPARQLWrapper.SPARQLWrapper", "line_number": 11, "usage_type": "call" }, { "api_name": "SPARQLWrapper.JSON", "line_number": 14, "usage_type": "argument" }, { "api_name": "typing.Dict", "line_number": 10, "usage_type": "name" }, { "api_name": "mediaw...
270474697
""" App routing and view logic """ # library import rollbar from flask import flash, redirect, render_template, request, url_for from flask_login import logout_user from flask_user import login_required, current_user from mailchimp3.mailchimpclient import MailChimpError from stripe.error import SignatureVerificationEr...
null
avwx_account/views.py
views.py
py
5,042
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.render_template", "line_number": 19, "usage_type": "call" }, { "api_name": "flask_user.current_user", "line_number": 19, "usage_type": "argument" }, { "api_name": "avwx_account.app.route", "line_number": 17, "usage_type": "call" }, { "api_name...
345869855
# -*- coding: utf-8 -*- import scrapy import json import re import time from bk.items import BkItem class BeikwSpider(scrapy.Spider): name = 'beikw' allowed_domains = ['fang.ke.com'] start_urls = ['https://gz.fang.ke.com/', 'https://gz.fang.lianjia.com/'] def isVaildDate(self, dat...
null
bk/bk/spiders/beikw.py
beikw.py
py
3,262
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 11, "usage_type": "attribute" }, { "api_name": "time.strptime", "line_number": 20, "usage_type": "call" }, { "api_name": "time.strptime", "line_number": 22, "usage_type": "call" }, { "api_name": "scrapy.Request", "...
199561947
from os.path import join from options.eld.base_options import BaseOptions from engine import Engine import torch import torch.backends.cudnn as cudnn import data.sid_dataset as datasets import util.util as util import data import glob import os import socket opt = BaseOptions().parse() cudnn.benchmark = True if opt...
null
test_SID.py
test_SID.py
py
2,659
python
en
code
null
code-starcoder2
76
[ { "api_name": "options.eld.base_options.BaseOptions", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.backends.cudnn.benchmark", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.backends.cudnn", "line_number": 15, "usage_type": "name" ...
328816663
from django.conf.urls import url, include from django.contrib import admin from user.views import index urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^user/', include('user.urls', namespace="user", app_name='user')), url(r'^todolist/', include('todolist.urls', namespace="todolist", app_name="todo...
null
project/urls.py
urls.py
py
503
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": ...
30049659
from io import BytesIO from json import dumps, loads import os from pathlib import Path import tempfile from typing import Generator import shutil import sqlite3 from flask.testing import FlaskClient from werkzeug.test import Client import pytest import threedyspool @pytest.fixture def client() -> ...
null
threedyspool-server/tests/test_upload.py
test_upload.py
py
4,098
python
en
code
null
code-starcoder2
76
[ { "api_name": "threedyspool.app", "line_number": 19, "usage_type": "attribute" }, { "api_name": "tempfile.mkdtemp", "line_number": 20, "usage_type": "call" }, { "api_name": "threedyspool.app", "line_number": 21, "usage_type": "attribute" }, { "api_name": "threedys...
593847906
#!/usr/bin/env python # encoding: utf-8 """ @author:nikan @file: wzskjj6.py @time: 2018-06-10 21:09:37 """ from typing import List from scrapy import Request from scrapy.crawler import CrawlerProcess from scrapy.http import TextResponse from scrapy.link import Link from scrapy.mail import MailSender from scrapy.spi...
null
effective_spiders/gov_spiders/2018-06-10_wzskjj6.py
2018-06-10_wzskjj6.py
py
4,497
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.spiders.Spider", "line_number": 28, "usage_type": "name" }, { "api_name": "PyScraper.extractor.html_link.HtmlLinkExtractor", "line_number": 34, "usage_type": "call" }, { "api_name": "PyScraper.extractor.error_correction.ErrorCorrectionExtractor", "line_n...
205156298
from gensim.models import Word2Vec import numpy as np import time raw_path1 = "./structured_data/thulac/CN/com_cn_main_" raw_path2 = "./structured_data/thulac/CN/com_cn_main_uw_" raw_path3 = "./structured_data/thulac/CN+EN/com_cn_main_" raw_path4 = "./structured_data/thulac/CN+EN/com_cn_main_uw_" raw_path = [raw_path1...
null
main_word2vec.py
main_word2vec.py
py
3,086
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 67, "usage_type": "call" }, { "api_name": "gensim.models.Word2Vec", "line_number": 70, "usage_type": "call" }, { "api_name": "time.time", "line_number": 71, "usage_type": "call" }, { "api_name": "time.time", "line_numb...
472408279
import pandas as pd from sklearn.externals import joblib from sklearn.model_selection import GridSearchCV from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.decomposition import PCA, TruncatedSVD ...
null
An I Sem I/ml/Homework2/src/training/classifier.py
classifier.py
py
2,993
python
en
code
null
code-starcoder2
76
[ { "api_name": "base.training.base_trainer.BaseTrainer", "line_number": 12, "usage_type": "name" }, { "api_name": "dataset.Dataset", "line_number": 26, "usage_type": "call" }, { "api_name": "base.feature_computer.FeatureComputer", "line_number": 30, "usage_type": "call" ...
421266796
import os import time from redis import StrictRedis redis = StrictRedis(host=os.getenv('DEFAULT_REDIS_CACHE', 'localhost'), port=6379) pubsub = redis.pubsub() pubsub.psubscribe('__keyspace@0__:email_event') print('Starting message loop', flush=True) while True: message = pubsub.get_message() if message: ...
null
scripts.py
scripts.py
py
433
python
en
code
null
code-starcoder2
76
[ { "api_name": "redis.StrictRedis", "line_number": 6, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 6, "usage_type": "call" }, { "api_name": "redis.pubsub", "line_number": 8, "usage_type": "call" }, { "api_name": "time.sleep", "line_number":...
134765041
#!/usr/bin/env python # # Copyright 2016 Google Inc. All Rights Reserved. # # 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 require...
null
src/tests/simian/mac/admin/panic_test.py
panic_test.py
py
4,506
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.settings.configure", "line_number": 23, "usage_type": "call" }, { "api_name": "django.conf.settings", "line_number": 23, "usage_type": "name" }, { "api_name": "tests.simian.mac.common.test.RequestHandlerTest", "line_number": 31, "usage_type": "a...
632521003
from utils import TreeNode from typing import List, Optional class Solution: def averageOfLevels(self, root: Optional[TreeNode]) -> List[float]: if root is None: return [] res = {} q = [(root, 0)] while len(q) > 0: node, depth = q[0] if depth not ...
null
source code/637. Average of Levels in Binary Tree.py
637. Average of Levels in Binary Tree.py
py
953
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Optional", "line_number": 5, "usage_type": "name" }, { "api_name": "utils.TreeNode", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "utils.TreeNode.build_by_str",...
113499973
#!/usr/bin/env python3 from bottle import route, run,request @route('/') def index(): name = request.query.name age = request.query.age if name and age: return f'{name} tiene {age} ' else: return "Julian" if __name__ == "__main__": run(host='35.237.215.97', port=80, debug=True,re...
null
server.py
server.py
py
333
python
en
code
null
code-starcoder2
76
[ { "api_name": "bottle.request.query", "line_number": 7, "usage_type": "attribute" }, { "api_name": "bottle.request", "line_number": 7, "usage_type": "name" }, { "api_name": "bottle.request.query", "line_number": 8, "usage_type": "attribute" }, { "api_name": "bottl...
350010703
import numpy as np import pandas as pd from itertools import groupby def create_sharpe_ratio(returns, periods=252): """ Create the Sharpe ratio for the strategy, based on a benchmark of zero (i.e. no risk-free rate information). Parameters: returns - A pandas Series representing period percentage ...
null
performance.py
performance.py
py
1,487
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sqrt", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.std", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 30, ...
327433950
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gio, GObject, GdkPixbuf, Gdk user_data = [("Akshay", 88, "Actor"),("Luffy", 18, "Pirate"), ("Zoro", 21, "Swordsman")] class Item(GObject.GObject): text = str age = GObject.property(type = int) profession = GObject.property(type = st...
null
py-Gtk/drag-flowbox.py
drag-flowbox.py
py
2,121
python
en
code
null
code-starcoder2
76
[ { "api_name": "gi.require_version", "line_number": 2, "usage_type": "call" }, { "api_name": "gi.repository.GObject.GObject", "line_number": 7, "usage_type": "attribute" }, { "api_name": "gi.repository.GObject", "line_number": 7, "usage_type": "name" }, { "api_name...
28713681
""" An amazing feature of this recipe is that the accessor functions will propagate through multiple levels of decoration (if all of your decorators utilize @functools.wraps). ```python @timethis @logged(logging.DEBUG) def countdown(n): while n > 0: n -= 1 ``` They will also work if set in inverse ord...
null
runtime/runtime_9_5.py
runtime_9_5.py
py
972
python
en
code
null
code-starcoder2
76
[ { "api_name": "decorators.decorator_9_5.logged", "line_number": 31, "usage_type": "call" }, { "api_name": "decorators.decorator_9_5", "line_number": 31, "usage_type": "name" }, { "api_name": "logging.DEBUG", "line_number": 31, "usage_type": "attribute" }, { "api_n...
157625129
import json import random from Model.util import log_message from Model.EdgeModel.JSON.base import ( BaseJSONHandler, BaseJSONClass, BaseAttribute, Caretaker, OTHER, DT_SEC, DT_SIMPLE_STRING, DT_WEBKIT, DT_WEBKIT_SEC, DT_SEC_DOT_MICRO ) ACCTRKUPDATE = "Account Tracker Update" N...
null
src/Model/EdgeModel/JSON/preferences.py
preferences.py
py
16,315
python
en
code
null
code-starcoder2
76
[ { "api_name": "Model.EdgeModel.JSON.base.BaseJSONClass", "line_number": 34, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 97, "usage_type": "call" }, { "api_name": "Model.EdgeModel.JSON.base.BaseAttribute", "line_number": 100, "usage_type": "call"...
315671090
from django import forms from phonenumber_field.widgets import PhoneNumberInternationalFallbackWidget from hwtgenapp.models import ContactInfo class ContactInfoForm(forms.ModelForm): class Meta: model = ContactInfo fields = ['firstname', 'lastname', 'email', 'phonenumber', 'message'] ...
null
hwtgenapp/forms.py
forms.py
py
689
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "hwtgenapp.models.ContactInfo", "line_number": 7, "usage_type": "name" }, { "api_name": "ph...
493233073
from pytest import fixture, mark from scanapi.tree import EndpointNode, RequestNode @mark.describe("request node") @mark.describe("run") class TestRun: @fixture def mock_session(self, mocker): return mocker.patch("scanapi.tree.request_node.session_with_retry") @fixture def mock_run_tests(sel...
null
tests/unit/tree/request_node/test_run.py
test_run.py
py
2,287
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 17, "usage_type": "name" }, { "api_name": "scanapi.tree.RequestNode"...
498457747
''' Grid Crossing Generator Adrian Low Samuel Lemly 2019 Undergraduate research for Martin Cenek Last updated: 11 MAR 2019 ''' from math import atan2, degrees import os import tkinter as tk import matplotlib.pyplot as plt import numpy as np from scipy import interpolate from scipy.interpolate import sp...
null
gridCrossings/gridcrossinggenerator.py
gridcrossinggenerator.py
py
4,696
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.degrees", "line_number": 20, "usage_type": "call" }, { "api_name": "math.atan2", "line_number": 20, "usage_type": "call" }, { "api_name": "scipy.interpolate.interp1d", "line_number": 58, "usage_type": "call" }, { "api_name": "scipy.interpolate"...
443442299
#coding: UTF-8 from django.contrib.sites.shortcuts import get_current_site from django.core.mail import EmailMessage from django.http import Http404, HttpResponse from django.shortcuts import render from django.template.loader import render_to_string from django.utils.html import strip_tags from django.views.generic.ed...
null
stroyprogress/contacts/views.py
views.py
py
2,118
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.edit.FormMixin", "line_number": 17, "usage_type": "name" }, { "api_name": "django.views.generic.list.ListView", "line_number": 17, "usage_type": "name" }, { "api_name": "django.http.Http404", "line_number": 24, "usage_type": "call" },...
252514750
#!/usr/bin/env python3 import re import math import argparse import importlib class CalcError(Exception): """Calculation exception class""" pass binary_operations = { "+": 0, "-": 0, "*": 1, "/": 1, "//": 1, "%": 1, "^": 2, } unary_operation = ['~'] constants = { "pi", ...
null
final_task/pycalc/calc.py
calc.py
py
12,299
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.search", "line_number": 50, "usage_type": "call" }, { "api_name": "re.search", "line_number": 56, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 71, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 82, "u...
17098372
import torch import torch.nn as nn import librosa import numpy as np class ConvNorm(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, padding): super(ConvNorm, self).__init__() self.conv_norm = nn.Sequential( nn.Conv1d(in_channels, out_channels, kernel_size=kernel_s...
null
audio_model.py
audio_model.py
py
4,921
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
261680856
from datetime import datetime import codecs import re import json class LearningManager(object): def __init__(self, json_data_path, csv_data_path): self._json_data_path = json_data_path self._json_data = json.loads(codecs.open(self._json_data_path, 'r', encoding='utf-8').read()) self._start...
null
src/learning_manager.py
learning_manager.py
py
2,322
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 9, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "l...
640611578
''' Actividad Guiada 2. CSV Reading with Python ''' import csv import pymongo csvFileName = 'cars.csv' dbStringConnection = "mongodb+srv://user01:user01@cluster0-ss0ab.mongodb.net/test?retryWrites=true" dbName = 'cars_db' dbCollection =...
null
ActividadVIU/main.py
main.py
py
1,737
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.DictReader", "line_number": 19, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 26, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 32, "usage_type": "call" }, { "api_name": "pymongo.MongoClient...
43286809
#!/usr/bin/env python3 import os import sys import random import wave import contextlib from datetime import datetime, timedelta import time #Button/Song A is L and Button/Song B is R def main(): try: print("----------------------------------------------------") print("***************************...
null
singsparrow/playFP.py
playFP.py
py
7,789
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 39, "usage_type": "call" }, { "api_name": "contextlib.closing", "line_number": 68, "usage_type": "call" }, { "api_name": "wave.open", "line_number": 68, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "li...
79812793
# -*- coding: utf-8 -*- """Public Module: Stock ***Gustavo Figueiredo ***Programa de Engenharia e Sistemas da Computação ***COPPE-UFRJ ***August - 2018 """ import json from urllib import request class Stock(object): """ Class used to get stock price from alpha vantage.""" def __init__(self, ticket): ...
null
edge_mining/sensor/stock.py
stock.py
py
924
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.urlopen", "line_number": 24, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 24, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 25, "usage_type": "call" } ]
605515613
from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import Http404 from django.shortcuts import render from . import models from taggit.models import Tag def blog_detail(request): if request.user.is_authenticated(): ...
null
blog/views.py
views.py
py
2,433
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.paginator.Paginator", "line_number": 16, "usage_type": "call" }, { "api_name": "django.core.paginator.PageNotAnInteger", "line_number": 23, "usage_type": "name" }, { "api_name": "django.core.paginator.EmptyPage", "line_number": 26, "usage_type":...
190568509
import numpy as np from Bio.Seq import Seq #------------------------------ penalty = {'MATCH': 1, 'MISMATCH': -1, 'GAP': -2} arrows = np.array([[0, 0, 0, 0]]) def match_score(alpha, beta): if alpha == beta: return penalty['MATCH'] else: return penalty['MISMATCH'] def finalize(align1, align2,...
null
algorithms/kband/kband.py
kband.py
py
7,346
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.dtype", "line_number": 109, "usage_type": "call" }, { "api_name": "numpy.str", "line_number": 109, "usage_type": "attribute" }, { "api_name": "numpy.str", "line_number"...
486138499
# -*- coding: utf-8 -*- """ Created on Fri Jan 12 10:21:23 2018 @author: Vedran Furtula """ import sys, serial, argparse, time, re, random import numpy as np import matplotlib.pyplot as plt class Oriel_stepper: def __init__(self,my_serial,testmode): # activate the serial. CHECK the serial ...
null
Spectrometer_v200420/instruments/Oriel_stepper.py
Oriel_stepper.py
py
9,908
python
en
code
null
code-starcoder2
76
[ { "api_name": "serial.Serial", "line_number": 26, "usage_type": "call" }, { "api_name": "serial.PARITY_NONE", "line_number": 26, "usage_type": "attribute" }, { "api_name": "serial.STOPBITS_ONE", "line_number": 26, "usage_type": "attribute" }, { "api_name": "time.s...
264958231
# -*- coding: UTF-8 -*- """ py_tools ======== Script : py_tools.py Author : Dan_Patterson@carleton.ca Modified: 2018-05-25 ------- Purpose : tools for working with python, numpy and other python packages - iterables : _flatten, flatten_shape, pack, unpack - folders : get_dir, folders...
null
arraytools/py_tools.py
py_tools.py
py
11,459
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.int32", "line_number": 33, "usage_type": "attribute" }, { "api_name": "numpy.set_printoptions", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.ma.masked_print_option.set_display", "line_number": 37, "usage_type": "call" }, { "...
158685346
import tesserocr from PIL import Image image = Image.open('var_code.png') image = image.convert('L') threshold = 100 table = [] for i in range(256): if i < threshold: table.append(0) else: table.append(1) image = image.point(table, '1') result = tesserocr.image_to_text(image) print(result) ...
null
reptilian/day05/try.py
try.py
py
452
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 5, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 5, "usage_type": "name" }, { "api_name": "tesserocr.image_to_text", "line_number": 17, "usage_type": "call" } ]
39002879
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('picmodels', '0063_auto_20180410_1601'), ] operations = [ migrations.AlterField( model_name='education', ...
null
picmodels/migrations/0064_auto_20180411_2123.py
0064_auto_20180411_2123.py
py
681
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
158355295
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import audioop from ctypes import * import RPi.GPIO as GPIO import ktkws # KWS import MicrophoneStream as MS import time import grpc import gigagenieRPC_pb2 import gigagenieRPC_pb2_grpc import user_auth as UA import os KWSID = ['기가지...
null
python3/temp.py
temp.py
py
6,439
python
en
code
null
code-starcoder2
76
[ { "api_name": "RPi.GPIO.setmode", "line_number": 26, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 26, "usage_type": "name" }, { "api_name": "RPi.GPIO.BOARD", "line_number": 26, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setwarnings", ...
619912782
from django.shortcuts import render, redirect, reverse, get_object_or_404 from students.models import Student from courses.models import Course from students.forms import StudentModelForm from django.contrib import messages from django.views.generic.list import ListView from django.views.generic.detail import DetailVie...
null
students/views.py
views.py
py
2,440
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.detail.DetailView", "line_number": 12, "usage_type": "name" }, { "api_name": "students.models.Student", "line_number": 13, "usage_type": "name" }, { "api_name": "django.views.generic.list.ListView", "line_number": 15, "usage_type": "nam...
529736070
#!/usr/bin/env pyturbubox import ulz import sys import couchdg import cubicle import argparse import numpy as np from pathlib import Path import matplotlib matplotlib.use('Agg') plt.rcParams.update({'font.family': 'Monospace', 'font.size': 10}) import matplotlib.pyplot as plt pp = argparse.ArgumentParser() pp.add_...
null
sandbox/plot/KHI/plot.py
plot.py
py
3,628
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "name" }, { "api_name": "pathlib.Path", ...
633277253
# coding: utf-8 # In[57]: #Importing libraries import pandas as pd #Data manipulation from sklearn.datasets import load_iris #Iris dataset import matplotlib.pyplot as plt #Plotting from scipy import stats #Statistical measures import numpy as np #Multidimensional array from sklearn.model_selection import train_test_...
null
SVM_Iris_Data.py
SVM_Iris_Data.py
py
6,735
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 31, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 43, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 103, "usage_type": "call" }, { "api_name": "m...
48815559
# -*-coding:utf-8-*- import warnings import time from threading import Thread import jieba from gensim.models.doc2vec import Doc2Vec from gensim.models.doc2vec import TaggedDocument jieba.load_userdict(r"D:\PythonWorkstation\job_project\information_extraction\lib\dict.txt") warnings.filterwarnings(action='ignore', ca...
null
information_extraction/submergence_model.py
submergence_model.py
py
4,080
python
en
code
null
code-starcoder2
76
[ { "api_name": "jieba.load_userdict", "line_number": 10, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 11, "usage_type": "call" }, { "api_name": "jieba.cut", "line_number": 46, "usage_type": "call" }, { "api_name": "gensim.models.d...
317628993
from django.db import models from django.db.models import FileField from django.forms import forms from django.template.defaultfilters import filesizeformat from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from django.core.exceptions import ValidationError from persian_tools im...
null
info/models_utils.py
models_utils.py
py
2,136
python
en
code
null
code-starcoder2
76
[ { "api_name": "persian_tools.national_id.validate", "line_number": 13, "usage_type": "call" }, { "api_name": "persian_tools.national_id", "line_number": 13, "usage_type": "name" }, { "api_name": "django.core.exceptions.ValidationError", "line_number": 14, "usage_type": "c...
457565877
from django.shortcuts import HttpResponse from django import views from django.urls import path, include import django import os from django.db import models from django import forms from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ import sys sys.path += ['c:\\Us...
null
Django/model_validation.py
model_validation.py
py
4,367
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ.setdefault", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.setup", ...
421853259
### # Copyright (c) 2014-2018, James Lu <james@overdrivenetworks.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice,...
null
FML/plugin.py
plugin.py
py
5,297
python
en
code
null
code-starcoder2
76
[ { "api_name": "supybot.i18n.PluginInternationalization", "line_number": 36, "usage_type": "call" }, { "api_name": "supybot.callbacks.Plugin", "line_number": 44, "usage_type": "attribute" }, { "api_name": "supybot.callbacks", "line_number": 44, "usage_type": "name" }, ...
442495927
from bs4 import BeautifulSoup from requests import get # --it comes with get for requests import re ## connects to the url passed and parses it with beautiful soup def visitSite(url): response = get(url) return BeautifulSoup(response.content, 'html.parser') ## Returns the links belonging to the elemen...
null
Scraper/WebScraperUtil.py
WebScraperUtil.py
py
1,453
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "re.search", "line_number": 26, "usage_type": "call" }, { "api_name": "re.compile", "line_numbe...
556766401
""" """ import sqlite3 import argparse from clldutils.clilib import Table, add_format def register(parser): add_format(parser, 'pipes') parser.add_argument('--dbpath', default=None, help=argparse.SUPPRESS) def run(args): conn = sqlite3.connect(args.dbpath or args.repos.dbpath) cu = conn.cursor() ...
null
src/pygeoroc/commands/stats.py
stats.py
py
583
python
en
code
null
code-starcoder2
76
[ { "api_name": "clldutils.clilib.add_format", "line_number": 11, "usage_type": "call" }, { "api_name": "argparse.SUPPRESS", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "cl...
178655793
# %% import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt #from sklearn.neighbors import NearestNeighbors import GeometryFunctions as gf #import GeneralLattice as gl import LAMMPSTool as LT #import LatticeDefinitions as ld import sys #import MiscFunctions as mf #import itertools as...
null
WriteTJIDswithGraphs.py
WriteTJIDswithGraphs.py
py
3,779
python
en
code
null
code-starcoder2
76
[ { "api_name": "LAMMPSTool.LAMMPSData", "line_number": 23, "usage_type": "call" }, { "api_name": "LAMMPSTool.LAMMPSGlobal", "line_number": 23, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 42, "usage_type": "call" }, { "api_n...
419015388
import configparser from datetime import datetime import os from pyspark.sql import SparkSession from pyspark.sql.functions import udf, col from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, date_format config = configparser.ConfigParser() config.read('dl.cfg') os.environ['AWS_ACCESS_KEY_ID...
null
.ipynb_checkpoints/etl-checkpoint.py
etl-checkpoint.py
py
6,922
python
en
code
null
code-starcoder2
76
[ { "api_name": "configparser.ConfigParser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pyspark.sql....
291290918
import datetime from typing import List, Dict import requests import dataclasses import pandas as pd from notion.client import NotionClient, CollectionRowBlock from notion.collection import NotionDate # ref: https://github.com/jamalex/notion-py/issues/292#issuecomment-791139647 def notion_settings() -> None: """...
null
src/utils/notify.py
notify.py
py
5,727
python
en
code
null
code-starcoder2
76
[ { "api_name": "tzlocal.get_localzone", "line_number": 66, "usage_type": "call" }, { "api_name": "notion.store", "line_number": 94, "usage_type": "attribute" }, { "api_name": "notion.store", "line_number": 95, "usage_type": "attribute" }, { "api_name": "notion.clie...
49614772
from rrt import build_obstacle_course from rrt import add_start_and_goal import matplotlib.pyplot as plt from matplotlib.path import Path import sys, random, math class RRT(): def __init__(self): fig, ax = plt.subplots() build_obstacle_course( './world_obstacles.txt', ax) start, goal = add_start_and_goal('./sta...
null
Lab4/RRT.py
RRT.py
py
4,441
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "rrt.build_obstacle_course", "line_number": 10, "usage_type": "call" }, { "api_name": "...