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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71103649063 | import pygame
from pygame.rect import *
from pygame.locals import *
BLACK = (0, 0, 0)
GRAY = (127, 127, 127)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
YELLOW = (255, 255, 0)
CYAN = (0, 255, 255)
MAGENTA = (255, 0, 255)
SIZE = 600,600
imagePath = "Capitulo_4/python.png"
running... | ArturBizon/estudo-pygame | Capitulo_4/ManipulacaoDeImagem.py | ManipulacaoDeImagem.py | py | 2,233 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.... |
6860598396 | # -*- coding: utf-8 -*-
# @Time : 2022/9/14
# @Author : youjiangyong
# @File : test_hotSpotRank.py
import allure
import pytest
from Common.Base import base
from Config.path_config import PathMessage
import os,jsonpath,datetime,random
def get_timestamp():
timestamp = datetime.datetime.now().replace(hour=9, m... | zhangmin123312/zhangmin | Testcase/aweme_material/test_rank_hotSpot.py | test_rank_hotSpot.py | py | 1,425 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "Common.Base.base",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "Config.... |
6995324450 | from lib.cuckoo.common.abstracts import Signature
utilities = [
"at ",
"at.exe",
"attrib",
"chcp",
"del ",
"del.exe",
"dir ",
"dir.exe",
"driverquery",
"erase ",
"erase.exe",
"fsutil",
"getmac",
"ipconfig",
"nbtstat",
"net ",
"net.exe",
"netsh",
... | cuckoosandbox/community | modules/signatures/windows/windows_utilities.py | windows_utilities.py | py | 4,845 | python | en | code | 312 | github-code | 36 | [
{
"api_name": "lib.cuckoo.common.abstracts.Signature",
"line_number": 142,
"usage_type": "name"
},
{
"api_name": "lib.cuckoo.common.abstracts.Signature",
"line_number": 160,
"usage_type": "name"
},
{
"api_name": "lib.cuckoo.common.abstracts.Signature",
"line_number": 176,
... |
40477310437 |
from django.urls import path, include
from estado.views import demonio_print
from estado.views import Estadoview,Estadoinsertar,Estadoeditar,Estadoeliminar,Partecuerpoview,Partecuerpoinsertar,Partecuerpoeditar,Partecuerpoeliminar,Detallecuerpoview,Detallecuerpoinsertar,Detallecuerpoeditar,Detallecuerpoeliminar,Demonio... | MrDavidAlv/FullStack_python_Django_postgreSQL | guerrero/estado/urls.py | urls.py | py | 2,109 | python | es | code | 1 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "estado.views.Estadoview.as_view",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "estado.views.Estadoview",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": ... |
33610092826 | import pygame,sys
from pygame.locals import *
class MySprite(pygame.sprite.Sprite):
def __init__(self,target):
pygame.sprite.Sprite.__init__(self)
self.master_image = None
self.frame =0
self.old_frame=-1
self.frame_width=1
self.frame_heiget=1
self.first_frame... | Ywp185/Planewar_workhouse | MySprite.py | MySprite.py | py | 2,810 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.sprite",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyga... |
24019479027 | # Author: Yuchen Liu HID213, Wenxuan Han HID209, Junjie Lu HID214
# Data: 2017.12.01
# Reference: http://blog.csdn.net/tinkle181129/article/details/55261251
from datetime import datetime
import matplotlib.pyplot as plt
import pandas as pd
from numpy import *
from sklearn import svm
from sklearn import tree
... | bigdata-i523/hid209 | project/code/523Project.py | 523Project.py | py | 4,677 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "matplotlib... |
9144803761 | import pytest
from qhub.render import render_default_template
@pytest.mark.parametrize('config_filename', [
'tests/assets/config_aws.yaml',
'tests/assets/config_gcp.yaml',
'tests/assets/config_do.yaml',
])
def test_render(config_filename, tmp_path):
output_directory = tmp_path / 'test'
output_dir... | terminal-labs/qhub-kubernetes | tests/test_render.py | test_render.py | py | 404 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "qhub.render.render_default_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 6,
"usage_type": "attribute"
}
] |
28557630081 | from pymongo import MongoClient, InsertOne
import logging
from collections import defaultdict
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
from config import TTL_BATCH_SIZE, DB_NAME
client = MongoClient()
db = client[DB_NAME]
coll_path = db.cname_real_ip
new_coll = db.ttl_real
l... | liangz1/workflow | 5_ttl_analysis/2_infer_anonymity_set_size.py | 2_infer_anonymity_set_size.py | py | 1,799 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
29307491629 | import time, math, config
from machine import Pin, ADC
mtr_enable = Pin('P20', mode=Pin.OUT)
snsr_enable = Pin('P19', mode=Pin.OUT)
adc = ADC()
adc.vref(config.level_vref)
sensor = adc.channel(pin='P13', attn=ADC.ATTN_11DB)
def purge(purge_for = 1):
""" Purge air from the tube for given number of seconds """
... | tobz-nz/firmware | lib/level.py | level.py | py | 2,374 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "machine.Pin",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "machine.Pin.OUT",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "machine.Pin",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "machine.Pin.OUT",
"line... |
17631143198 |
import pandas as pd
import numpy as np
# import seaborn as sb
import matplotlib.pyplot as plt
import statsmodels.formula.api as sm
from sklearn.model_selection import train_test_split # train and test
from sklearn import metrics
from sklearn.metrics import classification_report
#Importing Data
claimants1 = pd.read_... | mdshaji/Logistic_Regression | LogisticRegression_Claimants.py | LogisticRegression_Claimants.py | py | 2,573 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "statsmodels.formula.api.logit",
"line_number": 33,
"usage_type": "call"
},
{... |
11090983949 | import setuptools
from setuptools import find_packages
_name = "data_streaming_pipeline"
_repo_name = "realtime_data_streaming_pipeline"
_license = 'Proprietary: Internal use only'
_description = "Realtime Data pipeline and Web application"
_github_username = "NourSamir"
setuptools.setup(
name=_name,
version=... | NourSamir/realtime_data_streaming_pipeline | setup.py | setup.py | py | 1,440 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "setuptools.setup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 30,
"usage_type": "call"
}
] |
4942345877 | import numpy as np
import pygame
from tile import Tile
import algorithme
from button import Button
from timer import Timer
class Board:
def __init__(
self,
name: str, # Nom de la grille
window: pygame.Surface, # Paramรจtre spรฉcifiant la surface d'affichage
matrix: np.ndarray, # M... | Affell/depinfo_sudoku | board.py | board.py | py | 15,941 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.Surface",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarr... |
9210248768 | import discord
from redbot.core import commands, checks
from redbot.core.utils.menus import menu, DEFAULT_CONTROLS
from .core import Core
class Space(Core):
"""Show pics of space."""
@commands.group()
@checks.mod_or_permissions(manage_channels=True)
async def spaceset(self, ctx: commands.Context):
... | kennnyshiwa/kennnyshiwa-cogs | space/space.py | space.py | py | 5,376 | python | en | code | 19 | github-code | 36 | [
{
"api_name": "core.Core",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "redbot.core.commands.Context",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "redbot.core.commands",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "redbo... |
40657050860 | import tensorflow as tf
import tensorlayer as tl
import numpy as np
import scipy
import time
import math
import argparse
import random
import sys
import os
from termcolor import colored, cprint
from model_dual import model_dual as model_net
import dataLoad_dual as dataLoad
from time import gmtime, strftime
import p... | betairylia/NNParticles | predict_dual.py | predict_dual.py | py | 8,640 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.reduce_mean",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.reduce_max",
"line_number": 37,
"usage_type": "attribute"
},
{
"ap... |
29467412193 | import urllib.parse
from flask import request
from sqlalchemy import select
from FashionCampus.database import session
from FashionCampus.common import get_image_url
from FashionCampus.model import Product, ProductImage
from FashionCampus.api.blueprints import home
@home.route('/home/banner', methods = ['GET'])
de... | michaelrk02/FashionCampus | api/home/get_banner.py | get_banner.py | py | 866 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "FashionCampus.database.session",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.select",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "FashionCampus.model.Product.id",
"line_number": 18,
"usage_type": "attribute"
},
{
... |
25316015896 |
# coding: utf-8
# In[1]:
import numpy as np
import tensorflow as tf
dataPhase = np.load("trainLenetdataPhase.npy")
dataMag = np.load("trainLenetdataMag.npy")
dataY = np.load("trainLenetdataY.npy")
# In[2]:
from keras.models import Sequential
from keras.layers import Convolution2D
model = Sequential()
model.add... | MarvinChung/sound-classification-CNN | Lenet_with_MagAndPhase.py | Lenet_with_MagAndPhase.py | py | 1,445 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequential",
"line_... |
74059845544 | # Largely stolen from https://github.com/jmoiron/humanize (MIT)
from datetime import datetime, timedelta
def _ngettext(message, plural, num):
return message if num == 1 else plural
def _now():
return datetime.now()
def abs_timedelta(delta):
"""Returns an "absolute" value for a timedelta, always repre... | facultyai/faculty-sync | faculty_sync/screens/humanize.py | humanize.py | py | 4,625 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 27,
"usage_type": "argument"
},
{
"api_name": "datetim... |
17177496153 | from indexes.single_indexes.hnsw_hnswlib import HnswHnswlib
from indexes.testers.TimeStats import BuildTimeStats, QueryTimeStats
from indexes.utils.dataset import BasicDataset
from indexes.utils.distance_function import l2distance
import Index
from sklearn.cluster import KMeans
from overrides import overrides
from typ... | war-and-peace/dss | indexes/distributed_indexes/KMeansIndex.py | KMeansIndex.py | py | 3,703 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Index.Index",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "time.time",
"li... |
11625971052 | from typing import List
class Contact():
all_contacts: List["Contact"] = []
def __init__(self,nombre: str,email: str):
self.nombre = nombre
self.email = email
Contact.all_contacts.append(self)
def __repr__(self)->str:
return (f"ClassName: {self.__class__.__name__}... | ujpinom/python-advanced | oop/Intro/inheritance.py | inheritance.py | py | 764 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
}
] |
18108370652 | #!/usr/bin/env python3
from pynput import keyboard as kb
import rospy
from std_msgs.msg import String
rospy.init_node("teclas")
pub = rospy.Publisher("/voice_ui", String, queue_size=10)
def callback(tecla):
s = String()
print("Se ha pulsado la tecla ")
if(str(tecla) == "'r'"):
print("R"... | DanielFrauAlfaro/Proyecto_Servicios | controllers/scripts/teclas.py | teclas.py | py | 655 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rospy.init_node",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "rospy.Publisher",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "std_msgs.msg.String",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "std_msgs.msg.Str... |
32555585927 | from cvxpy import *
from cvxpy.tests.base_test import BaseTest
class TestSolvers(BaseTest):
""" Unit tests for solver specific behavior. """
def setUp(self):
self.a = Variable(name='a')
self.b = Variable(name='b')
self.c = Variable(name='c')
self.x = Variable(2, name='x')
... | riadnassiffe/Simulator | src/tools/ecos/cvxpy/cvxpy/tests/test_solvers.py | test_solvers.py | py | 5,663 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cvxpy.tests.base_test.BaseTest",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "cvxpy.problems.solvers.utilities.SOLVERS.keys",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "cvxpy.problems.solvers.utilities.SOLVERS",
"line_number": 125,
... |
8617197984 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Fetching user description and subscriptions given a channel id.
Usage: python 11_scrape_youtube_subscriptions.py
Input data files: data/mbfc/to_crawl_users.csv
Output data files: data/mbfc/active_user_subscription.json.bz2
"""
import up # go to root folder
import o... | avalanchesiqi/youtube-crosstalk | crawler/10_scrape_youtube_subscriptions.py | 10_scrape_youtube_subscriptions.py | py | 2,192 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "utils.helper.Timer",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "bz2.BZ2File",
"lin... |
1534341836 | from __future__ import annotations
from typing import Optional
from urllib.parse import urlencode
from jupyterhub.tests.utils import async_requests, public_host
from jupyterhub.utils import url_path_join
from traitlets import Unicode, default
from jupyterhub_moss import MOSlurmSpawner
def request(
app,
meth... | silx-kit/jupyterhub_moss | test/utils.py | utils.py | py | 1,809 | python | en | code | 14 | github-code | 36 | [
{
"api_name": "typing.Optional",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "jupyterhub.utils.url_path_join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "jupyte... |
29117927396 | from flask import Flask,request
from sklearn.pipeline import Pipeline
import numpy as np
import joblib
import json
app = Flask(__name__)
# inisialize predected volume
predected_data = 0.0
# load pipeline
pipeline = joblib.load('transform_predict.joblib')
@app.route("/", methods=["POST", "GET"])
def home():
... | MEZZINE-1998/ML-app-for-traffic-prediction-with-Azure-DevOps | app.py | app.py | py | 1,203 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "joblib.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
73313383785 | # %%
import numpy as np
import pandas as pd
import torch
import os
from matplotlib import pyplot as plt
colors2 = ['#FD6D5A', '#FEB40B', '#6DC354', '#994487', '#518CD8', '#443295']
line_styles = ['-', '--', '-', '--', '-', '--']
color = ['red', 'blue', '#FEB40B']
n = 5
length = 50
filenames = [
'results/fed_avg_... | zhengLabs/FedLSC | painting/compare_test2.py | compare_test2.py | py | 1,273 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.title... |
25625685943 | from collections import defaultdict
class Classy:
def __init__(self):
self.head = defaultdict()
def createTrie(self, phases):
if not phases: return 0
for word in phases:
temp = self.head
for each in word.split():
if each not in temp:
... | Akashdeepsingh1/project | 2020/Stream&Phase2.py | Stream&Phase2.py | py | 1,765 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 5,
"usage_type": "call"
}
] |
13213708677 | from bson import ObjectId
from pydantic import BaseModel, Field
from typing import Optional
class PyObjectId(ObjectId):
@classmethod
def __get_validators__(cls):
yield cls.validate
@classmethod
def validate(cls, v):
if not ObjectId.is_valid(v):
raise ValueError("Invalid ob... | danbeaumont95/e-commerce-app-backend | app/address/model.py | model.py | py | 2,057 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "bson.ObjectId",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "bson.ObjectId.is_valid",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bson.ObjectId",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "bson.ObjectId",
... |
44156571393 | import importlib
import model.trainer
import data.VCTK
import torch
import signal
if __name__ == "__main__":
dataset = data.VCTK.VCTKDataset(
text_file_paths=["resources/tomscott/txt/tomscott.txt"],
audio_file_paths=["resources/tomscott/wav48/tomscott.wav"]
)
print(f"Loaded {len(dataset)} e... | CISC-867/Project | afktrain-targeted.py | afktrain-targeted.py | py | 1,091 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "data.VCTK.VCTK.VCTKDataset",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "data.VCTK.VCTK",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "data.VCTK",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "model.trainer.t... |
35842733652 | import os
import numpy as np
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'cafe_star_project.settings')
import django
django.setup()
from CafeStar.models import User, Drink, Order, ShopStatus
def populate():
drinks = [
{'DrinkID': 0,
'Name': 'Latte',
'Picture... | zhengx-2000/CafeStar | populate_cafestar.py | populate_cafestar.py | py | 3,038 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.environ.setdefault",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "CafeStar.models.Drink... |
32910781669 | from pyspark import SparkContext, SparkConf
from pyspark.sql import Row, SQLContext
if __name__ == "__main__":
conf = SparkConf()
conf.setAppName("MinhaAPP")
sc = SparkContext(conf=conf)
linhas = sc.textFile('hdfs://elephant:8020/user/labdata/pessoas.txt')
cols = linhas.map(lambda linha: linha.... | dinomagri/cluster-conf-labdata | testing/minhaapp.py | minhaapp.py | py | 838 | python | pt | code | 1 | github-code | 36 | [
{
"api_name": "pyspark.SparkConf",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.Row",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SQLC... |
10677267231 | import logging
from datetime import datetime
import flask_rebar
from flask_rebar import errors
from app.app import v1_registry
from app.entities.author import Author
from app.schemas.request.author import AuthorRequestSchema
from app.schemas.response.author import AuthorResponseSchema
from app.services import author ... | Sunoyon/flask-foundation-service | app/controllers/author.py | author.py | py | 2,388 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask_rebar.get_validated_body",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.entities.author.Author",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "app.services.author.save",
"line_number": 23,
"usage_type": "call"
},
{
... |
30395166391 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
#from collections import OrderedDict
import matplotlib.pyplot as plt
#import torch.optim as optim
import math
import random
def plot3D(imgA,imgB,l1,l2,dim,mode="max"):
if mode == "max":
img2D_A,_ = torch.max(imgA[0,l1,:... | febrianrachmadi/BIA_ATLAS2 | deep_patchwork/pw/vis.py | vis.py | py | 3,013 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "torch.max",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 34,
... |
21200829619 | # coding: utf-8
import json
import traceback
from collections import deque
import requests
import time
from threading import Event, Thread, Lock
from datetime import datetime, timedelta
from datetime import time as datetime_time
import copy
import yaml
import os
from socket import socket, AF_INET, SOCK_DGRAM, SOCK_STRE... | PP-lib/BFS | BFS-X/libs/parameters.py | parameters.py | py | 19,180 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "collections.deq... |
75260503145 | import json, jsonlines
class vocab():
def __init__(self):
self.word2index = {}
self.word2count = {}
self.index2word = []
self.n_words = 0 # Count word tokens
self.num_start = 0
def add_sen_to_vocab(self, sentence): # add words of sentence to vocab
for word in se... | ttt-77/CS546_project | preprocess/pre_data.py | pre_data.py | py | 5,813 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.loads",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "jsonlines.open",
"line_number": ... |
71804654824 | import pygame
import time
import random
pygame.init()
wh = (255, 255, 255) # White
ye = (255, 255, 102) # Yellow
bk = (0, 0, 0) # Black
re = (213, 50, 80) # Red
gr = (0, 255, 0) # Green
bl = (50, 153, 213) # Blue
screenWidth = 600
screenHeight = 400
display = pygame.display.set_... | Feleur/Snake | main.py | main.py | py | 3,541 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
19793680016 | import logging
import gevent
from binascii import hexlify
from steam.client import SteamClient
from steam.core.msg import MsgProto
from steam.enums.emsg import EMsg
from steam.utils.proto import proto_to_dict
import vdf
LOG = logging.getLogger("Steam Worker")
class SteamWorker(object):
def __init__(self):
... | ValvePython/steam | recipes/2.SimpleWebAPI/steam_worker.py | steam_worker.py | py | 3,921 | python | en | code | 934 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "steam.client.SteamClient",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "steam.core.msg.MsgProto",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "st... |
71893420264 | #!/usr/bin/python3
""" Write a script that adds the State object
โLouisianaโ to the database hbtn_0e_6_usa """
import sys
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from model_state import Base, State
if __name__ == "__main__":
engine = create_engine(
'mysql+mysqldb://{}:{... | ericpo1sh/holbertonschool-higher_level_programming | python-object_relational_mapping/11-model_state_insert.py | 11-model_state_insert.py | py | 776 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "model_state.Base.metadata.create_all",
"line_number": 14,
"usage_type": "call"
},
{
"api_n... |
38100149531 | from django.db import models
# Create your models here.
class BaseModel(models.Model):
"""
All models (in other apps) should subclass BaseModel.
This is just a convenient place to add common functionality and fields
between models.
FSM_FIELDS (if used) must be defined on models that inherit from B... | iBala/bluetie | base/models.py | models.py | py | 569 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.DateTimeField",
"line_number": 14,
"usage_type": "call"
},
{
"api_nam... |
16354953325 | import configparser # implements a basic configuration language for Python programs
import os # provides a portable way of using operating system dependent functionality
import sys # system-specific parameters and functions
import numpy as np # the fundamental package for scientific computing with Python
from logz... | cmikke97/Automatic-Malware-Signature-Generation | src/Model/nets/generators/dataset.py | dataset.py | py | 6,823 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"l... |
4778471079 | from typing import Tuple, Sequence
from functools import partial, reduce
import operator
import jax
import jax.numpy as jnp
from transformer_engine_jax import DType as TEDType
from .cpp_extensions import cast_transpose, gemm, jax_dtype_to_te_dtype
from .fp8 import FP8Helper, FP8GemmPackage
from .sharding import Shardi... | NVIDIA/TransformerEngine | transformer_engine/jax/dot.py | dot.py | py | 9,710 | python | en | code | 1,056 | github-code | 36 | [
{
"api_name": "jax.config.update",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "jax.config",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "jax.config.update",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "jax.config",
... |
818390269 | """ Simple static vocabularies
"""
from eea.faceted.vocabularies.utils import IVocabularyFactory
from zope.interface import implements
from zope.schema.vocabulary import SimpleVocabulary
from zope.schema.vocabulary import SimpleTerm
from eea.faceted.vocabularies import EEAMessageFactory as _
#
# Use catalog
#
class U... | RedTurtle/eea.faceted.vocabularies | eea/faceted/vocabularies/simple.py | simple.py | py | 1,247 | python | en | code | null | github-code | 36 | [
{
"api_name": "zope.interface.implements",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "eea.faceted.vocabularies.utils.IVocabularyFactory",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "zope.schema.vocabulary.SimpleTerm",
"line_number": 22,
"u... |
22985633862 | import os
import yaml
class TestConfig:
def get_config(self, property_name: str):
data = self.get_config_data()
if data.get(property_name):
return data.get(property_name)
raise RuntimeError("Incorrect Config")
@staticmethod
def get_config_data():
cur_dir = os... | muthukrishnanmce/python_selenium_pom | utilities/test_config.py | test_config.py | py | 566 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
25210551689 | #!/usr/bin/env python3
"""Train several models for phone-play detector using synthetic data"""
from os import path
import random
import pickle
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
from... | bxkftechteam/onnx-ml-demo | train/train.py | train.py | py | 1,981 | python | en | code | 9 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numb... |
44095373893 | from typing import List
from test_framework import generic_test
import math
def maximum_revenue(coins: List[int]) -> int:
memo = [[None for j in range(len(coins))] for i in range(len(coins))]
def pick(start,end):
if start > end:
return 0
if memo[start][end] != None:
r... | kchen1025/Python-EPI | epi_judge_python/picking_up_coins.py | picking_up_coins.py | py | 829 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "test_framework.generic_test.generic_test_main",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "test_framework.generic_test",
"line_number": 26,
"usage_type": "name"
}
] |
4090267017 | # This code is mostly from here: https://thedatafrog.com/en/articles/word-embedding-sentiment-analysis/
# Adapted for Ling471 by Olga Zamaraeva
# May 2021
import matplotlib.pyplot as plt
import os
import math
# you must install tensorflow version 2.5.0 (the latest one)
import tensorflow as tf
from tensorflow import ke... | sam-testings/Ling471-SP2021-HW5 | imdb_neural.py | imdb_neural.py | py | 6,831 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tensorflow.random.set_seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.random",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "m... |
24499826950 | from django.shortcuts import render, redirect
from .models import Notes, Teacher ,Student, Pdfbooks, Papers, User, Answer, Post
from .forms import ContributionNoteForm, SignUpForm, ContributionBookForm,SignUpFormFaculty, PostForm, AnswerForm, ContributionPaperForm
from django.contrib.auth import authenticate, login, lo... | TanuAgrawal123/StudyApp | Notes/views.py | views.py | py | 10,440 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "django.contrib.auth.forms.AuthenticationForm",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 29,
"usage_type"... |
19780157392 | from torch_geometric.data import InMemoryDataset
import os.path as osp
import torch
from tqdm import tqdm
import argparse
import os, sys
sys.path.append('./data/graph_construction/prepare_notes')
from ConstructDatasetByNotes import *
IMDB_PATH = './data/IMDB_HCUT' # path to save output hypergraphs
PRE_PAT... | ny1031/TM-HGNN | graph_construction/prepare_notes/PygNotesGraphDataset.py | PygNotesGraphDataset.py | py | 4,404 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch_geometric.data.InMemoryDataset",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "os.p... |
2465730198 | import copy
import cv2
import glob
import os
import pathlib
import sys
import time
import xml
import xml.etree.ElementTree as ET
from . import utils
from .. import procs
# Add import path for submodules
currentdir = pathlib.Path(__file__).resolve().parent
sys.path.append(str(currentdir) + "/../../submodules/separate_... | ndl-lab/ndlocr_cli | cli/core/inference.py | inference.py | py | 30,875 | python | ja | code | 325 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"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",
"lin... |
28144596558 | """Script for picking certain number of sampels."""
from argparse import ArgumentParser
from streaming import StreamingDataset, MDSWriter
def parse_args():
args = ArgumentParser()
args.add_argument('--input_dir', type=str, required=True)
args.add_argument('--output_dir', type=str, required=True)
arg... | sophiawisdom/streaming | streaming/text/convert/enwiki/mds/pick_eval_samples.py | pick_eval_samples.py | py | 1,392 | python | en | code | null | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streaming.StreamingDataset",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "streaming.MDSWriter",
"line_number": 31,
"usage_type": "call"
}
] |
8343985378 | from typing import Dict, Iterator, NewType, Tuple
FILEPATH = "data/data_05.txt"
OverlapedPoints = NewType('OverlapedPoints', Dict[Tuple[int, int], int])
def read_lines(filepath: str) -> Iterator:
with open(filepath, 'r') as fp:
for line in fp.readlines():
start, end = line.split(' -> ')
... | fabiolab/adventOfCode2021 | day05.py | day05.py | py | 1,515 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "typing.NewType",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "typing.Iterator",
"line_numb... |
72177096103 |
import argparse
from utils.wandb import Wandb
from utils.config import config
import os, sys, time, shortuuid, pathlib, json, logging, os.path as osp
import torch
import numpy as np
import pandas as pd
from sklearn.utils import shuffle
import random
import torch.nn as nn
import torch.nn.functional as F
import os
sys... | emadalibrahim/reaction_rate_prediction | Hyperoptimization/ReactionPrediction.py | ReactionPrediction.py | py | 4,712 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "sys.path.insert",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "wandb.init",
"line_nu... |
36808225829 | from typing import Sequence, Dict, Union
import numpy as np
from .evaluator import Evaluator
from .labeled_tensor import LabeledTensor
class LabelMapEvaluator(Evaluator):
""" Computes statistics related to volume and shape of the structures in a label map.
A table with per-subject stats will be included in ... | efirdc/Segmentation-Pipeline | segmentation_pipeline/evaluators/label_map_evaluator.py | label_map_evaluator.py | py | 4,654 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "evaluator.Evaluator",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line... |
71949120425 | # -*- coding: utf-8 -*-
"""
This module contains the main experiments performed using the current framework.
Created on Mon Sep 30 13:42:15 2019
@author: Jorge Mario Cruz-Duarte (jcrvz.github.io), e-mail: jorge.cruz@tec.mx
"""
from . import hyperheuristic as hyp
from . import operators as op
from . import benchmark_... | jcrvz/customhys | customhys/experiment.py | experiment.py | py | 18,465 | python | en | code | 17 | github-code | 36 | [
{
"api_name": "os.path.isfile",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 127,
"usage_type": "name"
},
{
"api_name": "os.path.isfile",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
39556953839 | import pytest
def Fibonacci(n):
# Check if input is 0 then it will print incorrect input
if n < 0:
print("Incorrect input")
# Check if n is 0 then it will return 0
elif n == 0:
return 0
# Check if n is 1,2 it will return 1
elif n == 1 or n == 2:
return 1
else:... | Orya-s/U_code-CyberArk | exercises/week5/PythonIntermediate/tests/test_ex_1.py | test_ex_1.py | py | 480 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pytest.mark.parametrize",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 20,
"usage_type": "attribute"
}
] |
7958737031 | import argparse
import glob
import logging
import os
import random
import re
import shutil
import stat
import subprocess
# Path to the directory containing this source file.
SRC_DIR = os.path.dirname(os.path.realpath(__file__))
BINARIES_DIR = os.path.join(SRC_DIR, 'binaries')
def generate_shaders(no_of_files, output... | google/randomized-graphics-shaders | clusterfuzz-black-box-fuzzers/wgslsmith/run.py | run.py | py | 2,023 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
6484108617 | """
Data Analytics II: Simulation Study Functions.
Author: Arbian Halilaj, 16-609-828.
Spring Semester 2022.
University of St. Gallen.
"""
# load the required functions
import numpy as np
import statsmodels.api as sm
import pandas as pd
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as pl... | akapedan/Causal_Econometrics | functions.py | functions.py | py | 8,216 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.random.normal",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.random.binomi... |
23452539852 | # coding=utf-8
from oss2.api import *
from oss2.auth import *
from flask import current_app
def get_oss_auth_sigi():
# access_key_id, access_key_secret
access_key_id = current_app.config["ACCESS_KEY_ID"]
access_key_secret = current_app.config["ACCESS_KEY_SECRET"]
auth = AuthV2(access_key_id, access... | z1421012325/py_flask_online_classroom | OnlineClassroom/app/utils/aliyun_oss.py | aliyun_oss.py | py | 1,316 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.current_app.config",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flask.current_app",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.current_app.config",
"line_number": 13,
"usage_type": "attribute"
},
{
"api... |
38380409709 | import pytest, os
import warnings, collections, operator, logging
import generic_utils
## see https://docs.pytest.org/en/latest/example/simple.html#incremental-testing-test-steps
from typing import Dict, Tuple
# store history of failures per test class name and per index in parametrize (if parametrize used)
##_test_f... | cp4cds/cmip6_range_check_old | scripts/local_pytest_utils.py | local_pytest_utils.py | py | 11,159 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "collections.namedtuple",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "... |
70480534505 | import numpy as np
from tqdm import tqdm
from tools import augment_cluster
class InversionAugmentor(object):
"""docstring for InversionAugmentor."""
def __init__(self, waveforms = None, earthquake_parameters = None, new_elements=2, parameter_variation=0.2, additional_weight = False):
super(InversionA... | alexmundt/augmentation-tools | inversion_augmentation.py | inversion_augmentation.py | py | 5,611 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tools.augment_cluster",
"line_number": 73,
"usage_type": "call"
}
] |
32018992802 | # -*- coding: utf-8 -*-
"""
Author : Jason See
Date : 2022/6/9 15:50
Tool : PyCharm
Content:
"""
import json
import urllib.request
def get_response_dic(data):
url = 'http://192.168.30.128/api_jsonrpc.php'
header = {'Content-Type': 'application/json'}
data = bytes(data, 'utf-8')
request = urll... | zcsee/pythonPra | zabbix_pra/demo2.py | demo2.py | py | 2,611 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 16,
"usage_type": "name"
},
{
"api_nam... |
41524333829 | import cv2 # working with, mainly resizing, images
import numpy as np # dealing with arrays
import os # dealing with directories
from random import shuffle # mixing up or currently ordered data that might lead our network astray in training.
from tqdm import tqdm # a nice p... | MourabitElBachir/Face_Detection_Deep_Learning | code/preparing_data.py | preparing_data.py | py | 1,845 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tqdm.tqdm",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
... |
69816265383 | """Stream type classes for tap-sharepointsites."""
from singer_sdk.typing import (
DateTimeType,
ObjectType,
PropertiesList,
Property,
StringType,
)
from tap_sharepointsites.client import sharepointsitesStream
class ListStream(sharepointsitesStream):
"""Define custom stream."""
primary_... | storebrand/tap-sharepointsites | tap_sharepointsites/streams.py | streams.py | py | 1,003 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "tap_sharepointsites.client.sharepointsitesStream",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "singer_sdk.typing.PropertiesList",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "singer_sdk.typing.Property",
"line_number": 20,
"usage_... |
14415686598 | #!/usr/bin/env python3
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVR
from sklearn.ensemble import RandomForestRegressor
class Surrogate:
""" Surrogate models
"""
def __init__(self, hparams):
self.model_n... | RobinSeaside/S4IS | src/Surrogate.py | Surrogate.py | py | 2,259 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "sklearn.gaussian_process.GaussianProcessRegressor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.SVR",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestRegressor",
"line_number": 25,
"usage_type... |
75071113384 | import requests
import pandas as pd
import numpy as np
import seaborn as sns
from bs4 import BeautifulSoup
import warnings
import nltk
#import surprise
import scipy as sp
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.feature_extraction.text import CountVectorizer
from nltk.corpus import stopwords
... | Liixxn/MovieMender | tags.py | tags.py | py | 6,909 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "pandas.read_c... |
74194893543 | from torchvision import models
import torch.nn as nn
import torch.nn.functional as F
import torch
from initialize_delf import init_delf, init_densenet_TL, init_delf_TL, init_resnet101gem, init_delf_pca
def initialize_model(model_name, num_classes, freeze_layers, use_pretrained=True):
# Initialize these variables w... | kauterry/cs231n-retrieval | Kaushik/pretrain/model.py | model.py | py | 5,634 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "torchvision.models.resnet50",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torchvision.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.... |
36048548399 | import os
from uuid import uuid4
from datetime import timedelta
SECRET_KEY = os.urandom(32)
# Grabs the folder where the script runs.
basedir = os.path.abspath(os.path.dirname(__file__))
# create JWT secretkey
JWT_SECRET_KEY = 'm.f.ragab5890@gmail.comtafi_5890_TAFI'
JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=12)
# Ena... | mfragab5890/shop-sales | backend/instance/config.py | config.py | py | 478 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.urandom",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_numb... |
35098607020 | import numpy as np
from numpy import genfromtxt
from functools import reduce
#--- przerabianie grzybow ---#
mushroom = genfromtxt('dane/mushroom.csv', delimiter=',' ,dtype = str)
classes = mushroom[:,0].copy()
last = mushroom[:,-1].copy()
training_set= mushroom
training_set[:,0]= last
training_set[:,-1]=clas... | iSeptio/archive_ML_mushroom_clasification_tree | lista1.py | lista1.py | py | 7,049 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"lin... |
24921295985 | #SETUP
#Import Modules
import discord
from discord.ext import commands
from discord.ext import tasks
import os
from dotenv import load_dotenv
import math
import datetime
import _pickle
import xlwings
#Load the Token and Create a Bot
load_dotenv();
TOKEN = os.getenv('ULTIMATEPC_TOKEN'); ... | BlockMaster320/Ultimate-PC-Discord-Bot | Ultimate PC Bot.py | Ultimate PC Bot.py | py | 51,121 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Bot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "discord.ext.com... |
39916650041 | import scrapy
class QuotesSpider(scrapy.Spider):
name="quotes"
start_urls=[
'http://quotes.toscrape.com/page/1/'
]
def parse(self,response):
for quote in response.xpath('//div[@class="quote"]'):
yield {
'page':response.url,
'text':quote.xpath... | nigo81/python_spider_learn | scrapy/tutorial/tutorial/spiders/queots_spider.py | queots_spider.py | py | 714 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "scrapy.Spider",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 20,
"usage_type": "call"
}
] |
2412659284 | from flask import Flask, Blueprint
from app.controllers.animes_controller import get_animes, get_animes_by_id, create_animes, delete, update
bp_animes = Blueprint('animes', __name__, url_prefix='/animes')
bp_animes.post('')(create_animes)
bp_animes.get('')(get_animes)
bp_animes.get('/<int:anime_id>')(get_animes_by... | GustavoCielo/python-flask-psycopg2-CRUD-SQL | app/routes/anime_blueprints.py | anime_blueprints.py | py | 411 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "app.controllers.animes_controller.create_animes",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "app.controllers.animes_controller.get_animes",
"line_number": 10,
"usag... |
40569343475 | from PySide6.QtWidgets import (
QComboBox,
QGroupBox,
QHBoxLayout,
QLabel,
QVBoxLayout,
)
from game.ato.flight import Flight
from game.ato.starttype import StartType
from game.theater import OffMapSpawn
from qt_ui.models import PackageModel
class QFlightStartType(QGroupBox):
def __init__(self... | dcs-liberation/dcs_liberation | qt_ui/windows/mission/flight/settings/QFlightStartType.py | QFlightStartType.py | py | 1,582 | python | en | code | 647 | github-code | 36 | [
{
"api_name": "PySide6.QtWidgets.QGroupBox",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "qt_ui.models.PackageModel",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "game.ato.flight.Flight",
"line_number": 16,
"usage_type": "name"
},
{
"api_... |
36120731703 | import yaml
from termcolor import colored
import torch
from fortex.nltk import NLTKSentenceSegmenter, NLTKWordTokenizer, NLTKPOSTagger
from forte.common.configuration import Config
from forte.data.multi_pack import MultiPack
from forte.data.readers import MultiPackTerminalReader
from forte.common.resources import Reso... | asyml/forte | examples/chatbot/chatbot_example.py | chatbot_example.py | py | 4,076 | python | en | code | 230 | github-code | 36 | [
{
"api_name": "torch.device",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "forte.common.con... |
17096699473 | import numpy as np
from sklearn.cluster import DBSCAN
from sklearn import metrics
input_file = ('data_perf.txt')
# Load data ่ผๅ
ฅ่ณๆ
x = []
with open(input_file, 'r') as f:
for line in f.readlines():
data = [float(i) for i in line.split(',')]
x.append(data)
X = np.array(x)
# Find the best epsilon ๆพ... | neochen2701/TQCPans | ๆฉๅจๅญธ็ฟPython 3็ญๆกๆช/MLA202.py | MLA202.py | py | 1,602 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.DBSCAN",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.sil... |
37458267107 | from pprint import pprint
from fukushima_population import data
import json
with open('periodic_table.json', 'r') as f:
t = json.load(f)
# print(t)
for i in range(len(t["elements"])):
n = t["elements"][i]["name"]
sym = t["elements"][i]["symbol"]
print(f"{n}ใจใใๅ
็ด ใฏ{sym}ใจ่กจ่จใใ")
# lookup = {}
# for e... | lbrichards/asaka | python_kiso_2021_05/dict_study.py | dict_study.py | py | 539 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
}
] |
19589266829 | import json
import argparse
from sklearn.metrics import classification_report
from eval_F1 import exact_match_score, f1_score, metric_max_over_ground_truths
import numpy as np
def compute_span_f1(pred_span, gold_span):
gold_start, gold_end = gold_span
pred_start, pred_end = pred_span
tp, fp, fn = 0, 0, 0
... | blender-nlp/NewsClaims | eval/eval_claim_detection.py | eval_claim_detection.py | py | 8,147 | python | en | code | 17 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 59,
... |
18369494327 | import pandas as pd
import numpy as np
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import LinearSVC
from sklearn.metrics import confusion_matrix
#Function importing data from .txt file
def gatherData(directory):
with open(directory, "rb") as myFile:
data_table = pd.read_csv(myFile,... | trcz/human-activity-prediction | activity_prediction.py | activity_prediction.py | py | 1,585 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.naive_bayes.GaussianNB",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.LinearSVC",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "... |
37319398459 | import torch
import numpy as np
from utils.misc import soft_update
from model.BCAgent import BCAgent
from model.utils.model import *
class BahaviorClone(object):
def __init__(self, name, params):
self.name = name
self.lr = params.lr
self.gamma = params.gamma
self.tau = params.t... | bic4907/Overcooked-AI | model/bc.py | bc.py | py | 2,420 | python | en | code | 19 | github-code | 36 | [
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "model.BCAgent.BCAgent",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.T... |
74537281383 | #!/usr/bin/env python
# -*- coding: utf_8 -*
__author__ = "Benoit Delbosc"
__copyright__ = "Copyright (C) 2012 Nuxeo SA <http://nuxeo.com>"
"""
jenkviz.command
~~~~~~~~~~~~~~~~
Crawl a Jenkins to extract builds flow.
"""
import os
import logging
from model import open_db, close_db, list_builds
from crawl impo... | bdelbosc/jenkviz | jenkviz/command.py | command.py | py | 2,109 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "model.open_db",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "model.list_builds",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "model.close_db",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.error",
"l... |
22196508979 | import math
def lyapunov_exponent(d):
lamb = 0
for i in range(len(d)-2):
lamb += math.log((abs(d[i+2]-d[i+1])+1e-17)/(abs(d[i+1]-d[i])+1e-17))
lamb /= len(d)
return lamb
def logistic_f(alpfa, x0, n):
y = [0] * n
y[0] = x0
x = x0
for i in range(1, n):
x = alpfa*x*(1-x)
... | jecht1014/book | shumi/chaos/lyapunov_exponent.py | lyapunov_exponent.py | py | 649 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "math.log",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
846856008 | import itertools
from subprocess import call
import chainer
import chainer.functions as F
import chainer.links as L
import numpy as np
from chainer import serializers
from chainer.backends import cuda
from util import invLIDAR
class RecoNet(chainer.Chain):
def __init__(self, n_hid1=100, n_hid2=50):
supe... | pfnet-research/rp-safe-rl | circuit/estimator.py | estimator.py | py | 1,753 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "chainer.Chain",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "chainer.links.Linear",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "chainer.links",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "chainer.links.L... |
18457796268 | from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
import Image as PILImage
from uds.core.util.stats import charts
from uds.core.auths.auth import webLoginRequired
fr... | karthik-arjunan/testuds | server/src/uds/admin/views/reporting/usage.py | usage.py | py | 3,158 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "geraldo.Report",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "reportlab.lib.pagesizes.A4",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "reportlab... |
12573117304 | from tkinter import *
from datetime import date
from tkinter import messagebox
from PIL import Image
from tkinter.ttk import Combobox
import openpyxl
from openpyxl import Workbook
import pathlib
import tkinter as tk
import customtkinter
from tkinter import ttk
#initial
customtkinter.set_appearance_mode("System")
textco... | agarg1107/healthcare | doc.py | doc.py | py | 24,634 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "customtkinter.set_appearance_mode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "customtki... |
26821754249 | from django.urls import path
from . import views
app_name = 'myids'
urlpatterns = [
path('', views.view_index, name='index'),
path('stat', views.view_stat, name='stat'),
path('conn', views.view_conn, name='conn'),
path('query_conn', views.query_conn, name='query_conn'),
path('query_stat', views.qu... | ponedo/Network-intrusion-detection-system-based-on-heuristic-downsampling-and-random-forest | web_module/myids/urls.py | urls.py | py | 351 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
23620664915 | import math
import sys
import os
import itertools
import traceback
import copy
import datetime
from collections import deque
from collections import Counter
from random import shuffle, choice
import json
import multiprocessing
"""
Hexagons are handled in the QRS coordinate system.
Refer to https://www.redblobgames... | volzotan/LensLeech | pattern/generate.py | generate.py | py | 26,043 | python | en | code | 5 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "math.sqrt",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "PIL.ImageFont.load_default",
... |
25305990197 | import math
import os
import pygame
import random
from pygame.locals import *
import subprocess
directory = os.getcwd()
#window
pygame.init()
WIDTH = 800
HEIGHT = 500
win = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Tic Tac Toe")
#button vars
RADIUS = 20
GAP = 20
letters = []
startx = round... | Durp06/Pycade | tictactoe.py | tictactoe.py | py | 9,355 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"li... |
31046654638 | import asyncio
import uuid
from pycaret.datasets import get_data
from sqlalchemy.sql import text
from .app.database import async_engine
from .app.models import (
Base,
Client,
Payment,
)
def split_data_client_payments():
df = get_data("credit").reset_index().rename(columns={"index": "ID"})
clien... | ryankarlos/FastAPI-example-ml | src/load_data_into_tables.py | load_data_into_tables.py | py | 1,599 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "pycaret.datasets.get_data",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "uuid.uuid1",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "app.models.Client.__table__",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": ... |
31279302042 | import json
import ray
import requests
from fastapi import Body, FastAPI
from typing import List, Dict
from ray import serve
from ray.serve.handle import RayServeDeploymentHandle
from fi.service.lastpx import LastpxService
from fi.service.side import SideService
from fi.service.trddate import TrddateService
from fi.se... | tju-hwh/Yet-Another-Serverless-Benchmark | finra/ray/fi/main.py | main.py | py | 5,041 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "ray.serve.handle.RayServeDeploymentHandle",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "ray.serve.handle.RayServeDeploymentHandle",
"line_number": 28,
"usage_type": "n... |
39955757095 | #!/usr/bin/env python
#This script is to sort ArXiv papers according to your interest using Machine Learning algorithms.
import os
import urllib
import itertools
import feedparser
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
#from sklearn.linear_mod... | indiajoe/ArXivSorter | ArXivSorter.py | ArXivSorter.py | py | 13,331 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.expanduser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
11263854107 | from dataclasses import dataclass
from enum import Enum
from typing import Optional
@dataclass
class Objective:
id: Optional[int]
user_id: int
name: str
initial_date: str
final_date: str
initial_investment: str
recurring_investment: str
goal_value: str
@dataclass
class User:
user... | brunotsantos1997/robson-api | app/data/model.py | model.py | py | 964 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "typing.Optional",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "dataclasses.datac... |
35217612682 | from enum import IntEnum
import requests
from urllib.request import urlopen
import urllib
from selenium import webdriver
from bs4 import BeautifulSoup
import http.client
from openpyxl import Workbook
from openpyxl import load_workbook
from openpyxl.writer.excel import ExcelWriter
from openpyxl.cell.cell import ILLEGAL_... | Just-Doing/python-caiji | src/work/20220420/herealth.py | herealth.py | py | 7,238 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "http.client.client",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "urllib.request.build_opener",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "urlli... |
40656824900 | # python train_particleTest.py -gpu 2 -ep 20 -bs 128 -vSize 22 -vm 10 -zdim 30 -hdim 64 -enc plain -dec plain -log log_particleTest -name Plain_Plain_bs128_z30h64_gs8_gm22 MDSets/2560_smallGrid/
import tensorflow as tf
import numpy as np
import scipy
import time
import math
import argparse
import random
import sys
imp... | betairylia/NNParticles | Comparision/train_betairya.py | train_betairya.py | py | 10,993 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"l... |
22682169641 | import sys
import time
import numpy as np
import cv2
import blazeface_utils as but
# import original modules
sys.path.append('../../util')
from utils import get_base_parser, update_parser, get_savepath # noqa: E402
from model_utils import check_and_download_models # noqa: E402
from image_utils import load_image #... | axinc-ai/ailia-models-tflite | face_detection/blazeface/blazeface.py | blazeface.py | py | 7,170 | python | en | code | 14 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "utils.get_base_parser... |
11537413568 | import cv2
def getdifference(a, b):
# test image
#a, b should be image.jpeg
image = cv2.imread('./frames/'+str(a))
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
histogram = cv2.calcHist([gray_image], [0],
None, [256], [0, 256])
# data1 image
image = cv2.imread('./frames/'+str(b))
gray_image1 = c... | pa-kh039/nlp_video_descriptor | diff.py | diff.py | py | 618 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.calcHist",
"line... |
26453541576 | import gmpy2
thenumber = 600851475143
prime = 2
answer = 0
while thenumber > 1:
if thenumber % prime == 0:
thenumber = thenumber//prime
continue
prime = gmpy2.next_prime(prime)
answer = prime
print(answer)
"""
gmpy2 ์ ์๋ next_prime ์ ์ผ์. ๋ค์์ ์์์ ๋ํ ํจ์๋ค์ ๋ง๋ค์ด๋ด
์๋ค์
""" | hojin-kim/projectEuler | prob003.py | prob003.py | py | 348 | python | ko | code | 2 | github-code | 36 | [
{
"api_name": "gmpy2.next_prime",
"line_number": 10,
"usage_type": "call"
}
] |
18399557832 | from fastapi import APIRouter, Request, HTTPException, Body, Path
from linebot import LineBotApi, WebhookHandler
from linebot.exceptions import InvalidSignatureError
from linebot.models import StickerSendMessage, TextSendMessage
from machine_leanning.model_text_classifire import intent_model
from models.token_line impo... | watcharap0n/m-business | routers/wh_client.py | wh_client.py | py | 5,144 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "os.environ.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "config.db.MongoDB",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "fastapi.APIRouter",
... |
38164483571 | import itertools
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import gridspec
from scipy import linalg
from scipy.optimize import basinhopping
from skimage.filters import gabor_kernel
from skimage.transform import resize
from sklearn import feature_selection
from sklearn.... | franzigeiger/training_reductions | analysis/fit_gabor_filters.py | fit_gabor_filters.py | py | 23,923 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "numpy.real",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "skimage.filters.gabor_kernel",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "skimage.transform.resize",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "util... |
28328861625 | from asyncio.windows_events import NULL
import pstats
import sys
import tkinter as tk
import tkinter.ttk as ttk
import time
class Window(tk.Frame):
FRAME_PADX: int = 30
FRAME_PADY: int = 15
FRAME_SIZEX: int = 1000
FRAME_SIZEY: int = 300
BUTTON_SIZEX: int = 10
BUTTON_SIZEY: int = 30
BUTTON... | izumi0x01/psych-antam-advanced-experiment | myWindow.py | myWindow.py | py | 12,304 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tkinter.Frame",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "tkinter.E",
"line_number": 96,
"usage_type": "attribute"
},
{
"api_name": "tkinter.W",
"line_... |
36173603713 | import random
import re
from collections import Counter, namedtuple
re_smiley = re.compile(r'[8;:=%][-oc*^]?[)(D\/\\]')
re_smiley_reversed = re.compile(r'[)(D\/\\][-oc*^]?[8;:=%]')
re_smiley_asian = re.compile(r'\^[o_.]?\^')
extra_smileys = ['<3', '\o', '\o/', 'o/']
re_smileys = [re_smiley, re_smiley_reversed, re_smil... | Thor77/MarkovPy | markov/markov.py | markov.py | py | 5,811 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "re.compile",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 10,
... |
72694771304 | from typing import List
class Solution:
def fourSumCount(self, A: List[int], B: List[int], C: List[int], D: List[int]) -> int:
if not A:
return 0
def sameNum(arr: List[int]) -> dict:
result = {}
for i in arr:
if i in result:
r... | githubli97/leetcode-python | 202011/20201127/q454.py | q454.py | py | 1,337 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
}
] |
28867458807 | #!/usr/bin/env python3
import zipfile
import wget
import re
# CoVoST2 translations file
covost2_url = 'https://dl.fbaipublicfiles.com/covost/covost2.zip'
# File with CommonVoice English sentences translated to Catalan by humans
covost2_source_file = 'validated.en_ca.en'
# Output file
covost2_target_file = 'covost2-... | jmontane/covost2-ca | get_covost2.py | get_covost2.py | py | 1,632 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.match",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "wget.download",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "zipfile.ZipFile",
"line_number": 40,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.