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
604129170
# Copyright (c) 2018 Qumulo, Inc. # # 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, sof...
null
actions/lib/qumulo/rest/kerberos.py
kerberos.py
py
2,514
python
en
code
null
code-starcoder2
83
[ { "api_name": "qumulo.lib.request.rest_request", "line_number": 29, "usage_type": "call" }, { "api_name": "qumulo.lib.request", "line_number": 29, "usage_type": "name" }, { "api_name": "qumulo.lib.request.CONTENT_TYPE_BINARY", "line_number": 35, "usage_type": "attribute" ...
102569903
# %% from trainer import Trainer from network import ResUnet3D, ResAttrUnet3D, ResAttrUnet3D2, ResAttrBNUnet3D from loss import Dice, HybirdLoss, DiceLoss, FocalLoss from data import CaseDataset from torchvision.transforms import Compose from transform import Crop, RandomCrop, ToTensor, CombineLabels, \ RandomBrig...
null
nb_train_iib.py
nb_train_iib.py
py
2,110
python
en
code
null
code-starcoder2
83
[ { "api_name": "network.ResUnet3D", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 18, "usage_type": "call" }, { "api_name": "loss.HybirdLoss", "line_number": 19, "usage_type": "call" }, { "api_name": "loss.DiceLoss", ...
52103850
import pygame class KineticButton: def __init__(self, text: str, x: int, y: int, width: int, height: int, value: str, font="Calibri", font_size=20, text_color=(255, 255, 255), background_color=(0, 0, 0), hover_color=(130, 130, 130), hover=False, outline=0, outline_color=(0, 0, 0), borders=0, border_color=(0, 0, 0...
null
KineticButton.py
KineticButton.py
py
2,571
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.font.SysFont", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 20, "usage_type": "attribute" } ]
109577853
# -*- coding: utf-8 -*- """ Converts CSV data from the database into JSON files that the web app can load. See `facilities.sql` for how to create the various input files. File paths are hard coded in the script relative to the current working directory. Written for Python 2.7; may work with Python 3.x. """ from __fu...
null
facilities-website-tools/make_children.py
make_children.py
py
3,076
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.version_info", "line_number": 28, "usage_type": "attribute" }, { "api_name": "io.open", "line_number": 29, "usage_type": "call" }, { "api_name": "io.open", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.version_info", "line_nu...
298399170
import requests import re import json from concurrent.futures import ThreadPoolExecutor from multiprocessing import cpu_count class get_Oppo_r17_alldatas(object): def __init__(self): self.taobao_urls_list = [ 'https://rate.tmall.com/list_detail_rate.htm?itemId=575558439753&sellerId...
null
Oppo_r17_data.py
Oppo_r17_data.py
py
4,820
python
en
code
null
code-starcoder2
83
[ { "api_name": "multiprocessing.cpu_count", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 35, "usage_type": "call" }, { "api_name": "re.findall", ...
151759009
"""Meetup Views Module""" # Third Party Imports. import json from datetime import datetime from flask import Response from flask_restplus import reqparse, Resource from flask_jwt_extended import jwt_required, get_jwt_identity # Local Imports from ..models.meetup_model import MeetupModel from ..utils.serializer import ...
null
app/api/v2/views/meetup_views.py
meetup_views.py
py
5,037
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.serializer.MeetupDataTransferObject.meetup_namespace", "line_number": 15, "usage_type": "attribute" }, { "api_name": "utils.serializer.MeetupDataTransferObject", "line_number": 15, "usage_type": "name" }, { "api_name": "flask_restplus.reqparse.RequestParser",...
122439856
# Robert Cudmore # 20191119 """ created to be used with raw image data from napari bShapeAnalysisWidget """ import sys, time, math import numpy as np from skimage.measure import profile from scipy.optimize import curve_fit from skimage.draw import polygon import scipy.signal #from multiprocessing import Pool impor...
null
bimpy/old/bShapeAnalysis.py
bShapeAnalysis.py
py
13,767
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.exp", "line_number": 54, "usage_type": "call" }, { "api_name": "scipy.optimize.signal.medfilt", "line_number": 58, "usage_type": "call" }, { "api_name": "scipy.optimize.signal", "line_number": 58, "usage_type": "attribute" }, { "api_name": "sc...
12084029
#!/usr/bin/env python3 # Importando a biblioteca de datetime from datetime import datetime # Utilizando o parametro datetime.now # para pegar a hora do SO hora_atual = datetime.now() # Utilizando o parametro strftime # para personalizar o formato da hora view_hora = hora_atual.strftime('%H:%M') # Importando a bib...
null
python/tcp/client.py
client.py
py
791
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "socket.socket", "line_number": 23, "usage_type": "call" }, { "api_name": "socket.AF_INET", ...
484160065
import sys sys.path.append("..") from Config.get_all_config import * import subprocess import linecache import codecs import os def Ansible_Run(job_id,TESTCASE,TESTNAME,TOPONAME): current_path = str(os.getcwd()) current_path = current_path.replace("Execute","SONiC/") try: os.makedirs('/source/repor...
null
SONiC/Ansible_Test_Case.py
Ansible_Test_Case.py
py
5,683
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 10, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number"...
192096109
# coding=utf-8 # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, print_function import os from collections import deque from pex import third_party from pex.compatibility import urlparse from pex....
null
pex/pip.py
pip.py
py
5,800
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ.copy", "line_number": 22, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pex.third_party.expose", "line_number": 25, "usage_type": "call" }, { "api_name": "pex.third_part...
445121410
import base64 import calendar import datetime import hashlib from importlib import import_module import logging import operator import os from random import randint import re import uuid from dateutil import tz from django.conf import settings from django.contrib.auth.models import User from django.db import connectio...
null
src/gladminds/core/utils.py
utils.py
py
24,377
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 37, "usage_type": "call" }, { "api_name": "re.search", "line_number": 45, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 53, "usage_type": "call" }, { "api_name": "hashlib.sha256", "li...
395016465
# SQLAlchemy settings import os from datetime import timedelta SQLALCHEMY_DATABASE_URI = 'sqlite:///db.sqlite' SQLALCHEMY_TRACK_MODIFICATIONS = False # Flask settings # FLASK_SERVER_NAME = 'localhost:3000' FLASK_DEBUG = True # Do not use debug mode in production PORT = 3000 # JWT JWT_SECRET_KEY = os.getenv("JWT_SEC...
null
backend/settings.py
settings.py
py
540
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.getenv", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 20, "usage_type": "call" } ]
295170430
from neurolight.visualizations.neuroglancer_trees import visualize_trees from neurolight.match.costs import get_costs from neurolight.match.preprocess import mouselight_preprocessing from funlib.match.helper_functions import match import networkx as nx import sys from pathlib import Path import copy import pickle fi...
null
scripts/view_matching_neuroglancer.py
view_matching_neuroglancer.py
py
1,290
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 18, "usage_type": "call" }, { "api_name": "pickle.load", "line_number...
646773583
from flask import Flask, render_template, redirect, send_from_directory, session from pprint import pprint import os import sys import random LOCAL_PATH = "/home" if sys.argv[1:] == []: print('usage:', 'python3 app.py your_folder_path') else: giving_path = sys.argv[-1:][0] if giving_path == "&": ...
null
app/flask_app.py
flask_app.py
py
3,410
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_n...
517746062
import json import math class ShoppingBasket: def __init__(self): self.basket = {} self.subtotal = 0 self.discount = 0 self.total = 0 with open('shopping_basket/Catalogue.json', 'r') as f: self.catalogue = json.load(f) with open('shopping_basket/Offers...
null
shopping_basket/ShoppingBasket.py
ShoppingBasket.py
py
1,863
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 45, "usage_type": "call" } ]
366921659
import paho.mqtt.client as mqtt import pickle import sys import logging import datetime import time import pymongo logging.basicConfig(level=logging.DEBUG) db_name = sys.argv[2] mongoAddress=sys.argv[1] myclient = pymongo.MongoClient("mongodb://"+mongoAddress+":27017/") mydb = myclient[db_name] def on_message(cli...
null
Data-Driven E2E Latency Estimation/1.Latency Sample Generation/3)Latency Sampling/Latency Result Storage/storage/fault.py
fault.py
py
1,422
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.argv", "li...
461875279
from django import forms from django.utils.translation import ugettext_lazy as _ import StringIO from PIL import Image, ImageChops from .models import Device, TechnicalSpecification, ForumTopic, Comment, UserProfile class LoginForm(forms.Form): """Form used for logging user in. Form contains two fields, use...
null
gadgetfreak_web/forms.py
forms.py
py
5,430
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.forms.Form", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 9, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 15, "usage_type": "call" }, { "api_name": "django.forms...
272448792
import math from typing import Any, Generator, List, Tuple Coordinate = Tuple[int, int] Matrix = List[List[Any]] def count_items_on_level(matrix_size: int, depth: int = 1, level: int = 1) -> int: if level <= 0: raise ValueError("`level` should be great then `0`") if level > depth: raise Valu...
null
tasks/matrix_in_spiral_form.py
matrix_in_spiral_form.py
py
1,833
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.Tuple", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 6, "usage_type": "name" }, { "api_name": "math.ceil", "line_number": 40, ...
548826882
import numpy as np from numpy import linalg from scipy.linalg import hankel from numpy import genfromtxt import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages import sys arguments=sys.argv[2:] count=len(arguments) r=1 def PASAD_TRAIN(train,n,l): X=hankel(train[0:l],train[l:n]) u,s,vt ...
null
pasad.py
pasad.py
py
1,947
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "scipy.linalg.hankel", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linalg.svd", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.linalg", ...
296092881
import argparse import logging import os import traceback import numpy as np from computer_vision.classVgg import Vgg from dataset_utils.classImageClassificationDataset import ImageClassificationDataset parser = argparse.ArgumentParser(description='Image classification program') parser.add_argument('--training-set-pa...
null
exec/image_classification_vgg_exec.py
image_classification_vgg_exec.py
py
4,615
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.Logger", "line_number": 30, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 31, "usage_type": "attribute" }, { "api_name": "logging.INF...
260810404
import random from OpenGL.GL import * import glfw import numpy as np from scipy.spatial.transform import Rotation as R window = None surfaces = None def_verticies = None cur_verticies = None turn = 0 flag_spin = True flag_textured = True flag_move = True flag_ranom = False sphere_cut_a = 10 sphere_cut_b = 10 cur...
null
Computer Graphics/lab6.py
lab6.py
py
5,601
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 25, "usage_type": "attribute" }, { "api_name": "glfw.init", "line...
587009481
"""empty message Revision ID: de9cb9bebea2 Revises: 6f5fd8d74eb6 Create Date: 2019-11-07 11:33:03.263683 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'de9cb9bebea2' down_revision = '6f5fd8d74eb6' branch_labels = None depends_on = None def upgrade(): # ...
null
projects/01_fyyur/starter_code/migrations/versions/de9cb9bebea2_.py
de9cb9bebea2_.py
py
677
python
en
code
null
code-starcoder2
83
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
204967598
# Copyright 2022 Huawei Technologies Co., Ltd # # 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...
null
research/cv/RefineDet/modelart/refinedet.py
refinedet.py
py
12,986
python
en
code
null
code-starcoder2
83
[ { "api_name": "mindspore.common.set_seed", "line_number": 37, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 42, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 51, "usage_type": "attribute" }, { "api_name"...
327906799
#!/usr/bin/env python3 import socket import umsgpack import re LPORT = 9999 LHOST = "127.0.0.1" MAXCONNECTIONS = 1 BYTES = 4096 REGEXP = '[0-9]{2}\.[0-9]{2}\.[0-9]{4}' sock = socket.socket() sock.bind((LHOST, LPORT)) sock.listen(MAXCONNECTIONS) conn, addr = sock.accept() while True: try: data = conn.re...
null
server.py
server.py
py
614
python
en
code
null
code-starcoder2
83
[ { "api_name": "socket.socket", "line_number": 13, "usage_type": "call" }, { "api_name": "umsgpack.loads", "line_number": 22, "usage_type": "call" }, { "api_name": "re.match", "line_number": 24, "usage_type": "call" }, { "api_name": "umsgpack.dumps", "line_numb...
469198661
# -*- coding: utf-8 -*- import random import string import os import sys import numpy as np import time from model import createModel from datasetTools import getDataset from config import slicesPath, batchSize, filesPerGenre, nbEpoch, validationRatio, testRatio, sliceSize from songToData import createSli...
null
main.py
main.py
py
2,634
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "config.validationRatio", "line_number": 25, "usage_type": "argument" }, { "api_name": "config.testRatio", "line_number": 26, "usage_type": "argument" }, { "api_name"...
545670987
from utils import ConvertLabelImage,Resize import torch from torch.utils import data import os from skimage.io import imread,imshow,show import numpy as np import matplotlib.pyplot as plt class VideoSegmentationDataset(data.Dataset): """Face Landmarks dataset.""" def __init__(self, train_dir, label_dir): ...
null
code/dataloader.py
dataloader.py
py
1,750
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.Dataset", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "os.listdir",...
504730958
# functions # -*- coding: utf-8 -*- # # These are functions that can be used in expressions. They must take and # return a single string. # from __init__ import setup_logging from stdnum import isbn from stdnum import issn import regex # if '(', ' ', or '.' are present we may be able to rescue an ISBN ISBN_SNIFF = r...
null
marc_to_solr/string_functions.py
string_functions.py
py
4,123
python
en
code
null
code-starcoder2
83
[ { "api_name": "regex.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "regex.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "regex.compile", "line_number": 17, "usage_type": "call" }, { "api_name": "regex.compile", "line_n...
400300778
import os import getpass import time import requests ######## #CLASSES ######## class Item: def __init__(self, id, name, price): self.id = id self.name = name self.price = price class Invoice: def __init__(self, id, InventoryRecordId, quantity): self.id = id self.item...
null
client.py
client.py
py
5,472
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.post", "line_number": 83, "usage_type": "call" }, { "api_name": "os.system", "line_number": 94, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 98, "usage_type": "call" }, { "api_name": "requests.get", "line_number"...
379484150
""" Created on Dec 28 2019 Code for 3D task activation regression with convolutional networks based on resting state connectivity data @author: mregina """ import tensorflow as tf from datetime import datetime import os from utils import NiiSequence, CorrelationMetric, CorrelationLoss, save_prediction DA...
null
cnn_3D.py
cnn_3D.py
py
4,769
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
438073489
#!/usr/bin/python3 """ urbandict.py - urban dictionary module author: mutantmonkey <mutantmonkey@mutantmonkey.in> """ from tools import GrumbleError import web import json def urbandict(casca, input): """.urb <word> - Search Urban Dictionary for a definition.""" word = input.group(2) if not word: ...
null
modules/urbandict.py
urbandict.py
py
1,317
python
en
code
null
code-starcoder2
83
[ { "api_name": "web.get", "line_number": 28, "usage_type": "call" }, { "api_name": "web.quote", "line_number": 30, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 31, "usage_type": "call" }, { "api_name": "tools.GrumbleError", "line_number": ...
227175597
# models.py # Defines the structure of the database. # https://docs.djangoproject.com/en/1.10/topics/db/models/ from django.db import models from django.contrib.auth.models import User class Club(models.Model): name = models.CharField(max_length=64, default="") email = models.EmailField(max_length=128, blank=True,...
null
projectx/models.py
models.py
py
716
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 10, "usage_type": "call" }, { "api_name": ...
59086773
""" @author: Yuhao Cheng @contact: yuhao.cheng[at]outlook.com """ import torch from pyanomaly.core.utils import AverageMeter, ParamSet from ..utils import engine_save_checkpoint from ..utils import engine_save_model from .abstract_engine import AbstractTrainer, AbstractInference import abc from collections i...
null
pyanomaly/core/engine/abstract/base_engine.py
base_engine.py
py
18,614
python
en
code
null
code-starcoder2
83
[ { "api_name": "abstract_engine.AbstractTrainer", "line_number": 15, "usage_type": "name" }, { "api_name": "pyanomaly.core.utils.AverageMeter", "line_number": 66, "usage_type": "call" }, { "api_name": "pyanomaly.core.utils.AverageMeter", "line_number": 67, "usage_type": "c...
359880385
from PyQt5 import QtCore, QtWidgets from MplWidget import MplWidget def addCustomTabs(self, count, start = 3): self.gridLayout4 = {} self.horizontalLayout2 = {} self.gridLayout6 = {} self.horizontalLayout10 = {} self.label21 = {} self.label22 = {} self.horizontalLayout9 = {} self.onlineCustomModeCheckBoxArr =...
null
GUI/customTab.py
customTab.py
py
7,704
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 18, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets", "line_number": 18, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QGridLayout", "line_number": 22, "usage_type": "call" }, { "api_name": "P...
148933238
#!/usr/bin/python import multiprocessing,sys count=len(open("/var/log/system.log").readlines())/2 print(count) print(count*2) def ash(y): a=[] for value in "\n".join(open("/var/log/system.log").readlines(y)).split("\n")[0:]: a.append(value.strip()) return "\n".join(a) pool=multiprocessing.Pool(processes=2) result...
null
par.py
par.py
py
385
python
en
code
null
code-starcoder2
83
[ { "api_name": "multiprocessing.Pool", "line_number": 11, "usage_type": "call" } ]
630463757
import os import random import re from torch.utils.data import DataLoader, Dataset class ColorDataset(Dataset): def __init__(self, data_path="all.txt", color_ratio=0.5): with open(data_path) as f: self.data = f.read().splitlines() self.color_ratio = color_ratio def __len__(self):...
null
color_bert/pytorch/dataset.py
dataset.py
py
1,425
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.Dataset", "line_number": 8, "usage_type": "name" }, { "api_name": "random.random", "line_number": 19, "usage_type": "call" }, { "api_name": "re.search", "line_number": 48, "usage_type": "call" }, { "api_name": "random.choice", "...
637921758
#@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
null
Lab11/check3.py
check3.py
py
4,362
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.expand_dims", "line_number": 49, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.xticks", "line_number": 55, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 55, "usage_type": "name" }, { "api_name": "matplotl...
217280395
# !/usr/bin/env python # -*- coding:utf-8 -*- import re import threading import requests from userInfo.userinfo import t, curID, check_proxy_url, get_proxy_headers, check_proxy_headers, proxy_data download_proxies = {'http': 'socks5://127.0.0.1:1080'} threads = [] filter_lists = [] thread_num = 100 # 按需求修...
null
IP/gatherProxy.py
gatherProxy.py
py
4,491
python
en
code
null
code-starcoder2
83
[ { "api_name": "threading.Thread", "line_number": 15, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "userInfo.userinfo.check_proxy_url", "line_number": 22, "usage_type": "name" }, { "api_name": "...
90959746
# Copyright (c) 2019. yoshida-lab. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import numpy as np import pandas as pd import pytest from torch.nn import Sequential from xenonpy.descriptor import FrozenFeaturizer from xenonpy.model.nn i...
null
tests/descriptor/test_frozen_feature.py
test_frozen_feature.py
py
2,258
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Sequential", "line_number": 18, "usage_type": "call" }, { "api_name": "xenonpy.model.nn.Layer1d", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy....
392956218
import os import math import torch import numpy as np import time import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from tqdm import tqdm from torchdiffeq import odeint as odeint_normal from torchdiffeq import odeint_adjoint as odeint import pdb class DeepsetBlock(nn....
null
codes_regularly-sampled/exnode.py
exnode.py
py
9,884
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
574135903
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from babik_content.models import ShowFromMixin, ShowUntilMixin from babik_content.utils import cache_clearing class ContentAdmin(admin.ModelAdmin): def get_fieldsets(self, request, obj=None): fieldsets = super(Conten...
null
babik_content/admin.py
admin.py
py
1,141
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 8, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext_lazy", "line_number": 14, "usage_type": "call" ...
326936735
# -*-coding:utf-8 -*- import time from pymongo import MongoClient from datetime import datetime import asyncio @asyncio.coroutine def sample(mongoclient, collection, runtime, g): print('task start %s' % collection) yield from asyncio.sleep(runtime) res = [mongoclient.spv1[collection].find().count(), colle...
null
basic/asyn.py
asyn.py
py
1,349
python
en
code
null
code-starcoder2
83
[ { "api_name": "asyncio.sleep", "line_number": 11, "usage_type": "call" }, { "api_name": "asyncio.coroutine", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pymongo.MongoClient", "line_number": 19, "usage_type": "call" }, { "api_name": "asyncio.get_e...
61483582
import numpy as np import cv2 import matplotlib.pyplot as plt def find_squares(img): img = cv2.GaussianBlur(img, (5, 5), 0) squares = [] for gray in cv2.split(img): for thrs in range(0, 255, 26): if thrs == 0: bin = cv2.Canny(gray, 0, 50, apertureSize=5) bin = cv2.dilate(bin, None) else: _retval...
null
CodigosEnLosQueNicolasNoCree/Cuadrados.py
Cuadrados.py
py
2,142
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.GaussianBlur", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.split", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.Canny", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.dilate", "line_number": 12...
142187813
import glob import xray from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt pathname = '/Users/Phellipe/Desktop/' files = glob.glob('*.nc') m = Basemap(projection='cyl', resolution='i', llcrnrlon=-35, llcrnrlat=-60, urcrnrlon=-30, urcrnrlat=10) fname = 'ascat_Daily_200703.nc' ascat = fna...
null
DataAnalysis/ascat_tools.py
ascat_tools.py
py
708
python
en
code
null
code-starcoder2
83
[ { "api_name": "glob.glob", "line_number": 8, "usage_type": "call" }, { "api_name": "mpl_toolkits.basemap.Basemap", "line_number": 10, "usage_type": "call" }, { "api_name": "xray.open_dataset", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.py...
638566786
from django.conf.urls import url from . import views from django.views.generic import TemplateView urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^calculate', views.calculate, name='calculate'), url(r'^live_stats', views.live_stats, name='live_stats'), url(r'^edit', views.edit_team, name...
null
team_strength/urls.py
urls.py
py
426
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
58950238
from .utils import assign from .utils import getnested class Symbol(object): pass class Paradigm(object): def __init__(self, paradigms, paradigm): self.paradigms = paradigms assign(self, paradigm, ( ('key', None), ('symbols', []), ('type', None), ...
null
src/morfologija/paradigms.py
paradigms.py
py
3,500
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.assign", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.getnested", "line_number": 30, "usage_type": "call" }, { "api_name": "utils.getnested", "line_number": 40, "usage_type": "call" }, { "api_name": "utils.getnested", "l...
185583639
'''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OT...
null
pandas_ta/momentum/coppock.py
coppock.py
py
3,093
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.verify_series", "line_number": 29, "usage_type": "call" }, { "api_name": "utils.get_offset", "line_number": 35, "usage_type": "call" }, { "api_name": "roc.roc", "line_number": 38, "usage_type": "call" }, { "api_name": "overlap.wma.wma", "l...
286815943
import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation def f(a): return a +np.random.random() class AnimaPlot(object): def __init__(self,ax,data_lengh=200): self.data = 0 self.data_lengh = data_lengh self.line, = ax.plot([], [], '.-r') ...
null
animation.py
animation.py
py
1,588
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.random", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 60, "usage_type": "call" }, { "api_name": "matplo...
314240240
from keras.datasets import mnist import numpy as np (train_images, train_labels), (test_images, test_labels) = mnist.load_data() # 改形 train_images = train_images.reshape((60000, 28 * 28)) x = np.array([[0., 1.], [2., 3.], [4., 5.]]) print(x.shape) x = x.reshape((6, 1)) print(x) x = x.resh...
null
chapter2/tensor-reshaping.py
tensor-reshaping.py
py
852
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.datasets.mnist.load_data", "line_number": 4, "usage_type": "call" }, { "api_name": "keras.datasets.mnist", "line_number": 4, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.ze...
9032029
from scipy.optimize import linprog from os import path from sys import argv import numpy as np def print_list(list): for i in list: print(i) def cb(xk, **kwargs): print('------------------------------------', kwargs.pop('nit'), '------------------------------------') print('Ведущий элемент ', kwargs.pop('pivot')...
null
lab1/simplex.py
simplex.py
py
1,619
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.realpath", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.argv", "line_number"...
161776893
from shutil import copyfile from itertools import islice import os def createFolder(directory): try: if not os.path.exists(directory): os.makedirs(directory) except OSError: print ('Error: Creating directory. ' + directory) def copyToNewDir(data, oldDir, newDir,append = '.xyz'): createFolder(newDir) ...
null
script/copyCCStoFile.py
copyCCStoFile.py
py
847
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.exists", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 8, "usage_type": "call" }, { "api_name": "shutil.copyfile", "line_numb...
234015365
'''******************************************************************************* * * FILE NAME: * bta_serv_logg_logger.py * * DESCRIPTION: * This file is Test Automation System Logging sub Module that outputs * the system log onto log files as per configuration provided. * It inte...
null
kk_ADTRAN/Execution_Framework1_build25/Execution_Framework1_build25/bta_serv_logg_logger.py
bta_serv_logg_logger.py
py
21,987
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 75, "usage_type": "call" }, { "api_name": "threading.Semaphore", "line_number": 81, "usage_type": "call" }, { "api_name": "threading.Semaphore", "line_number": 82, "usage_type": "call" }, { "api_name": "threading.S...
108568803
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2020-04-07 17:00 # @Author: Leon.Zhang # @Blog : www.zccie.com from docxtpl import DocxTemplate subnet = '10.192.208' edge_hostname = 'CHD-WHWYGC-VM510-HA' n5k_iproute_config = 'ip route '+ subnet + '.0/24 172.20.254.6 name SD-WAN-' + edge_hostname[:edge_ho...
null
collection/docxtpl/docxtpl_test.py
docxtpl_test.py
py
639
python
en
code
null
code-starcoder2
83
[ { "api_name": "docxtpl.DocxTemplate", "line_number": 22, "usage_type": "call" } ]
647556116
# -*- encoding: utf-8 -*- import os import subprocess import xml.etree.ElementTree as ElementTree import sys import csv def show_facts(facts): for fact in facts: print("{0} {1} - len is {2}".format(fact['fact'], fact['adjForName'], fact['len'])) def facts_to_string(facts): result_str = '' ...
null
NLP-product-name-cl-work/ClearNames.py
ClearNames.py
py
5,596
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.expanduser", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path", "line_number": 32, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
341168057
from flask import Flask, render_template from flask.ext.sqlalchemy import SQLAlchemy import os from twitter.guestimator import * app = Flask(__name__) app.config.from_object(os.environ['APP_SETTINGS']) db = SQLAlchemy(app) from models import Result @app.route('/', methods=['GET', 'POST']) def index(): entry_l...
null
app.py
app.py
py
704
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.ext.sqlalchemy.SQLAlchemy", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render...
20559157
"""myhoney URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views ...
null
myhoney/urls.py
urls.py
py
1,201
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 23, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 23, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 23, "usage_type": "name" }, { "api_name...
97192884
from __future__ import unicode_literals import os import locale import sys sys.stdout = sys.stderr sys.path.append('/var/www/vhosts/sjdl.qc.ca/httpdocs/src/sjdl') sys.path.append('/var/www/vhosts/sjdl.qc.ca/httpdocs/src/') #addsitedir('/home/pawesome/envs/pinax072/lib/python2.6/site-packages') PROJECT_ROOT = os.pa...
null
wsgi.py
wsgi.py
py
826
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.stdout", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_num...
17041320
# -*- coding: utf-8 -*- import re from terminaltables import AsciiTable import pydevd from lib import util from lib import nso from lib import testcase from lib import json_cmp from config import config def split_expect(expect): expect_header = None expect_json = None position = expect.find("{") i...
null
workflow/nso_input.py
nso_input.py
py
3,188
python
en
code
null
code-starcoder2
83
[ { "api_name": "lib.util.conv_linesep", "line_number": 38, "usage_type": "call" }, { "api_name": "lib.util", "line_number": 38, "usage_type": "name" }, { "api_name": "re.match", "line_number": 52, "usage_type": "call" }, { "api_name": "lib.json_cmp.cmp_json", "...
519129608
# No shebang line, this module is meant to be imported # # Copyright 2014 Oliver Palmer # # 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 # # U...
null
pyfarm/agent/http/core/template.py
template.py
py
2,737
python
en
code
null
code-starcoder2
83
[ { "api_name": "jinja2.BytecodeCache", "line_number": 34, "usage_type": "name" }, { "api_name": "io.BytesIO", "line_number": 53, "usage_type": "call" }, { "api_name": "jinja2.Environment", "line_number": 58, "usage_type": "name" }, { "api_name": "jinja2.PackageLoad...
381832181
import requests from flask import jsonify from bs4 import BeautifulSoup from app.module.models.pole_model import Polemodel import datetime import gdelt from datetime import datetime class crawler: @staticmethod def webpagecrawler(data): try: pole= Polemodel() if not pole.ch...
null
app/module/services/gdeltcrawler.py
gdeltcrawler.py
py
3,450
python
en
code
null
code-starcoder2
83
[ { "api_name": "app.module.models.pole_model.Polemodel", "line_number": 14, "usage_type": "call" }, { "api_name": "gdelt.gdelt", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 29, "usage_type": "call" }, { "api_name": "flas...
18849777
from mimesis import Person from mimesis import Address from mimesis.enums import Gender from mimesis.decorators import romanized from customisablePrintColumnsEnum import Providers import datetime import os os.system('cls' if os.name == 'nt' else 'clear') print('] Which locale would you lik...
null
customisablePrintColumns.py
customisablePrintColumns.py
py
3,427
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.system", "line_number": 9, "usage_type": "call" }, { "api_name": "os.name", "line_number": 9, "usage_type": "attribute" }, { "api_name": "mimesis.Address", "line_number": 32, "usage_type": "call" }, { "api_name": "mimesis.Person", "line_numbe...
297233892
# -*- coding: utf-8 -*- """ @author: Adrien Wehrlé, GEUS (Geological Survey of Denmark and Greenland) """ import numpy as np import urllib.request import os import time import requests from bs4 import BeautifulSoup import re import progressbar import argparse # parse command-line arguments parser ...
null
PROMICE_S1GIV_download.py
PROMICE_S1GIV_download.py
py
2,137
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 34, "usage_type": "call" }, { "api_name": "re.compile", ...
447246225
import logging import json import uuid from collections import defaultdict import tornado.web import tornado.httpclient from tornado.platform.asyncio import to_asyncio_future import pymongo import motor from rest_tools.client import RestClient from iceprod.server.rest import RESTHandler, RESTHandlerSetup, authorizati...
null
iceprod/server/rest/datasets.py
datasets.py
py
13,072
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 34, "usage_type": "call" }, { "api_name": "iceprod.server.rest.RESTHandlerSetup", "line_number": 38, "usage_type": "call" }, { "api_na...
372032871
from elasticsearch import Elasticsearch from elasticsearch_dsl import Search, Q from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse # Create your views here. def annotation(request, an_id=None): client = Elasticsearch('amango.org:9200') s = Search(using=client, index="a...
null
bankofbook/annotations/views.py
views.py
py
568
python
en
code
null
code-starcoder2
83
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 11, "usage_type": "call" }, { "api_name": "elasticsearch_dsl.Search", "line_number": 13, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 24, "usage_type": "call" } ]
38939347
# -*- coding: utf-8 -*- """ Module that contains the command line app Why does this file exist, and why not put this in __main__? You might be tempted to import things from __main__ later, but that will cause problems--the code will get executed twice: - When you run `python3 -m pybel_tools` python will execute `...
null
src/pybel_tools/cli.py
cli.py
py
17,915
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 42, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path", "line_number": 47, "usage_type": "attribute" }, { "api_name": "os.path.expanduser", ...
474667647
# -*- coding: utf-8 -*- """ /*************************************************************************** QGIS plugin to integrate Point Clouds from LIDAR or Photogrammetry copyright : (C) David Hernandez Lopez email : david.hernandez@uclm.es **********************************...
null
point_cloud_3d.py
point_cloud_3d.py
py
13,504
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt5.QtCore.QFileInfo", "line_number": 28, "usage_type": "call" }, { "api_name": "qgis.core.QgsApplication.qgisUserDatabaseFilePath", "line_number": 28, "usage_type": "call" }, { "api_name": "qgis.core.QgsApplication", "line_number": 28, "usage_type": "nam...
579788344
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Call service orunav_msgs/ExecuteTask at /robot4/execute_task to abort task! """ import rospy from orunav_msgs.srv import ExecuteTask, ExecuteTaskRequest, ExecuteTaskResponse from orunav_msgs.msg import Operation from orunav_msgs.msg import Task from orunav_msgs....
null
iliad_human_aware_navigation/scripts/deprecated/abort_task.py
abort_task.py
py
8,528
python
en
code
null
code-starcoder2
83
[ { "api_name": "rospy.Time.now", "line_number": 31, "usage_type": "call" }, { "api_name": "rospy.Time", "line_number": 31, "usage_type": "attribute" }, { "api_name": "rospy.loginfo", "line_number": 36, "usage_type": "call" }, { "api_name": "rospy.get_name", "li...
313852346
""" Utilities and routines used with ZMQ for communication. """ import zmq def socket_recv(sock): topic = sock.recv() return sock.recv_pyobj() def socket_gen(sock): poller = zmq.Poller() poller.register(sock, zmq.POLLIN) while True: socks = dict(poller.poll(25)) if socks.get(soc...
null
psanamon/comm.py
comm.py
py
1,206
python
en
code
null
code-starcoder2
83
[ { "api_name": "zmq.Poller", "line_number": 14, "usage_type": "call" }, { "api_name": "zmq.POLLIN", "line_number": 15, "usage_type": "attribute" }, { "api_name": "zmq.POLLIN", "line_number": 18, "usage_type": "attribute" } ]
552910506
#!/usr/bin/env python3.4 from client import client, ss_config import argparse user_config = ss_config.load_or_create_config() parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(dest='command') parser_put_for = subparsers.add_parser('put-for') parser_put_for.add_argument('user_name') parser_put_fo...
null
src/shadowshare.py
shadowshare.py
py
1,212
python
en
code
null
code-starcoder2
83
[ { "api_name": "client.ss_config.load_or_create_config", "line_number": 6, "usage_type": "call" }, { "api_name": "client.ss_config", "line_number": 6, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_...
516043176
from django.urls import path, include from rest_framework.routers import DefaultRouter from rest_framework.urlpatterns import format_suffix_patterns from manage_carpark import views app_name = 'app_manage_carparks' router = DefaultRouter() router.register(r'carparks', views.CarparkViewSet) router.register(r'timesl...
null
carpark/manage_carpark/urls.py
urls.py
py
794
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 11, "usage_type": "call" }, { "api_name": "manage_carpark.views.CarparkViewSet", "line_number": 12, "usage_type": "attribute" }, { "api_name": "manage_carpark.views", "line_number": 12, "usage_type": "na...
76310781
import json from django.shortcuts import render_to_response from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext from django.core import serializers from models import * import forms def all_tasks(request): d = {} for hub in Person.objects.all(): d[hu...
null
web/tasks/views.py
views.py
py
2,089
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.http.HttpResponse", "line_number": 29, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 31, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 35, "usage_type": "call" }, { "api_name": "forms.Ta...
371804598
from django.shortcuts import render from http import cookies import requests import json import gspread from oauth2client.service_account import ServiceAccountCredentials json_key = json.load(open('google-creds_2.json')) # json credentials you downloaded earlier scope = ['https://spreadsheets.google.com/feeds', 'htt...
null
Meeting/views.py
views.py
py
16,216
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name", "line_number": 13, "usage_type": "call" }, { "api_name": "oauth2client.service_account.ServiceAccountCredentials", ...
199228755
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('news', '0003_auto_20160524_0645'), ] operations = [ migrations.AddField( model_name='column', name='...
null
news/migrations/0004_auto_20160524_0648.py
0004_auto_20160524_0648.py
py
647
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.AddField", "line_number": 14, "usage_type": "call" }, { ...
109579485
import tkinter as tk from tkinter import filedialog import pandas as pd from PIL import ImageGrab import win32com.client as win32 import os import requests root= tk.Tk() canvas1 = tk.Canvas(root, width = 300, height = 300, bg = 'lightsteelblue') canvas1.pack() def getExcel (): dir = os.getcwd() # path_destin...
null
uploadFurnitureData.py
uploadFurnitureData.py
py
3,688
python
en
code
null
code-starcoder2
83
[ { "api_name": "tkinter.Tk", "line_number": 9, "usage_type": "call" }, { "api_name": "tkinter.Canvas", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.filedialog.askopenfilename...
645022575
import pandas as pd from matplotlib import pyplot import datetime import statsmodels.api as sm #Possible projects #xd #dnn #COMPASS #apstud #mesos #mule #nexus #timob #tistud project = "COMPASS" projects = { "xd": ("fields.issuetype.name", "fields.status.name", "Done", "jiradataset_is...
null
user_story_analysis/analysing_stories_summary.py
analysing_stories_summary.py
py
6,449
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 32, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 40, "usage_type": "call" }, { "api_name": "pandas.merge", "line_number": 44, "usage_type": "call" }, { "api_name": "pandas.isnull", "lin...
297938867
# bfs의 경우 popleft 대신 pop을 사용 def solution(numbers, target): from collections import deque answer = 0 n_len = len(numbers) q = deque([ [0,numbers[0]] , [0,-numbers[0]] ]) print(q) while q: idx, t_val = q.popleft() idx+=1 if(idx < n_len): q.append([idx, t_val +...
null
sinhyun-kim/programmers/level2/타겟넘버_dfs_stack.py
타겟넘버_dfs_stack.py
py
491
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" } ]
232336349
import asyncio import json from .exception import ( AioWeiboTimeoutError, AioWeiboAuthError, ) class AioWeiboAuth: async def get_access_token(self, code): params = { 'client_id': self.app_key, 'client_secret': self.app_secret, 'grant_type': 'authorization_code...
null
aioweibo/auth.py
auth.py
py
1,706
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 27, "usage_type": "call" }, { "api_name": "exception.AioWeiboAuthError", "line_number": 29, "usage_type": "call" }, { "api_name": "asyncio.TimeoutError", "line_number": 34, "usage_type": "attribute" }, { "api_name": "exce...
67719197
import firebase_admin from firebase_admin import credentials from firebase_admin import db from firebase_admin import storage class resultsFirebase(): def __init__(self): cred = credentials.Certificate('C:/Relectrify/OpenTestRig-Results-Firebase/auth/serviceAccountKey.json') self.fbapp = firebase_admin.initial...
null
otrresultsfb/otrresultsfb.py
otrresultsfb.py
py
963
python
en
code
null
code-starcoder2
83
[ { "api_name": "firebase_admin.credentials.Certificate", "line_number": 11, "usage_type": "call" }, { "api_name": "firebase_admin.credentials", "line_number": 11, "usage_type": "name" }, { "api_name": "firebase_admin.initialize_app", "line_number": 12, "usage_type": "call"...
379746527
import argparse import patsy.core.command from patsy.core.db_gateway import DbGateway from patsy.core.schema import Schema def configure_cli(subparsers) -> None: # type: ignore """ Configures the CLI arguments for this command """ parser = subparsers.add_parser( name='schema', descrip...
null
patsy/commands/schema.py
schema.py
py
620
python
en
code
null
code-starcoder2
83
[ { "api_name": "patsy.core.command.core", "line_number": 18, "usage_type": "attribute" }, { "api_name": "patsy.core.command", "line_number": 18, "usage_type": "name" }, { "api_name": "argparse.Namespace", "line_number": 19, "usage_type": "attribute" }, { "api_name"...
606593031
from collections import Counter from concurrent.futures import ThreadPoolExecutor, as_completed from random import shuffle import tqdm from django.core.management.base import BaseCommand from enrich.lookup import create_sitelinks from ifx.quirks import patch_dns from movies.models import Movie from people.models impo...
null
enrich/management/commands/lookup_sitelinks.py
lookup_sitelinks.py
py
1,431
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "django.core.management.base.BaseCommand", "line_number": 20, "usage_type": "name" }, { "api_name": "ifx.quirks.patch_dns", "line_number": 27, "usage_type": "call" }, { "ap...
586410562
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,sys import pygame import copy import joypad from PIL import Image from pygame.locals import * from sprite import Player # consts screen_width, screen_height = (1242, 480) frame_rate = 20 move_distance = 40 cnt=0 endgame=0 jump_height=[250,140,50,10,50,140,250] ...
null
bin/joystick_game.py
joystick_game.py
py
18,485
python
en
code
null
code-starcoder2
83
[ { "api_name": "joypad.Joystick", "line_number": 49, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 49, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 50, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", ...
174957419
# -*- coding: utf-8 -*- """ Download IPEDS dictionaries and make a master csv dictionary Note, pre-2009 dictionaries are awfully-formatted HTML. """ from urllib.request import urlopen import json import zipfile import os import xlrd import csv import argparse parser = argparse.ArgumentParser() parser.add_argument("st...
null
scripts/makeDictionary.py
makeDictionary.py
py
3,552
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_...
625299202
# Developed by Alvaro Hurtado # a.hurtado.bo@gmail.com # Oruro, Bolivia import sys import time import multiprocessing import RPi.GPIO as GPIO from PyQt4 import QtGui, QtCore, QtTest from time import sleep, strftime from gpio import MembraneMatrix class GUIParalela(): """ La presente clase representa una inter...
null
questions.py
questions.py
py
11,039
python
en
code
null
code-starcoder2
83
[ { "api_name": "multiprocessing.Queue", "line_number": 21, "usage_type": "call" }, { "api_name": "gpio.MembraneMatrix", "line_number": 22, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 32, "usage_type": "call" }, { "api_name": "PyQ...
418864096
from django.db import models from courses.models import Subsection from random import randint from os import remove from profkurs import settings # Create your models here. class Teacher(models.Model): def get_image_path(self, filename): tmp = filename.split('.') type_file = tmp[-1] rand...
null
cours/models.py
models.py
py
5,551
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 17, "usage_type": "call" }, { "api_name": "profkurs....
285274222
import os import keras from keras import backend as K from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, Conv2DTranspose, merge, UpSampling2D, Convolution2D from keras.callbacks import LearningRateScheduler, ModelCheckpoint, ReduceLROnPlateau, TensorBoard from keras.models import Model from keras.optimi...
null
unet_app.py
unet_app.py
py
9,802
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.percentile", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.clip", "line_...
112356938
#coding:utf-8 from django.views.generic import View,ListView from django.shortcuts import render from django.contrib.auth.models import User,Group from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponse, JsonResponse, QueryDict from django.db import IntegrityError from djang...
null
lesson3/zhangbaocheng/opsweb/accounts/user/__init__.py
__init__.py
py
1,643
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 13, "usage_type": "name" }, { "api_name": "django.views.generic.ListView", "line_number": 13, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User", "line_number": 15, "usage_t...
507537680
#coding:utf-8 __author__ = '613108' from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from pyquery import PyQuery as pq from threading import Thread from Queue import Queue import sys,time,random reload(sys) sys.setdefaultencoding('utf-8') sys.path.append(r'C:\Users\Admini...
null
Official_store_project/361du_project/product_info.py
product_info.py
py
3,514
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.setdefaultencoding", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "selenium.webdriv...
82657087
import numpy as np import jenkspy import scipy.signal as signal class ConnectedComponent: def __init__(self, idx, birth, death): self.left = idx self.right = idx self.birth = birth self.death = death def __str__(self): return "{} -> {} ({})".format(self.birth[1], self.death[1], self.lifetime()) def __r...
null
src/rh/util/persistent_homology.py
persistent_homology.py
py
4,417
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.ndarray", "line_number": 91, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 92, "usage_type": "call" }, { "api_name": "scipy.signal.find_peaks", "line_number": 95, "usage_type": "call" }, { "api_name": "scipy.signal",...
336941850
from django.shortcuts import render, redirect, get_object_or_404 from .models import Product, Category, Banners from cart.forms import CartAddProductForm from django.views import View from .forms import ApplicationsForm import telebot from django.core.mail import send_mail from blog.models import Post from django.views...
null
mainasia/views.py
views.py
py
5,388
python
en
code
null
code-starcoder2
83
[ { "api_name": "telebot.TeleBot", "line_number": 18, "usage_type": "call" }, { "api_name": "cart.forms.CartAddProductForm", "line_number": 22, "usage_type": "call" }, { "api_name": "cart.forms", "line_number": 23, "usage_type": "name" }, { "api_name": "cart.cart.Ca...
498305634
############################################################################## # # Reference: Factorization meets the neightborhood: a multifaceted Collaborative # Filtering Model. # ############################################################################### import tensorflow as tf import numpy as np from collec...
null
scripts/tf_svd.py
tf_svd.py
py
12,434
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.transpose", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.random.randint", "...
125403077
import wikipedia #need to run $ pip install wikipedia import string from wiki_functions import summary_links from wiki_functions import key_links from collections import OrderedDict class PageTree: """a tree of wikipedia pages based on links attributes: title, summary_links""" def __init__(self, title, l...
null
pagetree.py
pagetree.py
py
3,891
python
en
code
null
code-starcoder2
83
[ { "api_name": "wiki_functions.summary_links", "line_number": 36, "usage_type": "call" }, { "api_name": "wiki_functions.key_links", "line_number": 46, "usage_type": "call" }, { "api_name": "collections.OrderedDict.fromkeys", "line_number": 98, "usage_type": "call" }, {...
242850596
# -*- coding: utf-8 -*- """ Created on Tue Jul 21 09:54:37 2020 @author: diada """ import cv2 import numpy as np import time from matplotlib import pyplot as plt cap = cv2.VideoCapture('C:/Users/diada/Downloads/blink.avi') #fourcc = cv2.VideoWriter_fourcc(*'XVID') #out = cv2.VideoWriter('C:/Users/diada...
null
try4.py
try4.py
py
2,520
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.VideoCapture", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_FRAME_COUNT", "line_number": 19, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.COLOR...
157380877
import json import os import sys import trueskill from trueskill import Rating,rate_1vs1 import operator env = trueskill.TrueSkill()#sigma=25/3)#draw_probability=0) class Player: def __init__(self,name): global env self.name = str(name) self.rating = env.Rating() self.oldrating = env.expose(self.rating) #us...
null
tiotochallonge/playerparse.py
playerparse.py
py
7,342
python
en
code
null
code-starcoder2
83
[ { "api_name": "trueskill.TrueSkill", "line_number": 8, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 47, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 60, "usage_type": "attribute" }, { "api_name": "os.listdir", ...
57410713
import requests import re import time # https://exhentai.org/api.php # {"method": "gdata", "gidlist": [[1438102,"7450614e10"]], "namespace": 1} s = requests.session() def login(username, password): post_data = { 'referer' : 'https://forums.e-hentai.org/index.php', 'UserName' : username, 'P...
null
ex/dev.py
dev.py
py
2,449
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.session", "line_number": 7, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 22, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 27, "usage_type": "call" }, { "api_name": "re.findall", "line_number":...
317698821
import fileinput import sys import itertools import re import math import collections import operator #./run < testcases/or.arff.in visited = [] class Node(object): def __init__(self, name, states): self.entropy = 0 self.gain = 0 self.name = name self.states = states self.t...
null
id3algo.py
id3algo.py
py
6,115
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.log", "line_number": 36, "usage_type": "call" }, { "api_name": "math.log", "line_number": 62, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 81, "usage_type": "attribute" }, { "api_name": "re.search", "line_number": 96, ...
610068663
import pickle from flask import Flask, render_template, request app = Flask(__name__) loadedModel = pickle.load(open('KNN Model.pkl', 'rb')) #WWW.google.co.in/prediction #Routes @app.route('/') def home(): return render_template('cancer.html') @app.route('/prediction',methods=['POST']) def predict...
null
app.py
app.py
py
933
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.form", ...
125007580
import re import logging from decimal import Decimal from ipaddress import ip_network, IPv4Network, IPv6Network from typing import List, Tuple, Optional, Union, Any from privex.helpers import is_true, empty from privex.pyrewall.RuleBuilder import RuleBuilder from privex.pyrewall.exceptions import RuleSyntaxError, Inval...
null
privex/pyrewall/RuleParser.py
RuleParser.py
py
15,391
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 16, "usage_type": "call" }, { "api_name": "re.compile", "line_number...
623634914
from fastapi import APIRouter, status, Depends, HTTPException from typing import List from sqlalchemy.orm import Session from src.schemas.schemas import Produto, ProdutoSimples, Usuario from src.infra.sqlalchemy.config.database import get_db from src.infra.sqlalchemy.repositorios.repositorio_produto \ import Reposi...
null
src/routers/rotas_produtos.py
rotas_produtos.py
py
2,054
python
en
code
null
code-starcoder2
83
[ { "api_name": "fastapi.APIRouter", "line_number": 10, "usage_type": "call" }, { "api_name": "src.schemas.schemas.Produto", "line_number": 17, "usage_type": "name" }, { "api_name": "src.schemas.schemas.Usuario", "line_number": 18, "usage_type": "name" }, { "api_nam...
55029410
import json import logging from orm.common.orm_common.utils import api_error_utils as err_utils from orm.common.orm_common.utils import utils from orm.services.region_manager.rms.services import error_base from orm.services.region_manager.rms.services import services as RegionService from orm.services.region_manager.r...
null
orm/services/region_manager/rms/controllers/v2/orm/resources/metadata.py
metadata.py
py
7,597
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "wsme.types.DynamicBase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "wsme.types", "line_number": 18, "usage_type": "name" }, { "api_name": "wsme.wsattr"...
299010236
from logger import log from utility import * from section_end import section_end from dispatcher import dispatcher from train import train from simtime import simtime from symbols import * import random import constants import re import traceback STATUS_INTERVAL = 10 # section states class section(object) : """...
null
section.py
section.py
py
18,979
python
en
code
null
code-starcoder2
83
[ { "api_name": "constants.default_max_speed", "line_number": 30, "usage_type": "attribute" }, { "api_name": "constants.section_through_prob", "line_number": 39, "usage_type": "attribute" }, { "api_name": "section_end.section_end", "line_number": 49, "usage_type": "call" ...
426366941
def preorderTraversal(self, root: TreeNode) -> List[int]: res = [] # def recursion(root): # if not root: # return # res.append(root.val) # recursion(root.left) # recursion(root.right) # return # recursion(root) # return res """ 迭代法: 使用 s...
null
Week_02/6 二叉树的前序遍历.py
6 二叉树的前序遍历.py
py
741
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.deque", "line_number": 20, "usage_type": "call" } ]