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
306360855
import torch import numpy as np def featurize_simple(obs, device): np_featurized = _featurize_simple(obs) # convert to tensor and send to device return torch.tensor([np_featurized]).to(device) def _featurize_simple(obs): # here we encode the board observations into a structure that can # be fed ...
null
student_agents/learning_agent/learning_agent/net_input.py
net_input.py
py
1,582
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.tensor", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 26, "usage_type": "attribute" }, { "api_name": "numpy.float32", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.float32", ...
494447546
# -*- coding: utf-8 -*- """ Created on Fri Jun 15 11:06:40 2018 @author: rulix """ import cv2 from SitPosture import SitPosture image_path='test.jpg' img=cv2.imread(image_path) img = cv2.cvtColor(img,cv2.COLOR_BGR2RGB) model=SitPosture(model_path='model/') a=model.SitPosJudge(img) print(a)
null
demo.py
demo.py
py
320
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_number": 16, "usage_type": "attribute" }, { "api_name": "SitPosture.SitPosture"...
89536109
from spacy.lang.en import English nlp = English() # DocとSpanクラスをインポート from spacy.tokens import Doc, Span words = ["I", "like", "David", "Bowie"] spaces = [True, True, True, False] # docをwordsとspacesから作成 doc = Doc(nlp.vocab, words=words, spaces=spaces) print(doc.text) # docから「David Bowie」というスパンを作成し、「PERSON」ラベルを付ける ...
null
exercises/ja/solution_02_06.py
solution_02_06.py
py
641
python
en
code
null
code-starcoder2
76
[ { "api_name": "spacy.lang.en.English", "line_number": 3, "usage_type": "call" }, { "api_name": "spacy.tokens.Doc", "line_number": 12, "usage_type": "call" }, { "api_name": "spacy.tokens.Span", "line_number": 16, "usage_type": "call" } ]
132141424
from transformers.modeling_bert import BertModel import torch.nn as nn # bert模型导入 class BertExtractor(nn.Module): def __init__(self, config, tok_helper): super(BertExtractor, self).__init__() self.config = config self.bert = BertModel.from_pretrained(config.bert_dir) self.be...
null
titlecls_project/new_moudle/bertExtractor.py
bertExtractor.py
py
1,376
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "transformers.modeling_bert.BertModel.from_pretrained", "line_number": 8, "usage_type": "call" }, { "a...
638059422
from types import SimpleNamespace import pytest from cascade.executor.covariate_description import create_covariate_specifications, EpiVizCovariate @pytest.fixture def covariate_settings(): study = list() country = list() setting = SimpleNamespace() setting.study_covariate_id = 1604 # one setti...
null
tests/executor/test_evcovariates.py
test_evcovariates.py
py
2,853
python
en
code
null
code-starcoder2
76
[ { "api_name": "types.SimpleNamespace", "line_number": 12, "usage_type": "call" }, { "api_name": "types.SimpleNamespace", "line_number": 18, "usage_type": "call" }, { "api_name": "types.SimpleNamespace", "line_number": 24, "usage_type": "call" }, { "api_name": "typ...
217444746
import calendar import copy import time import xml.etree.ElementTree as ET import numpy as np import qpimage from skimage.external import tifffile from .dataset import SingleData # baseline clamp intensity normalization for phasics tif files INTENSITY_BASELINE_CLAMP = 150 class LoadTifPhasicsError(BaseException):...
null
qpformat/file_formats/single_tif_phasics.py
single_tif_phasics.py
py
6,005
python
en
code
null
code-starcoder2
76
[ { "api_name": "dataset.SingleData", "line_number": 21, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 66, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 66, "usage_type": "name" }, { "api_nam...
96097512
import collections import math import numbers from ..proba.base import ContinuousDistribution from . import branch from . import splitting class Leaf: __slots__ = 'depth', 'tree', 'class_counts', 'n_samples', 'split_searchers' def __init__(self, depth, tree, class_counts=None): self.depth = depth ...
null
creme/tree/leaf.py
leaf.py
py
6,594
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 18, "usage_type": "call" }, { "api_name": "numbers.Number", "line_number": 51, "usage_type": "attribute" }, { "api_name": "math.log", "line_number": 68, "usage_type": "call" }, { "api_name": "math.sqrt", "lin...
78269002
"""license: Apache License 2.0, see LICENSE for more details.""" """Zookeeper Locking Implementations :Maintainer: None :Status: Unknown Error Handling ============== It's highly recommended to add a state listener with :meth:`~KazooClient.add_listener` and watch for :attr:`~KazooState.LOST` and :attr:`~KazooState.S...
null
slider-agent/src/main/python/kazoo/recipe/lock.py
lock.py
py
17,187
python
en
code
null
code-starcoder2
76
[ { "api_name": "uuid.uuid4", "line_number": 73, "usage_type": "call" }, { "api_name": "kazoo.retry.KazooRetry", "line_number": 80, "usage_type": "call" }, { "api_name": "kazoo.retry.RetryFailedError", "line_number": 115, "usage_type": "name" }, { "api_name": "kazoo...
505294338
import json from datetime import datetime from apscheduler.triggers.cron import CronTrigger import nonebot import pytz from nonebot import on_command, scheduler from aiocqhttp.exceptions import Error as CQHttpError from .lesson import * from awesome.plugins.date_time_study.config import * from .lessons_index i...
null
awesome/plugins/date_time_study/mon.py
mon.py
py
1,586
python
en
code
null
code-starcoder2
76
[ { "api_name": "nonebot.get_bot", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 34, "usage_type": "name" } ]
163399702
import cv2 as cv import numpy as np def background_mask(image, largest_element): image_copy = image.copy() # a mask is the same size as our image, but has only two pixel values, 0 and 255 -- pixels with a value of 0 (background) are ignored in the original image while mask pixels with a value of 255 (foregrou...
null
Module1/remove_background/remove_background.py
remove_background.py
py
839
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.drawContours", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.bitwise_and", "li...
565820451
import discord, asyncio, random, re, signal, string import urllib.request, json, pickle import operator from discord.ext import commands bot = commands.Bot(command_prefix='!', description='Reacts to given commands, use !help for list of available commands') wordcount_dict = {} regex = re.compile('[%s]' % re.escape(s...
null
quotesbot.py
quotesbot.py
py
4,313
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Bot", "line_number": 6, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 6, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "re.escape", ...
473038624
from json import dump, load from helper import capture, centered, fill, list_extensions, parseout with open('extensions.json', 'r+') as f: installed = list_extensions() extensions: list = load(f) success = 0 for idx, e in enumerate(extensions): print() # New line before header print(f...
null
install.py
install.py
py
1,146
python
en
code
null
code-starcoder2
76
[ { "api_name": "helper.list_extensions", "line_number": 6, "usage_type": "call" }, { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "helper.fill", "line_number": 11, "usage_type": "call" }, { "api_name": "helper.capture", "line...
105443570
# -*- coding: utf-8 -*- import os import fnmatch import logging import re import threading import urllib from functools import partial from cachetools import cached, LRUCache from cachetools.keys import hashkey import text_unidecode from jsonschema import validators, Draft4Validator from jsonschema.exceptions import...
null
datafeed/main.py
main.py
py
27,525
python
en
code
null
code-starcoder2
76
[ { "api_name": "sanic.Sanic", "line_number": 38, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 42, "usage_type": "call" }, { "api_name": "cachetools.LRUCache", "line_number": 43, "usage_type": "call" }, { "api_name": "config.ENV", "l...
508319190
from timeit import timeit import numpy as np from matplotlib import pyplot as plt nlst = [] t0lst = [] t1lst = [] t2lst = [] t3lst = [] for n in range(10, 210, 10): repeat = 10000 a = np.random.randint(-2**32,2**32-1, size=n, dtype=np.int64) b = a + 2 t0 = timeit('inner(a, outer(a, b)[1])', number=rep...
null
benchmarks/fastbench.py
fastbench.py
py
1,257
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.randint", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.int64", "line_number": 13, "usage_type": "attribute" }, { "api_name": "timeit.timeit...
393701535
import tensorflow as tf import numpy as np from sklearn.metrics import accuracy_score, precision_score, recall_score from load_data import LoadData_slice from keras.utils import np_utils # ============================================================================= # from keras.models import Sequential # from keras.l...
null
Code/CNN.py
CNN.py
py
3,161
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.keras.Input", "line_number": 28, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 28, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.layers.Conv1D", "line_number": 29, "usage_type": "call" }, { "api_n...
290008543
# coding=utf-8 from __future__ import absolute_import from mongoengine import * from .mongoengine import QuantumField import os from trex.support import pcrypt from trex.support.mongoengine import LowerCaseEmailField, serve_file from flask import g, url_for, abort import re import hashlib from . import token, quantum ...
null
support/model.py
model.py
py
30,189
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.abort", "line_number": 34, "usage_type": "call" }, { "api_name": "mongoengine.QuantumField", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 62, "usage_type": "call" }, { "api_name": "os.path", "l...
473556829
import pygame import random import math pygame.init() # creating a game window # it takes tuple as argument width first height second screen = pygame.display.set_mode((800, 600)) # Adding Title and Icon title = "Pumpkin Shooter" icon = pygame.image.load('data/logo.png') pygame.display.set_caption(title)...
null
PumpkinShooter.py
PumpkinShooter.py
py
5,474
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.image.loa...
521390359
from keras.layers import Input, Dense, Dropout, Flatten, merge, Reshape, Activation, Permute from keras.layers.convolutional import Convolution1D, Convolution2D from keras.layers.pooling import GlobalMaxPooling1D, MaxPooling1D from keras.layers.recurrent import LSTM, GRU from keras.models import Model, Sequential from ...
null
model/hierarchical2.py
hierarchical2.py
py
3,120
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.layers.Input", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.layers.embeddings.Embedding", "line_number": 12, "usage_type": "call" }, { "api_name": "keras.layers.embeddings.Embedding", "line_number": 13, "usage_type": "call" }, {...
369035810
import itertools class Matrix(object): '''Add your docstring here.''' def __init__(self): # no modification is needed for this method, but you may modify it if you wish to '''Create and initialize your class attributes.''' self._matrix = [] self._rooms = 0 d...
null
Week 14/Project 11/proj12.py
proj12.py
py
3,016
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.combinations", "line_number": 82, "usage_type": "call" } ]
405813648
from bs4 import BeautifulSoup from urllib import request def onlyAscii(s): return str("".join(i for i in s if ord(i)>=32 and ord(i)<=127)).strip() def onlyNumbers(s): return str("".join(i for i in s if ((ord(i)>=48 and ord(i)<=57) or ord(i)==46))).strip() class player: def __init__(self,name,kills,...
null
skw10mans.py
skw10mans.py
py
5,736
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.urlopen", "line_number": 43, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 43, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 44, "usage_type": "call" } ]
401051495
from keras.applications.vgg16 import VGG16 from keras.layers import Flatten, Dense, AveragePooling2D, Dropout, MaxPooling2D, BatchNormalization from keras.models import Model from keras import backend as K from keras.optimizers import RMSprop, SGD from keras.callbacks import ModelCheckpoint from keras.preprocessing.ima...
null
train_vgg.py
train_vgg.py
py
4,361
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.applications.vgg16.VGG16", "line_number": 33, "usage_type": "call" }, { "api_name": "keras.models.Model", "line_number": 61, "usage_type": "call" }, { "api_name": "keras.callbacks.ModelCheckpoint", "line_number": 70, "usage_type": "call" }, { ...
414778512
from multiprocessing import Queue from queue import PriorityQueue from numpy import linalg as LA from scipy import stats import numpy as np import pandas as pd import argparse import time import sys import os from tqdm import tqdm from functools import partial import warnings top_k_words = [] threshold = 0.001 total =...
null
code/evaluation/visualization/visualize_online.py
visualize_online.py
py
1,759
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 29, "usage_type": "call" }, { "api_name": "warnings.warn", "line_number": 33, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 36, "usage_type": "call" } ]
520282577
from pathlib import PurePath from typing import Dict, List from lab import util from lab.logger import internal from .indicators import Indicator, Scalar from .writers import Writer class Store: indicators: Dict[str, Indicator] def __init__(self, logger: 'internal.LoggerInternal'): self.values = {} ...
null
lab/logger/store.py
store.py
py
2,555
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Dict", "line_number": 11, "usage_type": "name" }, { "api_name": "indicators.Indicator", "line_number": 11, "usage_type": "name" }, { "api_name": "pathlib.PurePath", "line_number": 23, "usage_type": "name" }, { "api_name": "lab.util.yaml_dump"...
649615288
import os import glob import argparse parser = argparse.ArgumentParser() parser.add_argument('--video_dir', type=str, help='path to clip video dir', required=True) parser.add_argument('--output_dir', type=str, help='where to store extracted frames', ...
null
OurData/tools/extract_frame.py
extract_frame.py
py
822
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_num...
487680120
import sys from PyQt5.QtWidgets import QApplication, QWidget from secondForm import Ui_Form class MyForm(QWidget, Ui_Form): def __init__(self, parent=None): super(MyForm, self).__init__(parent) self.setupUi(self) if __name__ == '__main__': app = QApplication(sys.argv) f = MyForm() f....
null
day02/callSecondForm.py
callSecondForm.py
py
353
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 6, "usage_type": "name" }, { "api_name": "secondForm.Ui_Form", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 13, "usage_type": "call" }, { "api_name": ...
377604391
from rest_framework import serializers from .models import Category class CategoryListSerializer(serializers.ModelSerializer): class Meta: model = Category fields = [ # Don't want to show some of these fields.' 'category_id', 'category_name', 'sub_ca...
null
service/categories/serializers.py
serializers.py
py
395
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 5, "usage_type": "name" }, { "api_name": "models.Category", "line_number": 7, "usage_type": "name" } ]
67232978
import numpy as np from scipy import sparse as sp from sklearn.utils.fixes import comb from scipy.special import comb as n_comb import itertools def rand_score(labels_true, labels_pred): labels_true = np.array(labels_true) labels_pred = np.array(labels_pred) n_samples = labels_true.shape[0] n_classes =...
null
rand_index.py
rand_index.py
py
2,585
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": ...
576501999
import numpy as np import cv2 import imutils background = cv2.imread("background.jpg") frame = cv2.imread("lastcap.jpg") cv2.imshow("input",frame) cv2.waitKey(0) cv2.imshow("input",background) cv2.waitKey(0) reducer = np.ones(background.shape, background.dtype) reducer = reducer *50 lessbg = cv2.subtract(background,...
null
betterpoly.py
betterpoly.py
py
2,245
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 9, ...
622296094
import pymysql class output_id_data(object): """ 同步操作 """ def search_id(name_data): db = pymysql.connect( host='127.0.0.1', port=3306, user='root', password='password', db='xiaoshuo', charset='utf8') cur = db.cursor() sql_id = '''select id from books where name='{}' ...
null
guaiben_redis/guaiben_redis/spiders/get_number.py
get_number.py
py
1,318
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymysql.connect", "line_number": 8, "usage_type": "call" } ]
542538309
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
null
apps/universidad/migrations/0001_initial.py
0001_initial.py
py
5,672
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 11, "usage_type": "call...
210223764
"""Define tests for the Camera objects.""" from __future__ import annotations from typing import cast import aiohttp import pytest from aresponses import ResponsesMockServer from simplipy import API from simplipy.device.camera import CameraTypes from simplipy.system.v3 import SystemV3 from .common import ( TEST...
null
tests/test_camera.py
test_camera.py
py
3,448
python
en
code
null
code-starcoder2
76
[ { "api_name": "aresponses.ResponsesMockServer", "line_number": 25, "usage_type": "name" }, { "api_name": "aresponses.ResponsesMockServer", "line_number": 26, "usage_type": "name" }, { "api_name": "aiohttp.ClientSession", "line_number": 34, "usage_type": "call" }, { ...
169148516
from typing import List, Dict, Tuple, Any, Optional from collections import Counter from operator import itemgetter import json import os from wasabi import Printer import wasabi from copy import deepcopy from sciwing.vocab.embedding_loader import EmbeddingLoader from sciwing.vocab.char_emb_loader import CharEmbLoader ...
null
sciwing/vocab/vocab.py
vocab.py
py
17,184
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Optional", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 27, "usage_type": "name" }, { "api_name": "typing.Union", "line_num...
329826057
import urllib.request as ur import xml.etree.ElementTree as ET url = 'http://py4e-data.dr-chuck.net/comments_31276.xml' data = ur.urlopen(url).read() tree = ET.fromstring(data) counts = tree.findall('comments/comment/count') total = 0 for count in counts: total += int(count.text) print ('total: ', total)
null
access_web_data/sum_from_xml.py
sum_from_xml.py
py
308
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.urlopen", "line_number": 5, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 5, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 6, "usage_type": "call" }, { "api_name": "x...
10070821
import requests import json from datetime import datetime, timedelta class JQuantsAPI: def __init__(self, mailaddress, password): self.mailaddress = mailaddress self.password = password self.base_uri = "https://api.jquants.com" self.headers = { "Content-Type": "applicat...
null
jquants.py
jquants.py
py
5,373
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.today", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 30, "usage_type": "name" }, { "api_name": "datetime.datetime.today", "line_number": 33, "usage_type": "call" }, { "api_name": "dat...
380520281
import os, errno from flask import Flask, make_response from flask import request from flask_cors import CORS from werkzeug.utils import secure_filename import classify UPLOAD_FOLDER = '/uploads' app = Flask(__name__) CORS(app) @app.route('/upload', methods=['GET', 'POST']) def upload_file(): if request.method =...
null
back-end/app.py
app.py
py
820
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request",...
59980229
""" Copyright 2020 The OneFlow 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/licenses/LICENSE-2.0 Unless required by applicable law or agr...
null
oneflow/python/test/ops/test_image_normalize.py
test_image_normalize.py
py
3,053
python
en
code
null
code-starcoder2
76
[ { "api_name": "oneflow.clear_default_session", "line_number": 23, "usage_type": "call" }, { "api_name": "oneflow.FunctionConfig", "line_number": 24, "usage_type": "call" }, { "api_name": "oneflow.float", "line_number": 25, "usage_type": "attribute" }, { "api_name"...
284936484
# Objective: Use the BeautifulSoup and requests Python packages read a table and write it to file import requests, pandas as pd from bs4 import BeautifulSoup as soup url = 'https://www.worldometers.info/world-population/population-by-country/' r = requests.get(url) r_html = r.text parsed_data = soup(r_html,...
null
scripts/fundamentals/webscrp_bs_and_requests_L2.py
webscrp_bs_and_requests_L2.py
py
1,608
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_html", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
338893208
from itertools import chain, cycle, count import asyncio from functools import wraps take = lambda n, iter: (iter.next() for _ in range(n)) class take_only_while(object): def __init__(self,pred, iterator): self._pred = pred self._iter = iterator self._rest = iter([]) def __iter__(self): return s...
null
sjautils/iterext.py
iterext.py
py
1,635
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.chain", "line_number": 22, "usage_type": "call" } ]
243680380
from rest_framework.schemas import get_schema_view from django.conf.urls import url, include from rest_framework.documentation import include_docs_urls from rest_framework.routers import DefaultRouter from api import views from rest_framework.authtoken import views as rest_framework_views router = DefaultRouter...
null
api/urls.py
urls.py
py
1,404
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 8, "usage_type": "call" }, { "api_name": "api.views.CustomerViewSet", "line_number": 9, "usage_type": "attribute" }, { "api_name": "api.views", "line_number": 9, "usage_type": "name" }, { "api_na...
421020055
""" This file is a part of the Kithare programming language source code. The source code for Kithare programming language is distributed under the MIT license. Copyright (C) 2021 Kithare Organization build.py Builder script to build Kithare. On Windows and MinGW: You must have MinGW (AKA MinGW-w64) installed, and...
null
build.py
build.py
py
14,141
python
en
code
null
code-starcoder2
76
[ { "api_name": "platform.system", "line_number": 70, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 93, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 112, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
367355817
from modules.SimpleAero import Aero from modules.SimpleAtmo import Atmo from modules.Simplegravity import Gravity from Core_src.Objects import Vehicle from Core_src.Phase import Phase, run_once from Core_src.Buffer import Buffer from Core_src.State import State import random import sys import time from Core_src import ...
null
simulator_lander/Core_src/Core.py
Core.py
py
4,142
python
en
code
null
code-starcoder2
76
[ { "api_name": "Core_src.State.State", "line_number": 27, "usage_type": "call" }, { "api_name": "modules.SimpleAero.Aero", "line_number": 30, "usage_type": "call" }, { "api_name": "modules.Simplegravity.Gravity", "line_number": 31, "usage_type": "call" }, { "api_na...
182360909
from database import db, app, Admin, Reservation, Picnic, Camping, Resto from flask import request, jsonify, render_template import jwt import datetime import time from hashlib import sha256 from functools import wraps def token_required(f): @wraps(f) def decorated(*args, **kwargs): token = None ...
null
flask_app.py
flask_app.py
py
11,844
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.request.headers", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.request.headers", "line_number": 14, "usage_type": "attribute" }, { "api_name": "f...
556776185
#!/usr/bin/env python # -*- coding: UTF-8 -*- from urllib import request import json from sql.extend_json_encoder import ExtendJSONEncoder class WechatSender(object): # 获取access_token def GetToken(self, CorpID,Secret): tokenurl = 'https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%...
null
sql/sendwechat.py
sendwechat.py
py
1,554
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.urlopen", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 16, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 18, "usage_type": "call" }, { "api_name": "json.dumps", "li...
132219083
import sys from power_supply import * from connection import * from time import sleep from threading import Thread, Lock from PyQt5 import uic, QtWidgets, QtCore # Setting display U and I update period in msec DISPLAY_UPDATE_PERIOD = 200 # Setting data from PSU update period in msec DATA_UPDATE_PERIOD = 100 ...
null
main.py
main.py
py
4,613
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 16, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 20, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 28, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QMainWin...
445510674
#!/usr/bin/python # -*- coding: UTF-8 -*- import requests import datetime import time qq='接收信息的QQ' port='12513' domain='要监控的域名' if __name__ == '__main__': while (1==1): requests.get('http://127.0.0.1:' + port + '/send_private_msg?user_id=' + qq + '&message=域名检测启动成功') res = requests.ge...
null
domain.py
domain.py
py
942
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetim...
374041470
import argparse from amber.amber16.cpptraj.command import exec_cpptraj from utilities.path import which from tempfile import mkstemp import numpy from pdb import set_trace as tr if __name__ == '__main__': parser = argparse.ArgumentParser(description="""Obtain MSD(t) averaged over different chunks of the trajectory...
null
simulation/silica/cristobalite/confineBSA/poretop/yesbonds/wholesystem/diffusion_t0average.py
diffusion_t0average.py
py
2,748
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "utilities.path.which", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 25, "usage_type": "call" }, { "api_name": "tempfile.mkst...
534120847
import wx import os from typing import TYPE_CHECKING from amulet.api.level import Structure from amulet.api.selection import SelectionGroup from amulet.api.data_types import Dimension from amulet.level.formats.schematic import SchematicFormatWrapper from amulet_map_editor.programs.edit.api.operations import ( Sim...
null
amulet_map_editor/programs/edit/plugins/operations/stock_plugins/import_operations/schematic.py
schematic.py
py
2,043
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 15, "usage_type": "name" }, { "api_name": "amulet_map_editor.programs.edit.api.operations.SimpleOperationPanel", "line_number": 20, "usage_type": "name" }, { "api_name": "wx.Window", "line_number": 23, "usage_type": "at...
145571854
import numpy as np import pandas as pd import os from tqdm import tqdm from datetime import datetime as dt from keras.wrappers.scikit_learn import KerasClassifier from keras import optimizers import keras.backend.tensorflow_backend as KTF import tensorflow as tf from keras.callbacks import EarlyStopping, TensorBoard...
null
.ipynb_checkpoints/train_util-checkpoint.py
train_util-checkpoint.py
py
11,719
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.callbacks.Callback", "line_number": 34, "usage_type": "name" }, { "api_name": "numpy.less", "line_number": 82, "usage_type": "attribute" }, { "api_name": "numpy.Inf", "line_number": 83, "usage_type": "attribute" }, { "api_name": "numpy.greater...
417702519
import torch import torch.nn as nn from Layers import EncoderLayer, DecoderLayer from Embed import Embedder, PositionalEncoder from Sublayers import Norm from gensim.models import KeyedVectors import torch.nn.functional as F from torch import Tensor from typing import Tuple import copy, time, math from Seq2seq_rnn imp...
null
Models.py
Models.py
py
18,088
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.ModuleList", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn.ModuleList", ...
574910248
import sys import attr import click import serial.serialutil import sunspec.core.client import sunspecdemo.utils model_path_option = click.option( '--model-path', type=click.Path(file_okay=False), default='models', help='Path to the directory containing custom smdx_*.xml files', ) timeout_option =...
null
src/sunspecdemo/clishared.py
clishared.py
py
4,633
python
en
code
null
code-starcoder2
76
[ { "api_name": "click.option", "line_number": 11, "usage_type": "call" }, { "api_name": "click.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "click.option", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.platform.startswith", "l...
255676841
# python3 import matplotlib.pyplot as plt import matplotlib.image as mpimg import cv_inv_const def show_wa_state_highway(image): plt.imshow(image) plt.show() def show_rgb_channels(image): # RGB channels r = image[:,:,0] g = image[:,:,1] b = image[:,:,2] # Visualize the individual color ch...
null
src/rgb_channels.py
rgb_channels.py
py
715
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.imshow", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 9, "usage_type": "call" }, { "api_name": "matplo...
103117823
import sys from objects import * from control import Control from heuristic_v1 import Heuristic_v1 from heuristic_v2 import Heuristic_v2 from dqn import Dqn_player def next_player(game): if game.turn == game.player1: return game.player2 return game.player1 def name_from_card(card): name = '' i...
null
other attempts/q_learning/q_unogame.py
q_unogame.py
py
2,730
python
en
code
null
code-starcoder2
76
[ { "api_name": "control.Control", "line_number": 35, "usage_type": "call" }, { "api_name": "heuristic_v2.Heuristic_v2", "line_number": 36, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 38, "usage_type": "attribute" }, { "api_name": "sys.argv", ...
595213750
# Marty Osterhoudt Advanced Bioinformatics # Python script that calls Biopython objects import sys import xml.etree.ElementTree as ET import numpy #import zlib from Bio import Entrez from Bio import Seq from Bio import SeqRecord from Bio import SeqIO #from reportlab.lib import colors #from reportlab.lib.units import ...
null
original_base/NCBI-biopython-tryefetch_combos.py
NCBI-biopython-tryefetch_combos.py
py
3,501
python
en
code
null
code-starcoder2
76
[ { "api_name": "Bio.Entrez.email", "line_number": 21, "usage_type": "attribute" }, { "api_name": "Bio.Entrez", "line_number": 21, "usage_type": "name" }, { "api_name": "Bio.Entrez.efetch", "line_number": 54, "usage_type": "call" }, { "api_name": "Bio.Entrez", "...
471761321
from os import listdir from os.path import join from setuptools import setup, find_packages try: # for pip >= 10 from pip._internal.req import parse_requirements except ImportError: # for pip <= 9.0.3 from pip.req import parse_requirements PACKAGE_NAME = "mymodule" DESCRIPTION = "My module description" KEYW...
null
setup.py
setup.py
py
1,543
python
en
code
null
code-starcoder2
76
[ { "api_name": "pip.req.parse_requirements", "line_number": 26, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 31, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 34, "usage_type": "call" } ]
80119071
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion import mptt.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('lives', '0001_initial'), migrations.swappable_de...
null
apps/people/migrations/0001_initial.py
0001_initial.py
py
2,381
python
en
code
null
code-starcoder2
76
[ { "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.swappable_dependency", "line_number": 14, "usage_type": "ca...
642116492
import warnings; warnings.simplefilter('ignore') import numpy as np import copy from triqs_tprf.wannier90 import * from pytriqs.lattice.tight_binding import energies_on_bz_path from matplotlib import cm from triqs_tprf.tight_binding import * from matplotlib import pylab as plt import skimage.measure import ipywidgets a...
null
data/visualization_function.py
visualization_function.py
py
6,126
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.simplefilter", "line_number": 1, "usage_type": "call" }, { "api_name": "matplotlib.rcParams.update", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.rcParams", "line_number": 14, "usage_type": "attribute" }, { "api_name...
600037115
from common.logging import child_logger log = child_logger(__name__) import os import ROOT def load_makros(bkgModel, ptCut, etaMin, etaCut, year, massMin, massMax, massBin, npvMin, npvMax): log.info("Loading C marcos...") # load functions for fitting ROOT.gROOT.LoadMacro(os.path.dirname(os.path.realpath...
null
ZHarvester/roofit/utils.py
utils.py
py
1,050
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.logging.child_logger", "line_number": 2, "usage_type": "call" }, { "api_name": "ROOT.gROOT.LoadMacro", "line_number": 12, "usage_type": "call" }, { "api_name": "ROOT.gROOT", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.pa...
639673021
import json import torch import argparse import os from utils.SpeakerDatasetCopy import SpeakerDataset from utils.Vocab import Vocab import numpy as np from nlgeval import NLGEval if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("-data_path", type=str, default="./data") ...
null
models/speaker/compare_ref_hyp_base_TEST.py
compare_ref_hyp_base_TEST.py
py
6,498
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.ran...
640762481
"""Chat_apis tests""" import os from django.test import TestCase from chat_apis import models from django.core.management import call_command from django.test import Client from django.urls import reverse BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) class CommandTestCase(TestCase): "...
null
ariana_chat/chat_apis/tests.py
tests.py
py
1,499
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 12, "usage_type": "call" }, { "api_name": "django.test.TestCase", ...
519770616
import unittest from google.appengine.api import memcache from google.appengine.ext import ndb from google.appengine.ext import testbed from .. import user_data test_user = user_data.User(user_name="John", user_email="test@test.com", business_name="Test Business"...
null
webapp/controllers/InternalResource/DataResource/test_adduser/test_adduser.py
test_adduser.py
py
1,352
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 20, "usage_type": "attribute" }, { "api_name": "google.appengine.ext.testbed.Testbed", "line_number": 23, "usage_type": "call" }, { "api_name": "google.appengine.ext.testbed", "line_number": 23, "usage_type": "name" }, ...
648411647
from django.urls import path from survey import views app_name = 'survey' urlpatterns = [ path('', views.intro, name='intro'), path('response/<int:restaurant_pk>/', views.response, name='response'), # {% url 'survey:survey' restaurant_pk=restaurant.pk %} path('login/', views.login, name='login'), path...
null
survey/urls.py
urls.py
py
420
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "survey.views.intro", "line_number": 6, "usage_type": "attribute" }, { "api_name": "survey.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path",...
893489
import json def get_counts(sequence): counts = {} for x in sequence: if x in counts: counts[x] += 1 else: counts[x] = 1 return counts path = "usagov_bitly_data2012-03-16.txt" f = open(path, encoding='UTF8') record = [json.loads(line) for line i...
null
08_python_supplement/json_usa.py
json_usa.py
py
963
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 36, "usage_type": "call" } ]
95534076
from ws_connection import ClientClosedError from ws_server import WebSocketServer, WebSocketClient import json from iotreatment import iotreatment class MSGClients(WebSocketClient): def __init__(self, conn): super().__init__(conn) def process(self): try: data = self.connection.rea...
null
run_ws_server.py
run_ws_server.py
py
1,117
python
en
code
null
code-starcoder2
76
[ { "api_name": "ws_server.WebSocketClient", "line_number": 7, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 16, "usage_type": "call" }, { "api_name": "iotreatment.iotreatment", "line_number": 17, "usage_type": "call" }, { "api_name": "json.dump...
361366875
import matplotlib.pyplot as plt import numpy as np from sklearn import metrics from sklearn.metrics import classification_report from sklearn.metrics import confusion_matrix from datetime import datetime from tensorflow.keras import backend as K class Evaluator: def __init__(self): pass ''' Traini...
null
model_evaluator.py
model_evaluator.py
py
8,309
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.keras.backend.sum", "line_number": 24, "usage_type": "call" }, { "api_name": "tensorflow.keras.backend", "line_number": 24, "usage_type": "name" }, { "api_name": "tensorflow.keras.backend.round", "line_number": 24, "usage_type": "call" }, { ...
305615502
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2020-2023 tecnovert # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. """ export TEST_PATH=/tmp/test_basicswap mkdir -p ${TEST_PATH}/bin cp -r ~/tmp/basicswap_bin/* ${T...
null
tests/basicswap/extended/test_encrypted_xmr_reload.py
test_encrypted_xmr_reload.py
py
4,870
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 37, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 38, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 40, "usage_type": "call" }, { "api_name": "sys.stdout...
341640387
# -*- coding: UTF-8 -*- import os import os.path import xlrd import xlwt # Excel操作类 class ExcelHandle: def __init__(self,path): self.path=path #输出到Excel def write2Excel(targetPath,sheetName,data): if len(targetPath) <=0 : print("error. targetPath is empty ") return else: print("targetPath %s"%(...
null
ExcelHandle.py
ExcelHandle.py
py
1,371
python
en
code
null
code-starcoder2
76
[ { "api_name": "xlwt.Workbook", "line_number": 36, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 50, "usage_type": "call" } ]
194017701
''' 52. ステミング 51の出力を入力として受け取り,Porterのステミングアルゴリズムを適用し,単語と語幹をタブ区切り形式で出力せよ. \ Pythonでは,Porterのステミングアルゴリズムの実装としてstemmingモジュールを利用するとよい. ''' from stemming.porter2 import stem def stemming(input_, output_): with open(input_) as f, open(output_, "w") as fw: for word in f: word = word.rstrip() ...
null
Naoto/chapter06/knock52.py
knock52.py
py
662
python
en
code
null
code-starcoder2
76
[ { "api_name": "stemming.porter2.stem", "line_number": 14, "usage_type": "call" }, { "api_name": "stemming.porter2", "line_number": 20, "usage_type": "call" } ]
146210572
import datetime import random import string from datetime import date import stripe from django import template from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts ...
null
payments/views.py
views.py
py
8,573
python
en
code
null
code-starcoder2
76
[ { "api_name": "stripe.api_key", "line_number": 19, "usage_type": "attribute" }, { "api_name": "django.conf.settings.STRIPE_SECRET_KEY", "line_number": 19, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 19, "usage_type": "name" }, { ...
456502516
from flask import Flask,render_template #from fireinit import firebase,db,dataget import humidity app = Flask(__name__) @app.route('/') def index(): data = humidity.getTemp() return render_template('index.html', data=data) @app.route('/supplylist') def supplylist(): # userlist = dataget() return render_templat...
null
app.py
app.py
py
419
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "humidity.getTemp", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_templat...
189648142
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from fmix_orig import sample_mask device = "cuda" if torch.cuda.is_available() else "cpu" # https://www.kaggle.com/virajbagal/mixup-cutmix-fmix-visualisations/data # https://www.kaggle.com/ar2017/pytorch-efficientnet-train-aug-cut...
null
code/mix_aug.py
mix_aug.py
py
6,166
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.cuda.is_available", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.int", "lin...
530828295
# -*- coding: utf-8 -*- # # Copyright (c) 2013-2021 Virtual Cable S.L.U. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright not...
null
server/src/uds/core/util/stats/events.py
events.py
py
6,086
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 40, "usage_type": "call" }, { "api_name": "typing.Tuple", "line_number": 42, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 42, "usage_type": "attribute" }, { "api_name": "typing.Uni...
262075362
#!/usr/bin/python import logging import os from gevent.pywsgi import WSGIServer from geventwebsocket.handler import WebSocketHandler import flaskapp.views import daemon import sys class app_config(daemon.Config): section = 'listener' default_conf = os.path.join('flaskapp.cfg') def run(self): try: host = self...
null
run.py
run.py
py
1,048
python
en
code
null
code-starcoder2
76
[ { "api_name": "daemon.Config", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flaskapp.views.views", ...
139049829
from collections import defaultdict SHIFT, LEFT, RIGHT = 0, 1, 2 class DependencyParsing: def __init__(self): w = [defaultdict(lambda: 0) for _ in range(3)] def MakeFeats(self, stack, queue): feats = defaultdict(lambda: 0) if len(stack) > 0 and len(len) > 0: feats[f'W-1 {...
null
kobayashi/tutorial11/tutorial11.py
tutorial11.py
py
4,779
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 10, "usage_type": "call" } ]
278765388
import re import warnings from django.utils import timezone from django.contrib.auth.models import ( AbstractBaseUser, python_2_unicode_compatible, GroupManager, UserManager, _user_get_all_permissions, _user_has_perm, _user_has_module_perms, send_mail, urlquote, SiteProfileNotAv...
null
djangae/contrib/auth/models.py
models.py
py
9,584
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.signals.post_syncdb.disconnect", "line_number": 32, "usage_type": "call" }, { "api_name": "django.db.models.signals.post_syncdb", "line_number": 32, "usage_type": "attribute" }, { "api_name": "django.db.models.signals", "line_number": 32, "...
61788386
from happenings.settings import (IMAGE_MODEL_IMAGE_FIELD, IMAGE_MODEL_WIDTH_FIELD, IMAGE_MODEL_HEIGHT_FIELD, IMAGE_MODEL_RESIZER) def resize_image(image, width, height): from importlib import import_module if callable(IMAGE_MODEL_RESIZER): resize_method = IMAGE_MODEL_RESIZER elif isinstance(I...
null
happenings/api/utils.py
utils.py
py
2,067
python
en
code
null
code-starcoder2
76
[ { "api_name": "happenings.settings.IMAGE_MODEL_RESIZER", "line_number": 8, "usage_type": "argument" }, { "api_name": "happenings.settings.IMAGE_MODEL_RESIZER", "line_number": 9, "usage_type": "name" }, { "api_name": "happenings.settings.IMAGE_MODEL_RESIZER", "line_number": 10...
535245018
#! /usr/bin/python # -*- coding: latin-1 -*- from astropy.time import Time from astropy.coordinates import Angle import astropy.units as u import numpy as np from numpy import cos, sin, arccos, arcsin, arctan import location from astropy.utils.iers import IERS_A, IERS_A_URL from astropy.utils.data import download_fil...
null
coordinates.py
coordinates.py
py
3,725
python
en
code
null
code-starcoder2
76
[ { "api_name": "astropy.utils.data.download_file", "line_number": 15, "usage_type": "call" }, { "api_name": "astropy.utils.iers.IERS_A_URL", "line_number": 15, "usage_type": "argument" }, { "api_name": "astropy.utils.iers.IERS_A.open", "line_number": 16, "usage_type": "cal...
308759304
# Copyright 2020 Mickael Chen, Edouard Delasalles, Jean-Yves Franceschi, Patrick Gallinari, Sylvain Lamprier # 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/licens...
null
module/utils.py
utils.py
py
4,833
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.ReLU", "line_number": 34, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 34, "usage_type": "name" }, { "api_name": "torch.nn.LeakyReLU", "line_number": 36, "usage_type": "call" }, { "api_name": "torch.nn", "line_number...
640638367
from flask import Flask, render_template, request, redirect, url_for import mongo_api as mongo from viewModels.indexViewModel import IndexViewModel from dotenv import find_dotenv, load_dotenv import os import flask_login import requests import json from user import User from functools import wraps GITHUB_AUTHORIZATION...
null
app.py
app.py
py
3,339
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_login.LoginManager", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.redirect", "line_number": 20, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 20, "usage_type": "call" }, { "api_name": "user.User", "li...
446591265
import json import sys from wordcloud import WordCloud from gettags import get_user_info def makeImage(text): wc = WordCloud(max_words=1000, width=1920, height=1080) # wc = WordCloud(max_words=1000, width=3840, height=2160) # wc = WordCloud(background_color="white", max_words=1000, mask=alice_mask) ...
null
main.py
main.py
py
707
python
en
code
null
code-starcoder2
76
[ { "api_name": "wordcloud.WordCloud", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 22, "usage_type": "attribute" }, { "api_name": "gettags.get_user_info...
633226422
import os import time import uuid from flask import ( g, flash, abort, jsonify, request, url_for, session, redirect, Blueprint, render_template, send_from_directory, ) from models.collection import Collection from models.reply import Reply from models.topic import Topic fro...
null
routes/user.py
user.py
py
5,200
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 32, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 37, "usage_type": "call" }, { "api_name": "flask.request.form.to_dict", "line_number": 42, "usage_type": "call" }, { "api_name": "flas...
341340434
"""Process the raw EMO-DB dataset. This assumes the file structure from the original compressed file: /.../ wav_corpus/ *.wav silb/ ... ... """ import shutil from pathlib import Path import click from tqdm import tqdm from ertk.dataset import write_annotations, write_filelist from ertk.u...
null
datasets/EMO-DB/process.py
process.py
py
1,421
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 34, "usage_type": "name" }, { "api_name": "ertk.dataset.write_annotations", "line_number": 37, "usage_type": "call" }, { "api_name": "ertk.dataset.write_annotations", "line_number": 39, "usage_type": "call" }, { "api_na...
18413050
#!/usr/bin/env python import sys import json import argparse import logging import yaml from pprint import pprint from bitshares import BitShares from bitshares.asset import Asset from bitshares.account import Account log = logging.getLogger(__name__) def main(): parser = argparse.ArgumentParser(description=...
null
get_feeds.py
get_feeds.py
py
1,355
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 28, "usage_type": "attribute" }, { "api_name": "logging....
474203809
from threading import RLock import logging class MqttTopicSubscriber: ''' Manages callbacks for a particular machine motion and propagates them up to the client ''' def __init__(self, machineMotion: 'MachineMotion'): self.__lock = RLock() self.__queue = [] self.__callbacks = {...
null
mm-machineapp-template/server/internal/mqtt_topic_subscriber.py
mqtt_topic_subscriber.py
py
2,819
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.RLock", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" } ]
539257999
#!/usr/bin/env python # coding: utf-8 # # MMI Model with Mood # ## Authors: Per B. Sederberg & Adam W. Fenton & Charles Zheng # In[1]: # load matplotlib inline mode #get_ipython().run_line_magic('matplotlib', 'inline') import click @click.command() @click.argument('subj_input_dir') @click.argument('subj_out_dir') ...
null
notebook/MMI_Open_Loop/MMI_Model_Mood_LTA_gamma_WO_beta_p0_OL.py
MMI_Model_Mood_LTA_gamma_WO_beta_p0_OL.py
py
10,119
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 50, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 51, "usage_type": "call" }, { "api_name": "mmi_mood_LTA_gamma_WO_beta_p0_OL.load_mmi_data", "line_number": 57, "usage_type": "call" }, { "api_name...
439366081
from flask_restful import reqparse, abort from flask_restful_swagger_2 import swagger, Resource from resources import aggregationResource import configuration from flask import request from lib import mongodbConnection, crawler from bson.objectid import ObjectId from bson import json_util from datetime import datetime ...
null
src/resources/crawlerResource.py
crawlerResource.py
py
7,216
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "cerberus.Validator", "line_number": 39, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 43, "usage_type": "call" }, { "api_name": "cerberus.Validator", ...
255035329
import argparse import configparser # global var gparams = None class Params(object): def __init__(self): global gparams self.read_arguments() self.read_config() gparams = self pass def read_arguments(self): parser = argparse.ArgumentParser( descri...
null
python/lib-4xatwork/calix/timeseries/params.py
params.py
py
11,462
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 30, "usage_type": "call" } ]
511895217
#!/usr/bin/python3 import os import glob import argparse import numpy as np import tensorflow as tf from osgeo import gdal from tensorflow.python.keras.callbacks import TensorBoard, ModelCheckpoint, \ EarlyStopping from data_preparation import parse_label_code from cnn_lib import AugmentGenerator, categorical_d...
null
src/run-u-net.py
run-u-net.py
py
17,584
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "osgeo.gdal.Open", "line_numbe...
251053801
import cv2 import cv2.cv as cv import numpy as np # HSV ranges to detect bright orange lowerB = [0,100,220] upperB = [15,200,255] ## Code for testing ## #hand = cv2.imread('hand3.jpg') #small_hand = cv2.resize(hand, (640,480)) # hand is a cropped, color image def findFingerXY(hand): hsv_hand = cv2.cvtColor(...
null
hand.py
hand.py
py
1,937
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.cvtColor", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 16, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY",...
550439569
import gym from gym.spaces import Discrete from reco_gym import Organic_Session from numpy import zeros from numpy.random import RandomState, randint from numpy.linalg import matrix_power from scipy.special import expit as sigmoid # change name of function since it's confusing import pandas as pd # Arguments share...
null
reco_gym/envs/abstract.py
abstract.py
py
6,848
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.randint", "line_number": 23, "usage_type": "call" }, { "api_name": "scipy.special.expit", "line_number": 35, "usage_type": "call" }, { "api_name": "gym.Env", "line_number": 45, "usage_type": "attribute" }, { "api_name": "numpy.random.Ra...
370505891
#!/usr/bin/env python3 '''class Yolo''' import tensorflow.keras as K import numpy as np import glob import cv2 class Yolo(): '''class Yolo that uses the Yolo v3 algorithm Attributes: model: the Darknet Keras model class_names: a list of the class names for the model class_t: the box s...
null
supervised_learning/0x0A-object_detection/5-yolo.py
5-yolo.py
py
4,725
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.keras.models.load_model", "line_number": 32, "usage_type": "call" }, { "api_name": "tensorflow.keras.models", "line_number": 32, "usage_type": "attribute" }, { "api_name": "tensorflow.keras", "line_number": 32, "usage_type": "name" }, { "...
196945356
from rest_framework import serializers from .models import Estado from .models import Sesion from app.contenido.models import Contenido from app.competencia.models import Competencia from app.resultado_aprendizaje.models import Resultado_aprendizaje class EstadoSerializer(serializers.ModelSerializer): class Meta: ...
null
app/sesion/serializers.py
serializers.py
py
4,460
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 8, "usage_type": "name" }, { "api_name": "models.Estado", "line_number": 10, "usage_type": "name" }, {...
638603213
import json from datetime import date from datetime import datetime from urllib.parse import parse_qs from django.conf import settings from django.contrib.gis.db import models from django.core.cache import cache from django.db.models import Q from django.db.models.signals import pre_save, pre_delete, post_save, post_d...
null
apps/core/models.py
models.py
py
23,625
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.gis.db.models.Model", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.contrib.gis.db.models", "line_number": 16, "usage_type": "name" }, { "api_name": "django.contrib.gis.db.models.CharField", "line_number": 23, "usage_t...
590267331
#-*- coding: utf-8 -*- from django import forms from .models import MenuItem from django.utils.translation import ugettext_lazy as _ class MenuItemForm(forms.ModelForm): class Meta: model = MenuItem fields = ('name', 'href') labels = { 'name': _(u'Nazwa'), 'href': ...
null
misc/forms.py
forms.py
py
341
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "models.MenuItem", "line_number": 10, "usage_type": "name" }, { "api_name": "django.utils.t...
361204039
from django.conf.urls import url from django.contrib.auth.views import LogoutView from .views import ( UserCreateAPIView, UserLoginAPIView, UserExistAPIView ) urlpatterns = [ url(r'^register/$', UserCreateAPIView.as_view(), name='register'), url(r'^login/$', UserLoginAPIView.as_view(), name='login'...
null
Source/Serverside/django_react/djreact/user_account/urls.py
urls.py
py
461
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "views.UserCreateAPIView.as_view", "line_number": 10, "usage_type": "call" }, { "api_name": "views.UserCreateAPIView", "line_number": 10, "usage_type": "name" }, { "api_...
628335573
#!/usr/bin/python3 from sympy import * from sympy.parsing.sympy_parser import parse_expr from wibl2NusseltSimplified import wibl2NusseltSimplified def main(): x, y, z, t = symbols("x y z t") h = Function("h")(x, z, t) hbar = Function("hbar")(z) htilde = Function("htilde")(x, z) hhat = Function("hh...
null
lineariseRivuletWIBL2STF.py
lineariseRivuletWIBL2STF.py
py
2,475
python
en
code
null
code-starcoder2
76
[ { "api_name": "sympy.parsing.sympy_parser.parse_expr", "line_number": 29, "usage_type": "argument" } ]
464789099
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .models import Post from django.shortcuts import render, HttpResponse # Create your views here. def index(request): return HttpResponse('up and running!') def add_post(request): item1 = Post.objects.create(author='Something Something', tit...
null
django/django_girls/apps/blog/views.py
views.py
py
761
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.HttpResponse", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Post.objects.create", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 13, "usage_type": "attribute" }, { ...
401191968
import lib # keywords, braces, operators, types # lexify: split a string into its lexemes and story them and their respective identities def lexify(string): tokens = [] types = [] lexeme = "" for i, char in enumerate(string): # special case: char is an operator (defined in lib) ...
null
MRLex.py
MRLex.py
py
2,922
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.operators", "line_number": 12, "usage_type": "attribute" }, { "api_name": "lib.keywords", "line_number": 15, "usage_type": "attribute" }, { "api_name": "lib.types", "line_number": 16, "usage_type": "attribute" }, { "api_name": "lib.stop", "l...
296420433
#!/usr/bin/python3 #coding: utf-8 from urllib import request, parse, error import json from utils.timeout import * from exceptions import * from agv import * class Jz(Agv): """Summary class Jz class here. This is a AGV class describing Jiazhi brand's AGV inherited from Agv class. Most functions of Jz cla...
null
jz.py
jz.py
py
12,015
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.Request", "line_number": 50, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 50, "usage_type": "name" }, { "api_name": "urllib.request.urlopen", "line_number": 51, "usage_type": "call" }, { "api_name": "urllib.r...
225131632
# coding: utf-8 import pygame from pygame.locals import * import sys from collections import deque BLACK = (0, 0, 0) GRAY = (198, 198, 198) YELLOW = (214, 203, 2) isGen = True status = "bfs" def maze_gen(): maze_base = [["." for x in range(126)] for y in range(70)] for y in range(1, 70, 2): for x in...
null
pygame_proc/maze_anime.py
maze_anime.py
py
3,853
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 39, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 107, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 107, "usage_type": "attribute" }, { "api_name": "pygame.draw.rec...
477694101
""" Copyright (c) Facebook, Inc. and its affiliates. """ import os import sys import math import copy import time import logging from collections.abc import Iterable from prettytable import PrettyTable import Pyro4 import numpy as np if "/opt/ros/kinetic/lib/python2.7/dist-packages" in sys.path: sys.path.remove("/...
null
droidlet/lowlevel/locobot/locobot_mover.py
locobot_mover.py
py
15,508
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.path.remove", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "Pyro4.config", "line_...