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
40776088199
import cv2 import numpy as np import os def mouse_crop(event, x, y, flags, param): # grab references to the global variables global refPoint, image, cropping # if the left mouse button was DOWN, start RECORDING # (x, y) coordinates and indicate that cropping is being # Mouse is Moving i...
hcw-00/click_and_crop
click_and_crop.py
click_and_crop.py
py
2,800
python
en
code
0
github-code
18
[ { "api_name": "cv2.EVENT_MOUSEMOVE", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.rectangle", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.EVENT_LBUTTONUP", "line_number": 26, "usage_type": "attribute" }, { "api_name": "os.li...
22901595205
import sys from collections import deque N, L = map(int, sys.stdin.readline().strip().split()) lst = list(map(int, sys.stdin.readline().strip().split())) deq = deque() for n in range(0, N): while deq and deq[-1][0] > lst[n]: deq.pop() while deq and deq[0][1] < n - L + 1: deq.popleft() deq.ap...
justinkmoon1/Baekjoon1
11003 최솟값 찾기.py
11003 최솟값 찾기.py
py
370
python
en
code
0
github-code
18
[ { "api_name": "sys.stdin.readline", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "sys.stdin.readline", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.stdin", "li...
21150666034
from django.shortcuts import render # Create your views here. from rest_framework import permissions, status from rest_framework.views import APIView from rest_framework.response import Response from django.contrib.auth.models import User from .models import PurchasedStock from .serializers import PurchasedStockSerial...
Cesartwothousands/RU-MARKET-MOGUL
Back-end/property/views.py
views.py
py
4,336
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.views.APIView", "line_number": 13, "usage_type": "name" }, { "api_name": "rest_framework.permissions.IsAuthenticated", "line_number": 14, "usage_type": "attribute" }, { "api_name": "rest_framework.permissions", "line_number": 14, "usage_type"...
72146504360
#! python3 # TweetStreamer - streams and collects live tweet data for a certain keyword and stores the data in an SQLite database. import tweepy import re import textblob import sqlite3 import os class TweetListener(tweepy.StreamListener): """Initialises Twitter Stream API object that will obtain live tweets and...
jmehitch/TweetStreamer
TweetStreamer.py
TweetStreamer.py
py
6,667
python
en
code
0
github-code
18
[ { "api_name": "tweepy.StreamListener", "line_number": 11, "usage_type": "attribute" }, { "api_name": "re.sub", "line_number": 60, "usage_type": "call" }, { "api_name": "textblob.TextBlob", "line_number": 78, "usage_type": "call" }, { "api_name": "os.path.exists", ...
5329821011
from __future__ import print_function from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from googleapiclient.http import MediaIoBaseUpload import googleapiclient.errors f...
Dolinin2021/course_project_pb
classes/google_drive.py
google_drive.py
py
8,967
python
ru
code
0
github-code
18
[ { "api_name": "os.path.path.exists", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 44, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 44, "usage_type": "name" }, { "api_name": "google.oauth2.credentia...
30672367669
#####differernce betwwen poterstemmer and Lemmatizer import re, collections, os import nltk from nltk.stem import PorterStemmer ########get the location of current file __location__=os.path.realpath( os.path.join(os.getcwd(),os.path.dirname(__file__)) ) print(__location__) ##########original file_name=os.pa...
lcconly/Pra_Text_Analytics
pra1/pra1_stem.py
pra1_stem.py
py
918
python
en
code
0
github-code
18
[ { "api_name": "os.path.realpath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
11508073208
# coding: utf-8 import time from flask import Module, request, session, g, redirect, url_for, \ abort, render_template, flash, jsonify from flask_sqlalchemy import Pagination from feather import config from feather.extensions import db, cache from feather.helpers import mentions, mentionfilter from feather.databases ...
yetone/Feather
feather/views/love.py
love.py
py
2,576
python
en
code
53
github-code
18
[ { "api_name": "flask.Module", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.session.get", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.session", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.redirect", "li...
71874777961
from django.shortcuts import render from rest_framework import generics, status, serializers from .serializers import RegisterSerializers from rest_framework.response import Response from rest_framework.permissions import AllowAny, IsAuthenticated from django.contrib.auth.models import User from rest_framework.views im...
DUC-LV/zingmp3_projects
src/accounts/views.py
views.py
py
1,350
python
en
code
0
github-code
18
[ { "api_name": "rest_framework.generics.GenericAPIView", "line_number": 12, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 12, "usage_type": "name" }, { "api_name": "serializers.RegisterSerializers", "line_number": 13, "usage_type": "n...
8276438942
""" Compares Ultimate Tic Tac Toe game tree heuristics. """ import random import time import argparse from engine.GameTree import GameTree from UTTTState import UTTTState from UTTTSpace import UTTTSpace from heuristic import heuristic_A, heuristic_B from mcts import mcts_player, mcts_reset TRACE = False DICTATE = Fa...
noahnu/ai-ultimate-tic-tac-toe
compare_heuristics.py
compare_heuristics.py
py
5,902
python
en
code
2
github-code
18
[ { "api_name": "random.randint", "line_number": 22, "usage_type": "call" }, { "api_name": "UTTTState.UTTTState", "line_number": 60, "usage_type": "call" }, { "api_name": "UTTTSpace.UTTTSpace", "line_number": 60, "usage_type": "call" }, { "api_name": "engine.GameTre...
37515194953
import time import os import json import sys import socket print("Loading..."); with open("config.json", "r") as in_configFile: config = json.load(in_configFile) #Starting Up print(config["StartingMsg"]) #Global Declarations __GMPrivKey_API = os.environ['GroupMePrivKey'] __Port = int(os.environ['PO...
NOLA-Chronicle/GroupMe_HelloWorld
GroupMe_HelloWorld.py
GroupMe_HelloWorld.py
py
1,123
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "socket.socket", "line_n...
23175038990
import matplotlib.pyplot as plt from datetime import date, timedelta import telebot from telebot import types import os from ast import literal_eval import requests from bs4 import BeautifulSoup from flask import Flask, request TOKEN = '1$$$$$$$$$$$$$$$$$$$$$$$$$$$' bot = telebot.TeleBot(TOKEN) server = ...
Veremeich/teleBot_weather_for_fishing
teleBot.py
teleBot.py
py
10,150
python
en
code
0
github-code
18
[ { "api_name": "telebot.TeleBot", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.date", "...
16102020241
import requests, os, subprocess TOKEN = os.environ["token"] HEADERS = {'Authorization': f'token {TOKEN}'} # logging.basicConfig(filename='log.txt', # filemode='a', # format='%(asctime)s %(name)s %(levelname)s %(message)s', # datefmt='%H:%M:%S', # ...
junior9068/busca-senha
cerebro.py
cerebro.py
py
1,428
python
en
code
0
github-code
18
[ { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.get", "line_num...
12146609193
import os from datetime import timedelta from typing import List import fsspec import pandas as pd import xarray as xr from numcodecs import Blosc from pangeo_forge.pipelines.base import AbstractPipeline from pangeo_forge.tasks.http import download from pangeo_forge.utils import chunked_iterable from prefect import Fl...
pangeo-forge/noaa-oisst-avhrr-feedstock
recipe/pipeline.py
pipeline.py
py
5,580
python
en
code
1
github-code
18
[ { "api_name": "pandas.date_range", "line_number": 22, "usage_type": "call" }, { "api_name": "numcodecs.Blosc", "line_number": 27, "usage_type": "call" }, { "api_name": "fsspec.get_filesystem_class", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path...
10018337851
#/usr/bin/env python3 # coding: utf-8 # This file is part of SheddingWallpapers. # SheddingWallpapers is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any...
ridgeontheway/SheddingWallpapers
AutoStart.py
AutoStart.py
py
3,242
python
en
code
1
github-code
18
[ { "api_name": "os.path.exists", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
35812438499
from flask import Flask, request, jsonify, make_response from train_model import run_model app = Flask(__name__) @app.route("/recommendations", methods=["POST", "OPTIONS"]) def api_create_order(): if request.method == "OPTIONS": # CORS preflight return _build_cors_prelight_response() elif request.meth...
andrew-d-talley/web-dev-presentation
python/server.py
server.py
py
914
python
en
code
2
github-code
18
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 8, "usage_type": "name" }, { "api_name": "flask.request.method...
28958361445
# -*- coding: utf-8 -*- """ Created on Thu Jul 16 10:40:29 2017 Artificial Intelligence Assignment @author: Muhammad Dawood N-Queen Problem Given a chessBoard of N*N Calcualte the N Queen not attacking each other. """ import time import matplotlib.pyplot as plt import matplotlib.transfo...
engrodawood/Artificial-Intelligence
NQueen Problem Solution using Depth First Search(DFS)/AssignmentNQueenProbDFS.py
AssignmentNQueenProbDFS.py
py
3,568
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 23, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 24, "usage_type": "call" }, { "api_name": "...
16968337427
# 载入需要的库 import pandas as pd import numpy as np import torch as th from sklearn.model_selection import train_test_split import random import re import torch.nn.functional as F # 读取数据 files1 = pd.read_csv("/home/user/venture/homework3/laptop-train.txt",sep="\t",header=None) files2 = pd.read_csv("/home/user/venture/ho...
VentureRice/AI-ML
人工智能与机器学习-SentimentClassificaiton/CNN.py
CNN.py
py
8,442
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 30, "usage_type": "call" }, { "api_name...
22803407414
from math import exp import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor def gaussian(window_size: int, sigma: float = 1.5) -> Tensor: gauss = Tensor( [exp(-(x - window_size // 2)**2 / float(2 * sigma**2)) for x in range(window_size)]) return gauss / gauss.sum()...
iolag/UPD_study
UPD_study/models/FAE/pytorch_ssim.py
pytorch_ssim.py
py
3,022
python
en
code
18
github-code
18
[ { "api_name": "torch.Tensor", "line_number": 9, "usage_type": "call" }, { "api_name": "math.exp", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 14...
35621991883
import fpylll def reduce(matrix: list[list[int]]) -> list[list[int]]: """Performs a lattice reduction. This function calls LLL to find a reduce basis of the input. Args: matrix: the integer lattice to reduce Returns: the reduce basis. Typically the first row of the result is one of the shortest...
google/paranoid_crypto
paranoid_crypto/lib/lll.py
lll.py
py
824
python
en
code
771
github-code
18
[ { "api_name": "fpylll.IntegerMatrix.from_matrix", "line_number": 21, "usage_type": "call" }, { "api_name": "fpylll.IntegerMatrix", "line_number": 21, "usage_type": "attribute" }, { "api_name": "fpylll.LLL.reduction", "line_number": 22, "usage_type": "call" }, { "a...
70995936039
# coding: utf-8 __license__ = "GNU General Public License v3 (GPLv3)" import sys from functools import partial from os import path from fastpip import VERNUM from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * sys.path.append(path.dirname(__file__)) # rpk.exe 入口点所需 from __info__ imp...
hrpzcf/AwesomePyKit
src/awespykit/runpykit.py
runpykit.py
py
5,652
python
en
code
129
github-code
18
[ { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_num...
75052336039
""" ERC20 token. """ from collections import defaultdict from typing import Dict, Any, List from aave_tokens_model.core.logging import Logged from aave_tokens_model.core.utilities import ( AddressT, require, generate_address ) from aave_tokens_model.core.utilities.restriction import NOT_ENOUGH_BALANCE class ERC2...
DmitIv/aave-tokens-model
aave_tokens_model/core/tokens/erc20.py
erc20.py
py
3,372
python
en
code
0
github-code
18
[ { "api_name": "aave_tokens_model.core.logging.Logged", "line_number": 14, "usage_type": "name" }, { "api_name": "aave_tokens_model.core.utilities.generate_address", "line_number": 25, "usage_type": "call" }, { "api_name": "typing.Dict", "line_number": 27, "usage_type": "n...
21269991675
from django.urls import path, re_path from app import views urlpatterns = [ # Matches any html file - to be used for gentella # Avoid using your .html in your resources. # Or create a separate django app. # re_path(r'^.*\.html', views.gentella_html, name='gentella'), # The home page path('', v...
mialmodovar/NLP-Stocks
app/urls.py
urls.py
py
715
python
en
code
0
github-code
18
[ { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "app.views.index", "line_number": 11, "usage_type": "attribute" }, { "api_name": "app.views", "line_number": 11, "usage_type": "name" }, { "api_name": "django.urls.path", ...
6833797321
"""Custom TorchServe model handler for SAM encoder model. """ from ts.torch_handler.base_handler import BaseHandler import numpy as np import base64 import torch from PIL import Image from io import BytesIO from typing import Union import os from time import time from segment_anything.utils.transforms import ResizeLong...
developmentseed/segment-anything-services
handler_decode.py
handler_decode.py
py
10,686
python
en
code
69
github-code
18
[ { "api_name": "numpy.random.seed", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 25, "usage_type": "attribute" }, { "api_name": "ts.torch_handler....
36994480894
import BaseHTTPServer import urlparse import socket import thread import wx from service.settings import CRESTSettings import logging logger = logging.getLogger(__name__) HTML = ''' <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> <title>pyfa Local Server</tit...
blitzmann/pyfa-chinese
service/server.py
server.py
py
3,510
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "BaseHTTPServer.BaseHTTPRequestHandler", "line_number": 60, "usage_type": "attribute" }, { "api_name": "urlparse.urlparse", "line_number": 64, "usage_type": "call" }, { "ap...
73986660839
from tkinter import * from tkinter.ttk import * from tkinter import filedialog from PIL import Image, ImageTk from main import * # style = Style() # style.configure("BW.Tlabel", foreground=) root = Tk() root.configure(background="#B0BA84") root.title('Polar bear') # root.geometry("550x300+500+350") root.geometry("300...
YarMolenko13/techstroy-polar-bear
ui.py
ui.py
py
1,386
python
en
code
0
github-code
18
[ { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 19, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 19, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 22, "usage_type": "call" }, { "api_name": "...
73656787559
# This program generating cvs file for monthly time-workers # Author TDK21 # ver 1.0 from pathlib import Path from datetime import datetime import pandas as pd import calendar def getFileName(): date = datetime.date(datetime.now()) split_date = str(date).split(sep="-") month = split_date[1] year = sp...
TDK21/CHK_generator
CHK_Generator.py
CHK_Generator.py
py
2,658
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.date", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "pathli...
70303912041
# coding=utf-8 import datetime import logging import os import traceback from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.chrome.options import Options # 日志 from qichacha1.enterpriseEntity import Enterprise def get_logger(name): log = logging.getLogger(name) log.setLevel(...
huanghuizhou/pyTest
crawler/qichacha1/qichacha.py
qichacha.py
py
4,058
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.DE...
17285028366
import pandas import sqlite3 import helpers # The goal of this program is to create an HTML page with a # table of CPD allegations: # 1. Get data from the database: file_path = helpers.get_file_path('cpd.db', subdirectory='data_sources') conn = sqlite3.connect(file_path) df = pandas.read_sql_query(''' SELECT...
eecs110/winter2019
course-files/lectures/lecture_17/01_make_a_table_sqlite.py
01_make_a_table_sqlite.py
py
1,555
python
en
code
2
github-code
18
[ { "api_name": "helpers.get_file_path", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_sql_query", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.set...
11001686012
from kafka import KafkaProducer import csv from time import sleep import json import concurrent.futures from concurrent.futures import ThreadPoolExecutor # Kafka broker address bootstrap_servers = '10.18.17.153:9092' # Kafka topics to send the data topic_LF = "Heelstrike_LF" topic_LH = "Heelstrike_LH" topic_LS = "Hee...
AyemonBaraka/Heelstrike
kafka_heelstrike_prod.py
kafka_heelstrike_prod.py
py
2,643
python
en
code
0
github-code
18
[ { "api_name": "kafka.KafkaProducer", "line_number": 21, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 22, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 36, "usage_type": "call" }, { "api_name": "time.sleep", "line_numb...
1633669720
from logging import raiseExceptions import numpy as np from gym.utils import seeding import gym from gym import spaces import pandas as pd import argparse parser = argparse.ArgumentParser() # notice that although the title contains OE, the state does not contain any information about order # but traditional OHLCV like...
chunpengcoredelia/TradeMaster
env/OE/order_execution_for_PD.py
order_execution_for_PD.py
py
8,764
python
en
code
0
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "gym.Env", "line_number": 46, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 50, "usage_type": "call" }, { "api_name": "gym.spaces.Box", ...
35759822008
import os import fnmatch import yaml from log import log def get_node_info(node_dir, node_name): """ Recurses down the directory trying to find filename wildcards that match the given filename. Returns the node info for the closest match. If there are two wildcards that match, the one that is more...
gosquadron/squadron
squadron/nodes.py
nodes.py
py
1,921
python
en
code
51
github-code
18
[ { "api_name": "log.log.debug", "line_number": 26, "usage_type": "call" }, { "api_name": "log.log", "line_number": 26, "usage_type": "name" }, { "api_name": "os.path.basename", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3...
26473118869
from tkinter import * from tkinter import messagebox from tkinter import simpledialog from tkinter import filedialog from PIL import Image, ImageTk from test import oneImg from test import openCma import cv2 import os Flag = True #控制摄像头的变量 capture = cv2.VideoCapture(0)#摄像头对象作为全局变量会更快些 def ui_process(): root =Tk()...
ohMyJason/MTCNN_faceDetection
faceGui.py
faceGui.py
py
4,020
python
en
code
8
github-code
18
[ { "api_name": "cv2.VideoCapture", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 19, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoImage", ...
27878270053
# 展示playwright工具的使用 from playwright.sync_api import sync_playwright def run(): with sync_playwright() as p: browser = p.chromium.launch() page = browser.new_page() page.goto('https://langchain.com/') title = page.title() print('title=', title) browser.close() if _...
PengleiYu/CourseLangchain
13_代理下/chapter13_1playwright.py
chapter13_1playwright.py
py
367
python
en
code
0
github-code
18
[ { "api_name": "playwright.sync_api.sync_playwright", "line_number": 6, "usage_type": "call" } ]
35338374252
""" Script to anonymize the classifications The user names can be deleted and only user ids are kept. """ import pandas as pd import xarray as xr raw_data_filename_input = '../zooniverse_raw/sugar-flower-fish-or-gravel-classifications.csv' raw_data_filename_output = '../zooniverse_raw/sugar-flower-fish-or-gravel-cla...
leifdenby/EUREC4A_manualclassifications
scripts/anonymize_data.py
anonymize_data.py
py
856
python
en
code
null
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "xarray.open_dataset", "line_number": 25, "usage_type": "call" } ]
70499624680
''' Created on Aug 5, 2020 @author: Jeff ''' import PyQt5 from PyQt5 import QtCore, QtGui, QtWidgets import datetime import pyperclip #Fixes scaling issues on high res monitors if hasattr(QtCore.Qt, 'AA_EnableHighDpiScaling'): PyQt5.QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True) if ...
jmf11493/MusicDownloader
music_dl/song_download_view.py
song_download_view.py
py
17,603
python
en
code
1
github-code
18
[ { "api_name": "PyQt5.QtCore.Qt", "line_number": 12, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore", "line_number": 12, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QApplication.setAttribute", "line_number": 13, "usage_type": "call" }, { "api_n...
73948550759
import matplotlib.pyplot as plt import numpy as np def plot_histogram(data, title, output_filename): plt.rc('text', usetex=True) plt.rc('font', family='serif') fig, axis = plt.subplots() X = data[:,0] Y = data[:,1] axis.set_xlabel(r'association count', fontsize=15) axis.set_ylabel(r'number...
CHfCGS/pathfinder_slides
plots/histogram.py
histogram.py
py
1,011
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.rc", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 5, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.p...
43770644697
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from networks.deep_lab import DeepLabv3_plus from collections import OrderedDict from networks.tools import save_image from networks import tools # The Code of baseline network is referenced from https://github.com/icoz69/Ca...
ZRT1998JULY/FESA
networks/FEnetwork.py
FEnetwork.py
py
7,576
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Sequential", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.nn", "lin...
7565862068
from airflow.hooks.postgres_hook import PostgresHook from airflow.models import BaseOperator from helpers import SqlQueries class LoadFactOperator(BaseOperator): ui_color = '#F98866' load_fact_table_insert = """ INSERT INTO {} {} """ load_fact_table_truncate = """ TRUNCATE TABLE {} """ ...
tikhonova/Data-Pipeline-with-Airflow
operators/load_fact.py
load_fact.py
py
1,190
python
en
code
0
github-code
18
[ { "api_name": "airflow.models.BaseOperator", "line_number": 6, "usage_type": "name" }, { "api_name": "airflow.hooks.postgres_hook.PostgresHook", "line_number": 30, "usage_type": "call" } ]
1032675132
# -*- coding: utf-8 -*- """ Created on Mon Feb 6 16:11:33 2023 @author: SWannell """ import matplotlib.pyplot as plt; plt.style.use('ggplot') import matplotlib.ticker as mtick import pandas as pd df = pd.read_csv('AmendedData\\appeal_by_hour.csv', parse_dates=['datehour']) df.info() appeal_types = {'Turkey-Syria':...
SWannell/initial-appeal-comparison
plot_data.py
plot_data.py
py
2,620
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 8, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name"...
71427278440
import numpy as np import pandas as pd from fastai.vision import * from fastai import * import zipfile import torch.nn as nn import os # print(os.listdir("../input/carvana-image-masking-challenge")) def unzip_file(path_name): with zipfile.ZipFile(path_name, 'r') as zip_ref: zip_ref.extractall("/ka...
aorursy/new-nb-3
iampaliwal_segment-with-fastai.py
iampaliwal_segment-with-fastai.py
py
2,127
python
en
code
0
github-code
18
[ { "api_name": "zipfile.ZipFile", "line_number": 18, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 63, "usage_type": "call" } ]
30636332336
from http.client import HTTPResponse from django.contrib import admin from django.urls import path from django.http import HttpResponseRedirect from django.shortcuts import render tasks = [] completed_tasks = [] def task_view(request): return render(request, "tasks.html", {"tasks": tasks}) def add_task_view(re...
M2kishore/GDC-Level-4-Milestone
task_manager/urls.py
urls.py
py
1,209
python
en
code
1
github-code
18
[ { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 18, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 23, "usage_type": "call" }, ...
4820356532
""" 1499. Max Value of Equation You are given an array points containing the coordinates of points on a 2D plane, sorted by the x-values, where points[i] = [x_i, y_i] such that x_i < x_y for all 1 <= i < j <= points.length. You are also given an integer k Return the maximum value of the equation y_i + y_j + |x_i - x_j...
tkwang0530/LeetCode
1499.py
1499.py
py
3,400
python
en
code
4
github-code
18
[ { "api_name": "typing.List", "line_number": 43, "usage_type": "name" }, { "api_name": "heapq.heappop", "line_number": 52, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_number": 59, "usage_type": "call" }, { "api_name": "typing.List", "line_numb...
27987031959
## Code for PGD attacker import torch import torch.nn.functional as F class PGDAttacker(object): def __init__(self, attack_eps): self.attack_eps = attack_eps def attack(self, x, y, net, attack_steps, attack_lr, random_init=True, target=None, clamp=(0, 1)): """ :param x: Inputs to per...
yogeshbalaji/Adversarial-training
attacks/pgd.py
pgd.py
py
1,935
python
en
code
11
github-code
18
[ { "api_name": "torch.rand", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.nn.functional.cross_entropy", "line_number": 37, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 37, "usage_type": "name" }, { "api_name": "torc...
39708811869
from django.shortcuts import render, redirect, reverse from django.urls import reverse_lazy from django.views.generic import ListView, DetailView, FormView, DeleteView, UpdateView from books.models import Book from . import forms # Create your views here. class BooksView(ListView): """Show the Book lists""" ...
kariray/The-world-of-BM
books/views.py
views.py
py
1,703
python
en
code
0
github-code
18
[ { "api_name": "django.views.generic.ListView", "line_number": 9, "usage_type": "name" }, { "api_name": "books.models.Book", "line_number": 12, "usage_type": "name" }, { "api_name": "django.views.generic.DetailView", "line_number": 19, "usage_type": "name" }, { "ap...
38856993859
import pyaudio import socket import threading import wave import asyncio import sys import boto3 from queue import Queue from datetime import date, datetime from amazon_transcribe.client import TranscribeStreamingClient from amazon_transcribe.handlers import TranscriptResultStreamHandler from amazon_transcribe.model i...
polyu-17002407g/aiit-group5-2021
pyaudio/server.py
server.py
py
7,467
python
en
code
0
github-code
18
[ { "api_name": "queue.Queue", "line_number": 15, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 17, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 18, "usage_type": "call" }, { "api_name": "boto3.resource", "line_numb...
26429672602
import os import boto3 dynamo_client = boto3.client( 'dynamodb', endpoint_url='http://dynamodb:8000', region_name=os.environ.get('AWS_DEFAULT_REGION', 'us-west-2'), aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''), aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS...
muratcanozdemir/bootcamp-docker-2020
02-TicTacToe/dbreader/app/aws_controller.py
aws_controller.py
py
452
python
en
code
0
github-code
18
[ { "api_name": "boto3.client", "line_number": 4, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_n...
14314961778
import torch.nn as nn import torch from transformers import CLIPModel from torchvision import transforms class VisionEncoder(nn.Module): def __init__(self, pretrained_model: str = "flaviagiammarino/pubmed-clip-vit-base-patch32"): super(VisionEncoder, self).__init__() # Load the CLIP model and toke...
Aacashh/Open-Ended-VQA
vision_encoder.py
vision_encoder.py
py
1,149
python
en
code
1
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "transformers.CLIPModel.from_pretrained", "line_number": 11, "usage_type": "call" }, { "api_name": "tr...
6290519614
import os import os.path as osp import cv2 import numpy as np import vispy from transforms3d.axangles import axangle2mat from transforms3d.quaternions import quat2mat from vispy import app, gloo # import torch # import copy import OpenGL.GL as gl from lib.render_vispy.frustum import Camera3D from lib.render_vispy.mod...
shanice-l/gdrnpp_bop2022
lib/render_vispy/renderer.py
renderer.py
py
19,530
python
en
code
145
github-code
18
[ { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "name" }, { "api_name": "os.path.abspath", "line_n...
20770724982
#!/usr/bin/env python3 # coding: utf-8 from sys import argv, exit from subprocess import Popen, PIPE from os import path, listdir, sep, name from datetime import date, datetime, time, timedelta from PyQt5 import QtWidgets, QtGui, QtCore, QtSql class MyWindows(QtWidgets.QMainWindow): def __init__(self): su...
vladimir-se/ZLauncher
ZLauncher.py
ZLauncher.py
py
13,958
python
en
code
0
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 10, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 10, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLineEdit", "line_number": 13, "usage_type": "call" }, { "api_na...
33052651661
# -*- coding: utf-8 -*- import numpy as np import pickle import os import gc from typing import Dict curPath = os.path.abspath(os.path.dirname(__file__)) rootPath = os.path.split(curPath)[0] + "/Support/chapter02" NBayesPath = rootPath + "/train_word_bag/NBayes.dat" def writeBunch(path, bunch): fileObj = open(pa...
CILIWFES/MyPythonStudy
ML/TextClassification/Nbayes.py
Nbayes.py
py
8,498
python
en
code
0
github-code
18
[ { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.split", "line_n...
971547577
import os import argparse import asyncio import time from datetime import timedelta import logging, logging.handlers _LOGGER = logging.getLogger(__name__) import discord EMOJI_ASTRAY = "\N{ANGRY FACE}" EMOJI_ACTIVE = "\N{FACE WITH MONOCLE}" EMOJI_FINISHED = "\N{SHRUG}\N{ZWJ}\N{FEMALE SIGN}\uFE0F" EMOJI_IGNORED = "\N...
tifv/discord-queue-bot
queue_bot.py
queue_bot.py
py
33,219
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "discord.Client", "line_number": 78, "usage_type": "attribute" }, { "api_name": "discord.Intents", "line_number": 81, "usage_type": "call" }, { "api_name": "asyncio.Lock", ...
36889328794
################## # Imports & Co # ################## import random import json with open("cards_deck.json") as cards_deck: cards_data = json.load(cards_deck) # Check deck length (uncomment for test only) # print("lenght of deck:" + str(len(cards_data))) ################## # Game Setup # ###############...
Fred-FLQ/python-everdell
everdell.py
everdell.py
py
9,909
python
en
code
0
github-code
18
[ { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 173, "usage_type": "call" } ]
71426791720
import pandas as pd import numpy as np import matplotlib.pyplot as plt df_oof = pd.read_csv('../input/rnaoutputanalysis/holdouts.csv') df_oof df_oof['seq'] = df_oof.id_seqpos.apply(lambda v: v.split('_')[-2]) df_oof['i'] = df_oof.id_seqpos.apply(lambda v: int(v.split('_')[-1])) df_oof = df_oof.sort_values('i') df_o...
aorursy/new-nb-3
gdonchyts_compare-reactivity-predictions.py
gdonchyts_compare-reactivity-predictions.py
py
2,814
python
en
code
0
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.stack", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
23130847672
from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys import time ########################################################## cookie_id = "cookie" cursor_id = "buyCursor" cursor_xpath = '//*[@i...
Bruce70345/Cookie
main.py
main.py
py
4,660
python
en
code
0
github-code
18
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 38, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 38, "usage_type": "name" }, { "api_name": "selenium.webdriver.chrome.service.Service", "line_number": 42, "usage_type": "call" ...
27337714461
""" Core visualization operations based on Mayavi. Actual implementation of _Renderer and _Projection classes. """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric...
soheilbr82/BluegrassWorkingMemory
Python_Engine/Lib/site-packages/mne/viz/backends/_pysurfer_mayavi.py
_pysurfer_mayavi.py
py
18,946
python
en
code
5
github-code
18
[ { "api_name": "base_renderer._BaseRenderer", "line_number": 56, "usage_type": "name" }, { "api_name": "_utils._check_color", "line_number": 70, "usage_type": "call" }, { "api_name": "utils._import_mlab", "line_number": 71, "usage_type": "call" }, { "api_name": "tv...
3596522204
import matplotlib.pyplot as plt from rightUp import move_right_slant from moveRight import move_right def polyline_detection(incision, incision_original, image): x_len = len(incision) y_len = len(incision[1]) incision_points = list() # for the final detection y_position = 0 # on which column is th...
BerassHaggy/ZDO_krabu
devel/incisionPolyline.py
incisionPolyline.py
py
3,293
python
en
code
1
github-code
18
[ { "api_name": "moveRight.move_right", "line_number": 34, "usage_type": "call" }, { "api_name": "rightUp.move_right_slant", "line_number": 44, "usage_type": "call" }, { "api_name": "rightUp.move_right_slant", "line_number": 54, "usage_type": "call" }, { "api_name":...
16299936984
from __future__ import print_function import os import argparse import datetime import six import math import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchvision from torchvision import datasets from torchvision import transforms from torch.autograd import Variabl...
ahundt/deep-learning-jhu-cs-482-682
p02_fashion_mnist.py
p02_fashion_mnist.py
py
14,876
python
en
code
1
github-code
18
[ { "api_name": "argparse.ArgumentParser", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 66, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 66, "usage_type": "attribute" }, { "api_name": "...
11010073504
import sys input = lambda: sys.stdin.readline().rstrip() from collections import deque def resolve(): R, C = map(int, input().split()) sy, sx = map(int, input().split()) gy, gx = map(int, input().split()) c = [list(input().split()) for _ in range(R)] dir = ((0, 1), (1, 0), (0, -1), (-1, 0)) d...
kanji-a/competitive_programming
atcoder/ABC003/c.py
c.py
py
879
python
en
code
0
github-code
18
[ { "api_name": "sys.stdin.readline", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 2, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 14, "usage_type": "call" } ]
28439858488
import sys, re from PyQt5.QtWidgets import QApplication, QDialog, QMessageBox from PyQt5 import uic class Dialog(QDialog): def __init__(self): QDialog.__init__(self) uic.loadUi("poll.ui", self) self.name.textChanged.connect(self.validarNombre) self.email.textChanged.connect(self.val...
Hector290601/EDA2
primerProyecto/qt/basics/forms/validate/main.py
main.py
py
1,803
python
en
code
2
github-code
18
[ { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 5, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QDialog.__init__", "line_number": 7, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QDialog", "line_number": 7, "usage_type": "name" }, { "api...
72096036839
# -*- coding: utf-8 -*- from typing import TYPE_CHECKING, Dict, Any, Set, Tuple import abc import importlib from bag.layout.routing import TrackID from abs_templates_ec.laygo.core import LaygoBase from abs_templates_ec.digital.core import DigitalBase if TYPE_CHECKING: from bag.core import BagProject from b...
xyabc/bag_digital_ec
digital_ec/layout/stdcells/core.py
core.py
py
11,559
python
en
code
0
github-code
18
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 13, "usage_type": "name" }, { "api_name": "abs_templates_ec.digital.core.DigitalBase", "line_number": 18, "usage_type": "name" }, { "api_name": "abs_templates_ec.digital.core.DigitalBase.__init__", "line_number": 40, "u...
71081316199
from flask import g from flask_resources import Resource, resource_requestctx, response_handler, route from invenio_records_resources.resources.records.resource import ( request_data, request_headers, request_search_args, request_view_args, ) from .errors import ErrorHandlersMixin # # Resource # clas...
inveniosoftware/invenio-banners
invenio_banners/resources/resource.py
resource.py
py
2,662
python
en
code
0
github-code
18
[ { "api_name": "errors.ErrorHandlersMixin", "line_number": 16, "usage_type": "name" }, { "api_name": "flask_resources.Resource", "line_number": 16, "usage_type": "name" }, { "api_name": "flask_resources.route", "line_number": 28, "usage_type": "call" }, { "api_name...
6225849327
from bkbase.dataflow.batch.conf import batch_conf from bkbase.dataflow.batch.utils import batch_logger, batch_utils from pyspark.sql.types import StructField, StructType def create_hdfs_src_df(source_node, pipeline): schema = __get_input_schema(source_node) batch_logger.info("Get schema for {}: {}".format(sou...
Tencent/bk-base
src/dataflow/unified-computing/python/bkbase/dataflow/batch/exec/source_dataframe_handler.py
source_dataframe_handler.py
py
2,552
python
en
code
85
github-code
18
[ { "api_name": "bkbase.dataflow.batch.utils.batch_logger.info", "line_number": 8, "usage_type": "call" }, { "api_name": "bkbase.dataflow.batch.utils.batch_logger", "line_number": 8, "usage_type": "name" }, { "api_name": "bkbase.dataflow.batch.utils.batch_logger.info", "line_nu...
17821390230
# generalized model fitting lab #7/25 import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LogNorm import math from scipy import interpolate # #let’s test x from -3 to 3 and y from -2 to 2 # x=np.linspace(-3,3,40) # y=np.linspace(-2,2,40) # # # #look up the documentation for meshgrid ...
tsara-s/yspa
generalised_model_fitting_lab.py
generalised_model_fitting_lab.py
py
2,710
python
en
code
0
github-code
18
[ { "api_name": "math.e", "line_number": 43, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 44, "usage_type": "call" }, { "api_name": "scipy.interpolate.interp1d", "line_number": 47, "usage_type": "call" }, { "api_name": "scipy.interpola...
5608451286
import string, tweepy, json, re from dotenv import dotenv_values from sentiment import analyze_sentiment, translate_text from nltk.tokenize import WordPunctTokenizer config = dotenv_values(".env") auth = tweepy.OAuthHandler(config["CONSUMER_KEY"], config["CONSUMER_KEY_SECRET"]) auth.set_access_token(config["ACCESS_TOK...
sjerrietukkel/FirstName_BunchOfNumbers
final.py
final.py
py
5,170
python
en
code
0
github-code
18
[ { "api_name": "dotenv.dotenv_values", "line_number": 6, "usage_type": "call" }, { "api_name": "tweepy.OAuthHandler", "line_number": 7, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "lin...
23918745976
from django.shortcuts import render, redirect from django.core.urlresolvers import reverse from django.utils.translation import activate from product.models import Category from news.models import News from django.http import HttpResponse from general.models import ImageSlide import re def index(request): slides =...
genxstylez/ylauto
ylauto/views.py
views.py
py
1,272
python
en
code
0
github-code
18
[ { "api_name": "general.models.ImageSlide.objects.filter", "line_number": 11, "usage_type": "call" }, { "api_name": "general.models.ImageSlide.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "general.models.ImageSlide", "line_number": 11, "usage_typ...
41245283453
import logging import os import sys from oslo.config import cfg from tempest.common.utils.misc import singleton LOG = logging.getLogger(__name__) identity_group = cfg.OptGroup(name='identity', title="Keystone Configuration Options") IdentityGroup = [ cfg.StrOpt('catalog_type', ...
nastya-kuz/murano-tests
tempest/config.py
config.py
py
17,781
python
en
code
1
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "oslo.config.cfg.OptGroup", "line_number": 11, "usage_type": "call" }, { "api_name": "oslo.config.cfg", "line_number": 11, "usage_type": "name" }, { "api_name": "oslo.config...
33088334514
from __future__ import absolute_import import six from datetime import datetime from sentry.models import EventAttachment, File from sentry.testutils import APITestCase class EventAttachmentsTest(APITestCase): def test_simple(self): self.login_as(user=self.user) project = self.create_project()...
fictional-tribble-2/getsentry--sentry
tests/sentry/api/endpoints/test_event_attachments.py
test_event_attachments.py
py
1,981
python
en
code
1
github-code
18
[ { "api_name": "sentry.testutils.APITestCase", "line_number": 11, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 30, "usage_type": "call" }, { "api_name": "sent...
43712282550
import torch import torch.nn as nn import torch.nn.functional as F class DeviationLoss(nn.Module): def __init__(self): super().__init__() def forward(self, y_pred, y_true): confidence_margin = 2. # confidence_margin = 0.5 # print(y_pred,y_true) # size=5000 is the set...
zhenghejie/TFD-Net
util/build_criterion.py
build_criterion.py
py
9,203
python
en
code
0
github-code
18
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.normal", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.full", "line_numbe...
40921168144
""" Name: Helper functions Developer: Matt Clarke Date: Jan 1, 2020 Description: Helper functions for accessing Pandas data. """ import numpy as np from sklearn import feature_selection def select(df, column_name, operator, where=[], exclude=False): """Select DataFrame rows based on a column value using a ra...
flyandlure/pypreproc
pypreproc/helper.py
helper.py
py
3,910
python
en
code
2
github-code
18
[ { "api_name": "sklearn.feature_selection.VarianceThreshold", "line_number": 97, "usage_type": "call" }, { "api_name": "sklearn.feature_selection", "line_number": 97, "usage_type": "name" }, { "api_name": "numpy.number", "line_number": 109, "usage_type": "attribute" }, ...
24112614200
#!/usr/bin/python3 """ function that saves JSON to text file """ import json def save_to_json_file(my_obj, filename): """ input: JSON object filename: the file to write """ with open(filename, 'w', encoding='utf-8') as f: jsonStr = json.dumps(my_obj) f.write(jsonStr)
soft-insight/holbertonschool-higher_level_programming
0x0B-python-input_output/5-save_to_json_file.py
5-save_to_json_file.py
py
308
python
en
code
0
github-code
18
[ { "api_name": "json.dumps", "line_number": 14, "usage_type": "call" } ]
29674108579
from django.contrib import admin from .models import CustomerOrder, OrderItem class OrderItemAdmin(admin.TabularInline): model = OrderItem readonly_fields = ('line_total',) class OrderAdmin(admin.ModelAdmin): inlines = (OrderItemAdmin,) readonly_fields = ('order_number', 'date', ...
stellaexp/full-stack-frameworks-project
checkout/admin.py
admin.py
py
949
python
en
code
0
github-code
18
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "models.OrderItem", "line_number": 6, "usage_type": "name" }, { "api_na...
13077209482
import PySimpleGUI as sg from PySimpleGUI.PySimpleGUI import DEFAULT_BUTTON_COLOR from src.ventanas import menu_inicio as inicio from src.auxiliares import clases as cla from src.auxiliares import funciones_generales as funcs from src.auxiliares import registro_eventos as reg def evento_partida(tiempo, filas, columna...
LoreOth/MemPy-game
src/ventanas/Pantalla_juego.py
Pantalla_juego.py
py
9,029
python
es
code
1
github-code
18
[ { "api_name": "src.auxiliares.funciones_generales.get_info_usuario_actual", "line_number": 16, "usage_type": "call" }, { "api_name": "src.auxiliares.funciones_generales", "line_number": 16, "usage_type": "name" }, { "api_name": "src.auxiliares.funciones_generales.get_info_usuario...
30762038822
import os import openpyxl # 识别结果文件夹 RESULT_DIRS = 'C:/Users/a7825/Desktop/工作空间/跑代码/mac0001/out' # 正解文件夹 CORRECT_DIRS = 'C:/Users/a7825/Desktop/工作空间/跑代码/mac0001/zhengjie' # 特征值文件夹 EIGENVALUE_DIRS = 'C:/Users/a7825/Desktop/工作空间/跑代码/mac0001/tezheng' # 特征值合并后的文件 MERGE_CSV = 'C:/Users/a7825/Desktop/工作空间/跑代码/mac...
shuyuqing/-
各种文本/handel_info.py
handel_info.py
py
4,028
python
en
code
1
github-code
18
[ { "api_name": "os.listdir", "line_number": 30, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
35290535459
#!/usr/bin/env python # Ref: https://simpletutorials.com/c/1457/Python+3+Logging+using+DictConfig import logging import logging.config from module1.thing import Thing logging.config.dictConfig({ 'version': 1, 'formatters': { 'default': {'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s...
AlanCLo/python_logging_ref
08_dictConfig_test.py
08_dictConfig_test.py
py
3,572
python
en
code
0
github-code
18
[ { "api_name": "logging.config.dictConfig", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 63, "usage_type": "call" }, { "api_name": "loggi...
19268443371
from datetime import datetime import feature_2 def main(): start = datetime.now() feature_2.main() end = datetime.now() processing_time = (end-start).total_seconds() * 1000 print(f"Start time: {start}.") print(f"End time: {end}.") print(f"Processing time: {processing_time} milliseconds.") ...
nathania4c/practice-exercise
feature_1.py
feature_1.py
py
360
python
en
code
0
github-code
18
[ { "api_name": "datetime.datetime.now", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "name" }, { "api_name": "feature_2.main", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime...
37120491186
from sklearn.preprocessing import OneHotEncoder, LabelEncoder import pandas as pd from sklearn.externals import joblib def extract_features(train_file, test_file, feat_train_file, feat_test_file): df = pd.read_csv(train_file, header=None, names=['country','sku_id','title','category_lvl_1','category_lvl_2','catego...
nthanhtam/cikmcup2017
src/generate_sp_feature_v1.py
generate_sp_feature_v1.py
py
1,481
python
en
code
9
github-code
18
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.Lab...
7656316007
#!/usr/bin/env python3 import distutils.spawn import glob import os import subprocess import sys import utils from typing import Callable, List, Tuple DIR_CHAPTERS = os.path.join(os.getcwd(), 'Kapitel') DOKU_REPO = '../wiki' DOKU_DIR = os.path.join(DOKU_REPO, 'doku') PROGRAMS = ( ('pandoc', 'pandoc', 'pandoc')...
latexstudio/thesis-2
prepare.py
prepare.py
py
2,786
python
en
code
0
github-code
18
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number":...
24259087396
from csv import reader from os import walk import pygame map = {} def import_csv_layout(path): terrain_map = [] with open(path) as level_map: layout = reader(level_map, delimiter = ',') for row in layout: terrain_map.append(list(row)) return terrain_map def import_folder...
AndyOY647/Game_Prroject
support.py
support.py
py
1,223
python
en
code
0
github-code
18
[ { "api_name": "csv.reader", "line_number": 10, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.image.load", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.image", "line_number"...
9402451595
from __future__ import annotations from typing import Optional, TYPE_CHECKING from PyQt5.QtWidgets import QMainWindow from src.machine.rfid import RFIDReader from src.dialog_handler import UI_LANGUAGE from src.display_controller import DP_CONTROLLER from src.ui.setup_keyboard_widget import KeyboardWidget from src.ui_e...
AndreWohnsland/CocktailBerry
src/ui/setup_rfid_writer_window.py
setup_rfid_writer_window.py
py
2,184
python
en
code
51
github-code
18
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 11, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 15, "usage_type": "name" }, { "api_name": "src.ui_elements.rfidwriter.Ui_RFIDWriterWindow", "line_number": 15, "usage_type": "name"...
13354997614
import sys from collections import defaultdict def doParseLog(): feat_id_dict = defaultdict(lambda: 0) for line in sys.stdin: # recv = recv + 1 try: splits = line.strip().split() '''split_len = len(splits) # common_feature_index|feat_num|feat_list ...
Jinjiarui/HEROES
Feature_pipeline/get_feature_cnts_mapper.py
get_feature_cnts_mapper.py
py
1,468
python
en
code
3
github-code
18
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 7, "usage_type": "attribute" } ]
24739771728
import json import os import subprocess from django.http import HttpResponse from . import cv from django.views.decorators.csrf import csrf_exempt from django.core.files.storage import default_storage from django.core.files.base import ContentFile @csrf_exempt def process_img(request): # post /api/process if req...
BustosAndrew/PlasticDetector
api/views.py
views.py
py
1,168
python
en
code
0
github-code
18
[ { "api_name": "django.http.HttpResponse", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 15, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 19, "usage_type": "call" }, { "api_name": "os.chdir", "line_nu...
40918322031
from keras.models import Sequential from keras.layers import Dense, Dropout, BatchNormalization, Flatten from keras.applications import MobileNetV3Large from tensorflow.keras.applications.mobilenet_v3 import preprocess_input from NetUtils import NetUtils class MobileNet(NetUtils): def __init__(self, input_sha...
kamil271e/my-shrooms
MobileNet.py
MobileNet.py
py
1,422
python
en
code
0
github-code
18
[ { "api_name": "NetUtils.NetUtils", "line_number": 7, "usage_type": "name" }, { "api_name": "keras.applications.MobileNetV3Large", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.models.Sequential", "line_number": 14, "usage_type": "call" }, { "api_...
10050883988
import matplotlib.pyplot as plt import numpy as np class Environment(): # constructor function def __init__(self, water, air): self.water = water # water temperature self.air = air # air temperature self.dt = water - air #temperature difference between water and air ...
LucaChot/HydroponicsAI
Simulation_heat_map.py
Simulation_heat_map.py
py
4,235
python
en
code
2
github-code
18
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 142, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 142, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 145, "usage_type": "call" }, { "api_name...
75094360039
import os from io import StringIO import numpy as np from Bio.Blast import NCBIXML from Bio.Blast.Applications import NcbiblastpCommandline from config.config import DBConfig from model_processor.data_processor import ModelProcessor from search.search_processor import SearchProcessor class SearchBlast(object): d...
protdb/ABBNet
search/blast.py
blast.py
py
3,628
python
en
code
0
github-code
18
[ { "api_name": "config.config.DBConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "model_processor.da...
1126109765
import argparse import logging import os import numpy as np import math, copy, time import torch from torch import nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data.sampler import RandomSampler from tqdm import tqdm from IPython import embed from itertools import chain import tor...
JL-tong/PDTrans
train.py
train.py
py
12,941
python
en
code
5
github-code
18
[ { "api_name": "matplotlib.use", "line_number": 23, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 29, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "argparse.ArgumentPar...
71144924199
import torch import torch.nn as nn import torchvision.models as models import numpy as np import torchvision.transforms as transforms from PIL import Image import time import bioval.utils.gpu_manager as gpu_manager import bioval.utils.distance as distance import bioval.utils.aggregation as aggregation from scipy.stats...
IhabBendidi/bioval
bioval/metrics/conditional_evaluation.py
conditional_evaluation.py
py
46,799
python
en
code
18
github-code
18
[ { "api_name": "bioval.utils.distance.get_distance_functions", "line_number": 56, "usage_type": "call" }, { "api_name": "bioval.utils.distance", "line_number": 56, "usage_type": "name" }, { "api_name": "bioval.utils.distance.get_distributed_distance_functions", "line_number": ...
70202657641
# 导入需要的库 import numpy as np import torch import torch.nn as nn import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import warnings from scipy.stats import norm, skew # 导入封装好的模型算法 from sklearn.linear_model import LogisticRegression from sklearn import tree from sklearn.neighbors import KNeighborsC...
TheWangYang/kaggle_competitions_github
spaceship_titanic/pipeline_code.py
pipeline_code.py
py
11,779
python
en
code
2
github-code
18
[ { "api_name": "warnings.warn", "line_number": 35, "usage_type": "attribute" }, { "api_name": "pandas.set_option", "line_number": 38, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.read_csv"...
19614288602
import music21 import numpy as np import matplotlib.pyplot as plt import mido import csv import IPython.display as ipd import midi2audio import glob from convertVector import convertVector class xmlLoader(convertVector): DIR = "" def __init__(self, dir) : print("Welcome to XMLoader") self.DIR =...
Ayato964/MelodiesGenerator
convertXMLToVector.py
convertXMLToVector.py
py
2,648
python
en
code
0
github-code
18
[ { "api_name": "convertVector.convertVector", "line_number": 11, "usage_type": "name" }, { "api_name": "glob.glob", "line_number": 24, "usage_type": "call" }, { "api_name": "music21.converter.parse", "line_number": 26, "usage_type": "call" }, { "api_name": "music21...
37439721724
import uuid import matplotlib as mpl import pydot from matplotlib import pyplot as plt mpl.use('Agg') def get_root(tree): for s in tree.keys(): if s.parent is None: return s def s2node(s, tree): if s in tree.keys(): # return pydot.Node(str(uuid.uuid4()),label='n='+str(tree[s].n...
mushi333/2021-FIT4003-SBSE-for-self-driving-cars
ast_toolbox/utils/tree_plot.py
tree_plot.py
py
2,131
python
en
code
4
github-code
18
[ { "api_name": "matplotlib.use", "line_number": 7, "usage_type": "call" }, { "api_name": "pydot.Node", "line_number": 19, "usage_type": "call" }, { "api_name": "uuid.uuid4", "line_number": 19, "usage_type": "call" }, { "api_name": "pydot.Edge", "line_number": 3...
2307143333
import numpy as np from gym import spaces import tensorflow as tf high = [np.finfo(np.float32).max, np.finfo(np.float32).max] low = [0, 0] high = np.array(high) low = np.array(low) observation_space = spaces.Box(low, high) print(observation_space.shape[-1]) a = [[128, 10]] print(np.array(a).reshape([-1, observation_sp...
h10666/DDPG-Simulator
Algorithm/Test.py
Test.py
py
336
python
en
code
0
github-code
18
[ { "api_name": "numpy.finfo", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 5, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_numbe...
11201614879
""" Game server manager for Phagocytes This is used to handle the creation on the fly of new server instance to allow multiple games to be run at the same time """ import multiprocessing import subprocess import atexit import os import requests import sys from flask import Flask, request, jsonify __author__ = "Be...
BenjaminSchubert/HEIG_2016_GEN_project
game_server/phagocyte_game_manager.py
phagocyte_game_manager.py
py
5,061
python
en
code
0
github-code
18
[ { "api_name": "flask.Flask", "line_number": 29, "usage_type": "name" }, { "api_name": "multiprocessing.cpu_count", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 63, "usage_type": "call" }, { "api_name": "multiprocessing.c...
75311551400
# to draw a bar graph import matplotlib.pyplot as plt x=[1,2,3,4,5,6] y=[12,34,22,10,45,21] tick_label=['one','two','three','four','five','six'] plt.bar(x,y,tick_label=tick_label,color=['green','blue'],width=.7) plt.xlabel("x-axis") plt.ylabel("y-axis") plt.title('bar-graph') plt.show()
goswamiprashant/Machine-Learning
matplotlib_4.py
matplotlib_4.py
py
298
python
en
code
0
github-code
18
[ { "api_name": "matplotlib.pyplot.bar", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.xlabel", "line_number": 8, "usage_type": "call" }, { "api_name": "matplot...
38352747976
github_storage = "https://raw.githubusercontent.com/FacultadInformatica-LinkedData/Curso2020-2021/master/Assignment4" """Leemos el fichero RDF de la forma que lo hemos venido haciendo""" from rdflib import Graph, Namespace, Literal from rdflib.namespace import RDF, RDFS g = Graph() g.namespace_manager.bind('ns', Name...
FacultadInformatica-LinkedData/Curso2022-2023-ODKG
Assignment4/henribfe-220872/task07.py
task07.py
py
2,939
python
en
code
4
github-code
18
[ { "api_name": "rdflib.Graph", "line_number": 7, "usage_type": "call" }, { "api_name": "rdflib.Namespace", "line_number": 8, "usage_type": "call" }, { "api_name": "rdflib.Namespace", "line_number": 9, "usage_type": "call" }, { "api_name": "rdflib.Namespace", "l...
41873629895
""" test Data Loaders """ import os from collections import namedtuple from AGCN.utils.data_loader import PointcloudLoader, SMILESLoader, ImageCIFARLoader, ImageFashionLoader import time class LoaderTester(object): """ abstract class for tester, include basic functions and members """ def __init__(sel...
uta-smile/Adaptive-Graph-Convolutional-Network
utils/data_loader/test.py
test.py
py
6,205
python
en
code
20
github-code
18
[ { "api_name": "AGCN.utils.data_loader.PointcloudLoader", "line_number": 26, "usage_type": "call" }, { "api_name": "AGCN.utils.data_loader.PointcloudLoader", "line_number": 32, "usage_type": "argument" }, { "api_name": "AGCN.utils.data_loader.SMILESLoader", "line_number": 48, ...
9768896673
# 自己的简单使用 from redisbloom.client import Client,Pipeline import redis from datetime import datetime,timedelta import time PRODUCT_WAIT = "product_wait" #产品监控采集等待队列,储存asin码,过滤reveiw,rank和上架日期 PRODUCT_FILTER = 'product_filter' #产品监控已采集过滤,redis zset,需要设置过期时间 1天 SELLER_WAIT = "seller_wait" #卖家id信息采集等待队列, SELLER_FILTER = '...
iii706/examazon
bloomfilter.py
bloomfilter.py
py
2,945
python
en
code
1
github-code
18
[ { "api_name": "redis.ConnectionPool", "line_number": 17, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 18, "usage_type": "call" }, { "api_name": "time.mktime", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime.now", ...
7766358449
from typing import Optional from enum import Enum from pydantic import BaseModel, Field from fastapi import FastAPI from fastapi import Body, Query, Path app = FastAPI() # Models class HairColor(Enum): white = "White" black = "Black" red = "Red" class Person(BaseModel): first_name: str = Field( ...
krojasalfaro7/fastapi-developments
hello-world/main.py
main.py
py
1,815
python
en
code
0
github-code
18
[ { "api_name": "fastapi.FastAPI", "line_number": 9, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 14, "usage_type": "name" }, { "api_name": "pydantic.BaseModel", "line_number": 20, "usage_type": "name" }, { "api_name": "pydantic.Field", "lin...
32003912195
import logging import os import os.path as osp import time import numpy as np import torch from detectron2.checkpoint import PeriodicCheckpointer from detectron2.data import MetadataCatalog from detectron2.data.common import AspectRatioGroupedDataset from detectron2.utils.events import EventStorage from loguru import ...
KhiemPhi/Pose-Trans
explore_models.py
explore_models.py
py
21,974
python
en
code
0
github-code
18
[ { "api_name": "logging.getLogger", "line_number": 37, "usage_type": "call" }, { "api_name": "core.utils.my_comm.get_world_size", "line_number": 72, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 73, "usage_type": "call" }, { "api_name": ...
6122327364
# This Python file uses the following encoding: utf-8 from PySide6 import QtWidgets, QtCharts, QtGui, QtCore class GraphsWidget(QtWidgets.QWidget): def __init__(self, rows, columns): super(GraphsWidget, self).__init__() self.graphGrid = QtWidgets.QGridLayout() self.charts = {} ...
StRom42/PhysicsVerticalJump
GraphsWidget.py
GraphsWidget.py
py
1,709
python
en
code
0
github-code
18
[ { "api_name": "PySide6.QtWidgets.QWidget", "line_number": 5, "usage_type": "attribute" }, { "api_name": "PySide6.QtWidgets", "line_number": 5, "usage_type": "name" }, { "api_name": "PySide6.QtWidgets.QGridLayout", "line_number": 9, "usage_type": "call" }, { "api_n...
5683685303
# 按照平均IoU排序 import numpy as np import os import time import pytz def readIOU(path): mIoU={} i=0 for folder in os.listdir(path): f = open(path+'/'+folder+'/index.txt') modelName = ((f.readline()).split(':')[1]).split('\n')[0] submitter = ((f.readline()).split(':')[1]).split(...
Vaczzy/ATeamName-GeoxSegCompetiton
support/sortmIOU.py
sortmIOU.py
py
1,430
python
en
code
4
github-code
18
[ { "api_name": "os.listdir", "line_number": 9, "usage_type": "call" }, { "api_name": "time.time", "line_number": 33, "usage_type": "call" }, { "api_name": "pytz.timezone", "line_number": 34, "usage_type": "call" }, { "api_name": "pytz.datetime.datetime.fromtimestam...
24772519620
from ...core.qt import QtCore, QtGui, QtPrintSupport, QtWidgets from camelot.admin.action import ( ActionStep, DocumentActionGuiContext ) from camelot.admin.action.document_action import EditDocument from camelot.core.templates import environment from camelot.view.action_steps.open_f...
Platanen/camelot
camelot/view/action_steps/print_preview.py
print_preview.py
py
9,598
python
en
code
null
github-code
18
[ { "api_name": "core.qt.QtPrintSupport.QPrintPreviewDialog", "line_number": 11, "usage_type": "attribute" }, { "api_name": "core.qt.QtPrintSupport", "line_number": 11, "usage_type": "name" }, { "api_name": "core.qt.QtWidgets.QToolBar", "line_number": 26, "usage_type": "att...