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
497359560
from flata import Flata from flata.storages import JSONStorage import json def read_json(path_db, table_name): ''' :param path_db: json文件路径 :return: ''' try: db = Flata(path_db, storage=JSONStorage) tb = db.table(table_name) dic = tb.all() except Exception as e: ...
null
app/libs/get_data.py
get_data.py
py
768
python
en
code
null
code-starcoder2
76
[ { "api_name": "flata.Flata", "line_number": 12, "usage_type": "call" }, { "api_name": "flata.storages.JSONStorage", "line_number": 12, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 19, "usage_type": "call" } ]
594117166
import urllib2 import json import math class AudioQuery(object): POPUP_ARCHIVE_SEARCH_URL = "https://www.popuparchive.com:443/api/search?query=" ##Initialize a class the performs initial search of the pop archive def __init__(self, q, collection_id): ## generate search url from query input "q" and ...
null
audio_query.py
audio_query.py
py
1,822
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib2.urlopen", "line_number": 16, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib2.urlopen", "line_numb...
502818183
''' 用ResNet50从头开始训练 ''' #!/usr/bin/env python # -*- coding: UTF-8 -*- import cv2 import numpy as np import h5py import os from keras.utils import np_utils, conv_utils from keras.utils.generic_utils import unpack_singleton from keras.models import Model #from keras.layers import Flatten, Dense, Input from keras.optim...
null
painter3.py
painter3.py
py
14,720
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.layers.Conv2D", "line_number": 41, "usage_type": "call" }, { "api_name": "keras.layers.BatchNormalization", "line_number": 42, "usage_type": "call" }, { "api_name": "keras.layers.add", "line_number": 50, "usage_type": "call" }, { "api_name": "...
624119022
import scrapy from scrapy import Request import reader import writer from report_structure import FilesloopReportRow if __name__ == "__main__": print("file is meant for import.") exit() class RapidsearchengineCyberlockerSpider(scrapy.Spider): __domain = "rapid-search-engine.com" __protocol = "https"...
null
submodules/rapidsearchengine/rapidsearchengine_cyberlocker.py
rapidsearchengine_cyberlocker.py
py
2,125
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 13, "usage_type": "attribute" }, { "api_name": "reader.read", "line_number": 34, "usage_type": "call" }, { "api_name": "report_structure.FilesloopReportRow", "line_number": 39, "usage_type": "call" }, { "api_name": "sc...
217544330
##encoding=utf8 import requests from bs4 import BeautifulSoup import socket import json User_Agent = 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0' header = {'User-Agent': User_Agent} ''' 获取所有代理IP地址 ''' class ProxyGet: def __init__(self): self.proxys = self.validateIp(self.ge...
null
fetchs/get_proxy.py
get_proxy.py
py
2,077
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 27, "usage_type": "call" }, { "api_name": "socket.setdefaulttimeout", "line_number": 45, "usage_type": "call" }, { "api_name": "requests.get"...
646261683
import retro import numpy as np import cv2 import neat import pickle import math env = retro.make(game='SuperMarioWorld-Snes',state='YoshiIsland3.state') #actionVariable= env.action_space.sample() #resX, resY, resC = env.observation_space.shape #print(env.observation_space.shape) def evaluateGenome(genomes, confi...
null
Controler/height.py
height.py
py
4,070
python
en
code
null
code-starcoder2
76
[ { "api_name": "retro.make", "line_number": 8, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 28, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 29, "usage_type": "call" }, { "api_name": "neat.nn.recurrent.RecurrentNetwork.cr...
608039183
import numpy as np from numpy import concatenate as cat from scipy.linalg import toeplitz from scipy.sparse import csr_matrix from matlab_functions import row_ismember, interp1 from SurfStatEdg import py_SurfStatEdg def pacos(x): return np.arccos( np.minimum(np.abs(x),1) * np.sign(x) ) def py_SurfStatResels(slm,...
null
surfstat/python/SurfStatResels.py
SurfStatResels.py
py
19,181
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.arccos", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.minimum", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.sign", "line_number": 9, ...
421078056
import matplotlib.pyplot as plt import oandapyV20 import pandas as pd from oandapyV20.contrib.factories import InstrumentsCandlesFactory from myauth import myauth accountID, access_token = myauth.myAuth() client = oandapyV20.API(access_token=access_token) instrument = "EUR_USD" params = { 'from': '2019-01-13T22:00...
null
myfile.py
myfile.py
py
2,237
python
en
code
null
code-starcoder2
76
[ { "api_name": "myauth.myauth.myAuth", "line_number": 7, "usage_type": "call" }, { "api_name": "myauth.myauth", "line_number": 7, "usage_type": "name" }, { "api_name": "oandapyV20.API", "line_number": 8, "usage_type": "call" }, { "api_name": "oandapyV20.contrib.fac...
588472818
import unittest from igv_reports import vcf import pathlib class VcfTest(unittest.TestCase): def test_getvariants(self): path = str((pathlib.Path(__file__).parent / "data/minigenome/variants.vcf").resolve()) data = vcf.get_data(path) self.assertIsNotNone(data) def test_getvariants_...
null
test/test_vcf.py
test_vcf.py
py
568
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "igv_reports.vcf.get_data", "line_number": 11, "usage_type": "call" }, { "api_name": "igv_repor...
10571813
import xml.etree.ElementTree from io import BytesIO from fHDHR.tools import sub_el class Lineup_XML(): device_xml = None def __init__(self, settings, device): self.config = settings self.device = device def get_lineup_xml(self, base_url, force_update=False): if not self.device_x...
null
fHDHR/api/hub/files/lineup_xml.py
lineup_xml.py
py
1,062
python
en
code
null
code-starcoder2
76
[ { "api_name": "xml.etree.ElementTree.etree.ElementTree.Element", "line_number": 16, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.etree", "line_number": 16, "usage_type": "attribute" }, { "api_name": "xml.etree.ElementTree", "line_number": 16, "usage_type":...
20797425
import numpy as np import data np.set_printoptions(threshold=np.inf) def Run(player): data.LoadData() gucci = data.VerifyPlayer(player) if not gucci: return [["Invalid", 0]] result = data.GetData(player) #print(result) players = result[0][1:] matrix = result[1] prelimWeights = [] ...
null
src/model/engine.py
engine.py
py
1,414
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.set_printoptions", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 4, "usage_type": "attribute" }, { "api_name": "data.LoadData", "line_number": 8, "usage_type": "call" }, { "api_name": "data.VerifyPlayer", ...
39635806
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
null
All_In_One/addons/fbx_preflight/__init__.py
__init__.py
py
3,278
python
en
code
null
code-starcoder2
76
[ { "api_name": "ui.ExportObjectUIList", "line_number": 62, "usage_type": "name" }, { "api_name": "operators.MigratePreflightGroups", "line_number": 63, "usage_type": "name" }, { "api_name": "operators.AddSelectionToPreflightGroup", "line_number": 64, "usage_type": "name" ...
13106181
import matplotlib.pyplot as plt import matplotlib.ticker as ticker import pandas as pd import numpy as np import durationpy import math from os.path import join from adjustText import adjust_text IMG_OUTPUT_DIR = "../charts/" COLORS_DEFAULT = {'blue': '#348ABD', 'red': '#E24A33'} plt.style.use('ggplot') plt.rcParams...
null
scripts/plot_util.py
plot_util.py
py
20,915
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 14, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 14, "usage_type": "name" }, { "api_na...
219801770
import socket, threading, time import cv2 import numpy as np import sys import math import pyaudio import wave from PyQt5.QtCore import pyqtSignal, QObject from PyQt5.QtWidgets import QMainWindow, QApplication, QLabel from PyQt5.QtGui import QPixmap, QImage class CommunicateSignal(QObject): new_message = pyqtSigna...
null
VideoClient.py
VideoClient.py
py
4,693
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtCore.QObject", "line_number": 15, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 16, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 18, "usage_type": "name" }, { "api_name...
514633408
from flask import Flask, render_template, session, url_for, request, redirect import urllib.request, json app = Flask(__name__) class API: def __init__(self,url): self.url = url self.data = json.loads(urllib.request.urlopen(url).read()) @app.route("/") def root(): to_display = list() # list of...
null
25_restrio/app.py
app.py
py
1,078
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 8, "usage_type": "call" }, { "api_name": "urllib.request.request.urlopen", "line_number": 8, "usage_type": "call" }, { "api_name": "urllib.request.req...
250220599
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Project Euler Problem 199 ======================= Three circles of equal radius are placed inside a larger circle such that each pair of circles is tangent to one another and the inner circles do not overlap. There are four uncovered "gaps" which are to be filled itera...
null
project-euler/solvers/euler199.py
euler199.py
py
1,428
python
en
code
null
code-starcoder2
76
[ { "api_name": "ntpath.basename", "line_number": 33, "usage_type": "call" }, { "api_name": "time.time", "line_number": 36, "usage_type": "call" }, { "api_name": "time.time", "line_number": 38, "usage_type": "call" }, { "api_name": "common.shared_functions.verify_so...
58444491
def normalize(df): result = df.copy() for feature_name in df.columns: max_value = df[feature_name].max() min_value = df[feature_name].min() result[feature_name] = (df[feature_name] - min_value) / (max_value - min_value) return result import pandas as pd import numpy as np from sknn....
null
NeuralNet_Script.py
NeuralNet_Script.py
py
1,928
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.unique", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.get_dummies", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.cross_valida...
221574706
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals # Python standard library imports import json import operator import importlib import argparse # Third party imports # non...
null
code/json2osi/json2osi.py
json2osi.py
py
5,725
python
en
code
null
code-starcoder2
76
[ { "api_name": "importlib.import_module", "line_number": 38, "usage_type": "call" }, { "api_name": "operator.attrgetter", "line_number": 39, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 100, "usage_type": "call" }, { "api_name": "...
532010939
'documented SB 12/2/17/' import numpy as np import pyproj import pandas as pd def FRF2ncsp(xFRF, yFRF): """this function makes NC stateplane out of X and Y FRF coordinates, based on kent Hathaway's code, bill birkmeir's calculations . written by Kent Hathaway. 15 Dec 2014 Translated from Matlab to...
null
geoprocess.py
geoprocess.py
py
16,899
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.pi", "line_number": 52, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 60, "usage_type": "call" }, { "api_name": "numpy.arctan2", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number":...
228351801
#!/usr/bin/env python # -*- coding: utf-8 -*- """This import is obligatory for the good of the system Lib imports, they are important to help Django a have all tools for a good use Imports of files, they are important for this view file because it gives access to forms and templates Imports of Django lib, is a base fo...
null
users/views.py
views.py
py
6,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "forms.UserCreationForm", "line_number": 30, "usage_type": "call" }, { "api_name": "forms.ParagraphErrorList", "line_number": 30, "usage_type": "name" }, { "api_name": "django.contrib.auth.login", "line_number": 34, "usage_type": "call" }, { "api_nam...
6350640
import matplotlib.pyplot as plt from pf.world import landmarks, world_size from math import sin, cos def visualization(robot, step, p, pr, weights): plt.figure("Robot in the world", figsize = (15., 15.)) plt.title('Particle filter, step ' + str(step)) # draw coordinate grid for plotting grid = [0, wo...
null
pf/visu.py
visu.py
py
2,125
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 8, "usage_type": "call" }, { "api_name": "matpl...
536634807
#!/usr/bin/python3.8 from time import sleep import subprocess import os from colorama import Back,Fore try: while True: a=subprocess.run(['cat','/proc/meminfo'],capture_output=True,text=True) desireddata={} li=a.stdout.split("\n") for l in li[0:3]: desireddata[l.split("...
null
ramMonitor.py
ramMonitor.py
py
1,477
python
en
code
null
code-starcoder2
76
[ { "api_name": "subprocess.run", "line_number": 10, "usage_type": "call" }, { "api_name": "os.get_terminal_size", "line_number": 16, "usage_type": "call" }, { "api_name": "colorama.Fore.RED", "line_number": 19, "usage_type": "attribute" }, { "api_name": "colorama.F...
439352808
import configparser import geopy import sqlite3 class Cache(object): def __init__(self, fn='app.db'): self.conn = conn = sqlite3.connect(fn) cur = conn.cursor() cur.execute('CREATE TABLE IF NOT EXISTS ' 'geo ( ' 'id INTEGER PRIMARY KEY, ' ...
null
cache.py
cache.py
py
1,642
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 42, "usage_type": "call" }, { "api_name": "geopy.geocoders.GoogleV3", "line_number": 44, "usage_type": "call" }, { "api_name": "geo...
211375210
from trecs.models import ImplicitMF from trecs.components import Users, Creators import numpy as np import pytest import test_helpers class TestImplicitMF: def test_default(self): mf = ImplicitMF(seed=123) test_helpers.assert_correct_num_users(mf.num_users, mf, mf.users_hat.shape[0]) test_...
null
trecs/tests/test_ImplicitMF.py
test_ImplicitMF.py
py
4,921
python
en
code
null
code-starcoder2
76
[ { "api_name": "trecs.models.ImplicitMF", "line_number": 10, "usage_type": "call" }, { "api_name": "test_helpers.assert_correct_num_users", "line_number": 11, "usage_type": "call" }, { "api_name": "test_helpers.assert_correct_num_items", "line_number": 12, "usage_type": "c...
239995677
# Copyright 2018 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 required by applicable law or agreed ...
null
deepsea/3-prediction/batchpredict.py
batchpredict.py
py
2,118
python
en
code
null
code-starcoder2
76
[ { "api_name": "googleapiclient.discovery.build", "line_number": 20, "usage_type": "call" }, { "api_name": "googleapiclient.discovery", "line_number": 20, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "a...
206866251
# ============================================================================ # scan.py -- Scanner functions # ---------------------------------------------------------------------------- # Author: Benjamin P. Haley, Tongtong Shen, Purdue University # Copyright (c) 2012 Purdue University # ----------------------------...
null
simtool/polymerxtal/polymod/scan.py
scan.py
py
9,252
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.match", "line_number": 149, "usage_type": "call" }, { "api_name": "utils.openFile", "line_number": 176, "usage_type": "call" } ]
267073632
from enum import Enum import libvirt import logging import os import socket import sys import time import xml.etree.ElementTree as ET log = logging.getLogger(__name__) log.addHandler(logging.StreamHandler()) log.setLevel(logging.DEBUG) # TODO ENDIANNESS = 'little' def itob(value, length=4): """ Converts an integ...
null
python/proxy.py
proxy.py
py
11,834
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 12, "usage_type": "attribute" }, { "api_name": "enum.Enum"...
363425062
import os import matplotlib import matplotlib.pyplot as plt import numpy as np import numpy.ma as ma #import scipy.io from scipy.io import loadmat import pandas as pd import datetime as dt # If you don't use squeeze_me = True, then Pandas doesn't like # the arrays in the dictionary, because they look like an arrays #...
null
test_scripts/plot_buoy_data.py
plot_buoy_data.py
py
5,480
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.io.loadmat", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 15, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 17, "usage_type": "call" }, { "api_name": "scipy.io.loadmat",...
138619849
'''VSCode helper functions''' import subprocess, os, yaml, json, inspect, tempfile, glob, shutil from mod import util,log,verb,dep from mod.tools import cmake name = 'vscode' platforms = ['osx','linux','win'] optional = True not_found = 'used as IDE with vscode configs' #----------------------------------------------...
null
mod/tools/vscode.py
vscode.py
py
18,853
python
en
code
null
code-starcoder2
76
[ { "api_name": "subprocess.check_output", "line_number": 17, "usage_type": "call" }, { "api_name": "subprocess.CalledProcessError", "line_number": 19, "usage_type": "attribute" }, { "api_name": "mod.util.get_project_name_from_dir", "line_number": 25, "usage_type": "call" ...
345033186
# -*- coding: utf-8 -*- from pysistem import db from flask import render_template, g, flash, redirect, url_for, request, Blueprint from flask_babel import gettext from pysistem.lessons.model import Lesson, LessonUserAssociation, AutoMark from pysistem.lessons.decorators import yield_lesson from pysistem.groups.decorato...
null
pysistem/lessons/views.py
views.py
py
10,882
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 14, "usage_type": "call" }, { "api_name": "pysistem.db.session.delete", "line_number": 29, "usage_type": "call" }, { "api_name": "pysistem.db.session", "line_number": 29, "usage_type": "attribute" }, { "api_name": "p...
34447898
################################################################################# ## plotting script: ADC data distribution and simulation ## ################################################################################# import matplotlib.pyplot as plt import matplotlib matplotlib.rc('xtick', l...
null
calib/plotdist.py
plotdist.py
py
3,412
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.rc", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 7, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path.append", "line_numbe...
429211840
#!/usr/bin/env python # -*- coding: utf-8 -*- #========================================================================== # BUILT-IN/GENERIC IMPORTS FOR MAIDS #========================================================================== import RPi.GPIO as GPIO import time import datetime as datetime import smtplib impor...
null
Python Code/maids_final_python_code_22102019.py
maids_final_python_code_22102019.py
py
23,959
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 89, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 89, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setmode", "line_number": 154, "usage_type": "call" }, { "api_name": "RPi.GP...
514220854
from pathlib import Path from PyInstaller.building.api import PYZ, EXE, COLLECT from PyInstaller.building.build_main import Analysis here = Path(r".") tools = ["mitmproxy", "mitmdump", "mitmweb"] analysis = Analysis( tools, excludes=["tcl", "tk", "tkinter"], pathex=[str(here)], ) pyz = PYZ(analysis.pure...
null
release/specs/windows-dir.spec
windows-dir.spec
spec
882
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "PyInstaller.building.build_main.Analysis", "line_number": 9, "usage_type": "call" }, { "api_name": "PyInstaller.building.api.PYZ", "line_number": 15, "usage_type": "call" }, { "...
143814608
import cv2 import numpy as np import torch import os import pandas as pd from matplotlib import pyplot as plt import albumentations as albu def resize_it(x): if x.shape != (350, 525): x = cv2.resize(x, dsize=(525, 350), interpolation=cv2.INTER_LINEAR) return x def draw_convex_hull(mask, mode='convex...
null
understanding-clouds-from-satellite-images/code/help_func_v2.py
help_func_v2.py
py
9,222
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.resize", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.INTER_LINEAR", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.findContours", "...
585645962
import json import requests import pygal from datetime import datetime, timedelta #Intial data parsing test #----------------------------------------------------------------- #print(list) #flist = [] #clist = [] #tlist = [] #for x in list['info']: # flist.append(x['tempF']) # clist.append(x['tempC']) # tlist.a...
null
code/temp.py
temp.py
py
6,694
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 32, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 35, "usage_type": "call" }, { "api_name": "pygal.StackedLine", "line_number": 62, "usage_type": "call" }, { "api_name": "pygal.StackedLine", "li...
232867758
# -*- coding: utf-8 -*- from django.db import models from apps.gcd.models.publisher import Publisher, Brand, IndiciaPublisher from apps.gcd.models.language import Language from apps.gcd.models.country import Country from apps.gcd.models.series import Series from apps.gcd.models.issue import Issue, INDEXED from apps.gc...
null
apps/gcd/models/countstats.py
countstats.py
py
3,477
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Manager", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 12, "usage_type": "name" }, { "api_name": "apps.gcd.models.publisher.Publisher.objects.filter", "line_number": 25, "usage_type": "cal...
33022491
import logging log = logging.getLogger(__name__) # This is a custom valiator specifically for pyKwlify Schema extensions # It will validate if the email address exists for all accounts except PRIMARY account # It will validate if the account exports $[AccountId] as ssm_parameters def account_validation(value, rule_obj...
null
unzip/aws-landing-zone-handshake-state-machine/validation/custom_validation.py
custom_validation.py
py
6,090
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 2, "usage_type": "call" } ]
292061429
from textblob import TextBlob from nltk.sentiment.vader import SentimentIntensityAnalyzer def extract_rule4(doc, ner_heads, prod_pronouns, sid, product_id): ## FOURTH RULE OF DEPENDANCY PARSE - ## M - Sentiment modifier || A - Aspect #Adverbial modifier to a passive verb - A is a child of something with re...
null
lib/python/aspect_extraction/extract_rule4/__init__.py
__init__.py
py
1,980
python
en
code
null
code-starcoder2
76
[ { "api_name": "textblob.TextBlob", "line_number": 50, "usage_type": "call" } ]
47276531
import numpy as np from sklearn.model_selection import train_test_split from sklearn import datasets from logistic_regression import LogisticRegression bc = datasets.load_breast_cancer() X, y = bc.data, bc.target x_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=1234) def accura...
null
LogisticRegression/logistic_regression_test.py
logistic_regression_test.py
py
620
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.load_breast_cancer", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 7, "usage_type": "name" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 11, "usage_type": "call" }...
100289895
""" For CommonsCloud copyright information please see the LICENSE document (the "License") included with this software package. This file may not be used in any manner except in compliance with the License Unless required by applicable law or agreed to in writing, software distributed under the License is distributed...
null
CommonsCloudAPI/models/statistic.py
statistic.py
py
9,805
python
en
code
null
code-starcoder2
76
[ { "api_name": "CommonsCloudAPI.extensions.db.Model", "line_number": 45, "usage_type": "attribute" }, { "api_name": "CommonsCloudAPI.extensions.db", "line_number": 45, "usage_type": "name" }, { "api_name": "CommonsCloudAPI.models.base.CommonsModel", "line_number": 45, "usa...
82940836
import os import argparse import json from flask import Flask, request, send_from_directory, jsonify from psstat import make_stat app = Flask(__name__) parser = argparse.ArgumentParser() parser.add_argument("-d", dest="daemon_pid_file", action="store", default="/var/run/sockd.pid", help="Daemon pid file") parser.add...
null
monitor/__init__.py
__init__.py
py
898
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_n...
109040244
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (c) 2013 Frederik Elwert <frederik.elwert@web.de> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including...
null
tcflib/tagsets/base.py
base.py
py
8,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "lxml.etree.ElementBase", "line_number": 86, "usage_type": "attribute" }, { "api_name": "lxml.etree", "line_number": 86, "usage_type": "name" }, { "api_name": "lxml.etree.XPath", "line_number": 92, "usage_type": "call" }, { "api_name": "lxml.etree", ...
343128962
import affine cipher = """FRRONLSEMEACROIQKMXRZASTUGIVSEYCMDFPKSNEYXVJSFOEZMUAUHXMSMQDBMKBTZKTPOWUJPRSWUIKFXCZOEIIFYBBZIYSQSIPEKTOOGEOBHVCJHGFDKRHKSJUDJXWNNQOPIHDOJVEHPTDQQDGMNVQAYMHFQXDDPSPHGM""" alpha = [i for i in range(26) if affine.gcdex(26, i)[0] == 1] betta = [i for i in range(26)] for a in alpha: for b in...
null
Affine cipher/brute.py
brute.py
py
617
python
en
code
null
code-starcoder2
76
[ { "api_name": "affine.gcdex", "line_number": 6, "usage_type": "call" }, { "api_name": "affine.decrypt", "line_number": 14, "usage_type": "call" } ]
281074712
#!py #coding=utf-8 # 打包编译 #pyinstaller -F -c --icon=icon64.ico directory_size_sort.py # 兼容win中文乱码 from __future__ import unicode_literals import os import sys from collections import defaultdict from prettytable import PrettyTable file_size = {} dir_size = defaultdict(list) if len(sys.argv) == 1: dirname = '.'...
null
directory_size_sort.py
directory_size_sort.py
py
1,921
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "sys.argv", "l...
183456256
import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.rcParams['axes.unicode_minus'] = False class Visualize(object): def __init__(self, fileroot,): self.fileroot = fileroot # Make new column 'name' dict1 = { '광주광역시': '광주', '대구광역시': '대구', '대전광역시': '대전', '부산광역시': '부산'...
null
pj1/blockmapvisual.py
blockmapvisual.py
py
3,293
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 5, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy...
220933859
from dajax.core import Dajax from dajaxice.decorators import dajaxice_register from dajaxice.utils import deserialize_form from django.forms.models import model_to_dict # from django.http import HttpResponse, HttpResponseRedirect # from django.shortcuts import render, redirect from django.core.mail import EmailMultiAl...
null
website/ajax.py
ajax.py
py
15,520
python
en
code
null
code-starcoder2
76
[ { "api_name": "dajax.core", "line_number": 39, "usage_type": "name" }, { "api_name": "dajax.core.Dajax", "line_number": 39, "usage_type": "call" }, { "api_name": "website.models.TextbookCompanionProposal.objects.using", "line_number": 43, "usage_type": "call" }, { ...
382918295
"""Creature module. Includes the different types of creature, the different types of creature AI and a class (CreatureBuilder) which creates and returns creatures, adding them to the list of creatures and setting their position to be an empty tile.""" import curses from random import randint import random cu...
null
creature.py
creature.py
py
6,370
python
en
code
null
code-starcoder2
76
[ { "api_name": "curses.initscr", "line_number": 10, "usage_type": "call" }, { "api_name": "curses.start_color", "line_number": 11, "usage_type": "call" }, { "api_name": "curses.init_pair", "line_number": 12, "usage_type": "call" }, { "api_name": "curses.COLOR_RED",...
138585906
import pandas as pd import requests import json import pymysql.cursors import datetime import random def create_pass(line_user_id): passwd = str(random.randint(1000000,3000000))[1:4] #サーバにget書き込み url ="http://ik1-334-27288.vs.sakura.ne.jp/hack10/pass/pass.php?line_user_id="+line_user_id+"&passwd="+passwd ...
null
funcs.py
funcs.py
py
9,332
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.randint", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.post", "line...
536412241
import os import json import matplotlib.pyplot as plt import itertools as it from collections import Counter db_dir = 'db/results/C_gamma/' tickers = ['ABBV','AMZN','GOOGL','TSLA','ZTS'] days = [3,5,7,10] def missingValues(ticker, files): p = [0,0,0,0,0] # 3,5,7,10,none for f1 in files: with open(db...
null
Tests/collect_results.py
collect_results.py
py
8,143
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 22, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 45, "usage_type": "call" }, { "api_name": "os.remove", "line_number": 51, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 51, ...
221483086
import re from django.contrib.auth.models import User from django.utils.safestring import mark_safe, mark_for_escaping from django import template register = template.Library() class NameReducer(object): d = { 'Государственное учреждение': 'ГУ', 'Акционерное общество': 'АО', 'Республиканск...
null
tender/templatetags/custom_filters.py
custom_filters.py
py
1,666
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.Library", "line_number": 5, "usage_type": "call" }, { "api_name": "django.template", "line_number": 5, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 26, "usage_type": "call" }, { "api_name": "re.IGNORECASE", ...
459114385
#!/usr/bin/env python3 """ Copyright 2019 Digital Media Professionals Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Un...
null
YOLOv3TF/YOLOv3TF.py
YOLOv3TF.py
py
10,612
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.tanh", "line_number": 161, "usage_type": "call" }, { "api_name": "numpy.tanh", "line_number": 165, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 172, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 173, ...
446829970
import numpy as np from projectile import simulator, print_results import mogp_emulator try: import matplotlib.pyplot as plt makeplots = True except ImportError: makeplots = False # An end-to-end tutorial illustrating model calibration using mogp_emulator # First, we need to set up our experimental desig...
null
mogp_emulator/demos/tutorial.py
tutorial.py
py
2,766
python
en
code
null
code-starcoder2
76
[ { "api_name": "mogp_emulator.LatinHypercubeDesign", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "projectile.simulator", "line_number": 28, "usage_type": "call" }, { "api_name": "m...
390008950
# coding=utf-8 from flask import Flask # 导入flask_sqlalchemy扩展包 from flask_sqlalchemy import SQLAlchemy from config import Config app = Flask(__name__) # 指定数据库的配置信息 # app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:mysql@localhost/python24' # 使用配置文件 app.config.from_object(Config) # 创建sqlalchemy对象,两种实例化形式 db = SQL...
null
test/Flask/03/python_day03/demo2.py
demo2.py
py
2,196
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "config.Config", "line_number": 11, "usage_type": "argument" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 13, "usage_type": "call" } ]
42999874
from pos_constants import SCREEN_SIZE from pygame.locals import * from game_data import * import pygame import sys import os FPS = 30 class Game(object): def __init__(self): self.board = GameBoard() self.image = pygame.image.load( os.path.dirname(os.path.abspath(__file...
null
src/shesh_besh_gui.py
shesh_besh_gui.py
py
2,265
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.image.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "li...
133388656
"""untitled1 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-bas...
null
cart/urls.py
urls.py
py
2,105
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 22, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 23, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 24, "usage_type": "call" }, { "api_name": "django.urls.path",...
3155179
# -*- coding: utf-8 -*- """ general utilities Created on Fri Apr 1 08:56:28 2016 @author: vcn81216 """ import numpy as np from collections import deque import os def obs_dist(o1, o2): '''distance between observations at the same time point''' return np.sqrt((o1[0] - o2[0])**2 + (o1[1] - o2[1])**2) def sec...
null
python/biggles/_utilities.py
_utilities.py
py
4,654
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sqrt", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number": 57, "usage_type": "call" }, { "api_name": "numpy.log10", "line_number": 57, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number": 6...
339574022
# -*- coding: utf-8 -*- """ Created on Sun Jul 8 02:04:00 2018 @author: jimmybow """ from flask import Flask, render_template, request from datetime import datetime import Dash_App1, Dash_App2 app = Flask(__name__) app, create_secret = Dash_App1.Add_Dash(app) app = Dash_App2.Add_Dash(app) @app.route...
null
run.py
run.py
py
1,318
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "Dash_App1.Add_Dash", "line_number": 13, "usage_type": "call" }, { "api_name": "Dash_App2.Add_Dash", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.n...
141307717
from django import forms from django.utils import timezone from .models import Contact class ContactCreateForm(forms.ModelForm): sender_name = forms.CharField(max_length=50, required=True) email = forms.EmailInput() subject = forms.CharField(max_length=50, required=True) message = forms.CharField(max...
null
apps/contact/forms.py
forms.py
py
839
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 8, "usage_type": "call" }, { "api_name": "django.f...
333692538
from django.http import HttpResponse from django.template.loader import get_template import requests from django.shortcuts import render def inicio(request): return render(request, "inicio.html",{}) def temporadas(request): serie = request.GET["subject"] nombre_serie = serie.replace(" ", "+") response...
null
tarea1/views.py
views.py
py
2,938
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 18, "usage_type": "call" }, { "api_name": "requests....
409208494
import pyopencl as cl import numpy import numpy.linalg as la import scipy.special as ssf import datetime from time import time import test_cython def test_0(zz): a = numpy.random.rand(zz).astype(numpy.float64) b = numpy.random.rand(zz).astype(numpy.float64) c_result = numpy.empty_like(a) # Spe...
null
2014/Sep/8/test_opencl_benchmark_double_precision.py
test_opencl_benchmark_double_precision.py
py
3,687
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.rand", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.float64", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.random.r...
384212370
import pytest from model.application import Application, NotIntegerException from model.db import HospitalListDB, UnknowUserException from copy import deepcopy statuses = { 0: 'Тяжело болен', 1: 'Болен', 2: 'Слегка болен', 3: 'Готов к выписке', } database = HospitalListDB([ 0, 1, 1, 1, 1, 2...
null
tdd_trening/ivan_archiv/hospital_ivan_06/tests/test_application.py
test_application.py
py
6,546
python
en
code
null
code-starcoder2
76
[ { "api_name": "model.db.HospitalListDB", "line_number": 12, "usage_type": "call" }, { "api_name": "model.application.Application", "line_number": 18, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 23, "usage_type": "call" }, { "api_name": "p...
452202920
from django.shortcuts import render, get_object_or_404 from django.utils import timezone from .models import Student from .forms import StudentForm from django.shortcuts import redirect # Create your views here. def student_list(request): students = Student.objects.order_by('school_class') return render(request, 're...
null
records/views.py
views.py
py
1,189
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Student.objects.order_by", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Student.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.Student", "line_number": 9, "usage_type": "name" }, { "api_name"...
22671090
import os import cv2 import numpy def img_resize(current_dir,save_dir,size_x=300,size_y=300,): img_list = os.listdir(current_dir) if not os.path.exists(save_dir): os.mkdir(save_dir) #os.chdir(save_dir) for name in img_list: print(name) img = cv2.imread(os.path.join(current_di...
null
src/sup/image.py
image.py
py
716
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 10,...
124128690
""" Scikit-learn 的学习 """ import jieba from sklearn.feature_extraction import DictVectorizer from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer from sklearn.preprocessing import MinMaxScaler, StandardScaler import numpy as np from sklearn.impute import SimpleImputer from sklearn.feature_selecti...
null
venv/Scikit-learn/Scikit_learn.py
Scikit_learn.py
py
3,953
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.feature_extraction.DictVectorizer", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 36, "usage_type": "call" }, { "api_name": "jieba.cut", "line_number": 52, "usage_type": "c...
342313267
from django.shortcuts import render,redirect from django.urls import reverse # Create your views here. from django.template import loader from django.http import HttpResponse , HttpResponseRedirect from talks.models import * from django.http import JsonResponse from django.contrib.auth.decorators import login_required ...
null
talks/views.py
views.py
py
9,578
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.redirect", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 20, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_nam...
653696743
import cv2 class LineDetector: @staticmethod def get_line_offset(frame, roi): frame = frame[roi[1]:roi[1]+roi[3], roi[0]:roi[0]+roi[2]] frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) frame = cv2.blur(frame, (5, 5)) _, frame = cv2.threshold(frame, 60, 255, cv2.THRESH_BINARY_INV...
null
bionik_tbd/LineDetector.py
LineDetector.py
py
570
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.blur", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.threshold", "line_...
85424229
from django.shortcuts import render, redirect from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm, VolunteerForm, AssistanceForm from django.core.mail import send_mail, BadHe...
null
users/views.py
views.py
py
3,554
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.request.method", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.http.request", "line_number": 11, "usage_type": "name" }, { "api_name": "forms.UserRegisterForm", "line_number": 12, "usage_type": "call" }, { "api_na...
32034644
from rest_framework import serializers from common.util.access import is_checked_in from sam.models import SiteCheckIn import datetime class SiteCheckInSerializer(serializers.ModelSerializer): class Meta: model = SiteCheckIn fields = [ 'group', 'user', 'site',...
null
sam/api/serializers.py
serializers.py
py
637
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 9, "usage_type": "name" }, { "api_name": "sam.models.SiteCheckIn", "line_number": 11, "usage_type": "name"...
570575047
from __future__ import print_function, absolute_import, unicode_literals from prompt_toolkit import prompt from prompt_toolkit.history import FileHistory from prompt_toolkit.auto_suggest import AutoSuggestFromHistory from pygments.style import Style from pygments.token import Token from pygments.token import Keyword, ...
null
kubeshell/kubeshell.py
kubeshell.py
py
4,723
python
en
code
null
code-starcoder2
76
[ { "api_name": "prompt_toolkit.key_binding.defaults.load_key_bindings_for_prompt", "line_number": 28, "usage_type": "call" }, { "api_name": "kubeshell.completer.KubectlCompleter", "line_number": 29, "usage_type": "call" }, { "api_name": "prompt_toolkit.history.FileHistory", "l...
274128824
from django.conf.urls import url from project import views as projectviews urlpatterns = [ url(r'^new/$', projectviews.create), url(r'^view/(?P<projectid>[0-9]+)$', projectviews.view), url(r'^remove/(?P<projectid>[0-9]+)$', projectviews.remove), url(r'^open/(?P<projectid>[0-9]+)$', projectviews.ope...
null
project/urls.py
urls.py
py
364
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "project.views.create", "line_number": 5, "usage_type": "attribute" }, { "api_name": "project.views", "line_number": 5, "usage_type": "name" }, { "api_name": "django.conf...
83270360
from django.urls import path from Emp import views urlpatterns=[ path('',views.home,name="hm"), path('abt/',views.about,name="ab"), path('co/',views.contact,name="pn"), path('log/',views.login,name="hg"), ]
null
Day-10/Emp/urls.py
urls.py
py
225
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "Emp.views.home", "line_number": 5, "usage_type": "attribute" }, { "api_name": "Emp.views", "line_number": 5, "usage_type": "name" }, { "api_name": "django.urls.path", "l...
340263260
from django.urls import path from .views import (RetrieveUpdateDestroyTodoList, ListCreateTodoList, RetrieveUpdateDestroyTask, ListCreateTask) from django.views.generic.base import TemplateView app_name = 'todo' urlpatterns = [ path('api/v1/todolists/', ListCreateTodoList.as_view(), ...
null
todo/urls.py
urls.py
py
770
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "views.ListCreateTodoList.as_view", "line_number": 10, "usage_type": "call" }, { "api_name": "views.ListCreateTodoList", "line_number": 10, "usage_type": "name" }, { "api_na...
576450392
from keras.callbacks import Callback import keras.backend as K class PrintLearningRate(Callback): def on_epoch_begin(self, epoch, logs=None): print("Current lr is %.9f" % K.eval(self.model.optimizer.lr)) def generate_anchor_config(model, detection_layer_config): feature_map_sizes = [] anchor_ratios...
null
code/SSD model/utils/utils.py
utils.py
py
907
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.callbacks.Callback", "line_number": 3, "usage_type": "name" }, { "api_name": "keras.backend.eval", "line_number": 5, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 5, "usage_type": "name" } ]
41556511
import networkx as nx import matplotlib.pyplot as plt G = nx.MultiDiGraph() #Se crea un grafo vacio G.add_node("A") #Se crea el nodo raíz G.add_nodes_from(["C","B","R","G"]) G.add_edges_from([("A","C"),("C","A"),("C","B"),("B","C"),("B","R"),("R","B"),("R","G")]) nx.draw(G,with_labels=True) #Se dibuja el grafo plt...
null
Tarea_No.1/Tarea1_10.py
Tarea1_10.py
py
380
python
en
code
null
code-starcoder2
76
[ { "api_name": "networkx.MultiDiGraph", "line_number": 4, "usage_type": "call" }, { "api_name": "networkx.draw", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotl...
277590059
import torch import torch.nn as nn import torch.nn.functional as F class L2ContrastiveLoss(nn.Module): """ Contrastive loss Takes embeddings of two samples and a target label == 1 if samples are from the same class and label == 0 otherwise Args : output1 & output2 : [N, dim] target : [...
null
models/l2_contrastive_loss.py
l2_contrastive_loss.py
py
853
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.functional.relu", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn.functio...
334118029
import json import os import toml from box import BoxKeyError from dynaconf.utils.boxing import DynaBox true_values = ("t", "true", "enabled", "1", "on", "yes", "True") false_values = ("f", "false", "disabled", "0", "off", "no", "False", "") class MetaValue: """A Marker to trigger specific actions on `set` and...
null
dynaconf/utils/parse_conf.py
parse_conf.py
py
3,603
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 51, "usage_type": "attribute" }, { "api_name": "toml.loads", "line_number": 68, "usage_type": "call" }, { "api_name": "dynaconf.utils.boxing.DynaBox", "line_number": 68, "usage_type": "argument" }, { "api_name": "toml.Tom...
451281024
import logging import time from datetime import datetime from functools import wraps import random def decorator_execution_time(outer_function): @wraps(outer_function) def wrapper(*args, **kwargs): logging.basicConfig(filename="execution_time.log", level=logging.INFO) start_time = time.time()...
null
home_work/lesson6/task2/source/decorator_execution_time.py
decorator_execution_time.py
py
803
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 13, "usage_type": "call" }, { "api_name": "time.time", "line...
542005453
import math, itertools, fractions from tqdm import tqdm # store line segments as ((x0,y0),(x1,y1)) in a set. # Simple linear algebra problem - solve system of linear equations, subject to two solution variables being in the open unit interval. s = [290797] t = [] lineSegments = set() while len(t) < 20000: ...
null
165a.py
165a.py
py
1,491
python
en
code
null
code-starcoder2
76
[ { "api_name": "fractions.Fraction", "line_number": 33, "usage_type": "call" }, { "api_name": "fractions.Fraction", "line_number": 34, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 48, "usage_type": "call" }, { "api_name": "itertools.combination...
508872867
import os import logging BASE_DIR = os.path.dirname(os.path.abspath(__file__)) DB_DIR = os.path.join(BASE_DIR, 'db') DB_NAME = 'text_sum' DB_LOCATION = os.path.join(DB_DIR, DB_NAME) logging.basicConfig(filename='scraper.log', level=logging.DEBUG) logging.getLogger('scraper')
null
sum_code/settings.py
settings.py
py
281
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
143797006
import os, shutil, sys, getopt import json class ModBuilder: def __init__(self): self.modNames = [modName for modName in next(os.walk('.'))[1] if self.__isReleased(modName)] self.modFolderDir = None opts, args = getopt.getopt(sys.argv[1:], ":m:", ['dir=']) for opt, arg in opts: if opt in ('...
null
build.py
build.py
py
2,178
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.walk", "line_number": 7, "usage_type": "call" }, { "api_name": "getopt.getopt", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_numbe...
429531907
import os import moviepy.editor as mp import speech_recognition as sr from pydub import AudioSegment from pydub.silence import split_on_silence # Seperates audio from video def videoToAudio(clips): for clip in clips: print("\nClip found: " + clip) # Inserting video files at the specified p...
null
scripts/main.py
main.py
py
3,881
python
en
code
null
code-starcoder2
76
[ { "api_name": "moviepy.editor.VideoFileClip", "line_number": 14, "usage_type": "call" }, { "api_name": "moviepy.editor", "line_number": 14, "usage_type": "name" }, { "api_name": "os.path.splitext", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path"...
375613506
import re import html import emoji import tweepy import unidecode import collections from typing import List QUOTE_PATTERN = \ re.compile(r'^[\"\']{0,1}(?P<phrase>[A-Z].*[\.!?])[\"\']{0,1}' r'\s*?[-~]\s*' r'(?P<author>.*)$') SPECIAL_CHARS_PATTERN = re.compile(r'[^a-zA-Z0-9]') Quote ...
null
libs/twitter.py
twitter.py
py
3,132
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 16, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", ...
468877908
import pandas as pd import numpy as np import torch from sklearn import preprocessing from sklearn import model_selection from transformers import AdamW from transformers import get_linear_schedule_with_warmup import joblib import config import dataset import engine import utils from model import EntityMo...
null
app.py
app.py
py
2,780
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.process_data", "line_number": 18, "usage_type": "call" }, { "api_name": "config.DATA_FILE", "line_number": 18, "usage_type": "attribute" }, { "api_name": "joblib.dump", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.model_se...
521187422
############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # T...
null
Zope3/tags/ZopeX3-3.0.0a1/src/zope/app/hub/tests/test_objecthub.py
test_objecthub.py
py
23,262
python
en
code
null
code-starcoder2
76
[ { "api_name": "zope.app.hub.tests.objecthubsetup.ObjectHubSetup", "line_number": 62, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 62, "usage_type": "attribute" }, { "api_name": "zope.app.hub.tests.objecthubsetup.ObjectHubSetup.setUp", "line_number...
384034909
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /Users/dexter/git/tensorboardX/tensorboardX/proto/node_def_pb2.py # Compiled at: 2019-12-25 07:50:25 # Size of source mod 2**32: 5875 bytes import sys _b = sys.ve...
null
pycfiles/tensorboardX-2.0-py2.py3-none-any/node_def_pb2.cpython-37.py
node_def_pb2.cpython-37.py
py
5,678
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 9, "usage_type": "attribute" }, { "api_name": "google.protobuf.Default", "line_number": 14, "usage_type": "call" }, { "api_name": "google.protobuf", "line_number": 14, "usage_type": "name" }, { "api_name": "google.p...
586857118
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html import scrapy,os from scrapy.pipelines.images import ImagesPipeline #from settings import IMAGES_STORE as pic_store from scrapy...
null
leg/pipelines.py
pipelines.py
py
1,092
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "scrapy.exceptions.DropItem", "line_number": 17, "usage_type": "call" }, { "api_name": "scrapy.pipelin...
159429364
import bs4 as bs from collections import deque import datetime as dt from matplotlib import style import numpy as np import os import pandas as pd import pandas_datareader.data as web import pickle import random import requests from sklearn import preprocessing import tensorflow as tf from tensorflow.keras.models impor...
null
stock market predictor with rod's code.py
stock market predictor with rod's code.py
py
7,056
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.style.use", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.style", "line_number": 22, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup"...
386022651
import requests import json from os import path from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults from airflow.contrib.hooks.gcs_hook import GoogleCloudStorageHook class LaunchLibraryOperator(BaseOperator): ui_color = '#555' ui_fgcolor = '#fff' template_fields = ('...
null
dags/operators/launch_library_operator.py
launch_library_operator.py
py
1,305
python
en
code
null
code-starcoder2
76
[ { "api_name": "airflow.models.BaseOperator", "line_number": 8, "usage_type": "name" }, { "api_name": "airflow.utils.decorators.apply_defaults", "line_number": 13, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "a...
566932016
import ffmpeg import os import sys # Change these variables if you want! OUTPUT_FOLDER = "Converted Files" CONVERT_TO = ".mp4" # Make sure the output folder actually exists. if not os.path.exists(OUTPUT_FOLDER): os.mkdir(OUTPUT_FOLDER) def main(): # Creates a list of all the files that were dragged onto "Dr...
null
main.py
main.py
py
1,090
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 17...
120376002
import numpy as np from collections import Counter from scipy.stats import beta,iqr class Color(): HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' LIGHTBLUE = '\033[96m' FADE = '\033[90m' FAIL = '\033[91m' ENDC = '\033[0m' ...
null
mzhu_code/learnspngp.py
learnspngp.py
py
16,377
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.full", "line_number": 123, "usage_type": "call" }, { "api_name": "numpy.nonzero", "line_number": 130, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 138, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_numbe...
219464724
# -*- coding: utf-8 -*- """ Created on Thu Apr 18 10:41:29 2019 @author: ben """ import networkx as nx import sys sys.path =['','/home1/e01225371/kmst', '/home1/e01225371/anaconda3/lib/python35.zip', '/home1/e01225371/anaconda3/lib/python3.5', '/home1/e01225371/anaconda3/lib/python3.5/plat-linux', '/home1/e01225371/a...
null
framework/python/dcc.py
dcc.py
py
5,418
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "networkx.empty_graph", "line_number": 21, "usage_type": "call" }, { "api_name": "networkx.empty_graph", "line_number": 57, "usage_type": "call" }, { "api_name": "networkx.conn...
362983017
from app.precache import populate_player, populate_schedule, populate_teams, populate_stadiums, \ populate_ff_teams, populate_ff_roster from app.views import get_data, select_players #, draft_results from django.conf.urls import url from django.contrib import admin urlpatterns = [ # url(r'^$', home_page, name=...
null
dsxdemo/urls.py
urls.py
py
807
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "app.views.select_players", "line_number": 9, "usage_type": "argument" }, { "api_name": "django.conf.urls.url", "line_number": 13, "usage_type": "call" }, { "api_name": "...
123617462
# This file is part of the Reproducible and Reusable Data Analysis Workflow # Server (flowServ). # # Copyright (C) 2019-2021 NYU. # # flowServ is free software; you can redistribute it and/or modify it under the # terms of the MIT License; see LICENSE file for more details. """Unit test for overriding worker configura...
null
tests/controller/serial/engine/test_serial_engine_config.py
test_serial_engine_config.py
py
2,431
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
454444371
#! /usr/bin/python #-*- coding: utf-8 -*- # # sqlalchemy_sqlite3.py # # Mar/09/2017 # # ------------------------------------------------------------------ from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base import sys import datetime # ---------------------...
null
doc/tips/sqlalchemy/python/sqlalchemy_sqlite3.py
sqlalchemy_sqlite3.py
py
1,499
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.stderr.write", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 25, "usage_type": "call" }, { "api_...
481948592
''' Created on 1 Oct. 2018 @author: Shaun ''' import pygame from settings import * vec = pygame.math.Vector2 import random #loading and parsing spritesheets class Spritesheet: def __init__(self, filename): self.name = filename self.spritesheet = pygame.image.load(filename).convert() d...
null
sprites.py
sprites.py
py
4,745
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.math", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pygame.Surface", ...
84202198
import pandas as pd import datetime from datetime import datetime import pandas_datareader.data as web from pandas import Series, DataFrame import matplotlib.pyplot as plt import numpy as np import numpy.fft as fft from io import BytesIO import logging import requests from stocksapp.api.stocks.exceptions.TickerInvalidE...
null
stocksapp/api/stocks/algorithms.py
algorithms.py
py
2,449
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "stocksapp.api.stocks.exceptions.TickerInvalidError.TickerInvalidError", "line_number": 37, "usage_type": "...
547610806
#!/usr/bin/env python # encoding: utf-8 """Verify that all OSF Storage files have Glacier backups and parity files, creating any missing backups. TODO: Add check against Glacier inventory Note: Must have par2 installed to run """ import os import logging import pyrax from boto.glacier.layer2 import Layer2 from modu...
null
scripts/osfstorage/files_audit.py
files_audit.py
py
7,863
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 31, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 31, "usage_type": "attribute" }, { "api_name": "logging.getLo...
144430568
#!/usr/bin/env python3 import argparse import json import numpy as np import struct import pickle import config.config_api as config_api import simulator.sim_api as sim_api def _return_true(event): return True def main(): parser = argparse.ArgumentParser( description="Run the simulation f...
null
benchmark/vectoradd/vectoradd_sim.py
vectoradd_sim.py
py
4,290
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 21, "usage_type": "attribute" }, { "api_name": "config.config_api.load_hardware_config", "line_number": 49, "usage_ty...
310861496
import os,sys PROJECT_DIR='/home/ericp/tree_canopy_fcn/repo' sys.path.append(PROJECT_DIR) from importlib import reload # Ignore warnings import warnings warnings.filterwarnings("ignore") from datetime import datetime import re import numpy as np import pandas as pd import utils.load as load from utils.dataloader import...
null
scripts/bak.20200603/predict_pleiades.py
predict_pleiades.py
py
3,111
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "warnings.filterwarnings", "line_number": 7, "usage_type": "call" }, { "api_name": "utils.dataloader.H...
430028996
import glob from PIL import Image from common_utils import * import os def prop_resize_img(img,percentage): percentage = int(percentage) print(percentage) width, height = img.size width = width *(percentage / 100) height = height *(percentage / 100) img = resize(img,int(height),int(width)...
null
app/prop_resize.py
prop_resize.py
py
2,194
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", "line_number": 44, "usage_type": "attribute" }, { "api_name": "PIL.Image.open", "line_number...