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
353107612
import hashlib import hmac import time from collections import OrderedDict from typing import Any, Dict, Optional from urllib.parse import quote, urlencode, urlsplit from hummingbot.core.web_assistant.auth import AuthBase from hummingbot.core.web_assistant.connections.data_types import RESTRequest, WSRequest class F...
null
hummingbot/connector/exchange/ftx/ftx_auth.py
ftx_auth.py
py
3,249
python
en
code
null
code-starcoder2
83
[ { "api_name": "hummingbot.core.web_assistant.auth.AuthBase", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 14, "usage_type": "name" }, { "api_name": "hummingbot.core.web_assistant.connections.data_types.RESTRequest", "line_number":...
56349815
import csv import random as rand inpath_train = "data/twitter/twitter_train.csv" inpath_valid = "data/twitter/twitter_valid.csv" import numpy as np from scipy import stats def noise_mtx(s, n_classes): return (1.0-s) * np.identity(n_classes) + float(s / n_classes) def gen_rand_label(noise, label): dist = nois...
null
data/scripts/rand_noise_generation.py
rand_noise_generation.py
py
1,953
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.identity", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.stats.rv_discrete", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.array", ...
541972201
# -*- coding: utf-8 -*- """ Created on Mon Apr 16 12:09:24 2018 @author: T901 """ import numpy as np from numpy import linalg as LA import matplotlib.image as mpimg import matplotlib.pyplot as plt def do_svd(A): U, S, V = LA.svd(A) m = A.shape[0] n = A.shape[1] # checking if U, V are orthog...
null
py/26_SVC - singular value decomposition - img compr.py
26_SVC - singular value decomposition - img compr.py
py
3,186
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.linalg.svd", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.linalg.norm", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.linalg", "l...
267273069
__author__ = 'Hans Kristian Lunda, Mikko Rekstad' __email__ = 'hans.kristian.lunda@nmbu.no, mikkreks@nmbu.no' from biosim.fauna import Fauna from biosim.cell import Cell, Jungle, Ocean, Mountain, Savannah, Desert from biosim.map import Map from biosim.simulation import BioSim import mock import unittest # Testing th...
null
tests/test_map.py
test_map.py
py
9,166
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "biosim.map.Map", "line_number": 45, "usage_type": "call" }, { "api_name": "biosim.map.Map", "line_number": 49, "usage_type": "call" }, { "api_name": "biosim.simulatio...
88368208
import random from matplotlib import pyplot as plt import numpy as np class rand_distribution_generator: def __init__(self, func, start, stop): self.func = func self.start = start self.stop = stop self.val_number = 1000 self.values = [] for i in range(self.val_numbe...
null
Random generator.py
Random generator.py
py
1,534
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.uniform", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 45, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 56, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
31345371
import requests import bs4 as bs def query(my_url): session = requests.Session() response = session.get(my_url) soup = bs.BeautifulSoup(response.content,"html.parser") return soup def yt(search): url = "https://www.youtube.com/results?search_query=" search = "+".join(search.split(" ")) s...
null
youtube_url.py
youtube_url.py
py
774
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.Session", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" } ]
229111230
from aip import AipBodyAnalysis import cv2 import threading,io from PIL import Image, ImageDraw, ImageFont import numpy as np APP_ID="*****" API_KEY="*****" SECRET_KEY="**********" client =AipBodyAnalysis(APP_ID, API_KEY, SECRET_KEY) enname=["Face","Point","Palm","Fist","Ok","Prayer","Congratulation","Honour","Heart_s...
null
aiface.py
aiface.py
py
2,725
python
en
code
null
code-starcoder2
83
[ { "api_name": "aip.AipBodyAnalysis", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 15, "usage_type": "attribute" }, { "api_name": "PIL.Image.fromarray", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Image"...
343299093
from collections import UserList, namedtuple import aiohttp __all__ = ['Results'] class Results(UserList): """ The results of a download. """ def __init__(self, *args): super().__init__(*args) self._errors = list() self._error = namedtuple("error", ("filepath_partial", "url",...
null
parfive/results.py
results.py
py
1,795
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.UserList", "line_number": 8, "usage_type": "name" }, { "api_name": "collections.namedtuple", "line_number": 15, "usage_type": "call" }, { "api_name": "aiohttp.ClientResponse", "line_number": 19, "usage_type": "attribute" }, { "api_name":...
545219366
from onnx.mapping import NP_TYPE_TO_TENSOR_TYPE from onnx import helper from qumico.handlers.frontend.tflitehandler import TFLiteBaseHandler from qumico.handlers.frontend.tflitehandler import tflite_op from qumico.handlers.frontend.tflite.tflite_decorator import tflite_op_conf @tflite_op("LOGICAL_NOT") class LOGICAL...
null
qumico/handlers/frontend/tflite/logical_not.py
logical_not.py
py
1,505
python
en
code
null
code-starcoder2
83
[ { "api_name": "qumico.handlers.frontend.tflitehandler.TFLiteBaseHandler", "line_number": 10, "usage_type": "name" }, { "api_name": "onnx.helper.make_tensor_value_info", "line_number": 22, "usage_type": "call" }, { "api_name": "onnx.helper", "line_number": 22, "usage_type"...
145598979
import yaml if __name__ == '__main__': data = yaml.load(open("./plik.yaml")) print("\n \n \n Hello \n \n \n") dh = data["dh"] print(dh) print("\n") index = 0 h=0 wynik = open("wynik.yaml","w") for x in dh: name = "j"+ str(index)+":" xyz = str(x[1])+" 0.0 "+str(h) ...
null
catkin_ws/src/zad4/urdf/zad2/main.py
main.py
py
574
python
en
code
null
code-starcoder2
83
[ { "api_name": "yaml.load", "line_number": 4, "usage_type": "call" } ]
603737032
######################################################################## # Classes for generating prediction, given a model, for different setups of the problem ######################################################################## from classes.ItemSet import ItemSet3 import numpy as np import multiprocessing as mp f...
null
shared/classes/.ipynb_checkpoints/ModelPrediction-checkpoint.py
ModelPrediction-checkpoint.py
py
8,234
python
en
code
null
code-starcoder2
83
[ { "api_name": "pickle.load", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 21, "usage_type": "call" }, { "api_name": "classes.ItemSet.ItemSet3", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "l...
253809107
import numpy as np import tensorflow as tf import time from datetime import timedelta from sklearn.preprocessing import MinMaxScaler import sys sys.path.append('..') #unfortun0ately I can't find a better way to get stuff from sibling folders from score import get_batch, get_test, get_data_size import data_loader.loade...
null
player_model/model.py
model.py
py
4,168
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "data_loader.loader.get_players_collection", "line_number": 22, "usage_type": "call" }, { "api_name": ...
353797463
import sys import os import numpy import argparse from scipy.constants import c # Import local codes # sys.path.append("../../beam_perturbations/code/tile_beam_perturbations/") sys.path.append("../../CorrCal_UKZN_Development/corrcal") from corrcal import grid_data from src.covariance import thermal_noise from src.ra...
null
simulate_calibration.py
simulate_calibration.py
py
9,699
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.load", "line_numb...
364056609
import pygame player_front_frames = [ pygame.image.load(f'assets/images/inquisitor/front/normal/{i}.png') for i in range (1, 5) ] player_back_frames = [ pygame.image.load(f'assets/images/inquisitor/back/normal/{i}.png') for i in range (1, 5) ] player_right_frames = [ pygame.imag...
null
assets.py
assets.py
py
4,803
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.image.load", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.image", ...
244170366
#!/usr/bin/python import sys import rospy import actionlib from people_msgs.msg import People from geometry_msgs.msg import PoseStamped, Point from tinker_msgs.msg import FollowGoal from tinker_msgs.msg import FollowAction from tinker_msgs.msg import FollowResult from actionlib_msgs.msg import GoalStatus import tf fr...
null
tinker_human_track/script/simple_follow.py
simple_follow.py
py
3,385
python
en
code
null
code-starcoder2
83
[ { "api_name": "rospy.Publisher", "line_number": 20, "usage_type": "call" }, { "api_name": "geometry_msgs.msg.PoseStamped", "line_number": 20, "usage_type": "argument" }, { "api_name": "actionlib.SimpleActionServer", "line_number": 21, "usage_type": "call" }, { "ap...
109085627
from flask import request from flask_restful import Resource from database import db class CrabType(db.Model): __tablename__ = 'crab_type' id = db.Column(db.Integer, primary_key=True, autoincrement=True) common_name = db.Column(db.String) scientific_name = db.Column(db.String) def __init__(self, ...
null
model/crab_type.py
crab_type.py
py
1,330
python
en
code
null
code-starcoder2
83
[ { "api_name": "database.db.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "database.db", "line_number": 6, "usage_type": "name" }, { "api_name": "database.db.Column", "line_number": 8, "usage_type": "call" }, { "api_name": "database.db", ...
498749421
import scrapy from crawler.items import JobItem class OlxComplete(scrapy.Spider): name = "olx_complete" allowed_domains = ["olx.in"] start_urls = [ # 'https://www.olx.in/mumbai/customer-service/?page=1', # # 'https://www.olx.in/mumbai/online-part-time/?page=1', # 'https://www.olx.i...
null
crawler/spiders/OlxComplete.py
OlxComplete.py
py
4,562
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" }, { "api_name": "crawler.items.JobItem", "line_number": 84, "usage_type": "call" } ]
653098540
from pymongo import MongoClient from bson.objectid import ObjectId import json connect = MongoClient("mongodb://localhost:27017/calculated") db= connect.calculated historyData=db.Station_history_data hotCounter=0 years=[2012,2013,2014,2015,2016,2017,2018,2019,2020] for j in years: print(j) station=db.Station_...
null
Data/dynamicTagsForHistory.py
dynamicTagsForHistory.py
py
2,478
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymongo.MongoClient", "line_number": 4, "usage_type": "call" } ]
472926634
# importing all relevant libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt #import statsmodels.api as sm import seaborn as sns sns.set() from sklearn.linear_model import LinearRegression #Loading data into variablre using Pandas data=pd.read_csv('1.01. Simple linear regression.csv') data...
null
MachineAndDeepLearning/LinearRegression/LinearRegression_SAT_GPA_Example.pyw
LinearRegression_SAT_GPA_Example.pyw
pyw
1,053
python
en
code
null
code-starcoder2
83
[ { "api_name": "seaborn.set", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplo...
73172874
# This Python file uses the following encoding: utf-8 import sys from PySide2.QtWidgets import QApplication, QMainWindow,QHeaderView from PySide2 import QtWidgets from window import * from scapy.all import * from getmac import get_mac_address class Packet_Error(RuntimeError): def __init__(self, msg): ...
null
pasoib_8.py
pasoib_8.py
py
17,269
python
en
code
null
code-starcoder2
83
[ { "api_name": "PySide2.QtWidgets.QMainWindow", "line_number": 13, "usage_type": "name" }, { "api_name": "PySide2.QtWidgets.QMainWindow.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "PySide2.QtWidgets.QMainWindow", "line_number": 15, "usage_type": "na...
470930733
from django.urls import path, re_path from . import views urlpatterns = [ path('login/', views.LoginAPIView.as_view()), path('email/', views.CheckEmailAPIView.as_view()), path('username/', views.CheckUserAPIView.as_view()), path('sms/', views.SendSmsAPIView.as_view()), path('register/', views.Regis...
null
qzjg_back/apps/user/urls.py
urls.py
py
351
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
475378058
from math import nan from flask import * app=Flask(__name__) app.config["JSON_AS_ASCII"]=False app.config["TEMPLATES_AUTO_RELOAD"]=True # import mysql.connector import pymysql.cursors import pymysql # from flask import jsonify import json # import urllib.request as request import datetime import random import reques...
null
app.py
app.py
py
15,497
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymysql.connect", "line_number": 42, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 47, "usage_type": "attribute" }, { "api_name": "pymysql.connect", "line_number": 77, "usage_type": "call" }, { "api_name": "pymysql.cursors"...
511067530
from bs4 import BeautifulSoup from urllib2 import urlopen import sqlite3 as lite import sys import os def make_soup(url): html = urlopen(url).read() return BeautifulSoup(html, "lxml") def create_tables(): conn = lite.connect("data.db") c = conn.cursor() try: c.execute('''CREA...
null
get_data.py
get_data.py
py
2,510
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib2.urlopen", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlite3.OperationalEr...
188539176
from mmdet.apis import init_detector, inference_detector, show_result import os from mmcv import Config from tqdm import tqdm import shutil # config_file = 'cdcn_text_expr.py' config_file = 'cdcn_v1.py' checkpoint_file = '../work_dirs/debug_ctw/latest.pth' cfg = Config.fromfile(config_file) save_dir = 'show' if os.pa...
null
expr/demo.py
demo.py
py
1,130
python
en
code
null
code-starcoder2
83
[ { "api_name": "mmcv.Config.fromfile", "line_number": 11, "usage_type": "call" }, { "api_name": "mmcv.Config", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_n...
208656271
# encoding:utf-8 import unittest import asyncio import aiohttp import re def get_html(url): # htmlを取得する # @return string response = yield from aiohttp.request("GET", url) return (yield from response.text()) def is_url(url): if url is None: return False reg = r"https?://[\w/:%#\$&\?\...
null
main.py
main.py
py
1,101
python
en
code
null
code-starcoder2
83
[ { "api_name": "aiohttp.request", "line_number": 12, "usage_type": "call" }, { "api_name": "re.match", "line_number": 20, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 27, "usage_type": "attribute" }, { "api_name": "asyncio.get_event_loo...
292194013
from typing import Dict, List from src.domain.models import Users from src.domain.test import mock_users class FindUserSpy: """Class to define use case select user""" def __init__(self, user_repository: any): self.user_repository = user_repository self.id_param = {} self.by_id_param =...
null
src/data/test/find_user_spy.py
find_user_spy.py
py
1,553
python
en
code
null
code-starcoder2
83
[ { "api_name": "src.domain.test.mock_users", "line_number": 23, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 16, "usage_type": "name" }, { "api_name": "src.domain.models....
274457518
import os import unittest from django.core.management import call_command from django.test import TestCase from frontend.models import SHA, PCT def setUpModule(): SHA.objects.create(code='Q48') PCT.objects.create(code='06F', name='NHS Bedfordshire') def tearDownModule(): ...
null
openprescribing/frontend/tests/commands/test_import_org_names.py
test_import_org_names.py
py
1,752
python
en
code
null
code-starcoder2
83
[ { "api_name": "frontend.models.SHA.objects.create", "line_number": 9, "usage_type": "call" }, { "api_name": "frontend.models.SHA.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "frontend.models.SHA", "line_number": 9, "usage_type": "name" }, { ...
219898968
#!/usr/bin/env python3 # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 import os import shlex import subprocess import sys from typing import List THIS_DIR = os.path.dirname(__file__) IBEX_ROOT = os.path.join(THIS_DIR, ...
null
dv/uvm/core_ibex/scripts/scripts_lib.py
scripts_lib.py
py
1,572
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
249686606
from utils import variables from logic_gates.quantum_gates import xnor """ Operands do not contain target!!! """ def weak_summation(bqm, operands, c_summation=variables.c_summation): """ This function uses an environment variable c_summation that ensures that make qubits "agree" with each other. A...
null
operations/simple_operations.py
simple_operations.py
py
2,997
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.variables.c_summation", "line_number": 11, "usage_type": "attribute" }, { "api_name": "utils.variables", "line_number": 11, "usage_type": "name" }, { "api_name": "utils.variables.c_summation", "line_number": 42, "usage_type": "attribute" }, { ...
187910227
#!/usr/bin/env python3 import argparse import os import json def merge_video_json( json_dict, video_json, current_activity_id ): json_dict["filesProcessed"].extend(video_json["filesProcessed"]) for activity in video_json["activities"]: activity["activityID"] += current_activity_id json_dict["a...
null
scripts/cli_helpers/merge_videos.py
merge_videos.py
py
2,392
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.exists", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number...
332276550
# ------------------------------------------- # Data classes for resonator bit-map config. # ------------------------------------------- from dataclasses import dataclass, field from typing import List, Dict from pycqed.utilities.custom_exceptions import ( IdentifierFeedlineException, ) from pycqed.utilities.readwr...
null
pycqed/instrument_drivers/meta_instrument/LutMans/ro_lutman_config.py
ro_lutman_config.py
py
5,571
python
en
code
null
code-starcoder2
83
[ { "api_name": "dataclasses.field", "line_number": 26, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 27, "usage_type": "name" }, { "api_name": "dataclasses.field", "line_number": 27, "usage_type": "call" }, { "api_name": "dataclasses.dataclass...
473550723
###================================================== # HELPER FUNCTIONS (Part 1) ###================================================== import numpy as np import glob # to read files from dir import cv2 import matplotlib import matplotlib.pyplot as plt import matplotlib.image as mpimg # Visualization function to be us...
null
pipeline_helper_functions.py
pipeline_helper_functions.py
py
24,655
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplots_adjust", "line_number": 19, "usage_type": "call" }, { "ap...
47055608
#coding:utf-8 __author__ = 'vova' """ pip3 install mongoengine pip3 install tornado """ from tornado import httpserver from tornado.ioloop import IOLoop import tornado.web import os import tornado.web from tornado import web from controllers import MainHandler, BudgetHandler, LoginHandler, ProfileHandler # урлы наше...
null
run.py
run.py
py
1,504
python
en
code
null
code-starcoder2
83
[ { "api_name": "tornado.web", "line_number": 19, "usage_type": "attribute" }, { "api_name": "controllers.MainHandler", "line_number": 22, "usage_type": "name" }, { "api_name": "controllers.ProfileHandler", "line_number": 23, "usage_type": "name" }, { "api_name": "c...
476669222
# -*- coding: utf-8 -*- import csv import xlsxwriter import MySQLdb import MySQLdb.cursors import os import glob import unicodedata from xlrd import open_workbook from xlutils.copy import copy from copy import deepcopy import locale class LetterPosition: letter = "", location = "" def __init__(self): ...
null
MST/5-DERCalculation/PredictDiacriticsAndLetterApproach/DER_Sukun_Fatha_Dictionary_Correction.py
DER_Sukun_Fatha_Dictionary_Correction.py
py
29,606
python
en
code
null
code-starcoder2
83
[ { "api_name": "xlsxwriter.Workbook", "line_number": 58, "usage_type": "call" }, { "api_name": "xlsxwriter.Workbook", "line_number": 66, "usage_type": "call" }, { "api_name": "MySQLdb.connect", "line_number": 76, "usage_type": "call" }, { "api_name": "MySQLdb.curso...
592241299
from django.urls import path from . import views app_name = 'billing' urlpatterns = [ path('payment/', views.Payment, name='payment'), path('receipt/', views.ChargeDetailView.as_view(), name='receipt'), path('dashboard/', views.ChargeListView.as_view(), name='billing'), ]
null
billing/urls.py
urls.py
py
287
python
en
code
null
code-starcoder2
83
[ { "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", "line_number": 9, "usage_type": "call" } ]
332218847
__author__ = 'Administrator' import sys reload(sys) sys.setdefaultencoding('utf-8') from django import template register = template.Library() from django.utils.text import Truncator from django.utils.encoding import force_unicode import re def cut_str(str, length=10): is_encode = False tr...
null
PycharmProjects/seaapp/flylblog/1/blog/templatetags/cutecoding.py
cutecoding.py
py
1,088
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.setdefaultencoding", "line_number": 4, "usage_type": "call" }, { "api_name": "django.template.Library", "line_number": 6, "usage_type": "call" }, { "api_name": "django.template", "line_number": 6, "usage_type": "name" } ]
557012431
from typing import List, Optional, Union, Dict, Any import IPython import lazy_import pl = lazy_import.lazy_module('pytorch_lightning') np = lazy_import.lazy_module('numpy') torch = lazy_import.lazy_module('torch') nn = lazy_import.lazy_module('torch.nn') torch_data = lazy_import.lazy_module('torch.utils.data') AdamW...
null
mowgli/predictor/BaseLMPredictor.py
BaseLMPredictor.py
py
8,649
python
en
code
null
code-starcoder2
83
[ { "api_name": "lazy_import.lazy_module", "line_number": 6, "usage_type": "call" }, { "api_name": "lazy_import.lazy_module", "line_number": 7, "usage_type": "call" }, { "api_name": "lazy_import.lazy_module", "line_number": 8, "usage_type": "call" }, { "api_name": "...
472518574
#!/usr/bin/python3 # Takes in a URL, sends a request to the URL and # displays the value of the variable X-Request-Id # in the response header if __name__ == "__main__": '''argv[1] is the passed url and argv[2] the email''' import requests from sys import argv if len(argv) == 1: q = "" els...
null
0x11-python-network_1/8-json_api.py
8-json_api.py
py
655
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "argument" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 16, "usage_type": "call" } ]
93959052
import pytest import tutils import pathlib import pdoc.extract import pdoc.static @pytest.mark.parametrize( "modspec,ident,path", [ ("./modules/one", "one", "one.html"), ("./modules/dirmod", "dirmod", "dirmod.html"), ("./modules/submods", "submods", "submods/index.html"), ("./...
null
test/test_static.py
test_static.py
py
1,934
python
en
code
null
code-starcoder2
83
[ { "api_name": "tutils.tdir", "line_number": 22, "usage_type": "call" }, { "api_name": "pdoc.extract.extract.extract_module", "line_number": 23, "usage_type": "call" }, { "api_name": "pdoc.extract.extract", "line_number": 23, "usage_type": "attribute" }, { "api_nam...
371795746
# -*- coding:utf-8 -*- # @Time : 2019-09-05 # @Author:lqc # @Email:572948875@qq.com # File : learn_element_location.py # 元素定位 # id、classname、tagname、name from selenium import webdriver # 启动谷歌浏览器,开启与浏览器之间的会话 driver = webdriver.Chrome() # 访问一个网页 driver.get("https://www.baidu.com") # 方式一 ele = driver.find_element_by_...
null
WEB_AUTO_test/element_location_84/learn_element_location.py
learn_element_location.py
py
1,672
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 13, "usage_type": "name" } ]
327304555
""" Temporal aggregation class This class defines the object TemporalAggregation and its methods to perform temporal aggregation on time series of multi-regional energy systems """ import logging import numpy as np import pandas as pd import csv from pathlib import Path import esmc.preprocessing.dat_print as dp from ...
null
esmc/preprocessing/temporal_aggregation.py
temporal_aggregation.py
py
15,486
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 41, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 55, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 56, "usage_type": "call" }, { "api_name": "pandas.DataFrame", ...
43789402
# -*- coding: utf-8 -*- # Copyright 2023 Google LLC # # 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
google/cloud/vision_v1/types/product_search.py
product_search.py
py
8,095
python
en
code
null
code-starcoder2
83
[ { "api_name": "proto.module", "line_number": 27, "usage_type": "call" }, { "api_name": "proto.Message", "line_number": 36, "usage_type": "attribute" }, { "api_name": "google.cloud.vision_v1.types.geometry.BoundingPoly", "line_number": 77, "usage_type": "attribute" }, ...
375238126
#importing the necessary libraries import nltk.data tokenizer = nltk.data.load('tokenizers/punkt/english.pickle') from gensim.models import word2vec import pandas as pd from bs4 import BeautifulSoup import re #letters = re.sub("[^a-zA-Z]"," ",ex.get_text()) #Loading the labelled as well as unlabelled training data t...
null
major.py
major.py
py
2,275
python
en
code
null
code-starcoder2
83
[ { "api_name": "nltk.data.data.load", "line_number": 3, "usage_type": "call" }, { "api_name": "nltk.data.data", "line_number": 3, "usage_type": "attribute" }, { "api_name": "nltk.data", "line_number": 3, "usage_type": "name" }, { "api_name": "pandas.read_csv", ...
577862473
#!/usr/bin/python import matplotlib import numpy from pylab import * from matplotlib import pyplot as pl from matplotlib import axis as ax from matplotlib.ticker import MultipleLocator#, FormatStrFormatter #from scipy import integrate from matplotlib.backends.backend_pdf import PdfPag...
null
trash_py/130715_shifted_dF_DF.py
130715_shifted_dF_DF.py
py
7,496
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.backends.backend_pdf.PdfPages", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 13, "usage_type": "call" }, { "api_name": "...
393646036
import torch from torch import nn from torch import optim from torch.nn import functional as F from torch.utils.data import TensorDataset, DataLoader from torch import optim import numpy as np import time import re, os from learn_model_CNN_SVM import learn_model from copy import deepcopy from sk...
null
pre_train_CNN_SVM.py
pre_train_CNN_SVM.py
py
12,180
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.mean", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.sum", "line_number...
123809911
''' Created on 22.3.2012 @author: matej ''' import sys try: import unittest2 as unittest except ImportError: import unittest import tap import logging import subprocess import os.path class Test(unittest.TestCase): def test_simple_statement(self): name = "simple pass statement" result = ta...
null
test/test_tap.py
test_tap.py
py
2,694
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 16, "usage_type": "attribute" }, { "api_name": "tap.PASS", "line_number": 19, "usage_type": "attribute" }, { "api_name": "tap.TAPGenerator", "line_number": 21, "usage_type": "call" }, { "api_name": "tap.SKIP", ...
21009887
import pytest from sciwing.modules.embedders.bert_embedder import BertEmbedder import itertools from sciwing.utils.common import get_system_mem_in_gb bert_base_types = [ "bert-base-uncased", "bert-base-cased", "scibert-base-cased", "scibert-sci-cased", "scibert-base-uncased", "scibert-sci-uncas...
null
tests/modules/embedders/test_bert_embedder.py
test_bert_embedder.py
py
2,619
python
en
code
null
code-starcoder2
83
[ { "api_name": "itertools.product", "line_number": 19, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 20, "usage_type": "call" }, { "api_name": "sciwing.utils.common.get_system_mem_in_gb", "line_number": 22, "usage_type": "call" }, { "api...
110291979
#!/usr/bin/env python2.7 import sys,re,io from collections import defaultdict def main(): args = getArgs() tmap, herit = args.tmap, args.herit tmap, geneMap = storeTmap(tmap = tmap) herit = storeHerit(herit = herit) getHeritIsosPerGene(herit = herit, tmap = tmap) def getArgs(): import argparse parser = argpar...
null
gen_reg_as_pDeltoides/eqtl/herit_isos_per_reg_gene.py
herit_isos_per_reg_gene.py
py
1,548
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 34, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 45, "usage_type": "call" }, { "api_name"...
242634213
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This script modifies Proto-Slavic pages containing links to Slovene words # to contain the tonal version of the word by looking it up in the entry. import pywikibot, re, sys, argparse import blib from blib import getparam, rmparam, msg, site GRAVE = "\u0300" ACUTE...
null
fix_proto_slavic_slovene.py
fix_proto_slavic_slovene.py
py
8,041
python
en
code
null
code-starcoder2
83
[ { "api_name": "re.sub", "line_number": 31, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 32, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 33, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 34, "usage_type"...
337341864
import argparse import pickle import os import sys from pdb import set_trace as bp import numpy as np import torch #import gym import my_pybullet_envs import pybullet as p import time from a2c_ppo_acktr.envs import VecPyTorch, make_vec_envs from a2c_ppo_acktr.utils import get_render_func, get_vec_normalize import inspe...
null
main_test_grasp_move_place_cyl_s.py
main_test_grasp_move_place_cyl_s.py
py
12,336
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 20, "usage_type": "call" }, { "api_name": "inspect.getfile", "l...
619892729
# -*- coding: utf-8 -*- # 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”) # # 除非遵守当前许可,否则不得使用本软件。 # # * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件): # 遵守 Apache License 2.0(下称“Apache 2.0 许可”),您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。 # 除非法律有要求或以书面形式达成协议,否则本软件分发时需保持当前许可“原样”...
null
setup.py
setup.py
py
2,639
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 24, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 28, "usage_type": "call" }, { "api_name": "setuptools.find_package...
313340776
import tensorflow as tf import numpy as np import os import datetime from utils import * from ops import * from networks import * from data_loader_tensorflow_dataset import * import time class my_yolo3: def __init__(self, sess, cfg): self.sess = sess self.cfg = cfg self.m4_DataReader = m...
null
model.py
model.py
py
15,476
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.placeholder", "line_number": 29, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 29, "usage_type": "attribute" }, { "api_name": "tensorflow.placeholder", "line_number": 30, "usage_type": "call" }, { "api_name": ...
644099580
from unittest import TestCase from unittest.mock import MagicMock import pytest from kubernetes import client from libs.api import API_HTTP_URL, API_WS_HOST from scheduler.spawners.templates.env_vars import ( get_env_var, get_from_secret, get_resources_env_vars, get_service_env_vars ) @pytest.mark....
null
tests/test_spawner/test_env_vars.py
test_env_vars.py
py
2,578
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "name" }, { "api_name": "scheduler.spawners.templates.env_vars.get_env_var", "line_number": 21, "usage_type": "call" }, { "api_name": "scheduler.spawners.templates.env_vars.get_env_var", "line_number": 25, ...
256764363
import cv2 import matplotlib.pyplot as plt import numpy as np img=cv2.imread("c:/users/girishhegde/iitdimg/lena1.tiff",0) cv2.imshow('img1',img) tar=cv2.imread("c:/users/girishhegde/iitdimg/lena.tif",0) cv2.imshow("original",tar) def equhist(ipimg): x,y=ipimg.shape temp=np.zeros(ipimg.shape,np.uint8) h=np.ze...
null
histogram_match.py
histogram_match.py
py
2,999
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 10, ...
609415491
import unittest import requests import pytest from run import app as create_app class test(unittest.TestCase): @pytest.fixture def client(self): create_app.testing = True client = create_app.test_client() yield client def test_create(client): res = requests.get('http://loc...
null
test/test_simple.py
test_simple.py
py
706
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "run.app.testing", "line_number": 10, "usage_type": "attribute" }, { "api_name": "run.app", "line_number": 10, "usage_type": "name" }, { "api_name": "run.app.test_clien...
75931674
import pygame from pygame.locals import * from utils import * from random import randint, choice from numpy import array import os pygame.init() font = pygame.font.SysFont('arial', 25) rat_up = load_image("spr_rat_up.png") rat_down = load_image("spr_rat_down.png") rat_left = load_image("spr_rat_left.png") rat_right =...
null
player_game/game.py
game.py
py
19,033
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.font.SysFont", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode...
103793275
# -*- encoding: utf-8 -*- import time import twisted.names.cache from twisted.names import dns from twisted.internet import defer from twisted.python import failure from log import log class ResolverCache(twisted.names.cache.CacheResolver): def clearAll(self): ''' 清空所有 Memory Dns 结果缓存。 ...
null
network/dns-proxy/src/server/cache.py
cache.py
py
1,279
python
en
code
null
code-starcoder2
83
[ { "api_name": "twisted.names.cache.names", "line_number": 12, "usage_type": "attribute" }, { "api_name": "twisted.names.cache", "line_number": 12, "usage_type": "name" }, { "api_name": "log.log.info", "line_number": 22, "usage_type": "call" }, { "api_name": "log.l...
232851220
import pandas as pd import numpy as np #nltk from nltk.tokenize import sent_tokenize, word_tokenize from nltk.stem import WordNetLemmatizer #spacy import spacy import en_core_web_sm nlp = en_core_web_sm.load() #normalize from normalise import normalise import csv import os #####################################...
null
textPreprocessor.py
textPreprocessor.py
py
4,588
python
en
code
null
code-starcoder2
83
[ { "api_name": "en_core_web_sm.load", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.unique", "l...
112881661
from Utilities import bytesToInt, varInt from utils.EncoderDecoder import decodeToAscii, switchEndianAndDecode from io import BytesIO from core.script.ScriptSig import ScriptSig from unittest import TestCase, main class TransactionInput: def __init__(self, coinbase, sequence, prev_txid, prev_output_index=None, sc...
null
core/transaction/TransactionInput.py
TransactionInput.py
py
2,400
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.EncoderDecoder.switchEndianAndDecode", "line_number": 47, "usage_type": "call" }, { "api_name": "Utilities.bytesToInt", "line_number": 48, "usage_type": "call" }, { "api_name": "Utilities.varInt", "line_number": 49, "usage_type": "call" }, { "...
70410641
#!/usr/bin/python3 import numpy as np import pandas as pd import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt #seed NSTA ID FRBMIN SLOTS TRANSMITTED LOGTRAN TIMEAA TIMERA STFLOW ACTIVE AVEF AVERB LOGTIMEAA EMPTYSLOTS NONEMPTYSLOTS BIGSTANUM EMRB SUCRB COLRB fig, ax = plt.subplots(1, 2, ...
null
ana_sim_code/F-mortred/process.py
process.py
py
5,382
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.use", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_name": "pandas.rea...
230309783
# -*- coding: utf-8 -*- # + {} #tensorflow 1.2.0 is needed from __future__ import absolute_import from __future__ import division from __future__ import print_function import os,time,scipy.io import tensorflow as tf import numpy as np import utils as utils import scipy.misc as sic import subprocess import argparse # A...
null
fully_colorization/before_src/main_woflow-be.py
main_woflow-be.py
py
8,752
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 35, "usage_type": "attribute" }, { "api_name": "numpy.argmax"...
37081550
# -*- coding: utf-8 -*- import misc import time import datetime spreadsheet = "Planning lave-vaisselle" def get_month(excel): months = ["janvier", "fevrier", "mars", "avril", "mai", "juin", "juillet", "aout", "septembre", "octobre", "novembre", "decembre"] for i in range(0, len(months)): if excel == months[i] : ...
null
dishwasher.py
dishwasher.py
py
3,050
python
en
code
null
code-starcoder2
83
[ { "api_name": "misc.log", "line_number": 25, "usage_type": "call" }, { "api_name": "misc.log", "line_number": 29, "usage_type": "call" }, { "api_name": "misc.log", "line_number": 30, "usage_type": "call" }, { "api_name": "misc.log", "line_number": 32, "usa...
262931483
import numpy as np import os import json # Spotify API wrapper, documentation here: http://spotipy.readthedocs.io/en/latest/ import spotipy from spotipy.oauth2 import SpotifyClientCredentials # Authenticate with Spotify using the Client Credentials flow client_credentials_manager = spotipy.oauth2.SpotifyClientCred...
null
mymix/mymix/spotify.py
spotify.py
py
2,823
python
en
code
null
code-starcoder2
83
[ { "api_name": "spotipy.oauth2.SpotifyClientCredentials", "line_number": 13, "usage_type": "call" }, { "api_name": "spotipy.oauth2", "line_number": 13, "usage_type": "attribute" }, { "api_name": "spotipy.Spotify", "line_number": 14, "usage_type": "call" } ]
611734725
import sys import numpy as np import pandas as pd import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.tsa.arima_model import ARIMA from statsmodels.graphics.tsaplots import plot_acf, plot_pacf import os os.environ['R_HOME'] = '/Library/Frameworks/R.framework/Resources' import rpy2.robjects as...
null
estimation/statistics/time_series/arima.py
arima.py
py
4,311
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pandas.set_option", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.set_option...
258978806
from django.conf.urls import url from .views import ( edit_quiz, add_question_to_quiz, edit_question, add_answer_to_question, delete_question, reorder_answers, reorder_questions, delete_answer, edit_answer, ) urlpatterns = [ url(r'^edit_quiz/(?P<id>\d+)/$', edit_quiz, {}, 'edit-quiz'), url(r'^edit...
null
quizblock/urls.py
urls.py
py
1,040
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "views.edit_quiz", "line_number": 10, "usage_type": "argument" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "views.a...
535197537
#!/usr/bin/python3 -tt # -*- coding: utf-8 -*- __author__ = 'Bernard Gray' __copyright__ = '(C) 2018 Bernard Gray <bernard.gray@gmail.com>' __license__ = 'GPLv2 or any later version' from subprocess import * import argparse import ast import configparser import logging as log import os import sys import tempfi...
null
keycontrol/bin/gnome-custom-keybinding-setup.py
gnome-custom-keybinding-setup.py
py
7,207
python
en
code
null
code-starcoder2
83
[ { "api_name": "configparser.ConfigParser", "line_number": 31, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 53, "usage_type": "call" }, { "api_name": "os.path", "line...
197608943
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 7/24/19 7:23 PM @author: nirav """ from functools import partial from shapely.ops import transform from shapely import wkb import pyproj class RemoveLandFromGridCells: def __init__(self, grids, landArea, **kwargs): self.grids = grids s...
null
Scripts/DataProcessing/RemoveLandFromGridCells.py
RemoveLandFromGridCells.py
py
2,365
python
en
code
null
code-starcoder2
83
[ { "api_name": "functools.partial", "line_number": 22, "usage_type": "call" }, { "api_name": "pyproj.transform", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pyproj.Proj", "line_number": 23, "usage_type": "call" }, { "api_name": "pyproj.Proj", ...
390691828
import torch import torch.utils.data as data_utils import torch.autograd as autograd import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable from torch.nn.utils.clip_grad import clip_grad_norm_ from tensorboardX import SummaryWriter import l...
null
code/pytorch_models/doc_similarity_model.py
doc_similarity_model.py
py
7,222
python
en
code
null
code-starcoder2
83
[ { "api_name": "humanfriendly.format_size", "line_number": 36, "usage_type": "call" }, { "api_name": "pympler.asizeof.asizeof", "line_number": 36, "usage_type": "call" }, { "api_name": "pympler.asizeof", "line_number": 36, "usage_type": "name" }, { "api_name": "zli...
227052477
# Status code: # 0: Normal transfers # 1: Missed transfers # 2: Preemptive transfers # 3: missing_a # 4: missing_b # 5: missing_records # 6: Critical transfers import csv import json import math from pymongo import MongoClient from datetime import timedelta, date import time import multiprocessing # database setup c...
null
scr/transfer/dedicated_transfer.py
dedicated_transfer.py
py
12,291
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymongo.MongoClient", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 39, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 53, "usage_type": "call" }, { "api_name": "datetime.timedelta", ...
586549073
import pyimagetest import pytest import torch import pystiche.image as image_ from pystiche.image import transforms from . import assert_is_identity_transform def test_Crop(subtests, test_image): origin = (200, 300) size = (50, 30) spatial_slices = { ("top", "left"): [ slice(origin...
null
tests/integration/image/transforms/test_crop.py
test_crop.py
py
3,745
python
en
code
null
code-starcoder2
83
[ { "api_name": "pystiche.image.transforms.Crop", "line_number": 37, "usage_type": "call" }, { "api_name": "pystiche.image.transforms", "line_number": 37, "usage_type": "name" }, { "api_name": "pyimagetest.assert_images_almost_equal", "line_number": 42, "usage_type": "call"...
136683224
#!/bin/env python # coding:utf-8 import tarfile import MeCab import argparse import re import mojimoji class Corpus: def __init__(self,tarfile,outfile): self.tarfile=tarfile self.outfile=outfile pass def run(self): items=[] # http://d.hatena.ne.jp/cheeseshop/20070821/1...
null
src/10_corpus.py
10_corpus.py
py
3,383
python
en
code
null
code-starcoder2
83
[ { "api_name": "tarfile.TarFile.open", "line_number": 19, "usage_type": "call" }, { "api_name": "tarfile.TarFile", "line_number": 19, "usage_type": "attribute" }, { "api_name": "re.sub", "line_number": 40, "usage_type": "call" }, { "api_name": "re.sub", "line_n...
537658665
#imports import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.model_selection import StratifiedShuffleSplit from sklearn.metrics import accuracy_score, log_loss from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import SVC from sklearn.tree ...
null
entry3.py
entry3.py
py
11,248
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figur...
159813318
from parameters import * import os, copy, json, sys, random, pickle import nltk from read_data_util import * from collections import * #For tokenization nlp = StanfordCoreNLP('http://localhost', port=8000) data_type = sys.argv[1] if data_type == 'val': data_dir = val_dir else: data_dir = test_dir #Dependency P...
null
gcn3/read_data_val_or_test.py
read_data_val_or_test.py
py
10,244
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 23, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 37, "usage_type": "call" }, { "api_name": "json.load", "line_number": 3...
548516277
from nsepy import get_history from datetime import datetime,timedelta,date import pandas as pd import numpy as np import datetime import matplotlib import operator import itertools from nsepy.symbols import get_symbol_list, get_index_constituents_list import matplotlib.pyplot as plt import warnings warnings.filterwarni...
null
shortterm_main1111.py
shortterm_main1111.py
py
8,640
python
en
code
null
code-starcoder2
83
[ { "api_name": "warnings.filterwarnings", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.pivot_...
62297324
from django.core.urlresolvers import reverse from ..models import Person from .base import TestBase class TestPerson(TestBase): '''Test cases for persons.''' def setUp(self): super().setUp() self._setUpUsersAndLogin() def test_display_person_correctly_with_all_fields(self): respo...
null
workshops/test/test_person.py
test_person.py
py
4,242
python
en
code
null
code-starcoder2
83
[ { "api_name": "base.TestBase", "line_number": 6, "usage_type": "name" }, { "api_name": "django.core.urlresolvers.reverse", "line_number": 14, "usage_type": "call" }, { "api_name": "django.core.urlresolvers.reverse", "line_number": 19, "usage_type": "call" }, { "ap...
431116463
__all__=['SharedRepo', 'SharedRepoSession'] import threading, time, os, datetime, platform, tempfile, json repos = {} class DummyLock(object): def __init__(self, lockfile, lifetime=None): pass def refresh(self): pass def lock(self): pass def unlock(self): pass if platform.system()=='Windows': ...
null
webserver/cogenda_app/lib/shared_repo.py
shared_repo.py
py
5,046
python
en
code
null
code-starcoder2
83
[ { "api_name": "platform.system", "line_number": 16, "usage_type": "call" }, { "api_name": "lockfile.Lock", "line_number": 31, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 31, "usage_type": "call" }, { "api_name": "threading.Event", ...
436332827
''' Returns total price paid for individual rentals ''' import argparse import json import datetime import math import logging # in class 7/16 def parse_cmd_arguments(): parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('-i', '--input', help='input JSON file', requi...
null
students/colephalen/lesson02/assignment/src/charges_calc.py
charges_calc.py
py
3,838
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 37, "usage_type": "call" }, { "api_name": "datetime.datetime.str...
133525962
import csv import sys import hiive.mdptoolbox as mdptoolbox import hiive.mdptoolbox.example from hiive.mdptoolbox.mdp import ValueIteration, PolicyIteration, QLearning import numpy as pynp import pandas as pypd import matplotlib.pyplot as pymap import seaborn as pysb import time Trans = {} Rew = {} #gamma is the dis...
null
fl.py
fl.py
py
8,513
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
138470988
import networkx as nx import matplotlib.pyplot as plt import csv from networkx.algorithms import bipartite # Define Nodes nodes1 = [1, 2, 3] nodes2 = ['A','B','C','D','E'] # Define Edges edges = [(1,'A'),(1,'B'),(1,'C'),(1,'D'),(2,'B'),(2,'C'),(2,'D'),(3,'C'),(3,'D'),(3,'E')] # Generate a normal networkx Graph # ...
null
algorithms/common_neighbours_first_iteration.py
common_neighbours_first_iteration.py
py
2,004
python
en
code
null
code-starcoder2
83
[ { "api_name": "networkx.Graph", "line_number": 18, "usage_type": "call" }, { "api_name": "networkx.algorithms.bipartite.sets", "line_number": 24, "usage_type": "call" }, { "api_name": "networkx.algorithms.bipartite", "line_number": 24, "usage_type": "name" }, { "a...
35457039
#!/usr/bin/python2 import dbus import dbus.bus import dbus.service import dbus.mainloop.glib import gobject import gtk import gtk.gdk import os import signal import gobject import subprocess import socket import time import struct import fcntl def addCA(path, db_name): child_pid = os.fork() if child_pid != 0:...
null
standard_edition_linux_desktop/src/vestige_python2_launcher.py
vestige_python2_launcher.py
py
13,992
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.fork", "line_number": 20, "usage_type": "call" }, { "api_name": "os.waitpid", "line_number": 22, "usage_type": "call" }, { "api_name": "nss.nss.nss_init_read_write", "line_number": 30, "usage_type": "call" }, { "api_name": "nss.nss", "line_nu...
166267326
# uncompyle6 version 3.7.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: /home/quincy/Code/valuehorizon-people/people/migrations/0001_initial.py # Compiled at: 2015-05-08 17:59:14 from __future__ import unicode_literals from django.db...
null
pycfiles/valuehorizon-people-0.2.tar/0001_initial.py
0001_initial.py
py
2,026
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.CreateModel", "line_number": 14, "usage_type": "call" }, ...
13911091
"""Run predictions for COVID-19 model""" import numpy as np import xarray import pickle as pkl import tensorflow as tf from covid import model_spec from gemlib.util import compute_state def predicted_incidence(posterior_samples, covar_data, init_step, num_steps): """Runs the simulation forward in time from `ini...
null
covid/tasks/predict.py
predict.py
py
3,865
python
en
code
null
code-starcoder2
83
[ { "api_name": "covid.model_spec.CovidUK", "line_number": 35, "usage_type": "call" }, { "api_name": "covid.model_spec", "line_number": 35, "usage_type": "name" }, { "api_name": "tensorflow.function", "line_number": 23, "usage_type": "attribute" }, { "api_name": "ge...
536962348
import unittest import test_case_crm from ddt import ddt # excelPath='D:\PythonPrp\HTMLTestRunner\crm_report.xlsx' # sheetName='Sheet1' # # #创建ParseExcel类的实例对象 # excel=ParseExcel(excelPath,sheetName) @ddt class MyTestCase(unittest.TestCase): def setUp(self): self.run=test_case_crm.test_mock() # 导入e...
null
Text_py/unittest_excel_html/html_excel_py.py
html_excel_py.py
py
921
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "test_case_crm.test_mock", "line_number": 16, "usage_type": "call" }, { "api_name": "test_case_crm.test_kdear", "line_number": 23, "usage_type": "attribute" }, { "api_...
222471516
import json import requests from bs4 import BeautifulSoup from src.common.utils import Utils from src.definitions import ADDR_CODE_DATA_DIR as DATA_DIR class AddressCode: """ This class contains methods to crawl the address codes into Python dicts, save the dicts as json files and read them from these j...
null
src/common/ChineseIDValidator/addr_code_crawler.py
addr_code_crawler.py
py
3,178
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 30, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 36, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...
401388346
import mock from builder import build, errors from builder.tests.utils import PatchCase class LogDockerVersionCase(PatchCase): mocks = {'log': 'builder.build.public_log'} def mockUp(self): self.mock_version = mock.MagicMock(return_value=dict(a=1, b=2, c=3)) self.mock_client = mock.MagicMock(...
null
stage/builder/tests/test_build.py
test_build.py
py
4,066
python
en
code
null
code-starcoder2
83
[ { "api_name": "builder.tests.utils.PatchCase", "line_number": 7, "usage_type": "name" }, { "api_name": "mock.MagicMock", "line_number": 11, "usage_type": "call" }, { "api_name": "mock.MagicMock", "line_number": 12, "usage_type": "call" }, { "api_name": "builder.bu...
116048735
# -*- coding: utf-8 -*- # function that can print out a board from IPython.display import clear_output def display_board(board): clear_output() print(board[7]+'|'+board[8]+'|'+board[9]) print('- '+'- '+'- ') print(board[4]+'|'+board[5]+'|'+board[6]) print('- '+'- '+'- ') print(board[1...
null
Tic_Tac_Toe/tic tac toe.py
tic tac toe.py
py
4,870
python
en
code
null
code-starcoder2
83
[ { "api_name": "IPython.display.clear_output", "line_number": 6, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 42, "usage_type": "call" } ]
256353125
# -*- coding: utf-8 -*- import scrapy import os from aussie_gov.items import MemberItem ## wtf? fix this! import re import logging from datetime import datetime class MemberSpider(scrapy.Spider): name = 'member' allowed_domains = ['www.aph.gov.au'] start_urls = ['https://www.aph.gov.au/Senators_and_Memb...
null
aussie_gov/aussie_gov/spiders/member.py
member.py
py
1,875
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.Spider", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "...
511326420
import requests import json from bs4 import BeautifulSoup # Gets all the weapons urls so we can scrap them for info def getAllWeapons(): # Send request and pass it through our html parser responce = requests.get("https://mhworld.kiranico.com/weapons") soup = BeautifulSoup(responce.text, "html.parser") weap...
null
main.py
main.py
py
5,834
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 47, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "l...
43290501
from classytags.core import Options from classytags.arguments import Argument, KeywordArgument from classytags.helpers import InclusionTag from django import template from django.db.models.loading import get_model import urllib register = template.Library() class PaginationCtl(InclusionTag): name = 'pagination_c...
null
apps/common/templatetags/common_tags.py
common_tags.py
py
1,659
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.template.Library", "line_number": 8, "usage_type": "call" }, { "api_name": "django.template", "line_number": 8, "usage_type": "name" }, { "api_name": "classytags.helpers.InclusionTag", "line_number": 11, "usage_type": "name" }, { "api_name": ...
486970656
import time, datetime, argparse, cv2, os from models.model_train_detector import Model_Train from utils.utils import * from datagenerator.genGenerator import read_record_single_cls, apply_aug_single_cls import tensorflow_datasets as tfds import tensorflow as tf os.environ['CUDA_VISIBLE_DEVICES']='0' os.environ['TF_FORC...
null
ocr_onnx/trainer_detector.py
trainer_detector.py
py
3,453
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "...
28925653
import tweepy import keys # Authenticate to Twitter auth = tweepy.OAuthHandler(keys.CONSUMER_KEY, keys.CONSUMER_SECRET) auth.set_access_token(keys.ACCESS_TOKEN, keys.ACCESS_TOKEN_SECRET) api = tweepy.API(auth,wait_on_rate_limit=True) # setup nazwa = "factbot1" def HaveFriendship(nazwa): haveFriendship = 0 i...
null
PytonRozpoznawczy_1.0/MyFriendsHaveFriendship.py
MyFriendsHaveFriendship.py
py
1,347
python
en
code
null
code-starcoder2
83
[ { "api_name": "tweepy.OAuthHandler", "line_number": 5, "usage_type": "call" }, { "api_name": "keys.CONSUMER_KEY", "line_number": 5, "usage_type": "attribute" }, { "api_name": "keys.CONSUMER_SECRET", "line_number": 5, "usage_type": "attribute" }, { "api_name": "key...
359801039
import xlrd import nltk from nltk.corpus import stopwords from string import punctuation stopwords = set(stopwords.words('english') + list(punctuation)) stopwords.add('This') # nltk.download('punkt') # nltk.download('stopwords') class ReadKeywords(object): def __init__(self): self.list_key = [] def ...
null
excel/excel_item.py
excel_item.py
py
2,113
python
en
code
null
code-starcoder2
83
[ { "api_name": "nltk.corpus.stopwords", "line_number": 5, "usage_type": "name" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 5, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 5, "usage_type": "argument" }, { "api_name": ...
347729207
import sys sys.path.append('../puppetboard') import unittest from fact_querier import * import logging import json from pypuppetdb.types import Fact from fake_puppet_db import FakePuppetDb DATA1 = [ {'certname' : 'node1', 'operatingsystem' : 'RedHat', 'processorcount' : '1', 'puppetversion' :...
null
tests/test_fact_querier.py
test_fact_querier.py
py
25,630
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 31, "usage_type": "call" }, { "api_name": "sys.stderr", "lin...
629742536
from rest_framework import serializers from api.models import Category, Writer, Book, BookImage class CategorySerializer(serializers.Serializer): id = serializers.IntegerField(read_only=True) name = serializers.CharField() def create(self, validated_data): category = Category() category....
null
smthNew/back/bookstore_back/api/serializers.py
serializers.py
py
1,344
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.serializers.Serializer", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 6, "usage_type": "name" }, { "api_name": "rest_framework.serializers.IntegerField", "line_number": 7, "usage_ty...
223917481
import requests from fake_useragent import UserAgent from pymongo import MongoClient from pymongo.errors import DocumentTooLarge HEADER = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Accept-Encoding': 'gzip, deflate...
null
python/models/DocumentRetriever.py
DocumentRetriever.py
py
5,325
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymongo.MongoClient", "line_number": 21, "usage_type": "name" }, { "api_name": "fake_useragent.UserAgent", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 36, "usage_type": "call" }, { "api_name": "pymongo.err...
566349796
import unittest import requests import json from src.utils.config import init_config _API_URL = 'http://localhost:5000' _CONFIG = init_config() _INDEX_NAMES = [ _CONFIG['index_prefix'] + '.index_1', _CONFIG['index_prefix'] + '.index_2', _CONFIG['index_prefix'] + '.narrative', *[_CONFIG['index_prefix']...
null
src/test/test_legacy.py
test_legacy.py
py
13,865
python
en
code
null
code-starcoder2
83
[ { "api_name": "src.utils.config.init_config", "line_number": 8, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 23, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 40, "usage_type": "call" }, { "api_name": "json...
138520624
""" Test BIG-IP module """ import json import tempfile import shutil from os import path from f5sdk import exceptions from f5sdk.bigip.extension import ExtensionClient from f5sdk.utils import http_utils from ....global_test_imports import pytest, Mock, PropertyMock from ....shared import constants from ....shared i...
null
tests/unit/bigip/extension/test_extension.py
test_extension.py
py
19,105
python
en
code
null
code-starcoder2
83
[ { "api_name": "shared.constants.TOKEN", "line_number": 17, "usage_type": "attribute" }, { "api_name": "shared.constants", "line_number": 17, "usage_type": "name" }, { "api_name": "shared.constants.MOCK", "line_number": 19, "usage_type": "attribute" }, { "api_name"...
134238776
import typing from datetime import datetime import discord import utils.globals as GG from discord.ext import commands from cogsAdmin.models.case import Case, getCaseEmbed from cogsAdmin.models.caseStatus import CaseStatus from cogsAdmin.models.caseType import CaseType from utils import logger from utils.functions i...
null
cogsAdmin/note.py
note.py
py
1,463
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.logger.logger", "line_number": 15, "usage_type": "attribute" }, { "api_name": "utils.logger", "line_number": 15, "usage_type": "name" }, { "api_name": "discord.ext.commands.Cog", "line_number": 17, "usage_type": "attribute" }, { "api_name": "d...
577165105
import os import json def load(path): if not os.path.exists(path): return [] with open(path, 'r', encoding='utf-8') as f: s = f.read() return json.loads(s) def save(path, data): s = json.dumps(data, indent=4, ensure_ascii=False) with open(path, 'w+', encoding='utf-8') as f: ...
null
model.py
model.py
py
3,334
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.exists", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": ...
548009235
#!/usr/bin/env python -O import os import sys import bisect import os.path import ijson import numpy as np from datetime import date, datetime, timedelta from netCDF4 import Dataset ''' Testing Commands: Jerome: python hyperspectral_flux_based_calibration.py "10/15/2016 18:37:44" . ROGER : python hyperspectral_flux_...
null
scratch/hyperspectral_flux_based_calibration.py/hyperspectral_flux_based_calibration.py
hyperspectral_flux_based_calibration.py
py
6,553
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 51, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 59, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 61, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "line_n...