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
636168212
import logging import sys import stat import os import ctypes import types EXT2_GOOD_OLD_REV = 0 # The good old (original) format. EXT2_DYNAMIC_REV = 1 # V2 format w/ dynamic inode sizes. EXT2_N_BLOCKS = 15 EXT2_N_DIR_BLOCKS = 12 EXT2_NAME_LEN = 255 EXT2_GOOD_OLD_INODE_SIZE = 128 # Special inodes nu...
null
ext2_filesystem.py
ext2_filesystem.py
py
12,898
python
en
code
null
code-starcoder2
76
[ { "api_name": "stat.S_IFDIR", "line_number": 24, "usage_type": "attribute" }, { "api_name": "stat.S_IFREG", "line_number": 25, "usage_type": "attribute" }, { "api_name": "stat.S_IFLNK", "line_number": 26, "usage_type": "attribute" }, { "api_name": "stat.S_IFCHR", ...
474797789
from enum import Enum, unique from typing import List from .actions import RuleAction from .collectors import CollectorConfig from .conditions import RuleCondition from .primitives.base import attribute, BaseTolokaObject from .task_distribution_function import TaskDistributionFunction class QualityControl(BaseToloka...
null
src/client/quality_control.py
quality_control.py
py
1,983
python
en
code
null
code-starcoder2
76
[ { "api_name": "primitives.base.BaseTolokaObject", "line_number": 11, "usage_type": "name" }, { "api_name": "primitives.base.BaseTolokaObject", "line_number": 13, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 18, "usage_type": "name" }, { "api_n...
376668391
import pygame # Game parameters FRAME_RATE = 60 NO_CELLS = 16 CELL_SIZE = 32 SCREEN_WIDTH = NO_CELLS * CELL_SIZE SCREEN_HEIGHT = NO_CELLS * CELL_SIZE # Colors black = 0, 0, 0 gridColor = 255,0,0 class grid(object): """docstring for grid.""" def __init__(self): super( grid, self).__init__() se...
null
init.py
init.py
py
1,756
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.draw.line", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.draw", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pygame.draw.line", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.draw", ...
561168189
from setuptools import setup, find_packages import os version = '1.2.4.dev0' setup(name='plone.app.textfield', version=version, description="Text field with MIME type support", long_description=open("README.rst").read() + "\n" + open(os.path.join("docs", "HISTORY.rst")).read()...
null
setup.py
setup.py
py
1,568
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "setuptools.find_packages", ...
353279201
# -*- coding: utf-8 -*- """ Module implementing WriteEmailDialog. """ from PyQt4 import QtGui from PyQt4.QtCore import pyqtSlot from PyQt4.QtGui import QDialog from PyQt4.QtGui import QMessageBox from email.mime.base import MIMEBase from email.header import Header from email import encoders from email.encoders import ...
null
Email/Libs/writemail.py
writemail.py
py
3,622
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt4.QtGui.QDialog", "line_number": 25, "usage_type": "name" }, { "api_name": "Ui_writemail.Ui_WriteEmailDialog", "line_number": 25, "usage_type": "name" }, { "api_name": "DealJsonFile.GetJsonInfo", "line_number": 32, "usage_type": "call" }, { "api...
153500631
#1. TrainTheModel. # Sfyridaki Angeliki cs151036 # Mhxanikwn plhroforikhs # cs151036@uniwa.gr # Part 2 from random import seed from random import randint from numpy import array from math import ceil from math import log10 from numpy import argmax from keras.models import Sequential from keras.layers import...
null
Assignment3/LSTM/TrainTheModel.py
TrainTheModel.py
py
6,124
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.randint", "line_number": 25, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 34, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 42, "usage_type": "call" }, { "api_name": "math.log10", "line_number...
155125841
import pandas as pd import numpy as np import datetime as dt import xarray as xr import time print(dt.datetime.now(), 'Inicializando') start1 = time.time() with xr.open_dataset('../teste_ECMWF_3meses.grib2', engine='cfgrib') as ds: grbs = ds.to_dataframe() grbs = grbs.iloc[:,-1].rename('chuva_acum').reset_index(...
null
Sispshi3/Programas/ecmwf_3meses.py
ecmwf_3meses.py
py
700
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 8, "usage_type": "call" }, { "api_name": "xarray.open_datas...
329122987
import pyttsx3 import speech_recognition as sr import time from threading import Thread fall_words = ['help', 'ouch', 'fell', 'fall', 'testing'] r = sr.Recognizer() engine = pyttsx3.init() flag = -1 help_list = [] def speech_text(arg,idx,filename): global flag global help_list file = sr.AudioFile(filenam...
null
test.py
test.py
py
2,393
python
en
code
null
code-starcoder2
76
[ { "api_name": "speech_recognition.Recognizer", "line_number": 8, "usage_type": "call" }, { "api_name": "pyttsx3.init", "line_number": 9, "usage_type": "call" }, { "api_name": "speech_recognition.AudioFile", "line_number": 16, "usage_type": "call" }, { "api_name": ...
240754722
import numpy as np def infStd(*ifsets): mus = np.minimum(*[ifset[0] for ifset in ifsets]) nus = np.maximum(*[ifset[1] for ifset in ifsets]) return (mus,nus) def supStd(*ifsets): mus = np.maximum(*[ifset[0] for ifset in ifsets]) nus = np.minimum(*[ifset[1] for ifset in ifsets]) return (mus,nus...
null
ifs_operators_plot.py
ifs_operators_plot.py
py
6,576
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.minimum", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.maximum", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.maximum", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.minimum", "line_num...
127421140
""" user tag """ from sqlalchemy import BigInteger, Column, ForeignKey from sqlalchemy.orm import backref, relationship from models.utils import Model, Wrapper class UserTag(Wrapper, Model): userId = Column(BigInteger, ForeignKey('user.id'), primary_key=True...
null
models/user_tag.py
user_tag.py
py
693
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.utils.Wrapper", "line_number": 8, "usage_type": "name" }, { "api_name": "models.utils.Model", "line_number": 9, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlalchemy.Bi...
495537232
import os import datetime import json from flask import Flask, render_template, request, jsonify from flask_socketio import SocketIO, emit app = Flask(__name__) app.config["SECRET_KEY"] = os.getenv("SECRET_KEY") socketio = SocketIO(app) # Channel class -- maintains a list of messages and users currently in the chann...
null
application.py
application.py
py
6,978
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_socketio.SocketIO", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.render_template", ...
88906209
import sys, os, pickle import numpy as np # sys.path.append(os.pardir) from dataset.mnist import load_mnist from PIL import Image def img_show(img): pil_img = Image.fromarray(np.uint8(img)) pil_img.show() def get_data(): _, (x_test, y_test) = \ load_mnist(normalize=True, flatten=True, one_hot_lab...
null
Ch03/Neural_net_MNIST.py
Neural_net_MNIST.py
py
1,332
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.fromarray", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.uint8", "line_number": 8, "usage_type": "call" }, { "api_name": "dataset.mnist.load_mnist", ...
122714656
import numpy as np import cv2 from PIL import Image import os.path as osp import os import tensorflow as tf from scipy.signal import savgol_filter image_size_map={ 'avenue':(360,640), 'shanghaitech':(480,856), 'ped1':(158,238), 'ped2':(240,360), 'umn':(240,320) } def data_preprocessing(img_path,ta...
null
utils/util.py
util.py
py
4,651
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 18, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number":...
264866574
import time from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import WebDriverException import json import pandas as pd def scrape_classes(term, args, frame=None): driver = webdriver.Firefox...
null
rhode_combined.py
rhode_combined.py
py
6,992
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.web...
307914212
# -*- coding: utf-8 -*- """ pytests for Rechunk h5 """ import numpy as np import os import pandas as pd from pandas.testing import assert_frame_equal import pytest from scipy.stats import pearsonr, spearmanr, kendalltau from reVX import TESTDATADIR from reVX.hybrid_stats.hybrid_stats import (HybridStats, ...
null
tests/test_hybrid_stats.py
test_hybrid_stats.py
py
8,704
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.stats.pearsonr", "line_number": 19, "usage_type": "name" }, { "api_name": "scipy.stats.spearmanr", "line_number": 19, "usage_type": "name" }, { "api_name": "scipy.stats.kendalltau", "line_number": 19, "usage_type": "name" }, { "api_name": "os....
87290715
#!/usr/bin/env python from __future__ import print_function import collections import functools import unittest @functools.total_ordering class Bag(object): def __init__(self, str): self.c = collections.Counter([c.lower() for c in str]) def empty(self): return len(self.c) == 0 def __eq...
null
python/bag.py
bag.py
py
2,137
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 13, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 25, "usage_type": "call" }, { "api_name": "functools.total_ordering", "line_number": 10, "usage_type": "attribute" }, { "api_name": ...
71324598
from argparse import ArgumentParser from concurrent.futures import wait from django.core.management.base import BaseCommand from django.db.models import Count, F from radiofeed.feedparser import feed_parser, scheduler from radiofeed.feedparser.exceptions import FeedParserError from radiofeed.futures import ThreadPool...
null
radiofeed/feedparser/management/commands/parse_feeds.py
parse_feeds.py
py
2,133
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 13, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "name" }, { "api_name": "radiofeed.futures.ThreadPoolExecutor", "line_number": 38, "usage_type": "...
600260992
""" Program: Employee.py Author: Rajiv Malhotra Last Modified Date: 11/25/2020 Program contains the Person and Employee class. It also validates the attributes of an Employee. It also calculates the approx retirement balance for an employee. """ import re import datetime class Person: """Person class""" # C...
null
classes/Employee.py
Employee.py
py
3,774
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 45, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 75, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 75, "usage_type": "attribute" } ]
78558312
# -*- coding: utf-8 -*- """ Created on Fri Mar 1 19:01:22 2019 @author: 683898 """ import numpy as np import os from PIL import Image from configparser import ConfigParser class Canvas: def __init__(self,outPtah): self.outpath=outPtah pass def PlotImage(self,imgdict,ImagePath): ...
null
utility/Image.py
Image.py
py
2,844
python
en
code
null
code-starcoder2
76
[ { "api_name": "PIL.Image.open", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.copy", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number...
448157016
from __future__ import division import json import codecs def compute_author_hindex(record,year_t = 10000): cite_num = [] for v in record: num = 0 for year,n in v[1].items(): if int(float(year)) <= year_t: num += n cite_num.append(num) cite_num.sort(rev...
null
extract_feature.py
extract_feature.py
py
5,693
python
en
code
null
code-starcoder2
76
[ { "api_name": "codecs.open", "line_number": 74, "usage_type": "call" }, { "api_name": "json.load", "line_number": 75, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 87, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 88, ...
355988506
""" Perform Bayesian Optimization with the Risk Neutral surrogate computed via Monte Carlo on a GP for the function. """ import sys sys.path.insert(1, '../') import numpy as np from bayesopt import BayesianOptimization from sklearn.gaussian_process.kernels import WhiteKernel, ConstantKernel, RBF from surrogate impor...
null
examples/BO_MCRiskNeutral.py
BO_MCRiskNeutral.py
py
2,290
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": ...
327423264
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import setup, find_packages def parse_requirements(filename): """Parse requirement file and transform it to setuptools requirements """ from pip.req import parse_requirements as _parse_requirements if os.path.exists(filename): ...
null
pypi_install_script/qa_tests-0.3.0.tar/setup.py
setup.py
py
1,017
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pip.req.parse_requirements", "line_number": 14, "usage_type": "call" }, { "api_name": "setuptools.set...
608997072
# -*- encoding: utf-8 -*- import asyncio import lxml.html from django.conf import settings from feedgen.feed import FeedGenerator from requests_html import AsyncHTMLSession ATTEMPTS_PER_ENTRY = 5 async def _get_audio_url(article_url): session = AsyncHTMLSession() r = await session.get(article_url, timeout=2...
null
manabi/apps/reader_feeds/watanoc.py
watanoc.py
py
2,957
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests_html.AsyncHTMLSession", "line_number": 13, "usage_type": "call" }, { "api_name": "feedgen.feed.FeedGenerator", "line_number": 64, "usage_type": "call" }, { "api_name": "requests_html.AsyncHTMLSession", "line_number": 75, "usage_type": "call" } ]
318370888
from typing import Union from cyvcf2 import VCF, Variant import os import re from sqlalchemy.exc import IntegrityError, InvalidRequestError from sqlalchemy.orm import Session from covigator import MISSENSE_VARIANT from covigator.database.model import Variant as CovigatorVariant, VariantObservation, \ SubclonalVaria...
null
covigator/pipeline/vcf_loader.py
vcf_loader.py
py
13,976
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Union", "line_number": 42, "usage_type": "name" }, { "api_name": "covigator.database.model.Variant", "line_number": 42, "usage_type": "name" }, { "api_name": "covigator.database.model.SubclonalVariant", "line_number": 42, "usage_type": "name" }, ...
85344626
import inspect import os import discord import psutil from discord.ext import commands from utilities import utils class Information(commands.Cog): def __init__(self, client): self.client = client @commands.command(name="about", aliases=["info"]) async def about(self, ctx): """ ...
null
tutorial/cogs/copyinfo.py
copyinfo.py
py
11,125
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Cog", "line_number": 11, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 11, "usage_type": "name" }, { "api_name": "utilities.utils.ping", "line_number": 22, "usage_type": "call" }, { "api_name"...
541808004
""" Plot the rates from a CHEMKIN mechanism file """ import os import numpy as np import matplotlib import matplotlib.pyplot as plt # Set plotting options COLORS = ['k', 'b', 'r', 'g', 'm', 'y', 'c', '#ff9333'] LINESTYLES = ['-', '--', '-.'] MARKERS = ['.', 'o', 's'] FONT = {'size': 14} matplotlib.rc('font', **FONT)...
null
chemkin_io/plotter/sm_rates.py
sm_rates.py
py
7,409
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.rc", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", "line_number": 50, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number...
76361345
import torch import torch.nn as nn import torch.nn.functional as F import torchvision device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') # Image preprocessing modules transform = torchvision.transforms.Compose([ torchvision.transforms.Pad(4), torchvision.transforms.RandomHorizontalFlip(),...
null
RESNET.py
RESNET.py
py
5,847
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.device", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 6, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torchvision.transfo...
623147709
from time import strptime, strftime import RPi.GPIO as GPIO import config from chilli_pi.models import SensorData def is_light_time(): start_time = strptime(config.light['start_time'], '%H:%M') end_time = strptime(config.light['end_time'], '%H:%M') current_time_str = strftime('%H:%M') current_time = ...
null
jobs/handle_light_switch.py
handle_light_switch.py
py
863
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.strptime", "line_number": 8, "usage_type": "call" }, { "api_name": "config.light", "line_number": 8, "usage_type": "attribute" }, { "api_name": "time.strptime", "line_number": 9, "usage_type": "call" }, { "api_name": "config.light", "line_n...
177421470
# -*- coding: utf-8 -*- ################################################################################### # A part of Open HRMS Project <https://www.openhrms.com> # # Cybrosys Technologies Pvt. Ltd. # Copyright (C) 2018-TODAY Cybrosys Technologies (<https://www.cybrosys.com>). # Author: Nilmar Shereef (<h...
null
employee_documents_expiry/models/employee_documents.py
employee_documents.py
py
6,784
python
en
code
null
code-starcoder2
76
[ { "api_name": "odoo.models.Model", "line_number": 28, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 28, "usage_type": "name" }, { "api_name": "odoo.fields.Many2one", "line_number": 31, "usage_type": "call" }, { "api_name": "odoo.fields",...
47888935
import load_data import enums from load_data import get_camp_fixtures from export_football_data import label_columns from machine_learning.utility import load_sklearn_model import numpy as np from sklearn.linear_model import SGDClassifier from sklearn.neighbors import KNeighborsClassifier import time from datetime impo...
null
MachineLearning/Poseidon_Predictor/machine_learning/Football/both_to_score/fin_bts.py
fin_bts.py
py
2,930
python
en
code
null
code-starcoder2
76
[ { "api_name": "load_data.load_data", "line_number": 14, "usage_type": "call" }, { "api_name": "enums.SportsType", "line_number": 14, "usage_type": "attribute" }, { "api_name": "enums.CampType", "line_number": 14, "usage_type": "attribute" }, { "api_name": "load_da...
233791298
# -*- coding: utf-8 -*- import json from models import Product, Pricing class Basket: session = None def __init__(self, session): if session.get('basket') is None: session['basket'] = "{}" self.session = session def _get_key(self, product_id, size_id=0): """ ...
null
pim/trunk/catalog/basket.py
basket.py
py
7,673
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.dumps", "line_number": 30, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 39, "usage_type": "call" }, { "api_name": "models.Product.objects.get", "line_number": 55, "usage_type": "call" }, { "api_name": "models.Product.objec...
224255720
#! /usr/bin/env python import json, os, shutil from os import makedirs # Recursively copy src directory into dst directory # excludes is a list of patterns to exclude def copyall(src, dst, excludes=[]): # ignores is a function to be passed to copytree ignores = shutil.ignore_patterns(*excludes) all_files ...
null
BranchSDK/tools/stage.py
stage.py
py
1,870
python
en
code
null
code-starcoder2
76
[ { "api_name": "shutil.ignore_patterns", "line_number": 10, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_n...
260516073
import random import os.path import jsonpickle from discord.ext import commands class Data(object): def __init__(self): self.main_channel = "test" self.dm_name = "" self.initialized = 0 # --------------- BOT SETUP ------------------ token_file = open("data/token", "r") TOKEN = token_fi...
null
dndbot.py
dndbot.py
py
2,415
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Bot", "line_number": 22, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 22, "usage_type": "name" }, { "api_name": "random.shuffle", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path....
174584185
# Import required modules for the project import pandas as pd import numpy as np import plotly.graph_objs as go from plotly.subplots import make_subplots import streamlit as st # Set a password password = st.text_input("Please Enter Your Password to Proceed") if password =="6925tA": # Read in actual reve...
null
reed-share.py
reed-share.py
py
9,622
python
en
code
null
code-starcoder2
76
[ { "api_name": "streamlit.text_input", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "streamlit.radio",...
444374161
# %% import qutip.control.pulseoptim as cpo import matplotlib.pyplot as plt from qutip import * import numpy as np from qutip import Qobj, identity, sigmax, sigmaz from qutip.qip import hadamard_transform import qutip.logging_utils as logging logger = logging.get_logger() # Set this to None or logging.WARN for 'quiet' ...
null
environment/benchmark.py
benchmark.py
py
2,290
python
en
code
null
code-starcoder2
76
[ { "api_name": "qutip.logging_utils.get_logger", "line_number": 9, "usage_type": "call" }, { "api_name": "qutip.logging_utils", "line_number": 9, "usage_type": "name" }, { "api_name": "qutip.logging_utils.INFO", "line_number": 11, "usage_type": "attribute" }, { "ap...
516197250
# Lists the released and testing opponents in listing.xml (with path # to listing.xml prepended) from __future__ import print_function import sys import xml.etree.ElementTree as ET import os if len(sys.argv) > 1: filename = sys.argv[1] directory_name = os.path.dirname(filename) else: directory_name = ...
null
opponents/list_opponents.py
list_opponents.py
py
609
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number...
36658757
from pwn import * from pwn import log as Log from time import sleep def log(title,value): Log.info(title + ": {} ".format(hex(value))) period = 0.05 def include(priority,command): p.sendline("1") p.recv(8000) p.sendline(str(priority)) p.recv(8000) p.send(command) sleep(period) p.recv(...
null
pwn2win/pwn/at_your_command/solver.py
solver.py
py
1,936
python
en
code
null
code-starcoder2
76
[ { "api_name": "pwn.log.info", "line_number": 7, "usage_type": "call" }, { "api_name": "pwn.log", "line_number": 7, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" } ]
434204443
import random, itertools import numpy as np #N cubes implementation class Dolphinn: def __init__(self, P, D, K, N): self.P=P self.D=D self.K=K self.N = N self.h = [0 for i in range (N)] self.cubes = [0 for i in range(N)] for k in range(N): ...
null
dolphinn.py
dolphinn.py
py
2,248
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.multivariate_normal", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy....
529904141
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('assets', '0001_initial'), ] operations = [ migrations.CreateModel( name='Tenant', fields=[ ...
null
assetmanager/assetmanager/assets/migrations/0002_tenant.py
0002_tenant.py
py
1,391
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
471215549
from urllib.request import Request, urlopen import json import bs4 import time import requests import copy import os def getDataRestoran(url): hasilFinal = [] # with urllib.request.urlopen(url) as response: # page = response.read() req = requests.get(url, headers={"user-agent": "Mozilla/5.0 (Wind...
null
src/final.py
final.py
py
3,522
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 57, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
356269987
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # # write to the temp directory if possible, otherwise use . # dir = "." if (info.commands(globals(), locals(), "rtTester") == "rtTester"): dir = rtTester.GetTempDirectory() ...
null
IO/MINC/Testing/Python/TestMNIObjects.py
TestMNIObjects.py
py
3,803
python
en
code
null
code-starcoder2
76
[ { "api_name": "vtk.util.misc.vtkGetDataRoot", "line_number": 5, "usage_type": "call" }, { "api_name": "vtk.vtkRenderer", "line_number": 14, "usage_type": "call" }, { "api_name": "vtk.vtkRenderer", "line_number": 16, "usage_type": "call" }, { "api_name": "vtk.vtkRe...
444142534
import os import sys from loguru import logger current_path = sys.path[0] sys.path.remove(current_path) from git import Repo sys.path.insert(0, current_path) from joint_teapot.config import settings class Git: def __init__( self, org_name: str = settings.gitea_org_name, repos_dir: str ...
null
joint_teapot/workers/git.py
git.py
py
1,491
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.path.remove", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_...
53977016
import sys import networkx class LTGraph(networkx.DiGraph): def __init__(self): super().__init__(); self.influenceWord = "influence"; self.thresholdWord = "threshold"; self.stateWord = "state"; # 0: inactive # 1: selected by player 1 (AI) # 2: propagated by ...
null
hw1/python_new/sample_strategy.py
sample_strategy.py
py
4,266
python
en
code
null
code-starcoder2
76
[ { "api_name": "networkx.DiGraph", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 116, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 117, "usage_type": "attribute" }, { "api_name": "sys.argv", "li...
630723173
""" Tests for utils module """ from __future__ import absolute_import import pytest from ..utils import * import numpy as np try: import ase except ImportError: ase = None @pytest.fixture def unsorted_atoms(): atoms = ase.Atoms("TiO2", cell=[5, 5, 5], position...
null
aiida_castep/tests/test_utils.py
test_utils.py
py
1,887
python
en
code
null
code-starcoder2
76
[ { "api_name": "ase.Atoms", "line_number": 18, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 16, "usage_type": "attribute" }, { "api_name": "ase.Atoms", "line_number": 26, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_nu...
35158603
#!/usr/bin/python import unittest import sys import os test_dir = (os.path.dirname(os.path.realpath(__file__)) + "/img_seqs") project_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0, project_path) from filecheck import RenderFile import config test_files = ["/pig_v001.0001.ifd....
null
tests/test_filecheck.py
test_filecheck.py
py
2,336
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": "os.path.dirname", "lin...
76702223
from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse_lazy from django.views.generic.detail import DetailView from django.views.generic.edit import CreateView, UpdateView from resources.choices import RESOURCE_WAITING_FOR_APPROVAL from .forms imp...
null
apps/accounts/views.py
views.py
py
1,639
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.edit.CreateView", "line_number": 13, "usage_type": "name" }, { "api_name": "forms.UserRegistrationForm", "line_number": 14, "usage_type": "name" }, { "api_name": "django.urls.reverse_lazy", "line_number": 16, "usage_type": "call" }, ...
599412075
import cv2 import math import numpy as np class Transform3DPointsToDepthImageService: def execute(self, points_3d, points_a_2d, image): image_points = np.zeros(image.shape[0:2]) for point_3d, point_2d in zip(points_3d, points_a_2d): depth = math.sqrt((point_3d.x**2 + point_3d.y**2 + po...
null
code/src/vision/presentation/services/Transform3DPointsToDepthImageService.py
Transform3DPointsToDepthImageService.py
py
1,187
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.circle", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.FONT_HERSHEY_COMPLEX_SMALL", ...
610240763
""" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN...
null
csv2d42apis.py
csv2d42apis.py
py
3,727
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.put", "line_number": 48, "usage_type": "call" }, { "api_name": "requests.auth.HTTPBasicAuth", "line_number": 48, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 50, "usage_type": "call" }, { "api_name": "requests.auth....
102447746
import json import os import jwt import Crypto.PublicKey.RSA as RSA from utils.logger import Logger from exceptions import exceptions logger = Logger('checkAuthentication') public_key_file = os.path.join(os.environ['INSTALL_DIR'], 'keys','byewaitKeyy.pub') with open(public_key_file, 'r') as fd: public_key = fd.re...
null
byewait/src/decorators/checkAuthentication.py
checkAuthentication.py
py
1,128
python
en
code
null
code-starcoder2
76
[ { "api_name": "utils.logger.Logger", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ", "line_n...
145287248
from django.db import models from django.contrib.auth.models import User # Create your models here. def success_story_image_path(instance , filename): """ To save other image to specific folder """ return 'success_stories/%s/%s' %(instance.raiser_name,filename) class SuccessStory(models.Model): """...
null
myapp/models.py
models.py
py
754
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 14, "usage_type": "call" }, { "api_name"...
554713937
# -*- coding: utf-8 -*- import sqlite3 import yaml import glob import sys import re query = 'INSERT into switches values (?, ?)' query2 = 'INSERT into dhcp values (?, ?, ?, ?, ?)' conn = sqlite3.connect('dhcp_snooping.db') sh_version_files = glob.glob('*_dhcp_snooping*') def yaml_file_dict(in_file): with open(i...
null
test_folder/exercises/18_db/task_18_1/add_data.py
add_data.py
py
2,346
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 12, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 20, "usage_type": "call" }, { "api_name": "re.search", "line_number...
103632151
import datetime import json import logging import re import sys from base_django_document.exceptions import InvalidStatus, DuplicateScan from base_django_document.exceptions import InvalidLocation from base_django_document.exceptions import InvalidScan from base_django_document.exceptions import Fatality from base_dja...
null
simpleviews/views.py
views.py
py
41,612
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 54, "usage_type": "call" }, { "api_name": "django.views.generic.ListView", "line_number": 57, "usage_type": "name" }, { "api_name": "django.http.HttpResponse", "line_number": 64, "usage_type": "call" }, { "api_name...
199620503
# Standard library imports import logging import logging.handlers import os def setup_logging(log_name, log_level=logging.DEBUG): """ Setup logger. :param log_name: name for logger :param log_level: log level, a string :return: a logger object """ dir_path = os.path.dirname(os.path.realpath(...
null
shadow_collector/logger_manager.py
logger_manager.py
py
1,283
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.realpath", ...
288898440
import math import http.client import json import time from robot.api import logger global result result = { "mongo": { "devices": {}, "total_average_exported_time": 0 }, "redis": { "devices": {}, "total_average_exported_time": 0 } } class EventExportedTime(object): ...
null
lib/EventExportedTime.py
EventExportedTime.py
py
5,434
python
en
code
null
code-starcoder2
76
[ { "api_name": "http.client.client.HTTPConnection", "line_number": 22, "usage_type": "call" }, { "api_name": "http.client.client", "line_number": 22, "usage_type": "attribute" }, { "api_name": "http.client", "line_number": 22, "usage_type": "name" }, { "api_name": ...
628428314
from scipy.integrate import dblquad import math import numpy as np from scipy.interpolate import interp1d h = 1 relInt = np.array([0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.95,1.0,0.975,0,0]) ang = np.array([16.4,14.75,13,11.6,10,8.65,7.1,5.8,4.3,2.5,0,1.5,17.9,90]) relInt = np.array([0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0...
null
uvled/ledintegrate.py
ledintegrate.py
py
1,425
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 10,...
99572249
#!/usr/bin/env python """Python IRC bot based loosely on XKCD's Bucket""" import sys import re import random from twisted.enterprise import adbapi from twisted.internet import reactor, protocol from twisted.words.protocols import irc from database_config import dbpool class BucketBot(irc.IRCClient): def _get_n...
null
pail.py
pail.py
py
6,449
python
en
code
null
code-starcoder2
76
[ { "api_name": "twisted.words.protocols.irc.IRCClient", "line_number": 14, "usage_type": "attribute" }, { "api_name": "twisted.words.protocols.irc", "line_number": 14, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 22, "usage_type": "call" }, { ...
369848684
# -*- coding: utf-8 -*- """ Created on Thu Nov 29 22:36:20 2018 @author: Invisible-Tilkey """ from pyspark import SparkContext from pyspark import SparkConf sc = SparkContext.getOrCreate() import os os.chdir('D:\ML\ALGOS\PySpark\datas') cwd = os.getcwd() from pyspark.sql import SparkSession sp...
null
some_my_not_yet_ordered_practicing/SparkConf.py
SparkConf.py
py
1,174
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyspark.SparkContext.getOrCreate", "line_number": 12, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 12, "usage_type": "name" }, { "api_name": "os.chdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.get...
386660658
""" This module contains functions which are shared across multiple ACS modules. """ import os import yaml from typing import Any, List, Optional, Tuple, Union, Dict import numpy as np import pandas as pd import scipy.ndimage.filters as filters import scipy.ndimage.morphology as morphology from scipy import interp...
null
acs/common.py
common.py
py
15,994
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.Dict", "line_number": 24, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 136, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 137, "usage_type": "name" }, { "api_name": "arc.species.species.ARCSpecies...
46302248
# -*- coding: utf-8 -*- from __future__ import with_statement, print_function, absolute_import #!/usr/bin/python from datetime import date from django.conf import settings from trello import TrelloClient from .util import * from requests_oauthlib import OAuth1Session # from trello.util import * import os board_defa...
null
activity/trelloBoard.py
trelloBoard.py
py
1,851
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.conf.settings.APPLICATION_NAME.upper", "line_number": 15, "usage_type": "call" }, { "api_na...
632304043
from django.shortcuts import render, redirect from .forms import SignUpForm, ProfileForm, BusinessForm, PostForm from .models import Profile, Business, Post from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.decorators import login_required # Create your views here. @login_required(login_u...
null
neighbor/views.py
views.py
py
2,726
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Business.get_business", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Business", "line_number": 11, "usage_type": "name" }, { "api_name": "models.Post.get_posts", "line_number": 12, "usage_type": "call" }, { "api_name": "mo...
403115291
import os from setuptools import setup, find_packages version = '0.2.1' def read_file(name): return open(os.path.join(os.path.dirname(__file__), name)).read() readme = read_file('README.txt') changes = read_file('CHANGES.txt') setup(name='gaedeferred', version=version, ...
null
setup.py
setup.py
py
1,443
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_n...
490371196
import xml.etree.ElementTree as ET import csv database = ET.Element('Database') materials = ET.SubElement(database, 'Materials') headers = [ "Article", "Name", "Group_Name", "Unit_Measure", "Price", "Coef", "Length", "Width", "Thickness", "Sign", "Overhang", "Color", ...
null
convert_basis_material_csv_to_xml.py
convert_basis_material_csv_to_xml.py
py
968
python
en
code
null
code-starcoder2
76
[ { "api_name": "xml.etree.ElementTree.Element", "line_number": 4, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 4, "usage_type": "name" }, { "api_name": "xml.etree.ElementTree.SubElement", "line_number": 5, "usage_type": "call" }, { ...
568512425
from sqlalchemy import Column, ForeignKey, Integer, String, Float from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Anime(Base): __tablename__ = "anime" name = Column(String(256), primary_key=True) rating = Column(Float, nullable=False) description = Column(Strin...
null
CS3103/parallelcrawler/anime_db.py
anime_db.py
py
736
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 4, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.String", "line_number": 9, "usage_type": "call" }, { "api_...
93901727
#julio cesar santos azevedo, ra: 1900518 from flask import Flask app = Flask(__name__) def achar_primos(): n = 100 divisores = 0 primos =[] for i in range(n, 0, -1): for divisor in range(1, n + 1): if n % divisor == 0: divisores += 1 if ...
null
100_primos.py
100_primos.py
py
609
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" } ]
143510867
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/10/12 11:36 # @Author : Mr.Gan # @File : set_report.py # @Software : PyCharm import unittest import HTMLTestRunner import time import os import smtplib from email.mime.text import MIMEText from email.utils import formataddr from email.mime.base i...
null
自动化脚本/python自动化/common/reportconfig.py
reportconfig.py
py
3,691
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.logconfig.SetLog", "line_number": 24, "usage_type": "call" }, { "api_name": "common.logconfig", "line_number": 24, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path", "...
125481486
#Basic stats, sliding window, SLIm ms output #adding divergence to this #python statistics_bigwindow_pylibseq_SingExon_osg.py -LinkCutoff numbp50 -folder eqm_disc_5 -simID 1 from __future__ import print_function import libsequence #from libsequence.polytable import SimData #from libsequence.summstats import PolySIM #fr...
null
ABCScripts/statistics_bigwindow_pylibseq_SingExon_osg.py
statistics_bigwindow_pylibseq_SingExon_osg.py
py
14,230
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "libsequence.SimData", "line_number": 209, "usage_type": "call" }, { "api_name": "libsequence.SimData", "line_number": 219, "usage_type": "call" }, { "api_name": "lib...
259289255
import json import random import socket import threading import time import redis def disconnectHandler(userList, user): global maxPlayer, socketList print(user + 'disconnected!') # return to quque for k in range(userList.__len__()): try: if userList[k] != user: so...
null
Server.py
Server.py
py
5,611
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Thread", "line_number": 22, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 24, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 24, "usage_type": "attribute" }, { "api_name": ...
200862798
#!/usr/bin/env python ''' Copyright 2015 Ivan Sadikov 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 agreed to...
null
analytics/loading/xmlloader.py
xmlloader.py
py
4,732
python
en
code
null
code-starcoder2
76
[ { "api_name": "analytics.loading.loader.Loader", "line_number": 44, "usage_type": "name" }, { "api_name": "analytics.utils.misc.checkTypeAgainst", "line_number": 76, "usage_type": "call" }, { "api_name": "types.StringType", "line_number": 76, "usage_type": "argument" },...
395960551
from PyQt5.QtWidgets import QWidget, QHBoxLayout from PyQt5.QtWebEngineWidgets import QWebEngineView import os class DocumentationWidget(QWidget): def __init__(self, content=None, parent=None): super(DocumentationWidget, self).__init__(parent) self.setWindowTitle("Документация") self.__d...
null
ui/documentation.py
documentation.py
py
877
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtWebEngineWidgets.QWebEngineView", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 16, "usage_type": "call" }, { "api_name...
262364923
import argparse import functools import os import json import math from collections import defaultdict import random import io import numpy as np import torch import torch.optim as optim import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader import warnings warnings.filterwarnin...
null
sg2im/scripts/test_lstm.py
test_lstm.py
py
8,309
python
en
code
null
code-starcoder2
76
[ { "api_name": "warnings.filterwarnings", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path", "line_number": 29, "usage_type": "attribute" }, { "api_name": "argparse.Argu...
473616299
# -*- coding: utf-8 -*-- """ Detect faces on videos and create embeddings """ import cv2 import numpy as np import os, sys from tqdm import tqdm import time import torch.multiprocessing as mp from multiprocessing import Queue as mpQueue from threading import Thread from queue import Queue from queue import Empty as Qu...
null
process/src/face_detector.py
face_detector.py
py
19,962
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "sys.path", "line_num...
551345133
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import import logging from . import env, TEST_MODE SENTRY_URL = env.get_value('SENTRY_URL', default='') PAPERTRAIL_API_TOKEN = env.get_value('PAPERTRAIL_API_TOKEN', default='') LOGGING = dict( version=1, disable_existing_loggers=False, ...
null
device_map/settings/logging.py
logging.py
py
2,278
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.WARNING", "line_number": 42, "usage_type": "attribute" } ]
614908968
import re from datetime import datetime from django.shortcuts import render, redirect from django.http import HttpResponse from django.shortcuts import render from django.shortcuts import get_object_or_404 from catalog.models import Book, Author, BookInstance, Genre, Language from cart.forms import CartAddProductForm ...
null
catalog/views.py
views.py
py
2,765
python
en
code
null
code-starcoder2
76
[ { "api_name": "catalog.models.Book.objects.all", "line_number": 15, "usage_type": "call" }, { "api_name": "catalog.models.Book.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "catalog.models.Book", "line_number": 15, "usage_type": "name" }, { ...
261581056
# Libraries provided by the system import pygame import pygame.freetype import time import os from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException import grpc # Local libraries from lib.network import get_ip from lib.qr_generator import generate_qr_code from lib.lnd import get_stub, get_macaroon, check_...
null
ui.py
ui.py
py
5,536
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.putenv", "line_number": 21, "usage_type": "call" }, { "api_name": "os.putenv", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.display.init", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.display", "line_nu...
638166612
import base64 from sanic import Blueprint from sanic.response import json from models.pet import Pet from services.pet import PetService pets = Blueprint("pets", url_prefix="/pets") @pets.route("/", methods=["GET"]) async def index(request): service = PetService() pets = service.all() return json(pets) ...
null
handlers/pet.py
pet.py
py
772
python
en
code
null
code-starcoder2
76
[ { "api_name": "sanic.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "services.pet.PetService", "line_number": 12, "usage_type": "call" }, { "api_name": "sanic.response.json", "line_number": 14, "usage_type": "call" }, { "api_name": "services.p...
500879960
from django import forms from django.forms import Textarea from .models import Location, WaterBill, ElectricBill, OtherBill class LocationForm(forms.ModelForm): #address=forms.CharField(max_length=120,error_messages={'required':'This is required!!!'},help_text='Tu') class Meta: model = Location ...
null
EazyAssist/location/forms.py
forms.py
py
1,942
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "models.Location", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.T...
111960887
import cv2 import numpy as np import cv2.cv as cv import time import serial cap=cv2.VideoCapture(0) while(1): ret,frame=cap.read() hsv=cv2.cvtColor(frame,cv2.COLOR_BGR2HSV) lower_colour=np.array([0,255,255],dtype=np.uint8) upper_colour=np.array([204,255,255],dtype=np.uint8) mask=cv2.inRange(hsv,lower_colour,u...
null
OpenCV based MP/colordetection.py
colordetection.py
py
875
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HSV", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.array", "...
286987641
import numpy import gzip from pathlib import Path import pickle import io np = numpy DATABASE_FILE = "./data/GoogleNews-vectors-negative300.bin.gz" WORD2VEC_PICKLE_FILE = Path("word2vec.pickle.gz") def read_wordvec_database(database_file = DATABASE_FILE): FLOAT_SIZE = 4 FLOAT_TYPE = np.dtype("float32") wi...
null
pyword2vec/reader.py
reader.py
py
920
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 14, "usage_type": "call" }, { "api_name": "io.BufferedReader", "line_number": 15, "usage_type": "call" } ]
390216412
import functools from datetime import datetime, time import math # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def combinationSum3(self, k: int, n: int): result = [] ...
null
leetcode/2020/combinationSum3.py
combinationSum3.py
py
985
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 39, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 39, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 41, "usage_type": "call" }, { "api_name": "datetim...
449013388
from ..models import Post from django import template import datetime import timeago from django.utils import timezone register = template.Library() @register.simple_tag def total_posts(): return Post.published.count() @register.inclusion_tag('recent_posts.html/') def show_recent_posts(count=5): recent_posts...
null
blog/templatetags/blog_tags.py
blog_tags.py
py
506
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.Library", "line_number": 7, "usage_type": "call" }, { "api_name": "django.template", "line_number": 7, "usage_type": "name" }, { "api_name": "models.Post.published.count", "line_number": 11, "usage_type": "call" }, { "api_name": "mod...
280416129
import os import numpy as np from gym import utils from gym.envs.mujoco import mujoco_env class HalfCheetahFlipEnv(mujoco_env.MujocoEnv, utils.EzPickle): def __init__(self): self.prev_x_torso = None dir_path = os.path.dirname(os.path.realpath(__file__)) mujoco_env.MujocoEnv.__init__(self...
null
pmbrl/envs/envs/half_cheetah_flip.py
half_cheetah_flip.py
py
1,889
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.envs.mujoco.mujoco_env.MujocoEnv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "gym.envs.mujoco.mujoco_env", "line_number": 9, "usage_type": "name" }, { "api_name": "gym.utils.EzPickle", "line_number": 9, "usage_type": "attribute" }, ...
121114106
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import time import player_module as PM P1 = PM.player_module() P1.banner() class random_gen: def __init__(self, seed = 12345678): self.s1 = np.uint64(seed & 0xffff) self.s2 = np.uint64((seed >> 16) & 0xffff...
null
game2.py
game2.py
py
25,714
python
en
code
null
code-starcoder2
76
[ { "api_name": "player_module.player_module", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.uint64", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.uint64", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.uint64", ...
349924865
from __future__ import print_function import glob from astropy.io import fits import os import json import numpy as np import argparse #import matplotlib #matplotlib.use("Agg") import matplotlib.pyplot as plt import sys, getopt from collections import OrderedDict import seaborn as sns from scipy.optimize import fsolve...
null
PNe-cand-minijpas.py
PNe-cand-minijpas.py
py
18,872
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linspace", "line_number": 20, "usage_type": "call" }, { "api_name": "scipy.optimize.fsolve", "line_number": 21, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.empty", "lin...
188088005
import os # import variational # import matplotlib.pyplot as plt # import seaborn as sns # from matplotlib.ticker import FuncFormatter # import os # import time # import math # import pandas as pd # from collections import OrderedDict # from sklearn.linear_model import LogisticRegression # # import numpy as np # import...
null
common/fisher.py
fisher.py
py
13,979
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 61, "usage_type": "call" }, { "api_name": "os.environ", ...
353272943
#!/usr/bin/env python import struct import binascii from Crypto.Hash import MD5 class RC5: def __init__(self, w, R, key): self.w = w # block size (32, 64 or 128 bits) self.R = R # number of rounds (0 to 255) self.key = key # key (0 to 2040 bits) # some useful constants self.T = 2 * (R + 1) ...
null
sstic/report/tmp2/solve.py
solve.py
py
5,622
python
en
code
null
code-starcoder2
76
[ { "api_name": "Crypto.Hash.MD5.new", "line_number": 173, "usage_type": "call" }, { "api_name": "Crypto.Hash.MD5", "line_number": 173, "usage_type": "name" }, { "api_name": "binascii.hexlify", "line_number": 174, "usage_type": "call" } ]
349532363
"""Module with various utility functions. Was called dv in older Versions.""" import numpy as np from scipy.special import erf from scipy.stats import median_absolute_deviation from .unit_conversions import cm2THz import functools import wrapt def weighted_binning(x, arr, bins, weights=None): """ Bins a 1D a...
null
skultrafast/utils.py
utils.py
py
6,735
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.histogram", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.histogram", "line_number": 18, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.linspace", ...
590114861
#Import the required libraries import matplotlib.pyplot as plt import tensorflow as tf import numpy as np import pandas as pd import math from sklearn.utils import shuffle from sklearn.model_selection import train_test_split import os if not os.path.isdir('proj_figures'): os.makedirs('proj_figures') tf.compat.v1....
null
Project 1/Part A Files/Part A_1.py
Part A_1.py
py
4,935
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.isdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.compat.v1.logging.s...
529848782
from django.db import models class Customer(models.Model): name = models.CharField(max_length=200, default='') email = models.CharField(max_length=200, default='') password = models.CharField(max_length=200, default='') active = models.IntegerField(default=1) def __str__(self): return '%s <%s>' % (self.name, ...
null
admin/web_interface/models.py
models.py
py
1,465
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 5, "usage_type": "call" }, { "api_name": "...
217848506
import pygame from time import sleep pygame.init() screen_width = 400 screen_height = 400 screen_size = (screen_width, screen_height) screen = pygame.display.set_mode(screen_size) pygame.display.set_caption("OLIOTEHTAVA") RED = (255,0,0) BLACK = (0,0,0) WHITE = (255,255,255) GREEN = (0,255,0) FPS = 60 class Olio: ...
null
oliotehtava_liikkuvaolio.py
oliotehtava_liikkuvaolio.py
py
4,444
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
566379645
#!/usr/bin/env python import csv as csv import numpy as np import pandas as pd import os from sklearn.ensemble import RandomForestClassifier first_man=[] first_woman=[] second_man=[] second_woman=[] third_man=[] third_woman=[] first_fare=[] second_fare=[] third_fare=[] cumm_age=[] overall_age_median=0 lefter_then...
null
ml2.py
ml2.py
py
8,434
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.reader", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 52, "usage_type": "call" }, { "api_name": "numpy.median", "line_number": 94, "usage_type": "call" }, { "api_name": "numpy.median", "line_number":...
441709613
from django.conf.urls import url from . import views app_name = 'orders' urlpatterns = [ url(r'^$', views.OrderIndexView.as_view(), name='index'), url(r'^city/$', views.CityListView.as_view(), name='city_list'), # url(r'^city/add/$', views.add_city, name='add_city'), url(r'^city/add/$', views.CityCr...
null
orders/urls.py
urls.py
py
842
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" }, { "api_name": "django....
269226864
from SALib.sample import saltelli from SALib.analyze import sobol import numpy as np # function to define model # in this case it's a test function (Ishigami) def run_model(x): A = 7 B = 0.1 y = np.sin(x[0]) + A * np.sin(x[1])**2 + \ B * x[2]**4 * np.sin(x[0]) return y problem = { 'n...
null
example-ishigami.py
example-ishigami.py
py
916
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sin", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 19, "usage_type": "attribute" }, { "api_name": "SALib.sample.saltelli.sample", ...
91518839
import cv2 video_name = 'test.mp4' cap = cv2.VideoCapture('video/' + video_name) frame_id = 0 while cap.isOpened(): ret, frame = cap.read() if frame_id > 2001: cv2.imwrite('images/dataset/'+ str(frame_id) + ".jpg", frame) # cv2.imshow("frame", frame) if frame_id > 2500: break ...
null
tools/video_to_frames.py
video_to_frames.py
py
433
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "...
181840502
"""Use build_set results Revision ID: 60c119eb1e3f Revises: f86c9871ee67 Create Date: 2017-07-27 17:09:20.374782 """ # revision identifiers, used by Alembic. revision = '60c119eb1e3f' down_revision = 'f86c9871ee67' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa BUILDSET_TABLE...
null
zuul/driver/sql/alembic/versions/60c119eb1e3f_use_build_set_results.py
60c119eb1e3f_use_build_set_results.py
py
886
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.add_column", "line_number": 22, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 22, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
366122570
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. 'Separate from `mount.py` to avoid circular dep with `common.py`' import json import os from typing import AnyStr, Ite...
null
fs_image/compiler/items/mount_utils.py
mount_utils.py
py
4,176
python
en
code
null
code-starcoder2
76
[ { "api_name": "fs_image.subvol_utils.Subvol", "line_number": 24, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.walk", ...
52982799
from django.db.models import Q from django.shortcuts import render, redirect import markdown from . import models # 首页 def index(request): article_list = models.Article.objects.all() md = markdown.Markdown(extensions=[ 'markdown.extensions.extra', ]) for article in article_list...
null
blog/views.py
views.py
py
2,097
python
en
code
null
code-starcoder2
76
[ { "api_name": "markdown.Markdown", "line_number": 12, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "call" }, { "api_name": "markdown.Markdown", "line_number": 25, "usage_type": "call" }, { "api_name": "django.sh...
544154586
# Copyright (c) Istituto Nazionale di Fisica Nucleare (INFN). 2019-2020 # # 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 ...
null
app/providers/routes.py
routes.py
py
2,469
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 22, "usage_type": "call" }, { "api_name": "app.iam_blueprint.session", "line_number": 31, "usage_type": "attribute" }, { "api_name": "app.iam_blueprint", "line_number": 31, "usage_type": "name" }, { "api_name": "app....
405241435
import torch from torch.autograd import Variable from torch.autograd import Function from torch.autograd import gradcheck import math import numpy as np import torch.nn as nn import os import scipy.io as sio def A(input, GA): return (GA.cuda()).mm(torch.reshape(input.t(),(-1,1))) def At(input, GA...
null
layer_by_layer/RPCA_matrix_recovery_network.py
RPCA_matrix_recovery_network.py
py
4,519
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.reshape", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.reshape", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.abs", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number"...
595367839
import torch import os import argparse import numpy as np import hparams as hp from data.audio import save_wav, inv_mel_spectrogram from model.generator import MelGANGenerator from model.generator import MultiBandHiFiGANGenerator from model.generator import HiFiGANGenerator device = torch.device('cuda' if torch.cuda....
null
synthesize.py
synthesize.py
py
2,034
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.device", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 12, "usage_type": "attribute" }, { "api_name": "model.generator"...
383501924
import sys from distutils.core import setup from setuptools import find_packages # List of runtime dependencies required by this built package install_requires = [] if sys.version_info <= (2, 7): install_requires += ['future', 'typing'] install_requires += ["numpy", "protobuf"] setup( name="tfrecord", v...
null
setup.py
setup.py
py
570
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 9, "usage_type": "attribute" }, { "api_name": "distutils.core.setup", "line_number": 13, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 20, "usage_type": "call" } ]