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
376128940
from requests.exceptions import Timeout import requests import asyncio import json import random import string import time import sys from termcolor import colored import time import subprocess #list of relevant ports listOfPorts = ["13801", "13802", "13803", "13804", "13805"] portToVarMap = {"13801":"v...
null
test/lbscript.py
lbscript.py
py
11,730
python
en
code
null
code-starcoder2
76
[ { "api_name": "termcolor.colored", "line_number": 17, "usage_type": "call" }, { "api_name": "termcolor.colored", "line_number": 18, "usage_type": "call" }, { "api_name": "termcolor.colored", "line_number": 19, "usage_type": "call" }, { "api_name": "termcolor.color...
627743777
from django.contrib import admin from django.urls import path, include admin.site.site_header = "Exam Portal Admin" admin.site.site_title = "Exam Portal Admin Portal" admin.site.index_title = "Welcome to Exam Portal" urlpatterns = [ path('admin/', admin.site.urls), path('', include('main.urls')), path('pr...
null
portal/urls.py
urls.py
py
399
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.site", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 4, "usage_type": "name" }, { "api_name": "django.contrib.admin.site", "line_number": 5, "usage_type": "attribute" }, { "a...
462809074
#!/usr/bin/env python3 import sys from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfparser import PDFParser from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.pdfdevice import PDFDevice, TagExtractor from pdfminer.pdfpage import PDFPage from pdfminer.converter import XMLConv...
null
parser.py
parser.py
py
7,163
python
en
code
null
code-starcoder2
76
[ { "api_name": "getopt.getopt", "line_number": 26, "usage_type": "call" }, { "api_name": "getopt.GetoptError", "line_number": 27, "usage_type": "attribute" }, { "api_name": "pdfminer.layout.LAParams", "line_number": 48, "usage_type": "call" }, { "api_name": "pdfmin...
388484071
from django.shortcuts import render from django.http import HttpResponse from attention.models import Attention from users.models import Users from django.contrib.auth.models import User # Create your views here. def attentionOne(request): if request.is_ajax(): nickname = request.GET['nickname'] print(nickname) ...
null
myforum/attention/views.py
views.py
py
1,480
python
en
code
null
code-starcoder2
76
[ { "api_name": "users.models.Users.objects.get", "line_number": 12, "usage_type": "call" }, { "api_name": "users.models.Users.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "users.models.Users", "line_number": 12, "usage_type": "name" }, { ...
272738204
import os import subprocess import urllib import MaxPlus from PySide2 import QtCore, QtGui from PySide2 import QtWidgets from PySide2.QtCore import QFile from PySide2.QtGui import QIcon, QColor from PySide2.QtUiTools import QUiLoader from PySide2.QtWidgets import QMessageBox, QVBoxLayout, QSizePolicy, QFileDialog, QPu...
null
AnimRef/Contents/2020/animref.py
animref.py
py
12,850
python
en
code
null
code-starcoder2
76
[ { "api_name": "PySide2.QtWidgets.QDialog", "line_number": 16, "usage_type": "name" }, { "api_name": "MaxPlus.GetQMaxMainWindow", "line_number": 17, "usage_type": "call" }, { "api_name": "PySide2.QtCore.Qt", "line_number": 22, "usage_type": "attribute" }, { "api_na...
551164896
from typing import List class Solution: def PredictTheWinner(self, nums: List[int]) -> bool: numLen = len(nums) dp = [[0] * numLen] * numLen for k,v in enumerate(nums): dp[k][k] = v for i in range(numLen - 2, -1, -1): for j in range(i + 1, numLen): ...
null
pythonProj/leetcode/486.PredictTheWinner.py
486.PredictTheWinner.py
py
561
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 3, "usage_type": "name" } ]
152946621
""" .. See the NOTICE file distributed with this work for additional information regarding copyright ownership. 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.or...
null
CHiC/tool/bam2chicago_tool.py
bam2chicago_tool.py
py
7,206
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.logger.warn", "line_number": 35, "usage_type": "call" }, { "api_name": "utils.logger", "line_number": 35, "usage_type": "name" }, { "api_name": "utils.logger.warn", "line_number": 36, "usage_type": "call" }, { "api_name": "utils.logger", "...
558729251
""" Interactive shell """ import itertools import os import re import fire from parrotfish.utils import CustomLogging, get_callables from prompt_toolkit import prompt from prompt_toolkit.contrib.completers import WordCompleter, PathCompleter from prompt_toolkit.styles import style_from_dict from prompt_toolkit.token ...
null
parrotfish/shell.py
shell.py
py
5,899
python
en
code
null
code-starcoder2
76
[ { "api_name": "parrotfish.utils.CustomLogging.get_logger", "line_number": 16, "usage_type": "call" }, { "api_name": "parrotfish.utils.CustomLogging", "line_number": 16, "usage_type": "name" }, { "api_name": "prompt_toolkit.contrib.completers.WordCompleter", "line_number": 19,...
637450746
import numpy as np from collections import OrderedDict class hmm(): def __init__(self,S, A, B, pi, E): """ Initialisation des paramètres du HMM ---------- states (Tuple) : Liste des états du modèle E (Tuple) : Liste des émissions du modèle A (Matrice) : Probabilités ...
null
hmm.py
hmm.py
py
9,990
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.choice", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.random.choice", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.rando...
487483567
import numpy as np import networkx as nx import argparse import random from models.distance import get_dist_func # NOTE: g-score is the path cost. # NOTE: f-score is the path cost + heuristic. def heuristic(network, node, goal, dist_func): """ Heuristic function for estimating distance from specified node to ...
null
sp_astar.py
sp_astar.py
py
8,431
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 80, "usage_type": "call" }, { "api_name": "numpy.inf", "line_number": 92, "usage_type": "attribute" }, { "api_name": "numpy.inf", "line_number": 97, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", ...
302299598
# -*- coding: utf-8 -*- from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0004_event_photo_credit'), ] operations = [ migrations.CreateModel( name='Story', fields=[ ('id', models.AutoField(ve...
null
core/migrations/0005_story.py
0005_story.py
py
724
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 12, "usage_type": "call" }, ...
315187875
#!install some modules all in one go # # Hi There! # You may be wondering what this does. You should be able to work it out. # # Pip is a thing that installs packages, and you presumably want to install packages, so first run 'get-pip.py', # then install the VCForPython library (from MS) and the then run this script #...
null
qtlab_013/get-modules.py
get-modules.py
py
709
python
en
code
null
code-starcoder2
76
[ { "api_name": "pip.main", "line_number": 14, "usage_type": "call" } ]
633586309
import requests import bs4 from urllib.request import urlopen as uReq from bs4 import BeautifulSoup as soup # from bs4 import BeautifulSoup my_url = "https://www.nasdaq.com/symbol/aapl/historical" uClient = uReq(my_url) page_html = uClient.read() uClient.close() page_soup = soup(page_html, "html.parser") containe...
null
apple_stock.py
apple_stock.py
py
1,444
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.urlopen", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 15, "usage_type": "call" } ]
300744205
import npyscreen as np import curses from flightrecorder.appbase.constants import * from flightrecorder.forms.frconstants import * from flightrecorder.appbase.frmbase import AppBaseActionFormV2 class QueryForm(AppBaseActionFormV2): """Base form for querying the flight recorder database""" def create(self): ...
null
src/flightrecorder/forms/frquery.py
frquery.py
py
8,101
python
en
code
null
code-starcoder2
76
[ { "api_name": "flightrecorder.appbase.frmbase.AppBaseActionFormV2", "line_number": 8, "usage_type": "name" }, { "api_name": "npyscreen.GridColTitles", "line_number": 14, "usage_type": "attribute" }, { "api_name": "curses.ascii", "line_number": 15, "usage_type": "attribute...
411540031
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import configparser from hermes_python.hermes import Hermes from hermes_python.ffi.utils import MqttOptions from hermes_python.ontology import * from openhab import openHAB import io base_url = 'http://192.168.178.97:8080/rest' openhab = openHAB(base_url) MQTT_ADDR = "19...
null
action-light_on.py
action-light_on.py
py
1,674
python
en
code
null
code-starcoder2
76
[ { "api_name": "openhab.openHAB", "line_number": 12, "usage_type": "call" }, { "api_name": "configparser.SafeConfigParser", "line_number": 17, "usage_type": "attribute" }, { "api_name": "io.open", "line_number": 23, "usage_type": "call" }, { "api_name": "configpars...
217945715
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Oct 22 10:41:35 2017 @author: zander """ from scraper import scrape from selenium import webdriver import csv import os import re from datetime import datetime from functools import reduce # This script runs each day. It starts by checking some log fi...
null
src/webscraper/fulton/reg_script.py
reg_script.py
py
5,865
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 26, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", ...
621800643
""" Read in a pre-processed Fraud data-file and build a model - load data - separate into a Train and Valid set - train a model ** MODEL 1 - Random Forest ** - predict against the Valid set, print basic accuracy day - pickle model and save """ import argparse import gc import datetime import numpy as np import p...
null
train_model1.py
train_model1.py
py
2,647
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 27, "usage_type": "call" }, { "api_name": "...
5026294
# uncompyle6 version 3.7.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.linux-x86_64/egg/ditz/objects.py # Compiled at: 2016-11-27 06:27:17 """ Internal Ditz objects. """ import os, re, yaml, hashlib, random, six from cer...
null
pycfiles/pyditz-0.10.3-py2.7/objects.py
objects.py
py
12,562
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 19, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "yaml.YAMLObject", "line_number": 22, "usage_type": "attribute" }, { "api_name": "yaml.SafeLoader", "lin...
206510150
import matplotlib matplotlib.use('GTK3Agg') import matplotlib.pyplot as plt import xlrd import csv import pandas as pd import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class FileChooserWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="FileChooser Example") ...
null
simplechart.py
simplechart.py
py
2,720
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 2, "usage_type": "call" }, { "api_name": "gi.require_version", "line_number": 8, "usage_type": "call" }, { "api_name": "gi.repository.Gtk.Window", "line_number": 11, "usage_type": "attribute" }, { "api_name": "gi.repo...
37689569
# -*- coding: utf-8 -*- __author__ = 'yjin' from PyQt4 import QtGui, QtCore from calculator import * import style class WidgetD(QtGui.QWidget): SIZE = 60 MONTH_RANGES = {} CHANGE_DAYS = {} def __init__(self, parent=None): super(WidgetD, self).__init__(parent) palette = QtGui.QPalette(...
null
widget_d.py
widget_d.py
py
5,281
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt4.QtGui.QWidget", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 7, "usage_type": "name" }, { "api_name": "PyQt4.QtGui.QPalette", "line_number": 15, "usage_type": "call" }, { "api_name": "PyQt4.QtGui",...
324867594
#!/usr/bin/env python #***************************************************************************/ #* #* Copyright (c) 2007 Vonage Holdings Corp. #* All rights reserved. #* #* #***************************************************************************/ # """ """ from vonage....
null
security_key_validator/security_key_validator_common.py
security_key_validator_common.py
py
3,607
python
en
code
null
code-starcoder2
76
[ { "api_name": "vonage.dispatcher.handler.Handler.execute_query", "line_number": 57, "usage_type": "call" }, { "api_name": "vonage.dispatcher.handler.Handler", "line_number": 57, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 65, "usage_type"...
414259740
from django.http.response import JsonResponse from rest_framework.decorators import api_view from .serializers import BookSerializer, CatalogueSerializer from .models import Book, Catalogue from rest_framework.parsers import JSONParser from rest_framework import status from drf_yasg.utils import swagger_auto_schema @s...
null
django_library_management/management/views.py
views.py
py
6,098
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Catalogue.objects.all", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Catalogue.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "models.Catalogue", "line_number": 17, "usage_type": "name" }, { "api_n...
327783253
# -*- coding: utf-8 -*- import pandas as pd import requests from bs4 import BeautifulSoup import re import time import datetime as dt import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) def getDict(): url_list = ['https://cn.investing.com/indices/major-indices', ...
null
report/ReportData0602.py
ReportData0602.py
py
20,769
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib3.disable_warnings", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 104, "usage_type": "call" }, { "api_name": "re...
516443205
import numpy as np from scipy.integrate import quad from matplotlib import pyplot as plt #DEFINE PARAMETERS N = input('Pick the dimension of your basis, N = ') V0 = input('Pick the amplitude of the periodic potential, V_0 = ') a = 1.0 kmaxDa=1.0 vidd = range(1,int(N+1)) #To map elements to array/matrix stepsize=100 ...
null
Energy spectrum and probability density of an electron in a periodic potential/src/reiknistefja.py
reiknistefja.py
py
2,850
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sin", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.diag", "line_number": 21,...
110596859
from django import forms class SearchForm(forms.Form): Search = forms.CharField(label='Search', max_length=100) main_filters= ( ('all', 'All'), ('images', 'Images'), ('audios', 'Audios'), ('videos', 'Videos'), ('documents', 'Documents'), ) educationallevel_filters=( ('sel','Select Educ...
null
gliteapp/forms.py
forms.py
py
3,310
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.Form", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 4, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 5, "usage_type": "call" }, { "api_name": "django.forms"...
389029585
# window.py # # MIT License # # Copyright (c) 2020 Andrey Maksimov <meamka@ya.ru> # # 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 without limitation the right...
null
norka/window.py
window.py
py
16,220
python
en
code
null
code-starcoder2
76
[ { "api_name": "gi.repository.Gtk.ApplicationWindow", "line_number": 39, "usage_type": "attribute" }, { "api_name": "gi.repository.Gtk", "line_number": 39, "usage_type": "name" }, { "api_name": "gi.repository.Gio.Settings", "line_number": 42, "usage_type": "attribute" },...
458423446
# coding: utf-8 from __future__ import unicode_literals from django.conf.urls import include, patterns, url from django.contrib import admin from .views import InvitationView, \ InvitationCompletedView, \ RequestAccessView, \ RequestAccessCompletedView, \ RedeemInvitationView admin.autodiscover() ur...
null
django_rocket/urls.py
urls.py
py
903
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 13, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 13, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 15, "usage_type": "call" }, { "...
79886942
import matplotlib.pyplot as plt import string import matplotlib.patches as mpatches #class to hold the data: class dstorage: #input data: Sales = [] TonsSold = [] COGS = [] MonthlyInv = [] OT = [] R=[] RS = [] BT = [] Adjusts = [] #calculated from inputs: ManHours = [] TonsPerManHour = [] COGT =[] ...
null
KBI_15month.py
KBI_15month.py
py
3,622
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 89, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 89, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.savefig", "line_number": 128, "usage_type": "call" }, { "api_name": ...
400104276
"""Main shim logic""" import argparse import functools import os import re import subprocess import sys from typing import ( Callable, Dict, Hashable, Iterator, List, Optional, Sequence, Set, Tuple, TypeVar, Union, ) import semver from nvshim import __version__ from nvshim....
null
src/nvshim/core/__main__.py
__main__.py
py
14,992
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.TypeVar", "line_number": 35, "usage_type": "call" }, { "api_name": "typing.TypeVar", "line_number": 36, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 39, "usage_type": "name" }, { "api_name": "typing.Hashable", "line...
91694145
# import GPy # import GPyOpt # from numpy.random import seed # import matplotlib # # def myf(x): # return 2*x**2 # # bounds = [{'name': 'var_1', 'type': 'continuous', 'domain': (-1, 1)}] # # max_iter = 10 # # myProblem = GPyOpt.methods.BayesianOptimization(myf, bounds) # # myProblem.run_optimization(max_iter) # # p...
null
GPyOptFiles/GPyOptTest2.py
GPyOptTest2.py
py
2,405
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 53, "usage_type": "call" }, { "api_name": "GPyOpt.objective_examples.experiments2d.rosenbrock", "line_number": 56, "usage_type": "call" }, { "api_name": "GPyOpt.objective_examples", "line_number": 56, "usage_type": "attrib...
29103705
""" 检查一个在同一个平面上的力系是否处于静力平衡状态 python/black : true flake8 : passed mypy : passed """ from numpy import array, cos, sin, radians, cross # type: ignore from typing import List def 角坐标力( 力的大小: float, 角度: float, 弧度: bool = False ) -> List[float]: """ 沿矩形分量分解力 (力的大小, 角度) => (x分量, y分量) >>> 角坐标力(10, 45...
null
算术代数分析/合力为零.py
合力为零.py
py
2,618
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.cos", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.radians", "line_number": 27, ...
339951443
import json import numpy as np from tabulate import tabulate import os import matplotlib.pyplot as plt #Source: Andy Keene - https://github.com/andy-keene/ML/blob/master/perceptron/helpers/helper.py def print_matrix_as_table(file_name): ''' Prints the confusion matrix of a json obj as a pretty table Args: ...
null
generalutility.py
generalutility.py
py
1,754
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 20, "usage_type": "call" }, { "api_name": "tabulate.tabulate", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.exists", "line_nu...
353244724
import numpy as np import pandas as pd import pickle from matplotlib.colors import ListedColormap from sklearn import svm import matplotlib.pyplot as plt from AdversaryM import AdversaryM from oracles.train_oracles import Oracle np.random.seed(2019) n = 10 npl = 4 mpl = 3 budget = 40 filename = '../oracles/oracle_s...
null
example/moons.py
moons.py
py
2,657
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 19, "usage_type": "call" }, { "api_name": "sklearn.svm.SVC", ...
551889267
import json import os import sys from io import StringIO import pandas as pd from environs import Env from flask import jsonify, request from pandas.io.json import json_normalize from .ETL.extract import Extract from .ETL.load import Speed, Activity, Activity_Test, db, app, Persist from .ETL.transform import Transfor...
null
flask-on-docker (copy)/services/web/project/__init__.py
__init__.py
py
2,019
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 15, "usage_type": "call" }, { "api_name": "environs.Env", "line_numb...
152457295
import re from collections import Counter import matplotlib.pyplot as plt def translate_from_dna_to_rna(dna: str) -> str: """Function translate DNA sequence to RNA sequence """ base_complement = {'C': 'G', 'G': 'C', 'T': 'A', 'A': 'U'} rna = '' for nucleobase in dna: rna += base_complement[nuc...
null
01-Data-Structures/carrots/carrots.py
carrots.py
py
3,122
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.findall", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 37, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 34, "usage_type": "name" }, { "api_name": "matplotlib.pyplot....
191622091
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ creating the dataset """ # import tensorflow as tf # from tensorflow.keras.models import Sequential, load_model # from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten, Conv2D, MaxPooling2D # from tensorflow.keras.callbacks import EarlyStopping, Mo...
null
LICENSE.md/classification/FC_DNN/NN_v2.py
NN_v2.py
py
5,320
python
en
code
null
code-starcoder2
76
[ { "api_name": "timeit.default_timer", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 96, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "...
472590371
import cv2 as cv import numpy as np import pandas as pd import os import util import random # params for ShimTomasi corner detection feature_params = dict( maxCorners = 100, qualityLevel = 0.3, minDistance = 7, blockSize = 7 ) # params for Lucas Kan...
null
feature_extractor.py
feature_extractor.py
py
4,862
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.TERM_CRITERIA_EPS", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cv2.TERM_CRITERIA_COUNT", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 21, "usage_type": "call" }, { "api_name...
65088885
""" The plasma dispersion function ============================== Let's import some basics (and `PlasmaPy`!) """ import numpy as np import matplotlib.pyplot as plt ####################################################################### import plasmapy.formulary.dispersionfunction help(plasmapy.formulary.dispersion...
null
plasmapy/examples/plot_dispersion_function.py
plot_dispersion_function.py
py
3,239
python
en
code
null
code-starcoder2
76
[ { "api_name": "plasmapy.formulary.dispersionfunction.formulary", "line_number": 15, "usage_type": "attribute" }, { "api_name": "plasmapy.formulary.dispersionfunction", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 21, "usage_typ...
649643838
# _*_ coding: utf-8 import os import datetime import uuid import json import tornado.gen import tornado.concurrent from app.api.html_common import HtmlHandler from app.api.view_common import CommonHandler from app.configs import configs from app.common.forms import AccountAddForm, LoginForm from werkzeug.security impor...
null
app/userInfo/view_account.py
view_account.py
py
5,331
python
en
code
null
code-starcoder2
76
[ { "api_name": "app.api.view_common.CommonHandler", "line_number": 17, "usage_type": "name" }, { "api_name": "tornado.gen.gen", "line_number": 18, "usage_type": "attribute" }, { "api_name": "tornado.gen", "line_number": 18, "usage_type": "name" }, { "api_name": "os...
610719895
# Time: O(n) # Space: O(1) # a ^ 0 = a, a ^ a = 0 # a ^ b = (a & !b) || (!a & b) # a's 1 is b's 0 a's 0 is b's 1 # 137 # Given an array of integers, every element appears three times except for one. Find that single one. # # Note: # Your algorithm should have a linear runtime complexity. Could you implement it...
null
Python/single-number-ii.py
single-number-ii.py
py
3,860
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 48, "usage_type": "call" } ]
230505719
from typing import List import numpy as np import pandas as pd def prep_data4eval(gt_df: pd.DataFrame, pred_df: pd.DataFrame) -> List: merged_df = pd.merge( gt_df, pred_df, on=["query", "top_n"], how="left", suffixes=["_gt", "_pred"] ) merged_df.drop( index=merged_df[merged_df["text_page_...
null
other/evaluation.py
evaluation.py
py
1,971
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pandas.merge", "line_number": 8, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.List", "line_n...
427478775
import os import PySide.QtGui as QtGui import PySide.QtCore as QtCore from Utils import ftrack_utils2 import maya.cmds as cmds class ReferenceGUI(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.setWindowTitle('Reference UI') self.setLayout(QtGui....
null
maya/scripts/python/layout/reference_gui.py
reference_gui.py
py
7,437
python
en
code
null
code-starcoder2
76
[ { "api_name": "PySide.QtGui.QWidget", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PySide.QtGui", "line_number": 8, "usage_type": "name" }, { "api_name": "PySide.QtGui.QWidget.__init__", "line_number": 11, "usage_type": "call" }, { "api_name": "Py...
163831447
import bpy, textwrap, os, sys from .. import fountain from pathlib import Path class SCREENWRITER_OT_preview_fountain(bpy.types.Operator): '''Updates the preview''' bl_idname = "scene.preview_fountain" bl_label = "Refresh" @classmethod def poll(cls, context): space = bpy.context.space_dat...
null
operators/preview_fountain.py
preview_fountain.py
py
7,655
python
en
code
null
code-starcoder2
76
[ { "api_name": "bpy.types", "line_number": 6, "usage_type": "attribute" }, { "api_name": "bpy.context", "line_number": 13, "usage_type": "attribute" }, { "api_name": "bpy.context", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "l...
305165207
import onmt.transforms.bpe as bpe import argparse from tqdm import tqdm parser = argparse.ArgumentParser() parser.add_argument('--file', type=str, required=True) parser.add_argument('--table', type=str, required=True, help='Path to merge table') parser.add_argument('--target', type=str, default...
null
onmt/tokenize_text.py
tokenize_text.py
py
908
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "onmt.transforms.bpe.load_subword_nmt_table", "line_number": 14, "usage_type": "call" }, { "api_name": "onmt.transforms.bpe", "line_number": 14, "usage_type": "name" }, { ...
537969311
import os, sys, subprocess import xml.etree.ElementTree as ET from xml.dom import minidom import CompilationEngine from Tokenizer import Tokenizer class JackAnalyzer(): def __init__(self): pass def read_file_or_dir(self, path): if os.path.isdir(path): for filename in os.li...
null
projects/10/JackAnalyzer/JackAnalyzer.py
JackAnalyzer.py
py
5,297
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number...
587135229
from keras.layers.convolutional import Conv2D, MaxPooling2D from keras.layers.normalization import BatchNormalization from keras.layers import Activation, Flatten, Dropout, Dense, GlobalAveragePooling2D from keras.models import Sequential, load_model from keras.optimizers import Adam import tensorflow as tf import ker...
null
agent_model.py
agent_model.py
py
5,058
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.callbacks.TensorBoard", "line_number": 17, "usage_type": "name" }, { "api_name": "tensorflow.summary.FileWriter", "line_number": 23, "usage_type": "call" }, { "api_name": "tensorflow.summary", "line_number": 23, "usage_type": "attribute" }, { ...
232051255
from collections import defaultdict import networkx as nx from time import time uBound = 100000000 LEN = 9 def seive(N): A = [True]*(N+1) i = 2 while i*i < N: if A[i]: j = 2*i while j <= N: A[j] = False j += i i += 1 pDict = default...
null
51-100/problem060/60.py
60.py
py
1,117
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 16, "usage_type": "call" }, { "api_name": "time.time", "line_number": 31, "usage_type": "call" }, { "api_name": "time.time", "line_number": 33, "usage_type": "call" }, { "api_name": "networkx.Graph", "lin...
466359634
#!/usr/bin/env python """xrandr dmenu script. Add dmenu formatting options and default terminal if desired to ~/.config/xrandr-dmenu/config.ini """ import itertools import locale import os import shlex import sys import re from os.path import expanduser from collections import OrderedDict from subprocess import Popen...
null
xrandr-dmenu.py
xrandr-dmenu.py
py
9,152
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.copy", "line_number": 22, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 22, "usage_type": "attribute" }, { "api_name": "locale.getpreferredencoding", "line_number": 24, "usage_type": "call" }, { "api_name": "ConfigPar...
545557243
from model import create_model from model import test_predictions import pandas as pd import numpy as np import matplotlib.pyplot as plt from pandas import DataFrame data = "SPY-5-years.csv" model = create_model(data) predictions, etf_prices = test_predictions(model,"SPY.csv") p_list = predictions.tolist() balance = 10...
null
Main.py
Main.py
py
1,277
python
en
code
null
code-starcoder2
76
[ { "api_name": "model.create_model", "line_number": 8, "usage_type": "call" }, { "api_name": "model.test_predictions", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 39, "usage_type": "call" }, { "api_name": "matplo...
277601844
#!/usr/bin/env python ############################################################################## # # Copyright (c) 2009-2010 Nexedi SA and Contributors. All Rights Reserved. # Gabriel M. Monnerat <gabriel@tiolive.com> # # WARNING: This program as such is intended to be used by professional # prog...
null
cloudooo/handler/ooo/helper/unoconverter.py
unoconverter.py
py
14,123
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 82, "usage_type": "call" }, { "api_name": "com.sun.star.beans.PropertyValue", "line_number": 92, "usage_type": "call" }, { "api_name": "com.sun.star.beans.PropertyValue", "line_number": 102, "usage_type": "call" }, { ...
153949547
from bs4 import BeautifulSoup from pprint import * import requests import json def rem_end_alpa(s): index = len(s) rm_index = 0 while str.isalpha(s[index-1]): rm_index += 1 index -= 1 return s[:-rm_index] def get_courses(url): r = requests.get(url) html = r.content soup = BeautifulSoup(html,'html.pars...
null
backend_scripts/universities_scrapes/UB/UB_scrape.py
UB_scrape.py
py
2,648
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 60, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
562271245
#!/usr/bin/env python # coding: utf-8 # In[1]: from bs4 import BeautifulSoup import requests # In[2]: def pass_url(url): headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36'} # In[3]: # In[4]: r = ...
null
main/scrappers/AMAZON_SCRAPPER.py
AMAZON_SCRAPPER.py
py
940
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 23, "usage_type": "call" } ]
155572277
#!/usr/bin/env python # stdlib imports import sqlite3 from xml.dom import minidom import os.path import sys import copy import time # third party imports import pandas as pd import numpy as np from openquake.hazardlib import imt as GEM_IMT # local imports from shakemap.grind.gmice.wgrw12 import WGRW12 from .distance...
null
shakemap/grind/station.py
station.py
py
16,288
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.isnan", "line_number": 97, "usage_type": "call" }, { "api_name": "xml.dom.minidom.parse", "line_number": 136, "usage_type": "call" }, { "api_name": "xml.dom.minidom", "line_number": 136, "usage_type": "name" }, { "api_name": "xml.dom.minidom.D...
532019835
import requests import time import random import string spread_list = ['Fluids', 'Touch', 'Air'] while(1): disease_name = ''.join([random.choice(string.ascii_lowercase) for n in xrange(5)]) spread = spread_list[random.randint(0,2)] url_get = 'http://130.211.234.22:80/person' #url_get = 'htt...
null
sensors/disease_creator.py
disease_creator.py
py
1,084
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.choice", "line_number": 9, "usage_type": "call" }, { "api_name": "string.ascii_lowercase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.get",...
354484867
"""Initialization of the Web App""" import json import flask from flask_httpauth import HTTPTokenAuth from flask_sqlalchemy import SQLAlchemy # from flask_wtf.csrf import CSRFProtect with open('config.json') as f: CONFIG_INFO = json.load(f) DATABASE_URI = ( 'mysql+pymysql://' + CONFIG_INFO['database']['us...
null
nintendb/__init__.py
__init__.py
py
1,151
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 23, "usage_type": "call" }, { "api_name": "flask_httpauth.HTTPTokenAuth", "line_number": 24, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQ...
638757933
# -*- coding: utf-8 -*- from odoo import models, fields, api from odoo.exceptions import UserError import logging # El modelo 'sinc_bigcommerce.base' define varios métodos que son utilizados por varios modelos del módulo de sincronización. # Esta clase está diseñada para ser heredada por otros modelos, y no para crea...
null
models/base.py
base.py
py
7,112
python
en
code
null
code-starcoder2
76
[ { "api_name": "odoo.models.AbstractModel", "line_number": 9, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 9, "usage_type": "name" }, { "api_name": "logging.warn", "line_number": 101, "usage_type": "call" }, { "api_name": "logging.warn",...
469254677
import argparse import datetime import gc import glob import logging import os import pickle from datetime import timedelta from functools import partial from multiprocessing import ( JoinableQueue, Pool, Process, Queue, RLock, cpu_count, current_process, set_start_method, ) from pathlib...
null
bucky/postprocess.py
postprocess.py
py
12,861
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 58, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 64, "usage_type": "call" }, { "api_name": "util.read_config.bucky_cfg", "line_number": 64, "usage_type": "name" }, { "api_name": "os.path"...
613368378
import pymysql # ============================================================================= # Connection helper functios # ============================================================================= # # Connect to the database # params: database name # def connect_db(database=None): print('Checking...
null
MySQL/db_utils.py
db_utils.py
py
9,072
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymysql.connect", "line_number": 24, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pymysql.Error", "line_number": 31, "usage_type": "attribute" }, { "api_name": "pymysql.conne...
582784991
import tkinter as tk from tkinter import filedialog import configparser # configparserのインスタンス化 config = configparser.ConfigParser() # 読込むiniファイルを指定 config.read("./config.ini") ##### 関数 ##### # ファイルパスの取得 def get_path(): # グローバル変数 global file_path typ = [("Text","*.txt")] file_path = fil...
null
save.py
save.py
py
862
python
en
code
null
code-starcoder2
76
[ { "api_name": "configparser.ConfigParser", "line_number": 6, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 16, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 16, "usage_type": "name" }, { "ap...
19620249
import csv import numpy as np import matplotlib import matplotlib.pyplot as plt import time import pandas as pd with open("fes_arduino1.csv", "w") as saida: f = csv.writer(saida) f.writerow('Bem vindo a sessão de estimulação elétrica funcional - Neurobots') def acionarFes(): #rele = low #abre o circuito ...
null
Mouhamed/Atividades/Atividade 10/final_semClasse.py
final_semClasse.py
py
2,434
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.writer", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 33, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 38, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "lin...
96862348
import requests import re import execjs def get_url(url): headers = { 'Referer': url, 'User-Agent': 'Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36' } html = requests.get(url,headers=headers).text ...
null
军火库/MOM.py
MOM.py
py
3,320
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 12, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": ...
594178378
import string import os.path import json def read_ints(): return map(int, input().strip().split()) def is_complete(s): return all(d in s for d in string.digits) def preprocess(): answers = {} for num in range(10**6 + 1): answers[num] = calc_ans(num) return answers def save(answers): ...
null
codes/CodeJamCrawler/16_0_1_neat/16_0_1_luszczyk_a_brute.py
16_0_1_luszczyk_a_brute.py
py
1,205
python
en
code
null
code-starcoder2
76
[ { "api_name": "string.digits", "line_number": 10, "usage_type": "attribute" }, { "api_name": "json.dump", "line_number": 22, "usage_type": "call" }, { "api_name": "json.load", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path.path.exists", "lin...
323810098
import pytest import tensorflow as tf from doctr.models import backbones @pytest.mark.parametrize( "arch_name, top_implemented, input_shape, output_size", [ ["vgg16_bn", False, (224, 224, 3), (7, 56, 512)], ["resnet31", False, (32, 128, 3), (4, 32, 512)], ["mobilenet_v3_small", False,...
null
tests/tensorflow/test_models_backbones_tf.py
test_models_backbones_tf.py
py
901
python
en
code
null
code-starcoder2
76
[ { "api_name": "doctr.models.backbones.__dict__", "line_number": 19, "usage_type": "attribute" }, { "api_name": "doctr.models.backbones", "line_number": 19, "usage_type": "name" }, { "api_name": "tensorflow.random.uniform", "line_number": 21, "usage_type": "call" }, { ...
634638802
from suds.client import Client test_client = Client('http://localhost:8000/?wsdl') print(test_client) event = test_client.factory.create('ns0:Event') event.name = "Biji" event.location = "Jakarta" event.partner_id = 1 event.start_at = 2 event.end_at = 3 event.description = "Festival Biji Jakarta" section_array = te...
null
ticket-service-gateway/client.py
client.py
py
627
python
en
code
null
code-starcoder2
76
[ { "api_name": "suds.client.Client", "line_number": 4, "usage_type": "call" } ]
503248725
from netmiko import ConnectHandler from netmiko.ssh_exception import NetMikoTimeoutException from netmiko.ssh_exception import NetMikoAuthenticationException from paramiko.ssh_exception import SSHException from rtr_inventory import routers, loopbacks def addLoopback(): for devicelist, ips in zip(routers, loopback...
null
option3.py
option3.py
py
1,144
python
en
code
null
code-starcoder2
76
[ { "api_name": "rtr_inventory.routers", "line_number": 9, "usage_type": "argument" }, { "api_name": "rtr_inventory.loopbacks", "line_number": 9, "usage_type": "argument" }, { "api_name": "netmiko.ConnectHandler", "line_number": 11, "usage_type": "call" }, { "api_na...
321318383
from django.forms import Form, ModelForm, BooleanField, RadioSelect, HiddenInput from game.models import Kind, Opponent, Player, Round, Question, Option, Answer class OfferAcceptanceForm(ModelForm): class Meta: model = Round fields = ['accepted', 'time_elapsed'] widgets = { 'accepted': Rad...
null
game/forms.py
forms.py
py
1,102
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "name" }, { "api_name": "game.models.Round", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.RadioSelect", "line_number": 9, "usage_type": "name" }, { "api_name": "django...
468293351
# OLD NAIVE METHOD TO CONVERT MIDIS TO IMAGES # DO NOT USE AS IT TAKES TOO LONG, SAMPLING IS NAIVE (UNIFORMLY DISTRIBUTED) from music21 import converter, instrument, note, chord import json import sys import numpy as np import os from imageio import imwrite def extractNote(element): return int(element.pitch.ps) ...
null
data_utils/_convert_to_image.py
_convert_to_image.py
py
4,362
python
en
code
null
code-starcoder2
76
[ { "api_name": "music21.note.Note", "line_number": 26, "usage_type": "attribute" }, { "api_name": "music21.note", "line_number": 26, "usage_type": "name" }, { "api_name": "music21.chord.Chord", "line_number": 34, "usage_type": "attribute" }, { "api_name": "music21....
577139153
import datetime import unittest from django.test import TestCase from django.utils import timezone from django.urls import reverse from django.urls import resolve from polls.models import Question, Choice from django.test import Client from model_mommy import mommy from model_mommy.recipe import Recipe, foreign_key fro...
null
polls/tests.py
tests.py
py
7,134
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 19, "usage_type": "name" }, { "api_name": "django.utils.timezone.now", "line_number": 22, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 22, "usage_type": "name" }, { "api_name": "...
250971869
from django.conf.urls import patterns, url from .views import NewListView, ViewAndAddToList urlpatterns = patterns('', url(r'^(?P<pk>\d+)/$', ViewAndAddToList.as_view(), name='view_list'), url(r'^(?P<email>.*)/new/$', NewListView.as_view(), name='new_list'), ...
null
superlists/lists/urls.py
urls.py
py
489
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "views.ViewAndAddToList.as_view", "line_number": 7, "usage_type": "call" }, { "api_na...
19534582
import bpy import os import shutil import json class UIBrowser(bpy.types.Panel): bl_label = 'Browser' bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' bl_category = 'Browser' def draw(self, context): wm = context.window_manager layout = self.layout col = layout.colum...
null
scripts/startup/bl_app_templates_user/sequence_player/ui.py
ui.py
py
5,129
python
en
code
null
code-starcoder2
76
[ { "api_name": "bpy.types", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number...
231746089
from django.contrib import admin from django.urls import path ,include,re_path from myapp.views import* app_name = 'myapp' urlpatterns = [ #注册 path('register/',register,name = 'register'), path('email/',emails), path('registering/',registering), #首页 path('index/',index,name = 'index'), ...
null
myblog/myapp/urls.py
urls.py
py
659
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path",...
652323986
import requests from pprint import pformat from jinja2 import StrictUndefined import os from flask import Flask, render_template, request, flash, redirect, session, jsonify from flask_debugtoolbar import DebugToolbarExtension from model import connect_to_db, db, User, Therapist, Favorite # from seed import Faker a...
null
project.py
project.py
py
5,589
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 16, "usage_type": "call" }, { "api_name": "jinja2.StrictUndefined", "line_number": 20, "usage_type": "name" }, { "api_name": "flask.render_template", ...
142621822
from . import base_api_core import os import requests class Certificate(base_api_core.Core): def __init__(self, ip_address, port, username, password, secure=False, cert_verify=False): super(Certificate, self).__init__(ip_address, port, username, password, secure, cert_verify) def list_cert(self): ...
null
synology_api/core_certificate.py
core_certificate.py
py
2,454
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.basename", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_number": 37, "usage_type": "attribute" }, { "api_name": "os.path.basename", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
323488578
""" This module prepares midi file data and feeds it to the neural network for training """ import glob import pickle import numpy from music21 import converter, instrument, note, chord, corpus from keras.models import Sequential from keras.layers import Dense from keras.layers import Dropout from keras.layers impo...
null
lstmDurations.py
lstmDurations.py
py
4,440
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 32, "usage_type": "call" }, { "api_name": "music21.converter.parse", "line_number": 33, "usage_type": "call" }, { "api_name": "music21.converter", "line_number": 33, "usage_type": "name" }, { "api_name": "music21.instrumen...
466899751
from django.urls import path from estate import views app_name = 'estate' urlpatterns = [ path('index/<int:user_pk>/', views.index, name='index'), path('actions/<int:user_pk>/', views.actions, name='actions'), path('new-land/<int:user_pk>/', views.new_land, name='new-land'), path('edit-land/<int:land_p...
null
estate/urls.py
urls.py
py
1,709
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "estate.views.index", "line_number": 6, "usage_type": "attribute" }, { "api_name": "estate.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path",...
491745105
# _*_ coding:utf-8 _*_ # モジュールのインポート from bottle import route,run,template,request,get,post # http://localhost:8080/show_query @route('/show_query') def show_query(): # クエリパラメータを取得 keyword = request.query.keyword return template('keyword={{keyword}}',keyword=keyword) # http://localhost:8080/show_form @ro...
null
list6.py
list6.py
py
898
python
en
code
null
code-starcoder2
76
[ { "api_name": "bottle.request.query", "line_number": 10, "usage_type": "attribute" }, { "api_name": "bottle.request", "line_number": 10, "usage_type": "name" }, { "api_name": "bottle.template", "line_number": 11, "usage_type": "call" }, { "api_name": "bottle.route...
412485762
from backend import logger, app, db import models from flask import Flask, flash, redirect, url_for, request, render_template, g, abort from flask.ext.admin import Admin, expose, BaseView, AdminIndexView, helpers from flask.ext.admin.model.template import macro from flask.ext.admin.contrib.sqla import ModelView from fl...
null
backend/admin.py
admin.py
py
13,021
python
en
code
null
code-starcoder2
76
[ { "api_name": "backend.app.config", "line_number": 14, "usage_type": "attribute" }, { "api_name": "backend.app", "line_number": 14, "usage_type": "name" }, { "api_name": "backend.app.config", "line_number": 15, "usage_type": "attribute" }, { "api_name": "backend.a...
290454200
import discord code_reponse = ['🇦', '🇧', '🇨', '🇩'] def phase2_embed(choice): embed = discord.Embed(colour=discord.Colour(0x0000ff)) for i in range(len(choice)): embed.add_field(name=code_reponse[i], value=choice[i][0], inline=False ...
null
discord/message_style.py
message_style.py
py
363
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.Embed", "line_number": 6, "usage_type": "call" }, { "api_name": "discord.Colour", "line_number": 6, "usage_type": "call" } ]
210193016
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/pabuproject """ from setuptools import setup, find_packages from os import path, walk import sys import argparse # All functions def traverse_dir(dir_name): output = [] for root, subdirs,...
null
cat6/setup.py
setup.py
py
1,306
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.walk", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 24, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 34, "usage_type": "attribute" }, { "api_name": "setuptools.setup", ...
285539311
from typing import List from enum import Enum import operator class State(Enum): FLOOR = 1 EMPTY = 2 OCCUPIED = 3 def __repr__(self): if self.value == self.FLOOR.value: return '.' elif self.value == self.OCCUPIED.value: return '#' else: retur...
null
Chris/Day11/hodges_day11.py
hodges_day11.py
py
3,532
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.Enum", "line_number": 5, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 37, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 45, ...
116500240
import numpy as np from typing import Any, List from ray.rllib.connectors.connector import ( ConnectorContext, AgentConnector, register_connector, ) from ray.rllib.utils.annotations import DeveloperAPI from ray.rllib.policy.sample_batch import SampleBatch from ray.rllib.utils.typing import AgentConnectorDa...
null
rllib/connectors/agent/clip_reward.py
clip_reward.py
py
1,663
python
en
code
null
code-starcoder2
76
[ { "api_name": "ray.rllib.connectors.connector.AgentConnector", "line_number": 15, "usage_type": "name" }, { "api_name": "ray.rllib.connectors.connector.ConnectorContext", "line_number": 16, "usage_type": "name" }, { "api_name": "ray.rllib.utils.typing.AgentConnectorDataType", ...
554026814
# Documentación de acceso a HDFS desde Python3 # https://readthedocs.org/projects/hdfs3/downloads/pdf/latest/ import hdfs3 from collections import defaultdict, Counter #Conexión a HDFS # revisar la configuración del docker-compose.yml # este es el puerto rpc del namenode de hadoop # por defecto 8020 en la versión 2.7 ...
null
01_connect_hdfs.py
01_connect_hdfs.py
py
5,298
python
en
code
null
code-starcoder2
76
[ { "api_name": "hdfs3.HDFileSystem", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 99, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 124, "usage_type": "call" } ]
266752863
from flask.ext.login import LoginManager, UserMixin from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.dialects.postgresql import JSON from sqlalchemy import desc db = SQLAlchemy() class Comment(db.Model): """ A comment from an API comment_thread refers to a comment thread, and then the place_in...
null
models.py
models.py
py
1,908
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.ext.sqlalchemy.SQLAlchemy", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.ext.login.UserMixin", "line_number": 44, "usage_type": "name" } ]
201230939
import numpy as np import cv2 as cv try: # lock devices cap0 = cv.VideoCapture('/dev/video6') #cap1 = cv.VideoCapture('/dev/video7') # detect if connection was establish sucessfully if not cap0.isOpened(): #or not cap1.isOpened(): print('[ERROR] Cannot open camera stream.') rai...
null
test/camera/codeSnipplets/captureVideo.py
captureVideo.py
py
1,044
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "l...
250323159
import os from django.db import models from django.urls import reverse from django.core.files.storage import FileSystemStorage from django.core.validators import MinValueValidator, MaxValueValidator, validate_email from django.conf import settings from django.contrib.auth.models import User from ckeditor.fields import ...
null
YuLung/models.py
models.py
py
3,697
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.files.storage.FileSystemStorage", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": ...
34202353
import cv2 import numpy as np from easycv.validators import Number, Option from easycv.transforms.base import Transform from easycv.transforms.color import GrayScale class Gradient(Transform): """ Gradient is a transform that computes the gradient of an image. :param axis: Axis to compute, defaults to "...
null
easycv/transforms/edges.py
edges.py
py
2,953
python
en
code
null
code-starcoder2
76
[ { "api_name": "easycv.transforms.base.Transform", "line_number": 9, "usage_type": "name" }, { "api_name": "easycv.validators.Option", "line_number": 25, "usage_type": "call" }, { "api_name": "easycv.validators.Number", "line_number": 26, "usage_type": "call" }, { ...
276407392
from typing import List from core.models.GearModels import Gear from core.models.MemberModels import Member from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.core.exceptions import ValidationError from django.shortcuts import redirect, render from django.views im...
null
kiosk/views.py
views.py
py
4,147
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 14, "usage_type": "name" }, { "api_name": "django.views.generic.TemplateView", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.views.generic", "line_number": 14, "usage_typ...
542739985
# Internal imports from cycler import cycler # External imports import numpy as np import matplotlib.pyplot as plt # Set plot params plt.rc('font', size=16) # controls default text sizes plt.rc('axes', titlesize=16) # fontsize of the axes title plt.rc('axes', labelsize=16) # fontsize of the x and y l...
null
SNU/introduction_to_atomistic_simulations_of_nuclear_materials/example16-thermal_covductivity_ar_green_kubo/analyzer.py
analyzer.py
py
4,241
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.rc", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib....
255893105
#! /usr/bin/python # -*- coding: utf-8 -*- # Author: Wenyuan Wu, 18746867 # Date: 03.03.2020 # Additional Info: from collections import defaultdict import numpy as np import matplotlib.pyplot as plt from scipy.cluster.hierarchy import dendrogram, linkage, fcluster from sklearn.cluster import KMeans from sklearn.decomp...
null
helper_functions.py
helper_functions.py
py
7,432
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.cluster.hierarchy.linkage", "line_number": 69, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 73, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 73, "usage_type": "name" }, { "api_...
176647588
# -*- coding: utf-8 -*- import urllib2 import re import StringIO import base64 from HTMLParser import HTMLParser from pdfminer.pdfparser import PDFParser from pdfminer.pdfdocument import PDFDocument from pdfminer.pdftypes import resolve1 from xmp import xmp_to_dict from neo4jrestclient.client import GraphDatabase from ...
null
fda-docs-ix.py
fda-docs-ix.py
py
6,506
python
en
code
null
code-starcoder2
76
[ { "api_name": "pdfminer.pdfparser.PDFParser", "line_number": 27, "usage_type": "call" }, { "api_name": "pdfminer.pdfdocument.PDFDocument", "line_number": 28, "usage_type": "call" }, { "api_name": "xmp.xmp_to_dict", "line_number": 33, "usage_type": "call" }, { "api...
185927141
""" Insight Data Engineering SEA'19C Project: Traffic Control of API source """ from private_twitter_authentication_config import SystemDesignerCredentials from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream from tweepy.api import API import loggi...
null
TestTwitterAPI/stream_listener.py
stream_listener.py
py
10,168
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 22, "usage_type": "attribute" }, { "api_name": "logging.debug", "line_number": 23, "usage_type": "call" }, { "api_name": "private_twitter_...
301843384
from flask import Flask,render_template,request import os import pyodbc import random import redis import time import hashlib from json import loads, dumps app = Flask(__name__) myHostname = "vijayazure.redis.cache.windows.net" myPassword = "eGWbQ9K6RpbnGvMeGkpeylVnGwgXb4Rp6LjqTOcC9tE=" r = redis.StrictRedis(host=...
null
application.py
application.py
py
10,568
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "redis.StrictRedis", "line_number": 17, "usage_type": "call" }, { "api_name": "pyodbc.connect", "line_number": 35, "usage_type": "call" }, { "api_name": "time.time", "line_nu...
473453856
from collections import OrderedDict def backtrack(board, row, col, word, visited): if word == "": return True directions = [[-1, -1],[-1,0],[-1,1], [0,1], [1,1],[1,0],[1,-1],[0,-1]] wl = list(word) w = wl.pop(0) if w and w != board[row][col] or (row,col) in visited: return Fa...
null
interviewPractice/wordBoggle.py
wordBoggle.py
py
1,157
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.OrderedDict", "line_number": 30, "usage_type": "call" } ]
526848525
#!/usr/bin/env python from itertools import cycle import os from time import sleep import cv2 from fire import Fire import numpy as np from scipy.misc import imresize import tensorflow as tf from adain.image import load_image, prepare_image from adain.coral import coral from adain.nn import build_vgg, build_decoder f...
null
test_cam.py
test_cam.py
py
8,886
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 41, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 44, "usage_type": "attribute" }, { "api_name": "tensorflow.Graph", "line_number": 53, "usage_type": "call" }, { "api_name": "video.WebcamVideoStr...
545849214
import os from utils.extract_frames import process_video as process_video import numpy as np import tensorflow as tf import cv2 from Net import c3d_model from sklearn.preprocessing import Normalizer from scipy.io import loadmat from keras.models import model_from_json from math import factorial import numpy.matlib imp...
null
utils/get_c3d_feature.py
get_c3d_feature.py
py
8,462
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.app", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.random.randint", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.shap...
432626946
""" ================================================================================ [ Toufyx ] base.py base class for the models ================================================================================ """ import datetime from sqlalchemy.ext.declarative import declarative_base from sqlalchemy im...
null
troupadour/models/base.py
base.py
py
1,848
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.Column", "line_number": 17, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 17, "usage_type": "argument" }, { "api_name": "sqlalchemy.ext.declarative.declared_attr", "line_number": 19, "usage_type": "name" }, { ...
273228178
import requests import pygal from pygal.style import LightColorizedStyle as LCS, LightenStyle as LS url = 'https://api.github.com/search/repositories?q=language:ruby&sort=stars' r = requests.get(url) print("Status code:", r.status_code) # API returns the info in a json format, so we use the json method to convert # th...
null
ruby_repos.py
ruby_repos.py
py
2,823
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "pygal.style.LightenStyle", "line_number": 53, "usage_type": "call" }, { "api_name": "pygal.style.LightColorizedStyle", "line_number": 53, "usage_type": "name" }, { "api_name": "...
35831752
import os # os.environ["CUDA_VISIBLE_DEVICES"]="2" try: os.mkdir('./saves') except: pass import numpy as np import matplotlib matplotlib.use('Agg') import math from data_generators import PermutedMnistGenerator, SplitMnistGenerator, NotMnistGenerator, FashionMnistGenerator from ibpbcl import IBP_BCL import torc...
null
npbcl_not.py
npbcl_not.py
py
862
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.mkdir", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.use", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line...
386561011
from typing import List class Solution: def singleNumber(self, nums: List[int]) -> int: x = nums[0] for i in range(1, len(nums)): x = x ^ nums[i] return x s = Solution() print(s.singleNumber([2, 2, 1]))
null
leetcode_python/136. 只出现一次的数字.py
136. 只出现一次的数字.py
py
247
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
93240329
#!/usr/bin/python3 """Distributes""" import os from fabric.operations import local, run, put, env from datetime import datetime env.hosts = ['34.75.76.240', '35.229.102.53'] def do_deploy(archive_path): """Deploys""" if not os.path.exists(archive_path): return False name = archive_path.split(...
null
2-do_deploy_web_static.py
2-do_deploy_web_static.py
py
743
python
en
code
null
code-starcoder2
76
[ { "api_name": "fabric.operations.env.hosts", "line_number": 9, "usage_type": "attribute" }, { "api_name": "fabric.operations.env", "line_number": 9, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "o...