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
524547908
# 《机器学习实战》Logistic学习 """ 为什么用梯度上升?? 什么需要求最大值?? 目标函数?? """ # -*- coding: utf-8 -*- from numpy import * import matplotlib.pyplot as plt # from math import exp def loadDataSet(): """ testSet.txt 下载自https://blog.csdn.net/niutianzhuang/article/details/79781353 """ dataMat = [] labelMat = [] wi...
null
src/logistic_study.py
logistic_study.py
py
4,967
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 121, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 121, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 130, "usage_type": "call" }, { "api_name":...
117514910
import tensorflow as tf from Unet3D.Adaptive import train_isensee2017_EWC as train_isensee2017 import gpustat import time import os import argparse import numpy as np import pdb from tensorflow.python.client import device_lib # def get_free_gpus(num, except_gpu=None): # gpu_list = gpustat.GPUStatCollection.new_qu...
null
Parsing.py
Parsing.py
py
8,658
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.python.client.device_lib.list_local_devices", "line_number": 29, "usage_type": "call" }, { "api_name": "tensorflow.python.client.device_lib", "line_number": 29, "usage_type": "name" }, { "api_name": "Unet3D.Adaptive.train_isensee2017_EWC.config.update", ...
320102304
import json import os class Account: filepath = "data.json" def __init__(self, username): self.username = username self.pin = None self.balance = 0.0 self.data = {} self.load() def load(self): try: with open(self.filepath, 'r') as json_file:...
null
terminalTeller2/account.py
account.py
py
1,483
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 21, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 35, "usage_type": "call" } ]
243525772
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator 2.3.33.0 # ...
null
venv/Lib/site-packages/azureml/_restclient/models/dataset_lineage.py
dataset_lineage.py
py
1,450
python
en
code
null
code-starcoder2
66
[ { "api_name": "msrest.serialization.Model", "line_number": 15, "usage_type": "name" } ]
627793087
import pygame from jingling import * class PlaneGame(object): def __init__(self): print('初始化窗口') # 1. 创建游戏的窗口 self.screen = pygame.display.set_mode(SCREEN_RECT.size) # 2. 创建游戏的时钟 self.clock = pygame.time.Clock() # 3. 调用私有方法,精灵和精灵组的创建 self.__create_sprites() pygame.time.set_timer(CREATE_ENEMY_EVENT,1000...
null
08day/zhulei.py
zhulei.py
py
1,653
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.display.set_mode", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.time.Clock", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.tim...
581976321
from django.conf.urls import url from . import views app_name = 'emerald' urlpatterns = [ url(r"^$", views.index, name="index"), url(r"^(?P<foo_id>[0-9]+)/$", views.foobar, name="foobar"), ]
null
emerald/urls.py
urls.py
py
203
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" } ]
356281253
import json import urllib.request import re from Current_openweather_features import Current_openweather_features def lect_infos(fich): lect=open(fich,'r') datas=lect.readlines() api_key=re.split('=',re.split('\n',datas[0])[0])[1] lang=re.split('=',re.split('\n',datas[1])[0])[1] units=re.split('=',re....
null
openweather_tests/citydefzip_examples.py
citydefzip_examples.py
py
720
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.split", "line_number": 10, "usage_type": "call" }, { "api_name": "re.split", "line_number": 11, "usage_type": "call" }, { "api_name": "re.split", "line_number": 12, "usage_type": "call" }, { "api_name": "Current_openweather_features.Current_openw...
35260093
from django.shortcuts import render, get_object_or_404 from .models import Category, Product, CarouselImages, Notes from django.db.models import Q import re from cart.forms import CartAddProductForm def index(request): first_carousel_image = CarouselImages.objects.all()[0] carousel_images = CarouselImages.obje...
null
shop/views.py
views.py
py
1,910
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.CarouselImages.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.CarouselImages.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.CarouselImages", "line_number": 8, "usage_type": "name" }, ...
278145691
from django.shortcuts import render from django.views.generic import TemplateView from django.http import HttpResponseRedirect import pandas as pd from datetime import datetime from django.utils import timezone from .models import Submission,Submission_files from online_judge.settings import * from django.core.files.st...
null
online_judge/practice/utils.py
utils.py
py
15,038
python
en
code
null
code-starcoder2
66
[ { "api_name": "subprocess.call", "line_number": 54, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 56, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 58, "usage_type": "call" }, { "api_name": "os.path.exists", ...
318459058
import os import platform from pathlib import Path __version__ = "0.1.0" try: CLIENT_ID = os.environ["PLAID_CLIENT_ID"] SECRET = os.environ["PLAID_SECRET"] PUBLIC_KEY = os.environ["PLAID_PUBLIC_KEY"] ENV = os.environ["PLAID_ENV"] CHASE_TOKEN = os.environ["CHASE_ACCESS_TOKEN"] except KeyError: ...
null
plaid_lukepafford/__init__.py
__init__.py
py
760
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ", "line_...
503969933
from datetime import datetime from flask import request from flask_jwt_extended import get_jwt_identity, create_access_token from sqlalchemy import or_, and_ from project.server import app from project.server.controllers.v1 import errors from project.server.helpers.auth import send_confirmation_email, get_auth_token ...
null
g/docs/source/project/server/handlers/database/users.py
users.py
py
8,408
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.request.get_json", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 20, "usage_type": "name" }, { "api_name": "project.server.models.auth_user.User.query.filter", "line_number": 23, "usage_type": "call" }, {...
604979962
import asyncio import json import pytest import vcr from jupyterlab_thredds.crawler import TDSCrawler @pytest.fixture def expected_crawl_result(): with open('tests/fixtures/crawler.expected.json') as f: expected_datasets = json.load(f) return expected_datasets @pytest.mark.asyncio @vcr.use_cas...
null
tests/test_crawler.py
test_crawler.py
py
682
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 10, "usage_type": "attribute" }, { "api_name": "jupyterlab_thredds.crawler.TDSCrawler", "line_number": 21, "usage_type": "call" }, { "api_name": "a...
501772275
from django.shortcuts import render, redirect, HttpResponse from django.contrib import messages from .models import * # Create your views here. # the index function is called when root is visited def index(request): context = { 'users' : User.objects.all().values() } return render(request, 'first_app/index....
null
main/apps/first_app/views.py
views.py
py
1,943
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 16, "usage_type": "call" }, { "api_name": "django.contrib.messages.error", "line_number": 23, "usage_type": "call" }, { "api...
431875297
from flask import Flask, render_template from config import Configuration from flask_sqlalchemy import SQLAlchemy from flask import request, url_for, redirect, jsonify from wtforms import Form, StringField, TextAreaField, DateTimeField, BooleanField, IntegerField app = Flask(__name__) app.config.from_object(Configurat...
null
app.py
app.py
py
2,975
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "config.Configuration", "line_number": 8, "usage_type": "argument" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 9, "usage_type": "call" }, { "api_name": "wtforms...
507753126
# Run: # MISFIT_PREP_CONFIG="/Users/rosa/VERCE/dispy/dispel4py/test/seismo/misfit/processing.json" python -m dispel4py.new.processor simple dispel4py.test.seismo.misfit.create_misfit_prep -f /Users/rosa/VERCE/dispy/dispel4py/test/seismo/misfit/misfit_input.jsn # # Expects an environment variable MISFIT_PREP_CONFIG with...
null
processing_elements/Download_Specfem3d_Misfit_RA/create_misfit_prep_prov.py
create_misfit_prep_prov.py
py
9,189
python
en
code
null
code-starcoder2
66
[ { "api_name": "dispel4py.core.GenericPE", "line_number": 19, "usage_type": "name" }, { "api_name": "dispel4py.core.GenericPE.__init__", "line_number": 21, "usage_type": "call" }, { "api_name": "dispel4py.core.GenericPE", "line_number": 21, "usage_type": "name" }, { ...
444899432
import numpy as np import matplotlib.pyplot as plt import math def make_sample_traj(NUM, dt=0.01, a=30.): """ make sample trajectory Parameters ------------ NUM : int dt : float a : float Returns ---------- traj_xs : list traj_ys : list """ DELAY = 2. traj_xs = ...
null
mpc/extend/traj_func.py
traj_func.py
py
529
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.sin", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 27, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 27, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.s...
424466523
from typing import List class Solution: def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]: candidates.sort() self.res = [] self.path = [] def backtracking(ind): sumup = sum(self.path) if sumup == target: self.r...
null
Python/q40.py
q40.py
py
978
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
648897497
import numpy as np from itertools import permutations f = open('day9_input.txt') text = f.readlines() f.close() dist = np.zeros((8,8)) perms = permutations(list(range(8)), 8) row = 0 col = 0 for line in text: col += 1 if col == 8: row += 1 col = row + 1 line = line.strip().split(' = ') ...
null
2015/day9-2.py
day9-2.py
py
569
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "itertools.permutations", "line_number": 11, "usage_type": "call" } ]
138578047
import requests import pandas as pd cities = ['서울', '부산', '대구', '인천', '광주', '대전', '울산','경기', '강원', '충북', '충남', '전북', '전남', '경북', '경남', '제주', '세종'] serviceKey = 'M1iN3AHXsY2arykGcomyFyS16TTG5V%2Ftwy%2B1pTToDLK8ottKutqdpbla7Fna9tjr4xMe89FHcSeCzJ4ixfxqFw%3D%3D' endpoint = 'http://openapi.airkorea.or.kr/openapi/services/r...
null
my_app/services/openair_api.py
openair_api.py
py
827
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" } ]
292403147
# -*- coding: utf-8 -*- """ tests.unit.test_database ------------------------ Database Tests :copyright: (c) 2020 by John te Bokkel :license: BSD, see LICENSE for more details """ import pytest import datetime from sqlalchemy import func from log_it.extensions import db from log_it.user.model i...
null
tests/unit/test_database.py
test_database.py
py
2,662
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytest.fixture", "line_number": 31, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 48, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 48, "usage_type": "attribute" }, { "api_name": "log_it.log.mo...
169848977
import json import os.path import pickle import re import toml _ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) _INPUT_FILE = os.path.join(_ROOT, 'resources', 'versification', 'versification.toml') _OUTPUT_FILE = os.path.join(_ROOT, 'resources', 'versification', 'versification.pickle') def run()...
null
scripts/06_versification.py
06_versification.py
py
2,648
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 8, "usage_type": "name" }, { "api_name": "os.path.path.realpath", ...
117200679
""" Code to Train a Tensorflow Classifier for mountain bikes and road bikes Author: Hariharan Ramshankar """ import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import argparse import os import glob import cv2 #from tensorflow.python.framework import ops #from tensorflow.python.framework impo...
null
train.py
train.py
py
6,220
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "os.name", "line_number": 29, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 31, "usage_type": "call" }, { "api_name": "os.getcwd", "line_...
62756800
import vapoursynth as vs from typing import Any, Dict, Optional import vsutil import lvsfunc core = vs.core def nnedi3_rpow2_placebo(clip, rfactor=2, width=None, height=None, correct_shift=True, kernel="spline36", nsize=0, nns=3, qual=None, etype=None, pscrn=None, opt=True, int16_p...
null
Dorohedoro.2020/S01/Extra/dorohedoro.py
dorohedoro.py
py
9,189
python
en
code
null
code-starcoder2
66
[ { "api_name": "vapoursynth.core", "line_number": 7, "usage_type": "attribute" }, { "api_name": "vapoursynth.VideoNode", "line_number": 116, "usage_type": "attribute" }, { "api_name": "lvsfunc.kernels.Bilinear", "line_number": 117, "usage_type": "call" }, { "api_na...
518525943
print(__doc__) # Author: Peter Prettenhofer <peter.prettenhofer@gmail.com> # # License: BSD 3 clause import numpy as np import matplotlib.pyplot as plt import csv import pdb from sklearn import svm from sklearn import datasets from sklearn.utils import shuffle from sklearn.metrics import mean_squared_error from fil...
null
Assignment 1/cs7641-master/supervised/svm/svm_digits.py
svm_digits.py
py
1,867
python
en
code
null
code-starcoder2
66
[ { "api_name": "filehelper.Images", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.utils.shuffle", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.uint16", "line_number": 25, "usage_type": "attribute" }, { "api_name": "numpy.uint1...
552544119
# -*- coding: utf-8 -*- from datetime import timedelta from uuid import uuid4 from pyramid.security import Allow from schematics.exceptions import ValidationError from schematics.transforms import blacklist, whitelist from schematics.types import StringType, BaseType, EmailType, BooleanType, MD5Type from schematics.ty...
null
src/openprocurement/framework/electroniccatalogue/models.py
models.py
py
11,466
python
en
code
null
code-starcoder2
66
[ { "api_name": "openprocurement.api.models.Classification", "line_number": 43, "usage_type": "name" }, { "api_name": "schematics.types.StringType", "line_number": 44, "usage_type": "call" }, { "api_name": "schematics.types.StringType", "line_number": 45, "usage_type": "cal...
48499547
# Activate the license using serial number - used for serial license testing import subprocess import config import render_test def activate_license(serial_num): cmd = config.ConfigParams.license_path + ' --activate ' + serial_num print(cmd) ret_val = subprocess.call(cmd) render_test._run_render_test...
null
activate_license.py
activate_license.py
py
694
python
en
code
null
code-starcoder2
66
[ { "api_name": "config.ConfigParams", "line_number": 9, "usage_type": "attribute" }, { "api_name": "subprocess.call", "line_number": 11, "usage_type": "call" }, { "api_name": "render_test._run_render_test", "line_number": 12, "usage_type": "call" }, { "api_name": "...
404564358
import requests,json,random class YunPian(object): def __init__(self,api_key): self.api_key = api_key self.signle_send_url = 'https://sms.yunpian.com/v2/sms/single_send.json' def send_code(self,code,mobile,send_type): parmas = { "apikey": self.api_key, "mobile":...
null
signUppObjects/utils/send_code.py
send_code.py
py
1,102
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 21, "usage_type": "call" }, { "api_name": "random.sample", "line_numb...
278177590
import json import config import os data = { "regionMapping": {} } def createRegionMapping(newLayerName, description, shortName, nameOrCode): return { "layerName": newLayerName, "description": description, "server": f"http://localhost:8000/{newLayerName}/{{z}}/{{x}}/{{y}}.pbf", ...
null
createRegionMapping.py
createRegionMapping.py
py
2,500
python
en
code
null
code-starcoder2
66
[ { "api_name": "config.desired_outputs", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "config.countrie...
572165468
# -*- coding: utf-8 -*- # @Author: lshuns # @Date: 2020-05-01 21:13:39 # @Last Modified by: lshuns # @Last Modified time: 2020-05-12 09:41:00 ### Levin method for solving highly oscillatory one-dimensional integral ###### Target form: int_0^Infinity dx x J0(rx) exp(i G(x)) ###### First do variable change (x=x/(1-...
null
.ipynb_checkpoints/Levin_final-checkpoint.py
Levin_final-checkpoint.py
py
18,599
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number":...
361997238
from bs4 import BeautifulSoup from urllib.request import urlopen import urllib.error from translator import Translators as T from supp_funcs import today import json from conf.marathonSelectorFuncs import FUNCS_M as selectors class Fetcher_Marathon_Football: class HrefsFootball: def __init__(self, url):...
null
fetcherMarathon.py
fetcherMarathon.py
py
3,764
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib.request.urlopen", "line_number": 15, "usage_type": "call" }, { "api_name": "urllib.request.error", "line_number": 16, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 16, "usage_type": "name" }, { "api_name": "urlli...
205568772
""" test_txn.py implements test case for transactions """ import grpc import json import logging import os import random import time import unittest from pydgraph import client import test_acct_upsert as integ class TestClientTxns(integ.DgraphClientIntegrationTestCase): """Transactions test cases.""" def s...
null
tests/test_txn.py
test_txn.py
py
11,906
python
en
code
null
code-starcoder2
66
[ { "api_name": "test_acct_upsert.DgraphClientIntegrationTestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 43, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 62, "usage_type": "call" }, { "api_n...
319984297
from django.shortcuts import render from django.shortcuts import render, get_object_or_404 from django.contrib import auth from django.contrib.auth.decorators import login_required # Create your views here. from django.http import HttpResponse, HttpResponseRedirect from vminfo.models import VCInfo, VMList from django....
null
tools/vminfo/views.py
views.py
py
2,553
python
en
code
null
code-starcoder2
66
[ { "api_name": "vminfo.models.VCInfo.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "vminfo.models.VCInfo.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "vminfo.models.VCInfo", "line_number": 14, "usage_type": "name" }, ...
75877027
""" Soft Actor-Critic Algorithms and Applications: https://arxiv.org/abs/1812.05905 Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor: https://arxiv.org/abs/1801.01290 """ import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from m...
null
mani_skill_learn/methods/mfrl/sac.py
sac.py
py
4,619
python
en
code
null
code-starcoder2
66
[ { "api_name": "mani_skill_learn.utils.torch.BaseAgent", "line_number": 20, "usage_type": "name" }, { "api_name": "mani_skill_learn.networks.build_model", "line_number": 41, "usage_type": "call" }, { "api_name": "mani_skill_learn.networks.build_model", "line_number": 42, "...
538376506
import logging from database import Database logging.basicConfig(level="DEBUG") logger = logging.getLogger(__name__) class EtlScript: def __init__(self): self.database_conn = Database("acme") self.header_file = "./headers.txt" self.data_file = "./data.csv" self.out_file = "./outp...
null
src/main.py
main.py
py
1,418
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "database.Database", "line_number": 11, "usage_type": "call" } ]
566408794
from kappa.dao.DAO import DAO from kappa.controllers.Controller import Controller from kappa.dao.ConnectionManager import ConnectionManager from kappa.models.ImageModel import ImageModel from kappa.dao.ImageDAO import ImageDAO import os import glob from PIL import Image import time class ImageController(Controller): ...
null
src/kappa/controllers/ImageController.py
ImageController.py
py
1,607
python
en
code
null
code-starcoder2
66
[ { "api_name": "kappa.controllers.Controller.Controller", "line_number": 11, "usage_type": "name" }, { "api_name": "kappa.dao.ImageDAO.ImageDAO", "line_number": 14, "usage_type": "call" }, { "api_name": "kappa.dao.ConnectionManager.ConnectionManager", "line_number": 30, "u...
549788689
# -*- coding: utf-8 -*- import scrapy, json from douyu.items import DouyuItem class DouyuImagesSpider(scrapy.Spider): name = 'douyu_images' allowed_domains = ['douyucdn.cn'] base_url = 'http://capi.douyucdn.cn/api/v1/getVerticalRoom?limit=20&offset=' offset = 0 start_urls = [base_url + str(offset)...
null
scrapy/day03/douyu/douyu/spiders/douyu_images.py
douyu_images.py
py
1,140
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.Spider", "line_number": 6, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "douyu.items.DouyuItem", "line_number": 18, "usage_type": "call" }, { "api_name": "scrapy.Request", ...
235069590
#!/usr+*/bin/env python389*- # -*- coding: utf-8 -*- """ Created on Sat Feb 2 15:23:22 2019 @author: austin """ import numpy as np from numpy import * from keras.preprocessing.image import ImageDataGenerator,img_to_array, load_img from PIL import Image import os #i hju78ikl.o/p=*-+l0' listing = os.listdir('/home/...
null
data augmentation.py
data augmentation.py
py
1,156
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.listdir", "line_number": 18, "usage_type": "call" }, { "api_name": "keras.preprocessing.image.ImageDataGenerator", "line_number": 22, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 31, "usage_type": "call" }, { "api_name":...
202661435
#!/usr/bin/env python # -*- coding:utf-8 -*- #----------------------------------------------------------------------------- # Purpose: Use basic frame. Note, in common, not directely use Frame, but use it derive. #----------------------------------------------------------------------------- import wx class App(wx.App...
null
use_basic_frame_46.py
use_basic_frame_46.py
py
608
python
en
code
null
code-starcoder2
66
[ { "api_name": "wx.App", "line_number": 9, "usage_type": "attribute" }, { "api_name": "wx.Frame", "line_number": 12, "usage_type": "call" } ]
478836887
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from crypto import (PrivateKey, PublicKey) from address import Address from script import * from transaction import Transaction from constants import Constants if __name__ == '__main__': import sys if sys.version_info < (3, 5): sys.exit("Error: Must...
null
multisig.py
multisig.py
py
4,643
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.version_info", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 15, "usage_type": "call" }, { "api_name": "crypto.PublicKey.from_prvkey", "line_number": 30, "usage_type": "call" }, { "api_name": "crypto.Pu...
107414656
import torch import torch.nn.functional as F import torchtext from torch.autograd import Variable import numpy as np from tqdm import tqdm def vis_display(vis, vis_windows, x_coord, train_l, MAP): if vis_windows is None: vis_windows = {} vis_windows['train_ce'] = vis.line(Y=torch.Tensor([float(2**...
null
HW3/utils/postprocess.py
postprocess.py
py
1,492
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.Tensor", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_numbe...
625278596
import numpy as np import numpy.matlib as npm from scipy.interpolate import interp1d def processTrajectory(trajectory , endTime=1.0, timeStep=0.001): trajectory = np.vstack([trajectory, npm.repmat(trajectory[-1,:],20,1)]) dt = timeStep time_stamps = np.arange(0, endTime, timeStep) trajData = np...
null
dcp_python/scripts/processTrajectory.py
processTrajectory.py
py
684
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.vstack", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.matlib.repmat", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.matlib", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.arange", "line_n...
136954259
import os import argparse import logging import matplotlib.pyplot as plt import pandas as pd import json import vcf from matplotlib import pyplot as plt import tensorflow as tf import numpy as np from time import time from skopt import gp_minimize from skopt.space import Real, Integer from skopt.utils import use_named...
null
svchannels/sandbox/python/nested_locso_cv_per_chrom.py
nested_locso_cv_per_chrom.py
py
21,164
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 27, "usage_type": "call" }, { "api_name": "os.pardir", "line_numbe...
391582792
import nose from lazyflow.graph import Graph, Operator, InputSlot, OutputSlot from lazyflow import stype from lazyflow import operators import numpy class OpS(Operator): name = "OpA" Output1 = OutputSlot() Output2 = OutputSlot() Output3 = OutputSlot() Output4 = OutputSlot(level = 1) def __ini...
null
tests/testSlotCallbacks.py
testSlotCallbacks.py
py
7,432
python
en
code
null
code-starcoder2
66
[ { "api_name": "lazyflow.graph.Operator", "line_number": 7, "usage_type": "name" }, { "api_name": "lazyflow.graph.OutputSlot", "line_number": 10, "usage_type": "call" }, { "api_name": "lazyflow.graph.OutputSlot", "line_number": 11, "usage_type": "call" }, { "api_na...
220430989
from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten, Activation, BatchNormalization from keras.layers.convolutional import Conv2D, MaxPooling2D from keras.utils import np_utils from tensorflow.python.keras._impl.keras.datasets.cifar10 import load_data batch_sz = 32 num_classes = 10 epo...
null
TensorFlow/pt_2/cnn/cnn_cifar10_keras.py
cnn_cifar10_keras.py
py
2,781
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.python.keras._impl.keras.datasets.cifar10.load_data", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.utils.np_utils.to_categorical", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.utils.np_utils", "line_number": 20, ...
295952298
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 import math from moviepy.editor import VideoFileClip from IPython.display import HTML from shapely.geometry import Point from shapely.geometry.polygon import Polygon # not used till now def le...
null
project1.py
project1.py
py
13,295
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.cvtColor", "line_number": 44, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2GRAY", "line_number": 44, "usage_type": "attribute" }, { "api_name": "cv2.Canny", "line_number": 51, "usage_type": "call" }, { "api_name": "cv2.GaussianBlur", ...
311161395
from __future__ import print_function, division, absolute_import import ray from .parallel import AutoBatchingMixin, ParallelBackendBase class RayBackend(ParallelBackendBase, AutoBatchingMixin): """ Ray backend uses ray, a system for scalable distributed computing. more info are available here: htt...
null
joblib/_ray.py
_ray.py
py
2,315
python
en
code
null
code-starcoder2
66
[ { "api_name": "parallel.ParallelBackendBase", "line_number": 5, "usage_type": "name" }, { "api_name": "parallel.AutoBatchingMixin", "line_number": 5, "usage_type": "name" }, { "api_name": "ray.init", "line_number": 19, "usage_type": "call" }, { "api_name": "ray.re...
459339543
# -*- encoding: utf-8 -*- from myadmin.admin import admin_site from django.contrib import admin from .models import * # Register your models here. class CallbackAdmin(admin.ModelAdmin): list_per_page = 10 list_display = ('callback_name', 'callback_phone','status', 'called_at',) filter_fields = ('callback_n...
null
home/admin.py
admin.py
py
1,596
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 14, "usage_type": "attribute" ...
134411404
from collections import deque from typing import List, Deque # Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: # solution 1 def levelOrder(self, root: TreeNode) -> List[List[int]]: a...
null
binary_tree/traversal/102_binary_tree_level_order_traversal.py
102_binary_tree_level_order_traversal.py
py
1,650
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Deque", "line_number": 19, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" }, { "api_name": "typing.List", "line_nu...
130789952
import torch def trim_episodes_trans(trajs, orig_trajs): """ Stops the episodes on the first episode the goal is found. """ if "ep_found_goal" not in trajs: return trajs done = trajs["done"].float() obs = trajs["obs"].float() next_obs = trajs["next_obs"].float() actions = trajs...
null
rlf/benchmarks/il/utils.py
utils.py
py
1,494
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.ones", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.stack", "line_number": 47, "usage_type": "call" }, { "api_name": "torch.stack", "line_number": 48, "usage_type": "call" }, { "api_name": "torch.stack", "line_number": 4...
32460427
from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F import torch.backends.cudnn as cudnn import torchvision.transforms as transforms import torchvision.datasets as dst from torch.utils.data import Dataset import argparse import os import time from util import Averag...
null
train_cinic.py
train_cinic.py
py
25,503
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_number": 50, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
496973388
# Default imports import scipy.stats as stats import pandas as pd df = pd.read_csv('data/house_pricing.csv') # Enter Code Here def t_statistic(data): # considering two tailed t-test and confidence interval given is 90% # as we are trying with null hypothesis of # "The mean of Living area of houses in Old...
null
q03_t_test/build.py
build.py
py
861
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "scipy.stats.ttest_1samp", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 19, "usage_type": "name" } ]
242857926
from datetime import datetime import logging #logger.propagate = False, if logging disabled logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') # If one wants to stop console output, try: # logging.disable(logging.DEBUG) # Sample Logging execution # logging.debug(...
null
Database/Reminder/reminder.py
reminder.py
py
3,890
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.debug", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.debug", ...
490088316
import pandas as pd import torch from torch.utils.data import Dataset, DataLoader, sampler import torch.nn as nn import numpy as np import itertools class Vocabulary(object): """Class to process text and extract vocabulary for mapping""" def __init__(self, tokens_dict={}, frequencies_dict={}): ...
null
Programs/16-pytorch-back-to-basics/NLPUtils/WordVectors.py
WordVectors.py
py
6,010
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "itertools.compress", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 79, "usage_type": "name" }, { "api_name": "itertools.cha...
410190590
import sys import datetime def getMaxLength(s, s1, s2): max_l = 0 for i in range(len(s1)): l1 = len(s1) - i for j in range(len(s2)): l2 = len(s2) - j k = 0 l = 0 while l < min(l1, l2): if s1[i + l] != s2[j + l]: ...
null
hackerrank/substringdiff.py
substringdiff.py
py
1,780
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 69, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 69, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 76, "usage_type": "call" }, { "api_name": "da...
167367079
from rest_framework import serializers from rest_framework.serializers import SerializerMethodField from api.models.work import Work from api.models.size import Size from api.models.color import Color from api.models.genre import Genre, SubGenre from api.models.user import UserDetail from api.models.favorite import Fa...
null
api/serializers/work.py
work.py
py
2,314
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 16, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 16, "usage_type": "name" }, { "api_name": "rest_framework.serializers.SerializerMethodField", "line_number": ...
123706639
import pytest, time def solution(A, K, L): total_trees = len(A) if K + L > total_trees: return -1 if K + L == total_trees: apples = [int(x) for x in A] sum = 0 for amount in apples: sum += amount return sum if K + L < total_trees: apples_a...
null
3_apple_trees.py
3_apple_trees.py
py
1,728
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 54, "usage_type": "call" }, { "api_name": "time.time", "line_number": 63, "usage_type": "call" }, { "api_name": "pytest.main", "line_number": 79, "usage_type": "call" } ]
218127086
__author__ = 'giulio' import pandas as pd import numpy as np import math from joblib import Parallel, delayed, cpu_count import sklearn import sklearn.cluster import os import random from tempfile import mkstemp from shutil import move from os import remove, close # TODO: separa brake e acceleration e...
null
data/external/repositories_2to3/147276/axa-drivers-telematics-analysis-master/utils.py
utils.py
py
9,068
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.linspace", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.linspace", "li...
610725872
from django.test import TestCase from scrapes import models from scrapes.managers import RRLChapterScraper from novels import models as novel_models import logging rrl_chapter = RRLChapterScraper() class ParseChapterTestCase(TestCase): fixtures = ["2018-10-17.json"] parser_id = int @classmethod def ...
null
src/scrapes/tests/test_chapter_parser.py
test_chapter_parser.py
py
2,914
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapes.managers.RRLChapterScraper", "line_number": 7, "usage_type": "call" }, { "api_name": "django.test.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "logging.disable", "line_number": 16, "usage_type": "call" }, { "api_name":...
264134071
import unittest import rdflib rdflib.plugin.register('sparql', rdflib.query.Processor, 'rdfextras.sparql.processor', 'Processor') rdflib.plugin.register('sparql', rdflib.query.Result, 'rdfextras.sparql.query', 'SPARQLQueryResult') class TestDescribe(unittest.TestCase): ...
null
test/test_sparql/test_describe.py
test_describe.py
py
1,410
python
en
code
null
code-starcoder2
66
[ { "api_name": "rdflib.plugin.register", "line_number": 5, "usage_type": "call" }, { "api_name": "rdflib.plugin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rdflib.query", "line_number": 5, "usage_type": "attribute" }, { "api_name": "rdflib.plugi...
255031144
from django.conf.urls import url from blogapp import views from django.contrib.auth import views as auth_views # Down below are all the routes for the project app_name = 'blog' urlpatterns = [ url(r'^$', views.index, name='index'), url(r"create/", views.CreatePost, name="create_post"), # url(r"login/", aut...
null
blogapp/urls.py
urls.py
py
1,295
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "blogapp.views.index", "line_number": 8, "usage_type": "attribute" }, { "api_name": "blogapp.views", "line_number": 8, "usage_type": "name" }, { "api_name": "django.conf....
180686158
from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.floatlayout import FloatLayout from kivy.properties import ObjectProperty, ListProperty from kivy.clock import Clock from kivy.uix.popup import Popup from pi2ard.link import Link from kivy.factory import Factory from os.path import join, is...
null
Pi-lib/gui/main.py
main.py
py
8,397
python
en
code
null
code-starcoder2
66
[ { "api_name": "kivy.config.Config.set", "line_number": 16, "usage_type": "call" }, { "api_name": "kivy.config.Config", "line_number": 16, "usage_type": "name" }, { "api_name": "kivy.config.Config.set", "line_number": 17, "usage_type": "call" }, { "api_name": "kivy...
555247484
# coding=utf-8 import torch import math __all__ = ['to_edge_idx', 'tri_mask', 'tri_index', 'is_same', 'node_intersect', 'edge_filter', 'edge_select', 'is_nan', 'is_inf', 'is_panic'] def to_edge_idx(top_id, k=None): """ :param var: b, k, c, usually top_id :return: """ if top_id.dim()...
null
pt_pack/utils/ops.py
ops.py
py
5,035
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.arange", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.arange", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.arange", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.stack", "line_number...
534014889
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, DateTime, Enum from sqlalchemy.dialects.postgresql import * from sqlalchemy.orm import relationship, backref from sqlalchemy import create_engine from sqlalchemy import ForeignKey from geopy import geocoders from sql...
null
localshow/views/local_show_sql.py
local_show_sql.py
py
4,941
python
en
code
null
code-starcoder2
66
[ { "api_name": "geopy.geocoders.OpenMapQuest", "line_number": 14, "usage_type": "call" }, { "api_name": "geopy.geocoders", "line_number": 14, "usage_type": "name" }, { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 16, "usage_type": "call" }, ...
197729143
# sm, 21.01.2020 import requests import time import json headers = {'content-type': 'application/json'} clientUrl = "http://192.168.20.180:8080/" # trailing '/' is mandatory # send single color payload = {'color': 0x808080 } #payload = {'color': 0xFFFF00 } print("Data: " + json.dumps(payload)) r = requests.post(cl...
null
FLDCVisitManager/FLDCVisitManager.Backend/KRExamples/server_send_CP_LED_single.py
server_send_CP_LED_single.py
py
781
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dumps", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 15, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 1...
585661194
from flask import Blueprint, render_template, flash, redirect, session, url_for, request, g, jsonify, abort from flask.ext.login import login_user, logout_user, current_user, login_required from flask.ext.classy import FlaskView, route from flask.ext.wtf import Form from flask.ext.babel import lazy_gettext, gettext, re...
null
app/users/views.py
views.py
py
6,294
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.ext.classy.FlaskView", "line_number": 13, "usage_type": "name" }, { "api_name": "flask.ext.login.login_required", "line_number": 15, "usage_type": "name" }, { "api_name": "flask.request.args.get", "line_number": 19, "usage_type": "call" }, { "...
276463930
''' /*############################################################################# HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems. 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 Licen...
null
testing/regress/hpcc/regression/suite.py
suite.py
py
1,704
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isdir", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_number": 36, "usage_type": "attribute" }, { "api_name": "common.error.Error", "line_number": 37, "usage_type": "call" }, { "api_name": "os.listdir", "line_...
439009782
""" 621 task scheduler medium """ from typing import List class Solution: def leastInterval(self, tasks: List[str], n: int) -> int: frequencies = [0] * 26 for task in tasks: frequencies[ord(task)-ord("A")] += 1 frequencies.sort() f_max = frequencies.pop() - 1 ...
null
Q621.py
Q621.py
py
627
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 12, "usage_type": "name" } ]
647303244
import numpy as np import argparse import imutils import time from cv2 import cv2 import os # parse arguments ap = argparse.ArgumentParser() ap.add_argument("-i", "--input", required=True, help="path to input video") ap.add_argument("-o", "--output", required=True, help="path to output video") ap.add_argument("-y", "-...
null
yolo-video.py
yolo-video.py
py
4,122
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.sep.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.random.see...
46407953
import numpy as np import pandas as pd import matplotlib.pyplot as plt import skimage.io as io import skimage.transform as trans import random as r import SimpleITK as sitk import os img_size = 120 #original img size is 240*240 smooth = 1 import glob def create_data(src, mask, label=False, resize=(155,img_size...
null
examples/domain_adaptation/segmentation/data/BRATS2015.py
BRATS2015.py
py
3,922
python
en
code
null
code-starcoder2
66
[ { "api_name": "glob.glob", "line_number": 16, "usage_type": "call" }, { "api_name": "skimage.io.imread", "line_number": 23, "usage_type": "call" }, { "api_name": "skimage.io", "line_number": 23, "usage_type": "name" }, { "api_name": "os.path.exists", "line_num...
440447677
from lxml import etree import gzip from pip._vendor import requests import re import io def get_links(url, gz): xmlDict = {} headers = {'User-Agent': 'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)'} r = requests.get(url, headers=headers) if gz: rr = gzip.GzipFile(fileobj=io....
null
scraper.py
scraper.py
py
765
python
en
code
null
code-starcoder2
66
[ { "api_name": "pip._vendor.requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "pip._vendor.requests", "line_number": 11, "usage_type": "name" }, { "api_name": "gzip.GzipFile", "line_number": 13, "usage_type": "call" }, { "api_name": "io.BytesI...
441956362
import time from flask import Flask, render_template, request, jsonify app = Flask(__name__) @app.route("/") def index(): return render_template("index.html") @app.route('/posts',methods=["POST"]) def posts(): start = int(request.form.get('start') or 0) end = int(request.form.get('end')...
null
21DynamicElementcreateONscrol/app.py
app.py
py
526
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.form.get", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request...
317600758
import requests import csv from bs4 import BeautifulSoup def main(): # Purdue Police Department 'Daily Crime Log' page = requests.get('https://www.purdue.edu/ehps/police/assistance/stats/statsdaily.html') soup = BeautifulSoup(page.text, 'html.parser') soup_text = soup.find_all("p") raw_li = [] ...
null
auto_import.py
auto_import.py
py
4,201
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 22, "usage_type": "call" } ]
463437525
import json import logging import uuid import time import math import os import requests logger = logging.getLogger(__name__) if os.environ.get("LOG_LEVEL"): logger.setLevel(os.environ["LOG_LEVEL"]) else: logger.setLevel("INFO") def ladder_export(ladder_name): logger.debug(f"Started ladder_export funct...
null
src/poe_ladder_exporter/ladder.py
ladder.py
py
2,897
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ", "li...
56477194
from preprocessing import create_dataset from models import * import torch import utils #create dataset train_packs,train_picks,test_packs,test_picks = create_dataset() #initialize model with 249 cards and 15 archetypes rank_model = RankingNet(249,15) optimizer = torch.optim.Adam(rank_model.parameters(), lr=0.1) #cros...
null
create_model.py
create_model.py
py
2,162
python
en
code
null
code-starcoder2
66
[ { "api_name": "preprocessing.create_dataset", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.optim", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.n...
190069764
from selenium import webdriver import time from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait from influxdb import InfluxDBClient import json import datetime class ManualTesting(): def live_testing...
null
performance_ios.py
performance_ios.py
py
2,416
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 21, "usage_type": "call" }, { "api_name": "selenium.webd...
332145191
def MethodeRectangles(a,b,f,n): S=0 h=(b-a)/n for i in range (0,n): S=S+h*f(a+i*h) return S def MethodeTrapezes(a,b,f,n): S=0 h=(b-a)/(n) for i in range (0,n): S=S+(h*(f(a+i*h)+f(a+(i+1)*h)))/2 return(S) def F(x): y=4/(1+x**2) return (y) ...
null
python_prepa/TP_methode_des_rectangles_er_des_trapezes.py
TP_methode_des_rectangles_er_des_trapezes.py
py
1,214
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.sqrt", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.arcsinh", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.arcsinh", "line_number": 34, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "...
241206130
import urllib.request import json import time left_bottom=[118.609648,31.953192] right_top=[119.011679,32.156586] part_n=5 f=open('TrafficStatus_XY2.txt','a',encoding='utf-8') f2=open('TrafficStatus2.txt','a',encoding='utf-8') count=0 num=0 url0='http://restapi.amap.com/v3/traffic/status/rectangle?level=2&rectangle=' x...
null
交通拥堵与公交分析展示系统/爬虫/交通态势2.py
交通态势2.py
py
2,428
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib.request.request.urlopen", "line_number": 26, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 26, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 26, "usage_type": "name" }, { "api_nam...
9135926
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: C:\Users\sboon\AppData\Local\Temp\pip-install-ptdbtr91\quarchpy\quarchpy\connection_specific\serial\urlhandler\protocol_hwgrep.py # Compiled at: 2020-03-25 05:10:...
null
pycfiles/quarchpy-2.0.14-py2.py3-none-any/protocol_hwgrep.cpython-37.py
protocol_hwgrep.cpython-37.py
py
2,330
python
en
code
null
code-starcoder2
66
[ { "api_name": "serial.Serial", "line_number": 14, "usage_type": "attribute" }, { "api_name": "serial.Serial.port.__set__", "line_number": 21, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 21, "usage_type": "attribute" }, { "api_name": "seri...
546770221
# -*- encoding: utf8 -*- import MySQLdb import json import os import logging format_string = '%(asctime)s %(filename)s[line:%(lineno)d] \ %(levelname)s %(message)s' logging.basicConfig(level=logging.DEBUG, format=format_string, datefmt='%a, %d %b %Y %H:%M:%S',...
null
migrate_template.py
migrate_template.py
py
2,480
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 11, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.debug", ...
245726399
from datetime import datetime from bs4 import BeautifulSoup import requests import pandas as pd from .models import Brief_Stock from .helpers import Scraper import yfinance as yf # Get ASX300 information and save to database to be used in the stock screener class screenerHelper(): def __init__(self): ...
null
api/screener_helper.py
screener_helper.py
py
8,254
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 24, "usage_type": "call" }, { "api_name": "helpers.Scraper", "line_number": 39, "usage_type": "call" }, { "api_name": "yfinance.Ticker", ...
250726629
''' Created on 02.02.2015 @author: kmuesel # -*- coding: utf-8 -*- ''' import csv import spider import datetime import os.path import pprint import urllib path = '../../SpiderData/Spider/Data' def storeItems(items): assert(len(items)>0) items.reverse() writer = csv.writer(open(path+"/items3.csv","a+")) ...
null
Longterm/persistence.py
persistence.py
py
3,506
python
en
code
null
code-starcoder2
66
[ { "api_name": "csv.writer", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.path.exists", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path", "line_...
512054180
#!/usr/bin/python3 #=============================================================== # # IBeaconAdvertiser # # Copyright (c) 2020-2021, E-Motion, Inc. # # This SOFTWARE PRODUCT is provided "as-is". PROVIDER makes no # representations or warranties of any kind concerning the suitability # and safety of the SOFTWARE...
null
lib/iBeaconAdvertiser.py
iBeaconAdvertiser.py
py
10,504
python
en
code
null
code-starcoder2
66
[ { "api_name": "dbus.exceptions", "line_number": 39, "usage_type": "attribute" }, { "api_name": "dbus.exceptions", "line_number": 46, "usage_type": "attribute" }, { "api_name": "dbus.exceptions", "line_number": 53, "usage_type": "attribute" }, { "api_name": "dbus.e...
530344464
class Quicksort_2(object): def __init__(self): self.mylist = [] self.size = 0 def add(self, value): self.mylist.append(value) self.size += 1 def quick_sort(self): if len(self.mylist) > 1: x = self.mylist[0] self.left = Quicksort_2() ...
null
Quicksort.py
Quicksort.py
py
2,620
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.randint", "line_number": 53, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 66, "usage_type": "call" }, { "api_name": "time.time", "line_number": 67, "usage_type": "call" }, { "api_name": "time.time", "line_number"...
404273411
import re from typing import List class Errors: BACKWARDS = "Possible backwards compatibility break" @staticmethod def no_yml_file(file_path): return "No yml files were found in {} directory.".format(file_path) @staticmethod def wrong_filename(filepath, file_type): return '{} is ...
null
demisto_sdk/common/constants.py
constants.py
py
28,960
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 369, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 377, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 383, "usage_type": "name" }, { "api_name": "typing.List", "line_number...
535490317
#!/usr/bin/env python # encoding: utf-8 from django.conf.urls import url from . import views from .dj_views import * urlpatterns = [ ################# 0.2 版本前面的连接 ############# url(r'^$', views.edit_index, name="edit_index"), url(r'^2$', views.edit2, name="edit2"), url(r'^show/$', views.show, name="s...
null
jtopot/urls.py
urls.py
py
3,053
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 13, "usage_type": "call" }, { "api_name": "django...
96364202
""" Construct the DQG conditions were D and Q antisymmetry are taken care of by """ import numpy as np from itertools import product def find_num_constraints(mapper, M, sz_adapt, s2_adapt): """ Find the number of constraints implied my the matrices in the mapper :param mapper: mapper object relating matr...
null
representability/fermions/constraints/antisymmeterized_spin_orbital.py
antisymmeterized_spin_orbital.py
py
15,126
python
en
code
null
code-starcoder2
66
[ { "api_name": "itertools.product", "line_number": 79, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 84, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 89, "usage_type": "call" }, { "api_name": "itertools.produ...
606880900
#!/usr/bin/python3 import numpy as np import cv2 from scipy import ndimage img = cv2.imread("counter.png"); gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) edges = cv2.Canny(gray,200,250,apertureSize = 3) lines = cv2.HoughLines(edges, 1, np.pi/180,140) def drawLines(lines): for i in range(len(lines)): rho = lines[i][...
null
imgProcess.py
imgProcess.py
py
4,242
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.Canny", "line_nu...
134190175
from selenium import webdriver from selenium.webdriver.chrome.options import Options option = Options() option.add_argument("--autoplay-policy=no-user-gesture-required") option.add_argument("--use-fake-ui-for-media-stream") option.add_argument("--incognito") # option.add_argument("--kiosk") option.add_experimental_op...
null
backend/browser.py
browser.py
py
511
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 5, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" } ]
67696220
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
null
word2vec_basic.py
word2vec_basic.py
py
15,352
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path", "line_number": 52, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 52, "usage_type": "call" }, { "api_name": "sys.argv", "line_nu...
193674878
#!/usr/bin/python # -*- coding: utf-8 -*- """ Main class This module contains the abstract base class :py:class:`Escpos`. :author: `Manuel F Martinez <manpaz@bashlinux.com>`_ and others :organization: Bashlinux and `python-escpos <https://github.com/python-escpos>`_ :copyright: Copyright (c) 2012-2017 Bashlinux and ...
null
src/escpos/escpos.py
escpos.py
py
31,739
python
en
code
null
code-starcoder2
66
[ { "api_name": "escpos.capabilities.get_profile", "line_number": 58, "usage_type": "call" }, { "api_name": "magicencode.MagicEncode", "line_number": 59, "usage_type": "call" }, { "api_name": "abc.abstractmethod", "line_number": 65, "usage_type": "name" }, { "api_na...
480587453
import re import io import sys import argparse import configparser class Section: def __init__(self, title, regex='', enabled=True, size=None, intro='', help='', weight=1, accept=(), reject=(), accept_extra=(), reject_extra=()): self.title = title self.regex = reg...
null
provas/grader.py
grader.py
py
5,450
python
en
code
null
code-starcoder2
66
[ { "api_name": "io.StringIO", "line_number": 25, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 54, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 87, "usage_type": "call" }, { "api_name": "sys.stdout", "li...
458822904
import scrapy from ..items import ZufangItem class GanjiSpider(scrapy.Spider): name = "zufang" start_urls = [ 'http://bj.ganji.com/fang1/chaoyang/' ] def parse(self, response): # print(response) zf = ZufangItem() title_list = response.css("dd.title a::text").extract() ...
null
zufang/zufang/spiders/ganji.py
ganji.py
py
732
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.Spider", "line_number": 4, "usage_type": "attribute" }, { "api_name": "items.ZufangItem", "line_number": 12, "usage_type": "call" } ]
174508915
from django.conf.urls import url from rest_app.views import ( CartViews, CartDeleteViews, CartDetailViews, CartUpdateViews, UserAuthView, UserRegisterView, UserUpdateView, ProductDetailView, VariationDetailView, PaycomView, CartHtmlViews, OrderCreateView, DeliveryAdd...
null
rest_app/urls.py
urls.py
py
1,597
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 21, "usage_type": "call" }, { "api_name": "rest_app.views.UserAuthView.as_view", "line_number": 21, "usage_type": "call" }, { "api_name": "rest_app.views.UserAuthView", "line_number": 21, "usage_type": "name" }, { ...
622576056
import time from tqdm import tqdm start = time.time() cnt = 0 sumation = 0 LIMIT = 1000000 print("-------------------------------") with tqdm() as pbar: while(cnt < LIMIT): sumation += cnt pbar.update(1) cnt += 1 elapsed_time = time.time() - start print("while_time:{0}".format(elapsed_ti...
null
others/loop_speed/loop_speed.py
loop_speed.py
py
560
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 4, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 11, "usage_type": "call" }, { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "time.time", "line_number": 20, "...
272263785
# -*-coding:utf-8-*- ################################# # # Copyright (c) 2018 # ################################# from __future__ import print_function import grpc import audio_streaming_pb2 import audio_streaming_pb2_grpc import header_manipulator_client_interceptor import base64 from conf import conf def generat...
null
audio-streaming-client-python/process/audio_streaming_client.py
audio_streaming_client.py
py
2,223
python
en
code
null
code-starcoder2
66
[ { "api_name": "audio_streaming_pb2.AudioFragmentRequest", "line_number": 26, "usage_type": "call" }, { "api_name": "audio_streaming_pb2.InitRequest", "line_number": 32, "usage_type": "call" }, { "api_name": "header_manipulator_client_interceptor.header_adder_interceptor", "li...
215908689
from django.contrib.auth import get_user_model from django.urls import reverse from django.test import TestCase from rest_framework import status from rest_framework.test import APIClient from core.models import Register from dictionary.serializers import RegisterSerializer REGISTER_URL = reverse('dictionary:regist...
null
app/dictionary/tests/test_register.py
test_register.py
py
3,073
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.reverse", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 17, "usage_type": "call" }, { "api_name": "core.models.Register.objects.create", "line_number": 22, "usage_type": "call" }, { "api_n...
60338650
import tkinter as tk from PIL import ImageTk, Image import mysql.connector import easygui try: # add your databse details. mydb = mysql.connector.connect( host="db4free.net", user="codebot", password="1601Mybday", database="codebot" ) cur = mydb.cursor() create_table...
null
attendance_manager.py
attendance_manager.py
py
8,375
python
en
code
null
code-starcoder2
66
[ { "api_name": "mysql.connector.connector.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 8, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 8, "usage_type": "name" }, { "api...
370231934
import json import threading import pymysql.cursors class SQLHandler(object): def __init__(self): self.insert_queue = threading.Semaphore() self.insert_conn = self.connection() def connection(self) -> pymysql.Connection: return pymysql.connect(host='localhost', ...
null
sqlhandler.py
sqlhandler.py
py
1,186
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Semaphore", "line_number": 9, "usage_type": "call" }, { "api_name": "pymysql.cursors.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 13, "usage_type": "name" }, { "api_name": "pymysql.cu...
540403542
import pygame class Button: def __init__(self, target, size, location, text, color, font_size, oncolor=(150,150,150)): self.basecolor=color self.oncolor = oncolor self.target = target self.size = size self.location = location self.text = text self.color = c...
null
base/Classes/Button.py
Button.py
py
1,387
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.draw.rect", "line_number": 30, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 30, "usage_type": "attribute" }, { "api_name": "pygame.Rect", "line_number": 30, "usage_type": "call" }, { "api_name": "pygame.draw.rect", ...
240229001
''' Preprocessor for Foliant documentation authoring tool. Provides Pandoc-style custom IDs for headings. ''' import re from pathlib import Path from foliant.preprocessors.base import BasePreprocessor class Preprocessor(BasePreprocessor): defaults = { 'stylesheet_path': Path('customids.css'), '...
null
foliant/preprocessors/customids.py
customids.py
py
3,459
python
en
code
null
code-starcoder2
66
[ { "api_name": "foliant.preprocessors.base.BasePreprocessor", "line_number": 13, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 28, "usage_type": "name" }, { "api_name": ...