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
37177014
import matplotlib.pyplot as plt import numpy as np import openpyxl wb = openpyxl.load_workbook("2016_2017_HS_SQR_Results.xlsx") summary = wb.get_sheet_by_name("Summary") averageproficiency = [] hraelibiles = [] total = [] for i in range(2, 488): average8grademath = summary.cell(row=i, column=30).value average...
null
ISthereacorrelationbetweeneconomicstatusandsmartness.py
ISthereacorrelationbetweeneconomicstatusandsmartness.py
py
1,660
python
en
code
null
code-starcoder2
66
[ { "api_name": "openpyxl.load_workbook", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 30, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 30, "usage_type": "name" }, { "api_name": "matpl...
605952698
""" Utility functions to be used in several modules. """ import logging """ Takes a bunch of text, looks for dates and returns the most common one and the number of times it occured. Intended to be used with document classes to specifiy the date of the documents. """ def get_date_from_text(text): import re # S...
null
modules/utils.py
utils.py
py
1,283
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 24, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 31, "usage_type": "call" }, { "api_name": "dateutil.parser.parse", "line_number": 34, "usage_type": "call" }, { "api_name": "dateutil.parser"...
636682601
from flask import Flask, render_template, abort, redirect, url_for, request app = Flask(__name__) cards = [{"question": "What is your name?", "answer": "My name is Sachin"}, {"question": "Where do you study?", "answer": "I study at herald"}] @app.route("/") @app.route("/hello", methods = ['GET']) def hello(): retu...
null
flashcards.py
flashcards.py
py
1,463
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.abort", ...
436127472
import unittest from src.app import app, db from datetime import timedelta from src.models.schedules.utils import now, beginning_of_week from src.models.schedules.shift import Shift class TestShift(unittest.TestCase): def setUp(self): db.create_all() self.week_start = now().replace(hour=5, minu...
null
test/integration/test_shift.py
test_shift.py
py
3,230
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "src.app.db.create_all", "line_number": 13, "usage_type": "call" }, { "api_name": "src.app.db", "line_number": 13, "usage_type": "name" }, { "api_name": "src.models.sc...
414258085
from flask import current_app as app from flask import jsonify, request def loans_get_all_data(): """ Retrieves details of each tool and the name of the lastest user that loaned it """ connection = app.config["PYMYSQL_CONNECTION"] query = "SELECT \ tool.name as tool_name, \ ...
null
backend/app/backend/_temp_loans.py
_temp_loans.py
py
2,796
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.current_app.config", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.jsonify", "line_number": 38, "usage_type": "call" }, { "api_name": "flask.c...
399643041
from PIL import Image import os import dlib # 人脸识别的库dlib import numpy as np # 数据处理的库numpy import cv2 # 图像处理的库OpenCv path = "./images/" # 图像读取地址 savepath = "./dealimg/" # 图像保存地址 # fistlistA="./dealimg/trainA/" # fistlistB="./dealimg/trainB/" filelist = os.listdir(path) # 打开对应的文件夹 # pathlistA = os.listdir(savepath...
null
image_processing.py
image_processing.py
py
4,144
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 18, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number...
123956577
from django.conf.urls import patterns, url from todo_tracker import views urlpatterns = patterns('', url(r'logout$', views.logout_view, name='logout'), url(r'login$', views.login_view, name='login'), url(r'register$', views.register_view, name='register'), url(r'home$', views.home_view, name='home'), url(r'a...
null
todo_tracker/urls.py
urls.py
py
610
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "todo_tracker.views.logout_view", "line_number": 6, "usage_type": "attribute" }, { "a...
215248305
import argparse, itertools, jxmlease, more_itertools, numpy as np, pathlib from ..utilities import units from ..utilities.dataclasses import MetaDataAnnotation, MyDataClass from ..utilities.misc import dummylogger, printlogger from ..utilities.tableio import readtable, writetable from .csvclasses import Annotation, Reg...
null
astropath/baseclasses/annotationpolygonxmlreader.py
annotationpolygonxmlreader.py
py
7,210
python
en
code
null
code-starcoder2
66
[ { "api_name": "utilities.dataclasses.MyDataClass", "line_number": 8, "usage_type": "name" }, { "api_name": "utilities.dataclasses.MetaDataAnnotation", "line_number": 13, "usage_type": "call" }, { "api_name": "utilities.tableio.readtable", "line_number": 15, "usage_type": ...
470045267
import logging import time from datetime import datetime from json import JSONDecodeError from typing import Dict, Any, List, Tuple, Optional, Union from requests import get from requests.exceptions import HTTPError, ConnectionError from .comic_format import ComicFormat from .comic_info import ComicInfo, IdentifierIn...
null
Organizer/league_of_comic_geeks_api.py
league_of_comic_geeks_api.py
py
5,727
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "comic_info.ComicInfo", "line_number": 18, "usage_type": "name" }, { "api_name": "comic_info.identifiers", "line_number": 19, "usage_type": "attribute" }, { "api_name": "co...
382698723
# -*- coding: utf-8 -*- # snapshottest: v1 - https://goo.gl/zC4yUc from __future__ import unicode_literals from snapshottest import Snapshot snapshots = Snapshot() snapshots['test_add_library_type[uvloop] 1'] = [ { '_id': 'foo', 'library_type': 'srna' }, { '_id': 'bar', '...
null
tests/samples/snapshots/snap_test_migrate.py
snap_test_migrate.py
py
1,683
python
en
code
null
code-starcoder2
66
[ { "api_name": "snapshottest.Snapshot", "line_number": 8, "usage_type": "call" } ]
416889440
""" mbed SDK Copyright (c) 2011-2015 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writi...
null
packages/mbed-greentea/test/mbed_gt_hooks.py
mbed_gt_hooks.py
py
6,313
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 23, "usage_type": "attribute" }, { "api_name": "mbed_greentea.mbed_greentea_hooks.GreenteaCliTestHook", "line_number": 26, "usage_type": "call" }, { "api_name": "mbed_greentea.mbed_greentea_hooks.LcovHook", "line_number": 27, ...
467973362
# I have created this file from django.http import HttpResponse from django.shortcuts import render def index(request): return render(request, 'index.html') def analyze(request): #Get the text djtext = request.GET.get('text', 'default') # Check checkbox values removepunc = request.GET.get('removep...
null
textutility/views.py
views.py
py
2,072
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 6, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 26, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 33, "usage_type": "call" }, { "api_name":...
105617680
#!/usr/bin/env python from pyspark.sql import SparkSession from pyspark.sql.functions import col, window, asc, desc, lead, lag, udf, hour, month, dayofmonth, collect_list, lit import pyspark.sql.functions as F from pyspark.sql.window import Window from pyspark.sql.types import FloatType, IntegerType, DateType from pysp...
null
powerwatch/analysis/old_analysis_scripts/monthly_outages_aggregate_cluster_size.py
monthly_outages_aggregate_cluster_size.py
py
5,208
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyspark.SparkConf", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.config", "line_number": 19, "usage_type": "call" }, { "api_name": "p...
589305876
# -*- coding: utf-8 -*- import tkinter as tk from tkinter import messagebox from PIL import ImageTk, Image from datetime import datetime from qr import decode_input from qr import init_camera_settings, decode_input_camera, destroy_all_cv from observer import Publisher, Subscriber from matplotlib.backends.backend_tkagg ...
null
GUI.py
GUI.py
py
15,339
python
en
code
null
code-starcoder2
66
[ { "api_name": "observer.Publisher", "line_number": 13, "usage_type": "name" }, { "api_name": "SQL.data.Data", "line_number": 19, "usage_type": "call" }, { "api_name": "qr.init_camera_settings", "line_number": 26, "usage_type": "call" }, { "api_name": "tkinter.mess...
205098602
from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from optparse import make_option from devilry_usermod import UserModCommand class Command(UserModCommand): args = '<username>' help = 'Create new user.' option_list = BaseCommand.option_list + ( ...
null
devilry/apps/superadmin/management/commands/devilry_useradd.py
devilry_useradd.py
py
1,550
python
en
code
null
code-starcoder2
66
[ { "api_name": "devilry_usermod.UserModCommand", "line_number": 8, "usage_type": "name" }, { "api_name": "django.core.management.base.BaseCommand.option_list", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.core.management.base.BaseCommand", "line_number...
344839727
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
null
examples/hetero_feature_selection/run_feature_selection.py
run_feature_selection.py
py
5,344
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.split", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 27, "usage_type": "call" }, { "api_name": "json.load", "line_num...
305377452
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from PyQt4 import QtGui import sys #from matplotlib.patches import Rectangle class MplCanvas(FigureCanvas): """Represents a canvas in QtGui.QWidget""" def __init__(self): self....
null
matplotlib_gui/canvas.py
canvas.py
py
3,867
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.figure.Figure", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg.__init__", ...
280683573
from __future__ import print_function from unittest import TestCase from argparse import ArgumentParser, Namespace as N class T(TestCase): def test0(self): self._test( r'-a --delim -- -a --pseudo-pos 0 1 -- -2 3', ( N(delim=True, main_a=True), N(ch...
null
argparse_chain.py
argparse_chain.py
py
1,586
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "argparse.Namespace", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.Namespace", "line_number": 14, "usage_type": "call" }, { "api_name": "argparse.Names...
645703399
from sklearn.model_selection import train_test_split import os import ntpath from datetime import datetime import numpy as np from statistics import mean import statistics import re import math import random import pickle import scipy.stats as scstat from unidecode import unidecode import datetime from sk...
null
Simulations/Phase2-EdgeRetrain.py
Phase2-EdgeRetrain.py
py
3,207
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.chdir", "line_number": 34, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 35, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 39, "usage_type": "call" }, { "api_name": "pandas.options", "line_number": 45...
59898447
#!/usr/bin/env python # coding: utf-8 # In[413]: from nltk import word_tokenize,sent_tokenize import pandas as pd import numpy as np class TextFeatureSelection(): ''' target: list object which has categories of labels. for more than one category, no need to dummy code and instead provide label encoded value...
null
build/lib/TextFeatureSelection.py
TextFeatureSelection.py
py
11,979
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.log", "line_number": 64, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 67, "usage_type": "call" }, { "api_name": "nltk.sent_tokenize", "line_number": 75, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", "line...
175232551
import logging from websrvc.web.resources import FetchPage, Health, Information logger = logging.getLogger(__name__) def add_routes(api, config): """Add the routes to the application object :param websrvc.api.WebServiceAPI api: the webservice application object :param websrvc.loaders.Config config: th...
null
websrvc/web/routes.py
routes.py
py
544
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "websrvc.web.resources.FetchPage", "line_number": 17, "usage_type": "argument" }, { "api_name": "websrvc.web.resources.Health", "line_number": 18, "usage_type": "argument" }, { ...
123750088
from rest_framework import serializers from rest_framework.exceptions import ValidationError from expander import ExpanderSerializerMixin from django.contrib.auth import get_user_model from .models import ( Curriculum, Unit, Module, Lesson, Question, Answer, UserResponse, LessonProgress, Vector, MathematicalExpr...
null
curricula/serializers.py
serializers.py
py
11,524
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 14, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 14, "usage_type": "name" }, { "api_name": "models.LessonProgress", "line_number": 17, "usage_type": "name...
294699125
import numpy as np import mxnet as mx import mxnet.ndarray as nd import mxnet.gluon as gluon import gluonnlp from mxnet.io import NDArrayIter from mxnet import autograd from mxboard import * from tqdm import tqdm import json import argparse import pandas as pd import numpy as np from gensim.corpora import Dictionary ...
null
Code/models/LSTM/LSTM1/mxnet_lstm.py
mxnet_lstm.py
py
5,982
python
en
code
null
code-starcoder2
66
[ { "api_name": "mxnet.cpu", "line_number": 21, "usage_type": "call" }, { "api_name": "mxnet.ndarray.ones", "line_number": 24, "usage_type": "call" }, { "api_name": "mxnet.ndarray", "line_number": 24, "usage_type": "name" }, { "api_name": "tqdm.tqdm", "line_numb...
522231669
from kantai import * import datetime import os import collections with open("season_voice_list.txt", "r", encoding="utf-8") as fp: content = fp.readlines() season = set() for line in content: season.add(line.strip()) season_ships = [] for ship in iter_all_ships(): if ship.zh_name in season or ship.jp_name in seas...
null
season_generater.py
season_generater.py
py
1,425
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.strptime", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.j...
291138216
import sys, os from PySide2.QtWidgets import QApplication, QVBoxLayout, QWidget from PySide2.QtQuick import QQuickView from PySide2.QtCore import QUrl, Qt, QObject, QAbstractListModel, QRect, QStringListModel, QSortFilterProxyModel from models import ContentListModel, FilterModel from contentList import ContentList fro...
null
main.py
main.py
py
1,101
python
en
code
null
code-starcoder2
66
[ { "api_name": "PySide2.QtWidgets.QApplication", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "PySide2.QtQuick.QQuickView", "line_number": 11, "usage_type": "call" }, { "api_name": ...
291094634
import folium import pandas def get_color(elevation): if elevation <1000: return 'green' elif 1000<=elevation<3000: return 'orange' else: return 'red' data = pandas.read_csv("Volcanoes.txt") lat = list(data.LAT) lon = list(data.LON) elv = list(data.ELEV) map = folium.Map(location=[...
null
map1.py
map1.py
py
984
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "folium.Map", "line_number": 16, "usage_type": "call" }, { "api_name": "folium.FeatureGroup", "line_number": 18, "usage_type": "call" }, { "api_name": "folium.CircleMarker", ...
261317118
import gym import importlib import random from config import num_agents from mountainCar import num_output,num_input, moves from NEAT import Node, Edge, Genome, Specie, glb_innov, glb_node_index, innov_maker def init_nodes(num_input,num_output): #Is_input_node, Index, value, children, edges, move input_nodes =...
null
init_genomes.py
init_genomes.py
py
1,712
python
en
code
null
code-starcoder2
66
[ { "api_name": "NEAT.Node", "line_number": 10, "usage_type": "call" }, { "api_name": "mountainCar.num_input", "line_number": 10, "usage_type": "argument" }, { "api_name": "NEAT.Node", "line_number": 13, "usage_type": "call" }, { "api_name": "mountainCar.num_input",...
398599646
from __future__ import unicode_literals, division, print_function # built in modules import os import sys import time import codecs import shutil import argparse from six.moves import input # project modules from toolbox import countlines, CuiSemTypesDB, SimstringDBWriter, mkdir from constants import HEADERS_MRCONSO,...
null
check_source_concepts.py
check_source_concepts.py
py
4,659
python
en
code
null
code-starcoder2
66
[ { "api_name": "codecs.open", "line_number": 24, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 34, "usage_type": "call" }, { "api_name": "constants.HEADERS_MRCONSO", "line_number": 46, "usage_type": "name" }, { "api_name": "constants.HEADERS_M...
39114435
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Writer, write your content to html. :copyright: (c) 2012 by Hsiaoming Yang (aka lepture) :license: BSD ''' import os import re import datetime import hashlib import logging from jinja2 import Environment, FileSystemLoader import liquidluck from liquidluck.utils impor...
null
liquidluck/writers/base.py
base.py
py
9,186
python
en
code
null
code-starcoder2
66
[ { "api_name": "liquidluck.options.g.detail_logging", "line_number": 36, "usage_type": "attribute" }, { "api_name": "liquidluck.options.g", "line_number": 36, "usage_type": "name" }, { "api_name": "logging.error", "line_number": 42, "usage_type": "call" }, { "api_n...
32627363
import os import numpy as np from PIL import Image from collections import OrderedDict import cv2 overlay_color = [255, 0, 0] transparency = 0.6 result_path = './DAVIS-template-' def get_iou(pred, gt, ignore_cls=None): if pred.shape != gt.shape: print('pred shape', pred.shape, 'gt shape', gt.shape) a...
null
utils/metric.py
metric.py
py
3,652
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.unique", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.where", "line_number"...
466602480
import lmdb import sys import re from PIL import Image import os import pdb import six import numpy as np if __name__ == "__main__": # root = '/checkpoint/pkrishnan/datasets/icdar15_test/' # text_file = '/checkpoint/pkrishnan/datasets/synth-datasets/scribe/newsgroup_words_vqa.txt' # text_file = '/checkpoi...
null
dumpLMDBImages.py
dumpLMDBImages.py
py
3,970
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
425247393
import tensorflow as tf import os from configs.config import MiniImageNetConfig from data_loader.data_generator import DataGenerator, CompressedImageNetDataGenerator from models.example_model import ExampleModel, PrototypicalNetwork from trainers.example_trainer import ExampleTrainer, ProtoNetTrainer from utils.config...
null
main.py
main.py
py
6,906
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.utils.get_args", "line_number": 18, "usage_type": "call" }, { "api_name": "utils.config.process_config", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 23, "usage_type": "call" }, { "api_name": "os.pa...
409038066
from data.python_templates import effects from data.python_templates.items import item_templates from data.python_templates.material import material_templates from stats.enums import Size from items.item import Item from components.consumable import Consumable class ItemFactory(object): """ At first this will...
null
factories/item_factory.py
item_factory.py
py
3,785
python
en
code
null
code-starcoder2
66
[ { "api_name": "data.python_templates.items.item_templates", "line_number": 24, "usage_type": "name" }, { "api_name": "items.item.Item", "line_number": 39, "usage_type": "call" }, { "api_name": "data.python_templates.material.material_templates.get", "line_number": 55, "us...
188299507
import http.client, urllib.request, urllib.parse, urllib.error, base64,requests,json import requests html = requests.get('https://i.imgur.com/L6vu1jV.jpg') img_curr = html.content img_name = 'a.jpg' from PIL import Image with open(img_name, 'wb') as file: # 以byte形式将图片数据写入 file.write(html.content) file.flush() fi...
null
front/addFace.py
addFace.py
py
2,276
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 1...
92437012
from collections import defaultdict class UnionFind(): def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) return self.parents[x] ...
null
MinimumSpaningTree/JOI.py
JOI.py
py
1,679
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.defaultdict", "line_number": 45, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_number": 61, "usage_type": "call" }, { "api_name": "heapq.heappop", "line_number": 64, "usage_type": "call" } ]
299673215
from flask import Flask, render_template,abort,request import os import json with open("MSX.json") as fichero: datos=json.load(fichero) app = Flask(__name__) @app.route('/') def inicio(): return render_template("inicio.html") @app.route('/juegos') def juegos(): return render_template("juegos.html") @app.r...
null
app.py
app.py
py
1,275
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", ...
498391757
# Django from django.urls import include, path # Django REST Framework from rest_framework.routers import DefaultRouter # Views # from movies import views from .views import movies as movies_views from .views import rankings as ranking_views from .views import list_movies as list_movies_views from .views import comme...
null
movies/urls.py
urls.py
py
1,001
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 15, "usage_type": "call" }, { "api_name": "views.movies.MoviesViewSet", "line_number": 16, "usage_type": "attribute" }, { "api_name": "views.movies", "line_number": 16, "usage_type": "name" }, { ...
272876178
from pprint import pprint import os.path import requests from tinydb import TinyDB, where from tinydb.operations import increment from flask import Flask, jsonify, render_template, json app = Flask(__name__) def database(): """Initialise a TinyDB database at ./db.json and extends article model to include...
null
main.py
main.py
py
3,574
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.path.isfile", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path", "line...
257014677
#coding=utf-8 import pymysql from DBUtils.PooledDB import PooledDB from db_conf import * class DbManager(): def __init__(self,db_conf): self._pool = PooledDB(pymysql, mincached=0, maxcached=100, maxshared=100, maxusage=10000, **db_conf) def getConn(self): return self._pool.connection() ...
null
aspire_platform/httpserver/db.py
db.py
py
1,619
python
en
code
null
code-starcoder2
66
[ { "api_name": "DBUtils.PooledDB.PooledDB", "line_number": 9, "usage_type": "call" }, { "api_name": "pymysql.Error", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pymysql.Error", "line_number": 24, "usage_type": "call" }, { "api_name": "pymysql.Err...
520412967
#! /usr/bin/python """Script to run PyType tests. Usage: $> python run_tests.py [MODULE] [MODULE] ... A MODULE is a fully qualified name of a test module within the PyType source tree. If no module is specified, all test targets listed in the CMake files will be run. """ from __future__ import print_function import...
null
build_scripts/run_tests.py
run_tests.py
py
4,830
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_number": 40, "usage_type": "attribute" }, { "api_name": "os.path.exists", "l...
185629433
# -*- coding: utf-8 -*- from scrapy.spiders import CrawlSpider from scrapy.selector import Selector from dianping.items import * from scrapy.http import Request from dianping.search_keyword import dic from dianping.search_biz_area import biz_area_list import re import time class DianpingSpider(CrawlSpider): name ...
null
scrapy/dianping/dianping/spiders/DianpingSpider.py
DianpingSpider.py
py
4,518
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 12, "usage_type": "name" }, { "api_name": "dianping.search_keyword.dic", "line_number": 21, "usage_type": "name" }, { "api_name": "dianping.search_keyword.dic", "line_number": 22, "usage_type": "name" }, { ...
166266816
#!/usr/bin/python3 import gi gi.require_version('Gst', '1.0') from gi.repository import Gst Gst.init(None) # TODO: STUB, a TEE element has to be added class MediaServerSaveFile(): def __init__(self, input_source, output_sink): self.pipeline = Gst.Pipeline() self.bus = self.pipeline_get_bus() ...
null
gstreamer/media_server.py
media_server.py
py
4,658
python
en
code
null
code-starcoder2
66
[ { "api_name": "gi.require_version", "line_number": 4, "usage_type": "call" }, { "api_name": "gi.repository.Gst.init", "line_number": 7, "usage_type": "call" }, { "api_name": "gi.repository.Gst", "line_number": 7, "usage_type": "name" }, { "api_name": "gi.repositor...
242767577
import pygame ORIGIN = 0, 0 class Background: def __init__(self, w, h): self.x, self.y = ORIGIN # Point on bg img to blit from. self.w = w self.h = h self.FLAG = 6336 self.bgs = {} self.resource_file = open("background-images.txt") for line in self.resou...
null
background.py
background.py
py
811
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.transform.scale2x", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.transform", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 19, "usage_type": "call" }, { "api_name": "pyga...
160753818
from django.shortcuts import render from django.http import HttpResponse from django import forms from mmap import mmap,ACCESS_READ from django.http import HttpResponseRedirect from django.template import loader from django.template import RequestContext from django.core.urlresolvers import reverse import xlrd import o...
null
excel/views – kopio.py
views – kopio.py
py
5,504
python
en
code
null
code-starcoder2
66
[ { "api_name": "excel.forms.DocumentForm", "line_number": 22, "usage_type": "call" }, { "api_name": "excel.models.Document", "line_number": 24, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 28, "usage_type": "call" }, { "a...
346856781
import os import numpy as np import torch from torch import nn from torch import optim import torch.nn.functional as F from torch.autograd import Variable import torchvision from torchvision import datasets, transforms, models from collections import OrderedDict import json import time import argparse DEFAULT_DATA_DI...
null
identify/train.py
train.py
py
12,040
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 40, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 69, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 70, "usage_type": "call" }, { "api_name": "os.listdir", "line_...
652441496
#imports #django from django.core.serializers.json import DjangoJSONEncoder from django.contrib import messages from django.http.response import HttpResponse from django.shortcuts import redirect, render #python import json import uuid #self/app from user_app.models import Request,Complaint from official_app.decorat...
null
official_app/views.py
views.py
py
15,537
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Station.objects.get", "line_number": 39, "usage_type": "call" }, { "api_name": "models.Station.objects", "line_number": 39, "usage_type": "attribute" }, { "api_name": "models.Station", "line_number": 39, "usage_type": "name" }, { "api_name": ...
161742358
''' MainScreen is displayed first to the user. It contains a number of widgets, among them a 'user_ prompt'-able MainMenu instance. The 'invoke_menu' method always returns a method of the 'controller' received from the MainMenu instance. In case of a user exit request, this method is the 'exit_re...
null
src/tcctrl/console/screen/main_screen.py
main_screen.py
py
1,304
python
en
code
null
code-starcoder2
66
[ { "api_name": "base_screen.BaseScreen", "line_number": 16, "usage_type": "name" }, { "api_name": "base_screen.BaseScreen.__init__", "line_number": 18, "usage_type": "call" }, { "api_name": "base_screen.BaseScreen", "line_number": 18, "usage_type": "name" }, { "api...
102448637
import os from conans import ConanFile from conans.client import tools class NinjaConan(ConanFile): name = "ninja" version = "1.10.0" license = "TDB" url = "https://ninja-build.org/" settings = "os_build", "arch_build" build_policy = "missing" description = "Ninja build tool. Useful as a b...
null
conanfile.py
conanfile.py
py
2,156
python
en
code
null
code-starcoder2
66
[ { "api_name": "conans.ConanFile", "line_number": 6, "usage_type": "name" }, { "api_name": "conans.client.tools.get", "line_number": 41, "usage_type": "call" }, { "api_name": "conans.client.tools", "line_number": 41, "usage_type": "name" }, { "api_name": "os.chmod"...
379579752
import pymongo from Config import MONGO_HOST,MONGO_PORT, MONGO_DB from xpinyin import Pinyin def save_mongo(IA_name, IA_id, data): pinyin = Pinyin() clinct = pymongo.MongoClient(host=MONGO_HOST,port=MONGO_PORT) db = clinct[MONGO_DB] Data = data.get('data') if Data is not '': zip_res = zip(Data.get('x_arr'), Dat...
null
IT_Oranage/total_Investment_Agency/save_to_mongo.py
save_to_mongo.py
py
715
python
en
code
null
code-starcoder2
66
[ { "api_name": "xpinyin.Pinyin", "line_number": 6, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 7, "usage_type": "call" }, { "api_name": "Config.MONGO_HOST", "line_number": 7, "usage_type": "name" }, { "api_name": "Config.MONGO_PORT",...
379951515
# A 'simple' parser. # Follows PEP 8 and enforces E501 (line too long) # Ignore error 'redifinition of unused statement' as different producion rules # use names for defs that were already defined - totally fine here.. import simpleast from simplelexer import lex from rply import ParserGenerator tkns = ["If", "Else",...
null
Interpreter/simpleparser.py
simpleparser.py
py
11,677
python
en
code
null
code-starcoder2
66
[ { "api_name": "rply.ParserGenerator", "line_number": 16, "usage_type": "call" }, { "api_name": "simpleast.Program", "line_number": 45, "usage_type": "call" }, { "api_name": "simpleast.IfStatement", "line_number": 77, "usage_type": "call" }, { "api_name": "simpleas...
333501332
''' Created on Sep 2, 2012 @author: Luke ''' from reader.language_tools import Greek from reader.models import Lemma, Case, WordForm, WordDescription, Dialect from reader.importer.LineImporter import LineImporter import re import logging from time import time from django.db import transaction logger = ...
null
src/reader/importer/Diogenes.py
Diogenes.py
py
18,936
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "reader.importer.LineImporter.LineImporter", "line_number": 18, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 40, "usage_type": "call" }, { "api_name":...
5988983
import nltk import re import heapq import numpy as np paragraph = """There were once two brothers who lived on the edge of a forest. The elder brother was very mean to his younger brother and ate up all the food and took all his good clothes. One day, the elder brother went into the forest to find some firewood to sel...
null
bow_standard.py
bow_standard.py
py
1,666
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.sent_tokenize", "line_number": 9, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 13, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 14, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", "line_number...
135733723
import string import json import copy import factory from django.test import TestCase from django_webtest import WebTest from django.core.urlresolvers import reverse from cellcounter.keyboardapi.models import KeyMap, CustomKeyboard from cellcounter.main.tests import UserFactory from cellcounter.main.models import Cel...
null
cellcounter/keyboardapi/tests.py
tests.py
py
8,171
python
en
code
null
code-starcoder2
66
[ { "api_name": "factory.DjangoModelFactory", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cellcounter.keyboardapi.models.KeyMap", "line_number": 18, "usage_type": "name" }, { "api_name": "factory.django", "line_number": 22, "usage_type": "attribute" }, ...
485069205
# Copyright (c) 2018, Raul Astudillo import numpy as np from GPyOpt.acquisitions.base import AcquisitionBase from GPyOpt.core.task.cost import constant_cost_withGradients from pathos.multiprocessing import ProcessingPool as Pool class maKG(AcquisitionBase): """ Multi-attribute knowledge gradient acquisition ...
null
maKG.py
maKG.py
py
16,188
python
en
code
null
code-starcoder2
66
[ { "api_name": "GPyOpt.acquisitions.base.AcquisitionBase", "line_number": 9, "usage_type": "name" }, { "api_name": "GPyOpt.core.task.cost.constant_cost_withGradients", "line_number": 27, "usage_type": "name" }, { "api_name": "GPyOpt.core.task.cost.constant_cost_withGradients", ...
250715936
from google.appengine.ext import db from webapp2_extras import json import webapp2 from datetime import datetime import logging DATE_TIME_FORMAT = "%Y-%m-%d" class DataPoint(db.Model): date = db.DateTimeProperty() weight = db.IntegerProperty() height = db.IntegerProperty() circumference = db.Integer...
null
main.py
main.py
py
1,519
python
en
code
null
code-starcoder2
66
[ { "api_name": "google.appengine.ext.db.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "google.appengine.ext.db", "line_number": 11, "usage_type": "name" }, { "api_name": "google.appengine.ext.db.DateTimeProperty", "line_number": 12, "usage_type": "c...
433605422
import boto3 class Snapshot: def __init__(self, id, name, volumeId, time): self.id = id self.name = name self.volumeId = volumeId self.time = time self.parseName() def parseName(self): split = self.name.split(' ', 20) self.ami = '' for i in spli...
null
snapshots.py
snapshots.py
py
1,893
python
en
code
null
code-starcoder2
66
[ { "api_name": "boto3.client", "line_number": 33, "usage_type": "call" } ]
112227472
import numpy as np import math from pgmpy.factors.discrete import DiscreteFactor def normal(r, b): variance = 0.25 u_0 = -1 u_1 = 1 if b == 0: sample = ( 1/math.sqrt(2*variance) ) * math.exp( -((r - u_0) ** 2) / (2 * variance) ) else: sample = ( 1/math.sqrt(2*variance) ) * math.exp(...
null
week3/hamming_unquant.py
hamming_unquant.py
py
1,956
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.sqrt", "line_number": 10, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 10, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 12, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 12, "u...
578585244
#!/usr/bin/python # importing libraries----------------------------------------------------------------------------------------- import sys, os, Adafruit_DHT from time import sleep import datetime as dt from subprocess import call import RPi.GPIO as GPIO import lcddriver from time import * # import FunHouse from JustFo...
null
Temperature Measurement Station/Other Code/tempMeasure.py
tempMeasure.py
py
9,118
python
en
code
null
code-starcoder2
66
[ { "api_name": "lcddriver.lcd", "line_number": 15, "usage_type": "call" }, { "api_name": "RPi.GPIO.setmode", "line_number": 24, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 24, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_numb...
577513686
#!/usr/bin/python3 import numpy as np import matplotlib.pyplot as plt n = 1000000; dt = 0.01; rho = -1.0 W1 = np.random.normal(0, np.sqrt(dt), n) W2 = rho * W1 + np.sqrt(1 - rho **2) * np.random.normal(0, np.sqrt(dt), n) W1_cum = np.cumsum(W1) W2_cum = np.cumsum(W2) plt.plot(W1_cum) plt.plot(W2_cum) plt.show()
null
bm_corr.py
bm_corr.py
py
314
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.normal", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_...
340880035
from board import board import json import time from random import shuffle ############################################################################################################################# # findPath Algorithm test = [] # Checks to see if there exists at leas...
null
app/nodeBoard/test.py
test.py
py
3,703
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.shuffle", "line_number": 15, "usage_type": "call" }, { "api_name": "board.board", "line_number": 17, "usage_type": "argument" }, { "api_name": "board.board", "line_number": 26, "usage_type": "argument" }, { "api_name": "random.shuffle", "...
525745835
import torch from torch.tensor import Tensor from .agent import Agent class HumanAgent(Agent): """Allow a person to take on an AI agent.""" def act(self, obs_batch: Tensor) -> Tensor: action_mask, board = obs_batch['action_mask'], obs_batch['board'] print(' 1 2 3 4 5 6 7') print(' ...
null
src/agents/human_agent.py
human_agent.py
py
1,028
python
en
code
null
code-starcoder2
66
[ { "api_name": "agent.Agent", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.tensor.Tensor", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 35, "usage_type": "call" } ]
457135978
# -*- coding: utf-8 -*- """ Created on Sun Jul 01 09:41:09 2018 @author: theism """ import gen_func as gf import case_func as cf import logging import re import os import pandas as pd import numpy as np import settings def _see_if_on_sched(date_in, immun_buffer): if np.isnan(date_in): return 'null' el...
null
pregnancy_tasks.py
pregnancy_tasks.py
py
15,190
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.isnan", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.Timestamp", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
165408257
import pygame # to able the changing of the window from pygame.locals import RESIZABLE, VIDEORESIZE from text_to_speech import Speak from sys import exit as exit_sys __author__ = "Nadav Shani" ########################### # Windows file - (class) # ########################### # initialize pygame pygam...
null
windows.py
windows.py
py
29,210
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.display.Info", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pygame.image.load...
26079150
import matplotlib.pyplot as plt import numpy as np import argparse from matplotlib import animation class Particles: def __init__(self, x1=-1, y1=0, x2=1, y2=0, m1=1, m2=1, vx1=0, vx2=0, vy1=0, vy2=0, length=1, k=1, friction=0, **kwargs): self.position = np.array([[x1, y1], [x2, y2]]) ...
null
bond_model.py
bond_model.py
py
5,334
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": ...
613716838
# Copyright 2020 The Feast Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
null
sdk/python/tests/test_entity.py
test_entity.py
py
3,034
python
en
code
null
code-starcoder2
66
[ { "api_name": "contextlib.closing", "line_number": 30, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 30, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 30, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STRE...
320206706
import logging import datetime from telegram.ext import Updater, CommandHandler, MessageHandler, Filters import config import requests import pymongo mc=pymongo.MongoClient("mongodb://127.0.0.1:27017/") tgdb=mc["GIVE A NAME FOR YOUR DATABASE"] tgcol=tgdb["GIVE A NAME FOR THE COLLECTIONS"] URL = "https://api.telegra...
null
final_telegram_code.py
final_telegram_code.py
py
1,999
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymongo.MongoClient", "line_number": 8, "usage_type": "call" }, { "api_name": "config.token", "line_number": 14, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.INFO...
225314137
import os from setuptools import setup BASE_DIR = os.path.dirname(__file__) with open(os.path.join(BASE_DIR, "README.md")) as f: long_description = f.read() setup( name="jslog4kube", version="1.0.6", description="relatively hassle-free JSON logging for Kubernetes pods", long_description=long_des...
null
setup.py
setup.py
py
659
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7...
150974468
""" /register """ from urllib.parse import urlparse from utils import rds from .test_baseclass import TestBase class TestRegister(TestBase): """ Test register a user """ def test_register_directory(self): """ GET /register """ response = self.app.get('/register', conte...
null
tests/acceptance/test_register.py
test_register.py
py
1,741
python
en
code
null
code-starcoder2
66
[ { "api_name": "test_baseclass.TestBase", "line_number": 10, "usage_type": "name" }, { "api_name": "urllib.parse.urlparse", "line_number": 52, "usage_type": "call" }, { "api_name": "utils.rds.get_connection", "line_number": 60, "usage_type": "call" }, { "api_name":...
497027752
from django.views.generic import TemplateView class WeatherView(TemplateView): "Display a weather page with the forecast and current conditions preloaded" def render_to_response(self, context, **response_kwargs): response_kwargs.setdefault('content_type', self.content_type) return self.response...
null
apps/weather/views.py
views.py
py
489
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.views.generic.TemplateView", "line_number": 3, "usage_type": "name" } ]
651262392
# -*- coding: utf-8 -*- import io, os, importlib try: from importlib import resources as importlib_resources except ImportError: import importlib_resources from skymusic.resources import fonts, png, css, js, svg def get_default_theme(): global THEMES return list(THEMES)[0] def detect_themes(): '''...
null
src/skymusic/resources/Resources.py
Resources.py
py
6,143
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "skymusic.resources.css.__file__", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sky...
264785518
import sys import numpy as np import matplotlib.pyplot as plt def usage_error(): print("ERROR: Parameter not found.") print("Usage: python3 Soybean_drying.py -[OPTIONS]") print("\nOPTIONS: -ts for Soybean temperature") print(" -tg for air temperature") print(" -u for humidity") def...
null
Soy_drying/Soybean_drying.py
Soybean_drying.py
py
4,122
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 17, "usage_type": "call" }, { "api_name": "...
25318183
from django.urls import path from HousePredictionApp import views urlpatterns = [ path('', views.home, name='home'), path('predict/', views.predict, name='predict'), path('predict/result/', views.result, name='result'), path('predict/result/record', views.record, name='record'), ]
null
HousePredictionApp/urls.py
urls.py
py
300
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "HousePredictionApp.views.home", "line_number": 7, "usage_type": "attribute" }, { "api_name": "HousePredictionApp.views", "line_number": 7, "usage_type": "name" }, { "api_nam...
593813688
# -*- coding: utf-8 -*- """ Created on Tue Oct 23 18:45:49 2018 @author: vineet """ import networkx as nx import matplotlib.pyplot as plt import random import sys ##fb_file_path= "facebooklinks.txt" fb_file_path= "links.txt" global user_list,users,users_choice user_list=[] users=[] users_choice=[] ##user_list=['1'...
null
frnd.py
frnd.py
py
11,507
python
en
code
null
code-starcoder2
66
[ { "api_name": "networkx.Graph", "line_number": 53, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 154, "usage_type": "call" }, { "api_name": "networkx.draw", "line_number": 167, "usage_type": "call" }, { "api_name": "matplotlib.pyplot....
184746007
from SimPEG.simulation import BaseSimulation from SimPEG import utils, props, Data import numpy as np from discretize import TensorMesh import scipy.sparse as sp from scipy.signal import medfilt def get_medfilt_indicies(values): n_filter = 3 n = values.size inds_med = np.zeros(n, dtype=int) for ii in r...
null
insarinv/simulation.py
simulation.py
py
26,568
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.median", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.argwhere", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.median", "line_numb...
602733936
#!/usr/bin/env python from __future__ import print_function import logging import sys import gphoto2 as gp def main(): logging.basicConfig( format='%(levelname)s: %(name)s: %(message)s', level=logging.WARNING) callback_obj = gp.check_result(gp.use_python_logging()) camera = gp.Camera() came...
null
smarcambuddy/camera-summary.py
camera-summary.py
py
505
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 13, "usage_type": "attribute" }, { "api_name": "gphoto2.check_result", "line_number": 14, "usage_type": "call" }, { "api_name": "gphoto2...
499696448
from tweepy.streaming import StreamListener from tweepy import Stream import tweepy import twitter_credentials import json import geopandas import nltk import re bound_file = "SA3_2016_AUST.shp" jsonfile = 'twitter_user.json' sa3_bound = geopandas.read_file(bound_file) sa3_bound_vic = sa3_bound[sa3_bound['STE_NAME16...
null
MISC CODE/API_TWITTER_USER_STREAMING.py
API_TWITTER_USER_STREAMING.py
py
1,855
python
en
code
null
code-starcoder2
66
[ { "api_name": "geopandas.read_file", "line_number": 14, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 21, "usage_type": "call" }, { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dump", "line_number"...
113243716
# -*- coding: utf-8 -*- import sys tmp = sys.stdout tmp_in = sys.stdin from imp import reload reload(sys) import os from os.path import dirname, basename sys.path.append(os.path.join(sys.path[0], 'MyLib/')) # First, and before importing any Enthought packages, set the ETS_TOOLKIT # environment variable to qt4, to tell...
null
VolumeDataLabel.py
VolumeDataLabel.py
py
8,115
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.stdout", "line_number": 3, "usage_type": "attribute" }, { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "imp.reload", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path.append", "line_nu...
602639160
import numpy as np import cv2 # Identify pixels above the threshold # Threshold of RGB > 160 does a nice job of identifying ground pixels only def color_thresh(img, lwr_thresh=(113, 155, 155), upr_thresh = (255, 255, 255)): # Create an array of zeros same xy size as img, but single channel select = np.zeros_li...
null
code/perception.py
perception.py
py
7,108
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros_like", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.absolute", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 30, "usage_type": "attribute" }, { "api_name": "numpy.float", "li...
360778725
import os import itertools def read_input(filename): KB = [] alpha = '' with open(filename) as f: lines = [l.strip() for l in f.readlines()] for i,l in enumerate(lines): if i == 0: alpha = l elif i > 1: KB.append(l) return KB,alp...
null
utils.py
utils.py
py
4,101
python
en
code
null
code-starcoder2
66
[ { "api_name": "itertools.product", "line_number": 32, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 49, "usage_type": "call" } ]
181305617
from django.core.exceptions import ObjectDoesNotExist from pandas.tseries.offsets import Hour, Minute from position.classes.profiler.profiler import Profiler class ProfilerShortStock(Profiler): def __init__(self, position_set, date=''): """ :param position_set: PositionSet :param date: dat...
null
position/classes/profiler/equity/short_stock/short_stock.py
short_stock.py
py
5,663
python
en
code
null
code-starcoder2
66
[ { "api_name": "position.classes.profiler.profiler.Profiler", "line_number": 6, "usage_type": "name" }, { "api_name": "position.classes.profiler.profiler.Profiler.__init__", "line_number": 12, "usage_type": "call" }, { "api_name": "position.classes.profiler.profiler.Profiler", ...
507342300
from scipy import interpolate import numpy as np from weighting import weighting from decimal import Decimal def l2error(u1, params1, type1, u2, params2, type2): if type1 == 'cfd': radial_grid = params1['RadialGrid'].reshape(-1, 1) dr = np.diff(radial_grid, axis=0) dr = np.vstack((radial_...
null
l2error.py
l2error.py
py
3,557
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.diff", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number": 12, "usage_type": "call" }, { "api_name": "weighting.weighting", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.diff", "line_nu...
459747973
# -*- coding: utf-8 -*- """ Created on Sat Dec 1 00:05:56 2018 @author: Camel """ import pandas as pd import numpy as np from bs4 import BeautifulSoup import requests from selenium import webdriver import webbrowser driver = webdriver.Chrome() driver.get('http://vote.2018.nat.gov.tw/pc/zh_TW/TC/n63000000100000000.htm...
null
API_election_men.py
API_election_men.py
py
1,862
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 13, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.Beautif...
137414334
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2017, Luis Pedro Coelho <luis@luispedro.org> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal ...
null
jug/jug.py
jug.py
py
17,423
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.defaultdict", "line_number": 53, "usage_type": "call" }, { "api_name": "task.alltasks", "line_number": 54, "usage_type": "attribute" }, { "api_name": "io.print_task_summary_table", "line_number": 57, "usage_type": "call" }, { "api_name":...
537193191
import os import numpy as np import scipy as sp import scipy.optimize from astropy.stats import SigmaClip from astropy.stats import sigma_clipped_stats from astropy.io import fits import math import photutils from photutils.aperture import CircularAnnulus from photutils.aperture import CircularAperture from photutils.a...
null
src/simmer/Contrast.py
Contrast.py
py
7,283
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.sum", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 22, ...
621468110
import numpy as np class AbstractAugmentation: """ An abstract class for data augmentation that defines interfaces. A custom augmentation can be defined by inheriting from this class. Args: mode: Augmentation to be applied for training or evaluation. """ def __init__(self, mode="train...
null
fastestimator/pipeline/dynamic/augmentation.py
augmentation.py
py
12,763
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.eye", "line_number": 70, "usage_type": "call" }, { "api_name": "numpy.random.uniform", "line_number": 86, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 86, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line...
278722978
import networkx as nx from matlab import engine import scipy.io import os import time import tnetwork as tn import io import scipy def _runMatlabCode(matrix, matlab_session): #matrix = scipy.sparse.coo_matrix(matrix) dir = os.path.dirname(__file__) visuAddress = os.path.join(dir, "GenLouvain-master")...
null
build/lib/tnetwork/DCD/externals/MuchaOriginal_saved.py
MuchaOriginal_saved.py
py
5,673
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
399113092
import json import plotly.graph_objects as go def plot_transmission(): with open("outputs/graphdata.json") as f: data=json.load(f) I = 0 J = 0 K = 0 L = 0 M = 0 for l in data['links']: if l['state'] == 'I': I += 1 elif l['state'] == 'J': J += ...
null
temp_codes/plot_transmission.py
plot_transmission.py
py
983
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "plotly.graph_objects.Figure", "line_number": 23, "usage_type": "call" }, { "api_name": "plotly.graph_objects", "line_number": 23, "usage_type": "name" }, { "api_name": "plotly.grap...
419050516
import json import requests from flask import Flask app = Flask(__name__) @app.route("/") def hello(): headers = {'Authorization' : 'Bearer OGQ5YmUyMmYtZTlhOC00ZmE3LWE2NWQtZmEyMmFlZDAzOWVkMjlhODdlMjUtMDE3'} url = 'https://api.ciscospark.com/v1/rooms' r = requests.get(url,headers=headers) data = r.cont...
null
app.py
app.py
py
2,305
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "json.load", "line_number": 31, "usage_type": "call" }, { "api_name": "json.load", "line_number": 47, ...
249980339
import torch.utils.data as data from PIL import Image import os import os.path from .folder import default_loader class ImageList(data.Dataset): """A generic data loader where the input is an image list in this way: :: [ [/path/to/image/1, label_1], [/path/to/image/2, label_2], ...
null
torchvision/datasets/image.py
image.py
py
1,745
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.utils.data.Dataset", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 9, "usage_type": "name" }, { "api_name": "folder.default_loader", "line_number": 34, "usage_type": "name" }, { "api_name": "fo...
347007376
# -*- coding: utf-8 -*- from django.core.files.storage import FileSystemStorage from django.db.models.fields.files import FileField from django.core.files.storage import default_storage from django.http import HttpResponse from functools import wraps from django.utils import simplejson as json import os def file_cle...
null
Harpe-website/Patcher/utils.py
utils.py
py
2,191
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.fields.files.FileField", "line_number": 29, "usage_type": "argument" }, { "api_name": "os.path.exists", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name"...
216761096
#! /usr/bin/env python import os import datetime import torch import model import pickle from absl import app, flags, logging import sys from data_utils import Subset from utils import get_length from torch.nn.utils.rnn import pad_sequence import collections device = torch.device("cuda" if torch.cuda.is_available()...
null
main_infer.py
main_infer.py
py
7,478
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.device", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.cuda.set_d...
491457715
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.utils.timezone import utc import article.models import datetime class Migration(migrations.Migration): dependencies = [ ('article', '0004_auto_20150830_0841'), ] operations = [ ...
null
article/migrations/0005_auto_20150830_1028.py
0005_auto_20150830_1028.py
py
967
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 17, "usage_type": "call" }, {...
279230972
#------------------------------------------------------------------------------ # Name: configuration.py # Purpose: Storing CryBlend configuration settings # # Author: Mikołaj Milej # # Created: 02/10/2013 # Copyright: (c) Mikołaj Milej 2013 # Licence: GPLv2+ #------------------------...
null
io_export_cryblend/configuration.py
configuration.py
py
3,428
python
en
code
null
code-starcoder2
66
[ { "api_name": "bpy.utils.user_resource", "line_number": 22, "usage_type": "call" }, { "api_name": "bpy.utils", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "li...
493564407
#needed for debug mode to work! from gevent import monkey monkey.patch_all() #do some imports! from flask import Flask, render_template, request, jsonify from flask.ext.socketio import SocketIO, emit import urllib, json from banana import * #start me up! app = Flask(__name__) app.debug = True app.config['SECRET_KEY']...
null
main.py
main.py
py
5,841
python
en
code
null
code-starcoder2
66
[ { "api_name": "gevent.monkey.patch_all", "line_number": 3, "usage_type": "call" }, { "api_name": "gevent.monkey", "line_number": 3, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.ext.socketio.So...
86625763
from cms.sitemaps import CMSSitemap from django.conf.urls.defaults import * from django.conf import settings from django.contrib import admin from periodics.feeds import CategoryRss from library.feeds import PersonRss from manage import rel admin.autodiscover() urlpatterns = patterns('', (r'^admin/filebrowser/',...
null
urls.py
urls.py
py
1,813
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 10, "usage_type": "name" }, { "api_name": "django.contrib.admin.site", "line_number": 14, "usage_type": "attribute" }, { ...
275140784
#!/usr/bin/env python3 # noinspection PyUnresolvedReferences from mpi4py import MPI from baselines import logger from baselines.ppo1.mlp_policy import MlpPolicy from baselines.trpo_mpi import trpo_mpi import argparse import os import gym from baselines import logger, bench import logging from baselines.common.misc_uti...
null
examples/tiago_trpo_test.py
tiago_trpo_test.py
py
2,131
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "argparse.ArgumentDefaultsHelpFormatter", "line_number": 22, "usage_type": "attribute" }, { "api_name": "baselines.common.tf_util.single_threaded_session", "line_number": 36, ...
294846405
import sys import matplotlib.pyplot as plt import numpy as np def main(): colorset = ['b','g','r','c','m','y'] fig = plt.figure(figsize=(12, 5), dpi=100,facecolor='w', edgecolor='k') level = 1 p,r,f = get_data(level) N = len(p) idx = np.arange(N) width =0.5 plt.subpl...
null
pythoncode/plot/level_flixster.py
level_flixster.py
py
3,834
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.py...
133428601
import time from termcolor import colored from quora.profile_obj import Question from quora.profile_writer import csv_profile_writer_to_local import quora.config drag_times = 1 def scrape_questions(profile_url, driver): # Getting to other user's link full_link = "https://www.quora.com/" + profile_url dr...
null
university_counselor/b17706spark_usedcars/i2SGScrapy/quora/questions.py
questions.py
py
2,545
python
en
code
null
code-starcoder2
66
[ { "api_name": "termcolor.colored", "line_number": 21, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 32, "usage_type": "call" }, { "api_name": "time.sleep", "line_number...
147785057
import sys sys.path.insert(0, 'kmodes/') import numpy as np from kmodes.kmodes import KModes # the conflict dissimilarity measure def conflict_dissim(a, b, **_) : v = np.vectorize(lambda ai, bi : ai != 2 and bi != 2 and ai != bi) return np.sum(v(a,b), axis = 1) import argparse, os, sys, errno parser = argpa...
null
clustering_methods/celluloid_test.py
celluloid_test.py
py
3,335
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.insert", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "numpy.vectorize", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.sum", "line_numb...
540706880
# Author: @DJrif # Image classification script to classify # archaeological images from old Japanese pottery patterns import os import numpy as np # Importing Keras libraries and packages from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D from keras.layers import Activation, Dropout, Fl...
null
old/1thVGG16FromScratch.py
1thVGG16FromScratch.py
py
5,460
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 22, "usage_type": "attribute" }, { "api_name": "keras.backend.image_data_format", "line_number": 41, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 41, "usage_type": "name" }, { "api_name": "keras.m...