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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32175315189 | import sys, os
from termcolor import colored, cprint
from wordfreq import word_frequency
import matplotlib.pyplot as plt
from utils import *
os.system("color")
CHANCES = 5
WORD_LENGTH = 5
#ANSWER_WORD = "steal"
GRAY, YELLOW, GREEN = 0, 1, 3
# FORMAT BITMAPY: 5 x 2 bity
# ZIELONY 3 - ŻÓŁTY 1 - SZARY 0
# np GreenYello... | marcingesek79/AI---project | main.py | main.py | py | 6,749 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.system",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "termcolor.cprint",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "termcolor.cprint",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "termcolor.cprint",
"li... |
29559023877 | from setuptools import setup, find_packages
import sys, os
here = os.path.abspath(os.path.dirname(__file__))
try:
README = open(os.path.join(here, 'README.rst')).read()
except IOError:
README = ''
version = "0.3.0"
test_requirements = [
'nose',
'webtest<=2.0.24',
]
setup(name='tgext.mailer',
versi... | amol-/tgext.mailer | setup.py | setup.py | py | 1,379 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
3766477957 | import matplotlib.pyplot as plt
# Given list of words and counts
word_frequencies = {
'video evidence': 69,
'scientific evidence': 37,
'photo evidence': 34,
'statistical evidence': 17,
'source verification': 16,
'event date': 13,
'source credibility': 12,
'verification source': 11,
... | yvorlovskiy/misinfo_yury | context_prompt_exploration/graph_word_frequencies.py | graph_word_frequencies.py | py | 983 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.barh",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "mat... |
14709658890 | from dataloader.dataset import *
from utils.utility import *
from utils.resume import *
from models.model import *
from loss.seg_loss import *
from torch.autograd import Variable
from scipy import ndimage
import copy
import cv2
from argparse import *
import yaml
class StreamSegMetrics():
"""
Stream Metrics fo... | zju-vipa/EVS-Net | test.py | test.py | py | 7,580 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "copy.deepcopy",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2BGR",
"line_number": 93,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
... |
8181696010 | from keras.models import load_model
import cv2
import numpy as np
import sys
input = sys.argv[1]
output = sys.argv[2]
model = './u2netp_keras.h5'
# load model
u2netp_keras = load_model(model, compile=False)
# load image
image = cv2.imread(input)
# convert to array
blob = cv2.dnn.blobFromImage(image, 1.0/255, (32... | Voinic/u2net-keras | u2net-keras.py | u2net-keras.py | py | 932 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "keras.models.load_model",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"l... |
7330563809 | import pygame
import random
import os
from pygame.constants import K_k, K_w , K_s , K_a , K_d , K_u , K_h , K_j , K_k
def dasher(Two_Player,WIN,WIDHT,HEIGHT,FPS):
max_time = 60
timer = max_time
dt = 0
clock = pygame.time.Clock()
class ball_:
def __init__(self,size):
... | Lennylp/pygame-Project-Cafeteria-Run | Facharbeit/dasher.py | dasher.py | py | 9,020 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.time.Clock",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.Rect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.randint",
"... |
24570679807 | from rdkit import Chem
import os.path as osp
from statistics import mode, StatisticsError
import numpy as np
import pandas as pd
import pickle
# location of unzipped GEOM dataset
true_confs_dir = '../data/DRUGS/drugs'
def clean_confs(smi, confs):
good_ids = []
smi = Chem.MolToSmiles(Chem.MolFromSmiles(smi),... | PattanaikL/GeoMol | scripts/clean_smiles.py | clean_smiles.py | py | 2,108 | python | en | code | 141 | github-code | 7 | [
{
"api_name": "rdkit.Chem.MolToSmiles",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rdkit.Chem",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "rdkit.Chem.MolFromSmiles",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rdkit.Chem... |
21595456323 | """005 enrollments
Revision ID: 9c54ab0a43c5
Revises: 6d8dac873e40
Create Date: 2020-03-17 17:37:40.801390
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9c54ab0a43c5'
down_revision = '6d8dac873e40'
branch_labels = None
depends_on = None
def upgrade():
... | poymanov/assembly-22 | src/migrations/versions/9c54ab0a43c5_005_enrollments.py | 9c54ab0a43c5_005_enrollments.py | py | 980 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
5700593426 | import uuid, datetime
import logging
from orderapp.main.model.order_dto import OrderDto
from orderapp.main.model.order_model import Order
from orderapp.main.model.product_model import Product
from orderapp.main.model.product_catalog_model import ProductCatalog
from orderapp.main.model.offer_model import Offer
from or... | lakshmi-purushothaman/EMM-OrderService | orderapp/main/service/order_service.py | order_service.py | py | 4,128 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "orderapp.main.model.order_dto.OrderDto.product",
"line_number": 17,
"usage_type": "attribute"
},... |
14198639675 | # from pudb import set_trace; set_trace()
from typing import List
from collections import defaultdict
import math
import heapq
class Solution:
def minimumWeight(self, n: int, edges: List[List[int]], src1: int, src2: int, dest: int) -> int:
"""Can't solve this, because my dumbass didn't realize that findin... | FanchenBao/leetcode | Contest_284/LeetCode_2203.py | LeetCode_2203.py | py | 2,251 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
... |
27224574534 | import joblib
from flask import Flask, request, jsonify
from flask_cors import CORS
import os
from MovieReviewClassifierHelpers import preprocessor, tokenizer
app = Flask(__name__)
CORS(app)
@app.route('/predict', methods=['POST'])
def predict():
if request.method == 'POST':
# get our review from the requ... | abrigham1/abrigham | MovieReviewClassifier/MovieReviewPredict.py | MovieReviewPredict.py | py | 977 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
40728500968 | """
urls for carpathians
"""
from django.urls import path
from gpsfun.carpathians.views import (
ridges, ridge, peak, route, routes, peaks)
urlpatterns = [
path('ridges/', ridges, name="ridges"),
path('ridge/<slug>/', ridge, name="ridge"),
path('peak/<slug>/', peak, name="peak"),
path('peaks/', p... | kostin-aleks/gpsfun | gpsfun/gpsfun/carpathians/urls.py | urls.py | py | 436 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "gpsfun.carpathians.views.ridges",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": ... |
6767762006 | import os
import yagmail
receiver = "preethikahari2004@gmail.com" # receiver email address
body = "Attendence File" # email body
filename = "Attendance"+os.sep+"Attendance_2019-08-29_13-09-07.csv" # attach the file
# mail information
yag = yagmail.SMTP("preethehari2004@gmail.com", "hari@123")
# sent the mail
yag.... | hasmithraa/automatic_attendance | automail.py | automail.py | py | 471 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.sep",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "yagmail.SMTP",
"line_number": 9,
"usage_type": "call"
}
] |
17233290402 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 19 23:38:39 2023
@author: Shashank.S.Tiwari
"""
import os
import glob
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Set the folder path where the CSV files are located
folder_path = 'C:/Users/Shashank.S.Tiwari/OneDrive - Shell... | shashanktiwari619/postprocessing_point_monitors | trial_all_csv_plots.py | trial_all_csv_plots.py | py | 3,438 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "glob.glob",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "seaborn.set",
"line_number": ... |
7977576062 |
import numpy as np
import projectq
from projectq.ops import Rx, Rz, CNOT, Measure
import matplotlib.pyplot as plt
import copy
class Trainer(object):
def __init__(self):
self.theta = np.random.rand(2*3*3).reshape(3, 2, 3)
self.data = [(0, 0), (1, 0), (0, 1), (1, 1)]
self.label = [0, 1, 1, 0... | RindJLU/Undergraduate-Thesis | Born_Machine/train_xor.py | train_xor.py | py | 3,905 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.random.rand",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "projectq.MainEngine",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.log",
... |
8450994595 | """AsyncSession Database Schema
===============================
New in version 4:
- New metadata table for text parameters;
- Add index for timestamp and name in Log table;
- Add index for timestamp and name in Dataset table;
- Add explicit rowid column as primary key for Log and Dataset tables (this was already a... | jsalort/pymanip | pymanip/asyncsession/database_v4.py | database_v4.py | py | 3,475 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "sqlalchemy.orm.declarative_base",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Text",
"line_number": 36,
"usage_type": "argument"
},
{
"api_name": ... |
32021732329 | import sys
import os
from datetime import datetime, timedelta
import csv
import logging
import string
import pdb
import re
import numpy as np
from netCDF4 import Dataset
from . import Time
"""Module: util.py
Methods:
generate_date_range
read_station_list
read_station_table
station_trunc
equations... | NOAA-MDL/CAMPS | camps/core/util.py | util.py | py | 15,546 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "datetime.timedelta",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_NONE",
"line_numb... |
28815007446 | from google.appengine.ext import ndb
from webapp2_extras import security
import webapp2_extras.appengine.auth.models
import time
import www.utils
from datetime import datetime, timedelta
BOTTOM_SPONSOR_TIER = 1
TOP_SPONSOR_TIER = 5
YES_NO_MAYBE_OPTIONS = ['YES', 'NO', 'MAYBE']
SPONSORSHIP_OPTIONS = ['NONE', 'SQUIR... | HackIllinois/infrastructure-2016 | www/models.py | models.py | py | 24,175 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "google.appengine.ext.ndb.Model",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.ndb",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.ndb.Key",
"line_number": 30,
"usage_type": "attribute"
... |
71309365982 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | openstack/openstacksdk | openstack/baremetal/v1/node.py | node.py | py | 57,064 | python | en | code | 245 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "collections.namedtuple",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "openstack.baremetal.v1._common.ListMixin",
"line_number": 73,
"usage_type": "attribute"
},
{
... |
10712456015 | from typing import Any, Optional
from warehouse_manager.exceptions.base import CustomBaseException
class SessionDoesNotExistError(CustomBaseException):
def __init__(self, session_name: Optional[str] = None, custom_message: Optional[str] = None) -> None:
self._custom_message = custom_message
self.... | gerdsonSony/warehouse-manager | layers/src/warehouse_manager/exceptions/database.py | database.py | py | 1,496 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warehouse_manager.exceptions.base.CustomBaseException",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "warehouse_manager.exceptions.base.CustomBaseException",
"line_number": 15... |
11591709566 | import math
import cv2
import numpy as np
import random
import random as random_random
import torch
from utils.box_utils import matrix_iof
def intersect(box_a, box_b):
max_xy = np.minimum(box_a[:, 2:], box_b[2:])
min_xy = np.maximum(box_a[:, :2], box_b[:2])
inter = np.clip((max_xy - min_xy), a_min=0, a_... | FaithZSH/retinanet_widerface | data/data_augment.py | data_augment.py | py | 17,393 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.minimum",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.maximum",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.clip",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number":... |
19493159400 | # -*- coding:utf-8 -*-
import subprocess
import hashlib
import os
import re
import socket
import shlex
import xml.etree.ElementTree as ET
import requests
import json
import time
import telnetlib
from pysqlcipher3 import dbapi2 as sqlite
def check_devices():
cmd = 'adb devices'
args = shlex.split(cmd)
ret... | 1993gc/wx-helper | tools.py | tools.py | py | 6,286 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "shlex.split",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "shlex.split",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_n... |
29318653398 | """
This script is supposed to calculate the date when more people have
"common birthday" - when their ages combined will reach a certain
milestone.
Example: One person was born in 1990, the second one in 2000.
In the year 2020 they will celebrate 50th birthday together.
(One will be 30, second one 2... | grdddj/My-codebase | Python/Birthday Calculator/common_birthday.py | common_birthday.py | py | 5,989 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.Any",
"line_number": 138,
"usage_type": "name"
}
] |
73510703264 | import json
files=['babelio_reviews.json', 'critiques_libres_reviews.json']
def merge_JsonFiles(filenames):
result = list()
for f1 in filenames:
with open(f1, 'r') as infile:
result.extend(json.load(infile))
with open('french_books_reviews', 'w') as output_file:
json.dump(resu... | Abirate/Dataset_Creation_Scrapy_Project_French_book_reviews | Scrape_Site_Critiques_libres/critiques_libres_scraping/test.py | test.py | py | 336 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 12,
"usage_type": "call"
}
] |
20422293524 | #!/usr/bin/env python
# coding: utf-8
# In[125]:
#import libraries
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
# In[126]:
data = pd.read_csv("athlete_events.csv")
data.head()
# In[127]:
data['Medal'].value_counts()
# In[128]:
data['Medal'].isnull().sum()
# So The Null v... | PraveenRaj483/Olympic-events-analysis-using-Python | Project - 2 olympic athelete events.py | Project - 2 olympic athelete events.py | py | 979 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.barh",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
15782035400 | # check rnd_architecture.PNG in `paper` folder for visualization.
from typing import Tuple, Dict
import torch
from torch import nn
try:
from rnd_utils import RunningMeanStd
except ModuleNotFoundError:
from sac_rnd.rnd_utils import RunningMeanStd
# from torch.nn import functional as F
class PredictorNetwork(n... | zzmtsvv/sac_rnd | rnd_modules.py | rnd_modules.py | py | 7,673 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.Bilinear",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
29732687584 | import math
import carla
import datetime
import logging
from sensors.base_sensor import Sensor
from modules.canbus.proto.chassis_pb2 import FIX_3D, Chassis
from sensors.carla_sensors import GnssSensor, get_GnssSensor
class ChassisAlter(Sensor):
_apollo_channel = '/apollo/canbus/chassis'
_apollo_msgType = 'apo... | YanBC/cyber-bridge-api | sensors/chassis.py | chassis.py | py | 2,628 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "sensors.base_sensor.Sensor",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "modules.canbus.proto.chassis_pb2.Chassis",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "carla.Vehicle",
"line_number": 17,
"usage_type": "attribute"
},
{... |
42054248582 | """ Created 09/01/2021 by Stelian Stoian.
Implements the bencode encoder.
"""
from collections import OrderedDict
from .indicators import TOKEN_END, TOKEN_INTEGER, TOKEN_DICT, TOKEN_LIST, TOKEN_STRING_SEPARATOR
class Encoder:
""" Responsible for encoding a python object into the
corresponding bencode... | MxHonesty/hornet | src/bencode/encoder.py | encoder.py | py | 4,031 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "collections.OrderedDict",
"line_number": 28,
"usage_type": "argument"
},
{
"api_name": "indicators.TOKEN_INTEGER",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "indicators.TOKEN_END",
"line_number": 40,
"usage_type": "name"
},
{
"api_nam... |
1528239336 | # -------------------------------------------------------------------------
# AUTHOR: Joey Cindass
# FILENAME: naive_bayes.py
# SPECIFICATION: Using naive bayes, predict if someone will play tennis given weather conditions
# FOR: CS 4210- Assignment #2
# TIME SPENT: 4 hour
# --------------------------------------------... | jpcind/projects | naive_bayes.py | naive_bayes.py | py | 3,278 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "csv.reader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.naive_bayes.GaussianNB",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 63,
"usage_type": "call"
}
] |
16919975491 | import telebot
bot = telebot.TeleBot("5959592035:AAHFfTbtlGp6v59F4xK9DpO70O3eE2fAiZg", parse_mode=None)
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
bot.reply_to(message, "treasure, how was your day?")
bot.infinity_polling() | Munonyetreasure/stunning-octo-journey | box.py | box.py | py | 266 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "telebot.TeleBot",
"line_number": 3,
"usage_type": "call"
}
] |
38982171796 | import uuid
from enum import Enum
from sqlalchemy import Column, ForeignKey, Index, String
from sqlalchemy.dialects.postgresql import UUID, ENUM
from models.postgres import Base, SchemaInDb
from models.postgres.base import UUIDMixin, CreatedTimeMixin
class OAuthProviderEnum(str, Enum):
google: str = "google"
... | Rezyapkin/Online-Cinema-with-ABAC | auth_service/grpc/src/models/postgres/oauth.py | oauth.py | py | 1,075 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.postgres.Base",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.postgres.base.UUIDMixin",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "models.... |
28464952309 | from typing import Optional, List
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
# Time Complexity: O(n)
# Space Complexity: O(1)
def partition(self, head: Optional[ListNode], x: int) -> Optional[ListNode]:
left_head = List... | JianLiu666/StudyNote-DSA | leetcode/p00086/p00086.py | p00086.py | py | 1,413 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.Optional",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 33,
"usage_type": "name"
}
] |
12801612292 | import fuzzy
from src.helpers.spell_check_helper import spell_check_entity_name
from src.helpers.spell_check_helper import word_suggestion
#################
## POC POC POC ##
#################
"""
Rockwell Automation Technolgies, Inc. - does not resolve
Rockwell Automation Technologies Inc. - resolved via em and oc,... | arjunmukherjee/ers-serverless | scripts/spell_checker.py | spell_checker.py | py | 3,988 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "src.helpers.spell_check_helper.word_suggestion",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "src.helpers.spell_check_helper.spell_check_entity_name",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "src.helpers.spell_check_helper.word_suggest... |
29769139685 | from typing import Any, Callable, Mapping, Sequence, Tuple, Type
from pydantic import BaseModel
from pydantic.fields import FieldInfo
from . import utils
from .validation import create_func_model
__all__: Sequence[str] = (
"create_model_cls",
"create_model",
"bind_arguments",
)
def create_model_cls(
... | neoclient/neoclient | neoclient/api.py | api.py | py | 1,134 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.Sequence",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Mapping",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"lin... |
34874028099 | import contextlib
import io
import os
import pathlib
import tempfile
import warnings
import zipfile
import pytest
import tomli_w
from click.testing import CliRunner
"""
In your tests:
def test_foo(cli_runner):
r = cli_runner.invoke(mycli, ["mycommand"])
assert r.exit_code == 0
In `some_command()`, add:
... | bioidiap/bob.ip.binseg | tests/conftest.py | conftest.py | py | 5,185 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "click.testing.CliRunner",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "warnings.warn",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "contextlib.contextma... |
36737622350 | import smbus
import serial
import time
import datetime
import math
#import requests
import urllib.request, json
#from urlparse import urlparse
#import json
import MySQLdb
from scipy import optimize,exp
i2c_address = 0x76
bus_number = 1
bus = smbus.SMBus(bus_number)
digT = []
digP = []
digH = []
sensor_data = {'TEMP... | ogatyan1019/Hi-Ce | Raspi.py | Raspi.py | py | 6,546 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "smbus.SMBus",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.exp",
"line_number": 138,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 152,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
72867786782 |
import os
import shutil
from loguru import logger
import torch
def load_ckpt(model, ckpt):
model_state_dict = model.state_dict()
load_dict = {}
for key_model, v in model_state_dict.items():
if key_model not in ckpt:
logger.warning(
"{} is not in the ckpt. Please doubl... | Ascend/ModelZoo-PyTorch | PyTorch/dev/cv/detection/YOLOX_Dynamic_ID4069_for_PyTorch/yolox/utils/checkpoint.py | checkpoint.py | py | 1,218 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "loguru.logger.warning",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "loguru.logger.warning",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "loguru.logg... |
8150882058 | from ..responses import ResponseMsg, ResponseCQFunc
from ..permissions import get_permissions
from .general import Session
class CQCommandSession(Session):
def __init__(self, user_id):
Session.__init__(self, user_id=user_id)
self._max_delta = 30
self.session_type = 'CQ控制台'
... | lizard1998myx/MultiBot | sessions/cq_command.py | cq_command.py | py | 1,914 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "general.Session",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "general.Session.__init__",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "general.Session",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "permissions.get... |
30371707751 | from os import listdir
from os.path import isfile, join, splitext, basename
import multiprocessing
import time
import pandas as pd
SEQ_LEN = 288 # Number of indexes for 24 hours
def get_file_list(path, extension=None):
if extension is None:
file_list = [path + f for f in listdir(path) if isfile(join(path,... | jyj545/Bot-crypto-V2 | build_target.py | build_target.py | py | 1,630 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number"... |
17808783674 | import zernike
import util
import cv2
import plotter
import combined
import contour
import orb
import sift
zernike_database = util.load_obj('zernike_database_icon_50')
orb_database = util.load_obj('orb_database_icon_50')
sift_database = util.load_obj('sift_database_icon_50')
images = util.load_images("shoes")
images =... | kac123/Icon-Matching-Project | gcloudtest/testground.py | testground.py | py | 2,285 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "util.load_obj",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "util.load_obj",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "util.load_obj",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "util.load_images",
"lin... |
72543406624 | from django.conf.urls.static import static
from django.conf.urls import patterns, url, include
from solid_i18n.urls import solid_i18n_patterns
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = solid_i18n_patterns('',
url(r'^member/', include('apps.team.urls')),
... | zvadym/vox | vox/urls.py | urls.py | py | 1,138 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "solid_i18n.urls.solid_i18n_patterns",
"line_number": 9,
"usage_type": "call"
},
... |
26456996574 |
from flask import Flask, request, jsonify
from dotenv import load_dotenv
import subprocess
import os
import requests
import threading
import time
import json
import platform
import datetime
requests.packages.urllib3.disable_warnings()
load_dotenv() # take environment variables from .env.
app = Flask(__name__)
file... | alfaori1977/serviceFather | src/httpServer.py | httpServer.py | py | 9,372 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.packages",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 16,
"usage_type": "call"
},
{
... |
71519050465 | import sys
import os
import logging
import time
import ipdb
import pickle
from typing import Optional
from dataclasses import dataclass, field
import torch
import transformers
from transformers import (
Seq2SeqTrainingArguments,
HfArgumentParser,
set_seed,
AutoTokenizer,
AutoConfi... | NLPWM-WHU/SLGM | run.py | run.py | py | 14,060 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "dataclasses.field",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "dataclasses.field... |
23840654068 | import cgi, os
# Getting the data from the buildhamburger.html post request.
data = cgi.FieldStorage()
# Total Price of burger.
totalPrice = 0
# Total BrugerCO Points.
burgerCOPoints = 0
# Getting the different values.
getHamburgerType = data.getvalue("type")
getHamburgerBreadType = data.getvalue("bread-type")
getP... | HusenjanDev/Python-Web-Development | processHamburger.py | processHamburger.py | py | 4,350 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cgi.FieldStorage",
"line_number": 4,
"usage_type": "call"
}
] |
35753668770 | """Reviewers and ratings: Number of Submissions/Revisions over time"""
from asyncio import gather, run
from typing import Tuple, Type, Union
from matplotlib import pyplot as plt
from matplotlib.axes import Axes
from pandas import DataFrame
from seaborn import barplot, color_palette
from sqlalchemy import func
from sql... | HPI-Information-Systems/cmt_statistics_tool | cmt_statistics_tool/statistics/s01_03.py | s01_03.py | py | 2,465 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.Union",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Type",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "cmt_statistics_tool.tables.Submission",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "cmt_st... |
6335541025 | from cuber import cube
from cuber import utils
import logging
import numpy as np
logger = logging.getLogger(__name__)
class CubeSplitTrainTest(cube.Cube):
def __init__(self, X, y, test_ratio, seed):
self.seed = seed
self.X = X
self.y = y
self.test_ratio = test_ratio
def name(s... | kriot/Cuber | examples/example_2/cube_split_train_test.py | cube_split_train_test.py | py | 948 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cuber.cube.Cube",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cuber.cube",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "cuber.utils.universal_... |
3632564381 | # -*- coding: utf-8 -*-
from setuptools import find_packages
from setuptools import setup
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name='osxcollector_output_filters',
version='1.1.1',
author='Yelp Security',
author_email='opensource@yelp.com',
description='Filter... | Yelp/osxcollector_output_filters | setup.py | setup.py | py | 822 | python | en | code | 75 | github-code | 7 | [
{
"api_name": "setuptools.setup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 20,
"usage_type": "call"
}
] |
40481483591 | # %%
import simpy
import random
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
RANDOM_SEED = 42
random.seed(RANDOM_SEED)
WALK_RADIUS = 50
# TO-DO:
# parametrize speeds
# include gis maps
##### INPUT OF DATA #####
data = {
# Size of the grid
"grid": {"xlim": [0, 100], "ylim": [0, 1... | NaroaCS/AutonomousBicycleSimulation | test_code/simpy_refactor.py | simpy_refactor.py | py | 33,116 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8... |
30054847279 | import cv2
import matplotlib.pyplot as plt
#import pylab
import numpy as np
import close_window
# termination criteria
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 100, 0.001)
# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)
objp = np.zeros((8*11,3), np.float32)
objp[:,:2] = np.m... | barrypr14/109-opencvdl-hw2 | Camera_Calibration.py | Camera_Calibration.py | py | 2,065 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.TERM_CRITERIA_EPS",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.TERM_CRITERIA_MAX_ITER",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "... |
38440906133 |
from transformers import AutoTokenizer, AutoModelForMaskedLM, RobertaConfig , RobertaTokenizer,RobertaForMaskedLM, DataCollatorForLanguageModeling, LineByLineTextDataset, Trainer, TrainingArguments
from pathlib import Path
from tokenizers import ByteLevelBPETokenizer
from tokenizers.implementations import ByteLeve... | ASR01/QuijoBERT | quijoBERT.py | quijoBERT.py | py | 2,448 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tokenizers.implementations.ByteLevelBPETokenizer",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 31,
"usage_type": "call"
},
{
"api_name"... |
39919391952 | import torch
import torchvision.models
shape = (1,3,64,64)
model = torchvision.models.resnet18(pretrained=True)
data = torch.rand(shape)
labels = torch.rand(1,1000)
# forward
prediction = model(data)
loss = (prediction - labels).sum()
loss.backward()
optim = torch.optim.SGD(model.parameters(),lr=1e-2,momentum=0.9... | yahoo17/machine_learning | mmsearch_vision.py | mmsearch_vision.py | py | 335 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torchvision.models.models.resnet18",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torchvision.models.models",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torchvision.models",
"line_number": 5,
"usage_type": "name"
},
{
... |
28271522540 | #!/home/yin/opt/bin/python3
import numpy as np
from myvasp import vasp_func as vf
def main():
jobn, Etot, Eent, pres = vf.vasp_read_post_data()
if Etot.shape[0] < 5.9:
import sys
sys.exit("\n==> ABORT: insufficient data \n" )
pres0 = vf.read_pressure('../y_full_relax/OUTCAR')
... | BinglunYin/vasp_utils | vasp_workflow_bulk/yin_vasp_plot_cij_stress.py | yin_vasp_plot_cij_stress.py | py | 5,939 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "myvasp.vasp_func.vasp_read_post_data",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "myvasp.vasp_func",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "myvasp.v... |
32854895121 | import time,board,busio
import numpy as np
import adafruit_mlx90640
import matplotlib.pyplot as plt
import pandas as pd
# import keyboard
from tempfile import TemporaryFile
# Set up MLX90640
i2c = busio.I2C(board.SCL, board.SDA, frequency=400000) # setup I2C
mlx = adafruit_mlx90640.MLX90640(i2c) # begin MLX90640 with ... | animosoumya/Occupancy-Detection-Framework | MLX90640/Data Collection/collect_data.py | collect_data.py | py | 2,220 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "busio.I2C",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "board.SCL",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "board.SDA",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "adafruit_mlx90640.MLX90640",
... |
1873046227 | import nltk
from nltk.tokenize import TweetTokenizer
from nltk.corpus import stopwords
from nltk.corpus import opinion_lexicon
import string
from nltk.stem.porter import *
from sklearn.feature_extraction.text import CountVectorizer
import math
import csv
class TweetEnricher:
"""
Class that adds features to twe... | mthaak/2imw15-project | TweetEnricher/tweetEnricher.py | tweetEnricher.py | py | 22,854 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "nltk.tokenize.TweetTokenizer",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 18,
"usage_type": "name"
},
{
"ap... |
29367498480 | import discord
from discord import slash_command
from discord.ext import commands
from modals.Anonymous import Anonymous
from utils import globals as GG
log = GG.log
class AnonModal(commands.Cog):
def __init__(self, bot):
self.bot = bot
@slash_command(name="anonreport")
@commands.guild_only()
... | CrawlerEmporium/DiscordCrawler | cogs/anonmodal.py | anonmodal.py | py | 4,614 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "utils.globals.log",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "utils.globals",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "disc... |
119949015 | from typing import List, Union
import numpy as np
from sentence_transformers import SentenceTransformer
from services.components.cos_similarity import cos_sim
from services.interface.abstract_model import PlagiarismDriver
class Similarity(PlagiarismDriver):
def __init__(
self,
model_name_o... | baibhav2002/sih_sahyoog | llm_model/services/src/plagiarsim_class.py | plagiarsim_class.py | py | 1,461 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "services.interface.abstract_model.PlagiarismDriver",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sentence_transformers.SentenceTransformer",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 24,
"usage_type... |
23355536776 | import math
import torch
from torch import nn
from vqfr.archs.stylegan_arch import UpFirDnSmooth
from vqfr.ops.upfirdn2d import upfirdn2d
from vqfr.utils.registry import ARCH_REGISTRY
def get_haar_wavelet(in_channels):
haar_wav_l = 1 / (2**0.5) * torch.ones(1, 2)
haar_wav_h = 1 / (2**0.5) * torch.ones(1, 2)
... | TencentARC/VQFR | vqfr/archs/swagan_arch.py | swagan_arch.py | py | 10,849 | python | en | code | 281 | github-code | 7 | [
{
"api_name": "torch.ones",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 53,
... |
35678553300 | # assignment4.py
#
# Contains the implementation of a replicated fault-tolerant
# key-value store that provides casual consistency.
from flask import Flask, jsonify, request, abort
from flask_restful import Api, Resource, reqparse
from requests.exceptions import Timeout
from uhashring import HashRing
from mmh3 import ... | cyruskarsan/DS-KVS-REST-API | assignment4.py | assignment4.py | py | 49,830 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 61,
"usage_type": "name"
},
{
"api_name": "requests.delete",
"li... |
43313149802 | import logging
logger = logging.getLogger(__name__)
def early_stopping(val_loss: 'list', error: 'float' = 0.1):
'''Stop training if validation loss has increased.'''
if val_loss[-1] - min(val_loss) >= error:
logger.info(f"Validation loss starts increasing, training will stop.")
return True
... | xzhxzhxzhxzhxzh/ML-Projects | training_and_testing/tt_generic.py | tt_generic.py | py | 349 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 3,
"usage_type": "call"
}
] |
16620260973 | # Run this code to get the results of the sim
import behaviour
import numpy as np
import scipy as sp
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import statistics
import time
from time import sleep
from tqdm import tqdm
# Effective size
N = int(1360/2)
mu_cognition = 0.5 # alpha
mu_... | Sbourgeat/HungerGames | Main.py | Main.py | py | 4,339 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "numpy.random.normal",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.rando... |
23366197248 | #!/usr/bin/env python3
# Source code from auth0 / APIs / test
# documentaiton at https://auth0.com/docs/quickstart/backend/nodejs/01-authorization
# basically:
# we send our client credential to authorizer.
# auth0 replies with a token that auth<accesstoken>
# this is added as authorization to the call to sietch
# sie... | nathanieltagg/Sietch | client/SietchConnect.py | SietchConnect.py | py | 3,586 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "six.moves.urllib.request.Request",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "six.moves.urlli... |
18815976258 | import time
import logging
import traceback
from gcf.functions.execution.exceptions import RetryException
from gcf.functions.execution.time import Timer
from gcf.functions.execution.config import ExecutionStatus
from gcf.functions.execution.events.handler import EventHandler
from gcf.functions.execution.worker import ... | musatdragosro/boastlabs-cloud-functions | gcf/functions/execution/functions.py | functions.py | py | 2,657 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "gcf.functions.execution.worker.AbstractWorker.__class__",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "gcf.functions.execution.worker.AbstractWorker",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number":... |
2729813831 | import subprocess
import wolframalpha
import pyttsx3
import tkinter
from tkinter import *
import operator
import smtplib
import getpass
from email.message import EmailMessage
import json
import speech_recognition as sr
from datetime import *
import wikipedia
import webbrowser
import os
import pyjokes
import smtplib
imp... | Mayaank1/Voice_Assistant | Voice assistant.py | Voice assistant.py | py | 11,613 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pyttsx3.init",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Recognizer",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 46,
"usage_type": "call"
},
{
"api_name... |
19807838348 | import os
from statistics import mean
from typing import Any, Dict
import hydra
import torch
from omegaconf import DictConfig
from transformers import PreTrainedModel, PreTrainedTokenizerFast
from transformers.generation import LogitsProcessorList
from kwja.modules.base import BaseModule
from kwja.modules.components.... | ku-nlp/kwja | src/kwja/modules/seq2seq.py | seq2seq.py | py | 5,159 | python | en | code | 113 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "kwja.modules.base.BaseModule",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "kwja.metr... |
34005378525 |
from tornado.gen import multi
from anthill.common import discover, cached
from anthill.common.model import Model
from anthill.common.internal import Internal, InternalError
from anthill.common.login import LoginClient, LoginClientError
import logging
import collections
class AdminModel(Model):
def __init__(se... | anthill-platform/anthill-admin | anthill/admin/model/admin.py | admin.py | py | 3,338 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "anthill.common.model.Model",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "anthill.common.internal.Internal",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "anthill.common.discover.cache.location",
"line_number": 26,
"usage_type": "ca... |
35036538917 | from app.api import bp
from flask import request,jsonify,url_for, abort
from app.models import Fridge, User, Item
from app import db
from app.api.errors import error_response
from flask_jwt_extended import jwt_required, get_raw_jwt
from sqlalchemy import desc, asc
from datetime import datetime, date
@bp.route('/fridge... | TKone7/product-api | app/api/fridges.py | fridges.py | py | 5,792 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "app.models.User.fromJwt",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.models.User",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.jsonify",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "app.api.bp.rout... |
44296339371 | """test1
Revision ID: 05086d407e64
Revises: 9bc90cd0b9a6
Create Date: 2017-08-16 23:56:04.934419
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '05086d407e64'
down_revision = '9bc90cd0b9a6'
branch_labels = None
depends_on = None
def upgrade():
# ### comm... | fangweiren/Flask_web | migrations/versions/05086d407e64_test1.py | 05086d407e64_test1.py | py | 828 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
73910981342 | from typing import List
class Solution:
def search(self, nums: List[int], target: int) -> int:
return search_rotated_array(nums, target)
def search_rotated_array(arr: List[int], key: int) -> int:
if not arr:
return -1
rotation_point = binary_search_for_max_index(arr)
print(rotation_... | cs-cordero/interview-prep | grokking-coding/binary_search/problem_search_2.py | problem_search_2.py | py | 1,548 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 42... |
25854471400 | import requests
from django.conf import settings
def get_token():
"""
Sms jonatishdan oldin olinadigan token
"""
url = "https://notify.eskiz.uz/api/auth/login"
payload = {
'email': settings.ESKIZ_EMAIL,
'password': settings.ESKIZ_SECRET_KEY,
}
response = requests.post(url, ... | major-hub/moscow | users/api/sms.py | sms.py | py | 932 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.conf.settings.ESKIZ_EMAIL",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.ESKIZ_SECRET_KEY",
"line_number": 12,
"usage_type": "attr... |
22572526141 | from __future__ import print_function
import urllib
import boto3
import zipfile
import json
#-------- aws variables -----------
s3_client= boto3.client('s3')
lambda_client = boto3.client('lambda')
#-------- functions begin---------
def lambda_handler(event, context):
# Get the object from the event and show its ... | ryanstantz/lambda_check_images_process_zip | unzip.py | unzip.py | py | 1,971 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "boto3.client",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_numbe... |
37659958728 | import tweepy
from tweepy import Client
from decouple import config
api_key = config('api_key')
api_key_secret= config('api_key_secret')
access_token = config('access_token')
access_token_secret = config('access_token_secret')
auth = tweepy.OAuthHandler(api_key, api_key_secret)
auth.set_access_token(access_token, acc... | itsregalo/Sentiment-Analysis-Classifier-with-Logistic-Regression-and-TfidfVectorizer | extract_tweets.py | extract_tweets.py | py | 1,306 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "decouple.config",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"l... |
37305973556 | from apscheduler.scheduler import Scheduler
from flask import Flask, request
from flask.ext.googleauth import GoogleFederated
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.sql import not_
import os
from werkzeug.contrib.fixers import ProxyFix
app = Flask('revere')
app.config['WTF_CSRF_ENABLED'] = False
a... | pegler/revere | revere/__init__.py | __init__.py | py | 2,909 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_nu... |
26158718473 | import torch
from torch import nn
from torch.nn import functional as F
import lightning as L
from typing import Dict, Tuple
import warnings
from torch.distributions import Normal
from torch.distributions import kl_divergence as kl
def apply_scaled_init(model):
for m in model.modules():
if isin... | Genentech/contrastive-ops | src/models.py | models.py | py | 41,787 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.nn.Conv2d",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "torch.nn.init.kaiming_normal_",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn.... |
6601466354 | #coding=utf-8
from app import app
from flask import render_template
#两个 route 装饰器创建了从网址 / 以及 /index 到这个函数的映射
@app.route('/')
@app.route('/index')
#def index():
# return "Hello,World!"
#def index():
# user = { 'nickname': 'Miguel' } # fake user
# return '''
#<html>
# <head>
# <title>Home Page</title>
# </head... | zekaigit/flask | app/views.py | views.py | py | 755 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.render_template",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "app.app.route",
"line_n... |
39788060770 | """
Source Code Term Project
นายธณรัฐ เพียรชัยภูมิ 643040011-1
นายพีระณัฐ ศรีสรรพ์ 643040249-8
นางสาวภูริชญดา สนิทชน 643040251-1
"""
import csv
import pandas as pd
import tabulate
import numpy as np
import os
import matplotlib.pyplot as plt
import datetime as dt
class openAccount:
# ฟังก์ชั่นห... | Khaotang911/Account-Progarm | Account.py | Account.py | py | 14,685 | python | th | code | 0 | github-code | 7 | [
{
"api_name": "datetime.date.today",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "tabulate.tabul... |
43215497369 | from bs4 import BeautifulSoup
import requests
#Constants
ZILLOW_URL = "https://www.zillow.com/homes/for_rent/?searchQueryState=%7B%22pagination%22%3A%7B%7D%2C%22mapBounds%22%3A%7B%22west%22%3A-122.90711440039063%2C%22east%22%3A-121.95954359960938%2C%22south%22%3A37.57257324635536%2C%22north%22%3A37.97745533023803%7D%2... | RustyGrackle/Data-Entry-Automation | Website_Scraping.py | Website_Scraping.py | py | 1,824 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
}
] |
44131542048 | import torch
from torchsim.core import get_float, SMALL_CONSTANT
from torchsim.core.models.expert_params import NUMBER_OF_CONTEXT_TYPES, EXPLORATION_REWARD, REWARD_DISCOUNT_FACTOR
from torchsim.core.models.temporal_pooler.buffer import TPFlockBuffer
from torchsim.core.models.temporal_pooler.kernels import tp_process_ke... | GoodAI/torchsim | torchsim/core/models/temporal_pooler/forward_and_backward.py | forward_and_backward.py | py | 48,561 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "torchsim.core.models.temporal_pooler.process.TPProcess",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.dtype",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torchsim.core.models.temporal_pooler.tp_output_projection.TPOutputProject... |
9441840048 | import stripe
from django.contrib import messages
from django.shortcuts import render, reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
# stripe
#==================================================... | mohamadRaafat/WatchW-CS50W-FP | watchw/views.py | views.py | py | 10,748 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "models.Order.objects.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "models.Order.objects",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "models.Order",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "djang... |
74101776862 | import os
import numpy as np
from pathlib import Path
from docx import Document
from pandas import DataFrame
from typing import Dict, Any, List
from docx.shared import Inches
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
class BacktestDocument:
def __init__(self) -> None:
self.document: Document = D... | algo21-219040029/Assignment3 | display/word_template.py | word_template.py | py | 5,383 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "docx.Document",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number":... |
3990867084 | import subprocess
import pyttsx3
import speech_recognition as sr
from datetime import date, datetime
import webbrowser
import subprocess
import os
# the function that turns a text into speech
def speak(text):
engine = pyttsx3.init()
engine.setProperty("rate", 178)
engine.say(text)
engine.runAndWait()
... | dinuionica/Johnny_bot | johnny_bot.py | johnny_bot.py | py | 7,004 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pyttsx3.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Recognizer",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 33,
"usage_type": "call"
},
{
"api_name... |
40067933752 | # https://www.acmicpc.net/problem/9376 문제 제목 : 탈옥 , 언어 : Python, 날짜 : 2020-03-12, 결과 : 실패
"""
회고:
이 문제는 내일 풀고나서 회고를 작성하고 싶다.
밑에 회고 작성했다.
"""
import sys
from collections import deque
list_result = []
T = int(sys.stdin.readline())
dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]
for _ in range(T):
h, w = map(int, sy... | SpicyKong/problems | BOJ/Q_9376.py | Q_9376.py | py | 7,495 | python | ko | code | 3 | github-code | 7 | [
{
"api_name": "sys.stdin.readline",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
... |
23369298819 | from torch import nn
import torch
class BaseConv(nn.Module):
def __init__(self, inc, ouc, k, s):
super().__init__()
self.conv = nn.Conv2d(inc, ouc, k, s, (k-1)//2, 1, 1, False)
self.norm = nn.BatchNorm2d(ouc)
self.act = nn.ReLU(inplace=True)
def forward(self, x):
retu... | FangJingYunner/DMPR-PS_End_to_End | model_slot_det/utils.py | utils.py | py | 1,636 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
71967785502 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 2 16:35:17 2018
@author: Liaowei
"""
import pandas as pd
import numpy as np
import time
import datetime
import matplotlib.pyplot as plt
from sklearn.cross_validation import KFold,train_test_split
from sklearn.metrics import f1_score
import lightgbm as lgb
import itertoo... | dayL-W/Diabetes-prediction | 1_feature_linear.py | 1_feature_linear.py | py | 9,661 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "pylab.mpl.rcParams",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "pylab.mpl",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "pylab.mpl.rcParams",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "pylab.mpl",... |
4277779799 | import tensorflow as tf # noqa
import numpy as np
import os as os
import pickle as pickle
import scipy.linalg as linalg
from ..utils import ocd # noqa
# TODO: Make loader and saver functions for pickle/npz versions
def add_noise_pickle(data_path, noise_scale=0.01, standardize=False):
dataset = pickle.load(open... | SamuelDGeorge/generative_sets | tan/data/helpers.py | helpers.py | py | 5,216 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pickle.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_numb... |
20879442831 | import sys
import os
import pymel.core as pm
import maya.OpenMayaUI as omui
import maya.OpenMaya as OpenMaya
from maya.app.general.mayaMixin import MayaQWidgetDockableMixin
from PySide2 import QtCore
from PySide2 import QtGui
from PySide2 import QtWidgets
from PySide2 import QtUiTools
from PySide2.QtUiToo... | RavioliFinoli/SelectionHistory | SelectionHistory.py | SelectionHistory.py | py | 9,651 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "PySide2.QtWidgets.QListWidgetItem",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "PySide2.QtWidgets",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "maya.OpenMayaUI.MQtUtil.mainWindow",
"line_number": 46,
"usage_type": "call"
}... |
10792478288 | # quickScaleFix.py - Python Script
# DESCRIPTION: Tool for quick scale adjustment
# REQUIRE: Python3
# AUTHOR: BulinThira - GitHub
import maya.cmds as mc
import math
def scaleLayout():
if mc.window('scaleLayout_window', q=True, ex=True):
mc.deleteUI('scaleLayout_window', window=True)
mc.w... | BulinThira/Maya_quickScaleFix | quickScaleFix.py | quickScaleFix.py | py | 5,443 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "maya.cmds.window",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "maya.cmds.deleteUI",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "maya.cmds",
"line_n... |
72780598943 | from artmaps.maps.models import Location
from artmaps.maps.models import Gallery
from artmaps.maps.models import Show
from artmaps.maps.models import Event
from django.contrib import admin
class LocationAdmin(admin.ModelAdmin):
list_display = ('nickname', 'address1', 'city', 'state', 'zipcode', 'url')
class ShowAdmi... | howdiz/artMap | artmaps/maps/admin.py | admin.py | py | 974 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 10,
"usage_type": "attribute"
... |
29231293012 | import copy
import logging
import shutil
from math import exp
import numpy as np
from sklearn.preprocessing import StandardScaler, normalize
from sklearn.utils import shuffle
from tqdm import trange
from lib.bqueue import Bqueue
from lib.dnn import Dnn
from lib.helper import Helper
from lib.som import SOM
logging.basi... | behzadzarfsaz/DualMemoryLearning | lib/model.py | model.py | py | 7,049 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "shutil.get_te... |
38264649267 | import csv
from flask import Flask,render_template,request,redirect
app = Flask(__name__)
students=[]
@app.route("/")
def home_page():
return render_template("home.html")
@app.route("/register",methods=['POST'])
def register():
if not request.form.get("name") or not request.form.get('dorm') :
re... | NIVEDITHA0808/fluffy-octo-waffle | FLASK_APP/application1.py | application1.py | py | 809 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.form.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request... |
35121564496 | import json
import os
import re
import sqlite3
import numpy as np
import pandas as pd
import global_imports
from src import write_to_excel, report
def import_database_from_sql(sql_query, db_path):
"""Imports database from db or sqlite file as a pandas dataframe. Provide the SQL query and database path
as argume... | aravindpanil/hard_to_choose | src/main_csv_generator.py | main_csv_generator.py | py | 11,520 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "numpy.arange",
"li... |
5042188936 | import cv2
import numpy as np
fld = cv2.ximgproc.createFastLineDetector()
"""
The array is colored
"""
def get_otsu_threshold(img:np.ndarray):
gray_img= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
return cv2.threshold(gray_img,100,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)[1]
def get_kmeans_on_image(img:np.ndarray):
... | seif7666/OpenCV-Sessions | Session3/recap.py | recap.py | py | 1,985 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.ximgproc.createFastLineDetector",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.ximgproc",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": ... |
15986954215 | import os
import pygraphviz
import inherit_relation as ir
from clang.cindex import Index
kInputsDir = os.path.join(os.path.dirname(__file__), 'cpp')
def draw(G, output_filename):
G.layout(prog='dot')
G.draw(output_filename)
def build():
cpp_file_path = os.path.join(kInputsDir, 'main.cpp')
index = Ind... | shaochuan/clang-tools | simple_inherit_graph_demo.py | simple_inherit_graph_demo.py | py | 621 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
35501825583 | import time
import sys as eeeeee
from webbrowser import open_new_tab as eeeeeeeeeeeeeeeeee
from plyer import notification as eeee
from typing import List as eee
from base64 import urlsafe_b64decode as e
from traceback import format_exception as eeeeeeeeeeee
def not_my_toes(*args, **kwargs):
print(*args, **kwargs)... | ForixM/abba | garbage.py | garbage.py | py | 1,259 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "base64.urlsafe_b64decode",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "webbrowser.open_new_tab",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "base64.u... |
21156725486 | import random
import math
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from tqdm import tqdm
from torch.utils.data import DataLoader
from torchvision.transforms import Compose, ToTensor, Lambda
from torchvision.datasets.mnist import MNIST
seed = 42069
random.seed(seed)
np.ran... | aljhn/ddpm | conditional_ddpm.py | conditional_ddpm.py | py | 17,666 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
... |
23552880495 | import falcon
import json
import pandas as pd
import pickle
import io,sys
import pandas.core.indexes
import numpy as np
sys.modules['pandas.indexes'] = pandas.core.indexes
from sklearn.preprocessing import LabelEncoder,OneHotEncoder
import lime
import lime.lime_tabular
class Data():
def __init__(self):
sel... | fufufukakaka/lime-juice | backend/utils.py | utils.py | py | 10,297 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.modules",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.core",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "nu... |
30550323844 | """QGIS Unit tests for the OGR/GPKG provider.
From build dir, run:
ctest -R PyQgsOGRProviderGpkg -V
.. note:: 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 ... | qgis/QGIS | tests/src/python/test_provider_ogr_gpkg.py | test_provider_ogr_gpkg.py | py | 129,735 | python | en | code | 8,946 | github-code | 7 | [
{
"api_name": "utilities.unitTestDataPath",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "qgis.testing.QgisTestCase",
"line_number": 77,
"usage_type": "name"
},
{
"api_name": "providertestbase.ProviderTestCase",
"line_number": 77,
"usage_type": "name"
},
{... |
33984802714 | import json
def AddNameBytes(DataFrame, str):
for char in str:
DataFrame.append(ord(char))
return DataFrame
# ACK byte = 0x00: reserved for future use
# CMDNUMBER (2 bytes): 0x00 0xxx
def Error_FrameEncode(Payload):
temp = json.loads(Payload) # parse JSON payload
ID = int(temp["ID"])
... | qbaonguyen98/Automatic-Dispenser-System | PiClient/framedata.py | framedata.py | py | 4,544 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 58,
... |
5393363057 | import pytest
import torch
from inseq.utils.misc import pretty_tensor
from inseq.utils.torch_utils import filter_logits
@pytest.mark.parametrize(
("tensor", "output"),
[
(None, "None"),
(torch.tensor([1, 1], dtype=torch.long), "torch.int64 tensor of shape [2]"),
(
torch.te... | inseq-team/inseq | tests/utils/test_torch_utils.py | test_torch_utils.py | py | 2,694 | python | en | code | 223 | github-code | 7 | [
{
"api_name": "torch.Tensor",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "inseq.utils.misc.pretty_tensor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 8,
"usage_type": "call"
},
{
"api_name"... |
13270463153 | # -*- python2.7 -*
# -*- coding: utf-8 -*
import cv2
import numpy as np
SRC = "image/lena.jpg"
CASCADE = "cascade/haarcascade_frontalface_default.xml"
MAG = 0.2
image = cv2.imread(SRC) # 画像の取得
image_face = image.copy() # 顔認識結果描画用
cascade = cv2.CascadeClassifier(CASCADE) # 顔探索用のカスケード型分類器を... | YK-Orfeluna/Yonesemi_Scripts | 2017_Ando/face/face.py | face.py | py | 1,478 | python | ja | code | 0 | github-code | 7 | [
{
"api_name": "cv2.imread",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line... |
38823343434 | import argparse
import benchmarks
import os
import planning
import sys
import json
import networkx as nx
import matplotlib.pyplot as plt
from benchmarks import *
from networkx.drawing.nx_agraph import graphviz_layout
from moz_sql_parser import parse
from enum import Enum
from planning import *
def load_schema(... | alanamarzoev/MultiverseDSL | planning-prototype/prototype.py | prototype.py | py | 3,891 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "networkx.DiGraph",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "networkx.drawing.nx_agraph.graphviz_layout",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "networkx.draw",
"line_number": 103,
"usage_type": "call"
},
{
"api_n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.