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
46644261
import xlrd CLASSIFICATION_RULES= r"C:\PythonExperiments\ClassificationRules.xlsx" class ClassificationRules: rules=[] path="" def __init__(self): self.path = CLASSIFICATION_RULES self.load_rules_from_excel() def load_rules_from_excel(self): workbook = xlrd.open_...
null
classification_rules.py
classification_rules.py
py
767
python
en
code
null
code-starcoder2
83
[ { "api_name": "xlrd.open_workbook", "line_number": 14, "usage_type": "call" } ]
508307943
#!/usr/bin/python ''' Program description: The gate_detector takes in the left camera image, identifies the 4 corners of the prominant gate and calculates the gate pose using P3P algorithm. Author: Swapneel Naphade (snaphade@umd.edu) version: 2.0 Date: 6/19/19 Change log: 7...
null
scripts/Nodes Not used/gate_detection.py
gate_detection.py
py
10,873
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv_bridge.CvBridge", "line_number": 26, "usage_type": "call" }, { "api_name": "common_resources.MVA", "line_number": 33, "usage_type": "call" }, { "api_name": "common_resources.MVA", "line_number": 34, "usage_type": "call" }, { "api_name": "sys.exit...
65329161
import unittest from selenium import webdriver from case.login_in import login_In import time from common.util import explicit_wait as etwait,drop_down_menu from common import settings settings.create_dir() pict_path = settings.pictsave_path() class Extmana(unittest.TestCase): u"""分机管理""" @classmethod de...
null
case/system_management/extmana_case.py
extmana_case.py
py
5,016
python
en
code
null
code-starcoder2
83
[ { "api_name": "common.settings.create_dir", "line_number": 8, "usage_type": "call" }, { "api_name": "common.settings", "line_number": 8, "usage_type": "name" }, { "api_name": "common.settings.pictsave_path", "line_number": 9, "usage_type": "call" }, { "api_name": ...
14496370
#Python libraries that we need to import for our bot import random from flask import Flask, request from pymessenger.bot import Bot token = "EAANxYyQBarcBAFYe4kHxUDIWMmf1gmRhjIcIMXO4bbjwbPdqpFc2ZBxV9hLVyDpCvx76TtKgVcJuMyMKtGGKJXFhp0fqEoIj8xXMWZBzu9ZBcjDuheujQMlycaL1pdQptcZBO0TMV0ZBXsCdZBeKuigUTjFsgOMbF1oepBU0jFrQZDZD"...
null
start.py
start.py
py
3,800
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "pymessenger.bot.Bot", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.reques...
148062957
# conduct experiment using data and structured prediction method import spectralKalmanFilter import scipy.io as sio import numpy as np cropped = sio.loadmat('../hand-written-algebra/pre-process/data/cropped.mat') cropped = cropped['cropped'] (numObs, obsDim) = cropped.shape numObs = int(numObs / 2) # reshape the cro...
null
parse-predict/experiment.py
experiment.py
py
664
python
en
code
null
code-starcoder2
83
[ { "api_name": "scipy.io.loadmat", "line_number": 7, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 14, "usage_type": "call" }, { "api_name": "spectralKalmanFilter.spectralKalm...
639014645
import logging import socket from tcp_client_server.proto import server as srv from tcp_client_server.contexts import stream_socket_control from tcp_client_server.logging import LOG_CONF logging.basicConfig(**LOG_CONF) def server(): sock_init = socket.socket(socket.AF_INET, socket.SOCK_STREAM) with stream_...
null
server.py
server.py
py
889
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "tcp_client_server.logging.LOG_CONF", "line_number": 8, "usage_type": "name" }, { "api_name": "socket.socket", "line_number": 12, "usage_type": "call" }, { "api_name": "so...
184843637
# -*- coding: utf-8 -*- """ Created on Tue Jan 22 13:20:58 2019 @author: Administrator """ import requests import pandas as pd # import json # import time # 初始API的URL url = "https://restapi.amap.com/v3/traffic/status/rectangle?key=98e71c11ba3874e20d70616063ef454c&extensions=all&level=2&rectangle=" # 设定整个网格左下角坐标的经纬...
null
test/road condition(1).py
road condition(1).py
py
2,427
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 45, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 64, "usage_type": "call" } ]
596099161
"""Módulo 'formatter' de georef-api Contiene funciones que establecen la presentación de los datos obtenidos desde las consultas a los índices o a la base de datos. """ import csv from flask import make_response, jsonify, Response, request import geojson from service import strings from service import names as N CSV...
null
service/formatter.py
formatter.py
py
17,106
python
en
code
null
code-starcoder2
83
[ { "api_name": "service.names.ID", "line_number": 19, "usage_type": "attribute" }, { "api_name": "service.names", "line_number": 19, "usage_type": "name" }, { "api_name": "service.names.STATE", "line_number": 19, "usage_type": "attribute" }, { "api_name": "service....
45461225
import numpy as np import cv2 from scipy.ndimage.measurements import label from Vehicle import Vehicle class VehicleDetection: def __init__(self, classifiers, heatmap_threshold, debug_mode=False): self._classifiers = classifiers self._heatmap_thr...
null
VehicleDetection.py
VehicleDetection.py
py
7,043
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.copy", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_...
413105047
#!/usr/bin/env python3 import csv,datetime,sys,re,os import requests,dateparser,smtplib import numpy as np import pandas as pd import email.message def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def make_time_url(frequency): end_time = datetime.datetime.now() start_time = end_time -...
null
ai/check_rsyslog_error.py
check_rsyslog_error.py
py
3,469
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.stderr", "line_number": 10, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" }, { "api_name": "datetime...
538216965
import numpy as np import cv2 # OpenCV for perspective transform # Instantiate a Databucket().. this will be a global variable/object # that you can refer to in the process_image() function below # Define a function to convert to rover-centric coordinates def rover_coords(binary_img): # Identify nonzero pixels ...
null
code/perception.py
perception.py
py
7,905
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.absolute", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.float", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "li...
506282034
from sys import version_info from unittest import TestCase from xml.etree import ElementTree from pyclarity_lims.entities import ProtocolStep, StepActions, Researcher, Artifact, \ Step, StepPlacements, Container, Stage, ReagentKit, ReagentLot, Sample, Project, Process from pyclarity_lims.lims import Lims from tests...
null
tests/test_entities.py
test_entities.py
py
25,218
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.version_info", "line_number": 8, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 204, "usage_type": "name" }, { "api_name": "pyclarity_lims.lims.Lims", "line_number": 209, "usage_type": "call" }, { "api_name": "xml.etre...
164340516
import quandl import pandas as pd import os def scrapper(): quandl.ApiConfig.api_key = '4_ERbyf3sSDTz8qsDsoM' symbol = "ICICIBANK" DIR = os.getcwd() nifty=pd.read_csv(DIR+"/Historicaldata/ind_nifty50list.csv") error=[] for ele,symbol in enumerate(list(nifty["Symbol"])): for i in rang...
null
scrapper.py
scrapper.py
py
845
python
en
code
null
code-starcoder2
83
[ { "api_name": "quandl.ApiConfig", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "quandl.get", "line...
623681460
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import uuid import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ...
null
src/device/migrations/0001_initial.py
0001_initial.py
py
1,173
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 13, "usage_type": "ca...
600516626
import numpy as np from skimage import filters from skimage.feature import corner_peaks from scipy.spatial.distance import cdist from scipy.ndimage.filters import convolve import math from utils import pad, get_output_space, unpad import cv2 _COLOR_RED = (255, 0, 0) _COLOR_GREEN = (0, 255, 0) _COLOR_BLUE = (0, 0, 255...
null
Lab 3/image_stitching.py
image_stitching.py
py
20,146
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.sum", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 26, ...
437247232
# https://web.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf has the formulae import numpy as np import pickle try: import modin.pandas as pd except ModuleNotFoundError: import pandas as pd import sys, os #sys.path.append(os.path.abspath('/home/ashwath/Programs/ArxivCS/hyperdoc2vec_arxivmag'...
null
Evaluation/predict_evaluate_mag50.py
predict_evaluate_mag50.py
py
22,061
python
en
code
null
code-starcoder2
83
[ { "api_name": "tqdm.tqdm.pandas", "line_number": 19, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 41, "usage_type": "call" }, { "api_name": "nltk.stem.SnowballStemmer", ...
5108030
import glob import os import cv2 import numpy as np from skimage.transform import AffineTransform,warp ratio = 0.98 image_size = 128 x = [] paths = glob.glob('/home/avisek/vineel/data/celebA/img_align_celeba/*') cnt = 0 cnt1 = 1 for path in paths: cnt += 1 img = cv2.imread(path) transform = AffineTransfo...
null
3in1out/to_npy_celebA.py
to_npy_celebA.py
py
1,319
python
en
code
null
code-starcoder2
83
[ { "api_name": "glob.glob", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 17, "usage_type": "call" }, { "api_name": "skimage.transform.AffineTransform", "line_number": 18, "usage_type": "call" }, { "api_name": "skimage.transf...
366197579
import pandas as pd import numpy as np import os from multiprocessing import Pool from collections import OrderedDict from step1.cal_slope import big3_trend from step2.build_map import map_maker, make_ans_target from step3.model_run import model_run from step3.processing.group_process import group_processing if __na...
null
map_pipeline.py
map_pipeline.py
py
6,967
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 40, "usage_type": "call" }, { "api_name": "step1.cal_slope.big3_trend", "line_number": 41, "usage_type": "call" }, { "api_name": "step1.cal_slope", "line_number": 42, "usage_type": "name" }, { "api_name": "step1.cal_...
11256205
""" Created on 2 mai. 2018 @author: jerome """ import yaml import logging import logging.handlers import dolibarr_API import woocommerce_API import sendMail class NapProcessor(object): """ """ class CheckError(Exception): pass default_root_dir = '../nap.d' def __init__(self): ...
null
napProcessor.py
napProcessor.py
py
5,358
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 29, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 30, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 31, "usage_type": "attribute" }, { "api_name": "logging.Fo...
90229633
from __future__ import annotations from random import randrange, choices, choice from pathlib import Path from collections import namedtuple import toml from typing import Dict, List from .random_name_generator import RandomNameGenerator from mentormatch.utils.enums import Gender class RandomApplicantGenerator: ...
null
tests/random_applicant_generator.py
random_applicant_generator.py
py
6,314
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "call" }, { "api_name": "toml.load", "line_number": 18, "usage_type": "call" }, { "api_name": "random_name_generator.RandomNameGenerator", "line_number": 24, "usage_type": "call" }, { "api_name": "typi...
537076936
from utils import log from utils import current_time from response import current_user from response import redirect from response import login_required from response import render_template from model import User from model import Weibo from model import Comment from .index import error def route_weibo_index(reque...
null
routes/weibo.py
weibo.py
py
3,678
python
en
code
null
code-starcoder2
83
[ { "api_name": "response.current_user", "line_number": 17, "usage_type": "call" }, { "api_name": "model.User.find", "line_number": 20, "usage_type": "call" }, { "api_name": "model.User", "line_number": 20, "usage_type": "name" }, { "api_name": "index.error", "l...
237591084
# -*- coding: utf-8 -*- ######################################################### # UI of N:1 Schema Designer # # Imports all wx libraries and creates GUI # # # # Authors : Ajinkya # # Last...
null
UI.py
UI.py
py
33,693
python
en
code
null
code-starcoder2
83
[ { "api_name": "wx.Frame", "line_number": 23, "usage_type": "attribute" }, { "api_name": "wx.Frame.__init__", "line_number": 26, "usage_type": "call" }, { "api_name": "wx.Frame", "line_number": 26, "usage_type": "attribute" }, { "api_name": "wx.ID_ANY", "line_n...
178919028
# -*- coding: utf-8 -*- from os.path import dirname, isfile, join import pytest @pytest.fixture(scope='session') def client(): from apps import create_app from apps.db import mongo # instancia função factory em modo 'testing' flask_app = create_app('testing') testing_client = flask_app.test_cl...
null
tests/conftest.py
conftest.py
py
838
python
en
code
null
code-starcoder2
83
[ { "api_name": "apps.create_app", "line_number": 13, "usage_type": "call" }, { "api_name": "apps.db.mongo.db.planets.drop", "line_number": 23, "usage_type": "call" }, { "api_name": "apps.db.mongo.db", "line_number": 23, "usage_type": "attribute" }, { "api_name": "a...
414658288
# -*- coding: utf-8 -*- # from __future__ import unicode_literals from __future__ import division from scipy.stats import norm, dweibull, weibull_max, weibull_min, invweibull, exponweib from odoo import models, fields, api from odoo.exceptions import UserError, ValidationError from pyecharts import Overlap, Bar, Line, ...
null
sa_addons/spc/models/tor_ang_spc.py
tor_ang_spc.py
py
16,364
python
en
code
null
code-starcoder2
83
[ { "api_name": "odoo.models.TransientModel", "line_number": 22, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 22, "usage_type": "name" }, { "api_name": "odoo.fields.Datetime", "line_number": 26, "usage_type": "call" }, { "api_name": "odoo...
496765232
from django.conf.urls import url from . import views app_name = 'material' urlpatterns = [ # ex: /material/ url(r'^$', views.IndexView.as_view(), name='index'), # ex: /material/5/ url(r'^(?P<pk>[0-9]+)/$', views.DetailView.as_view(), name='detail'), # ex: /material/add url(r'add/$', views.Mat...
null
materials/urls.py
urls.py
py
490
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" }, { "api_name": "django....
402147289
import sys from PyQt5 import QtCore, QtGui from PyQt5.QtCore import Qt from PyQt5.QtWidgets import( QMainWindow, QApplication, QLabel ) class MainWindow(QMainWindow): def __init__(self): super().__init__() self.label = QLabel() canvas = QtGui.QPixmap(400, 300) canvas....
null
customWidgets/cuwid1.py
cuwid1.py
py
665
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 11, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 15, "usage_type": "call" }, { "api_name": "PyQt5.QtGui.QPixmap", "line_number": 16, "usage_type": "call" }, { "api_name":...
155651905
import requests from bs4 import BeautifulSoup def crawl(): r=requests.get("https://search.naver.com/search.naver?sm=top_sug.pre&fbm=1&acr=1&acq=%EB%AF%B8%EC%84%B8%EB%A8%BC%EC%A7%80&qdt=0&ie=utf8&query=%EB%AF%B8%EC%84%B8%EB%A8%BC%EC%A7%80") c=r.content #print(c) html = BeautifulSoup(c,"html.parse...
null
WebCrawling/dustInformation.py
dustInformation.py
py
1,350
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" } ]
470481188
# Copyright (c): Wenyi Tang 2017-2019. # Author: Wenyi Tang # Email: wenyi.tang@intel.com # Update Date: 2019/4/3 下午5:03 from functools import partial from pathlib import Path import h5py import numpy as np from . import _logger, parse_index from ...Util.ImageProcess import array_to_img from ...Util.ImageProcess...
null
VSR/DataLoader/Parser/hdf.py
hdf.py
py
3,251
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 27, "usage_type": "call" }, { "api_name": "h5py.File", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 57, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 57...
490594401
import pickle import re import string import os import random from utils import load_stuff,\ spacy_docs_dir, spacy_docs_list, \ load_sent_labels, filter_sent, \ calc_nc_avg_tfidf, stopwords_set def load_data_label_for_CNN(file_id): with open(os.path.join(spacy_docs_dir, spacy_docs_list[file_id]), "rb"...
null
src/step6_get_sent_dataset_for_CNN.py
step6_get_sent_dataset_for_CNN.py
py
1,139
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.spacy_docs_dir", "line_number": 13, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "utils.spacy_docs_l...
642671910
from enum import Enum class Direction(Enum): NONE = 1 UP = 2 DOWN = 3 LEFT = 4 RIGHT = 5 #class Keys(Enum): # ESC = 27 # UP = 273 # DOWN = 274 # RIGHT = 275 # LEFT = 276
null
Tasks/Aliens/utils/enums.py
enums.py
py
206
python
en
code
null
code-starcoder2
83
[ { "api_name": "enum.Enum", "line_number": 3, "usage_type": "name" } ]
158785027
import pdb import sys import os.path import math import numpy as np import torch import torch.nn as nn import torchvision.transforms as transforms from torch.autograd import Variable import torchvision.models.vgg as models from PIL import Image from os import path from itertools import islice import pickle class Im...
null
grasp_category_dataset.py
grasp_category_dataset.py
py
6,555
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.ceil", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 42, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": ...
386769570
from datetime import datetime as dt # POSSIBLE USER SETTINGS MAX_HOURS = 9999 DIR = '/Users/paulpries/Documents/bc_forecasting/' WGRIB2 = '/opt/local/bin/wgrib2' import platform if platform.system() == 'Windows': FILE_SPLITTER = '\\' else: FILE_SPLITTER = '/' # NON USER SETTINGS VERSION = 1.0 BIAS_DAYS = 1...
null
src/config/general_settings.py
general_settings.py
py
661
python
en
code
null
code-starcoder2
83
[ { "api_name": "platform.system", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 33, "usage_type": "call" } ]
93747085
''' Python based X-Ray image generator Author : Pranjal Joshi Contact : pranjaljoshi@bel.co.in Date : 13/03/2018 ''' from datetime import datetime from datetime import timedelta import time import pytz import os import sys import re from tkinter import * from tkinter.filedialog import ...
null
Fuze-Xray/Time_Xray.py
Time_Xray.py
py
16,679
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path", "line_number": 45, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path.dirname", "...
570269303
# The metaparameters can be found at the beginning of the code, below imports. # Fine-tune them for a different behaviour. #KERAS from keras.models import Model import keras.backend as kback from keras.layers import Input, Convolution2D, Dense, Flatten, Lambda, Multiply from keras.optimizers import RMSprop from keras....
null
code/without_memory/agent.py
agent.py
py
16,034
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.backend.image_data_format", "line_number": 25, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 25, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", ...
552611734
# encoding:utf-8 """ 操作js driver.execute_script(js_str) """ from selenium import webdriver from selenium.webdriver.common.keys import Keys import time driver = webdriver.Chrome(r"C:\Users\19663\Desktop\chromedriver.exe") driver.get("https://www.baidu.com") driver.find_element_by_id("kw").send_keys("hello") driver...
null
selenium_test/selenium_test_8.py
selenium_test_8.py
py
474
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 14, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.keys.Keys.RETURN", "line_number": 18, "usage_type": "attribute" ...
311328845
from config import ADMIN_ID from misc import dp from alchemy import Person, TG_Account, DB from aiogram import types import asyncio @dp.message_handler(user_id=ADMIN_ID, commands="add_manile") async def add_me_for_test(message: types.Message): """проверяет, есть ли пользователь НИКИТА, если нет, то добавляет его ...
null
handlers/Handlers_not_ready/handler_5_test.py
handler_5_test.py
py
1,073
python
en
code
null
code-starcoder2
83
[ { "api_name": "aiogram.types.Message", "line_number": 9, "usage_type": "attribute" }, { "api_name": "aiogram.types", "line_number": 9, "usage_type": "name" }, { "api_name": "misc.dp.message_handler", "line_number": 8, "usage_type": "call" }, { "api_name": "misc.dp...
146677868
""" Created on October 2019 Author : Marta CICCARELLA """ from processing import * from model import * from training import * from sys import argv import numpy as np from sklearn.model_selection import train_test_split # set arguments epochs = int(argv[1]) n_proteins = int(argv[2]) if __name__=="__main__": p...
null
src/deepdrug3d.py
deepdrug3d.py
py
1,943
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 17, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.repeat", "line_number": 49, ...
534497828
# # tests/test_http_responder.py # import asyncio from growler.http.responder import GrowlerHTTPResponder class mock_protocol(): def __init__(self, data=[]): self.loop = asyncio.get_event_loop() self.http_application = None class mock_parser(): def __init__(self, parent): self.p...
null
tests/test_http_responder.py
test_http_responder.py
py
1,025
python
en
code
null
code-starcoder2
83
[ { "api_name": "asyncio.get_event_loop", "line_number": 14, "usage_type": "call" }, { "api_name": "growler.http.responder.GrowlerHTTPResponder", "line_number": 34, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 39, "usage_type": "call" }, ...
182576734
import datetime import facebook import hashlib import json import re from django.conf import settings from django.db import models from django.contrib.auth.models import User from django.contrib.gis.db.models import GeoManager from django.contrib.localflavor.us.models import USStateField from django.core.cache import ...
null
rah/models.py
models.py
py
13,188
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.today", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 22, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 22, "usage_type": "call" }, { "api_name": "dja...
405889288
""" hint.py - Hint Module """ import pytz from django.conf import settings from main.module import command, ex from main.models import Record CMD_STR = "history" LOCAL_TZ = pytz.timezone(settings.TIME_ZONE) @ex @command(CMD_STR) def record(goobo, reply_to, command_str): """ Given a keyword, return the re...
null
goobo/main/record.py
record.py
py
1,348
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytz.timezone", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.settings.TIME_ZONE", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 10, "usage_type": "name" }, { "api_name":...
39273328
# coding=utf-8 import unittest from threading import Thread import requests from time import sleep from simtip.simtip import main DO_CONTINUE = True def kill_servers_soon(): global DO_CONTINUE DO_CONTINUE = False sleep(5) requests.post("http://localhost:5678/shutdown") def do_continue(): global...
null
test/main.py
main.py
py
636
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.sleep", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 16, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 22, "usage_type": "attribute" }, { "api_name": "simtip.simtip.main", ...
456927842
# import system module import sys import os # import some PyQt5 modules from PyQt5.QtWidgets import QApplication, QWidget, QMessageBox from PyQt5.QtGui import QImage, QIcon, QPixmap from PyQt5.QtCore import QTimer from tkinter import simpledialog, Tk from ui_main_window import * from face_lib import * from worker imp...
null
main_window.py
main_window.py
py
7,727
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 17, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QIcon", "line_number": 25, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QTimer", "line_number": 27, "usage_type": "call" }, { "api_name": "PyQt5.Q...
496178096
''' This code reads in a batch of very high resolution spectra and degrades them to a lower resolution, assuming a Gaussian line-spread function. The main use case is that we produce synthetic spectra (from an updated version of the Kurucz line list by default) at R~300,000 and need to convolve them the resolution of ...
null
train_NNs/convolve_highrez_spectra_to_given_R.py
convolve_highrez_spectra_to_given_R.py
py
3,977
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.load_wavelength_array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 29, "usage_type": "call" }, { "api_name": "scipy.sparse.diags", "line_number": 49, "usage_type": "call" }, { "api_name": "scipy.spars...
619279539
import json import sys from os import path import vk from PyQt5 import QtGui from PyQt5.QtCore import QRegExp, QObject, pyqtSignal, QEventLoop from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.uic import loadUi import google_export import vktests class Window(QMainWindow): def __init__(self, pa...
null
main.py
main.py
py
9,168
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt5.uic.loadUi", "line_number": 20, "usage_type": "call" }, { "api_name": "PyQt5.QtGui.QPixmap", "line_number": 22, "usage_type": "call" }, { "api_name": "PyQt5.QtGui", "line_number": 22, "usage_type": "name" }, { "api_name": "vktests.save_to_txt"...
111012944
import sqlite3 # экспорт con = sqlite3.connect('E:\\My Project\\Dg\\first_data\\DB_parser.db') cur = con.cursor() name = cur.execute('SELECT DISTINCT Shpon FROM Global_doors') f =[] # Импорт exp = sqlite3.connect('E:\\My Project\\Dg\\main_data.db') for row in name: expcur = exp.cursor() rec =expcur.execute ('I...
null
first_data/Shpon.py
Shpon.py
py
409
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" } ]
448515794
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn import torch.optim as optim import numpy as np from matplotlib import pyplot as plt import torch.nn.functional as F import os import argparse from PIL import Image # ours fro...
null
test_new.py
test_new.py
py
3,333
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 44, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 44, "usage_type": "call" }, { "api_name": "torch.cu...
367740221
# examples/Python/Advanced/colored_pointcloud_registration.py # https://www.programmersought.com/article/75924798173/ import numpy as np import open3d as o3d #Read the ply point cloud file in the computer source = o3d.io.read_point_cloud("pack1.ply") #source is the point cloud that needs to be registered target = o3...
null
icp/main2.py
main2.py
py
1,978
python
en
code
null
code-starcoder2
83
[ { "api_name": "open3d.io.read_point_cloud", "line_number": 8, "usage_type": "call" }, { "api_name": "open3d.io", "line_number": 8, "usage_type": "attribute" }, { "api_name": "open3d.io.read_point_cloud", "line_number": 9, "usage_type": "call" }, { "api_name": "ope...
405436172
#!/usr/bin/env python from googleapiclient import discovery from googleapiclient import errors from oauth2client.client import GoogleCredentials from oauth2client.service_account import ServiceAccountCredentials import argparse from random import choice from sys import exit from time import sleep from os import enviro...
null
modules/provision_gcp_project_wrapper.py
provision_gcp_project_wrapper.py
py
8,630
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 32, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 52, "usage_type": "call" }, { "api_name": "json.load", "line_number": 64, "usage_type": "call" }, { "api_name": "logging.config.dictConfi...
520367435
#!/usr/bin/env python # These two lines are only needed if you don't put the script directly into # the installation directory from simplestyle import * import inkex import sys import pystache import string import json sys.path.append('/usr/share/inkscape/extensions') # We will use the inkex module with the predefine...
null
jmerge.py
jmerge.py
py
2,125
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "inkex.Effect", "line_number": 17, "usage_type": "attribute" }, { "api_name": "inkex.Effect.__init__...
417821247
from TimeIt import TimeIt from PlanDataObject import PlanDataObject from EquipmentDataObject import EquipmentDataObject from FundingDataObject import FundingDataObject from ExpEval import ExpEval import random import math import array as arr import nvsympy as nsp import numpy as np import sympy as sp from nvtranslate ...
null
Solver.py
Solver.py
py
13,830
python
en
code
null
code-starcoder2
83
[ { "api_name": "sympy.lambdify", "line_number": 35, "usage_type": "call" }, { "api_name": "TimeIt.TimeIt", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.matmul", "line_number": 49, "usage_type": "call" }, { "api_name": "numpy.matmul", "line_nu...
612770548
#import chatbot import pandas as pd import numpy as np import pickle import operator from sklearn.svm import SVC from sklearn.model_selection import train_test_split as tts from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.preprocessing import LabelEncoder as LE from sklearn.metrics.pair...
null
FAQ bot/finalchatbot.py
finalchatbot.py
py
2,502
python
en
code
null
code-starcoder2
83
[ { "api_name": "nltk.LancasterStemmer", "line_number": 25, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 35, "usage_type": "call" }, { "api_n...
421837471
from flask import g, render_template, redirect, url_for, current_app, request from maintain_frontend.decorators import requires_permission from maintain_frontend.constants.permissions import Permissions from maintain_frontend.add_lon.validation.servient_structure_position_validator \ import ServientStructurePositio...
null
maintain_frontend/add_lon/servient_structure_position.py
servient_structure_position.py
py
3,596
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.g.session", "line_number": 19, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 19, "usage_type": "name" }, { "api_name": "flask.current_app.logger.info", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.curr...
204685684
from django.views.generic.edit import FormView from django.views.generic import TemplateView from api.forms import PersonForm from django.urls import reverse_lazy import requests as rq import json api_endpoint = 'http://localhost:8000/api/v1/person/' class CreatePersonView(FormView): template_name = 'front/creat...
null
front/views.py
views.py
py
1,388
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.views.generic.edit.FormView", "line_number": 11, "usage_type": "name" }, { "api_name": "api.forms.PersonForm", "line_number": 13, "usage_type": "name" }, { "api_name": "django.urls.reverse_lazy", "line_number": 14, "usage_type": "call" }, { "...
37510296
# -*- coding: utf-8 -*- import datetime import matplotlib.pyplot as plt from Stock import Stock from StockProduct import StockProduct from InterestProduct import InterestProduct start = datetime.datetime(2002, 1, 1) end = datetime.datetime(2013, 12, 28) start_product = "2010-01-01" end_product = "2013-10-01" plot_st...
null
etude_product_database.py
etude_product_database.py
py
1,544
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "call" }, { "api_name": "StockProduct.StockProduct", "line_number": 17, "usage_type": "call" }, { "api_name": "Stock.Sto...
158374102
import os import sys import traceback import logging # try: # import _winreg as winreg # except: # import winreg import win32api #import winsys from winsys import accounts, registry, security from winsys.registry import REGISTRY_ACCESS # Monkeypatch to force stuff in the registry class to do 64 bit regi...
null
client_tools/svc/mgmt_RegistrySettings.py
mgmt_RegistrySettings.py
py
10,292
python
en
code
null
code-starcoder2
83
[ { "api_name": "winsys.registry.Registry", "line_number": 18, "usage_type": "attribute" }, { "api_name": "winsys.registry", "line_number": 18, "usage_type": "name" }, { "api_name": "winsys.registry.REGISTRY_ACCESS.KEY_READ", "line_number": 18, "usage_type": "attribute" }...
367806966
import requests import pandas as pd from pandas import DataFrame import numpy as np import sqlite3 from os import path league_id = 331933 year = 2019 #espn API ul url = f'https://fantasy.espn.com/apis/v3/games/ffl/leagueHistory/{league_id}?seasonId={year}' resp = requests.get(url) d = resp.json()[0] ...
null
espn_api.py
espn_api.py
py
3,734
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
372562253
# -*- coding: utf-8 -*- """ Created on Wed Sep 4 00:52:15 2019 @author: ibrahim mert oğurcu """ import numpy as np import pandas as pd from sklearn.linear_model import LinearRegression import matplotlib.pyplot as plt data = pd.read_csv("linear.csv") # Verimizi okuyalım print(data) x = data["Square-meter"] y ...
null
Linear-Regression-Numpy.py
Linear-Regression-Numpy.py
py
971
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataFrame.as_matrix", "line_number": 21, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pand...
363214332
from pathlib import Path from typing import TYPE_CHECKING import pytest from ovgenpy.channel import ChannelConfig from ovgenpy.outputs import RGB_DEPTH, \ FFmpegOutput, FFmpegOutputConfig, FFplayOutput, FFplayOutputConfig from ovgenpy.ovgenpy import default_config, Ovgen from ovgenpy.renderer import RendererConfi...
null
tests/test_output.py
test_output.py
py
3,678
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 13, "usage_type": "name" }, { "api_name": "ovgenpy.ovgenpy.default_config", "line_number": 16, "usage_type": "call" }, { "api_name": "ovgenpy.renderer.RendererConfig", "line_number": 16, "usage_type": "call" }, { ...
492079455
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
null
scripts/addons/Tila_Config/copy_vert_ids.py
copy_vert_ids.py
py
15,304
python
en
code
null
code-starcoder2
83
[ { "api_name": "bpy.types", "line_number": 63, "usage_type": "attribute" }, { "api_name": "bpy.types", "line_number": 73, "usage_type": "attribute" }, { "api_name": "bpy.props.FloatProperty", "line_number": 80, "usage_type": "call" }, { "api_name": "bpy.props", ...
107171982
# -*- coding: utf-8 -*- """ Created on Thu Feb 11 21:03:13 2021 @author: Ahmed Fayed """ # data analysis and wrangling import pandas as pd import numpy as np import random as rnd # Visualization import seaborn as sns import matplotlib.pyplot as plt # machine learning from sklearn.linear_model import LogisticRegr...
null
Titanic.py
Titanic.py
py
3,453
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 36, "usage_type": "call" }, { "api_name": "seaborn.FacetGrid", "line_number": 69, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.h...
565411749
import csv from urllib.parse import urljoin from flask import json import datetime from datetime import date from dateutil.relativedelta import relativedelta class Basic_Arguments: def __init__(self): pass def get_dates_and_output_file(self): today = datetime.datetime.now() last_month ...
null
app.py
app.py
py
6,560
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" }, { "api_name": "dateutil.relativedelta.relativedelta", "line_number": 14, "usage_type": "call" }, { ...
180834778
from __future__ import absolute_import import tempfile import logging try: from StringIO import StringIO except ImportError: from io import StringIO import json from dmutils import request_id from dmutils.logging import init_app, RequestIdFilter, JSONFormatter, CustomLogFormatter from dmutils.logging import LO...
null
tests/test_logging.py
test_logging.py
py
5,001
python
en
code
null
code-starcoder2
83
[ { "api_name": "dmutils.logging.RequestIdFilter", "line_number": 16, "usage_type": "call" }, { "api_name": "dmutils.request_id.init_app", "line_number": 21, "usage_type": "call" }, { "api_name": "dmutils.request_id", "line_number": 21, "usage_type": "name" }, { "ap...
261721633
import os import math import pandas as pd # Gerekli kütüphaneleri import ettik from sklearn.neighbors import KNeighborsClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import ...
null
k_enyakin.py
k_enyakin.py
py
4,047
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.isfile", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path", "line_number": 41, "usage_type": "attribute" }, { "api_name": "os.access", "line_number": 41, "usage_type": "call" }, { "api_name": "os.R_OK", "line_number": 41...
299781520
"""Definition of the ClinicalTrials content type """ from zope.interface import implements, directlyProvides from Products.Archetypes import atapi from Products.ATContentTypes.content import base from Products.ATContentTypes.content import schemata from plone.ClinicalTrials import ClinicalTrialsMessageFacto...
null
plone/ClinicalTrials/content/clinicaltrials.py
clinicaltrials.py
py
5,713
python
en
code
null
code-starcoder2
83
[ { "api_name": "Products.ATContentTypes.content.schemata.ATContentTypeSchema.copy", "line_number": 14, "usage_type": "call" }, { "api_name": "Products.ATContentTypes.content.schemata.ATContentTypeSchema", "line_number": 14, "usage_type": "attribute" }, { "api_name": "Products.ATCo...
13339350
from datetime import datetime, timedelta import airflow from airflow import DAG from airflow.hooks.postgres_hook import PostgresHook from airflow.operators.dummy_operator import DummyOperator from airflow.operators.python_operator import PythonOperator default_args = { "owner": "airflow", "depend_on_past": "Fa...
null
dags/mydag.py
mydag.py
py
1,075
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.utcnow", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 13, "usage_type": "call" }, { "api_name": "airflow...
541057019
import time import re import requests import html import csv import re import requests import os import pandas as pd # Nom du fichier de sauvegarde saveAs = 'contact_avocats_marseille_essaie.xlsx' # Récupération du path du fichier script_dir = os.path.dirname(__file__) requests_headers = {'User-Agent':"(Mozilla/5.0 ...
null
scrapper_4/scrapper.py
scrapper.py
py
2,638
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "html.unescape", "line_n...
621146347
from django.shortcuts import render import requests def home(request): req=requests.get('https://api.kawalcorona.com/indonesia/provinsi') data=req.json() return render (request,'TestApi/home.html',{ "name" : data, })
null
TestApi/views.py
views.py
py
242
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 9, "usage_type": "call" } ]
201012296
''' Copyright (c) 2014, UChicago Argonne, LLC See LICENSE file. ''' from setuptools import setup, find_packages import minixs # read the contents of your README file from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md')) as f: long_description =...
null
pypi_install_script/minixes2-0.8.3.tar/setup.py
setup.py
py
1,172
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
193264184
import math import pandas as pd import numpy as np import sys import os lib_path = os.path.abspath(os.path.join('.')) sys.path.append(lib_path) import config def tau_model(file, config): hbar = 1.054571726E-34 k_B = 1.3806488E-23 m_0 = 1.6605E-27 mass = config.configs['mass'] mass_ave = sum(mass) ...
null
opt/thermalConductivity/klemens_model-qeinput.py
klemens_model-qeinput.py
py
4,279
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path.append", "line_nu...
580313570
# ------------------------------------------------------------------------------ # Name: imdb-lookup-folder # Purpose: # # Author: manoj mj # # Created: # Copyright: (c) www.manojmj.com # Licence: # ------------------------------------------------------------------------------ import urllib i...
null
imdb-folder.py
imdb-folder.py
py
5,904
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "urllib.urlopen", "line_number": 31, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 32, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "l...
486286493
# -*- coding: utf-8 -*- from __future__ import division , print_function import sys import os import glob import numpy as np from keras.preprocessing import image from keras.applications.imagenet_utils import preprocess_input, decode_predictions from keras.models import load_model from keras import back...
null
web.py
web.py
py
3,420
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.get_default_graph", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 25, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 27, "usage_type": "call" }, { "api_name": "flas...
74331958
import pandas as pd from wordcloud import WordCloud, STOPWORDS import re import datetime import matplotlib.pyplot as plt from collections import Counter from pathlib import Path data_folder = Path(r"F:/FOR KION") la_tweets = data_folder / "airbnb_geo_labeled.csv" tweetcorpus = pd.read_csv(la_tweets, index_co...
null
Wordcloud_helpers.py
Wordcloud_helpers.py
py
3,231
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime",...
11594280
import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import Dataset, DataLoader from torchvision import datasets, models, transforms from torch.optim import lr_scheduler import os import time import copy import cv2 import numpy as np import pandas as pd import matplotlib.pyplot as plt im...
null
fire_eye/classifier/classifier.py
classifier.py
py
12,057
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.random_split", "line_number": 46, "usage_type": "call" }, { "api_name": "torch.utils", "line_number": 46, "usage_type": "attribute" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 49, "usage_type": "call" }, { "api_na...
516615043
import requests from bs4 import BeautifulSoup import re import json def get_user():#验证 reponse = s.get(url, auth=('1024847824@qq.com', '99271727f')) soup = BeautifulSoup(reponse.text, 'html.parser') p = r'"username":"(.+)".+' p1 = r'(.+)", "urlname".+' get = re.findall(p, soup.text) get1 = re.f...
null
杂项/花瓣网模拟登陆.py
花瓣网模拟登陆.py
py
1,299
python
en
code
null
code-starcoder2
83
[ { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 11, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.Session", "line_n...
353428114
from random import randint import pytest from starlette.applications import Starlette from starlette.endpoints import HTTPEndpoint from starlette.responses import JSONResponse from starlette.routing import Mount, Route from starlette.staticfiles import StaticFiles from starlette.testclient import TestClient from spec...
null
tests/test_plugin_starlette.py
test_plugin_starlette.py
py
4,473
python
en
code
null
code-starcoder2
83
[ { "api_name": "spectree.SpecTree", "line_number": 29, "usage_type": "call" }, { "api_name": "starlette.endpoints.HTTPEndpoint", "line_number": 34, "usage_type": "name" }, { "api_name": "starlette.responses.JSONResponse", "line_number": 46, "usage_type": "call" }, { ...
371206831
import configparser import os import traceback import logging from collections import defaultdict import subprocess import json from pathlib import Path from typing import List, NamedTuple, Tuple, Set, Dict from typing import Optional, Any, Union, Iterable from .cmd import run_cmd from .const import mydir from .typing...
null
lilac2/nvchecker.py
nvchecker.py
py
5,821
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "name" }, { "api_name": "const.mydir", "line_number": 19, "usage_type": "name" }, { "api_name": "const.mydir", "line_nu...
316797063
# -*- coding: utf-8 -*- """ Created on Thu Nov 14 11:18:48 2019 @author: Yehuda """ import numpy as np from sklearn.datasets import load_digits import matplotlib.pyplot as plt sigmoid=lambda x: 1/(1+np.exp(-x)) der_sigmoid=lambda x:sigmoid(x)*(1-sigmoid(x)) # in this algoritm my starting point i...
null
CNN/cnn.py
cnn.py
py
3,168
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.exp", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.random.rand", ...
491497666
from decorators import settings, override_settings from analyser import Analyser from conf.default_config import data from pynput.keyboard import Key @override_settings({'commands': {'exit': '\ALT+\F4'}}) def test_by_default_should_override_only_active_settings(): assert settings.active()['commands']['exit'] == '\...
null
tests/test_analyser/test_analyser.py
test_analyser.py
py
4,505
python
en
code
null
code-starcoder2
83
[ { "api_name": "decorators.settings.active", "line_number": 8, "usage_type": "call" }, { "api_name": "decorators.settings", "line_number": 8, "usage_type": "name" }, { "api_name": "decorators.override_settings", "line_number": 6, "usage_type": "call" }, { "api_name...
9805695
""" setup.py 辅助函数 auto_name 自动获取当前目录为包名 其他 暂时无用 """ import io import os import datetime def auto_name(setup_file): currpath = os.path.dirname(os.path.abspath(setup_file)) return os.path.basename(currpath) def auto_package_data(setup_file, name): currpath = os.path.dirname(os.path.abspath(setup...
null
qutils/qutils/misc.py
misc.py
py
4,078
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.basename", "...
49744346
from django.test import TestCase, Client from django.urls import reverse class ViewsTest(TestCase): def setUp(self): self.client = Client() def test_index(self): response = self.client.get(reverse('index')) self.assertEqual(response.status_code, 200) self.assertTemplateUsed(res...
null
project/foolinterview/main/tests.py
tests.py
py
637
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.test.TestCase", "line_number": 4, "usage_type": "name" }, { "api_name": "django.test.Client", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls....
503782718
import catboost import os import timeit CUR_DIR = os.path.dirname(os.path.abspath(__file__)) def get_model(classes=None, iterations=30): if len(classes) == 1: loss_function = 'Logloss' else: loss_function = 'MultiClass' model = catboost.CatBoostClassifier( l2_leaf_reg=7, ...
null
08-unseen-sc02/train.py
train.py
py
1,395
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "catboost.CatBoostClassifier...
221566223
from django.contrib import admin from django.core.exceptions import ValidationError from django import forms from .models import Redirect class RedirectModelForm(forms.ModelForm): class Meta: model = Redirect fields = ( 'site', 'from_url', 'to_url', 'http_status', 'status', ...
null
robustredirects/admin.py
admin.py
py
1,153
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.forms.ModelForm", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "models.Redirect", "line_number": 10, "usage_type": "name" }, { "api_name": "django.core.ex...
320094842
import discord from discord import utils from discord.ext import commands class ModerationCog(commands.Cog): def __init__(self, client: commands.Bot): self.client = client # Clear @commands.command( name='clear', aliases=['purge'], usage='[amount=10] [channel]', d...
null
Cogs/moderation.py
moderation.py
py
4,942
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.ext.commands.Cog", "line_number": 6, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 6, "usage_type": "name" }, { "api_name": "discord.ext.commands.Bot", "line_number": 8, "usage_type": "attribute" }, { "api...
584762173
import speech_recognition as sr import pyttsx3 import pywhatkit listener = sr.Recognizer() engine = pyttsx3.init() class Voice(): @classmethod def messague(self): print("hola star") @classmethod def voz(self): voices = engine.getProperty('voices') res = Voice() res.messague()
null
.history/project/voice/voice_20210404084555.py
voice_20210404084555.py
py
310
python
en
code
null
code-starcoder2
83
[ { "api_name": "speech_recognition.Recognizer", "line_number": 5, "usage_type": "call" }, { "api_name": "pyttsx3.init", "line_number": 6, "usage_type": "call" } ]
26236016
from bs4 import BeautifulSoup import requests import os import re import sys import multiprocessing import time import psutil import os import socket import gevent from gevent import monkey monkey.patch_all() header = {'Referer': 'https://asiansister.com/'} socket.setdefaulttimeout(5) def pictcount()...
null
downpic.py
downpic.py
py
4,132
python
en
code
null
code-starcoder2
83
[ { "api_name": "gevent.monkey.patch_all", "line_number": 13, "usage_type": "call" }, { "api_name": "gevent.monkey", "line_number": 13, "usage_type": "name" }, { "api_name": "socket.setdefaulttimeout", "line_number": 16, "usage_type": "call" }, { "api_name": "time.t...
62037671
import socket import json import argparse from pathlib import Path # python file_receiving_udp.py --ip 192.168.43.26 --port 5001 parser = argparse.ArgumentParser(description='Receiving JSON data through UDP') parser.add_argument("--file", dest="out_file", required=False, ...
null
Img_Processing_Part/file_transfer/file_receiving_udp.py
file_receiving_udp.py
py
2,019
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 34, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 34, "usage_type": "attribute" }, { "api_name": "socket.SOCK_...
110244612
from flask import request, jsonify from config import CONFIG from wordStore.controller.word_list import range_iter_words from . import API @API.route('/wordlist/<category>', methods=['GET']) def range_words(category): args = request.args start = args['start'] end = args['end'] # validate args tr...
null
wordStore/api/word_list.py
word_list.py
py
793
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.request.args", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.jsonify", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.jsonify", ...
395721486
from django.shortcuts import render, redirect from core_app.forms import publicarObra, EditarObra from core_app.models import Obra # Create your views here. def inicio_real(request): return render(request, 'core_app/home.html') def home(request): return render(request,'core_app/home.html') def galeria(req...
null
ea4_proy/core_app/views.py
views.py
py
2,123
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.render", "line_number": 8, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "core_app.models.Obra.objects.all", "line_number": 15, "usage_type": "call" }, { "a...
546392121
# coding=utf-8 # Created by Meteorix at 2019/8/16 import os from vision_case.model import VisionModel, DIR_PATH from service_streamer import ThreadedStreamer, ManagedModel, Streamer, RedisStreamer, RedisWorker import torch BATCH_SIZE = 8 if torch.cuda.is_available(): device = "cuda" else: device = "cpu" # ...
null
tests/test_service_streamer.py
test_service_streamer.py
py
3,547
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.cuda.is_available", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 12, "usage_type": "attribute" }, { "api_name": "service_streamer.ManagedModel", "line_number": 24, "usage_type": "name" }, { "api_name": ...
20697291
from flask import (Flask, render_template, url_for, redirect, request, make_response, flash, jsonify, session) from custom_converters.float_converter import ConvertFloat import firebase_admin from firebase_admin import db, credentials from config import SECRET_KEY import json impo...
null
hello.py
hello.py
py
6,155
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 25, "usage_type": "call" }, { "api_name": "custom_converters.float_converter.ConvertFloat", "line_number": 26, "usage_type": "name" }, { "api_name": "firebase_admin.credentials.Certificate", "line_number": 28, "usage_type": "cal...
63233078
import dash import dash_html_components as html import dash_core_components as dcc from dash.dependencies import Input, Output import dash_bootstrap_components as dbc import locale import altair as alt locale.setlocale(locale.LC_ALL, "") import os, sys, inspect currentdir = os.path.dirname(os.path.abspath(inspect.ge...
null
src/python/app.py
app.py
py
4,531
python
en
code
null
code-starcoder2
83
[ { "api_name": "locale.setlocale", "line_number": 9, "usage_type": "call" }, { "api_name": "locale.LC_ALL", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line...
46960015
""" contains chapter object and chapter generating utilities """ import os import html import uuid import imghdr import requests import lxml.html import urllib.parse from jinja2 import Template from typing import Optional from .const import log, validate, xmlprettify, SUPPORTED_TAGS #** Variables **# __all__ = [ ...
null
pypub/chapter.py
chapter.py
py
8,888
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.Session", "line_number": 25, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 34, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 35, "usage_type": "name" }, { "api_name": "typing.Optional", ...
362990580
from django.db import models from django.contrib.auth.models import User class Game(models.Model): players = models.ManyToManyField( User, through='GameMembership', through_fields=('game', 'user'), ) created_at = models.DateTimeField(null=False, auto_now_add=True) updated_at = m...
null
alpha_beta_iota/app/models.py
models.py
py
3,330
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.ManyToManyField", "line_number": 5, "usage_type": "call" }, { "api_na...
85269513
# -*- coding: utf-8 -*- import os import pickle import json class FacebookProfile: def __init__(self, pid, nombre, amigos): self.nombre = nombre self.pid = pid self.amigos = amigos class TwitterProfile: def __init__(self, pid, handle, seguidos, seguidores): ...
null
Actividades/AC14/main.py
main.py
py
7,389
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 39, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 46, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 58, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 92,...
59291775
from django.conf.urls import url from news.views import * urlpatterns = [ url(r'^api/feed/$', feed), url(r'^api/news/(?P<pk>\d+)/$', news), url(r'^api/filter_news/$', filter_news), url(r'^api/get_csrf_token/$', get_csrf_token), url(r'^api/get_configuration_values/$', get_configuration_values), ...
null
news/urls.py
urls.py
py
477
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "news.views", "line_number": 7, "usage_type": "argument" }, { "api_name": "django.conf.url...
491234278
import sopel.module import requests API_URL = "https://query.yahooapis.com/v1/public/yql" CARDS = [ (338, "north"), (293, "north west"), (247, "west"), (203, "south west"), (157, "south"), (110, "south east"), (67, "east"), (23, "north east"), (0, "north") ] def req_weather(lo...
null
weather.py
weather.py
py
2,001
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "sopel.module.module.rule", "line_number": 43, "usage_type": "call" }, { "api_name": "sopel.module.module", "line_number": 43, "usage_type": "attribute" }, { "api_name": "sopel....
310041201
import os import sys import shutil from pathlib import Path import xml.etree.ElementTree as ET import subprocess as sp import argparse as ap def usage(): print("Usage: python {} <APK file to patch>".format(sys.argv[0])) def die(msg): print(msg) exit(1) def check(proc): chk = True if os.name ==...
null
patch.py
patch.py
py
4,110
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.name", "line_number": 21, "usage_type": "attribute" }, { "api_name": "subprocess.check_call", "line_number": 23, "usage_type": "call" }, { "api_name": "subprocess.DEVNULL",...
470891879
import argparse from nilearn import image import nipype.pipeline.engine as pe from bids import BIDSLayout import nipype.interfaces.utility as niu from nipype.algorithms.confounds import ACompCor, ComputeDVARS from niworkflows.interfaces.utils import AddTPMs import os from fmriprep.interfaces import DerivativesDataSink ...
null
analysis/preprocess/get_confounds.py
get_confounds.py
py
8,290
python
en
code
null
code-starcoder2
83
[ { "api_name": "bids.BIDSLayout", "line_number": 25, "usage_type": "call" }, { "api_name": "bids.BIDSLayout", "line_number": 26, "usage_type": "call" }, { "api_name": "utils.get_derivative", "line_number": 28, "usage_type": "call" }, { "api_name": "utils.get_deriva...
154388850
from selenium import webdriver from random import * proxies = ["169.57.157.148:25", "169.57.157.146:8123", "169.57.157.148:25","169.57.157.148:80"] def configurar(): #proxy = proxies[randint(0,(len(proxies)-1))] proxy = '169.57.157.146:8123' opcoes = webdriver.ChromeOptions() opcoes.add_argu...
null
Configuracoes/opcoes.py
opcoes.py
py
697
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" } ]
263030956
""" Access control functions """ import logging from django.contrib.auth.models import Group, User from django.db.models import Q, QuerySet from django.http import HttpRequest from rest_framework.request import Request import core_main_app.permissions.rights as rights from core_main_app.access_control.exceptions impo...
null
core_parser_app/access_control.py
access_control.py
py
4,397
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.Group.objects.filter", "line_number": 35, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.Group.objects", "line_number": 35, "usage_ty...