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
461701069
from django.contrib.auth.tokens import default_token_generator from django.core import mail from rest_framework import status, viewsets from rest_framework.decorators import action, api_view from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework_simplejwt...
null
users/views.py
views.py
py
2,744
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.viewsets.ModelViewSet", "line_number": 16, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 16, "usage_type": "name" }, { "api_name": "models.User.objects.all", "line_number": 17, "usage_type": "call" }, ...
95814644
#--------------------------------------------------------------------- # Basic ePub reader written in Python, using wxPython for the GUI # Author: Michael Stover # # Status: Work in Progress # To-Do: # - Add function that places images into memory # - Add function for placing CSS files into memory # - Add fu...
null
eReader.py
eReader.py
py
7,332
python
en
code
null
code-starcoder2
83
[ { "api_name": "wx.html", "line_number": 24, "usage_type": "attribute" }, { "api_name": "wx.html.HtmlWindow.__init__", "line_number": 30, "usage_type": "call" }, { "api_name": "wx.html", "line_number": 30, "usage_type": "attribute" }, { "api_name": "wx.PlatformInfo...
166665161
import rubrik_oracle_module as rbk import click import datetime import pytz import json @click.command() @click.argument('host_cluster_db') @click.argument('target_host') @click.option('--time_restore', '-t', type=str, help='Point in time to mount the DB, iso format is YY:MM:DDTHH:MM:SS example 2019-01-01T20:30:15') ...
null
rubrik_oracle_db_mount.py
rubrik_oracle_db_mount.py
py
2,757
python
en
code
null
code-starcoder2
83
[ { "api_name": "rubrik_oracle_module.connect_rubrik", "line_number": 26, "usage_type": "call" }, { "api_name": "rubrik_oracle_module.get_cluster_info", "line_number": 27, "usage_type": "call" }, { "api_name": "rubrik_oracle_module.get_oracle_db_id", "line_number": 31, "usa...
645904433
# -*- coding: utf-8 -*- from django.contrib.auth import login,logout,authenticate,get_user_model from django.views.decorators.http import require_POST from django.http import HttpResponse,JsonResponse from .forms import LoginForm,RegisterForm,ChangeUserForm from utils import restful from django.shortcuts import render,...
null
apps/xfzauth/views.py
views.py
py
4,091
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 15, "usage_type": "call" }, { "api_name": "forms.LoginForm", "line_number": 18, "usage_type": "call" }, { "api_name": "django.contrib.auth.authenticate", "line_number": 24, "usage_type": "call" }, { ...
56017380
import os import random import cv2 import numpy as np from mobilenetv2 import train_L2 import test_Predict_keras from test_Predict_tflite import tflite_predition import argparse ''' This project utilize to classify the automative spare parts images whether spare part is "Healthy" or "Defected". Main logics is in the m...
null
main.py
main.py
py
5,149
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.listdir", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 33...
78972637
from django.conf import settings from django.contrib.auth.models import AbstractUser from django.contrib.auth.models import UserManager as AuthUserManager from django.contrib.auth.signals import user_logged_in from django.core.mail import send_mail from django.db.models.signals import post_save from django.db import mo...
null
models.py
models.py
py
1,966
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.auth.models.UserManager", "line_number": 10, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 16, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 17, "usage_typ...
218548589
import sqlite3 # Setting up the database def connect(): con = sqlite3.connect("movies.db") # reaching for 'movies' database using sqlite3.connection cur = con.cursor() # using .cursor we can write commands in sql to our database cur.execute("CREATE TABLE IF NOT EXISTS movies (ID INTEG...
null
Application 5 - Desktop Database App/Movies/app5_backend.py
app5_backend.py
py
2,150
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlite3.connect", ...
603776291
import sys from time import sleep import pygame from bullet import Bullet from alien import Alien def check_events(ai_settings, screen, stats, play_button, ship, aliens, bullets,sb): """响应按键和鼠标事件""" for event in pygame.event.get(): if event.type == pygame.QUIT: sb.dump_file() sys.exit() elif event.type =...
null
game_functions.py
game_functions.py
py
7,629
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.event.get", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.event", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.QUIT", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.exit", "l...
298704684
#!/usr/bin/env python ''' @author Luke Campbell <LCampbell@ASAScience.com> @file ion/processes/data/replay/replay_process.py @date 06/14/12 13:31 @description Implementation for a replay process. ''' from pyon.core.exception import BadRequest, NotFound from pyon.core.object import IonObjectDeserializer from pyon.core....
null
ion/processes/data/replay/replay_process.py
replay_process.py
py
11,838
python
en
code
null
code-starcoder2
83
[ { "api_name": "interface.services.dm.ireplay_process.BaseReplayProcess", "line_number": 33, "usage_type": "name" }, { "api_name": "pyon.core.object.IonObjectDeserializer", "line_number": 64, "usage_type": "call" }, { "api_name": "pyon.core.bootstrap.get_obj_registry", "line_n...
173229494
# -*- coding: utf-8 -*- import os import json import chardet import urllib2 import common_operations as co DEFAULT_HOSTS_FN = u"DEFAULT.hosts" class Hosts(object): CONFIG_FLAG = "#@SwitchHost!" def __init__(self, index=0, path=None, icon_idx=0): self.index = index self.path = path ...
null
legacy/v1/libs/cls_Hosts.py
cls_Hosts.py
py
3,162
python
en
code
null
code-starcoder2
83
[ { "api_name": "common_operations.decode", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.split", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.isfile", ...
24096253
import os import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import config from utils import figure_utils from utils.typical_pair_utils import get_joint_plot_x_y fontsize = 6 mpl.rcParams['font.size'] = fontsize mpl.rcParams['lines.lin...
null
plotting_for_publication/supp_plot_example_cf_pd_joint.py
supp_plot_example_cf_pd_joint.py
py
2,496
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.rcParams", "line_number": 12, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 13, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 14, "usage_type": "attribute" }, { "api_na...
207704944
import os import numpy as np import sys import urllib import math from pyspark import SparkConf from pyspark.context import SparkContext from pyspark.sql import SparkSession from pyspark import SparkContext, SparkConf sc = SparkContext.getOrCreate() import re from collections import Counter from string import punctua...
null
gru/p1/naive_bayes.py
naive_bayes.py
py
10,266
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyspark.SparkContext.getOrCreate", "line_number": 10, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 10, "usage_type": "name" }, { "api_name": "re.sub", "line_number": 27, "usage_type": "call" }, { "api_name": "re.sub",...
531398356
""" * ProjectBio v1.0 * Copyright 2014-2015 Web2all. * Licensed under Share2Create * Author: Senthilkumar M <allaboutsenthil.appspot.com> */ """ import jinja2 import os import webapp2 from datetime import datetime TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), 'templates') jinja_environment = \ jin...
null
main.py
main.py
py
957
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "jinja2.Environment", "l...
286486033
################################################################## # Experiments for event-enhanced knowledge graph embeddings # # How to run: # # To train the embeddings for a given knowledge graph and event dataset # python ekl_experiment.py --dir 'path/to/dir' --... # Up to now there is no flag to switch to GPU sup...
null
experiments/experiment_loop.py
experiment_loop.py
py
19,069
python
en
code
null
code-starcoder2
83
[ { "api_name": "prep.preprocessing.PreProcessor", "line_number": 53, "usage_type": "call" }, { "api_name": "rdflib.RDFS.comment", "line_number": 60, "usage_type": "attribute" }, { "api_name": "rdflib.RDFS", "line_number": 60, "usage_type": "name" }, { "api_name": "...
554186201
import pymongo from pymongo import MongoClient import datetime import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from string import Template MY_ADDRESS = "no-reply@quiz-me.co" ## Current template email could remove username or replace it with identikey emailText = "He...
null
Email.py
Email.py
py
2,493
python
en
code
null
code-starcoder2
83
[ { "api_name": "smtplib.SMTP", "line_number": 17, "usage_type": "call" }, { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 22, "usage_type": "call" }, { "api_name": "email.mime.text.MIMEText", "line_number": 26, "usage_type": "call" }, { "api_name...
342626607
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. """ Entrypoint utility for launching distributed torch jobs. NOTE: All command line arguments are forwarded to the child script, including those relevant to only this script. If the dependent script uses argparse, then you can parse command l...
null
dist_run.py
dist_run.py
py
4,163
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.getpid", "line_number": 34, "usage_type": "call" }, { "api_name": "os.kill", "line_number": 38, "usage_type": "call" }, { "api_name": "signal.SIGUSR1", "line_number": 39, "usage_type": "attribute" }, { "api_name": "signal.SIGUSR2", "line_numb...
299064716
import nibabel as nib import glob import pandas as pd import numpy as np from nilearn import datasets as ds from nilearn.image import resample_img from nilearn.input_data import NiftiLabelsMasker import psutil from matplotlib import pylab as plt import time from nilearn.signal import clean from nilearn import plotting,...
null
v0.1/lMCI/ADNI_lMCI_matrix_refactorized.py
ADNI_lMCI_matrix_refactorized.py
py
23,183
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame.from_dict", "line_number": 50, "usage_type": "call" }, { "api_name": "pandas...
419445144
from typing import List, Union, Tuple import numpy as np import random from tqdm import tqdm class Variable: def __init__(self, value=None, grad=None): self.value = value self.grad = grad class Polynomial: def __init__(self, a: List = None): self.coef = np.array(a) def __call...
null
libs/functional.py
functional.py
py
2,287
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.List", "line_number": 17, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 20, "usage_type": "name" }, { "api_name": "numpy.array", "line_number":...
168255906
from time import time, sleep from enum import Enum from sqlalchemy import update from flask_sqlalchemy import SQLAlchemy from celery import Celery import matplotlib.pyplot as plt import io import http import numpy as np import redis from helper import * from forms import * from models import * # How ...
null
webapp/app.py
app.py
py
12,512
python
en
code
null
code-starcoder2
83
[ { "api_name": "celery.Celery", "line_number": 26, "usage_type": "call" }, { "api_name": "celery.conf.update", "line_number": 27, "usage_type": "call" }, { "api_name": "celery.conf", "line_number": 27, "usage_type": "attribute" }, { "api_name": "celery.task", "...
95173720
import requests from PIL import Image import numpy as np ENDPOINT_URL = "http://0.0.0.0:80/infer" def infer(): image = np.asarray(Image.open('resources/yorkshire_terrier.jpg')).astype(np.float32) data ={'image': image.tolist()} response = requests.post(ENDPOINT_URL, json = data) response.raise_for_sta...
null
9. How to use uWSGI and Nginx to serve a Deep Learning model/app/client.py
client.py
py
393
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.asarray", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.float32", "line_number"...
457015893
#!/usr/bin/env python # Copyright (c) 2014, Palo Alto Networks # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" A...
null
bin/lib/pandevice/pandevice/panorama.py
panorama.py
py
4,741
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandevice.base.base", "line_number": 33, "usage_type": "attribute" }, { "api_name": "pandevice.base", "line_number": 33, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 45, "usage_type": "call" }, { "api_name": "pandevice.b...
21859955
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import postgres.fields import decimal import django.db.models.deletion import django.core.serializers.json class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_conten...
null
crawler/migrations/0001_initial.py
0001_initial.py
py
2,753
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 18, "usage_type": "call" }, ...
121250594
import logging import re from datetime import date from marcottimls.etl.base import BaseCSV from marcottimls.models import (Countries, Clubs, Competitions, DomesticCompetitions, InternationalCompetitions, Seasons, CompetitionSeasons, Persons, Players, NameOrderType, PositionType, ...
null
marcottimls/etl/overview.py
overview.py
py
11,271
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "marcottimls.etl.base.BaseCSV", "line_number": 13, "usage_type": "name" }, { "api_name": "marcottimls.models.Countries", "line_number": 24, "usage_type": "argument" }, { "a...
124396611
""" :py:mod:`pymco.listeners` ------------------------- stomp.py listeners for python-mcollective. """ import functools import threading import time from stomp import listener class CurrentHostPortListener(listener.ConnectionListener): """Listener tracking current host and port. Some connectors, like Active...
null
pymco/listener.py
listener.py
py
3,180
python
en
code
null
code-starcoder2
83
[ { "api_name": "stomp.listener.ConnectionListener", "line_number": 13, "usage_type": "attribute" }, { "api_name": "stomp.listener", "line_number": 13, "usage_type": "name" }, { "api_name": "stomp.listener.ConnectionListener", "line_number": 47, "usage_type": "attribute" ...
260602147
# -*- coding: utf-8 -*- import dpkt,sys,json,time,socket from collections import OrderedDict # packets = { # port_number: [ # { syn_flag_time: num, syn_flag_ack_time: num, delay: num }, # ... # port_number: [ ... ], # } packets = OrderedDict() MAIN_IP = "202.229.23.46" before_ti...
null
calculate.py
calculate.py
py
2,984
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.OrderedDict", "line_number": 13, "usage_type": "call" }, { "api_name": "dpkt.pcap.Reader", "line_number": 19, "usage_type": "call" }, { "api_name": "dpkt.pcap", "line_number": 19, "usage_type": "attribute" }, { "api_name": "sys.stdin", ...
541020941
#!/usr/bin/env python3 # coding: utf8 import datetime from collections import namedtuple import cardiologs.common.model.wave as wave import cardiologs.common.math.streamstatistics as cardiomath def ms_to_secs(ms): """ Convert milliseconds to seconds """ return ms / 1000 def ms_to_days(ms): """...
null
cardiologs/measure.py
measure.py
py
3,327
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.namedtuple", "line_number": 25, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 26, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 27, "usage_type": "call" }, { "api_name": "...
342113249
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
null
sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/azure/cognitiveservices/language/textanalytics/models/match_record_py3.py
match_record_py3.py
py
2,003
python
en
code
null
code-starcoder2
83
[ { "api_name": "msrest.serialization.Model", "line_number": 15, "usage_type": "name" } ]
651561274
def load_data(): import pandas as pd import os import ujson df = pd.read_csv('data/dataset_1/Video_Games_Sales_as_at_22_Dec_2016.csv') #print df #genres = df.transpose().groupby('Global_Sales')[['Action','Adventure','Fighting','Misc','Platform','Puzzle','Racing','Role-Playing','Shooter','Simulat...
null
gamedata.py
gamedata.py
py
4,518
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "ujson.dumps", "line_number": 33, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 40, "usage_type": "call" }, { "api_name": "ujson.dumps", "line_nu...
206839824
from tm1637 import TM1637 import RPi.GPIO as GPIO import multiprocessing, time class WorkoutBuddy(): REST_TIME = 90 CLK_PIN = 24 DIO_PIN = 23 INPUT_PIN = 17 MAX_SETS = 5 _time = 0 _set = 1 _thread = None _tm = None _gpio = None # Debouncing _accept_input = True ...
null
main.py
main.py
py
1,870
python
en
code
null
code-starcoder2
83
[ { "api_name": "RPi.GPIO.setmode", "line_number": 25, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 25, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 25, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setwarnings", ...
287768271
import sys, os, argparse from os.path import join, isdir, isfile, split sys.path.insert(0, 'caffe/python') import caffe from caffe import layers as L, params as P from caffe.coord_map import crop import numpy as np from math import ceil parser = argparse.ArgumentParser(description='Training hed.') parser.add_argument('...
null
zeaky/model/h2.py
h2.py
py
14,338
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.insert", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.isdir", ...
262500749
# uncompyle6 version 3.6.7 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] # Embedded file name: build/bdist.linux-x86_64/egg/pyp_beagle/beagle_pdf.py # Compiled at: 2019-07-16 04:25:49 import logging, numpy as np, os, json from matp...
null
pycfiles/pyq-4.2.1.tar/beagle_pdf.py
beagle_pdf.py
py
8,269
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 20, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 24, "usage_type": "call" }, { "api_name": "astropy.io....
198475545
""" This program is free software. Feel free to fix, modify, or remake it. https://github.com/lk-lkaz/ldr4pov """ import bpy import math import mathutils from bpy.props import ( FloatProperty, IntProperty, EnumProperty, ) ...
null
ldr4pov_Tools_AssemblyAnimation.py
ldr4pov_Tools_AssemblyAnimation.py
py
12,728
python
en
code
null
code-starcoder2
83
[ { "api_name": "bpy.types", "line_number": 29, "usage_type": "attribute" }, { "api_name": "bpy.context", "line_number": 37, "usage_type": "attribute" }, { "api_name": "bpy.types", "line_number": 84, "usage_type": "attribute" }, { "api_name": "bpy.data", "line_n...
398176661
import datetime import pytz import julian from astropy.io import fits from astropy.wcs import WCS from astropy.coordinates import SkyCoord import numpy as np from collections import OrderedDict # maping from attributes of Image Class (as named in the fits file header) to names which will be displayed in html dict_a...
null
images_query_interface/common_utils.py
common_utils.py
py
3,079
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.OrderedDict", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 51, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 51, "usage_type": "attribute" }, { "api_nam...
309401901
# Copyright 2013 – present by the SalishSeaCast Project contributors # and The University of British Columbia # # 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 # # https://www.apache.o...
null
nowcast/workers/archive_tarball.py
archive_tarball.py
py
6,602
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 38, "usage_type": "call" }, { "api_name": "nemo_nowcast.NowcastWorker", "line_number": 42, "usage_type": "call" }, { "api_name": "arrow.get", "line_number": 82, "usage_type": "call" }, { "api_name": "arrow.parser",...
122876062
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ============================= BRENDA Enzyme Database Parser ============================= :Author: Moritz Emanuel Beber :Date: 2011-01-27 :Copyright: Copyright(c) 2011 Jacobs University of Bremen. All rights reserved. :File: errors.py """ import re ...
null
brenda_parser.py
brenda_parser.py
py
14,080
python
en
code
null
code-starcoder2
83
[ { "api_name": "errno.EINVAL", "line_number": 63, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 237, "usage_type": "call" }, { "api_name": "re.UNICODE", "line_number": 237, "usage_type": "attribute" }, { "api_name": "re.compile", "line...
71326390
from django.shortcuts import render, redirect from django.utils.timezone import localtime, now from django.contrib import auth from django.contrib.auth.models import User from prueba.models import * from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import UserCreationFor...
null
teamWaifu/prueba/views.py
views.py
py
14,583
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.choice", "line_number": 39, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 49, "usage_type": "call" }, { "api_name": "django.utils.timezone.localtime", "line_number": 52, "usage_type": "call" }, { "api_name": ...
276492671
import cv2 import numpy as np from helpers import apply_clahe def add_circle_mask(image,x=None,y=None,r=None,type=None): h,w = image.shape if x is None or y is None: y,x = h//2,w//2 Y,X = np.ogrid[:h,:w] if r is None: r = min(h//2,w//2) mask = (X-x)**2+(Y-y)**2<=r**2 if type==0: image[mask] ...
null
exudates.py
exudates.py
py
1,886
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.ogrid", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_number": 21, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2HLS", "line_number": 21, "usage_type": "attribute" }, { "api_name": "helpers.apply_cl...
330762448
import logging import asyncio from sechome_conf import HOST if HOST == 'pi': import RPi.GPIO as gpio else: import mock_gpio as gpio gpio.setwarnings(False) def setup_gpio(pin): gpio.setmode(gpio.BOARD) gpio.setup(pin, gpio.IN) def cleanup_gpio(): gpio.cleanup() # 0 == open, 1 == closed def...
null
door_sensor.py
door_sensor.py
py
872
python
en
code
null
code-starcoder2
83
[ { "api_name": "sechome_conf.HOST", "line_number": 6, "usage_type": "name" }, { "api_name": "mock_gpio.setwarnings", "line_number": 10, "usage_type": "call" }, { "api_name": "mock_gpio.setmode", "line_number": 14, "usage_type": "call" }, { "api_name": "mock_gpio.BO...
264069367
from flask import Flask, render_template, request from flask_restful import Resource, Api import sys DEBUG = True TEMPLATE_FOLDER = './frontend/dist/' STATIC_URL_PATH = '' STATIC_FOLDER = './frontend/dist/' app = Flask(__name__, template_folder=TEMPLATE_FOLDER, static_url_path=STATIC_URL_PATH, static_folder=STATIC_F...
null
app.py
app.py
py
2,017
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 30, "usage_type": "call" }, { "api_name": "api.resources.boa...
254716357
# -*- coding: utf-8 -*- #FABIEN GENTY #2017/10 #PROJET LONG VISUALISATEUR DE PROTEINES # importing librairy from bokeh.plotting import figure, output_file, show,ColumnDataSource from bokeh import * from bokeh.models import HoverTool,Span,Slider, CustomJS,CategoricalColorMapper,Button, DataTable, TableColumn from bokeh...
null
app/plot.py
plot.py
py
5,123
python
en
code
null
code-starcoder2
83
[ { "api_name": "bokeh.plotting.ColumnDataSource", "line_number": 26, "usage_type": "call" }, { "api_name": "bokeh.models.CategoricalColorMapper", "line_number": 34, "usage_type": "call" }, { "api_name": "bokeh.models.HoverTool", "line_number": 37, "usage_type": "call" },...
190273067
import base64 import io import random import string from PIL import Image, ImageFont, ImageDraw class CaptchaTool(object): """ 生成图片验证码 """ def __init__(self, width=50, height=12): self.width = width self.height = height # 新图片对象 RGBA,第四通道为透明图片 self.im = Image.new('RGBA...
null
flaskapp/common/captcha.py
captcha.py
py
2,221
python
en
code
null
code-starcoder2
83
[ { "api_name": "PIL.Image.new", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 17, "usage_type": "name" }, { "api_name": "PIL.ImageFont.load_default", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.ImageFont", ...
520011733
import numpy as np import cv2 capture = cv2.VideoCapture(0) while (1): val, frame = capture.read() abu = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) negative = (255 - abu) cv2.imshow('Gambar Negatif', negative) if cv2.waitKey(1) & 0xFF == ord('c'): break cv2.destroyAllWindows() capture.rel...
null
negative.py
negative.py
py
326
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 10, "usage_type": "attribute" }, { "api_name": "cv2.imshow", ...
478624247
from __future__ import annotations from typing import TYPE_CHECKING, List, Optional, Set from blspy import G1Element from typing_extensions import Protocol from chia.server.ws_connection import WSChiaConnection from chia.types.blockchain_format.coin import Coin from chia.types.blockchain_format.sized_bytes import by...
null
chia/wallet/wallet_protocol.py
wallet_protocol.py
py
2,239
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 16, "usage_type": "name" }, { "api_name": "typing_extensions.Protocol", "line_number": 20, "usage_type": "name" }, { "api_name": "chia.wallet.util.wallet_types.WalletType", "line_number": 22, "usage_type": "name" }, ...
34445111
from pprint import pprint import requests TEST_USER_DATA = { "first_name": "Ash", "last_name": "Ketchum", "hobbies": "Catching em all!" } URL = 'http://127.0.0.1:5000/users/2' def update_user(): out = requests.put(URL, json=TEST_USER_DATA) if out.status_code == 200: pprint(out.json()) ...
null
tests/manual/update_users.py
update_users.py
py
435
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.put", "line_number": 14, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 16, "usage_type": "call" } ]
352961069
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import time from .base.exchange import * from .errors import * import requests from datetime import datetime from urllib.parse import urlencode import time import calendar import hmac import hashlib import http.client POLONIEX_REST_URL = 'poloniex.com' cl...
null
exchanges/poloniex.py
poloniex.py
py
2,810
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.time", "line_number": 23, "usage_type": "call" }, { "api_name": "hmac.new", "line_number": 26, "usage_type": "call" }, { "api_name": "urllib.parse.urlencode", "line_number": 26, "usage_type": "call" }, { "api_name": "hashlib.sha512", "line_...
126852498
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('clientes', '0001_initial'), ('locacion', '0001_initial'), ('personas', '__first__'), ('proveedores', '__first__'), ...
null
apps/domicilios/migrations/0001_initial.py
0001_initial.py
py
1,733
python
en
code
null
code-starcoder2
83
[ { "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": 17, "usage_type": "call" }, ...
496466706
from datetime import datetime from django.views.generic import TemplateView from django.contrib.auth.models import User from articles.models import Article from blog.models import Post from events.models import Event from frontpage.models import CarouselItem from songs.models import Annotation, Song class SiteIndex...
null
piosenka/views.py
views.py
py
2,622
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.views.generic.TemplateView", "line_number": 13, "usage_type": "name" }, { "api_name": "frontpage.models.CarouselItem.objects.filter", "line_number": 21, "usage_type": "call" }, { "api_name": "frontpage.models.CarouselItem.objects", "line_number": 21, ...
384049578
import csv from datetime import datetime from dataset.freeze.format.common import Serializer def value_to_str(value): if isinstance(value, datetime): return value.isoformat() if hasattr(value, 'encode'): return value.encode('utf-8') if value is None: return '' return value c...
null
dataset/freeze/format/fcsv.py
fcsv.py
py
913
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "argument" }, { "api_name": "dataset.freeze.format.common.Serializer", "line_number": 17, "usage_type": "name" }, { "api_name": "csv.writer", "line_number": 26, "usage_type": "call" } ]
140710146
import sys import os import numpy as np import torch import torch.utils.data as du from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import util from util import * from drugcell_NN import * import argparse import gc # build mask: matrix (nrows = number of relevant gene set, nco...
null
train_drugcell_prune_st.py
train_drugcell_prune_st.py
py
32,384
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.autograd.Variable", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.autograd", "line_number": 29, "usage_type": "attribute" }, { "api_name": "torch.abs", ...
236905313
import json import os import requests from urllib3.util import parse_url class Zodiac(object): def __init__(self, username, password, company=None, api=None, api_version=None): self.api = api or 'https://dashboard.zodiacmetrics.com/api' self.api_version = api_version or 'v1' self.login_...
null
zodiac/api.py
api.py
py
5,237
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 46, "usage_type": "call" }, { "api_name": "urllib3.util.parse_url", "line_number": 61, "usage_type": "call" }, { "api_name": "os.name", "lin...
13191767
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html import pymongo import re import os class DoubanPipeline(object): """ 清洗过滤数据 """ def process_item(self, item,...
null
scrapy_crawler/douban/douban/pipelines.py
pipelines.py
py
2,668
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymongo.MongoClient", "line_number": 59, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 88, "usage_type": "call" }, { "api_name": "re.match", "line_number": 98, "usage_type": "call" } ]
647361015
""" TextWin, the window showing the text messages and info messages in poezio. Can be locked, scrolled, has a separator, etc… """ import logging from typing import Optional, List, Union from poezio.windows.base_wins import Win from poezio.text_buffer import TextBuffer from poezio.config import config from poezio.the...
null
poezio/windows/text_win.py
text_win.py
py
12,577
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "poezio.windows.base_wins.Win", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 25, "usage_type": "name" }, { "api_name": "typing...
578065990
import argparse import sys import libvh PARSER = argparse.ArgumentParser() PARSER.add_argument("api", help="The api file to work on") PARSER.add_argument("-v", "--version", help="Explicitly sets version to the specified version number.") PARSER.add_argument("-d", "--directory", help="Specify a directory where the sou...
null
versionhelper/main.py
main.py
py
2,128
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 20, "usage_type": "attribute" }, { "api_name": "sys.argv.remove", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.argv", "...
580036407
# -*- coding: utf-8 -*- """ Created on Sun Feb 21 16:07:23 2021 @author: Peter """ #Import Packages import cv2 from skimage.color import rgb2gray from skimage.feature import blob_log import numpy as np import matplotlib.pyplot as plt import seaborn as sns from math import sqrt from math import hypot i...
null
Scripts/Interparticle Distance of Direct Neighbors.py
Interparticle Distance of Direct Neighbors.py
py
11,082
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.rcParams", "line_number": 20, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 21, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_na...
449420169
import torch from torch import nn from torch.nn import functional as F from model.layers import ConvNorm, LinearNorm from hparams import hparams as hps class Prenet(nn.Module): def __init__(self): super(Prenet, self).__init__() out_sizes = hps.prenet_out_sizes in_sizes = [hps.prenet_input_...
null
model/modules.py
modules.py
py
789
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "hparams.hparams.prenet_out_sizes", "line_number": 11, "usage_type": "attribute" }, { "api_name": "hpa...
535235433
from user_auth.models import DeviceToken import datetime class DeviceTokenHelper(object): def __init__(self, username): self.username = username timestamp_str = datetime.datetime.now().strftime('%s') self.datetime_now = int(timestamp_str) def add_update_device_token(self, device_token...
null
user_auth/functions/device_token_helper.py
device_token_helper.py
py
966
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "attribute" }, { "api_name": "user_auth.models.DeviceToken.objects.get", "line_number": 13, "usage_type": "call" }, { ...
600825962
import numpy as np import cv2 import time import win32api, win32con cap = cv2.VideoCapture(0) time.sleep(2) ret, frame = cap.read() lower=[157,69,119] upper=[179,255,255] while(1): ret, frame = cap.read() frame = cv2.resize(frame,(1360, 750), interpolation = cv2.INTER_CUBIC) frame=cv2.flip(frame,1) h...
null
cursor_movement_detection.py
cursor_movement_detection.py
py
1,267
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.INTER_CUBIC", "line_numb...
392091634
from flask_caching import Cache from collections import OrderedDict import pandas as pd import sys import os from traffic_analysis.d00_utils.data_loader_s3 import DataLoaderS3 from traffic_analysis.d00_utils.data_loader_sql import DataLoaderSQL from traffic_viz.d06_visualisation.dash_object_detection.server import serv...
null
src/traffic_viz/d06_visualisation/dash_object_detection/helper.py
helper.py
py
2,254
python
en
code
null
code-starcoder2
83
[ { "api_name": "traffic_analysis.d00_utils.get_project_directory.get_project_directory", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attri...
269344995
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division import matplotlib.pyplot as plt from matplotlib.artist import setp as setprop from matplotlib.backends.backend_pdf import PdfPages import datetime as dt import matplotlib.cm as cm from mpl_toolkits.axes_grid.anchored_artists impor...
null
naos-python/Library/Graphics/scatter_plot.py
scatter_plot.py
py
15,439
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.cm.get_cmap", "line_number": 51, "usage_type": "call" }, { "api_name": "matplotlib.cm", "line_number": 51, "usage_type": "name" }, { "api_name": "master_plot.warnigs", "line_number": 119, "usage_type": "call" }, { "api_name": "matplotlib....
616446930
from django.test.testcases import TestCase from 試驗.書面表.書面試驗表 import 書面試驗表 class 字數試驗(TestCase): def test_一句(self): 漢字 = '一場無練習' 臺羅 = 'Tsi̍t tiûnn bô liān-si̍p ê pí-sài' 書面 = 書面試驗表.新增一筆書面(編號='3', 文章名='一場無練習的比賽', 作者='33') 資料 = 書面.新增資料(None, 漢字=漢字, 臺羅=臺羅) 漢字字數, 臺羅字數 = 資料.字數()...
null
試驗/書面表/test字數試驗.py
test字數試驗.py
py
1,114
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.test.testcases.TestCase", "line_number": 5, "usage_type": "name" }, { "api_name": "試驗.書面表.書面試驗表.書面試驗表.新增一筆書面", "line_number": 10, "usage_type": "call" }, { "api_name": "試驗.書面表.書面試驗表.書面試驗表", "line_number": 10, "usage_type": "name" }, { "api_na...
317478873
from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth.models import User from django.shortcuts import get_object_or_404, render, redirect # from .models import related models from .models import CarModel # from .restapis import related methods # from .re...
null
server/djangoapp/views.py
views.py
py
7,329
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 28, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 34, "usage_type": "call" }, { "api_name": "dja...
465221981
# # Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. # # Licensed under the MIT License. See the LICENSE accompanying this file # for the specific language governing permissions and limitations under # the License. # import mount_efs import socket import pytest from mock import MagicMock...
null
test/mount_efs_test/test_get_dns_name.py
test_get_dns_name.py
py
2,670
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytest.fixture", "line_number": 20, "usage_type": "call" }, { "api_name": "mock.MagicMock", "line_number": 27, "usage_type": "call" }, { "api_name": "mount_efs.get_dns_name", "line_number": 35, "usage_type": "call" }, { "api_name": "mount_efs.get_dn...
319525318
from sklearn.datasets import load_breast_cancer import sklearn.preprocessing from Ridge_Lasso_model.Ridge_Lasso import RidgeClassifier, LassoClassifier import torch x, y = load_breast_cancer(return_X_y=True) x = sklearn.preprocessing.scale(x) x_train, y_train = torch.from_numpy(x[:400]), torch.from_numpy(y[...
null
Ridge_Lasso_model/test_classification.py
test_classification.py
py
843
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.datasets.load_breast_cancer", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.datasets.preprocessing.scale", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.datasets.preprocessing", "line_number": 8, "usage_type": "...
579590404
""" rex.widget.port_support ======================= :copyright: 2015, Prometheus Research, LLC """ from contextlib import contextmanager from werkzeug.local import LocalStack from rex.port import Port __all__ = ('PortSupport',) _stack = LocalStack() _default_parameters = {} def get_parameters(): ...
null
src/rex.widget/src/rex/widget/port_support.py
port_support.py
py
1,168
python
en
code
null
code-starcoder2
83
[ { "api_name": "werkzeug.local.LocalStack", "line_number": 17, "usage_type": "call" }, { "api_name": "contextlib.contextmanager", "line_number": 26, "usage_type": "name" }, { "api_name": "rex.port.Port", "line_number": 53, "usage_type": "call" } ]
642226255
#!/usr/bin/env python3 # Copyright 2017 SchedMD LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
null
dm/scripts/setup.py
setup.py
py
15,000
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 36, "usage_type": "call" }, { "api_name": "requests.exceptions", "line_number": 40, "usage_type": "attribute" }, { "api_name": "sys.exit", "li...
78156344
from nltk.corpus import names from nltk import NaiveBayesClassifier from nltk import classify from nltk import MaxentClassifier import random names = ([(name, 'male') for name in names.words('male.txt')] + [(name, 'female') for name in names.words('female.txt')]) random.shuffle(names) print(names[0:10]) def gender...
null
nltk/practice/gender_identification_classifier.py
gender_identification_classifier.py
py
2,378
python
en
code
null
code-starcoder2
83
[ { "api_name": "nltk.corpus.names", "line_number": 8, "usage_type": "name" }, { "api_name": "nltk.corpus.names.words", "line_number": 8, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 10, "usage_type": "call" }, { "api_name": "nltk.corpus.na...
49160889
from collections import OrderedDict import inspect import numpy as np import os from Assignment6.Code import kDataPath, report_path from model.NeuralNetworkModel import NeuralNetwork from model.RandomForestsModel import RandomForestModel from utils.Assignment4Support import draw_accuracies from utils.Assignment5Support...
null
Assignment8/Code/assignments/previous/hw6/prob2_roc_curves.py
prob2_roc_curves.py
py
5,173
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "Assignment6.Code.report_path", "line_number": 12, "usage_type": "argument" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "utils.Assi...
308717504
import os import numpy as np from glob import glob import random # image data import SimpleITK as sitk from ops.preprocessing import Preprocessing # Learning import torch import torch.nn as nn from ops.data_loader import Create_Batch from train import training from validation import validation from test import test...
null
main.py
main.py
py
3,408
python
en
code
null
code-starcoder2
83
[ { "api_name": "warnings.filterwarnings", "line_number": 24, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 26, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 43, "usage_type": "attribute" }, { "api_name": "ops.u...
534070130
# -*- coding:utf-8 -*- from .sortbase import ConditionWithSort import psutil class FreeSpaceCondition(ConditionWithSort): def __init__(self, settings): ConditionWithSort.__init__(self, settings['action']) self._min = settings['min'] * 1073741824 # limit = limit * 1GiB self._path = settin...
null
autoremovetorrents/condition/freespace.py
freespace.py
py
728
python
en
code
null
code-starcoder2
83
[ { "api_name": "sortbase.ConditionWithSort", "line_number": 7, "usage_type": "name" }, { "api_name": "sortbase.ConditionWithSort.__init__", "line_number": 9, "usage_type": "call" }, { "api_name": "sortbase.ConditionWithSort", "line_number": 9, "usage_type": "name" }, {...
90738847
import os import time import shutil from uuid import getnode from abc import ABC, abstractmethod from recording.src.coding_framework.BDAConfigParser import g_config from recording.src.speech_recognition.BDAVideoAudioUtilities import BDAVideoToAudio from google.cloud import speech from google.cloud import storage from...
null
recording/src/speech_recognition/BDAGoogleStorage.py
BDAGoogleStorage.py
py
10,566
python
en
code
null
code-starcoder2
83
[ { "api_name": "abc.ABC", "line_number": 40, "usage_type": "name" }, { "api_name": "recording.src.coding_framework.BDAConfigParser.g_config.get_value", "line_number": 58, "usage_type": "call" }, { "api_name": "recording.src.coding_framework.BDAConfigParser.g_config", "line_num...
379746640
import numpy as np import torch, torchvision import torch.nn as nn from torchvision import datasets import torchvision.transforms as transforms import matplotlib.pyplot as plt from PIL import Image from dataset_3 import CatAndDogsDataset class net(nn.Module): def __init__(self): super(net, self).__init_...
null
homeworks/homework2/cnn_4.py
cnn_4.py
py
5,143
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
631303399
from serial import Serial class StepperMotor(): """Stepper Motor with Serial""" def __init__(self, serial_port, baud_rate): self.serial_port = serial_port self.baud_rate = baud_rate self.serial = None self.connected = False def connect(self): try: ...
null
Python/StepperMotor.py
StepperMotor.py
py
970
python
en
code
null
code-starcoder2
83
[ { "api_name": "serial.Serial", "line_number": 14, "usage_type": "call" } ]
306191441
''' MIT License Copyright (c) 2019 Arshdeep Bahga and Vijay Madisetti 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, mo...
null
imagepro/myapp/s3upload.py
s3upload.py
py
2,384
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto.s3.connect_s3", "line_number": 28, "usage_type": "call" }, { "api_name": "boto.s3", "line_number": 28, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
166454965
import sys from tensorflow.examples.tutorials.mnist import input_data # mnist = input_data.read_data_sets(".", one_hot=True, reshape=False) mnist = input_data.read_data_sets('K:\datasets\MNIST', one_hot=True, reshape=False) #MNIST数据集已经可以用one-hot编码的形式提供 import tensorflow as tf save_file = './train_model.ckpt' saving ...
null
Class1/4-02_Save_and_restore_tensorflow_models/multilayer_perceptron.py
multilayer_perceptron.py
py
4,805
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "line_number": 5, "usage_type": "call" }, { "api_name": "tensorflow.examples.tutorials.mnist.input_data", "line_number": 5, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 13, ...
58415856
#!/user/bin/env python '''viewStructures.py Simple wrapper functions that uses ipywidgets and py3Dmol to view a list of protein structures. ''' __author__ = "Mars (Shih-Cheng) Huang" __maintainer__ = "Mars (Shih-Cheng) Huang" __email__ = "marshuang80@gmail.com" __version__ = "0.2.0" __status__ = "Done" from ipywidge...
null
mmtfPyspark/structureViewer.py
structureViewer.py
py
9,318
python
en
code
null
code-starcoder2
83
[ { "api_name": "py3Dmol.view", "line_number": 52, "usage_type": "call" }, { "api_name": "py3Dmol.view", "line_number": 58, "usage_type": "call" }, { "api_name": "ipywidgets.IntSlider", "line_number": 66, "usage_type": "call" }, { "api_name": "ipywidgets.interact", ...
72923834
# -*- coding: utf-8 -*- import scrapy from scrapy import Request from urllib import parse class SteamSpider(scrapy.Spider): name = 'steam' # allowed_domains = ["lab.scrapyd.cn"] start_urls = ['http://lab.scrapyd.cn/'] def parse(self, response): # 1.获取当前页所有文章列表url,并对文章进行解析 # 2.获取下一页url...
null
demo1/spiders/steam.py
steam.py
py
1,401
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.parse.urljoin", "line_number": 18, "usage_type": "call" }, { "api_name": "urllib.parse", ...
178609921
import argparse import json import os import requests from google.oauth2 import service_account from google.cloud.iot import DeviceManagerClient, types, enums from google.api_core.exceptions import NotFound WOTT_ENDPOINT = os.getenv('WOTT_ENDPOINT', 'https://api.wott.io') PROJECT = 'wott-244904' LOCATION = 'europe-...
null
wott.py
wott.py
py
5,549
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 22, "usage_type": "attribute" }, { "api_name": "json.load", "line_numbe...
165654780
# -*- coding: utf-8 -*- # @Time : 2018-04-05 16:26 # @Author : Dingzh.tobest # 文件描述 :计算指数相关数据的算法 from scada.db_data.index_db_data import * from scada.util import global_var as gv import pandas as pd import json # 计算指数PE数据 def compute_index_pe_ttm(index_code, trade_date): df = get_index_cons(index_code, trade...
null
scada/algo_module/index_data_algo.py
index_data_algo.py
py
1,786
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.strftime", "line_number": 24, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 24, "usage_type": "call" }, { "api_name": "time.time", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_n...
499899601
""" Loader for SDSS individual spectrum files: spec_ files. .. _spec: https://data.sdss.org/datamodel/files/BOSS_SPECTRO_REDUX/RUN2D/spectra/PLATE4/spec.html """ import os import re import _io from astropy.io import fits from astropy.table import Table from astropy.wcs import WCS from astropy.units import Unit, def_u...
null
specutils/io/default_loaders/sdss.py
sdss.py
py
7,686
python
en
code
null
code-starcoder2
83
[ { "api_name": "re.compile", "line_number": 25, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 26, "usage_type": "call" }, { "api_name": "parsing_utils.read_fileobj_or_hdulist", "line_number": 35, "usage_type": "call" }, { "api_name": "astropy.i...
456618904
# Copyright (c) 2014, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. import unittest from cybox.test import EntityTestCase from stix.extensions.identity.ciq_identity_3_0 import CIQIdentity3_0Instance class CIQIdentity3_0InstanceTests(EntityTestCase, unittest.TestCase): ...
null
stix-1.1.1.0/stix/test/extensions/identity/ciq_identity_3_0_test.py
ciq_identity_3_0_test.py
py
1,424
python
en
code
null
code-starcoder2
83
[ { "api_name": "cybox.test.EntityTestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 9, "usage_type": "attribute" }, { "api_name": "stix.extensions.identity.ciq_identity_3_0.CIQIdentity3_0Instance", "line_number": 10, "usa...
240944477
from dotenv import load_dotenv import os from selenium import webdriver from selenium.webdriver.chrome.options import Options as ChromeOptions from selenium.webdriver.firefox.options import Options as FirefoxOptions from selenium.webdriver.safari.options import Options as SafariOptions from selenium.webdriver.edge.opti...
null
samplebrowsertest.py
samplebrowsertest.py
py
3,262
python
en
code
null
code-starcoder2
83
[ { "api_name": "dotenv.load_dotenv", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 37, "usage_type": "call" }, { "api_name": "selenium.webdriver.firefox.options.Options", "line_number": 38, "usage_type"...
474958326
import docx from diot import Diot from docx.shared import Inches, Pt from docx.enum.dml import MSO_COLOR_TYPE, MSO_THEME_COLOR from docx.enum.text import WD_ALIGN_PARAGRAPH, WD_LINE_SPACING, WD_BREAK_TYPE, WD_COLOR, WD_TAB_ALIGNMENT, WD_TAB_LEADER, WD_UNDERLINE from docx.enum.style import WD_STYLE, WD_STYLE_TYPE from d...
null
bioprocs/scripts/docx/pDocx.py
pDocx.py
py
2,509
python
en
code
null
code-starcoder2
83
[ { "api_name": "docx.enum.section.WD_SECTION", "line_number": 42, "usage_type": "argument" }, { "api_name": "docx.enum.section.WD_ORIENT", "line_number": 43, "usage_type": "argument" }, { "api_name": "docx.shared.Pt", "line_number": 46, "usage_type": "call" }, { "a...
504289676
# coding=UTF8 import requests URL = "https://www.madailicai.com/p2p/service/" def count_for_each(product_type, service_type): params = {"productType": product_type} result = requests.head(url=URL + service_type, params=params) return result.headers.get('X-Record-Count') def list_of_each(start, size, p...
null
week-1/zhangqing.py
zhangqing.py
py
1,982
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.head", "line_number": 10, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 16, "usage_type": "call" } ]
463580579
from datetime import datetime import pytest from unittest.mock import MagicMock from pytz import utc from sccc_contestbot.models import Contest, ContestData from sccc_contestbot.contest_manager import RenewalFlag from .conftest import temp_db_data def test_renewal_contest(contest_manager, db_session, event_loop): ...
null
tests/test_contest_manager.py
test_contest_manager.py
py
3,678
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.mock.MagicMock", "line_number": 20, "usage_type": "call" }, { "api_name": "sccc_contestbot.models.ContestData", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 22, "usage_type": "call" }, { "...
543168364
# code taken and modified from: # https://github.com/aaron-xichen/pytorch-playground/blob/master/cifar/model.py import torch import torch.nn as nn import torch.utils.model_zoo as model_zoo from collections import OrderedDict model_urls = { 'cifar10': 'http://ml.cs.tsinghua.edu.cn/~chenxi/pytorch-models/cifar10-d8...
null
oppel/demos/cifar10model.py
cifar10model.py
py
2,076
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Module", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 21, "usage_type": "attribute" }, { "api_name": "torch.nn", ...
556508327
import logging import numpy as np from sklearn.linear_model import LinearRegression, ElasticNet, Ridge from sklearn.utils import check_random_state from csrank.objectranking.object_ranker import ObjectRanker from csrank.tunable import Tunable from csrank.util import normalize, print_dictionary from ..dataset_reader.o...
null
csrank/objectranking/expected_rank_regression.py
expected_rank_regression.py
py
5,315
python
en
code
null
code-starcoder2
83
[ { "api_name": "csrank.objectranking.object_ranker.ObjectRanker", "line_number": 16, "usage_type": "name" }, { "api_name": "csrank.tunable.Tunable", "line_number": 16, "usage_type": "name" }, { "api_name": "csrank.util.normalize", "line_number": 54, "usage_type": "name" ...
512908971
import json class Hotel: def __init__(self, a_name, a_adress, a_description, a_services, a_apartments): self.name = a_name self.adress = a_adress self.description = a_description self.services = a_services self.apartments = a_apartments def to_JSON(self): retur...
null
Model/hotel.py
hotel.py
py
389
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.dumps", "line_number": 13, "usage_type": "call" } ]
132326671
"""solve_problem6.py: Assignment 1, Problem 6. """ __author__ = "Dilawar Singh" __copyright__ = "Copyright 2016, Dilawar Singh " __credits__ = ["NCBS Bangalore"] __license__ = "GNU GPL" __version__ = "1.0.0" __maintainer__ = "Dilawar Singh" __email__ ...
null
DifferentialEquations2016/Assignment1/solve_problem6.py
solve_problem6.py
py
1,503
python
en
code
null
code-starcoder2
83
[ { "api_name": "pylab.style.use", "line_number": 22, "usage_type": "call" }, { "api_name": "pylab.style", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.exp", "line_number": 25, "usage_type": "call" }, { "api_name": "scipy.integrate.ode", ...
241579253
#!/usr/bin/env python # -----------------------\ n------------------------------------- # lexer.py # # ------------------------------------------------------------ import ply.lex as lex from ply.lex import TOKEN import sys from table import Table # List of token names. tokens = ( # KEYWORDS 'IMPORT', 'CLASS'...
null
asgn1/src/lexer.py
lexer.py
py
6,289
python
en
code
null
code-starcoder2
83
[ { "api_name": "ply.lex.lex", "line_number": 260, "usage_type": "call" }, { "api_name": "ply.lex", "line_number": 260, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 262, "usage_type": "attribute" }, { "api_name": "table.Table", "line_number":...
353080772
import logging def init(options): logging.addLevelName(5, 'TRACE') logging.addLevelName(3, 'MICROTRACE') log_format = '%(asctime)s - [%(module)s] %(levelname)s - %(message)s' logging.basicConfig(level=logging.getLevelName(options.log_level), format=log_format, datefmt='%H:%M:%S...
null
old/Pipeline/logger.py
logger.py
py
1,162
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.addLevelName", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.addLevelName", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.ge...
473785587
__author__ = "Nikhil Bharadwaj Gosala" __version__ = 'Python 2.7' import os from PIL import Image, ExifTags def preprocessImages(image_path, wm_path): "Open the images and resize the watermark to the required size" is_landscape = False is_potrait = False wm = {} #Open the images try: ...
null
auto_watermark_multiple_27.py
auto_watermark_multiple_27.py
py
4,825
python
en
code
null
code-starcoder2
83
[ { "api_name": "PIL.Image.open", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 15, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 23, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number"...
344098503
import os import functools from .utils import printProgressBar from randomness_testsuite.ApproximateEntropy import ApproximateEntropy as aet from randomness_testsuite.Complexity import ComplexityTest as ct from randomness_testsuite.CumulativeSum import CumulativeSums as cst from randomness_testsuite.FrequencyTest imp...
null
scripts/test_all.py
test_all.py
py
3,025
python
en
code
null
code-starcoder2
83
[ { "api_name": "randomness_testsuite.FrequencyTest.FrequencyTest.monobit_test", "line_number": 28, "usage_type": "attribute" }, { "api_name": "randomness_testsuite.FrequencyTest.FrequencyTest", "line_number": 28, "usage_type": "name" }, { "api_name": "randomness_testsuite.Frequenc...
602877261
# ======================================== # [] File Name : network.py # # [] Creation Date : Februray 2018 # # [] Created By : Ali Gholami (aligholami7596@gmail.com) # ======================================== """ Kaggle competition, predicting the survivals of the Titanic! """ # coding: utf-8 # Import Pandas an...
null
docs/assignment-1/src/network.py
network.py
py
9,256
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 39, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 122, "usage_type": "call" }, { "api_name": "matplotlib....
363043962
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Sep 21 14:48:16 2019 @author: zoe """ """ #import matplotlib from tkinter import * main=Tk() main.title('RoboTeam_RRT_GUI') #renames the title of the main window mainFrame= Frame(main) mainFrame.pack() """ import numpy as np import random, math imp...
null
RoboTeam_RRT_Gui.py
RoboTeam_RRT_Gui.py
py
5,473
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.sqrt", "line_number": 72, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 88, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 89, "usage_type": "call" }, { "api_name": "pygame.locals.init", "lin...
99877906
""" MIT License Copyright (c) 2020 Airbyte 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, modify, merge, publish, distr...
null
airbyte-integrations/connectors/source-file/integration_tests/client_storage_providers_test.py
client_storage_providers_test.py
py
5,557
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 31, "usage_type": "call" }, { "api_name": "source_file.client.Client", "line_number": 35, "usage_type": "call" }, { "api_name": "source_file.client.Client", "line_number": 53, "usage_type": "call" }, { "api_name": "pyte...
607013936
# # github Repo: https://github.com/clejae # ------------------------------------------ LOAD PACKAGES ---------------------------------------------------# import os import time import pandas as pd import matplotlib.pyplot as plt from matplotlib.patches import Patch import numpy as np # ------------------------------...
null
figures_in_paper/Landscape21_grouped_stacked_bars_farm_characteristics.py
Landscape21_grouped_stacked_bars_farm_characteristics.py
py
8,095
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_excel", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 37, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 37, "usage_type": "call" }, { "api_name": "pandas.concat", "l...
116665284
from setuptools import setup, find_packages import sys, os version = '0.1' setup(name='updater', version=version, description="Consistent update for OpenFlow Networks", long_description="""\ This package provides update commands to satisfy requirement.""", classifiers=[], # Get strings from ht...
null
updater/setup.py
setup.py
py
820
python
en
code
null
code-starcoder2
83
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 17, "usage_type": "call" } ]
483445797
#!python3 """ Hi there. This file doesn't contain any code. It's just here to give an example of the file naming scheme. Cheers! """ import validators def isurl(link): value=validators.url(link) if(value==True): print("It is a URL") else: print("It is not a URL") def main(): string=str(in...
null
December-09/python_Raahul46_IS_THIS_URL.py
python_Raahul46_IS_THIS_URL.py
py
409
python
en
code
null
code-starcoder2
83
[ { "api_name": "validators.url", "line_number": 12, "usage_type": "call" } ]
696818
#!/usr/bin/env python """ lib/reykjavik/deps.py A simple dependency manager that does NOT implement atomicity and concurrency. What we do not implement here is the textbook semaphore behaviour: * atomic behaviour * decrementing and blocking * incrementing and unblocking one waiting thread * notification of scheduler...
null
docker/reykjavik/110-library/opt/reykjavik/lib/reykjavik/deps.py
deps.py
py
2,047
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 38, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 39, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 40, "usage_type": "attribute" }, { "api_name": "memcache.Client", ...
628385208
from django.conf import settings import numpy as np import time def get_arrangement_permutation( dist, mode, model=None, clusters=None, init_perm=None): start_time = time.time() if mode == "none": return [i for i in range(dist.shape[0])] if mode == "hamilto...
null
algo/arranging/base.py
base.py
py
1,702
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name": "hamilton_path.HamiltonPath", "line_number": 18, "usage_type": "call" }, { "api_name": "hamilton_path.HamiltonPath", "line_number": 23, "usage_type": "call" }, { "api_name": "sklea...