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
440819846
import pandas as pd import numpy as np import json import random import keras class DataHandler(object): """ This class feeds training and test batches to the learning algorithm. """ def __init__(self, f, s): #Some hyper params self.sequence_len = s self.test_day = 8 #Choose on...
null
NeuralNetTraining/TrainingAlgorithm/DataHandler.py
DataHandler.py
py
9,247
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 72, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 83, "usage_type": "call" }, { "api_name": "random.randint", "line...
520536323
#!/usr/bin/env python ''' ============================================================= HEADER ============================================================= INSTITUTION: BU-ISCIII AUTHOR: Guillermo J. Gorines Cordero MAIL: guillermo.gorines@urjc.es VERSION: 1.0 CREATED: Exact date unknown (late 2020) REVISED: 26-...
null
bin/graphs_coverage.py
graphs_coverage.py
py
13,990
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.average", "line_number": 68, "usage_type": "call" }, { "api_name": "numpy.average", "line_number": 69, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 80, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
461216589
#!/usr/bin/env python # coding:utf-8 import re from dateutil.parser import parse # 用户行为相关 RESUME_PATTERN = r"(.*)\s+\d+\s+\d+ I am_resume_activity: \[(\d+,){3}(.*)/(.*)\]" RESUME_CALLED_PATTERN = r"(.*)\s+\d+\s+\d+ I am_on_resume_called: \[\d,(.*)\]" FOCUSED_PATTERN = r"(.*)\s+\d+\s+\d+ I am_focused_activity: \[\d+,(...
null
parsers.py
parsers.py
py
14,438
python
en
code
null
code-starcoder2
83
[ { "api_name": "dateutil.parser.parse", "line_number": 49, "usage_type": "call" }, { "api_name": "re.search", "line_number": 62, "usage_type": "call" }, { "api_name": "re.search", "line_number": 76, "usage_type": "call" }, { "api_name": "re.search", "line_numbe...
209713289
from ert.cwrap import BaseCClass, CWrapper from ert.util import UTIL_LIB class SubstitutionList(BaseCClass): def __init__(self): c_ptr = SubstitutionList.cNamespace().alloc(0) super(SubstitutionList, self).__init__(c_ptr) def __len__(self): return SubstitutionList.cNamespace().size(se...
null
devel/python/python/ert/util/substitution_list.py
substitution_list.py
py
2,028
python
en
code
null
code-starcoder2
83
[ { "api_name": "ert.cwrap.BaseCClass", "line_number": 5, "usage_type": "name" }, { "api_name": "ert.cwrap.CWrapper", "line_number": 33, "usage_type": "call" }, { "api_name": "ert.util.UTIL_LIB", "line_number": 33, "usage_type": "argument" }, { "api_name": "ert.cwra...
592610683
from pulson440_unpack import unpack from backprojection import interp_approach import matplotlib.pyplot as plt import numpy as np import pandas import math radar_data = unpack('UASSAR3_Final_1') platform_position_data = 'uassar3_final_2.csv' given_object = 'Right_Ref_Refl-FinalEvent.csv' meters = 3 eyeballing_start_ti...
null
GUI/final_script.py
final_script.py
py
10,304
python
en
code
null
code-starcoder2
83
[ { "api_name": "pulson440_unpack.unpack", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.float", ...
123643233
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import Flask from . import config app = Flask(__name__) for blue in config.blueprints: app.register_blueprint(blue) # @app.route('/') # def hello_world(): # return 'Hello, World!' def run(): port = 4567 app.run(debug=True, port=port, host="0.0...
null
server/ctfServer/idIoT/server.py
server.py
py
343
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" } ]
197866075
import datetime from services.elastic_search import es def init_initial_project(): """ Create the initial project which is hillary's emails :param es: :return: """ print("[INITIAL] Create initial project") test = { "name": "Hillary Clinton Emails", "date": datetime.datetime...
null
config/initial.py
initial.py
py
988
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "attribute" }, { "api_name": "services.elastic_search.es.index", "line_number": 16, "usage_type": "call" }, { "api...
631546698
## this script will load the information (either from "data" or from "result") and plot them ## the points will be colored into three different classes, and the Gaussian centers will be plotted also import matplotlib.pyplot as plt if __name__ == '__main__': likelihood = [] file = open("./result/likelihood.txt",...
null
plot_like.py
plot_like.py
py
761
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 24, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 31, "usage_type": "call" }, { "api_name": "mat...
299328487
from fastapi import FastAPI, Request, status from fastapi.responses import JSONResponse from fastapi.encoders import jsonable_encoder from fastapi.exceptions import RequestValidationError from fastapi.middleware.cors import CORSMiddleware from .api.books import router as books_router from .db.mongo_utils import close_...
null
python/app/main.py
main.py
py
1,226
python
en
code
null
code-starcoder2
83
[ { "api_name": "fastapi.FastAPI", "line_number": 11, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 16, "usage_type": "argument" }, { "api_name": "fastapi.Request", "line_number": 25, "usage_type": "name" }, { "api_na...
64428479
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
null
wsgi/iportalen_django/organisations/migrations/0001_initial.py
0001_initial.py
py
1,038
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 11, "usage_type": "call...
461007744
#!/usr/bin/env python # coding: utf-8 # In[4]: import pygame,sys import time,random from pygame.sprite import Sprite import struct import socket import codecs import time import sys pygame.init() white = (255,255,255) black = (0,0,0) red = (255,0,0) green = (0,155,0) display_width = 1800 display_height = 1000 ga...
null
src/eye_move.py
eye_move.py
py
1,080
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 26, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pygame.displa...
153654412
import socket import os from datetime import datetime while 1: def create_Socket(): global conn,conn1,addr,size,s,host,port s = socket.socket() host = input(str("Please enter an ip adress of the server : ")) port = 5001 s.connect((host, port)) size = s...
null
Downloader.py
Downloader.py
py
2,838
python
en
code
null
code-starcoder2
83
[ { "api_name": "socket.socket", "line_number": 8, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 14, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 21, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 2...
230572015
from django.urls import include, path from rest_framework.routers import DefaultRouter from api.views import (FavoriteViewSet, IngredientAPIView, PurchaseViewSet, SubscribeViewSet) router = DefaultRouter() router.register('favorites', FavoriteViewSet) router.register('purchases', PurchaseView...
null
api/urls.py
urls.py
py
494
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 8, "usage_type": "call" }, { "api_name": "api.views.FavoriteViewSet", "line_number": 10, "usage_type": "argument" }, { "api_name": "api.views.PurchaseViewSet", "line_number": 11, "usage_type": "argument"...
223900948
#!/usr/bin/env python3 import argparse import os import subprocess import math from tqdm import tqdm def tail(f, lines=1, _buffer=64): """Tail a file and get X lines from the end""" # place holder for the lines found lines_found = [] # block counter will be multiplied by buffer # to get the bloc...
null
determine_longduration_youtube/determine_duration_all_videos_monster.py
determine_duration_all_videos_monster.py
py
2,600
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.SEEK_END", "line_number": 22, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 44, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 58, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "...
585943305
import pytest from abmarl.sim import PrincipleAgent, DynamicOrderSimulation from abmarl.managers import DynamicOrderManager from abmarl.examples import MultiAgentSim class SequentiallyFinishingSim(DynamicOrderSimulation): def __init__(self, **kwargs): self.agents = {f'agent{i}': PrincipleAgent(id=f'agen...
null
tests/test_dynamic_order_manager.py
test_dynamic_order_manager.py
py
2,974
python
en
code
null
code-starcoder2
83
[ { "api_name": "abmarl.sim.DynamicOrderSimulation", "line_number": 9, "usage_type": "name" }, { "api_name": "abmarl.sim.PrincipleAgent", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 45, "usage_type": "call" }, { "api_name...
598774190
from selenium import webdriver import time import pandas as pd import re import datetime import sys sys.setrecursionlimit(10000) def rtsaget(): print(datetime.datetime.now().strftime("%Y/%m/%d %H:%M:%S")) driver=webdriver.Chrome("./selenium/chromedriver") driver.maximize_window() key_list = ["宿...
null
django/scraping_app/rtsa.py
rtsa.py
py
11,180
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.setrecursionlimit", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sel...
89592010
# coding=utf-8 import json from flask import Flask, app, render_template, request, Response import requests import os access_token = "" refresh_token = "" """ Recupera as informações de autenticacao do hubspot, e automaticamente "refresca" o token caso ele expire, salvando as informações em um arquivo para persisten...
null
api/hubspot/hubspot.py
hubspot.py
py
1,927
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.isfile", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.request", "line_numb...
216679750
#!/usr/bin/env python # -*- coding: utf8 -*- # cp936 # #=============================================================================== # History # 1. 20200816, Added by fasiondog #=============================================================================== import os import stat import errno import sys import shuti...
null
hikyuu/house.py
house.py
py
21,539
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 27, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 32, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 32, "usage_type": "argument" }, { ...
74226555
# encoding: utf-8 from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, HttpResponseNotFound from django.views.decorators.csrf import csrf_exempt from models import PromoCod, Record, LiveInternetRecord, MetrikaRecord from random import Random from forms i...
null
topka/core/views.py
views.py
py
8,355
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.Random", "line_number": 19, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 23, "usage_type": "call" }, { "api_name": "django.contrib.auth.authenticate", "line_number": 26, "usage_type": "call" }, { "a...
325230963
from __future__ import absolute_import import collections import logging import optparse from pathlib import Path import pytest import pretend from pip_check_reqs import find_missing_reqs, common, __version__ @pytest.fixture def fake_opts(): class FakeOptParse: class options: requirements_f...
null
tests/test_find_missing_reqs.py
test_find_missing_reqs.py
py
5,594
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 41, "usage_type": "name" }, { "api_name": "pip_check_reqs.common.FoundModule", "line_number": 42, "usage_type": "call" }, { "api_name": "pi...
309869092
#!/usr/bin/env python from argparse import ArgumentParser from stackmachine_lex import lexer from stackmachine_interp_gram import parser from stackmachine_interp_state import state ##################################################################################### def interp_program(): 'execute stack machine' ...
null
Programming Language Implementation/Assignment6_jh/stackmachine_interp.py
stackmachine_interp.py
py
5,727
python
en
code
null
code-starcoder2
83
[ { "api_name": "stackmachine_interp_state.state.instr_ix", "line_number": 13, "usage_type": "attribute" }, { "api_name": "stackmachine_interp_state.state", "line_number": 13, "usage_type": "name" }, { "api_name": "stackmachine_interp_state.state.instr_ix", "line_number": 18, ...
241753403
#-*-coding:utf-8-*- import pylab as plt def _plot_graph_list(x): x_val = range(0,len(x),1) plt.plot(x_val,x) plt.xlabel("Frame[n]",fontsize=14,fontname='self') plt.ylabel('Value',fontsize=14,fontname='self') plt.ylim(0,40) def plot_graph_list(x,x_classes): from common import divide_list a...
null
python/graphic.py
graphic.py
py
377
python
en
code
null
code-starcoder2
83
[ { "api_name": "pylab.plot", "line_number": 8, "usage_type": "call" }, { "api_name": "pylab.xlabel", "line_number": 9, "usage_type": "call" }, { "api_name": "pylab.ylabel", "line_number": 10, "usage_type": "call" }, { "api_name": "pylab.ylim", "line_number": 11...
179018566
import cv2 import os import numpy as np import pytesseract from PIL import Image,ImageEnhance def box_extraction(img,component_name): (thresh, img_bin) = cv2.threshold(img, 128, 255,cv2.THRESH_BINARY,cv2.THRESH_OTSU) img_bin=255-img_bin kernel_length=np.array(img).shape[1]//40 vertical_kernel=cv2.getS...
null
UI_FINAL/pdfProcess/table.py
table.py
py
2,746
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.threshold", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.THRESH_BINARY", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.THRESH_OTSU", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.array", ...
531556358
import numpy as np np.random.seed(10) from keras.models import Sequential, load_model from keras.layers import Dense, Activation, Conv1D, MaxPooling1D, Flatten, Dropout from keras.optimizers import Adam from keras.callbacks import TensorBoard, ModelCheckpoint, EarlyStopping from sklearn.model_selection import train_tes...
null
nn/CNNmodel_v2.py
CNNmodel_v2.py
py
2,138
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 2, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 2, "usage_type": "attribute" }, { "api_name": "keras.models.Sequential", "line_number": 16, "usage_type": "call" }, { "api_name": "keras.layer...
615780974
import torch from torch.autograd import Variable from rnng.models import DiscriminativeRnnGrammar from rnng.utils import ItemStore from rnng.actions import ShiftAction, ReduceAction, NonTerminalAction from rnng.decoding import greedy_decode word2id = {'John': 0, 'loves': 1, 'Mary': 2} pos2id = {'NNP': 0, 'VBZ': 1} nt...
null
tests/test_decoding.py
test_decoding.py
py
1,556
python
en
code
null
code-starcoder2
83
[ { "api_name": "rnng.actions.NonTerminalAction", "line_number": 12, "usage_type": "call" }, { "api_name": "rnng.actions.NonTerminalAction", "line_number": 13, "usage_type": "call" }, { "api_name": "rnng.actions.NonTerminalAction", "line_number": 14, "usage_type": "call" ...
547529221
# -*- coding: utf-8 -*- # # ramstk.dao.commondb.RAMSTKGroup.py is part of The RAMSTK Project # # All rights reserved. # Copyright 2007 - 2017 Doyle Rowland doyle.rowland <AT> reliaqual <DOT> com """RAMSTKGroup Table Module.""" from sqlalchemy import Column, Integer, String # Import other RAMSTK modules. from ra...
null
src/ramstk/dao/commondb/RAMSTKGroup.py
RAMSTKGroup.py
py
2,415
python
en
code
null
code-starcoder2
83
[ { "api_name": "ramstk.dao.RAMSTKCommonDB.RAMSTK_BASE", "line_number": 16, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 26, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 28, "usage_type": "argument" }, { "ap...
640548813
import os import locale from flask import Flask, g, request, url_for, render_template from werkzeug.contrib.fixers import ProxyFix from webapp import db from webapp.mail import mailer from webapp.controllers import listener __author__ = 'paxet' __version__ = '0.1.0.dev1' __description__ = 'Simple web app to host and s...
null
webapp/__init__.py
__init__.py
py
1,551
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.name", "line_number": 13, "usage_type": "attribute" }, { "api_name": "locale.setlocale", "line_number": 14, "usage_type": "call" }, { "api_name": "locale.LC_ALL", "line_number": 14, "usage_type": "attribute" }, { "api_name": "locale.setlocale", ...
256443297
from compas_rhino import unload_modules unload_modules("compas") import compas from compas_3gs.diagrams import FormNetwork from compas_3gs.diagrams import ForceVolMesh from compas_rhino.geometry import RhinoSurface from compas_3gs.diagrams import Cell from compas_3gs.algorithms import volmesh_dual_network from ...
null
examples/_temp_subd.py
_temp_subd.py
py
4,297
python
en
code
null
code-starcoder2
83
[ { "api_name": "compas_rhino.unload_modules", "line_number": 2, "usage_type": "call" }, { "api_name": "compas.raise_if_ironpython", "line_number": 29, "usage_type": "call" }, { "api_name": "rhinoscriptsyntax.GetObject", "line_number": 34, "usage_type": "call" }, { ...
570552373
# ------------------------------------------------------------------------------ # LICENSE # ------------------------------------------------------------------------------ # Render+ - Blender addon # (c) Copyright Diego Garcia Gangl (januz) - 2014, 2015 # <diego@sinestesia.co> # ----------------------------------------...
null
All_In_One/addons/renderplus/slots.py
slots.py
py
3,600
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 35, "usage_type": "call" }, { "api_name": "bpy.context", "line_number": 45, "usage_type": "attribute" }, { "api_name": "bpy.data", "line_number": 48, "usage_type": "attribute" }, { "api_name": "bpy.context", "l...
598210174
import os import pathlib this_env = os.environ #Strings to replace: # [[SUBID]] # # data_files [[RUN_FILE_1]] # event_onsets [[ARROWBLOCKS_ONSETS_1]] # event_onsets [[DISTSTRATEGYCUES_ONSETS_1]] # event_onsets [[NEGFLOWSTRATEGYCUES_ONSETS_1]] # event_onsets [[NEGMEMORYWORDS_ONSETS_1]] # event_onsets [[NEUMEMORYWORD...
null
pls_analysis/create_pls_txts.py
create_pls_txts.py
py
4,483
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_num...
349334218
from django.conf import settings from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse_lazy from django.shortcuts import render, get_object_or_404 from django.contrib.admin.views.decorators import staff_member_required from djforms.biology.genomics.forms import PhageHunterForm...
null
djforms/biology/genomics/views.py
views.py
py
1,874
python
en
code
null
code-starcoder2
83
[ { "api_name": "djforms.biology.genomics.forms.PhageHunterForm", "line_number": 16, "usage_type": "call" }, { "api_name": "django.conf.settings.DEBUG", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 20, "usage_type": "n...
511614007
import numpy as np from scipy.io.wavfile import read as rd from sklearn.mixture import GaussianMixture as GMM from featureextraction import extract_features import os import Models def GMMModels(audiopath , modeldest) : for folder in os.listdir(audiopath) : mfcc_features = np.asarray(()) for audio ...
null
GMMTraining.py
GMMTraining.py
py
1,376
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 10, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "scipy.io.wavfile.read", "line_...
77430351
import logging from downloader import download logger = logging.getLogger(__file__) url_patterns = ['uploadir.com'] def get_link(link): logger.debug('Getting ' + __file__ + ' link..') download.download(link) # Get all links on this page and try to download them. def get_soup(soup): links = [] for ...
null
downloader/uploaddir.py
uploaddir.py
py
648
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "downloader.download.download", "line_number": 11, "usage_type": "call" }, { "api_name": "downloader.download", "line_number": 11, "usage_type": "name" } ]
651096478
# -*- coding: utf-8 -*- ''' Created on 2017年6月21日 @author: Simba ''' import jenkins import config.config as CONFIG def triggerJenkinsWithparameter(jobName, parameterDic): server = jenkins.Jenkins( CONFIG.JENKINS_URL_173, CONFIG.USERID_AND_APITOKEN_173[0], CONFIG.USERID_AND_APITOKEN_173[1]...
null
triggerJenkins/jenkinsManager.py
jenkinsManager.py
py
1,381
python
en
code
null
code-starcoder2
83
[ { "api_name": "jenkins.Jenkins", "line_number": 12, "usage_type": "call" }, { "api_name": "config.config.JENKINS_URL_173", "line_number": 13, "usage_type": "attribute" }, { "api_name": "config.config", "line_number": 13, "usage_type": "name" }, { "api_name": "conf...
214934062
import numpy as np import nltk import nltk.tree as Tree from nltk import treetransforms, induce_pcfg, Nonterminal class PCFG(): """ Our PCFG is given by gramar where terminals are part-of-speech tags The probabilistic lexicon i.e. triples of the form (token, part-of-speech tag, probability) such that the sum of t...
null
MVA_TD2_LEVY_John/system/PCFG_Gramar.py
PCFG_Gramar.py
py
4,170
python
en
code
null
code-starcoder2
83
[ { "api_name": "nltk.tree.Tree.fromstring", "line_number": 106, "usage_type": "call" }, { "api_name": "nltk.tree", "line_number": 106, "usage_type": "attribute" } ]
342492509
import json import os import unittest from runner.fromHtttpRunner.report import HtmlTestResult class Runner(): def __init__(self): pass def run_test(self, test_data): expect, actual = test_data assert expect == actual class HttpRunner(object): def __init__(self, **kwargs): ...
null
runner/fromHtttpRunner/xx.py
xx.py
py
5,645
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestLoader", "line_number": 19, "usage_type": "call" }, { "api_name": "unittest.TextTestRunner", "line_number": 21, "usage_type": "call" }, { "api_name": "runner.fromHtttpRunner.report.HtmlTestResult", "line_number": 21, "usage_type": "name" }, ...
646853366
#!/usr/bin/env python # -*- coding: utf-8 -*- """Build channels names based on FRIB naming convention. """ from collections import OrderedDict from phantasy.library.layout import BCMElement from phantasy.library.layout import BLElement from phantasy.library.layout import BLMElement from phantasy.library.layout impor...
null
phantasy/facility/frib/channels/channels.py
channels.py
py
15,771
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.OrderedDict", "line_number": 106, "usage_type": "call" }, { "api_name": "phantasy.library.layout.CavityElement", "line_number": 125, "usage_type": "argument" }, { "api_name": "collections.OrderedDict", "line_number": 130, "usage_type": "call" ...
212840665
"""Configuration settings values for the solomon intelligence engine.""" # -*- coding: utf-8 -*- import logging DB_URL = 'http://localhost:7474/db/data/' PAGE_SIZE = 100 LOG_FILE = 'solomon.log' LOG_FORMAT = '%(asctime)-15s %(filename)s %(funcName)s %(lineno)d %(message)s' LOG_ENABLED = True LOG_QUERIES = False LOG_EX...
null
settings.py
settings.py
py
484
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 12, "usage_type": "attribute" }, { "api_name": "logging.disable", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.NOTSET...
365384414
#!/usr/bin/env python3 """ Module that handles authentication with auth0 """ import urllib import re import webbrowser import hashlib import secrets import socket import time from typing import Tuple from base64 import urlsafe_b64encode import requests from auth0.constants import DOMAIN, AUDIENCE, CLIENT_ID, CODE_CHALL...
null
auth0/auth0.py
auth0.py
py
6,219
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.Tuple", "line_number": 17, "usage_type": "name" }, { "api_name": "base64.urlsafe_b64encode", "line_number": 30, "usage_type": "call" }, { "api_name": "hashlib.sha256", "line_number": 43, "usage_type": "call" }, { "api_name": "secrets.token_by...
621202221
""" Training RNN for Phase picking """ import os, time import argparse import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader, RandomSampler, BatchSampler import torch.multiprocessing as mp from dataset import Sequences from models import RNN import config from tensorboar...
null
train_rnn.py
train_rnn.py
py
5,228
python
en
code
null
code-starcoder2
83
[ { "api_name": "warnings.filterwarnings", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.backends", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", ...
84620460
from sklearn import svm, linear_model from sklearn.neural_network import MLPClassifier from sklearn.decomposition import PCA from PIL import Image from os import listdir from random import shuffle import numpy as np import pickle train_size = 0.8 soup_dir = "soup/" salad_dir = "salad/" soup_photos = [f for f in listd...
null
train.py
train.py
py
2,498
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 15, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 16, "usage_type": "call" }, { "api_name": "random.shuffle", "line_numbe...
566909474
# import os # import torch # from collections import Counter # class Dictionary(object): # def __init__(self): # self.word2idx = {} # self.idx2word = [] # self.counter = Counter() # self.total = 0 # def add_word(self, word): # if word not in self.word2idx: # ...
null
data.py
data.py
py
7,089
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.Counter", "line_number": 68, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 105, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 118, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
498226304
from functools import wraps import json from django.http import HttpResponse, HttpResponseNotAllowed from django.http import HttpResponseBadRequest from django.http import JsonResponse from django.contrib.auth import login from django.contrib.auth import logout from django.contrib.auth.models import User as AuthUser f...
null
server_project/target/views.py
views.py
py
17,066
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.auth.models.User.objects.all", "line_number": 38, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 38, "usage_type": "attribute" }, { "api_name": "django.contrib.auth.models.User", "line_number": 38,...
469328390
from detectron2.data.datasets import register_coco_instances from detectron2.utils.visualizer import ColorMode, Visualizer from detectron2.engine import DefaultPredictor import cv2 import matplotlib.pyplot as plt from detectron2.engine import DefaultTrainer from detectron2.config import get_cfg from detectron2 import ...
null
bolts.py
bolts.py
py
1,698
python
en
code
null
code-starcoder2
83
[ { "api_name": "detectron2.data.datasets.register_coco_instances", "line_number": 12, "usage_type": "call" }, { "api_name": "detectron2.config.get_cfg", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, ...
610165038
"""This module provides base Daemon class.""" import os import time from abc import abstractmethod, ABC from utils.loggerhelper import LOGGER class Daemon(ABC): """Provides basic functionality of daemon.""" def __init__(self, frequency): """Initializes the new Daemon instance.""" self.is_pr...
null
way_to_home/daemons/base_daemon.py
base_daemon.py
py
1,324
python
en
code
null
code-starcoder2
83
[ { "api_name": "abc.ABC", "line_number": 10, "usage_type": "name" }, { "api_name": "os.getpid", "line_number": 22, "usage_type": "call" }, { "api_name": "utils.loggerhelper.LOGGER.info", "line_number": 24, "usage_type": "call" }, { "api_name": "utils.loggerhelper.L...
462629509
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from settings import MEDIA_ROOT from stdimage import StdImageField class PhotoManager(models.Manager): def get_al...
null
albuns/models.py
models.py
py
2,194
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.Manager", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { "api_name": "django.contrib.contenttypes.models.ContentType.objects.get_for_model", "line_number": 13, ...
179320455
"""Adds config flow for Mail and Packages.""" import logging from typing import Any import homeassistant.helpers.config_validation as cv import voluptuous as vol from homeassistant import config_entries from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_RESOURCES, CONF_USE...
null
custom_components/mail_and_packages/config_flow.py
config_flow.py
py
9,361
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 41, "usage_type": "call" }, { "api_name": "helpers.login", "line_number": 45, "usage_type": "call" }, { "api_name": "const.DEFAULT_FOLDER", "line_number": 51, "usage_type": "argument" }, { "api_name": "const.DEFAUL...
518073459
from flask import request from flask.ext.login import current_user, login_required from app import app from app.util import serve_response, serve_error, admin_required from .models import BlogPost from app.modules.user_manager.models import User from sqlalchemy import desc from time import time import app.database as d...
null
auacm/app/modules/blog_manager/views.py
views.py
py
2,913
python
en
code
null
code-starcoder2
83
[ { "api_name": "app.database.session.query", "line_number": 12, "usage_type": "call" }, { "api_name": "app.modules.user_manager.models.User", "line_number": 12, "usage_type": "argument" }, { "api_name": "app.database.session", "line_number": 12, "usage_type": "attribute" ...
220521315
#!/usr/bin/env python # File : plotfile.py # Created : Thu Mar 26 2020 09:45:41 PM (+0100) # Author : Fabian Wermelinger # Description: Plotfile tool # Copyright 2020 ETH Zurich. All Rights Reserved. import numpy as np import argparse import os def parseArgs(): parser = argparse.ArgumentParser() ...
null
python/plotfile.py
plotfile.py
py
4,588
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.array", "...
380263326
import os import pickle from collections import defaultdict from graph import Node, Edge def check_all_nodes_present(visited_edges, cities_to_visit): visited_nodes = [edge.to_node for edge in visited_edges] return len(visited_nodes) == cities_to_visit + 1 def get_sum(edges): return sum(e.cost for e in...
null
MMAS.py
MMAS.py
py
3,755
python
en
code
null
code-starcoder2
83
[ { "api_name": "pickle.load", "line_number": 116, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 116, "usage_type": "call" }, { "api_name": "os.path", "line_number": 116, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", ...
564404381
# -*- coding: utf-8 -*- """ Created on Thu Sep 28 13:09:49 2017 @author: sahid """ #forest2020 from osgeo import gdal import numpy as np from numpy import * import glob #Load Metadata f = open('D:/PROJECT/FOREST 2020/TRAINING/PyQgis/DATA/clip/mtl.txt', 'r') #open file for reading def build_data(f): #build dictionar...
null
qgis/forest2020_1.py
forest2020_1.py
py
8,713
python
en
code
null
code-starcoder2
83
[ { "api_name": "glob.glob", "line_number": 27, "usage_type": "call" }, { "api_name": "osgeo.gdal.Open", "line_number": 30, "usage_type": "call" }, { "api_name": "osgeo.gdal", "line_number": 30, "usage_type": "name" }, { "api_name": "numpy.array", "line_number":...
141137939
from flask import Blueprint from flask import request from flask import jsonify from flask import make_response from app.v2.utils.validator import response, response_error from app.v2.models.office_model import Office from app.blueprints import v2 as bp from flask_jwt_extended import (jwt_required, get_jwt_identity) fr...
null
app/v2/views/offices.py
offices.py
py
2,775
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.request.get_json", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 17, "usage_type": "name" }, { "api_name": "app.v2.utils.validator.response_error", "line_number": 20, "usage_type": "call" }, { "api_na...
50317739
## Total is Generation (copy) import time import psycopg2 #postgres connection lib try: #connect to server conn = psycopg2.connect(host="localhost", port="5432", database="mapre", user="Anaavu", password="") #create cursor to execute SQL commands cur = conn.cursor() #the SQL query to execute cur.execute('SELECT ...
null
tools/tb_save_db.py
tb_save_db.py
py
1,567
python
en
code
null
code-starcoder2
83
[ { "api_name": "psycopg2.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 22, "usage_type": "call" }, { "api_name": "psycopg2.Error", "line_number": 41, "usage_type": "attribute" } ]
208058636
import graphene from graphene_django_subscriptions import Subscription from core.serializers import MessageSerializer class MessageSubscription(Subscription): class Meta: serializer_class = MessageSerializer stream = 'messages' description = 'Message Subscription' class RootSubscription...
null
core/graphql/subscriptions.py
subscriptions.py
py
398
python
en
code
null
code-starcoder2
83
[ { "api_name": "graphene_django_subscriptions.Subscription", "line_number": 7, "usage_type": "name" }, { "api_name": "core.serializers.MessageSerializer", "line_number": 9, "usage_type": "name" }, { "api_name": "graphene.ObjectType", "line_number": 14, "usage_type": "attri...
173188016
from BeautifulSoup import BeautifulSoup, Comment from django import template from django.utils.translation import ugettext as _ register = template.Library() ALLOWED_TAGS = 'p i strong b u a h1 h2 h3 pre br img' ALLOWED_TAGS_STRING = _("Allowed tags: ") + ALLOWED_TAGS def sanitize_html(value): valid_tags = ALLO...
null
anytask/tasks/templatetags/sanitize_html.py
sanitize_html.py
py
907
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.template.Library", "line_number": 6, "usage_type": "call" }, { "api_name": "django.template", "line_number": 6, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext", "line_number": 9, "usage_type": "call" }, { "api_name":...
559868576
from collections import defaultdict class TopVotedCandidate: def __init__(self, persons, times): """ :type persons: List[int] :type times: List[int] """ self.leadings = [(times[0], persons[0])] self.votes = defaultdict(int) for i in range(len(persons)): ...
null
src/online-election.py
online-election.py
py
1,141
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" } ]
600368818
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import numpy as np import scipy.io import pandas as pd import fnmatch import os import matplotlib.pyplot as plt import glob #find onset files matching .csv and return matlab cell array #run from dir containing onsets. def genOnsets(subjectDir): summary_files = [] ...
null
df2cell.py
df2cell.py
py
2,513
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 17, "usage_type": "call" }, { "api_name": "fnmatch.fnmatch", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
354065800
import pandas as pd import random as rnd from airflow import DAG from airflow.operators.bash_operator import BashOperator from airflow.operators.python_operator import PythonOperator, BranchPythonOperator from datetime import datetime, timedelta default_args={ 'owner':'Logan', 'depends_on_past': False, 's...
null
airflow/dags/treino03.py
treino03.py
py
2,422
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 17, "usage_type": "call" }, { "api_name": "airflow.DAG", "line_number": 21, "usage_type": "call" }, { "api_name": "airflow.operators.ba...
154170298
############################################################################### # # hubbardI: A TRIQS based hubbardI solver # # Copyright (c) 2020 Malte Schueler # # hubbardI 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 ...
null
hubbardI/2.2.x/_downloads/plot_dos.py
plot_dos.py
py
1,849
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytriqs.archive.HDFArchive", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 39, "usage_type": "call" }, { "api_name": "matpl...
567028203
from keras.preprocessing.image import ImageDataGenerator from keras.applications.vgg16 import preprocess_input from keras.preprocessing.image import load_img from keras.preprocessing.image import img_to_array class DataPreprocessor: def __init__(self): self.TRAIN_DIR = r"C:\Users\helga_sh\PycharmProjects\...
null
asl-alphabet/data/DataPreprocessor.py
DataPreprocessor.py
py
2,069
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.preprocessing.image.ImageDataGenerator", "line_number": 16, "usage_type": "call" }, { "api_name": "keras.preprocessing.image.ImageDataGenerator", "line_number": 24, "usage_type": "call" }, { "api_name": "keras.preprocessing.image.load_img", "line_number":...
73079484
import pytest from django.contrib.gis.geos import Point from django.utils import timezone from schema import Schema, Or from backend.models import Tag, Address from backend.serializers import TagSerializer from test.serializers.schema import is_blank, is_datetime pytestmark = pytest.mark.usefixtures("db") TAG_SCHEMA...
null
test/serializers/integration/tag_tests.py
tag_tests.py
py
1,737
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytest.mark.usefixtures", "line_number": 10, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 10, "usage_type": "attribute" }, { "api_name": "schema.Schema", "line_number": 12, "usage_type": "call" }, { "api_name": "test.serialize...
204361318
from __future__ import unicode_literals import frappe import requests import json from frappe.utils import get_url from frappe.utils import nowdate def execute(): project_url = get_url() support_settings = frappe.get_single("Support Settings") server_api_key = support_settings.server_api_key server_api_secret = ...
null
support_tickets/patches/set_support_token.py
set_support_token.py
py
917
python
en
code
null
code-starcoder2
83
[ { "api_name": "frappe.utils.get_url", "line_number": 9, "usage_type": "call" }, { "api_name": "frappe.get_single", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.request", "line_number": 19, "usage_type": "call" }, { "api_name": "frappe.throw",...
322412211
""" Plots evolution of ensembles """ # Takes size (or length of Markov chain or final time) of models as the command line argument # add modules folder to Python's search path import sys from pathlib import Path from os.path import dirname, realpath script_dir = Path(dirname(realpath(__file__))) module_dir = str(script...
null
python/experiments/EnKF Evolution/enkf5_evol.py
enkf5_evol.py
py
1,263
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.realpath", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path.insert", "lin...
145738640
from django.contrib import admin from .models import VoiceService, MessagePresentation, Choice, ChoiceOption, VoiceFragment, CallSession, CallSessionStep, KasaDakaUser, Language, VoiceLabel, Offer, Announcement, Record_offer, Record_announcement def format_validation_result(obj): """ Creates a HTML li...
null
vsdk/service_development/admin.py
admin.py
py
3,984
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 12, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 34, "usage_type": "attribute" ...
616586535
import re import logging import logging.config jobDefString = "DEFINE JOB ID=" jobsetDefString = "DEFINE JOBSET ID=" jobpredDefString = "DEFINE JOBPRED ID=" jobsetpredDefString = "DEFINE JOBSETPRED ID=" stationDefString = "DEFINE STATION ID=" triggerDefString = "DEFINE TRIGGER ID=" resourceDefString = "DEFINE RESOURCE...
null
JMO/JMOAnalyzer/GetDuplicateTriggers.py
GetDuplicateTriggers.py
py
2,230
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.config.fileConfig", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 25, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "re.ma...
478223243
# 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. """The workflow run API component provides m...
null
flowserv/service/run/local.py
local.py
py
20,458
python
en
code
null
code-starcoder2
83
[ { "api_name": "flowserv.service.run.base.RunService", "line_number": 41, "usage_type": "name" }, { "api_name": "flowserv.model.run.RunManager", "line_number": 47, "usage_type": "name" }, { "api_name": "flowserv.model.group.WorkflowGroupManager", "line_number": 47, "usage_...
263955903
import discord import redbot class Away(redbot.core.commands.Cog): """An away thingy to set away and be not away.""" def __init__(self, bot: redbot.core.bot.Red): self.bot = bot self.config = redbot.core.Config.get_conf( self, identifier=0x390440438, force_registration=True ...
null
away/__init__.py
__init__.py
py
7,611
python
en
code
null
code-starcoder2
83
[ { "api_name": "redbot.core", "line_number": 5, "usage_type": "attribute" }, { "api_name": "redbot.core", "line_number": 8, "usage_type": "attribute" }, { "api_name": "redbot.core.Config.get_conf", "line_number": 10, "usage_type": "call" }, { "api_name": "redbot.co...
162978005
# -*- coding: utf-8 -*- import cv2 import numpy as np import StringIO import datetime import pytz from math import cos, sin import angus.client def main(stream_index): camera = cv2.VideoCapture(stream_index) camera.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, 640) camera.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, 480) ...
null
audience-analytics/sceneanalysis_fromwebcam.py
sceneanalysis_fromwebcam.py
py
2,872
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.VideoCapture", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.cv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.cv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.cv", "line_number": ...
122142598
import datetime class Vessel: """Creates a vessel""" def __init__(self, name, imo, value): self.name = name self.imo = imo self.value = value self.value_date = datetime.datetime.now().strftime("%d/%m/%Y") self.owned = True self.sold_date = "" self.versio...
null
vessel.py
vessel.py
py
1,248
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.datetime.utcnow", "line_number": 14, "usage_type": "call" }, { "api_name": ...
165351031
######## # Copyright (c) 2018 GigaSpaces Technologies Ltd. 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...
null
cloudify_tf/utils.py
utils.py
py
6,974
python
en
code
null
code-starcoder2
83
[ { "api_name": "tempfile.mkdtemp", "line_number": 40, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 41, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 56, "usage_type": "call" }, { "api_name": "base64.encode", "line...
191552132
""" Use Case: Analyzing realtime data live on PC (nurse with a screen scenario) - source: serial (teensy) - save to logfile - realtime graph (short-term) - session graph (long-term) - realtime analysis x after-the-fact analysis """ DEBUG_ON = True TEENSY_VENDOR_ID = 0x16c0 TEENSY_PRODUCT_ID = 0x0483 DISPLAY...
null
realtime-analyze.py
realtime-analyze.py
py
2,234
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 27, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line...
370252112
from rest_framework import viewsets, views, status, permissions, filters from django_filters.rest_framework import DjangoFilterBackend from musics import models as musics_models from musics import serializers as musics_serializers from musics import validators as musics_validators from rest_framework.response import Re...
null
zonia-backend-master/musics/views.py
views.py
py
13,972
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "musics.base.views.ArtistViewSet", "line_number": 24, "usage_type": "attribute" }, { "api_name": "musics.base.views", "line_number": 24, "usage_type": "name" }, { "api_name...
56544606
import argparse import cv2 import datetime import json import matplotlib.pyplot as plt import numpy as np import os import os.path as osp import PIL.Image import PIL.ImageDraw import yaml from chainercv.utils.mask.mask_to_bbox import mask_to_bbox from grasp_data_generator.visualizations \ import vis_occluded_inst...
null
demos/grasp_data_generator/scripts/generate_evaluation_data.py
generate_evaluation_data.py
py
3,866
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "name" }, { "api_name": "os.path.realpath", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_num...
605299399
# -*- coding:utf-8 -*- from __future__ import unicode_literals import json import logging from tornado import gen from tornado.web import HTTPError from tornado.web import RequestHandler, asynchronous from tornado.concurrent import run_on_executor from concurrent.futures import ThreadPoolExecutor from tornado.option...
null
handlers/ansible_async.py
ansible_async.py
py
5,419
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "tornado.web.RequestHandler", "line_number": 22, "usage_type": "name" }, { "api_name": "tornado.web.RequestHandler", "line_number": 27, "usage_type": "name" }, { "api_name"...
229845543
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.action_chains import ActionChains import pandas as pd import time URL = 'https://www.imobiliare.ro/vanzare-apartamente/bucuresti' pages_to_scrape = 20 driver = webdriver.Chrome('./chromedriver') driver.get(URL) ...
null
RealEstateProject/scraper.py
scraper.py
py
2,976
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.CSS_SELECTOR", "line_number": 18, "usage_type": "attribute" ...
56986197
# ADOBE CONFIDENTIAL # # Copyright 2019 Adobe # All Rights Reserved. # # NOTICE: Adobe permits you to use, modify, and distribute this file in # accordance with the terms of the Adobe license agreement accompanying it. # If you have received this file from a source other than Adobe, # then your use, modification, or d...
null
SDPython/designer/testrunner.py
testrunner.py
py
1,940
python
en
code
null
code-starcoder2
83
[ { "api_name": "sd.getContext", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "lin...
347274376
# Importing libraries import numpy as np import torch from torch import nn import torch.nn.functional as F import matplotlib.pyplot as plt # Open text file and read in data as `text` with open('C:/Python Projects/Eb5002/Text Generation/data/Grimm_text.txt', 'r') as f: text = f.read() text=text.lower() # Showin...
null
Text Generation/LSTM Fairy Tale generation.py
LSTM Fairy Tale generation.py
py
14,242
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.multiply", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.float32", "line_numb...
335726029
from setuptools import setup requires = [ "toposort", "psycopg2-binary", "mysql-connector-python" ] setup(name='condenser', version='0.1', description='Condenser database subsetting tool', url='https://github.com/Spantree/condenser', author='Spantree, based on original work by Toni...
null
setup.py
setup.py
py
471
python
en
code
null
code-starcoder2
83
[ { "api_name": "setuptools.setup", "line_number": 9, "usage_type": "call" } ]
353972064
#--*-- coding:utf-8 --*-- from __future__ import print_function,division,unicode_literals from flask import Flask import pygal app = Flask(__name__) app.debug = True @app.route('/') def hello(): bar_chart = pygal.Bar() # Then create a bar graph object bar_chart.add('F...
null
附录工具篇/数据展现/app.py
app.py
py
469
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "pygal.Bar", "line_number": 10, "usage_type": "call" } ]
562484833
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # # Author : Dariusz Kowalczyk # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it...
null
sensors.py
sensors.py
py
7,416
python
en
code
null
code-starcoder2
83
[ { "api_name": "gpiozero.LED", "line_number": 53, "usage_type": "call" }, { "api_name": "gpiozero.Button", "line_number": 57, "usage_type": "call" }, { "api_name": "gpiozero.Button", "line_number": 58, "usage_type": "call" }, { "api_name": "gpiozero.MotionSensor", ...
385556219
from dataclasses import dataclass import csv from datetime import date import os import re from typing import Dict, Set from src.api.db.semester_info import semester_info as SemesterInfo from src.api.db.courses import Courses from tests.mock_cache import MockCache from src.api.tables import Base @dataclass(frozen=...
null
tests/test_data.py
test_data.py
py
2,510
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.date", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 28, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 16, "usage_type": "call" }, { "api_name": "typing.Dict", "...
394375660
from django.urls import path from django.contrib.auth.decorators import login_required from core.views import ( HomeView, ResourceListByCategoryView, ResourceListAddedByUserView, ResourceCreateView, ResourceUpdateView, ResourceDeleteView, ) urlpatterns = [ path( '', Hom...
null
core/urls.py
urls.py
py
1,142
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "core.views.HomeView.as_view", "line_number": 15, "usage_type": "call" }, { "api_name": "core.views.HomeView", "line_number": 15, "usage_type": "name" }, { "api_name": "djan...
60350049
import insightconnect_plugin_runtime from .schema import RaiseErrorInput, RaiseErrorOutput, Input, Component from insightconnect_plugin_runtime.exceptions import ConnectionTestException, PluginException # Custom imports below class RaiseError(insightconnect_plugin_runtime.Action): def __init__(self): sup...
null
samples/example/icon_example/actions/raise_error/action.py
action.py
py
1,437
python
en
code
null
code-starcoder2
83
[ { "api_name": "insightconnect_plugin_runtime.Action", "line_number": 7, "usage_type": "attribute" }, { "api_name": "schema.Component.DESCRIPTION", "line_number": 12, "usage_type": "attribute" }, { "api_name": "schema.Component", "line_number": 12, "usage_type": "name" }...
121398690
"""djangoProject 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...
null
项目名字/06代码/小组项目-网页开发/django_project/app001/urls.py
urls.py
py
1,089
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 20, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 20, "usage_type": "name" }, { "api_name": "...
576967598
import nmap from twilio.rest import Client import ssh_router from ip_scan import ip_scan #setup twillico# accountSID = '' # your account SID authToken = '' #your auth token twilioCli = Client(accountSID, authToken) TwilioNumber = '' #your twilio nr nr = '' #your mobile #port scanning# nm = nmap.PortScann...
null
netscan/network_scan.py
network_scan.py
py
1,756
python
en
code
null
code-starcoder2
83
[ { "api_name": "twilio.rest.Client", "line_number": 9, "usage_type": "call" }, { "api_name": "nmap.PortScanner", "line_number": 14, "usage_type": "call" }, { "api_name": "ssh_router.ssh_router", "line_number": 42, "usage_type": "call" }, { "api_name": "ip_scan.ip_s...
615570795
# coding=utf-8 # 获取网站的www 信息 import urllib.request import sys from builtins import print from bs4 import BeautifulSoup type = sys.getfilesystemencoding() class wwwInfo: ''' 抓取网站的标题等信息 ''' @classmethod def start_parse(self, domain, contacttool_info, getContactFlag): url = 'http://' + do...
null
getWwwwInfo.py
getWwwwInfo.py
py
2,708
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.getfilesystemencoding", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib.request.request.urlopen", "line_number": 23, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 23, "usage_type": "attribute" }, { ...
268574354
import os import sys sys.path.append( os.path.join(os.path.dirname(__file__), "../stability_l4dc") ) import torch import numpy as np from lpv import lpv_batched, lpv from eigen_plots import compute_eigenvalues, plot_eigenvalues import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable...
null
neuromancer/train_scripts/papers/stability_jmlr/test_weights.py
test_weights.py
py
3,946
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
30329919
"""Time-series Generative Adversarial Networks (TimeGAN) Codebase. Reference: Jinsung Yoon, Daniel Jarrett, Mihaela van der Schaar, "Time-series Generative Adversarial Networks," Neural Information Processing Systems (NeurIPS), 2019. Paper link: https://papers.nips.cc/paper/8789-time-series-generative-adversarial-n...
null
main_timegan.py
main_timegan.py
py
6,901
python
en
code
null
code-starcoder2
83
[ { "api_name": "warnings.filterwarnings", "line_number": 33, "usage_type": "call" }, { "api_name": "os.system", "line_number": 51, "usage_type": "call" }, { "api_name": "os.system", "line_number": 52, "usage_type": "call" }, { "api_name": "data_loading.real_data_lo...
164027014
from abrirVariosArchivos import joinSomeTextFromSomeFiles from chunking import get_sentences from chunking import get_text_string def getMayus(sentences): upperWords = [] for s in sentences: a = s.split() #print(s[0]) if a[0][0].isupper(): upperWords.append(a[0]) else...
null
Olga/SantoGrial/chinking.py
chinking.py
py
1,745
python
en
code
null
code-starcoder2
83
[ { "api_name": "spacy.load", "line_number": 28, "usage_type": "call" }, { "api_name": "chunking.get_text_string", "line_number": 47, "usage_type": "call" }, { "api_name": "chunking.get_sentences", "line_number": 48, "usage_type": "call" } ]
613038029
import copy import csv import os import random import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch from scipy.io import loadmat from skimage import io, transform ''' This script is for a data loader that randomly crops the input to be of different sizes. ''' def get_roi_len(dirs): ...
null
IPMI2021/src/data_loader_varying.py
data_loader_varying.py
py
8,186
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
584647585
import sys import pika import datetime import time from enum import IntEnum from threading import Thread, Lock, Event class LogLevel(IntEnum): Elections = 1 Failures = 2 Events = 3 Methods = 4 Debug = 5 Ping = 6 All = 7 global_log_level = LogLevel.All def Log(level, message): if level...
null
distributed_systems/lab1/node.py
node.py
py
10,765
python
en
code
null
code-starcoder2
83
[ { "api_name": "enum.IntEnum", "line_number": 8, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pika.Blockin...
502692479
import re from setuptools import find_packages, setup with open("README.md", "rt") as f: readme = f.read() setup( name="google-events", version="0.0.1", url="https://github.com/googleapis/google-cloudevents", project_urls={ "Source": "https://github.com/googleapis/google-cloudevents", ...
null
setup.py
setup.py
py
1,251
python
en
code
null
code-starcoder2
83
[ { "api_name": "setuptools.setup", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 34, "usage_type": "call" } ]
173320092
import collections import copy import os import re import sys import gc from datetime import datetime, timedelta from time import strftime import numpy as np import scipy as sp import pandas as pd import nltk from nltk.stem import WordNetLemmatizer from nltk.stem.porter import PorterStemmer from nltk.stem import Snowba...
null
app/scripts/bugclassifier.py
bugclassifier.py
py
36,732
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 37, "usage_type": "attribute" }, { "api_name": "configuration.RANDOM_STATE", "line_number": 37, "usage_type": "attribute" }, { "api_name": "n...
49664204
from flask import Blueprint, request from flask.json import jsonify import SQL, Config import concurrent.futures as cf import pandas as pd import sys import logging detect = Blueprint('detect', __name__, template_folder='templates') def custom_hiscore(detection): # input validation bad_name = False detect...
null
plugin/detect.py
detect.py
py
2,529
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Blueprint", "line_number": 9, "usage_type": "call" }, { "api_name": "SQL.name_check", "line_number": 14, "usage_type": "call" }, { "api_name": "SQL.name_check", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.debug", "lin...
624466939
import pygame import index from constants import * hold_buttons = [0,0, 0,0, 0,0,0,0] release_buttons = [0,0, 0,0, 0,0,0,0] def key_listen(): release_buttons = [0,0, 0,0, 0,0,0,0] for event in pygame.event.get(): if event.type == pygame.KEYDOWN: if event.key == B_RIGHT: ...
null
controls/__init__.py
__init__.py
py
1,053
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.event.get", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.event", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pygame.KEYDOWN", "line_number": 14, "usage_type": "attribute" }, { "api_name": "index.X_AXIS",...
606810821
from django.shortcuts import render from django.http import HttpResponse from django.shortcuts import render,render_to_response from django import forms from django.db.utils import OperationalError from . import models from . import functions from .models import Model, Task, Process,User from .Graph import Graph from...
null
model/views.py
views.py
py
26,328
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 26, "usage_type": "call" }, { "api_name": "models.User.objects.get", "line_number": 30, "usage_type": "call" }, { "api_name": "mo...
571985760
######################################## # # # This is the score board of the game # # # ######################################## import pygame from pygame.locals import * from sys import exit from getpos import * from sprite_class import * fr...
null
scoreboard.py
scoreboard.py
py
1,168
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.font.Font", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 34, "usage_type": "call" }, { "api_name": "pygame.font.Font", ...
375635333
import discogs_client import spotipy def find_artist(name): """ Returns the first artist found at discogs and Spotify with the given name. If no items are found None is returned """ artists_discogs = discogs.search(name, type='artist') artists_spotify = spotify.search(q='artist:' + name, type='art...
null
band_booking/artist_information_collectors/artist_information.py
artist_information.py
py
5,347
python
en
code
null
code-starcoder2
83
[ { "api_name": "spotipy.Spotify", "line_number": 173, "usage_type": "call" }, { "api_name": "discogs_client.Client", "line_number": 174, "usage_type": "call" } ]
215760835
# Copyright 2014 Rackspace # # 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 agree...
null
octavia/tests/unit/api/handlers/queue/test_producer.py
test_producer.py
py
9,492
python
en
code
null
code-starcoder2
83
[ { "api_name": "octavia.tests.unit.base.TestCase", "line_number": 44, "usage_type": "attribute" }, { "api_name": "octavia.tests.unit.base", "line_number": 44, "usage_type": "name" }, { "api_name": "mock.Mock", "line_number": 47, "usage_type": "call" }, { "api_name"...
205694379
## # See the file COPYRIGHT for copyright information. # # 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
src/ims/run/_server/_server.py
_server.py
py
3,324
python
en
code
null
code-starcoder2
83
[ { "api_name": "twisted.web.server.Session", "line_number": 42, "usage_type": "name" }, { "api_name": "twisted.logger.Logger", "line_number": 52, "usage_type": "call" }, { "api_name": "typing.Sequence", "line_number": 56, "usage_type": "name" }, { "api_name": "_opt...