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
143120560
from abc import abstractmethod import keras import numpy as np from keras import Model from keras.optimizers import Adam from sklearn.utils.extmath import softmax from nn_utils.losses import huber_loss from policies import base_policy as bp from state_utils.State import SquareAroundHeadState, DiamondAroundHeadState, ...
null
policies/policy_PriorityBaseDQN.py
policy_PriorityBaseDQN.py
py
6,588
python
en
code
null
code-starcoder2
76
[ { "api_name": "policies.base_policy.Policy", "line_number": 25, "usage_type": "attribute" }, { "api_name": "policies.base_policy", "line_number": 25, "usage_type": "name" }, { "api_name": "state_utils.State.FULL", "line_number": 47, "usage_type": "name" }, { "api_...
159586875
from flask import Flask, render_template, request import requests import pickle import numpy as np import sklearn app = Flask(__name__) with open('lin_reg6.pkl','rb') as f: model = pickle.load(f) @app.route('/',methods=['GET']) def Home(): return render_template('index.html') @app.route("/predict", method...
null
main.py
main.py
py
2,419
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.method", ...
582560636
__author__ = 'jhazheng' import urllib2 import json from urllib import quote dp_api = 'http://dpadmint.grid.sina.com.cn/api/inner_admin_api.php' #change url to rfc1738 urlencode type,python not support class xapis(): def __init__(self, searchtype, searchvalue): self.searchtype = searchtype self....
null
DSP_BG_Monitors/utils/xapis.py
xapis.py
py
3,125
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.quote", "line_number": 23, "usage_type": "call" }, { "api_name": "urllib.quote", "line_number": 25, "usage_type": "call" }, { "api_name": "urllib.quote", "line_number": 31, "usage_type": "call" }, { "api_name": "urllib.quote", "line_numbe...
204029895
# SPDX-License-Identifier: MIT # # This file contains the entry point for the OpenAPI mapping import logging import json from time import sleep import connexion from ratbag_emu.device_handler import DeviceHandler from ratbag_emu.protocol.base import BaseDevice from ratbag_emu.protocol.devices import DeviceList log...
null
ratbag_emu/server.py
server.py
py
4,940
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 21, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 26, "usage_type": "call" }, { "api_name": "ratbag_emu.device_handler.Dev...
556498856
import datetime import logging import os import sys import time from shutil import which from subprocess import run, PIPE log = logging.getLogger(__name__) class OOMMFRunner: """Base class for running OOMMF. Don't use this directly. You should normally use get_oommf_runner() to pick a subclass of thi...
null
oommfc/oommf.py
oommf.py
py
7,032
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "attribute" }, { "api_name": "time.ti...
205024178
import os import configparser import numpy as np import netCDF4 FILE_PATH = os.path.dirname(os.path.realpath(__file__)) class Quality: """Class containing quality control routines.""" def __init__(self, filename: str): self.n_metadata_tests = 0 self.n_metadata_test_failures = 0 self....
null
cloudnetpy/quality/quality.py
quality.py
py
4,338
python
en
code
null
code-starcoder2
76
[ { "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.realpath", "line_number": 6, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "lin...
396303931
import logging from typing import Optional from imagehash import phash from PIL import Image from mgallery.database import ImageService, GalleryService logger = logging.getLogger(__name__) def extract_image_data(path: str) -> Optional[dict]: result = { "size": 0, "width": None, "height"...
null
mgallery/services.py
services.py
py
2,596
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 20, "usage_type": "name" }, { "api_name": "imagehash.phash", "line...
356764621
''' Created on 3 May 2012 @author: John Gale ''' from google.appengine.ext import db class ModelBase(db.Model): created = db.DateTimeProperty(auto_now_add=True) modified = db.DateTimeProperty(auto_now=True) created_by = db.UserProperty(auto_current_user_add=True, indexed=False) modified_by = db.UserPr...
null
src/wedding/models.py
models.py
py
1,641
python
en
code
null
code-starcoder2
76
[ { "api_name": "google.appengine.ext.db.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "google.appengine.ext.db", "line_number": 8, "usage_type": "name" }, { "api_name": "google.appengine.ext.db.DateTimeProperty", "line_number": 9, "usage_type": "call...
34145071
import h5py as h5 import numpy as np # Read H5 file my_file = h5.File("test_catvnoncat.h5", "r") # Get list of datasets name within the H5 file datasets = (key for key in my_file.keys()) print(type(datasets)) # print list of datasets name within the H5 file i = 0 dict_of_arrays = {} for datasetname in datasets: ...
null
AdvancePythonFunctions/H5Files/ReadAndWriteDatasetsToH5.py
ReadAndWriteDatasetsToH5.py
py
2,961
python
en
code
null
code-starcoder2
76
[ { "api_name": "h5py.File", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random.randn", "line_number": 56, "usage_type": "call" }, { "api_name": "numpy.random", "line_numb...
256771668
import os import main_routes import unittest import tempfile import pymysql.cursors import json import datetime from pytz import timezone import pytz class FlaskrTestCase(unittest.TestCase): def setUp(self): self.connection = pymysql.connect(host="localhost", user="root", password="SMUFOOD", db="SMUFOOD",...
null
smufood_backend_test_cases.py
smufood_backend_test_cases.py
py
3,808
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pymysql.cursors.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 14, "usage_type": "name" }, { "api_name": "pymysq...
282064523
#!/usr/bin/env python from Bio import SeqIO outFile = "resGenes.faa" outhandle = open(outFile, 'w') inSeqs = SeqIO.parse(open("resGenes.fna", "rU"), "fasta") for record in inSeqs: record.seq = record.seq.translate() print(record) SeqIO.write(record, outhandle, "fasta") outhandle.close()
null
translator.py
translator.py
py
300
python
en
code
null
code-starcoder2
76
[ { "api_name": "Bio.SeqIO.parse", "line_number": 7, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number": 7, "usage_type": "name" }, { "api_name": "Bio.SeqIO.write", "line_number": 11, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number"...
178018615
import math import itertools primes_list = [2, 3] def is_integer(n): return n == int(n) def is_prime(n): if n < 2: return False elif n == 2: return True elif n%2 == 0: return False else: for i in range(3, int(math.sqrt(n))+1, 2): if n%i == 0: ...
null
P0046.py
P0046.py
py
821
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.sqrt", "line_number": 17, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 35, "usage_type": "call" }, { "api_name": "itertools.count", "line_number": 38, "usage_type": "call" } ]
277464010
from PIL import Image sister = Image.open("sister.png") r,g,b = sister.split() new_img = Image.merge('RGB', (g,r,b)) new_img.show() bucky = Image.open('bucky.rpg') r1,g1,b1 = sister.split() r2,g2,b2 = bucky.split() new_img1 = Image.merge('RGB', (r2,g1,b2)) new_img1.show()
null
ml_quality/datasets/shit/merge_effects.py
merge_effects.py
py
293
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 3, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 3, "usage_type": "name" }, { "api_name": "PIL.Image.merge", "line_number": 6, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": ...
238200654
""" 문서의 TF표현은 소석 단어의 one-hot 표현을 합해 생성 TF표현의 각 원소는 해당 단어가 문장(말뭉치)에 등장하는 횟수다. """ from sklearn.feature_extraction.text import CountVectorizer import seaborn as sns corpus = ['Time flies like an arrow.', 'Fruit flies like a banana.'] one_hot_vectorizer = CountVectorizer(binary=True) one_hot = one_hot_vectori...
null
NLP with PyTorch/ch1/tf.py
tf.py
py
619
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 12, "usage_type": "call" }, { "api_name": "seaborn.heatmap", "line_number": 15, "usage_type": "call" } ]
296354731
#!/usr/bin/env python #--------------------------------------------------------------- # THIS PROGRAM IS SUBSCRIBING "/camera/rgb/image_raw" TOPIC AND | # PUBLISHING "position_publisher" TOPIC. | # PLEASE ADJUST formula from excel and helper variables | #----------------------------------...
null
ros_mm_arm_vision/scripts/find_obj_parallel.py
find_obj_parallel.py
py
3,442
python
en
code
null
code-starcoder2
76
[ { "api_name": "rospy.Publisher", "line_number": 29, "usage_type": "call" }, { "api_name": "geometry_msgs.msg.Pose", "line_number": 29, "usage_type": "argument" }, { "api_name": "cv_bridge.CvBridge", "line_number": 30, "usage_type": "call" }, { "api_name": "rospy.S...
564281350
from django import forms from django.forms import inlineformset_factory, BaseInlineFormSet from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Div from whatyouspend.models import Budget, Account from whatyouspend.constants import ( BUDGET_TYPE_MONTHLY, BUDGET_TYPE_QUARTERLY, BUDGET...
null
whatyouspend/budgets/forms.py
forms.py
py
2,286
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 15, "usage_type": "name" }, { "api_name": "whatyouspend.models.Budget", "line_number": 20, "usage_type": "name" }, { "api_name": "c...
393820543
path1="D:\\Users\\850037702\\Downloads\\retention_time.csv" path2="D:\\Users\\850037702\\Downloads\\scans (1).csv" import numpy as np from scipy.optimize import curve_fit #copied from stackoverflow from scipy import asarray as ar,exp #copied from stackoverflow import pylab as plb #copied from stackoverflow impo...
null
Assignment.py
Assignment.py
py
3,444
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.exp", "line_number": 18, "usage_type": "call" }, { "api_name": "scipy.optimize.curve_fit", "line_number": 32, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 33, "usage_type": "call" }, { "api_name": "matplotlib....
69788701
import pytest from fido2.ctap import CtapError from tests.utils import * @pytest.fixture(scope="module", params=["", "123456"]) def SetPINRes(request, device): device.reset() pin = request.param req = FidoRequest() if pin: device.client.pin_protocol.set_pin(pin) pin_token = device....
null
tests/standard/fido2/test_resident_key.py
test_resident_key.py
py
2,376
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytest.fixture", "line_number": 7, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 27, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 35, "usage_type": "call" }, { "api_name": "pytest.raises", "line...
585935022
""" Management utility to create superusers. """ import getpass import sys from django.core import exceptions from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS from django.utils.text import capfirst from caravaggio_rest_api.users.models import CaravaggioClient, C...
null
src/caravaggio_rest_api/users/management/commands/manageorganization.py
manageorganization.py
py
2,606
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 15, "usage_type": "name" }, { "api_name": "sys.stdin", "line_number": 52, "usage_type": "attribute" }, { "api_name": "caravaggio_rest_api.users.models.CaravaggioOrganization.objects.get", "line_number": 6...
333619375
#by Ibrahim waheed all of the module and any code that was not my have been commented import pyttsx3 #https://pyttsx3.readthedocs.io/en/latest/ for the TextToSpeech Effect # maybe instead of pyttsx3 could have use gttsx a google cloud base text to speech' # google one require internet! and API key # the below impor...
null
GroupBot/BoxingIbrahimWaheed/fancy_tools_effects.py
fancy_tools_effects.py
py
3,920
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 26, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 27, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sys.stdout.flush", "l...
300850733
# coding = utf-8 from selenium import webdriver from PIL import Image # 需要安装 pillow 这个库 import pytesseract # 识别验证码图片的库 from ShowapiRequest import ShowapiRequest driver = webdriver.Chrome() driver.get('http://5itest.cn/register') # 解决图片验证码的问题(该方法适用干扰项很少的图片验证码) driver.save_screenshot('D://imooc.png') code_element...
null
selenium_item/test_operate/img_code.py
img_code.py
py
1,136
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image",...
291116439
import random import json import time from datetime import date, datetime from collections import OrderedDict import argparse import string import pprint from faker.factory import Factory from kafka import KafkaProducer from kafka import KafkaConsumer # 참고사이트 # [Pythonメモ : fakerでテストデータを生成する](https://wonderwall.hatena...
null
kafka-python-docker/02_sample-compose/opt/FakerSample.py
FakerSample.py
py
3,584
python
en
code
null
code-starcoder2
76
[ { "api_name": "faker.factory.Factory.create", "line_number": 19, "usage_type": "attribute" }, { "api_name": "faker.factory.Factory", "line_number": 19, "usage_type": "name" }, { "api_name": "string.ascii_uppercase", "line_number": 24, "usage_type": "attribute" }, { ...
25604027
import asyncio import time from sequential import build_addition_units @asyncio.coroutine def add_one_unit(add_unit): sum = 0 for val in add_unit[0]: sum = sum + val add_unit = (add_unit[0], sum) yield from asyncio.sleep(3) return add_unit if __name__ == "__main__": # build add units ...
null
asyncio_concur.py
asyncio_concur.py
py
1,016
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.sleep", "line_number": 12, "usage_type": "call" }, { "api_name": "asyncio.coroutine", "line_number": 6, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "sequential.build_additi...
172983351
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
null
neutron/openstack/common/fileutils.py
fileutils.py
py
4,030
python
en
code
null
code-starcoder2
76
[ { "api_name": "neutron.openstack.common.log.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "neutron.openstack.common.log", "line_number": 25, "usage_type": "name" }, { "api_name": "os.makedirs", "line_number": 36, "usage_type": "call" }, { "a...
473114245
import sys,os from argparse import ArgumentParser from ioh5 import load_dictionary from ioh5 import load_QTensor from ioh5 import readIn_generator_coefficient import manybody from manybody.validity import valid_operator as _valid_operator from tools.locking import output_measure_all_average from tools.locking i...
null
pycode/tools/cmdlineParser2.py
cmdlineParser2.py
py
9,896
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number...
196658693
# -*- coding:utf-8 -*- import os import hashlib import tempfile import requests BLOCK_SIZE = 1024 * 8 # 单次最大读取文件字节大小 def get_file_md5(file_path): """ @desc 获取文件的md5值 @file_path 文件的路径 @return 文件的md5值 """ if not os.path.exists(file_path): return None mHash = hashlib.md5() ...
null
common/utils/fileUtil.py
fileUtil.py
py
1,622
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "hashlib.md5", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.exists", "line_nu...
571284003
# -*- coding: utf-8 -*- #WOWHoneypotの前日のlogをメール送付するpython3スクリプトです。 #本文にはサマリが記載され、加工したlogが圧縮されて届きます。(passwordはhoneypot) #圧縮時にsubprocessで7zipを呼び出すため、事前にインストールが必要です。 #sudo apt install p7zip-full #sudo pip3 install pandas #2019-04-13 mah-nyan import smtplib from email.mime.text import MIMEText from email.utils import forma...
null
send_logs_mail.py
send_logs_mail.py
py
8,971
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date.today", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 28, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 28, "usage_type": "call" }, { "api_name": "base64.deco...
484707670
from sys import argv from json import load, dumps from re import compile, match # Argument syntaxical constants ARG_MODE = 'mode:' ARG_TCP = 'tcp:' ARG_HOST = 'host:' ARG_PORT = 'port:' ARG_MODE_VALUE_VISIT = 'visit' ARG_MODE_VALUE_TEST = 'test' ARG_TCP_VALUE_ENABLED = 'enabled' ARG_TCP_VALUE_DIS...
null
tag_data_acquisition/argumentParser.py
argumentParser.py
py
4,912
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "json.load", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 41, "usage_type": "name" } ]
177777676
from __future__ import print_function from imutils.object_detection import non_max_suppression import numpy as np import imutils import cv2 face_cascade = cv2.CascadeClassifier( 'C:/Users/Jasper/PycharmProjects/PO3/P_en_O_3_computer_vision/Cascades/haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeCla...
null
code_for_kinect/eigenpersondetection/persondetectionnoslice.py
persondetectionnoslice.py
py
4,493
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.CascadeClassifier", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.HOGDes...
141438489
#%% import requests import urllib3 #Using logigns instead of print import logging #Datetime will allow Python to recognize dates as dates, not strings. from datetime import datetime #Pandas will be the backbone of our data manipulation. import pandas as pd from pandas.io.json import json_normalize #Seaborn is a data v...
null
strava_api.py
strava_api.py
py
2,923
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib3.disable_warnings", "line_number": 21, "usage_type": "call" }, { "api_name": "urllib3.exceptions", "line_number": 21, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "...
154633168
import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('Lenna_img.png',0) edges = cv2.Canny(img,100,100) inverted_edges = np.invert(edges) cv2.imwrite('edge.png',inverted_edges) plt.subplot(121),plt.imshow(img,cmap = 'gray') plt.title('Original Image'), plt.xticks([]), plt.yticks([]) plt.s...
null
code_appendix/edge_detection.py
edge_detection.py
py
456
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.Canny", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.invert", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 8, ...
614875091
from django.contrib import admin from django import forms from django.contrib.admin.widgets import FilteredSelectMultiple # Register your models here. from django.forms import BaseInlineFormSet from .models import Testing, Category, Question, Comment, AnswerUser, Answer from django.utils.translation import ugettext_la...
null
src/apps/testings/admin.py
admin.py
py
5,119
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 25, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 25, "usage_type": "name" }, { "api_name": "django.forms.ChoiceField", "line_number": 32, "usage_type": "call" }, { "api_name": "dja...
226154951
# -*- coding: utf-8 -*- import math import sys import matplotlib import numpy as np import pandas as pd import seaborn as sns import time from datetime import date, datetime, time, timedelta from matplotlib import pyplot as plt from pylab import rcParams from sklearn.linear_model import LinearRegression from sklearn.m...
null
moving_average.py
moving_average.py
py
8,127
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.concatenate", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.array",...
554303705
import os import tempfile class FileUtils(object): """ Find an occurrence of a yaml key in a file and replace the value for that key. filename - the yaml file to load the contents of to check for replacements replace_dict - keys/values of where the key is also the key in the yaml file and value is the ...
null
bootstrap/p1.4/src/common/file_utils.py
file_utils.py
py
1,193
python
en
code
null
code-starcoder2
76
[ { "api_name": "tempfile.mkstemp", "line_number": 25, "usage_type": "call" }, { "api_name": "os.close", "line_number": 28, "usage_type": "call" } ]
589926667
import pygame WHITE = (255, 255, 255) class Boundary: def __init__(self, x1, y1, x2, y2): self.a_pos = (x1, y1) self.b_pos = (x2, y2) def show(self, surface): pygame.draw.line(surface, WHITE, self.a_pos, self.b_pos) if __name__ == '__main__': print("Please run racinggame.py a...
null
boundary.py
boundary.py
py
330
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.draw.line", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 14, "usage_type": "attribute" } ]
485356861
#For prd spells index. Might not want to use the same approach as feats, as each spell has a separate page. from urllib.request import urlopen from urllib.error import HTTPError from bs4 import BeautifulSoup import re sites = set() anchor_maps = dict() #function to get the links from the feat index in the pathfinder...
null
app/rules_scrapers/spells/update_sites.py
update_sites.py
py
2,085
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.urlopen", "line_number": 15, "usage_type": "call" }, { "api_name": "urllib.error.HTTPError", "line_number": 16, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 20, "usage_type": "call" }, { "api_name": "bs4.B...
486792555
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on 2018 Jun. @author: HuangLiPang, QuenLo python version: 2.7 Desciption: Rotating file handler will produce the log with its name the same with the execution file name. """ import logging import datetime import os import sys class RotatingFileNameHandler(lo...
null
data_processing/kairosCrawler/RotatingFileNameHandler/RotatingFileNameHandler.py
RotatingFileNameHandler.py
py
1,987
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.handlers", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "...
604044258
import argparse import numpy as np from rembrandtml.configuration import DataConfig, ModelConfig, ContextConfig, VisualizationConfig from rembrandtml.factories import ContextFactory from rembrandtml.visualization import Visualizer from rembrandtml.models import ModelType from sklearn.metrics import roc_curve, auc d...
null
safetoswim/__main__.py
__main__.py
py
3,263
python
en
code
null
code-starcoder2
76
[ { "api_name": "rembrandtml.configuration.DataConfig", "line_number": 18, "usage_type": "call" }, { "api_name": "rembrandtml.configuration.ModelConfig", "line_number": 22, "usage_type": "call" }, { "api_name": "rembrandtml.models.ModelType.LOGISTIC_REGRESSION", "line_number": ...
247682837
from typing import Dict from urllib.parse import quote import boto3 from botocore.config import Config from data_model.enums import TaskType, UnknownTaskTypeException from data_model.models import Task from kono_data.utils import get_s3_bucket_from_str s3_session = boto3.session.Session(region_name='eu-west-1') s3_c...
null
kono_data/views/views_utils.py
views_utils.py
py
1,688
python
en
code
null
code-starcoder2
76
[ { "api_name": "boto3.session.Session", "line_number": 11, "usage_type": "call" }, { "api_name": "boto3.session", "line_number": 11, "usage_type": "attribute" }, { "api_name": "botocore.config.Config", "line_number": 14, "usage_type": "call" }, { "api_name": "data_...
43595717
from typing import Dict from typing import List class User(object): def __init__(self, name: str, email: str) -> None: self.name: str = name self.email: str = email self.books: Dict = {} # Book(object) : rating def get_email(self) -> str: return self.email def change_ema...
null
TomeRater/TomeRater.py
TomeRater.py
py
9,274
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Dict", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 51, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 140, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": ...
204389040
# -*- coding: utf-8 -*- import pytest import gevent from raiden.utils import sha3 from raiden.api.python import RaidenAPI from raiden.messages import ( decode, Ack, Ping, ) from raiden.network.transport import UnreliableTransport from raiden.tests.utils.messages import setup_messages_cb from raiden.tests.u...
null
raiden/tests/unit/test_service.py
test_service.py
py
6,026
python
en
code
null
code-starcoder2
76
[ { "api_name": "raiden.tests.utils.messages.setup_messages_cb", "line_number": 23, "usage_type": "call" }, { "api_name": "raiden.messages.Ping", "line_number": 25, "usage_type": "call" }, { "api_name": "raiden.utils.sha3", "line_number": 35, "usage_type": "call" }, { ...
487694325
import komand from .schema import AddAddressObjectToAddressGroupInput, AddAddressObjectToAddressGroupOutput, Input, Output, Component # Custom imports below from komand.exceptions import PluginException class AddAddressObjectToAddressGroup(komand.Action): def __init__(self): super(self.__class__, self)._...
null
fortinet_fortigate/icon_fortinet_fortigate/actions/add_address_object_to_address_group/action.py
action.py
py
2,293
python
en
code
null
code-starcoder2
76
[ { "api_name": "komand.Action", "line_number": 7, "usage_type": "attribute" }, { "api_name": "schema.Component.DESCRIPTION", "line_number": 12, "usage_type": "attribute" }, { "api_name": "schema.Component", "line_number": 12, "usage_type": "name" }, { "api_name": "...
539411116
import firebase_admin from firebase_admin import credentials from firebase_admin import firestore def get_tokens(): # Use a service account cred = credentials.Certificate('hackathonalertapp-a9c1ea8b1a9f.json') firebase_admin.initialize_app(cred) db = firestore.client() # [START quickstart_get_co...
null
src/app/get_token.py
get_token.py
py
471
python
en
code
null
code-starcoder2
76
[ { "api_name": "firebase_admin.credentials.Certificate", "line_number": 8, "usage_type": "call" }, { "api_name": "firebase_admin.credentials", "line_number": 8, "usage_type": "name" }, { "api_name": "firebase_admin.initialize_app", "line_number": 9, "usage_type": "call" ...
171737452
# -- encoding:utf-8 -- """ Create by ibf on 2018/12/8 """ import numpy as np import hmmlearn.hmm as hmm # 定义变量 states = ['盒子1', '盒子2', '盒子3'] obs = ['白球', '黑球'] n = 3 m = 2 # 定义模型参数 pi = np.array([0.2, 0.5, 0.3]) a = np.array([ [0.5, 0.4, 0.1], [0.2, 0.2, 0.6], [0.2, 0.5, 0.3] ]) b = np.array([ [0.4,...
null
Notebook/11 机器学习之主题模型、特征工具/[20181209]_主题模型、特征工程/05_随堂代码/05_随堂代码/sklearn11/1208/01_案例代码:hmmlearn的基本应用.py
01_案例代码:hmmlearn的基本应用.py
py
1,416
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "hmmlearn.hmm.MultinomialHMM", ...
526283074
import datetime from szurubooru import search from szurubooru.api.base_api import BaseApi from szurubooru.func import auth, comments, posts, scores class CommentListApi(BaseApi): def __init__(self): super().__init__() self._search_executor = search.SearchExecutor( search.CommentSearchCo...
null
server/szurubooru/api/comment_api.py
comment_api.py
py
2,812
python
en
code
null
code-starcoder2
76
[ { "api_name": "szurubooru.api.base_api.BaseApi", "line_number": 6, "usage_type": "name" }, { "api_name": "szurubooru.search.SearchExecutor", "line_number": 9, "usage_type": "call" }, { "api_name": "szurubooru.search", "line_number": 9, "usage_type": "name" }, { "a...
396762797
#!/usr/bin/env python #6. Write a Python program that creates a list. One of the elements of the list should be a dictionary with at least two keys. Write this list out to a file using both YAML and JSON formats. The YAML file should be in the expanded form. import yaml import json my_list = range(10) my_list.append...
null
exercise_1_6.py
exercise_1_6.py
py
633
python
en
code
null
code-starcoder2
76
[ { "api_name": "yaml.dump", "line_number": 16, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 19, "usage_type": "call" } ]
191448184
from __future__ import division, print_function import os, json from glob import glob import numpy as np from scipy import misc, ndimage from scipy.ndimage.interpolation import zoom from keras.utils.data_utils import get_file from keras import backend as K from keras.layers.normalization import BatchNormalization fro...
null
deep_learning/vgg16.py
vgg16.py
py
3,637
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.utils.data_utils.get_file", "line_number": 30, "usage_type": "call" }, { "api_name": "json.load", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.array", ...
576063380
from django.conf.urls import url, include from rest_framework.urlpatterns import format_suffix_patterns from .views import CreateView, OrderCreateView, TaskView, Get_Factory_List, TaskViewTest app_name = 'api' urlpatterns = { url(r'^customer_api/$', CreateView.as_view(), name="customer_create"), url(r'^order...
null
api/urls.py
urls.py
py
702
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "views.CreateView.as_view", "line_number": 9, "usage_type": "call" }, { "api_name": "views.CreateView", "line_number": 9, "usage_type": "name" }, { "api_name": "django.co...
355668681
# -*- coding: utf-8 -*- """ Created on Wed Apr 22 08:14:40 2020 @author: fernando """ ######################################################## from scipy import misc import scipy import numpy as np import time import matplotlib.pyplot as plt import imageio import PIL import pickle #%% imagen=imageio.imread('../s...
null
06.1_ScalarQ_Code_47945746_53320844.py
06.1_ScalarQ_Code_47945746_53320844.py
py
4,899
python
en
code
null
code-starcoder2
76
[ { "api_name": "imageio.imread", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 33, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 33, "usage_type": "name" }, { "api_name": "matplotlib....
70770148
# Q6 # Put the savedict() function into the program and call it from the dosave() function. # Author: Amanda Murray import json # the array we store everything in students = [] filename = "students.json" def writeDict(obj): with open(filename, 'wt') as f: json.dump(obj, f) def displayMenu (): print ("...
null
labs/Topic07-Files/saveStudents.py
saveStudents.py
py
1,932
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.dump", "line_number": 11, "usage_type": "call" } ]
444833381
# -*- coding: utf-8 -*- from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np # 元の式 def func1(x, y): return np.sin(x) + 2*x*np.cos(y) + 0.2*x**2 + 0.2*y**2 # x で偏微分した式 def f_x(x, y): return np.cos(x) + 2*np.cos(y) + 0.4*x # y で偏微分した式 def f_y(x, y): return -2*x*np.sin...
null
20180518/no6.py
no6.py
py
1,223
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sin", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 16, "u...
100443284
# Copyright 2020 getcarrier.io # # 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...
null
galloper/api/report.py
report.py
py
22,383
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask_restful.Resource", "line_number": 35, "usage_type": "name" }, { "api_name": "galloper.utils.api_utils.build_req_parser", "line_number": 67, "usage_type": "call" }, { "api_name": "galloper.utils.api_utils.build_req_parser", "line_number": 68, "usage_ty...
627711541
import os import sys import numpy as np import json import random import string # from google.cloud import firestore # import google.cloud.exceptions # db = firestore.Client() #reading genre map with open('genremap_full.json', 'r') as f: raw_loaded_genres = json.loads(f.read()) # #reading moods with open('moods.tx...
null
GenerateFilter/GenerateFilter.py
GenerateFilter.py
py
3,201
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number"...
596361200
from influxdb import InfluxDBClient import urllib3 requests.packages.urllib3.disable_warnings() def dashing(): #vars date=mytime.nowunix() warning = 0 critical = 0 unknown = 0 acknowledged = 0 #Influx vars client = InfluxDBClient('185.27.108.57', 8086, ...
null
jobs/influx_connect.py
influx_connect.py
py
369
python
en
code
null
code-starcoder2
76
[ { "api_name": "influxdb.InfluxDBClient", "line_number": 15, "usage_type": "call" } ]
318790818
import numpy as np import cv2 import os DIR = "photos_of_people" NAME = "cropped1.jpg" cap = cv2.VideoCapture(0) while 1: ret, img = cap.read() cv2.imshow('img',img) k = cv2.waitKey(30) & 0xff if k == 27: cv2.imwrite(os.path.join(DIR,NAME), img) print('Изображение сохранено') ...
null
n_p/saving_image.py
saving_image.py
py
385
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number...
472982025
from django.contrib import admin from .models import * class DireccionAdmin(admin.ModelAdmin): model = Direccion # exclude = ('nombre', 'ubicacion',) # prepopulated_fields = {'nombre': ('_direccion',)} # list_filter = ('padre',) fieldsets = ( ('Dirección postal', {'fields': ( ('cal...
null
calli/direcciones/admin.py
admin.py
py
635
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 4, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 21, "usage_type": "call" },...
301030637
from django.forms import forms from django.template.loader import get_template from django.views.generic import View from django.http import HttpResponseForbidden from django.http import HttpResponse from login.models import User from professor.forms import ProposeCourse, AddGradeForm from professor.models import Profe...
null
professor/views.py
views.py
py
7,314
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.View", "line_number": 13, "usage_type": "name" }, { "api_name": "django.template.loader.get_template", "line_number": 14, "usage_type": "call" }, { "api_name": "django.http.HttpResponseForbidden", "line_number": 18, "usage_type": "call"...
405278100
import open3d as o3d from matplotlib import cm import numpy as np import torch # from scipy.spatial.transform import Rotation as R class Callback: def __init__(self, point_to_class_map): self.points = set() self.ptc_map = point_to_class_map def __call__(self, vis): idxs = vis.get_pick...
null
deco.py
deco.py
py
8,604
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.cm.get_cmap", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.cm", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.unique", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.apply_along_a...
494515639
import numpy import pandas import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib import rc import sys plt.rc('text', usetex=True) plt.rcParams['text.latex.preamble'] = [r'\usepackage{helvet} \usepackage{sfmath}'] fig = plt.figure(figsize=(7.5, 6)) gs = gridspec.GridSpec(3, 2) ax0 ...
null
summary/plots/figure-6/plot_by_branch.py
plot_by_branch.py
py
3,798
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.rc", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 10, "usage_type": "attribute" }, { "api_name": "...
35765820
import sys import os import base64 from . import store as s from . import client from . import authserver as a from . import crypto as c def read_line(): return sys.stdin.readline().strip() def select_option(options): selected = len(options) if len(options) == 0: print("It seems like there are no ...
null
boulder_chat/message.py
message.py
py
5,203
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.stdin.readline", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 40, "usage_type": "attribute" }, { "api_name": "base64.b64encode", ...
417098737
from django.shortcuts import render,redirect from django.http import HttpResponse from blog.models import * from django.core.paginator import Paginator,InvalidPage,EmptyPage,PageNotAnInteger from django.conf import settings from django.db.models import Count from django.contrib.auth import login,logout,authenticate fro...
null
blog/views.py
views.py
py
12,880
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Count", "line_number": 32, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 45, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 45, "usage_type": "call" }, { "api_name": "django.cor...
109271831
import os import ConfigParser import config class Theme(object): def __init__(self, theme_name): self.name = theme_name # set path to theme directory self.root_path = os.path.abspath( os.path.join( config.THEMES_DIR, self.name, ))...
null
markgen/theme.py
theme.py
py
2,829
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
132074346
from elo_calculator import EloCalculator from logger import Logger from Configuration.Constants import MessagingConstants from Configuration.Constants import ResultConstants from Configuration.Constants import DataConstants from Configuration.Constants import RankingChangeConstants from Configuration.Constants import S...
null
src/Handlers/mlb_fixture_result_handler.py
mlb_fixture_result_handler.py
py
2,904
python
en
code
null
code-starcoder2
76
[ { "api_name": "logger.Logger", "line_number": 16, "usage_type": "call" }, { "api_name": "elo_calculator.EloCalculator", "line_number": 17, "usage_type": "call" }, { "api_name": "data_provider.DataProvider", "line_number": 18, "usage_type": "call" }, { "api_name": ...
240976039
from django.shortcuts import render, redirect from myshopping import db from django.http import JsonResponse # Create your views here. def billAdd(request): if request.method == "GET": sql = "select * from t_supplier" sup = db.query_list(sql) return render(request, 'billAdd.html', {"sup"...
null
bill/views.py
views.py
py
3,807
python
en
code
null
code-starcoder2
76
[ { "api_name": "myshopping.db.query_list", "line_number": 12, "usage_type": "call" }, { "api_name": "myshopping.db", "line_number": 12, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" }, { "api_name": "myshop...
36712229
# -*- encoding: utf-8 -*- """ @Project: ESIM @File : main.py.py @Time : "2019/7/20 11:00 @Author : ZuoquanGong @Email : 2754915212@qq.com @Software: PyCharm """ from optparse import OptionParser from Nebuchadnezzar_master import Nebuchadnezzar from config import Params import torch import numpy as np import log...
null
ESIM-BiLSTM-SimpleFeeder/main.py
main.py
py
1,702
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.random....
650568960
from paramz.caching import Cache_this from paramz.transformations import Logexp from GPy.kern.src.kern import CombinationKernel from GPy.core.parameterization import Param import GPy.kern as _Gk import numpy as np from GPy_ABCD.Kernels.sigmoidalKernels import SigmoidalKernel, SigmoidalIndicatorKernel class ChangeWin...
null
GPy_ABCD/Kernels/changeWindowShiftedSides.py
changeWindowShiftedSides.py
py
9,144
python
en
code
null
code-starcoder2
76
[ { "api_name": "GPy.kern.src.kern.CombinationKernel", "line_number": 11, "usage_type": "name" }, { "api_name": "GPy.core.parameterization.Param", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "a...
155762703
# -*- coding: utf-8 -*- # Copyright (c) 2017 Red Hat, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modi...
null
mbs_messaging_umb/publisher.py
publisher.py
py
5,077
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 37, "usage_type": "call" }, { "api_name": "stomp.Connection11", "line_number": 45, "usage_type": "attribute" }, { "api_name": "fedmsg.config.config.load_config", "line_number": 73, "usage_type": "call" }, { "api_na...
16318517
from flask import Blueprint, render_template, request, flash, url_for, redirect from app.models import ArticleData, Comment, Admin, MyFollow, MyFans, Message from app.extensions import db from app.forms import CommentForm from flask_login import current_user from app.utils import redirect_back blog_bp = Blueprint("blo...
null
app/views/blog.py
blog.py
py
3,849
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 8, "usage_type": "call" }, { "api_name": "app.models.ArticleData.query.order_by", "line_number": 13, "usage_type": "call" }, { "api_name": "app.models.ArticleData.query", "line_number": 13, "usage_type": "attribute" }, {...
511054652
from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker, relationship Base = declarative_base() # write the Role and Actor classes below class Actor(Base): __tablename__ = 'actor' id = Column(Integer, primary_key = True) name = Column(Tex...
null
models.py
models.py
py
759
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.relationship", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.relationship", "line_number": 25, "usage_type": "ca...
348679976
""" Broadcasts to the Hutton Helper web site. """ from version import HH_VERSION import json import zlib import plugin import xmit class ForTheMugPlugin(plugin.HuttonHelperPlugin): "Forwards data to the CGThreshCalc team." event_paths = { 'Bounty': '/bounty', 'Cargo': '/cargo', 'Ca...
null
forward.py
forward.py
py
2,102
python
en
code
null
code-starcoder2
76
[ { "api_name": "plugin.HuttonHelperPlugin", "line_number": 14, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 60, "usage_type": "call" }, { "api_name": "zlib.compress", "line_number": 61, "usage_type": "call" }, { "api_name": "xmit.post", ...
500685357
from django.shortcuts import HttpResponse,redirect def auth_session(func): def check_session(request, *args, **kwargs): # 1.获取 session,判断session 是否有标识符 dicts = request.session.get('loginFlag') # 如果不存在 if not dicts: return redirect(to='/') # 重置session的存活时间 ...
null
dailyfresh/decorator.py
decorator.py
py
582
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.redirect", "line_number": 10, "usage_type": "call" } ]
107691931
#!/usr/bin/python # # simple extension of TextCtrl. Typical usage: # entry = LabelEntry(self, -1, value='22', # color='black', # labeltext='X',labelbgcolor='green', # style=wx.ALIGN_LEFT|wx.ST_NO_AUTORESIZE) # row = wx.BoxSizer(wx.HORIZONTAL) # row.Add(e...
null
larch/modules/dataviewer/MPlot/LabelEntry.py
LabelEntry.py
py
1,948
python
en
code
null
code-starcoder2
76
[ { "api_name": "wx.TextCtrl", "line_number": 16, "usage_type": "attribute" }, { "api_name": "wx.ALIGN_LEFT", "line_number": 26, "usage_type": "attribute" }, { "api_name": "wx.ST_NO_AUTORESIZE", "line_number": 26, "usage_type": "attribute" }, { "api_name": "wx.TE_PR...
427141301
# -*- coding: utf-8 -*- import logging from glob import glob import os.path import subprocess from pymip.api import load_analysis logger = logging.getLogger(__name__) def _find_same_file(filename, start_dir): """ Find files with the same inode Args: filename (str): full path to original file. ...
null
moneypenny/flow/mutations/purge.py
purge.py
py
3,597
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 25, "usage_type": "call" }, { "api_name": "subprocess.CalledProcessError", "line_number": 26, "usage_type": "attribute" }, { "api_n...
438957695
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Nov 6 11:58:28 2018 @author: Heiko """ from psychopy import visual,core,event,monitors import numpy as np import PIL import pickle import os # This is the only way I found to do this. It looks like a HORRIBLE IDEA # but unfortunately it works so far...
null
dead-rects/Experiment/experiment2.py
experiment2.py
py
12,402
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.path.pop", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.path", "line_numbe...
52270321
from ftrackplugin import ftrackConnector from PySide import QtGui, QtCore from ftrackplugin.ftrackWidgets.PlayblastWidget import PlayblastWidget from ftrackplugin.ftrackWidgets.HeaderWidget import HeaderWidget class ftrackPlayblastQt(QtGui.QDialog): def __init__(self, parent=ftrackConnector.Connector.getMainWind...
null
linux/ftrack-connect-package/resource/legacy_plugins/ftrackplugin/ftrackDialogs/ftrackPlayblastDialog.py
ftrackPlayblastDialog.py
py
8,601
python
en
code
null
code-starcoder2
76
[ { "api_name": "PySide.QtGui.QDialog", "line_number": 8, "usage_type": "attribute" }, { "api_name": "PySide.QtGui", "line_number": 8, "usage_type": "name" }, { "api_name": "ftrackplugin.ftrackConnector.Connector.getMainWindow", "line_number": 9, "usage_type": "call" }, ...
607080053
import os import subprocess import qisys.command import qibuild.cmake import qibuild.find import qisrc.git import pytest # This modules also serves as a test for the # qibuild cmake API def test_simple(qibuild_action): # Just make sure that the basic stuff works # (find qibuild-config.cmake) qibuild_ac...
null
python/qibuild/test/test_qibuild_configure.py
test_qibuild_configure.py
py
7,256
python
en
code
null
code-starcoder2
76
[ { "api_name": "qibuild.cmake.cmake.read_cmake_cache", "line_number": 37, "usage_type": "call" }, { "api_name": "qibuild.cmake.cmake", "line_number": 37, "usage_type": "attribute" }, { "api_name": "qibuild.cmake", "line_number": 37, "usage_type": "name" }, { "api_n...
148772739
import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import numpy as np class Model(nn.Module): def __init__(self): super(Model, self).__init__() # 1 input image channel, 6 output channels, 5x5 square convolution # kernel # ...
null
keno/strategies/ai/pytorch/v_1_00/test.py
test.py
py
2,511
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 9, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 9, "usage_type": "name" }, { "api_name": "torch.FloatTensor", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.autograd.Var...
168729679
from nltk.corpus import stopwords import string from src.model.topic.lda import LDA import src.helper.document_helper as dh import seaborn as sns import numpy as np sns.set() np.random.seed(1) fname = '../../data/lda_bananas_sister.txt' with open(fname) as file: docs = file.readlines() # data = [x.strip() for x i...
null
tst/lda_example_2.py
lda_example_2.py
py
1,139
python
en
code
null
code-starcoder2
76
[ { "api_name": "seaborn.set", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 8, "usage_type": "attribute" }, { "api_name": "nltk.corpus.stopwords.wo...
622266571
# Base Url from finviz.screener import Screener from ticker import Ticker from dotenv import load_dotenv import requests import os load_dotenv() DAILY_DIGEST_URL = os.getenv('DAILY_DIGEST_URL') class Screeners: # Names of screeners insider_buy = "insider_buy" squeeze = "squeeze" top_gainer = "top_gain...
null
stock_queries.py
stock_queries.py
py
4,342
python
en
code
null
code-starcoder2
76
[ { "api_name": "dotenv.load_dotenv", "line_number": 7, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "finviz.screener.Screener", "line_number": 64, "usage_type": "call" }, { "api_name": "ticker.Ticker", ...
597922489
###################################################################################### # # python tokenize_with_phrases.py < in.jsonl > out.jsonl # # Input: same jsonlines format required by preprocess_data.py # # Output: adds a 'tokenized' element to each json line, # doing spaCy-based tokenization in which...
null
tokenize_with_phrases.py
tokenize_with_phrases.py
py
1,774
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.stderr.write", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 30, "usage_type": "attribute" }, { "api_name": "sys.stderr.write", "line_number": 34, "usage_type": "call" }, { "api_name": "sys.stderr", "l...
474078987
from django.forms import ModelForm from .models import * class BlogForm(ModelForm): class Meta: #attach additional information model = Blog fields = ('blog_title', 'blog_content') def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields['blog_title'].w...
null
main/forms.py
forms.py
py
1,059
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 4, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 14, "usage_type": "name" } ]
347333591
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import gzip import json from urlparse import urlparse import tldextract # Input looks like this: # lang-independent url url ELANG LANGS # where ELANG is the expected language, based on what was removed from the url # and LANGS are the ...
null
baseline/add_warc_locations.py
add_warc_locations.py
py
2,946
python
en
code
null
code-starcoder2
76
[ { "api_name": "tldextract.extract", "line_number": 22, "usage_type": "call" }, { "api_name": "urlparse.urlparse", "line_number": 22, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 43, "usage_type": "call" }, { "api_name": "argparse.ArgumentParse...
468500050
import pandas as pd import numpy as np import json,os from common.setting import RESOURCE_DIR from util.lib import Logger class FileLoader(): def __init__(self,files,mode): self.files = files self.mode = mode def _csv_loader(self,file_name,encoding="utf-8"): return pd.read_csv(o...
null
FinancialAnalytics/util/lib/FileLoader.py
FileLoader.py
py
1,599
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "common.setting.RESOURCE_DIR...
167771226
from djitellopy import tello import KeyPressModule as kp import time import cv2 kp.init() my_drone = tello.Tello() my_drone.connect() print(my_drone.get_battery()) global img my_drone.streamon() def getKeyboardInput(): lr, fb, ud, yv = 0, 0, 0, 0 speed = 50 if kp.getKey("LEFT"): lr = -speed elif k...
null
Project-KeyboardControlImageCapture.py
Project-KeyboardControlImageCapture.py
py
1,072
python
en
code
null
code-starcoder2
76
[ { "api_name": "KeyPressModule.init", "line_number": 7, "usage_type": "call" }, { "api_name": "djitellopy.tello.Tello", "line_number": 8, "usage_type": "call" }, { "api_name": "djitellopy.tello", "line_number": 8, "usage_type": "name" }, { "api_name": "KeyPressModu...
625851388
#!/usr/bin/env python3 # Author: Warwick Payne from flask import Flask, render_template, Response, send_from_directory, request, jsonify, json from time import strftime, sleep, time, gmtime, localtime, ctime, mktime, strptime from threading import Thread, Lock import RPi.GPIO as GPIO import serial import json import io...
null
flask/app.py
app.py
py
37,204
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 18, "usage_type": "attribute" }, { "api_name": "logging.Formatter", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.FileHa...
341731000
from bs4 import BeautifulSoup from urllib.request import urlretrieve import csv, os, re, sys data = [] imgPath = './data/' def pathConvert(matchobj): path = matchobj.group(1).split('/')[-1] return 'src="{}{}.jpg"'.format(imgPath, path) def readCSV(): with open('./example1.csv', newline='', encoding='utf-1...
null
taobao/tb.py
tb.py
py
2,792
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.reader", "line_number": 33, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 38, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 42, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 5...
150965671
from django.conf.urls import url, include from . import views #=========================== # Territory assessment #=========================== assessment_patterns = [ url(r'^scan/$', views.TerritoryScanView.as_view(), name="scan"), url(r'^data/$', views.BilanResultsDownloadsView.as_view(), name="data")] #=...
null
wattstrat/simulation/urls.py
urls.py
py
2,983
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 19, "usage_type": "call" }, { "api_name": "django...
401614770
import pymongo from elasticsearch import Elasticsearch import json import time import random es = Elasticsearch() client = pymongo.MongoClient() db = client.snrm query_coll = db.queries with open("../data/rank_labels.json", "r") as f: rank_labels = json.load(f) queries = [] for q in query_coll.find(): querie...
null
evaluation/evaluate_bm25.py
evaluate_bm25.py
py
2,356
python
en
code
null
code-starcoder2
76
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 7, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 8, "usage_type": "call" }, { "api_name": "json.load", "line_number": 13, "usage_type": "call" } ]
308341025
''' Util file for Demographics thesis project ''' import numpy as np import pandas as pd import scipy import scipy.optimize as opt import math from math import e import matplotlib.pyplot as plt import matplotlib.cm as mplcm import matplotlib.colors as colors import warnings ######################################### #...
null
code/Rick/z_old/util.py
util.py
py
33,033
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 51, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 66, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 68, "usage_type": "call" }, { "api_name": "numpy.sum", "line...
23471433
import json import logging import random import socket from pathlib import Path from json.decoder import JSONDecodeError from subprocess import PIPE, Popen from time import sleep from component_utility_predictor import RidgeUtilityPredictor from component_dependencies import ComponentDependencyModel import pandas as ...
null
mrubis_controller/controller.py
controller.py
py
19,248
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 18, "usage_type": "attribute" }, { "api_name": "json.load", ...
216518768
#!/usr/bin/env python # -*- coding:utf-8 -*- # author:Erik Chan # datetime:2019/4/18 16:29 # software: PyCharm from pandas import read_csv,read_table,read_excel,DataFrame,to_datetime #导入数据 df = read_csv('E://test.csv',encoding='UTF-8',sep=" ",names=['name','age']) df = read_table('E://test.txt',encoding='UTF-8') df...
null
PycharmProjects/Practice/数据分析/处理数据/Test.py
Test.py
py
1,704
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_table", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.DataFrame"...
156908612
############################################## ## Author: I-No Liao ## ## Date of update: 2018/10/19 ## ## Description: Leetcode #099 ## ############################################## # Two elements of a binary search tree (BST) are swapped by mistake. # Recover the t...
null
099_RecoverBinarySearchTree.py
099_RecoverBinarySearchTree.py
py
3,804
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 71, "usage_type": "call" }, { "api_name": "Tree.TreeNode", "line_number": 91, "usage_type": "call" }, { "api_name": "Tree.BinaryTree", "line_number": 116, "usage_type": "call" }, { "api_name": "Tree.BinaryTree", ...
221108948
import MySQLdb db = MySQLdb.connect("localhost", "root", "passwort", "greenhouse_db") curs=db.cursor() def write_log_message(message): try: print("writing log message..") curs.execute ("INSERT INTO log_message (message) VALUES (%s);" % message) db.commit() print("Done") except:...
null
greenhouse-measurement/write_log.py
write_log.py
py
663
python
en
code
null
code-starcoder2
76
[ { "api_name": "MySQLdb.connect", "line_number": 3, "usage_type": "call" } ]
556913007
import random from datetime import datetime, timedelta import redis import requests from celery.schedules import crontab from celery.task import periodic_task from django.apps import apps r = redis.Redis(host="rd01", port=6379) @periodic_task(run_every=(crontab(minute='*/5')), name="load_video_info", ignore_result=...
null
search_video/tasks.py
tasks.py
py
2,898
python
en
code
null
code-starcoder2
76
[ { "api_name": "redis.Redis", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "name" }, { "api_name": "django.apps.apps....
201207537
import serial import time class PyDMX: def __init__(self,COM='COM8',Cnumber=512,Brate=250000,Bsize=8,StopB=2,use_prev_data=False): #start serial self.channel_num = Cnumber self.data = [0] * (self.channel_num + 1) self.ser = serial.Serial(COM,baudrate=Brate,bytesize=Bsize,stopbits=S...
null
PyDMX.py
PyDMX.py
py
1,538
python
en
code
null
code-starcoder2
76
[ { "api_name": "serial.Serial", "line_number": 10, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 28, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 32, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 3...
280519262
#!/usr/bin/env python import datetime import PyRSS2Gen rss = PyRSS2Gen.RSS2( title = "KadeFor's Site feed", link = "http://www.kadefor.com/feed", description = "KadeFor's docs Site" "the site based uliweb", lastBuildDate = datetime.datetime.now(), items = [ ...
null
genrss.py
genrss.py
py
748
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyRSS2Gen.RSS2", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "attribute" }, { "api_name": "PyRSS2Gen....
95586556
import pytest from uuid import uuid4 from sentenai.stream import Stream def test_streams_iter(client): """tests iterability as dict of Streams object.""" assert dict(client.streams) or True def test_streams_get(client): """Tests default getitem of Streams object.""" n = uuid4().hex s = client.str...
null
sentenai/tests/test_streams.py
test_streams.py
py
543
python
en
code
null
code-starcoder2
76
[ { "api_name": "uuid.uuid4", "line_number": 12, "usage_type": "call" }, { "api_name": "sentenai.stream.Stream", "line_number": 14, "usage_type": "argument" }, { "api_name": "uuid.uuid4", "line_number": 20, "usage_type": "call" }, { "api_name": "pytest.raises", ...
315074285
import logging import os import boto3 import pandas as pd import requests from botocore.exceptions import ClientError LOGGER = logging.getLogger('atm') def download_from_s3(path, local_path, **kwargs): aws_conf = kwargs.get('aws_config') aws_access_key = None aws_secret_key = None if aws_conf: ...
null
atm/data.py
data.py
py
2,324
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 23, "usage_type": "call" }, { "api_name": "botocore.exceptions.ClientError", "line_number": 38, "usage_type": "name" }, { "api_name": "request...
336502019
from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None tags: set[str] = set() @app.post( "/items/", response_model=Item, summary="Create an item", response_d...
null
docs_src/path_operation_configuration/tutorial005_py310.py
tutorial005_py310.py
py
698
python
en
code
null
code-starcoder2
76
[ { "api_name": "fastapi.FastAPI", "line_number": 4, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 7, "usage_type": "name" } ]
165551429
# ============================================================================ # This file is part of Pwman3. # # Pwman3 is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2 # as published by the Free Software Foundation; # # Pwman3 is distributed in ...
null
pwman/ui/__init__.py
__init__.py
py
1,275
python
en
code
null
code-starcoder2
76
[ { "api_name": "cli.PwmanCliNew", "line_number": 32, "usage_type": "name" } ]