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
32190404614
import pygame from tiles import Tile, AnimatedTile from support import import_folder from settings import screen_ratio class Enemy(Tile): def __init__(self, width, height, x, y, direction, speed, surface): super().__init__(width, height, x, y) self.direction = direction self.speed = int(screen_ratio ...
MikeReeves27/platform-game
code/enemy.py
enemy.py
py
1,793
python
en
code
0
github-code
18
[ { "api_name": "tiles.Tile", "line_number": 6, "usage_type": "name" }, { "api_name": "settings.screen_ratio", "line_number": 11, "usage_type": "name" }, { "api_name": "pygame.transform.flip", "line_number": 29, "usage_type": "call" }, { "api_name": "pygame.transfor...
17733012963
import sys import os from flask import Flask, request, jsonify, redirect, url_for app = Flask(__name__) #@app.route("/", methods=['GET','POST', 'PUT', 'DELETE', 'PATCH','OPTIONS']) @app.route("/", methods=['GET','POST', 'PUT', 'DELETE', 'PATCH','OPTIONS']) def home(): return printAndReturnRequest(request) @app.r...
molleer/echo-rest
app/main.py
main.py
py
873
python
en
code
1
github-code
18
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "argument" }, { "api_name": "flask.request", "line_number": 16, "usage_type": "argument" }, { "api_name": "flask.request.headers....
19918645962
from flask import Blueprint, request, jsonify from flask_cors import cross_origin from utilities.query_signup import SignUp from database_functions.db_connection.connection import connection from database_functions.groups.querying_functions import get_status_for_group, get_group_pending_state_machine checkUserAPI = Bl...
anurag-as/Costrajectory
backend/api/auth/checkUser.py
checkUser.py
py
1,211
python
en
code
0
github-code
18
[ { "api_name": "flask.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "utilities.query_signup.SignUp", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 14, "usage_type": "attribute" }, { "api_name": "...
13296761805
import cv2, time, pandas from datetime import datetime first_frame = None status_list = [None, None] times = [] df = pandas.DataFrame(columns=["Start", "End"]) video = cv2.VideoCapture(0) # creates the video object time.sleep(2) # allows webcam to initialize properly while True: check, frame = video.read() ...
slylikeme/Motion-Detector-App
motion_detector.py
motion_detector.py
py
2,667
python
en
code
0
github-code
18
[ { "api_name": "pandas.DataFrame", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 9, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_n...
30271224111
import cv2 from base_camera import BaseCamera class Camera(BaseCamera): video_source = 0 width = 1024 height= 768 @staticmethod def set_video_source(source): Camera.video_source = source @staticmethod def set_video_height(height): Camera.height = height return Came...
Microshak/AI_Benchtest_Cam
camera_opencv.py
camera_opencv.py
py
1,004
python
en
code
0
github-code
18
[ { "api_name": "base_camera.BaseCamera", "line_number": 5, "usage_type": "name" }, { "api_name": "cv2.VideoCapture", "line_number": 29, "usage_type": "call" } ]
35135478385
from module import obo2csv from configure import obo_url,num_threads excludeGO = "GO:0005515,GO:0005488,GO:0003674,GO:0008150,GO:0005575" #excludeGO = "" import sys import os import multiprocessing as mp from multiprocessing import Pool from contextlib import closing def get_obo_dict(): # read obo_dict fp = open...
QuanEvans/parallel-atgo
parallel-gpu/Find_Parents.py
Find_Parents.py
py
3,473
python
en
code
0
github-code
18
[ { "api_name": "configure.obo_url", "line_number": 13, "usage_type": "argument" }, { "api_name": "module.obo2csv.parse_obo_txt", "line_number": 16, "usage_type": "call" }, { "api_name": "module.obo2csv", "line_number": 16, "usage_type": "name" }, { "api_name": "sys...
27380157280
from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.label import Label from kivy.core.window import Window from kivy.graphics import Color, Line, Ellipse, Rectangle Window.set_system_cursor('crosshair') class MousePosDemo(BoxLayout): def __init__(self, **kwargs): super(MousePo...
KenoLeon/NeuralNetViewer_Wrk
Prototypes_Kivy/Kivy_tests/mouseEventsWidget.py
mouseEventsWidget.py
py
1,376
python
en
code
0
github-code
18
[ { "api_name": "kivy.core.window.Window.set_system_cursor", "line_number": 7, "usage_type": "call" }, { "api_name": "kivy.core.window.Window", "line_number": 7, "usage_type": "name" }, { "api_name": "kivy.uix.boxlayout.BoxLayout", "line_number": 9, "usage_type": "name" }...
26989485810
import json import matplotlib.pyplot as plt import torch import step7_model import numpy as np import sys from sklearn.cluster import DBSCAN np.set_printoptions(threshold=sys.maxsize) def draw_loss_pic(): # 画出5次迭代的损失值曲线图 loss = [] for i in range(5): # 遍历每一个损失文件 path = "triplet_model_c...
cgeeeeh/Projects-referred-in-CV
论文作者冷启动同名消岐/code/方法1:参考论文复现/step9_drawloss.py
step9_drawloss.py
py
3,320
python
en
code
0
github-code
18
[ { "api_name": "numpy.set_printoptions", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 9, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plo...
26930044880
import datetime from PyQt4.QtCore import Qt from PyQt4.QtGui import QColor, QGraphicsDropShadowEffect, QLabel class Log(): def __init__(self, name="MAIN()", level="error"): self.level = level self.name = name def log(self, message, lvl): ts = "{:%x %X} ".format(datetime.datetime.now()) nm = "{:<20}".for...
Gadget512/TyPiClock
Clock/Utilities.py
Utilities.py
py
3,379
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "attribute" }, { "api_name": "PyQt4.QtCore.Qt.AlignLeft", "line_number": 54, "usage_type": "attribute" }, { "api_n...
75327303720
from .base import BaseDataset import numpy as np import os import torch import pandas as pd import copy from utils.tools import get_sub_luna_point,get_sub_sun_point, dprint from utils.timefeatures import time_features from .normlizer import PreGauessNormlizer,PreUnitNormlizer,NoneNormlizer,PostGauessNormlizer,...
veya2ztn/Seq2SeqAutoregressiveModel
dataset/WeatherBenchDataset.py
WeatherBenchDataset.py
py
36,162
python
en
code
2
github-code
18
[ { "api_name": "numpy.timedelta64", "line_number": 38, "usage_type": "call" }, { "api_name": "numpy.maximum", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.arange", "line...
32175119860
# %% Specify which data-set should be analyzed name_probes = 'Probes__cov-2' # Genomic probes #name_probes = 'Probes__cov-2--RevComp' # Replication intermediate # %% Imports from pathlib import Path import pandas as pd from covfish import probe_designer import seaborn as sns import numpy as np import matplotlib.pyp...
muellerflorian/corona-fish
workflows/probe_design/5_blast_combine.py
5_blast_combine.py
py
4,853
python
en
code
1
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "call" }, { "api_name": "pathlib.Path.cwd", "line_number": 17, "usage_type": "call" }, { "api_name": "importlib.reload", "line_number": 28, "usage_type": "call" }, { "api_name": "covfish.probe_designer...
10447989935
# (c) 2017 Gregor Mitscha-Baude """stokesian dynamics simulation of two kinds of particles framework: given list of particle centers xi and radii ri, for each timestep, calculate: 1.) external force on each particle (and torque?) F(xi, ri) or even F(x1,...,xn; r1,...,rn) 2.) brownian (random) force (and torque?) Frand...
mitschabaude/nanopores
scripts/stokesian/simulation.py
simulation.py
py
10,566
python
en
code
7
github-code
18
[ { "api_name": "numpy.reshape", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.array", "line_number"...
11621720255
# -*- coding:utf-8 -*- # Last Change : Fri 02 Nov 2018 16:40:31. import socket import json import threading import matplotlib.pyplot as plt import pickle # {"range":float,"angle":float,"x":float,"y":float,"radian":float} class SLAM(object): '''recv map data and draw map''' def __init__(self, origin=[0, 0]): ...
mryyomutga/PDIII
client/client_json_dump_test.py
client_json_dump_test.py
py
3,993
python
en
code
0
github-code
18
[ { "api_name": "threading.Thread", "line_number": 21, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 37, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 37, "usage_type": "attribute" }, { "api_name": "socket.SOCK_DGRAM"...
20100153879
import numpy as np import pandas as pd import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.keras.layers import AveragePooling2D from tensorflow.keras.layers import Dropout from tensorflow.keras.layers import Flatten from tensorflow.keras.layers import Dense from tensorflow.keras.layers ...
Ayubii/Proyek-Akhir
Train Mask Detector.py
Train Mask Detector.py
py
6,382
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 57, "usage_type": "call" }, { "api_name": "os.path", "line_number": 57, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 58, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
35461659719
import csv from datetime import datetime # Year, Avg Price, Min Price, Max Price, Avg Volume, Min Volume, Max Volume def get_year(date: str) -> int: date = datetime.strptime(date, "%d-%m-%Y").date() year = date.year return year def create_new_csv_file(file_name: str, fieldnames: list[str]) -> None: ...
druckhead/EduLabs-FullStack-Course
python/Lessons/Lesson_9/Homework/D1_files_directories/E2.py
E2.py
py
4,082
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.strptime", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "csv.DictWriter", "line_number": 15, "usage_type": "call" }, { "api_name": "csv.QUOTE_N...
71693796519
import torch from torch import nn from torch.nn import init from torchvision.datasets import FashionMNIST import numpy as np import sys from torch.utils.data import DataLoader from torchvision import transforms ''' 1、数据加载 2、权重初始化、数据预处理 分割 裁剪 3、loss函数定义 4、准确度估计 torchvision.datasets: 一些加载数据的函数及常用的数...
huangshixin/python-base_learing
C_深度学习/B-深度学习基础/F-softmax回归从0开始实现.py
F-softmax回归从0开始实现.py
py
6,081
python
zh
code
0
github-code
18
[ { "api_name": "torchvision.datasets.FashionMNIST", "line_number": 43, "usage_type": "call" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 43, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 43, "usage_type": "name" }, ...
12582440301
# @author: Gautam Patel # Problem Description URL: https://www.hackerrank.com/challenges/two-characters/problem #!/bin/python3 import math import os import random import re import sys from itertools import groupby from collections import Counter # Complete the alternate function below. def isStringAlternate(s): i...
gautambp/HackerRank
Master/python3/two-characters.py
two-characters.py
py
1,184
python
en
code
0
github-code
18
[ { "api_name": "re.compile", "line_number": 28, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 34, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 43, "usage_type": "attribute" } ]
38927369560
# # @lc app=leetcode id=162 lang=python3 # # [162] Find Peak Element # # @lc code=start from typing import List class Solution: def findPeakElement(self, nums: List[int]) -> int: length = len(nums) left = 0 right = length - 1 while left < right: mid = (left + right) /...
huhudev-git/leetcode
162.find-peak-element.py
162.find-peak-element.py
py
1,033
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 12, "usage_type": "name" } ]
37438772060
import serial from serial.tools.list_ports import comports import time from statistics import mean class Connect: connection_status = False def __init__(self): self.xData = [] self.yData = [] self.ocpData = [] # Get a list of all connected devices through serial port co...
jrmc502/AWT
Software/connect.py
connect.py
py
3,181
python
en
code
0
github-code
18
[ { "api_name": "serial.tools.list_ports.comports", "line_number": 14, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 17, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 21, "usage_type": "call" }, { "api_name": "time.sleep"...
74638396201
from sklearn import metrics def CD_map_to_int(x): # Returns D:0 C:1 return 68 - ord(x) # Itertuples is a list of (index,col1,col2,..) for each row. We sort them by score first df_vectors = pd.DataFrame() df_vectors_strings = pd.DataFrame() df_generation_max = df_generation_max.sort_values('opponent_name') d...
GitToby/FinalYearProject
LaTeX/tex/code_snippets/appendix/dist_matrix.py
dist_matrix.py
py
2,630
python
en
code
3
github-code
18
[ { "api_name": "sklearn.metrics.pairwise.pairwise_distances", "line_number": 42, "usage_type": "call" }, { "api_name": "sklearn.metrics.pairwise", "line_number": 42, "usage_type": "attribute" }, { "api_name": "sklearn.metrics", "line_number": 42, "usage_type": "name" }, ...
70287225641
#!/usr/bin/python3 from typing import List, Tuple, Dict, Set, Union from re import split from operator import mul, add def compute_equal_precedence(enumerator: enumerate) -> int: op = lambda a, b: b result = 0 for i, t in enumerator: if t == "*": op = mul elif t == "+": ...
julminen/aoc-2020
day_18.py
day_18.py
py
2,678
python
en
code
0
github-code
18
[ { "api_name": "operator.mul", "line_number": 13, "usage_type": "name" }, { "api_name": "operator.add", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Union", "line_number...
31808615601
from tkinter import * import math, random import sqlite3 import sys import django from time import sleep django.setup() # Conductor est un daemon from threading import Thread from components.mission import Mission import signal polling_interval = 1 def bddCreation(): """ CREATE TYPE droneStatus AS ENUM('busy'...
Oclean14/delivrone
Server/conductor_pour_test/conductor.py
conductor.py
py
3,952
python
en
code
0
github-code
18
[ { "api_name": "django.setup", "line_number": 7, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 65, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 157, "usage_type": "call" }, { "api_name": "components.mission.Mission", ...
70258467241
#!/usr/bin/env python # TODO: search # - https://docs.python.org/3/library/json.html # - https://docs.python.org/3/library/urllib.request.html#module-urllib.request import json import os import sys import urllib.parse as parse import urllib.request as req from urllib.error import HTTPError from colorama import Fore,...
allanpedroni/python
hello/pr/pr-trello.py
pr-trello.py
py
6,909
python
en
code
1
github-code
18
[ { "api_name": "os.environ.get", "line_number": 50, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 50, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 51, "usage_type": "call" }, { "api_name": "os.environ", "line_...
17033115239
#coding: utf-8 #本程序用于显示数据清理和流重组后的数据 import sys from window_base import * from PyQt5.QtWidgets import QAbstractItemView, QHeaderView from PyQt5.QtGui import QFont class show_Dataclustering_Window(QtWidgets.QMainWindow, Ui_MainWindow): def __init__(self): super(show_Dataclustering_Window, self)....
Nicolas-yuan/graduation_project_0x03
showClustering.py
showClustering.py
py
6,208
python
zh
code
3
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QAbstractItemView.NoEditTriggers", "line_number": 26, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets.QAbstractItemView", "line_number": 26, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QAbstractItemView.SelectRows", "line_...
22326134163
# coding=utf8 from django.conf import settings from hashlib import md5 from pymogile import Client from wand.image import Image class Avatar(object): def __init__(self, key): self.key = key self.__origin_store_key = 'avatar/origin/' + self.__key self.__large_store_key = 'avatar/large/...
guoku/Raspberry
raspberry/base/avatar.py
avatar.py
py
2,572
python
en
code
0
github-code
18
[ { "api_name": "pymogile.Client", "line_number": 17, "usage_type": "call" }, { "api_name": "django.conf.settings.MOGILEFS_DOMAIN", "line_number": 18, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 18, "usage_type": "name" }, { "ap...
7348528825
""" This library does all the complex network analysis required by the program """ # from typing import List, Any, Tuple, Dict, Union import inspect import csv import networkx as nx import matplotlib import matplotlib.pyplot as plt import matplotlib.colors as colors import matplotlib.cm as cmx import json import random...
sayonsom/pycanvass
pycanvass/complexnetwork.py
complexnetwork.py
py
23,018
python
en
code
4
github-code
18
[ { "api_name": "pycanvass.utilities._banner", "line_number": 30, "usage_type": "call" }, { "api_name": "pycanvass.utilities", "line_number": 30, "usage_type": "name" }, { "api_name": "os.path.split", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path...
1038474946
"""MATH96012 2019 Project 1 Alexander John Pinches CID: 01201653 """ import numpy as np import matplotlib.pyplot as plt import scipy.spatial.distance as ds import scipy.optimize as op #-------------------------------- plt.style.use('ggplot') # plot style plt.rcParams["figure.figsize"] = [8,8] # figure size def simula...
Parply/M3C-High-Performance-Computing
Project 1/p1.py
p1.py
py
7,892
python
en
code
1
github-code
18
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 10, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_na...
2750065450
from itertools import chain import sys A, B, K = map(int, input().split()) diff = B - A if diff == 0: print(A) sys.exit() if K > diff: K = diff ans = [x for x in chain(range(A, A + K), range(B - K + 1, B + 1))] ans = sorted(list(set(ans))) print('\n'.join(map(str, ans)))
shioyama18/atcoder
ABC093_B_Small_and_Large_Integers.py
ABC093_B_Small_and_Large_Integers.py
py
289
python
en
code
0
github-code
18
[ { "api_name": "sys.exit", "line_number": 9, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 14, "usage_type": "call" } ]
32800257198
import pyodbc from airflow import DAG from airflow.operators.python import PythonOperator from airflow.utils.dates import days_ago our_dag = DAG( "RefreshAnalysisServer", description='Обновление модели Analysis Server - Monopoly', start_date=days_ago(0, 0, 0, 0, 0), tags=['python'], ) conn_str = ( ...
dmtvasin/DataEngineering
airflow/dags/RefreshAnalysisServer.py
RefreshAnalysisServer.py
py
930
python
en
code
0
github-code
18
[ { "api_name": "airflow.DAG", "line_number": 6, "usage_type": "call" }, { "api_name": "airflow.utils.dates.days_ago", "line_number": 9, "usage_type": "call" }, { "api_name": "pyodbc.connect", "line_number": 21, "usage_type": "call" }, { "api_name": "airflow.operato...
26290720732
import re import logging _log = logging.getLogger("PingRelay") class MessageFormatter(): def __init__(self, message_format, alert_user="@everyone", time_format = "%Y-%m-%d %I:%M:%S %p"): self.format = message_format self.time_format = time_format self.alert_user = alert_user def forma...
FlyingKiwiBird/PingRelay
Resources/MessageFormatter.py
MessageFormatter.py
py
1,343
python
en
code
1
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 4, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 13, "usage_type": "call" } ]
450419257
import argparse from pathlib import Path import numpy as np from matplotlib import pyplot as plt from sklearn.metrics import ConfusionMatrixDisplay, confusion_matrix, f1_score from models.hmm.facial_movement import ordinal_from_csv from models.hmm.prediction_visualisation import load_predictions from models.hmm.test_...
Casvanrijbroek/Sign-Language-Thesis
validation/cross_validation.py
cross_validation.py
py
13,678
python
en
code
0
github-code
18
[ { "api_name": "utils.draw.set_seaborn_theme", "line_number": 42, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 43, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 43, "usage_type": "name" }, { "api_name":...
29818523841
from airflow.hooks.postgres_hook import PostgresHook from airflow.contrib.hooks.aws_hook import AwsHook from airflow.hooks.S3_hook import S3Hook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class StageToRedshiftOperator(BaseOperator): ui_color = '#358140' @apply_...
Hayleypp/udacity_dataengineering
d_engieering05/plugins/operators/stage_redshift.py
stage_redshift.py
py
1,437
python
en
code
0
github-code
18
[ { "api_name": "airflow.models.BaseOperator", "line_number": 7, "usage_type": "name" }, { "api_name": "airflow.utils.decorators.apply_defaults", "line_number": 10, "usage_type": "name" }, { "api_name": "airflow.hooks.S3_hook.S3Hook", "line_number": 23, "usage_type": "call"...
1249965338
import sys from csp.tools.build import util from csp.tools.build import scons from subprocess import Popen, PIPE import pickle import re from distutils import sysconfig GetPythonInclude = sysconfig.get_python_inc GetPythonLibrary = sysconfig.get_python_lib def CheckSConsVersion(minimum): version = scons.GetVe...
nsmoooose/csp
csp/tools/build/autoconf.py
autoconf.py
py
7,779
python
en
code
8
github-code
18
[ { "api_name": "distutils.sysconfig.get_python_inc", "line_number": 12, "usage_type": "attribute" }, { "api_name": "distutils.sysconfig", "line_number": 12, "usage_type": "name" }, { "api_name": "distutils.sysconfig.get_python_lib", "line_number": 13, "usage_type": "attrib...
34314901956
# # @lc app=leetcode id=1 lang=python3 # # [1] Two Sum # # @lc code=start from typing import List class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: num_to_index = {} for i, num in enumerate(nums): complement = target - num if complement in num_t...
krishhsuri/leetcode-
1.two-sum.py
1.two-sum.py
py
459
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" } ]
1042832572
from django.contrib.auth.decorators import login_required from django.utils import timezone from django.shortcuts import render, get_object_or_404, redirect from django.contrib import messages from ..models import Question from ..forms import QuestionForm # Create your views here. @login_required(login_url='common:lo...
sungm1nn/Hello
mysite/pybo/views/question_views.py
question_views.py
py
2,058
python
en
code
3
github-code
18
[ { "api_name": "forms.QuestionForm", "line_number": 13, "usage_type": "call" }, { "api_name": "django.utils.timezone.now", "line_number": 17, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 17, "usage_type": "name" }, { "api_name": "dj...
12707495708
from __future__ import annotations from collections import defaultdict from collections.abc import Hashable from functools import wraps from inspect import signature from time import monotonic from typing import Any, Callable, TypeVar from typing_extensions import ParamSpec T = TypeVar("T") P = ParamSpec("P") _senti...
EspenAlbert/py-libs
zero_3rdparty/src/zero_3rdparty/cache_ttl.py
cache_ttl.py
py
2,397
python
en
code
3
github-code
18
[ { "api_name": "typing.TypeVar", "line_number": 12, "usage_type": "call" }, { "api_name": "typing_extensions.ParamSpec", "line_number": 13, "usage_type": "call" }, { "api_name": "time.monotonic", "line_number": 23, "usage_type": "call" }, { "api_name": "functools.w...
18336772711
#!/usr/bin/python # # -*- coding: utf-8 -*- # vim: set ts=2 sw=2 et sts=2 ai: import copy import time try: import simplejson except: import json as simplejson import urllib2 import logging from cache import CACHE from helpers import * from libcloud_gae import ResourceNotFoundError def parse_time(timestamp_str)...
mithro/chrome-buildbot-sprint
appengine/objects.py
objects.py
py
7,396
python
en
code
2
github-code
18
[ { "api_name": "libcloud_gae.ResourceNotFoundError", "line_number": 71, "usage_type": "name" }, { "api_name": "cache.CACHE.get", "line_number": 75, "usage_type": "call" }, { "api_name": "cache.CACHE", "line_number": 75, "usage_type": "name" }, { "api_name": "cache....
7958448658
#!/usr/bin python3 # ---------------------------------------------------------------------------- # IOTpoll cycles thru the connected pins and returns back to Promethus server # the settings, An API gateway allows grafana pages to switch relays # if required # # To Set : View Readme.txt in ...
leerobo/IOT
IOTpoll/IOTpoll.py
IOTpoll.py
py
11,851
python
en
code
0
github-code
18
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", "line_number": 41, "usage_type": "call" }, { "api_name": "configparser....
14727645440
from __future__ import unicode_literals import logging import time from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.db import connection from multigtfs.models import Feed, Route, Shape, Trip class Command(BaseCommand): help = 'Updates the cached geom...
tulsawebdevs/django-multi-gtfs
multigtfs/management/commands/refreshgeometries.py
refreshgeometries.py
py
4,597
python
en
code
51
github-code
18
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 12, "usage_type": "name" }, { "api_name": "time.time", "line_number": 35, "usage_type": "call" }, { "api_name": "django.core.management.base.CommandError", "line_number": 41, "usage_type": "call" },...
9946649351
import math from typing import List class InfiniteArray: def __init__(self, nums:List[int]): self.nums = nums def get(self, index): if index >= len(self.nums): return math.inf return self.nums[index] def binary_search(arr, start, end, key): while start <= end: ...
swechhasingh/my-coding-journey
modified_binary_search/search_in_sorted_infinite_array.py
search_in_sorted_infinite_array.py
py
1,247
python
en
code
0
github-code
18
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "math.inf", "line_number": 10, "usage_type": "attribute" } ]
22294257591
import math import torch import torch.nn as nn from torch.nn import functional as F import os import tiktoken from ._transformer import LayerNorm, Block from ..config import Config as cfg new_line = tiktoken.get_encoding("gpt2").encode("\n")[0] class GPT(nn.Module): """ A class that represents the GPT model. ...
SilvioBaratto/GPTGram
GPTGram/model/_gpt.py
_gpt.py
py
16,307
python
en
code
3
github-code
18
[ { "api_name": "tiktoken.get_encoding", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "config.Config.gpt...
27878243153
# 重构为使用chain请求 import pandas as pd from langchain.chains import LLMChain from langchain.llms.openai import OpenAI from langchain.output_parsers import StructuredOutputParser, ResponseSchema from langchain.prompts import PromptTemplate # 响应解析器,将来会按指定格式解析响应,同时可以提供对该格式的描述用于模板 output_parser: StructuredOutputParser = Struc...
PengleiYu/CourseLangchain
08_链上_SequencialChain/chapter3_refactor.py
chapter3_refactor.py
py
1,653
python
en
code
0
github-code
18
[ { "api_name": "langchain.output_parsers.StructuredOutputParser", "line_number": 9, "usage_type": "name" }, { "api_name": "langchain.output_parsers.StructuredOutputParser.from_response_schemas", "line_number": 9, "usage_type": "call" }, { "api_name": "langchain.output_parsers.Resp...
71957799079
from flask import Flask, request, jsonify from flask_cors import CORS, cross_origin from Utils import verifyListingShape, verifyUserShape, verifyUser, verifyLoginShape, verifyAuthShape, verifyTransacationShape, verifyMessageShape from Models import Listings, User, Transaction, Messages from basicauth import decode from...
d-mooers/The-Market-Client
api/App.py
App.py
py
6,649
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.request", ...
74498249641
from django.urls import include, path from . import views urlpatterns = [ path('signup', views.add, name="signup"), path('signin', views.login, name="signin"), path('logout', views.logout, name='logout'), path('update/<str:id>', views.update, name='update') ]
bambadiagne/django-exploration
users/urls.py
urls.py
py
278
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "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", ...
22788787360
"""" This is the instrument definition file for PyCat. Here we define the classes that reads instrument raw data into a standardized data format. For most instruments this is a simple pandas Dataframe. The main point is that the standardized data format should be the same for all instrument. That way the analysis clas...
NicolaiHaaberJunge/UiOcat
uiocat/instrument.py
instrument.py
py
11,034
python
en
code
0
github-code
18
[ { "api_name": "pkg_resources.resource_stream", "line_number": 46, "usage_type": "call" }, { "api_name": "json.load", "line_number": 49, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 58, "usage_type": "call" }, { "api_name": "datetime.datetime....
29021458178
import os import numpy as np import pandas as pd import torch import requests from bs4 import BeautifulSoup with open('record.txt') as f: model_paths = f.read().splitlines() # #make predictions and save as .txt files # PUT HERE - code that loads model and makes predictions on test set. Then saves predictions for...
GateNLP/PEFT_FFT_multilingual
st3/submit.py
submit.py
py
3,510
python
en
code
0
github-code
18
[ { "api_name": "requests.post", "line_number": 28, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 42, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 87, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
19310598535
# lavadoras/urls.py from django.urls import path from .views import LavadoraListView, LavadoraCreateView, LavadoraUpdateView, LavadoraDeleteView urlpatterns = [ path('', LavadoraListView.as_view(), name='lavadoras-list'), path('crear/', LavadoraCreateView.as_view(), name='lavadora-create'), path('editar/<i...
seuz716/AlquilerLavadoras
myproject/lavadoras/urls.py
urls.py
py
473
python
pt
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "views.LavadoraListView.as_view", "line_number": 6, "usage_type": "call" }, { "api_name": "views.LavadoraListView", "line_number": 6, "usage_type": "name" }, { "api_name": "d...
13780227365
import torch import numpy as np def image_batch_transformation(batch, transformation): perturbed = [] for k in range(batch.shape[0]): image_k = batch[k, :, :].cpu().detach().numpy() perturbed.append(transformation(image=image_k)['image']) perturbed = torch.FloatTensor(perturbed).uns...
BearSubj13/metrlearn_dsprites
utils.py
utils.py
py
850
python
en
code
0
github-code
18
[ { "api_name": "torch.FloatTensor", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.moveaxis", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.moveaxis", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.FloatTensor", ...
17539281782
from flask import Flask, render_template, request import joblib app = Flask(__name__) @app.route('/') def indexPage(): return render_template("homePage.html") @app.route('/', methods = ['POST']) def pricePage(): if request.method == 'POST': crim = float(request.form['crim']) zn = float(request.form['zn']) in...
akabhishek680/Boston-House-Price-Prediction
bostonHousePricePrediction.py
bostonHousePricePrediction.py
py
2,162
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.reque...
26911309104
import argparse import math import cv2 import numpy as np import numpy.random as nprnd import os import torch import torch.utils.data import tqdm # import sys # sys.path.append("..") from data import datasets from utils.train_utils import load_multi, restore_checkpoint, fill_ohem_mask, detection_loss # Train and va...
wuzhenyusjtu/LPCVC20-VideoTextSpotting
lpcv_fots/test.py
test.py
py
3,277
python
en
code
3
github-code
18
[ { "api_name": "torch.no_grad", "line_number": 25, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 28, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 53, "usage_type": "call" }, { "api_name": "data.datasets.SampleD...
24652984168
from flask import Flask, render_template, request,redirect,url_for,session import random from utils.learning import * import json import requests app = Flask(__name__) app.secret_key = 'password' IMDB_KEY = "3df29fd2" BASEURL = "http://www.omdbapi.com/?i=tt" movie_list = [] def get_request_url(movid): return BASEURL...
sachalmalick/Movie-Reccomender
app.py
app.py
py
2,186
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "random.sample", "line_number": 22, "usage_type": "call" }, { "api_name": "flask.render_template", "li...
31227244639
#!/usr/bin/env python ''' Runs wsgi web server using bottle framework To get usage $ python server_bottle.py -h Runs embedded wsgi server when run directly as __main__. The server is at http://localhost:port or http://127.0.0.1:port The default port is 8080 The root path is http://localhost:...
vmware-archive/halite
halite/server_bottle.py
server_bottle.py
py
22,995
python
en
code
414
github-code
18
[ { "api_name": "aiding.getLogger", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "...
6220423597
from transitions import Machine from common.transaction import auto_meta_sync from datamanage.pro.datamodel.models.model_dict import DataModelStep, DataModelPublishStatus from datamanage.pro.datamodel.models.datamodel import DmmModelInfo from datamanage.pro.datamodel.dmm.object import get_object # step_id的状态转移矩阵 STE...
Tencent/bk-base
src/api/datamanage/pro/datamodel/dmm/state_machine.py
state_machine.py
py
6,256
python
en
code
85
github-code
18
[ { "api_name": "datamanage.pro.datamodel.models.model_dict.DataModelStep.INIT", "line_number": 11, "usage_type": "attribute" }, { "api_name": "datamanage.pro.datamodel.models.model_dict.DataModelStep", "line_number": 11, "usage_type": "name" }, { "api_name": "datamanage.pro.datamo...
41240920203
from random import randint from telegram import Update, Bot from telegram.ext import Updater, CommandHandler, Filters, MessageHandler, ConversationHandler bot = Bot(token='5594488827:AAG1tLzTOpSE1_tEABaf43GT3uf0iukcGdI') updater = Updater(token='5594488827:AAG1tLzTOpSE1_tEABaf43GT3uf0iukcGdI', use_context=True) dispat...
AleksNest/PhythonHomeworks
homework10.py
homework10.py
py
6,363
python
ru
code
0
github-code
18
[ { "api_name": "telegram.Bot", "line_number": 5, "usage_type": "call" }, { "api_name": "telegram.ext.Updater", "line_number": 6, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 62, "usage_type": "call" }, { "api_name": "random.randint", "...
42109201262
from logging import exception from time import time import pyautogui import cv2 import numpy as np import timeit import mss import prueba from PIL import Image cv2.namedWindow("Live", cv2.WINDOW_NORMAL) cv2.resizeWindow("Live", 1024, 1024) monitor = {'top': 40, 'left': 0, 'width': 1024, 'height': 1024} ms...
0omanuo0/mcIA
screen.py
screen.py
py
1,345
python
en
code
0
github-code
18
[ { "api_name": "cv2.namedWindow", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.WINDOW_NORMAL", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.resizeWindow", "line_number": 12, "usage_type": "call" }, { "api_name": "mss.mss", ...
39447564622
from django.views.generic import DetailView from django.shortcuts import get_object_or_404 from django.http import JsonResponse from django.utils import timezone from champsquarebackend.core.loading import get_model, get_class AnswerPaper = get_model('quiz', 'AnswerPaper') VideoRecord = get_model('monitoring', 'Vide...
ChampSquare/ChampionSquareBackend
champsquarebackend/apps/monitoring/views.py
views.py
py
1,450
python
en
code
0
github-code
18
[ { "api_name": "champsquarebackend.core.loading.get_model", "line_number": 8, "usage_type": "call" }, { "api_name": "champsquarebackend.core.loading.get_model", "line_number": 9, "usage_type": "call" }, { "api_name": "django.views.generic.DetailView", "line_number": 12, "u...
23513844409
import numpy as np import jax import jax.numpy as jnp from functools import partial from free_hamiltonian import H_free from logpsi import log_psi from metropolis import random_init, make_E, make_QGT, make_QGT_ED, make_loss from sampler import Gaussian_fn def optimize_sigma(): batch = 1000 t = 1. U = 6....
pengbingrui26/VMC_Gaussian
optimize_sigma.py
optimize_sigma.py
py
1,706
python
en
code
0
github-code
18
[ { "api_name": "free_hamiltonian.H_free", "line_number": 18, "usage_type": "call" }, { "api_name": "metropolis.random_init", "line_number": 21, "usage_type": "call" }, { "api_name": "logpsi.log_psi", "line_number": 32, "usage_type": "call" }, { "api_name": "optax.a...
43339811608
import os from app import app from flask import Flask, render_template, request, url_for, redirect, send_from_directory from werkzeug.utils import secure_filename UPLOAD_FOLDER = os.path.join(app.root_path, 'image') ALLOWED_EXTENSIONS = set(['pdf','png','jpg','jpeg','gif']) app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDE...
mattgoorley/picupload
app/project.py
project.py
py
1,227
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "app.app.root_path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "app.app", "line_num...
26167564554
import os.path from CropModels import * from CropDataset import Apple_leaf_dataset, normalize_torch, normalize_05, normalize_dataset, preprocess, \ preprocess_hflip, \ preprocess_with_augmentation import pandas as pd import torch.nn as nn from tensorboardX import SummaryWriter import torch from torch...
Jin-Xi/apple_leaf
train.py
train.py
py
6,842
python
en
code
0
github-code
18
[ { "api_name": "torch.manual_seed", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.cuda.amp.GradScaler", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.backends", "line_number": 24, "usage_type": "attribute" }, { "api_name": "datet...
13091143514
""" Model performance. """ import os import sys import time import resource import argparse import warnings from datetime import datetime warnings.simplefilter(action='ignore', category=UserWarning) # lgb compiler warning import numpy as np import pandas as pd from sklearn.neighbors import KNeighborsClassifier from s...
jjbrophy47/trex
scripts/experiments/performance.py
performance.py
py
9,310
python
en
code
3
github-code
18
[ { "api_name": "warnings.simplefilter", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.dirname", ...
25159965775
import jieba import re #去除描述信息中无用的被告,原告,姓名和日期等信息 jieba.setLogLevel('WARN') class normalizer: def __init__(self, stopword_filepath): ''' :param stopword_filepath: 停用词表路径 :return: ''' self.raw_json_list = [] self.cut_list = [] self.data_out = None s...
belieberly/judicial_doc_measurement
utils/lda/normalize.py
normalize.py
py
5,936
python
en
code
1
github-code
18
[ { "api_name": "jieba.setLogLevel", "line_number": 6, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 92, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 94, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 96, "u...
18434686019
import dis import os import time import torch import torch.nn as nn from torch.autograd import Variable import sys import fastai from fastai.vision import * from fastai.callbacks import * import torch.nn.functional as F import plot from adversarial import run_wgan from adversarial import run_waae def instance_bce_with...
anon0001/adv_rec
VQA/train.py
train.py
py
9,135
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.functional.binary_cross_entropy_with_logits", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 19, "usage_type": "name" }, {...
35359966956
import matplotlib.pyplot as plt import os def plot_col_graph(x, y, titulo_x, titulo_y, plot_title, size, name, representar='N'): ''' Función que genera un gráfico de barras a partir de los parámetros de entrada :param x: datos eje x :param y: datos eje y :param titulo_x: título eje x :param t...
JaimePerez89/Bitcoin
bitcoin/PlotColumns.py
PlotColumns.py
py
1,635
python
es
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 21, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_na...
26279783115
import face_recognition import os TEST_FACES = "test_faces" true_positives = 0 false_positives = 0 image = face_recognition.load_image_file(f"image_0001.jpg") realID = face_recognition.face_encodings(image)[0] print(type(realID)) tolerance = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1] for value in tolerance: ...
rbangay-personal/ass4
ass4.py
ass4.py
py
1,141
python
en
code
0
github-code
18
[ { "api_name": "face_recognition.load_image_file", "line_number": 9, "usage_type": "call" }, { "api_name": "face_recognition.face_encodings", "line_number": 10, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 15, "usage_type": "call" }, { "api_na...
22665270542
from typing import List from collections import defaultdict from itertools import combinations class Solution: def mostVisitedPattern(self, username: List[str], timestamp: List[int], website: List[str]) -> List[str]: all_data = [(t, u, w) for u, t, w in zip(username, timestamp, website)] all_data....
mohanwer/algorithms-study
leet_code/analyze_user_website.py
analyze_user_website.py
py
1,057
python
en
code
1
github-code
18
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 15, "usage_type": "call" }, { "api_name": "itertools....
24925586078
#!/usr/bin/python # -*- coding: UTF-8 -*- # 添加小车反馈:如果杆往右歪,则往右走; """ “观测状态”有四维: 小车位置、小车速度、杆的角度和杆顶端的速度(初始状态每个值均在 ±0.05 区间内取随机值); “终止条件”有三条: 杆的角度大于 ±12 度,小车的位置超过 ±2.4,以及迭代次数超过 200(v1 为 500); 每个步骤的“奖励”均为 1(包括终止步)。 """ import gym env = gym.make("CartPole-v0") t_all = [] action_bef = 0 #纪律上一次action action_threshold...
bobby4k/BobbyGym
test003.py
test003.py
py
1,411
python
zh
code
0
github-code
18
[ { "api_name": "gym.make", "line_number": 13, "usage_type": "call" } ]
18707992634
import argparse import curse import logging import worker import urllib3 from multiprocessing import cpu_count def main(): http = urllib3.PoolManager(num_pools=512, maxsize=512, block=True) cmd_line_parser = argparse.ArgumentParser(description="Batch downloads minecraft mods from curseforge") cmd_line_pa...
Janrupf/curse-indexer
main.py
main.py
py
2,003
python
en
code
0
github-code
18
[ { "api_name": "urllib3.PoolManager", "line_number": 10, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "multiprocessing.cpu_count", "line_number": 16, "usage_type": "call" }, { "api_name": ...
1170446346
import datetime from utils.group import User import random import string import pymongo import pandas as pd from src.plugins.messages import kws from nonebot import on_command from nonebot.typing import T_State from nonebot.adapters.cqhttp.bot import Bot from nonebot.adapters.cqhttp.message import MessageSegment as ms...
syhanjin/chizi_bot
src/plugins/integrated_command/__init__.py
__init__.py
py
2,645
python
en
code
0
github-code
18
[ { "api_name": "pymongo.MongoClient", "line_number": 16, "usage_type": "call" }, { "api_name": "nonebot.on_command", "line_number": 21, "usage_type": "call" }, { "api_name": "nonebot.adapters.cqhttp.permission.PRIVATE", "line_number": 24, "usage_type": "name" }, { ...
31766882845
#!/usr/bin/env python # coding: utf-8 # # Importing Libraries # In[1]: import matplotlib.pyplot as plt import cv2 import numpy as np import math # # Loading Image # In[2]: img_path = './images/Bird2.jpg' img_path # In[3]: bgr_img = cv2.imread(img_path, -1) rgb_img = cv2.cvtColor(bgr_img, cv2.COLOR_BGR2RGB)...
ShahriarRu/Image-Processing
Assignment5/Laplace and Sobel Filters.py
Laplace and Sobel Filters.py
py
1,956
python
en
code
0
github-code
18
[ { "api_name": "cv2.imread", "line_number": 27, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_number": 28, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line...
17233789322
from __future__ import print_function import Tile import numpy as np import collections ''' Encoding: 0: player->hand, 1: player->fixed_hand 2: player->disposed_tiles 3+2i: neighbor[i]->fixed_hand 3+2i+1: neighbor[i]->disposed_tiles ''' def dnn_encode_state(player, neighbors): state = np.zeros((9, 34, 1)) for tile ...
clarkwkw/mahjong-ai
MoveGenerator/utils.py
utils.py
py
9,013
python
en
code
25
github-code
18
[ { "api_name": "numpy.zeros", "line_number": 16, "usage_type": "call" }, { "api_name": "Tile.convert_tile_index", "line_number": 18, "usage_type": "call" }, { "api_name": "Tile.convert_tile_index", "line_number": 25, "usage_type": "call" }, { "api_name": "Tile.conv...
19209274135
#!/usr/bin/env python import octomap import numpy as np import scipy import cc3d from plot import * from pytransform3d.plot_utils import plot_sphere, plot_box from polytope import * from transform import * def cluster_indices(assignment): indices = [] for i, j in enumerate(assignment): while True: ...
BobbyCephy/grop
scripts/objects.py
objects.py
py
7,142
python
en
code
0
github-code
18
[ { "api_name": "octomap.OcTree", "line_number": 41, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 77, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number"...
11798066062
from flask import Flask, request from flask_restful import Resource, Api from models import Pessoas, Atividades, Usuarios #https://flask-httpauth.readthedocs.io/en/latest/ from flask_httpauth import HTTPBasicAuth auth = HTTPBasicAuth() app = Flask(__name__) api = Api(app) # USUARIOS = { # 'teste':'12345' # } # # ...
ceconelo/api_atividade
app.py
app.py
py
3,604
python
pt
code
0
github-code
18
[ { "api_name": "flask_httpauth.HTTPBasicAuth", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Usuari...
40437376924
import sys import os import argparse import json import cerberus_document_editor as cde from cerberus_document_editor import yaml_parser APP_NAME = 'Cerberus Document Editor' DESCRIPTION='Document Editor for Cerberus Schema.' parser = argparse.ArgumentParser(description=DESCRIPTION) parser.add_argument('-v', '--versio...
onetop21/cerberus-document-editor
cerberus_document_editor/__main__.py
__main__.py
py
3,294
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "cerberus_document_editor.__version__", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 16, "usage_type": "attribute" }, { ...
20665866169
import numpy as np from astropy.io import fits from ...photometry import Band # from .sensitivity import Sensitivity from ....logger import LOGGER # # Written for slitlessutils by R. Ryan at STScI # # v1.0 Jan 2023 # # # class Order: """ Class to contain the trace, dispersion, and sensitivity for a spectra...
duytnguyendtn/slitlessutils_private
slitlessutils/core/wfss/config_orig/order.py
order.py
py
13,281
python
en
code
0
github-code
18
[ { "api_name": "numpy.full_like", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 40, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 121, "usage_type": "call" }, { "api_name": "numpy.isscalar", "line...
30723655214
from langchain.llms import OpenAI from pdf2image import convert_from_path import numpy as np import cv2 import os import pytesseract import time pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe' poppler_path = r'C:\poppler-23.01.0\Library\bin' apiKey = "..." os.environ["OPENAI_A...
kabhinha/EduCom
lang.py
lang.py
py
1,443
python
en
code
0
github-code
18
[ { "api_name": "pytesseract.pytesseract", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "langchain.llms.OpenAI", "line_number": 14, "usage_type": "call" }, { "api_name": "cv...
14875097712
#// IMPORTS //# from modules.helpers import ltxt from modules.helpers import utxt from modules.config import gv #// FUNCTIONS //# # run metals function with calamity def metals(): calamity = 0 ltxt('RNG Seed is set to: ' + str(gv['rng'])) ltxt('Metals Calamity is currently set to: ' + str(calamity)) if (gv['rn...
ckreon/py-text-colony-sim
modules/metals.py
metals.py
py
1,392
python
en
code
1
github-code
18
[ { "api_name": "modules.helpers.ltxt", "line_number": 12, "usage_type": "call" }, { "api_name": "modules.config.gv", "line_number": 12, "usage_type": "name" }, { "api_name": "modules.helpers.ltxt", "line_number": 13, "usage_type": "call" }, { "api_name": "modules.c...
70030787559
import html import os import sys from dotenv import load_dotenv import fetch_budget_data import fetch_tripletex_data from flask import Flask, Response, request, send_from_directory from flask_cors import CORS load_dotenv() def require_env(name: str) -> str: value = os.environ.get(name, None) if value is Non...
cybernetisk/okotools
tripletexweb/backend/app/app.py
app.py
py
2,480
python
en
code
2
github-code
18
[ { "api_name": "dotenv.load_dotenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.environ.get", ...
39399319475
import sys import argparse import logging import audiocontrol.audiocontrol as ac if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-v', '--verbose', action='store_true', help='verbose, log to console') parser.add_argument('-vv...
hifiberry/audiocontrol
audiocontrol/__main__.py
__main__.py
py
866
python
en
code
3
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.I...
35008973162
import datetime from functools import lru_cache from json import loads from pathlib import Path import subprocess from subprocess import check_output from colorama import Style, Fore import settings from common.filesystem import File class MediaFile(File): def __init__(self, path: Path): super(MediaFil...
dukensk/smg
common/media.py
media.py
py
7,106
python
en
code
0
github-code
18
[ { "api_name": "common.filesystem.File", "line_number": 14, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "name" }, { "api_name": "subprocess.check_out...
9948362712
import json with open('new_dumps.txt') as f: data = f.read() new = eval(data) parsed_json = json.dumps(new) #print parsed_json """json_file = open('new_dumps.txt') data = json.load(json_file) do = data['dataObjects'][0] print do['identifier'] print do['description'] json_file.close()""" print(new['textOrigin...
UCSB-dataScience-ProjectGroup/youtube
oldRepo/parseJSON.py
parseJSON.py
py
506
python
en
code
11
github-code
18
[ { "api_name": "json.dumps", "line_number": 9, "usage_type": "call" } ]
21119260284
""" Given a binary tree, print it vertically. e.g. 1 / \ 2 3 / \ / \ 4 5 6 7 / \ 8 9 The output of print this tree vertically will be: 4 2 1 5 6 3 8 7 9 """ from typing import Optional from collections import defaultdic...
rrwt/daily-coding-challenge
gfg/hashing/print_tree_vertically.py
print_tree_vertically.py
py
1,313
python
en
code
1
github-code
18
[ { "api_name": "binary_tree_node.Node", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 31, "usage_type": "name" }, { "api_name": "binary_tree_node.Node", "line_number": 31, "usage_type": "name" }, { "api_name": "collectio...
14043519256
# coding: utf-8 """Objects used to deal with symmetry operations in crystals.""" from __future__ import print_function, division, unicode_literals, absolute_import import sys import abc import warnings import collections import six import numpy as np from six.moves import cStringIO from monty.string import is_string ...
CaptainDasheng/abipy
abipy/core/symmetries.py
symmetries.py
py
41,948
python
en
code
null
github-code
18
[ { "api_name": "numpy.around", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.allclose", "line_number": 45, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 64, "usage_type": "call" }, { "api_name": "numpy.int", "line_number"...
1915070454
#!/usr/bin/env python #-*- coding: utf-8 -*- """ @Project:zhifu @author:sandu @Email: sandu12345@msn.cn @Software: PyCharm @file: hooks.py @time: 2018-09-20 0020 下午 18:31 """ from .views import bp from flask import session,g,render_template from config import SESSION_FRONT_ID from .models import FrontUser @bp.bef...
yongnights/bbs
apps/front/hooks.py
hooks.py
py
629
python
en
code
0
github-code
18
[ { "api_name": "config.SESSION_FRONT_ID", "line_number": 19, "usage_type": "name" }, { "api_name": "flask.session", "line_number": 19, "usage_type": "name" }, { "api_name": "flask.session.get", "line_number": 20, "usage_type": "call" }, { "api_name": "config.SESSIO...
84014523
""" Functions to detect duplicate Samples in imputed HDF5 file @ Author: Harald Ringbauer, 2023 """ import numpy as np import pandas as pd import h5py import itertools as it def get_match_df(path_h5="./data/hdf5/1240k_v54.1/ch", ch=3, iids=[], gp_cutoff=0.98): """Create diploid Match Rate for all...
hringbauer/ancIBD
package/ancIBD/IO/h5_duplicates.py
h5_duplicates.py
py
2,282
python
en
code
2
github-code
18
[ { "api_name": "h5py.File", "line_number": 17, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.mean", "l...
71703498279
import requests from .config import host from exceptions.mileage_error import MileageError from database_abc import VehicleDB from model.model import Vehicle """ Connects to server and makes API calls. Implements the same interface as the sql_database version of VehicleDB """ class APIVehicleDB(VehicleDB): ...
claraj/miles_solid
final/api_database/database.py
database.py
py
1,538
python
en
code
1
github-code
18
[ { "api_name": "database_abc.VehicleDB", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 17, "usage_type": "call" }, { "api_name": "config.host", "line_number": 17, "usage_type": "argument" }, { "api_name": "exceptions.milea...
15215939714
from sklearn.feature_extraction.text import CountVectorizer sentences = [ 'I love my dog', 'I love my cat', ] vectorizer = CountVectorizer(token_pattern=r"(?u)\b\w+\b") X = vectorizer.fit_transform(sentences) word_index = {v:k for k, v in enumerate(vectorizer.get_feature_names())} print(word_...
igormorgado/nlp
sk_tokenizer.py
sk_tokenizer.py
py
328
python
en
code
0
github-code
18
[ { "api_name": "sklearn.feature_extraction.text.CountVectorizer", "line_number": 8, "usage_type": "call" } ]
69926011241
from __future__ import print_function import dockercloud import psycopg2 import subprocess import os import datetime import time # Parameters: BUCKET = os.environ['S3_BUCKET'] NAMESPACE = os.environ['S3_NAMESPACE'] ACCESS_KEY = os.environ['AWS_ACCESS_KEY'] SECRET_KEY = os.environ['AWS_SECRET_KEY'] HOST = os.environ.g...
okfn/dockercloud-db-to-s3
backup.py
backup.py
py
3,684
python
en
code
1
github-code
18
[ { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.environ", "lin...
16230537772
#!/usr/bin/env python # -*- coding: utf-8 -*- from maya import cmds from maya import mel import os, json import pymel.core as pm from . import weight from . import common from . import qt import maya.api.OpenMaya as om import re def setSoftEdge(mesh, angle=120): # 法線のロック解除 cmds.polyNormalPerVertex(mesh + ...
ShikouYamaue/SIWeightEditor
Contents/scripts/siweighteditor/modeling.py
modeling.py
py
11,003
python
en
code
92
github-code
18
[ { "api_name": "maya.cmds.polyNormalPerVertex", "line_number": 16, "usage_type": "call" }, { "api_name": "maya.cmds", "line_number": 16, "usage_type": "name" }, { "api_name": "maya.cmds.polySoftEdge", "line_number": 18, "usage_type": "call" }, { "api_name": "maya.c...
38629774941
import logging from utils.pif_storage import get_pif, pif_exists, save_pif def handle_comment(comment): if not comment.author: logging.debug('Comment [%s] is deleted, skipping', comment.id) return logging.info('Handling comment [%s] by %s on post "%s"', comment.id, comment.author.name, commen...
waab76/PIFBot
handlers/comment_handler.py
comment_handler.py
py
1,170
python
en
code
5
github-code
18
[ { "api_name": "logging.debug", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.info", "line_numb...
32373542328
# Importar librerías necesarias import tkinter as tk import secrets import string import copy import pyperclip from tkinter import messagebox def generar_contraseña(longitud): caracteres = string.ascii_letters + string.digits + string.punctuation contraseña = ''.join(secrets.choice(caracteres) for _ in range(l...
adriiiaa12/SafePass
__SafePass__/Code/file3.py
file3.py
py
4,094
python
es
code
0
github-code
18
[ { "api_name": "string.ascii_letters", "line_number": 10, "usage_type": "attribute" }, { "api_name": "string.digits", "line_number": 10, "usage_type": "attribute" }, { "api_name": "string.punctuation", "line_number": 10, "usage_type": "attribute" }, { "api_name": "...
37318292335
from datetime import datetime def days(num): days_in_week = ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'] return days_in_week[int(num)] def extract_current_date(): dt = datetime.now().date() today = dt.strftime('%w') return [today, dt] def extract_time(): dt = datetime.now() ...
REl98/Scrape_surfing_data
General_functions.py
General_functions.py
py
1,875
python
he
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetim...
3273162851
import torch from torch import Tensor import torch.nn as nn import math from typing import Optional from bench.core.executer import Executer class NestedTensor(object): def __init__(self, tensors, mask: Optional[Tensor]): self.tensors = tensors self.mask = mask def to(self, device): ...
DeepLink-org/DLOP-Bench
bench/samples/long_tail/position_embedding_sine/torch_impl.py
torch_impl.py
py
3,033
python
en
code
38
github-code
18
[ { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 33, "usage_type": "attribute" }, { "api_name": "torch.nn", "lin...
28109160650
import os; os.environ["TMPDIR"] = os.path.join(os.environ['HOME'], 'tmp') import pwn from ctypes import CDLL #from struct import pack host = "jupiter.challenges.picoctf.org" port = 51462 target = "./vuln" def must_guess(pr): res = 0 while res != 1: for num in range(1, 100): pr.sendlineafter("W...
onealmond/hacking-lab
picoctf-2020/guessing-game1/shellcode.py
shellcode.py
py
2,431
python
en
code
72
github-code
18
[ { "api_name": "os.environ", "line_number": 1, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 1, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1, "usage_type": "attribute" }, { "api_name": "pwn.remote", "line_number"...
20199573589
import json import os data = {} for file in os.listdir('data'): with open('data/{}'.format(file)) as data_file: js = json.load(data_file) for js_line in js: destination = js_line["destination"] load=js_line["loadSum"] if destination not in data.keys(): ...
marty30/MBD-trade-routes
src/main/python/mergeDestinationResults.py
mergeDestinationResults.py
py
486
python
en
code
0
github-code
18
[ { "api_name": "os.listdir", "line_number": 5, "usage_type": "call" }, { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 17, "usage_type": "call" } ]
7567258099
#!/usr/bin/env python # coding: utf-8 import os import sys import requests import regex import time import pytz from datetime import datetime, timedelta import pandas as pd from multiprocessing.pool import ThreadPool import json import logging from configparser import ConfigParser from optparse import OptionParser ...
insightfinder/InsightAgent
nagios/nagios.py
nagios.py
py
13,783
python
en
code
19
github-code
18
[ { "api_name": "warnings.filterwarnings", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 34, "usage_type": "attribute" }, { "api_name": "logging.F...
72212371880
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- import os import datetime as dt import argparse from account import Account from entry import stringToDate def lookFornext25 (date): d = date while d.day != 25: d += dt.timedelta (days = 1) return d parser = argparse.ArgumentParser(description='C...
florent-lamiraux/banking
balance.py
balance.py
py
1,016
python
en
code
0
github-code
18
[ { "api_name": "datetime.timedelta", "line_number": 13, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "entry.stringToDate", "line_number": 23, "usage_type": "call" }, { "api_name": "datetim...
36923133952
#!/usr/bin/env python3.9 """ Update Fields or Tags in an InfluxDB Measurement. """ from configparser import ConfigParser from influxdb import InfluxDBClient config = ConfigParser(interpolation=None) config.read("InfluxUploader.ini", encoding="utf-8") def connect() -> InfluxDBClient: """Connect to DB.""" cl...
entorb/raspi-sensorics
influx_value_update.py
influx_value_update.py
py
1,426
python
en
code
0
github-code
18
[ { "api_name": "configparser.ConfigParser", "line_number": 10, "usage_type": "call" }, { "api_name": "influxdb.InfluxDBClient", "line_number": 16, "usage_type": "call" }, { "api_name": "influxdb.InfluxDBClient", "line_number": 14, "usage_type": "name" } ]
16667947741
import datetime import os import sys import logging from io import StringIO from getpass import getpass from Framework import AutoApi from Framework.auth_manager import AuthenticationManager # import functions from module_1 import __main__ as Func1 from module_2 import __main__ as Func2 from module_3 impor...
ImmanuelSuleimanCS/AutomationFramework
Lib/Sample_Run.py
Sample_Run.py
py
4,405
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 18, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.INF...
6136479384
import requests from bs4 import BeautifulSoup url = 'https://coinmarketcap.com/' page = requests.get(url) soup = BeautifulSoup(page.content, 'html.parser') table = soup.find_all('table')[0] print(table) rows = table.find_all('tr') print(len(rows)) data = [] count = 1 for row in rows[1:11]: cols = row.find_all('td...
hims1911/coin-market-backend-django
scripts/scrapper.py
scrapper.py
py
1,013
python
en
code
0
github-code
18
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 6, "usage_type": "call" } ]
74240418281
from pathlib import Path as OrigPath path = OrigPath(__file__) BLUR_AMOUNT = 0.6 DATA_DIRECTORY = path.parent.parent.joinpath("data") DEFAULT_FRAMERATE = 30 DEFAULT_IMAGE_WIDTH = 600 DEFAULT_IMAGE_HEIGHT = 600 DEFAULT_TRESHOLD = 0.6 FEATHER_AMOUNT = 11 IMAGE_EXTENSIONS = (".jpg", ".png") PREDICTOR_PATH = f"{DATA_DIREC...
hay/facetool
facetool/constants.py
constants.py
py
427
python
en
code
47
github-code
18
[ { "api_name": "pathlib.Path", "line_number": 2, "usage_type": "call" } ]