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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72014798908 | from .Datasets import Dataset
import numpy as np
import glob
import os
import pandas as pd
from sklearn.model_selection import LeaveOneOut
from sklearn.preprocessing import OneHotEncoder, LabelEncoder
from enum import Enum
class SignalsNonSense(Enum):
acc_foot_X = 0
acc_foot_Y = 1
acc_foot_Z = 2
acc_w... | jesimonbarreto/SensorsDataset | frankDataset/Dataset/Nonsense19.py | Nonsense19.py | py | 2,205 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "Datasets.Dataset",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "glob.glob",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number":... |
18547223341 | from PIL import Image, ImageDraw, ImageFont
from sys import argv
# this program takes a spritemap with a one-pixel border around each cell, and changes the border color to be the same color as the "actual border"
# useful for avoiding bleeding
if len(argv) != 6:
print("Usage: python3 border.py path/to/image.png ce... | Tsirup/Tsirup-cs50-final-project | border.py | border.py | py | 996 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 10,... |
71844652989 | from django.views.generic import UpdateView as BaseUpdateView
from django.views.generic import View
from viewpack.enums import PackViews
from viewpack.mixins import InlineMixin
from .base import get_base_view
class UpdateMixin:
name = PackViews.UPDATE
def get_success_url(self):
self.success_url = s... | dbsiavichay/faclab | viewpack/views/update.py | update.py | py | 984 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "viewpack.enums.PackViews.UPDATE",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "viewpack.enums.PackViews",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.views.generic.View",
"line_number": 19,
"usage_type": "name"
},
... |
10835964358 | """small script to save the pose of an aruco marker to a pickle file for later use.
"""
import pickle
from pathlib import Path
import cv2
from camera_toolkit.aruco_pose import get_aruco_marker_poses
from camera_toolkit.zed2i import Zed2i
Zed2i.list_camera_serial_numbers()
zed = Zed2i()
img = zed.get_mono_rgb_image()... | tlpss/workshop-icra-2022-cloth-keypoints | robot/marker_pose_to_pickle.py | marker_pose_to_pickle.py | py | 699 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "camera_toolkit.zed2i.Zed2i.list_camera_serial_numbers",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "camera_toolkit.zed2i.Zed2i",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "camera_toolkit.zed2i.Zed2i",
"line_number": 12,
"usage_t... |
15059713700 | from django.core.exceptions import ValidationError
from rest_framework.authentication import SessionAuthentication
from rest_framework.exceptions import NotFound
from rest_framework.generics import (
GenericAPIView,
ListCreateAPIView,
RetrieveAPIView,
get_object_or_404,
)
from rest_framework.pagination ... | terrorizer1980/openwisp-controller | openwisp_controller/connection/api/views.py | views.py | py | 2,470 | python | en | code | null | github-code | 6 | [
{
"api_name": "swapper.load_model",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "swapper.load_model",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "rest_framework.pagination.PageNumberPagination",
"line_number": 21,
"usage_type": "name"
},
{
... |
6412246026 | #======================================================================================
# Реализуйте алгоритм нахождения(генерации) рандомного(случайного) числа.
# (Не используя библиотеки связанные с рандомом)
#======================================================================================
import datetime
date... | screwupug/Python_GeekBrains | Sem2/sem2_homework5.py | sem2_homework5.py | py | 551 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "attribute"
}
] |
25230071037 | import numpy as np
import pandas as pd
import requests as r
import xlsxwriter as x
import math, datetime, json
from calculator import material, BaseConverter, GeneralConverter
from finance import get_stock_data, get_stock_info, get_current_price
from apitk import IEX_CLOUD_API_TOKEN
from flask import Flask, render_te... | meierms1/wp | app.py | app.py | py | 15,861 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask_mail.Mail",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "flask_login.L... |
6398828261 | #%%
from datetime import timedelta
from os import makedirs
from os.path import basename, dirname, exists, join
from time import time
from warnings import catch_warnings, simplefilter
import numpy as np
import pandas as pd
import seaborn as sns
from joblib import dump, load
from matplotlib import gridspec
from matplotl... | dunnkers/bsc-thesis | src/analyze.py | analyze.py | py | 5,201 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "time.time",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.roc_auc_score",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.roc_curve",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "tim... |
12928418523 | __author__ = 'ryanvade'
import sys
import serial
import time
import threading
# try:
# import RPi.GPIO as GPIO
# except ImportError as e:
# print(e)
# sys.exit(1)
class BaseSerial:
constant_communication = False
def __init__(self, port, baud_rate):
self.__port = port
self.__bau... | ryanvade/robotproject | serialCommunication.py | serialCommunication.py | py | 3,544 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "serial.Serial",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "serial.SerialException",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "serial.SerialTimeo... |
8350546930 | import os
import h5py
from time import time
import numpy as np
from pandas import read_csv
import librosa
import logging
from .hparams import HParamsFromYAML
class Spectrogram():
'''
Stores the common parameters for log-mel, mfcc, or chroma spectrograms.
'''
def __init__(self, params):
'''
... | mishagli/audio_classification | src/features.py | features.py | py | 10,117 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "librosa.core.load",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "librosa.core",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "numpy.max",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_n... |
31234971485 | import sqlalchemy
engine = sqlalchemy.create_engine('postgresql://vomar:grs12345@localhost:5432/music_site')
engine
connection = engine.connect()
# 1. название и год выхода альбомов, вышедших в 2018 году
sel1 = connection.execute("""SELECT name_album, released FROM songwriters_albums
WHERE released = 2018;""").fetcha... | Vitaliy-O/DZ4 | DZ4-SELECT.py | DZ4-SELECT.py | py | 1,591 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 2,
"usage_type": "call"
}
] |
21998326553 | from nicegui import ui
from ..documentation_tools import text_demo
def main_demo() -> None:
select1 = ui.select([1, 2, 3], value=1)
select2 = ui.select({1: 'One', 2: 'Two', 3: 'Three'}).bind_value(select1, 'value')
def more() -> None:
@text_demo('Search-as-you-type', '''
You can activate `with_... | hp50tms/nicegui | website/more_documentation/select_documentation.py | select_documentation.py | py | 790 | python | en | code | null | github-code | 6 | [
{
"api_name": "nicegui.ui.select",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "nicegui.ui",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "nicegui.ui.select",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "nicegui.ui",
"line_nu... |
19580215666 | import pytest
from torch.nn import Tanh as _Tanh
from neuralpy.layers.activation_functions import Tanh
# Possible values
names = [False, 12, 3.6, -2]
@pytest.mark.parametrize("name", [name for name in names])
def test_relu_should_throw_value_error_Exception(name):
with pytest.raises(ValueError):
Tanh(na... | imdeepmind/NeuralPy | tests/neuralpy/layers/activation_functions/test_tanh.py | test_tanh.py | py | 835 | python | en | code | 78 | github-code | 6 | [
{
"api_name": "pytest.raises",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "neuralpy.layers.activation_functions.Tanh",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 10,
"usage_type": "call"
},
{
"a... |
26171716344 | #This is an example of a code I used for my transiting exoplanets project. This code makes pretty plots of my data!
import matplotlib.pyplot as plt
import numpy as np
import json
import datetime
import dateutil
import matplotlib.dates as mdates
import pandas as pd
timestamp_file = './rebin_timestamps.json'
photoresul... | winnkoster/Exoplanet-Example-Code | rebin_plotter_example.py | rebin_plotter_example.py | py | 2,130 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "dateutil.parser.parse",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dateutil.parser",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "json.load",
... |
72339881147 | import sqlite3
from sqlite3 import Cursor, Connection
DB_PATH = "Test.db"
class DbWrapper:
db_connection: Connection
db: Cursor
def __init__(self):
self.db_connection = sqlite3.connect(DB_PATH)
self.db = self.db_connection.cursor()
def __del__(self):
self.db_connection.clos... | cou723/dhu-class-review-site | db.py | db.py | py | 2,057 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.Connection",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sqlite3.Cursor",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sqlite3.connect",
"line_number": 13,
"usage_type": "call"
}
] |
42891150414 | # Imports
from __future__ import print_function
from httplib2 import Http
import os, time, base64, email
from apiclient import discovery
from oauth2client import file, client, tools
from oauth2client.file import Storage
from apiclient import errors
# Variables
SCOPES = 'https://www.googleapis.com/auth/gmail.modify'
s... | tylerhardy/email_alert | email_project.py | email_project.py | py | 4,867 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "oauth2client.file.Storage",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "oauth2client.file",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "oauth2client.client.flow_from_clientsecrets",
"line_number": 16,
"usage_type": "call"
},
... |
26529456641 | import discord
import json
import os
import command_handler
import level_handler
import archive_handler
import pythoncentral.common as common
# Load the responses from the JSON file
def run_bot(token):
# Initialize the Discord bot client
intents = discord.Intents.default()
intents.message_con... | Cosmicflamethrower/pythoncentral | DeathMetal64/bot.py | bot.py | py | 2,561 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.Intents.default",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "discord.Client",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pythoncen... |
14581794736 | import csv
import googlemaps
import json
import jsonpickle
from datetime import datetime
import time
import polyline
gmaps = googlemaps.Client(key='AIzaSyCLpq4hRY9QHGGMFV4jKDRO0oDDHSk6RrY')
region = '.us'
alternatives = False
try:
with open('Trips_Oct1_Less30_2.csv', 'rb') as csvfile:
spamreader = csv.read... | andresfchamorro/BikeshareTrips | python/QueryAndDecode.py | QueryAndDecode.py | py | 1,751 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "googlemaps.Client",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number"... |
10137594744 | '''
File name: /ciphers/block_ciphers/anu/keys.py
Author: Cesar Cruz
Project: cryptofeather
Python Version: 2.7
'''
import numpy
from constants import NUMBER_OF_ROUNDS, SBOX
from utils.others import get_fragment_int, int_to_bin, pretty_print
def key_schedule_128(key):
round_keys = []
for i in range(NUMB... | ccruz182/Lightweight-Cryptography | cryptofeather/ciphers/block_ciphers/anu/keys.py | keys.py | py | 1,059 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "constants.NUMBER_OF_ROUNDS",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "numpy.roll",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "utils.others.get_fragment_int",
"line_number": 31,
"usage_type": "call"
},
{
"api_name"... |
20426954988 | import os
import sys
from pathlib import Path
import PyQt5
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from HomeUI.HomePage import Ui_HomePage
from Feature.GUI import FeatureMergeForm, FeatureExtractionForm
from BC.GUI import PrepareConnection, ProcessConnection, VisualizationConnection
from VersionConst... | salan668/FAE | HomeUI/HomePageForm.py | HomePageForm.py | py | 5,210 | python | en | code | 121 | github-code | 6 | [
{
"api_name": "HomeUI.HomePage.Ui_HomePage",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "VersionConstant.VERSION",
"line_number": 25,
"usage_type": "argument"
},
{
"api_name": "Feature.GUI.FeatureExtractionForm",
"line_number": 27,
"usage_type": "call"
},
... |
27773519840 | import asyncio
import math
import os
import time
import shutil
from datetime import datetime
from pySmartDL import SmartDL
from telepyrobot.setclient import TelePyroBot
from pyrogram import filters, errors
from pyrogram.types import Message
import json
import logging
import re
import urllib.parse
from random import cho... | Divkix/TelePyroBot | telepyrobot/plugins/download_upload.py | download_upload.py | py | 8,507 | python | en | code | 40 | github-code | 6 | [
{
"api_name": "os.path.basename",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "telepyrobot.COMMAND_HAND_LER",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "telepyrobo... |
39555531537 | import collections
def parse(dic_lote):
#merge
merged_dict = dic_lote# default_header_arquivo().update( dic_header )
header_str = '{:0>3.3}{:0>4.4}{:0>1.1}{:0>5.5}{:<1.1}{:<1.1}{:<2.2}{:<3.3}{:<3.3}{:0>5.5}{:<1.1}{:0>12.12}{:<1.1}{:<1.1}{:<30.30}{:<20.20}{:<8.8}{:<3.3}{:0>15.15}{:0>15.15}{:<20.20}{:... | thiagosantos/bradesco-cnab240 | cnab240/core/segmento_a.py | segmento_a.py | py | 2,504 | python | pt | code | 16 | github-code | 6 | [
{
"api_name": "collections.OrderedDict",
"line_number": 13,
"usage_type": "call"
}
] |
9540745565 | from django import forms
from django.forms import fields
from .models import Image
class ImageForm(forms.ModelForm):
class Meta:
model = Image
fields = ['photo']
# widgets = {
# 'myfield': forms.TextInput(attrs={'class': 'myfieldclass'}),
# }
def __init__(self, *args... | 01anuraganand/CVBN | core/forms.py | forms.py | py | 509 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Image",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.field... |
37735776172 | import os
import sys
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from utils.model import Model
from utils.profiler import TimeEvaluator
class Blocks(nn.Module):
def __init__(self, input_dim, hidden_u... | yixunzhang/qbench | models/dnn.py | dnn.py | py | 6,613 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
160575686 | import json
import requests
from requests.structures import CaseInsensitiveDict
def mail(id=0, number=0, text=''):
url = "https://probe.fbrq.cloud/v1/send/0"
headers = CaseInsensitiveDict()
headers["Accept"] = "application/json"
headers[
"Authorization"] = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6... | Sthdire/task_P | probe_server_form.py | probe_server_form.py | py | 661 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "requests.structures.CaseInsensitiveDict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 18,
"usage_type": "call"
}
] |
30596970672 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn import preprocessing
class Airfoil:
theta = []
def cal_cost(self, theta, X, y):
m = len(y)
predictions = X.dot(theta)
cost = (1/2*m) * np.sum(np.square(predictions-y))
return cost
... | PJain2000/SMAI-Assignment2 | q3.py | q3.py | py | 1,907 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.sum",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.square",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 1... |
10373768674 | # Given an array of integers, find the first missing positive integer in linear time and constant space. In other words, find the lowest positive integer that does not exist in the array. The array can contain duplicates and negative numbers as well.
# For example, the input [3, 4, -1, 1] should give 2. The input [1, ... | marianosimone/interviewed | dailycodingproblem/problems/20180721.py | 20180721.py | py | 1,176 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 30,
"usage_type": "attribute"
}
] |
25884160607 | import os
import time
import uuid
from .. import log
from .. import util
from .. import file
from . import client
from ..exception import NoSuchS3File
from boto3.exceptions import S3UploadFailedError
from botocore.exceptions import ClientError
def create_client():
return client.create_client('s3')
def create_re... | anne-chow/python-helpers | helpers/aws/s3.py | s3.py | py | 24,722 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.basename",
"line_number": 288,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 288,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 290,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
542991397 | # import modules
from tkinter import *
from tkinter import messagebox, ttk
import mysql.connector
from datetime import date
def connect_db():
global conn
global c
# connecting to mysql db
conn = mysql.connector.connect(user = 'root', password = 'gevindu1', host = 'localhost', database = 'lms'... | GevinduGanganath/Library-Management | LMS (Version 1.0.01).py | LMS (Version 1.0.01).py | py | 17,994 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mysql.connector.connector.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mysql.connector.connector",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector",
"line_number": 11,
"usage_type": "name"
},
{
"... |
19490514880 | from __future__ import annotations
from typing import Any, Dict, List, Optional
import torch
from transformers import (
AutoConfig,
AutoModelWithLMHead,
AutoTokenizer,
GPT2Model,
GPT2Tokenizer,
PreTrainedModel,
PreTrainedTokenizer,
)
from mario_gpt.lm.base import BaseMarioLM
from mario_gp... | shyamsn97/mario-gpt | mario_gpt/lm/gpt.py | gpt.py | py | 3,124 | python | en | code | 1,041 | github-code | 6 | [
{
"api_name": "mario_gpt.lm.base.BaseMarioLM",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "transformers.PreTrainedModel",
"line_number": 32,
"usage_type": "name"
},
{
"api_na... |
37676337883 | from django.db.models.signals import pre_delete
from django.dispatch import receiver
from .models import SwimTime,PersonalBest
@receiver(pre_delete, sender=SwimTime)
def update_personal_best_on_delete(sender, instance, **kwargs):
try:
# Retrieve the personal best time for the given swim time
p... | rglackin/SwimHub | home/signals.py | signals.py | py | 1,298 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.PersonalBest.objects.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.PersonalBest.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.PersonalBest",
"line_number": 10,
"usage_type": "name"
},
{
... |
13226591687 | def Newton_basic(f, dfdx, x, eps=1E-7):
n = 0 # iteration counter
while abs(f(x)) > eps:
x = x - f(x)/dfdx(x)
n += 1
return x, f(x), n
def test_Newton_basic_precomputed():
from math import sin, cos, pi
def f(x):
return sin(x)
def dfdx(x):
return cos(x)
x_... | hplgit/scipro-primer | src-4th/tech/eq_solver.py | eq_solver.py | py | 3,956 | python | en | code | 181 | github-code | 6 | [
{
"api_name": "math.sin",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "math.tanh",
"line_number": 82,
"usa... |
31282525308 | from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from .forum import Forum
import secrets
from django.conf import settings
SETTINGS_USERS = settings.SETTINGS_USERS
Permissions = SETTINGS_USERS['Permissions']
class Category(models.Model):
regular_code = 0
... | smichaelshal/Forum | backend/drf/forum/models/category.py | category.py | py | 1,648 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.settings.SETTINGS_USERS",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.models.Model",
"line_number": 13,
"usage_type": "attribute"
},
... |
20554256545 | from pytorch_lightning import Trainer, seed_everything
from project.lit_mnist import LitClassifier
from project.lit_mnist import LitMNISTDataModule
def test_lit_classifier():
seed_everything(1234)
model = LitClassifier()
mnist = LitMNISTDataModule(data_dir="", batch_size=32)
trainer = Trainer(limit_... | 21jun/deep-learning-project-template | tests/test_classifier.py | test_classifier.py | py | 491 | python | en | code | null | github-code | 6 | [
{
"api_name": "pytorch_lightning.seed_everything",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "project.lit_mnist.LitClassifier",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "project.lit_mnist.LitMNISTDataModule",
"line_number": 10,
"usage_type": "... |
30092689820 | import re
from datetime import datetime
from event import Event
def main():
events = []
with open("input.txt") as file:
events_input = file.readlines()
for event_input in events_input:
split_claim = re.split('\[|\] ', event_input.strip())
event = Event(split_claim[1], s... | chrisalex2/adventOfCode2018 | 4-december/repose_record.py | repose_record.py | py | 1,950 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re.split",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "event.Event",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
11120813837 | import inspect
import typing as tp
from librarius.adapters import orm, redis_eventpublisher
from librarius.adapters.notifications import MemoryNotification
from librarius.service import handlers, message_bus, uow as uow_package
if tp.TYPE_CHECKING:
from librarius.service import AbstractUnitOfWork
from librariu... | adriangabura/vega | librarius/bootstrap.py | bootstrap.py | py | 2,583 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "typing.Type",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "inspect.signature",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "typing.Un... |
73652421949 | # 给你一个正整数数组 skill ,数组长度为 偶数 n ,其中 skill[i] 表示第 i 个玩家的技能点。将所有玩家分成 n / 2 个 2 人团队,使每一个团队的技能点之和 相等 。
# 团队的 化学反应 等于团队中玩家的技能点 乘积 。
# 返回所有团队的 化学反应 之和,如果无法使每个团队的技能点之和相等,则返回 -1 。
from collections import Counter
class Solution(object):
def dividePlayers(self, skill):
"""
:type skill: List[int]
:r... | xxxxlc/leetcode | competition/单周赛/322/dividePlayers.py | dividePlayers.py | py | 1,141 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 22,
"usage_type": "call"
}
] |
3705210251 | import angr
import claripy
import sys
from pwn import *
import logging
HOOK_ADDR = 0x4014bb
logging.getLogger('angr').setLevel(logging.CRITICAL)
logging.getLogger('pwnlib').setLevel(logging.CRITICAL)
def hook_access_func(state):
f = open('token.txt', 'r')
t = int(f.readline())
f.close()
print("[+] ... | tj-oconnor/spaceheroes_ctf | pwn/pwn-sat/solve/pwn-satisfy.py | pwn-satisfy.py | py | 2,261 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.CRITICAL",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.CRITI... |
43600107874 | import logging
import os
import sys
import coloredlogs
import sentry_sdk
from sentry_sdk.integrations.logging import LoggingIntegration
from bot import constants
def setup() -> None:
"""Set up loggers."""
format_string = "%(asctime)s | %(name)s | %(levelname)s | %(message)s"
root_log = logging.getLogger... | HassanAbouelela/evalbot | bot/log.py | log.py | py | 2,622 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "coloredlogs.DEFAULT_LEVEL_STYLES",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name"... |
34032248684 | """Module with active learning functions
"""
import pandas as pd
import numpy as np
import sys
import os
import collections
from numpy.core.defchararray import lower
from collections import defaultdict
from collections import Counter
class Active_learning:
def __init__(self, rule_value, weight):
... | dbguilherme/testing_blocking | lib/active_learning.py | active_learning.py | py | 10,542 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.maxsize",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "collections.defaul... |
39830532924 | from collections import deque
def solution(alp, cop, problems):
# 목표 알고력과 코딩력
max_alp = max([p[0] for p in problems])
max_cop = max([p[1] for p in problems])
# 초기 값에서 부터의 최단거리
dp = [[float('inf')] * (max_cop + 1) for _ in range(max_alp + 1)]
#초기 알고력과 코딩력이 목표 알고력과 코딩력 보다 크면 초기 알고력과 코딩력을 목표 알고... | omg7152/CodingTestPractice | kakaoTechInternship2022/Q3.py | Q3.py | py | 1,747 | python | ko | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 16,
"usage_type": "call"
}
] |
26266450027 | import yaml
import pathlib
from config.scene import Scene, scene_description
from motion_control.soads import SoadsController
from motion_control.tunnel_mpc import TunnelMpcController
from motion_control.tunnel_mpc_convergence import TunnelMpcController as TunnelMpcControllerConvergence
from robot import Unicycle, Omni... | albindgit/starworld_tunnel_mpc | config/load_config.py | load_config.py | py | 4,053 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "config.scene.scene_description.items",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "config.scene.scene_description",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "config.scene.Scene",
"line_number": 18,
"usage_type": "call"
},
{... |
15534549697 | '''
example for enums in python
'''
from enum import Enum,auto
class Color(Enum):
RED = 1
GREEN = 2
BLUE = 3
class Color2(Enum):
RED = auto()
GREEN = auto()
BLUE = auto()
class Color3(Enum):
RED,GREEN,BLUE = range(3)
class Color4(Enum):
RED = 'red'
GREEN = 'gr... | mal1kc/learnin_area | python/enums_ex.py | enums_ex.py | py | 811 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 13,
"... |
34049779420 | import http.client as httplib
def check_internet_connection():
connection = httplib.HTTPConnection("www.google.com", timeout=5)
try:
# only header requested for fast operation
connection.request("HEAD", "/")
connection.close() # connection closed
print("Internet On")
r... | AbdelrahmanElayashy/ovest | ovest/emergencyHandler/internet.py | internet.py | py | 403 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "http.client.HTTPConnection",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "http.client",
"line_number": 5,
"usage_type": "name"
}
] |
35259693045 | from webshop.celery import app
from django.core.mail import send_mail
from orders.models import Order
@app.task
def order_created(order_id):
"""
Task to send an e-mail notification when an order is
successfully created.
"""
order = Order.objects.get(id=order_id)
subject = f"VitaKing · Budaörs ... | csabimvp/vitaking | webshop/orders/tasks.py | tasks.py | py | 636 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "orders.models.Order.objects.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "orders.models.Order.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "orders.models.Order",
"line_number": 12,
"usage_type": "name"
},
{
... |
23084021246 | from pyrfuniverse.envs.gym_goal_wrapper_env import RFUniverseGymGoalWrapper
# from pyrfuniverse.utils import RFUniverseController
import numpy as np
from gym import spaces
from gym.utils import seeding
import copy
class FrankaClothFoldEnv(RFUniverseGymGoalWrapper):
metadata = {"render.modes": ["human"]}
heig... | mvig-robotflow/pyrfuniverse | pyrfuniverse/envs/robotics/franka_cloth_fold_env.py | franka_cloth_fold_env.py | py | 7,849 | python | en | code | 39 | github-code | 6 | [
{
"api_name": "pyrfuniverse.envs.gym_goal_wrapper_env.RFUniverseGymGoalWrapper",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 35,
"usage_type": "call"
},
... |
36491807194 | from collections import defaultdict
N = int(input("Maximum Pay: "))
M = int(input("Number of employees: "))
"""
Approach the problem as if it was a lattice path problem on:
-------------------------------------------------------- N
| |
| |
| |
| ... | sslavnic/problems | HashCodePayOrdering/solution.py | solution.py | py | 2,473 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 46,
"usage_type": "call"
}
] |
16243536977 | from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from twilio.rest import Client
from time import sleep
twilio_sid = "AC39f1e47ce52ba8a7dd3d8338a6f0cf04"
auth_token = "5739009e86c871617ba74a581d3c345e"
EXECUTABLE_PATH = "C:\\Python38\\geckodriver.exe"
#Testing
# options = Options()
... | DhyeyaDesai/WhatsappBot | gigbot.py | gigbot.py | py | 1,996 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.firefox.options.Options",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 17,
"usage_type": "name"
},
... |
5035643907 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('sitios', '0008_auto_20160808_2117'),
]
operations = [
migrations.AddField(
model_name='sitio',
name=... | DirectorioTurismoComercio/BackEnd | sitios/migrations/0009_sitio_tipo_sitio.py | 0009_sitio_tipo_sitio.py | py | 532 | 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.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
74474114109 | # -*- coding: utf-8 -*-
import nltk
from nltk.stem import WordNetLemmatizer
from nltk.corpus import stopwords
from nltk.tokenize import RegexpTokenizer
from gensim import corpora, models
import numpy as np
import sys
import json
# 求出每一个词出现的词频
def cipin(topicc):
datafirst = []
for i in range(0,... | yzy-zz/project1 | project1/src/nodee/fenci.py | fenci.py | py | 4,098 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 65,
"usage_type": "attribute"
},
{
"api_name": "nltk.tokenize.RegexpTokenizer",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "nltk.stem.WordNetLemmatizer",
"line_number": 90,
"usage_type": "call"
},
{
"api_name"... |
3655786771 | from robobrowser import RoboBrowser
import pandas as pd
import time
import re; re._pattern_type = re.Pattern # Workaround for a bug in robobrowser and Python 3.7
from config import *
browser = RoboBrowser(history=True)
bets = [] # Log of bet results to be exported to csv
def log_in():
global browser... | armasog/Hexrpg_Bot | gambling.py | gambling.py | py | 1,968 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "re._pattern_type",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "re.Pattern",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "robobrowser.RoboBrowser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.search"... |
23505296880 | from django.conf import settings
from django.core.handlers.wsgi import WSGIHandler
from django.http import HttpResponse
from django.urls import path
settings.configure(
ROOT_URLCONF=__name__,
)
def hello_world(request):
return HttpResponse(request.headers.get('foo'))
urlpatterns = [
path("", hello_world... | lewisdbentley/django-microframework | spa/hello_django.py | hello_django.py | py | 460 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.conf.settings.configure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.settings",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponse",
"line_number": 12,
"usage_type": "call"
},
{
"api_na... |
31378076727 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import sys
from pylab import rcParams
def parsexydata(fdata):
keys=[]
xy=[]
with open(fdata,'r') as f:
pre=''
for idx, i in enumerate(f.read().replace('\n','').split(',')[2:]):
if idx%2==0:
pre=i
continue
tmp = pre.split('.')
... | ctfs/write-ups-2015 | volgactf-quals-2015/stego/strange-text/plotit.py | plotit.py | py | 874 | python | en | code | 1,969 | github-code | 6 | [
{
"api_name": "pylab.rcParams",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyp... |
35695898016 | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 15 15:09:44 2021
@author: camar
"""
import sys
if '..' not in sys.path:
sys.path.append('..')
from src import wallet
# https://semaphoreci.com/community/tutorials/testing-python-applications-with-pytest
# combine pytest fixtures and parametrized test functions
impo... | francisco-camargo/cloud_dev | tests/test_wallet_b.py | test_wallet_b.py | py | 790 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "src.wallet.Wallet",
"l... |
2856057908 | import unittest
import os
from conans.test.tools import TestClient, TestBufferConanOutput
from conans.test.utils.test_files import hello_source_files
from conans.client.manager import CONANFILE
from conans.model.ref import ConanFileReference, PackageReference
import shutil
from conans.paths import CONANINFO
from conans... | AversivePlusPlus/AversivePlusPlus | tools/conan/conans/test/create_package_test.py | create_package_test.py | py | 5,569 | python | en | code | 31 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "conans.test.tools.TestClient",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "conans.test.utils.test_files.hello_source_files",
"line_number": 48,
"usage_type": "c... |
35835054406 | from utils import BasicError
from time import sleep
class SymbolTable():
def __init__(self, parent=None):
self.symbols = dict()
self.parent = parent
def get_var(self, name):
val = self.symbols.get(name)
if val is None and self.parent:
val = self.parent.get_var(name... | shaleen111/pyqb | interpreter.py | interpreter.py | py | 3,151 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "utils.BasicError",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "utils.BasicError",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "utils.BasicError",
"line_number": 82,
"usage_type": "call"
}
] |
28294497520 | from flask import Flask, render_template, request
import urllib.parse
import requests
app = Flask(__name__) # create an app instance
main_api = "https://api.teleport.org/api/" #API root
@app.route("/", methods=['GET', 'POST']) #Website root that handsles both GET and POST
def citystatus():
image... | alexfour/CityStatus | citystatus.py | citystatus.py | py | 3,009 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flask.request.form... |
27099613016 | import pandas as pd
import numpy as np
import datetime
import math
import os
import rews
import turbine
import warnings
from power_deviation_matrix import ResidualWindSpeedMatrix
from ..core.status import Status
warnings.simplefilter('ignore', np.RankWarning)
def getSeparatorValue(separator):
try:
retu... | PCWG/PCWG | pcwg/core/dataset.py | dataset.py | py | 47,326 | python | en | code | 23 | github-code | 6 | [
{
"api_name": "warnings.simplefilter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.RankWarning",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pandas.rolling_mean",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "pand... |
16021977697 | from pyproj import Proj, Transformer
import numpy as np
def lonlat_to_xy(coords_1, coords_2, hemisphere, inverse=False):
"""Converts between longitude/latitude and EASE xy coordinates.
Args:
lon (float): WGS84 longitude
lat (float): WGS84 latitude
hemisphere (string): 'n' or 's'
... | robbiemallett/custom_modules | ll_xy.py | ll_xy.py | py | 1,142 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "numpy.ndarray",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pyproj.Transformer.from_crs",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pyproj.Transformer",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "pyp... |
74851589628 | import json
# Save API response JSON to files for debugging.
class Files:
@staticmethod
def save_as_json(data, filename):
"""Save data to a json file with preferred name.
Params:
data: the json data to write
filename: desired name for the file (ex. data.json)
... | Max-Valek/songs-python | dataManager/files.py | files.py | py | 413 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dump",
"line_number": 16,
"usage_type": "call"
}
] |
45636623483 | from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.firefox import GeckoDriverManager
class DriverFactory():
@staticmethod
def get_driver(browser):
if browser == "chrome":
options = webdriver.ChromeOptions()
options.... | mcwilk/Selenium_automation | utils/driver_factory.py | driver_factory.py | py | 868 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 16,
"usage_type": "call"
},
{
"api... |
8399599148 | #!/usr/bin/env python3
#IMPORTING LIBRARIES
import numpy as np
import matplotlib.pyplot as plt
from xlrd import open_workbook
from xlutils.copy import copy
from email.mime.multipart import MIMEMultipart
from email.mime.image import MIMEImage
from email.mime.text import MIMEText
import os
import tim... | priyankmakwana88/Attendance_Management_openCV | graph_report.py | graph_report.py | py | 4,114 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "email.mime.multipart.MIMEMultipart",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "xlutils.copy.copy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name"... |
26112891310 | print('Bot is Starting.....')
import asyncio
import functools
import itertools
import math
import random
import os
import discord
from discord.ext import commands, tasks
import requests
from requests import get
import json
from async_timeout import timeout
import urllib.request
import re
import datetime
from datetime i... | Tomoghna/ROck | main.py | main.py | py | 170,108 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.when_mentioned_or",
"line_number": 48,
"usage_type": "call"
},
... |
43104228005 | # + tags=["hide_inp"]
from chalk.core import BaseDiagram
from chalk import *
def help(f):
import pydoc
from IPython.display import HTML
return HTML(pydoc.HTMLDoc().docroutine(f))
# -
# Diagrams can be styled using standard vector graphic style
# primitives. Colors use the Python [colour](https://github.c... | chalk-diagrams/chalk | docs/api/style.py | style.py | py | 1,153 | python | en | code | 230 | github-code | 6 | [
{
"api_name": "IPython.display.HTML",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pydoc.HTMLDoc",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "colour.Color",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "colour.Color",
"lin... |
3486101687 | ###########################################################################
# Person Pose Class
###########################################################################
# Google Pose Detection
# https://google.github.io/mediapipe/solutions/pose
# https://paperswithcode.com/paper/blazepose-on-device-real-time-bo... | uutzinger/NCNN_python | blazepersonpose.py | blazepersonpose.py | py | 10,952 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.exp",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "ncnn.Net",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "ncnn.set_cpu_powersave",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "ncnn.set_omp_num_threads"... |
44376797014 | import gymnasium as gym
import numpy as np
from collections import namedtuple
from torch import nn
from torch import optim
import torch
HIDDEN_SIZE = 128
BATCH_SIZE = 100
PERCENTILE = 30
GAMMA = 0.9
class DiscreteOneHotWrapper(gym.ObservationWrapper):
def __init__(self, env):
super().__init__(env)
... | anyinlover/LearnML | learnRL/hands_on_drl/chap4/frozenlake.py | frozenlake.py | py | 3,585 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gymnasium.ObservationWrapper",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "gymnasium.spaces.Box",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "gymnasium.spaces",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_... |
15364391063 |
import itertools, collections, random
import os,glob
from pprint import pprint
import sqlite3
class DevilFusionSystem:
devils = [] # リストにはDevilクラスのオブジェクトが格納される
devils_set = set(devils)
combinations = [] # 悪魔合体可能な組み合わせと合体方法を格納したリスト
results_dict = dict() # 悪魔リストから合体生成が可能な悪魔のリスト
dbpath = os.pa... | idylle-cynique/extensional_smt1_devilcomp | devilsfusionsystem.py | devilsfusionsystem.py | py | 58,238 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "itertools.combinations"... |
40874521972 | from nltk import Tree
from typing import List, Tuple, Callable
from itertools import product
def convert_to_tree(seq: List[int]) -> Tree:
last_tree = None
while len(seq) >= 1:
if last_tree is None:
curr_suffix = [Tree(s, []) for s in seq[-2:]]
seq = seq[:-2]
last_t... | dolavn/CFGLearner | TreeGenerator.py | TreeGenerator.py | py | 1,911 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "nltk.Tree",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nltk.Tree",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "nltk.Tree",
"line_number": 15,
... |
34086904155 | from influxdb import InfluxDBClient
import COVID19Py
covid19 = COVID19Py.COVID19()
locations = covid19.getLocations()
for location in locations:
for status, cases in location['latest'].items():
influx_payload = [
{
"measurement": status,
"tags": {
... | mrtrotl/covid19 | latest.py | latest.py | py | 752 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "COVID19Py.COVID19",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "influxdb.InfluxDBClient",
"line_number": 25,
"usage_type": "call"
}
] |
31452974396 | import tkinter as tk
from tkinter import messagebox
import json
import random
import Gallows
class Hangman:
"""
A class of functions that fulfil the rules of a Hangman game
"""
def __init__(self, master):
self.master = master
with open("words.json", 'r') as file:
self.word_l... | nnasa14/hangman-game | Hangman.py | Hangman.py | py | 6,308 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tkinter.Canvas",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_num... |
70337571389 | #!/usr/bin/env python3
"""Train a classification model."""
import math
import copy
import numpy as np
import pprint
import torch
import torch.nn as nn
import torch.nn.functional as F
import slowfast.models.losses as losses
import slowfast.models.optimizer as optim
import slowfast.utils.checkpoint as cu
import slowfast... | alimottaghi/slowfast | tools/mme.py | mme.py | py | 13,227 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "slowfast.utils.logging.get_logger",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "slowfast.utils.logging",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "slowfast.models.losses.get_loss_func",
"line_number": 32,
"usage_type": "call"
... |
21831656849 | import distutils
import os
import subprocess
import sys
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
extensions = [
Extension("socr.line.codecs.baseline_decoder", ["socr/line/codecs/baseline_decoder.pyx"]),
... | lizabelos/socr | setup.py | setup.py | py | 2,516 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "distutils.extension.Extension",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "distutils.extension.Extension",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "distutils.extension.Extension",
"line_number": 14,
"usage_type": "call"
},
... |
73021867708 | from django.contrib import admin
from APP.models.Test import Test
admin.site.site_header = "Test"
admin.site.index_title = "Test"
admin.site.site_title = "Test"
class TestAdmin(admin.ModelAdmin):
list_display = (
'testdata',
)
search_fields = ['testdata',]
admin.site.register(Test, TestAdmin) | amirdharaja/test | APP/admin.py | admin.py | py | 318 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.site",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 7,
"usage_type": "attribute"
},
{
"a... |
73051110268 | from time import sleep
import gpiozero
led1 = gpiozero.LED(17)
led2 = gpiozero.LED(27)
sw1 = gpiozero.Button(3)
sw2 = gpiozero.Button(4)
while True :
if sw1.is_pressed:
led1.off()
else :
led1.on()
print("Sw1 Pressed")
if sw2.is_pressed:
led2.off()
else:
... | dasfef/Chungbuk_Univ_RaspberryPi | day05/SW_LED_Module2.py | SW_LED_Module2.py | py | 372 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "gpiozero.LED",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "gpiozero.LED",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "gpiozero.Button",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "gpiozero.Button",
"line_nu... |
2026814229 | import requests
from bs4 import BeautifulSoup
# 获取歌曲页面的 HTML
url = 'https://music.163.com/song?id=1398663417'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
}
response = requests.get(url, headers=headers)
# 解析 HTML
so... | Nienter/mypy | personal/wangyi.py | wangyi.py | py | 991 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
}
] |
40334117002 | import os
import cv2
import numpy as np
from sklearn.cluster import KMeans
from tensorflow.keras.applications.vgg16 import VGG16, preprocess_input
from sklearn.metrics.pairwise import cosine_similarity
import pandas as pd
import pickle
# 图像文件夹路径
image_folder = "picture_spec_contour"
# 获取所有图像文件路径
image_paths = [os.pat... | hetonghui02/cluster | notebooks/clustering.py | clustering.py | py | 5,805 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_numbe... |
18100868994 | """
https://leetcode.com/problems/insert-interval/description/
57. Insert Interval
You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and intervals is sorted in ascending order by starti. You are also given an interval n... | hirotake111/leetcode_diary | leetcode/57/solution.py | solution.py | py | 1,761 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "bisect.bisect",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number"... |
7919867285 | # -*- coding: utf-8 -*-
# Author: Ztj
# Email: ztj1993@gmail.com
import pymysql
from dbutils.pooled_db import PooledDB
from pymysql.connections import Connection
from pymysql.cursors import DictCursor
class MySQL(object):
def __init__(self, **kwargs):
self._pool = None
self._connec... | ztj1993/py-mysql | ZtjMySQL.py | ZtjMySQL.py | py | 2,441 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "dbutils.pooled_db.PooledDB",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors.DictCursor",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "dbutils.pooled_db.PooledDB",
"line_number": 18,
"usage_type": "name"
},
{
"... |
33195715178 | import torch
import torch.nn as nn
import torch.autograd as autograd
def dsm(energy_net: nn.Module, samples: torch.Tensor, sigma: int=1) -> torch.Tensor:
"""Compute denoising score matching for a given energy network, samples and sigma pertubation."""
samples.requires_grad_(True)
vector = torch.randn_li... | PeDiot/tabular-sbgm | src/loss/dsm.py | dsm.py | py | 2,010 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.randn_like",
"... |
34571997121 | from flask.json import jsonify as flask_jsonify
from datetime import datetime, timedelta
MAX_REQUESTS_PER_MINUTE = 5
request_count = 0
last_request_time = datetime.now()
def validate_prompt_data(data):
"""
Validates and serializes prompt data.
Parameters:
- data (dict): The JSON payload received in... | xuancuongdoo/StapleAi_test | helpers.py | helpers.py | py | 1,312 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask.json.jsonify",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
22342700406 | # This Python file uses the following encoding: utf-8
# 该文件是主程序
from PyQt5 import QtWidgets
from window import Ui_Window
from PyQt5.QtWidgets import QFileDialog
import pandas as pd
import cair_al
import cv2
class Server(QtWidgets.QWidget, Ui_Window):
def __init__(self):
super(Server, self).__i... | StevenSuo3537/-SeamCarving-SaliencyDetection- | Server.py | Server.py | py | 1,453 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "window.Ui_Window",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "PyQt5.Q... |
20648027187 | """Config admin.py."""
from django.contrib import admin
# Register your models here.
from algo.models import Product, ProductCategory
class ProductAdmin(admin.ModelAdmin):
"""Config admin."""
list_display = ('name',
'category',
'stock',
'selling_pri... | JoshParinussa/gudang_algo | algo/admin/product.py | product.py | py | 593 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 17,
"usage_type": "attribute"
... |
38403407271 | #!/usr/bin/env python3
import requests
from github3 import login
from config import *
token = config['auth_token']
gist_id = config['gist_id']
gist_filename = config['gist_filename']
gh = login(token=token)
gist = gh.gist(gist_id)
with open(gist_filename, 'r') as file:
content = file.read()
gist.edit("",{gist_fil... | cmtsij/xinmedia_bike_ical | gist_ical_push.py | gist_ical_push.py | py | 492 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "github3.login",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
}
] |
40791793663 | # display menu - done
# get input from the user - done
# implement the user selection - -DONE
#save /LOAD (Serializing/deSerializing) -DONE
import json
import os
my_file= "contacts.json"
contacts=[]
def display_menu():
print("a - add") # DONE
print("d - delete")
print("s - search")
pr... | AmirHauz/just_a_test | app.py | app.py | py | 1,909 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number":... |
15919295023 | # Embedded file name: toontown.uberdog.ClientServicesManager
from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal
from direct.directnotify.DirectNotifyGlobal import directNotify
from otp.distributed.PotentialAvatar import PotentialAvatar
from otp.otpbase import OTPLocalizer, OTPGlobals
from ot... | RegDogg/Toontown-Offline-cv.2.5.0-SRC | toontown/uberdog/ClientServicesManager.py | ClientServicesManager.py | py | 3,785 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "direct.distributed.DistributedObjectGlobal.DistributedObjectGlobal",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "direct.directnotify.DirectNotifyGlobal.directNotify.newCategory",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "direct.directno... |
42701801269 | #!/usr/bin/python
#$Id$
import numpy as np
import importlib
def makeNorm(confFile):
conf = importlib.import_module(confFile)
f = open(conf.dataFile, 'r')
f.readline() #sentinal line
header = f.readline()
column = header.split('\t')
solventBL = np.array(range(conf.solvI,conf.solvF,conf.interval)... | cmcfaul/smsls | smsls/normalization.py | normalization.py | py | 1,959 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "importlib.import_module",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"lin... |
43299513816 | from pathlib import Path
import pytest
from groovypy.runner import Runner
from groovypy.slurper import Slurper
TEST_DATA_PATH = Path(__file__) / ".." / "data"
@pytest.mark.parametrize(
"input_file",
[str(p) for p in Path(TEST_DATA_PATH).iterdir()],
)
def test_slurp_example(input_file):
Slurper().parse(... | MarkVerbeek91/groovypy | tests/test_component_level.py | test_component_level.py | py | 565 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "groovypy.slurper.Slurper",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.m... |
18875879396 | # coding=utf-8
import time
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium import webdriver
import os
# param
memberShipNo = "1234512345"
password = "P@ssw0rd"
startingPoint = "서울"
endingPoint = "강릉"
day: str = "4"
hour: str = "10"
month: str = "2... | blancgoat/ktx-lover | main.py | main.py | py | 2,929 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.CLASS_NAME",
"line_number": 49,
"usage_type": "attribute"
... |
9187301090 | import argparse
from trainer.train import *
from utils.inference.inference import *
import configparser
import json
import wandb
def _decode(o):
# Note the "unicode" part is only for python2
if isinstance(o, str):
try:
return float(o)
except ValueError:
return o
eli... | boostcampaitech5/level2_klue-nlp-04 | code/main.py | main.py | py | 2,249 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "wandb.sweep",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "wandb.agent",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "wandb.finish",
"line_number": 3... |
38588099983 | """
Dataloader for dummy data.
"""
# Author: Georgios Douzas <gdouzas@icloud.com>
# License: MIT
from datetime import datetime
import numpy as np
import pandas as pd
from sklearn.model_selection import ParameterGrid
from ._base import _BaseDataLoader
class DummySoccerDataLoader(_BaseDataLoader):
"""Dataloader... | thePegasusai/sports-betting | sportsbet/datasets/_dummy.py | _dummy.py | py | 10,713 | python | en | code | null | github-code | 6 | [
{
"api_name": "_base._BaseDataLoader",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pandas.Timestamp",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "datetime... |
7143014065 | from random import randint
from django.db import models
from django.dispatch import receiver
from faker import Faker
class EnemyType(models.Model):
"""
Enemy type model.
"""
name = models.CharField(max_length=255, default='Unnamed')
health = models.IntegerField(default=10)
class Enemy(models.M... | the-norns/norns | norns/enemy/models.py | models.py | py | 5,121 | python | en | code | 0 | github-code | 6 | [
{
"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": 13,
"usage_type": "call"
},
{
"api_name": ... |
17435556559 | import pytest
from typing import Optional
from collections import deque
"""
# Definition for a Node.
class Node:
def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = None, next: 'Node' = None):
self.val = val
self.left = left
self.right = right
self.next = next
"""... | naubull2/codingtests | leetcode/solved/116_Populating_Next_Right_Pointers_in_Each_Node/solution.py | solution.py | py | 1,043 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.deque",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pytest.ma... |
22569131109 | from flask import Flask
from flask_restful import Resource, Api, reqparse
from courseDB import get_course_offerings, get_course_titles
app = Flask(__name__)
api = Api(app)
class CourseTitles(Resource):
def get(self):
parser = reqparse.RequestParser()
parser.add_argument('quarter', required=True)
... | GusAlejandro/UCSB-COURSE-VIEWER | backend/courseApi.py | courseApi.py | py | 1,013 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_restful.Resource",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask_restful.reqpa... |
37591885383 | # -*- coding: utf-8 -*-
from google.auth.exceptions import DefaultCredentialsError
from google.cloud import storage
from helpers.constants import BUCKET
def store_results(arguments):
client = get_client()
if client:
print(50 * '-')
print('SAVING RESULTS TO GOOGLE CLOUD STORAGE')
prin... | otrenav/tabelog-scrapy | google_cloud/cloud_storage.py | cloud_storage.py | py | 792 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "helpers.constants.BUCKET",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "helpers.constants.BUCKET",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "helpers.constants.BUCKET",
"line_number": 18,
"usage_type": "argument"
},
{... |
11066241811 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
class SGD(optim.Optimizer):
def __init__(self, params, lr):
defaults = dict(lr=lr)
super(SGD, self).__init__(params, defaults)
def step(self):
for group i... | gonglixue/Energy-Based-DescriptorNet | MLEOptim/sgd.py | sgd.py | py | 1,835 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.optim.Optimizer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.optim",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.optim.Optimizer",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch... |
18483255185 | #%%
import numpy as np
import os
from scipy.optimize import minimize, curve_fit, least_squares
from scipy import stats
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import Ridge
from sklearn.linear_model import Lasso... | ElyDoodson/spin_down | model_v1.0.py | model_v1.0.py | py | 14,265 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 21,
"usage_type": "name"
},
{
"api_na... |
13626624275 | import numpy as np
import matplotlib
from matplotlib.widgets import Button
import matplotlib.pyplot as plt
import can
from can import Message
#import time
# arguments: datastring = bytestring, input_array --> to join upper and lower byte = [[upperbyte, lowerbyte, multiplier],...]
# contd. to use byte without addition ... | AbhinavGarg90/BMS-viewer-py | pratice.py | pratice.py | py | 8,342 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "can.bus",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "can.Bus",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "can.Message",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "can.Message",
"line_number": 92,... |
35509010197 | import string
import numpy as np
import math
import csv
import shapely.geometry
import matplotlib.pyplot as plt
from obstacle_course import Tetrominos
import random
class Vehicle:
def __init__(self,vec_type = 'car'):
if vec_type == 'car':
self.lw = 2.8 # wheelbase
self.lf = 0.96 #... | berta28/RBE550 | wildfire/costmap.py | costmap.py | py | 14,923 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.tan",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 34,
... |
8648878687 | import streamlit as st
from streamlit_option_menu import option_menu
import pandas as pd
import requests
from requests import Session
import plotly.express as px
import altair as alt
from requests.exceptions import ConnectionError, Timeout, TooManyRedirects,ReadTimeout
import json
import os
from millify import millify
... | kaiblade/Streamlit | main_page.py | main_page.py | py | 15,196 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_records",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "stre... |
74893472186 | import pandas as pd
import numpy as np
df= pd.read_csv('/home/sunbeam/PycharmProjects/medium/final.csv')
#======================================selecting columns===========================================================
def data(t1,t2):
labels = []
y = df.iloc[:, np.array(
[3, 4, 5, 6, 7, 8, 9, 11, 12... | anujjaaa/multilabel-classification | predict_record.py | predict_record.py | py | 2,273 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.CountVectorizer",
"line_number": 17,
"usage_type": "call"
},
{
"api_nam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.