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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
371434803 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 30 22:19:05 2015
the core function to evaluate the logLikelihood of the data
function p=logLikelihood(data,options,alpha,beta,lambda,gamma,varscale)
Calculates the logLikelihood of the given data with given parameter
values. It is fully vectorized and contains the core cal... | null | logLikelihood.py | logLikelihood.py | py | 6,908 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.isfinite",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.isfinite",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_num... |
245904243 | import socket
import ast
import datetime
from threading import Thread
from ws import initiate_server
def fullLog(t):
print('['+str(datetime.datetime.now())+']: '+t)
def getNodeList():
with open('node_list', 'r') as f:
d = f.readline()
node_list = ast.literal_eval(d)['nodes']
return node_list
def getC... | null | node.py | node.py | py | 2,625 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "ast.literal_eval",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ast.liter... |
98281866 | from apscheduler.schedulers.blocking import BlockingScheduler
from concurrent.futures import ThreadPoolExecutor
import requests
def crawler_run(url):
r = requests.get(url)
print(r)
class Crawler:
def __init__(self, item_service, source_service):
self.item_service = item_service
self.sour... | null | services/crawler.py | crawler.py | py | 601 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.ThreadPoolExecutor",
"line_number": 21,
"usage_type": "call"
}
] |
182703069 | import io
import os
import boto
import boto3
import boto.s3.connection
import requests
import json
import zipfile
import time
import db
from settings import dbname, dbhost, dbuser, dbpw, dbport
from multiprocessing.dummy import Pool as ThreadPool
def lambda_handler(event, context):
class DB():
... | null | py/goal/archived/qualtrics/lambda.py | lambda.py | py | 16,308 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "db.connect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "settings.dbname",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "settings.dbhost",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "settings.dbport",
"lin... |
21460752 | from functools import lru_cache
from time import perf_counter
from requests import get
from json import loads
import datetime as dt
# Example where a costly function can be improved by using lru_cache
@lru_cache(maxsize=365)
# Maxsize here is 365 to store up to one year of exchange rates
def date_exchange_rates_lr... | null | exchange_rate.py | exchange_rate.py | py | 2,758 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "functools.lru_cache",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_... |
264341264 | # variable.py
# managed variables
# author: Playinf
# email: playinf@stu.xmu.edu.cn
import theano
from collection import add_to_collection, get_collection
__all__ = [
"variable",
"global_variables",
"trainable_variables"
]
_GLOBAL_VARIABLES_KEY = "variables"
_TRAINABLE_VARIABLES_KEY = "trainable_variabl... | null | ops/variable.py | variable.py | py | 1,077 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "theano.config",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "theano.shared",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "collection.add_to_collection",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "collect... |
340411116 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig, ax = plt.subplots()
circle, = ax.plot([], [], 'bo', ms=10)
coord = np.array([5000.,9000.]) # область появления мяча
velocity = np.array([100.,0.]) # вектор начальной скорости, задаём смещение по х
def init():
ax.set_... | null | task3.py | task3.py | py | 1,315 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
247750954 | import os
import random
import pathlib
from bisect import insort_right
from collections import defaultdict
import torch.utils.data as data
import PIL
import PIL.Image
from torchwisdom.vision.transforms import pair as ptransforms
class SiamesePairDataset(data.Dataset):
def __init__(self, root, ext='jpg', transfor... | null | torchwisdom/vision/datasets/datasets.py | datasets.py | py | 4,847 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "PIL.Image... |
433873178 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build\bdist.win32\egg\seishub\core\db\tests\test_util.py
# Compiled at: 2010-12-23 17:42:43
"""
Test suite for DB utilities.
"""
from seishub.core.db import DEFA... | null | pycfiles/seishub.core-1.2.1-py2.7/test_util.py | test_util.py | py | 5,030 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "seishub.core.db.manager.meta",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "seishub.core.db.DEFAULT_PREFIX",
"line_number": 16,
"usage_type": "name"
},
{
"api_... |
196229094 | #-*- coding:utf-8 -*-
from xml.dom.minidom import Document
import os
import glob
import numpy as np
def run_sys_command(command_str,output_type=""):
print("command_str", command_str)
import subprocess
if output_type == "FILE":
# fdout = open("/tmp/tmpSysCommand.out", 'w')
fderr = open(... | null | SceneText/pre-prepare/generate_xml_annotation.py | generate_xml_annotation.py | py | 4,827 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "subprocess.PIPE",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Popen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.ex... |
513712742 | import tensorflow as tf
from tensorflow.keras.callbacks import TensorBoard
import time
import argparse
from helper_scripts import load_data
def main(args):
training_X, training_y = load_data.load_training_data()
testing_X, testing_y = load_data.load_testing_data()
model = tf.keras.models.Sequential()
model.add(t... | null | neural_network.py | neural_network.py | py | 1,586 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "helper_scripts.load_data.load_training_data",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "helper_scripts.load_data",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "helper_scripts.load_data.load_testing_data",
"line_number": 10,
"usage... |
275951390 | # coding=utf-8
from math import *
from prettytable import PrettyTable
class Interpolation:
def __init__(self):
self.x_array = []
self.y_array = []
def arrays(self, x, n, X, Y):
k = 0
l_x = len(X) - 1
if x > X[l_x - int((n + 1) / 2)]:
for i in range(n + 1):
... | null | ALG/lab1.py | lab1.py | py | 2,801 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "prettytable.PrettyTable",
"line_number": 75,
"usage_type": "call"
}
] |
53151615 | import logging
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from .models import Flower
####student
@receiver(post_save, sender=Flower)
def log_flower_updated_added_event(sender, **kwargs):
logger = logging.getLogger(__name__)
flower = kwargs['instance']
if kwarg... | null | shop/signals.py | signals.py | py | 757 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.dispatch.receiver",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.db.models.signals.post_save",
"line_number": 9,
"usage_type": "argument"
},
{
"a... |
26358634 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'URLMinify', fields ['short_url']
db.dele... | null | minify/migrations/0004_auto__del_unique_urlminify_short_url__add_unique_urlminify_short_url_s.py | 0004_auto__del_unique_urlminify_short_url__add_unique_urlminify_short_url_s.py | py | 2,260 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "south.v2.SchemaMigration",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "south.db.db.delete_unique",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "south.db.db",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "south.d... |
1609077 | import nengo
import numpy as np
import pytest
import struct
import tempfile
from nengo_spinnaker.operators import lif
from nengo_spinnaker.utils import type_casts as tp
class TestEnsembleLIF(object):
@pytest.mark.parametrize("size_in", [1, 4, 5])
def test_init(self, size_in):
"""Test that creating an... | null | tests/operators/test_lif.py | test_lif.py | py | 3,672 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nengo.Ensemble",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nengo_spinnaker.operators.lif.EnsembleLIF",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "nengo_spinnaker.operators.lif",
"line_number": 20,
"usage_type": "name"
},
{... |
570147106 | from numpy import array
from logging import getLogger
log = getLogger(__name__)
def square(side):
"""
Same as rectangle(side, side).
"""
return rectangle(side, side)
def rectangle(width, height):
"""
Returns a numpy-array of an rectangle ready to use as a
vertex buffer.
The orig... | null | client/geometry.py | geometry.py | py | 885 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 42,
"usage_type": "call"
}
] |
594355443 | from itertools import product
import datetime
def answer():
counter = 0
for year, month in product(range(1901, 2001), range(1, 13)):
if datetime.date(year, month, 1).weekday() == 6:
counter += 1
return counter
if __name__ == '__main__':
print(answer())
| null | OLD_PY_CODE/project_euler_py/pe0019.py | pe0019.py | py | 295 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.product",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 7,
"usage_type": "call"
}
] |
389420741 | import csv
from collections import OrderedDict
#might need to re-think what data format will be in
#should obviously be a dict
def create_file(data=[], fieldnames=[] ,name="",delimiter=','):
print(data)
try:
with open(name, mode='w') as csv_file:
wr = csv.DictWriter(csv_file, fieldnames=... | null | data_processing/csv_storage.py | csv_storage.py | py | 2,838 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.DictWriter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "collections.Ord... |
348577215 | from subprocess import call
import numpy as np
import pickle
import time as t
import datetime
import os
from shutil import copyfile,copy,move
import easygui
import sys
# Select the Odorant, Odor Delivery Protocol, Locust Model
odor_path = sys.argv[1]# easygui.fileopenbox(msg='Open Odor File',title='Odor Browser',defau... | null | B. Model/Olfactory System/NGN 2020/initExperiment.py | initExperiment.py | py | 2,511 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
... |
554022449 | import io
import json
from django.http import JsonResponse, HttpResponseRedirect
from django.shortcuts import render
# Create your views here.
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from .api import CityModelsSerializers, CityAreaModelsSerializers
from .models import City... | null | Citys/views.py | views.py | py | 2,622 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.views.View",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.CityModels.objects.filter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "models.CityModels.objects",
"line_number": 19,
"usage_type": "attribute"
},
{
... |
168300706 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 07 13:39:54 2017
@author: dfberenson
"""
from skimage import io, filters, morphology, measure, util
import scipy.ndimage as nd
import pandas as pd
import numpy as np
import time
import matplotlib.pyplot as plt
start_time = time.clock()
print('\nLoading images...\n')
#O... | null | measureTraces.py | measureTraces.py | py | 4,178 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.clock",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "skimage.io.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "skimage.io",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "skimage.io.imread",
"line... |
404681924 | from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.list_shells, name='list_shells'),
url(r'^create$', views.create_shell, name='create_shell'),
url(r'^(?P<shell_id>\d+)$', views.panel, name='panel'),
url(r'^(?P<shell_id>\d+)/task$', views.task, na... | null | lxc_panel/urls.py | urls.py | py | 335 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "djan... |
231345916 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.selector import HtmlXPathSelector
from scrapy.http.request import Request
from scrapy.spiders import BaseSpider
from scrapy.http import FormRequest
from loginform import fill_login_form
import time
class TwSpider(scrapy.Spider):
name = 'tw'
#allowe... | null | tw.py | tw.py | py | 3,445 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "scrapy.http.FormRequest.from_response",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scrapy.http.FormRequest",
"line_number": 17,
"usage_type": "name"
},
{
"... |
155456262 | """ clock """
import os
from flask import Flask
from mailjet_rest import Client
from apscheduler.schedulers.blocking import BlockingScheduler
from models.utils.db import db
from utils.mailing import MAILJET_API_KEY, MAILJET_API_SECRET
app = Flask(__name__, template_folder='../templates')
app.config['SQLALCHEMY_DATAB... | null | scripts/clock.py | clock.py | py | 870 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.utils.db.db.init_ap... |
622768495 | from cryptography.fernet import Fernet
from math import pi, acos, asin
from enum import Enum
from random import randint
class Element(Enum):
Normal = (0, None, None)
Islamist = (1, 5, 6)
Renoi = (2, 4, None)
Breton = (3, 4, 5)
Babtou = (4, 1, 3)
Pig = (5, 3, 1)
Sheep = (6, None, None)
... | null | TEUB_GAME/General.py | General.py | py | 19,702 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "math.pi",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "math.acos",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "math.asin",
"line_number": 41,
"us... |
237056680 | import os
import sys
from dagster_cron import SystemCronScheduler
from dagster import RepositoryDefinition, ScheduleDefinition, check, lambda_solid, pipeline
from dagster.core.scheduler import RunningSchedule
from dagster.seven import TemporaryDirectory, mock
class TestSystemCronScheduler(SystemCronScheduler):
... | null | python_modules/libraries/dagster-cron/dagster_cron_tests/test_cron_scheduler.py | test_cron_scheduler.py | py | 2,592 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dagster_cron.SystemCronScheduler",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dagster.ScheduleDefinition",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "dagster.lambda_solid",
"line_number": 36,
"usage_type": "name"
},
{
"... |
430213752 | # Copyright 2015 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Cloud endpoints for the Machine Provider API."""
import hashlib
import json
import logging
import endpoints
from google.appengine.ext import ndb
fr... | null | appengine/machine_provider/handlers_endpoints.py | handlers_endpoints.py | py | 7,720 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "protorpc.remote.Service",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "protorpc.remote",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "acl.is_catalog_admin",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "log... |
343664099 | from django.http import HttpResponseRedirect
from django.shortcuts import render
from formare.models.formatter_results import FormatterResults
from django.http import HttpResponse
from django.core.urlresolvers import reverse
import csv
import os
from datetime import datetime
def home(request):
context = {}
ret... | null | formare/views/home.py | home.py | py | 1,472 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "formare.models.formatter_results.FormatterResults",
"line_number": 20,
"usage_type": "cal... |
5473124 | from decimal import Decimal
from django.conf import settings
from django.shortcuts import get_object_or_404
from clubs.models import Club
def bag_contents(request):
bag_items = []
total = 0
club_count = 0
bag = request.session.get('bag', {})
for item_id, quantity in bag.items():
club = g... | null | bag/contexts.py | contexts.py | py | 1,168 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "clubs.models.Club",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "django.conf.settings.DISCOUNT_THRESHOLD",
"line_number": 24,
"usage_type": "attr... |
36732984 | from django.conf.urls import patterns
from generic.views import GenericDeleteJavaScript,\
GenericTabDeleteJavaScript, DeleteObjectAPI
urlpatterns = patterns('scoutfile3.generic.views',
(r'js/(?P<app_label>\w+)/(?P<model>\w+)/delete.js$', GenericDeleteJavaScript.as_view(), {}, "js_delete"),
(r'js/tabs/(?P<ap... | null | generic/urls.py | urls.py | py | 491 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "generic.views.GenericDeleteJavaScript.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "generic.views.GenericDeleteJavaScript",
"line_number": 7,
"usage_ty... |
549444953 | from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, get_object_or_404
from django.conf import settings
from django.http import HttpResponse
from django.template.loader import render_to_string
fro... | null | SuperShop-v02/orders/views.py | views.py | py | 3,148 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cart.cart",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "cart.cart.Cart",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "forms.OrderCreateForm",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cart.cart.coupon",
... |
443944650 | from TDhelper.Scheduler.base import *
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class InterfaceScheduler(Scheduler):
@abc.abstractmethod
def __init__(self,name,plug,taskType="interval",startTime=None,sleep=0):
"""Init
Params:
name:taskName
plug:... | null | Scheduler/interface.py | interface.py | py | 801 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "abc.abstractmethod",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "six.add_metaclass",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "abc.A... |
570927803 | from collections import OrderedDict
from mapping import Mapping
from recommenders.generic_recommender import GenericRecommender, Stats
# keep dictionary per domain of items:views
# if item does not exist, add to the dictionary
#
class SeqRank(GenericRecommender):
def __init__(self, BASEDIR,session_only = Fals... | null | recommenders/sequence_based_recommender.py | sequence_based_recommender.py | py | 4,753 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "recommenders.generic_recommender.GenericRecommender",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "mapping.Mapping",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "recommenders.generic_recommender.Stats",
"line_number": 35,
"usage_ty... |
294439233 | #! /usr/bin/env python3
import numpy as np
import h5py
import note_decompose as nde
import note_recompose as nre
import noise_gate as ngate
import note_utils as note
import sys
import math_fun
def main():
print("decomposing data")
nde_class = nde.decompose('test.wav')
nde_class.octaves = (2, 15)
nde_class.deco... | null | main.py | main.py | py | 1,155 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "note_decompose.decompose",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "noise_gate.noise_gate_sigma",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "h5py.F... |
635454529 | import argparse
import pickle
import gzip
import sys
import logging
import numpy
import sklearn.cluster
import utils
import data
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input", dest="input", help="Input file")
parser.add_argument("-s", "--spec", dest="sp... | null | src/cluster.py | cluster.py | py | 3,437 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "gzip.op... |
110052830 | import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
from collections import Counter
from kgbuild import GraphBuilder
from models import Node
def node_type_stats(G):
orgs = [n for n,d in G.nodes(data=True)
if 'ent_type' in d
and d["ent_type"] == "ORG"]
pe... | null | analysis.py | analysis.py | py | 5,269 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "kgbuild.GraphBuilder",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "networkx.connected_compon... |
70594129 | # colleges/views.py
import logging
from django.views.generic.list import ListView
from django.views.generic.edit import FormView
from .models import College
from .forms import AddCollegeForm
from college_411.libs.log_utils import get_user_ip
logger = logging.getLogger(__name__)
class CollegeListView(ListView):
... | null | college_411/colleges/views.py | views.py | py | 1,587 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.views.generic.list.ListView",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.College",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "m... |
595990180 | """Define a config flow manager for AirVisual."""
from pyairvisual import Client
from pyairvisual.errors import InvalidKeyError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import callback
from home... | null | homeassistant/components/airvisual/config_flow.py | config_flow.py | py | 3,242 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "homeassistant.config_entries.ConfigFlow",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "homeassistant.config_entries",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "const.DOMAIN",
"line_number": 14,
"usage_type": "name"
},
{... |
612810360 | import pygame
from MainGame import *
class Hero:
def __init__(self,image):
self.image = image
# 飞机的宽
self.width = 104
# 飞机的高
self.height = 122
# 飞机初始化的纵坐标
self.x = (MainGame.WIDTH/2) - self.width/2
# 飞机初始化的横坐标
self.y = (MainGa... | null | 飞机大战/Hero.py | Hero.py | py | 620 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "MainGame.WIDTH",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "MainGame.HEIGHT",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pygame.mouse.get_pos",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygame.... |
82004306 | # python version is 3.6.10
# ref: https://buzzorange.com/techorange/2017/08/04/python-scraping/
# ref: https://leemeng.tw/beautifulsoup-cheat-sheet.html
# ref: https://www.cnblogs.com/wj-1314/p/9429816.html
# SARS data: https://www.who.int/csr/sars/country/en/
import re
import csv
import threading
import numpy as np
i... | null | 1_fetch_one_day_total_number.py | 1_fetch_one_day_total_number.py | py | 4,797 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.unique"... |
513325530 | import pandas as pd
import matplotlib.pyplot as plt
data1 = pd.read_csv('8.2d_data.csv', delimiter=' ', names=['x','y'])
data2 = pd.read_csv('8.elliptical.csv', delimiter=' ', names=['x','y'])
from sklearn import cluster
k_means = cluster.KMeans(n_clusters=2, max_iter=50, random_state=1)
k_means.fit(data1)
labels1 =... | null | Week7/datamining_week7_13.py | datamining_week7_13.py | py | 908 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster",... |
232810793 | import re
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import EmailMultiAlternatives, EmailMessage
from django.template.loader import render_to_string
from django.template import TemplateDoesNotExist
from django.utils.six.moves.urllib.parse import u... | null | daiquiri/core/utils.py | utils.py | py | 3,372 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.utils.six.moves.urllib.parse.urlparse",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "django.contrib.sites.shortcuts.get_current_site",
"line_number": 70,
"usage_type": ... |
74917260 | from django.db import models
from datetime import datetime
class Phone(models.Model):
PHONE_MODELS = (('9320', '9320'),
('9720', '9720'),
('9900', '9900'),
('9790', '9790'),
('9360', '9360'),
('9105', '9105'),
)... | null | phones/models.py | models.py | py | 2,631 | 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.EmailField",
"line_number": 12,
"usage_type": "call"
},
{
"api_name":... |
305557359 | """Calculate length of railways by line
"""
# pylint: disable=C0103
import os
from collections import defaultdict
from shapely.geometry import shape
import fiona
# Input data
base_path = os.path.join(os.path.dirname(__file__), '..')
data_path = os.path.join(base_path, 'data')
# PMO_TanRoads
regional_road_filename =... | null | scripts/2_analysis/calculate_rail_length.py | calculate_rail_length.py | py | 1,246 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
466428027 | from .utils import seeded
import numpy as np
@seeded
def shuffle(*args, state=None, **kwargs):
"""
Execute a synchronised shuffle over a set of one or more arrays.
Parameters
----------
args: tuple of arrays
Each array in the tuple must be of the same length. Each array will be returned ... | null | apogee/random/basic.py | basic.py | py | 797 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.arange",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "utils.seeded",
"line_number": 5,
"usage_type": "name"
}
] |
407823016 | # -*- coding: utf-8 -*-
import argparse
import os
import sys
from parallel import scanner_with_thread, scanner_with_process
# 增加参数说明
parser = argparse.ArgumentParser(description='scan port parameter')
parser.add_argument('-n', type=int, default=1)
parser.add_argument('-f', type=str, default='ping')
parser.add_argumen... | null | week03/work1/scan_port.py | scan_port.py | py | 1,940 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "parallel.scanner_with_thread.ScannerWithThread",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "parallel.scanner_with_thread",
"line_number": 47,
"usage_type": "na... |
127768562 | from PyQt5 import QtCore, QtGui, QtWidgets
import sys
import sqlite3
from random import randrange
from Ui import main_win, scripture_games, release_notes
from scripture_finder import ScriptureFinder
conn = sqlite3.connect('MemScript_E.db')
cur = conn.cursor()
find_script = ScriptureFinder()
book_index = ... | null | Bible_Game.py | Bible_Game.py | py | 28,561 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scripture_finder.ScriptureFinder",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 58,
"usage_type": "attribute"
},
{
"... |
563441388 | # -*- coding: utf-8 -*-
"""
author: 苏亚涛
email: yataosu@gmail.com
create_time: 2019/10/25 11:29
file: m2m_insert.py
ide: PyCharm
"""
from coding.learn_sqlalchemy import m2m
from sqlalchemy.orm import sessionmaker
session_class = sessionmaker(bind=m2m.engine)
session = session_class()
b1 = m2m... | null | coding/learn_sqlalchemy/m2m_insert.py | m2m_insert.py | py | 671 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "coding.learn_sqlalchemy.m2m.engine",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "coding.learn_sqlalchemy.m2m",
"line_number": 12,
"usage_type": "name"... |
54020834 | import requests
import json
import tweepy
import time
import copy
from bs4 import BeautifulSoup
import numpy as np
from geopy.distance import distance
from db.user import User
from db.tweet_user import tweetUser
from db.tweets import Tweet
# Auth functions
def get_access(x):
f = open(x, 'r')
CK = []
CS =... | null | methods.py | methods.py | py | 9,083 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "tweepy.error",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "tweepy.error",
"... |
594575904 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('edsict_app', '0002_location'),
]
operations = [
migrations.CreateModel(
name='LocationType',
fields=... | null | migrations/0003_auto_20160920_1327.py | 0003_auto_20160920_1327.py | py | 1,375 | 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"
},
... |
369455917 | import random
import time
import logging
import threading
import datetime as dt
from trading.data import DataHandler
from ib.connection import IBConnection
logging.basicConfig(level=logging.INFO, format='%(asctime)s: %(message)s')
log = logging.getLogger('IBDataHandler')
class IBWebDataHandler(IBConnection):
def... | null | web/ib_web_data_handler.py | ib_web_data_handler.py | py | 7,609 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "ib.connection.IB... |
413825429 |
from django import template
register = template.Library()
try:
register.simple_tag(takes_context=True)
except TypeError:
from django.template import Node, Variable, generic_tag_compiler, TemplateSyntaxError
from django.utils.functional import curry
from inspect import getargspec
def simple_tag(s... | null | iadmin/templatetags/future.py | future.py | py | 1,870 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.template.Library",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "inspect.getargspec",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.templ... |
260827334 | import socket
import numpy as np
#from events import event, threadInfo
import events
import classifier as clsfy
DEBUGGING = True
NUM_COMPONENTS = 13
OK = "ok"
KO = "ko"
INIT_VALUE = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
summary = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
burst = 0
num_packets = int(1 / 0.025)
class Cli... | null | Core/dedicatedServer.py | dedicatedServer.py | py | 3,263 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "socket.sendall",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "socket.recv",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number... |
169713651 | import os
import imageio
import imagehash
from PIL import Image
from .ailab_multiprocessing import pool_worker
def __get_average_hash(path):
im = Image.open(path)
return imagehash.average_hash(im)
def __extract_distinct_hash_indexes(hashes, min_distant=2):
distinct_indexs = [0]
for i in range(1, len... | null | build/lib/ailabtools/extract_distinct_image.py | extract_distinct_image.py | py | 2,454 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "imagehash.average_hash",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "imageio.get_reader",
... |
193916253 | import numpy as np
from skimage import color
import matplotlib.pyplot as plt
import json
import seaborn
from getMeanColor import getMeanAB2
def modifiedDeltaE(l1, l2):
return color.deltaE_ciede2000(l1, l2, 1E30, 1, 1)
def getABFromL(Ltarget, ain, bin):
Lmin = -100.0
Lmax = 200.0
Lmid = 50.0
Lout, ... | null | PosterAnalysis/Deprecated/oldMainFiles/xkcd.py | xkcd.py | py | 6,849 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "skimage.color.deltaE_ciede2000",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "skimage.color",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "skimage.color.rgb2lab",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "skim... |
23217866 | import json
import pymysql.cursors
import deepdiff as dd
import re
"""
--------------------------------------------------------------------------------
M A N I F E S T
SIMPLE DATA HISTORY AND DELTAS
--------------------------------------------------------------------------------
Concept... | null | manifest/core.py | core.py | py | 7,072 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors.connect",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors",
"line_number": 72,
"usage_type": "name"
},
{
"api_name": "re.search",
"li... |
226736187 | from __future__ import print_function # Forward compatibility for Python 2.6/2.7
from HRConsts import INITIAL_TO_PIECE, N_TYPE
from HRBoard import HRBoard
from HRNode import HRNode
from HRSolution import HRSolution
from HRException import InvalidMove
from collections import deque
import time
class HRGame:
def __i... | null | HRGame.py | HRGame.py | py | 3,994 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "HRBoard.HRBoard",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "HRSolution.HRSolution",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "HRNode.HRNode... |
259889230 | """
Set of classes to handle wavefronts, analysis, fitting and interferoneters.
"""
from poptics.vector import Vector2d, Vector3d, Unit3d, Angle
import math
from poptics.surface import OpticalPlane
from poptics.psf import Psf
from poptics.wavelength import getDefaultWavelength, getDesignWavelength
from poptics.zernike ... | null | poptics/wavefront.py | wavefront.py | py | 43,745 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.pi",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "numpy.arccos",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "poptics.vector.Vector2d",
"l... |
193075720 | import numpy as np
import cv2
from PIL import ImageEnhance
import argparse
ap = argparse.ArgumentParser(description="")
ap.add_argument("-i", "--input", type=str, default="0", help="path to input video file")
args = vars(ap.parse_args())
if args["input"] != "0":
cap = cv2.VideoCapture(args["input"])... | null | video_enhancement.py | video_enhancement.py | py | 2,039 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor... |
94716227 | # Copyright (c) 2019, Facebook, Inc. and its affiliates. All Rights Reserved
"""
Run SpanBERT on general test examples
Scripts adopted from https://github.com/facebookresearch/SpanBERT and edited by Giannis Karamanolakis
"""
import os
import random
import time
import json
import numpy as np
import torch
from torch.ut... | null | Project 2/proj2/spanbert.py | spanbert.py | py | 9,661 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.no_grad",
"line_number": 137,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number": 142,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 145,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_numb... |
121395359 |
import theano as T
from theano.tensor.signal.conv import conv2d
from theano.tensor.signal.pool import pool_2d
from theano.tensor.signal.pool import max_pool_2d_same_size
from PIL import Image
import numpy as np
import time
import sys
start = time.time()
for i in range(1):
img = Image.open("images/Dogs/do... | null | Conv.py | Conv.py | py | 7,094 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.asarray",
"line_number":... |
200322255 | '''
Created on Jul 12, 2016
@author: Phil
'''
import os
import re
import utils
from Dos4 import Dos4
import diskutils
class GitRepo():
'''
classdocs
'''
def __init__(self, wt='.', gd='.'):
'''
Constructor
'''
self.wt = wt
self.gd = gd
def gitcmd(self, ar... | null | py-test/GitRepo.py | GitRepo.py | py | 6,502 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Dos4.Dos4",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "utils.log",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "diskutils.fileExists",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.unlink",
"line_number... |
114170520 | from VVR_Bank import VVR_Bank as Bank
import numpy as np
import torch
import pandas as pd
class VVR_Simulator():
def __init__(self, num_color=6, num_model=3, capacity=30, num_lanes=6, lane_length=7, cc_file=None, color_dist_file=None, vari=False):
self.num_color = num_color
self.num_model = num_mo... | null | VVR_SimulatorV2.py | VVR_SimulatorV2.py | py | 13,092 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "numpy.sum",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"lin... |
484284184 | from django.contrib import admin
from .models import Pko
class RkoAdmin(admin.ModelAdmin):
list_display = ('autor', 'created_date', 'month', 'year', 'summ_e',
'summ_w', 'summ_fond')
list_filter = ['month', 'year']
date_hierarchy = 'created_date'
admin.site.register(Pko, RkoAdmin)
| null | pko/admin.py | admin.py | py | 317 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 12,
"usage_type": "call"
},... |
356744257 | # -*- coding: utf-8 -*-
from flask import Flask, url_for
from flask import jsonify
from flask import request
import itchat
from itchat.content import *
import os
import upyun
from threading import Thread # 多线程
import json
import time
from config.wechat_config import WechatConfig
app = Flask(__name__)
thread = Thread... | null | wechat-bot/bot-api.py | bot-api.py | py | 3,495 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "config.wechat_config.WechatConfig",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.pat... |
490837981 | from django import forms
from motores.models import Motor, Manutencao
class BaseForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for key in self.fields:
self.fields[key].widget.attrs.update(
{
'class': 'm... | null | motores/forms.py | forms.py | py | 570 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "motores.models.Motor",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "motores.m... |
519592070 | import numpy as np
from sympy.abc import x, y, z
from geometer import Point, Line, Conic, Circle, Quadric, Plane
from geometer.curve import AlgebraicCurve
class TestAlgebraicCurve:
def test_polynomial(self):
coeff = np.array([[[0, 1], [1, 0]], [[1, 0], [0, 0]]])
curve = AlgebraicCurve(coeff, symb... | null | tests/test_curve.py | test_curve.py | py | 2,463 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "geometer.curve.AlgebraicCurve",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sympy.abc.x",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "sympy.abc.y",
... |
480196014 | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://root:password@localhost/animedb'
db = SQLAlchemy(app)
"""
Create table of Many to Many relationship between genre and anime shows.
"""
association_table = db.Table('genre_ani... | null | models.py | models.py | py | 17,871 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.ext.sqlalchemy.SQLAlchemy",
"line_number": 6,
"usage_type": "call"
}
] |
212224930 | import ssl
import asyncio
import websockets
ssl_context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
ssl_context.load_verify_locations('super-site.com.cert')
async def hello(uri):
async with websockets.connect(uri, ssl=ssl_contex... | null | websocket_client.py | websocket_client.py | py | 563 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ssl.create_default_context",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "ssl.Purpose",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "ssl.CERT_NONE",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "websocket... |
583033523 | from data import get_commodity_data
def recommend_price(asin):
price_list=[]
result=[]
r=0.0
data=get_commodity_data(asin)
for offer in data['offer']:
for info in offer['info']:
try:
price_list.append(info['price'])
... | null | end/cgi-bin/recommendprice.py | recommendprice.py | py | 846 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "data.get_commodity_data",
"line_number": 7,
"usage_type": "call"
}
] |
162939008 | import logging
from typing import Union
from molanet.base import NetworkFactory
from molanet.operations import *
_log = logging.getLogger(__name__)
class BigDiscPix2Pix(NetworkFactory):
"""
Network factory which creates enhanced discriminators and base architecture generators.
"""
def __init__(
... | null | molanet/models/big_discriminator.py | big_discriminator.py | py | 9,537 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "molanet.base.NetworkFactory",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 113,
"usage_type": "name"
}
] |
167696960 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import json
import os
import click
from ....utils import read_file
from ...annotations import annotate_display_queue, annotate_error
from ...testing import process_checks_option
from ...utils import comp... | null | datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/dashboards.py | dashboards.py | py | 4,288 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "testing.process_checks_option",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "console.echo_info",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "utils.get_assets_from_manifest",
"line_number": 51,
"usage_type": "call"
},
{
"ap... |
562268828 | import itertools as it
input = "1113222113"
# next input should be 3113322113
def conway_sequence(input):
output = []
for k, g in it.groupby(input):
output.append(str(len(list(g))))
output.append(str(k))
return "".join(output)
def run_conway(input, i):
if i == 0:
return input... | null | 2015/day10/part2.py | part2.py | py | 436 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.groupby",
"line_number": 8,
"usage_type": "call"
}
] |
176374351 | import os
import sys
import time
from datetime import timedelta
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from sklearn import metrics
from torch.autograd import Variable
from torch.utils.data import DataLoader
from backup.data_loader import Dicti... | null | backup/run_rnn.py | run_rnn.py | py | 6,134 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
643830788 | import boto3
_CLIENTS = {}
def get_regions_for_service(service, regions=()):
"""Given a service name, return a list of region names where this service can have resources,
restricted by a possible set of regions."""
# if service == "s3":
# return ['us-east-1'] # s3 ListBuckets is a global request,... | null | aws_list_all/client.py | client.py | py | 1,007 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "boto3.Session",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "boto3.Session",
"line_number": 24,
"usage_type": "call"
}
] |
227314145 | # Import our library of test stuff
import pytest
# Expose all the fixtures
# https://stackoverflow.com/questions/36452363/how-to-use-py-test-fixtures-without-importing-them
from testlib import *
#@pytest.fixture(scope="session", params)
#@pytest.fixture()
#def gem():
# return None
# Tests marked incremental shoul... | null | pytest-playground/conftest.py | conftest.py | py | 625 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.xfail",
"line_number": 19,
"usage_type": "call"
}
] |
82591712 | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from mailing.views import SubscribeView, UnSubscribeView, SubscribeSuccessView, UnSubscribeSuccessView, APISympaListView, APIFullListView
from django.conf.urls.static import static
admin.autodiscover(... | null | sympasympa/sympasympa/urls.py | urls.py | py | 1,452 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 10,
"usage_type": "call"
},
{
"ap... |
249453458 | #!/usr/bin/env python3
"""
Author : donaldscoon
Date : 2019-04-11
Purpose: A program for the peasentry.
"""
import argparse
import sys
import os
import re
import logging
from tabulate import tabulate
# --------------------------------------------------
def get_args():
"""get command-line argumen... | null | assignments/finals/undergrad/upgoer/upgoer.py | upgoer.py | py | 2,226 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 69,
"usage_type": "attribute"
},
{
... |
349461011 | """
Module to run tests on ProcessImages class
Requires files in Development suite and an Environmental variable
"""
import os
import pathlib
from IPython import embed
from pypeit.images import buildimage
from pypeit.spectrographs.util import load_spectrograph
def test_combine_deimos_flats():
deimos_flat_files ... | null | unit_tests/test_buildimage.py | test_buildimage.py | py | 1,722 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pypeit.spectrographs.util.load_sp... |
169843019 | import sqlite3
"""
ariel gal
the object that as access to our data base
"""
class SongsDatabase:
def __init__(self, path):
"""
builder
"""
self.path = path
def add_song(self, song_name):
conn = sqlite3.connect(self.path) # connect us to the database
... | null | justlisten/songsDatabase.py | songsDatabase.py | py | 1,571 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 37,
"usage_type": "call"
}
] |
369285231 | from transcriptor import get_model, oauth2
from flask import Blueprint, current_app, redirect, render_template, request, \
session, jsonify
from .translate import translate_text
from .model_datastore import list_by_user, create
crud = Blueprint('crud', __name__)
# [START list_mine]
@crud.route("/mine")
@oauth2.r... | null | H3/app/transcriptor/crud.py | crud.py | py | 1,102 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "model_datastore.list_by_user",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "transcriptor.oauth2.email",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_na... |
551053641 | from enum import Enum
from nio.signal.base import Signal
from nio.block.base import Block
from nio.properties import VersionProperty, SelectProperty, ListProperty
from nio.types import StringType
class Behavior(Enum):
BLACKLIST = False
WHITELIST = True
class AttributeSelector(Block):
"""
A block fo... | null | blocks/attribute_selector/attribute_selector_block.py | attribute_selector_block.py | py | 2,305 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.Enum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "nio.block.base.Block",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "nio.properties.VersionProperty",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "nio.prop... |
417254723 | import os
import math
import torch
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.sampler import WeightedRandomSampler
from torchvision import transforms
import torchvision
from torch.optim import Adam, SGD, AdamW
from torch.nn import CrossEntropyLoss
import pickle
from data_utils import FrameP... | null | baselines/cnn_driver.py | cnn_driver.py | py | 14,817 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.optim.AdamW",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "torch.utils.tensorboard.SummaryWriter",
"line_number": 40,
"usage_type": "call"
},
{
... |
58240925 | # uncompyle6 version 3.6.7
# Python bytecode 3.6 (3379)
# 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: /home/erwincoumans/dev/tmp/bullet3/examples/pybullet/gym/pybullet_envs/bullet/kuka.py
# Compiled at: 2020-04-29 23:02:34
# Size of source... | null | pycfiles/pybullet_planning-0.1.1.tar/kuka.cpython-36.py | kuka.cpython-36.py | py | 7,523 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "inspect.getfile",
"line... |
357645747 | import io, base64
from base64 import b64encode
class Images():
def __init__(self, image, description, title, id):
self.image = image
self.description = description
self.title = title
self.id = id
self.images
#this is used to prepare image file to store into database
... | null | image.py | image.py | py | 1,554 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "io.BytesIO",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 44,
"usage_type": "call"
}
] |
493365090 | import datetime
import numpy as np
# ----------------------------------------------------------------------
# Section that user can edit to tailor simulation
# ----------------------------------------------------------------------
batch_mp_workers = 2
verbose = True
batch_size = 50 # can also be set to 'all'
dithers ... | null | hpc_parallel/sim_inputs/desgw_kne/kraken2044_inputs.py | kraken2044_inputs.py | py | 2,465 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.deg2rad",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.deg2rad",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",... |
197688730 | import random
import pygame
BOARD_SIZE = 400
RED = (255, 0, 0)
GREEN = (0, 255, 0)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
class Fruit:
def __init__(self):
self.x = random.randrange(0, BOARD_SIZE, 10)
self.y = random.randrange(0, BOARD_SIZE, 10)
print(self.x, self.y)
self.w = 1... | null | utlis.py | utlis.py | py | 2,370 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.randrange",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "random.randrange",... |
346839628 | import os, sys
import yaml
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from firebaserunner.runner import *
config = yaml.load(open('./config.yml'))['firebase']
def test_set_app_apk_path():
runner = Runner(config['service-key'], 'project', True)
runner.set_app_apk_path('test')
... | null | tests/test_runner.py | test_runner.py | py | 1,292 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
640023025 | import numpy as np
import cv2
from skimage import measure
from docrec.ndarray import utils
def extract_text(image, min_height, max_height, max_separation, max_extent, pbline=0.66):
''' Extract text regions from image.
text = [(box, patch_binary, patch_rgb), ...]
'''
# Thresholded image
_, thres... | null | docrec/ocr__/text/extraction.py | extraction.py | py | 2,632 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.threshold",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2GRAY",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "cv2.THRESH_BINARY_... |
278232749 | # Made by Dan Barkhorn
import copy
import dataset
import numpy as np
class DTree:
'Represents a decision tree created with the ID3 algorithm'
def __init__(self, classifier, training_data, attributes):
self.classifier = classifier
self.temp_data = training_data
self.attributes = attributes
self.m... | null | hw3/id3-random-forests.py | id3-random-forests.py | py | 4,416 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.randint",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "dataset.DataSet",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "copy.copy",
... |
292511365 | import cv2
#using the cascade for face recognition
cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
def find_and_blur(bw, color):
#detect all faces in video capture
faces = cascade.detectMultiScale(bw, 1.1, 4)
#for each face, we apply gaussian blur
for (x, y, w, h) in fa... | null | scratch_4.py | scratch_4.py | py | 1,335 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.GaussianBlur",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",... |
315575464 | import numpy as np
import cv2
import dlib
from math import hypot
import socket
import datetime
import time
cap = cv2.VideoCapture(0)
blink_flag = 0
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor("supportingFiles/shape_predictor_68_face_landmarks.dat")
serversocket = socket.socket(socket... | null | Software/On_Screen/smile.py | smile.py | py | 4,354 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "dlib.get_frontal_face_detector",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dlib.shape_predictor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "s... |
589287622 | import sys
import json
from model import *
filename = sys.argv[1]
movies = []
for movie in Movie.select():
id_ = movie.id_
url = 'https://movie.douban.com/subject/%d/' % id_
name = movie.name
type_ = movie.type_
comment_pages = movie.comment_pages
review_pages = movie.review_pages
movie_js... | null | export_movie.py | export_movie.py | py | 1,599 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": 52,
"usage_type": "call"
}
] |
195913545 | import sys
from PIL import Image, ImageDraw
if __name__ == "__main__":
# 枠線の太さ(二本分)
waku_w2 = 32
# 枠にはめ込む写真
photo = Image.open('./design.png')
draw = ImageDraw.Draw(photo)
draw.line((350, 200, 450, 100), fill=(255, 255, 0), width=10)
photo.show() | null | codes/Xmas2019/signboard_t1/main.py | main.py | py | 309 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PIL.ImageDraw.Draw",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.ImageDraw",
"line... |
37910464 | import time
import random
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
class StarGenerator(object):
def __init__(self, filename, figsize = (2048, 2048)):
'''Initialization.'''
self.filename = filename
self.figsize = figsize
self.stars = sel... | null | temp/gen_nos.py | gen_nos.py | py | 10,652 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 21... |
375694444 | import sqlite3
class ContManSql:
def __init__(self, name='students.db'):
self._name = name
def __enter__(self):
self.conn = sqlite3.connect(self._name)
return self.conn.cursor()
def __exit__(self, exc_type, exc_val, exc_tb):
self.conn.commit()
self.conn.close()
... | null | 07/task02.py | task02.py | py | 5,110 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 11,
"usage_type": "call"
}
] |
410391809 | from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import LSTM
from keras.utils import np_utils
from tensorflow.python.lib.io import file_io
import numpy as np
import pandas as pd
import argparse
from datetime import datetime
import time
# text=(open(... | null | trainer/deadSpeare.py | deadSpeare.py | py | 3,331 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "tensorflow.python.lib.io.file_io.FileIO",
"line_number": 22,
"usage_type": "call"
},
{
"a... |
349673679 | from collections import deque
for i in range(3):
A = deque()
M = list(map(int, input().strip().split()))
if(M[5] - M[2] < 0):
A.append(M[5]-M[2]+60)
M[4] -= 1
else:
A.append(M[5]-M[2])
if(M[4] - M[1] < 0):
A.appendleft(M[4]-M[1]+60)
M[3] -= 1
else:
... | null | 2020-2022/5575.py | 5575.py | py | 398 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 4,
"usage_type": "call"
}
] |
161535362 | import torch
import torch.nn.utils.rnn as rnn
from DataLoader import DataLoader
import numpy as np
from sklearn.dummy import DummyClassifier
from sklearn.metrics import classification_report, mean_squared_error
from sklearn.model_selection import cross_val_predict
data_loader = DataLoader(device='cpu',
... | null | src/majority_baseline.py | majority_baseline.py | py | 1,904 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "DataLoader.DataLoader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn.utils.rnn.pad_sequence",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "to... |
631515867 | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 25 15:10:52 2017
@author: sony
"""
from __future__ import print_function
import keras.backend as K
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten, BatchNormalization, SpatialDropout2D
from keras.layers import advanced_act... | null | deep_mil_code.py | deep_mil_code.py | py | 16,097 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.backend.sigmoid",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "keras.utils.generic_utils.get_custom_objects",
"line_number": 28,
"usage_type": "call"
},
{
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.