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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
29707449656 | #!/usr/bin/env python
import pybullet as p
import random
import numpy as np
from mamad_util import JointInfo
def check_collision(active_joints_info,num_active_joints):
collision_set=[]
index_of_active_joints = [active_joints_info[i]["jointIndex"] for i in range(num_active_joints)]
for i in index_of_active_joints:
... | ccylance/theis-code | gym_test/gym_test/envs/shadow_hand_vijay/gym_test.py | gym_test.py | py | 4,379 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pybullet.getClosestPoints",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.argsort",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.argsort",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pybullet.connec... |
6814540794 | from django.urls import path
from . import views
################################################################################
# Registering the app namespace...
# this will allow you to create dynamic Django hyperlinks in html files
# when using the django tag: {% url atomic:tracker ... %} for example.
app_name = ... | chinchay/habit-tracker | backend/atomic/urls.py | urls.py | py | 669 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
16293536002 | import os
from time import sleep
import boto3
from botocore.exceptions import ClientError
IAM_R = boto3.resource('iam')
IAM_C = boto3.client('iam')
LAMBDA_C = boto3.client('lambda')
EVENTS_C = boto3.client('events')
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
def setup_iam_role():
"""
Setup the A... | zulily/aws_monitor | deployscripts/setup_lambda.py | setup_lambda.py | py | 4,849 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "boto3.resource",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number... |
19886880930 | from guardata.client.client_events import ClientEvent
import pytest
from unittest.mock import ANY
from pendulum import datetime
from guardata.api.data import UserManifest, WorkspaceEntry
from guardata.client.types import WorkspaceRole, LocalUserManifest, EntryID
from guardata.client.fs import (
FSError,
FSWork... | bitlogik/guardata | tests/client/fs/userfs/test_sharing.py | test_sharing.py | py | 21,167 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "guardata.client.types.EntryID",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "guardata.client.fs.FSWorkspaceNotFoundError",
"line_number": 22,
"usage_type": "argument"
}... |
33963223285 | from http import HTTPStatus
from django.test import TestCase, Client
class AboutTests(TestCase):
def setUp(self):
self.guest_client = Client()
def test_about_urls_uses_correct_templates(self):
templates_url_names_quest = {
'/about/author/': 'about/author.html',
'/abou... | Mashabor/hw05_final | yatube/about/tests.py | tests.py | py | 660 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.test.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "http.HTTPStatus.OK",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "http.HT... |
20594474782 | import torch
import torch.nn.functional as F
def global_align_loss(
visual_embed,
textual_embed,
labels,
mixture=False,
alpha=0.6,
beta=0.4,
scale_pos=10,
scale_neg=40,
):
batch_size = labels.size(0)
visual_norm = F.normalize(visual_embed, p=2, d... | CCNU-DigitalLibrary/CCNU-DigitalLibrary | MCM-HC/lib/models/losses/align_loss.py | align_loss.py | py | 6,662 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.functional.normalize",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.normalize",
"line_number": 17,
"usage_type": "call"
},
{
"a... |
25495485263 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 27 17:39:39 2020
@author: satya
"""
import pandas as pd
import scipy.cluster.hierarchy as sch
from sklearn.cluster import DBSCAN
data=pd.read_csv('cars_clus.csv')
featureset = data[['engine_s', 'horsepow', 'wheelbas', 'width', 'length', 'curb_wgt', 'fuel_... | Satyake/Deep-Learning | DBSCAN and HC.py | DBSCAN and HC.py | py | 928 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.cluster.hierarchy.dendrogram",
"line_number": 23,
"usage_type": "call"
},
... |
17351623183 | import vertexai
from vertexai.language_models import ChatModel, InputOutputTextPair
vertexai.init(project="samwin", location="us-central1")
chat_model = ChatModel.from_pretrained("chat-bison@001")
parameters = {
"max_output_tokens": 256,
"temperature": 0.2,
"top_p": 0.8,
"top_k": 40
}
chat = chat_model... | samwinp/rock-paper-sisor | future.py | future.py | py | 1,288 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "vertexai.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "vertexai.language_models.ChatModel.from_pretrained",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "vertexai.language_models.ChatModel",
"line_number": 5,
"usage_type": "name... |
2736213027 | from keras.optimizers import Nadam, Optimizer
from keras import backend as K
class Nadam_entropy(Nadam):
def __init__(self, temperature=0.1, **kwargs):
self.temperature = temperature
super(Nadam_entropy, self).__init__(**kwargs)
def get_gradients(self, loss, params):
grads = K.gradients(loss, params)... | twoev/APEMEN | utils/optimisers.py | optimisers.py | py | 1,081 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "keras.optimizers.Nadam",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "keras.backend.gradients",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "keras.bac... |
75319095866 | import random
from pypinyin import lazy_pinyin
from nonebot import require, on_command, on_message, on_keyword, on_shell_command, on_request
from nonebot.rule import command
from nonebot.permission import SUPERUSER
from nonebot.typing import T_State,T_Handler
from nonebot.adapters.cqhttp.bot import Bot
from nonebot.ad... | Joenothing-lst/qbot | src/plugins/admin/__init__.py | __init__.py | py | 9,965 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "nonebot.on_command",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "nonebot.permission.SUPERUSER",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "src.utils.util.gen_parser",
"line_number": 29,
"usage_type": "call"
},
{
"api_nam... |
37708709276 | from django.urls import path
from . import views
app_name = "shop"
urlpatterns = [
path("", views.all_products, name="all_products"),
path("<slug:c_slug>/", views.all_products, name="category_products"),
path("product/new/", views.add_product, name="add_product"),
path("product/remove/<slug:p_slug>", ... | aleksandr-hilko/alex_online_shop | homeshop/shop/urls.py | urls.py | py | 532 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
40483436324 | import tkinter
import os
from PIL import Image, ImageTk
class OngletsPersonnage():
def __init__(self, main_onglets):
self.onglets_personnage = tkinter.ttk.Frame(main_onglets)
self.onglets_personnage.pack()
main_onglets.add(self.onglets_personnage, text='character')
self.cre... | Azzary/LeafMITM | interface/onglets/onglets_personnage.py | onglets_personnage.py | py | 4,255 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "tkinter.ttk.Frame",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Canvas",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tkinter.Canvas",
... |
6960045652 | import numpy as np
import matplotlib.pyplot as plt
x = np.arange(10, 90, 10.)
y = np.array([25, 70, 380, 550, 610, 1220, 830, 1450])
plt.figure(1)
plt.plot(x, y, 'ro-')
plt.grid()
xsum=np.sum(x)
ysum=np.sum(y)
xysum=sum(x*y)
n=np.size(x)
xavg=xsum/n
yavg=ysum/n
a1=(n*xysum-xsum*ysum)/(n*sum(x**2)-xsum**2)
a0= yavg... | SCKIMOSU/Numerical-Analysis | polyfit_implement.py | polyfit_implement.py | py | 566 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
38456424440 | import re
import os
import torch
import base64
import uvicorn
import numpy as np
from io import BytesIO
from PIL import Image
from typing import Union
from fastapi import FastAPI, File, Form
from pydantic import BaseModel
from maskrcnn_benchmark.config import cfg
from maskrcnn_benchmark.engine.predictor_glip import G... | bensonbs/GLIP | main.py | main.py | py | 2,914 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "re.sub",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number"... |
2107589551 | import pygame
import sys
from space_objects import *
from tools import *
pygame.init()
infoObject = pygame.display.Info()
W_SIZE = WIDTH, HEIGHT = (infoObject.current_w, infoObject.current_h)
H_SIZE = H_WIDTH, H_HEIGHT = WIDTH // 2, HEIGHT // 2
screen = pygame.display.set_mode(W_SIZE, pygame.FULLSCREEN)
clock = py... | Programmer-Anchous/Solar-system-model | main.py | main.py | py | 8,409 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display.Info",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set... |
7973610749 | import logging
from dataclasses import asdict
from typing import List
from game_service.routers.templates import BasicResponse
from game_service.services.game_manager import CodingConundrumManager
logging.basicConfig(format='%(name)s-%(levelname)s|%(lineno)d: %(message)s', level=logging.INFO)
log = logging.getLogger... | zhuweiji/CPP-FYP-Proj | game_service/game_service/routers/game_handlers.py | game_handlers.py | py | 1,858 | python | en | code | 0 | github-code | 6 | [
{
"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": "fastapi.APIRoute... |
74916425146 | import util
import cv2
import torch
import os
def compareTensors(refs, target, targetName):
sum_ = 0
if len(refs) == 0:
print("no reference images")
return
for i in range(len(refs)):
ref = refs[i]
dotself = torch.tensordot(ref , ref, dims=2)
sum_ =... | EunbinSeo/Pytorch-vgg-memoji | compare.py | compare.py | py | 1,363 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.tensordot",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.tensordot",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "util.process",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_n... |
5203502596 | # -*- coding: utf-8 -*-
"""
Spyderエディタ
これは一時的なスクリプトファイルです
"""
#WEBクローリング
import time
import re
import requests
import lxml.html
from pymongo import MongoClient
def main():
client = MongoClient('localhost', 27017)
#scrapingデータベースのebooksコレクションを作成
collection = client.scraping.eb... | inamasa12/cr-sc | python_crowler_4.py | python_crowler_4.py | py | 2,855 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_... |
73706334586 | from django.shortcuts import render
from django.http import HttpResponse
from app1.models import Topic, Webpage, AccessRecord
from app1.forms import App1Form
# Create your views here.
def home(request):
#return HttpResponse("Hello Hao!")
my_dict = {'insert_me':"Goodbye now from view.py!!"}
return render(request,... | haozer/project1 | app1/views.py | views.py | py | 1,277 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app1.models.AccessRecord.objects.order_by",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app1.models.AccessRecord.objects",
"line_number": 13,
"usage_type": "at... |
7782101624 | import cv2
import random
import numpy as np
frameWidth = 640
frameHeight = 480
cap = cv2.VideoCapture(0)
cap.set(3, frameWidth)
cap.set(4, frameHeight)
save = False
colors = [[51, 153, 255],
[255, 0, 255],
[0, 255, 0],
[255, 0, 0],
[0, 0, 255]]
color = random.choice(colors)
poin... | tarekbrahmi/Open-cv-project | learining/projects and apps/other/webcam-drawing.py | webcam-drawing.py | py | 1,934 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.EVENT_LBUTTONDOWN",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "cv2.EVENT_LB... |
42090679043 | from events import OnEvents
from environment import Environment
from util import Util
class Component(OnEvents):
""" Base Class for individual processes.
"""
def __init__(self):
super(Component, self).__init__()
self.exec_times = []
self.Util = Util()
def run(self, **kwargs):
... | tom-kerr/bookmaker | components/component.py | component.py | py | 2,107 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "events.OnEvents",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "util.Util",
"line_number": 11,
"usage_type": "call"
}
] |
10663274434 | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 16 11:25:30 2020
@author: Rijk
Extracts the resistance from the IV curves measured
"""
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 22 17:10:35 2019
@author: LocalAdmin
Curve fitting script
"""
import os
import math as m
import numpy as np
import matplotlib.pyplot... | rehogenbirk/MEP_control_software | fit_IVcurve_single.py | fit_IVcurve_single.py | py | 3,578 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": ... |
18091330209 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('account', '0060_auto_20150130_1750'),
]
operations = [
migrations.AlterField(
model_name='basicmemberinformation... | hongdangodori/slehome | slehome/account/migrations/0061_auto_20150201_1909.py | 0061_auto_20150201_1909.py | py | 531 | python | en | code | 0 | github-code | 6 | [
{
"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.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
39209939169 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import math
from scipy.interpolate import griddata
import copy
# import tecplot as tp
# with open('Rectangle_EXP.dat') as Rectangle_EXP:
# all_data =
# D rectangle = 100
def load_data(fname):
# To load tecplot dat to datafram... | hmharley/FlowData_processing_py | source/Plot.py | Plot.py | py | 7,313 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "copy.copy",
"line_... |
15864287326 | import pandas as pd
import matplotlib.pyplot as plt
# Set up the output screen
plt.style.use(style='ggplot')
plt.rcParams['figure.figsize'] = [20, 12]
# Read dataset
trainData = pd.read_csv('./train.csv')
# With outliers
plt.scatter(trainData.GarageArea, trainData.SalePrice, color='red')
plt.xlabel('Garage Area')
pl... | nikolozdz/Linear-Regression-Models-ICP5 | Task 1.py | Task 1.py | py | 690 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name"... |
72532378429 | from collections.abc import Sequence
from datetime import datetime, timedelta
from typing import Final
import arrow
import pytest
from pydantic import NonNegativeFloat
from simcore_service_dynamic_sidecar.modules.prometheus_metrics import (
_MAX_DEFAULT_METRICS_SCRAPE_INTERVAL,
_MAX_PROMETHEUS_SAMPLES,
_ge... | ITISFoundation/osparc-simcore | services/dynamic-sidecar/tests/unit/test_modules_prometheus_metrics.py | test_modules_prometheus_metrics.py | py | 1,426 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "typing.Final",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "arrow.utcnow",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "collections.abc.Sequence"... |
14255729146 | from _MOM import MOM
from _TFL import TFL
import _TFL._Meta.Object
import _TFL._Meta.Once_Property
from _TFL.predicate import first, paired
from _TFL.Decorator import getattr_safe
from _TFL.I18N import _, _T, _Tn
import itertools
import logging
class Entity (TFL.Meta.Object) :
... | xiaochang91/tapyr | _MOM/E_Type_Manager.py | E_Type_Manager.py | py | 20,532 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "_TFL.TFL.Meta",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "_TFL.TFL",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "_TFL.TFL.Meta",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "_TFL.TFL",
"line_n... |
19581520317 | import os
import time
from collections import defaultdict
from os.path import join as osjoin
import csv
from pyspark.sql import SparkSession
import pyspark.sql.types as T
from util.file_manager import file_manager
from util.cosine_similarity import calculate_cosine_similarity
from core.directory import (
src_embe... | oldguard69/lvtn | server/core/4_make_data_for_training_classifier.py | 4_make_data_for_training_classifier.py | py | 4,560 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 18,
"usage_type"... |
35260443444 | import logging
from typing import List, Optional
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from debunkbot.models import (
Claim,
GoogleSheetCredentials,
MessageTemplate,
MessageTemplateSource,
)
logger = logging.getLogger(__name__)
class GoogleSheetHelper(obj... | CodeForAfrica/DebunkBot | debunkbot/utils/gsheet/helper.py | helper.py | py | 3,569 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "debunkbot.models.GoogleSheetCredentials.objects.first",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "debunkbot.models.GoogleSheetCredentials.objects",
"line_number": 29,
... |
74959952508 | from django.db import models
from django.core.validators import RegexValidator
from django.contrib.auth.models import AbstractUser
from django.db import models
from libgravatar import Gravatar
# Create your models here.
class User(AbstractUser):
"""User model used for authentication."""
class Experience(mode... | amir-rahim/ChessClubManagementSystem | clubs/models/users.py | users.py | py | 1,456 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.models.TextChoices",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 12,
"usage_type": "name"
},
... |
10260578739 | import json
import heapq
import math
#get texts
with open('10k_tokenized_texts.json', 'r') as file:
tokenized_texts = json.load(file)
#count word frequency and create vocabulary
wordfreq = {}
for text in tokenized_texts:
for token in text:
if token not in wordfreq.keys():
wordfreq[token] =... | iwillemse/pre-uni | code/bow-tfidf.py | bow-tfidf.py | py | 1,368 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "heapq.nlargest",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 45,
... |
35727586260 | #!/usr/bin/python
import pygame, sys, game
from pygame.locals import *
WIDTH = 640
HEIGHT = 480
DRAWSTEP = 3
TICK = 30
VOLATILITY = 0.8
TIMESTEP = float(TICK)/1000
if len(sys.argv) < 2:
ORDER = 2
else:
ORDER = int(sys.argv[1])
BLACK = pygame.Color(0,0,0)
WHITE = pygame.Color(255,255,255)
pygame.init()
fpsCl... | TheBB/deriv | deriv.py | deriv.py | py | 1,999 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pygame.Color",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.Color",
"line_num... |
9756222638 | import theano
from theano import tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from theano.tensor.signal import pool
from theano.tensor.nnet import conv3d2d
import numpy as np
from collections import OrderedDict
from .. import config
from .numpy_backend import get_random_magic_seed,... | trungnt13/odin_old | odin/tensor/theano_backend.py | theano_backend.py | py | 43,646 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "theano.config",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "theano.config",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "theano.sandbox",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarr... |
13522158009 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 7 10:37:20 2019
@author: paul
"""
# import relevant packages
from TwitterAPI import TwitterAPI
import pandas as pd
import json
i = 0 # counter
requestlist = [] # list for storing each call from the api (500 tweets at a time)
# search Crit... | prgeddes/TwitterDataExtraction | Search_Save_Tweets.py | Search_Save_Tweets.py | py | 1,563 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "TwitterAPI.TwitterAPI",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pandas.read_json",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 53,
"usage_type": "call"
}
] |
4341271396 | from __future__ import annotations
import logging
import os
from time import sleep
from typing import List, Optional, Union, ClassVar, Dict, Type, Optional, Iterable
from queue import Queue, Empty
from easyflow.common.logger import setupLogger
from easyflow.common.utils import Timer
import threading
logger = setupLo... | catwang01/easyflow | easyflow/obj.py | obj.py | py | 8,548 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "easyflow.common.logger.setupLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Type",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Typ... |
14241805756 | from sys import exit
from time import sleep, time
from random import randint
import pygame
from pygame.constants import RESIZABLE
# Tetramino definitions on a 4x4 grid. 1 means the tile exists.
TETRAMINO_I = (((0, 0, 0, 0), (0, 0, 0, 0), (1, 1, 1, 1), (0, 0, 0, 0)),
((0, 1, 0, 0), (0, 1, 0, 0), (0, 1, 0... | dmcdo/Pygame-Games | tetris.pyw | tetris.pyw | pyw | 22,293 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.Rect",
"line_number": 62,
"usage_type": "attribute"
},
{
"api_name": "pygame.init",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "pygame.constants... |
14703280517 | from datetime import datetime
from os.path import dirname, join
import pytest
from city_scrapers_core.constants import COMMISSION
from city_scrapers_core.utils import file_response
from freezegun import freeze_time
from city_scrapers.spiders.sf_planning import SfPlanningSpider
test_response = file_response(
join... | washabstract/city-scrapers-ca | tests/test_sf_planning.py | test_sf_planning.py | py | 2,234 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "city_scrapers_core.utils.file_response",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "c... |
5125409200 | from heatmappy import Heatmapper
from PIL import Image
import database_func as db
import img_lib
def percent_to_diameter(percent):
default = 150
if percent == 0:
return 0
elif percent <= 10:
return default
elif percent <= 20:
return default + 50
elif percent <... | jinho17/eye_tracking_project | eye_tracking/database/heatmap.py | heatmap.py | py | 2,434 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "database_func.select_user_imgstr",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "img_lib.str_to_img",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "img_lib.img_save",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "... |
5308409788 | ## adsbib.py
## A tool for collecting BibTeX records from NASA ADS.
##
## Call with reference to a plaintext list of bibcodes,
## separated by newlines. Output will be to the same
## filename, appended with .bib
## >> python3 ads-bib.py bibcodes
##
## Note : To strip an existing BibTeX file down to bibcodes with vi... | lowderchris/ads-bib | ads-bib.py | ads-bib.py | py | 959 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ads.ExportQuery",
"line_number": 29,
"usage_type": "call"
}
] |
13119405899 | from django.conf.urls import url, include
from . import views
from .models import *
from rest_framework import routers, permissions, serializers, viewsets
from oauth2_provider.ext.rest_framework import TokenHasReadWriteScope, TokenHasScope
class UserProfileSerializer(serializers.HyperlinkedModelSerializer):
class... | dammahom/matchpredict | gameapi/urls.py | urls.py | py | 1,075 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.serializers.HyperlinkedModelSerializer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 13,... |
21959415638 | from fastapi import APIRouter, HTTPException
from init_system import system
from schemas.customer_shcema import SignIn, SignUp, SetCart, Email
from models.Cart import CartItem
router = APIRouter(prefix="/customer")
@router.post("/sign_in")
async def customer_login(body: SignIn):
try:
return {
... | Dope21/python-oop | controllers/customer_ctrl.py | customer_ctrl.py | py | 2,486 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "schemas.customer_shcema.SignIn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "init_system.system.sign_in",
"line_number": 14,
"usage_type": "call"
},
{
"api_na... |
34892241691 | from logging import raiseExceptions
from flask import Flask, request, make_response, jsonify
from flask_cors import CORS, cross_origin
import hashlib
from controller import *
app = Flask(__name__)
CORS(app)
Controller = Controller()
@app.route("/ong", methods=["GET", "POST", "PUT"])
@cross_origin()
def ong():
"""... | BrunoTaufner/RPII | server/app.py | app.py | py | 4,960 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
12211334459 | '''Some helper functions for PyTorch, including:
- get_mean_and_std: calculate the mean and std value of dataset.
- msr_init: net parameter initialization.
- progress_bar: progress bar mimic xlua.progress.
'''
import os
import sys
import time
import math
import torch
import torchvision
import torch.nn as n... | zarekxu/QuadraLib | image_classification/utils.py | utils.py | py | 7,113 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.utils",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.zeros",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.zeros"... |
26109711840 | """
The customers resource is a representation of the customer accounts.
All the REST API calls to the Customer or the Address Database are housed here.
Customers Service with Swagger and Flask RESTX
Paths:
------
GET / - Displays a UI for Selenium testing
GET /customers - Lists a list all of Customers
GET /customers/... | CSCI-GA-2820-SP23-003/customers | service/routes.py | routes.py | py | 21,967 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "flask_restx.fields.String",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "flask_restx.fields",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "flask_restx.fields.String",
"line_number": 35,
"usage_type": "call"
},
{
"api_name":... |
30823116350 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render, redirect, get_object_or_404
# from django.views.decorators.http import require_POST
from shop.models import Product
from .models import Cart, CartItem
# from .forms import CartAddProductForm
from django.contrib.auth.de... | studiosemicolon/onlineshop | cart/views.py | views.py | py | 2,091 | python | en | code | 23 | github-code | 6 | [
{
"api_name": "models.Cart.objects.update_or_create",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Cart.objects",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "models.Cart",
"line_number": 15,
"usage_type": "name"
},
{
"api_nam... |
911107140 | from collections import Counter
import re
from xml.etree import ElementTree
from trapdoor import TrapdoorProgram, Message, run_command
exclusion_rules = [
re.compile(r'^[\s]*raise NotImplementedError')
]
def excluded_from_coverage(source_line):
"""Determine of the given line should be excluded from the cov... | theochem/horton | tools/qa/trapdoor_coverage.py | trapdoor_coverage.py | py | 5,168 | python | en | code | 83 | github-code | 6 | [
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "trapdoor.TrapdoorProgram",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "trapdoor.TrapdoorProgram.... |
646604887 | import copy
import logging
import os
from gunpowder.caffe.net_io_wrapper import NetIoWrapper
from gunpowder.ext import caffe
from gunpowder.nodes.generic_predict import GenericPredict
from gunpowder.volume import VolumeType, Volume
logger = logging.getLogger(__name__)
class StupidPredict(object):
'''Augments a ... | constantinpape/gunpowder-experiments | experiments/inference/stupid_predict.py | stupid_predict.py | py | 2,500 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "gunpowder.ext.caffe.enu... |
19373198646 | import time
from selenium import webdriver
from selenium.webdriver.common.by import By
url = 'http://parsinger.ru/selenium/1/1.html'
text = ['Name', 'Surname', 'Sursurname', 'Age', 'City', 'EMAIL']
with webdriver.Chrome() as browser:
browser.get(url)
inputs = browser.find_elements(By.CLASS_NAME, 'form')
... | spac3orange/Web-parsing-study | Selenium/search_elements/tasks/task1_5sek.py | task1_5sek.py | py | 496 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.CLASS_NAME",
"line_number": 11,
"usage_type": "attribute"
},... |
28774253567 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Leonardo La Rocca
"""
import melopero_RV_3028 as mp
import datetime
import gpiozero as gpio
from signal import pause
def main():
# First initialize and create the rtc device
rtc = mp.RV_3028()
# Set the device to use the 24hour format (default) ... | melopero/Melopero_RV-3028 | examples/alarm_interrupt_example.py | alarm_interrupt_example.py | py | 1,795 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "melopero_RV_3028.RV_3028",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": ... |
36242169771 | """
RUNBASE-IMP
HTML scraping bot for monitoring Adidas Runners events
Author: Francesco Ramoni
francesco[dot]ramoni@email.it
https://github.com/framoni/
"""
import json
from lxml import html
from selenium import webdriver
import time
from twilio.rest import Client
#-------------------------------... | framoni/runbase-imp | main.py | main.py | py | 3,011 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "time.s... |
1796292061 | from hashlib import md5
from typing import Union
def hash_encode(data: Union[str, bytes],
return_bytes: bool = False) -> Union[str, bytes]:
if isinstance(data, str):
data = data.encode()
output = md5(data)
return output.digest() if return_bytes else output.hexdigest()
| FZQ0003/Qi-Bot | utils/hash.py | hash.py | py | 307 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "hashlib.md5",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 6,
"usage_type": "name"
}
] |
32583976944 | import json
import logging
import os
import threading
from time import sleep
from tqdm import tqdm
from logger import get_logger
machines = [
'4GB-rpi-4B-alpha',
'4GB-rpi-4B-beta',
'2GB-rpi-4B-beta',
'2GB-rpi-4B-alpha',
'cloud1',
'cloud2',
'desktop-remote'
]
ips = {
'4GB-rpi-4B-alpha'... | Cloudslab/FogBus2 | containers/experiment.py | experiment.py | py | 11,903 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "logger.get_logger",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"l... |
41978220901 | from task_3 import Bucket, Unbucketed, JoinBuckets
from pyspark.sql import SparkSession
from pyspark.sql.types import StructType, StructField, StringType, DateType, IntegerType
from datetime import datetime
import pytest
spark = SparkSession.builder.appName("Clients").getOrCreate()
# schema for trx_table
... | rkrvchnk/pyspark_tasks | tests/test_task_3.py | test_task_3.py | py | 2,853 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pyspark.sql.SparkSession",
"line_number": 9,
"usage_type": "... |
42929655074 | from collections import defaultdict
class Solution:
def accountsMerge(self, accounts):
email_accounts_map = defaultdict(list)
visited_accounts = [False]*len(accounts)
result = []
for i, account in enumerate(accounts):
for j in range(1, len(account)):
ema... | shwetakumari14/Leetcode-Solutions | Miscellaneous/Python/721. Accounts Merge.py | 721. Accounts Merge.py | py | 1,279 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 5,
"usage_type": "call"
}
] |
5430866729 | from airflow import DAG
from datetime import datetime, timedelta
from airflow.operators.python import PythonOperator
default_args = {
'owner': 'airflow',
'start_date': datetime(2023, 7, 16),
'retries': 1,
}
def print_hello():
return "Hello World from Airflow!"
dag = DAG(
dag_id="hello_airflow",... | tejas7777/RobinHood | dags/test.py | test.py | py | 594 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
70926690428 | """
youtube_downloader.py notes:
- May occasionally have errors. Just re-run.
- Caches to prevent duplicate downloading of videos.
"""
from pytube import YouTube
def download_youtube(video_url, videoname='0'):
if check_cache(video_url):
print(f"youtube_downloader.py: Video already exists.")
retur... | jetnew/carelytics | video_indexer/youtube_downloader.py | youtube_downloader.py | py | 1,291 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "pytube.YouTube",
"line_number": 17,
"usage_type": "call"
}
] |
24812924597 | from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from ... | IldarKhuzin/selenium_7 | lenta.py | lenta.py | py | 1,400 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.chrome.service.Service",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 15,
"usage... |
43694416643 | from django import template
from django.contrib.contenttypes.models import ContentType
from notification_channels.models import Notification
register = template.Library()
""" Notification tags """
@register.simple_tag(name='get_all_notifs')
def get_all_notifs(user):
return user.notifications.all().order_by("-... | Velle-log/FusionIIIT | FusionIIIT/notification_channels/templatetags/notif_tags.py | notif_tags.py | py | 3,084 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "django.template.Library",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.contenttypes.models.ContentType.objects.get_for_model",
"line_number": 34,
"usage_ty... |
22493469406 | import logging
from pathlib import Path
from yapsy.PluginManager import PluginManager
def get_module_logger():
return logging.getLogger(__name__)
THIS_PATH = Path(__file__).parent
modules_plugin_manager = PluginManager()
modules_plugin_manager.setPluginPlaces([str(THIS_PATH)])
modules_plugin_manager.collectP... | cryptologyrooms/raat | raat/modules/__init__.py | __init__.py | py | 1,189 | python | en | code | null | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "yapsy.PluginManager.PluginManager",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "loggi... |
6727933661 | ###In this script I combined the raw features of colone and humanbonmarrow to run with Height GWAS summary statistics
#importing the imprtant maduals
import pandas as pd
import numpy as np
import os
from pathlib import Path
arr = os.listdir('combine')
out_dir = Path("combine")
for file in arr:
new_na... | molgenis/benchmark-gwas-prio | prioritization_methods/PoPS/Combine hbm_colon_rawfeatures.py | Combine hbm_colon_rawfeatures.py | py | 926 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.rename",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number":... |
8451903556 | from pyrogram import Client, idle, enums
import json
from userbot import app, Db
from config import *
from userbot import UPSTREAM_REPO
import sys
import requests
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from random import choice
import base64
async def keep_alive():
url = "https://ap... | LavanderProjects/XUserBot | userbot/__main__.py | __main__.py | py | 2,355 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "apscheduler.schedulers.asyncio.AsyncIOScheduler",
"line_number": 34,
"usage_type": "call"
},
{
"api_nam... |
39830056794 | import sys
from collections import deque
sys.setrecursionlimit(10**7)
n = int(sys.stdin.readline().rstrip())
k = int(sys.stdin.readline().rstrip())
graph = [[0] * n for _ in range(n)]
direction = deque()
moves = [[0, 1], [1, 0], [0, -1], [-1, 0]]
snake = deque()
for i in range(k):
x, y = map(int, sys.stdin.read... | omg7152/CodingTestPractice | Etc/Snake_3190.py | Snake_3190.py | py | 1,660 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readli... |
30410039881 | from Node import *
from bitarray import bitarray
import os
def alphabet_frequency(nom_fichier) -> dict:
"""Renvoies un dictionnaire comportant les caractères du texte dans l'ordre de fréquence croissante puis si deux caractères ont le même nombre d'apparition, par leur ordre dans l'alphabet ASCII
Args:
... | ArthurOnWeb/Codage-de-Huffman-PROJ631- | Main.py | Main.py | py | 5,011 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "bitarray.bitarray",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "os.path.getsize",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 73,
"usage_type": "attribute"
},
{
"api_name": "os.path.getsize",
... |
11005307998 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import math
import seaborn as sns
from numpy.random import rand
from sklearn import preprocessing
from sklearn import metrics, svm
from sklearn.metrics import plot_confusion_matrix, precision_score
from collections import Counter
from sklearn.linea... | xixihaha1995/cosc5555 | proposal/simpleLogistic.py | simpleLogistic.py | py | 7,185 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.random",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "math.ceil",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.count_nonzero",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
... |
15548163858 | import argparse
import itertools
import json
import logging
import sys
from pathlib import Path
from server.src.pdf_tools_core import Document, set_log_level
log = logging.getLogger()
log_handler = logging.StreamHandler()
log.addHandler(log_handler)
log_handler.setFormatter(logging.Formatter('%(levelname)s: %(messag... | lukasstorck/py-pdf-tools | pdf_tools_cli.py | pdf_tools_cli.py | py | 4,787 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pathlib.Pat... |
23010318012 | __all__ = (
"__version__",
"AssumedDiagonalGraphTraversal",
"Edge",
"Flow",
"get_path_from_matrix",
"guess_production_exchanges",
"NewNodeEachVisitGraphTraversal",
"Node",
"path_as_brightway_objects",
"to_normalized_adjacency_matrix",
)
from .graph_traversal_utils import get_pat... | brightway-lca/bw_graph_tools | bw_graph_tools/__init__.py | __init__.py | py | 652 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "utils.get_version_tuple",
"line_number": 25,
"usage_type": "call"
}
] |
2124151948 | import asyncio
import inspect
import sys
import json
import socket
from contextlib import redirect_stdout, suppress
from traceback import format_exc
from typing import Dict, Callable
from copy import copy
from gornilo.models.api_constants import *
from gornilo.models.action_names import INFO, CHECK, PUT, GET, TEST
fr... | HackerDom/Gornilo | gornilo/actions.py | actions.py | py | 10,242 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "contextlib.suppress",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "gornilo.models.action_names.PUT",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "gornilo.models.action_names.GET",
"line_number": 26,
"usage_type": "name"
},
{
... |
36275046877 | import pygame
SCROLLBAR_THICKNESS = 20
BUTTON_SCROLL_WHEEL_UP = 4
BUTTON_SCROLL_WHEEL_DOWN = 5
SCROLL_SPEED = 20
VSPACE = 20
class ScrolledPanel(pygame.Surface):
def __init__(self, display, x, y, width, height, vspace=VSPACE, background_color=(255, 255, 255)):
pygame.Surface.__init__(self, (width, height))
... | Timtam/cards-against-humanity | client/scrolled_panel.py | scrolled_panel.py | py | 6,728 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "pygame.Surface",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.Surface.__init__",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.Surface",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygam... |
39717267724 | from enum import Enum
class VarTypes(Enum):
INT = "int"
FLOAT = "float"
BOOL = "bool"
STRING = "string"
VECTOR = "vector"
VOID = "void"
class Ops(Enum):
POW = "^"
NEG = "neg"
POS = "pos"
NOT_ = "not"
MAT_MULT = "@"
DOT = ".."
MULT = "*"
DIV = "/"
INT_DIV =... | Irvel/doflir | SemanticCube.py | SemanticCube.py | py | 6,726 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 52,
"usage_type": "name"
}
] |
18536127088 | import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
input_file_aclevel = '/exports/humgen/idenhond/data/basenji_preprocess/human_atac_targets_Ac-level_cluster.csv'
df_aclevel = pd.read_csv(input_file_aclevel, sep = '\t').rename(columns = {'Unnamed: 0' : 'Index per level'})
df_aclevel_test = pd.re... | icdh99/LUMC_internship_enformer_continual | enformer/correlation/plots_paper/correlation_atac.py | correlation_atac.py | py | 9,010 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"l... |
73815172026 | import selenium.webdriver
from bonobo_selenium._version import __version__
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4'
def create_profile(use_tor=False):
_profile = selenium.webdriver.FirefoxProfile()
_profile.set_prefer... | python-bonobo/bonobo-selenium | bonobo_selenium/__init__.py | __init__.py | py | 1,078 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "selenium.webdriver.webdriver.FirefoxProfile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.webdriver",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
... |
7894457497 | from flask import Flask, render_template, request
import os
import json
from nova_code import start_vm
from swift_code import upload_to_container, check_file_exists
container_upload = 'uploads'
container_download = 'rendered'
environ = json.load(open(os.environ['CRED_FILE']))['CONFIG']['CONFIG_VARS']
app = Flask(__na... | stepanvanecek/cah-blender | main.py | main.py | py | 1,784 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_... |
73825796027 | """
分类算法应用案例-汽车金融预测用户是否会贷款买车
"""
from sklearn import tree
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.neighbors import KNeighborsClassifier
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve, auc
i... | ghostlyFeng/ML | Cluster/car.py | car.py | py | 4,212 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.GridSearchCV",
"line_number": 30,
"usage_type": "call"
... |
19007770169 | import traceback,json,pdb
from datetime import date,timedelta,datetime
import pandas as pd
from flask import jsonify
from backEnd.database.db_connection import set_connection
from answergen import create_single_column_response,create_multi_column_response,get_highlight_response
from frontendAPI import city_region_mappi... | divakar-yadav/Backend-APIs | frontendAPI/executor.py | executor.py | py | 11,994 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "backEnd.database.db_connection.set_connection",
"line_number": 13,
"usage_type": "call"
},
{
... |
13041202153 | import falcon
import json
import logging
logger = logging.getLogger(__name__)
class Correlation:
def __init__(self, store):
self.__store = store
def on_get(self, req, resp):
params = req.params
logger.info('request: {}'.format(params))
if 'series1' not in params or 'series2'... | Qinode/final-visual-api | src/resources/data/corr.py | corr.py | py | 576 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "falcon.HTTP_400",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "falcon.HTTP_200",
... |
73076321467 | from __future__ import annotations
import os
from typing import Callable, TYPE_CHECKING
if TYPE_CHECKING:
from bot.translator import Translator
app_name = "TTMediaBot"
app_version = "2.3.1"
client_name = app_name + "-V" + app_version
about_text: Callable[[Translator], str] = lambda translator: translator.translat... | gumerov-amir/TTMediaBot | bot/app_vars.py | app_vars.py | py | 715 | python | en | code | 52 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "bot.translator.Translator",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path... |
3439919651 | from sortedcontainers import SortedDict
class Node:
def __init__(self, val=None):
self.val = val
self.next = None
self.last = None
class MaxStack:
def __init__(self):
self.dic = SortedDict()
self.root = Node()
self.root.last, self.root.next = self.root... | cuiy0006/Algorithms | leetcode/716. Max Stack.py | 716. Max Stack.py | py | 1,463 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sortedcontainers.SortedDict",
"line_number": 13,
"usage_type": "call"
}
] |
43959470416 | import datetime
import os
import random
import sys
from itertools import islice
from typing import List, Generator, Iterator
folder = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'ch03-mem-and-variables'))
sys.path.insert(0, folder)
import size_util
random.seed(42)
def main():
# Took 83 MB in n... | talkpython/python-memory-management-course | code/ch07-mem-and-functions/app_one_at_a_time.py | app_one_at_a_time.py | py | 1,496 | python | en | code | 39 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_nu... |
6690596464 | from json import load
with open('config.json', 'r') as file:
params = load(file)
BOT_TOKEN = params['BOT_TOKEN']
PARAMS = params['PARAMS']
SEARCH_URL = params['SEARCH_URL']
HOST = params['HOST']
PORT = params['PORT']
DB_NAME = params['DB_NAME']
| YusupovAI/TelegramBot | config.py | config.py | py | 274 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 4,
"usage_type": "call"
}
] |
71442915067 | import sys
import os
import logging
from datetime import datetime
from logging.handlers import TimedRotatingFileHandler
from logging import StreamHandler
from panda3d.core import (
loadPrcFile,
Filename,
ConfigVariableBool,
)
def setup_log(editor_name, log_to_console=False, log_level=logging.DEBUG):
... | fireclawthefox/FRAME | panda3d_frame/editorLogHandler.py | editorLogHandler.py | py | 2,086 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "logging.DEBUG",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
14950903206 | # author: detoX
import glob
import numpy as np
import torch
import nibabel as nib
from PIL import Image
import nii_dataset
def main():
train_path = glob.glob("D:\\xuexi\\post-graduate\\py_projects\\ResNet-PET\\datasets\\Brain-PET\\Train\\*\\*")
test_path = glob.glob("D:\\xuexi\\post-graduate\\py_projects\\R... | Rah1m2/ResNet-PET | display_nii.py | display_nii.py | py | 2,266 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nibabel.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_numb... |
41912482635 | from array import array
import datetime
from datetime import datetime, timezone
import requests
import math
from app.core.common import cf
# import json
from app.core.wcommon import wcf
from app.db.database import couch
class WSearch():
def __init__(self) -> None:
self.SEARCH_TAGS = [
... | metno/weamyl-metcap | app/app/core/wsearch.py | wsearch.py | py | 19,290 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.core.wcommon.wcf.getQueryString",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "app.core.wcommon.wcf",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "app.db.database.couch.get",
"line_number": 44,
"usage_type": "call"
},
{
... |
22021057101 | from fractions import Fraction
from typing import Generic, TypeVar
import funcy
# generic `NamedTuple`s were only introduced in Python 3.11 - until then we need to
# import from `typing_extensions`
from typing_extensions import NamedTuple
from boiling_learning.io.dataclasses import dataclass
_T = TypeVar('_T')
cl... | ruancomelli/boiling-learning | boiling_learning/datasets/splits.py | splits.py | py | 1,911 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "typing.TypeVar",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing_extensions.NamedTuple",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Generic",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "fractions.... |
27260781556 | #Script for the first experiment of the multi-channel DART paper
#In this experiment, the performance of MC-DART is investigated for different number of channels and materials in the phantom,
# all averaged over 100 runs.
#Author,
# Mathé Zeegers,
# Centrum Wiskunde & Informatica, Amsterdam (m.t.zeegers@cwi.n... | mzeegers/MC-DART | scripts/MCDARTExp1.py | MCDARTExp1.py | py | 8,833 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"lin... |
72729149627 | import cv2
from skimage.metrics import structural_similarity as ssim
import numpy as np
from PIL import Image, ImageChops
import matplotlib.pyplot as plt
################################################################
########### USING PIXEL COMPARISON #########################
############## IMPORTANT TO REA... | joaofgois/saut_ogm | scripts/MapComparisonMetric.py | MapComparisonMetric.py | py | 4,169 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number"... |
39254020126 | import os
import rasterio
import geopandas as gpd
import shapely
from shapely.geometry import box
from tqdm import tqdm
def parse_txt(txt_dir):
"""
Read txt file.
bbox format - xmin, ymin, xmax, ymax (unnormalized).
Params:
txt_dir (str): path to text file containing bboxes.
... | unicef/Mongolia-school-mapping-AI-models | codes/geo_utils.py | geo_utils.py | py | 6,240 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "geopandas.read_file",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
33036426825 | """Config flow for UniFi."""
import socket
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_USERNAME,
CONF_VERIFY_SSL,
)
from homeassistant.core import callback
import homeassistant.helpers.config_validati... | 84KaliPleXon3/home-assistant-core | homeassistant/components/unifi/config_flow.py | config_flow.py | py | 11,066 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "const.CONTROLLER_ID.format",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "const.CONTROLLER_ID",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "const.CONF_CONTROLLER",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "... |
22688604701 | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.decorators import login_required
from .models import Product
from apps.customers.models import Customer
from django.views.decorators.http import require_POST
from .cart import Cart
from .forms import CartAddProductForm
@login_re... | ordemdigitale/django-crm-v2 | apps/shop/views.py | views.py | py | 2,148 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "models.Product.objects.count",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.Product.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "models.Product",
"line_number": 13,
"usage_type": "name"
},
{
"api_name"... |
38814850733 | import matplotlib.pyplot as plt
import pandas as pd
import argparse
import seaborn as sns
sns.set_context("notebook", font_scale=1.8)
plt.style.use('fivethirtyeight')
parser = argparse.ArgumentParser()
parser.add_argument('--classifier', default="svm", type=str, nargs='?', help='classifier')
args = parser.parse_args()... | nphdang/CCRAL | visualize.py | visualize.py | py | 1,524 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "seaborn.set_context",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_nam... |
10114743152 | from __future__ import annotations
from typing import Tuple
import stage.tile_types as tile_types
from stage.game_map import GameMap
class Room:
"""Klass för att representera ett rektangulärt rum"""
def __init__(self, x: int, y: int, width: int, height: int) -> None:
self.x1 = x
self.y1 = y... | programmerare93/Dungeons_of_Kwargs | src/stage/rooms.py | rooms.py | py | 1,435 | python | sv | code | 4 | github-code | 6 | [
{
"api_name": "typing.Tuple",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 30,
"usage_type": "name"
}
] |
70465798267 | import sys
from cx_Freeze import setup, Executable
target = Executable(script="Main_Program_Design.py",
base = "Win32GUI",
icon="Meat_Icon.ico")
setup(name="Meat Shop Management System",
version = "1.0",
description="A simple program that helps the owner compute the... | zEuS0390/python-meat-shop-management-system | setup.py | setup.py | py | 375 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "cx_Freeze.Executable",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.setup",
"line_number": 8,
"usage_type": "call"
}
] |
73400038269 | #!/usr/bin/env python2
import sys
sys.path.insert(0, '/root/jhbuild')
import jhbuild.main
import jhbuild.moduleset
from jhbuild.versioncontrol.git import GitBranch
import __builtin__
import json
__builtin__.__dict__['SRCDIR'] = '/root/jhbuild'
__builtin__.__dict__['PKGDATADIR'] = None
__builtin__.__dict__['DATADIR'] ... | benwaffle/gnome-hound | gen-conf.py | gen-conf.py | py | 878 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "__builtin__.__dict__",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "__builtin__.__d... |
1549161757 | import numpy as np
import pickle
import os
import random
from compute_pairwise_dataset import compute_pairwise_dataset
import torch
from utils import get_torch_device
def save_dataset(qids, X, y, folder):
"""
Save the dataset in the provided folder.
"""
if not os.path.exists(folder):
os.mkdir(... | catalinlup/learning-to-rank | src/data_loaders.py | data_loaders.py | py | 4,938 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number":... |
20678009932 | from django.test import TestCase
from django.urls import reverse
from apps.articles.models import Tag
from apps.users.models import CustomUser
from .models import Tool
# Create your tests here.
test_tool = {
"name": "tool_name",
"slug": "tool_slug",
"description": "tool_description",
"img_link": "htt... | akundev/akundotdev | apps/tools/tests.py | tests.py | py | 4,039 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.test.TestCase",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "models.Tool.objects.create",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "models.Tool.objects",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name... |
30086443751 | import os
import pickle
import numpy as np
from .util import draw_roc
from .statistic import get_EER_states, get_HTER_at_thr
from sklearn.metrics import roc_auc_score
def eval_acer(results, is_print=False):
"""
:param results: np.array shape of (N, 2) [pred, label]
:param is_print: print eval score
:r... | VIS-VAR/LGSC-for-FAS | utils/eval.py | eval.py | py | 4,112 | python | en | code | 223 | github-code | 6 | [
{
"api_name": "statistic.get_EER_states",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.roc_auc_score",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "util.draw_roc",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "... |
32509272843 | import numpy as np
import matplotlib.pyplot as plt
from math import sqrt
import scipy.stats as sc
def myRho(T,n):
COV=0;
pq =0 ;
SY=0;
SX=0;
EX=sum(T[0][0:])/float(len(T[0][0:])) #La experence de x
EY=sum(T[1][0:])/float(len(T[1][0:])) #La experence de y
for i in range(n):
COV = COV ... | Varelafv/TD6.py | exo3.py | exo3.py | py | 1,511 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "math.sqrt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,... |
29214477520 | import pytest
from datetime import datetime
from ..forms import PostForm, CategoryForm, CommentForm
from accounts.models import Profile, User
from ..models import Post
@pytest.fixture
def create_test_user():
data = {"email": "test@test.com", "password": "a/1234567"}
return User.objects.create_user(**data, is... | smz6990/DRF-Blog | core/blog/tests/test_forms.py | test_forms.py | py | 3,203 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "accounts.models.User.objects.create_user",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "accounts.models.User.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "accounts.models.User",
"line_number": 12,
"usage_type": "name"... |
29913794129 | #
# VIK Example file for working with date information
#
import os
import calendar
from datetime import date, time, datetime
def main():
os.system('clear')
## DATE OBJECTS
# Get today's date from the simple today() method from the date class
# today = date.today()
# print("Today's date is", date.today())
... | VikramDMello/Python-Learning | src/Lynda.com Exercise Files/Ch3/dates_start.py | dates_start.py | py | 3,633 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.system",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "datetime.date.... |
31315499323 | ###########
# This script builds the database for the web visualization
# It can take a long time to run, so it is recommended to run it in the background
# Here we we are going to take a folder of ABF or NWB files, and extract some features
# we will choose to use a custom backend or ipfx to extract the features
# fro... | smestern/pyAPisolation | pyAPisolation/web_viz/build_database.py | build_database.py | py | 22,652 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "allensdk.core.json_utilities.read",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "allensdk.core.json_utilities",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "ipfx.stimulus.StimulusOntology.DEFAULT_STIMULUS_ONTOLOGY_FILE",
"line_number":... |
18803588453 | from django.urls import path, include
from watchlist_app.api import views
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register('stream', views.StreamPlatformVS,
basename='streamplatform')
urlpatterns = [
path('list/', views.WatchListAV.as_view(), name='Watch-l... | aliesmaeli79/watchmateAPI | watchlist_app/api/urls.py | urls.py | py | 1,206 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "watchlist_app.api.views.StreamPlatformVS",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "watchlist_app.api.views",
"line_number": 7,
"usage_type"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.