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
21366302281
""" URL: https://www.lintcode.com/problem/invert-binary-tree/description Definition of TreeNode: class TreeNode: def __init__(self, val): self.val = val self.left, self.right = None, None """ # My own solution, simple recursion. class Solution: """ @param root: a TreeNode, the root of the b...
simonfqy/SimonfqyGitHub
lintcode/easy/175_invert_binary_tree.py
175_invert_binary_tree.py
py
1,448
python
en
code
2
github-code
36
[ { "api_name": "collections.deque", "line_number": 37, "usage_type": "call" } ]
22450452976
""" Team 46 Haoyue Xie 1003068 @Melbourne Jiayu Li 713551 @Melbourne Ruqi Li 1008342 @Melbourne Yi Zhang 1032768 @Melbourne Zimeng Jia 978322 @Hebei, China """ import json from shapely.geometry import shape, Point #current_region is a dictionary def streaming_region(current_region, tweet): if current_region != {...
yzzhan4/COMP90024-AuzLife
TwitterStreaming/streaming_region.py
streaming_region.py
py
1,436
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 21, "usage_type": "call" }, { "api_name": "shapely.geometry.shape", "line_number": 24, "usage_type": "call" }, { "api_name": "shapely.geometry.Point", "line_number": 28, "usage_type": "call" }, { "api_name": "shapely.geome...
38336151204
from streamlit_webrtc import webrtc_streamer import av import cv2 cascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") class VideoProcessor: def recv(self, frame): frm = frame.to_ndarray(format="bgr24") CONFIDENCE = 0.5 SCORE_THRESHOLD = 0.5 IOU_THRESHOL...
NeTRooo/CyberGarden2022-Atom
rtc_test.py
rtc_test.py
py
1,710
python
en
code
0
github-code
36
[ { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.FONT_HERSHEY_COMPLEX", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cv2.CascadeClassifier", "line_number": 16, "usage_type": "call" }, { "api_name...
37655164252
from django.shortcuts import render from django.http import HttpResponse from hello.models import User import random # Create your views here. count = 0 def World(request): return HttpResponse('this is app2') def Add_user(request): global count count += 1 user = User() user.user_age = ...
yy1110/Mydjango
django_first/app2/views.py
views.py
py
2,338
python
en
code
1
github-code
36
[ { "api_name": "django.http.HttpResponse", "line_number": 8, "usage_type": "call" }, { "api_name": "hello.models.User", "line_number": 13, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 15, "usage_type": "call" }, { "api_name": "random.getran...
26454404997
import gc import logging import os import glob import pandas as pd import sys # sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages') import time from collections import defaultdict import torch import torch.nn as nn import torch.optim as optim from math import exp import numpy as np torch.backends.cudn...
Vikr-182/ddn-forecasting
vis/infer.py
infer.py
py
10,164
python
en
code
0
github-code
36
[ { "api_name": "torch.backends", "line_number": 21, "usage_type": "attribute" }, { "api_name": "argoverse.map_representation.map_api.ArgoverseMap", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 40, "usage_type": "call" }, { ...
4413470363
''' xを数字とセットにした二次元配列を作る sを数字に置き換えたものと、元のままのものの三次元配列にする →二次元配列では取り扱いきれないので、遠慮なく三次元へ ソートして、出す ''' from collections import defaultdict x = input() n = int(input()) s = [input() for _ in range(n)] new = defaultdict(dict) for i in range(len(x)): new[x[i]] = i ans = [] for i in s: inner = [] for j in i: inner....
burioden/atcoder
submissions/abc219/c.py
c.py
py
566
python
ja
code
4
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 13, "usage_type": "call" } ]
73947800422
from django.contrib import admin from django.urls import path from . import views urlpatterns = [ path('',views.ProductList,name='ProductList'), path('productdetails',views.productdetails,name='productdetails'), path('orderslist',views.OrdersList,name='OrdersList'), path('addcolumns',views.AddColumns,n...
Fawazk/VofoxSolutions-test
vofox/purchase/urls.py
urls.py
py
403
python
en
code
1
github-code
36
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "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", ...
19453386854
import requests #Requests é um biblioteca, um pacote de código. Para instalar usar: pip install requests from tkinter import * #Pegando todas as informações da biblioteca tkinter. def pegar_cotacoes(): requisicao = requests.get("https://economia.awesomeapi.com.br/last/USD-BRL,EUR-BRL,BTC-BRL") requisicao_dic...
jessicarios-DevOps/Tkinter-python
janela.py
janela.py
py
1,628
python
pt
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" } ]
73011952423
#-*- coding: utf-8 -*- import csv import os import pymysql import pandas as pd # 一个根据pandas自动识别type来设定table的type def make_table_sql(df): columns = df.columns.tolist() types = df.ftypes # 添加id 制动递增主键模式 make_table = [] for item in columns: if 'int' in types[item]: char = item + ' ...
cyj-user/MedData
sampleData/data_input.py
data_input.py
py
2,208
python
en
code
0
github-code
36
[ { "api_name": "pymysql.cursors", "line_number": 46, "usage_type": "attribute" }, { "api_name": "pymysql.Connect", "line_number": 49, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 55, "usage_type": "call" }, { "api_name": "pandas.notnull",...
73903114025
import pandas as pd from datetime import date, timedelta, datetime from meteostat import Point, Daily import statsmodels.api as sm def read_data(): # Set time period start = datetime(2010, 1, 1) end = pd.to_datetime(datetime.now().strftime("%Y-%m-%d")) # Create Point for Vancouver, BC vancouver...
Marcosgrosso/automation_series
predict_model.py
predict_model.py
py
1,724
python
en
code
0
github-code
36
[ { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.date...
71404383785
import random, sys # random.seed(42) from person import Person from logger import Logger from virus import Virus import argparse class Simulation(object): def __init__(self, pop_size, vacc_percentage, initial_infected, virus): # TODO: Create a Logger object and bind it to self.logger. # Remember t...
b3fr4nk/Herd-Immunity-Sim
simulation.py
simulation.py
py
9,203
python
en
code
0
github-code
36
[ { "api_name": "logger.Logger", "line_number": 13, "usage_type": "call" }, { "api_name": "virus.name", "line_number": 13, "usage_type": "attribute" }, { "api_name": "person.Person", "line_number": 43, "usage_type": "call" }, { "api_name": "random.choices", "lin...
556091123
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html import os import scrapy import json from urllib.parse import urlparse from pymongo import MongoClient from scrapy.pipelines.im...
GruXsqK/Methods_scraping
Lesson_6/Youla_parser_project/youlaparser/pipelines.py
pipelines.py
py
1,918
python
en
code
0
github-code
36
[ { "api_name": "json.loads", "line_number": 20, "usage_type": "call" }, { "api_name": "scrapy.pipelines.images.ImagesPipeline", "line_number": 30, "usage_type": "name" }, { "api_name": "scrapy.Request", "line_number": 36, "usage_type": "call" }, { "api_name": "os.p...
4861207569
from dataclasses import dataclass from datetime import datetime,date import pytz import dateparser from typing import Union import pandas as pd from sqlalchemy import Column,Integer,DateTime,Text,TIMESTAMP,MetaData,Table from sqlalchemy.engine import create_engine from sqlalchemy.exc import OperationalError fr...
nitesh1489/test
helpers/handlers.py
handlers.py
py
6,204
python
en
code
1
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 19, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "datetime.date", ...
32296716535
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="trello_client-basics-api-denisshvayko", version="0.0.1", author="denis", author_email="denis.shvayko@phystech.edu", description="Обертка для trello API", long_description=long_description, long_des...
denisshvayko/D1.8
setup.py
setup.py
py
640
python
en
code
0
github-code
36
[ { "api_name": "setuptools.setup", "line_number": 5, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 9, "usage_type": "call" } ]
13989800577
# -*- coding: utf-8 -*- import copy from io import BytesIO from datetime import datetime from xlwt import Workbook, XFStyle, Borders, Pattern class ExcelWT(Workbook): """Excel生成工具 """ def __init__(self, name, encoding=r'utf-8', style_compression=0): super().__init__(encoding, style_compressio...
wsb310/hagworm
hagworm/extend/excel.py
excel.py
py
2,028
python
en
code
13
github-code
36
[ { "api_name": "xlwt.Workbook", "line_number": 11, "usage_type": "name" }, { "api_name": "xlwt.XFStyle", "line_number": 22, "usage_type": "call" }, { "api_name": "xlwt.Borders.THIN", "line_number": 23, "usage_type": "attribute" }, { "api_name": "xlwt.Borders", ...
44298786313
# -*- coding: utf-8 -*- """ Created on Fri Nov 30 08:29:53 2018 @author: Ahsan """ from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister from qiskit import compile, Aer from QGates import gateArity , gateName class QCircuit: def __init__ (self,qBit,cBit,shot=1): '''...
usamaahsan93/AutoQP
myQFn.py
myQFn.py
py
2,868
python
en
code
0
github-code
36
[ { "api_name": "qiskit.Aer.get_backend", "line_number": 32, "usage_type": "call" }, { "api_name": "qiskit.Aer", "line_number": 32, "usage_type": "name" }, { "api_name": "qiskit.QuantumRegister", "line_number": 35, "usage_type": "call" }, { "api_name": "qiskit.Class...
35397958448
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import mox from pants.base.hash_utils import hash_all, hash_file from pants.util.contextutil import temporary_file class TestHashUtils(mox.MoxTestBase): def setU...
fakeNetflix/square-repo-pants
tests/python/pants_test/base/test_hash_utils.py
test_hash_utils.py
py
942
python
en
code
0
github-code
36
[ { "api_name": "mox.MoxTestBase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pants.base.hash_utils.hash_all", "line_number": 22, "usage_type": "call" }, { "api_name": "pants.util.contextutil.temporary_file", "line_number": 29, "usage_type": "call" }, ...
74630975144
import math import os.path import re import html def calcScore(now, best): if now<1e-9: return 0 #return now / best return best / now def isBetter(now, best): if now<1e-9: return False #return best < now return now < best def main(): import sqlite3 db = sqlite3.connect...
colun/mmlang
src/mmhttpd.py
mmhttpd.py
py
15,984
python
en
code
21
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 20, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 36, "usage_type": "call" }, { "api_name": "http.server.server", "line_number": 116, "usage_type": "attribute" }, { "api_name": "http.server", ...
72508017705
''' liguangyao 10/25/2023 guangyaoli@ruc.edu.cn ''' import os import torch from torchvision import transforms, utils from PIL import Image import numpy as np import glob from imagebind import data from imagebind.models import imagebind_model from imagebind.models.imagebind_model import ModalityType device = "cuda:1...
ayameyao/ResearchToolCode
FeatureExtraction/Extract_ImageBind_Features/extract_imagebind_feats.py
extract_imagebind_feats.py
py
7,418
python
en
code
2
github-code
36
[ { "api_name": "torch.cuda.is_available", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 19, "usage_type": "attribute" }, { "api_name": "imagebind.models.imagebind_model.imagebind_huge", "line_number": 22, "usage_type": "call" }, ...
20655962047
import dataclasses import subprocess from typing import Any, ClassVar, List, Optional from fancy_dataclass.utils import DataclassMixin, issubclass_safe, obj_class_name class SubprocessDataclass(DataclassMixin): """Mixin class providing a method for converting dataclass fields to command-line args that can be use...
jeremander/fancy-dataclass
fancy_dataclass/subprocess.py
subprocess.py
py
5,568
python
en
code
0
github-code
36
[ { "api_name": "fancy_dataclass.utils.DataclassMixin", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.ClassVar", "line_number": 38, "usage_type": "name" }, { "api_name": "fancy_dataclass.utils.issubclass_safe", "line_number": 44, "usage_type": "call" }, ...
70308798185
import wx class SlideshowFrame(wx.Frame): def __init__(self,**kwargs): wx.Frame.__init__(self, **kwargs) self.SetBackgroundColour(wx.BLACK) self.panel = wx.Panel(self, pos=self.Rect.GetPosition(), size=self.Rect.GetSize()) self.empty_img = wx.EmptyImage(self.Rect.GetWidth()...
jamestunnell/auto-slideshow
slideshow_frame.py
slideshow_frame.py
py
1,851
python
en
code
1
github-code
36
[ { "api_name": "wx.Frame", "line_number": 3, "usage_type": "attribute" }, { "api_name": "wx.Frame.__init__", "line_number": 5, "usage_type": "call" }, { "api_name": "wx.Frame", "line_number": 5, "usage_type": "attribute" }, { "api_name": "wx.BLACK", "line_numbe...
8272148926
#!/usr/bin/env python3.8 # -*- coding: utf-8 -*- """ Created on Wed Feb 27 17:55:12 2023 @author: Carlos Gómez-Huélamo """ # General purpose imports import sys import os import pdb import git if str(sys.version_info[0])+"."+str(sys.version_info[1]) >= "3.9": # Python >= 3.9 from math import gcd else: from f...
Cram3r95/argo2_TGR
model/models/TFMF_TGR.py
TFMF_TGR.py
py
53,803
python
en
code
4
github-code
36
[ { "api_name": "sys.version_info", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.backends", "line_number": 42, "usage_type": "attribute" }, { "api_name": "torch.set_float32_matmul_precision", "line_number": 43, "usage_type": "call" }, { "api_...
39265812608
import pandas as pd import plotly.graph_objects as go import prepare_data population = { 'NSW':8089526, 'QLD':5095100, 'VIC':6594804, 'SA':1751693, 'WA':2621680, 'TAS':534281, 'ACT':426709, 'NT':245869, 'Total':25359662, 'DeathsNationally':25359662, } df_aus = prepare_data.aust...
explodingdinosaurs/corona
aus_states_per_capita.py
aus_states_per_capita.py
py
2,043
python
en
code
1
github-code
36
[ { "api_name": "prepare_data.australia", "line_number": 18, "usage_type": "call" }, { "api_name": "prepare_data.australia_change", "line_number": 19, "usage_type": "call" }, { "api_name": "plotly.graph_objects.Figure", "line_number": 22, "usage_type": "call" }, { "...
28891405121
import collections import difflib import logging import os import re from pytype.platform_utils import path_utils from pytype.tools.merge_pyi import merge_pyi import unittest __all__ = ('TestBuilder', 'load_tests') PY, PYI, EXPECTED = 'py', 'pyi', 'pep484.py' OVERWRITE_EXPECTED = 0 # flip to regenerate expected f...
google/pytype
pytype/tools/merge_pyi/merge_pyi_test.py
merge_pyi_test.py
py
2,585
python
en
code
4,405
github-code
36
[ { "api_name": "pytype.platform_utils.path_utils.join", "line_number": 20, "usage_type": "call" }, { "api_name": "pytype.platform_utils.path_utils", "line_number": 20, "usage_type": "name" }, { "api_name": "pytype.platform_utils.path_utils.dirname", "line_number": 20, "usa...
28148567000
import datetime import time from gpiozero import LED, Device from gpiozero.pins.pigpio import PiGPIOFactory Device.pin_factory = PiGPIOFactory() # NOTE: Change this to match the GPIO pin you're connecting the LED to led = LED(18) # NOTE: Change these values to set the time you want the light to turn on and off at we...
szh/pi-timedlight
timedlight.py
timedlight.py
py
936
python
en
code
1
github-code
36
[ { "api_name": "gpiozero.Device.pin_factory", "line_number": 7, "usage_type": "attribute" }, { "api_name": "gpiozero.Device", "line_number": 7, "usage_type": "name" }, { "api_name": "gpiozero.pins.pigpio.PiGPIOFactory", "line_number": 7, "usage_type": "call" }, { "...
70943213544
"""Module to index columns of the paper-summarized CSV file.""" import pandas as pd from loguru import logger from omegaconf import OmegaConf from utils import create_embeddings # Load the configuration cfg = OmegaConf.load("conf/config.yaml") FILE_PATH = cfg.data.path INDEXED_FILE_PATH = cfg.data.indexed_path df =...
naarkhoo/LiteGrave
src/index_csv_columns.py
index_csv_columns.py
py
831
python
en
code
0
github-code
36
[ { "api_name": "omegaconf.OmegaConf.load", "line_number": 9, "usage_type": "call" }, { "api_name": "omegaconf.OmegaConf", "line_number": 9, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "loguru.log...
29654762562
import re from io import StringIO from flask import Flask, request, Response, redirect import pandas as pd app = Flask(__name__) def is_valid_query(q): ''' A query is valid if it is strictly consisted of the following three entries: [(A-Z, a-z, 0-9)+ or *] [==, !=, $=, &=] ["..."] Queries can be co...
CandiceD17/Http-Server-Query-Retrieval
my_server.py
my_server.py
py
8,078
python
en
code
0
github-code
36
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 111, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_...
29730523882
#coding:utf8 #login import logging logging.basicConfig(level=logging.DEBUG) _logger = logging.getLogger(__name__) #flask frame from flask_restplus import Resource #wechat frame import flask_wechat_utils from flask_wechat_utils.user.utils import auth from flask_wechat_utils.config import api #application config impo...
synctrust/flask-wechat-utils
flask_wechat_utils/message_template/routes.py
routes.py
py
1,768
python
en
code
0
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 5, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_wechat_ut...
36709037388
import rclpy import rclpy.node from airobot_interfaces.srv import StringCommand from gtts import gTTS import speech_recognition as sr import subprocess class SpeechService(rclpy.node.Node): def __init__(self): super().__init__('speech_service') self.get_logger().info('音声サーバーを起動しました') se...
AI-Robot-Book/chapter3
speech_service/speech_service/speech_service_mpg123.py
speech_service_mpg123.py
py
1,728
python
en
code
2
github-code
36
[ { "api_name": "rclpy.node", "line_number": 10, "usage_type": "attribute" }, { "api_name": "speech_recognition.Recognizer", "line_number": 16, "usage_type": "call" }, { "api_name": "airobot_interfaces.srv.StringCommand", "line_number": 19, "usage_type": "argument" }, {...
12032981505
import itertools import numpy as np import networkx as nx from sklearn.neighbors import kneighbors_graph from sklearn.metrics.pairwise import euclidean_distances from scipy.sparse.csgraph import minimum_spanning_tree from ggc.utils import * def knn_graph(X, k): """Returns k-Nearest Neighbor (MkNN) graph from the...
haczqyf/ggc
ggc/graphs.py
graphs.py
py
4,902
python
en
code
6
github-code
36
[ { "api_name": "sklearn.neighbors.kneighbors_graph", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.fill_diagonal", "line_number": 35, "usage_type": "call" }, { "api_name": "sklearn.neighbors.kneighbors_graph", "line_number": 56, "usage_type": "call" }, ...
14774852874
import streamlit as st from src.plotgraphs import make_radar_graph from src.sentanalysis import hf_analysis from src.sentanalysis import spacy_sentiment if __name__ == "__main__": st.write("Welcome") user_input = st.text_input("Enter a sentence", key="name") result = st.button("Submit") if result: ...
yugant10-commits/sentiment-analysis
main.py
main.py
py
652
python
en
code
0
github-code
36
[ { "api_name": "streamlit.write", "line_number": 8, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 9, "usage_type": "call" }, { "api_name": "streamlit.button", "line_number": 10, "usage_type": "call" }, { "api_name": "src.sentanalysis....
37406492523
import logging logging.basicConfig(filename='test_logs.log', encoding='utf-8', level=logging.INFO) logger = logging.getLogger('selenium') logger.setLevel(logging.INFO) disable_loggers = ['urllib3.connectionpool','faker.factory'] def pytest_configure(): for logger_name in disable_loggers: logger_not = log...
AlejandroPadilla99/mentoringPython
conftest.py
conftest.py
py
383
python
en
code
0
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 3, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 3, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.INFO", ...
912034710
import cv2 cap = cv2.VideoCapture('vtest.avi') hog = cv2.HOGDescriptor() # 클래스 호출을 통해 객체 생성 # SVM: 머신러닝 기술 이름 hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector()) while True: ret, frame = cap.read() # 프레임을 읽어서 반환 # ret: true / false, true: 동영상 frame을 정상적으로 읽었을 때, false: 비정상적으로 읽었을 때 if not...
yousung1020/OpenCV
실습자료/chapter 13/hog.py
hog.py
py
782
python
ko
code
0
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.HOGDescriptor", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.HOGDescriptor_getDefaultPeopleDetector", "line_number": 8, "usage_type": "call" }, { "api_na...
3530324591
# from threading import Thread import speech_recognition as sr import keyboard as k import spotipy import os import pyttsx3 import random import credentials from spotipy.oauth2 import SpotifyOAuth from spotipy.oauth2 import SpotifyClientCredentials # from refresh import Refresh # from googleText2Speech import synthe...
nsrehman/Virtual-Assistant
voiceRecognition.py
voiceRecognition.py
py
5,520
python
en
code
0
github-code
36
[ { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "credentials.SPOTIPY_CLIENT_ID", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 18, "usage_type": "attribute" }, { "api_name": "cr...
31058374968
import networkx as nx import pandas as pd from matplotlib import pyplot as plt from networkx.generators.ego import ego_graph from pyvis.network import Network from sklearn.decomposition import PCA def plot_network_with_edge_weights(G, figsize=(10, 10)): elarge = [(u, v) for (u, v, d) in G.edges(data=True) if (d["...
ryankarlos/networks_algos
vis/visualize.py
visualize.py
py
3,867
python
en
code
1
github-code
36
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "networkx.spring_layout", "line_number": 16, "usage_type": "call" }, { "api_name": "net...
17192006071
from typing import List from app.api.validators import ValidatorsClass from app.core.db import get_async_session from app.core.user import current_superuser from app.crud.charity_project import charity_crud from app.models import Donation from app.schemas.charity_project import CharityCreate, CharityDB, CharityUpdate ...
Lexxar91/QRkot_spreadsheets
app/api/endpoints/charity_project.py
charity_project.py
py
4,780
python
ru
code
0
github-code
36
[ { "api_name": "fastapi.APIRouter", "line_number": 14, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.asyncio.AsyncSession", "line_number": 22, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 22, "usage_type": "call" }, { "api_name": ...
72076483945
import numpy as np import torch from torch.utils.data import Dataset import matplotlib from matplotlib import pyplot as plt import enum import scipy from scipy import ndimage, signal import io from . import fileloader, util, zernike from skimage import restoration @enum.unique class Augmentation(enum.Enum): PIXEL_...
kkhchung/smlm-dl
smlm_dl/dataset.py
dataset.py
py
22,899
python
en
code
0
github-code
36
[ { "api_name": "enum.Enum", "line_number": 14, "usage_type": "attribute" }, { "api_name": "enum.unique", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.utils.data.Dataset", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.atleas...
11370466883
import requests from time import sleep class Ark(object): """This is a python wrapper for the ARK api""" def __init__(self,api_token): self.api_token = api_token self.header = {'api_token' : self.api_token } def check_token(self,full_object=False): """Checks the number of calls your token has left""" bas...
gregimba/Ark
ark.py
ark.py
py
2,070
python
en
code
2
github-code
36
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 18, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "requests.get", "line_number"...
42776999573
"""canaryAPI URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-bas...
toucan-project/TOUCAN
toucan/canary_api/urls.py
urls.py
py
2,670
python
en
code
3
github-code
36
[ { "api_name": "django.urls.path", "line_number": 34, "usage_type": "call" }, { "api_name": "manage_api.views.UserItem.as_view", "line_number": 34, "usage_type": "call" }, { "api_name": "manage_api.views.UserItem", "line_number": 34, "usage_type": "name" }, { "api_...
12639565741
from mainapp.model.Event import Event from datetime import datetime from django.core.cache import cache from mainapp.Common import CacheUtil from django.conf import settings from django.utils import timezone KEY_CACHE_DAO_GET_ALL_EVENT_ACTIVE = 'context-dao-all-event-active' KEY_CACHE_DAO_GET_ALL_EVENT_NOT_ACTIVE = 'c...
trunganhvu/personalweb
mainapp/dao/Event/EventDao.py
EventDao.py
py
2,795
python
en
code
0
github-code
36
[ { "api_name": "mainapp.model.Event.Event.objects.filter", "line_number": 15, "usage_type": "call" }, { "api_name": "mainapp.model.Event.Event.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "mainapp.model.Event.Event", "line_number": 15, "usage_typ...
36219148196
import numpy as np from numpy import array from mSimplexFaseII import solve from scipy.optimize import linprog import pprint from math import log, exp from numpy.random import rand, normal from numpy import round, int, abs, array, transpose def main(): #Primer test A = array([[1,0], [0, 2], [3, 2]]) b = ...
SergioArnaud/Linear-programming
Practica1/testFaseII.py
testFaseII.py
py
2,007
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "mSimplexFaseII.solve", "line_number": 21, "usage_type": "call" }, { "api_name": "scipy.optimize.linprog",...
9228040497
import torch from torch._C import Value import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.loss import PoissonNLLLoss from .MultiHeadAttention import MultiHeadAttention from .Block import Block class Decoder(nn.Module): """ add another attention between encoder's out and decoder a...
chenzhike110/Transformer
Tranformer/Modules/Decoder.py
Decoder.py
py
1,380
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "MultiHeadAttention.MultiHeadAttention", "line_number": 18, "usage_type": "call" }, { "api_name": "M...
43041308146
from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QApplication,QWidget,QHBoxLayout,QVBoxLayout,QRadioButton,QGroupBox,QPushButton,QLabel,QListWidget,QLineEdit from second_win import * from instr import * class FinalWin(QWidget): def __init__(self,exp): super().__init__(...
AlexanderKudelya/indexruf
index/final_win.py
final_win.py
py
976
python
en
code
0
github-code
36
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 6, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 15, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 16, "usage_type": "call" }, { "api_name": "...
21114082657
from src import app from flask import jsonify, request import requests import json import os slackToken = os.environ['SLACK_TOKEN'] botAccessToken = os.environ['BOT_ACCESS_TOKEN'] hasuraDataUrl = "http://data.hasura/v1/query" chatUrl = "https://slack.com/api/chat.postMessage" ##################### APIs ##############...
Satyabrat35/SlackGitBot
microservices/bot/app/src/server.py
server.py
py
12,668
python
en
code
2
github-code
36
[ { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "src.app.route", "line_number": 14, "usage_type": "call" }, { "api_name": "src.app", "line_numbe...
25770685168
import numpy as np import seaborn from PIL import Image import matplotlib.pyplot as plt import tensorflow as tf from keras import layers, models from sklearn.metrics import confusion_matrix from sklearn.preprocessing import StandardScaler, Normalizer from sklearn import svm from sklearn.metrics import f1_score...
AndrewSSB/KaggleCompetition
main.py
main.py
py
10,932
python
en
code
0
github-code
36
[ { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.array", "line_number":...
69801320106
import csv import sys from collections import defaultdict sys.setrecursionlimit(10**9) array_words = [] with open('sgb-words.txt') as csv_file: csv_reader = csv.reader(csv_file) for row in csv_reader: array_words.append(row[0]) def list_incident(word, array_words): array = [] for w in array_w...
Chidt12/discreteMath
Bai3_Searching_on_graph/bai3b_searching_on_graph.py
bai3b_searching_on_graph.py
py
2,846
python
en
code
0
github-code
36
[ { "api_name": "sys.setrecursionlimit", "line_number": 4, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 27, "usage_type": "call" } ]
39844679092
""" Iguana (c) by Marc Ammon, Moritz Fickenscher, Lukas Fridolin, Michael Gunselmann, Katrin Raab, Christian Strate Iguana is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. You should have received a copy of the license along with this work. If not, see <http://creativecommons.org...
midas66/iguana
src/common/templatetags/user_preference.py
user_preference.py
py
603
python
en
code
null
github-code
36
[ { "api_name": "django.template.Library", "line_number": 14, "usage_type": "call" }, { "api_name": "django.template", "line_number": 14, "usage_type": "name" } ]
35854946253
""" The flask application package. """ # newest 1.4 version of sqlalchemy not working please install 1.3.24 #pip install SQLAlchemy==1.3.24 async_mode = None if async_mode is None: try: import gevent async_mode = 'gevent' except ImportError: pass if async_mode is None: ...
Radkos1976/Hrnest-FLask-enchacment
HrnestBoss/HrnestBoss/__init__.py
__init__.py
py
4,549
python
en
code
0
github-code
36
[ { "api_name": "eventlet.monkey_patch", "line_number": 29, "usage_type": "call" }, { "api_name": "gevent.monkey.patch_all", "line_number": 33, "usage_type": "call" }, { "api_name": "gevent.monkey", "line_number": 33, "usage_type": "name" }, { "api_name": "flask.Fla...
34993839592
# Thư viện import pygame, sys import numpy as np import time # Khởi tạo game pygame.init() # --------- # CÁC HẰNG SỐ # --------- WIDTH = 600 HEIGHT = WIDTH LINE_WIDTH = 15 WIN_LINE_WIDTH = 8 BOARD_ROWS = 5 BOARD_COLS = BOARD_ROWS SQUARE_SIZE = WIDTH/BOARD_ROWS CIRCLE_RADIUS = SQUARE_SIZE/3 CIRCLE_WIDTH = 15 CROS...
LeVan102/AI_Caro
Caro5x5.py
Caro5x5.py
py
11,268
python
en
code
0
github-code
36
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 39, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 39, "usage_type": "attribute" }, { "api_name": "pygame.display...
15480079320
import io from PIL import Image from django.test import TestCase, Client from django.urls import reverse import numpy as np from unittest.mock import patch from mnist_predictor.views import make_prediction class PredictViewTestCase(TestCase): def setUp(self): self.client = Client() # Create a test ...
MichelWakim/mnist-api
mnist_predictor/tests.py
tests.py
py
1,514
python
en
code
0
github-code
36
[ { "api_name": "django.test.TestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "django.test.Client", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image.new", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image", ...
4492015736
## Load training SDFs import argparse import colorsys import os import numpy as np import pathlib import tqdm import open3d as o3d import random from CARTO.simnet.lib.datapoint import decompress_datapoint from CARTO.Decoder import utils from CARTO.Decoder.data import dataset from CARTO.Decoder import config from CARTO...
robot-learning-freiburg/CARTO
CARTO/Decoder/visualizing/visualize_sdf_values.py
visualize_sdf_values.py
py
2,511
python
en
code
10
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 22, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 23, "usage_type": "call" }, { "api_name": "CARTO.Decoder.config.GenerationConfig", "line_number": 25, "usage_type": "attribute" }, { "api_name": "...
2875218070
#!/usr/bin/python3 import requests def number_of_subscribers(subreddit): """ Set a custom User-Agent in headers to prevent API errors""" headers = {'User-Agent': 'MyRedditBot/1.0'} """ Construct the API URL for the given subreddit""" url = f'https://www.reddit.com/r/{subreddit}/about.json' """ Ma...
Ojobumiche/alx-higher_level_programming
0x16-api_advanced/0-subs.py
0-subs.py
py
933
python
en
code
0
github-code
36
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" } ]
73118843944
import multiprocessing from threading import Thread import time def is_prime(n): if n <= 1: return False for i in range(2, int(n**0.5) + 1): if n % i == 0: return False return True def find_primes(end, start): primes = [] for num in range(start, end - 1): if i...
IlyaOrlov/PythonCourse2.0_September23
Practice/achernov/module_12/task_1.py
task_1.py
py
2,712
python
ru
code
2
github-code
36
[ { "api_name": "time.time", "line_number": 24, "usage_type": "call" }, { "api_name": "time.time", "line_number": 28, "usage_type": "call" }, { "api_name": "time.perf_counter", "line_number": 32, "usage_type": "call" }, { "api_name": "threading.Thread", "line_nu...
26122545244
# -*- coding: utf-8 -*- """ Created on Thu Jan 14 09:43:42 2016 @author: sampepose """ import csv import numpy as np from sklearn.neighbors import KNeighborsClassifier import matplotlib.pyplot as plt data = [] TestData = [] # Read the training data f = open('data/train.csv') reader = csv.reader(f) next(reader, None...
sampepose/digit-recognizer
kNearestNeighbor/test_increasing_sample_size.py
test_increasing_sample_size.py
py
1,447
python
en
code
0
github-code
36
[ { "api_name": "csv.reader", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.neighbors.KNeighborsClassi...
42493212575
""" WRITEME """ from __future__ import absolute_import, print_function, division from copy import copy, deepcopy from sys import getsizeof import sys import traceback import numpy as np import theano from theano.compat import izip from six import reraise from six.moves import StringIO from theano.gof import utils fro...
Theano/Theano
theano/gof/link.py
link.py
py
38,073
python
en
code
9,807
github-code
36
[ { "api_name": "sys.excepthook", "line_number": 22, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 25, "usage_type": "attribute" }, { "api_name": "traceback.format_list", "line_number": 47, "usage_type": "call" }, { "api_name": "sys.excepth...
7557841018
import sys from collections import deque def Run(fin, fout): readline = fin.readline N = int(readline()) to = [None] * (N + 1) from_ = [set() for _ in range(N + 1)] for i in range(1, N + 1): a, v = map(int, readline().split()) to[i] = (a, v) from_[a].add((i, v)) visited = set() ans = 0 f...
chenant2017/USACO
Silver/2022 Open/p1.py
p1.py
py
1,247
python
en
code
2
github-code
36
[ { "api_name": "collections.deque", "line_number": 35, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 65, "usage_type": "attribute" }, { "api_name": "sys.stdout", "line_number": 65, "usage_type": "attribute" } ]
13100959928
from __future__ import print_function # import logging import json import sys import uuid from random import randrange # TODO remove this import requests import logging from cakework import exceptions from urllib3.exceptions import NewConnectionError import os # TODO: need to re-enable TLS for the handlers in the fl...
usecakework/async-backend
sdk/python/src/cakework/client.py
client.py
py
6,074
python
en
code
3
github-code
36
[ { "api_name": "logging.basicConfig", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 19, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 38, "usage_type": "call" }, { "api_name": "requests.exception...
10392633050
import json import os import cv2 from cfg import cfg import numpy as np from collections import defaultdict as dd from dsl.base_dsl import BaseDSL, one_hot_labels class NSFWDSL(BaseDSL): def __init__(self, batch_size, shuffle_each_epoch=False, seed=1337, normalize=True, mode='train', val_frac=0.0...
gongzhimin/ActiveThief-attack-MLaaS
dsl/nsfw_dsl.py
nsfw_dsl.py
py
3,309
python
en
code
2
github-code
36
[ { "api_name": "dsl.base_dsl.BaseDSL", "line_number": 10, "usage_type": "name" }, { "api_name": "cfg.cfg.img_size", "line_number": 15, "usage_type": "attribute" }, { "api_name": "cfg.cfg", "line_number": 15, "usage_type": "name" }, { "api_name": "cfg.cfg.ntest", ...
74105735145
from django.contrib import admin from django.urls import path from tareas import views urlpatterns = [ path("admin/", admin.site.urls), path ("", views.menu, name = "menu"), path ("registro/", views.registro, name = "registro"), path ("iniciar_sesion/", views.iniciar_sesion, name = "iniciar_sesion"),...
MallicTesla/Mis_primeros_pasos
Programacion/002 ejemplos/002 - 14 django/16 django proyrcto inicio de cesion/django_crud/urls.py
urls.py
py
732
python
en
code
1
github-code
36
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "dja...
36720200958
#!/usr/bin/env python """ Parser for condor job log files to get information out """ from datetime import datetime, timedelta from .logit import log from . import jobsub_fetcher from .poms_model import Submission # our own logging handle, goes to cherrypy def get_joblogs(dbhandle, jobsub_job_id, cert, key, experim...
fermitools/poms
webservice/condor_log_parser.py
condor_log_parser.py
py
6,245
python
en
code
0
github-code
36
[ { "api_name": "logit.log", "line_number": 21, "usage_type": "call" }, { "api_name": "logit.log", "line_number": 25, "usage_type": "call" }, { "api_name": "poms_model.Submission", "line_number": 26, "usage_type": "argument" }, { "api_name": "poms_model.Submission.j...
15282409982
import regTrees from numpy import * import matplotlib.pyplot as plt myDat = regTrees.loadDataSet('ex00.txt') myMat = mat(myDat) print(regTrees.createTree(myMat)) plt.plot(myMat[:,0],myMat[:,1], 'ro') plt.show() myDat1 = regTrees.loadDataSet('ex0.txt') myMat1 = mat(myDat1) print(regTrees.createTree(myMat1)...
mengwangme/MachineLearninginAction
Ch09/test.py
test.py
py
376
python
en
code
0
github-code
36
[ { "api_name": "regTrees.loadDataSet", "line_number": 5, "usage_type": "call" }, { "api_name": "regTrees.createTree", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotl...
8445183338
from numpy import prod import cupy from cupy.fft import config from cupy.fft._fft import (_convert_fft_type, _default_fft_func, _fft, _get_cufft_plan_nd, _get_fftn_out_size, _output_dtype) from cupy.fft._cache import get_plan_cache def get_fft_plan(a, shape=None,...
cupy/cupy
cupyx/scipy/fftpack/_fft.py
_fft.py
py
19,687
python
en
code
7,341
github-code
36
[ { "api_name": "cupy.fft._fft._output_dtype", "line_number": 115, "usage_type": "call" }, { "api_name": "cupy.fft._fft._convert_fft_type", "line_number": 116, "usage_type": "call" }, { "api_name": "cupy.cuda", "line_number": 124, "usage_type": "attribute" }, { "api...
70091360103
from datetime import datetime from persistent.list import PersistentList from zope.annotation import IAnnotations import logging TWITTER_KEY = "noise.addon.twitter" FACEBOOK_KEY = "noise.addon.facebook" EMAIL_KEY = "noise.addon.email" HARDCOPY_KEY = "noise.addon.hardcopy" TWITTER_CSV_HEADERS = ["timestamp", "twitter-...
cleanclothes/vmd.noise
noise/addon/storage.py
storage.py
py
1,916
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "zope.annotation.IAnnotations", "line_number": 41, "usage_type": "call" }, { "api_name": "persistent.list.PersistentList", "line_number": 44, "usage_type": "call" }, { "api...
875221895
#!/usr/bin/python from foo import bar import datetime import json import pathlib import shutil import sys import urllib.request date_13w39a = datetime.datetime(2013, 9, 26, 15, 11, 19, tzinfo = datetime.timezone.utc) date_17w15a = datetime.datetime(2017, 4, 12, 9, 30, 50, tzinfo = datetime.timezone.utc) date_1_17_pre...
JWaters02/Hacknotts-23
testclient/test_code.py
test_code.py
py
3,249
python
en
code
1
github-code
36
[ { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.timezone", "line_number": 11, "usage_type": "attribute" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.t...
42243497350
import numpy as np import matplotlib.pyplot as plt from hs_digitizer import * import glob import scipy.signal as ss from scipy.optimize import curve_fit import re import matplotlib #Ns = 500000 #Fs = 200000. path = "/data/20181030/bead1/high_speed_digitizer/golden_data/amp_ramp_50k_good" files = glob.glob(path + "/*.h...
charlesblakemore/opt_lev_analysis
scripts/spinning/old_scripts/ampt_ramp_spectra_plot.py
ampt_ramp_spectra_plot.py
py
1,607
python
en
code
1
github-code
36
[ { "api_name": "glob.glob", "line_number": 13, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.fft.rfftfreq", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.fft", "line_number"...
38400918265
# This is a demo of running face recognition on a Raspberry Pi. # This program will print out the names of anyone it recognizes to the console. # To run this, you need a Raspberry Pi 2 (or greater) with face_recognition and # the picamera[array] module installed. # You can follow this installation instructions to get ...
minakhan01/LanguageLearning
PrototypingFiles/Python Vision Files/raspi_facerec.py
raspi_facerec.py
py
3,217
python
en
code
0
github-code
36
[ { "api_name": "picamera.PiCamera", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.listdir", "line...
71249021545
import json from math import sqrt # Returns a distance-based similarity score for person1 and person2 def sim_distance(prefs, person1, person2): # Get the list of shared_items si = {} for item in prefs[person1]: if item in prefs[person2]: si[item] = 1 # if they have no ratings in common, retu...
brokencranium/recommender
ItemBasedFiltering.py
ItemBasedFiltering.py
py
4,740
python
en
code
0
github-code
36
[ { "api_name": "math.sqrt", "line_number": 50, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 119, "usage_type": "call" } ]
27517754092
import torch import torch.nn as nn import torchvision.datasets as dsets import torchvision.transforms as transforms from torch.autograd import Variable import geojson import json import time def chip_image1(img, chip_size=(300, 300)): """ Segment an image into NxWxH chips Args: img : Array of imag...
catsbergers/Final-Project-Group-2
jiarong-che-final-project/Code/mywork.py
mywork.py
py
3,764
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 39, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 39, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "li...
72655514343
import copy import json import os import datetime from json import dumps import logging import uuid import tweepy from flask import Flask, render_template, url_for, request, send_from_directory from flask_pymongo import PyMongo import folium from geopy.exc import GeocoderTimedOut from geopy.geocoders import Nominatim ...
rwth-acis/bot-detector
web_application/ms_signal_generator.py
ms_signal_generator.py
py
4,034
python
en
code
3
github-code
36
[ { "api_name": "dotenv.load_dotenv", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 34, "usage_type": "attribute" }, { "api_name": "flask.Flask", ...
25872641550
__author__ = "Domenico Solazzo" __version__ = "0.1" RESPONSE_CODES = { 200: "OK: Success", 202: "Accepted: The request was accepted and the user was queued for processing", 401: "Not Authorized: either you need to provide authentication credentials, or the credentials provided aren't valid.", ...
domenicosolazzo/PythonKlout
pythonklout.py
pythonklout.py
py
8,616
python
en
code
1
github-code
36
[ { "api_name": "urllib.urlencode", "line_number": 150, "usage_type": "call" }, { "api_name": "httplib.HTTPConnection", "line_number": 158, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 162, "usage_type": "call" }, { "api_name": "httplib.HTTPExc...
42867652572
from utils import read_input def age_and_spawn_the_fish(fishes): baby_age = 8 spawns = determine_num_spawns(fishes) for i, fish in enumerate(fishes): fishes[i] = calc_next_age(fish) for i in range(0, spawns): fishes.append(baby_age) return fishes def calc_next_age(fish): ...
tthompson691/AdventOfCode
src/2021/Day6/day6_solution.py
day6_solution.py
py
1,479
python
en
code
2
github-code
36
[ { "api_name": "utils.read_input", "line_number": 46, "usage_type": "call" } ]
18287559618
from urllib.request import urlopen from bs4 import BeautifulSoup url = input('Enter URL:') count = int(input('Enter count:')) position = int(input('Enter position:'))-1 html = urlopen(url).read() soup = BeautifulSoup(html,"html.parser") href = soup('a') #print href for i in range(count): link = href[position].g...
Abhishek32971/python_my_code
college/ActivitySet01/problem16.py
problem16.py
py
473
python
en
code
1
github-code
36
[ { "api_name": "urllib.request.urlopen", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 17, "usage_type": "call" }, { "api_name": "bs4.Be...
7862870875
#!/usr/bin/env python3 import sys import re import glob import prettytable import pandas as pd import argparse import os def readFile(filename): fileContents = list() with open(filename, "r") as f: for line in f: line = line.strip() fileContents.append(line) return fileContents def getStatusLine(fileConte...
vjbaskar/cscipipe
farm/farmhist.py
farmhist.py
py
4,130
python
en
code
0
github-code
36
[ { "api_name": "re.match", "line_number": 23, "usage_type": "call" }, { "api_name": "re.match", "line_number": 37, "usage_type": "call" }, { "api_name": "re.match", "line_number": 39, "usage_type": "call" }, { "api_name": "re.match", "line_number": 41, "usa...
21366953261
''' Link: https://www.lintcode.com/problem/shortest-path-in-undirected-graph/description ''' # Uses bidirectional BFS. I closesly followed the teachings on Jiuzhang.com. from collections import deque class Solution: """ @param graph: a list of Undirected graph node @param A: nodeA @param B: nodeB @...
simonfqy/SimonfqyGitHub
lintcode/medium/814_shortest_path_in_undirected_graph.py
814_shortest_path_in_undirected_graph.py
py
1,593
python
en
code
2
github-code
36
[ { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" } ]
18050976874
from django.urls import path from .views import RegistrationView, CustomLoginView, CustomLogoutView, ProfileView, UserProfileUpdateView, UserEducationalUpdateView urlpatterns = [ path('register/', RegistrationView.as_view(), name='register'), path('login/', CustomLoginView.as_view(), name='login'), path('l...
Kamal123-cyber/skillshare
skillshare/skillapp/urls.py
urls.py
py
618
python
en
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "views.RegistrationView.as_view", "line_number": 5, "usage_type": "call" }, { "api_name": "views.RegistrationView", "line_number": 5, "usage_type": "name" }, { "api_name": "d...
72237218663
"""Form definitions.""" from braces.forms import UserKwargModelFormMixin from crispy_forms.helper import FormHelper, Layout from crispy_forms.layout import Fieldset, Submit from django import forms from django.utils.translation import gettext_lazy as _ from .models import Sheet class SheetForm(UserKwargModelFormMi...
FlowFX/unkenmathe.de
src/um/sheets/forms.py
forms.py
py
1,017
python
en
code
1
github-code
36
[ { "api_name": "braces.forms.UserKwargModelFormMixin", "line_number": 13, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 13, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 13, "usage_type": "name" }, { "api...
69960188586
from django.contrib.auth.models import AbstractUser, Group from django.db import models class User(AbstractUser): CREATOR = 'CREATOR' SUBSCRIBER = 'SUBSCRIBER' ROLE_CHOICES = ( (CREATOR, 'Créateur'), (SUBSCRIBER, 'Abonné'), ) profile_photo = models.ImageField(verbose_name='Photo de ...
TonyQuedeville/fotoblog
authentication/models.py
models.py
py
1,089
python
fr
code
0
github-code
36
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.ImageField", "line_number": 11, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { ...
6239431595
from datetime import datetime import json from odd_utils import * VERSION = "1.0" def shallow_copy(data) -> dict: if type(data) is list: return traverse(data) elif(type(data) is str): with open(data, "r") as f: return shallow_copy(json.load(f)) else: return traverse(da...
SamuelMiddendorp/OpenDataDocumentor
odd_library.py
odd_library.py
py
1,332
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 13, "usage_type": "call" } ]
21365527624
import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from dptb.nnet.mlp import MLP from dptb.utils.tools import _get_activation_fn from typing import Optional, Any, Union, Callable class ResBlock(nn.Module): def __init__(self, n_in, n_hidden, n_out, activation: Union[str, ...
deepmodeling/DeePTB
dptb/nnet/resnet.py
resnet.py
py
2,761
python
en
code
21
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Callable", "lin...
15290025439
# -*- coding: utf-8 -*- from threading import Thread, Event from yasc.utils import CONFIG, state, ZoneAction, in_production, ControllerMode from datetime import datetime, timedelta from time import sleep import logging # RPi imports not working if in_production(): from yasc.pi_controller import get_active_zone, a...
asmyczek/YASC
yasc/zone_controller.py
zone_controller.py
py
6,739
python
en
code
1
github-code
36
[ { "api_name": "yasc.utils.in_production", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 16, "usage_type": "call" }, { "api_name": "yasc.utils.state.zone_on", "line_number": 19, "usage_type": "call" }, { "api_name": "yasc....
25677729371
import cv2 import torch from PIL import Image from utils.segmenter import Segmenter from utils.type_conversion import * def resize(img, short_size): w, h = img.size if w < h: nw, nh = short_size, int(w * short_size / h) else: nw, nh = int(h * short_size / w), short_size return img.resi...
MondayYuan/HairSegmentation
scripts/test.py
test.py
py
2,875
python
en
code
5
github-code
36
[ { "api_name": "torch.device", "line_number": 24, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 26, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 26, "usage_type": "name" }, { "api_name": "dlib.get_frontal_face_detector"...
21115457088
"""Django FilterSet classes for Nautobot.""" import django_filters from nautobot.apps.filters import BaseFilterSet, NautobotFilterSet, SearchFilter from nautobot_chatops.choices import PlatformChoices from nautobot_chatops.models import CommandLog, AccessGrant, ChatOpsAccountLink, CommandToken class CommandLogFilte...
nautobot/nautobot-plugin-chatops
nautobot_chatops/filters.py
filters.py
py
1,773
python
en
code
47
github-code
36
[ { "api_name": "nautobot.apps.filters.BaseFilterSet", "line_number": 10, "usage_type": "name" }, { "api_name": "nautobot_chatops.models.CommandLog", "line_number": 16, "usage_type": "name" }, { "api_name": "nautobot.apps.filters.BaseFilterSet", "line_number": 30, "usage_ty...
25450887207
from django.urls import path, include from . import views app_name = "accounts" urlpatterns = [ # login path("login/", views.LoginView.as_view(), name="login"), # logout path("logout/", views.LogoutView.as_view(), name="logout"), # signup path("signup/", views.SignupView.as_view(), name="signu...
AmirhosseinRafiee/Blog
mysite/accounts/urls.py
urls.py
py
391
python
en
code
0
github-code
36
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path", ...
5812402236
import unittest import warnings from datetime import date, datetime from decimal import Decimal import pytz from babel import Locale from fluent.runtime.types import FluentDateType, FluentNumber, fluent_date, fluent_number class TestFluentNumber(unittest.TestCase): locale = Locale.parse('en_US') def setUp...
projectfluent/python-fluent
fluent.runtime/tests/test_types.py
test_types.py
py
12,837
python
en
code
185
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "babel.Locale.parse", "line_number": 14, "usage_type": "call" }, { "api_name": "babel.Locale", "line_number": 14, "usage_type": "name" }, { "api_name": "fluent.runtime...
73198190823
import json import re from typing import Any, Dict, List, Text from airflow.exceptions import AirflowException from airflow.providers.google.cloud.hooks.datacatalog import CloudDataCatalogHook import google.auth.transport.requests from google.auth.transport.urllib3 import AuthorizedHttp from grizzly.config import Conf...
google/grizzly
airflow/plugins/grizzly/data_catalog_tag.py
data_catalog_tag.py
py
15,091
python
en
code
51
github-code
36
[ { "api_name": "typing.Dict", "line_number": 13, "usage_type": "name" }, { "api_name": "grizzly.grizzly_typing.TGrizzlyOperator", "line_number": 39, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 40, "usage_type": "name" }, { "api_name": "typin...
5409351564
import sys from pathlib import Path from shutil import copy, copytree, ignore_patterns # This script initializes new pytorch project with the template files. # Run `python3 new_project.py ../MyNewProject` then new project named # MyNewProject will be made current_dir = Path() assert ( current_dir / "new_project.py...
Ttayu/pytorch-template
new_project.py
new_project.py
py
1,242
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": ...
3829718910
from __future__ import print_function import io import logging import logging.handlers import sys import threading import time try: import argparse except ImportError: sys.stderr.write(""" ntploggps: can't find the Python argparse module If your Python version is < 2.7, then manual installation is ne...
ntpsec/ntpsec
ntpclients/ntploggps.py
ntploggps.py
py
7,198
python
en
code
225
github-code
36
[ { "api_name": "sys.stderr.write", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.stderr.write", "lin...
14963542759
import mysql.connector import socket import logging from logging.config import fileConfig fileConfig('log.ini', defaults={'logfilename': 'bee.log'}) logger = logging.getLogger('database') mydb = mysql.connector.connect( host="45.76.113.79", database="hivekeeper", user="pi_write", password=")b*I/j3s,umyp0-8"...
jenkinsbe/hivekeepers
database.py
database.py
py
1,702
python
en
code
0
github-code
36
[ { "api_name": "logging.config.fileConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 11, "usage_type": "call" }, { "api_n...
6750580086
# -*- coding: utf-8 -*- from PyQt5.QtWidgets import QDialog, QTreeWidgetItem, QMenu from PyQt5.QtCore import pyqtSlot, QPoint from labrecord.controllers.labrecordscontroller import LabrecordsController from labrecord.modules.editobservationmodule import EditObservationModule from labrecord.modules.checkreportmodule i...
zxcvbnmz0x/gmpsystem
labrecord/modules/editsamplerecorddetailmodule.py
editsamplerecorddetailmodule.py
py
10,508
python
en
code
0
github-code
36
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 19, "usage_type": "name" }, { "api_name": "labrecord.views.editsamplerecorddetail.Ui_Dialog", "line_number": 19, "usage_type": "name" }, { "api_name": "user.powers", "line_number": 24, "usage_type": "attribute" }, ...
34998353566
""" Created on Thu Mar 17 16:34:46 2022 ​ @author: svein """ import speech_recognition as sr import sounddevice as sd from scipy.io.wavfile import write import os import ffmpeg from scipy.io import wavfile import numpy as np def Speech_to_text(): myfile="output.wav" ## If file exists, delete it ## if os.p...
klarahi/Fuzzy_project
voice_recognition.py
voice_recognition.py
py
1,245
python
en
code
0
github-code
36
[ { "api_name": "os.path.isfile", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.remove", "line_number": 19, "usage_type": "call" }, { "api_name": "sounddevice.default", "line...
34203743613
import numpy as np import torch import torch.nn as nn from pytorch_lightning.utilities.rank_zero import _get_rank import models from models.base import BaseModel from models.utils import scale_anything, get_activation, cleanup, chunk_batch from models.network_utils import get_encoding, get_mlp, get_encoding_with_net...
3dlg-hcvc/paris
models/geometry.py
geometry.py
py
13,820
python
en
code
31
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "torchmcubes.marching_cubes", "line_number": 22, "usage_type": "attribute" }, { "api_name": "mcubes....
1947036421
from collections import defaultdict def solution(genres, plays): answer = [] stream = defaultdict(list) # 같은 장르내에서는 plays수가 같을 수 있지만 # 장르 합은 다른 장르의 합과 다르다 for g,p in zip(genres, plays): stream[g].append(p) answer = [] stream = sorted(stream.items(), key = lambda x:-sum(x[1])) # list ...
hellokena/2022
프로그래머스/LV2/LV3_베스트앨범(해시).py
LV3_베스트앨범(해시).py
py
862
python
ko
code
0
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 4, "usage_type": "call" } ]
9634671657
import argparse # Parse arguments parser = argparse.ArgumentParser() parser.add_argument("text") parser.add_argument("repetitions") args = parser.parse_args() # Convert repetitions to integer try: text = args.text repetitions = int(args.repetitions) except: quit(1) # Create repeated repeated input text a...
jdwijnbergen/CWL_workshop
3_create-text-file.py
3_create-text-file.py
py
518
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" } ]
23597401890
from tkinter import * import mysql.connector import matplotlib.pyplot as plt import csv root = Tk() root.title('VINCI FarmDB') root.geometry("400x700") root.iconbitmap('Logo.ico') # Connec to the MySQL Server mydb = mysql.connector.connect( host="localhost", user = "", ...
murali22chan/Aatmanirbhar-Bharat-Hackathon
main.py
main.py
py
10,762
python
en
code
0
github-code
36
[ { "api_name": "mysql.connector.connector.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 11, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 11, "usage_type": "name" }, { "...
21126149841
"""The core of p2pg.""" import logging from threading import Lock from .conf import conf, dump_after __author__ = 'Michael Bradley <michael@sigm.io>' __copyright__ = 'GNU General Public License V3' __copy_link__ = 'https://www.gnu.org/licenses/gpl-3.0.txt' __website__ = 'https://p2pg.sigm.io/' __support__ = 'https:/...
TheDocTrier/p2pg
core/__init__.py
__init__.py
py
1,156
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "threading.Lock", "line_number": 37, "usage_type": "call" } ]
39914557124
from fastapi import APIRouter from utils import model from utils.socket import socket_connection from services.event_service import write_log, write_video_log from utils.plc_controller import * from services.camera_service import camera_service import time import threading router = APIRouter(prefix="/event") @router...
ngocthien2306/be-cctv
src/router/event_router.py
event_router.py
py
2,107
python
en
code
0
github-code
36
[ { "api_name": "fastapi.APIRouter", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.model.Event", "line_number": 14, "usage_type": "attribute" }, { "api_name": "utils.model", "line_number": 14, "usage_type": "name" }, { "api_name": "services.camera_...
33078309482
from flask import request from flask.ext.babel import Babel from tweetmore import app import re babel = Babel(app) # *_LINK_LENGTH constants must be get from help/configuration/short_url_length daily # last update 14th November 2013 TWITTER_HTTPS_LINK_LENGTH = 23 TWITTER_HTTP_LINK_LENGTH = 22 TWITTER_MEDIA_LINK_LENG...
dedeler/tweet-more
tweetmore/views/utils.py
utils.py
py
5,555
python
en
code
0
github-code
36
[ { "api_name": "flask.ext.babel.Babel", "line_number": 7, "usage_type": "call" }, { "api_name": "tweetmore.app", "line_number": 7, "usage_type": "argument" }, { "api_name": "re.compile", "line_number": 20, "usage_type": "call" }, { "api_name": "re.I", "line_num...
8635223611
import calendar from datetime import date from django.contrib.auth import get_user_model from django.core.cache import cache from rest_framework import generics, status from rest_framework.permissions import IsAuthenticated from rest_framework.renderers import TemplateHTMLRenderer from rest_framework.response import Re...
hanoul1124/healthcare2
app/tables/apis.py
apis.py
py
4,279
python
en
code
0
github-code
36
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 13, "usage_type": "call" }, { "api_name": "rest_framework.generics.ListAPIView", "line_number": 17, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 17, "usage_type": "n...
41847098946
from telegram.ext import Updater from telegram.ext import CommandHandler, CallbackQueryHandler from telegram.ext import MessageHandler, Filters import os import square import telegram #initialize updater and dispatcher updater = Updater(token='TOKEN', use_context=True) dispatcher = updater.dispatcher def start(updat...
sethiojas/Square_It_Bot
bot.py
bot.py
py
2,367
python
en
code
0
github-code
36
[ { "api_name": "telegram.ext.Updater", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_n...
6786801031
import unittest from local import EXOLEVER_HOST import requests class ChatUserTest(unittest.TestCase): def do_login(self): url = '/api/accounts/login/' prefix = '' url = EXOLEVER_HOST + prefix + url data = { 'username': 'gorkaarrizabalaga@example.com', 'pa...
tomasgarzon/exo-services
service-exo-broker/tests/test_chat_user.py
test_chat_user.py
py
1,990
python
en
code
0
github-code
36
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "local.EXOLEVER_HOST", "line_number": 12, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 17, "usage_type": "call" }, { "api_name": "local.EXOLEVE...