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
437048758
from rest_framework import serializers from api.models import User, Party, Track __author__ = 'agusx1211' class AccountSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('user_name', 'spotify_id', 'email', 'last_token_spotify', 'account_type') class UserSerializer(seria...
null
api/serializers.py
serializers.py
py
1,732
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 7, "usage_type": "name" }, { "api_name": "api.models.User", "line_number": 9, "usage_type": "name" }, ...
67920998
# IR Temperature sensor import serial from sensor import Sensor class PulseOx(Sensor): """Pulse Oximeter Sensor.""" PORT='/dev/ttyUSB0' def __init__(self): Sensor.__init__(self) self.have_serial = False try: self.ser = serial.Serial(port=self.PORT, baudrate=115200, tim...
null
pulseox_sensor.py
pulseox_sensor.py
py
1,036
python
en
code
null
code-starcoder2
76
[ { "api_name": "sensor.Sensor", "line_number": 5, "usage_type": "name" }, { "api_name": "sensor.Sensor.__init__", "line_number": 11, "usage_type": "call" }, { "api_name": "sensor.Sensor", "line_number": 11, "usage_type": "name" }, { "api_name": "serial.Serial", ...
131754107
import numpy as np from numpy import linalg as nplg import matplotlib.pyplot as plt from KCollisions.KNewOrbit import * import timeit from numba import jit, int32,float64 import cProfile import re #Units Mstar = 1.2e30 au = 1.496e11 year = 3.154e+7 #Setup x='a' a1=2*au e1=0.99 s1=0 a2=2.1*au e2=0.993 s2=2 dfSize = 1 ...
null
Masters/Old/TimeEvolutionOld1.py
TimeEvolutionOld1.py
py
9,351
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 46, "usage_type": "name" }, { "api_name": "numpy.array", "line_nu...
73475634
import torch import torch.nn as nn class ResNetBlock(nn.Module): #定义残差模块 def __init__(self, input_channel, channel_in, stride = 1, downsampling = False, expansion = 4): #初始化downsampling表示是非该模块有下采样操作,expansion表示通道数膨胀多少倍 super(ResNetBlock, self).__init__() self.expansion = expansion ...
null
model.py
model.py
py
3,194
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 4, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 4, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_...
414936085
from pymongo import MongoClient from collections import defaultdict from time import time import json # MongoDB 접속 host = "localhost" port = "27017" client = MongoClient(host, int(port)) db = client['lol_matchdata'] collection = db['matchdata'] # 분석에 사용할 Feature col_names = ['kills', 'deaths', 'assists', 'champlevel'...
null
test.py
test.py
py
6,193
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" }, { "api_name": "time.time", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 58, "usage_type": "call" }, { "api_name": "json.dump", ...
21234272
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'myproject.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^pages', 'ContentAappBarraPunto.vi...
null
project/project/urls.py
urls.py
py
526
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 4, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 9, "usage_type": "call" }, { "api_name": "...
634831131
""" Creates a plugin that is composed of a new window with a text field (QLabel) The plugin hooks into updateMainWindowOnMouseMove and gets the X and Y position of the mouse in the current axes each time this method is run. This information is then displayed on the screen. """ from lasagna_plugin import lasagna_...
null
tutorialPlugins/infoBox_plugin.py
infoBox_plugin.py
py
2,755
python
en
code
null
code-starcoder2
76
[ { "api_name": "lasagna_plugin.lasagna_plugin", "line_number": 16, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QWidget", "line_number": 16, "usage_type": "attribute" }, { "api_name": "PyQt5.QtGui", "line_number": 16, "usage_type": "name" }, { "api_name": "in...
427670086
from uber_rides.session import Session from uber_rides.client import UberRidesClient from pprint import pprint import requests class Uber: def __init__(self, serverToken): self._serverToken = serverToken self._baseUrl = 'https://api.uber.com/v1.2' @property def baseUrl(self): retur...
null
Uber/Uber.py
Uber.py
py
1,335
python
en
code
null
code-starcoder2
76
[ { "api_name": "uber_rides.session.Session", "line_number": 16, "usage_type": "call" }, { "api_name": "uber_rides.client.UberRidesClient", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 32, "usage_type": "call" }, { "api_nam...
124127423
## Copyright 2015-2021 PyPSA Developers ## You can find the list of PyPSA Developers at ## https://pypsa.readthedocs.io/en/latest/developers.html ## PyPSA is released under the open source MIT License, see ## https://github.com/PyPSA/PyPSA/blob/master/LICENSE.txt """Functionality to help with georeferencing and cal...
null
pypsa/geo.py
geo.py
py
3,388
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.deg2rad", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.deg2rad", "li...
87889175
import sys import numpy as np import cv2 import math from net import * import torchvision.transforms as transforms import torch from torch import nn, optim from torch.backends import cudnn from torch.autograd import Variable from PIL import Image import os #寻找暗通道 def DarkChannel(im,sz): b,g,r = cv2.split(im) d...
null
pre_trans.py
pre_trans.py
py
3,628
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.split", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.min", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.getStructuringElement", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.MORPH_RECT", "lin...
354420936
from pathlib import Path from urllib import request from urllib.error import URLError import yaml import numpy as np import torch from torch.utils.data import DataLoader from torchvision.transforms import Compose, Resize, Normalize from scipy.interpolate import interp1d from data.data_utils import suggest_metadata fr...
null
model/videopose3d.py
videopose3d.py
py
9,720
python
en
code
null
code-starcoder2
76
[ { "api_name": "model.estimator_3d.Estimator3D", "line_number": 18, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 50, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 54, "usage_type": "call" }, { "api_name": "yaml.load", ...
140192967
import json import base64 import io import asyncio import websockets import cv2 import numpy as np class WebSocketsOpencvServer: "Burada ki amaç şudur raspberry pi den geliştirğidiğimiz bu kütüphane sayesinde websockets üzerinden" \ "verillerimizi aktararak kablosuz bağlantı sayesinde mobil ve bilgisayar üzer...
null
Image Operations(OpenCv Operation)/websockets-flask-opencv/webSocketsOpencvServer.py
webSocketsOpencvServer.py
py
7,701
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.destroyAllWindows", "line_number": 28, "usage_type": "call" }, { "api_name": "websockets.serve", "line_number": 61, "usage_type": "call" }, { "api_name": "websockets.recv", "line_number": 96, "usage_type": "call" }, { "api_name": "cv2.imencode",...
46792030
import pathlib from bs4 import BeautifulSoup from selenium import webdriver url = 'https://www.leagueofgraphs.com/champions/runes/kaisa' dir_path = pathlib.Path(__file__).parent.absolute() javascript_file = open(f"{dir_path}/js/html2canva.min.js", "r").read() javascript_script = ( 'html2canvas(document.querySelec...
null
services/scrapper_league_of_graphs.py
scrapper_league_of_graphs.py
py
748
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 17, "usage_type": "name" } ]
232922102
import MySQLdb import discord fruits = ["apple"] db = MySQLdb.connect( host = 'localhost', user = 'data', passwd = 'pass', db = 'base' ) cursor = db.cursor() cursor.execute def getAllRows(): cursor.execute('SELECT nickname, kills FROM users ORDER BY kills DESC') result...
null
discordbot.py
discordbot.py
py
1,854
python
en
code
null
code-starcoder2
76
[ { "api_name": "MySQLdb.connect", "line_number": 4, "usage_type": "call" }, { "api_name": "discord.Client", "line_number": 36, "usage_type": "attribute" }, { "api_name": "discord.Embed", "line_number": 54, "usage_type": "call" } ]
357350919
import os from os import listdir from os.path import isfile, join, isdir from pathlib import Path import concurrent.futures def split_all_files(source): linesPerFile = 1000000 filename = 1 resultfiles = [] newfolder = join(os.path.dirname(source), Path(source).stem) if not os.path.exists(newfolder...
null
splitfile.py
splitfile.py
py
1,512
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_nu...
86147060
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg # implement the default mpl key bindings from matplotlib.backend_bases import key_press_handler import sys if sys.version_info[0] < 3: import Tkinter as Tk else: import tkinter as Tk root = Tk.Tk() #\/#\/# from matplotlib.figure import Figure import...
null
smoothing/gaussian_filtering.py
gaussian_filtering.py
py
1,535
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tkinter.Tk", "line_number": 11, "usage_type": "call" }, { "api_name": "imread.imread", "line_number": 19, "usage_type": "call" }, { "api_name": "mahotas.colors.rgb2gray...
539291568
from selenium import webdriver from time import sleep from json import * a = [] options = webdriver.ChromeOptions() options.add_argument('headless') from selenium.webdriver.common.desired_capabilities import DesiredCapabilities # enable browser logging d = DesiredCapabilities.CHROME.copy() d['goog:loggingPrefs'] = {'...
null
final.py
final.py
py
1,800
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 5, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 5, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities.CHROME.copy", "line_numb...
73413673
#!/usr/bin/env python ''' Function that takes the optical flow and associated (x,y) coordinates and calculates the descriptor ''' import yaml import numpy as np import scipy, scipy.stats import pdb import rospy def build_grid_descriptor(x, y, vx, vy): ###### Read .yaml & set parameters ####### descriptor_stat...
null
src/descriptor_building.py
descriptor_building.py
py
1,009
python
en
code
null
code-starcoder2
76
[ { "api_name": "rospy.get_param", "line_number": 18, "usage_type": "call" }, { "api_name": "rospy.get_param", "line_number": 19, "usage_type": "call" }, { "api_name": "rospy.get_param", "line_number": 20, "usage_type": "call" }, { "api_name": "rospy.get_param", ...
463840573
import logging import time import uuid from typing import List import furl import esia_client from esia_client import Scope logger = logging.getLogger(__name__) __all__ = ['AsyncAuth', 'AsyncUserInfo', 'AsyncEBS'] class AsyncUserInfo(esia_client.UserInfo): async def _request(self, url: str) -> dict: "...
null
esia_client/async_client.py
async_client.py
py
6,271
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "esia_client.UserInfo", "line_number": 16, "usage_type": "attribute" }, { "api_name": "esia_client.utils.make_async_request", "line_number": 32, "usage_type": "call" }, { "...
243674694
import zipfile import os def unzip(input_directory, output_directory): ##directory = '/home/research/datasets/dun-bradstreet/' for file_name in os.listdir(input_directory): if '.zip' in file_name: print(file_name) zip_ref = zipfile.ZipFile(input_directory+file_name, 'r') zip_ref.extractall(output_director...
null
dunn_bradsheet/main/unzip_files.py
unzip_files.py
py
526
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 6, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 9, "usage_type": "call" } ]
484825348
#!/usr/bin/python3 """ Downloads latest model run from NOAA, concatenates csv files into Pandas dataframe. Extracts only Pinellas County sites. Builds unique list of sites from main dataframe and uses this to build the geoJSON for each site. As we're building the feature we query the main data_frame for all entries mat...
null
app/static/python/map_utils/test_harvest.py
test_harvest.py
py
2,072
python
en
code
null
code-starcoder2
76
[ { "api_name": "wget.download", "line_number": 39, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 42, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 49, "usage_type": "call" } ]
314427969
"""study for SVM.""" from sklearn import datasets from sklearn import model_selection as ms from sklearn import metrics import numpy as np import cv2 import matplotlib.pyplot as plt X, y = datasets.make_classification( n_samples=100, n_features=2, n_redundant=0, n_classes=2, random_state=7816) plt.scatter(X[:, 0], ...
null
python-test/test17.py
test17.py
py
1,411
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.make_classification", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 10, "usage_type": "call" }, { "api...
176503627
import matplotlib.pyplot as plt import numpy as np from tick.base import TimeFunction from tick.plot import plot_timefunction T = np.array([0, 3, 5.9, 8.001], dtype=float) Y = np.array([2, 4.1, 1, 2], dtype=float) tf_1 = TimeFunction((T, Y), dt=1.2) tf_2 = TimeFunction((T, Y), border_type=TimeFunction.BorderContinue,...
null
doc/modules/code_samples/plot_time_function.py
plot_time_function.py
py
754
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "tick.base.TimeFunction", "line_number": 9, "usage_type": "call" }, { "api_name": "tick.base.TimeFunction", ...
176733004
import cv2 import numpy as np # images = [] # paths = ['res/cars/Cars1.png', # 'res/cars/Cars2.png', # 'res/cars/Cars3.png', # 'res/cars/Cars4.png', # 'res/cars/Cars5.png'] # # for path in paths: img = cv2.imread('res/cars/Cars2.png') kernel = np.ones((5, 5), np.uint8) gray = cv2...
null
gen.py
gen.py
py
791
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_numbe...
79586220
import requests BASE_URL = 'https://shapeshift.io/%s' def _shapeshift_get_request(url_path): url = BASE_URL % url_path response = requests.get(url) return response.json() def get_coins(): return _shapeshift_get_request('getcoins') def get_rate(input_coin, output_coin): url_path = "rate/{}_{}"....
null
Plant_Coin/shapeshift.py
shapeshift.py
py
3,411
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 52, "usage_type": "call" } ]
601983850
# Program to convert text with ANSI escape sequences to HTML. # # Author: Peter Odding <peter@peterodding.com> # Last Change: May 18, 2017 # URL: https://coloredlogs.readthedocs.io """Convert text with ANSI escape sequences to HTML.""" # Standard library modules. import codecs import os import pipes import re import ...
null
home--tommy--mypy/mypy/lib/python2.7/site-packages/coloredlogs/converter.py
converter.py
py
11,117
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 33, "usage_type": "call" }, { "api_name": "re.MULTILINE", "line_number": 33, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 38, "usage_type": "call" }, { "api_name": "re.UNICODE", "line_number...
254769552
# Copyright © 2019 National Institute of Advanced Industrial Science and Technology (AIST). All rights reserved. from pathlib import Path from injector import singleton import json from datetime import datetime import os import shutil import werkzeug from zipfile import ZipFile import docker from docker.errors import I...
null
src/integration-provider/qai_testbed_integration_provider/usecases/deploy_dag.py
deploy_dag.py
py
9,484
python
en
code
null
code-starcoder2
76
[ { "api_name": "qlib.utils.logging.get_logger", "line_number": 22, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 30, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 31, "usage_type": "call" }, { "api_name": "os.environ"...
380545194
import discord import asyncio import re import json import time jsonf = open("Settings_Mudae.json") settings = json.load(jsonf) jsonf.close() #Settings kakera_wall = {} token = settings["token"] mudae = 432610292342587392 channelid = settings["channel_id"] multiids = settings["multichannel"] claim...
null
Mudaebot.py
Mudaebot.py
py
11,326
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 26, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 27, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 28, ...
376302737
from __future__ import absolute_import import functools import hashlib import itertools import logging import uuid from collections import OrderedDict from datetime import datetime, timedelta import pytz from mock import patch from sentry import eventstream, tagstore from sentry.app import tsdb from sentry.models im...
null
tests/snuba/tasks/test_unmerge.py
test_unmerge.py
py
20,318
python
en
code
null
code-starcoder2
76
[ { "api_name": "sentry.similarity._make_index_backend", "line_number": 35, "usage_type": "call" }, { "api_name": "sentry.utils.redis.clusters.get", "line_number": 35, "usage_type": "call" }, { "api_name": "sentry.utils.redis.clusters", "line_number": 35, "usage_type": "att...
543695741
import pygame class gap(pygame.sprite.Sprite): def __init__(self, pos): super().__init__() self.screen_info = pygame.display.Info() self.size = (self.width, self.height) = (int(self.screen_info.current_w), int(self.screen_info.current_h)) self.image = pygame.Surface((1, self.height ...
null
gap.py
gap.py
py
539
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.sprite", "line_number": 3, "usage_type": "attribute" }, { "api_name": "pygame.display.Info", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pygame.Surfac...
176939927
import datetime import logging from .config import get_config from .interval import WeatherInterval from .status import Status log = logging.getLogger(__name__) class WeatherForecast: """ A class requesting and containing data from the API Attributes: status : Status contains the status cod...
null
data_types/forecast.py
forecast.py
py
12,844
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "status.Status", "line_number": 52, "usage_type": "call" }, { "api_name": "config.get_config", "line_number": 54, "usage_type": "call" }, { "api_name": "subprocess.run", ...
330560365
''' Implémentation de VGG19: https://arxiv.org/pdf/1409.1556.pdf ''' import torch.nn as nn class ConvBlock(nn.Module): ''' Construction d'un bloc de convolutions ''' def __init__(self, size, in_features, out_features): super(ConvBlock, self)._...
null
Architectures/VGG.py
VGG.py
py
2,639
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
349463985
import copy,json from django.conf.urls import url from django.shortcuts import HttpResponse, render, redirect from django.utils.safestring import mark_safe from django.urls import reverse from django.http import QueryDict from django.db.models import Q from pure_pagination import Paginator, EmptyPage, PageNotAnInteger ...
null
stark/service/v1.py
v1.py
py
23,525
python
en
code
null
code-starcoder2
76
[ { "api_name": "copy.deepcopy", "line_number": 42, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 50, "usage_type": "name" }, { "api_name": "django.utils.safestring.mark_safe", "line_number": 51, "usage_type": "call" }, { "api_name": "...
308558620
"""Metrics to assess performance on regression task, tending existing sklearn interface Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Di Chen <chenditc@gmail.co...
null
sklearn_metric_ext.py
sklearn_metric_ext.py
py
2,581
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.metrics.regression._check_reg_targets", "line_number": 62, "usage_type": "call" }, { "api_name": "numpy.average", "line_number": 64, "usage_type": "call" }, { "api_name": "numpy.log", "line_number": 64, "usage_type": "call" }, { "api_name": ...
512626891
import math import numpy as np from matplotlib import pyplot as plt from numpy.linalg import inv def appendedX(degree, X): Xappended = X for i in range(2, degree + 1): #it starts with 2 since for deg>=2 we dont want redundant 1st column extrafeat = (X[:, 1] ** i).reshape(Xappended.shape[0], 1) ...
null
Assignment3/1c-poly.py
1c-poly.py
py
4,955
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.append", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random.random", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.sin", "l...
89802192
import torch import torch.nn as nn import torch.nn.functional as F import math from copy import deepcopy as c def clones(module, N): "Produce N identical layers." return nn.ModuleList([c(module) for _ in range(N)]) def attention(query, key, value, mask=None, dropout=None): "Compute 'Scaled Dot Product Att...
null
model/attention.py
attention.py
py
2,445
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.ModuleList", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "copy.deepcopy", "line_number": 9, "usage_type": "call" }, { "api_name": "torch.matmul", "line_numb...
250719983
import csv import sys import multiprocessing as mp # counts number of masses in file with open(sys.argv[1]) as row_count: counter = csv.reader(row_count) num_masses = 0 for x in counter: num_masses += 1 # appends each mass to a list with open(sys.argv[1]) as input_tier: reader = csv.reader(in...
null
Python/protein_tree/parallel_process.py
parallel_process.py
py
1,301
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number": ...
647970842
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('employee', '0008_attendance_incoming_employee_id'), ] operations = [ migrations.AlterModelOptions( name='attenda...
null
employee/migrations/0009_auto_20150326_1552.py
0009_auto_20150326_1552.py
py
661
python
en
code
null
code-starcoder2
76
[ { "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.AlterModelOptions", "line_number": 14, "usage_type": "call" ...
456017016
import logging import json import random import string from django.shortcuts import render from django.views import View from django_redis import get_redis_connection from django.http import HttpResponse, JsonResponse from users import models from utils.yuntongxun.sms import CCP from verifications.forms import CheckI...
null
apps/verifications/views.py
views.py
py
5,413
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "django.views.View", "line_number": 27, "usage_type": "name" }, { "api_name": "utils.captcha.captcha.captcha.generate_captcha", "line_number": 34, "usage_type": "call" }, { ...
78790516
from torch.utils.data import Dataset import numpy as np import math import torch import matplotlib.pyplot as plt class AdsCFT(Dataset): print('数据生成中...') def __init__(self, data_type='train', alpha=4, size=2000, a_1=1.5, b_1=0.2, split=1): self.data_type = data_type self.size = size s...
null
dataset_10_layers.py
dataset_10_layers.py
py
5,201
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.utils.data.Dataset", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.transpose", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.rando...
547797659
import numpy as np from PIL import Image with open('text/icdar_2019_art.txt') as f: # for annotation_line in f.readlines()[3616:3648]: for annotation_line in f.readlines()[3635:3636]: line = annotation_line.split() print(line[0]) image = Image.open(line[0]) image_width, image_he...
null
text/test_annotations.py
test_annotations.py
py
1,345
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 13,...
496944513
import warnings from django.template import Variable, Library, Node, TemplateSyntaxError,\ VariableDoesNotExist, TemplateIfParser from django.template.loader import render_to_string from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers ...
null
actstream/templatetags/activity_tags.py
activity_tags.py
py
9,896
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.Library", "line_number": 13, "usage_type": "call" }, { "api_name": "actstream.models.Follow.objects.is_following", "line_number": 17, "usage_type": "call" }, { "api_name": "actstream.models.Follow.objects", "line_number": 17, "usage_type": "...
105184105
from openpyxl import load_workbook import telebot from telebot import types from os import walk import os token=os.environ.get('data_token', None) delivery=["Москва","Обнинск","РАНХиГС","РЭУ","РНИМУ","Бауманка","ПМГМУ","РГУ им. Косыгина","РУДН"] base_path="catalog/" electronic=base_path+"Электронные сигарет...
null
main.py
main.py
py
10,247
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_nu...
543467775
# -------------------------------------------------------- # Tensorflow Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick # -------------------------------------------------------- from __future__ import absolute_import from __...
null
extract_general_features.py
extract_general_features.py
py
15,343
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.float32", "line_number": 40, "usage_type": "attribute" }, { "api_name": "numpy.min", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 44, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number"...
5279901
from comet_ml import Experiment from AFSLogin import init_token, API_KEY import logging import numpy as np from utils.args import get_parser, print_args from utils.hypertune_utils import ( combine_namedtuple, get_dict_and_info, get_dataset, hyperparam_tuning, get_hyperparam_setttings) import multiprocessing m...
null
main_residual_moe.py
main_residual_moe.py
py
8,099
python
en
code
null
code-starcoder2
76
[ { "api_name": "multiprocessing.set_start_method", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 40, "usage_type": "attribute" }, { "api_name": "...
494596961
import glob import tensorflow as tf from PIL import Image as im import numpy as np import matplotlib.pyplot as plt from scipy.misc import imsave directory = 'IQ stuff/iq/' # path to the puzzle files box_width = 98 box_height = 76 from_center_height_up = 38 from_center_height_bot = 38 from_center_width = 49 # candi...
null
IQ solver v1.py
IQ solver v1.py
py
8,512
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 32, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 34, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 34, "usage_type": "name" }, { "api_name": "numpy.asarray", "line_number":...
154901110
import re import logging import pandas as pd import os from os import listdir from os.path import isfile, join import tagshegen_new as tsg from disautils_new import CheckFileByArch32, NoFilesFoundError # Module for generating additional tagging sheets ('extra') after the main tagging sheets have been generated, for #...
null
disambiguation/program/etagshe.py
etagshe.py
py
13,085
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "re.split", "line_number": 40, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 54, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_numb...
632692623
from typing import List class Solution: def expressiveWords(self, S: str, words: List[str]) -> int: """ ### [809. Expressive Words](https://leetcode.com/problems/expressive-words/) Sometimes people repeat letters to represent extra feeling, such as "hello" -> "heeellooo", "hi" -> "hiiii"....
null
00809/expressive_words.py
expressive_words.py
py
2,468
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "itertools.groupby", "line_number": 63, "usage_type": "call" } ]
443766148
import sys import os os.environ["OMP_NUM_THREADS"] = "1" import pyDNMFk.config as config;config.init(0) import argparse from pyDNMFk.utils import * from pyDNMFk.pyDNMFk import * from pyDNMFk.pyDNMF import * from pyDNMFk.dist_comm import * import pandas as pd def parser_pyNMF(parser): parser.add_argument('--p_r', ...
null
main.py
main.py
py
4,384
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "pyDNMFk.config.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pyDNMFk.config", "line_number": 4, "usage_type": "name" }, { "api_name": "argparse.ArgumentPars...
306493189
# Copyright by Werder, Huber, Moor, Guler import easygui from Maze_Master import * # we designed a GUI with the module easygui while True: easygui.msgbox("Welcome to the Maze Project \nby Jonas Guler,Kilian Werder,Nicolas Huber,Philipp Moor","") #creates the messagebox choice_list = ["Prim's Algorithm", "Recurs...
null
A-Maze-ing/Maze_Main_withGUI.py
Maze_Main_withGUI.py
py
3,292
python
en
code
null
code-starcoder2
76
[ { "api_name": "easygui.msgbox", "line_number": 6, "usage_type": "call" }, { "api_name": "easygui.choicebox", "line_number": 8, "usage_type": "call" }, { "api_name": "easygui.multenterbox", "line_number": 10, "usage_type": "call" }, { "api_name": "easygui.enterbox"...
340582594
from flask import Blueprint, render_template,request, redirect, url_for from logic import func from logic.Search import reservation choice = Blueprint('choice', __name__,template_folder='templates',static_folder='./static') @choice.route('/Roomchoice',methods=['GET','POST']) def Roomchoice(): if request.method ==...
null
logic/Roomchoice.py
Roomchoice.py
py
1,186
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 9, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.request.fo...
274316943
#!/usr/bin/env python # Find grid-cell centres in images. import os import sys import tensorflow as tf import pickle import numpy import argparse parser = argparse.ArgumentParser() parser.add_argument( "--epoch", help="Restart from epoch", type=int, required=False, default=0 ) args = parser.parse_args() # Dist...
null
models/find_grid/findGrid.py
findGrid.py
py
3,495
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "tensorflow.distribute.MirroredStrategy", "line_number": 20, "usage_type": "call" }, { "api_name": "tensorflow.distribute", "line_number": 20, "usage_type": "attribute" }, ...
224685588
import requests from bs4 import BeautifulSoup def get_so_pages(url): result = requests.get(url) soup = BeautifulSoup(result.text, "html.parser") try: pages = soup.find("div", {"class": "s-pagination"}).find_all("a") last_page = pages[-2].get_text(strip=True) return int(last_page) except: return...
null
python_files/extractor/so.py
so.py
py
1,727
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 39, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "li...
467175393
#!/usr/bin/python # -*- coding: utf-8 -*- # 4h-dose-pv.py # This program provides an EPICS PV that corresponds to the 4h radiation dose associated to any # radiation probe at Sirius. The program receives two arguments. One is the name of the dose rate # input PV used for calculation. The other is the name of the 4h d...
null
4h-dose-pv.py
4h-dose-pv.py
py
3,939
python
en
code
null
code-starcoder2
76
[ { "api_name": "pcaspy.Driver", "line_number": 25, "usage_type": "name" }, { "api_name": "pcaspy.Driver.__init__", "line_number": 31, "usage_type": "call" }, { "api_name": "pcaspy.Driver", "line_number": 31, "usage_type": "name" }, { "api_name": "Queue.Queue", ...
250080320
import tkinter as tk from PIL import Image, ImageTk, ImageDraw from .canvas import Canvas from .main_picture import MainPicture from .side_panel import SidePanel from NeuralNetwork.setup import setup class Master(tk.Tk): def __init__(self): tk.Tk.__init__(self) self.neuralNetwork = setup() ...
null
GUI/master.py
master.py
py
1,448
python
en
code
null
code-starcoder2
76
[ { "api_name": "tkinter.Tk", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tkinter.Tk.__init__", "line_number": 11, "usage_type": "call" }, { "api_name": "tkinter.Tk", "line_number": 11, "usage_type": "attribute" }, { "api_name": "NeuralNetwork.setu...
353467634
# -*- coding: utf-8 -*- # # Copyright (C) Red Hat, 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 ...
null
dci/db/declarative.py
declarative.py
py
4,562
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.Column", "line_number": 26, "usage_type": "call" }, { "api_name": "sqlalchemy.dialects.postgresql.UUID", "line_number": 26, "usage_type": "call" }, { "api_name": "sqlalchemy.dialects.postgresql", "line_number": 26, "usage_type": "name" }, { ...
520093073
from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.forms.formsets import formset_factory from django.http import Http404 from django.shortcuts import render, get_object_or_404, redirect from d...
null
polls/views.py
views.py
py
3,621
python
en
code
null
code-starcoder2
76
[ { "api_name": "polls.models", "line_number": 14, "usage_type": "name" }, { "api_name": "polls.models.Question.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "polls.models.Question.objects", "line_number": 14, "usage_type": "attribute" }, { ...
569460035
import matplotlib.pyplot as plt import numpy as np def show_result(solver, solver_name): ans = solver.get_answer().get_matrix() title = f"{solver_name}, dim:{ans.shape[0]}, {solver.get_num_iters()} iterations, black pixels:{np.count_nonzero(ans != 0)} " print_3d_matrix(ans, title, ans.shape[0]).sho...
null
GUI.py
GUI.py
py
1,535
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.count_nonzero", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure",...
344922870
import pygame #al iniciar programa dibujar triangulo dando tres clics ancho=800; alto=600 #dimensiones verde = [0,255,0] ; rojo = [255,0,0] ;negro = [0,0,0];otrocol=[40,30,200] reloj = pygame.time.Clock() #reloj para manejar tiempo centro = [int(ancho/2),int(alto/2)] def escalar(pto,pEs): # recibe los puntos e...
null
escalar2.py
escalar2.py
py
2,353
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.time.Clock", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pygame.init", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.display.set_mode"...
447290609
#!/usr/bin/env python # -*- coding:utf-8 -*- # author:Erik Chan # datetime:2019/4/25 18:18 # software: PyCharm import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.python.tools.inspect_checkpoint import print_tensors_in_checkpoint_file #获取10个数的平均值 def moving_average(a,w=10): ...
null
PycharmProjects/Practice/数据分析/TensorFlow入门/逻辑回归/准备数据.py
准备数据.py
py
3,621
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linspace", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random.randn", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "...
286220840
import os from forms import AddForm, DelForm from flask import Flask, render_template, session, url_for, redirect from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate app = Flask(__name__) app.config['SECRET_KEY'] = 'mysecretkey' # Database basedir = os.path.abspath(os.path.dirname(__file__)) #...
null
Jeremy/app.py
app.py
py
2,991
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_n...
428400261
"""Example command: python benchmark.py --resume /checkpoint/cinjon/spaceofmotion/supercons/corrflow.kineticsmodel.pth --savepath /checkpoint/cinjon/spaceofmotion/supercons/corrflow.kineticsmodel.gymnastics --workers 8 --dataset jun1full-gymnastics --use_max_mask --datasplit trainval --limit 10 --skip_frames 3""" impor...
null
benchmark.py
benchmark.py
py
8,734
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isdir", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 22, "usage_type": "call" }, { "api_name": "logger.setup_logger", "lin...
314020190
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Medicine', fields=[ ('id', models.AutoField(pri...
null
records/migrations/0001_initial.py
0001_initial.py
py
5,058
python
en
code
null
code-starcoder2
76
[ { "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.CreateModel", "line_number": 13, "usage_type": "call" }, ...
254741066
import numpy as np import networkx as nx import multiprocessing as mp import pandas as pd def _parallel_RGD(node): RGD_ = 0 total = 0 for rec in REC_dict_: data = rec.split(",") if node in data: #if node in the graphlet RGD_ += REC_dict_[rec] total += 1 if total != 0: #faster to ask if node is acting in ...
null
obj3/pyloto.py
pyloto.py
py
11,264
python
en
code
null
code-starcoder2
76
[ { "api_name": "multiprocessing.Pool", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 44, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", ...
58992149
from django.shortcuts import render from django.http import JsonResponse from django.views import View from .models import Casa, ImagenesHabitaciones, BotonLink from .forms import CasaForm import tempfile import requests from django.conf import settings from django.core import files import os import zipfile from os.pat...
null
inmobiliariaVR/appVR/views.py
views.py
py
10,352
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.View", "line_number": 19, "usage_type": "name" }, { "api_name": "forms.CasaForm", "line_number": 23, "usage_type": "call" }, { "api_name": "models.Casa.objects.filter", "line_number": 25, "usage_type": "call" }, { "api_name": "models.Ca...
619637029
import pycom import time from machine import Pin from machine import Timer from dth import DTH import gps import machine from gps import GPS_UART_start from gps import NmeaParser from machine import RTC from network import LoRa from network import WLAN import socket import binascii import ubinascii im...
null
Full platform code/main.py
main.py
py
4,068
python
en
code
null
code-starcoder2
76
[ { "api_name": "pycom.heartbeat", "line_number": 22, "usage_type": "call" }, { "api_name": "dth.DTH", "line_number": 23, "usage_type": "call" }, { "api_name": "machine.Pin", "line_number": 23, "usage_type": "call" }, { "api_name": "machine.Pin.OPEN_DRAIN", "lin...
395650481
''' Created on Apr 24, 2017 @author: Guyling1 ''' import numpy as np from pymc3.distributions import Discrete import theano.tensor as tt from theano import as_op from theano import shared,function import theano from pymc3.distributions.dist_math import bound theano.config.compute_test_value = "ignore" "...
null
gammaPrior.py
gammaPrior.py
py
4,160
python
en
code
null
code-starcoder2
76
[ { "api_name": "theano.config", "line_number": 13, "usage_type": "attribute" }, { "api_name": "theano.tensor.fill", "line_number": 21, "usage_type": "call" }, { "api_name": "theano.tensor", "line_number": 21, "usage_type": "name" }, { "api_name": "theano.tensor.one...
399720588
import credentials import tweepy import csv auth = tweepy.OAuthHandler(credentials.API_KEY, credentials.API_SECRET_KEY) auth.set_access_token(credentials.ACCESS_TOKEN, credentials.ACCESS_TOKEN_SECRET) api = tweepy.API(auth) id = None count = 0 while count <= 3000: tweets = api.search(q='ParoNacional3M', lang='es...
null
tweets.py
tweets.py
py
642
python
en
code
null
code-starcoder2
76
[ { "api_name": "tweepy.OAuthHandler", "line_number": 5, "usage_type": "call" }, { "api_name": "credentials.API_KEY", "line_number": 5, "usage_type": "attribute" }, { "api_name": "credentials.API_SECRET_KEY", "line_number": 5, "usage_type": "attribute" }, { "api_nam...
444629803
import sys _module = sys.modules[__name__] del sys hummingbird = _module ml = _module _container = _module _parse = _module _utils = _module convert = _module exceptions = _module operator_converters = _module _gbdt_commons = _module _tree_commons = _module _tree_implementations = _module constants = _module decision_t...
null
generated/test_microsoft_hummingbird.py
test_microsoft_hummingbird.py
py
29,243
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.modules", "line_number": 2, "usage_type": "attribute" }, { "api_name": "_paritybench_helpers.patch_functional", "line_number": 38, "usage_type": "call" }, { "api_name": "unittest.mock.mock_open", "line_number": 39, "usage_type": "call" }, { "api...
48833858
import logging import string as s logging.basicConfig( level=logging.INFO, filename='cipher_log.log', filemode='w', format='%(asctime)s - %(message)s', datefmt='%d/%m/%Y %H:%M:%S' ) def main(): """The main code""" user_input = '' while user_input != 'STOP': user_input = input...
null
cipher.py
cipher.py
py
2,511
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 5, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 19, "usage_type": "call" }, { "api_name": "string.punctuation",...
619531960
from tkinter import * from tkinter.ttk import * from tkinter import ttk from pymongo import MongoClient import tkinter.messagebox as ms import webbrowser import shutil import Passwords import post import signup client = MongoClient(Passwords.MONGO_URI) db = client['Jobs-db'] jobs = db.jobs db_det = client['Student-d...
null
Py_chasers/main.py
main.py
py
20,195
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 13, "usage_type": "call" }, { "api_name": "Passwords.MONGO_URI", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tkinter.ttk.Notebook", "line_number": 44, "usage_type": "call" }, { "api_name": "tki...
559054014
import numpy as np import pandas as pd from tqdm import tqdm from HW2.config import ITEM_COL, USER_COL, INTERNAL_DATA_DIR, NEGATIVE_SAMPLES_FILE_NAME, N_NEGATIVE_SAMPLES_SETS, LOAD_NEGATIVE class NegativeSampler: """ choose the negative sample proportionally to their item strength can get inverse parameter s...
null
HW2/nagative_sampler.py
nagative_sampler.py
py
2,864
python
en
code
null
code-starcoder2
76
[ { "api_name": "HW2.config.INTERNAL_DATA_DIR", "line_number": 15, "usage_type": "name" }, { "api_name": "HW2.config.NEGATIVE_SAMPLES_FILE_NAME", "line_number": 15, "usage_type": "name" }, { "api_name": "pandas.Series", "line_number": 21, "usage_type": "call" }, { "...
610279819
import os import glob import time import ms5837 import io # used to create file streams import fcntl # used to access I2C parameters like addresses import string # helps parse strings import time class AtlasI2C: long_timeout = 1.5 # the timeout needed to query readings and calibrations shor...
null
SU/AtlasI2C.py
AtlasI2C.py
py
2,291
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.open", "line_number": 18, "usage_type": "call" }, { "api_name": "io.open", "line_number": 19, "usage_type": "call" }, { "api_name": "fcntl.ioctl", "line_number": 24, "usage_type": "call" }, { "api_name": "fcntl.ioctl", "line_number": 25, ...
143565183
from django.urls import path from . import views app_name = 'home' urlpatterns = [ path('', views.home, name='home'), path('loginHome/', views.loginHome, name='loginHome'), path('ownerHome/', views.ownerHome, name='ownerHome'), path('driverHome/', views.driverHome, name='driverHome'), path('sharerH...
null
home/urls.py
urls.py
py
491
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
570333458
from __future__ import print_function from __future__ import absolute_import # global imports import sys, os import matplotlib.pyplot as plt import time from matplotlib.colors import LogNorm # local imports from .open_edf import open_edf def plot_edf(data, index = 0, savename = "/savename...
null
fileIO/edf/plot_edf.py
plot_edf.py
py
2,995
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.subplot", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_name": "matplotlib.colors.LogNorm", "line_number": 25, "usage_type": "call" }, { "api_name": ...
427556845
import json import logging import os import urllib from com.dub.api.AdminApi import AdminApi from com.dub.api.DubrooApi import DubrooApi from com.dub.api.UsersApi import UsersApi from com.dub.api.YTDetailsFetcher import YTDetailsFetcher from com.dub.api.session_module import BaseSessionHandler from google.appengine.ex...
null
src/start.py
start.py
py
32,210
python
en
code
null
code-starcoder2
76
[ { "api_name": "jinja2.Environment", "line_number": 25, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", ...
503029234
#encoding:utf-8 import sys PROJECT_PATH = r"D:\python\Test_App\osc_test" sys.path.append(PROJECT_PATH) from common.BasicTestCase import BasicTestCase from utils.ExcelUtils import ExcelUtils import unittest import os from ddt import ddt,unpack,data import time @ddt class LoginCheck(BasicTestCase): app_path = os....
null
testcases/login/LoginCheck.py
LoginCheck.py
py
1,134
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "common.BasicTestCase.BasicTestCase", "line_number": 13, "usage_type": "name" }, { "api_name": "os.pat...
308790715
#!C:\Users\Ritesh\PycharmProjects\MyPro\venv\Scripts\python.exe import sys import pandas as pd import datetime import urllib import webbrowser as wb import tweepy from tweepy import API from tweepy import Cursor consumer_key = 'x1MmILheA2rZUOt3ASe8Ml3Ay' consumer_secret = 'SALsd26Rqdlemn2qgShY9Nuc4nwIrrfxhmwOyq6SSmpz...
null
Twitter_final.py
Twitter_final.py
py
1,792
python
en
code
null
code-starcoder2
76
[ { "api_name": "tweepy.OAuthHandler", "line_number": 14, "usage_type": "call" }, { "api_name": "webbrowser.open_new_tab", "line_number": 16, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 22, "usage_type": "call" }, { "api_name": "tweepy.Cursor"...
284378027
# Copyright 2013-2014 The Meson development team # 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 agree...
null
mesonbuild/mlog.py
mlog.py
py
11,356
python
en
code
null
code-starcoder2
76
[ { "api_name": "ctypes.windll.kernel32", "line_number": 33, "usage_type": "attribute" }, { "api_name": "ctypes.windll", "line_number": 33, "usage_type": "name" }, { "api_name": "ctypes.wintypes.DWORD", "line_number": 35, "usage_type": "call" }, { "api_name": "ctype...
344680599
import os from bs4 import BeautifulSoup as bs import requests from splinter import Browser from bs4 import BeautifulSoup from webdriver_manager.chrome import ChromeDriverManager import pandas as pd import pymongo def scrape(): executable_path = {'executable_path': ChromeDriverManager().install()} browser = B...
null
Mission_to_Mars/scrape_mars.py
scrape_mars.py
py
3,254
python
en
code
null
code-starcoder2
76
[ { "api_name": "webdriver_manager.chrome.ChromeDriverManager", "line_number": 12, "usage_type": "call" }, { "api_name": "splinter.Browser", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 21, "usage_type": "call" }, { "a...
374975494
import pandas as pd import numpy as np from typing import Tuple def get_grid( orders: pd.DataFrame, # columns: latitiude, longitude, vendor_id x_n_points: int, y_n_points: int ) -> pd.DataFrame: max_x = orders['longitude'].max() min_x = orders['longitude'].min() max_y = orders['latitude']...
null
assignment-2/location-based/src/utils.py
utils.py
py
1,622
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.DataFrame", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.DataFrame",...
194036950
from kivy.app import App from kivy.uix.label import Label class MainApp(App): def build(self): try: x=0 while True: x = x+1 c ="" name = "virus" +'-' +str(x) f=open(name,"w") for y in range(x): c= c+ y*"you are hacked!!...
null
Kivy/file/main.py
main.py
py
695
python
en
code
null
code-starcoder2
76
[ { "api_name": "kivy.app.App", "line_number": 4, "usage_type": "name" }, { "api_name": "kivy.uix.label.Label", "line_number": 21, "usage_type": "call" } ]
216755646
#!/usr/bin/env python3 import argparse import tempfile import json import requests import re import os.path from typing import Iterable from PIL import Image import math from pprint import pprint import sys def reqex(r: requests.Response, okcodes: int) -> requests.Response: if not r.ok and r.status_code not in o...
null
mattermost/manage.py
manage.py
py
7,754
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.Response", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pprint.pprint", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pprint.pprint", ...
498373531
from scipy.stats import spearmanr # def spearman(list1, list2): # N = len(list1) # sumD2 = sum((a - b) ** 2 for a, b in zip(list1, list2)) # return 1 - 6 * sumD2 / (N ** 3 - N) def read_calc_spearman(path): human = [] machine = [] data = open(path, encoding='utf8') next(data) for line...
null
homma/chapter10/knock95.py
knock95.py
py
1,262
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.stats.spearmanr", "line_number": 20, "usage_type": "call" } ]
298107009
#!python # -*- coding: utf-8 -*- # # Author : Bhishan Poudel; Physics Graduate Student, Ohio University # Date : Aug 15, 2016 # Last update : """ This program creates weighted average of the input fitsfiles. :Inputs: phosim_normalized_psf/psf*.fits :Outputs: weighted_psf.fits ...
null
a8_weighted_normalized_psf.py
a8_weighted_normalized_psf.py
py
2,341
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linspace", "line_number": 41, "usage_type": "call" }, { "api_name": "astropy.io.fits.getdata", "line_number": 44, "usage_type": "call" }, { "api_name": "astropy.io.fits", "line_number": 44, "usage_type": "name" }, { "api_name": "astropy.io.fit...
361410094
# -*- coding: utf-8 -*- """ Created by Dufy on 2019/11/27 11:21 IDE used: PyCharm Description : 1)对总的数据集进行划分 2)输出:'test_split_data.txt' ‘train_split_data.txt' Remark: 记得在运行前,清空 'test_split_data.txt' 与 ‘train_split_data.txt'内容 """ from data_operation import OperateExcel, function import os import random impo...
null
data_selection.py
data_selection.py
py
6,799
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 49, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 71, "usage_type": "call" }, { "api_name": "linecache.getline", "line_number": 76, "usage_type": "call" }, { "api_name": "linecache.getline", "l...
195172732
from urllib.request import urlopen import pickle import urllib import urllib.request as url from urllib.parse import quote from bs4 import BeautifulSoup as bs from dict import v_set import bleach import re from nltk.corpus import stopwords from nltk.tokenize import word_tokenize #from test1 import skilldict #import url...
null
scripts backup/skillnkey.py
skillnkey.py
py
1,886
python
en
code
null
code-starcoder2
76
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 22, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 22, "usage_type": "name" }, { "api_name": "filterurldict.corrskdic", "line_number": 29, "usage_type": "name" }, { "api_nam...
108599822
import discord from discord.ext import commands import random description = "ACM!!" bot = commands.Bot(command_prefix='!', description=description) @bot.event async def on_ready(): print('Logged in as') @bot.command() async def banme(ctx): await ctx.guild.ban(ctx.message.author) bot.run('')
null
03_banme.py
03_banme.py
py
306
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Bot", "line_number": 7, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 7, "usage_type": "name" } ]
472204877
import discord from discord.ext import commands import json import asyncio import cards cardsId = "SDCards" class GetSDCards(commands.Cog): def __init__(self, bot=None): self.bot = bot with open(r"C:\Users\krypt\Desktop\TradeWars\Cards.json", "r") as f: self.cardData = js...
null
cogs/GetSDCardsClass.py
GetSDCardsClass.py
py
696
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Cog", "line_number": 9, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 9, "usage_type": "name" }, { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "cards.SDCa...
455775152
# -*- coding: cp1252 -*- import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test from selenium.common import exceptions from selenium.webdriver.support import wait class WebElementTest(base_test.WebDriverBaseTest): ## These makes no sense in pyth...
null
webdriver/element_location/web_element_test.py
web_element_test.py
py
5,093
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number...
225342054
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 22 13:24:14 2019 @author: kuangmeng """ import numpy as np from Read_Dataset import ReadDataset from sklearn.linear_model import LogisticRegression from sklearn import tree from sklearn.ensemble import GradientBoostingClassifier from sklearn import ...
null
Simple_Classification_Methods.py
Simple_Classification_Methods.py
py
2,127
python
en
code
null
code-starcoder2
76
[ { "api_name": "Read_Dataset.ReadDataset", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.linear_model...
490439698
# Copyright (c) maiot GmbH 2020. 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
zenml/backends/training/training_gcaip_backend.py
training_gcaip_backend.py
py
5,125
python
en
code
null
code-starcoder2
76
[ { "api_name": "zenml.utils.requirement_utils.check_integration", "line_number": 32, "usage_type": "call" }, { "api_name": "zenml.utils.requirement_utils", "line_number": 32, "usage_type": "name" }, { "api_name": "zenml.utils.requirement_utils.GCP_INTEGRATION", "line_number": ...
112431814
#!/bin/env python3 """ """ import numpy as np import pandas as pd from scipy.linalg import pinv from sklearn.preprocessing import scale import matplotlib.pyplot as plt import seaborn as sns from tqdm import trange from contextual_matrix import get_contextual_matrix class DCMF(object): """ DCMF: Dynamic Conte...
null
dcmf.py
dcmf.py
py
8,993
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.isnan", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 53, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 53, "usage_type": "attribute" }, { "api_name": "numpy.random.rand", ...
269761330
import sklearn import numpy as np from sklearn import tree import random from scipy.spatial import distance def euc(a,b): return distance.euclidean(a,b) class ScrappyKNN(): def fit(self,X_train,Y_train): self.X_train = X_train self.y_train = y_train def predict(self,X_test): predi...
null
KNN.py
KNN.py
py
1,278
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.spatial.distance.euclidean", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.spatial.distance", "line_number": 8, "usage_type": "name" }, { "api_name": "sklearn.datasets.load_iris", "line_number": 35, "usage_type": "call" }, { "...
418997722
from mxnet import gluon from mxnet import ndarray as nd from mxnet import autograd as ag # import sys # sys.path.append('/Users/lnn/Code/Github/Gluon_DL/') import utils net = gluon.nn.Sequential() with net.name_scope(): net.add(gluon.nn.Flatten()) net.add(gluon.nn.Dense(256, activation="relu")) net.add(glu...
null
mlp_Gluon/mlp_Gluon.py
mlp_Gluon.py
py
1,156
python
en
code
null
code-starcoder2
76
[ { "api_name": "mxnet.gluon.nn.Sequential", "line_number": 8, "usage_type": "call" }, { "api_name": "mxnet.gluon.nn", "line_number": 8, "usage_type": "attribute" }, { "api_name": "mxnet.gluon", "line_number": 8, "usage_type": "name" }, { "api_name": "mxnet.gluon.nn...
259843750
""" Created on Sun Oct 27 19:13:32 2019 @author: RK Task2, Exercise1: Use the cross product to compute the area of a convex, 2D polygon """ #%% # Import dependencies import numpy as np import logging import matplotlib.pyplot as plt #%% # logging # Create and configure the logging LOG_FORMAT = "%(message)s" logging....
null
RK-Task2-Exercise2.py
RK-Task2-Exercise2.py
py
5,824
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 15, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random...
313868080
import requests from flask import Blueprint, jsonify from datetime import datetime, timedelta from dateutil import parser from src.route.root import TODAY_STR, TODAY, YESTERDAY_STR from src.cache import cache from src.db import session from src.models import Status indonesia = Blueprint('indonesia', __name__) JABAR ...
null
src/route/indonesia.py
indonesia.py
py
5,318
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "dateutil.parser.parse", "line_number": 21, "usage_type": "call" }, { "api_name": "dateutil.parser", ...
87702012
from pyramid.view import view_config from ..models import Entry from pyramid.response import Response from sqlalchemy import desc import datetime from pyramid.httpexceptions import HTTPFound from pyramid.security import NO_PERMISSION_REQUIRED from pyramid.httpexceptions import HTTPFound from pyramid.security import rem...
null
lj_step3/views/default.py
default.py
py
2,347
python
en
code
null
code-starcoder2
76
[ { "api_name": "security.check_credentials", "line_number": 18, "usage_type": "call" }, { "api_name": "pyramid.security.remember", "line_number": 19, "usage_type": "call" }, { "api_name": "pyramid.httpexceptions.HTTPFound", "line_number": 20, "usage_type": "call" }, { ...
104194887
from bs4 import BeautifulSoup as bs from urllib.request import urlopen, Request from pymongo import MongoClient from bson.objectid import ObjectId import json import sys songinfo=[] client=MongoClient() db=client.tamilMusicDB hdr = {'User-Agent': 'Mozilla/5.0'} base = 'http://www.5starmusiq.com/' f=open('links.txt',...
null
scraping.py
scraping.py
py
2,183
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" }, { "api_name": "urllib.request.Request", "line_number": 20, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4....
35056293
"""Mock reader used by the MockTransport class.""" import asyncio from aiohttp import web input_buffer = asyncio.Queue() def _set_response(web_response: web.Response): web_response.headers.add("Content-type", "text/html") web_response.set_status(200) return web_response class MockReader: """Web se...
null
pyinsteon/protocol/mock/mock_reader.py
mock_reader.py
py
1,925
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.Queue", "line_number": 6, "usage_type": "call" }, { "api_name": "aiohttp.web.Response", "line_number": 9, "usage_type": "attribute" }, { "api_name": "aiohttp.web", "line_number": 9, "usage_type": "name" }, { "api_name": "aiohttp.web.Applicat...