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
7349321214
import asyncio import configargparse import logging import json from dotenv import load_dotenv load_dotenv() SPECIAL_SYMBOLS_FOR_MARKING_END_OF_MESSAGE = '\n\n' async def main(args): reader, writer = await asyncio.open_connection(args.host, args.port) try: await connect_to_chat(args, reader, writer)...
KhorinVitaly/underground-chat-cli
minechat_client.py
minechat_client.py
py
3,617
python
ru
code
0
github-code
71
[ { "api_name": "dotenv.load_dotenv", "line_number": 6, "usage_type": "call" }, { "api_name": "asyncio.open_connection", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 48, "usage_type": "call" }, { "api_name": "json.loads", ...
37366592926
import mySURF import pandas as pd import numpy as np from sklearn.cluster import KMeans import matplotlib.pyplot as plt import cv2 def getX(goodMatchePoints,k1,k2): XList=[];YList=[] for i in goodMatchePoints: left_id=i.queryIdx right_id=i.trainIdx xl=int(k1[left_id].pt[0]) yl=...
hamham223/PRP40-Binocular-camera
Hamster/Week_23/kmeans.py
kmeans.py
py
1,648
python
en
code
1
github-code
71
[ { "api_name": "mySURF.goodMatchePoints", "line_number": 23, "usage_type": "attribute" }, { "api_name": "mySURF.k1", "line_number": 23, "usage_type": "attribute" }, { "api_name": "mySURF.k2", "line_number": 23, "usage_type": "attribute" }, { "api_name": "sklearn.cl...
42623541475
import datetime from prac_07.project import Project MENU = " - (L)oad projects\n - (S)ave projects\n - (D)isplay projects\n - (F)ilter projects by date\n" \ " - (A)dd new project\n - (U)pdate project\n - (Q)uit" FILENAME = "project.txt" INDEX_NAME = 0 INDEX_START_DATE = 1 INDEX_PRIORITY = 2 INDEX_COST_ESTIMATE ...
jcoggan/Pracs
prac_07/project_mangement.py
project_mangement.py
py
4,483
python
en
code
0
github-code
71
[ { "api_name": "datetime.datetime.strptime", "line_number": 52, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 52, "usage_type": "attribute" }, { "api_name": "prac_07.project.Project", "line_number": 55, "usage_type": "call" }, { "api_nam...
24255726429
import sys from PyQt5.QtCore import pyqtSignal, QObject class Controller(QObject): addAlbum = pyqtSignal(list) # connected in GalleryPage albumSwitch = pyqtSignal(str) # connected in GalleryPage loadThumbnails = pyqtSignal(str) # connected in ThumbnailsLoader, emit in ImageThumbnailTile loadingBre...
WittmannD/gallery
utils/controller.py
controller.py
py
862
python
en
code
1
github-code
71
[ { "api_name": "PyQt5.QtCore.QObject", "line_number": 5, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 6, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 7, "usage_type": "call" }, { "api_name": "PyQ...
20075692573
from pip import List class Solution: def searchMatrix(self, matrix: List[List[int]], target: int) -> bool: if not matrix: return False row = 0 col = len(matrix[0]) - 1 while row <= len(matrix) - 1 and col >= 0: if target == matrix[row][col]: r...
Parksoonil/python
PAI/Search_a_2D.py
Search_a_2D.py
py
1,082
python
en
code
0
github-code
71
[ { "api_name": "pip.List", "line_number": 4, "usage_type": "name" }, { "api_name": "pip.List", "line_number": 17, "usage_type": "name" } ]
23926061643
import datetime import networkx as nx import ifcopenshell.api import ifcopenshell.util.date import ifcopenshell.util.sequence class Usecase: def __init__(self, file, work_schedule=None): """Calculate the critical path and floats for a work schedule This implements critical path analysis, using th...
IfcOpenShell/IfcOpenShell
src/ifcopenshell-python/ifcopenshell/api/sequence/recalculate_schedule.py
recalculate_schedule.py
py
22,660
python
en
code
1,412
github-code
71
[ { "api_name": "networkx.DiGraph", "line_number": 94, "usage_type": "call" }, { "api_name": "ifcopenshell.api.util.date.ifc2datetime", "line_number": 114, "usage_type": "call" }, { "api_name": "ifcopenshell.api.util", "line_number": 114, "usage_type": "attribute" }, { ...
10399652278
#!/usr/bin/python2 import smtplib import sys from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText def sendError(recipient, reportURL): SMTP_SERVER = 'smtp.gmail.com' SMTP_PORT = 587 sender = 'info@greenpangia.com' secret = 'temp9999' subject = "An error happen in SBS/Pa...
jortizcs/Pangia
sbs/reportError.py
reportError.py
py
1,133
python
en
code
0
github-code
71
[ { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 20, "usage_type": "call" }, { "api_name": "email.mime.text.MIMEText", "line_number": 36, "usage_type": "call" }, { "api_name": "smtplib.SMTP", "line_number": 40, "usage_type": "call" }, { "api_name...
25406140079
""" This module provides plotting support in iPython. """ from functools import wraps import matplotlib.pyplot as plt __all__ = ['peek_show', "axis_labels_from_ctype"] def peek_show(func): """ A decorator to place on ``peek()`` methods to show the figure. The ``peek()`` method should return the figure ...
StanczakDominik/sunpy
sunpy/visualization/visualization.py
visualization.py
py
1,486
python
en
code
null
github-code
71
[ { "api_name": "matplotlib.pyplot.show", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "functools.wraps", "line_number": 19, "usage_type": "call" } ]
73163014949
import unittest from pathlib import Path from automationv3.framework.testcase import EdnTestCase from automationv3.database import db from automationv3.requirements.models import Requirement edn_text = ''' " ========= The Title ========= Requirements ------------ 1. :req:`R1` 2. :req:`R2` " " Steps ----- " (Wait 1...
fillet54/automation-v3
test/test_testcase.py
test_testcase.py
py
1,730
python
en
code
0
github-code
71
[ { "api_name": "unittest.TestCase", "line_number": 30, "usage_type": "attribute" }, { "api_name": "automationv3.requirements.models.Requirement.metadata.create_all", "line_number": 33, "usage_type": "call" }, { "api_name": "automationv3.requirements.models.Requirement.metadata", ...
22639687494
from collections import Counter from .tiles import grid from .tiles.start import GameWon def process_move(move): move = move.upper() if move == 'N': return (0, 1) if move == 'S': return (0, -1) if move == 'W': return (-1, 0) if move == 'E': return (1, 0) print("M...
gistfoundation/adventuregame-pysheff
agps/__init__.py
__init__.py
py
938
python
en
code
1
github-code
71
[ { "api_name": "collections.Counter", "line_number": 20, "usage_type": "call" }, { "api_name": "tiles.grid", "line_number": 25, "usage_type": "name" }, { "api_name": "tiles.grid", "line_number": 29, "usage_type": "name" }, { "api_name": "tiles.start.GameWon", "...
38985771093
import math from typing import Optional, Tuple, Union import torch import torch.nn.functional as F from torch import Tensor from torch_sparse import SparseTensor from torch.nn import Sequential, ReLU, BatchNorm1d from torch_geometric.nn.conv import MessagePassing from torch_geometric.nn.dense.linear import Linear fr...
yininghase/multiagent-collision-mining
u_attention_conv.py
u_attention_conv.py
py
8,297
python
en
code
0
github-code
71
[ { "api_name": "torch.nn", "line_number": 18, "usage_type": "attribute" }, { "api_name": "torch_geometric.nn.dense.linear.Linear", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn.BatchNorm1d", "line_number": 25, "usage_type": "call" }, { "api_nam...
18681331068
from .astronomy_object_type import AstronomyObjectType from .astronomy_day import AstronomyDay from .astronomy_current import AstronomyCurrent from libtad.common.exceptions import MalformedXMLException import xml.etree.ElementTree as ET from typing import List class AstronomyObjectDetails: """ A class used to ...
timeanddate/libtad-python
libtad/datatypes/astro/astronomy_object_details.py
astronomy_object_details.py
py
1,758
python
en
code
4
github-code
71
[ { "api_name": "xml.etree.ElementTree.Element", "line_number": 33, "usage_type": "attribute" }, { "api_name": "xml.etree.ElementTree", "line_number": 33, "usage_type": "name" }, { "api_name": "astronomy_object_type.AstronomyObjectType", "line_number": 34, "usage_type": "na...
33028394872
import json, re, random def preprocess_input(input_text): # Tokenize and preprocess the input by converting to lowercase and removing punctuation return re.sub(r'[^\w\s]', '', input_text.lower()).split() def identify_intent(input_tokens, intents_data): # Iterate through each intent and its patterns...
AnakinSkywalk18/PythonAnywhere
mysite/chatbotFiles/chatbot.py
chatbot.py
py
3,140
python
en
code
0
github-code
71
[ { "api_name": "re.sub", "line_number": 5, "usage_type": "call" }, { "api_name": "json.load", "line_number": 21, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 62, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 74, ...
12572747227
import sys sys.path.append('/home/frth/notebooks') import fpmodules as fp import fpmodules.tools as fk feature_id = list(fk.get_feature_ids().values()) import sys from fplearn.processing import mlready_data, compile_process_segmented_data from fplearn.run import run_model, evaluate_model from fplearn.tsne import TSN...
datofauna/classifiers
classifiers/pollen_beetle/pollen_beetle_model.py
pollen_beetle_model.py
py
3,127
python
en
code
0
github-code
70
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "fpmodules.tools.get_feature_ids", "line_number": 7, "usage_type": "call" }, { "api_name": "fpmodules....
42567696990
from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.model_pruning.python import pruning from tensorflow.python.ops import control_flow_ops from tensorflow.python.training import moving_averages import tensorflow as tf import argparse impo...
sirius-ai/MobileFaceNet_TF
nets/L_Resnet_E_IR.py
L_Resnet_E_IR.py
py
10,131
python
en
code
411
github-code
71
[ { "api_name": "tensorflow.pad", "line_number": 39, "usage_type": "call" }, { "api_name": "tensorflow.pad", "line_number": 43, "usage_type": "call" }, { "api_name": "tensorflow.get_variable", "line_number": 66, "usage_type": "call" }, { "api_name": "tensorflow.cons...
36829364872
from dataclasses import dataclass, field from nonebot import get_driver # from nonebot.rule import to_me from nonebot.params import CommandArg, RawCommand from nonebot.matcher import Matcher from nonebot.adapters.onebot.v11 import Message, MessageSegment from nonebot.plugin import on_command import datetime from time i...
cubicYYY/ybot
plugins/hanakotoba/__init__.py
__init__.py
py
17,827
python
ja
code
0
github-code
71
[ { "api_name": "nonebot.get_driver", "line_number": 20, "usage_type": "call" }, { "api_name": "config.Config.parse_obj", "line_number": 21, "usage_type": "call" }, { "api_name": "config.Config", "line_number": 21, "usage_type": "name" }, { "api_name": "os.path.dirn...
31902767061
import torch import numpy as np import tenseal as ts from PIL import Image import copy import pdb def ServerInference(enc_model, x_enc, windows_nb, kernel_shape, stride): # Encrypted evaluation enc_output = enc_model(x_enc, windows_nb) return enc_output def train_acc(output, target): class_correct = l...
Drenches/Homomorphic-HalfFed
utils.py
utils.py
py
2,638
python
en
code
0
github-code
71
[ { "api_name": "torch.max", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.squeeze", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 32, ...
18730824381
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'Jonathan Chen' __date__ = '2019-09-10' ''' 获取 user 配置信息 ''' import os import sys import time import datetime import paramiko import telnetlib import getpass import smtplib from datetime import date from configparser import ConfigParser from...
OldJohn86/godstock
demo/cfg.py
cfg.py
py
2,610
python
en
code
0
github-code
71
[ { "api_name": "configparser.ConfigParser", "line_number": 29, "usage_type": "call" }, { "api_name": "email.mime.multipart.MIMEMultipart", "line_number": 51, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 52, "usage_type": "call" }, { "...
14356203809
from pyspark.sql import functions as F, SparkSession from utils import create_table_ddl, format_date, apply_masking, get_column_valid_vals from pyspark.sql.types import StringType, DoubleType, IntegerType def process(spark, source_path, target_path, target_schema, table_name, table_schema, merge_key, cdc_key, timestm...
yasfaw/pistevo_decision
scripts/process.py
process.py
py
4,184
python
en
code
0
github-code
71
[ { "api_name": "utils.create_table_ddl", "line_number": 24, "usage_type": "call" }, { "api_name": "utils.apply_masking", "line_number": 37, "usage_type": "call" }, { "api_name": "pyspark.sql.functions.lit", "line_number": 41, "usage_type": "call" }, { "api_name": "...
25142258970
from flask import Flask import random app = Flask(__name__) number = 0 @app.route('/') def home(): global number number = random.randint(0,9) html = """ <center> <h1>Guess a number between 0 and 9</h1> <br> <img src='https://media.giphy.com/media/3o7aCSPqXE5C6T8tBC/giphy.gif' width='200...
marcelo-gs/100DaysOfCode_Python
Day055/server.py
server.py
py
936
python
en
code
0
github-code
71
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 13, "usage_type": "call" } ]
32514518696
from discord.ext import commands categories = [ 1004064554780721242 ] class Adventure(commands.Cog): games = {} async def CreateGame( self, ctx ): if ( ctx.author.id in self.games ): return False c = None for category in ctx.guild.categories: if ( cate...
catornot/Liza
events.py
events.py
py
566
python
en
code
0
github-code
71
[ { "api_name": "discord.ext.commands.Cog", "line_number": 5, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" } ]
40031774987
#Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length. #Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. from typing import List class RemoveDuplicateValuesFromArray: ...
KatthakS/data_structures_in_python
LeetCode_Problems/remove_duplicates.py
remove_duplicates.py
py
738
python
en
code
1
github-code
71
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" } ]
70824109991
import subprocess import argparse from pathlib import Path def submit_experiment_on_slurm(python_script_name, data_dir, experiment_type, argdict): command = "sbatch slurm_job {} {} {}".format( python_script_name, data_dir, experiment_type ) argstring = " ".join( ["--{} {}".format(argname, ...
a-arbabi/learn2lpa
run_all_experiments_on_slurm.py
run_all_experiments_on_slurm.py
py
4,261
python
en
code
0
github-code
71
[ { "api_name": "subprocess.Popen", "line_number": 15, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 35, "usage_type": "call" }, { "api_name": "pathlib.Path", ...
28588445047
import PIL.Image as Image import os, sys mw = 133 # 图片大小+图片间隔 ms = 5 msize = mw * ms fpre = "x" #图片前缀 toImage = Image.new('RGBA', (msize, msize)) for y in range(1, 6): ## 先试一下 拼一个5*5 的图片 for x in range(1, 6): # 之前保存的图片是顺序命名的,x_1.jpg, x_2.jpg ... fname = "x_%s.jpg" % (ms*(y-1)+x) ...
littlesnail0/LittleSnail
tell_my_feeling_about_you/test.py
test.py
py
626
python
en
code
0
github-code
71
[ { "api_name": "PIL.Image.new", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 11, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number":...
8211009006
import reader import argparse parser = argparse.ArgumentParser(description='Parse OAM data.') parser.add_argument('offsets', metavar='offsets', type=str, nargs='+', help='offsets of OAM data') args = parser.parse_args() def getSigned(x): return (x - 0x100, x)[x < 0x80] def getOAM...
ElectroDeoxys/wl3
tools/oam_extractor.py
oam_extractor.py
py
2,945
python
en
code
1
github-code
71
[ { "api_name": "argparse.ArgumentParser", "line_number": 4, "usage_type": "call" }, { "api_name": "reader.getROMByte", "line_number": 34, "usage_type": "call" }, { "api_name": "reader.getROMByte", "line_number": 35, "usage_type": "call" }, { "api_name": "reader.get...
28754966810
from typing import List class BingoBoard: '''A bingo board''' def __init__(self, rows: List[str]): '''Takes the five rows (in string format) and creates a bingo board.''' self.numbers = [([int(number) for number in row.split()]) for row in rows] self.marked = [([False] * 5) for _ in ra...
nlgilbert/advent_of_code_2021
day04/bingo_board.py
bingo_board.py
py
2,053
python
en
code
0
github-code
71
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" } ]
31283348833
import re import os from bs4 import BeautifulSoup from docx import Document from docx.oxml.ns import qn from docx.shared import Pt from util import util class Field: def __init__(self, name='', type='', dtype='', comment=''): self.name = name self.type = type self.dtype = dtype se...
lukoou3/Toolbox
util/sqlParse.py
sqlParse.py
py
14,083
python
en
code
0
github-code
71
[ { "api_name": "pprint.pprint", "line_number": 39, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 49, "usage_type": "call" }, { "api_name": "re.X", "line_number": 53, "usage_type": "attribute" }, { "api_name": "re.I", "line_number": 53, ...
33087677092
# This is a sample Python script. # Press Shift+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. from openpyxl import Workbook from openpyxl.utils import get_column_letter from openpyxl import load_workbook import PySimpl...
oskarar/Excelproject
main.py
main.py
py
4,033
python
en
code
0
github-code
71
[ { "api_name": "openpyxl.load_workbook", "line_number": 16, "usage_type": "call" }, { "api_name": "openpyxl.Workbook", "line_number": 22, "usage_type": "call" }, { "api_name": "openpyxl.utils.get_column_letter", "line_number": 40, "usage_type": "call" }, { "api_nam...
33828137154
# coding: utf-8 # In[220]: import pandas as pd import numpy as np from keras.models import Sequential from keras.layers import Dense, Dropout from keras import backend as K from pylab import * from sklearn import linear_model from sklearn.model_selection import train_test_split, StratifiedKFold from sklearn.neighbo...
vampiirre/case
ML.py
ML.py
py
13,421
python
en
code
0
github-code
71
[ { "api_name": "pandas.read_csv", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 33, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 49, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
27037969401
import geopandas import libpysal import numpy import pandas import spopt from spopt.region import RegionKMeansHeuristic import warnings import matplotlib.pyplot as plt import geopandas as gpd dim1 = 4 dim2 = 4 w = libpysal.weights.lat2W(dim1, dim2) w.n noclusters = 5 RANDOM_SEED = 12345 numpy.random....
olivierdeforche/GEP
Clustering/tests/test_kmeansregions.py
test_kmeansregions.py
py
2,487
python
en
code
0
github-code
71
[ { "api_name": "libpysal.weights.lat2W", "line_number": 14, "usage_type": "call" }, { "api_name": "libpysal.weights", "line_number": 14, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy....
5928334192
#!/usr/bin/env python import pika import time import threading # Consumer - odbiera zlecenia # Dostawca posiada liste dostepnych produktow # 1. dostawca -> klucze: tlen, buty; 2. dostawca -> klucze: tlen, plecak # zlecenia identyfikowane sa przez nazwe Teamu oraz wewnetrzny # numer zlecenia nadany przez Suppliera o...
magdalena-b/systemy-rozproszone
homework_2/supplier.py
supplier.py
py
3,426
python
en
code
0
github-code
71
[ { "api_name": "time.sleep", "line_number": 30, "usage_type": "call" }, { "api_name": "pika.BasicProperties", "line_number": 37, "usage_type": "call" }, { "api_name": "pika.BlockingConnection", "line_number": 46, "usage_type": "call" }, { "api_name": "pika.Connecti...
15953375170
import json class Book(object): def __init__(self, isbn, titlu, editura, an_publicare, gen_literar): self.isbn = isbn self.titlu = titlu self.editura = editura self.an_publicare = an_publicare self.gen_literar = gen_literar def toJSON(self): return json.dumps(se...
RaduAndrei99/BookStoreDigital
DTOs/book.py
book.py
py
392
python
ro
code
0
github-code
71
[ { "api_name": "json.dumps", "line_number": 12, "usage_type": "call" } ]
31719957437
import numpy as np import re from utils.latin_bert.latin_bert import LatinBERT from funcy import flatten import torch def get_nth_key(dictionary, n=0): if n < 0: n += len(dictionary) for i, key in enumerate(dictionary.keys()): if i == n: return key raise IndexError("dictionary i...
sebastian-nehrdich/latin-parser
parser/utils/load_bert_embeddings.py
load_bert_embeddings.py
py
2,448
python
en
code
0
github-code
71
[ { "api_name": "torch.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.from_numpy", "line_number": 25, "usage_type": "call" }, { "api_name": "utils.latin_bert.latin_bert.LatinBERT", "line_number": 35, "usage_type": "call" }, { "api_name": "re...
9313664314
import pytest from pytest_rally.elasticsearch import TestCluster from pytest_rally.rally import Rally @pytest.fixture(scope="module") def distribution_version(request): return request.config.option.distribution_version @pytest.fixture(scope="module") def revision(request): return request.config.option.revisi...
elastic/pytest-rally
pytest_rally/fixtures.py
fixtures.py
py
797
python
en
code
0
github-code
71
[ { "api_name": "pytest.fixture", "line_number": 6, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 10, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 14, "usage_type": "call" }, { "api_name": "pytest_rally.elasticsearc...
70216946471
"""範例使用datetime顯示時間""" from datetime import date,timedelta # today = date.today() # for i in range(1,10): # today = today + timedelta(days=1) # dayary = (str(today).split('-')) # print ('-'.join([str(int(dayary[0])-1911),dayary[1],dayary[2]])) #抓取到當日時間 today = date.today() #顯示10筆日期 for i in range(1,10): #範圍取0~9...
royroyroy010/royTEST
Selenium/使用datetime_顯示時間.py
使用datetime_顯示時間.py
py
642
python
en
code
0
github-code
71
[ { "api_name": "datetime.date.today", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 17, "usage_type": "call" } ]
73700260068
# -*- coding: utf-8 -*- import requests import time #変数初期化 baseurl = "http://www1.mbrace.or.jp/od2/B/" url = "" file_name = "" year = 0 mon = 0 first = "" second = "" day = 0 #20XXのXの部分を入れる 例:2002 -2017なら2と18 for year in range(2,18): print() for mon in range(1,13): for day in range(1,32): time.sleep(1) ...
cstenmt/boatrace
download_timetable.py
download_timetable.py
py
966
python
en
code
16
github-code
71
[ { "api_name": "time.sleep", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" } ]
16889551663
# -*- coding: utf-8 -*- # @Author : Zhang # @Email : zl16035056@163.com # @File : dataloader.py import torch from torchvision import datasets, transforms def loader(name): print('Using MNIST dataset!\n') if name == 'MNIST': train_dataloader = datasets.MNIST(root='~/data', train=True, download=False,...
Turningl/fedavg_pytorch
utils/dataloader.py
dataloader.py
py
883
python
en
code
6
github-code
71
[ { "api_name": "torchvision.datasets.MNIST", "line_number": 14, "usage_type": "call" }, { "api_name": "torchvision.datasets", "line_number": 14, "usage_type": "name" }, { "api_name": "torchvision.transforms.ToTensor", "line_number": 14, "usage_type": "call" }, { "a...
40155310460
import pika connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) channel = connection.channel() channel.queue_declare(queue='celery') def callback(ch, method, properties, body): print(" [x] Received %r" % body) channel.basic_consume(callback, queue='celery', ...
poplingue/lameufquijouedans
lameufquijouedans/consumer/consumer.py
consumer.py
py
433
python
en
code
1
github-code
71
[ { "api_name": "pika.BlockingConnection", "line_number": 3, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 3, "usage_type": "call" } ]
29454240287
from datetime import datetime from discord.ui import View, button, Button from discord import Interaction, ButtonStyle, Embed from .ticket_processor import TicketProcessor from .modals_classes import NormalTicketModal, CollaborativeTicketModal from utils.utils import save_data class TicketMenuView(View): ticket_p...
Sometimesfunny/discord_tickets_bot
tickets/buttons_views.py
buttons_views.py
py
6,076
python
en
code
0
github-code
71
[ { "api_name": "discord.ui.View", "line_number": 8, "usage_type": "name" }, { "api_name": "ticket_processor.TicketProcessor", "line_number": 10, "usage_type": "name" }, { "api_name": "discord.Interaction", "line_number": 17, "usage_type": "name" }, { "api_name": "m...
15633041811
import pathlib from typing import Union import logging from ultralytics import YOLO import numpy as np logger = logging.getLogger(__name__) # Reference: https://tech.amikelive.com/node-718/what-object-categories-labels-are-in-coco-dataset/ COCO_ORIGINAL_NAMES = [ "person", "bicycle", "car", "motorcyc...
oele-isis-vanderbilt/ETTK
ettk/processing/seg_tracker.py
seg_tracker.py
py
2,621
python
en
code
0
github-code
71
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 99, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 99, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "l...
38217248902
from starflow.utils import ListUnion import copy from bson import SON from model_categories import MODEL_CATEGORIES as CAT all_models = ListUnion(CAT.values()) extraction = SON([ ('transform_average',SON([('transform_name','translation'),('percentile',[73,90,99])])), ('query',SON...
yamins81/v1framework
config/trans_inrot_extraction_percentile.py
trans_inrot_extraction_percentile.py
py
1,063
python
en
code
1
github-code
70
[ { "api_name": "starflow.utils.ListUnion", "line_number": 9, "usage_type": "call" }, { "api_name": "model_categories.MODEL_CATEGORIES.values", "line_number": 9, "usage_type": "call" }, { "api_name": "model_categories.MODEL_CATEGORIES", "line_number": 9, "usage_type": "name...
2724638429
import cv2 import numpy as np import simpleaudio as sa # Load sound files c4_wave_obj = sa.WaveObject.from_wave_file('c4.wav') d4_wave_obj = sa.WaveObject.from_wave_file('d4.wav') e4_wave_obj = sa.WaveObject.from_wave_file('e4.wav') f4_wave_obj = sa.WaveObject.from_wave_file('f4.wav') g4_wave_obj = sa.WaveObject.from_...
tuna0426/py
pytoadV1.py
pytoadV1.py
py
3,004
python
en
code
0
github-code
71
[ { "api_name": "simpleaudio.WaveObject.from_wave_file", "line_number": 6, "usage_type": "call" }, { "api_name": "simpleaudio.WaveObject", "line_number": 6, "usage_type": "attribute" }, { "api_name": "simpleaudio.WaveObject.from_wave_file", "line_number": 7, "usage_type": "...
10427496470
import pandas as pd import datetime import matplotlib.pyplot as plt import numpy as np import calendar import sys # read files from parent directory. sys.path.append('../../') #from psql_manictime import ManictimeDBConnect from psql_manictime import CalcActivity from psql_manictime import Params_status from psql_manic...
meitosyou/general_plotter
general_plotter.py
general_plotter.py
py
12,438
python
en
code
0
github-code
71
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyp...
23802388982
import os import subprocess import hashlib import openai import json from pathlib import Path # receive email in O365 to check Apache AGE release # Use Power Automate to send email to gpt-3 to extract commit hash and fingerprint # clone and check out commit hash # check fingerprint # if fingerprint matches, then downl...
sorrell/apache_age_release_verification
compare.py
compare.py
py
7,768
python
en
code
0
github-code
71
[ { "api_name": "os.getenv", "line_number": 16, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 18, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 19, ...
70483594467
from dash import Dash, html, dcc import dash_bootstrap_components as dbc from dash import Input, Output, callback from dash.dependencies import Input, Output from datetime import datetime import pandas as pd import plotly.express as px from yahoo_fin.stock_info import * style_input={'width':'14rem','height':'2rem','b...
tingatdallas/stock-dashboard-dash
pages/page1/layout_6_cash_flow.py
layout_6_cash_flow.py
py
8,788
python
en
code
0
github-code
70
[ { "api_name": "dash_bootstrap_components.Col", "line_number": 71, "usage_type": "call" }, { "api_name": "dash.html.H5", "line_number": 72, "usage_type": "call" }, { "api_name": "dash.html", "line_number": 72, "usage_type": "name" }, { "api_name": "dash.html.Div", ...
13962664768
from unicodedata import name from unittest import result import pymysql connection = pymysql.connect( host="localhost", user="root", password="password", db="dummy" ) cursor = connection.cursor() select_query = "select * from employee" try: cursor.execute(select_query) results = cursor.fetch...
leducthanguet/aws-server
rds/pymysql/read_record.py
read_record.py
py
547
python
en
code
0
github-code
70
[ { "api_name": "pymysql.connect", "line_number": 5, "usage_type": "call" }, { "api_name": "unicodedata.name", "line_number": 21, "usage_type": "name" }, { "api_name": "unicodedata.name", "line_number": 22, "usage_type": "name" } ]
18728336034
#!/usr/bin/env python3 import math import argparse import random import credb import traceback from multiprocessing import Process from test import * parser = argparse.ArgumentParser() parser.add_argument("--server_port", type=int, default=5042) parser.add_argument("--no_server", action="store_true") parser.add_argume...
kaimast/credb
test/concurrent_call_programs.py
concurrent_call_programs.py
py
1,710
python
en
code
1
github-code
71
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "credb.create_client", "line_number": 40, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 47, "usage_type": "call" }, { "api_name": "m...
12139207848
from airflow import DAG from airflow.operators.python import PythonOperator from airflow.providers.postgres.operators.postgres import PostgresOperator from airflow.providers.postgres.hooks.postgres import PostgresHook from datetime import datetime default_args = { 'owner': 'airflow', 'depends_on_past': False, ...
weastel/airflow-dags
dags/Group_sessions_dag.py
Group_sessions_dag.py
py
6,137
python
en
code
0
github-code
71
[ { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "call" }, { "api_name": "airflow.providers.postgres.hooks.postgres.PostgresHook", "line_number": 23, "usage_type": "call" }, { "api_name": "airflow.DAG", "line_number": 86, "usage_type": "call" }, { ...
18430703772
#!/usr/bin/python import psycopg2 try: connection = psycopg2.connect(database="pivot_db", user="postgres", password="Needajob1", host="database-1-postgres.ctjowhpkuywk.us-east-2.rds.amazonaws.com", ...
borisgarbuzov/project2
lab/python_database/pg_ex.py
pg_ex.py
py
2,685
python
en
code
0
github-code
71
[ { "api_name": "psycopg2.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "psycopg2.Error", "line_number": 64, "usage_type": "attribute" } ]
8329073088
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from src.users.models import User @admin.register(User) class UserAdmin(UserAdmin): list_display = ("username", "email", "is_staff", "is_superuser", "is_active", "is_deleted") list_display_links = ("username"...
aliyanura/TestShop
src/users/admin.py
admin.py
py
1,199
python
en
code
0
github-code
70
[ { "api_name": "django.contrib.admin.register", "line_number": 6, "usage_type": "call" }, { "api_name": "src.users.models.User", "line_number": 6, "usage_type": "argument" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" } ]
71646155428
import pytest from pyspark import SparkContext import os import multiprocessing @pytest.fixture() def eng(): if 'SPARK_HOME' not in os.environ: import pyspark path1 = pyspark.__file__ dir1 = os.path.dirname(path1) parent = os.path.split(dir1)[0] spark_home = os.path.split(p...
boazmohar/pySparkUtils
test/conftest.py
conftest.py
py
648
python
en
code
2
github-code
70
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pyspark.__file__", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "l...
36654853791
from utils import list_graph from collections import deque def is_cycle(node,graph,vis): q = deque([(node,-1)]) vis[node]=1 while q: node,parent = q.popleft() for neighbour in graph[node]: if not vis[neighbour]: vis[neighbour]=1 q.append((neighbo...
quirrelHK/DSA
Graphs/detect_cycle_bfs.py
detect_cycle_bfs.py
py
760
python
en
code
0
github-code
70
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" }, { "api_name": "utils.list_graph", "line_number": 23, "usage_type": "call" } ]
29097497781
## the attack on the genome data from util import Embedder import numpy as np from sklearn.svm import SVC, LinearSVC from sklearn import linear_model import torch import torch.utils.data as data_utils import torch.optim as optim import torch.nn as nn import torch.nn.functional as F from torch.nn import GRU, Embedding, ...
ravenSanstete/bert_privacy
adv_genome_position.py
adv_genome_position.py
py
26,049
python
en
code
3
github-code
71
[ { "api_name": "matplotlib.use", "line_number": 28, "usage_type": "call" }, { "api_name": "seaborn.set", "line_number": 30, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 33, "usage_type": "call" }, { "api_name": "util.Embedder", ...
74395776225
from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import paddle.fluid as fluid from paddle.fluid.param_attr import ParamAttr __all__ = [ "ResNet18_ACNet", "ResNet34_ACNet", "ResNet50_ACNet", "ResNet101_ACNet", "ResNet152_ACNet" ] class ...
gujingxiao/BaiduStar2020-Traffic-Sign-Detection-And-Pair-Competition-Solution
PaddleClas/ppcls/modeling/architectures/resnet_acnet.py
resnet_acnet.py
py
10,546
python
en
code
16
github-code
70
[ { "api_name": "paddle.fluid.layers.pool2d", "line_number": 49, "usage_type": "call" }, { "api_name": "paddle.fluid.layers", "line_number": 49, "usage_type": "attribute" }, { "api_name": "paddle.fluid", "line_number": 49, "usage_type": "name" }, { "api_name": "padd...
37945994614
from multiprocessing import Pool import asyncio import hashlib from datetime import datetime import struct as st from socket import * ANS_TIME_OUT = 10 class Server: MESSAGE_FORMAT = '32sc40sc256s256s' def __init__(self, num_of_processes, listen_port): self.server_online = True self.semaphor...
doprinhas/HackHash
venv/Server.py
Server.py
py
6,000
python
en
code
0
github-code
70
[ { "api_name": "asyncio.Semaphore", "line_number": 16, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 17, "usage_type": "call" }, { "api_name": "struct.unpack", "line_number": 41, "usage_type": "call" }, { "api_name": "struct.unpack", ...
18157897384
from collections import Counter class HocSinh(): def __init__(self): self.maLop = "" self.tenLop = "" self.hoTen = "" self.ngaySinh = "" self.gioiTinh = "" def getMaLop(self): return self.maLop def getTenLop(self): return self.tenLop def getHo...
lequangit99/PyCode
b3_2.py
b3_2.py
py
3,673
python
vi
code
0
github-code
70
[ { "api_name": "collections.Counter", "line_number": 94, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 103, "usage_type": "call" } ]
16302265292
import json import cv2 import math import os import sys import time import numpy as np import traitlets import pickle import socket from PIL import Image import torch import torchvision.transforms as transforms from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler fr...
Huan80805/2022NMlab_final
trt_pose_hand/hand_pose_server_ws.py
hand_pose_server_ws.py
py
4,301
python
en
code
0
github-code
70
[ { "api_name": "json.load", "line_number": 27, "usage_type": "call" }, { "api_name": "trt_pose.coco.coco.coco_category_to_topology", "line_number": 28, "usage_type": "call" }, { "api_name": "trt_pose.coco.coco", "line_number": 28, "usage_type": "attribute" }, { "ap...
12785789774
from setuptools import setup def get_version(filename): """ Parse the value of the __version__ var from a Python source file without running/importing the file. """ import re version_pattern = r"^ *__version__ *= *['\"](\d+\.\d+\.\d+)['\"] *$" match = re.search(version_pattern, open(filena...
ucamhal/jsonlogging
setup.py
setup.py
py
1,495
python
en
code
1
github-code
70
[ { "api_name": "re.search", "line_number": 11, "usage_type": "call" }, { "api_name": "re.MULTILINE", "line_number": 11, "usage_type": "attribute" }, { "api_name": "setuptools.setup", "line_number": 18, "usage_type": "call" } ]
973510108
import requests from pprint import pprint from tqdm import tqdm class FotosYD: def __init__(self, token_YD): self.token = token_YD def get_headers(self): return { "Content-Type": "application/json", "Authorization": "OAuth {}".format(self.token), } def get...
RogiKuchvesh/Reserv_copy_to_YDisk
fotos_to_YD.py
fotos_to_YD.py
py
1,201
python
en
code
0
github-code
70
[ { "api_name": "requests.put", "line_number": 19, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 30, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number...
16765071804
import os from fastapi import FastAPI from fastapi.responses import FileResponse import uvicorn import json app = FastAPI() @app.get("/") async def main(): return FileResponse('img/map.jpg') @app.get("/origin") async def original_img(): return FileResponse('img/out.jpg') @app.get("/slots") async def fre...
ioiein/Parking-free
server/app.py
app.py
py
521
python
en
code
1
github-code
70
[ { "api_name": "fastapi.FastAPI", "line_number": 8, "usage_type": "call" }, { "api_name": "fastapi.responses.FileResponse", "line_number": 13, "usage_type": "call" }, { "api_name": "fastapi.responses.FileResponse", "line_number": 18, "usage_type": "call" }, { "api_...
1673432127
from django.contrib import admin from .models import Curso, Docente # Register your models here. #1 admin.site.register(Curso) @admin.register(Curso) #3 class CursoAdmin(admin.ModelAdmin): #2 y #3 #ordering=('-nombre',) #tupla indicarlo con la coma #ordering=('creditos', 'nombre') #search_fields=('nom...
Sergio395/Universidad_PostgreSQL
Aplicaciones/Academico/admin.py
admin.py
py
1,263
python
es
code
0
github-code
70
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 6, "usage_type": "call" }, { ...
72460971746
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 6 14:01:34 2019 @author: thibault Just Model Architecture of unet """ import numpy as np from keras.layers.convolutional import Conv2D, Conv2DTranspose from keras.layers.pooling import MaxPooling2D from keras.layers.merge import concatenate from ...
thibaulttabarin/UnAxSeg
unet_4_user/utility/Model.py
Model.py
py
2,802
python
en
code
2
github-code
70
[ { "api_name": "keras.layers.convolutional.Conv2D", "line_number": 24, "usage_type": "call" }, { "api_name": "keras.layers.BatchNormalization", "line_number": 25, "usage_type": "call" }, { "api_name": "keras.layers.Activation", "line_number": 26, "usage_type": "call" }, ...
17839944704
import pickle import pypdb as pyp from bioservices import * import networkx as nx import collections import numpy as np import scipy import operator import random import community import matplotlib.pyplot as plt import os # This file contains functions used in the main file or in the mining file. Some f...
tavisreed/CSE416FinalProject
Code/helper_functions.py
helper_functions.py
py
30,535
python
en
code
0
github-code
71
[ { "api_name": "pypdb.get_ligands", "line_number": 56, "usage_type": "call" }, { "api_name": "pypdb.get_ligands", "line_number": 58, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 110, "usage_type": "call" }, { "api_name": "pickle.load", "l...
30821938494
import os import numpy as np import torch import torch.nn as nn from torch.utils.data import DataLoader from torch.utils.tensorboard import SummaryWriter from model import * from dataset import * from util import * import matplotlib.pyplot as plt from torchvision import transforms def train(args): ## 트레이닝 파라메...
hanyoseob/youtube-cnn-005-pytorch-GAN
train.py
train.py
py
10,000
python
en
code
3
github-code
70
[ { "api_name": "numpy.asarray", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 33, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 43, "usage_type": "call" }, { "api_name": "torch.cuda.is_available",...
35831369385
from collections import defaultdict from datetime import date, timedelta from PIL import Image, ImageFont, ImageDraw from os import mkdir from os.path import dirname, join, exists depend_extra = ('coords.txt',) jobs = ('source', 'modelduration', 'sizes', 'totalsize') options = dict(failframes=53) missing_dates = s...
exaxorg/backblaze_animation
movie/a_render.py
a_render.py
py
6,976
python
en
code
2
github-code
70
[ { "api_name": "datetime.date", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.ImageFont.truetype", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.ImageFont", "line_number": 16, "usage_type": "name" }, { "api_name": "os.mkdir", "li...
21942767583
import unittest import threading import traceback from nose.plugins.skip import SkipTest from test.utils import (joinall, remove_all_users, server_started_with_auth, RendezvousThread) from test.test_client import get_client from test.utils import get_pool from pymongo.pool import SocketInfo, _...
Georce/lepus
lepus/pymongo-2.7/test/test_threads.py
test_threads.py
py
11,563
python
en
code
333
github-code
71
[ { "api_name": "threading.Thread", "line_number": 15, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 18, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 18, "usage_type": "attribute" }, { "api_name": ...
39065849605
from collections import Counter t = int(input()) for i in range(t): size = int(input()) array = list(map(int, input().split())) if size == 1: print("-1") else: heights = sorted(Counter(array).items()) for idx in heights: array.append(idx[1]) for idx in array: ...
shantanudwvd/PythonHackerrank
monkbeingmonitor.py
monkbeingmonitor.py
py
361
python
en
code
1
github-code
71
[ { "api_name": "collections.Counter", "line_number": 9, "usage_type": "call" } ]
71053153510
#!/usr/bin/env python3 """ A simple parser for the Enron e-mail corpus """ import argparse import json import matplotlib.pyplot as plt import operator import dateutil.parser import itertools import pandas as pd import numpy as np import networkx as nx from collections import Counter, defaultdict import timeit def pr...
csrhau/sandpit
latex/enron_report/scripts/important_network.py
important_network.py
py
2,197
python
en
code
0
github-code
71
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 20, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 22, "usage_type": "call" }, { "api_name": "json.load...
7973194274
''' # @ Author: Zhi Wu # @ Create Time: 2022-08-09 12:36:35 # @ Modified by: Zhi Wu # @ Modified time: 2022-08-09 12:37:06 # @ Description: Install scripts. ''' import setuptools with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name='HIBERTools', v...
wuzhiwyyx/HIBER
HIBERTools/setup.py
setup.py
py
823
python
en
code
null
github-code
71
[ { "api_name": "setuptools.setup", "line_number": 14, "usage_type": "call" } ]
30060614801
import streamlit as st from bmoderiva import lib from dotenv import load_dotenv import os load_dotenv() df = lib.get_data(os.getenv('REMOBS_TOKEN')) df1 = lib.get_data_bmo(os.getenv('REMOBS_TOKEN')) mapbox_token = os.getenv("MAPBOX_TOKEN") st.write("# BMO-BR DERIVA") st.write(f"## DADO TAG") if df.empty: st.w...
soutobias/bmoderiva
app.py
app.py
py
1,047
python
pt
code
0
github-code
71
[ { "api_name": "dotenv.load_dotenv", "line_number": 6, "usage_type": "call" }, { "api_name": "bmoderiva.lib.get_data", "line_number": 9, "usage_type": "call" }, { "api_name": "bmoderiva.lib", "line_number": 9, "usage_type": "name" }, { "api_name": "os.getenv", ...
6709198242
import pandas as pd import numpy as np import chardet def Random_Time(size): import datetime import time import random end_time=datetime.datetime.now() start_time=datetime.datetime.now() + datetime.timedelta(days=-10) # 当前时间减去3分钟 a1=tuple(start_time.timetuple()[0:9]) #设置开始日期时间元...
ycallenchina/PythonStudy_Git
Pandas学习/pandas实验室.py
pandas实验室.py
py
3,710
python
en
code
0
github-code
71
[ { "api_name": "datetime.datetime.now", "line_number": 12, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 13, "usage_type": "call" }, { "api_name": "da...
22269427831
""" Text-Classify by DeepLearning """ import pandas as pd from tqdm import tqdm from sklearn import preprocessing from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.model_selection import train_test_split from src.utils.word2vec import sent2vec from src.utils.matplot import draw_acc import numpy ...
technologyMz/Text-Classify
src/nn_tc.py
nn_tc.py
py
4,631
python
en
code
1
github-code
71
[ { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 26, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 42, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 45, "usage_type": "ca...
11599811813
import os import shutil from invoke import Collection, task default_venv_python = "python3" precommit_config_basename = ".pre-commit-config.yaml" ignore_revs_basename = ".git-blame-ignore-revs" # setting up some directory paths this_dir = os.path.dirname(os.path.abspath(__file__)) venv_dir = os.path.join(this_dir, "...
ghackebeil/home-energy
tasks.py
tasks.py
py
5,094
python
en
code
1
github-code
70
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line...
43217345529
from email.mime import base from lib2to3.pytree import convert from os import write from requests import request import requests from openpecha.core.ids import get_base_id,get_initial_pecha_id from datetime import datetime from openpecha.core.layer import Layer, LayerEnum from openpecha.core.pecha import OpenPechaFS f...
jungtop/multilingual
create_opf.py
create_opf.py
py
2,354
python
en
code
0
github-code
71
[ { "api_name": "openpecha.core.ids.get_base_id", "line_number": 24, "usage_type": "call" }, { "api_name": "openpecha.core.pecha.OpenPechaFS", "line_number": 26, "usage_type": "call" }, { "api_name": "openpecha.core.layer.LayerEnum.segment", "line_number": 28, "usage_type":...
72030468710
from ultralytics import YOLO from PIL import Image import cv2 import matplotlib.pyplot as plt #load large oiv7 model model = YOLO('./yolov8x-oiv7.pt') #results = model('https://www.americanrifleman.org/media/uman22jj/fn-america-high-power-stainless-steel-f.jpg') results = model('./testimg3.jpg') detection_result =...
lorincm/machine-vision-project
misi_playground/object_detection2.py
object_detection2.py
py
1,182
python
en
code
0
github-code
71
[ { "api_name": "ultralytics.YOLO", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image.fromarray", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 20, "usage_type": "name" }, { "api_name": "cv2.imread", "line_...
19287374525
import numpy as np from .._fiff.pick import _picks_to_idx from ..evoked import Evoked from ..utils import _ensure_int, _validate_type, verbose def _temp_proj(ref_2, ref_1, raw_data, n_proj=6): # Orthonormalize gradiometer and magnetometer data by a QR decomposition ref_1_orth = np.linalg.qr(ref_1.T)[0] r...
mne-tools/mne-python
mne/preprocessing/_css.py
_css.py
py
2,921
python
en
code
2,405
github-code
71
[ { "api_name": "numpy.linalg.qr", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.linalg.qr", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.linalg", ...
8155113402
import pygame # Initialize Pygame pygame.init() # Set up the display window (width, height) screen = pygame.display.set_mode((600, 400)) # Define colors for easier reference later on WHITE = (255, 255, 255) BLACK = (0, 0, 0) # Define the positions of the paddles player1_paddle_x = 20 player1_paddle_y = 200 player2_...
FlamesLLC/TheInfiniteArcade-
PongAI.py
PongAI.py
py
2,510
python
en
code
0
github-code
70
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.display.s...
33672700884
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String Base = declarative_base() class Example(Base): __tablename__ = 'examples' id = Column(Integer, primary_key=True) name = Column(String) def __init__(self, id_, name): self.id = id_ ...
thesnapdragon/python-cli
db/models/example.py
example.py
py
420
python
en
code
0
github-code
71
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 4, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 10, "usage_type": "argument" }, { ...
3715739253
"""Tests the `namespaces` Module. This module provides full unit test coverage for the `namespaces` module, testing all branches of all functions. """ # Standard import argparse # Local from pydantic_argparse import utils def test_namespace_to_dict() -> None: """Tests `utils.namespaces.to_dict` Function.""" ...
SupImDos/pydantic-argparse
tests/utils/test_namespaces.py
test_namespaces.py
py
940
python
en
code
54
github-code
71
[ { "api_name": "pydantic_argparse.utils.namespaces.to_dict", "line_number": 18, "usage_type": "call" }, { "api_name": "pydantic_argparse.utils.namespaces", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pydantic_argparse.utils", "line_number": 18, "usage_ty...
15241595611
from multiprocessing.sharedctypes import Value import torch import torch.nn as nn from torch.nn import functional from transformers import AutoModel, AutoConfig, BertConfig from transformers.models.bert import BertModel # !note leave to modify class InvRNN(nn.Module): """ A RNN-based invariant rationalization...
srhthu/Simple-Trainer
model.py
model.py
py
12,918
python
en
code
2
github-code
71
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "transformers.AutoModel.from_pretrained", "line_number": 37, "usage_type": "call" }, { "api_name": "...
69903042471
from typing import List class Solution: def maxSum(self, nums: List[int], m: int, k: int) -> int: # we definitely need a set to track number of unique elements which will be in current sub # array max_sum, current_sum = 0, 0 window_start = 0 LEN = len(nums) allowed_...
naveen17797/leetcode-py
max-sum-of-almost-unique-subarray/solution.py
solution.py
py
1,031
python
en
code
1
github-code
71
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
74644803429
import bisect import sys import collections def counter_sum(counter): retval = 0 for num, cnt in counter.items(): retval += num * cnt return retval def counter_mul(counter): retval = 1 for num, cnt in counter.items(): retval *= num ** cnt return retval def solve(): M = i...
hepheir/Problem-Solving
Google Coding Competitions/Code Jam/2021/Round 1A/Prime Time/.py
.py
py
1,348
python
en
code
2
github-code
71
[ { "api_name": "sys.stdin.readline", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 20, "usage_type": "attribute" }, { "api_name": "collections.Counter", "line_number": 22, "usage_type": "call" }, { "api_name": "collections.deq...
29284514643
from flask import Flask from flask_restful import Api from flask import request from src.model.model_haarcascade import ModelHaarcascade from src.controller.apis.controller_face_recognizer import ControllerFaceRecognizer from src.controller.apis.controller_machine import ControllerMachineLearning from src.controller.ap...
jpsandovaln/AT16-SKYNET
MACHINE_LEARNING_SERVICE/main.py
main.py
py
4,042
python
en
code
1
github-code
71
[ { "api_name": "absolute_path.AbsolutePath.get_absolute_path", "line_number": 21, "usage_type": "call" }, { "api_name": "absolute_path.AbsolutePath", "line_number": 21, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { ...
29964751091
import requests import pendulum from pyspark.context import SparkContext from pyspark.dbutils import DBUtils from pyspark.sql import SparkSession, DataFrame, Window from pyspark.sql.functions import ( input_file_name, lit, when, min, max, concat_ws, sha2, to_json, ) spark = SparkSessio...
pennfoster/databricks-pipelines
shared/functions/metadata_utilities.py
metadata_utilities.py
py
5,953
python
en
code
0
github-code
71
[ { "api_name": "pyspark.sql.SparkSession.builder.getOrCreate", "line_number": 18, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 18, "usage_t...
70732532710
import pya import os from .draw_mos import * from .mos import mos_ld, mos_grw USER = os.environ['USER'] gds_path = f"/home/{USER}/.klayout/pymacros/cells/efuse" def draw_efuse(layout): layout.read(f"{gds_path}/efuse.gds") #layout.read(f"{gds_path}/efuse_bitline.gds") cell_name = "efuse_cell" return...
egorxe/gf180_efuse_compiler
klayout/pymacros/cells/draw_efuse.py
draw_efuse.py
py
16,130
python
en
code
0
github-code
71
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pya.Point", "line_number": 38, "usage_type": "call" }, { "api_name": "pya.CellInstArray", "line_number": 48, "usage_type": "call" }, { "api_name": "pya.Trans", "line_numb...
15823534067
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 24 15:27:31 2018 @author: marcos """ import silabas as si import recortar as co import os, itertools, shutil import numpy as np import matplotlib.pyplot as plt from skimage.filters import threshold_otsu #Consigo todos los archivos home = os.getcwd...
mwappner/Tesis
Analisis cantos/estudio_motivos_v2.py
estudio_motivos_v2.py
py
7,849
python
es
code
0
github-code
71
[ { "api_name": "os.getcwd", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number":...
32178825527
from django.shortcuts import render,redirect from django.http import HttpResponse, JsonResponse from django.core import serializers import json from .models import * # Create your views here. def home(request): allMovies = movie.objects.all() #queryset data = { "movies": list(allMovies.values()), ...
mantu-sharma2/Movie-reviews-Web-page
movie_review/main/views.py
views.py
py
1,124
python
en
code
0
github-code
71
[ { "api_name": "django.http.JsonResponse", "line_number": 13, "usage_type": "call" }, { "api_name": "django.core.serializers.serialize", "line_number": 19, "usage_type": "call" }, { "api_name": "django.core.serializers", "line_number": 19, "usage_type": "name" }, { ...
15112360030
import networkx as nx import matplotlib.pyplot as plt import random as rnd from friend import friend graph_size = (18, 12) def show_network(network_graph): """ Displays the specified network with associated nodes and edges. Args: network_graph: A network graph object. """ node_color = [10...
Wibbo/network
graph.py
graph.py
py
813
python
en
code
0
github-code
71
[ { "api_name": "networkx.spring_layout", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 17, "usage_type": "name" }, { "api_name": "net...
19233569151
from datetime import date def voto(idade): if idade >= 18 and idade < 70: return 'OBRIGATÓRIO' elif idade >= 70 or idade >= 16 and idade < 18: return 'OPCIONAL' else: return 'NEGADO' anoDeNascimento = int(input('Em que ano você nasceu?: ')) idade = date.today().year - anoDeNascime...
Mathesu-veLi/Python
cursoEmVídeo/Mundo 3/Aula 20 e 21 (Funções)/Parte 2/Desafio 101.py
Desafio 101.py
py
400
python
pt
code
0
github-code
71
[ { "api_name": "datetime.date.today", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 13, "usage_type": "name" } ]
41668610399
from typing import Callable, TypedDict import logging from flask import Flask, request from .blueprints import stripe_connect import stripe log = logging.getLogger(__name__) class StripeBusinessProfile(TypedDict): name: str url: str email: str class Flask_SaaS: """Flask SaaS routes for Stripe Conne...
KarmaComputing/flask-saas
src/flask_saas/flask_saas.py
flask_saas.py
py
4,871
python
en
code
1
github-code
71
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "typing.TypedDict", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 36, "usage_type": "name" }, { "api_name": "typing.Callable", "...
36701839942
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # vim:fenc=utf-8 """ About: The SFC-Ostack Resource Manager Managed Resources: - OpenStack Resources: nova, neutron - SFC Resources: port pair, port pair group, port chain Email: xianglinks@gmail.com """ import json import logging import os import sys import t...
stevelorenz/sfc-ostack
sfc-ostack/sfcostack/dev/rsc_mngr.py
rsc_mngr.py
py
7,560
python
en
code
3
github-code
71
[ { "api_name": "sys.path.insert", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number...
34590787313
"""Module containing JMCFunction subclasses for custom JMC function that can only be used on load function and used once""" from ..jmc_function_mixin import EventMixin from ...exception import JMCMissingValueError from ...datapack import DataPack from ..utils import ArgType, hash_string_to_string from ..jmc_function im...
WingedSeal/jmc
src/jmc/compile/command/builtin_function/load_once.py
load_once.py
py
3,892
python
en
code
47
github-code
71
[ { "api_name": "jmc_function.JMCFunction", "line_number": 17, "usage_type": "name" }, { "api_name": "datapack.DataPack.private_name", "line_number": 31, "usage_type": "attribute" }, { "api_name": "datapack.DataPack", "line_number": 31, "usage_type": "name" }, { "ap...
73080187110
import logging from typing import Dict, List from PyQt5.QtCore import Qt, QThread, pyqtSignal, QObject from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QAction, QHeaderView from config.settings import COL_INFO from lib.get_resource_path import get_resource_path from module.execute_queries import execute_quer...
hxz393/ConfigCenterComparer
ui/action_start.py
action_start.py
py
13,405
python
zh
code
2
github-code
71
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QObject", "line_number": 20, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 35, "usage_type": "call" }, { "api_name": "ui.lan...
3390071620
import pygame as pg from pygame.locals import KEYUP, K_ESCAPE class GameEngine: def __init__(self, w = 640, h = 480, fps = 1): pg.init() self.w, self.h, self.fps = w, h, fps self.screen = pg.display.set_mode((self.w, self.h)) self.running = False def mainLoop(self): self.running = True while(self.r...
hoppfull/Learning-Python
PyGame/pygame3/ex1/myGameEngine.py
myGameEngine.py
py
491
python
en
code
0
github-code
71
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.event.get...
33224745946
import requests class PokemonService: def __init__(self): self.URL = 'https://pokeapi.com/api/v2' def lista_pokemons(self): pokemons = [] for numero in range(1, 1000): response = requests.get(f'{self.URL}/pokemon/{numero}') if not response.ok: ...
gustapinto/fatec
Desenvolvimento web 3/2022-05-11/pokemon_service.py
pokemon_service.py
py
860
python
en
code
2
github-code
71
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" } ]
9560961388
from typing import List class Solution: def wordBreak(self, s: str, wordDict: List[str]) -> List[str]: if not s or not wordDict: return [] self.words = [] N = len(s) dp = [False] * (N + 1) dp[0] = True memo = {} for length in range(1, N + 1): ...
yanansun2020/leetcode
python/dp/140-Word-Break-II.py
140-Word-Break-II.py
py
1,592
python
en
code
1
github-code
71
[ { "api_name": "typing.List", "line_number": 3, "usage_type": "name" } ]
19351654857
import os import queue import typing import warnings import flatbuffers import igraph as ig from . import tflite as tfl from .base import ExtendedOperator from tinynn.util.util import get_logger log = get_logger(__name__, 'INFO') class CommonGraph(object): graph: ig.Graph tensor_map: typing.Dict[str, tfl....
alibaba/TinyNeuralNetwork
tinynn/converter/operators/graph.py
graph.py
py
30,436
python
en
code
661
github-code
71
[ { "api_name": "tinynn.util.util.get_logger", "line_number": 14, "usage_type": "call" }, { "api_name": "igraph.Graph", "line_number": 18, "usage_type": "attribute" }, { "api_name": "typing.Dict", "line_number": 19, "usage_type": "attribute" }, { "api_name": "typing...
30451490536
import time import random from selenium import webdriver from selenium.webdriver import ActionChains from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.firefox.options import Options RESOLUTIONS = [ (1920, 1080), (1...
timesqueezer/fmexp
fmbot/bot.py
bot.py
py
3,430
python
en
code
2
github-code
71
[ { "api_name": "selenium.webdriver.firefox.options.Options", "line_number": 32, "usage_type": "call" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 34, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 34, "usage_type": "name" }, ...
37169103702
import numpy as np import pandas as pd from scipy.linalg import block_diag, norm from pyFBS.utility import coh_frf class VPT(object): """ Virtual Point Transformation (VPT) - enables transformation of measured responses to a virtual DoFs. Current implementation enables rigid interface deformation modes an...
anantagrg/FBS_Substructuring
pyFBS/VPT.py
VPT.py
py
15,653
python
en
code
1
github-code
71
[ { "api_name": "numpy.asarray", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 63, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 69, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_num...
9160549324
import pandas as pd import json import os import time from datetime import datetime, timedelta from pytrends.request import TrendReq # code to export search periods JSON.stringify(arr.map(x => ({name: x.name, from: `${x.year_start}-${x.month_start.toString().padStart(2,'0')}-${x.day_start.toString().padStart(2,'0')} $...
idoshamir/GoogleTrendsTerrorWaves
main.py
main.py
py
3,596
python
en
code
0
github-code
71
[ { "api_name": "json.load", "line_number": 22, "usage_type": "call" }, { "api_name": "pytrends.request.TrendReq", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 35, "usage_type": "call" }, { "api_name": "dateti...