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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
39593733294 | """
To run the app, do the following.
$ export FLASK_APP=app.py
$ flask run
* Running on http://127.0.0.1:5000/
"""
import sys
from flask import Flask, jsonify, render_template, request
import logging
sys.path.append('.')
from helpers.score import calculate_score
from helpers.io import load_data, write_response, ... | ChalkTalk/qa-interview | app.py | app.py | py | 1,345 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"li... |
35771969647 | from django.db import models
from users.models import ImagesUser
# Create your models here.
class Image(models.Model):
name = models.CharField(max_length=20)
owner = models.ForeignKey(ImagesUser, on_delete=models.CASCADE)
file = models.ImageField(upload_to="images/")
created_at = models.DateTimeFiel... | blaku01/imagesAPI | backend/images/models.py | models.py | py | 341 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "... |
44778296811 | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from .models import Post
from apis.note_api import parse_post_request
def notesheet(request):
posts = Post.objects.all()
return render(request, 'web-notes/note.html', {'posts': posts... | shoark7/personal-web-apps | web_notes/views.py | views.py | py | 1,261 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "models.Post.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Post.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.Post",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.s... |
74097186879 | #!/usr/bin/env python3
###########################################################################
#
# xasyFile implements the loading, parsing, and saving of an xasy file.
#
#
# Author: Orest Shardt
# Created: June 29, 2007
#
############################################################################
from string imp... | holzschu/lib-tex | utils/asymptote/GUI/xasyFile.py | xasyFile.py | py | 2,554 | python | en | code | 68 | github-code | 97 | [
{
"api_name": "xasy2asy.xasyItem",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "re.match",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "xasy2asy.identity",
"lin... |
16761900996 | from django.contrib import admin
from django.urls import path, re_path, include
from django.views.generic import TemplateView
from rest_framework_simplejwt.views import (
TokenObtainPairView,
TokenRefreshView,
TokenVerifyView
)
urlpatterns = [
# Django
path('admin/', admin.site.urls),
# Api
... | ah-aydin/Twitter-Clone | backend/tweety/tweety/urls.py | urls.py | py | 552 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "... |
70216047359 | import os
from PIL import Image
from flask import Flask, flash, request, jsonify, render_template, Response
from flask_cors import CORS
import requests
from werkzeug.utils import secure_filename
from dotenv import load_dotenv
import numpy as np
from numpy import asarray
import tensorflow as tf
import cv2
from skimage.t... | hanamthai/identifyingAndClassifyingCoffeeBeans | api/app.py | app.py | py | 5,583 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_n... |
34596022695 | from django.test import TestCase
from django.core.exceptions import ValidationError
from payments.models import Payment
class PaymentModelTestCase(TestCase):
def create_payment(self):
payment = Payment.objects.create(
name="Test Payment",
merchant="12345678-1234-1234-1234-123456789... | HamedDaneshvar/Persian-Ecommerce | volumes/app/payments/test/test_models.py | test_models.py | py | 2,348 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.test.TestCase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "payments.models.Payment.objects.create",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "payments.models.Payment.objects",
"line_number": 8,
"usage_type": "attribute"
... |
23916959447 | # -*- coding: utf-8 -*-
import pytz
import datetime
import pkg_resources
from django.template import Context, Template
from django.utils.encoding import smart_text
from xblock.core import XBlock
from xblock.fields import Scope, Integer, String, Boolean
from xblock.fragment import Fragment
from xmodule.util.duedate ... | MasterGowen/txt-XBlock | txt/txt.py | txt.py | py | 8,149 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "xblock.core.XBlock",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "xblock.fields.String",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "xblock.fields.Scope.settings",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_nam... |
13335424812 | import re
from click import style
from uno.model.card import Card
class TerminalUnoView:
"""A view of the Uno card game for the Terminal.
"""
def __init__(self):
self.last_message_seen = 0
def play(self, game):
"Plays a game"
self.greet()
while not game.is_over():
... | cproctor/mwc-pedprog-unit02-lab03 | uno/view/terminal.py | terminal.py | py | 3,711 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "click.style",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "click.style",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "click.style",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "click.style",
"line_number": ... |
6222325057 | from setuptools import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
cmdclass = {'build_ext' : build_ext}
import os
from distutils.sysconfig import get_config_var
MPICC = 'mpicc -v'
MPICXX = 'mpicxx'
ld = get_config_var('LDSHARED')
cc = get_config_var('CC')
# Futz up linker... | nickaj/sohpc-scorep | setup.py | setup.py | py | 1,631 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "Cython.Distutils.build_ext",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "distutils.sysconfig.get_config_var",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "distutils.sysconfig.get_config_var",
"line_number": 14,
"usage_type": "call"... |
1489872623 | import asyncio
from skellycam.detection.detect_cameras import detect_cameras
from skellycam.opencv.camera.camera import Camera
from skellycam.opencv.camera.models.camera_config import CameraConfig
async def imshow_testing():
cams = detect_cameras()
cvcams = []
for info in cams.cameras_found_list:
... | freemocap/skellycam | skellycam/experiments/imshow_tester.py | imshow_tester.py | py | 535 | python | en | code | 17 | github-code | 97 | [
{
"api_name": "skellycam.detection.detect_cameras.detect_cameras",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "skellycam.opencv.camera.camera.Camera",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "skellycam.opencv.camera.models.camera_config.CameraConfig"... |
41271112432 | from firebase_admin import credentials, messaging
import os
from datetime import datetime, timedelta
cred = credentials.Certificate({
"type": "service_account",
"project_id": os.environ.get("PROJECT_ID"),
"private_key_id": os.environ.get("PRIVATE_KEY_ID"),
"private_key": os.environ.get("PRIVATE_KEY").replace("... | devosfernando/lra.api | src/pushNotification/index.py | index.py | py | 1,304 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "firebase_admin.credentials.Certificate",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "firebase_admin.credentials",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.environ.get",
"line_number": 7,
"usage_type": "call"
},
{
"api... |
31336121935 | import pyjokes
import pyttsx3
import datetime
import speech_recognition as sr
import wikipedia
import webbrowser
import speedtest
import sys
import os
import smtplib
import random
import tkinter as tk
import re
import wmi
import cv2
from urllib.request import urlopen
from bs4 import BeautifulSoup as soup
import subproc... | rishitmavani/DreamnoidAIbot | main.py | main.py | py | 30,989 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "pyttsx3.init",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "psutil.sensors_battery",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "wmi.WMI",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
... |
15392906241 | import email
import hashlib
import logging
from email.message import Message
from pathlib import Path
from typing import Optional, Tuple
from logger import get_logger
from model import Attachment, MsgMeta, RawMsg, db, pw
log = get_logger(__name__)
def process_message(email_msg: Message, checksum: str, m_uid: str):
... | radupotop/mailboxdb | app/process.py | process.py | py | 2,854 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "logger.get_logger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "email.message.Message",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "email.utils.parsedate_to_datetime",
"line_number": 33,
"usage_type": "call"
},
{
"api_nam... |
73891579517 | from ast import operator
import imp
import json
from dsutils.de.utils import dbg, get_var_name
import fnmatch
import functools
import os
import shutil
from tqdm import tqdm
import pandas as pd
import sys
import subprocess
#subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'tabulate'])
from tabulate import... | e-lubrini/dsutils | dsutils/de/files.py | files.py | py | 7,045 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "os.path.isfile",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
13905158701 | """
Assumptions made:
1. For the GET method, assuming that whenever that GET method is ran, list will always be size 500,
so no need to check and just return the sorted list.
2. For the overall API, assuming this would be ran locally so enabled it to be ran locally. Otherwise,
possible to corrected and be ran o... | fmuno003/HeadStorm_Challenge | backEnd_challenge.py | backEnd_challenge.py | py | 2,667 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask_restful.Resource",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "flask.request.da... |
26335654084 | import pytest
from typing import Dict, Any, cast
from opentrons_shared_data.pipette import (
load_data,
pipette_load_name_conversions,
dev_types,
)
from opentrons_shared_data.pipette.types import (
PipetteChannelType,
PipetteModelType,
PipetteVersionType,
PipetteTipType,
Quirks,
Liqu... | Opentrons/opentrons | shared-data/python/tests/pipette/test_load_data.py | test_load_data.py | py | 3,369 | python | en | code | 363 | github-code | 97 | [
{
"api_name": "opentrons_shared_data.pipette.load_data.load_definition",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "opentrons_shared_data.pipette.load_data",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "opentrons_shared_data.pipette.types.PipetteModelT... |
26336974874 | """Tests for SystemConfigurationModel class.
Note: Do not need to test matching module names because module names cannot be the same
by definition of dict.
"""
from typing import Any, Callable, Dict
import pytest
from pydantic import ValidationError
from pytest_lazyfixture import lazy_fixture # type: ignore[import]
... | Opentrons/opentrons-emulation | emulation_system/tests/compose_file_creator/input/test_configuration_file.py | test_configuration_file.py | py | 9,002 | python | en | code | 12 | github-code | 97 | [
{
"api_name": "typing.Callable",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "pytest.fixture",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"lin... |
35450135311 | import pprint
from typing import List, Optional, Dict
from pydantic import BaseModel, Field
from unskript.thirdparty.pingdom import swagger_client as pingdom_client
pp = pprint.PrettyPrinter(indent=4)
class InputSchema(BaseModel):
checkIds: Optional[List[str]] = Field(
title='checkIds',
descripti... | unskript/Awesome-CloudOps-Automation | Pingdom/legos/pingdom_pause_or_unpause_checkids/pingdom_pause_or_unpause_checkids.py | pingdom_pause_or_unpause_checkids.py | py | 1,803 | python | en | code | 258 | github-code | 97 | [
{
"api_name": "pprint.PrettyPrinter",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
... |
73673459518 | # coding utf-8
# @time :2019/6/24 17:09
# @Author :zjunbin
# @Email :648060307@qq.com
# @File :alarm_first.py
from common.basepage import BasePage
from PageLocator.Alarm_locator import Alarm as loc
from Testdatas import common_data
class AlarmPage(BasePage):
def alarm_first(self, value):
... | zjunbin/InternetThingsplatform | PageObject/alarm_page/alarm_first.py | alarm_first.py | py | 875 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "common.basepage.BasePage",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PageLocator.Alarm_locator.Alarm.alarm_page",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "PageLocator.Alarm_locator.Alarm",
"line_number": 13,
"usage_type... |
1812207170 | import pygame
import random
# Constants
WIDTH = 800
HEIGHT = 600
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GRAVITY = 0.2
class Particle:
def __init__(self, x, y, size, color):
self.x = x
self.y = y
self.size = size
self.color = color
self.vx = random.uniform(-1, 1)
... | Supragroza34/Gravity | gravity.py | gravity.py | py | 1,653 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.uniform",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.draw.circle",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"l... |
36228255552 | def index_to_column(data, indx_col, power_col):
import pandas as pd
data = data.reset_index()
data[indx_col] = pd.to_datetime(data[indx_col])
data = data.sort_values(indx_col)
data = data.rename(columns={indx_col: 'ds', power_col: 'y'})
return data
def xgboost_algorithm(file, checked_columns, ... | stephanpesch/Innolab_08_KI_EE | algorithms/xgboost.py | xgboost.py | py | 4,947 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.to_datetime",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "xgboost.XGBRegressor",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
... |
30394436330 | import urllib.request
import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin
import sqlite3
import re
ignorewords = set(['the', 'of', 'to', 'and', 'a', 'in', 'is', 'it'])
class Crawler:
# iniitialize the Crawler with the name database
def __init__(self, dbname):
self.con = sqlite... | Aananda-giri/pdf_search_engine | back-end/crawler.py | crawler.py | py | 6,748 | python | en | code | null | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_... |
42229753067 | from __future__ import absolute_import
import os
from os.path import join
import flask
from . import helpers
class Flask(flask.Flask):
def __init__(self, name, settings=None, *args, **kwargs):
settings = helpers.import_settings(name, settings_module=settings)
if not 'static_folder' in kwargs:
... | ContinuumIO/continuum-flask | continuum_flask/server.py | server.py | py | 883 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
}
] |
17432483111 | import urllib
import random
import time
import pyperclip
filename = False
lineRn = 0 # For ordered mode
randomVal = 0
copyTime = False
def getFile():
print("What is your file called?")
x = input()
if ".txt" in x:
global filename;
filename = x;
try:
f = op... | Sajantoor/python-copy-paster | index.py | index.py | py | 2,902 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.sleep",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_n... |
41649689618 | from django.views.generic.edit import CreateView # For user registration, as per http://www.obeythetestinggoat.com/using-the-built-in-views-and-forms-for-new-user-registration-in-django.html
from django.contrib.auth.forms import UserCreationForm # For user registration
from django.conf.urls ... | JenniferPDX/effective-dj-tutorial | addressbook/urls.py | urls.py | py | 2,106 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "contacts.views.views.ListContactView.as_view",
"line_number": 9,
"usage_type": "call"
},
... |
16101110564 | from flask import Blueprint, render_template, request, flash, redirect, url_for
from flask_login import current_user
from blog_app import db
from blog_app.database.models import Review
from blog_app.forms.reviews import Review
reviews = Blueprint("reviews", __name__)
@reviews.route("/review-create", methods=['GET',... | 4ki11U/MicroBlogg | blog_app/routes/reviews/reviews.py | reviews.py | py | 1,529 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "blog_app.forms.reviews.Review",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name":... |
13278439770 | import time
import pandas as pd
import pyclone2revolver as p2r
from pathlib import Path
def AssignCopyNumber(battenberg_ouput, patient_data):
# Patient number
mutation_id_begin = patient_data.split('.')[0].split('/')[1] + ":"
# print(mutation_id_begin)
# print(patient_data)
# print(battenberg_oupu... | Ximelele/bachelor-thesis | main.py | main.py | py | 6,490 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"lin... |
74981919678 | from datetime import datetime, timezone
from os import environ
from typing import Callable, List, Optional, Union
from uuid import uuid4
from boto3.dynamodb.conditions import Attr, Key
import dynamo.user
from dynamo.util import DYNAMODB_RESOURCE, convert_floats_to_decimals, format_time, get_request_time_expression
... | ASFHyP3/hyp3 | lib/dynamo/dynamo/jobs.py | jobs.py | py | 5,792 | python | en | code | 30 | github-code | 97 | [
{
"api_name": "datetime.datetime.now",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "datetime.timezone.utc",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "da... |
44209891658 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
# Data collection and Pre-Processing
raw_mail_data = pd.read_csv('./dat... | sevdaimany/Machine-Learning-Projects | spam-mail-prediction/spam_mail.py | spam_mail.py | py | 2,733 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.notnull",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 37,
"usage_type": "call"
},
{
"api_name"... |
23167086894 | import sys
import pygame
import random
from settings import Settings
from catcher import Catcher
from ball import Ball
class Window:
def __init__(self):
pygame.init()
self.settings = Settings()
if self.settings.fullscreen == True:
self.screen = pygame.display.set_mode((0, 0), py... | Ansesteri/Medium_Level | 5_taskz.py | 5_taskz.py | py | 3,648 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "settings.Settings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.display"... |
71590435840 | import functools
from rest_framework import status
from rest_framework.response import Response
import datetime
import pytz
TIME_OUTPUT_FORMAT = '%Y-%m-%d %H:%M:%S'
def validate_serializer(serializer):
"""
如果符合序列化要求,序列化之后的数据放在request.serializer.data
否则直接返回序列化失败
@validate_serializer(TestSerializer)
... | Antinomy20001/Room214 | utils/utils.py | utils.py | py | 1,223 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "rest_framework.response.Response",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "rest_framework.status.HTTP_400_BAD_REQUEST",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.status",
"line_number": 28,
"usage_type":... |
38707980903 | import numpy as np
import pandas as pd
import shap
from ALEScore import *
def get_shap(model, X):
explainerShap = shap.Explainer(model.predict, X, )
shap_values = explainerShap(X, feature_perturbation = "tree_path_dependent")
vector = []
for i in range(X.shape[1]):
value = abs(shap_values.values[:, i]).mean... | rogerioluizsi/XAI--ExtrapolationExperiments | getScores.py | getScores.py | py | 2,553 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "shap.Explainer",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "shap.TreeExplainer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "shap.TreeExplainer",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
... |
37524900024 | from django.conf.urls import include,url,patterns
from . import views
import django.contrib.auth.views as auth_views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^about-us/$', views.about_us, name='about_us'),
url(r'^members/$', views.members, name='members'),
url(r'^achievements/$', views.achievem... | markroxor/Roboism | mainsite/urls.py | urls.py | py | 1,631 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.co... |
10550594201 | import pytest
from datetime import datetime
from src.utils.utils import view_list_generator, format_date
sample_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
class TestUtils:
def test_view_list_generator(self, my_config_loader):
g = view_list_generator(sample_list)
assert next(g) == sample_list[:2]
... | Deadpool-1000/Customer_Service_Portal | tests/test_utils/test_utils.py | test_utils.py | py | 1,060 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "src.utils.utils.view_list_generator",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "src.utils.utils.view_list_generator",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytest.raises",
"line_number": 22,
"usage_type": "call"
},
{
... |
27551472209 | import ujson
env_file_name = 'env.json'
def get_all():
file = open(env_file_name, 'r')
contents = ujson.loads(file.read())
file.close()
return contents
def get(var_name):
print('VAR NAME GET ' + var_name)
contents = get_all()
value = contents[var_name]
print(value)
print('---'... | harvzor/scrobbler-arduino | code/env.py | env.py | py | 589 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "ujson.loads",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "ujson.dumps",
"line_number": 31,
"usage_type": "call"
}
] |
21210512706 | import logging
import babel
import babel.dates
import weather
import drawing
EPD_WIDTH = 400
EPD_HEIGHT = 300
# only update once an hour within these ranges
DEAD_TIMES = [
range(0,6),
range(10,16)
]
class PaperClock( object ):
def __init__( self, debug_mode=False ):
self._debug_mode =... | prehensile/waveshare-clock | paperclock.py | paperclock.py | py | 1,477 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "epd4in2.EPD",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "babel.dates.get_timezone",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "babel.dates",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "babel.dates.for... |
24331076844 | import os
import unittest
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
import VolumeClipWithRoi
#
# VolumeClip
#
class VolumeClip(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https://github.com/Slicer/Slicer/blob/master/Bas... | orthotron/C1SegmentationTool | C1SegmentationTool/VolumeClip/VolumeClip.py | VolumeClip.py | py | 11,568 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "qt.QTabWidget",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "qt.QTabWidget",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "qt.QFormLayout",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "qt.QVBoxLayout",
"line... |
11917159891 | import argparse
import logging
import numpy as np
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from datasets import load_dataset
logging.basicConfig(
format='%(asctime)s %(levelname)-8s %(message)s',
level=logging.INFO,
datefmt='%Y-%m-%d %H:%M:%S')
label_di... | UKPLab/TexPrax | examples/inference.py | inference.py | py | 1,773 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "transfor... |
202005532 | # 假设现有需求,将一个只包含数字的列表中的所有元素都自加1
# 函数式编程的思想实现如下
test = [3,6,4,5,7,8,9,12,3]
def add_one(x):
return x+1
def squ(x):
return x**2
def map_list(func,list):
res = []
for i in list:
a = func(i)
res.append(a)
return res
result = map_list(add_one,test)
result_2 = map_list... | ChrisFourteen/pythonLearning | Map、Reduce、Filter.py | Map、Reduce、Filter.py | py | 2,442 | python | zh | code | 2 | github-code | 97 | [
{
"api_name": "functools.reduce",
"line_number": 82,
"usage_type": "call"
}
] |
22575311153 | from django.urls import path
from . import views
# app_name 변수는 주소에 라벨링을 합니다.
app_name="polls"
urlpatterns = [
path('main', views.index, name='index'),
path('test', views.test, name = 'test'),
path('get', views.get, name ='get'),
path('getform', views.getform, name = 'getform... | hongseok9/djangoblog | myfirstprj/polls/urls.py | urls.py | py | 1,412 | python | en | code | 0 | github-code | 97 | [
{
"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",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
6501619611 | from httpx import AsyncClient
from pytest import mark
from csv import writer, QUOTE_NONNUMERIC
from io import StringIO
from datetime import datetime
from schemas_mock import *
from app.services.auth import AuthHandler
auth = AuthHandler()
@mark.anyio
async def test_healthcheck(client: AsyncClient, refresh_db):
re... | khodjiyev2o/Meduzzen_Regista | tests/workers_test.py | workers_test.py | py | 1,913 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "app.services.auth.AuthHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "httpx.AsyncClient",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pytest.mark.anyio",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": ... |
38110114910 | # 1. set, 리스트만으로
from itertools import combinations
def solution(relation):
col_n = len(relation[0])
entity_n = len(relation)
all = []
for n in range(1, col_n+1):
for tmp in combinations(range(col_n), n):
all.append(tmp)
# 유일성
answer = []
for case in all:
tmp_... | sooyoungh/algorithm-study | 4. kakao/2019 blind/4. 후보키.py | 4. 후보키.py | py | 2,677 | python | ko | code | 0 | github-code | 97 | [
{
"api_name": "itertools.combinations",
"line_number": 11,
"usage_type": "call"
}
] |
41516451226 | import random
import matplotlib.pyplot as plt
class Point2D:
def __init__(self, x, y):
self.x = x
self.y = y
class Line2D:
def __init__(self, p1, p2):
self.p1 = p1
self.p2 = p2
def check_turn_right(p1, p2, p3):
vec1 = (p2.x - p1.x, p2.y - p1.y)
vec2 = (p3.x - p2.x,... | yyyhx/planning | Notes/python_test/conves_row.py | conves_row.py | py | 1,704 | python | en | code | null | github-code | 97 | [
{
"api_name": "random.seed",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplo... |
33322310388 | from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from .forms import ProfileForm
from .models import Profile
from notifications.signals import notify
from posts.models import Post, Report, Interest
# from notifications.models import notification
from django.core.ex... | gcivil-nyu-org/NYU-Marketplace | users/views.py | views.py | py | 4,579 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "posts.models",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "posts.models.Post.objects.all",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "posts.models.Post.objects",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_nam... |
30977378238 | """
This is a debugging test for FuncPipe
Local environment used
"""
import sys
sys.path.append('../')
import torch
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import DataLoader
from funcpipe import FuncPipe
from funcpipe.platforms import Platform
from funcpipe.debu... | liu445126256/FuncPipe | pipetests/test_local_launch_bert.py | test_local_launch_bert.py | py | 4,559 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "funcpipe.debugger.Logger.use_logger",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "funcp... |
7426169916 | import datetime
import gc
import logging
import operator
import os
from pprint import pformat
import joblib
import numpy as np
import pandas as pd
import torch
from scipy import spatial
from sklearn.preprocessing import LabelEncoder
from torch.utils.data import DataLoader
from src.config.config_template import Traini... | nikitajz/google-landmarks | src/inference_cos_dist.py | inference_cos_dist.py | py | 8,326 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.environ.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
35793398186 | import json
from flask import request, _request_ctx_stack, abort
from functools import wraps
from jose import jwt
algo = 'HS256' # HMAC-SHA 256
secret = 'learning'
class AuthError(Exception):
def __init__(self, error, status_code):
self.error = error
self.status_code = status_code
def get_auth_t... | AhmedAlsudairi/Rate-it | api/auth.py | auth.py | py | 2,128 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.request.headers.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.headers",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "jo... |
70864386238 | import sys
import math
from collections import deque
Towers = deque()
number_of_steps = 0
sys.setrecursionlimit(3090)
def initialize(n, K) :
for i in range(K) :
X = deque()
if (i == 0) :
for j in range(n) :
X.append(j+1)
Towers.append(X)
def is_everything_leg... | ericpzh/UIUC | IE531/mp1/hanoi.py | hanoi.py | py | 2,083 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.setrecursionlimit",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.floor",
... |
25529506812 | from discord import Client
class Bot(Client):
def __init__(self):
super().__init__()
async def on_ready(self):
print("Bot is now online")
async def on_message(self, message):
if message.author == self.user:
return
await message.channel.send("ping")
| chirprush/sm-bot | src/bot.py | bot.py | py | 308 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "discord.Client",
"line_number": 3,
"usage_type": "name"
}
] |
25085242549 | import matplotlib.pyplot as plt
def SIR(days_list, susceptible_list, infected_list, recovered_list):
# Plot the SIR graph
plt.figure(figsize=(8, 6))
plt.plot(days_list, susceptible_list, label="Susceptible", color="green")
plt.plot(days_list, infected_list, label="Infected", color="red")
plt.plot(d... | Anshxy/Epidemic-Simulation-Model | graph.py | graph.py | py | 510 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplo... |
20500812745 | from django.core.mail import send_mail
from django.shortcuts import redirect, render
from feedback.forms import FeedbackForm
from feedback.models import (
ComplainingUserModel,
FeedbackAttachments,
FeedbackModel,
)
from myserver.settings import DEFAULT_FROM_EMAIL
def feedback(request):
form = Feedba... | fedya-eremin/django_academy | feedback/views.py | views.py | py | 1,380 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "feedback.forms.FeedbackForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "feedback.models.ComplainingUserModel.objects.create",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "feedback.models.ComplainingUserModel.objects",
"line_number":... |
352696609 | from collections import defaultdict
import random
import re
import nltk
from nltk.corpus import wordnet as wn
dst = defaultdict(list)
# update_dst(input): Updates the dialogue state tracker
# Input: A list ([]) of (slot, value) pairs. Slots should be strings; values can be whatever is
# most appropriate for t... | nathanloo9927/chatbot | chatbot.py | chatbot.py | py | 32,502 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 206,
"usage_type": "call"
},
{
"api_name": "re.co... |
1325416778 | from pickle import FALSE
from turtle import pd
from cv2 import mean
import plotly.figure_factory as ff
import statistics
import random
import pandas as pd
import csv
import plotly.graph_objects as go
df = pd.read_csv("data.csv")
data = df["average"].tolist()
population_mean = statistics.mean(data)
print... | TrexSamar/110- | main.py | main.py | py | 1,485 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "statistics.mean",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "statistics.stdev",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "plotly.figure_factor... |
24412790932 | # The intro from the following code is from CS psets 7 and 8
import os
from cs50 import SQL
from flask import Flask, flash, jsonify, redirect, render_template, request, session
from flask_session import Session
from tempfile import mkdtemp
from werkzeug.exceptions import default_exceptions, HTTPException, InternalServ... | gppasco/vine | application.py | application.py | py | 6,181 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "flask_session.Session",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
... |
23945317432 | """
Import content from a TAXII 2.1 server.
"""
import collections
import itertools
import json
import misp_modules.lib.stix2misp
from pathlib import Path
import re
import stix2.v20
import taxii2client
import taxii2client.exceptions
import requests
class ConfigError(Exception):
"""
Represents an error in the ... | MISP/misp-modules | misp_modules/modules/import_mod/taxii21.py | taxii21.py | py | 10,599 | python | en | code | 310 | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 131,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_... |
22988715686 | import os
import numpy as np
import matplotlib.pyplot as plt
import pylibconfig2
from ergoPack import ergoPlot
from coupledRO import *
#ergoPlot.dpi = 2000
configFile = '../cfg/coupledRO.cfg'
cfg = pylibconfig2.Config()
cfg.read_file(configFile)
L = cfg.simulation.LCut + cfg.simulation.spinup
spinup = cfg.simulation... | atantet/transferCoupledRO | plot/plotEigVal.py | plotEigVal.py | py | 3,110 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pylibconfig2.Config",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.prod",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_n... |
42009716489 | from PyQt5 import Qt
import ctypes
import sip
_qtgui = ctypes.CDLL("libQtGui.so.4")
_qt_blurImage = _qtgui._Z12qt_blurImageP8QPainterR6QImagedbbi
def qt_blurImage(p, blurImage, radius, quality, alphaOnly, transposed=0):
p = ctypes.c_void_p(sip.unwrapinstance(p))
blurImage = ctypes.c_void_p(sip.unwrapinstance(... | atharva-naik/FigUI | FigUI/widgets/BlurShadowEffect.py | BlurShadowEffect.py | py | 3,430 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "ctypes.CDLL",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "ctypes.c_void_p",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sip.unwrapinstance",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "ctypes.c_void_p",
"li... |
20344795432 | import setuptools
from setuptools import setup
from nisnap import __version__
import os.path as op
this_directory = op.abspath(op.dirname(__file__))
with open(op.join(this_directory, 'README.md')) as f:
long_description = f.read()
download_url = 'https://github.com/xgrg/nisnap/-/archive/v0.4/'\
'nisnap-v0.4.t... | xgrg/nisnap | setup.py | setup.py | py | 1,446 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
25410243008 | import Start as s
import Database as db
import sleet_core as sleet
from termcolor import colored
import os
import sys
os.system('color')
s.start_initial()
print(colored("\n#####################################################################\n","red"))
print("Sorry for the command line interface we are working on UI... | tarunjarvis5/sleet | sleet_commandline/Main.py | Main.py | py | 2,142 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.system",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "Start.start_initial",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "termcolor.colored",
... |
22648500632 | import tweepy
import selenium
from bs4 import BeautifulSoup as bs
from urllib.request import urlopen, Request
import re
import csv
import os
import random as rd
import numpy as np
import keys
qt_list = []
def download_quotes():
url = "https://www.happycow.org.uk/inspiration/quotes_tolkien.xml"
response = urlopen(R... | ayushk7102/Tolkien-quote-py | tolkien_quote.py | tolkien_quote.py | py | 1,008 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib.request.Request",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.sp... |
13129639730 | # -*- coding: UTF-8 -*-
from common.log.Logger import log
from common.objects import BaseObj
from common.func import str_convert_to_camel
class PeeweeUtil(object):
def __init__(self, query=None, dbase=None, index=None):
"""
在这个里面做查询可以修改db配置
:param query: 查询的query
:param dbase: 查询的数... | chase001/chase_learning | Python接口自动化/GWE_test/common/db/PeeweeUtil.py | PeeweeUtil.py | py | 4,524 | python | zh | code | 0 | github-code | 97 | [
{
"api_name": "common.log.Logger.log.mysql",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "common.log.Logger.log",
"line_number": 61,
"usage_type": "name"
},
{
"api_name": "peewee.OperationalError",
"line_number": 85,
"usage_type": "attribute"
},
{
"ap... |
5599697583 | # blender CAM ops.py (c) 2012 Vilem Novak
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any l... | vilemduha/blendercam | scripts/addons/cam/ops.py | ops.py | py | 25,267 | python | en | code | 413 | github-code | 97 | [
{
"api_name": "bpy.context",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "cam.utils.reload_paths",
... |
40934488476 | """
Python implementation of the LiNGAM algorithms.
* some slight modification for speedup, 04/26/2022
The LiNGAM Project: https://sites.google.com/site/sshimizu06/lingam
"""
import time
import numpy as np
from scipy.stats import gamma
from statsmodels.nonparametric import bandwidths
__all__ = ['get_kernel_width', '... | py-why/causal-learn | causallearn/search/FCMBased/lingam/hsic.py | hsic.py | py | 5,589 | python | en | code | 846 | github-code | 97 | [
{
"api_name": "numpy.sum",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.tril",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 43,
... |
23951517882 | import os
import random
import argparse
import yaml
from tqdm import tqdm
from io import BytesIO
import torch
import torch.nn.functional as F
import torch.nn as nn
from datasets.imagenet import ImageNet
import clip
from utils_vqa import *
import base64
from torchvision import transforms
from PIL import Image, ImageFil... | alibaba/EasyNLP | examples/xtremeclip/main_vqa.py | main_vqa.py | py | 9,893 | python | en | code | 1,835 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.nn.Linear",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",... |
20228420686 | import argparse
import os
import random
parser = argparse.ArgumentParser(description='Reads conll dataset file, and augments the dataset')
parser.add_argument('--data-dir', type=str, default='train',
help="Folder of the dataset file")
args = parser.parse_args()
DOWNSAMPLE_LANGUAGES = ['ml... | AssafSinger94/sigmorphon-2020-inflection | src/downsample.py | downsample.py | py | 1,724 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"... |
25101702659 | from PIL import Image
import os
# Input and output directories
input_dir = "old"
output_dir = "new"
# Create the output directory if it doesn't exist
if not os.path.exists(output_dir):
os.makedirs(output_dir)
# Maximum width for resizing
max_width = 500
image_no = 1
# Function to resize and save an image
def re... | baradraja/useful_scripts | python/image_resize.py | image_resize.py | py | 1,728 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.exists",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_numb... |
37220588393 | from flask import Flask, jsonify, request
from flask_cors import CORS
from argparse import ArgumentParser
from models.wallet import Wallet
from models.blockchain import Blockchain
status_codes = {
"SUCCESS": 200,
"CREATED": 201,
"CLIENT_ERROR": 400,
"SERVER_ERROR": 500,
}
server = F... | kgebreki/blockchain | src/node.py | node.py | py | 4,525 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_n... |
35147690536 | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseRedirect, Http404
from django.urls import reverse
from django.template.loader import render_to_string
monthly_challenges = {
"january": "Eat no meat for the entire month!",
"february": "Work for at least... | Kasaklalita/monthly-challenges | challenges/views.py | views.py | py | 2,030 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.shortcuts.render",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseNotFound",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 44,
"usage_type": "call"
},
{
"api_... |
18119422951 | import sys
import hikari
import lightbulb
import asyncio
import traceback
import aiofiles
from ..utils import db
from datetime import datetime
class Events(lightbulb.Plugin):
def __init__(self, bot):
super().__init__()
self.bot = bot
@lightbulb.listener(hikari.ShardReadyEvent)
async def o... | DevHyperCoder/shikamaru-bot | shikamaru/plugins/events.py | events.py | py | 1,817 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "lightbulb.Plugin",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "hikari.Activity",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "hikari.ActivityType",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "lightb... |
24857496345 | from kivy import Config
from kivy.config import platform
if platform != "android":
# config window size
Config.set("graphics", "width", 360)
Config.set("graphics", "height", 640)
# MdTool overrides the config
from libs.screens.home_screen import HomeScreen # noqa: E402
from kivymd.tools.hotreload.app im... | coreproject-moe/android-kivy | main.py | main.py | py | 541 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "kivy.config.platform",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "kivy.Config.set",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "kivy.Config",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "kivy.Config.set",
"... |
21936619111 | # -*- coding: utf-8 -*-
import logging
import random
import time
from odoo import models, fields, api
from odoo.osv import expression
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
from datetime import datetime, timedelta, date
_logger = logging.getLogger(__name__)
class TShirtOrder(models.Model):
_name = ... | yorlysoro/awesome_tshirt | models/order.py | order.py | py | 3,982 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "odoo.api.model",... |
35043375026 | from email.header import Header
from email.message import Message
from email.utils import getaddresses, parseaddr
from django.conf import settings
from django.utils.functional import curry
from stepping_out.mail.commands import run_command, COMMANDS
from stepping_out.mail.logs import LOGGER
from stepping_out.mail.model... | melinath/stepping_out | mail/message.py | message.py | py | 5,816 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "django.conf.settings.STEPPING_OUT_LISTADMIN_EMAIL",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 27,
"usage_type": "call"
},
{... |
16149826512 | import utils.pg
import utils.cm
import utils.metrics
import pandas as pd
import datetime as dt
import os
fmtt = '%Y-%m-%dT%H:%M:%S'
# convert to pd dt
dStart = pd.to_datetime(dt.date(int(2016),int(1),int(1)), utc=True, format=fmtt, errors='ignore')
dEnd = pd.to_datetime(dt.date.today() + dt.timedelta(days=60), utc=Tru... | bochinchero/dcrpgdata | treasury.py | treasury.py | py | 1,669 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.to_datetime",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.date.tod... |
72840505918 | import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'amazon_search',
'query': 'nintendo',
'user_agent_type': 'desktop',
'parse': True,
'domain': 'com',
'geo_location': '10020',
'locale': 'en-us',
'start_page': '1',
'pages': '1'
}
# Get a response.
response =... | oxylabs/amazon-asin-scraper | src/amazon_asin.py | amazon_asin.py | py | 608 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.request",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 27,
"usage_type": "call"
}
] |
36341211253 | #!/usr/bin/env python
# coding: utf-8
# # Introduction
# This notebook presents couple examples of **graph visualization** in **pytorch**.
# **NOTE**: graph vizualization code was originally copied from https://github.com/szagoruyko/pytorchviz. Subsequenty modified by me.
# Contents:
# * [Imports](#Imports)
# * [Gr... | marcinbogdanski/ai-sketchpad | DebugNN/makedot.py | makedot.py | py | 6,032 | python | en | code | 8 | github-code | 97 | [
{
"api_name": "torch.Tensor",
"line_number": 183,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"line_number": 187,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"line_number": 193,
"usage_type": "attribute"
},
{
"api_name": "graphviz.Dig... |
9033262047 | from html.parser import HTMLParser
from typing import Dict, List, Tuple
from src import (
LexItem,
CONLLUToken, CONLLUTree,
Inventory
)
from data_readers.abstract_readers import ReaderAbstract
class CroDeriVHTMLParser(HTMLParser):
def __init__(self, *args, **kwargs):
super().__init__(*args, *... | s231644/wfdt | data_readers/croderiv_reader.py | croderiv_reader.py | py | 7,554 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "html.parser.HTMLParser",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"li... |
73244685759 | from django.shortcuts import render
from django.http import JsonResponse,HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import *
from .models import ResourceForProduct,ResourceForModule
@require_GET
@csrf_exempt
def insertproduct(request):
# 查询ResourceF... | chaofandashi/testauto | study/views_models.py | views_models.py | py | 713 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "models.ResourceForProduct.objects.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.ResourceForProduct.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.ResourceForProduct",
"line_number": 11,
"usage_type":... |
74981805758 | import argparse
import base64
import json
import logging
import textwrap
import urllib.parse
from typing import List, Optional
import boto3
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from tea_cli.commands.list_versions import TeaVersion, TeaVersio... | asfadmin/thin-egress-app | tea-cli/tea_cli/commands/quick_deploy.py | quick_deploy.py | py | 14,686 | python | en | code | 16 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name":... |
7678521589 | import numpy as np
import matplotlib.pyplot as plt
import PIL.Image as Image
import gymnasium
import random
import pygame
from gymnasium import Env, spaces
import time
from .agent import Agent
from .bullet import Bullet
from .enemy import Enemy
class EvaderEnv_v1(Env):
metadata = {"render_modes": ["human", "rgb_... | KPraszkiewicz/Evader | EvaderGym/evader/envs/evader_env_v1.py | evader_env_v1.py | py | 5,443 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "gymnasium.Env",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "enemy.Enemy",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "agent.Agent",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "gymnasium.spaces.Box",
"lin... |
7830498522 | import json
import logging
import re
import xml.etree.ElementTree as ET
from io import StringIO
from requests import __build__ as requests_version
from svtplay_dl.utils.http import get_full_url
from svtplay_dl.utils.http import HTTP
from svtplay_dl.utils.output import output
from svtplay_dl.utils.text import decode_ht... | olof/debian-svtplay-dl | lib/svtplay_dl/subtitle/__init__.py | __init__.py | py | 13,431 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "svtplay_dl.utils.http.HTTP",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.warning",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "svtplay_dl.utils.output.output",
"line_number": 72,
"usage_type": "call"
},
{
"api_nam... |
30644872718 | """
Author : Sravya Motepalli
Date created : 06/01/2022
Functionality : PORTFOLIO PROGRAMMING ASSIGNMENT - IMPROVING THE STOCK PROBLEM WITH ADDITIONAL FUNCTIONALITY
"""
# Import required libraries
import sqlite3
import plotly.express as px
import csv
import pandas as pd
import json
... | Sravya-M13/UD---Python | PortfolioAssignment.py | PortfolioAssignment.py | py | 4,351 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sqlite3.connect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_numb... |
15334909800 | """
Helper functions for dealing with calendar dates.
"""
import datetime as dtime
from datetime import timedelta, tzinfo
from functools import total_ordering
import numpy as np
import pandas as pd
import pytz
import xarray as xr
INC_ONE_DAY = timedelta(hours=24)
def is_leap_year(year):
"""
Is the given yea... | UCIDataLab/fire_prediction | src/helper/date_util.py | date_util.py | py | 6,858 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "datetime.timedelta",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
28606977142 | import argparse
import functools
import json
import logging
import os
import random
import sys
from systemd.journal import JournalHandler
from io import BytesIO
import bottle
from bottle import (
response,
request,
jinja2_view,
static_file,
redirect,
Bottle,
)
from PIL import Image, ImageDraw, ... | newAM/brother_ql_web | brother_ql_web/__init__.py | __init__.py | py | 11,030 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "bottle.TEMPLATE_PATH.insert",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "bottle.TEMPLATE_PATH",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "loggi... |
20480123953 | from datetime import datetime, timedelta, timezone
from enum import Enum
from random import SystemRandom
from typing import Any, Dict, List, Optional, Tuple
from mlib.localization import tr
def _t(key: str, language: str = "en", **kwargs):
return tr("bot.events.Halloween.translations." + key, "en-US", **kwargs)
... | Mmesek/MBot.py | bot/events/Halloween/general.py | general.py | py | 48,860 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "mlib.localization.tr",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "MFramework.commands.cooldowns.CacheCooldown",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "MFramework.Context",
"line_number": 44,
"usage_type": "name"
},
{
... |
36385208981 | import pygame
from ctypes import windll
from substick import SubStick
from stick import Stick
try: # Python 2.X support
from tkFileDialog import askopenfilename
except ImportError: # Python 3.0+ support
from tkinter.filedialog import askopenfilename
WHITE = (255,255,255)
class BigStick(Stick):
def __ini... | twerner/CouchPlays | bigstick.py | bigstick.py | py | 3,488 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "stick.Stick",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "stick.Stick.__init__",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "stick.Stick",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pygame.font.SysFont",
... |
16623678121 | """export implementation for storage"""
from typing import Any
from src.core.config import read_config
from src.storage.conoha.storage import ConohaStorage
from src.storage.storage_interface import StorageInterface
from src.core.logger import create_logger
logger = create_logger(__file__)
class StorageConfigure(Sto... | ganemaruko/auto_trade | apps/trade_lib/python/src/storage/storage_.py | storage_.py | py | 2,138 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "src.core.logger.create_logger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "src.storage.storage_interface.StorageInterface",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 13,
"usage_type": "name"
},
{... |
69883021438 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import sys
import os
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..smplifyx.utils_mics.mesh_viewer import MeshViewer
from ..smplifyx import utils_... | yhw-yhw/MOVER | thirdparty/body_models/video_smplifyx/fitting_video_loss.py | fitting_video_loss.py | py | 53,069 | python | en | code | 86 | github-code | 97 | [
{
"api_name": "smplifyx.fitting.SMPLifyLoss",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "smplifyx.fitting",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "torch.float32",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": ... |
5378219121 | import pygame
import random
pygame.init()
window = pygame.display.set_mode((1920, 1080))
pygame.display.set_caption("ULTIMATE GHOST FIGHT 9000")
class player:
def __init__(
self,
x,
y,
width,
height,
ghostLeft,
ghostRight,
ghostCrouchLeft,
g... | Hornflakes/python-2d-game | game.py | game.py | py | 16,210 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
20821522613 | import json
import re
from typing import Generator
import milagro_bls_binding as bls
import pytest
from aioresponses import CallbackResult, aioresponses
from eth_typing import HexStr
from staking_deposit.key_handling.keystore import Keystore
from web3 import Web3
from src.validators.typings import BLSPrivkey
@pytes... | stakewise/v3-operator | src/test_fixtures/remote_signer.py | remote_signer.py | py | 3,344 | python | en | code | 16 | github-code | 97 | [
{
"api_name": "pytest.fixture",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "eth_typing.HexStr",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "src.validators.typings.BLSPrivkey",
"line_number": 24,
"usage_type": "name"
},
{
"api_name"... |
22874186331 | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.options import Options
options = Options()
options.add_argument('--headless')
firefox = webdriver.Firefox(options=options)
URL = 'https://diolinux.com.br/'
def scrape(url):
firefox.get(url)
posts = []... | guilherme-ac-fernandes/trybe-exercicios | 04-ciencia-da-computacao/bloco-35-redes-e-raspagem-de-dados/dia-03-outras-ferramentas-de-raspagem-de-dados/src/script-03.py | script-03.py | py | 860 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "selenium.webdriver.firefox.options.Options",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 8,
"usage_type": "name"
},
{
... |
11398299286 | import os
import time
import psutil
import Natsunagi.modules.no_sql.users_db as users_db
from Natsunagi import StartTime
from Natsunagi.modules.helper_funcs import formatter
# Stats Module
async def bot_sys_stats():
bot_uptime = int(time.time() - StartTime)
cpu = psutil.cpu_percent()
mem = psutil.virtu... | aryazakaria01/Natsunagi-Nagisa | Natsunagi/modules/stats.py | stats.py | py | 780 | python | en | code | 13 | github-code | 97 | [
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Natsunagi.StartTime",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "psutil.cpu_percent",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "psutil.virtual_memor... |
15917329810 | import pygame
import random
from os import path
img_dir = path.join(path.dirname(__file__), 'img3')
snd_dir = path.join(path.dirname(__file__), 'snd3')
pygame.display.set_caption('Ближе-дальше')
FPS = 60
WIDTH = 800
HEIGHT = 600
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
GRAY = (125, 125, 125)
LIGHT_BLUE = (64, 128,... | Handsomeneness/DiplomGame | Diplom/Blizhe_Dalshe3.py | Blizhe_Dalshe3.py | py | 6,102 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.join",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 6... |
72854325118 | #!/usr/bin/env python3
import pandas as pd
from collections import namedtuple, Counter
import os
from invoke import run
import os.path
import tempfile
from io import StringIO
from bs4 import BeautifulSoup
class AssemblySide(object):
Top = 0
Bottom = 1
Both = 2
AssemblyPosition = namedtuple("AssemblyPo... | ulikoehler/KiCAD-ProcessAutomation | KiCADIO.py | KiCADIO.py | py | 8,704 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "collections.namedtuple",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_table",
"line_number": 134,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 138,
"usage_type": "call"
},
{
"api_name": "os.... |
39854184521 | import re
from collections import namedtuple
from dataclasses import dataclass
from os import linesep
blueprint_pattern = re.compile(
r"Blueprint (\d+): "
+ r"Each ore robot costs (\d+) ore. "
+ r"Each clay robot costs (\d+) ore. "
+ r"Each obsidian robot costs (\d+) ore and (\d+) clay. "
+ r"Each ... | KrLiam/advent-of-code | advent_of_code/2022/day_19.py | day_19.py | py | 3,897 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "re.compile",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 15,
"usage_type": "call"
}
] |
37273000408 | import logging
import boto3
from app import settings
from app.exceptions.upload_file import S3SendFileException
class S3Service:
def __init__(self, bucket_name, aws_access_key_id, aws_secret_access_key):
self._bucket_name = bucket_name
self._aws_access_key_id = aws_access_key_id
self._aw... | EryginaS/spenxy_test | app/external/service/s3.py | s3.py | py | 1,033 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "boto3.client",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "app.exceptions.upload_file.S3SendFileException",
"line_number": 24,
"usage_type": "call"
},
{
"api_nam... |
3929804839 | import cv2
from matplotlib import pyplot as plt
# Download files from https://drive.google.com/file/d/1XdZLvORnCnfpyBYflh15I58VQrQdVlUe/view?usp=sharing
h_skin_hist = 0
h_nonskin_hist = 0
s_skin_hist = 0
s_nonskin_hist = 0
for im_id in range(1, 4):
print(im_id)
im = cv2.imread("SkinDetection\SkinTr... | neokarn/computer_vision | example3_5_color_histogram.py | example3_5_color_histogram.py | py | 1,351 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_numb... |
13399358042 | import torch
from torch.nn import Module, Embedding, Linear, MultiheadAttention, LayerNorm, Dropout
from pykt.models.utils import transformer_FFN, pos_encode, ut_mask, get_clones
from torch.nn.functional import binary_cross_entropy
class SAKT(Module):
def __init__(self, num_c, num_q, seq_len, emb_size, num_attn_... | lucky7-code/CORE | model/SAKT/sakt.py | sakt.py | py | 4,183 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "torch.nn.Embeddi... |
10844543951 | import os
import unittest
import logging
import csv
import io
from unittest.mock import patch
from nose.tools import raises
import snakemakelib.bio.ngs.targets
from snakemakelib.bio.ngs.targets import generic_target_generator
from snakemakelib.bio.ngs.regexp import ReadGroup
logger = logging.getLogger(__name__)
class... | percyfal/snakemakelib | snakemakelib/bio/ngs/tests/test_targets.py | test_targets.py | py | 3,738 | python | en | code | 22 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "snakemakelib.bio.ngs.targets.generic_target_generator",
"line_number": 18,
"usage_type": "call"
... |
22006330377 | import pysolr
import py2neo
from py2neo import Graph, Node, Relationship, NodeSelector
g = Graph('http://neo4j.csse.rose-hulman.edu:7474/db/data', user='neo4j', password='TrottaSucks')
selector = NodeSelector(g)
class Beer:
def __init__(self, beer_id, name, brewery, brewery_id, style_id, style, abv, ibu, categor... | cbudo/beer_base | beer.py | beer.py | py | 2,492 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "py2neo.Graph",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "py2neo.NodeSelector",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pysolr.Solr",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pysolr.Solr",
"line_nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.