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
601491193
# -*- coding: utf-8 -*- # # Copyright 2018 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compli...
null
services/singleuser/setup.py
setup.py
py
2,651
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 58, "usage_type": "call" } ]
650252051
#!/usr/bin/env python ############################################################################### # This script is used to refresh the access and refresh tokens for an # institution's Box account. Note that this is a very preliminary script, in # that it assumes that the active BackendProvider is a Box account. Wh...
null
Mylocker-Upgrade-master/refresh_fs_provider_access_token.py
refresh_fs_provider_access_token.py
py
4,813
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number...
639879091
import json import boto3 from botocore.exceptions import ClientError def fortune(event, context): dynamodb = boto3.resource('dynamodb') table = dynamodb.Table('fortunes') response = table.scan() tostring = '' for i in response['Items']: tostring += str(i.get('quote')) + '\n' # pri...
null
handler.py
handler.py
py
1,539
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto3.resource", "line_number": 8, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 29, "usage_type": "call" }, { "api_name": "botocore.exceptions.ClientError", "line_number": 58, "usage_type": "name" } ]
617512635
from django.shortcuts import render, get_object_or_404 from django.shortcuts import redirect from django.views.generic import TemplateView from .models import Project from django.utils import timezone from .forms import ProjectForm from django.contrib.auth import get_user # Create your views here. class HomePageView(...
null
projects/views.py
views.py
py
1,842
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.TemplateView", "line_number": 11, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Project.objects.all", "line_number": 17, "usage_type": "call" }, { ...
625094586
""" Wrapper module around a Sublime Text 3 view for showing a terminal look-a-like """ import collections import time import sublime import sublime_plugin from . import terminal_emulator class SublimeTerminalBuffer(): def __init__(self, sublime_view, title, logger, syntax_file=None): self._view = sublim...
null
sublime_terminal_buffer.py
sublime_terminal_buffer.py
py
14,568
python
en
code
null
code-starcoder2
76
[ { "api_name": "sublime.load_settings", "line_number": 34, "usage_type": "call" }, { "api_name": "time.time", "line_number": 68, "usage_type": "call" }, { "api_name": "time.time", "line_number": 70, "usage_type": "call" }, { "api_name": "sublime.active_window", ...
295414683
import sys from SheetsUpdater import * from EndSession import EndSession from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit, QVBoxLayout, QHBoxLayout, QInputDialog, QApplication, QLabel, QGridLayout, QCheckBox, QListWidget) from PyQt5.QtGui import QPainter, QColor, QFont from PyQt5.QtCore import Qt class Vol...
null
VolunteerSignIn.py
VolunteerSignIn.py
py
3,738
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 16, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 18, "usage_type": "call" }, { "api_name": "...
189525670
import re from matplotlib import pyplot as plt import numpy as np def count_function(filepath): try: i = 0 function_dict = {} with open(filepath, 'r+') as f: line = f.readline().strip() while len(line)!=0: if 'Function' in line: it...
null
count/count_function.py
count_function.py
py
1,708
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.split", "line_number": 13, "usage_type": "call" }, { "api_name": "re.split", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 33, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot",...
422556666
from django.shortcuts import render import pickle def home(request): return render(request,'index.html') def result(request): age = request.GET['age'] medu = request.GET['medu'] fedu = request.GET['fedu'] travelTime = request.GET['travelTime'] studyTime = request.GET['studyTime'] ...
null
SPA/views.py
views.py
py
7,293
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 4, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 261, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 281, "usage_type": "call" } ]
552436125
# coding:utf-8 import asyncio import os import signal import time from functools import partial from inspect import isawaitable CURRENT_TIME = None def update_current_time(loop): global CURRENT_TIME CURRENT_TIME = time.time() loop.call_later(1, partial(update_current_time, loop)) log = print # tod...
null
zk_sanic/app.py
app.py
py
5,219
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.time", "line_number": 15, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 16, "usage_type": "call" }, { "api_name": "asyncio.Protocol", "line_number": 22, "usage_type": "attribute" }, { "api_name": "inspect.isawaitable...
361139208
from cement import Controller, ex def get_pool_members(conn, pool_id): memberdata = {} members = conn.load_balancer.members(pool_id) for member in members: memberdata[member.id] = { 'project_id': member.project_id, 'name': member.name, 'provisioning_status': mem...
null
occ/controllers/loadbalancer.py
loadbalancer.py
py
3,519
python
en
code
null
code-starcoder2
76
[ { "api_name": "cement.Controller", "line_number": 74, "usage_type": "name" }, { "api_name": "cement.ex", "line_number": 81, "usage_type": "call" } ]
123991521
import pygame, sys from pygame.locals import * WINDOWWIDTH = 400 # Chiều dài cửa sổ WINDOWHEIGHT = 300 # Chiều cao cửa sổ WHITE = (255, 255, 255) RED = (255, 0, 0) GREEN = ( 0, 255, 0) pygame.init() ### Xác định FPS ### FPS = 60 fpsClock = pygame.time.Clock() DISPLAYSURF = pygame.display.s...
null
code/ki_1/python/pygame/chuyen dong.py
chuyen dong.py
py
1,168
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mod...
536284272
api_key = 'apikey' import vk_api import time import random import datetime import news vk = vk_api.VkApi(token=api_key) vk._auth_token() now = datetime.datetime.now() time = now.strftime("%d-%m-%Y %H:%M") while True: try: messages = vk.method("messages.getConversations", {"offset": 0, "count": 20, "fil...
null
main.py
main.py
py
1,746
python
en
code
null
code-starcoder2
76
[ { "api_name": "vk_api.VkApi", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "attribute" }, { "api_name": "news.search_...
135193487
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue May 8 17:52:38 2018 @author: rita Pragmatrix Main Script """ # Imports import os import requests import re from collections import OrderedDict #import gensim #import spacy import pickle from tqdm import tqdm from nltk.tokenize import sent_tokenize ...
null
Code/pragmatrix_main_script.py
pragmatrix_main_script.py
py
8,525
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 39, "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": "os.path.join", "line_number": ...
437155711
### <summary> ### Simulator for AI Statistics ### ### </summary> from QuantConnect.Orders import * from QuantConnect.Orders.Fills import * from QuantConnect.Orders.Fees import * from QuantConnect.Orders import OrderStatus import os from sys import getsizeof as getsizeof import shutil from datetime import datetime, t...
null
Algorithm.Python/Dev_Stat8_B_fw1_0/sim.py
sim.py
py
18,979
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path", "line_number": 52, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 53, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "...
315461781
# -*- coding: utf-8 -*- from os.path import abspath, join, exists import numpy as np import utool as ut import vtool as vt import random import uuid import tqdm import cv2 # ibs = None MIN_AIDS = 1 MAX_AIDS = np.inf MAX_NAMES = np.inf PADDING = 32 url = 'https://kaiju.dyn.wildme.io/public/random/humpback.crc.csv'...
null
export.kaggle7.py
export.kaggle7.py
py
11,124
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.inf", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.inf", "line_number": 17, "usage_type": "attribute" }, { "api_name": "utool.download_url", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.abspath", ...
309115353
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^mapdemo/$', views.mapdemo, name="mapdemo"), url(r'^mapdemo2/$', views.mapdemo2, name="mapdemo2"), url(r'^mapdemo3/$', views.mapdemo3, name="mapdemo3"), url(r'^(?P<album_id>[0-9]+)/$', views.detail, n...
null
User Interface/music/urls.py
urls.py
py
336
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.co...
279861378
from InfluenceGraph import InfluenceGraph, random_subgraph import numpy as np from scipy.misc import comb from numpy import log2, log import operator class TIM: """---------------------------------------------------------------- This is the implementation of TIM (Two-phase Influence Maximization) algorithm from ...
null
TIM.py
TIM.py
py
3,224
python
en
code
null
code-starcoder2
76
[ { "api_name": "InfluenceGraph.InfluenceGraph", "line_number": 28, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 60, "usage_type": "call" }, { "api_name": "numpy.log2", "line_number": 69, "usage_type": "call" }, { "api_name": "numpy.lo...
400393310
import json import logging import os import uuid import shutil from logic.metadata import Metadata class Fs(): STATUS_FILE = "_status_" """ Filesystem folder as a storage place for tasks with ids. """ def __init__(self, path:str): self._path = path if not os.path.exists(path): ...
null
mlinferer/logic/fs.py
fs.py
py
2,240
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 19, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number...
417735726
# -*- coding: utf-8 -*- """ Created on Wed Aug 5 20:18:07 2020 @author: cvicentm """ from tqdm import tqdm import pandas as pd import numpy as np # mis importaciones from modules.pre import create_corpus as c def more_important_words_by_day(dic_subtitles,corpus,id2word,model,day): """model is tfidf model""" ...
null
modules/lsa/tfidf.py
tfidf.py
py
2,831
python
en
code
null
code-starcoder2
76
[ { "api_name": "tqdm.tqdm", "line_number": 17, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 22, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 2...
382153722
from __future__ import absolute_import from __future__ import division from __future__ import print_function import pickle import redis from ray.utils import (decode, binary_to_object_id, binary_to_hex, hex_to_binary) # Import flatbuffer bindings. from ray.core.generated.TaskInfo import TaskIn...
null
python/ray/experimental/state.py
state.py
py
8,400
python
en
code
null
code-starcoder2
76
[ { "api_name": "redis.StrictRedis", "line_number": 66, "usage_type": "call" }, { "api_name": "ray.utils.binary_to_hex", "line_number": 83, "usage_type": "call" }, { "api_name": "ray.core.generated.ResultTableReply.ResultTableReply.GetRootAsResultTableReply", "line_number": 90,...
301538868
import enum import os import pathlib import re from logging import getLogger from google.cloud import storage from jinja2 import BaseLoader, Environment, FileSystemLoader logger = getLogger(__name__) class SourceType(enum.Enum): FS = "fs" GCS = "gcs" def __str__(self): return self.name class ...
null
src/stairlight/template.py
template.py
py
5,832
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 36, "usage_type": "call" }, { "api_name": "re.fullmatch", "lin...
81419389
# -*- coding: utf-8 -*- from django.contrib import admin from django import forms from django.db import models from pages.models import Page, InfoBlock from treeadmin import TreeAdmin from gallery.admin import GalleryInline class PageAdmin(TreeAdmin): fieldsets = [ (None, { 'fiel...
null
pages/admin.py
admin.py
py
1,261
python
en
code
null
code-starcoder2
76
[ { "api_name": "treeadmin.TreeAdmin", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.models.ManyToManyField", "line_number": 30, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 30, "usage_type": "name" }, { "api_na...
142696537
#!/usr/bin/env python from argparse import ArgumentParser from CommonLib import * from Hash import * DeleteCfgTagNames = [ 'Name', 'ConfigFileList' ] def GetSpeedStats(log_file_path, number_of_frames): __file = open(log_file_path) __lines = __file.readlines() __file.close() __fps_list = [] ...
null
scripts/TestCodec.py
TestCodec.py
py
9,870
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 62, "usage_type": "call" } ]
317328056
import os, sys import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt def get_directory_from_id_openmind(root, id:int): kinect_set = root + "/Kinect" kinects = ["/Kin01", "/Kin02"] subjects = ["/S01", "/S02", "/S03", "/S04", "/S05", "/S06", "/S07", "/S08", "/S09", "/S10"...
null
read_eval_losses.py
read_eval_losses.py
py
1,660
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 31, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 31, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", ...
196790586
############################### ## Collector/confirmation.py ## Part of the Silverback Voting System ## By: Kevin Butterfield ## ## This file holds resources relating to location confirmation. ## This is an optional step in the election that, if used, allows for final voting locations to be consise. ## It...
null
Collector/Core/confirmation.py
confirmation.py
py
4,566
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Event", "line_number": 19, "usage_type": "call" }, { "api_name": "common.election", "line_number": 32, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 33, "usage_type": "call" }, { "api_name": "common.log", "line...
39874722
# -*- coding utf-8 -*- import os.path import pandas as pd import numpy as np import DataAccessBase from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.optimizers import Adam from keras.callbacks import EarlyStopping, CSVLogger from keras.utils.vis_utils impo...
null
Keiba-4_cnn.py
Keiba-4_cnn.py
py
5,851
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 24, "usage_type": "attribute" }, { "api_name": "keras.layers.advanced_activations.LeakyReLU", "line_number": 33, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 34, "usage_type": "call" }, { ...
584499988
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import re import csv import subprocess as sub from datetime import date STEP2_DIR = '/data/step2' OUTPUT_TEST_DIR = '%(root)s/year=%(year)s/month=%(month)s/day=%(day)s' INPUT_TEST_FILE = '/data/step1/in/' INPUT_TEST_DIR = INPUT_TEST...
null
test.py
test.py
py
4,642
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.writer", "line_number": 21, "usage_type": "call" }, { "api_name": "csv.QUOTE_MINIMAL", "line_number": 22, "usage_type": "attribute" }, { "api_name": "datetime.date.today", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.date",...
494166573
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$',views.index, name = 'index'), url(r'^home/',views.index, name = 'index'), url(r'^deuses/',views.deuses, name = 'deuses'), url(r'^deuses7/',views.deuses7, name = 'deuses7'), url(r'^deuses15/',views.deuses15, name ...
null
mysite/blogapp/urls.py
urls.py
py
656
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.co...
632604992
from PIL import Image, ImageFilter import os import struct base = [str(x) for x in range(10)] + [ chr(x) for x in range(ord('a'),ord('a')+6)] def imageprepare(argv): im = Image.open(argv).convert('L') width = float(im.size[0]) height = float(im.size[1]) if width > 28: img = im.resize((28, 28),...
null
test2.py
test2.py
py
2,426
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 8, "usage_type": "name" }, { "api_name": "PIL.Image.ANTIALIAS", "line_number": 12, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line...
219079508
import unittest import os from configobj import ConfigObj from E3SMDiags import E3SMDiags from lib.events import Event_list class TestE3SM(unittest.TestCase): def __init__(self, *args, **kwargs): super(TestE3SM, self).__init__(*args, **kwargs) config_path = os.path.join(os.getcwd(), 'tests', 't...
null
jobs/test_e3sm.py
test_e3sm.py
py
3,204
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.getcwd", "lin...
333044212
from typing import List, Tuple import importlib import importlib.util import builtins import os import ast import traceback from machaon.core.docstring import parse_doc_declaration from machaon.core.symbol import full_qualified_name def module_loader(expr=None, *, location=None): if location: if expr is ...
null
machaon/core/importer.py
importer.py
py
19,435
python
en
code
null
code-starcoder2
76
[ { "api_name": "ast.PyCF_ONLY_AST", "line_number": 104, "usage_type": "attribute" }, { "api_name": "ast.get_docstring", "line_number": 105, "usage_type": "call" }, { "api_name": "machaon.core.docstring.parse_doc_declaration", "line_number": 110, "usage_type": "call" }, ...
70014876
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This module provides helper functions to georegister (add geo-referenced \ coordinates) to raster-based (image) data products. This module makes \ extensive use of osgeo.gdal.Dataset and osgeo.gdal.Dataset.GetGeoTransform """ from osgeo import osr import numpy as np ...
null
PFILT/create_docker/navfeatdb/build/lib/navfeatdb/frames/coverage2d.py
coverage2d.py
py
5,721
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.hstack", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 54, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 55, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 56...
32374477
from . import views from django.urls import path urlpatterns = [ path('', views.homepage, name='home'), path('new', views.newpage, name='new'), path('sell', views.sell, name='sell'), path('<slug:old_product_slug>/', views.detail, name='detail'), path('new/<slug:product_slug>/', views.newdetail, na...
null
ecom_web/sell/urls.py
urls.py
py
338
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "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", ...
455974795
import urllib3 from bs4 import BeautifulSoup class DownloadDoc: def __init__(self, url: str='', config: dict={}): self._searched_links = [] self._failed_links = [] self._all_links = [] self._doc_links = [] self.error = '' self.config = self._default_config() ...
null
downloadoc.py
downloadoc.py
py
2,973
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib3.PoolManager", "line_number": 21, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 24, "usage_type": "attribute" }, { "api_name": "bs4.BeautifulSoup", "line_number": 40, "usage_type": "call" }, { "api_name": "urllib3...
408790756
import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn.metrics import confusion_matrix # import some data to play with data = pd.read_csv('data/pollo_results.csv') names = pd.read_csv('data/pollo_classes.csv') labels = names['label'].as_matrix() y = data['y'].as_matrix() y_pred = data['y_p...
null
caffe/confusion.py
confusion.py
py
1,044
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.cm", "line_number": 13, "usage_type": "attribute" }, { "api_name": "matplotlib.py...
41253307
#%% import sys import os import numpy as np import pandas as pd import matplotlib.pyplot as plt plt.rcParams['font.size'] = 6 root_path = os.path.dirname(os.path.abspath('__file__')) # root_path = os.path.abspath(os.path.join(root_path,os.path.pardir)) graphs_path = root_path+'/graph/' print("root path:{}".format(root_...
null
results_analyze/plot_hind_forecsing_testing_metrics.py
plot_hind_forecsing_testing_metrics.py
py
8,755
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.pat...
61007114
import unittest from datetime import datetime from pathlib import Path import pytest import sleap_io from hdmf.testing import TestCase from parameterized import param, parameterized from pynwb import NWBHDF5IO from neuroconv import NWBConverter from neuroconv.datainterfaces import DeepLabCutInterface, SLEAPInterface,...
null
tests/test_on_data/test_gin_behavior.py
test_gin_behavior.py
py
11,670
python
en
code
null
code-starcoder2
76
[ { "api_name": "setup_paths.BEHAVIOR_DATA_PATH.exists", "line_number": 20, "usage_type": "call" }, { "api_name": "setup_paths.BEHAVIOR_DATA_PATH", "line_number": 20, "usage_type": "name" }, { "api_name": "pytest.fail", "line_number": 21, "usage_type": "call" }, { "...
461162378
import os from flask import Flask, request, jsonify, abort from sqlalchemy import exc import json from flask_cors import CORS from .database.models import db_drop_and_create_all, setup_db, Drink, db from .auth.auth import AuthError, requires_auth app = Flask(__name__) setup_db(app) CORS(app) ''' !! NOTE THIS WILL DR...
null
projects/03_coffee_shop_full_stack/starter_code/backend/src/api.py
api.py
py
4,457
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "database.models.setup_db", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 12, "usage_type": "call" }, { "api_name": "database.models....
596310078
""" Django settings for demo project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impor...
null
libs/demo/demo/settings.py
settings.py
py
6,783
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
624837671
import matplotlib.pyplot as plt import numpy as np from scipy.signal import chirp t = np.zeros(1000000) y = np.zeros(1000000) t = np.linspace(0,0.01,1000000) y[0:500000] = chirp(t[0:500000],f0=500.0,f1=10000,t1=0.005) #datab1x = np.loadtxt('./AA.S0001.BXX.semd') datab1z = np.loadtxt('./displace/OUTPUT_FILES/AA.S0001...
null
directivity/ALPHAtestsims/plotsignals.py
plotsignals.py
py
654
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.signal.chirp", "line_nu...
496622688
# -*- coding: utf-8 -*- """ Created on Sun Jan 19 19:41:12 2020 @author: rheaa note need CVXOPT ver >=1.2.3 installed (\w 1.2.0 'hermitian' requirement seemed to fuck things up) """ import numpy as np import picos as pic #import cvxopt as cvx import matplotlib.pyplot as plt import math zero = pic.new_par...
null
Legacy Code/CGP.py
CGP.py
py
6,683
python
en
code
null
code-starcoder2
76
[ { "api_name": "picos.new_param", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "picos.new_param", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_n...
379387689
import numpy as np import requests import geopandas from shapely.geometry import shape, Point import pandas as pd def get_neighborhoods(city,state): apiurl = 'https://data.opendatasoft.com/api/records/1.0/search/' response = requests.get(apiurl, params={'dataset': 'zillow-neighborhoo...
null
estateaggregator/aggregate_class.py
aggregate_class.py
py
982
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 19, "usage_type": "call" }, { "api_name": "shapely.geometry.Point", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.random.unif...
572274540
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import re import json from pathlib import Path macros = [] files = list(Path("macros").rglob("*.js")) for filepath in files: # read all lines in f with open(filepath, 'r') as f: content = f.read().split("------------\n") if len(content) < 2: pr...
null
macros.py
macros.py
py
1,441
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "re.search", "line_number": 25, "usage_type": "call" }, { "api_name": "re.search", "line_number": 26, "usage_type": "call" }, { "api_name": "re.search", "line_number": 27, ...
181950777
# Copyright (c) 2003-2015 by Mike Jarvis # # TreeCorr is free software: redistribution and use in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of condi...
null
tests/test_gg.py
test_gg.py
py
28,624
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 47, "usage_type": "attribute" }, { "api_name": "numpy.random.random_sample", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy....
523509539
""" Scripts that find the taxonomy of an aligned sequence """ # Author: Alessio Milanese <milanese.alessio@gmail.com> # Requirements: # - numpy # - h5py import numpy as np import sys import time import os import h5py import tempfile import shutil # load align routine ------------------------------------------------...
null
bin/classify.py
classify.py
py
11,681
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.realpath", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
544234423
import requests import json from bs4 import BeautifulSoup import string from operator import itemgetter import time def get_route_options(start, end, attempts=1): url = "https://www.google.com/maps/dir/%s/%s/" % (start,end,) r = requests.get(url) soup = BeautifulSoup(r.text) routes = soup.find_all('div', {'class...
null
routes.py
routes.py
py
1,168
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 13, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" }, { "api_name": "string.replace", "line_...
60845894
# -*- coding: utf-8 -*- """ Created on Tue Sep 17 21:11:59 2019 @author: dafer Title: Python's exercise. Hey ho! Python!! """ #Reset all. This is as magic command that runs only in the console. #load libraries import os import pandas as pd import numpy as np import matplotlib.pyplot as plt #...
null
Ejpr1.py
Ejpr1.py
py
8,463
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getcwd", "line_number": 23, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 26, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 31,...
413283066
#!/usr/bin/env python2 from __future__ import print_function import parse_config import pandas as pd import requests from xml.etree import ElementTree def download_file(url, workingdir='data/'): ''' downloads and saves a file locally Args: url (str): the url of the file to download workingdir (...
null
src/process_xml.py
process_xml.py
py
4,228
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.parse", "line_number": 67, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 67, "usage_type": "name" }, { "api_name": "pandas...
156389370
import sys from data import * from utils import * from model import * from warnings import filterwarnings filterwarnings("ignore") import random import argparse def inspect(args): graph = dill.load(open(os.path.join(args.data_dir, 'graph%s.pk' % args.domain), 'rb')) node_types = ['paper', 'author', 'venue', 'a...
null
inspect_dataset.py
inspect_dataset.py
py
1,567
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 6, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 34, "usage_type": "call" } ]
189469829
import torch.nn as nn class ConvNetMaker(nn.Module): """ Creates a simple (plane) convolutional neural network """ # def __init__(self, layers): def __init__(self, layers, input_size): """ Makes a cnn using the provided list of layers specification The details of this list...
null
model_factories/plain_cnn_factory.py
plain_cnn_factory.py
py
4,954
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": "torch.nn.Conv2d", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
607281710
from sklearn.pipeline import Pipeline import xgboost as xgb import preprocessors as pp import config as cfg model = xgb.XGBRegressor(**cfg.xgb_params) pipeline = Pipeline( [ ('log transformer', pp.LogTransformer(lambda_boxcox = cfg.lambda_boxcox)), ('feature extractor', p...
null
pipeline.py
pipeline.py
py
615
python
en
code
null
code-starcoder2
76
[ { "api_name": "xgboost.XGBRegressor", "line_number": 7, "usage_type": "call" }, { "api_name": "config.xgb_params", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sklearn.pipeline.Pipeline", "line_number": 9, "usage_type": "call" }, { "api_name": "pr...
589268537
from django.core.exceptions import ValidationError from django import forms from django.db import models from django.forms import ModelForm, Textarea, TextInput, NumberInput, Select, FileInput from website.models import Seller, Listing from haystack.forms import SearchForm class StyledSearchForm( SearchForm ): q ...
null
bookshare/website/forms.py
forms.py
py
3,676
python
en
code
null
code-starcoder2
76
[ { "api_name": "haystack.forms.SearchForm", "line_number": 9, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 10, "usage_type": "call" }, { "api_name": "django.forms", "line_number": 10, "usage_type": "name" }, { "api_name": "django.f...
599447670
import discord from discord.ext import commands bot = commands.Bot(command_prefix='a.') saki_chans = [] channel_name='Kurusaki-Text-Channel' async def get_world_channels(): """ Get all the channels that has the same names as the variable value `channel_name` """ for i in bot.servers: for x ...
null
world_chat.py
world_chat.py
py
1,311
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Bot", "line_number": 5, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" }, { "api_name": "discord.Object", "line_number": 41, "usage_type": "call" } ]
604724480
import cherrypy from paste.translogger import TransLogger from flask import Flask, request, abort, jsonify, make_response, render_template import json import os import pandas as pd import lightgbm as lgb from utils import BASELINE_MODEL, BAD_REQUEST, STATUS_OK, NOT_FOUND, SERVER_ERROR, PORT # app app = Flask(__name__...
null
Intro_to_Fraud_Detection/api.py
api.py
py
1,948
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.make_response", "line_number": 17, "usage_type": "call" }, { "api_name": "utils.BAD_REQUEST", "line_number": 17, "usage_type": "argument" }, { "api_name": "flask.jsonify",...
75681061
import tensorflow as tf import numpy as np np.set_printoptions(suppress=True, precision=6) import os import glob import cv2 import sys import time import pickle from random import shuffle from .pose_gt import * from matplotlib import pyplot as plt from time import time as t class Dataset(object): ...
null
Evaluation/3/codes/function/pose/pose_dataset.py
pose_dataset.py
py
3,201
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.set_printoptions", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.load", "line_nu...
580688568
# coding = gbk from __future__ import print_function from PIL import Image import imghdr import os import module1 as funcs print(""" ***************************************** 图像样本生成程序 v1.0 ***************************************** 请输入待处理的图像目录,支持jpg及bmp文件的处理 比如:\"D:/opencvimages/read/common test\" 注意:目录中不能包含文件夹! """) im...
null
tools/实用工具源码/Create_Samples_PY/PythonApplication1.py
PythonApplication1.py
py
1,826
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "imghdr.what", "line_numb...
72075086
# ########################################################## # FlatCAM: 2D Post-processing for Manufacturing # # File Author: Marius Adrian Stanciu (c) # # Content was borrowed from FlatCAM proper # # Date: 4/22/2020 # # MIT Licence ...
null
HSRWLaserTool_APP/FlatCAM_beta_8.994_sources/tclCommands/TclCommandHelp.py
TclCommandHelp.py
py
4,382
python
en
code
null
code-starcoder2
76
[ { "api_name": "appTranslation.apply_language", "line_number": 17, "usage_type": "call" }, { "api_name": "builtins.__dict__", "line_number": 18, "usage_type": "attribute" }, { "api_name": "gettext.gettext", "line_number": 19, "usage_type": "attribute" }, { "api_nam...
564692845
#!/usr/bin/env python # coding: utf-8 # In[1]: import nltk #natural language toolkit nltk.download('punkt') from nltk.stem.lancaster import LancasterStemmer stemmer= LancasterStemmer() import tkinter from tkinter import * # In[2]: import tensorflow as tf import numpy as np import tflearn impo...
null
train_bot.py
train_bot.py
py
6,508
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.download", "line_number": 8, "usage_type": "call" }, { "api_name": "nltk.stem.lancaster.LancasterStemmer", "line_number": 10, "usage_type": "call" }, { "api_name": "json.load", "line_number": 29, "usage_type": "call" }, { "api_name": "nltk.word...
504825451
import matplotlib matplotlib.use('Agg') import h5py import sys import matplotlib.pyplot as plt from matplotlib import animation as am import matplotlib.colors as colors import numpy as np import scipy as sp import astropy.constants as ks import astropy.units as u import math import glob import os import o...
null
stage/python/snapshot_plot.py
snapshot_plot.py
py
6,177
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.use", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path.insert", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.set_printoptions", ...
405730854
""" This module implements an ensemble version of cont_autoreg model """ from typing import Optional, Any, Tuple, Union, List, Dict import math import random import time from copy import deepcopy from pathlib import Path import numpy as np import torch import torch.nn as nn import torch.optim as optim from utils.fil...
null
src/optnet/alg/autoregressive/ensemble_alg.py
ensemble_alg.py
py
15,371
python
en
code
null
code-starcoder2
76
[ { "api_name": "alg.base.AlgBase", "line_number": 36, "usage_type": "name" }, { "api_name": "alg.base.AlgBase.__init__", "line_number": 39, "usage_type": "call" }, { "api_name": "alg.base.AlgBase", "line_number": 39, "usage_type": "name" }, { "api_name": "benchmark...
527816640
import holoviews as hv import panel as pn import param from param import parameterized class testview(param.Parameterized): check_val = param.Integer(default=0) parameters = param.List(default=[]) def add_parameters(self, k): parameters = self.parameters for i in range(k): nam...
null
scripts/issue_watch.py
issue_watch.py
py
894
python
en
code
null
code-starcoder2
76
[ { "api_name": "param.Parameterized", "line_number": 7, "usage_type": "attribute" }, { "api_name": "param.Integer", "line_number": 8, "usage_type": "call" }, { "api_name": "param.List", "line_number": 9, "usage_type": "call" }, { "api_name": "param.Integer", "l...
422179165
import numpy as np import matplotlib.pyplot as plt # main if __name__ == '__main__': s = 0.8 # initial settings p = 0.1 q = 0.1 g = np.array([1,0,0,0,0,0,0]) S = np.array([[s+p,p,0,0,0,0,0], [q,s,p,0,0,0,0], [0,q,s,p,0,0,0], [0,0,q,s,p,0,0], ...
null
work1/1-4-1.py
1-4-1.py
py
925
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_n...
583059452
import os from os import listdir from os.path import isfile, join from scipy.ndimage import imread from scipy.misc import imresize from PIL import Image from skimage import transform import numpy as np pathToImages = 'Q:\Matula\Data\Red_Del(-90-cz)xInv(-33-cz)_24783e5\Red_Del(-90-cz)xInv(-33-cz)_24783e5' pathToResized...
null
imResize.py
imResize.py
py
1,504
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_numbe...
160513404
# Author: Joubert Visagie 22983856, Levi Dipnarain 20857624 from flask import Flask, render_template, request, redirect, url_for from flask_bootstrap import Bootstrap import requests # import ./API app = Flask(__name__) bootstrap = Bootstrap(app) @app.route("/", methods=['POST', 'GET']) def home(): if request.me...
null
Computer Science 334/Group/20687184-rw334-project-2-master/src/app.py
app.py
py
4,041
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_bootstrap.Bootstrap", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.r...
461062517
from itertools import tee, izip import csv import xml.etree.cElementTree as ET import os, sys from collections import defaultdict from math import radians, cos, sin, asin, sqrt import operator from operator import itemgetter import MySQLdb def haversine(lon1, lat1, lon2, lat2): """ Calculate the great circle distanc...
null
near_mrt.py
near_mrt.py
py
2,043
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.radians", "line_number": 17, "usage_type": "argument" }, { "api_name": "math.sin", "line_number": 21, "usage_type": "call" }, { "api_name": "math.cos", "line_number": 21, "usage_type": "call" }, { "api_name": "math.asin", "line_number": 22,...
59319526
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('cloudservmodels', '0005_auto_20150619_1139'), ] operations = [ migrations.CreateModel( ...
null
cloudservmodels/migrations/0006_auto_20150619_1245.py
0006_auto_20150619_1245.py
py
892
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.CreateModel", "line_number": 15, "usage_type": "call" }, ...
552095765
#!/usr/bin/python # -*- encoding=utf8 -*- ################################ # config logging with dictionary # dictionary configuration needs yaml module to parse yaml format config file ################################ import yaml import logging import logging.config #config logging from dictionary logging.config.dic...
null
programming_intro/logging/src/logging_config_with_dictionary.py
logging_config_with_dictionary.py
py
607
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.config.dictConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 13, "usage_type": "attribute" }, { "api_name": "yaml.load", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.getLo...
94014455
#from django.shortcuts import render import django_filters import random from django.contrib.auth.models import User from .models import Play, Ranking, VerifyCode from .serializers import UserSerializer, UserSimpleSerializer, PlaySerializer, RankingSerializer from .permissions import IsSelf, Answerable#, IsOwner fro...
null
users/apiviews.py
apiviews.py
py
4,054
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.generics.ListCreateAPIView", "line_number": 18, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 18, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.all", "line_number": 19, "...
288668591
import schedule import speedtest import sys import time import threading ################################################################################ # This is the main function that will run the speed test and report the results # Input: None # Output: None #######################################################...
null
network_speed_test.py
network_speed_test.py
py
2,011
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.ctime", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 28, "usage_type": "call" }, { "api_name": "speedtest.Speedtest", "line_number": 45, "usage_type": "call" }, { "api_name": "threading.Thread", "l...
124370893
import os import datetime from colorama import Fore, Style def get_timestamp(): now = datetime.datetime.now() return "{0}_{1}_{2}_{3}_{4}".format( now.strftime("%b"), now.day, now.year, now.hour, now.minute ) def rsync(folder): if os.path.exists(folder[1]): cmd = 'rsync -av {0}/{2}/...
null
utils.py
utils.py
py
621
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", ...
196443880
from django.shortcuts import render,redirect import requests import os from django.core.files.storage import default_storage from django.core.files.base import ContentFile from django.utils import timezone # Create your views here. from scanbc.forms import ScanForm from scanbc.models import ImageFileModel def home(re...
null
scanbc/views.py
views.py
py
1,886
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.redirect", "line_number": 14, "usage_type": "call" }, { "api_name": "scanbc.forms.ScanForm", "line_number": 17, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 30, "usage_type": "call" }, { "api_name"...
314862306
from predict import predict, get_best_model, predict_CAM import matplotlib.pyplot as plt import numpy as np from PIL import Image import utils from skimage import transform import torch from sklearn.manifold import TSNE from sklearn.decomposition import PCA import os import pickle from torchvision.utils import make_gri...
null
visualize.py
visualize.py
py
6,409
python
en
code
null
code-starcoder2
76
[ { "api_name": "predict.predict", "line_number": 22, "usage_type": "call" }, { "api_name": "predict.predict", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 34, "usage_type": "call" }, { "api_name": "utils.preprocess", "lin...
158362024
from rest_framework import status from rest_framework.decorators import api_view, APIView from rest_framework.response import Response from core.permissions import IsOwnerOrParentOfOwner from teacher.models import Teacher from teacher.serializers import TeacherSerializer class TeacherList(APIView): permission_cl...
null
teacher/views.py
views.py
py
1,580
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.decorators.APIView", "line_number": 10, "usage_type": "name" }, { "api_name": "core.permissions.IsOwnerOrParentOfOwner", "line_number": 11, "usage_type": "name" }, { "api_name": "teacher.models", "line_number": 14, "usage_type": "name" }, ...
594777984
from selenium import webdriver class WangyiyunMusic: def __init__(self): self.start_url = 'https://music.163.com/#/discover/playlist/' self.driver = webdriver.Chrome() def get_detail_url(self): detail_list = self.driver.find_elements_by_xpath("//div[@class='u-cover u-cover-1']") ...
null
wangyiyun.py
wangyiyun.py
py
2,518
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" } ]
207652476
import math from math import e import sympy as sp from sympy.utilities.lambdify import lambdify class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[90m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' HEADER = '\033[9...
null
Q14 Finding Equation Roots Numerical Integration.py
Q14 Finding Equation Roots Numerical Integration.py
py
12,778
python
en
code
null
code-starcoder2
76
[ { "api_name": "sympy.limit", "line_number": 42, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 51, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 51, "usage_type": "name" }, { "api_name": "math.log", "l...
286102233
import pygame from pygame.locals import * import sys import os def load_image(nombre, dir, alpha=False): ruta = os.path.join(dir, nombre) try: image = pygame.image.load(ruta) except: print("Error, no se puede cargar la imagen: " + ruta) sys.exit(1) if alpha is True: imag...
null
loadImage.py
loadImage.py
py
404
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.image", "line_num...
504908031
#!/usr/bin/env python from glob import glob from xml.dom import minidom import argparse import logging import shutil import subprocess import sys, os class Default: modules = 6 current_dist = 'current_dist' vivado_hls = 'vivado_hls' project = 'hls_impl' solution = 'solution1' class Status: d...
null
manage.py
manage.py
py
9,565
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.stdout.isatty", "line_number": 33, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
651847253
from django.test import TestCase from .models import Article,Author,Categorie from datetime import date # Create your tests here. class ArticleTest(TestCase): def setUp(self): boss=Author.objects.create(name='ok',nationality='fr',birthdate=date.today()) categ=Categorie.objects.create(name='lourd')...
null
articles/tests.py
tests.py
py
957
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "models.Author.objects.create", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Author.objects", "line_number": 9, "usage_type": "attribute" }, { "api_nam...
533736567
import cv2 import time class MotionDetector(object): def __init__(self, camera): # 初期化処理 self.camera = camera.start() self.background = None def get_frame(self): # 動体検知処理の呼び出しをおこなう # フレームはJPEG画像に変換して戻り値にする frame = self.detect() _, jpeg = cv2.imencode('.jpg', ...
null
chapter6/processor.py
processor.py
py
4,493
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imencode", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 21, "usage_type": "attribute" }, { "api_name": "cv2.absdiff", "...
565339942
import requests import json import socketio agent = {'name': 'victim_action_test'} fake = {'name': 'fake'} wait = True responses = [] socket = socketio.Client() fake_socket = socketio.Client() token = None fake_token = None victim_loc = None def connect_agent(): global token, fake_token response = requests...
null
src/tests/integration/test_agents/test_rescue_victim_action.py
test_rescue_victim_action.py
py
2,840
python
en
code
null
code-starcoder2
76
[ { "api_name": "socketio.Client", "line_number": 10, "usage_type": "call" }, { "api_name": "socketio.Client", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.post", "li...
618153484
#!/usr/bin/env python import os from os.path import join as pjoin, abspath import torch import numpy as np import numpy.random as rand from numpy import genfromtxt import pandas as pd from .dataset import Dataset _default_folder = abspath(pjoin(__file__, "..", "..", "..", "datasets")) DATASET_FOLDER = os.environ.g...
null
selective_gp/datasets/real_data.py
real_data.py
py
5,461
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 16, "usage_type": "call" }, { "api_name": "os.environ", "line_nu...
603844138
#!/usr/bin/python import smc import logging from pprint import pprint logger = logging.getLogger(__name__) smc.login('http://172.18.1.150:8082', 'EiGpKD4QxlLJ25dbBEp20001') #smc.web_api.login('http://172.18.1.150:8082', 'EiGpKD4QxlLJ25dbBEp20001') #Example of using a search filter #Response is a json record with...
null
test.py
test.py
py
2,396
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "smc.login", "line_number": 10, "usage_type": "call" }, { "api_name": "smc.search.get_element", "line_number": 19, "usage_type": "call" }, { "api_name": "smc.search", "l...
311999831
# pylint: disable=missing-docstring, too-many-arguments, unused-argument import json async def test_insert_unauthorized(cli): url = '/v1/points' resp = await cli.post(url) assert resp.status == 403 async def test_insert_bad_request(cli, token): url = '/v1/points' resp = await cli.post(url, heade...
null
src/tests/test_api.py
test_api.py
py
1,739
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.dumps", "line_number": 16, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 35, "usage_type": "call" } ]
107377310
''' Created on Feb 21, 2014 @author: u0490822 ''' import logging import os import nornir_imageregistration.core as core import nornir_imageregistration.spatial as spatial import numpy as np def CreateTiles(transforms, imagepaths): '''Create tiles from pairs of transforms and image paths :param transform tr...
null
nornir_imageregistration/tile.py
tile.py
py
6,124
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", "line_number": 25, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "nornir_imageregistratio...
135635234
''' 1.get、post方法做一下异常处理 2.打印日志 3.保持回话,使用session发送请求 ''' import requests class BaseRequests: # 构造方法中创建一个session # 该session能够自动管理请求过程中的cookie保持有效会话 def __init__(self): self.session = requests.session() def get(self, url, **kwargs): try: r = self.session.get(url, **kwargs) ...
null
zonghe/caw/BaseRequests.py
BaseRequests.py
py
1,488
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.session", "line_number": 14, "usage_type": "call" } ]
403791943
# _*_ encoding:utf-8 _*_ # _*_ author:wen _*_ import pymongo from pymongo import MongoClient class MG(object): def __init__(self): self.client = MongoClient("127.0.0.1", 27017) self.db = self.client["shenjinlong"] """ mongodb_operation 静态方法,用来和 mongodb 操作交互 """ class BaseHandle(object): ...
null
izone/apps/finance/mongo.py
mongo.py
py
7,060
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" } ]
220509914
# Paul Glenn -- 21 July 2014 # Draw a Koch curve on the interval [x_lower,x_upper]. # Usage: python koch_fractal.py [num_iterations = 1] [x_lower = 0] [x_upper = 1] # Module imports import numpy as np import matplotlib.pyplot as pp import math as m from sys import argv argc = len(argv) -1 if argc == 0: numIterations...
null
python/koch_fractal.py
koch_fractal.py
py
1,154
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "argument" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 17, ...
237341492
from __future__ import division import numpy as np import scipy.sparse as sp import json from utils import sparse_to_tuple seed = 123 np.random.seed(seed) class MinibatchIterator(object): def __init__(self, n_entity, n_rel, feat, rel2end, mat_data_path, json_data_path, add_label_loss=False, n_hierarchical_label=0,...
null
minibatch.py
minibatch.py
py
5,989
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.load", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.load", "line_n...
121660754
# -*- coding: utf-8 -*- # Copyright (c) 2013-2018 Will Thames <will@thames.id.au> # Copyright (c) 2018 Ansible by Red Hat # Modified work Copyright (c) 2019 Warpnet B.V. import unittest from saltlint.linter import RulesCollection from saltlint.rules.FileModeQuotationRule import FileModeQuotationRule from tests import...
null
tests/unit/TestFileModeQuotationRule.py
TestFileModeQuotationRule.py
py
1,167
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 33, "usage_type": "attribute" }, { "api_name": "saltlint.linter.RulesCollection", "line_number": 34, "usage_type": "call" }, { "api_name": "saltlint.rules.FileModeQuotationRule.FileModeQuotationRule", "line_number": 37, "u...
643714827
import os import pathlib from pathlib import Path import re def has_admin(): if os.name == 'nt': try: # only windows users with admin privileges can read the C:\windows\temp temp = os.listdir(os.sep.join([os.environ.get('SystemRoot', 'C:\\windows'), 'temp'])) except: ...
null
baseAndroid/make_symbolic_links.py
make_symbolic_links.py
py
2,232
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.name", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.sep.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.sep", "line_number": 11, ...
318089471
""" Spotify """ import time import tqdm from datetime import datetime, timedelta import sched import pandas import logging import requests import charts from io import StringIO import spotipy import spotipy.util as util import sys import utils from database import upsert_bpa from database import upsert_spotify BPA_S...
null
data_acquire.py
data_acquire.py
py
4,402
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.Logger", "line_number": 25, "usage_type": "call" }, { "api_name": "utils.setup_logger", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 36, "usage_type": "call" }, { "api_name": "requests.exceptions", ...
285138985
# Copyright (c) 2019-2021, Tom Westerhout # 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 notice, this # list of conditions a...
null
python/lattice_symmetries/__init__.py
__init__.py
py
46,572
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 80, "usage_type": "call" }, { "api_name": "sys.platform", "line_number": 85, "usage_type": "attribute" }, { "api_name": "sys.platform", "line_number": 87, "usage_type": "attribute" }, { "api_name": "sys.platf...
59775648
bl_info = { "name": "Import Pokémon Masters Models", "author": "Turk, Jugolm, MiniEmerald", "version": (1, 3, 3), "blender": (2, 80, 0), "location": "File > Import-Export", "description": "A tool designed to import LMD files from the mobile game Pokémon Masters", "warning": "", "...
null
io_import_pokemon_masters.py
io_import_pokemon_masters.py
py
21,466
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.walk", "line_number": 36, "usage_type": "call" }, { "api_name": "fnmatch.fnmatch", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_number": 39,...
646549581
import sys import math import pygame from pygame import Vector2 from pygame import Rect class LineSegment: def __init__(self, p1, p2): self.p1 = Vector2(p1) self.p2 = Vector2(p2) self.vector_from_p1 = Vector2(self.p2.x - self.p1.x, self.p2.y - self.p1.y) def __repr__(self): re...
null
pygame/diamonds/collisions.py
collisions.py
py
8,241
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.Vector2", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.Vector2", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.Vector2", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.Vector2", "li...
18565120
from flask import Flask, render_template, url_for, request, redirect, session, flash, g, send_from_directory from app import app, db from .models import * import os import time from sqlalchemy.orm import load_only # @app.context_processor # def utility_processor(): # def get_parent_categories(id): # return...
null
app/views.py
views.py
py
8,681
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.g.categories", "line_number": 21, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 21, "usage_type": "name" }, { "api_name": "app.db.session.query", "line_number": 21, "usage_type": "call" }, { "api_name": "app.db.session",...
371274059
import logging import os from inspect import getmembers, isfunction import pytest from data_science_from_scratch.library import machine_learning current_dir = os.path.dirname(__file__) parent_dir = os.path.join(current_dir, os.pardir) def test_smoke(): logging.info("is anything on fire") for member in getm...
null
tests/test_data_science_from_scratch/test_library/test_machine_learning.py
test_machine_learning.py
py
2,600
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
613940102
"""Test filters based on a set of patterns.""" import importlib.util import logging import os import sys import pytest import yaml from webchanges.filters import FilterBase logger = logging.getLogger(__name__) bs4_is_installed = importlib.util.find_spec('bs4') is not None # https://stackoverflow.com/questions/31...
null
tests/filters_test.py
filters_test.py
py
4,823
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "importlib.util.util.find_spec", "line_number": 16, "usage_type": "call" }, { "api_name": "importlib.util.util", "line_number": 16, "usage_type": "attribute" }, { "api_name...
219869335
""" Written by nanbuwks forked from LaTeX renderer for mistletoe. """ import re from itertools import chain import mistletoe.latex_token as latex_token from mistletoe.base_renderer import BaseRenderer from mistletoe import block_token, span_token class MDMDRenderer(BaseRenderer): def __init__(self, *extras): ...
null
mdmd_renderer.py
mdmd_renderer.py
py
8,416
python
en
code
null
code-starcoder2
76
[ { "api_name": "mistletoe.base_renderer.BaseRenderer", "line_number": 12, "usage_type": "name" }, { "api_name": "mistletoe.latex_token", "line_number": 19, "usage_type": "argument" }, { "api_name": "itertools.chain", "line_number": 21, "usage_type": "call" }, { "ap...
295576144
#!/usr/bin/env python # Docker class to connect to docker server box and perform docker operations from __future__ import print_function import cloudmesh import docker import os #from cloudmesh.api.docker_instance import Cloudmeshdocker, Container, Images import requests import json class Docker(object): ...
null
cloudmesh/api/docker_client.py
docker_client.py
py
3,913
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "docker.from_env", "line_number": 14, "usage_type": "call" }, { "api_name": "docker.errors", "line_number": 45, "usage_type": "attribute" }, { "api_name": "docker.errors", ...
332362967
import os import cgi import subprocess import json data = cgi.FieldStorage() verb = data.getvalue("verb") describedeployname = data.getvalue("describedeploy") describedeployname = data.getvalue("describedeploy") describedeployname = data.getvalue("describedeploy") def describe(deployname): cmd="curl -s --cacert ...
null
deployments_backup.py
deployments_backup.py
py
2,617
python
en
code
null
code-starcoder2
76
[ { "api_name": "cgi.FieldStorage", "line_number": 6, "usage_type": "call" }, { "api_name": "subprocess.getoutput", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "subprocess.getoutput"...