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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
43531825283 | import pygame
WallCors = []
class Character:
StartingPositionX = 0
StartingPositionY = 0
Speed = 0
size = [0,0]
position = dict(x = StartingPositionX,y= StartingPositionY)
def __init__(self):
StartingPositionX = self.StartingPositionX
StartingPositionY = self.StartingPositionY
position = self.position
... | Robo-Stud-Lab/OS-Lab-Tasks | Lab 3 Game/Entity/Character.py | Character.py | py | 1,673 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pygame.Rect",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pygame.draw.rect",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 40,
"usage_type": "attribute"
}
] |
36311927152 | # Python 3.6 introduced a new implementation of dict.
# dict now keeps its items ordered as well.
# An OrderedDict is a dictionary subclass that remembers the order in which its contents are added.
from collections import OrderedDict
if __name__ == "__main__":
order_dic = OrderedDict()
order_dic['a'] = 'A'
... | twtrubiks/python-notes | OrderedDict_tutorial.py | OrderedDict_tutorial.py | py | 1,278 | python | en | code | 94 | github-code | 7 | [
{
"api_name": "collections.OrderedDict",
"line_number": 8,
"usage_type": "call"
}
] |
72865708062 | import torch.nn as nn
from mmcv.cnn import build_norm_layer
from ..builder import NECKS
@NECKS.register_module()
class Feature2Pyramid(nn.Module):
"""Feature2Pyramid.
A neck structure connect ViT backbone and decoder_heads.
Args:
embed_dims (int): Embedding dimension.
rescales (list[flo... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/semantic_segmentation/MMseg-swin/mmseg/models/necks/featurepyramid.py | featurepyramid.py | py | 2,369 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
27758881257 | from django.shortcuts import render
from .models import Pilotos, Corridas, Circuitos
# Create your views here.
def index(request):
return render(request, 'index.html')
def detalhe_pilotos(request, pk):
pilotos = Pilotos.objects.get(pk=pk)
pilotos_quantidade = Pilotos.objects.all()
context = {
... | iuryeng/formula-analytcs-one | dashboard/views.py | views.py | py | 1,809 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Pilotos.objects.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Pilotos.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api... |
70723632865 | import discord
from discord.ext import commands
from datetime import datetime
intents = discord.Intents.all()
intents.members = True
bot = commands.Bot(command_prefix='!',intents=intents)
serverID = ""
with open('serverID.txt') as f:
serverID = f.readline()
serverID = int(serverID)
bot.newChanBitrate = 9600
bot.... | GitZero1/OldFartsDiscordBot | OFWelcomeBot.py | OFWelcomeBot.py | py | 6,473 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "discord.Intents.all",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "discord.Intents",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "discor... |
14267958137 | import math
import heapq
import numpy as np
import random
from collections import namedtuple, deque
from model import QNetwork
import torch
import torch.nn.functional as F
import torch.optim as optim
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
class experience:
"""Represents an exper... | jcvacaro/dqn-agent | memory.py | memory.py | py | 6,911 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "torch.device",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "collections.dequ... |
25040041677 | import sys
sys.path.insert(1, '../')
import numpy as np
import pandas as pd
import os
import shutil
from datetime import datetime
metadata_dob = pd.read_csv('itmt_v2/cvs_files/metadata_bch_scan_date.csv', header=0)
def find_age_gender(id_to_find):
for idx, row in metadata_dob.iterrows():
if str(id_to_fi... | AIM-KannLab/itmt | itmt_v2/curate_cancer_cases.py | curate_cancer_cases.py | py | 1,642 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.path.insert",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptim... |
27815408765 | from keras.models import Model
from keras.models import load_model
from keras.layers import Input, Convolution2D, MaxPooling2D, Dense, Dropout, Activation, Flatten
from keras.utils import np_utils # utilities for one-hot encoding of ground truth values
from CNNParameters import batch_size, num_epochs, kernel_size, pool... | JiapengWu/COMP-551-A3 | cnn/create_resnet.py | create_resnet.py | py | 4,325 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.load",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "sklearn.p... |
36845967479 | # 버튼 활성화 유무에 따른 동작
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QFrame, QPushButton
from PyQt5.QtGui import QColor
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
# 컬러를 지정하기 위한 컬러 객체 생성 초기값 (0, 0, 0)검정
self.col =... | lyj911111/PyQT5-Tutorial | 8_여러가지 위젯들/2_버튼활성화에 따른 이벤트, 버튼을 눌렀을 때 frame에 해당색상을 가함.py | 2_버튼활성화에 따른 이벤트, 버튼을 눌렀을 때 frame에 해당색상을 가함.py | py | 2,265 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QColor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QPushButton",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": ... |
13834849456 | from time import sleep
import random
import yaml
from threading import Thread
import logging
import threading
import common
import cecclient
import mqttclient
def init(config):
logging.basicConfig(filename='stereo.log', level=logging.INFO, format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
conf... | awkimball/hass-mqtt-cec-universal-media-player | stereo.py | stereo.py | py | 3,944 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "yaml.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
... |
27352072463 | from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import ( QWidget)
class BottomToolbar(object):
def __init__(self,parent):
self.parent = parent
def Mainpage (self, Widget):
self.tollbar1 = QtWidgets.QWidget(Widget)
self.tollbar1.setGeometry(QtCore.QRect(31, 470, 981, ... | hendrikdash/FinalProject_PlateRecognition_BaseVideo | FormControl/BottomToolbar.py | BottomToolbar.py | py | 3,079 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.QRect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCo... |
33404327680 | """
Minimalistic video player that allows visualization and easier interpretation of FAR-VVD results.
"""
import argparse
import difflib
import itertools
import logging
import math
import os
import re
import sys
import time
import uuid
from utils import (
ToolTip,
draw_bbox,
parse_timestamp,
read_metafi... | crim-ca/FrVD-visualization-tool | source/viewer.py | viewer.py | py | 83,262 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.splitext",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"... |
12644174755 | # cnn이란 이미지 (특징을 추출한다.)
from keras.models import Sequential
filter_size = 32
kernel_size = (3,3)
from keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
model = Sequential()
model.add(Conv2D(7, (2,2), # padding='same',
input_shape = (28, 28, 1)))
#model.add(Conv2D(아웃풋노드개수), (2,2)... | mti7086/keras | keras21_cnn1.py | keras21_cnn1.py | py | 817 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "keras.models.Sequential",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "keras.layers.Flatten",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras... |
21879146505 | def store(deliveries, innings, db):
entries = []
for i in range(len(deliveries)):
keys = deliveries[i].keys()
for j in keys:
ball = deliveries[i][j]
bowler = ball['bowler']
batsman = ball['batsman']
runs = int(ball['runs']['batsman'])
extras = int(ball['runs']['extras'])
total = int(ball['runs']... | sumitshyamsukha/CricketSheet | store2.py | store2.py | py | 1,510 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "yaml.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 25,
"usage_type": "call"
}
] |
41367765954 | from pytorch_pretrained_bert import BertTokenizer, BertModel, BertForMaskedLM
import numpy as np
from pytorch_transformers import BertConfig
import pandas as pd
import os
import argparse
import pickle
import platform
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--max_seq_length', ... | sweetbao/PRS-PM-IS04FT-GRP10-Public-Opinion-Analysis-System | backend/TextEmotion/SentimentModel/extract_feature.py | extract_feature.py | py | 5,792 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pytorch_pretrained_bert.BertTokenizer.from_pretrained",
"line_number": 27,
"usage_type": "call"
... |
72869795422 | import pickle as pkl
import sys
import torch
"""
Usage:
# download one of the ResNet{18,34,50,101,152} models from torchvision:
wget https://download.pytorch.org/models/resnet50-19c8e357.pth -O r50.pth
# run the conversion
./convert-torchvision-to-d2.py r50.pth r50.pkl
# Then, use r50.pkl with the following... | Ascend/ModelZoo-PyTorch | PyTorch/dev/cv/image_classification/SlowFast_ID0646_for_PyTorch/detectron2/tools/convert-torchvision-to-d2.py | convert-torchvision-to-d2.py | py | 1,534 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "torch.load",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "pickle.dump",
"line_number... |
17716390245 | """warehouse URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | jialu001/git | warehouse/urls.py | urls.py | py | 2,407 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "extra_apps.to_log.to_des",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "extra_apps.to_log",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "djan... |
15412865181 | # -*- coding: utf-8 -*-
'''
Reuben Brewer, Ph.D.
reuben.brewer@gmail.com
www.reubotics.com
Apache 2 License
Software Revision G, 07/18/2023
Verified working on: Python 3.9 for Windows 10 64-bit and Raspberry Pi Bullseye.
'''
__author__ = 'reuben.brewer'
##############################################... | Reuben-Brewer/SelfBalancingRobot1 | SelfBalancingRobot1.py | SelfBalancingRobot1.py | py | 245,548 | python | de | code | 0 | github-code | 7 | [
{
"api_name": "platform.system",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "sys.version_info",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "platform.system",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "ctypes.WinDLL",... |
42901041748 | import ASUS.GPIO as GPIO
import time
import importlib
defaults = importlib.import_module('ircgpio.ircauxiliary.defaults')
parser = importlib.import_module('ircgpio.ircauxiliary.parser')
amendment = []
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
pin=7
ir_sensor_th = 36
GPIO.setup(pin, GPIO.IN)
def clearlst(lst, ... | asidaras/ircgpio | irrecord.py | irrecord.py | py | 6,201 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "importlib.import_module",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "ASUS.GPIO.setwarnings",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "AS... |
24560272197 | from __future__ import annotations
import logging
from typing import Optional
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_community.tools.edenai.edenai_base_tool import EdenaiTool
logger = logging.getLogger(__name__)
class EdenAiObjectDetectionTool(EdenaiTool):
"""Tool that q... | langchain-ai/langchain | libs/community/langchain_community/tools/edenai/image_objectdetection.py | image_objectdetection.py | py | 2,476 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "langchain_community.tools.edenai.edenai_base_tool.EdenaiTool",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 72,
"usage_type": "name"
... |
14054506692 | #########################################################
# This class is responsible for parsing the image file #
# using PIL we get data of all the pixels in the image #
#########################################################
from PIL import Image
class ImageParser:
def __init__(self, file_name):
se... | alojzmilicevic/mazes | image_parser.py | image_parser.py | py | 1,013 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PIL.Image.open",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 15,
"usage_type": "name"
}
] |
35580384350 | # -*- coding: utf-8 -*-
import os
from flask import Flask, jsonify, request
from __init__ import app, db
from models import Resource
# sanity check route
@app.route('/ping', methods=['GET'])
def ping_pong():
return jsonify('pong!')
@app.route('/resource', methods=['GET', 'POST'])
def all_resources():
respon... | RoseBud13/flask-practice | flask-restful-api/app.py | app.py | py | 879 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.jsonify",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "__init__.app.route",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "__init__.app",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.request.method",
... |
20823004090 | from dagster import (
job,
op,
repository,
ScheduleDefinition,
DefaultScheduleStatus,
DagsterInstance
)
from datetime import datetime
from feeds_importing_worker.apps.models.models import Feed
from feeds_importing_worker.apps.services import FeedService
from feeds_importing_worker.apps.models.p... | hulahoo/feeds-sonar-check | src/feeds_importing_worker/worker.py | worker.py | py | 4,132 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "feeds_importing_worker.apps.services.FeedService",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "feeds_importing_worker.apps.models.provider.FeedProvider",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "feeds_importing_worker.apps.models.prov... |
38009400550 | # Databricks notebook source
# MAGIC %md-sandbox
# MAGIC
# MAGIC <div style="text-align: center; line-height: 0; padding-top: 9px;">
# MAGIC <img src="https://databricks.com/wp-content/uploads/2018/03/db-academy-rgb-1200px.png" alt="Databricks Learning" style="width: 600px">
# MAGIC </div>
# COMMAND ----------
# M... | MinusOneByTwelve/MiscStuff | DB/Temp/ml/deep-learning-with-databricks/Solutions/DL 01 - Linear Regression.py | DL 01 - Linear Regression.py | py | 10,034 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
1756410370 | from flask import Flask, request, jsonify
import ratelimit
import logger
import cache
import tools
app = Flask(__name__)
ssl_cert = ""
ssl_key = ""
limiter = ratelimit.Enable(app)
@app.errorhandler(429)
def ratelimit_handler(e):
msg = 'User triggered rate-limit ({})'.format(ratelimit.getIP())
logger.warning... | martijnrondeel/Steam-Profile-Background | api/api.py | api.py | py | 1,554 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ratelimit.Enable",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ratelimit.getIP",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logger.warning",
"lin... |
20905775391 | import random
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute, Aer
"""
IMPROVEMENTS
- figure out an easier for way for people to see the results rather than
having to access public variable result
"""
class QuantumCoinFlip: # Maybe change this name later to something more generic a... | seunomonije/quantum-programming-api | qapi/utilities/random_number_generation/quantum/rng.py | rng.py | py | 2,000 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "qiskit.QuantumRegister",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "qiskit.ClassicalRegister",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "qiskit.QuantumCircuit",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": ... |
33782353319 | #!/usr/bin/python
import sys, argparse, subprocess, time, os, re, glob, numpy as np
from ftplib import FTP
# Globals
path_to_data = ''
path_to_ref = ''
path_to_results = os.path.dirname(os.path.abspath(__file__))
index_genome = False
verbosity = False
threads = 1
deleteResultFiles = False
def create_directory(mypath... | kyleaoconnell22/BDS_genomics_tutorial | scripts/execute_mapping.py | execute_mapping.py | py | 13,672 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_... |
37450499247 | import time
import pytest
from src.forge_cfg import world
from src.protosupport.dhcp4_scen import get_address, get_rejected
from src.protosupport.dhcp4_scen import get_address4, get_address6
from src.protosupport.dhcp4_scen import send_decline4, send_decline6
from src.protosupport.dhcp4_scen import send_request_and_c... | isc-projects/forge | tests/config_backend/test_globals.py | test_globals.py | py | 11,490 | python | en | code | 30 | github-code | 7 | [
{
"api_name": "pytest.mark",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "src.softwaresuppor... |
8885262762 | import sqlite3
import uuid
from Loginsysteem import BezoekerInfo as _BezoekerInfo
"""
- Johan de Graaf, 30-10-2015
"""
class GebruikerDatabase:
@classmethod
def __verbind_met_database(cls):
"""
:return: sqlite3.Connection, object waarmee er gelezen en geschreven kan worden naar de databas... | MStronghold/Miniproject | Loginsysteem/GebruikerDatabase.py | GebruikerDatabase.py | py | 5,114 | python | nl | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlite3.OperationalError",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlite3... |
32086434750 | # coding=utf-8
import requests
from bs4 import BeautifulSoup
import datetime
import time
import json
from website_crawler.crawler import Crawler
class HeiMa(Crawler):
update_stop = 0 # stop crawler.
headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) "
"A... | jfqiao/who.focus_crawler | website_crawler/hei_ma.py | hei_ma.py | py | 4,561 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "website_crawler.crawler.Crawler",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "websit... |
71935780063 | import argparse
import logging
import os
import shutil
import sys
import tempfile
from cros.factory.utils.process_utils import Spawn
# A pattern in TEMPLATE to be replaced with real module list.
MODULES_PATTERN = '__MODULES_HERE__'
# The template is a stub to be inserted in the beginning of output PAR file.
TEMPLAT... | arccode/factory | py/tools/tiny_par.py | tiny_par.py | py | 4,433 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "os.path.dirname",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
13947495747 | import sublime
import sublime_plugin
import re
import http.client
import hashlib
import urllib
import random
import json
from .config import appid, secretKey
def baidu_translate(word):
myurl = 'http://api.fanyi.baidu.com/api/trans/vip/translate'
from_lang = 'auto'
to_lang = 'en'
salt = random.randint... | KirinDr/Translator-Sublime | Translator.py | Translator.py | py | 2,826 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "random.randint",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "config.appid",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "config.secretKey",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "hashlib.md5",
"line_... |
72430367583 | """
#last edit 27/10/2023 (ver.9)
*Compleat??? Edit By NN
!------------------------------------------------------------
TODO:Mini Project Programming Fundamental KMUTNB BKK Thailand
=> By Noppasin Renruang CprE. 6601012620119
?ref. https://www.geeksforgeeks.org/how-to-find-the-index-of-value-in-numpy-arra... | Sukito53/Otello | main.py | main.py | py | 36,500 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.sum",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.where",
... |
73724042462 | from typing import Tuple
import numpy as np
import torch
import PIL
from torchvision.transforms import transforms
from PIL import Image
from config.exception import InvalidImageModeException
class JitCycleGANModel:
# i extract transform condition from original cycle gan repo
transform = transforms.Compose... | heojae/CartoonizedGanAPI | model.py | model.py | py | 2,337 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "torchvision.transforms.transforms.Compose",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.transforms",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.transforms.Resize",
"line_number": 17,
... |
35063651481 | import sys
from time import sleep
import pygame
from bullet import Bullet
from alien import Alien
from alien_creator import *
def check_events(ai_settings, screen, stats, sb, play_button, ship, aliens, bullets):
""" 响应 """
for event in pygame.event.get():
if event.type == pygame.QUIT:... | klhsag/pygame_practice | alien_alpha/game_functions.py | game_functions.py | py | 5,946 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pygame.event.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.event",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.QUIT",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"l... |
14297257672 | # -*- coding: utf-8 -*-
import streamlit as st
from PIL import Image
import cv2
import numpy as np
def main():
selected_box = st.sidebar.selectbox(
'Choose any one',
('Welcome','Image Processing', 'Video', 'Face Detection', 'Object Detection')
)
if selected_box == 'Welcome':
welc... | dishachopra/Image-Processing-with-Streamlit | myapp.py | myapp.py | py | 5,211 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "streamlit.sidebar.selectbox",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "streamlit.sidebar",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "streamlit.title",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "st... |
74465146144 | #Import libraries
import streamlit as st
import matplotlib.pyplot as plt
import pandas as pd
from pickle import load
#
st.title('2016 Election Modeling')
st.markdown('See how your county voted in the 2016 election relative to its regression predicted vote proportion')
#
df = pd.read_csv('Data/election_full_dataset.cs... | blantj/2016_election_modeling_v2 | app.py | app.py | py | 1,266 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "streamlit.title",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "streamlit.selectbox"... |
31321409656 | # coding=utf-8
import xlrd
def read_xlrd(excelFile):
data = xlrd.open_workbook(excelFile)
table = data.sheet_by_index(0)
dataFile = []
for rowNum in range(table.nrows):
# if 去掉表头
if rowNum > 0:
dataFile.append(table.row_values(rowNum))
return dataFile
if __name__ ==... | mychristopher/test | pyfirstweek/excel与python交互/pyexcel3.py | pyexcel3.py | py | 482 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 6,
"usage_type": "call"
}
] |
7618135572 | # -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
# -------------------------------------------------------------------------
# This is the main controller
# - index is the default action of any application
# - user is required for authentication and authorization
... | uptane/uptane_web_app | applications/UPTANE/controllers/default.py | default.py | py | 37,367 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "xmlrpc.client.client.ServerProxy",
"line_number": 137,
"usage_type": "call"
},
{
"api_name": "xmlrpc.client.client",
"line_number": 137,
"usage_type": "attribute"
},
{
"api_name": "xmlrpc.client",
"line_number": 137,
"usage_type": "name"
},
{
"api_n... |
24493008660 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Description
"""
import sys
import os
import argparse
import random
import numpy as np
import torch
from ptranking.utils.args.argsUtil import ArgsUtil
from ptranking.ltr_adhoc.eval.ltr import LTREvaluator, LTR_ADHOC_MODEL
from ptranking.ltr_tree.eval.ltr_tree import T... | houcharlie/ltr-pretrain | e2e_eval.py | e2e_eval.py | py | 6,906 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "random.seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
... |
40728648918 | """
views for application geokret
"""
import re
from datetime import datetime
from lxml import etree
from django.http import HttpResponse
from django.shortcuts import render
from django.template.loader import render_to_string
from django.db.models import Max
from django.utils.translation import ugettext_lazy as _
fr... | kostin-aleks/gpsfun | gpsfun/gpsfun/geokret/views.py | views.py | py | 16,312 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "gpsfun.main.models.LogUpdate.objects.filter",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "gpsfun.main.models.LogUpdate.objects",
"line_number": 65,
... |
71486952224 | import glob
import os
import pickle
import re
from typing import Dict
import matplotlib.pyplot as plt
import pandas as pd
def load_lasso_data(data_dir):
if not data_dir.endswith("/"):
data_dir += "/"
input_files = glob.glob(data_dir + "log2*pkl")
Abs = [os.path.split(i)[-1].split("_mic")[0] + "_m... | bjeffrey92/unitig_AMR_prediction | scripts/plot_cv_results.py | plot_cv_results.py | py | 8,629 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "glob.glob",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number":... |
72198647584 |
# std
import multiprocessing as mp
# local
from recipes.logging import LoggingMixin
class ConservativePool(mp.pool.Pool):
"""
Subclass of Pool which avoid making a potentially huge list when mapping over a function
and is therefor more memory efficient
"""
def _map_async(self, func, iterable, ... | astromancer/recipes | src/recipes/parallel/pool.py | pool.py | py | 7,928 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "multiprocessing.pool",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.pool.MapResult",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "multiprocessing.pool",
"line_number": 29,
"usage_type": "attribute"
},
{
... |
43406239887 | from matplotlib import pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei'] #设置中文
plt.rcParams['font.family'] = 'sans-serif'
colorlist = ['r', 'b', 'g', 'y']
def mat_zhu(size_list, name_list):
#调节图形宽、高
plt.figure(figsize = (6,6))
#横向柱状图
#plt.barh(name_list,size_list,height=0.5,color=colorlist)
... | huangleiCCIE/Pythoncentos | 图/Netflow_柱状图.py | Netflow_柱状图.py | py | 1,383 | python | zh | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 2,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 3,
"usage_type": "attribute"
},
{
"ap... |
37920533645 | from urllib.error import URLError
from django.conf import settings
from django.core.mail import send_mail
from apps import celery_app
from apps.proxy.models import ProxyNode, UserTrafficLog
from apps.sspanel import models as m
from apps.utils import get_current_datetime
@celery_app.task
def debug_task():
u = m.... | Ehco1996/django-sspanel | apps/sspanel/tasks.py | tasks.py | py | 4,673 | python | en | code | 3,002 | github-code | 7 | [
{
"api_name": "apps.sspanel.models.User.objects.first",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "apps.sspanel.models.User",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "apps.sspanel.models",
"line_number": 14,
"usage_type": "name"
},
... |
31881069441 | import MySQLdb as sql
import RPi.GPIO as GPIO
import time
from datetime import datetime
btn = 0
pin_1 = 15
pin_2 = 18
cnt = 1
db = sql.connect("localhost", "pi", "1234", "timeTable")
cur = db.cursor()
query = "INSERT INTO dbTable (num, btn, time) VALUES (%s, %s, %s)"
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GP... | sueundev/2022_2_IOT-SYSTEM-APPLICATION | Assignments 2/MariaDB활용_시간기록.py | MariaDB활용_시간기록.py | py | 1,690 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "MySQLdb.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO.setwarnings",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.setmode",
... |
10277849006 | #!/usr/bin/env python
# encoding=utf-8
# maintainer: rgaudin
import inspect
import reversion
from django.db import models
from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.utils.translation import ugettext_lazy as _
from bolibana.models import EntityType, Repor... | yeleman/pnlp2011 | pnlp_core/models/MalariaReport.py | MalariaReport.py | py | 19,652 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "bolibana.models.Report",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 26,
"usage_type": "... |
12984074999 | #!/usr/bin/env python
from __future__ import print_function
from collections import defaultdict, namedtuple
from operator import add
from math import floor
class AutoInc(object):
# ''' Get a uniquely auto-incremented integer value '''
__slots__ = ('v',)
def __init__(self, value=0):
self.v = i... | fish2000/rolodexer | rolodexer/histogram.py | histogram.py | py | 6,955 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "pprint.pformat",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "{'pformat': 'pprint.pformat'}.lexcmp",
"line_number": 77,
"usage_type": "attribute"
},
{
"... |
5951473497 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.preprocessing import PowerTransformer, QuantileTransformer
from sklearn.datasets import make_classification
from sklearn.mixture import GaussianMixture
from sklearn.decomp... | SarthakJain333/Kaggle_TPS_July | tps_july.py | tps_july.py | py | 2,662 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
8317963428 | from django.shortcuts import render
import requests
from lxml import html
from requests.compat import quote_plus
# Create your views here.
def home (request):
return render(request, 'base.html')
def new_search(request):
search = request.POST.get('search')
print(search)
session = requests.Session()
... | Navneet78/codedaddies | myapp/views.py | views.py | py | 1,698 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests.compat.quote_plus",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re... |
71040015263 | import abc
import logging
import os
import socket
import uuid
from copy import deepcopy
from twisted.internet.defer import Deferred
from twisted.python.failure import Failure
from types import MethodType
from typing import Optional
import requests
logger = logging.getLogger(__name__)
class ClientError(Exception):
... | golemfactory/clay | golem/resource/client.py | client.py | py | 8,568 | python | en | code | 2,915 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 101,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 107,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
... |
40173050938 | #!/usr/bin/python
# update 2017-09-07 23:45
from flask import Flask, jsonify, make_response, request
from redis import Redis
import os
r = Redis(host = os.environ['REDIS_HOST'], port = 6379)
app = Flask(__name__)
@app.errorhandler(404)
def not_found(error):
return make_response(jsonify({'error': 'Not found'}), 4... | cloudtogo/comment | comment_redis.py | comment_redis.py | py | 1,104 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "redis.Redis",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.make_response",
"line_... |
41435500304 | from requests_oauthlib import OAuth1Session
# User must create their own secrets.py with the following:
# 1) client_key: Consumer Key(API Key)
# 2) client_secret: Consumer Secret (API Secret)
# 3) access_token
# 4) access_token_secret
import secrets
client_key = secrets.client_key
client_secret = secrets.client_secret... | p1ho/lec10ex | oauth-twitter-withkeys.py | oauth-twitter-withkeys.py | py | 857 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "secrets.client_key",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "secrets.client_secret",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "secrets.access_token",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_n... |
12865472894 | from tkinter import *
from functools import partial
import random
import sys
sngle_creds = 500 # Intial value of credits
sngle_bets = 0 # and bets
root = Tk()
root.title("Home")
home_frame = Frame(root, width=600, height=400, bg="maroon")
home_frame.grid()
home_header = Label(home_frame,
text=... | Pranav2625/Pranav_AS_Home | main.py | main.py | py | 20,744 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "functools.partial",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 154,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 156,
"usage_type": "call"
},
{
"api_name": "random.randint",
... |
33945967188 | # -*- coding:utf-8 -*-
'''
@ author Yanqun Pan.
@ 09/14 2018
@ State Key Laboratory of Esturine and Coastal Research,East China Normal University
'''
import time
from datetime import datetime
import datetime as dt
from Cprotocol import *
import Cprotocol
import numpy as np
import math,os
from apscheduler... | peterpan83/CloudPlatform | CloudPlatform.py | CloudPlatform.py | py | 15,775 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.timedelta",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"l... |
35967927357 | import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from google.appengine.dist import use_library
use_library('django', '1.2')
import logging
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from util.sessions import Session
from google.appengine.... | matrixki/Protfolio---Google-App-Engine | index.py | index.py | py | 10,764 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.dist.use_library",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.db.Model",
"line_number": 14,
"usage_type": "attribute"
},
{
... |
16116173808 | from flask import Flask, render_template, request
import pandas as pd
from model_train import train_data,input_transform
model = None
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
@app.route('/train', methods=['POST'])
def train_model():
global mo... | johncuevas51/Project_4_Group7 | run.py | run.py | py | 1,851 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.files",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "flask.reque... |
23393732082 | from builtins import str
from builtins import object
from bson import json_util
from unicodecsv import DictWriter
from datetime import datetime
import json
import os
from ordered_set import OrderedSet
from mongoengine import Q
from mongoengine.fields import ReferenceField
from openelex import COUNTRY_DIR
from openel... | openelections/openelections-core | openelex/base/bake.py | bake.py | py | 26,213 | python | en | code | 175 | github-code | 7 | [
{
"api_name": "builtins.object",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "builtins.object",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "future.utils.with_metaclass",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "builtins.... |
11309294444 | from collections import Counter
#clean data
#Aux Functions
#break down each column by row types which are a string into a list and concat them Ex: "AI, FinTech, Life Sciences" -->> ["AI, FinTech, Life Sciences"]
def count_verticals(data, col_name):
verticals_list = []
#iterate over the entire "verticals"... | deanmeyer10/VC_Investments_2020_Trends | modules/cleaning.py | cleaning.py | py | 869 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "collections.Counter",
"line_number": 16,
"usage_type": "call"
}
] |
35100141331 | import yaml
class Hero:
def __init__(self, name, hp, sp):
self.name = name
self.hp = hp
self.sp = sp
def __repr__(self):
return "̀%s(name=%r, hp=%r, sp=%r)" % (self.__class__.__name__, self.name, self.hp, self.sp)
hero = Hero('hoan', hp=1, sp=2)
print("print with repr:... | HoanVanHuynh/Setting-up-a-Python-Development-Environment-and-Complete-Overview- | dump_instances.py | dump_instances.py | py | 420 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "yaml.dump",
"line_number": 12,
"usage_type": "call"
}
] |
2970875432 | from __future__ import unicode_literals
from sopel.module import commands, unblockable, HALFOP
from random import choice, randint
from re import search
import sched
import time
colors = ['Red', 'Yellow', 'Blue', 'White', 'Black']
sch = sched.scheduler(time.time, time.sleep)
fuse = 60 # seconds
bombs = dict()
@comma... | maxpowa/inumuta-modules | bomb.py | bomb.py | py | 3,522 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "sched.scheduler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sopel.module.HALFOP",
... |
32793167833 | from collections import ChainMap
import math
from natsort import natsorted
import numpy as np
import pandas as pd
from scipy import spatial
from libtiger.hunter.isotope_score import IsotopeHunter
from libtiger.reader import mzml_spectra_reader
def get_star_isotope_score(score_summary: dict, isotope_score: float = 7... | LMAI-TUD/lpptiger2 | libtiger/hunter/score_generator.py | score_generator.py | py | 31,373 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "libtiger... |
5607129226 | # The Snowpark package is required for Python Worksheets.
# You can add more packages by selecting them using the Packages control and then importing them.
#import snowflake.snowpark as snowpark
import numpy as np
import matplotlib.pyplot as plt
import snowflake.connector
import pandas as pd
#from snowflake.snowpark.f... | onlyjazz/baseball-metrics-research | makepandas.py | makepandas.py | py | 9,337 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "snowflake.connector.connector.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "snowflake.connector.connector",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "snowflake.connector",
"line_number": 10,
"usage_type": "name"
... |
72869885022 | import torch
import os
import torch.distributed as dist
import torch.npu
import os
NPU_CALCULATE_DEVICE = 0
if os.getenv('NPU_CALCULATE_DEVICE') and str.isdigit(os.getenv('NPU_CALCULATE_DEVICE')):
NPU_CALCULATE_DEVICE = int(os.getenv('NPU_CALCULATE_DEVICE'))
if torch.npu.current_device() != NPU_CALCULATE_DEVICE:
... | Ascend/ModelZoo-PyTorch | PyTorch/dev/cv/image_classification/Swin-Transformer_ID2377_for_PyTorch/utils.py | utils.py | py | 2,488 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.npu.current_device",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.npu",
"line_numbe... |
16894396184 | import json
import paho.mqtt.client as mqtt
from threading import Lock
activeSensors = []
sensorMutex = Lock()
def get_sensors_for_render():
sensors = []
with sensorMutex:
for sensor in activeSensors:
sensors.append({
"id": sensor.id(),
"type": sensor.type(... | jpxor/burlo | controller/sensors.py | sensors.py | py | 3,291 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "threading.Lock",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client.Client",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "paho.mqtt.client",
"line_number": 53,
"usage_type": "name"
},
{
"api_name": "json.loads",
... |
71718238942 | from fastapi import FastAPI, Request, Response, status, HTTPException
from fastapi.responses import FileResponse
from starlette.templating import Jinja2Templates
import psycopg2
from psycopg2.extras import RealDictCursor
import time
from pydantic import BaseModel
app = FastAPI()
templates = Jinja2Templates("app/temp... | amirbahador-hub/fastapi-tutorial | 2_fastapi_basics/fastapi_2_basics/app/main.py | main.py | py | 2,637 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "starlette.templating.Jinja2Templates",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 16,
"usage_type": "name"
},
{
"api_name"... |
3648795784 | # -*- coding: utf-8 -*-
# @Time : 2020/12/29 17:26
# @Author : tingting.yang
# @FileName: demo04.py
import json
json_obj = {"access_token":"40_FwH70OJu-kiO9ys9xywWS0aHhGKpugPB3Vmf_aCS2tLD6tbfKRDBi42GxAsoggAAOIxpXuJUPcogJLqIgMDEuV5LF6RibZHIrcEx31ARVLiNBZ2gFchy2KDKMh48bN6_L-xQFY5FsMrm8y66XHIdADALVW","expires_in":7200... | yangtingting123456/API_Test_Framework | samples/deom/demo04.py | demo04.py | py | 803 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.loads",
"line_number": 8,
"usage_type": "call"
}
] |
28991702789 | from flask import redirect, render_template, url_for, flash, request, session
from shop import app,db
from shop.products.models import Addproduct
def MergeDicts(dict1, dict2):
if isinstance(dict1, list) and isinstance(dict2, list):
return dict1 + dict2
elif isinstance(dict1, dict) and isinstance(dict2,... | arshupt/VegMart | shop/carts/carts.py | carts.py | py | 2,893 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.request.form.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.re... |
2118817925 | import csv
import numpy as np
from keras.applications.vgg16 import VGG16
from keras.models import Model
from keras.layers import Flatten, Dense, Dropout
from keras.layers.normalization import BatchNormalization
from keras import backend as K
from keras.optimizers import Adam
import galaxy_image as gimage
from galaxy_i... | footh/dl | galaxy/galaxy.py | galaxy.py | py | 7,878 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
11212048196 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
""" Reboot host if hash value < limit"""
"""
1) Install python
apt-get install python
2). Upload host_reboot.py to a folder (\home\app\):
3) Run cmd:
python \home\app\host_reboot.py
"""
HOST_IP = 'YOURIP'
TEST_REGIME = 0 # 1- No reboot only error messages; 0 -... | narezzi/miningcheckhash | check.py | check.py | py | 5,107 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.name",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "socket.socket",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_DGRAM",
... |
72864041502 | import os
import cv2
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import matplotlib as mpl
from config import cfg
def vis_keypoints(img, kps, kps_lines, kp_thresh=0.4, alpha=1):
# Convert from plt 0-1 RGBA colors to 0-255 BGR colors for opencv.
cmap = plt.get_cmap... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/pose_estimation/3Dmppe_RootNet/common/utils/vis.py | vis.py | py | 2,949 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.get_cmap",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy.linspace",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.cop... |
40635365040 | from rest_framework import generics
from rest_framework.permissions import IsAdminUser, AllowAny, IsAuthenticated, IsAuthenticatedOrReadOnly
from rest_framework import permissions
from rest_framework.response import Response
from rest_framework.decorators import api_view, permission_classes
from rest_framework.views im... | WebDilemma/Projects-Website | team/api/views.py | views.py | py | 2,740 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.generics.ListAPIView",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.generics",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "team.models.OurTeam.objects.all",
"line_number": 17,
"usage_type": "call... |
4386173201 | import ast
import re
from typing import List
# pylint: disable=g-importing-member
import colorama
from termcolor import colored
from lib import model
from lib.model import StandardField
from yamlformat.validator.field_lib import FIELD_INCREMENT_REGEX
colorama.init()
DEFAULT_MATCHED_TYPES_LIST_SIZE = 10
DELIMITER_REG... | google/digitalbuildings | tools/explorer/lib/parse_input.py | parse_input.py | py | 5,822 | python | en | code | 329 | github-code | 7 | [
{
"api_name": "colorama.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "yamlformat.validator.field_lib.FIELD_... |
41238955453 | from fastapi import FastAPI
from routes.stadium import stadium
# Define API object
app = FastAPI(
title = "Stadium API",
openapi_tags = [{
"name" : "stadiums",
"description": "descriptions api of stadiums of world"
}]
)
app.include_router(stadium)
| Camilo-Duque98/Project-FastAPI-React | Backend/main.py | main.py | py | 280 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "routes.stadium.stadium",
"line_number": 14,
"usage_type": "argument"
}
] |
37920786505 | '''
抓取百度贴吧---生活大爆炸吧的基本内容
爬虫线路: requests - bs4
Python版本: 3.6
OS: mac os 12.12.4
'''
import requests
import time
from bs4 import BeautifulSoup
# 首先我们写好抓取网页的函数
def get_html(url):
try:
r = requests.get(url, timeout=30)
r.raise_for_status()
# 这里我们知道百度贴吧的编码是utf-8,所以手动设置的。爬去其他的页面时建议使用:
... | Ehco1996/Python-crawler | Beautiful Soup 爬虫/baidutieba.py | baidutieba.py | py | 2,884 | python | zh | code | 1,796 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 38,
"usage_type": "call"
}
] |
3784444555 | import socketio
from aiohttp import web
from core.src.world.builder import websocket_channels_service, async_redis_queue, world_repository
from core.src.world.services.redis_pubsub_interface import PubSubManager
from core.src.world.transport.redis_pubsub_subscriber_service import RedisPubSubSystemEventsSubscriberServic... | ProjectMHQ/projectm | core/src/world/run_websocket.py | run_websocket.py | py | 1,725 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "socketio.AsyncRedisManager",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "etc.settings.REDIS_HOST",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "etc.settings",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "... |
31008075680 | import pandas as pd
from sqlalchemy import create_engine, inspect
import json
# gets the table 'table' with sqlalchemy engine
def get_table(engine, table):
df = pd.read_sql_query('select * from '+table, con=engine)
return df
#This function retreives the components needed then it fills 'drugname_dict'... | AbdouAkaen/Data_eng_test | src/fetch_data.py | fetch_data.py | py | 3,475 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_sql_query",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.inspect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_e... |
41999668475 | # vim: ts=4:sw=4:expandtabs
__author__ = 'zach.mott@gmail.com'
from django.conf.urls import url
from quizard import views
urlpatterns = [
url(r'^$', views.Index.as_view(), name='index'),
url(r'^about/$', views.About.as_view(), name='about'),
url(r'^assignment/(?P<code>\w+)/$', views.Assignment.as_view(... | E7ernal/quizwhiz | quizard/urls.py | urls.py | py | 672 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "quizard.views.Index.as_view",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "quizard.views.Index",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_nam... |
31547310325 | import requests
API_URL = "https://api.havenondemand.com/1/api/async/recognizelicenseplates/v1"
data = {
"url": "https://www.havenondemand.com/sample-content/videos/gb-plates.mp4",
"source_location": "GB",
"apikey": "695e513c-xxxx-xxxx-a666-xxxxxxxxxx"
}
response = requests.post(API_URL, data)
print(res... | avurlod/python-games-simulation | openai aucun rapport/old_files/curl.py | curl.py | py | 334 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "requests.post",
"line_number": 11,
"usage_type": "call"
}
] |
36328408877 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
def preprocess(stations, trips):
'''
- Drops rows with missing values from both tables
- Drop trips that have a start or end station id that is not in the stations table
- Dros trips that ended at th... | afenyvesi/Bubi_Bikesharing_Network | FenyvesiA_Bubi_Network_Functions.py | FenyvesiA_Bubi_Network_Functions.py | py | 11,515 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pandas.to_datetime",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.Timestamp",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "networkx.DiGra... |
5821500860 | from django.test import RequestFactory, TestCase
from unittest import skip
from graphql import GraphQLError
from graphene.test import Client
from users.models import User
from tasks.models import Task, Customer
from config.schema import schema
TestCase.maxDiff = None
def execute_query(query, user=None, variable_va... | srezanova/CRM-GraphQL-API-Django | backend/tests/test_queries.py | test_queries.py | py | 10,051 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.test.TestCase.maxDiff",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.test.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.test.RequestFactory",
"line_number": 18,
"usage_type": "call"
},
{
... |
25692646382 | import tkinter
from PIL import Image, ImageTk, ImageDraw, ImageOps
import numpy as np
import torch
class Application(tkinter.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.master.title('Normalize Demo')
self.pack()
se... | shinome551/normalizeMNIST | app.py | app.py | py | 2,937 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tkinter.Frame",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.load"... |
850644386 | from flask_app import app, db
from flask import render_template, request, redirect, url_for
from sqlalchemy import func
from flask_app.models import User, Answers, Questions
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///servey.db'
@app.route('/')
def main():
return render_template('main.html')
... | s-alyona-a/flask_app | flask_app_files/routes.py | routes.py | py | 3,713 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask_app.app.config",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "flask_app.app",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_app... |
5197799996 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
###############################################################################
# i2c_sensors_and_display.py #
# (c) https://github.com/thomaspfeiffer-git 2016, 2017 #
#####################################... | thomaspfeiffer-git/raspberry | playground/i2c_sensors_and_display.py | i2c_sensors_and_display.py | py | 5,262 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
21008501020 | import ctypes
import os
import sys
import shlex
import tarfile
import time
from datetime import datetime
from subprocess import Popen
import psutil
from .log_utils import LogType, RemoteLogger, StdOutputType, nni_log
from .commands import CommandType
trial_output_path_name = ".nni"
class Trial:
def __init__(se... | microsoft/nni | nni/tools/trial_tool/trial.py | trial.py | py | 6,871 | python | en | code | 13,409 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "log_utils.RemoteLogger",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "log_utils.StdOutputType.Stdout",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_na... |
9965851953 | def update_direction(turn, direction):
'''Manages clockwise/counter-clockwise turns of painting robot'''
import numpy as np
if turn==0:
if direction[0]*direction[1]>0:
return np.array([-direction[1], -direction[0]], dtype=np.int64)
else:
return np.array([-directi... | p-mckenzie/Advent_of_Code_2019 | day11.py | day11.py | py | 2,365 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.int64",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.int64",
"line_number"... |
36752850523 |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import pyttsx3
# initialize Text-to-speech engine.
engine = pyttsx3.init()
text = "now we are going to automate Some of the browser functionalities this program can be helpful to test the browser which you have coded so sit b... | areyouroot/univer-sel | auto_google.py | auto_google.py | py | 2,407 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pyttsx3.init",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "time.sleep",... |
25833804129 | # -*- coding: utf-8 -*-
# Define your item pipelines here
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import xlwt
import random
from openpyxl import Workbook
from school.spiders.schoolspider import SchoolspiderSpider
class SchoolP... | zbuhui/anjuke | school_518/school/pipelines.py | pipelines.py | py | 6,699 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "xlwt.Workbook",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "school.spiders.schoolspider.SchoolspiderSpider.nrows",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "school.spiders.schoolspider.SchoolspiderSpider",
"line_number": 15,
... |
74123078623 | #!/usr/bin/env python3
"""
Combine data from different model
"""
import pandas as pd
from pathlib import Path
from matplotlib import ticker
import matplotlib.pyplot as plt
def concatenate_files(file_list):
"""
concatenate all files from a list
"""
appended_data = []
for f in file_list:
d... | jli755/git_stuff | gather_data.py | gather_data.py | py | 1,787 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.ylabel",... |
27270132469 | from calendar import c
from re import I
from selenium import webdriver
from webdriver_manager.firefox import GeckoDriverManager
import time
print('\n[INSTRUÇÕES]:\n')
print('1. Crie um arquivo com o nome "perfis_a_seguir.txt" e adicione os perfis que você deseja seguir.\n')
print('2. Crie um arquivo com o nome "posts_... | JHE4N/bot-insta | bot.py | bot.py | py | 9,165 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "webdriver_manager.firefox.GeckoDriverManager",
"line_number": 20,
"usage_type": "call"
},... |
72198620064 | import numpy as np
import matplotlib.pyplot as plt
from recipes.logging import LoggingMixin
from scrawl.imagine import _sanitize_data
from scrawl.utils import percentile
def get_bins(data, bins, range=None):
# superset of the automated binning from astropy / numpy
if isinstance(bins, str) and bins in ('block... | astromancer/scrawl | src/scrawl/hist.py | hist.py | py | 5,141 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "astropy.stats.calculate_bin_edges",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.histogram_bin_edges",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "recipes.logging.LoggingMixin",
"line_number": 18,
"usage_type": "name"
},
... |
72863985502 | import numpy as np
import torch
from collections import OrderedDict
# import scipy.io as io
import hdf5storage
"""
# --------------------------------------------
# Convert matconvnet SimpleNN model into pytorch model
# --------------------------------------------
# Kai Zhang (cskaizhang@gmail.com)
# https://github.co... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/others/SwinIR/utils/utils_matconvnet.py | utils_matconvnet.py | py | 6,780 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "numpy.squeeze",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "torch.from_numpy",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.ascontiguousarray",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "torch.save",
... |
39048628244 | from django.core.exceptions import ValidationError
import pytest
pytestmark = pytest.mark.django_db
class TestCategoryModel:
def test_str_method(self, category_factory):
test = category_factory(name="test_str")
assert test.__str__() == "test_str"
class TestBrandModel:
def test_str_method(se... | Shahadat-Hossain-Akash/drf-ecom-api | app/app/test/product/test_models.py | test_models.py | py | 2,189 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pytest.mark",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pytest.raises",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 39,
"usage_type": "argument"
}
] |
27762076889 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
from googlecloudsdk.api_lib.container.images import container_data_util
from googlecloudsdk.api_lib.containeranalysis import requests
import six
_INDENT = ' '
_NULL_SEVERITY = 'UNKNOWN'... | twistedpair/google-cloud-sdk | google-cloud-sdk/lib/googlecloudsdk/api_lib/container/images/container_analysis_data_util.py | container_analysis_data_util.py | py | 4,264 | python | en | code | 55 | github-code | 7 | [
{
"api_name": "googlecloudsdk.api_lib.containeranalysis.requests.GetMessages",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "googlecloudsdk.api_lib.containeranalysis.requests",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "collections.defaultdict",
"li... |
24794060003 | #!/usr/bin/env python3
import warnings
warnings.filterwarnings("ignore")
import argparse
import os, datetime
import pandas as pd
import numpy as np
import yfinance as yf
import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')
plt.rcParams['figure.figsize'] = (20, 10)
from matplotlib import rcParams
rcPar... | pgvasiliu/sta | plotting/uo.py | uo.py | py | 4,774 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 15,
"usage_type": "attribute"
},
{
"a... |
72428690783 | import torch.nn.functional as F
from torch import nn
class FeedForward(nn.Module):
def __init__(self, input_dim: int = 512,
expansion_factor: int = 4,
drop_prob: int = 0.1):
super().__init__()
self._layers(input_dim, expansion_factor, drop_prob)
def _layers(... | SurajDonthi/Conformer | conformer/modules/feedforward.py | feedforward.py | py | 757 | python | en | code | 1 | 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.Linear",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
10307199509 | from PIL import Image
import os, sys
import cv2
from glob import glob
def resize(path):
if os.path.isfile(path):
for i in range(0,2):
img_org = cv2.imread(path)
h , w, c = img_org.shape
if w>1920 and h>1080:
... | pintwenty/fake-image-and-video-detector | resize2.py | resize2.py | py | 842 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "os.path.isfile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_num... |
70408598305 | import numpy as np
import cv2
import math
def naive_image_rotate(image, degree):
'''
This function rotates the image around its center by amount of degrees
provided.
'''
# First we will convert the degrees into radians
rads = math.radians(degree)
# In this case, we consider the ... | ShrishailSGajbhar/Naive-image-rotation | transform2.py | transform2.py | py | 1,767 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "math.radians",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 18,
... |
26410981346 | """Make a figure analogous to Figure 2.6 for the nonstationary case outlined in Exercise 2.5. Include the
constant-step-size "-greedy algorithm with ↵=0.1. Use runs of 200,000 steps and, as a performance measure for each
algorithm and parameter setting, use the average reward over the last 100,000 steps. """
import ... | jeremysong/rl-book-exercises | chap_2/exercise_2_11.py | exercise_2_11.py | py | 2,077 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "framework.rewards.RandomWalkActionReward",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "framework.action_selectors.GreedyActionSelector",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "framework.runner.Runner",
"line_number": 41,
"us... |
307129974 | from PyQt6.QtWidgets import QApplication, QPushButton, QMainWindow, QVBoxLayout, QWidget, QLabel, QColorDialog, QHBoxLayout
from PyQt6.QtCore import QTimer
from PyQt6.QtGui import *
import sys
import glob
from time import sleep
import serial
import threading
def setInterval(func,time):
e = threading.Event()
wh... | 1MarBur1/SWL | main.py | main.py | py | 6,476 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "threading.Event",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.platform.startswith",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.platfor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.