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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
35869844483 | import pynput
import time
from pynput.mouse import Button, Controller
import gigglio
import colorErrors
mouse = Controller()
pos = [483, 217]
dif = [102, 76] # Resolution
brushSize = [1087, 864]
moveAmount = 8
#XChange = 813
#YChange = 610
color = [[585, 850], [610, 850], [635, 850], [660, 850], [685, 850], [710... | kbau121/Skribblio-Drawer | draw.py | draw.py | py | 1,597 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pynput.mouse.Controller",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pynput.mouse.Button.left",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "pynput.mouse.Button",
"line_number": 28,
"usage_type": "name"
},
{
"api_name... |
39404937523 | import cv2
import numpy as np
from matplotlib import pyplot as plt
# function to perform lane detection
def detectRoads(image):
img_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
img_gr = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# smoothing to remove noise
blur = cv2.GaussianBlur(img_gr, (3, 3), 0)
# ... | crunchbang/Machine_Perception-DS863 | Assignment_1/src/question_11.py | question_11.py | py | 1,343 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
... |
40696527566 | from rest_framework import serializers
from apps.send.models import Replies
class RepliesSerializer(serializers.ModelSerializer):
def create(self, validated_data):
validated_data['company'] = self.context['request'].company
return super().create(validated_data)
class Meta:
model = Re... | ankitch/mccc-backend | apps/send/serializers.py | serializers.py | py | 391 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "apps.send.models.Replies",
"line_number": 12,
"usage_type": "nam... |
4907640521 | from typing import Optional, Tuple
import abc
from dataclasses import dataclass
from typing import Union
import logging
from lux.unit import Unit
from lux.config import UnitConfig
from util import (
actions_to_path,
)
from master_state import MasterState
from actions import Recommendation
LOGGING_LEVEL = 3
@da... | TimChild/lux2022 | agent_v2_0/unit_manager.py | unit_manager.py | py | 2,321 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.Union",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "actions.Recommendation",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "dataclasses.datac... |
21588104500 | # encoding: utf-8
# !/usr/bin/env python
'''
@version :python 3.7
@File :admin.py
@Author :WangTwoThree
@Site :https://wangtwothree.com
@Date :2022/12/19 15:40
@Description :
'''
import functools, jwt
from flask import Blueprint, render_template, request, flash, redirect, url_for
from datetime import datetime, timedel... | TwoThreeWang/flask_dh | views/admin.py | admin.py | py | 3,912 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlmodel.curd.DbCurd",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request.cookies.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask.... |
9213265370 | from typing import Iterable, Optional, List
from django.db import models
from .manager import UpdateReturningManager, UpdateReturningMixin, UpdateReturningQuerySet
class UpdateReturningModel(models.Model):
class Meta:
abstract = True
objects = UpdateReturningManager()
def __init__(self, *args,... | M1ha-Shvn/django-pg-returning | src/django_pg_returning/models.py | models.py | py | 5,130 | python | en | code | 14 | github-code | 7 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "manager.UpdateReturningManager",
"line_number": 12,
"usage_type": "call"
},
{
"api_nam... |
26372215752 | import pygame
def main():
pygame.init()
pantalla = pygame.display.set_mode([800, 800])
pygame.display.set_caption("Laberinto mamadisimo")
salir = False
reloj1 = pygame.time.Clock()
contador=0
reproductor=0
maquina=pygame.mixer.Sound("Maquina 2.wav")
pygame.mixer.music.load("sacrific... | federico-procs/laberintoTerror | pruebas.py | pruebas.py | py | 4,218 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
71935670303 | import logging
import time
import unittest
from cros.factory.device import device_utils
from cros.factory.test import state
from cros.factory.test.utils import stress_manager
from cros.factory.utils.arg_utils import Arg
from cros.factory.goofy.plugins import plugin_controller
class StressAppTest(unittest.TestCase):
... | arccode/factory | py/test/pytests/stressapptest.py | stressapptest.py | py | 3,232 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cros.factory.utils.arg_utils.Arg",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cros.factory.utils.arg_utils.Arg",
"line_number": 17,
"usage_type": "call"
},
... |
44831800007 | import kivy
from kivy.properties import ObjectProperty
from kivy.clock import Clock
from kivy.uix.screenmanager import ScreenManager, Screen
import points
class Type5Window(Screen):
video = ObjectProperty(None)
answer = ""
ppp = 0
start = 0
def update(self, btn):
self.start = self.start ... | florekkinga/LearnPythonApp | com/multiwindow/type5.py | type5.py | py | 1,904 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "kivy.uix.screenmanager.Screen",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "kivy.properties.ObjectProperty",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "points.globalPoint",
"line_number": 29,
"usage_type": "attribute"
},
{
... |
35761803265 | from dotenv import load_dotenv
import os
import openai
import subprocess
import json
import argparse
class Styles:
bold = "\u001b[1m"
underline = "\u001b[4m"
inverted = "\u001b[7m"
reset = "\u001b[0m"
green = "\u001b[38;5;121m"
blue = "\u001b[38;5;117m"
red = "\u001b[38;5;198m"
yellow ... | hunterunger/gpt-cli-assistant | main.py | main.py | py | 4,214 | python | en | code | 19 | github-code | 7 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentPar... |
27533488698 | # Numpy merupakan singkatan Numerical Python yang digunakan dalam memproses array... misi ngedit dikit
# Matplotlib digunakan untuk menggambarkan titik koordinat menjadi sebuah garis... misi mau coba ngedit lagi
import numpy as np
import matplotlib.pyplot as graphic
x1 = int(input('Masukan Nilai X1 : '))
y1 =... | AuliyaRahmanAsdar/Kelompok-1-Grafika-Komputer.github.io | Grafkom_Kelompok1.py | Grafkom_Kelompok1.py | py | 2,763 | python | id | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matpl... |
8007456640 | #!/bin/python3
import time
import sys
import os
from PIL import Image
on = os.system('ps -aux | grep "wall.py" | wc -l')
if on > 0:
os.system('killall wall.py')
file = sys.argv[1]
if file == "":
print("Dame un parametro plox, un gif")
if not file.endswith(".gif"):
print("Introduce un... | Yukics/yuki-bspwm | bin/wall.py | wall.py | py | 1,070 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.system",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number": 2... |
32977061528 | import tables
import numpy as np
import logging
logger = logging.getLogger('root')
class EnterExitPrint(object):
"""docstring for EnterExitPrint"""
def __init__(self, enter, exit):
super(EnterExitPrint, self).__init__()
self.enter = enter
self.exit = exit
def __enter__(self... | tklijnsma/lpcdbeclient | lpcdbeclient/utils.py | utils.py | py | 2,731 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "tables.open_file",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tables.open_file",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
24403098183 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Validator script for CS 2204 Homework submissions"""
import sys
import os
import traceback
from contextlib import redirect_stdout, redirect_stderr
from importlib.util import spec_from_file_location, module_from_spec
from io import StringIO
from math import isclose
impo... | kdmalc/data-structs-algos | CS2204/CS_HW5/validator.py | validator.py | py | 12,040 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.splitext",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "importlib.util.spec_fr... |
16694090806 | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 8 12:29:39 2019
@author: grin
"""
import logging
import sys
class StreamToLogger(object):
"""
Fake file-like stream object that redirects writes to a logger instance.
"""
def __init__(self, logger, log_level=logging.INFO):
self.logger = logger
... | radmimir/textron | textron-dev/textron/logging_module.py | logging_module.py | py | 1,516 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "logging.shutdown",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHandler"... |
70816512864 | import numpy as np
import matplotlib.pyplot as plt
# Given Parameters
N_fatalities = np.linspace(1,1000,1000) # fatalities
P_df = 0.1; beta = 0.1
alpha = 2
k = 3
N_A = 100
r= 0.025
I = 5*10**6
B = 0.33
# Individual Risk
Pf_ind_risk = (beta*(10**-4))/P_df # per year
# print('Acceptable Failure Probability: ', ... | TUDelft-CITG/MUDE | book/code/risk_types.py | risk_types.py | py | 1,038 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.linspace",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",... |
26238321095 | from ray import air, tune
def tune_hyper_param(algo, config, log_dir, iterations,
name,max_concurrent_trials=1):
"""
Wrapper for the ray.tune.Tuner.fit function used for tuning the hyper-parameters
:param algo: The algorithm to use for training
:param config: The algorithm configs... | MHamza-Y/Autonomous-Insulin-Infusion-RL | src/components/tune.py | tune.py | py | 1,073 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "ray.tune.Tuner",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "ray.tune",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "ray.tune.TuneConfig",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "ray.tune",
"line_numb... |
70702725664 | import datetime
import os
import numpy as np
# classifiers
from model import ToMatrix
from neural_network import NeuralNetwork
from twinsvm.TVSVM import TwinSVMClassifier
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import MultinomialNB, Gau... | tihomir-kojuharski/spam-filter | pipeline.py | pipeline.py | py | 6,733 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number... |
11736929066 | from .client import PORT
from helper.IPC import Server, FuncCall, Connection, Response, Packet
from helper.main_handler import main_handler
from helper.report_exceptions import report_exception
from .nearcrowd_account import NearCrowdAccount
from helper.provider_config import provider
from .accounts_db import Account... | MAKMED1337/NC-watcher | accounts/server.py | server.py | py | 3,985 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "helper.IPC.Server",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "client.PORT",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "helper.IPC.Connection",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "helper.re... |
30980269145 | #Code referenced from TA Alek Bedard
from flask import Flask, jsonify, request
import sys
app = Flask(__name__)
@app.route('/')
def light():
if len(sys.argv) < 2:
return "Dude! You are not curling from a server!!"
num = 10
counter = 30
while(counter < 30):
num = num*num*num
... | Comp598Assign/M3final | jobs/test.py | test.py | py | 464 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
}
] |
11028913003 | from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import api_view
from product.models import Product
from online_system.api.serializers import ProductSerializer
@api_view(['GET',])
def api_detail_product_view(request, id):
try:
products = Produ... | nilu242/online_system-master | online_system/api/views.py | views.py | py | 1,461 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "product.models.Product.objects.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "product.models.Product.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "product.models.Product",
"line_number": 13,
"usage_type": "name"
... |
4472089110 | from PyQt5 import QtCore, QtGui, QtWidgets
from Start.DB_Configuration import exe_query
class Ui_Admin_Remove_Employee_window(object):
def __init__(self):
self.res = []
self.staff_id = -1
def setupUi(self, Admin_Remove_Employee_window):
Admin_Remove_Employee_window.setObjectName("Ad... | ali-asnaashari/Hotel-Management-System-DB_Project | Source Code/Admin/Script/Admin_Remove_Employee.py | Admin_Remove_Employee.py | py | 10,798 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "PyQt5.QtGui.QCursor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtGui",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.Qt",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore",
... |
41668992157 | #coding=utf-8
from functools import partial
from OCC.Core.Quantity import Quantity_Color, Quantity_TOC_RGB
from OCC.Core.TopoDS import TopoDS_Compound
from OCC.Extend.DataExchange import read_step_file_with_names_colors
from OCC.Extend.TopologyUtils import TopologyExplorer
from PyQt5.QtWidgets import QApplication, QCom... | qunat/FengXing-select-software | module/SelectModule.py | SelectModule.py | py | 47,020 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QMovie",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "P... |
4198917066 | import os
import tempfile
import math
import torch.distributed as dist
import numpy as np
import pandas as pd
import torch
import argparse
import torch.nn as nn
import torch.optim as optim
import torch.multiprocessing as mp
from apex.parallel import DistributedDataParallel as DDP
from torch.utils.data import Dataset, D... | Cappuccino-y/Temporal_pred | predict/distributed_apex.py | distributed_apex.py | py | 8,993 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.backends",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "torch.backends",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
... |
72865479582 | import inspect
import platform
from typing import Dict, Tuple, Union
import torch.nn as nn
from .registry import PLUGIN_LAYERS
if platform.system() == 'Windows':
import regex as re # type: ignore
else:
import re # type: ignore
def infer_abbr(class_type: type) -> str:
"""Infer abbreviation from the cl... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/semantic_segmentation/MMseg-swin/mmcv/mmcv/cnn/bricks/plugin.py | plugin.py | py | 2,715 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "platform.system",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "inspect.isclass",
"line_number": 49,... |
37575126947 | # MatthewInkawhich
# Use this script to train a custom CNN without using LMDB for data layer input
# LINES TO MODIFY BEFORE RUNNING:
# - Must manually set Configs
from __future__ import print_function
from matplotlib import pyplot
import numpy as np
import os
import shutil
import random
import skimage.io
import ski... | MatthewInkawhich/caffe2_sandbox | mstar/train_mstar_NO_LMDB.py | train_mstar_NO_LMDB.py | py | 15,297 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.expanduser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
31537378996 | import matplotlib.pyplot as plt
import os
import seaborn as sns
import numpy as np
import pingouin as pg
plt.rcParams["font.sans-serif"] = ["SimHei"] # 用来正常显示中文标签
def model_overlap_plot(
raw_data,
sub_nums,
assign_name,
save_path=None,
aspect_ratio=1.5,
negative=False,
print_corr=True,
... | dddd1007/xia_cog_model | xia_cog_model/model_based_beh_analysis.py | model_based_beh_analysis.py | py | 9,321 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.pat... |
74938412064 | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from . import views
urlpatterns = [
url(r'^login$', auth_views.login, name='login'),
url(r'^discourse_login', views.discourse_login, name='discourse_login'),
url(r'^logout$', views.logout, name='logout'),
url(r'^signu... | CCrypto/ccvpn3 | lambdainst/urls.py | urls.py | py | 620 | python | en | code | 21 | github-code | 7 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.views.login",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.views",
"line_number": 7,
"usage_type": "name"
},
{
"... |
23420384552 | import boto3
import logging
import hashlib
import os
import requests
from s3_client_lib.utils import *
from botocore.client import Config
logger = logging.getLogger(__name__)
import re
class S3Client:
def __init__(
self,
address,
access_key,
secret_access_key,
tenant=None,... | CESNET/s3-client | s3_client_lib/s3_client.py | s3_client.py | py | 16,963 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "botocore.client.Config",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "re.match",
"... |
14273125631 | from time import time
from typing import List, AnyStr
from collections import defaultdict
from dataset.COCO.coco_parser import COCOParser
from dataset.utils.random_buffer import RandomBuffer
from torch.utils.data import DataLoader, Dataset, RandomSampler
class COCOImages(COCOParser, Dataset):
class ImgBuf:
... | MartinBrazdil/dataset | dataset/COCO/coco_images.py | coco_images.py | py | 3,373 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "dataset.COCO.coco_parser.COCOParser",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.AnyStr",
"line_number": 31,
"usage_type": "name"
},
{
"api_na... |
29639906796 | # import librarys
import gym
import random
env = gym.make('CartPole-v1') # make an envirenment named 'Cartpole-v1' which has been defined in the library
goal_steps = 100
while True:
obs = env.reset() # reset the status
for i in range(goal_steps):
obs, reward, done, info = env.step(random.randrange... | sangkny/RL-Gym | main.py | main.py | py | 667 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "gym.make",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.randrange",
"line_number": 12,
"usage_type": "call"
}
] |
26191208289 | from telethon.errors import (
BotMethodInvalidError,
ChatSendInlineForbiddenError,
ChatSendMediaForbiddenError,
)
from . import LOG_CHANNEL, LOGS, Button, asst, eor, get_string, ultroid_cmd
REPOMSG = """
• **ULTROID USERBOT** •\n
• Repo - [Click Here](https://github.com/PredatorHackerzZ/Renamer-Bot)... | itzharshit/ubbbb | plugins/_ultroid.py | _ultroid.py | py | 1,629 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "telethon.errors.ChatSendInlineForbiddenError",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "telethon.errors.ChatSendMediaForbiddenError",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "telethon.errors.BotMethodInvalidError",
"line_number... |
4040575505 |
#Decision tree
from sklearn.datasets import load_iris
from sklearn import tree
iris = load_iris()
print(iris.feature_names)
print(iris.data)
print(iris.target)
print(iris.target_names)
clf = tree.DecisionTreeClassifier()
clf = clf.fit(iris.data, iris.target)
import graphviz
dot_data = tree.export_graphviz(clf,out_fil... | kunjandhoble/batchrepo | batch_mlAlgos.py | batch_mlAlgos.py | py | 1,965 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.tree",
"line_number": 10,
"usage_type": "name"
},
{
"api_na... |
14198456755 | #! /usr/bin/env python3
from typing import List
from random import randint
"""08/25/2019
Solution1:
I am very proud of this solution, because it is simple, short, and fast. Granted,
I did test run my solution against the OJ with some given test cases, but still
this is the very first complex DP solution I have writte... | FanchenBao/leetcode | Contest_150/1163.py | 1163.py | py | 3,896 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 82,
"usage_type": "call"
}
] |
40303674649 | import argparse
import logging
import os
import sys
from tasks.valenco_translator_task import ValencoTranslatorTask
if __name__ == '__main__':
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(message)s")
parser = argparse.ArgumentParser()
parser.add_argument('--input', dest='input', re... | abdullah-syngenta/poc-flink-valenco-translator | main.py | main.py | py | 1,624 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentP... |
40587060853 | from allennlp.data import DatasetReader, Token
from allennlp.data.dataset_readers.dataset_utils import span_utils
from allennlp.models.archival import load_archive
from allennlp.common.util import import_submodules
from bert_tokenization import BasicTokenizer
import ccg
class Predictor:
def __init__(self, model... | CogComp/multilingual-ner | kairos/predict_instance.py | predict_instance.py | py | 6,054 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "bert_tokenization.BasicTokenizer",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "allennlp.models.archival.load_archive",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "allennlp.data.DatasetReader.from_params",
"line_number": 28,
"usag... |
41051424799 | import random
from datetime import datetime, timedelta
from django.db import transaction
from django.db.models import OuterRef, Exists
from common.models import *
from config import *
class TimeUtil(object):
@classmethod
def format_time(cls, date_string):
return datetime.strptime(date_string, "%Y-%... | yiyuhao/FukuanUnion | payserver/test/unittest/system_admin/mock_util.py | mock_util.py | py | 23,244 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.db... |
3965147994 | import time
import streamlit as st
# import numpy as np
# import pandas as pd
# import plotly.express as px
# from PIL import Image
st.title('Streamlit 超入門')
st.write('プログレスバーの表示')
'Start!'
latest_iteration = st.empty()
bar = st.progress(0)
for i in range(100):
latest_iteration.text(f'Iteration {i+1}')
bar... | speantze/streamlit-intro | 01_intro/main.py | main.py | py | 1,518 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "streamlit.title",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "streamlit.empty",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "streamlit.progress",
... |
38241620177 | import logging
from common.registration_service import RegistrationService
from load_balancer import LoadBalancer
from proto.messages.meteo.meteo_messages_pb2 import RawMeteoData, RawPollutionData
logger = logging.getLogger(__name__)
class MeteoService:
def __init__(self, load_balancer: LoadBalancer, registrati... | bystepii/meteo | load_balancer/meteo_service.py | meteo_service.py | py | 777 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "load_balancer.LoadBalancer",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "common.registration_service.RegistrationService",
"line_number": 11,
"usage_type": "name"
}... |
3956190297 | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from notification.models import Notification
from twitter_user.models import Profile
@login_required
def notifications_view(request, handle):
html = 'notification.html'
notifcation_count = Notification.objects.filter... | jsinghw/twitter_clone | notification/views.py | views.py | py | 604 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "notification.models.Notification.objects.filter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "notification.models.Notification.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "notification.models.Notification",
"line_number... |
13906182790 | import binascii
import enum
import json
import mobiclip
import MySQLdb
import nlzss
import os
import sqlite3
import struct
import sys
import textwrap
from ninfile import NinchDllist
from ninfile2 import GameTDB
from ninfile3 import *
with open("./config.json", "rb") as f:
config = json.load(f)
def u8(data):
... | RiiConnect24/File-Maker | Channels/Nintendo_Channel/dllist.py | dllist.py | py | 40,653 | python | en | code | 65 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 38... |
70831844702 | """
This is used to manage the submission of final papers. Authors enter the site via
an authenticated URL with a paper ID from hotcrp. When a paper is submitted, it
receives an upload of a zip file with at least one tex file. We start a docker instance
in a separate task to compile the output.
"""
from flask import j... | kmccurley/fundreg | webapp/app.py | app.py | py | 1,878 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.version_info",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "config.Config",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "config.Productio... |
26705964143 | from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
from django.shortcuts import render
# relative import of forms
def create_view(request):
# dictionary for initial data with
# field names as keys
context ={}
# add the dictionary d... | Hashsharma/storefront | playground/views.py | views.py | py | 519 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 22,
"usage_type": "call"
}
] |
73131312863 | # Use case: Python command line tool that accepts city name as input and returns the current weather for that city
# Usage: python weather.py <city_name>
# Example: python weather.py "New York"
# Output: Current weather in New York, US is 10.0 degrees Celsius with clear sky
# Importing the libraries required for ... | mi112/weather-forecasting-tool | weather.py | weather.py | py | 3,133 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"lin... |
74436220064 | # Contact from 31 October 2018 to now
import os
from dotenv import load_dotenv
import pandas as pd
import requests
import json
print()
print()
print()
load_dotenv()
airtable_key = os.environ.get("DOORMATIC_AIRTABLE_KEY")
baseId = "appga9Mr4rk0qIOy5"
tableIdOrName = "Contacts Table"
airtable_create_record_url = f"ht... | CompoundBot/code-blocks | doormatic/contacts/act_airtable_migration.py | act_airtable_migration.py | py | 3,590 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
... |
21636677833 | from django.shortcuts import render
from .models import Product, Company
from django.http import HttpResponseRedirect, HttpResponseNotFound
from .forms import ProductForm
def index(request):
products = Product.objects.all()
return render(request, 'index.html', {'products': products})
def create(request):
... | classsik/django_one_to_many | main/views.py | views.py | py | 1,548 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "models.Product.objects.all",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Product.objects",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "models.Product",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dj... |
844465456 | import os
import glob
import time
from PIL import Image
import tensorflow as tf
def load_model(model_path):
return tf.keras.models.load_model(model_path)
def classify_image(model, image_path):
image = Image.open(image_path)
resized_image = image.resize((224, 224), Image.ANTIALIAS)
input_data = tf.ke... | ryanspoone/queue_notify | utilities/organize_screenshots.py | organize_screenshots.py | py | 1,704 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": ... |
3868843221 | from typing import Any
import numpy as np
from numpy.linalg import norm
from numpy.linalg import pinv
import pinocchio as pin
import time
from pinocchio.utils import rotate
from bezier import Bezier
from config import DT, LEFT_HAND, RIGHT_HAND
from scipy.optimize import fmin_bfgs
import math
# in my solution these ga... | sammygb26/aro_lab | control2.py | control2.py | py | 4,873 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.sqrt",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pinocchio.SE3",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pinocchio.utils.rotate",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"li... |
27136563208 | #!/usr/bin/env python
## 2021/06/21. Levi King. From the blog,
## https://naturallanguagepuzzling.blogspot.com
## This code was written to assist with the 2021/05/30 Sunday Puzzle:
## https://www.npr.org/2021/06/20/1008352915/sunday-puzzle-hidden-cities
## That puzzle:
"""
This week's challenge comes from listener Iv... | naturallanguagepuzzling/blog | 2021-06-21-car-rotate-letters.py | 2021-06-21-car-rotate-letters.py | py | 4,102 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "slugify.slugify",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_number": 92,
"usage_type": "call"
}
] |
25841801501 | from config import Instance
from typing import List
from paths import get_training_metrics_path, get_cross_validation_scores_path
import h5py
import pandas as pd
def get_last_epoch(keys):
epochs = [int(s.split('epoch')[1]) for s in keys]
last_epoch = max(epochs)
return last_epoch
def compute_score_for_e... | LucaMarconato/phyper | example/score_models.py | score_models.py | py | 2,075 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "config.Instance",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "config.Instance.get_projections",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "config.In... |
11728022532 | from itune_radio import *
from mutagen.mp3 import MP3
from mutagen.id3 import ID3, APIC, error
import requests
from PIL import Image
from StringIO import StringIO
import os
def get_song_from_file(name_of_song):
audio = MP3(name_of_song, ID3=ID3)
return audio
def add_album_to_ID3(song,image_name,image_format):
#... | vihu/ituneProject | add_albumart.py | add_albumart.py | py | 1,587 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "mutagen.mp3.MP3",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mutagen.id3.ID3",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "mutagen.id3.error",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "mutagen.id3.APIC",
... |
38564740232 | import numpy as np
from tmtools import tm_align
from openfold.np import protein, residue_constants
import os
import argparse
import logging
from tqdm import tqdm
from statistics import mean
def tm_score_from_pdbs(fp1, fp2):
coords1, seq1 = coord_seq_from_file(fp1)
coords2, seq2 = coord_seq_from_file(fp2)
r... | WANG-CR/JointProteinFolding | evalute_tm.py | evalute_tm.py | py | 2,351 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tmtools.tm_align",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "openfold.np.protein.from_pdb_string",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "openfold.np.protein",
"line_number": 19,
"usage_type": "name"
},
{
"api_name... |
72541508062 | # TensorFlow2.0 VAE Implementation
# Large amount of credit goes to:
# https://github.com/ChengBinJin/VAE-Tensorflow
# https://github.com/keras-team/keras/blob/master/examples/variational_autoencoder.py
# https://github.com/ShengjiaZhao/MMD-Variational-Autoencoder/blob/master/mmd_vae.py
# which I've used as a reference... | githubmhjao/TensorFlow2.0-MNIST | VAE_MMD_Conv.py | VAE_MMD_Conv.py | py | 9,561 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.random.randint",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.datasets.mnist.load_data",
"line_number": 35,
"usage_type": "call"
},
{
"... |
72875946464 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys
import os
import csv
import math
import numpy
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot
import joblib
def calculate_n0(r_e):
size = int(math.ceil(r_e))
n0 = 0.0
for y in range(-size, size+1):
for x in range(-size, size+1):
r = ... | openmps/openmps | Benchmark/CentralGravity/check_result.py | check_result.py | py | 2,803 | python | en | code | 22 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 27,... |
26081284276 | from bs4 import BeautifulSoup
from urllib.request import urlopen
import pyexcel
url = 'http://s.cafef.vn/bao-cao-tai-chinh/VNM/IncSta/2017/3/0/0/ket-qua-hoat-dong-kinh-doanh-cong-ty-co-phan-sua-viet-nam.chn'
conn = urlopen(url)
raw_data = conn.read()
web_text = raw_data.decode('utf-8')
soup = BeautifulSoup(web_text,'h... | notthumann/nguyentrangan-labs-c4e22 | Lab2/homework/serious2.py | serious2.py | py | 994 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pyexcel.save_as",
"line_number": 29,
"usage_type": "call"
}
] |
1079563325 | import base64
import os
from io import BytesIO
import time
import datetime
import streamlit as st
import pandas as pd
import openpyxl
from .postxml_ema02 import prettyxmlfile, postxml_ema
def xmldownload(xmlfile):
buffered = BytesIO()
file = open(xmlfile,'rb').read()
buffered.write(file)
b64 = ba... | ghost125/webposting | apps/updatexml.py | updatexml.py | py | 4,808 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "io.BytesIO",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "streamlit.selectbox",
... |
1396617549 | # With acknowledgement to deeplearning.ai
# Coursera courses by Andrew Ng
import numpy as np
import pandas as pd
from sklearn.preprocessing import normalize
from sklearn.model_selection import train_test_split
import h5py
import scipy
import matplotlib.pyplot as plt
class NeuralNetwork:
def __init__(self, layer_... | LegalBIGuy/ritter-ipo | ritter_ipo_nn.py | ritter_ipo_nn.py | py | 7,809 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.random.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.exp",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_n... |
72866037662 | import torch
import numpy as np
from thop import profile
from thop import clever_format
if torch.__version__ >= "1.8":
import torch_npu
def clip_gradient(optimizer, grad_clip):
"""
For calibrating misalignment gradient via cliping gradient technique
:param optimizer:
:param grad_clip:
:return:
... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/semantic_segmentation/PraNet/utils/utils.py | utils.py | py | 3,162 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "torch.__version__",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.mean",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "torch.stack",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.maximum",
"lin... |
22022058050 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Measure the harmonic distortion (HD2 and HD3) of the DAC and ADC combined.
Connect DAC0 to ADC0 to perform the measurement.
'''
import numpy as np
import os
import time
import matplotlib.pyplot as plt
from fft import FFT
from koheron import connect
host = os.getenv('... | Koheron/koheron-sdk | examples/alpha250/fft/python/test_distortion_dac_adc.py | test_distortion_dac_adc.py | py | 1,337 | python | en | code | 91 | github-code | 7 | [
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "koheron.connect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fft.FFT",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number":... |
14388897903 | '''
0008/0025
一个HTML文件
找出里面的正文
'''
from bs4 import BeautifulSoup
import requests
def search_body(path):
page = requests.get(path)
page.encoding = 'utf-8'
soup = BeautifulSoup(str(page.text), 'html.parser')
article = soup.find_all('body')
print(article)
if __name__ == "__main__":
Path = 'https:... | TRillionZxY/ShowMeTheCode | 0008.py | 0008.py | py | 411 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
}
] |
28844414521 | from datetime import datetime
# def transDataFormat(datas={},keyname="",dateformat=""):
# if (keyname in datas.keys()):
# dt = datetime.fromtimestamp( int(datas[keyname]) / 1000 )
# datas[keyname] = dt.strftime(dateformat )
# print( datas[keyname] )
def transDataFormat(dateStr,dateformat="... | hutu1234567/crawl | com/inspur/reptile/skyeyes/common/DateTool.py | DateTool.py | py | 590 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
}
] |
72895415582 | import json
import time
import random
from datetime import datetime
from parameters import TRANSACTIONS_TOPIC, DELAY
from streaming_kafka.confluent_utils import create_producer
_id = 0
producer = create_producer()
if producer is not None:
fake_data = ["Noor", "Victor", "Yusuf", "Bayang", 123, 152, 555]
while... | bm777/predictive-maintenance | streaming_kafka/producer.py | producer.py | py | 871 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "streaming_kafka.confluent_utils.create_producer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 20,
"usage_type": "call"
},
{
... |
32316779597 | from typing import List, Set, Dict, Optional
class Transaction:
def __init__(self, buyer_id: str,
seller_id: str,
amount: int,
price: int) -> None:
self.buyer_id = buyer_id
self.seller_id = seller_id
self.amount = amount
self.price... | ShishkinPavel/python_1_hw | hw4.py | hw4.py | py | 14,547 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": ... |
12705845604 | import sys
from itertools import permutations
input = sys.stdin.readline
n = int(input())
record = []
for _ in range(n):
record.append(list(map(int, input().split())))
ans = 0
for seq in permutations([i for i in range(1, 9)], 8):
seq = list(seq)
seq.insert(3, 0) # 타자 순열
score = 0
cur = 0 # 타자번호... | gwYun/2023-April-coding-study | dongeon/230413 야구.py | 230413 야구.py | py | 1,253 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "itertools.permutations",
"line_number": 13,
"usage_type": "call"
}
] |
10232543937 | from flask import url_for
from web.tests import BaseTestCase
class UITest(BaseTestCase):
def setUp(self):
BaseTestCase.setUp(self)
# make sure that response code for /index is 200
def test_index_reachable(self):
with self.client.session_transaction() as sess:
sess["user"] = ... | PierpaoloLucarelli/CERN-AVEditor | web/tests/views/test_ui.py | test_ui.py | py | 750 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "web.tests.BaseTestCase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "web.tests.BaseTestCase.setUp",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "web.tests.BaseTestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name"... |
2950878027 | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 6 14:04:08 2017
@author: gatesk
"""
import pandas as pd
import sqlite3
conn = sqlite3.connect('samples_dict.db')
c = conn.cursor()
DD_RPT_FILE = pd.read_sql_query("Select * from DD_RPT_FILE", conn)
DD_RPT_GENERAL = pd.read_sql(DD_RPT_GENERAL, conn)
DD_SGC_SAMPLE = pd.... | keithjohngates/python_scripts | untitled21.py | untitled21.py | py | 397 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_query",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql... |
22139831718 | import pandas
from collections import namedtuple
from datetime import datetime
from math import floor
import heapq
import copy
def text_to_date(txt):
return datetime.strptime(txt, "%Y-%m-%d %H:%M:%S")
files = [
"csv_Hoche/score.csv",
"csv_LLG/score.csv"
]
F_HOCHE = 0
F_LLG = 1
submissison_data = [pandas.read_cs... | Dr-McFish/prologin-graph | combine_pointsLLG_hoche.py | combine_pointsLLG_hoche.py | py | 1,743 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collection... |
72850913822 | import argparse
import json
import os.path as osp
import cv2
from mmocr.utils import list_from_file, list_to_file
def parse_old_label(data_root, in_path, img_size=False):
imgid2imgname = {}
imgid2anno = {}
idx = 0
for line in list_from_file(in_path):
line = line.strip().split()
img_f... | Ascend/ModelZoo-PyTorch | PyTorch/built-in/cv/detection/DBpp_ID4145_for_PyTorch/tools/data/textrecog/seg_synthtext_converter.py | seg_synthtext_converter.py | py | 2,644 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "mmocr.utils.list_from_file",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
... |
368755092 | import scipy.sparse as sp
import numpy as np
from .. import pardiso
def create_matrix(dim, alpha=0.95, smallest_coef=0.1, largest_coef=.9):
''' Based o scikit-learn make_sparse_spd_matrix'''
chol = -np.eye(dim)
aux = np.random.rand(dim, dim)
aux[aux < alpha] = 0
aux[aux > alpha] = (smallest_coef
... | simnibs/simnibs | simnibs/simulation/tests/test_pardiso.py | test_pardiso.py | py | 1,573 | python | en | code | 87 | github-code | 7 | [
{
"api_name": "numpy.eye",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand",
"l... |
10609485510 | from cx_Freeze import setup, Executable
import sys
base = 'WIN32GUI' if sys.platform == "win32" else None
executables = [Executable("upload.py", base=base, icon='myapp.ico')]
packages = []
include_files=['myapp.ico']
options = {
'build_exe': {
'packages':packages,
'include_files': include_files
... | werynj/pyqt | setupbk.py | setupbk.py | py | 466 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.platform",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "cx_Freeze.Executable",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.setup",
"line_number": 18,
"usage_type": "call"
}
] |
22552300179 | import os
import sys
import subprocess
import argparse
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pandas_market_calendars as mcal
from scipy import signal
from matplotlib import style
from matplotlib.patches import Rectangle
from sklearn.preprocessing import StandardScaler
from alpac... | regholl2023/Simple_Alpaca_API_trading_bot | bars.class.new.py | bars.class.new.py | py | 16,949 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 71,
"usage_type": "name"
},
{
"api_nam... |
72671383582 | import itertools
from sympy import isprime
def pandigital_prime():
initial = "987654321"
while True:
for s in itertools.permutations(initial):
n = int("".join(s))
if isprime(n):
return n
initial = initial[1:]
if __name__ == "__main__":
print(pandi... | TurtleSmoke/Project-Euler | problems/problem_0041/solution1.py | solution1.py | py | 335 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "itertools.permutations",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sympy.isprime",
"line_number": 11,
"usage_type": "call"
}
] |
6051288730 | from django.shortcuts import render, render_to_response, get_object_or_404
from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.core.mail imp... | lauri-codes/GameShop | gameshop/game/views.py | views.py | py | 25,734 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "game.forms.UserForm",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "game.forms.UserProfileForm",
"line_number": 30,
"usage_type": "call"
},
{
"api_name":... |
1174049576 | from django.http.response import HttpResponse
from shultze.models import IssuesGraph
from issues.models import Issue, IssueRankingVote
from ocd.base_views import json_response
import json
def user_vote(committee_id, current_vote, prev_vote=[]):
try:
g = IssuesGraph.objects.get(committee_id=committee_id)
... | nonZero/OpenCommunity | src/issues/shultze_vote.py | shultze_vote.py | py | 2,950 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "shultze.models.IssuesGraph.objects.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "shultze.models.IssuesGraph.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "shultze.models.IssuesGraph",
"line_number": 10,
"usage_typ... |
72844180702 | import argparse
from tqdm import tqdm
from collections import OrderedDict
import torch
from torch.nn import functional as F
import numpy as np
from ais_bench.infer.interface import InferSession
from mobilenetv3 import MobileNetV3_Small
from data import Dataset, create_loader, compute_accuracy, AverageMeter
def adju... | Ascend/ModelZoo-PyTorch | ACL_PyTorch/built-in/cv/MobileNetV3_for_Pytorch/om_val.py | om_val.py | py | 3,873 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "collections.OrderedDict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "mobilenetv3.MobileNetV3_Small",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "ais_... |
73131296223 | import os
import logging
import requests
class SimpleFluentBitHTTPInputHandler(logging.Handler):
"""A minimal handler for sending logs to the HTTP Input
of a Fluent Bit collector."""
def __init__(self, url, env_prefix=None):
logging.Handler.__init__(self)
self.url = url
self.env_p... | mhuin/python-simple-fluentbit-http-handler | simpleFluentBitHTTPHandler/__init__.py | __init__.py | py | 850 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.Handler",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.Handler.__init__",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.Handler",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.... |
21787907000 | import flask
from flask import request, jsonify
import socket
import json
import pandas as pd
from datetime import datetime, date
import csv
__author__ = 'Yannik Motzet'
__email__ = 'yannik.motzet@outlook.com'
PASSPHRASE="12345!"
MAX_STORAGE_DAYS = 28
DATABASE_LIST_PATH = "storage.csv"
DATABASE_ROOMS_PATH = './rooms.... | yannikmotzet/digital-corona-list | server/server.py | server.py | py | 4,353 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "pandas.read_csv",
"... |
6030408798 | from pathlib import Path
from typing import Dict, List, Optional
import yaml
from pydantic import BaseModel
import insurance_claim_model
PACKAGE_ROOT = Path(insurance_claim_model.__file__).resolve().parent
ROOT = PACKAGE_ROOT.parent
CONFIG_FILE_PATH = PACKAGE_ROOT / "config.yml"
DATASET_DIR = PACKAGE_ROOT / "dataset... | Michael95-m/packaging-insurance-claim-model | insurance_claim_model/config/core.py | core.py | py | 1,761 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "insurance_claim_model.__file__",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pydantic.BaseModel",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pyd... |
6553982478 | ##
##
import logging
import googleapiclient.errors
from couchformation.gcp.driver.base import CloudBase, GCPDriverError
logger = logging.getLogger('couchformation.gcp.driver.instance')
logger.addHandler(logging.NullHandler())
logging.getLogger("googleapiclient").setLevel(logging.ERROR)
class Instance(CloudBase):
... | mminichino/couch-formation-core | couchformation/gcp/driver/instance.py | instance.py | py | 4,328 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.NullHandler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",... |
39659564904 | import http.client
import json
class Conexao:
def __init__(self):
pass
def criaConexaoComServidor(self):
return http.client.HTTPSConnection('api.github.com', 443)
def criaCabecalho(self):
cabecalho = {
'Content-type': 'application/json',
'User-Agent': 'gabrielsmenezes',
'Authorization': 'Bearer 8... | researchgroupsoma/ESEM2019-FrameworkCodeSamples | frameworkCodeSamples/Samples/DadosParaGerarOsGraficosDaFigura2NaSecao3a/Conexao.py | Conexao.py | py | 1,895 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "http.client.client.HTTPSConnection",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "http.client.client",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 10,
"usage_type": "name"
},
{
"api_name":... |
19063319066 | # encoding: utf-8
'''
@author: zhao zhibo
@file: eastmoney_guba_hot_comments_orm.py
@time: 2021/3/2 下午4:16
@desc:
'''
from sqlalchemy import Column, VARCHAR, DATETIME
from sqlalchemy.dialects.mysql import LONGTEXT
from shannon_spider.db import CommonFieldMixin, ItemBaseModel
class EastmoneyGubaHotCommen... | cxapython/catvm | selenium/shannon_spider/orm/eastmoney_guba_hot_comments_orm.py | eastmoney_guba_hot_comments_orm.py | py | 885 | python | en | code | 30 | github-code | 7 | [
{
"api_name": "shannon_spider.db.CommonFieldMixin",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "shannon_spider.db.ItemBaseModel",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 18,
"usage_type": "call"
},
{
... |
5369631964 |
import json
import logging
from flask import Flask, request, send_file, send_from_directory
from flask_cors import CORS
import os
import sys
sys.path.append('../tools/')
import ev
# No module named 'ev'
# No module named 'pythonService'
app = Flask(__name__)
CORS(app) # 解决跨域问题
app.logger.setLevel(logging.DEBUG)... | wcl95716/videoWebsites | pythonService/src/service/videosServiceApi.py | videosServiceApi.py | py | 1,894 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_n... |
9963178186 | import numpy as np
import imutils
from imutils import contours
import cv2
from scipy.spatial import distance as dist
from imutils import perspective
import random
# Specified colors to draw the distances along with the reference object.
colors = ((0, 0, 255), (240, 0, 159), (0, 165, 255), (255, 255, 0), (255, 0, 255))... | fernandowolfer/industry-cv-solutions | utils.py | utils.py | py | 10,616 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.cvtColor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "cv2.GaussianBlur",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.threshold",... |
38279608296 | from core.models import BaseModel
from core.models import Keyword
from google.appengine.ext import ndb
class Variable(BaseModel):
name = ndb.StringProperty()
tipo = ndb.StringProperty()
keywords = ndb.KeyProperty(Keyword, repeated=True)
description = ndb.StringProperty()
@classmethod
def get... | juliankmazo/policy-matrix | backend/core/models/variable.py | variable.py | py | 1,155 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "core.models.BaseModel",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.ndb.StringProperty",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.ndb",
"line_number": 8,
"usage_type": "name"
},
{
... |
39781088343 | from flask import Blueprint, jsonify
from flask_login import login_required
from app.models import db, User
from flask_login import current_user
from app.forms import UserForm
from app.models.request import FriendRequest
user_routes = Blueprint('users', __name__)
@user_routes.route('/')
@login_required
def users():... | Waseemalame/Phasebook | app/api/user_routes.py | user_routes.py | py | 2,263 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "app.models.User.query.all",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "app.models.User.query",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "a... |
12085951250 | from PIL import Image
#opening the reference image
reference_name = "uno_reverse_resized"
reference_path = f"reference_images/{reference_name}.jpg"
reference_image = Image.open(reference_path)
reference_pixels = list(reference_image.getdata())
reference_size = reference_image.size # getting the refence image's size i... | LightspeedC83/Generating-ASCII-Art | ascii_art_generator.py | ascii_art_generator.py | py | 1,116 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PIL.Image.open",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 7,
"usage_type": "name"
}
] |
46095917087 | import numpy as np
from sklearn.metrics import RocCurveDisplay
import matplotlib.pyplot as plt
import os
cert_or_unm = 'snd-cert' if False else 'snd-unm'
path = os.path.join('.', 'negative-selection', 'syscalls', cert_or_unm)
jarfile = os.path.join('.', 'negative-selection', 'negsel2.jar')
filename = rf'{path}\{cert_... | slejeune/negative-selection | syscalls.py | syscalls.py | py | 2,165 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
... |
40978864591 | from typing import List, Tuple, Optional
from collections import defaultdict,deque
from functools import cache
import heapq
from sortedcontainers import SortedDict,SortedList
class Solution:
def minReverseOperations(self, n: int, p: int, banned: List[int], k: int) -> List[int]:
ret = [-1]*n
ret[p]... | wherby/code | contest/00000c315d89/c339/q4/t4 copy.py | t4 copy.py | py | 1,523 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
}
] |
36511164634 | from typing import List
from . import ImageDisplayOptions, UrlTypeHint
from .AndroidApp import AndroidApp
from .CarouselBrowseItem import CarouselBrowseItem
from .Image import Image
from .OpenUrlAction import OpenUrlAction
class CarouselBrowse(dict):
"""
{
"item_list": [
{
object(Item)... | mayankberi1/GoogleActions | CarouselBrowse.py | CarouselBrowse.py | py | 2,481 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "CarouselBrowseItem.CarouselBrowseItem",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "Carouse... |
12839753746 | import os
import opts
import json
from PIL import Image
import subprocess
import platform
import shutil
from constants import VIDEO_FNAME, VIDEO_META_FNAME
output_path = os.path.join(os.path.dirname(__file__), opts.global_opts.outpath)
ops = ['txt2img', 'img2img', 'img2vid', 'editing']
op_opt_keys = {
# "txt2img... | danpursuit/all-is-one | server/output_manager.py | output_manager.py | py | 6,739 | python | en | code | 13 | github-code | 7 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "opts.global_opts",
"lin... |
39240896084 | import csv
from ...models import Solution
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
def handle(self, *args, **options):
Solution.objects.all().delete()
with open("drawdown-stats.csv", "r+") as f:
for index, row in enumerate(csv.reade... | mrchrisadams/djangocon-eu-2019 | jupaltdjango/charts/management/commands/import_drawdown.py | import_drawdown.py | py | 681 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Solution.objects.all",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.Solution.objects",
"line_number": 8,
"usage_type": "attribute"
... |
30248866155 | """
strategy to solve the problem:
#daily temperature problem: find the number of day from the ith day will have warmer temperature
#using stack strategy:
res (list): to hold result list
stack (list): to hold the index, temperature of daly
#for each iteration we will know the index (da... | toanbui626391/data_structure_algorithm | stack/daily_temperatures.py | daily_temperatures.py | py | 905 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
}
] |
29082506368 | import os
import sys
import pandas as pd
import numpy as np
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
_cur_dir = os.path.split(os.path.abspath(__file__))[0]
_root_dir = os.path.split(_cur_dir)[0]
sys.path.append(_root_dir)
from server.interfaces.data.data_add_values import data_add_values, DataInput
from server.inter... | ELMEM/text2sql | scripts/import_values.py | import_values.py | py | 2,816 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_n... |
25174495889 | #required modules for the program
import pyttsx3
import datetime
import speech_recognition as sr
import webbrowser
import wikipedia
import os
import requests
# import googlesearch
#engine
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice',voices[0].id)
de... | MadFlasheroo7/py-code | Mark.py | Mark.py | py | 5,738 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "pyttsx3.init",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "speech_reco... |
38847575043 | from pathlib import Path
import numpy as np
from matplotlib import pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.transforms as mtransforms
from scipy.signal import savgol_filter
from mne import read_evokeds
from mne.viz import plot_topomap
root = Path(__file__).parent.parent.parent.absolute()
... | OleBialas/elevation-encoding | code/plots/plot_components.py | plot_components.py | py | 2,235 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.gr... |
74905238943 | import os
import uuid
import json
import s3_handler
import processing_requests as pr
import pika
import aio_pika
import asyncio
import logging
from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.utils import executor
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from a... | Uzym/OOP_curs | bot/app.py | app.py | py | 4,029 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "aiogram.Bot",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "config.TOKEN",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "aiogram.dispatcher.Dispatcher",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "aiogram.contri... |
74226757342 | #!/usr/bin/python3
#-*-coding:utf-8-*-
# @Time: 2020/8/10 19:41
# @Author: haiyong
# @File: removeDuplicates.py
from typing import List
class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
i = 0
j = 0
while j < len(nums) - 1:
if nums[j] == nums[j + 1]:
... | hiyongz/AlgorithmNotes | 01-Arrays-List/removeDuplicates.py | removeDuplicates.py | py | 572 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
}
] |
20944651180 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:Yingli Zhou
# version 0.1.0 2022/1/1
from collections import defaultdict
import requests
import re
# 下载一个网页
url = 'http://rest.kegg.jp/link/ko/M00001'
# 模拟浏览器发送http请求
response = requests.get(url)
# 编码方式
response.encoding='utf-8'
# 目标主页的网页源码
html = ... | ucassee/Challenger-Deep-Microbes | Py/pachong_kegg_mudule.py | pachong_kegg_mudule.py | py | 1,109 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 22,
"usage_type": "call"
}
] |
23201402411 |
import torch
import numpy as np
from tqdm import tqdm
class NN():
def __init__(self):
pass
def fit(self, X, y):
self.X = X
self.y = y
def _predict(self, X, mode, y = None):
pass
def q(self, X, y):
return self._predict(X = X, mode = 'q', y = y)
def q_mean(self, X, y):
yhat = self... | josegfer/nn | models.py | models.py | py | 3,178 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.mean",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.cdist",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 34,... |
3047572765 | import datetime
import csv
import os
def unix_to_utc(ts):
# 예를들어 1688391782.799519를 변환하게 되면 나중에 역변환 할때 .0799519 부분이 누락됨.
utc_time = datetime.datetime.fromtimestamp(float(ts))
return utc_time.strftime("%Y-%m-%d %H:%M:%S")
def utc_to_unix(ts):
utc_time = datetime.datetime.strptime(ts, "%Y-%m-%d %H:%M:%... | carrotcookie/SlackChannelPy | util.py | util.py | py | 3,276 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 11,
"usage_type": "call"
},
{
"a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.