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
409838638
import os import unittest from flexmock import flexmock import subprocess import cryptorito TEST_KEY='AAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBB' def key_resp(_command, stderr=None): testdir = os.path.dirname(__file__) path = "%s/fixtures/gpg/key_list" % (testdir) return open(path, 'r').read() def key_blank...
null
tests/test_gpg.py
test_gpg.py
py
794
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flexmock.flexmock",...
377396172
import sqlite3 import sys import threading import time db_filename = 'todo.db' isolation_level = None # autocommit mode def reader(conn): print('Starting thread') try: cursor = conn.cursor() cursor.execute('select * from task') cursor.fetchall() print('results fetched') e...
null
src/lesson_data_persistence_and_exchange/sqlite3_threading.py
sqlite3_threading.py
py
734
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 22, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 25, "usage_type": "call" } ]
196957377
import matplotlib.pyplot as plt import math w=[] vw=[] cw=[] t=[] Ek=[] Ep=[] E=[] a=1 b=0.5 c=2/3 fd=1 dt=0.01 pi=math.pi w.append(0.2) vw.append(0) cw.append(0) t.append(0) Ek.append(0) Ep.append(0) E.append(0) end_time=100 ...
null
第七次作业/第七次作业.py
第七次作业.py
py
1,447
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.pi", "line_number": 17, "usage_type": "attribute" }, { "api_name": "math.cos", "line_number": 29, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_n...
108222946
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.contrib.sites.models import Site from django.db import models from django.utils.translation import ugettext_lazy as _ from mezzanine.conf import settings from mezzanine.core.models import Ownable from...
null
feedb/models.py
models.py
py
1,485
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 12, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 13, "usage_type": "call" }, { "api_name...
627581445
# -*- coding: utf-8 -*- """ Function implementation test. Usage: resilient-circuits selftest -l fn_guardium_insights_integration resilient-circuits selftest --print-env -l fn_guardium_insights_integration Return examples: return { "state": "success", "reason": "Successful connection to th...
null
fn_guardium_insights_integration/fn_guardium_insights_integration/util/selftest.py
selftest.py
py
1,639
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 25, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 26, "usage_type": "call" }, { "api_name": "fn_guardium...
473558256
import cv2 import numpy as np import os from random import shuffle from tqdm import tqdm import tensorflow as tf from keras.models import Sequential from keras.layers import * from keras.optimizers import * train_data = "./train_sample" test_data = "./test" record = {} img_size = 32 def one_hot_label(img)...
null
autoCNN.py
autoCNN.py
py
3,320
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 25, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 25,...
323923329
from collections import Counter import pandas as pd def load_data(path): with open(path) as file: data = file.read() data = re.sub(r'\n+', '', data) data = re.sub('[A-Z]+-[A-Z]+', '', data) dataList = data.split() dataList = [elem for elem in dataList if elem != '.' or elem != ','] iter = 0 li...
null
pos.py
pos.py
py
3,953
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 43, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 59, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 76, "usage_type": "call" }, { "api_name": "pandas.DataF...
541628057
#encoding=utf-8 from selenium import webdriver from bs4 import BeautifulSoup import time import sys import xlsxwriter import xlwt import xlrd reload(sys) sys.setdefaultencoding('utf-8') def Get_Create(url,F):#url是网页地址,F是所有人名字的list driver=webdriver.Chrome() driver.get(url) driver.find_element_by_id('userna...
null
Extra/crack_on_lgdy_get_data.py
crack_on_lgdy_get_data.py
py
2,174
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setdefaultencoding", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 14, "usage_type": "name" }, { "api_name": "t...
576214855
#https://matplotlib.org/stable/gallery/images_contours_and_fields/irregulardatagrid.html import matplotlib.pyplot as plt import matplotlib.tri as tri import numpy as np from scipy.interpolate import Rbf np.random.seed(19680801) npts = 200 ngridx = 200 ngridy = 200 x = np.random.uniform(-2, 2, npts) y = np.random.uni...
null
色斑图等值线/TriContourf.py
TriContourf.py
py
2,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.random.uniform", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random",...
67908603
""" The SHT3X series Smart Gadget from Sensirion. """ from time import perf_counter from datetime import datetime from typing import Tuple try: from bluepy.btle import Peripheral, UUID except ImportError: # then not on the Raspberry Pi Peripheral, UUID = object, lambda u: u from . import logger, timestamp_to...
null
smartgadget/sht3x.py
sht3x.py
py
29,231
python
en
code
null
code-starcoder2
76
[ { "api_name": "bluepy.btle.Peripheral", "line_number": 11, "usage_type": "name" }, { "api_name": "bluepy.btle.UUID", "line_number": 11, "usage_type": "name" }, { "api_name": "smart_gadget.SmartGadget", "line_number": 18, "usage_type": "name" }, { "api_name": "blue...
438789162
# ------------------------------------------------------------------ # # cl-calc.py - The main program for cl-calc. Parses command line # args and then dispatches to interpreter/interpreter.py # ------------------------------------------------------------------ from optparse import OptionParser from int...
null
tags/cl-calc-0.1/cl-calc.py
cl-calc.py
py
591
python
en
code
null
code-starcoder2
76
[ { "api_name": "optparse.OptionParser", "line_number": 13, "usage_type": "call" }, { "api_name": "interpreter.interpreter.run_repl", "line_number": 19, "usage_type": "call" }, { "api_name": "interpreter.interpreter", "line_number": 19, "usage_type": "name" } ]
201412481
import os import pickle as pk import numpy as np import torch from model import Generator import torch.nn as nn from torch.autograd import Variable import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt cuda_available = torch.cuda.is_available() def build_model(model_type): generator = Generator(...
null
gen_image.py
gen_image.py
py
2,331
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 12, "usage_type": "attribute" }, { "api_name": "model.Generator...
618719156
#-*- coding: utf-8 -*- import os import sys from urllib.parse import quote import requests import settings # 지정한 키워드로 검색한 이미지의 URL 얻기 def get_image_urls(keyword, total_num): image_urls = [] i = 0 while i < total_num: # Query query = CUSTOM_SEARCH_URL + "?key=" + settings.API_KEY + \ ...
null
python_code/01.img_dl_gcs.py
01.img_dl_gcs.py
py
4,274
python
en
code
null
code-starcoder2
76
[ { "api_name": "settings.API_KEY", "line_number": 14, "usage_type": "attribute" }, { "api_name": "settings.CUSTOM_SEARCH_ENGINE", "line_number": 15, "usage_type": "attribute" }, { "api_name": "urllib.parse.quote", "line_number": 17, "usage_type": "call" }, { "api_n...
10684089
import unittest from collections import Counter from shortest_path.algorithms import JumpPointSearch from shortest_path.datastructures import JPSGrid2D # Helper def compare_lists(expected, result): return Counter(expected) == Counter(result) class JPSPruneTestCase(unittest.TestCase): def setUp(self): ...
null
tests.py
tests.py
py
1,865
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "shortest_path.datastructures.JPSGrid2D", "line_number": 15, "usage_type": "call" }, { ...
139868131
import os import sys import datetime import time import gpt_2_simple as gpt2 import config import json from pick import pick import time import threading from utils import * from functools import partial from db import * from utils import * os.chdir(sys.path[0]) model_number = model_config.GPT2_MODEL_NUMBER input_ti...
null
gpt2_trainer/train_model.py
train_model.py
py
2,702
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "config.DATABASES.values", "line_number": 21, "usage_type": "call" }, { "api_name": "config.DATABASES", ...
134129523
"""Download flags of countries (with error handling). Sequential version Sample run:: $ python3 flags2_sequential.py -s DELAY b DELAY site: http://localhost:8002/flags Searching for 26 flags: from BA to BZ 1 concurrent connection will be used. -------------------- 17 flags downloaded. 9 n...
null
flags/flags2_sequential_urllib.py
flags2_sequential_urllib.py
py
2,257
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.request.urlopen", "line_number": 34, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 34, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 34, "usage_type": "name" }, { "api_nam...
627387080
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression cols = ['QE_I01', 'QE_I02', 'QE_I04', 'QE_I05', 'QE_I06', 'QE_I07', 'QE_I08', 'QE_I09', 'QE_I10', 'QE_I11', 'QE_I12'...
null
proposal.py
proposal.py
py
1,009
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 36, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 37, "usage_type": "call" ...
355889899
from sqlite3 import connect, Row import calendar import datetime class App(object): def __init__(self, argParser, repoFactory): args = argParser.getParsedArguments() connection = self.getConnection(args.db) repoFactory.setConnection(connection) self.handleActions(args, repoFactory)...
null
src/kash/app.py
app.py
py
2,055
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlite3.Row", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 35, "usage_type": "call" }, { "api_name": "datetime.date", "...
377624376
from django.conf.urls import url from django.urls import path from . import views urlpatterns = [ path( 'getfile/', views.get_file_by_name, name='get-file' ), path( 'sendfile/', views.send_file, name='send-file' ), ]
null
viewer/urls.py
urls.py
py
293
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" } ]
605624388
import os import hglib from git import Repo import hashlib def gitHash(filepath): sha1 = hashlib.sha1() sha1.update("blob ") try: f = open(filepath, 'rb') c = 0 for line in f: c += len(line) sha1.update(str(c)+"\0") f = open(filepath, 'rb') for li...
null
versioncontrol.py
versioncontrol.py
py
1,703
python
en
code
null
code-starcoder2
76
[ { "api_name": "hashlib.sha1", "line_number": 7, "usage_type": "call" }, { "api_name": "git.Repo", "line_number": 28, "usage_type": "call" }, { "api_name": "hglib.open", "line_number": 33, "usage_type": "call" }, { "api_name": "os.system", "line_number": 52, ...
109546816
# Using tensorflow 1.4.0 # The models: SSD from SSD import ssd import os from PIL import Image as pi # Training root_dir = 'C:/Users/work/Desktop/shigoto/ship-detection' input_dir = root_dir + '/crop_input' output_dir = root_dir + '/crop_output' ssd_model_dir = root_dir + '/checkpoints/ssd_300_vgg.ckpt' # check dirs...
null
crop.py
crop.py
py
1,438
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
519681419
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('users', '0002_auto_20200329_0242'), ]...
null
AdTominApps/users/migrations/0003_adtaccounts.py
0003_adtaccounts.py
py
793
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 11, "usage_type": "call...
539847505
# -*- coding: utf-8 -*- import json import re import scrapy from locations.items import GeojsonPointItem class BassProSpider(scrapy.Spider): name = "basspro" download_delay = 0 allowed_domains = ["basspro.com", "cabelas.com", "cabelas.ca"] start_urls = ('https://www.cabelas.com/stores',) def par...
null
locations/spiders/bass_pro.py
bass_pro.py
py
1,422
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 9, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": 22, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 23, "usage_type": "call" }, { "api_name": "locations.items.GeojsonPointIt...
617649339
# -*- coding: utf-8 -*- # python3 # Copyright (c) 2017 by Dr. Justin Klotz # TODO: Test new code that computes ground range # TODO: Improve positioning # - See how just 2 anchors perform in positioning # - 3D EKF? # - Rely on front two anchors? (increase variance of rear anchor ranges) # - Transition from 2D to 3D as ...
null
Raspberry_Pi/coolerbot/main.py
main.py
py
14,056
python
en
code
null
code-starcoder2
76
[ { "api_name": "RPi.GPIO.setmode", "line_number": 32, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 32, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 32, "usage_type": "attribute" }, { "api_name": "coolerbot._log_level", ...
66836563
import pandas as pd import subprocess import os import re import time import threading import argparse import csv import openpyxl from tqdm import tqdm #---------------------------------------------------# # Windows Process Information: # # This script / set of scripts is dedicated to # # hun...
null
search.py
search.py
py
10,916
python
en
code
null
code-starcoder2
76
[ { "api_name": "tqdm.tqdm", "line_number": 36, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 47, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 64, "usage_type": "call" }, { "api_name": "threading.Thread", "line_nu...
79875790
import os import cv2 import numpy as np import pandas as pd import glob import cPickle from sklearn.cross_validation import train_test_split from sklearn.utils import shuffle from keras.models import Sequential from sklearn.metrics import log_loss from keras.layers import Dense, Dropout, Activation, Flatten from keras....
null
state_farm_2.py
state_farm_2.py
py
7,308
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.models.Sequential", "line_number": 33, "usage_type": "call" }, { "api_name": "keras.layers.Convolution2D", "line_number": 35, "usage_type": "call" }, { "api_name": "keras.layers.Activation", "line_number": 36, "usage_type": "call" }, { "api_na...
337513377
from __future__ import unicode_literals import matplotlib.pyplot as plt import numpy as np import os from matplotlib.pylab import find from load_channels import get_file_name, load_channel, load_channel_emg from calculate_data import calculate_MVC_femoris, calculate_MVC_hamstring, ACCel_indexes, get_limits, abs_max, ab...
null
emg_processing.py
emg_processing.py
py
14,634
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.close", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "os.path.realpath", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", ...
253210988
#!/usr/bin/env python3 import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GObject, GLib import os import json import codecs import datetime from mimetypes import MimeTypes import shutil import glob import unicodedata import re import subprocess import urllib.request as urllib2 import n4d.client ...
null
lliurex-easy-sites/python3-easysites/sitemanager.py
sitemanager.py
py
8,161
python
en
code
null
code-starcoder2
76
[ { "api_name": "gi.require_version", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path", "line_number": 45, "usage_type": "attribute" }, { "api_name": "subprocess.Popen", ...
600389918
import os import re import sys import csv import radix import logging import psycopg2 from psycopg2.extras import execute_batch from typing import Dict, NoReturn from raven.conf import setup_logging from raven.handlers.logging import SentryHandler import dask.dataframe as dd from airflow import DAG from airflow.models ...
null
geoinfo/geoinfo.py
geoinfo.py
py
24,792
python
en
code
null
code-starcoder2
76
[ { "api_name": "airflow.models.Variable.get", "line_number": 19, "usage_type": "call" }, { "api_name": "airflow.models.Variable", "line_number": 19, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.p...
557425605
import numpy as np from .bbox import Box from . import interpolation import logging from . import resampling logger = logging.getLogger("scarlet.frame") class Frame(Box): """Spatial and spectral characteristics of the data Attributes ---------- shape_or_box: tuple shape tuple (Channel, Height...
null
scarlet/frame.py
frame.py
py
9,926
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "bbox.Box", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.float32", "line_number": 27, "usage_type": "attribute" }, { "api_name": "bbox.Box", "line_numb...
554747271
# -*- coding: utf-8 -*- """ Created on Sun Jul 9 17:06:42 2017 @author: Anirudh """ from __future__ import print_function from temp import * import scipy.io.wavfile as wav import matplotlib.pyplot as plt import numpy as np from scipy import signal import scipy import librosa import librosa.display def package_featu...
null
h5_test_d.py
h5_test_d.py
py
6,006
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.mean", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.std", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 27, ...
602173191
import asyncio from cassandra.cluster import Cluster from cassandra.auth import PlainTextAuthProvider import time def create_connection(): cloud_config = { "secure_connect_bundle": "/home/sakshi/python_project/secure-connect-test.zip" } # auth_provider = PlainTextAuthProvider( # "usbOWtaIq...
null
db.py
db.py
py
2,954
python
en
code
null
code-starcoder2
76
[ { "api_name": "cassandra.cluster.Cluster", "line_number": 16, "usage_type": "call" }, { "api_name": "time.time", "line_number": 112, "usage_type": "call" }, { "api_name": "asyncio.run", "line_number": 113, "usage_type": "call" }, { "api_name": "time.time", "li...
556148412
import os import sys import tensorflow as tf import subprocess from tensorflow.python.framework import ops import configparser # Register ops for compilation here OP_NAMES = ['backward_warp', 'downsample', 'correlation', 'forward_warp'] cwd = os.getcwd() os.chdir(os.path.dirname(os.path.realpath(__file__))) os.chd...
null
src/e2eflow/ops.py
ops.py
py
3,063
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getcwd", "line_number": 14, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, ...
242819762
import torch from torch.utils.data import Dataset, DataLoader import torch.nn.functional as F from sklearn.model_selection import train_test_split import numpy as np import pickle import time # constants: train_num_classes = 10 solution_num_classes = 9 def to_categorical(y, num_classes): """ 1-hot encodes a tenso...
null
Code/CNN_1.py
CNN_1.py
py
10,569
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.transpose", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.transpose", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.eye", "line_numbe...
328125090
#!/usr/bin/env python import pathlib from setuptools import setup, find_packages __ROOT = pathlib.Path(__file__).parent __version__ = '0.1.4' __author__ = 'Stanislav Kiryukhin' __license__ = "MIT" with open(str(__ROOT / 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='newrelic-...
null
setup.py
setup.py
py
1,222
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 14, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 31, "usage_type": "call" } ]
507786274
import os.path import numpy as np from lyapunov_reachability.speculation_tabular.base import QBase import cplex from cplex.exceptions import CplexSolverError class LyapunovQAgent(QBase): def __init__( self, env, confidence, nb_states, nb_actions, initial_policy, terminal_states, seed=None...
null
lyapunov_reachability/speculation_tabular/lyapunov.py
lyapunov.py
py
7,477
python
en
code
null
code-starcoder2
76
[ { "api_name": "lyapunov_reachability.speculation_tabular.base.QBase", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.ones", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 16, "usage_type": "call" }, { "api_na...
196764378
# -*- coding: utf-8 -*- """ Ce programme permet de recuperer une image grace a la webcam. Recuperre ensuite les references de rouge et de vert dans le coins superieurs droits et gauche. Trouve les points correspondant au meme rouge et au meme vert. Determine la droite passant par ces points. """ import readchar impor...
null
ImageProcessing/detect_alignement_from_camera.py
detect_alignement_from_camera.py
py
5,566
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.draw.line", "line_number": 33, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 33, "usage_type": "attribute" }, { "api_name": "pygame.display.flip", "line_number": 34, "usage_type": "call" }, { "api_name": "pygame.display"...
361541174
#!/usr/bin/env python import numpy as np import math from numpy import * from math import sqrt import matplotlib.pyplot as plt import matplotlib.animation as animation # import Person and World objects from person_simplified import Person_simplified from world import * from LegsDMP import LegsDMP # l - distance to s ...
null
sim_walking/walksim.py
walksim.py
py
5,689
python
en
code
null
code-starcoder2
76
[ { "api_name": "person_simplified.Person_simplified", "line_number": 24, "usage_type": "call" }, { "api_name": "LegsDMP.LegsDMP", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 46, "usage_type": "call" }, { "api_...
156989787
# ---------------------------------------------------------# # astroNN.NN.generative_test: test generative models # ---------------------------------------------------------# import random import time import h5py import numpy as np import pylab as plt import seaborn as sns import tensorflow as tf from astropy.io im...
null
astroNN/NN/generative_test.py
generative_test.py
py
6,024
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "tensorflow.ConfigProto", "line_number": 43, "usage_type": "call" }, { "api_name": "keras.backend.tensorflow_backend.set_session", "line_number": 45, "usage_type": "call" }, { "a...
466032048
""" This module should be erased for March release. """ import logging import inspect from CRABClient.ClientUtilities import colors def printModuleRetirementMsg(newname = None): renamemsg = "" if newname: renamemsg = " (with new name '%s')" % (newname) curframe = inspect.currentframe() calframe...
null
src/python/CRABClient/client_utilities.py
client_utilities.py
py
1,421
python
en
code
null
code-starcoder2
76
[ { "api_name": "inspect.currentframe", "line_number": 12, "usage_type": "call" }, { "api_name": "inspect.getouterframes", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "CRABCli...
36652663
import argparse import cv2 # construct the argument parser and parse the arguments image = cv2.imread("data/ResizedImage.jpg") gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) cv2.imshow("Original", image) kernelSizes = (5, 5) # loop over the kernel sizes and apply an "average" blur to the image blurred = cv2.blu...
null
blur.py
blur.py
py
427
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.imshow", "line_n...
224797451
#!/usr/local/bin/python3 import pymysql as db from cgi import FieldStorage,escape from os import environ from http.cookies import SimpleCookie cookie=SimpleCookie() http_cookie_header=environ.get('HTTP_COOKIE') form_data= FieldStorage() maxid=form_data.getfirst('maxid','').strip() forum=form_data.getfirst('forumName',...
null
python/testIfNew.py
testIfNew.py
py
760
python
en
code
null
code-starcoder2
76
[ { "api_name": "http.cookies.SimpleCookie", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "name" }, { "api_name": "cgi.FieldStorage", ...
603618099
# -*- coding=UTF-8 -*- import datetime import os import pyodbc # from sqlalchemy import create_engine # from sqlalchemy.pool import NullPool from admin import app # db_engine = create_engine('mysql+mysqlconnector://%s:%s@%s/%s' % ( # app.config['DB_USER'], app.config['DB_PASSWORD'], app.config['DB_HOST'], # ...
null
admin/admin/gl.py
gl.py
py
1,764
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyodbc.connect", "line_number": 64, "usage_type": "call" }, { "api_name": "admin.app.config", "line_number": 75, "usage_type": "attribute" }, { "api_name": "admin.app", "line_number": 75, "usage_type": "name" }, { "api_name": "os.path.exists", "...
384301076
from django.contrib.auth.forms import UserCreationForm, UserChangeForm, forms from datetime import datetime from .models import CustomUser, Conversation class CustomUserCreationForm(UserCreationForm): class Meta(UserCreationForm): model = CustomUser fields = ('email',) class CustomUserChangeForm...
null
mentoruservinod/mentoruserapp/forms.py
forms.py
py
1,758
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 7, "usage_type": "name" }, { "api_name": "models.CustomUser", "line_number": 8, "usage_type": "...
177392903
import pygame def create_frame(tiled_screen, settings): for x in range(0, settings.pixels_width): for y in range(0, settings.pixels_height): if x == 0 or x == settings.pixels_width-1 or y == 0 or y == settings.pixels_height-1: tiled_screen.fill([y, x]) def pause(paused): ...
null
game_functions.py
game_functions.py
py
499
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.event.get", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.event", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pygame.KEYDOWN", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pygame.K_p", ...
300864810
from __future__ import annotations import collections import random import heapq import math import bisect """ Success Details Runtime: 48 ms, faster than 87.01% of Python3 online submissions for Minimum Cost For Tickets. Memory Usage: 13.9 MB, less than 11.33% of Python3 online submissions for Minimum Cost For ...
null
M_983_mincostTickets.py
M_983_mincostTickets.py
py
855
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 20, "usage_type": "call" } ]
632450318
import requests import datetime import pandas as pd import pyperclip from bs4 import BeautifulSoup import tkinter as tk from tkinter import messagebox def pasteUrl(e): urlText.delete("1.0", "end") urlText.insert("1.0", pyperclip.paste()) def getData(): url = urlText.get("1.0", "end") html_contents = r...
null
Sample/sample02.py
sample02.py
py
1,514
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyperclip.paste", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.read_excel", ...
240127321
import pygame as pg import sys from os import path from settings import * from sprites import * class Game: def __init__(self): pg.init() self.screen = pg.display.set_mode((WIDTH, HEIGHT)) pg.display.set_caption(TITLE) self.clock = pg.time.Clock() self.what_time = self.clock...
null
semester1/PycharmProjects/pacman/main.py
main.py
py
10,899
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.display...
552911929
#!/usr/bin/env python """ Author: Nick Russo Purpose: A test case file for the Database class (Model in MVC). Used to illustrate Test Driven Development (TDD) and DevOps CI/CD. """ import pytest import database @pytest.fixture(scope="module") def db_mock(): """ Test fixture setup to create sample database f...
null
m5/src/test_unit.py
test_unit.py
py
752
python
en
code
null
code-starcoder2
76
[ { "api_name": "database.Database", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "call" } ]
344661314
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mail', '0003_message_created_data'), ] operations = [ migrations.AlterIndexTogether( name='message', ...
null
poleno/mail/migrations/0004_message_index_created.py
0004_message_index_created.py
py
400
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.AlterIndexTogether", "line_number": 14, "usage_type": "call" ...
6860261
import base64 import urllib import json import logging import requests class BaiduFaceIdentify(): #此函数用于获取access_token,返回access_token的值 #此函数被parse_face_pic调用 def get_access_token(self): client_id = 'KuLRFhTzX3zBFBSrbQBsl6Q4' #此变量赋值成自己API Key的值 client_secret = '8ahbIb2hEOePzX...
null
huaban/BaiduFaceIdentify.py
BaiduFaceIdentify.py
py
3,897
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 29, "usage_type": "call" }, { "api_name": "urllib.request", "...
394138382
import sys from argparse import ArgumentParser class MultipleDefaultCommands(Exception): pass class SubcommParser(ArgumentParser): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.subparsers = self.add_subparsers(help='Subcommands.') self.subparsers._parse...
null
subcomm/__init__.py
__init__.py
py
1,450
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 39, "usage_type": "attribute" } ]
404917390
#!/usr/bin/env python import rospy import numpy as np #from std_msgs.msg import Float32 from nav_msgs.msg import Odometry from tf.transformations import euler_from_quaternion from geometry_msgs.msg import Twist from math import sin, cos, atan2, pi x_bot = 0.1 y_bot = 0.0 theta = 0.0 m = 30 angle = 270.0 diff = 0.0 ang...
null
braitenberg_simulation/src/braitenberg_safe copy.py
braitenberg_safe copy.py
py
1,690
python
en
code
null
code-starcoder2
76
[ { "api_name": "tf.transformations.euler_from_quaternion", "line_number": 25, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 26, "usage_type": "name" }, { "api_name": "numpy.clip", "line_number": 27, "usage_type": "call" }, { "api_name": "math.pi",...
425795150
import MySQLdb from utils.config import settings from elasticsearch import Elasticsearch from elasticsearch import helpers class Database: """ 对数据库 """ __db_instances={} @classmethod def get_instance(cls, db_type=settings.DatabaseType.MYSQL): """ 定义get_instance类方法,用来获取数据库对象的...
null
utils/dal/database.py
database.py
py
2,922
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.config.settings.DatabaseType", "line_number": 16, "usage_type": "attribute" }, { "api_name": "utils.config.settings", "line_number": 16, "usage_type": "name" }, { "api_name": "utils.config.settings.DatabaseType", "line_number": 29, "usage_type": "attr...
61601882
from tqdm import tqdm from algoritmos.ag import AG from algoritmos.pso import PSO from algoritmos.utils import escreve_ag, escreve_pso def chungreynolds(x): total=0 for i in range(len(x)): total+=x[i]**2 return total**2 if __name__ == "__main__": # Parâmetros do experimento fatorial popul...
null
chungreynolds_fatorial.py
chungreynolds_fatorial.py
py
3,018
python
en
code
null
code-starcoder2
76
[ { "api_name": "tqdm.tqdm", "line_number": 24, "usage_type": "call" }, { "api_name": "algoritmos.ag.AG", "line_number": 33, "usage_type": "call" }, { "api_name": "algoritmos.utils.escreve_ag", "line_number": 52, "usage_type": "call" }, { "api_name": "tqdm.tqdm", ...
569340516
# Thresolding is a popular segmentation technique used for seperating an object from its bavkground. # The process of thresholding involves comparing each pixel of an image with a predefined threshold value. # This type of comparision devides all the pixels of the input image into two groups. # First group involves...
null
Anudit Bhatt/OpenCv/Opencv_Thresholding.py
Opencv_Thresholding.py
py
1,186
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.threshold", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.THRESH_BINARY", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.threshold", "...
205887403
import traceback from datetime import datetime from decimal import Decimal from background_task import background from django.contrib.auth.models import User from django.db import models from exchange.models import Signal, Strategy, Choices, TradeState, StrategyType from trade import log class Candle: def __ini...
null
back_test/models.py
models.py
py
8,073
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 22, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 22, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 23, "usage_type": "call" }, { "api_name...
417716652
""" Miscellaneous widgets which do not fit into the other main categories. """ from __future__ import absolute_import, division, unicode_literals import os from io import BytesIO from base64 import b64encode from six import string_types import param import numpy as np from ..depends import depends from ..io.noteboo...
null
panel/widgets/misc.py
misc.py
py
4,834
python
en
code
null
code-starcoder2
76
[ { "api_name": "base.Widget", "line_number": 24, "usage_type": "name" }, { "api_name": "param.Boolean", "line_number": 26, "usage_type": "call" }, { "api_name": "param.Number", "line_number": 29, "usage_type": "call" }, { "api_name": "param.Integer", "line_numb...
202228707
#! /usr/bin/env python # -*- mode: python; coding: utf-8 -*- # Copyright 2019 the .Net Foundation # Distributed under the terms of the revised (3-clause) BSD license. from __future__ import absolute_import, division, print_function from os.path import join as pjoin from setuptools import setup from setupbase import ...
null
setup.py
setup.py
py
2,063
python
en
code
null
code-starcoder2
76
[ { "api_name": "setupbase.get_version", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "setupbase.find_packages", "line_number": 24, "usage_type": "call" }, { "api_name": "setuptools...
81293723
import numpy as np import sys sys.path.append("/opt/openrobots/lib/python2.7/site-packages") import yarp import matplotlib.pylab as mpl yarp.Network.init() input_port = yarp.Port() #BufferedPortImageRgba() input_port.open("/image-port") yarp.Network.connect("/morse/atrv/videocameraL/out", "/image-port") image...
null
simulation/yarp_test.py
yarp_test.py
py
801
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "yarp.Network.init", "line_number": 10, "usage_type": "call" }, { "api_name": "yarp.Network", "lin...
136067158
import PyPDF2 from PyPDF2 import PdfFileReader import sys def impr(fileName): pdfFile = PdfFileReader(fileName,'rb') meta = pdfFile.getDocumentInfo() print('-Document: ' + str(fileName)) for i in meta: print('-' + i[1:] + ': ' + meta[i]) def main(): filename = sys.argv[1] if filename == ...
null
pyfiles/pdfmeta.py
pdfmeta.py
py
431
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyPDF2.PdfFileReader", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" } ]
224530200
from django import forms from django.forms.models import inlineformset_factory, BaseInlineFormSet from impositions import models, utils from impositions.widgets import ImageWidget class CSVSelect(object): def value_from_datadict(self, data, files, name): return ','.join(data.getlist(name)) def render(...
null
impositions/forms.py
forms.py
py
6,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.SelectMultiple", "line_number": 17, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 17, "usage_type": "name" }, { "api_name": "django.forms.CheckboxSelectMultiple", "line_number": 18, "usage_type": "attribute" }, {...
88135144
from django.urls import path from django.urls.resolvers import URLPattern from . import views urlpatterns = [ path("", views.home, name="user_home"), path("login/", views.login, name="user_login"), path("register", views.register, name="user_register"), path("logout", views.logout, name="user_logout")...
null
SmartWatch_Dashboard/user/urls.py
urls.py
py
388
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", ...
391547978
from django.conf.urls import url, include from django.views.decorators.cache import cache_page from rest_framework import routers from .apiviews import PlaceViewSet, GreetingViewSet, PfopNotifyView, UserGreetingView, \ ProvinceListView, CityListView, DistrictListView, InspirationViewSet, LikeViewSet, \ ShareVi...
null
greetings/urls.py
urls.py
py
1,223
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 9, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 9, "usage_type": "name" }, { "api_name": "apiviews.ProvinceListView", "line_number": 10, "usage_type": "argument" }, ...
416328971
# -*- coding: utf-8 -*- import json from django.http import HttpResponse from django.utils.translation import ugettext as _ from btw.models import UserAchievement _ERRORS = { 'ACHIEVEMENT_TODO': _(u'Это достижение уже в избранном'), 'ACHIEVEMENT_IN_PROGRESS': _(u'Вы уже началали выполнять это достижение'), ...
null
btw/errors.py
errors.py
py
1,270
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.utils.translation.ugettext", "line_number": 9, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext", "line_number": 10, "usage_type": "call" }, { "api_name": "django.utils.translation.ugettext", "line_number": 11, "usage_type": "...
318747184
from django.shortcuts import render, redirect from django.contrib.auth import logout as auth_logout from django.http import Http404 from django.contrib import messages from models import * import string # from apps.events.models import Event, Reservation # from apps.login.models import User def index(request): retur...
null
apps/login/views.py
views.py
py
2,683
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 35, "usage_type": "call" }, { "api_nam...
353057923
import tweepy import time # Two lines below require key from your twitter dev account consumer_key = '' consumer_secret = '' access_token = '' access_token_secret = '' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) public_twee...
null
projects/twitter-bot/twitter_bot.py
twitter_bot.py
py
1,144
python
en
code
null
code-starcoder2
76
[ { "api_name": "tweepy.OAuthHandler", "line_number": 10, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 12, "usage_type": "call" }, { "api_name": "tweepy.RateLimitError", "line_number": 31, "usage_type": "attribute" }, { "api_name": "time.sleep"...
536304655
from django import forms from django.contrib.auth.forms import UserCreationForm, UserChangeForm from .models import CustomUser from django.contrib.auth.forms import AuthenticationForm class CustomUserCreationForm(UserCreationForm): class Meta: model = CustomUser fields = ('username', 'email') ...
null
users/forms.py
forms.py
py
1,069
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 7, "usage_type": "name" }, { "api_name": "models.CustomUser", "line_number": 10, "usage_type": "name" }, { "api_name": "django.contrib.auth.forms.UserChangeForm", "line_number": 20, "usage_type": "...
52827630
import sys import quandl import pandas as pd import configparser as cp config = cp.SafeConfigParser() config.read('./config.ini') class StockReader(): def appendCSV(self, path, code): all_rows = int(config.get('config', 'all_rows')) data = quandl.get('TSE/%s'%code, rows=rows) df = pd.Data...
null
pred_fx/get_datas.py
get_datas.py
py
1,889
python
en
code
null
code-starcoder2
76
[ { "api_name": "configparser.SafeConfigParser", "line_number": 6, "usage_type": "call" }, { "api_name": "quandl.get", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_...
296321000
import torch from torchvision import transforms from torchvision.utils import make_grid from torch.utils.data import DataLoader import transform_data from torch import optim, nn import network from slc_dataset import SLC_spe_4D import numpy as np import os.path txt_file = '../data/temp_data.txt' data_trans...
null
DSN_src/mapping_r4_r3.py
mapping_r4_r3.py
py
2,019
python
en
code
null
code-starcoder2
76
[ { "api_name": "torchvision.transforms.Compose", "line_number": 13, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 13, "usage_type": "name" }, { "api_name": "transform_data.Normalize_spe_xy", "line_number": 14, "usage_type": "call" }, { ...
187290026
from discord.ext.commands import Context from cogs.utils.constants import EmbedConstants from cogs.utils.global_checks import has_message_perms from io import BytesIO import discord import logging class WardenContext(Context): def __init__(self, **kwargs): super().__init__(**kwargs) self.lang =...
null
src/context.py
context.py
py
2,768
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Context", "line_number": 10, "usage_type": "name" }, { "api_name": "cogs.utils.global_checks.has_message_perms", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 25, "usage_type": "call" }, { ...
334443274
import pandas as pd import numpy as np import matplotlib.pyplot as plt from algorithms.algorithms import ICSS from statsmodels.tsa.stattools import adfuller plt.rcParams['figure.figsize'] = 15, 5 ds_name = "QIWI_790101_190612.csv" data = pd.read_csv(f"data\\{ds_name}").iloc[:1401] data["<DATE>"] = pd.to_datetime(d...
null
qiwi_test.py
qiwi_test.py
py
1,744
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 8, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "panda...
107353380
# -*- coding: utf-8 -*- # rdminfo logger import json import logging class RdmLogger(logging.LoggerAdapter): def process(self, msg, kwargs): information = { 'extra': { 'kwargs': kwargs, 'structual': True, }, } return msg, information ...
null
api/base/rdmlogger.py
rdmlogger.py
py
1,335
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.LoggerAdapter", "line_number": 6, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.BASIC_FORMAT", "line_number": 20, "usage_type": "attribute" }, { "api_name": ...
266361308
# coding=utf-8 # Copyright 2020 The Robustness Metrics Authors. # # 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 appli...
null
robustness_metrics/metrics/uncertainty.py
uncertainty.py
py
5,122
python
en
code
null
code-starcoder2
76
[ { "api_name": "robustness_metrics.metrics.base.KerasMetric", "line_number": 29, "usage_type": "attribute" }, { "api_name": "robustness_metrics.metrics.base", "line_number": 29, "usage_type": "name" }, { "api_name": "uncertainty_metrics.ExpectedCalibrationError", "line_number"...
465008457
""" TRPO """ import numpy as np import scipy.signal import tensorflow as tf from gym.spaces import Box, Discrete import matplotlib.pyplot as plt EPS = 1e-8 class PPO: def __init__( self, env, lr_pi=0.01, lr_v=0.01, gamma=0.99, lam=0.97, ...
null
contents/12_Proximal_Policy_Optimization/ppo3.py
ppo3.py
py
7,947
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 31, "usage_type": "attribute" }, { "api_name": "tensorflow.set_random_seed", "line_number": 32, "usage_type": "call" }, { "api_name": "tensor...
508656150
""" Copyright 2020 The OneFlow Authors. 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 required by applicable law or agr...
null
ClickThroughRate/WideDeepLearning/wdl_train_eval.py
wdl_train_eval.py
py
10,768
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 28, "usage_type": "call" }, { "api_name": "oneflow.data.ofrecord_reader", "line_number": 65, "usage_type": "call" }, { "api_name": "oneflow.data", "line_number": 65, "usage_type": "attribute" }, { "api_name":...
327365308
# -*- coding: utf-8 -*- import os import shutil import logging import boto3 # for sending key to user import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from logging.handlers import RotatingFileHandler def create_dir(directory): try: if not os.path.exists(...
null
utils.py
utils.py
py
3,801
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 18, "usage_type": "call" }, { "api_name": "shutil.rmtree", "line_num...
438861955
# coding=utf-8 from typing import List, NewType from uuid import UUID from adbook.orm.collection_manager import CollectionManager from adbook.orm.entity import Entity RefListType = NewType('RefListType', List[UUID]) class CollectionRef: def __init__(self, collection_name: str, owner: Entity, manager: Collecti...
null
adbook/orm/types/collection_ref.py
collection_ref.py
py
1,217
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.NewType", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "uuid.UUID", "line_number": 10, "usage_type": "name" }, { "api_name": "adbook.orm.entity.Entity", "...
592218401
from collections import OrderedDict from rest_framework.pagination import PageNumberPagination from rest_framework.response import Response class DynamicPageNumberPagination(PageNumberPagination): page_size = None page_size_query_param = 'per_page' max_page_size = 30 def get_page_metadata(self): ...
null
trap/api/pagination.py
pagination.py
py
1,185
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.pagination.PageNumberPagination", "line_number": 7, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 26, "usage_type": "call" }, { "api_name": "rest_framework.response.Response", "line_number": 38, "usage_type":...
546775213
import matplotlib.pyplot as plt import numpy as np def savefig(w, ax, save_path): xs = np.arange(1000) / 10 ys = -(w[0] + w[1] * xs) / w[2] ax.plot(xs, ys) ax.set_xlim(0, 100) ax.set_ylim(0, 100) plt.savefig(save_path) def display_boundary(w, ax): ''' 将decision boundary更新到ax所在的图像中,仅仅能...
null
lab2/utils.py
utils.py
py
4,371
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arange", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.arange"...
272832035
#coding:utf-8 """ ���ݿ����ӹ��� """ __author__ = "liangxiaokai@21cn.com" __version__ = "1.0" __date__ = "2011/04/14" __copyright__ = "Copyright (c) 2011" __license__ = "Python" from connect import * from sqlalchemy import Table,Column,func from sqlalchemy.types import * from sqlalchemy.ext.declarati...
null
server/db/texas.py
texas.py
py
1,504
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.Table", "line_number": 19, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.Colum...
541432967
import os import shutil import sys import fs.move import fs.path import pytest from api import util from api.site.storage_provider_service import StorageProviderService from api.site.providers import get_provider from bson.objectid import ObjectId # When we move a file we also need to update the provider Id now def ...
null
tests/integration_tests/python/test_migrate_storage.py
test_migrate_storage.py
py
10,326
python
en
code
null
code-starcoder2
76
[ { "api_name": "api.util.path_from_uuid", "line_number": 16, "usage_type": "call" }, { "api_name": "api.util", "line_number": 16, "usage_type": "name" }, { "api_name": "fs.move.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "fs.move.path", ...
648305806
import pygame from constants import TRANSPARENT from morph.morph import Morph from primitives.point import Point class CircleBox(Morph): " I can be used for sliders " def __init__(self): super(CircleBox, self).__init__() self.set_extent(Point(20, 100)) self.draw_new() def auto_...
null
morphs/circle_box.py
circle_box.py
py
2,525
python
en
code
null
code-starcoder2
76
[ { "api_name": "morph.morph.Morph", "line_number": 9, "usage_type": "name" }, { "api_name": "primitives.point.Point", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.Surface", "line_number": 25, "usage_type": "call" }, { "api_name": "constants.TRAN...
245238602
import tensorflow as tf import numpy import matplotlib.pyplot as plt rng = numpy.random # Paramters learning_rate = 0.01 training_epochs = 1000 display_step = 50 # Training data train_X = numpy.asarray([3.3,4.4,5.5,6.71,6.93,4.168,9.779,6.182,7.59,2.167, 7.042,10.791,5.313,7.997,5.654,9.27,3...
null
TensorFlow/Tuts/LinearRegression/linearregression.py
linearregression.py
py
2,630
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 15, "usage_type": "call" }, { "api_name": "tensorflow.placeholder",...
594630658
import numpy import timeit from .utils import train_test_split from .utils import computeAccuracy class myNN: """ A neural network implenetation from scratch using numpy only. ... Attributes ---------- hiddenLayerSize : tuple each entry in the tuple respresents the number of perce...
null
msafaNN/myNN.py
myNN.py
py
18,628
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.unique", "line_number": 87, "usage_type": "call" }, { "api_name": "timeit.default_timer", "line_number": 98, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 112, "usage_type": "call" }, { "api_name": "numpy.sum", "line_...
644438050
import socket; import json; import MasterDaemon; import sys; sys.path.append('/usr/lib/greenleaf'); from inspect import currentframe, getframeinfo; import utils; from MasterSql import *; from DaemonConfigParser import *; from Crypto.Cipher import AES; import AESManager; import os; import hashlib; OPTION_ON_OFF ...
null
glmaster/usr/bin/glmaster/KNXManager.py
KNXManager.py
py
6,133
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "Crypto.Cipher.AES.key_size", "line_number": 76, "usage_type": "attribute" }, { "api_name": "Crypto.Ci...
618384949
import os import pickle from flask import Flask, request, redirect, url_for, send_from_directory from werkzeug.utils import secure_filename from pydub import AudioSegment import scipy.io.wavfile from python_speech_features import mfcc import numpy as np from sklearn.metrics import accuracy_score from sklearn.linear_mod...
null
music.py
music.py
py
3,476
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 30, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 30, "usage_type": "name" }, { "api_name": "flask.request.fil...
514225638
from tkinter import ttk, messagebox, filedialog from PIL import Image, ImageTk import blop_catalogue import tkinter as tk import ntpath import shutil import glob import re class DragDropListbox(tk.Listbox): """ A Tkinter listbox with drag'n'drop reordering of entries. """ def __init__(self, mast...
null
SettingsWin.py
SettingsWin.py
py
26,207
python
en
code
null
code-starcoder2
76
[ { "api_name": "tkinter.Listbox", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tkinter.SINGLE", "line_number": 15, "usage_type": "attribute" }, { "api_name": "tkinter.Listbox.__init__", "line_number": 16, "usage_type": "call" }, { "api_name": "tki...
104206247
# Copyright (c) 2020, salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root # or https://opensource.org/licenses/BSD-3-Clause import json import lz4.frame from ai_economist.foundation.base.base_env import BaseEnvironment d...
null
ai_economist/foundation/utils.py
utils.py
py
1,233
python
en
code
null
code-starcoder2
76
[ { "api_name": "ai_economist.foundation.base.base_env.BaseEnvironment", "line_number": 17, "usage_type": "argument" }, { "api_name": "lz4.frame.frame.open", "line_number": 24, "usage_type": "call" }, { "api_name": "lz4.frame.frame", "line_number": 24, "usage_type": "attrib...
478597300
"""bookDB URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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-base...
null
B/urls.py
urls.py
py
1,187
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 20, "usage_type": "call" }, { "api_name": "myBook.views.show", "line_number": 20, "usage_type": "argument" }, { "api_name": "django.conf.urls.url", "line_number": 21, "usage_type": "call" }, { "api_name": "djang...
408548203
# -*- coding: utf-8 -*- """ """ import logging __author__ = "Nicu Tofan" __package_name__ = "p2p0mq" __copyright__ = "Copyright 2019, Nicu Tofan" __credits__ = [] __license__ = "MIT" __maintainer__ = "Nicu Tofan" __email__ = "nicu.tofan@gmail.com" __package_url__ = 'https://github.com/pyl1b/%s' % __package_name__ # ...
null
p2p0mq/constants.py
constants.py
py
2,122
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.addLevelName", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.addLevelName", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.addLevelName", "line_number": 24, "usage_type": "call" }, { "api_name": "loggin...
136588581
import json import boto3 from botocore.exceptions import ClientError from boto3.dynamodb.conditions import Key from ex import exceptions dynamodb = boto3.resource("dynamodb") table = dynamodb.Table("DemoServerless") def get_all(): try: response = table.query( KeyConditionExpression = Key("hk").eq("EMPLEADO") ...
null
api/getAll.py
getAll.py
py
753
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto3.resource", "line_number": 7, "usage_type": "call" }, { "api_name": "boto3.dynamodb.conditions.Key", "line_number": 13, "usage_type": "call" }, { "api_name": "botocore.exceptions.ClientError", "line_number": 17, "usage_type": "name" }, { "api_n...
120370044
# python- from datetime import date,datetime ''' property可以将函数作为属性被调用 当我们使用@property这个装饰器的时候, @property会创建一个@age.setter装饰器,可以对属性值进行修改 ''' class User: def __init__(self,name,birthday): self.name = name self.birthday = birthday #birthday是一个date对象,有year,month,day三个属性 self._age = 0 @property def age(self): r...
null
property_test.py
property_test.py
py
673
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "datetime.date", "line_number": 26, "usage_type": "call" } ]
28255534
# coding = utf-8 import configparser import os class test_config(object): def get_BrowserType(self): root_dir = os.path.abspath('.') print(root_dir) config = configparser.ConfigParser() file_path = os.path.dirname(os.path.abspath('.')) + '/config/config.ini' config.read(file_path) browser = config.ge...
null
experiments/test_config.py
test_config.py
py
483
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.dirnam...
423695301
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D def threedplot(x,y,z): fig = plt.figure(figsize=(4,4)) ax = fig.add_subplot(111, projection='3d') try: ax.scatter(x,y,z) plt.show() except: print("Invalid input") ...
null
threed_project.py
threed_project.py
py
332
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 15, "usage_type": "call" }, { "api_name": "matpl...
467578786
from velociraptor.observations.objects import ObservationalData import unyt import numpy as np import os import sys # Exec the master cosmology file passed as first argument with open(sys.argv[1], "r") as handle: exec(handle.read()) # Cosmologies h_sim = cosmology.h input_filename = "../raw/Gratier2010.txt" ou...
null
data/GalaxyColdGasFractions/conversion/convertGratier2010.py
convertGratier2010.py
py
1,724
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number"...
215333080
""" compile Pytorch IR Graph into Tensorflow Graph """ from __future__ import absolute_import from __future__ import print_function from __future__ import division import re import torch import tensorflow as tf from converter.conversion import op_map from converter.tensor_copy import copy_through_numpy from convert...
null
compiler.py
compiler.py
py
5,125
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.findall", "line_number": 37, "usage_type": "call" }, { "api_name": "tensorflow.compat.v1.disable_eager_execution", "line_number": 53, "usage_type": "call" }, { "api_name": "tensorflow.compat", "line_number": 53, "usage_type": "attribute" }, { "ap...
229045681
import argparse, pickle import numpy as np import os import torch from torch import nn, optim # Use the util.load() function to load your dataset from .utils import * from .models import * dirname = os.path.dirname(os.path.abspath(__file__)) def test(iterations): # Load the model model = Model().cuda() model.loa...
null
homework_10/homework/test.py
test.py
py
1,385
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.load", "line_n...
494655911
from bs4 import BeautifulSoup import bs4 from selenium import webdriver from selenium.webdriver import ActionChains from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import urllib.parse from flask import j...
null
api/impi/get_impi.py
get_impi.py
py
2,709
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 26, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 26, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 34, "usage_type": "call" }, { "api...
619908706
import tweepy from auth import authenticate, authenticate_search, authenticate_another import requests import json from dateutil.parser import parse from add_to_db import upload_replied, get_database, if_already_replied from time import sleep from re import sub with open("cities", "r") as f: cities = f.read().spli...
null
search_for_need.py
search_for_need.py
py
4,688
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.sub", "line_number": 21, "usage_type": "call" }, { "api_name": "auth.authenticate_search", "line_number": 47, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 48, "usage_type": "call" }, { "api_name": "auth.authenticate", "l...