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
251738639
from django.shortcuts import render from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from django.core.exceptions import ObjectDoesNotExist from .models import Port, Category, BuildHistory, Maintainer, Dependency, Builder, User from bs4 import BeautifulSoup from django.core.pagin...
null
app/ports/views.py
views.py
py
8,739
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.Category.objects.all", "line_number": 15, "usage_type": "call" }, { "api_name": "models.Category.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "models.Category", "line_number": 15, "usage_type": "name" }, { "api_name...
100532373
#!/usr/bin/env python3 import datetime import json import os import re import fnmatch import numpy as np import cv2 from natsort import natsorted import random import sys ROOT_DIR = '/media/juan/Data/retail_products/ceiling/shoot1_one_person_vivoteks' IMAGE_DIR = os.path.join(ROOT_DIR, "all_cams") VGG_ANNOTATIONS_DIR...
null
tools_vgg_annotation_to_coco.py
tools_vgg_annotation_to_coco.py
py
9,190
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
369097868
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('vault', '0002_bluray_dvd'), ] operations = [ migrations.AlterField( model_name='dcp', name='subtitle...
null
vault/migrations/0003_auto_20150512_1942.py
0003_auto_20150512_1942.py
py
526
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
483082673
''' Evaluate performance of a single trained classifier on multiple patient-stay-slices ''' import os import numpy as np import pandas as pd from joblib import dump, load import sys sys.path.append(os.path.join(os.path.abspath('../'), 'src')) DEFAULT_PROJECT_REPO = os.path.sep.join(__file__.split(os.path.sep)[:-2]) PR...
null
scripts/mimic3benchmarks_inhospital_mortality/src/evaluate_skorch_lr_surrogate_loss_vs_bce_plus_threshold_search.py
evaluate_skorch_lr_surrogate_loss_vs_bce_plus_threshold_search.py
py
40,298
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
348403993
import discord from discord.ext import commands class General(commands.Cog): def __init__(self,bot): self.bot = bot @commands.command() async def role(self, ctx): import random roles = ['Damage','Tank','Support'] output = random.choice(roles) await ctx.send(output) ...
null
cogs/general/__init__.py
__init__.py
py
366
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.ext.commands.Cog", "line_number": 4, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 4, "usage_type": "name" }, { "api_name": "random.choice", "line_number": 12, "usage_type": "call" }, { "api_name": "discor...
297732434
from list_ui import * import json import random import cv2 import json import os class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): dic={} files=[] is_useful = {} alpha = 0.4 sli_min,sli_max = 0, 10 all_files = [] key="" sample = [] com_lists = [] curr_box = ["001",...
null
qt_files/mul_images/listv3.py
listv3.py
py
7,178
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.sample", "line_number": 86, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 99, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 100, "usage_type": "call" }, { "api_name": "cv2.addWeighted", "line_numb...
106091764
import unittest import json from ..server import app class TestServer(unittest.TestCase): def setUp(self): app.config["TESTING"] = True app.config["DEBUG"] = True self.app = app.test_client() self.assertEqual(app.debug, True) def test_home_root(self): response = self.a...
null
ToDo/Tests/test_server.py
test_server.py
py
681
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "server.app.config", "line_number": 8, "usage_type": "attribute" }, { "api_name": "server.app", "line_number": 8, "usage_type": "name" }, { "api_name": "server.app.conf...
79873548
import dash import dash_leaflet as dl import dash_leaflet.express as dlx import dash_core_components as dcc import dash_html_components as html import plotly.express as px import dash_table import dash_bootstrap_components as dbc import pandas as pd from dash.exceptions import PreventUpdate from dash.dependencies impo...
null
web_dashboard.py
web_dashboard.py
py
18,615
python
en
code
null
code-starcoder2
83
[ { "api_name": "animal_shelter.AnimalShelter", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_records", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "attribute" }, { "...
475914742
import numpy as np import matplotlib.pyplot as plt from sklearn.cross_validation import KFold, cross_val_score, cross_val_predict, LeaveOneOut from sklearn.tree import DecisionTreeClassifier from sklearn.tree import DecisionTreeRegressor from sklearn import preprocessing from sklearn import metrics from sklearn.ensembl...
null
MachineLearning_Python/DecisionTreeNoEntropy_v1.py
DecisionTreeNoEntropy_v1.py
py
3,455
python
en
code
null
code-starcoder2
83
[ { "api_name": "csv.reader", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 33...
574168276
# -*- coding: utf-8 -*- """Utilities.""" from six.moves import input as raw_input import os import sys def query_yes_no(question, default="yes"): """Ask a yes/no question via raw_input() and return their answer. "question" is a string that is presented to the user. "default" is the presumed answer if th...
null
dodo_commands/framework/util.py
util.py
py
2,457
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.stdout.write", "line_number": 31, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 31, "usage_type": "attribute" }, { "api_name": "six.moves.input", "line_number": 32, "usage_type": "call" }, { "api_name": "sys.stdout.write", ...
218579025
import string import numpy as np import cv2 import math def get_vocabulary(voc_type, EOS='EOS', PADDING='PAD', UNKNOWN='UNK'): voc = None types = ['LOWERCASE', 'ALLCASES', 'ALLCASES_SYMBOLS'] if voc_type == 'LOWERCASE': voc = list(string.digits + string.ascii_lowercase) elif voc_typ...
null
data_provider/data_utils.py
data_utils.py
py
1,541
python
en
code
null
code-starcoder2
83
[ { "api_name": "string.digits", "line_number": 11, "usage_type": "attribute" }, { "api_name": "string.ascii_lowercase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "string.digits", "line_number": 13, "usage_type": "attribute" }, { "api_name": "str...
356384684
import os, sys, threading from pyspark import SparkConf, SparkContext, SQLContext from pyspark.sql import SparkSession, DataFrame conf = SparkConf().setAppName('partitioning') sc = SparkContext(conf=conf) spark = (SparkSession.builder.config(conf=conf) # .config("hive.exec.dynamic.partition", "true") \ ...
null
scripts/partition.py
partition.py
py
3,578
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyspark.SparkConf", "line_number": 5, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 6, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder.config", "line_number": 7, "usage_type": "call" }, { "api_n...
561675358
#!/usr/bin/env python import numpy as np import random from ddpg_model import Actor, Critic import torch import torch.nn.functional as F import torch.optim as optim from ounoise import OUNoise # Hyperparameters BUFFER_SIZE = int(1e6) # replay buffer size BATCH_SIZE = 300 # minibatch size GAMMA = 0.99 ...
null
ddpg_agent.py
ddpg_agent.py
py
7,438
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.device", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 22, "usage_type": "attribute" }, { "api_name": "ddpg_model.Actor...
569805392
#!/usr/bin/env python3 import sys import os import pandas as pd import numpy as np import pandas as pd import folium import urllib import json import socket from ipwhois import IPWhois import pycountry import io import requests import xarray as xr import numpy as np import pandas as pd import holoviews as hv import ge...
null
scripts/scraper.py
scraper.py
py
6,638
python
en
code
null
code-starcoder2
83
[ { "api_name": "holoviews.notebook_extension", "line_number": 33, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 40, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 41, "usage_type": "attribute" }, { "api_name": "pandas.read_...
361257440
from django.shortcuts import render from django.views import generic from catalogue.models import Post from django.contrib.postgres.search import SearchVector from django.http import HttpResponse from member.models import Member class IndexView(generic.ListView): template_name="catalogue/catalogue.html" def get_query...
null
A_library_V3/catalogue/views.py
views.py
py
1,672
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.views.generic.ListView", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.views.generic", "line_number": 7, "usage_type": "name" }, { "api_name": "catalogue.models.Post.objects.all", "line_number": 10, "usage_type": "call" }, ...
117829544
#!/usr/bin/env python3 import hashlib import random import subprocess import unittest from pathlib import Path from faker import Faker from src.anonfile import AnonFile, get_logfile_path TOKEN = None def test_option(token): TOKEN = token def md5_checksum(path: Path) -> str: with open(path, mode='rb') as...
null
tests/test_anonfile.py
test_anonfile.py
py
4,203
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 20, "usage_type": "name" }, { "api_name": "hashlib.md5", "line_number": 22, "usage_type": "call" }, { "api_name": "faker.Faker", "line_number": 26, "usage_type": "call" }, { "api_name": "src.anonfile.AnonFile", "lin...
377789540
import sys import traceback from functools import wraps from tornado import web from tornado.escape import json_decode, json_encode from tornado.log import app_log from graphql.error import GraphQLError from graphql.error import format_error as format_graphql_error from graphql import graphql from .session_control imp...
null
maverick_api/modules/base/tornadoql/graphql_handler.py
graphql_handler.py
py
4,872
python
en
code
null
code-starcoder2
83
[ { "api_name": "tornado.web.HTTPError", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tornado.web", "line_number": 17, "usage_type": "name" }, { "api_name": "graphql.error.GraphQLError", "line_number": 19, "usage_type": "name" }, { "api_name": "gra...
448220795
import os import cv2 from skimage import io import shutil from imgseg import segmentationUtils from imgseg import annotationUtils from geojson import FeatureCollection, dump from skimage import measure def masks_to_annotation(datasets_dir, save_path): masks_dir = os.path.join(datasets_dir, "labels_all") nuclei...
null
src/imgseg/geojson_utils.py
geojson_utils.py
py
8,914
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
213927346
# encoding: UTF-8 import abc import inspect import types import six from combo_x40.core.frozen_types import FrozenObject from combo_x40.core.utils import resolve_module class CodeElement(object): MODULE = 1 ANNOTATION = 2 CLASS = 4 FUNCTION = 8 PROPERTY = 16 DESCRIPTOR = 32 ANY = MODULE...
null
combo_x40/core/annotations.py
annotations.py
py
6,384
python
en
code
null
code-starcoder2
83
[ { "api_name": "inspect.ismodule", "line_number": 22, "usage_type": "attribute" }, { "api_name": "inspect.isclass", "line_number": 26, "usage_type": "call" }, { "api_name": "inspect.isclass", "line_number": 30, "usage_type": "call" }, { "api_name": "inspect.isfunct...
338550461
from django.urls import path, include from rest_framework import routers from . import views app_name = 'blog' router = routers.DefaultRouter() router.register('posts', views.AllPostsViewSet) router.register('post', views.PostViewSet) urlpatterns = [ path('', views.home, name="homepage"), path('list', views....
null
src/blog/urls.py
urls.py
py
471
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 7, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 7, "usage_type": "name" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_na...
396635104
import os import time from pathlib import Path import pandas as pd import torch from torch.nn import SmoothL1Loss from torch.utils.data import DataLoader from ts.es_rnn.config import get_config from ts.es_rnn.model import ESRNN from ts.es_rnn.trainer import ESRNNTrainer from ts.utils.data_loading import SeriesDataset...
null
ts/es_rnn/main.py
main.py
py
3,204
python
en
code
null
code-starcoder2
83
[ { "api_name": "ts.utils.helper_funcs.set_seed", "line_number": 17, "usage_type": "call" }, { "api_name": "time.time", "line_number": 19, "usage_type": "call" }, { "api_name": "ts.utils.helper_funcs.MODEL_TYPE.ESRNN", "line_number": 20, "usage_type": "attribute" }, { ...
347395599
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
null
vsts/vsts/release/v4_1/models/release_environment.py
release_environment.py
py
10,222
python
en
code
null
code-starcoder2
83
[ { "api_name": "msrest.serialization.Model", "line_number": 12, "usage_type": "name" } ]
279469332
import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.switch_backend('agg') #%matplotlib inline from glob import glob from tqdm import tqdm import cv2 from PIL import Image from imgaug import augmenters as iaa #from keras.callbacks import TensorBoard #from keras.utils import ...
null
test_inception_resnet_v2.py
test_inception_resnet_v2.py
py
7,481
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.switch_backend", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "nump...
9251953
""" www.dorkal.com :author Dedaldino M. Antonio (3D) :decryption This software was developed Dedaldino Mambuenze Antonio, an programmer Python, love a lot python and others languages like Java, JavaScript, C++, Earlang, Go Dorkal, Inc - All right reserved &copy 2020 """ import re from backend.p...
null
backend/users/models.py
models.py
py
16,866
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.auth.base_user.BaseUserManager", "line_number": 30, "usage_type": "name" }, { "api_name": "django.contrib.auth.base_user.AbstractBaseUser", "line_number": 40, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.PermissionsMixin", "l...
604230836
import os import numpy as np import pandas as pd from PIL import Image from torchvision import transforms import torch.utils.data as data class DatasetFLViT(data.Dataset): def __init__(self, args, phase ): super(DatasetFLViT, self).__init__() self.phase = phase if args.dataset == "cifa...
null
utils/data_utils.py
data_utils.py
py
5,279
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.Dataset", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 11, "usage_type": "name" }, { "api_name": "numpy.load", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.joi...
590898886
# Copyright 2021 Hathor Labs # # 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 writing, s...
null
hathor/conf/get_settings.py
get_settings.py
py
1,437
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ.get", "line_number": 31, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 31, "usage_type": "attribute" }, { "api_name": "importlib.import_module", "line_number": 37, "usage_type": "call" }, { "api_name": "importlib.impo...
644000189
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse from os.path import join import matplotlib.pyplot as plt import numpy as np import tensorflow as tf # define the CLI arguments parser = argparse.ArgumentParser() parser.add_argument('--batch_s...
null
fullstack/python/tensorflow/cat-dogs-dataset-with-tensorflow-pfehrmann.py
cat-dogs-dataset-with-tensorflow-pfehrmann.py
py
9,322
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.read_file", "line_number": 37, "usage_type": "call" }, { "api_name": "tensorflow.image.decode_image", "line_number": 41, "usage_type": "call" }, { "api_na...
314570330
# Copyright (c) 2018, Novo Nordisk Foundation Center for Biosustainability, # Technical University of Denmark. # # 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
tests/conftest.py
conftest.py
py
4,483
python
en
code
null
code-starcoder2
83
[ { "api_name": "warehouse.app.init_app", "line_number": 32, "usage_type": "call" }, { "api_name": "warehouse.app.app", "line_number": 32, "usage_type": "argument" }, { "api_name": "warehouse.app.app.app_context", "line_number": 33, "usage_type": "call" }, { "api_na...
380656250
from django.urls import path from . import views app_name='homemap' urlpatterns=[ path('',views.index,name='index'), path('create/',views.create,name='create'), path('delete/<int:id>',views.delete,name='delete'), path('update/<int:id>',views.update,name='update'), path("select/",views.select,name='...
null
homemap/urls.py
urls.py
py
448
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
411491777
import re import json import os.path import unicodedata from urllib import parse, request import requests import urllib.request import sys import json def gethouselink(ln): link=ln.replace('- ','-') link=link.replace('? ','-') link=link.replace(', ','-') link=link.replace(' ','-') print(link) prefix='http:...
null
househunter/generatehouses.py
generatehouses.py
py
10,423
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.post", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.path.isfile", "line_number": 75, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 75, "usage_type": "attribute" }, { "api_name": "os.path", "li...
369394031
import logging LOGGER = logging.getLogger() try: HANDLER = LOGGER.handlers[0] except IndexError: # This is required for local testing HANDLER = logging.StreamHandler() LOGGER.addHandler(HANDLER) LOGFORMAT = "[%(asctime)s] %(levelname)s:%(name)s:%(message)s" HANDLER.setFormatter(logging.Formatter(LOGFOR...
null
logger/logger_format.py
logger_format.py
py
376
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 3, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.INFO"...
369176508
import tensorflow as tf import keras import numpy as np print(tf.__version__) # loading train data imdb = keras.datasets.imdb (train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words=1000) #Explore the data print("Training entries: {}, labels: {}".format(len(train_data), len(train_labels))) ''...
null
IMDB-textmining.py
IMDB-textmining.py
py
2,091
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.__version__", "line_number": 5, "usage_type": "attribute" }, { "api_name": "keras.datasets", "line_number": 8, "usage_type": "attribute" }, { "api_name": "keras.preprocessing.sequence.pad_sequences", "line_number": 47, "usage_type": "call" }, ...
337069339
# -*- coding: utf-8 -*- """ Created on Sat Feb 13 14:45:21 2021 @author: Mike """ import pygame.font from pygame.sprite import Group from ship import Ship class Scoreboard: """A class to report scoring information""" def __init__(self, ai_game): """Initialize scorekeeping attributes""" se...
null
src/scoreboard.py
scoreboard.py
py
1,693
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.font.font.SysFont", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.font.font", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pygame.font", "line_number": 24, "usage_type": "name" }, { "api_name": "pygame.spr...
313094868
# -*- coding: utf-8 -*- """ @author: brendan.fitzpatrick Questions ------------------------------------------------------------------------------- 1. The stakeholder wants the message_blast chart to have two new fields: total_emails_clicked and total_emails_opened. How can we provide this information...
null
NJOY/basic_data.py
basic_data.py
py
4,332
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.ExcelWriter", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 48, "usage_type": "call" }, { "api_name": "os.path", "line_number": 48, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "...
212320947
import datetime import json class TaskCache(object): def __init__(self, use_cache, cache_path): self.use_cache = use_cache self.cache_path = cache_path or '.asanagh.cache' def load(self): if not self.use_cache: return {} try: with open(self.cache_path) ...
null
asana_to_github/taskcache.py
taskcache.py
py
1,023
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.datetime", "li...
545857024
import pytest from triangle import triangle_type many_triangles = [ (90, 60, 30, "right"), (100, 40, 40, "obtuse"), (60, 60, 60, "acute"), (0, 0, 0, "invalid") ] def idfn(a_triangle): a, b, c, expected = a_triangle return f'{a}-{b}-{c}-{expected}' @pytest.fixture(params=many_triangles, ids=...
null
2020/pycon_2020/code/test_11.py
test_11.py
py
486
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytest.fixture", "line_number": 17, "usage_type": "call" }, { "api_name": "triangle.triangle_type", "line_number": 23, "usage_type": "call" } ]
296662924
# -*- mode: python; coding: utf-8 -* # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 3-clause BSD License from __future__ import absolute_import, division, print_function import numpy as np import os import sys import six from six.moves import map, range, zip import warnings import astropy.co...
null
pyuvsim/uvsim.py
uvsim.py
py
21,498
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.isclose", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.isclose", "line_number": 48, "usage_type": "call" }, { "api_name": "astropy.time.Time", "line_number": 88, "usage_type": "call" }, { "api_name": "astropy.units.Hz", ...
371815025
import logging from pprint import pformat LOGGER = logging.getLogger(__name__) class APIItems: """Base class for a map of API Items.""" def __init__(self, raw, request, path, item_cls): self._request = request self._path = path self._item_cls = item_cls self._items = {} ...
null
aiounifi/api.py
api.py
py
1,087
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "pprint.pformat", "line_number": 17, "usage_type": "call" } ]
254806145
#!/usr/bin/python """ for testing run: (python3 gloss_links.py test_data/gloss_key.txt test_data --lf "test_data/gloss_links_inp1.txt" "test_data/gloss_links_inp2.txt") --------- for understanding code -------- Each file is opened only once now. The data structure used in new version is a bit complicated: -> keyword_c...
null
gloss_links.py
gloss_links.py
py
5,306
python
en
code
null
code-starcoder2
83
[ { "api_name": "re.sub", "line_number": 45, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 88, "usage_type": "call" } ]
169599884
# coding=utf-8 # !/usr/bin/python """ INFO: DESC: script options -------------- --param : parameter list Created by Samujjwal_Ghosh on 11-Apr-17. __author__ : Samujjwal Ghosh __version__ = ": 1 $" __date__ = "$" __copyright__ = "Copyright (c) 2017 Samujjwal Ghosh" __license__ = "Python" Supervised a...
null
SMERP17_CNE.py
SMERP17_CNE.py
py
5,498
python
en
code
null
code-starcoder2
83
[ { "api_name": "platform.system", "line_number": 34, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 35, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "sys.path.append", "...
180891043
from django.urls import path from . import views from .my_views import state_views from .my_views import old_func_views from .my_views import old_func_async_views from .my_views import analyze_cfg_view from .my_views import parse_cfg_view from .my_views import task_view from .my_views import pack_view from .my_views i...
null
fw_analyze/urls.py
urls.py
py
6,650
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 20, "usage_type": "call" }, { "api_name": "my_views.analyze_cfg_view.analyze_cfg", "line_number": 20, "usage_type": "attribute" }, { "api_name": "my_views.analyze_cfg_view", "line_number": 20, "usage_type": "name" }, { ...
57798440
from torch.utils.data import Dataset from torch.utils.data import DataLoader import os from tqdm import tqdm import torch import cv2 import numpy as np class VideoDataset(Dataset): def __init__(self, data_dir, split): print('Initialize VideoDataset...') self.data_dir = os.path.join(dat...
null
SpatialAttention/VideoDataset.py
VideoDataset.py
py
2,061
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.Dataset", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.random.randi...
316601380
import json from datetime import datetime from django.http import HttpResponse from oauth2_provider.decorators import protected_resource from oauth2_provider.models import get_access_token_model from .util import get_member_data from core import librato from user.models import UserOauthActiveLog AccessToken = get_...
null
apps/api/resources_oauth.py
resources_oauth.py
py
3,094
python
en
code
null
code-starcoder2
83
[ { "api_name": "oauth2_provider.models.get_access_token_model", "line_number": 14, "usage_type": "call" }, { "api_name": "core.librato.increment", "line_number": 19, "usage_type": "call" }, { "api_name": "core.librato", "line_number": 19, "usage_type": "name" }, { ...
370528522
import numpy as np import matplotlib.pyplot as plt print("Select an option") print("Option 1") print("Option 2") print("Option 3") c=input("Select ") if c=="1": x=np.linspace(1,100,100) y=np.sin(x) plt.plot(x,y) plt.show() else: print("selecciono otro")
null
main_REMOTE_2214.py
main_REMOTE_2214.py
py
267
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.linspace", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
274493342
import logging from smartcard.CardType import AnyCardType from smartcard.CardRequest import CardRequest from smartcard.sw.SWExceptions import SWException from smartcard.Exceptions import CardRequestTimeoutException class SmartCardFuzzer(): # Constants for logging a succes class Status(): SUCCES = 0 ...
null
card_fuzzer.py
card_fuzzer.py
py
5,914
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 29, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 29, "usage_type": "attribute" }, { "api_name": "smartcard.CardType.AnyCardType", "line_number": 44, "usage_type": "call" }, { "api_name": ...
146135795
import SimpleITK as sitk import numpy as np import matplotlib.pyplot as plt from data_loaders_old import Dataset from models import Modified3DUNet import os import torch from enum import Enum # Get paths and names (IDS) of folders that store the multimodal training data data_path = r'C:\Users\artur\Desktop\UCL\Brats20...
null
segmentation_evaluation.py
segmentation_evaluation.py
py
2,104
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "data_loaders_old.Dataset", "...
423676558
#Este script te permite recuperar los tweets almacenados en Redis previamente #Los tweets almacenados usan el tema "Viva México" #Para organizar los tweets y mostrarlos en pantalla se accede a Redis usando hashmaps #El script te permite escribir una palabra clave y recuperar los tweets que contienen dicha palabra #Tamb...
null
Redis/Actividad5/sort_tweets.py
sort_tweets.py
py
4,818
python
en
code
null
code-starcoder2
83
[ { "api_name": "redis.StrictRedis", "line_number": 12, "usage_type": "call" }, { "api_name": "redis.keys", "line_number": 28, "usage_type": "call" }, { "api_name": "redis.hget", "line_number": 32, "usage_type": "call" }, { "api_name": "redis.hget", "line_number...
57233834
from datetime import datetime from BacktestMarket import BacktestMarket from FronttestMarket import FronttestMarket import time class Trader: def __init__(self, portfolio, logger, log_level): self.portfolio = portfolio self.market = None self.logger = logger self.log_level = log_level def t...
null
src/Trader.py
Trader.py
py
2,321
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "name" }, { "api_name": "datetime.da...
580435353
#coding=utf-8 from django.core.management.base import BaseCommand, CommandError from main.models import * class Command(BaseCommand): """Fix data integrity of share_count of Item model """ args = '<item_id item_id ...>' help = 'Fix data integrity' def handle(self, *args, **options): self.stdou...
null
main/management/commands/fix_item_data.py
fix_item_data.py
py
1,365
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 5, "usage_type": "name" } ]
47352914
# -*- coding: utf-8 -*- """ Created on Fri Dec 21 17:29:04 2018 @author: Ashlin """ import pandas as pd from sklearn.ensemble import RandomForestRegressor import matplotlib.pyplot as plt import numpy as np mydata=pd.read_csv("Position_Salaries.csv") X=mydata.iloc[:,1:2] y=mydata.iloc[:,-1] regressor=R...
null
Random Forest Regression.py
Random Forest Regression.py
py
840
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestRegressor", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 19, "usage_type": "call" }, { "ap...
620129715
from copy import error from django.http.response import HttpResponse from django.shortcuts import render from django.http import HttpResponse, request from rest_framework import serializers, viewsets from rest_framework import status from rest_framework.response import Response from rest_framework.views import APIView ...
null
back_end_globo/card/views.py
views.py
py
4,347
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 15, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 15, "usage_type": "name" }, { "api_name": "serializers.CardSerializer", "line_number": 16, "usage_type": "name" ...
274772895
from gensim.models import Word2Vec from gensim.test.utils import common_texts from gensim.models import Phrases import pandas as pd import re pd_title = pd.read_excel('./excel_sample/마버리타이틀.xlsx') raw_title_list = pd_title.bd_title_ko.tolist() raw_title_list def refined_special_symbol(str_list): # 특수문자 제끼기 r...
null
gensim.py
gensim.py
py
1,098
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_excel", "line_number": 7, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 14, "usage_type": "call" }, { "api_name": "gensim.models.Phrases", "line_number": 18, "usage_type": "call" }, { "api_name": "gensim.models.Word2Vec"...
594396117
import asyncio import json import logging from abc import abstractmethod from threading import Thread from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union from llama_index.agent.types import BaseAgent from llama_index.callbacks.base import CallbackManager from llama_index.chat_engine.types import...
null
llama_index/agent/openai_agent.py
openai_agent.py
py
18,383
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 25, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 31, "usage_type": "name" }, { "api_name": "llama_index.tools....
623640422
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User from django.contrib.auth.models import AbstractUser # Create your models here. class UserProfile(User): avatar = models.ImageField(upload_to='avatar/%Y/%m/%d', null=True, verb...
null
ask_app/models.py
models.py
py
6,969
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.auth.models.User", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.models.ImageField", "line_number": 12, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 12, "usage_type": "name" }, { "api_...
165555383
import multiprocessing as mp import csv import nodes import setup_state import steady_state import plt def main(): if __name__ == "__main__": pool = mp.Pool(6) pool.map(fdrc, range(int(input("Simulation times: ")))) def fdrc(k): # rd = [10, 80] m, step by 5 m for rd in range(10, 81, 5): ...
null
main.py
main.py
py
1,816
python
en
code
null
code-starcoder2
83
[ { "api_name": "multiprocessing.Pool", "line_number": 11, "usage_type": "call" }, { "api_name": "nodes.generate_node", "line_number": 20, "usage_type": "call" }, { "api_name": "setup_state.phase1", "line_number": 28, "usage_type": "call" }, { "api_name": "setup_sta...
14250168
import networkx as nx import numpy as np import scipy.io import matplotlib.pyplot as plt from shapely.geometry.polygon import Polygon from descartes import PolygonPatch from matplotlib import animation from matplotlib.animation import FuncAnimation from aircraft import Aircraft import time class Simulator(object): ...
null
simulator.py
simulator.py
py
17,938
python
en
code
null
code-starcoder2
83
[ { "api_name": "scipy.io.io.loadmat", "line_number": 34, "usage_type": "call" }, { "api_name": "scipy.io.io", "line_number": 34, "usage_type": "attribute" }, { "api_name": "scipy.io", "line_number": 34, "usage_type": "name" }, { "api_name": "scipy.io.io.loadmat", ...
347938655
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render, render_to_response,redirect from django.contrib.auth import authenticate, login from ter.models import Way from shutil import rmtree, copy2, copytree import os from os.path import isdir, isfile import codecs import plat...
null
ter/views.py
views.py
py
7,061
python
en
code
null
code-starcoder2
83
[ { "api_name": "platform.system", "line_number": 12, "usage_type": "call" }, { "api_name": "ctypes.windll.LoadLibrary", "line_number": 14, "usage_type": "call" }, { "api_name": "ctypes.windll", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.listd...
647937047
from django.shortcuts import render, redirect from .models import Article, Comment from .form import ArticleForm, CommentForm # Create your views here. def index(request): articles = Article.objects.all() context = { 'articles': articles } return render(request, 'index.html', context) def new(...
null
django_pair/start/views.py
views.py
py
2,319
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.Article.objects.all", "line_number": 7, "usage_type": "call" }, { "api_name": "models.Article.objects", "line_number": 7, "usage_type": "attribute" }, { "api_name": "models.Article", "line_number": 7, "usage_type": "name" }, { "api_name": "dj...
641215895
import logging import unittest from mock import Mock from stompest.config import StompConfig from stompest.error import StompConnectionError, StompProtocolError from stompest.protocol import StompFrame, StompSpec, commands from stompest.sync import Stomp logging.basicConfig(level=logging.DEBUG) HOST = 'fakeHost' PO...
null
stompest/tests/sync_client_test.py
sync_client_test.py
py
7,165
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 11, "usage_type": "attribute" }, { "api_name": "stompest.config.StompConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "un...
640023408
import pickle import re from pathlib import Path from string import punctuation from typing import IO, Any, Dict, List, NamedTuple, Sequence, Tuple, Union import numpy as np import pandas as pd from nltk.tokenize import word_tokenize from spacy import displacy from .indexing import PaperIndexer from .jsonformatter im...
null
corona_nlp/utils.py
utils.py
py
8,049
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.NamedTuple", "line_number": 16, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_n...
353774507
import os import numpy as np import xlrd import scipy from scipy.stats import norm from pathlib import Path import pandas as pd from models.regression.ada_boost_regressor import Ada_boost_regressor from models.regression.decision_tree_regressor import Decision_tree_regressor from models.regression.gaussian_process_regr...
null
Default_Project/Master_Script_part_1/models/regression/Student_Performance.py
Student_Performance.py
py
8,543
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.loadtxt", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "numpy.object", "line_numb...
89627227
import functools import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.cuda.amp import autocast, GradScaler from torchvision.utils import save_image from torch.utils.data import random_split import numpy as np from ..general import XDoGAnimeFaceDataset, XDoGDanboor...
null
implementations/SCFT/utils.py
utils.py
py
9,480
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.L1Loss", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 22, "usage_type": "name" }, { "api_name": "numpy.sqrt", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.bmm", "line_number": 26...
579848129
import unittest import gradio.interpretation import gradio.test_data from gradio.processing_utils import decode_base64_to_image, encode_array_to_base64 from gradio import Interface import numpy as np import os os.environ["GRADIO_ANALYTICS_ENABLED"] = "False" class TestDefault(unittest.TestCase): def test_default_...
null
test/test_interpretation.py
test_interpretation.py
py
5,099
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "unittest.TestCase", "line_number": 11, "usage_type": "attribute" }, { "api_name": "gradio.Interface", "line_number": 14, "usage_type": "call" }, { "api_name": "unittest.TestC...
146790840
""" Created by nguyenvanhieu.vn at 9/18/2018 """ from sklearn.discriminant_analysis import LinearDiscriminantAnalysis import json from sklearn.neighbors import NearestNeighbors import data_helper class LDA: def __init__(self, folders, query, mode): self.X, self.y, self.path = data_helper.read_data(f...
null
lda.py
lda.py
py
1,745
python
en
code
null
code-starcoder2
83
[ { "api_name": "data_helper.read_data", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.discriminant_analysis.LinearDiscriminantAnalysis", "line_number": 16, "usage_type": "call" }, { "api_name": "data_helper.read_image", "line_number": 21, "usage_type": ...
436504627
import os import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.render("index.html") def post(self): body = self.get_argument('body') len_body = len(body) self.render("result.html", len_body = len_bo...
null
server.py
server.py
py
801
python
en
code
null
code-starcoder2
83
[ { "api_name": "tornado.ioloop.web", "line_number": 5, "usage_type": "attribute" }, { "api_name": "tornado.ioloop", "line_number": 5, "usage_type": "name" }, { "api_name": "tornado.ioloop.web", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tornado....
356561853
import os import shutil import tarfile from coco_assistant import COCO_Assistant import data_getter from pycocotools.coco import COCO import pytest @pytest.fixture def get_data(): if os.path.isdir('./annotations') is False and os.path.isdir('./images') is False: # Download and extract data print("Down...
null
tests/tests.py
tests.py
py
1,944
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.isdir", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "data_getter.download_file_from_google_drive", "line_number": 22, "usage_type": "call" }, { "api_name":...
49756977
import pytest import csv import re import email as email_lib import imaplib from retry import retry from notifications_python_client.notifications import NotificationsAPIClient from config import Config from tests.pages import VerifyPage class RetryException(Exception): pass def remove_all_emails(email=None, ...
null
tests/utils.py
utils.py
py
7,148
python
en
code
null
code-starcoder2
83
[ { "api_name": "config.Config.SERVICE_EMAIL", "line_number": 20, "usage_type": "attribute" }, { "api_name": "config.Config", "line_number": 20, "usage_type": "name" }, { "api_name": "config.Config.SERVICE_EMAIL_PASSWORD", "line_number": 22, "usage_type": "attribute" }, ...
589353255
# Some pygame helper functions for simple image display # and sound effect playback # Rob Miles July 2017 # Version 1.0 import time import random import pygame surface = None sound_available = False def setup(width=800, height=600, title=''): ''' Sets up the pygame environment ''' global window_size ...
null
5. Making Decisions in Programs/snaps.py
snaps.py
py
11,255
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 33, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 36, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 36, "usage_type": "attribute" }, { "api_name": "pygame.displa...
566027923
from typing import List import torch from allennlp.data import TextFieldTensors, Vocabulary from allennlp.modules import TextFieldEmbedder from allennlp.nn import util from .seq2vec_encoder import Seq2VecEncoder def masked_mean_pooling(embedding_sequence: torch.Tensor, mask: torch.Tensor): embedding_sequence = e...
null
examples_allennlp/utils/retrieval/models/bag_of_embeddings.py
bag_of_embeddings.py
py
2,307
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.Tensor", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.max", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 29, "usage_type": "attribute" }, { "api_name": "typing.List", "line...
234756079
from typing import Dict from concurrent.futures import ( ProcessPoolExecutor, ThreadPoolExecutor, ) from asyncpg.connection import Connection as PgConnection from helpers import ElasticContext from .base import BaseUpdater from .terms import TermUpdater def get_update_handlers(pg_conn: PgConnection, ...
null
eupdater/helpers.py
helpers.py
py
1,276
python
en
code
null
code-starcoder2
83
[ { "api_name": "asyncpg.connection.Connection", "line_number": 14, "usage_type": "name" }, { "api_name": "helpers.ElasticContext", "line_number": 15, "usage_type": "name" }, { "api_name": "concurrent.futures.ThreadPoolExecutor", "line_number": 16, "usage_type": "name" },...
424102036
from django.urls import path from applications.forms import ( FinancialAidApplicationForm, ScholarshipApplicationForm, ) from applications.views import apply, view app_name = "applications" urlpatterns = [ # pyre-ignore[16]: This is fixed by https://github.com/facebook/pyre-check/pull/256. path("edit...
null
src/applications/urls.py
urls.py
py
911
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 13, "usage_type": "call" }, { "api_name": "applications.views.apply", "line_number": 13, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 15, "usage_type": "call" }, { "api_name": "applic...
426995395
import scipy.integrate as spi import numpy as np import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = ['SimHei'] # N为人群总数 N = 10000 # β为传染率系数 B = 0.01 # y为恢复健康的概率 y = 0.02 # I为感染者的初始人数 I = 1 # S为易感者的初始人数 S = N - I # 感染者每天接触人数 r = 10 # T为传播时间 T = 200 # INI为初始状态下的数组 INI = (S, I) def funcSIS(inivalue, _):...
null
SIS_Model.py
SIS_Model.py
py
1,083
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 5, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.ara...
593448263
# coding: utf-8 # In[1]: import requests from bs4 import BeautifulSoup from collections import OrderedDict from contextlib import closing # In[2]: url = 'http://us-city.census.okfn.org/place/miami' # In[3]: response = requests.get(url) response.raise_for_status() soup = BeautifulSoup(response.content.decode(),...
null
notebooks/MiamiOpenDataCensus.py
MiamiOpenDataCensus.py
py
2,135
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 21, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 53, "usage_type": "call" }, { "api_name": "contextlib.clo...
384674994
import os from uuid import uuid4 from matplotlib import pyplot from dds_simulation.conf.default import PROJECT_ROOT def draw_extrapolation(x_vector, y_vector, partitions_number): pyplot.figure() pyplot.ylim(0,1) pyplot.ylabel('I(U)') pyplot.plot(x_vector, y_vector, color='b', linewidth=3.0) pa...
null
dds_simulation/graphs/extrapolation.py
extrapolation.py
py
1,013
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ylim", "line_number": 11, "usage_type": "call" }, { "api_name": "mat...
635161876
from opentelemetry import trace from opentelemetry.exporter import jaeger from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchExportSpanProcessor from opentelemetry.instrumentation.flask import FlaskInstrumentor from flask import Flask from flask import request import requ...
null
orchestrator.py
orchestrator.py
py
1,415
python
en
code
null
code-starcoder2
83
[ { "api_name": "opentelemetry.trace.set_tracer_provider", "line_number": 10, "usage_type": "call" }, { "api_name": "opentelemetry.trace", "line_number": 10, "usage_type": "name" }, { "api_name": "opentelemetry.sdk.trace.TracerProvider", "line_number": 10, "usage_type": "ca...
242701061
import pygame from constants import * class Interface(object): def __init__(self): pygame.init() self.resolution = RESOLUTION self.size = SCREEN_WIDTH, SCREEN_HEIGHT self.screen = pygame.display.set_mode(self.size) self.clock = pygame.time.Clock() self.timestep = 0...
null
CE-288/LeaderElectionNetwork/interface.py
interface.py
py
2,546
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.time.Cl...
256774015
import matplotlib.pyplot as plt import pandas as pd import numpy as np from mylinearregression import MyLinearRegression as MyLR data = pd.read_csv("../resources/spacecraft_data.csv") X = np.array(data[['Age','Thrust_power','Terameters']]) Xage = np.array(data["Age"]).reshape(-1, 1) Xthrush = np.array(data["Thrust_po...
null
day01/ex01/multi_linear_model.py
multi_linear_model.py
py
2,201
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number":...
13509569
import numpy as np import keras as keras #Import de keras import h5py from keras.preprocessing.image import load_img, img_to_array from keras.models import load_model from keras.utils import CustomObjectScope from keras.initializers import glorot_uniform from keras.models import load_model from tensorflow.keras.mod...
null
Archivos de entrenamiento/Clasificador.py
Clasificador.py
py
1,612
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.keras.models.load_model", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.preprocessing.image.load_img", "line_number": 24, "usage_type": "call" }, { "api_name": "keras.preprocessing.image.img_to_array", "line_number": 25, "usage_...
43954339
import numpy as np import scipy as sc import time import imageio import copy import torch as K import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import gym_wmgds as gym from sldr.algorithms.ddpg import DDPG_BD from sldr.experience import Normalizer from sldr.exploration import Noise f...
null
sldr/main.py
main.py
py
19,750
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.device", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 28, "usage_type": "attribute" }, { "api_name": "torch.float32", ...
509299678
import numpy as np import matplotlib.pyplot as plt # Lay a gid over the input space X = np.arange(0, 10, 0.1) # Evaluate function Y = np.sin(X) # Plotting fig = plt.figure() plt.plot(X, Y, ".") plt.show() plt.savefig("sin.png")
null
EX1/plot_sin.py
plot_sin.py
py
233
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.arange", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
141050393
import os from collections import defaultdict import sys import subprocess import json import math import collections def test(pathInput): weight = {} bias = {} sOperation = ["shift", "reduce left", "reduce right"] i_phi = {} pathModel = "model.json" pathOutput = "out.dep" class cElement...
null
hShibata/tutorial11/test-sr.py
test-sr.py
py
4,847
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 31, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 46, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 54, "usage_type": "call" }, { "api_name": "collections.defaultdict...
448331769
import numpy as np import csv import nibabel as nib import skimage.transform import matplotlib as mptlib mptlib.use('TkAgg') import matplotlib.pyplot as plt import time import math import scipy as sp import scipy.stats as stats from scipy.signal import convolve2d from preprocess import window npx = 256 hu_lb = -100...
null
analysis/histogram.py
histogram.py
py
6,801
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.use", "line_number": 7, "usage_type": "call" }, { "api_name": "skimage.transform.transform.resize", "line_number": 28, "usage_type": "call" }, { "api_name": "skimage.transform.transform", "line_number": 28, "usage_type": "attribute" }, { ...
297748593
# -*- coding: utf-8 -*- ############################################################### # PyNLPl - WordAlignment Library for reading GIZA++ A3 files # by Maarten van Gompel (proycon) # http://ilk.uvt.nl/~mvgompel # Induction for Linguistic Knowledge Research Group # Universiteit van Tilburg # ...
null
formats/giza.py
giza.py
py
5,995
python
en
code
null
code-starcoder2
83
[ { "api_name": "bz2.BZ2File", "line_number": 54, "usage_type": "call" }, { "api_name": "bz2.BZ2File", "line_number": 104, "usage_type": "call" }, { "api_name": "itertools.izip", "line_number": 152, "usage_type": "call" } ]
213805330
from gdsfactory.components.bend_s import bend_s from gdsfactory.port import Port from gdsfactory.types import Route def get_route_sbend(port1: Port, port2: Port, **kwargs) -> Route: """Returns an Sbend Route to connect two ports. Args: port1: start port. port2: end port. keyword Args: ...
null
gdsfactory/routing/get_route_sbend.py
get_route_sbend.py
py
2,391
python
en
code
null
code-starcoder2
83
[ { "api_name": "gdsfactory.port.Port", "line_number": 6, "usage_type": "name" }, { "api_name": "gdsfactory.components.bend_s.bend_s", "line_number": 39, "usage_type": "call" }, { "api_name": "gdsfactory.types.Route", "line_number": 42, "usage_type": "call" }, { "ap...
461017342
# -*- coding: utf-8 -*- """Module to render most used components of Beauty Latte.""" from model import HairSalonEs, HairSalon, HairStyleEs, HairStylistEs, CutModelEs from flask import session from flaskext.babel import lazy_gettext as _lg def pc_welcome_hair_stylist(nb_hair_stylist=3, nb_hair_style=2): """Get the n...
null
apps/component/beauty.py
beauty.py
py
17,914
python
en
code
null
code-starcoder2
83
[ { "api_name": "model.HairStylistEs.get_pickup", "line_number": 11, "usage_type": "call" }, { "api_name": "model.HairStylistEs", "line_number": 11, "usage_type": "name" }, { "api_name": "model.HairStylistEs.PTS_NOT_ASSISTANT", "line_number": 12, "usage_type": "attribute" ...
361417917
import time from warnings import warn from bs4 import BeautifulSoup import xml.etree.ElementTree as ET import json from requests import get from requests_xml import XMLSession class ImdbSpider(object): def scraping(self): municipios = [] codigo_iteraveis = [] session = XMLSession() ...
null
spider/imdb.py
imdb.py
py
3,648
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests_xml.XMLSession", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 46, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 56, "usage_type": "call" }, { "api_name": "warnings.warn", "...
427236732
# !/usr/bin/env python3 # -*- coding:utf-8 -*- # Author:yhq import xlrd import re excel_path = r'C:\WD\WeiDuReport\report\test_en.xlsx' # excel_path = 'test_en.xlsx' data = xlrd.open_workbook(excel_path) table = data.sheet_by_index(3) row_count = table.nrows substandard_name = "" substandard_comments_map = {} def h...
null
report/hm_temp_en.py
hm_temp_en.py
py
2,582
python
en
code
null
code-starcoder2
83
[ { "api_name": "xlrd.open_workbook", "line_number": 11, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 66, "usage_type": "call" }, { "api_name": "re.S", "line_number": 66, "usage_type": "attribute" }, { "api_name": "re.M", "line_number": 66,...
401854579
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'ar' import os import glob import skimage.io as skio import cv2 import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches from scipy.ndimage.morphology import binary_erosion ########################################## def MinimizePa...
null
src_experimental_1/step06_simpleCorrSynth/run01_Simple_CorrTextSynth_v2.py
run01_Simple_CorrTextSynth_v2.py
py
10,818
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.matchTemplate", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.TM_CCORR_NORMED", "line_number": 25, "usage_type": "attribute" }, { "api_name": "cv2.minMaxLoc", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.matchTem...
236446895
# -*- coding: utf-8 -*- """ Created on Fri Jul 19 00:21:43 2019 @author: molguitianzn """ import numpy as np import matplotlib.pyplot as plt ''' b = 2 for i in range(10): a += b print("a = ", a) a = np.multiply(a, b) print("new a = ", a) ''' c = ([1,2,3,4]) d = ([5,6,7,8]) e = np.multiply(c,d) f = np.tran...
null
HelloWorld.py
HelloWorld.py
py
535
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.multiply", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.transpose", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.transpose", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.multiply", "...
646051753
# -*- coding: utf-8 -*- from django.core.cache import caches cache = caches['default'] def get_cached_or_qs(cache_key, qs, time_to_live): value = cache.get(cache_key) if None is value: value = qs() cache.set(cache_key, value, time_to_live) return value
null
core/instruments.py
instruments.py
py
284
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.cache.caches", "line_number": 4, "usage_type": "name" } ]
477495737
from omxplayer.player import OMXPlayer from PIL import Image, ImageTk from collections import OrderedDict from time import time import tkinter as tk import threading import logging import dbus import json import praw import re import os from tkinter import messagebox class Reddit: def __init__(self, data): ...
null
redditplayer.py
redditplayer.py
py
12,439
python
en
code
null
code-starcoder2
83
[ { "api_name": "praw.Reddit", "line_number": 17, "usage_type": "call" }, { "api_name": "re.match", "line_number": 44, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 55, "usage_type": "call" }, { "api_name": "time.time", "line_nu...
86127612
import cv2 from matplotlib import pyplot as plt import numpy as np file_name = '/home/nearlab/Downloads/' \ 'trainingData_semanticSegmentation/' \ 'trainingData_semanticSegmentation/' \ '00000.tif' image = cv2.imread(file_name) print(np.unique(image)) plt.figure() plt.subplot(131)...
null
general/small_test.py
small_test.py
py
446
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
624135038
import os import time # Widgets import ipywidgets as widgets from IPython.display import display, Javascript # Jupy4Syn from jupy4syn.utils import logprint class ExportButtonHTML(widgets.Button): def __init__(self, config, *args, **kwargs): """ **Constructor** Parameters ...
null
jupy4syn/ExportButtonHTML.py
ExportButtonHTML.py
py
4,233
python
en
code
null
code-starcoder2
83
[ { "api_name": "ipywidgets.Button", "line_number": 12, "usage_type": "attribute" }, { "api_name": "ipywidgets.Button.__init__", "line_number": 30, "usage_type": "call" }, { "api_name": "ipywidgets.Button", "line_number": 30, "usage_type": "attribute" }, { "api_name...
353893996
#!/usr/bin/env python # coding:utf-8 import os import numpy as np import xlsxwriter #---------------------------------------------------------- class Analyser(object): def __init__(self, outdir, category, top=1, multilabel=False): self.outdir = outdir self.category = category s...
null
chainer/ssd_withRotate_Score/utils/analyser.py
analyser.py
py
12,696
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
650049456
from AccessControl import allow_module from Acquisition import aq_inner from Products.CMFCore.permissions import ModifyPortalContent from Products.CMFCore.utils import getToolByName from Products.PluggableAuthService.interfaces.plugins import IRolesPlugin from Products.ATContentTypes.lib import constraintypes from zope...
null
plone.products/bungenicms.workspaces/trunk/bungenicms/workspaces/content/principal_content.py
principal_content.py
py
6,618
python
en
code
null
code-starcoder2
83
[ { "api_name": "Products.PluggableAuthService.interfaces.plugins.IRolesPlugin", "line_number": 25, "usage_type": "argument" }, { "api_name": "zope.app.component.hooks.getSite", "line_number": 34, "usage_type": "call" }, { "api_name": "Products.CMFCore.utils.getToolByName", "li...
319320604
# -*- coding: utf-8 -*- from bs4 import BeautifulSoup import re from urllib.parse import urlparse from urllib.parse import urljoin class HtmlParser(object): def _get_new_urls(self,page_url,soup): new_urls = set() links = soup.find_all('a',class_='vd_folder') for link in links: new_url = link['href'] n...
null
spider/A_Frame/template/sample_split_version/html_parser.py
html_parser.py
py
933
python
en
code
null
code-starcoder2
83
[ { "api_name": "bs4.BeautifulSoup", "line_number": 32, "usage_type": "call" } ]
89264749
#!/usr/bin/env python """ @package ion.services.mi.sbe37_driver @file ion/services/mi/sbe37_driver.py @author Edward Hunter @brief Driver class for sbe37 CTD instrument. """ __author__ = 'Edward Hunter' __license__ = 'Apache 2.0' import logging import time import re import datetime from ion.services.mi.instrument_d...
null
ion/services/mi/drivers/sbe37_driver.py
sbe37_driver.py
py
50,667
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 36, "usage_type": "call" }, { "api_name": "ion.services.mi.common.BaseEnum", "line_number": 39, "usage_type": "name" }, { "api_name": "ion.services.mi.instrument_driver.DriverState.UNCONFIGURED", "line_number": 42, "usage_...
95062391
import sys import argparse import os.path from api import get_course, split_url, find_module def parse_args(args): # help text and argument parser # solution based on https://stackoverflow.com/a/24181138/462692 desc = '\n'.join(["Adds an exitsing page on Canvas to an existing module in the same course.", ...
null
add_to_module.py
add_to_module.py
py
2,331
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "api.split_url", "line_number": 29, "usage_type": "call" }, { "api_name": "api.get_course", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.exit", "...
517257352
import pandas as pd import dateutil.parser import json import math import os.path import shlex import subprocess import tempfile def execute_command( command): result = subprocess.call(shlex.split(command)) if result != 0: raise RuntimeError("Error executing {}".format(command)) def lue_tr...
null
benchmark/lue/benchmark/util.py
util.py
py
4,435
python
en
code
null
code-starcoder2
83
[ { "api_name": "subprocess.call", "line_number": 14, "usage_type": "call" }, { "api_name": "shlex.split", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.path.expandvars", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.path", ...
574030004
import os, webapp2, jinja2 from google.appengine.api import users, memcache from dkc import jinja_functions from dkc.models import User import query JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'templates')), extensions=['jinja2.ext.autoescape']...
null
manage/__init__.py
__init__.py
py
1,594
python
en
code
null
code-starcoder2
83
[ { "api_name": "jinja2.Environment", "line_number": 7, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "l...