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
517612769
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: shaopf @file: gen_posseg_pinyin_otherlanguage.py @version: 1.0 @time: 2019/07/15 10:54:02 @email: feipengshao@163.com @function: 其它无前端语言,根据发音词典生成,分词仍然利用jieba """ from jieba import posseg from seperate_pinyin import pinyinformat from language_util import _PUNC...
null
src/gen_posseg_pinyin_otherlanguage.py
gen_posseg_pinyin_otherlanguage.py
py
3,425
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.split", "line_number": 24, "usage_type": "call" }, { "api_name": "seperate_pinyin.pinyinformat", "line_number": 34, "usage_type": "call" }, { "api_name": "seperate_pinyin.pinyinformat", "line_number": 38, "usage_type": "call" }, { "api_name": "la...
48763879
# -*- coding: utf-8 -*- """ Created on Tue Nov 26 09:29:05 2019 @author: Sylvain.FINOT """ import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import inset_axes np.random.seed(12789749) plt.style.use('Rapport') plt.rc('axes', titlesize=12) Rate = int(9.2e4+1.7e5) #nombre de c...
null
Simulation g2/Poisson/Simulation_g2_poisson.py
Simulation_g2_poisson.py
py
1,855
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.style.use", "line_number": 12, "usage_type": "call" }, { "api_name": "matpl...
574800351
import pwn import argparse from send_kernel import * parser = argparse.ArgumentParser() parser.add_argument('-t', '--tty', help='target tty', default='/dev/ttyUSB0') parser.add_argument('-b', '--baudrate', help='serial baudrate', type=int, default=115200) parser.add_argument('-k', '--kernel', help=...
null
script.py
script.py
py
602
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "pwn.serialtube", "line_number": 17, "usage_type": "call" } ]
285196457
# -*- coding: utf-8 -*- # # Copyright 2015 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 requir...
null
google-cloud-sdk/lib/tests/lib/surface/compute/e2e_managers_updater_test_base.py
e2e_managers_updater_test_base.py
py
15,022
python
en
code
null
code-starcoder2
66
[ { "api_name": "tests.lib.surface.compute.e2e_test_base.BaseTest", "line_number": 30, "usage_type": "attribute" }, { "api_name": "tests.lib.surface.compute.e2e_test_base", "line_number": 30, "usage_type": "name" }, { "api_name": "googlecloudsdk.calliope.base.ReleaseTrack", "li...
337193759
from flask import Flask, jsonify, request, send_from_directory from flask_cors import CORS from blockchain import Blockchain from transaction import Transaction from wallet import Wallet from block import Block app = Flask(__name__) CORS(app) @app.route('/', methods=['GET']) def get_node_ui(): return send_from_...
null
node.py
node.py
py
9,160
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.send_from_directory", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.send_from_...
254761003
#coding:utf-8 from Conll09FileReader import Conll09FileReader from SentenceData09 import SentenceData09 from collections import deque from lxml import etree as ET, etree from os import listdir from os.path import isfile, join import globals from CompoundVerb import CompoundVerb from Tagger.VerbEventTagger impo...
null
EventProcessing/CorpusXMLManipulation.py
CorpusXMLManipulation.py
py
9,556
python
en
code
null
code-starcoder2
66
[ { "api_name": "Conll09FileReader.Conll09FileReader", "line_number": 21, "usage_type": "call" }, { "api_name": "lxml.etree.Element", "line_number": 29, "usage_type": "call" }, { "api_name": "lxml.etree", "line_number": 29, "usage_type": "name" }, { "api_name": "lxm...
217493267
#!/usr/bin/python3 import csv import datetime import fnmatch import os from dateutil.relativedelta import * files, all_libs = [], [] mon = datetime.datetime.now() - relativedelta(months=1) mon = mon.strftime('%Y/%m') def find(files): """ Find EBSCO stats file in working directory """ for file in o...
null
misc/process-ebsco-stats.py
process-ebsco-stats.py
py
1,573
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "fnmatch.fnmat...
225726414
import tensorflow as tf from tensorflow.keras.preprocessing.image import ImageDataGenerator import numpy as np from PIL import ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True from sklearn.metrics import classification_report from numpy.random import seed from tensorflow.keras.layers import Conv2D,Activation,MaxPooling...
null
crosswalk_sign_model.py
crosswalk_sign_model.py
py
2,320
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.ImageFile.LOAD_TRUNCATED_IMAGES", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PIL.ImageFile", "line_number": 5, "usage_type": "name" }, { "api_name": "tensorflow.compat.v1.set_random_seed", "line_number": 11, "usage_type": "call" }, ...
298940494
import requests import random word_site = "https://svnweb.freebsd.org/csrg/share/dict/propernames?view=co" response = requests.get(word_site) WORDS = response.content.splitlines() the_gender='' the_name='' suggestions='' number=0 def gend(): global the_gender while True: your_gen=input("Is the baby ...
null
namegen.py
namegen.py
py
1,325
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 34, "usage_type": "call" } ]
121913030
import logging import re logger = logging.getLogger(__name__) class FieldDomain: """Mixin class for methods of field and domain constructs. .. versionadded:: (cfdm) 1.8.9.0 """ def _apply_masking_constructs(self): """Apply masking to metadata constructs in-place. Masking is appli...
null
cfdm/mixin/fielddomain.py
fielddomain.py
py
38,268
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 346, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 381, "usage_type": "call" } ]
404462531
#!/usr/bin/env python3 import sqlite3 import os import nltk import json import time import datetime from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from collections import Counter nltk.download('stopwords') nltk.download('punkt') STOPS = stopwords.words() + ["amp", "gt", "lt"] FILLER = ["lik...
null
analysis/popular-words/crpopular.py
crpopular.py
py
2,604
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.download", "line_number": 12, "usage_type": "call" }, { "api_name": "nltk.download", "line_number": 13, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 15, "usage_type": "call" }, { "api_name": "nltk.corpus.s...
395546401
import numpy as np import matplotlib.pyplot as plt import os import tensorflow as tf def plot_mel_and_alignment(save_folder, mel, align_path, tokens=None, idx=0, step=0, mel_length=None, character_length=None): """Plot, align character and mel mel: [mel_length, 80] align_path: [...
null
tensorflow_tts/utils/plot_utils.py
plot_utils.py
py
2,806
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.ndarray", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.concatenate", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.nonzero", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.concatenate"...
565452236
import os from subprocess import Popen import tempfile from djangomaster.views import MasterView, MasterJSONView from djangomaster.conf import settings class TestView(MasterView): template_name = 'djangomaster/test.html' menu_item = 'test' def get_context_data(self, **kwargs): context = super(Te...
null
djangomaster/views/test.py
test.py
py
2,297
python
en
code
null
code-starcoder2
66
[ { "api_name": "djangomaster.views.MasterView", "line_number": 9, "usage_type": "name" }, { "api_name": "djangomaster.views.MasterJSONView", "line_number": 23, "usage_type": "name" }, { "api_name": "os.path.split", "line_number": 32, "usage_type": "call" }, { "api_...
567167498
import os import datetime import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score, confusion_matrix, roc_curve, auc from sklearn.pipeline import Pipeline from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer from skle...
null
head_classifier_train.py
head_classifier_train.py
py
4,743
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 30, "usage_type": "call" }, { "api_name...
45679860
import concurrent.futures import json import math import multiprocessing import os import time import urllib.parse import urllib.request def convert_meter_to_latitude(meter): earth_radius = 6378137.0 earth_circumference = 2.0 * math.pi * earth_radius meters_per_degree = earth_circumference / 360.0 ret...
null
main.py
main.py
py
6,615
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.pi", "line_number": 13, "usage_type": "attribute" }, { "api_name": "math.cos", "line_number": 21, "usage_type": "call" }, { "api_name": "math.radians", "line_number": 21, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 22, ...
53908916
import json import glob, os import argparse def str2bool(string): if type(string) == bool: bool_type = string else: assert string == 'True' or string == 'False' bool_type = True if string == 'True' else False return bool_type def is_same_original(ref, test, root=False...
null
Challenge/Second_Year/Mission2/function/output/compare_gt.py
compare_gt.py
py
6,818
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 130, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 145, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 151, "usage_type": "call" }, { "api_name": "os.path", "...
446533986
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.keys import Keys import time import config import threading from flask import Flask,request,r...
null
updateticketstatus.py
updateticketstatus.py
py
11,383
python
en
code
null
code-starcoder2
66
[ { "api_name": "configparser.ConfigParser", "line_number": 17, "usage_type": "call" }, { "api_name": "check_licensing.decrypt_message", "line_number": 20, "usage_type": "call" }, { "api_name": "config.logger.info", "line_number": 23, "usage_type": "call" }, { "api_...
416977132
"""Module that handles the interaction with the files.""" import os import shutil from collections import OrderedDict import json import basic class JsonFileHandler: """Provide basic functionality to handle files.""" def __init__(self, root_path, files_path, backup_path="backup"): """Constructor.""" ...
null
backend/filesys.py
filesys.py
py
6,337
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.exists", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 32, "usage_type": "call" }, { "api_name": "basic.perror", "line_number"...
129456215
import tts import stt import karp running=True talk=tts.tts() # # talk.talk("test 1 2 3 4") # karp=karp.karp(); talking=stt.stt() # # text=talk.talk((memes.listen())) def commands(txt): print(txt) while running: x=input() talk.talk("say a command") inp=talking.listen() commands(inp)
null
pycharm/javis/jarvis.py
jarvis.py
py
315
python
en
code
null
code-starcoder2
66
[ { "api_name": "tts.tts", "line_number": 7, "usage_type": "call" }, { "api_name": "karp.karp", "line_number": 11, "usage_type": "call" }, { "api_name": "stt.stt", "line_number": 12, "usage_type": "call" } ]
626947631
import logging from datetime import datetime import tensorflow as tf import numpy as np from model import Model class Config: """Holds model hyperparams and data information. The config class is used to store various hyperparameters and dataset information parameters. Model objects are passed a Config()...
null
cam/sgnmt/RL/linearModel.org.py
linearModel.org.py
py
8,120
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 31, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 31, "usage_type": "name" }, { "api_name": "model.Model", "line_number": 35, "usage_type": "name" }, { "api_name": "tensorflow.placeh...
57843194
from keras.applications.mobilenet import MobileNet from keras.models import Model from keras.layers import BatchNormalization, Dense, Input, Flatten, Conv2D from keras.utils import plot_model def mobile_net_define(height, width, channel, alpha=0.25, weights=None): # model define # input_tensor = Input((height...
null
model/mobile_net/my_mobile_net.py
my_mobile_net.py
py
1,584
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.layers.Input", "line_number": 12, "usage_type": "call" }, { "api_name": "keras.layers.Conv2D", "line_number": 14, "usage_type": "call" }, { "api_name": "keras.layers.Conv2D", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.appl...
67209598
# uncompyle6 version 3.7.4 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /root/project/datamaestro/context.py # Compiled at: 2020-02-25 07:34:23 # Size of source mod 2**32: 12420 bytes from pathlib import Path import sys, importlib, os...
null
pycfiles/datamaestro-0.6.13-py3-none-any/context.cpython-36.py
context.cpython-36.py
py
12,106
python
en
code
null
code-starcoder2
66
[ { "api_name": "tqdm.tqdm", "line_number": 29, "usage_type": "name" }, { "api_name": "marshmallow.fields", "line_number": 53, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 57, "usage_type": "call" }, { "api_name": "marshmallow.Schema", ...
13935459
''' A schematic figure to illustrate how Pe (and F_act) sets deformability: -LJ potential -Overlay 2 Forces (Strong under week) -Corresponds to collision angle ''' import numpy as np import matplotlib.pyplot as plt import mpl_toolkits.mplot3d.axes3d as axes3d eps = 0.01 sigma = 1. def ljPotential(r, eps=0...
null
deformable_potential_figure/deformable_figure.py
deformable_figure.py
py
5,854
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.cos", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 29, "usage_type": "call" }, { "api_name": "sympy.Symbol", "line_number": ...
648598723
# -*- coding: utf-8 -*- from sklearn import cluster import csv import numpy as np ''' 题目难度聚类分析,输出八分类中心 ''' class CaseCalculator: def __init__(self, score_statistics, output): self.score_statistics = score_statistics self.output = output def __get_raw_scores(self): ''' 读取题目做题分...
null
OurModel/_3_Case_Difficulty.py
_3_Case_Difficulty.py
py
2,568
python
en
code
null
code-starcoder2
66
[ { "api_name": "csv.reader", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.average", "line_number": 40, "usage_type": "call" }, { "api_name": "sklearn.cluster.KMeans", "line_number": 60, "usage_type": "call" }, { "api_name": "sklearn.cluster", ...
503247211
from selenium import webdriver driver = webdriver.Chrome(executable_path="C:\\Users\\indrasen\\Documents\\chromedriver_win32\\chromedriver.exe") driver.get("https://the-internet.herokuapp.com/iframe") #frame id/frame name/frame index driver.switch_to.frame("mce_0_ifr") driver.find_element_by_css_selector("#tinymce").c...
null
PracticePrograms/frames.py
frames.py
py
526
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 3, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 3, "usage_type": "name" } ]
58582179
import pytest from protox_encoding import ( encode_varint, decode_varint, encode_bytes, decode_bytes, encode_zig_zag32, decode_zig_zag32, encode_zig_zag64, decode_zig_zag64, encode_header, decode_header, read_bytes, ) @pytest.mark.parametrize('value', [ 0, 1, 127, 128, 2 *...
null
tests.py
tests.py
py
1,914
python
en
code
null
code-starcoder2
66
[ { "api_name": "protox_encoding.encode_varint", "line_number": 22, "usage_type": "call" }, { "api_name": "protox_encoding.decode_varint", "line_number": 23, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 13, "usage_type": "call" }, { ...
617430915
from flask import Flask, render_template, request, jsonify from lib import chart import json app=Flask(__name__) @app.route('/', methods=['GET', 'POST']) def index(): if request.method == 'POST': return jsonify({'result': request.get_array(field_name='file')}) return render_template('index.html') @ap...
null
run.py
run.py
py
1,019
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.jsonify", ...
411664942
from django.urls import path from blog import views app_name = 'blog' urlpatterns = [ path('',views.PostListView.as_view(),name='post_list'), path('article/', views.ArticleView.as_view(), name="article"), path('newpost/', views.CreatPostView.as_view(), name="new_post"), path('post/<int:pk>/edit/', vie...
null
blog/urls.py
urls.py
py
1,180
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "blog.views.PostListView.as_view", "line_number": 7, "usage_type": "call" }, { "api_name": "blog.views.PostListView", "line_number": 7, "usage_type": "attribute" }, { "api_na...
41082687
from airflow.plugins_manager import AirflowPlugin from airflow.utils.decorators import apply_defaults from airflow.operators.sensors import BaseSensorOperator from airflow.operators.python_operator import ShortCircuitOperator from builtins import bytes from subprocess import Popen, STDOUT, PIPE from tempfile import ...
null
plugins/file_operators.py
file_operators.py
py
7,195
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "airflow.operators.sensors.BaseSensorOperator", "line_number": 28, "usage_type": "name" }, { "api_name": "airflow.utils.decorators.apply_defaults", "line_number": 31, "usage_type":...
294341394
# from django.shortcuts import render/ from django.http import HttpResponseRedirect # from django.template import loader from django.shortcuts import render, redirect from . models import Product, Cart, Item from .forms import UserRegistrationForm, FilterForm from django.contrib import messages from django.contrib.auth...
null
shop/views.py
views.py
py
3,678
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Product.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Product.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "models.Product", "line_number": 14, "usage_type": "name" }, { "api_name": ...
186478112
import pygame from pygame.locals import KEYDOWN, QUIT, MOUSEBUTTONDOWN, K_RETURN, K_ESCAPE from collections import namedtuple from heapq import heappush, heappop import time from time import sleep import sys, argparse, csv, math, random # CLASS DEFINITIONS class City: def __init__(self, name, id, pos_x, pos_y): s...
null
PVC/Exercise/RamseyerSerex.py
RamseyerSerex.py
py
11,687
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.draw.circle", "line_number": 51, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 51, "usage_type": "attribute" }, { "api_name": "pygame.display.flip", "line_number": 56, "usage_type": "call" }, { "api_name": "pygame.displa...
52167741
#!/usr/bin/env python # Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import subprocess import shutil import sys import os def MakeStamp(stamp_path): dir_name = os.path.dirname(stamp_pa...
null
sky/tools/copy_dir.py
copy_dir.py
py
820
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number...
568280899
# -*- coding: utf-8 -*- from tg import expose, url from bs.lib import base import urllib2 import urllib import tg import json class DirectController(base.BaseController): """ Display plugins operation and forms when user come directly to BioScript server """ @expose('mako:bs.templates.visual_inde...
null
bs/controllers/direct.py
direct.py
py
2,776
python
en
code
null
code-starcoder2
66
[ { "api_name": "bs.lib.base.BaseController", "line_number": 10, "usage_type": "attribute" }, { "api_name": "bs.lib.base", "line_number": 10, "usage_type": "name" }, { "api_name": "tg.config.get", "line_number": 22, "usage_type": "call" }, { "api_name": "tg.config",...
125072049
""" The FileStorage Administration view. Allows users to be given access to file storage. This is where an admin approves and organization to use the storage app. @author aevans """ import traceback from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.db ...
null
filestorage/filestorageapp/views/admin.py
admin.py
py
4,335
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.models.User.objects.filter", "line_number": 27, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 27, "usage_type": "attribute" }, { "api_name": "django.contrib.auth.models.User", "line_number": ...
43855374
# Copyright 2021 Google LLC # # 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, ...
null
gcp_doctor/queries/gce_stub.py
gce_stub.py
py
4,722
python
en
code
null
code-starcoder2
66
[ { "api_name": "pathlib.Path", "line_number": 31, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 33, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 49, "usage_type": "call" }, { "api_name": "json.load", "line_number"...
410035507
''' The output layer. ''' from abc import abstractmethod from Layer import Layer import theano import theano.tensor as T class LayerOutput(Layer): def __init__(self, input_layer, C, objective='crossentropy', enable_reparameterization_trick=False...
null
network/LayerOutput.py
LayerOutput.py
py
6,697
python
en
code
null
code-starcoder2
66
[ { "api_name": "Layer.Layer", "line_number": 11, "usage_type": "name" }, { "api_name": "theano.tensor.ivector", "line_number": 31, "usage_type": "call" }, { "api_name": "theano.tensor", "line_number": 31, "usage_type": "name" }, { "api_name": "theano.config", "...
125072607
import random import speech_recognition as sr import os from string import capwords from playsound import playsound from gtts import gTTS def speak(text): tts = gTTS(text=text, lang = 'en') fileName = "voice.mp3" tts.save(fileName) print(text) playsound(fileName) os.remove(fileName) def getA...
null
game.py
game.py
py
5,469
python
en
code
null
code-starcoder2
66
[ { "api_name": "gtts.gTTS", "line_number": 10, "usage_type": "call" }, { "api_name": "playsound.playsound", "line_number": 14, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 15, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer...
40815611
from flask import Flask, request, json, jsonify import mysql.connector #import hashlib import time #import base64 #SHA1 : The 160 bit hash function that resembles MD5 hash in working and was discontinued to be used seeing its security vulnerabilities. app = Flask(__name__, static_url_path='/static') app....
null
REST/Containers/allinone-flask - Copy.py
allinone-flask - Copy.py
py
16,589
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 14, "usage_type": "attribute" }, { "api_...
504872387
# -*- coding: utf-8 -*- """ Created on Wed Oct 11 15:12:47 2017 @author: Administrator """ from django.conf.urls import url, include from .views import OrgView,AddUserAskView from .views import TeacherListView,TeacherDetailView,AddFavView,OrgHomeView urlpatterns = [ # 课程机构列表页 url(r'^list/$',OrgView.as_v...
null
yyonline/apps/organization/urls.py
urls.py
py
981
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 15, "usage_type": "call" }, { "api_name": "views.OrgView.as_view", "line_number": 15, "usage_type": "call" }, { "api_name": "views.OrgView", "line_number": 15, "usage_type": "name" }, { "api_name": "django.conf....
53383496
import tempfile import unittest from testfixtures import compare import mock from mock import patch import yaml import json import boto.cloudformation import boto.ec2.autoscale import paramiko from bootstrap_salt import cloudformation from bootstrap_salt import ec2 from bootstrap_salt import ssh from bootstrap_salt imp...
null
tests/test.py
test.py
py
13,927
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 20, "usage_type": "attribute" }, { "api_name": "tempfile.mkdtemp", "line_number": 23, "usage_type": "call" }, { "api_name": "mock.Mock", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.join", ...
260450796
#!/usr/bin/env python3 import sys import os from binascii import unhexlify, hexlify import string from Crypto.PublicKey import RSA from hashlib import sha256 import asyncio import aiosqlite from crypto import decrypt, encrypt, sign, verify # def timeout_handler(): # print("TIMEOUT!") # os._exit(os.EX_OK) i...
null
crystore/cry_async.py
cry_async.py
py
5,074
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isfile", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "Crypto.PublicKey.RSA.importKey", "line_number": 21, "usage_type": "call" }, { "api_name": "Crypto.Pub...
176782250
""" Accelerator ----------- This module provides high-level classes to define most functionality of ``model.accelerators``. It contains entrypoint the parent `Accelerator` class as well as other support classes. """ import re from pathlib import Path from typing import List, Union, Sequence import numpy import pandas...
null
omc3/model/accelerators/accelerator.py
accelerator.py
py
13,156
python
en
code
null
code-starcoder2
66
[ { "api_name": "omc3.utils.logging_tools.get_logger", "line_number": 31, "usage_type": "call" }, { "api_name": "omc3.utils.logging_tools", "line_number": 31, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 32, "usage_type": "call" }, { "api_nam...
348334349
import pygame def drawRegularPolygon(surface, color, theta, x, y, w, h): x -= w/2 y -= h/2 hw = w/2 hh = h/2 # Rect points points = [ (-hw, -hh), (hw, -hh), (hw, hh), (-hw, hh) ] rotated_point = [pygame.math.Vector2(p).rotate(theta) for p in points] ...
null
fieldsim/Draw.py
Draw.py
py
419
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.math.Vector2", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.math", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pygame.math.Vector2", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.math"...
420175489
import datetime from unittest import mock import pytest import scoring from store import Store class TestGetStore: CONST_ARGS = ('7586', 'email@example.com') CONST_KWARGS = {'gender': 'male'} @staticmethod def get_store(return_mock_get): store = mock.create_autospec(Store) store.cac...
null
03_04_oop_tests/homework/app/tests/unit/test_scoring.py
test_scoring.py
py
2,502
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.mock.create_autospec", "line_number": 16, "usage_type": "call" }, { "api_name": "store.Store", "line_number": 16, "usage_type": "argument" }, { "api_name": "unittest.mock", "line_number": 16, "usage_type": "name" }, { "api_name": "store.cac...
224152192
import requests import json reqUrl = "http://schedulemanag-test.tclclouds.com/gate/notice/up" reqParam = "uid=92e931b1-a67b-49e4-aa20-de4c7ae1fa56" \ "&account=18575532874" \ "&account_id=6ea516ed-4886-4e8b-9f28-56602135b891" \ "&type=wechat" \ "&amounts=1" \ "&o...
null
src/main/ATEST/test/mobileTest/api4.py
api4.py
py
603
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" } ]
54667132
# -*- coding: utf-8 -*- import cv2 # 認識対象ファイルの指定 image_path = "hoge.JPG" # 認識対象ファイルの読み込み image = cv2.imread(image_path) # グレースケールに変換 image_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # 顔認識用特徴量のファイル指定 cascade_path = "haarcascade_frontalface_alt.xml" # カスケード分類器の特徴量を取得する cascade = cv2.CascadeClassifier(cascade_path...
null
face_recognaize.py
face_recognaize.py
py
1,236
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.CascadeClassifier"...
633961405
import pandas as pd from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from sklearn import linear_model from sklearn.preprocessing import StandardScaler data = pd.read_csv('Social_Network_Ads.csv') df = data df.head() print(df.head()) df.info() data = df.drop(colu...
null
MLPython/TrainingDicoding/venv/bin/supervised/regression/logistic_regression/codelab_logistic_regression.py
codelab_logistic_regression.py
py
853
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.get_dummies", "line_number": 18, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 25, "usage_type": "call" }, { "api_name":...
361452877
#%% """ Draw graphs for the Toblerone paper from the simulated cortical surface dataset """ import scipy.io as sio import numpy as np import matplotlib.pyplot as plt import os import os.path as op savekws = {'dpi': 400, 'bbox_inches': 'tight'} cmap = np.array(plt.get_cmap('tab10').colors) #%% Load in the data, ...
null
sim_surfaces/sim_analysis.py
sim_analysis.py
py
3,544
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.get_cmap", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "scipy.io.loa...
494189913
from netmiko import ConnectHandler import time # http://ktbyers.github.io/netmiko/COMMON_ISSUES.html import logging logging.basicConfig(filename='test.log', level=logging.DEBUG) logger = logging.getLogger("netmiko") cisco_device = { 'device_type': 'cisco_ios', 'host': '10.1.1.10', 'username': 'u...
null
nemiko_troubleshooting.py
nemiko_troubleshooting.py
py
798
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 6, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "netmiko.Connect...
647332673
import torch import torch.nn.functional as F class CNNMNIST(torch.nn.Module): """ Train a CNN with: conv - maxpool - conv - maxpool - fc + relu - fc Reference: https://github.com/pytorch/examples/blob/master/mnist/main.py """ def __init__(self): super(CNNMNIST, self).__init__() # i...
null
hw2/.ipynb_checkpoints/cnnMNIST-checkpoint.py
cnnMNIST-checkpoint.py
py
988
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn.Conv2d", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn.MaxPool2d", "...
40085741
import requests import uuid import json api_endpoint = "https://graph.microsoft.com/v1.0/" def api_call(method, end_point_url, token, user_mail, payload=None, parameters=None): req_id = str(uuid.uuid4()) headers = { 'User-Agent': 'python_tutorial/1.0', 'Authorization': 'Bearer {0}'.format(token), 'Accept': 'a...
null
tutorial/outlookhelper.py
outlookhelper.py
py
1,927
python
en
code
null
code-starcoder2
66
[ { "api_name": "uuid.uuid4", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.delete", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.patch", "line_num...
569637224
import numpy as np import math import matplotlib.pyplot as plt N = 100 # number of samples a = 0.1 # acceleration sigmaPsi = 1 # model error variance sigmaEta = 50 # sensor error variance x, z = np.zeros(N), np.zeros(N) z[0] = x[0] + np.random.normal(0, sigmaEta) for t in range(N - 1): x[t + 1] ...
null
lectures/lec 04. Data filtering/practice/kalman1d.py
kalman1d.py
py
1,171
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.random.normal"...
225657142
from django import forms from django.core.exceptions import ValidationError from django.contrib.auth import get_user_model from topic.models import TopicCategory User = get_user_model() def user_validate(username): if not User.objects.filter(username=username).first(): raise ValidationError('用户不存在...
null
topic/forms.py
forms.py
py
1,596
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 5, "usage_type": "call" }, { "api_name": "django.core.exceptions.ValidationError", "line_number": 10, "usage_type": "call" }, { "api_name": "topic.models.TopicCategory.objects.filter", "line_number": 14, "...
435106559
import webapp2 import playGame import scoreBase import jinja2 import os from google.appengine.api import users #Citation: Google App Engine Python Tutorial regarding Jinja JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=['jinja2.ext.autoescape'], ...
null
mainMenu.py
mainMenu.py
py
1,649
python
en
code
null
code-starcoder2
66
[ { "api_name": "jinja2.Environment", "line_number": 10, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", ...
151833185
# Copyright 2019 The Cirq Developers # # 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 ...
null
cirq/experiments/fidelity_estimation.py
fidelity_estimation.py
py
16,621
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Sequence", "line_number": 27, "usage_type": "name" }, { "api_name": "numpy.mean", "line_number": 64, "usage_type": "call" }, { "api_name": "typing.Sequence", "line_number": 69, "usage_type": "name" }, { "api_name": "numpy.log", "line_numb...
85249757
import datetime as dt from utils.algorithm.fama.encap import attribution_pri def main(): args = ( (dt.date(2018, 2, 28), "d", "JR000063"), (dt.date(2018, 3, 15), "w", "JR000063"), # 基金数据不足的test case (dt.date(2018, 4, 1), "w", "JR000063"), ) apis = (attribution_pri.FamaThreeAttr, a...
null
testing/utiltest/algorithm/perf/test_20180607/test_attribution.py
test_attribution.py
py
769
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.date", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 9, "usage_type": "call" }, { "api_name": "utils.algorithm.fama.encap.att...
497135420
import mysql.connector import datetime connection = mysql.connector.connect(host="localhost", user="root", passwd="Gautam@4424", database="atm") cur = connection.cursor() date_time=datetime.datetime.now() def withdrawl(): code = int(input("Enter your secret code")) cur.execute("SELECT * FROM Balance WH...
null
withdral.py
withdral.py
py
2,255
python
en
code
null
code-starcoder2
66
[ { "api_name": "mysql.connector.connector.connect", "line_number": 3, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 3, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 3, "usage_type": "name" }, { "api...
360073094
"""Show dependencies CCP command. This module provides logic for execution 'show-dep' command. This command returns a set of dependencies for specified CCP components. Usage: ccp --config-file=<path_to_config> show-dep <component1> <component2> ... Example: The following example command will return set of de...
null
fuel_ccp/dependencies.py
dependencies.py
py
2,075
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "fuel_ccp.common.utils.get_deploy_components_info", "line_number": 36, "usage_type": "call" }, { "api_name": "fuel_ccp.common.utils", "line_number": 36, "usage_type": "name" }, ...
360703632
#!/usr/bin/env python from __future__ import print_function import os from .bash import bash from .requires import requires_program,requires_version @requires_program('git') @requires_version('git>=2') def sync(**kwargs): """ Ensure modules are fresh. """ modules = kwargs.pop('modules',{}) current = kwargs.pop('...
null
ortho/modules.py
modules.py
py
1,611
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isdir", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "bash.bash", "line_number": 27, "usage_type": "call" }, { "api_name": "bash.bash", "line_number": 3...
552723996
import pytest from flask import render_template_string from udata.core.dataset.factories import DatasetFactory, ResourceFactory import udata_schema_gouvfr.views as schema_views def render_resource_card(resource): return render_template_string( '{{ hook("dataset.resource.card.extra-buttons") }}', ...
null
tests/test_views.py
test_views.py
py
2,447
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.render_template_string", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_template_string", "line_number": 18, "usage_type": "call" }, { "api_name": "udata_schema_gouvfr.views.blueprint", "line_number": 23, "usage_type": "attribu...
162915777
import json import os from threading import Lock from uuid import uuid4 from flask import request, abort, Response, send_file, session import common as oddb import captcha from callbacks import PostCrawlCallbackFactory from database import Task, Website from search.search import InvalidQueryException from tasks impor...
null
api.py
api.py
py
9,036
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Lock", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.form.get", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 21, "usage_type": "attribute" }, { "api_name": "flask.r...
33648962
import sys from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Activation, normalization, Dropout from keras.layers.pooling import MaxPooling1D from keras.layers.core import Flatten, Reshape from keras.layers.recurrent import LSTM from keras.layers.convolutional import ...
null
tester.py
tester.py
py
1,871
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.datasets.mnist.load_data", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.datasets.mnist", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.random.seed", "line_number": 18, "usage_type": "call" }, { "api_name": ...
94738072
# -*- coding:utf-8 -*- from sqlalchemy import Column, String, create_engine, ForeignKey, Table, MetaData from sqlalchemy.orm import sessionmaker, relationship from sqlalchemy.ext.declarative import declarative_base # 创建对象的基类 Base = declarative_base() # 定义User对象: class User(Base): # 表的名字: __tablename__ = 'use...
null
my_sqlalchemy.py
my_sqlalchemy.py
py
1,721
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 8, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlalchemy.String", "line_number": 16, "usage_type": "call" }, { "ap...
503500975
from django.shortcuts import render, redirect, get_object_or_404 from django.views.decorators.csrf import csrf_protect from django.contrib.auth import * from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from django.contrib.auth.models imp...
null
user/views.py
views.py
py
13,090
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.auth.authenticate", "line_number": 41, "usage_type": "call" }, { "api_name": "django.contrib.auth.login", "line_number": 46, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 47, "usage_type": "call" }, { ...
486536278
import logging import os from slack_bolt import App from slack_bolt.oauth.oauth_settings import OAuthSettings from app.database import ( oauth_state_store, installation_store, ) logger = logging.getLogger(__name__) logging.getLogger("sqlalchemy.engine").setLevel(logging.DEBUG) user_token = os.environ.get("S...
null
app/app_oauth.py
app_oauth.py
py
815
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.environ.get...
194752415
# -*- coding: utf-8 -*- from kafka import KafkaProducer from time import sleep import json, sys import requests import time import tweepy import sys import apiKeys def publish_message(producer_instance, topic_name, value): try: key_bytes = bytes('foo', encoding='utf-8') value_bytes =...
null
tweet_producer.py
tweet_producer.py
py
3,132
python
en
code
null
code-starcoder2
66
[ { "api_name": "kafka.KafkaProducer", "line_number": 27, "usage_type": "call" }, { "api_name": "tweepy.StreamListener", "line_number": 35, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 49, "usage_type": "call" }, { "api_name": "sys.stderr"...
391945070
from django.db import transaction from giantsapp.models import Apply, Personaje, Hermandad, Evento, Subscripcion __author__ = 'Ruben' class SubscripcionServicio: @staticmethod def create(personajeId, eventId, jugador): pj = Personaje.objects.filter(id = personajeId)[0] pjs = Personaje.objects....
null
giants/giantsapp/services/SubscripcionServicio.py
SubscripcionServicio.py
py
818
python
en
code
null
code-starcoder2
66
[ { "api_name": "giantsapp.models.Personaje.objects.filter", "line_number": 9, "usage_type": "call" }, { "api_name": "giantsapp.models.Personaje.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "giantsapp.models.Personaje", "line_number": 9, "usage_typ...
465994604
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import datetime, os, paramiko, json import os import time import json from collections import MutableMapping #from texttable import Texttable from ansible.module_utils._text import to_bytes from ansible.plugins.callback import Call...
null
callback_plugins/show_re_switchover_summary.py
show_re_switchover_summary.py
py
5,391
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.setdefaultencoding", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.getcwd", ...
135503748
from flask import Flask, request, jsonify, abort from flask_cors import CORS from werkzeug.utils import secure_filename import time import numpy import os #Code to import EmailFilter class import sys module_path = os.path.join(os.path.expanduser("~"), "ShellPrivacyFilterDemo", "backend") sys.path.append(module_path) f...
null
backend/api/api.py
api.py
py
2,412
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path.append", "l...
92980700
""" This script consumes data from Wikipedia and a Google RSS feed. Then it fills a template with that data and updates a Reddit submission. """ import xml.etree.ElementTree as ET from datetime import datetime import praw import requests from bs4 import BeautifulSoup import config HEADERS = { "User-Agent": "Moz...
null
coronabot/bot.py
bot.py
py
8,255
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 29, "usage_type": "name" }, { "api_name": "praw.Reddit", "line_number": 37, "usage_type": "call" }, { "api_name": "config.APP_ID", ...
254436972
from Crypto import Random from Crypto.Cipher import AES from Crypto.Util import Counter from Crypto.Util.Padding import pad, unpad import os import time def onekb(): s = time.clock() key = os.urandom(16) print((time.clock()-s)*10**6) def enckb(ip, key ,key_size=128): ip = ip + b"\0" * (AES.block_si...
null
b/hw31b.py
hw31b.py
py
2,063
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.clock", "line_number": 9, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 10, "usage_type": "call" }, { "api_name": "time.clock", "line_number": 11, "usage_type": "call" }, { "api_name": "Crypto.Cipher.AES.block_size", "l...
549946998
import glob import logging import os import shutil import subprocess import sys import tempfile import time import unittest TEST_ROOT = os.path.abspath(os.path.dirname(__file__)) TEST_PROJECTS = os.path.join(TEST_ROOT, "test_projects") MAKEENV_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(TEST_ROOT))) log ...
null
makeenv/test/cases.py
cases.py
py
6,644
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line...
100201337
from django.conf.urls import url #app_name = 'bu_app' from .bu_app_views.course import AllCoursesList, CreateCourse, CourseView, EditSection, deleteSection, \ custom_login, logout_view from .bu_app_views.learningplan import my_learning_plan, browse_all_learning_plans,\ CreateLearningPlan, get_the_lea...
null
bu/bu_app/urls.py
urls.py
py
2,140
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 18, "usage_type": "call" }, { "api_name": "bu_app_views.course.custom_login", "line_number": 18, "usage_type": "argument" }, { "api_name": "django.conf.urls.url", "line_number": 19, "usage_type": "call" }, { "ap...
12834391
#!/usr/bin/env python """ Script for determining activity levels of a repo Going through the last years of commits for the last active week And barring that reporting the github updated_at which might be much earlier than a year. And finally created_at so we know who old things are. Used to help determination for arc...
null
repo_activity.py
repo_activity.py
py
8,603
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.stderr.write", "line_number": 42, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 42, "usage_type": "attribute" }, { "api_name": "sys.stderr.flush", "line_number": 43, "usage_type": "call" }, { "api_name": "sys.stderr", "l...
375572130
import os from decimal import Decimal, getcontext, ROUND_UP from typing import List from celery import Celery from celery.utils.log import get_task_logger import requests from backend.apps.exchange import CurrencyDatabase celery = Celery() log = get_task_logger(__name__) getcontext().prec = 2 getcontext().rounding...
null
backend/apps/tasks.py
tasks.py
py
2,090
python
en
code
null
code-starcoder2
66
[ { "api_name": "celery.Celery", "line_number": 12, "usage_type": "call" }, { "api_name": "celery.utils.log.get_task_logger", "line_number": 13, "usage_type": "call" }, { "api_name": "decimal.getcontext", "line_number": 15, "usage_type": "call" }, { "api_name": "dec...
470763003
import dash_core_components as dcc import dash_html_components as html import dash_table as dt import json import numpy as np import plotly from dash.dependencies import Input, Output, State import itertools import seaborn as sns import plotly.graph_objs as go from copy import deepcopy import subprocess import pandas...
null
apps/app_interactive_genomes.py
app_interactive_genomes.py
py
10,586
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "myscripts.neighbourhood_reshape.neighbourhood_reshape", "line_number": 33, "usage_type": "call" }, { ...
92357281
""" Base view """ import uuid import base64 from ..views import DEFAULT_LIBRARY_NAME_PREFIX, DEFAULT_LIBRARY_DESCRIPTION, \ USER_ID_KEYWORD from flask import request, current_app from flask_restful import Resource from ..models import User, Library, Permissions from ..client import client from sqlalchemy.exc impor...
null
biblib/views/base_view.py
base_view.py
py
10,592
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask_restful.Resource", "line_number": 17, "usage_type": "name" }, { "api_name": "base64.urlsafe_b64encode", "line_number": 36, "usage_type": "call" }, { "api_name": "flask.current_app.logger.info", "line_number": 38, "usage_type": "call" }, { "api...
195157807
import pygame import time import random pygame.init() displayWidth = 1280 displayHeight = 720 gridWidth = 5 gridHeight = 5 gridMargin = 1 black = (0,0,0) white = (255,255,255) red = (200,0,0) green = (0,200,0) brightRed = (255,0,0) brightGreen = (0,255,0) gameDisplay = pygame.display.set_mode((...
null
conway.py
conway.py
py
5,809
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pygame.display...
356732118
import tensorflow as tf import numpy as np,os,dicom,sys from scipy import misc import dicom import matplotlib.pyplot as plt from skimage.measure import compare_psnr from skimage.restoration import (denoise_tv_chambolle, denoise_bilateral, denoise_wavelet, estimate_sigma) import shutil n...
null
l_Super_Resolution_DICOM/b2.py
b2.py
py
9,993
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 10, "usage_type": "attribute" }, { "api_name": "tensorflow.set_random_seed", "line_number": 11, "usage_type": "call" }, { "api_name": "tensor...
621033102
# -*- coding: utf-8 -*- """ Created on Mon Nov 11 19:06:16 2019 @author: PWL """ # Importing the libraries import pandas as pd import matplotlib.pyplot as plt import numpy as np #Importing the dataset dataset = pd.read_csv('Position_Salaries.csv') X = dataset.iloc[:, 1:2].values y = dataset.iloc[:, 2].v...
null
Python/Regression/Polynomial_Regression/polynomial_regression.py
polynomial_regression.py
py
1,060
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.PolynomialFeatures", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 28, "usage_type": "call" }, { "api_name": ...
551517765
from django.shortcuts import render from django.http.response import JsonResponse from rest_framework.parsers import JSONParser from rest_framework import status from stopwatchr.models import users, stocks from stopwatchr.serializers import UsersSerializer, StocksSerializer from rest_framework.decorators import api...
null
stopwatchr/views.py
views.py
py
4,478
python
en
code
null
code-starcoder2
66
[ { "api_name": "stopwatchr.models", "line_number": 15, "usage_type": "name" }, { "api_name": "stopwatchr.models.users.objects.all", "line_number": 15, "usage_type": "call" }, { "api_name": "stopwatchr.models.users.objects", "line_number": 15, "usage_type": "attribute" },...
404983798
import seaborn as sns import matplotlib as mpl import numpy as np ## Allows for easy text manipulation in illustrator by changing this mpl.rcParams['pdf.fonttype'] = 42 import matplotlib.pyplot as plt import pandas as pd font = {'family' : 'Arial', 'weight' : 'bold', 'size' : 14} mpl.rc('font',**font)...
null
Seaborn_Graphing/DCG_Utilities.py
DCG_Utilities.py
py
840
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.rcParams", "line_number": 5, "usage_type": "attribute" }, { "api_name": "matplotlib.rc", "line_number": 13, "usage_type": "call" } ]
79395870
#!/usr/bin/env python3 import os import sys import argparse from PyQt4 import QtGui sys.path.append(os.path.join(os.path.dirname(__file__),'lib')) from pygui.main_window import MainWindow def get_program_arguments(): parser = argparse.ArgumentParser() parser.add_argument("--seed", type=int,help="Pseudo-ran...
null
rungui.py
rungui.py
py
648
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
253457025
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('industrias', '0001_initial'), ] operations = [ migrations.CreateModel( name='Grupo', fields=[ ...
null
produtos/migrations/0001_initial.py
0001_initial.py
py
3,059
python
en
code
null
code-starcoder2
66
[ { "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.CreateModel", "line_number": 14, "usage_type": "call" }, ...
371860530
import streamlit as st import tensorflow as tf import os from tensorflow.keras.preprocessing.image import ImageDataGenerator from sklearn.metrics import accuracy_score import wget import zipfile class_names = ["COVID-19", "Normal", "Pneumonia"] @st.cache(suppress_st_warning=True) def predict(model_path): tes...
null
app.py
app.py
py
2,318
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.keras.preprocessing.image.ImageDataGenerator", "line_number": 14, "usage_type": "call" }, { "api_name": "tensorflow.keras.models.load_model", "line_number": 45, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 45, "usage_t...
294223868
import uuid import time import requests from decimal import * class Client(object): def __init__(self, url, public_key, secret): self.url = url + "/api/2" self.session = requests.session() self.session.auth = (public_key, secret) def get_symbol(self, symbol_code): """Get symb...
null
test/hitbtc.py
hitbtc.py
py
9,431
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.session", "line_number": 11, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 86, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 129, "usage_type": "call" }, { "api_name": "time.sleep", "line_number...
247697434
from django.conf.urls import url from . import views from rest_framework.urlpatterns import format_suffix_patterns urlpatterns = [ url(r'^mywall/$', views.WallList.as_view(), name='wall'), url(r'^fellowship/(?P<action>[a-zA-Z]+)/(?P<username>[a-zA-Z]+)/$', views.FollowingApi.as_view(), name='following'), url(r'^fav...
null
api/urls.py
urls.py
py
1,909
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.co...
178431284
import sys import pandas as pd from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): """ Loading messages and categories from `.csv`-files. Args: messages_filepath: path to `.csv`-file of messages categories_filepath: path to `.csv`-file of categories...
null
process_data.py
process_data.py
py
3,419
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.merge", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.merge", "line...
370378712
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 处理文件 """ import os,sys import hashlib import requests class DownloadFile(object): def __init__(self, config): if 'app_dir' in config: sel.app_dir = config['app_dir'] else: self.app_dir = 'joke' if 'res' in ...
null
joke/spider/file.py
file.py
py
1,529
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.path.basename", "li...
106543520
# --- # jupyter: # jupytext: # formats: py:light,ipynb # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.10.3 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # CSV # # Reading, wri...
null
io/pand.py
pand.py
py
5,170
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.show", "line_number": 115, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 115, "usage_type": "name" }, { "api_name": "matplotlib...
577293707
#--- ---------------------------------------------------------------------------- # Name: server # Purpose: # # Author: achamara # # Created: 09/01/2013 # Copyright: (c) achamara 2013 # Licence: <your licence> #------------------------------------------------------------------------------- #!/usr/...
null
server.py
server.py
py
1,058
python
en
code
null
code-starcoder2
66
[ { "api_name": "http.server.SimpleHTTPRequestHandler", "line_number": 16, "usage_type": "name" }, { "api_name": "http.server.HTTPServer", "line_number": 17, "usage_type": "name" }, { "api_name": "http.server.HTTPServer", "line_number": 23, "usage_type": "name" }, { ...
165121445
#!/usr/bin/env python3 import asyncio async def worker(lock): async with lock: print("Successfully acquired the lock") await asyncio.sleep(3) print("Releasing lock") async def main(): lock = asyncio.Lock() tasks = [worker(lock) for _ in range(12)] await asyncio.gather(*(tasks)...
null
Python Tests/asyncio/asyncio_lock.py
asyncio_lock.py
py
371
python
en
code
null
code-starcoder2
66
[ { "api_name": "asyncio.sleep", "line_number": 8, "usage_type": "call" }, { "api_name": "asyncio.Lock", "line_number": 12, "usage_type": "call" }, { "api_name": "asyncio.gather", "line_number": 14, "usage_type": "call" }, { "api_name": "asyncio.run", "line_numb...
22911704
import os import sys import itertools dry_run = '--dry-run' in sys.argv clear = '--clear' in sys.argv local = False #'--local' in sys.argv double_book = False #'--double-book' in sys.argv if not os.path.exists("slurm_logs"): os.makedirs("slurm_logs") if not os.path.exists("slurm_scripts"): os.makedirs("slurm_...
null
runner_pixels.py
runner_pixels.py
py
6,604
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
550263535
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('registrar', '0001_initial'), ] operations = [ migrations.CreateModel( name='Student', fields=[ ...
null
PycharmProjects/reg/reg/registrar/migrations/0002_student.py
0002_student.py
py
766
python
en
code
null
code-starcoder2
66
[ { "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.CreateModel", "line_number": 14, "usage_type": "call" }, ...
69170844
import cv2 import numpy as np from hdr_enhance.wls_filter import wlsFilter from hdr_enhance.srs import SRS from hdr_enhance.virtual_ev import VIG from hdr_enhance.tonemap import tonemap from hdr_enhance.anisotropic import anisodiff class FakeHDR: def __init__(self, flag): self.weighted_fusion = flag ...
null
test/hdr_saved___REPLACE.py
hdr_saved___REPLACE.py
py
2,346
python
en
code
null
code-starcoder2
66
[ { "api_name": "hdr_enhance.wls_filter.wlsFilter", "line_number": 14, "usage_type": "name" }, { "api_name": "hdr_enhance.srs.SRS", "line_number": 15, "usage_type": "name" }, { "api_name": "hdr_enhance.virtual_ev.VIG", "line_number": 16, "usage_type": "name" }, { "a...
561111778
# coding=utf-8 # Copyright 2018 The TF-Agents 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 applicable law...
null
tf_agents/bandits/policies/linear_thompson_sampling_policy.py
linear_thompson_sampling_policy.py
py
6,099
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow_probability.distributions", "line_number": 30, "usage_type": "attribute" }, { "api_name": "tensorflow.transpose", "line_number": 39, "usage_type": "call" }, { "api_name": "tf_agents.bandits.policies.linalg.conjugate_gradient_solve", "line_number": 40...
369901535
import os import imageio import numpy as np from PIL import Image import PIL.ImageDraw as ImageDraw # import matplotlib.pyplot as plt def image_with_episode_number(frame, episode_num=None, step_num=None): im = Image.fromarray(frame) drawer = ImageDraw.Draw(im) if np.mean(im) < 128: text_colo...
null
scripts/gym_env/box2d/utils.py
utils.py
py
1,126
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.Image.fromarray", "line_number": 10, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 10, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", ...
154098118
import json from stellar_base.address import * from stellar_base.builder import Builder from wrapper.client import Client def op(source, destination, amount): builder = Builder(secret=source) builder.append_payment_op(destination=destination,amount=amount) builder.sign() builder.submit() # master ...
null
unit_tests/test_generate_key_pairs.py
test_generate_key_pairs.py
py
1,849
python
en
code
null
code-starcoder2
66
[ { "api_name": "stellar_base.builder.Builder", "line_number": 10, "usage_type": "call" }, { "api_name": "wrapper.client.Client", "line_number": 20, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 41, "usage_type": "call" } ]
556490194
# coding: utf-8 # In[1]: import pandas as pd import numpy as np import csv import matplotlib.pyplot as plt from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import ExtraTreesClassifier from sklearn import ensemble # In[2]: "Loading train.csv file" print('Loading data from train.csv file...') #...
null
scripts/ali/ali04_empty_fill_option1_decisiontree/ali04_decisiontree.py
ali04_decisiontree.py
py
2,557
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.factorize", "line_number": 55, "usage_type": "call" }, { "api_name": "sklearn.ensemble.Ext...
121464113
from sqlalchemy import Column, DateTime, Numeric, String import sqlalchemy import sqlalchemy.ext.hybrid import pyrob.table from lxml import etree import logging from datetime import datetime log = logging.getLogger(__name__) class MibLabel(pyrob.table.Common, pyrob.table.Base): __tablename__ = 'T_NW_EQUIP_DWDM_MI...
null
pyrob/schema/ipact_stg/dwdm/mib_label.py
mib_label.py
py
2,644
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "pyrob.table.table", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pyrob.table", "line_number": 11, "usage_type": "name" }, { "api_name": "sqlalchemy.Column...