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
73505701627
# coding=utf-8 # # /************************************************************************** # *** # *** File Author: Dell, 2018年 09月 18日 星期二 16:28:12 CST # *** # **************************************************************************/ # import os import sys import logging import argparse import model parser = ...
delldu/ImageCNN
train.py
train.py
py
1,707
python
en
code
4
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "model.DEFAULT_TRAIN_DATA_ROOT_DIR", "line_number": 22, "usage_type": "attribute" }, { "api_name": "model.DEFAULT_TRAIN_DATA_ROOT_DIR", "line_number": 24, "usage_type": "attr...
27641421937
# by filtering stock that is in the range of 0.5 to 2 pct difference import os from dotenv import load_dotenv load_dotenv() import os from supabase import create_client import numpy as np import pandas as pd import requests from datetime import datetime from io import StringIO def preprocess_numeric_value(value): ...
supertypeai/sectors_forecast_growth_rate
code/main_v2.py
main_v2.py
py
7,738
python
en
code
0
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.isna", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.nan", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pandas.isna", "line_...
45386146936
""" Serialize data to/from JSON """ # Avoid shadowing the standard library json module from __future__ import absolute_import from __future__ import unicode_literals import datetime import decimal import json import sys from theory.core.serializers.base import DeserializationError from theory.core.serializers.python...
grapemix/theory
theory/core/serializers/json.py
json.py
py
3,323
python
en
code
1
github-code
6
[ { "api_name": "theory.core.serializers.python.Serializer", "line_number": 21, "usage_type": "name" }, { "api_name": "json.__version__.split", "line_number": 28, "usage_type": "call" }, { "api_name": "json.__version__", "line_number": 28, "usage_type": "attribute" }, {...
9224541444
from flask import Flask from flask import request, jsonify import json, os, util, pickle app = Flask(__name__) SIMULATION_RESULT_PATH = './sim_result' from flask_cors import CORS CORS(app) def load(path): with open(path, 'rb') as f: obj = pickle.load(f) return obj @app.route("/") def hello_world(): ...
Tsinghua-MARS-Lab/InterSim
simulator/dashboard_server.py
dashboard_server.py
py
5,757
python
en
code
119
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 8, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.args.get", "l...
72307131709
import apace as ap import matplotlib.pyplot as plt import numpy as np from fodo import make_fodo from master_thesis import figure_path angles = [0, np.pi / 8, np.pi / 4] fodo = make_fodo(angle=angles[1]) d1, b1, q1, q2 = (fodo[name] for name in ("d1", "b1", "q1", "q2")) twiss = ap.Twiss(fodo) steps = 1000 lengths = ...
andreasfelix/master-thesis
code/lattice-design/fodo/necktie_plot.py
necktie_plot.py
py
1,796
python
en
code
0
github-code
6
[ { "api_name": "numpy.pi", "line_number": 8, "usage_type": "attribute" }, { "api_name": "fodo.make_fodo", "line_number": 9, "usage_type": "call" }, { "api_name": "apace.Twiss", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", ...
39159138446
from numpy import squeeze, real, mean, pi, float16, array, float16, reshape, float32 from scipy import ndimage as ndi from skimage.filters import gabor_kernel from skimage.feature import hog from skimage import feature import cv2 import numpy as np from skimage.transform import rescale, resize, downscale_local_mean imp...
NaghmeNazer/diabetes-iridology
featureExtraction.py
featureExtraction.py
py
3,245
python
en
code
6
github-code
6
[ { "api_name": "skimage.feature.hog", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 20, "usage_type": "argument" }, { "api_name": "numpy.array", "...
7233973656
import os import json import numpy as np from ortools.sat.python import cp_model def solve(all_block, wafer_width, wafer_height): ### wafer sampling # Number of blocks n = len(all_block) # wafer Variables all_wafer_x_st, all_wafer_y_st, all_wafer_x_ed, all_wafer_y_ed, sampled = [], [], [], [], [] ...
Jerry-Github-Cloud/OR-Tools-Code
AdvacneProcess/advance_process_1.py
advance_process_1.py
py
7,607
python
en
code
0
github-code
6
[ { "api_name": "ortools.sat.python.cp_model.CpSolver", "line_number": 121, "usage_type": "call" }, { "api_name": "ortools.sat.python.cp_model", "line_number": 121, "usage_type": "name" }, { "api_name": "ortools.sat.python.cp_model.OPTIMAL", "line_number": 125, "usage_type"...
650430067
#! /bin/python import os import sys import json import numpy as np import luigi import vigra import nifty import nifty.tools as nt import cluster_tools.utils.volume_utils as vu import cluster_tools.utils.function_utils as fu from cluster_tools.cluster_tasks import SlurmTask, LocalTask, LSFTask # # Orphan Filter Ta...
constantinpape/cluster_tools
cluster_tools/postprocess/orphan_assignments.py
orphan_assignments.py
py
4,673
python
en
code
32
github-code
6
[ { "api_name": "luigi.Task", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "luigi.Parameter", "l...
26070327512
import re from validate_email import validate_email TAG_RE = re.compile(r'<[^>]+>') def remove_tags(text): return TAG_RE.sub('', text) class Email(): EMAIL_FIELDS = ["to", "from"] FIELDS = "to to_name from from_name subject body".split() def __init__(self, raw_data): self.populate_fields(raw_data) ...
jasonwang0/email-service
lib/email.py
email.py
py
976
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 4, "usage_type": "call" }, { "api_name": "validate_email.validate_email", "line_number": 28, "usage_type": "call" } ]
14095916252
#!/usr/bin/env python # coding: utf-8 # In[9]: import json with open('file1.json','r') as a: data1 = a.read() obj1 = json.loads(data1) with open('file2.json','r') as a: data2 = a.read() obj2 = json.loads(data2) dlt = {i: obj1[i] for i in obj1 if i in obj2 and obj1[i] != obj2[i]} if len(dlt): print ("Есть...
Ventelj/Test-Task
test.py
test.py
py
471
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 13, "usage_type": "call" } ]
12960757699
from popsycle import synthetic import numpy as np import matplotlib.pyplot as plt from astropy.table import Table import h5py def test_h5_output(extra_col= True): """" Parameters ---------- extra_col : boolean, defaults to False Tells the code whether or not the new h5 file will have ...
jluastro/PopSyCLE
popsycle/tests/test_h5_output.py
test_h5_output.py
py
2,763
python
en
code
13
github-code
6
[ { "api_name": "popsycle.synthetic.perform_pop_syn", "line_number": 23, "usage_type": "call" }, { "api_name": "popsycle.synthetic", "line_number": 23, "usage_type": "name" }, { "api_name": "h5py.File", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy...
24200669844
import logging import threading import types from collections import namedtuple from hashlib import sha256 from time import sleep, time from goTenna.payload import BinaryPayload, CustomPayload from termcolor import colored import config from utilities import de_segment, naturalsize logger = logging.getLogger("MSGS"...
willcl-ark/lightningtenna
lightningtenna/messages.py
messages.py
py
5,494
python
en
code
10
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 28, "usage_type": "call" }, { "api_name": "goTenna.payload.Custom...
24998792911
import time from osv import osv from osv import fields from tools import config from tools.translate import _ from datetime import datetime from datetime import timedelta class hr_payroll_declar(osv.osv): ''' Decleration Form ''' _name = 'hr.payroll.declare' _description = 'Decleration Form' ...
factorlibre/openerp-extra-6.1
hr_payroll_declare/hr_payroll_declare.py
hr_payroll_declare.py
py
7,785
python
en
code
9
github-code
6
[ { "api_name": "osv.osv.osv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "osv.osv", "line_number": 10, "usage_type": "name" }, { "api_name": "osv.fields.char", "line_number": 18, "usage_type": "call" }, { "api_name": "osv.fields", "line_numbe...
11370435084
import torch import torchvision import gym import random import torch.nn as nn import torch from torch.autograd import Variable import torch.autograd as autograd import torch.nn.functional as F import gym import random import heapq from gym.envs.registration import register register( id='FrozenLakeNotSlippery-v0...
ssainz/reinforcement_learning_algorithms
non_jupyter/Frozen_Lake_Actor_Critic_Batch_NoReplacement.py
Frozen_Lake_Actor_Critic_Batch_NoReplacement.py
py
17,568
python
en
code
0
github-code
6
[ { "api_name": "gym.envs.registration.register", "line_number": 17, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 27, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 30, "usage_type": "call" }, { "api_name": "torch...
28969370099
from django.urls import path from apps.cafes.urls import CAFE_URL_KEYWORD from apps.products import views CATEGORY_LIST_URL_NAME = "category-list" CATEGORY_DETAIL_URL_NAME = "category-detail" CATEGORY_URL_KEYWORD = "category_id" OPTION_GROUP_LIST_URL_NAME = "optiongroup-list" OPTION_GROUP_DETAIL_URL_NAME = "optiongr...
TGoddessana/cafehere
apps/products/urls.py
urls.py
py
1,800
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 19, "usage_type": "call" }, { "api_name": "apps.cafes.urls.CAFE_URL_KEYWORD", "line_number": 20, "usage_type": "name" }, { "api_name": "apps.products.views.CategoryAPIViewSet.as_view", "line_number": 21, "usage_type": "call...
31434243930
#!/usr/bin/python3 # Coding: utf-8 # Author: Rogen # Description: 專家系統功能集 from os import walk from tkinter import * from PIL import ImageTk, Image from tkinter import ttk, messagebox, font, filedialog from tkintertable.TableModels import TableModel from tkintertable.Tables import TableCanvas from matplotlib.backends....
NCHU-rogen/ExpertSystem_Project
ExpertSystem_Functions.py
ExpertSystem_Functions.py
py
33,877
python
en
code
0
github-code
6
[ { "api_name": "os.environ", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.pathsep", "line_number": 28, "usage_type": "attribute" }, { "api_name": "pandas.read_excel", "line_number": 44, "usage_type": "call" }, { "api_name": "pandas.ExcelFile", ...
41489732999
import numpy as np from gym import spaces import gym import json import pickle class StateNormWrapper(gym.Wrapper): """ Normalize state value for environments. """ def __init__(self, env, file_name): super(StateNormWrapper, self).__init__(env) with open(file_name, "r") as read_file: ...
quantumiracle/Cascading-Decision-Tree
src/rl/env_wrapper.py
env_wrapper.py
py
1,617
python
en
code
32
github-code
6
[ { "api_name": "gym.Wrapper", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 18, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 4...
19547650475
import logging import multiprocessing import os from subprocess import run from Bio import SeqIO, AlignIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from constants import CD_HIT_CLUSTER_REPS_OUTPUT_FILE, CLUSTERS_NT_SEQS_DIR, CLUSTERS_ALIGNMENTS_DIR, \ NUMBER_OF_PROCESSES, FASTA_FILE_TYPE, ALIGNM...
yarivz/pa-pseudogene
external_tools.py
external_tools.py
py
9,994
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "constants.CD_HIT_CLUSTER_REPS_OUTPUT_FILE", "line_number": 20, "usage_type": "name" }, { "api_name": "subprocess.run", "line_number": 22, "usage_type": "call" }, { "api_na...
41491508331
# ----------- Import statements ------------ import math; import numpy; import matplotlib.pyplot as plt; # ------------ Custom functions ------------ # A-F sums def A(xlist, ylist, y_uncert): A = 0; for i in range(len(xlist)): A += xlist[i] / (y_uncert[i])**2; return A; def B(xlist, ylist, y_unc...
henryshi1/phy-153
Homework/hw05/shi_homework05.py
shi_homework05.py
py
5,372
python
en
code
0
github-code
6
[ { "api_name": "math.sqrt", "line_number": 107, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 109, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 162, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
35696320275
from flask import Flask ,request,Response,session,jsonify,render_template,redirect,url_for from flask.json import JSONDecoder from google.protobuf import message from keras.utils.generic_utils import default from db import create_db,db from models import imgModel,User from flask_restful import marshal_with,fields,abort...
yussif-issah/finalwork
main.py
main.py
py
18,083
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 27, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 29, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 30, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "lin...
41380069765
from functools import wraps import time from utils.mics import colorstr def fun_run_time(func): ''' 装饰器,用于获取函数的执行时间 放在函数前,如 @fun_run_time() def xxx(): ''' @wraps(func)#可删去,是用来显示原始函数名的 def _inner(*args, **kwargs): s_time = time.time() ret = func(*args, **kwargs) ...
Backlory/motionDetection
utils/timers.py
timers.py
py
1,229
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 14, "usage_type": "call" }, { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "utils.mics.colorstr", "line_number": 18, "usage_type": "call" }, { "api_name": "functools.wraps", "line_n...
39005364665
import numpy as np import datetime import math def anagram(s1,s2): s1=list(s1) s2=list(s2) if len(s1)==(len(s2)): s1=set(s1) s2=set(s2) s3=set() if s1^s2==s3: print("Anagram") else: print("not an anagram") else: print("String are ****NOT*** Anagram") def primerange(num): newarr=[] for num in ...
Rohan2596/Python_1_moth
Python_1_Month/Algorithms_programs/AlogoUtility.py
AlogoUtility.py
py
4,962
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime", "line_number": 123, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 132, "usage_type": "call" }, { "api_name": "math.pow", "line_number": 174, "usage_type": "call" }, { "api_name": "math.pow", "line_number"...
27213609715
from collections import deque, defaultdict def bfs(n, adj): visited = [False] * (n+1) min_dist = [1e9] * (n+1) visited[1] = True min_dist[1] = 0 q = deque([1]) while q: cur = q.popleft() for a in adj[cur]: if not visited[a]: q.append...
hammii/Algorithm
Programmers_python/가장_먼_노드.py
가장_먼_노드.py
py
677
python
en
code
2
github-code
6
[ { "api_name": "collections.deque", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 25, "usage_type": "call" } ]
33344135925
import os import logging from pathlib import Path from llama_index import ( GPTSimpleVectorIndex, GPTSimpleKeywordTableIndex, SimpleDirectoryReader ) from llama_index.indices.composability import ComposableGraph # Initialise Logger logging.basicConfig(level=logging.INFO, format="[{asctime}] - {funcName}...
gilgamesh7/iliad_llama
04_local_data_update_index.py
04_local_data_update_index.py
py
2,482
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 13, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "os.environ.ge...
73439288188
import argparse from subcommands.setup.parser import parser as setup_parser from subcommands.export.parser import parser as export_parser from subcommands.info.parser import parser as info_parser from subcommands.process.parser import parser as process_parser from subcommands.prune.parser import parser as prun...
zruan/hotspur_command
hotspur.py
hotspur.py
py
1,681
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "subcommands.setup.parser.parser", "line_number": 21, "usage_type": "name" }, { "api_name": "subcommands.process.parser.parser", "line_number": 26, "usage_type": "name" }, ...
20289549716
from stat_arb.src.data_loader.dao.dataframe.RawPostgresSampledDataLoader import RawPostgresSampledDataLoader from stat_arb.src.data_loader.dao.dataframe.ClickhouseTradesDataLoader import ClickhouseTradesDataLoader from stat_arb.src.data_loader.database import database_config from datetime import datetime from stat_arb....
v-buchkov/statistical_arbitrage_backtester
download_hourly_data.py
download_hourly_data.py
py
1,939
python
en
code
2
github-code
6
[ { "api_name": "stat_arb.src.data_loader.general.Interval.Interval", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "call" }, { "api_name": "stat_arb.src.data_loader.general.Interval.Interval", "line_number": 24, ...
22799615615
from django.shortcuts import render from django.http import HttpResponse from myapp.models import City,Country,Person from myapp.forms import PersonForm from django.shortcuts import redirect # Create your views here. def index(request): country=Country.objects.all() context={ 'country':country, } ...
pappubca005/dynamic-dropdown
myapp/views.py
views.py
py
1,346
python
en
code
0
github-code
6
[ { "api_name": "myapp.models.Country.objects.all", "line_number": 10, "usage_type": "call" }, { "api_name": "myapp.models.Country.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "myapp.models.Country", "line_number": 10, "usage_type": "name" }, ...
27578228523
#!/usr/bin/env python3 import argparse import configparser from pathlib import Path from rich import console import sys sys.path.append("/home/vermin/IdeaProjects/summalarva") from summalarva.openai_client import OpenAIClient from summalarva.orgnoter import OrgNoter console = console.Console() config = configparser....
nhannht/summalarva
summalarva/summarize_pdf.py
summarize_pdf.py
py
1,484
python
en
code
1
github-code
6
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rich.console", "line_number": 13, "usage_type": "name" }, { "api_name": "rich.console.Console", "...
10548067106
#!/usr/bin/env python3 """ From a set of zone transits representing trips between stops, work out the effective trip time for a passenger arriving at the the origin every minute from the departure time of the first bus to the departure time of the last one """ import collections import datetime import logging import ...
SmartCambridge/milton_road_study
initial_investigation/expand_transits.py
expand_transits.py
py
4,037
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 45, "usage_type": "call" }, { "api_name": "csv.QUOTE_ALL", "line_number": 45, "usage_type": "attribute" }, { "api_name": "collections.OrderedDi...
30704086585
from collections import deque with open('day6.txt') as day6: lines = day6.readlines() target_size = 14 current = 0 buffer = deque([''] * target_size) for line in lines: for char in line: current = current + 1 buffer.popleft() buffer.append(char) if current > target_size and len(set(buffer)) == t...
shanetreacy/aoc2022
day6aoc.py
day6aoc.py
py
365
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 9, "usage_type": "call" } ]
22734703340
# -*- coding: utf-8 -*- import json import os import sys import xbmc import xbmcvfs import xbmcaddon import xbmcgui import xbmcplugin import pyxbmct import requests import io import unicodedata import re import ast import sqlite3 import shutil import time from medias import Media, TMDB import medias import zipfile impo...
osmoze06/repo.weebox
repo/plugin.video.sendtokodiU2P/service.py
service.py
py
291,195
python
en
code
2
github-code
6
[ { "api_name": "sys.version_info", "line_number": 54, "usage_type": "attribute" }, { "api_name": "sys.version_info", "line_number": 55, "usage_type": "attribute" }, { "api_name": "xbmcvfs.translatePath", "line_number": 82, "usage_type": "call" }, { "api_name": "xbm...
36621325200
import pygame import sys from moviepy.editor import VideoFileClip from PIL import Image pygame.init() music_background = pygame.mixer.music.load("assets/LostCompanionTomboFry.mp3") pygame.mixer.music.play() pygame.mixer.music.set_volume(0.2) lar = 550 hut = 700 screen = pygame.display.set_mode((lar, hut)) pygame.di...
RuFiripo/Pythongoras-Game
menu.py
menu.py
py
2,712
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.mixer.music.load", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.mixer.music...
73765860989
import asyncio import collections import contextlib import datetime import functools import io import multiprocessing import multiprocessing.pool import os import signal import tempfile from aiohttp import web import marshmallow from oslo_config import cfg from oslo_log import log LOG = log.getLogger(__name__) CONF...
indigo-dc/DEEPaaS
deepaas/model/v2/wrapper.py
wrapper.py
py
12,808
python
en
code
31
github-code
6
[ { "api_name": "oslo_log.log.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "oslo_log.log", "line_number": 19, "usage_type": "name" }, { "api_name": "oslo_config.cfg.CONF", "line_number": 21, "usage_type": "attribute" }, { "api_name": "oslo_co...
8407981184
from abc import ABC, abstractmethod import threading import boto3 import botocore import sys import logging import logging.config from enum import Enum from itertools import cycle from botocore.config import Config from botocore.endpoint import MAX_POOL_CONNECTIONS from collections.abc import Iterable class AWS_SVC_B...
prisma-cloud/IAMFinder
aws_svc/aws_service_base.py
aws_service_base.py
py
3,839
python
en
code
102
github-code
6
[ { "api_name": "abc.ABC", "line_number": 14, "usage_type": "name" }, { "api_name": "botocore.config.Config", "line_number": 16, "usage_type": "call" }, { "api_name": "botocore.endpoint.MAX_POOL_CONNECTIONS", "line_number": 21, "usage_type": "name" }, { "api_name": ...
42739931950
import os import pickle import shutil import numpy as np from tqdm import tqdm import time class ModelManager: ''' Model manager is designed to load and save all models No matter what dataset name. ''' path_name = './checkpoints/' @classmethod def __init__(cls, cfg): if not cfg.MOD...
Jack-Lio/RecommenderSystem
utls.py
utls.py
py
11,868
python
en
code
0
github-code
6
[ { "api_name": "time.strftime", "line_number": 20, "usage_type": "call" }, { "api_name": "time.localtime", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
5762269283
import os scriptPath = os.path.dirname(os.path.abspath(__file__)) projRootPath = os.path.abspath( os.path.join(scriptPath , os.path.join('..', '..'))) import numpy as np # matplotlib for displaying the output import matplotlib.pyplot as plt import seaborn as sns sns.set() from scipy import sign...
mariusdgm/AudioMining
src/visualization/spectrogram.py
spectrogram.py
py
1,360
python
en
code
0
github-code
6
[ { "api_name": "os.path.dirname", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path.abspath", "line...
4714847905
import requests import ast import sys import getopt class XkcdClient(): def api_call(self, url): self.urls = url r = requests.get(url = self.urls) byte_str = r.content dict_str = byte_str.decode("UTF-8") my_data = ast.literal_eval(dict_str) return my_data de...
nishantasarma/XkcdClientApp
client.py
client.py
py
2,527
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.argv", "line_numbe...
7874667169
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jun 22 16:48:54 2019 @author: xiaohaoren """ import json import pickle import numpy as np negative_word = ['悶熱','吵雜','髒','髒亂','加強','改進','缺點'] def Load_All_Info(json_path,pickle_path): with open(json_path,'r') as fp: json_data = json....
e841018/DinnerSelector
utils/Filtering.py
Filtering.py
py
2,301
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 20, "usage_type": "call" } ]
35839328750
import argparse from distutils.util import strtobool import pathlib import siml import convert_raw_data def main(): parser = argparse.ArgumentParser() parser.add_argument( 'settings_yaml', type=pathlib.Path, help='YAML file name of settings.') parser.add_argument( 'raw_da...
yellowshippo/isogcn-iclr2021
src/preprocess_raw_data_with_preprocessors.py
preprocess_raw_data_with_preprocessors.py
py
3,638
python
en
code
42
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pathlib.P...
71175312187
import re import time import textwrap from copy import copy import torch.nn.functional as F from training_utils import * BASH_FORMATTING = { 'PURPLE': '\033[95m', 'CYAN': '\033[96m', 'DARKCYAN': '\033[36m', 'BLUE': '\033[94m', ...
amauriciorr/AubreyBot
chat_utils.py
chat_utils.py
py
2,389
python
en
code
2
github-code
6
[ { "api_name": "copy.copy", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.nn.functional.rand", "line_number": 40, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 40, "usage_type": "name" }, { "api_name": "torch.nn.funct...
33359786284
from unittest import TestCase import unittest import requests # import sys # # sys.path.insert(0, '../../src') class TestLoadTimeSeries(TestCase): def test_load_data_success(self): f = open("tests/routes/time_series_covid19_recovered_global.csv", "rb") file = f.read() url = 'https://covid...
shin19991207/CSC301-A2
tests/routes/test_time_series.py
test_time_series.py
py
1,255
python
en
code
0
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "requests.post", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 32, "usage_type": "call" }, { "api_name": "unittest.main", "li...
25254340151
import numpy as np import sys from vispy import app, visuals, scene # build visuals Plot3D = scene.visuals.create_visual_node(visuals.line.line.LineVisual) # build canvas canvas = scene.SceneCanvas(keys='interactive', title='plot3d', show=True) # Add a ViewBox to let the user zoom/rotate view = canvas.central_widg...
ptmorris03/Clip3D
lines.py
lines.py
py
1,152
python
en
code
0
github-code
6
[ { "api_name": "vispy.scene.visuals.create_visual_node", "line_number": 8, "usage_type": "call" }, { "api_name": "vispy.scene.visuals", "line_number": 8, "usage_type": "attribute" }, { "api_name": "vispy.scene", "line_number": 8, "usage_type": "name" }, { "api_name...
11932438017
from env import data from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.ui import Select from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by...
bangef/pz
python/post-test/module/program.py
program.py
py
4,797
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.action_chains.ActionChains", "line_number": 16, "usage_type": "cal...
12153147067
import matplotlib.pyplot as plt import numpy as np with open('scores.txt', 'r') as f: scores = f.read().splitlines() scores = list(map(int, scores)) mean = [] max_list = [] for i,j in enumerate(scores): if i % 1000 == 0: mean.append(np.average(scores[i:i+1000])) max...
Mike-Teng/Deep_Learning
lab/lab2/plot.py
plot.py
py
798
python
en
code
0
github-code
6
[ { "api_name": "numpy.average", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.ylabel", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib.p...
333459228
import argparse import glob import os import h5py import hdbscan import numpy as np from scipy.ndimage import binary_erosion from skimage.filters import gaussian from skimage.segmentation import watershed from sklearn.cluster import MeanShift def expand_labels_watershed(seg, raw, erosion_iters=4): bg_mask = seg ...
kreshuklab/takafumi_embryos_segmentation
utils/cluster.py
cluster.py
py
4,632
python
en
code
0
github-code
6
[ { "api_name": "skimage.filters.gaussian", "line_number": 20, "usage_type": "call" }, { "api_name": "scipy.ndimage.binary_erosion", "line_number": 22, "usage_type": "call" }, { "api_name": "skimage.segmentation.watershed", "line_number": 27, "usage_type": "call" }, { ...
32311173285
#import networkx as nx #import matplotlib.pyplot as plt import json import pprint from TwitterModule import * import time from datetime import datetime #Set up api and global variables twitter_api = oauth_login()#twitter api for grabbing data #dates = [330,331,401,402,403] dates = [401,402,403,404,405,406,407] for day...
drewpj/cis400tweetfrequency
searchTweets.py
searchTweets.py
py
4,925
python
en
code
1
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 47, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 47, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 57, "usage_type": "call" }, { "api_name": "datetim...
26096479620
from typing import final import pandas as pd import numpy as np import os final_df=pd.read_csv("prepared_final_data.csv") print(final_df) values=final_df["pollution"].values print(values) print(final_df.columns) """# Normalized the data""" from sklearn.preprocessing import MinMaxScaler # values = final_df.values pr...
manisha841/Air-Quality-Index-Prediction
train.py
train.py
py
3,028
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 31, "usage_type": "call" }, { "api_name": "keras.m...
19167044996
""" A collection of neural network code. The first part of the script includes blocks, which are the building blocks of our models. The second part includes the actual Pytorch models. """ import torch import torchvision.transforms as transforms class ConvBlock(torch.nn.Module): """ A ConvBlock represents a co...
notkarol/derplearning
derp/model.py
model.py
py
9,661
python
en
code
40
github-code
6
[ { "api_name": "torch.nn", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn.Conv2d", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 31, "usage_type": "attribute" }, { "api_name": "torch.nn.BatchNorm2d", ...
36562134507
import sys import json import time import numpy as np import argparse from operator import itemgetter from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import dok_matrix from math import sqrt from math import log from upper_learning_corpus import LearningCorpus from sparse_matr...
mfaruqui/vector-semantics
src/svd/convert_counts_to_pmi.py
convert_counts_to_pmi.py
py
4,114
python
en
code
5
github-code
6
[ { "api_name": "sys.stderr.write", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 21, "usage_type": "attribute" }, { "api_name": "time.time", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.stderr.write", "li...
25026171656
from flask import abort from flask_restx import Resource, Namespace, Model, fields, reqparse from infraestructura.alumnos_repo import AlumnosRepo from api.cursos_api import modeloCurso from flask_restx.inputs import date repo = AlumnosRepo() nsAlumno = Namespace('Alumnos', description='Administrador de Alumno') mo...
PepoPalo/Final-Laboratorio-Diciembre2021
Backend/api/alumnos_api.py
alumnos_api.py
py
3,258
python
es
code
1
github-code
6
[ { "api_name": "infraestructura.alumnos_repo.AlumnosRepo", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_restx.Namespace", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_restx.Model", "line_number": 13, "usage_type": "call" }, { "a...
32144899005
import pandas as pd def read_fasta(file_path): sequences = {"Header": [], "Sequence": []} current_header = None current_sequence = "" with open(file_path, "r") as file: for line in file: line = line.strip() if line.startswith(">"): # New header found ...
txz32102/paper
util/sample.py
sample.py
py
3,139
python
en
code
0
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 59, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 64, "usage_type": "ca...
23873824195
import cv2 import os # Input folder containing the saved images image_folder = '/Users/tobieabel/Desktop/video_frames/ConcatVideo/' # Output video file path output_video_path = '/Users/tobieabel/Desktop/video_frames/Youtube/v3_a demo.mp4' # Get the list of image files in the input folder image_files = os.listdir(ima...
tobieabel/demo-v3-People-Counter
Create_video.py
Create_video.py
py
1,633
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_num...
1363723921
from typing import Any, Dict, List, Type, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset T = TypeVar("T", bound="FollowUpPriorityV2ResponseBody") @_attrs_define class FollowUpPriorityV2ResponseBody: """ Example: {'de...
expobrain/python-incidentio-client
incident_io_client/models/follow_up_priority_v2_response_body.py
follow_up_priority_v2_response_body.py
py
2,629
python
en
code
4
github-code
6
[ { "api_name": "typing.TypeVar", "line_number": 8, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 29, "usage_type": "name" }, { "api_name": "types.Unset", "line_number": 29, "usage_type": "name" }, { "api_name": "types.UNSET", "line_number...
37407208814
from jinja2 import Environment, BaseLoader from io import BytesIO import plotly import base64 ''' export = ExportHTML('testclass.html') export.render() ''' class ExportHTML: __template_vars = {'title':'Hello World','body':'Hello World !!!'} __template_html = ''' <html> <head lang="en"> ...
etq-quant/etqbankloan
Lib/etiqalib/export_html.py
export_html.py
py
2,768
python
en
code
0
github-code
6
[ { "api_name": "io.BytesIO", "line_number": 55, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 57, "usage_type": "call" }, { "api_name": "plotly.io", "line_number": 63, "usage_type": "attribute" }, { "api_name": "base64.b64encode", "li...
12948066350
import matplotlib.pyplot as plt tiempo = [0,1,2,3,4,5] sensor = [4,5,6,8,9, 10] plt.plot(tiempo,sensor,'--,r') plt.title('Grafico sensor contra el tiempo') plt.xlabel('Tiempo(s)') plt.ylabel('Voltaje(v)') plt.savefig('sensor.png') plt.show() # Nota: se le puede poner el simbolo para que se grafique('--'), si no se pon...
vero-obando/Programacion
Clases/Graficos/curvas.py
curvas.py
py
679
python
es
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 4, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.title", "line_number": 5, "usage_type": "call" }, { "api_name": "matplot...
19809320159
import time import constants as cons import matplotlib.pyplot as plt from preprocessing.images_reader import ImagesReader start_time = time.time() print('reading images...') reader = ImagesReader(cons.PREPROCESSED_DATASET_DIR) train_images = reader.read_train_images() classes = [None] * len(train_images) samples = ...
sachokFoX/caltech_256
code/run_data_distribution_analysis.py
run_data_distribution_analysis.py
py
589
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 6, "usage_type": "call" }, { "api_name": "preprocessing.images_reader.ImagesReader", "line_number": 9, "usage_type": "call" }, { "api_name": "constants.PREPROCESSED_DATASET_DIR", "line_number": 9, "usage_type": "attribute" }, ...
25965027391
import json import os from contextlib import suppress from math import sqrt from typing import Tuple import numpy as np import pandas as pd from openpyxl import load_workbook, styles, utils from PIL import Image def to_excel( image: Image, path: str, lower_image_size_by: int = 10, **spreadsheet_kwargs ) -> None:...
Henrique-CSS/unexpected-isaves
src/unexpected_isaves/save_image.py
save_image.py
py
24,926
python
en
code
null
github-code
6
[ { "api_name": "PIL.Image", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 53, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_n...
40709996191
# coding=utf-8 from __future__ import absolute_import, division, print_function import torch import torch.nn as nn from torch.utils.data import DataLoader, Dataset from util.custom_dataset import FaceLandmarksDataset, Rescale, ToTensor import torchvision.models as models from torchvision import transforms impor...
hanluyt/gACNN_pytorch
model_roi.py
model_roi.py
py
7,947
python
en
code
2
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 15, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.nn", "li...
29262983646
import sys import socket import platform import psutil import wmi import urllib.request from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QPushButton, QTextEdit, QWidget from PyQt5.QtCore import Qt from PyQt5.QtGui import QFont, QColor class App(QMainWindow): def __init__(self, app): supe...
miko7ajradziw1llowicz/Zadanie-3-python
main.py
main.py
py
4,160
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 11, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 21, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QVBoxLayout", "line_number": 24, "usage_type": "call" }, { "a...
10881296356
import unittest from pathlib import Path from tests import CdsTestMixin from . import CDSCase class DumpTest(CdsTestMixin, unittest.TestCase): def test_trace_json(self): with CDSCase(self, self.NAME_LIST, self.TEST_ARCHIVE) as cds: cds.run_trace('import json') cds.verify_files(che...
alibaba/code-data-share-for-python
tests/test_cds/test_dump.py
test_dump.py
py
745
python
en
code
38
github-code
6
[ { "api_name": "tests.CdsTestMixin", "line_number": 8, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" } ]
70541333949
import os import re import spotipy from moviepy.editor import * from urllib.parse import quote from urllib import request as rq from youtube_dl import YoutubeDL from spotipy.oauth2 import SpotifyClientCredentials ## fix to skip use for PYTHONPATH sys.path.append(os.getcwd()) sys.path.append(os.path.join(os.getcwd(),"....
alejan2x/FuckDownload
spotify/spotify.py
spotify.py
py
4,850
python
en
code
0
github-code
6
[ { "api_name": "os.getcwd", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 12...
26656448918
#the code partial borrowed from # "Neural Network-based Reconstruction in Compressed Sensing #MRI Without Fully-sampled Training Data" import torch import torch.nn as nn import numpy as np import torch.nn.functional as F import util_torch as util_torch def absval(arr): """ Takes absolute value of last dimensio...
ikjalata/MRIunsup
model.py
model.py
py
3,925
python
en
code
0
github-code
6
[ { "api_name": "torch.norm", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.flatten", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.max", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number...
23341249880
import json as js import csv import sys import jinja2 import os from datetime import datetime # import smtplib # read customers file to get information about customers def get_customers(customers_file, error): TITLE = [] FIRST_NAME = [] LAST_NAME = [] EMAIL = [] with open(customers_file, mode='...
thanhthien272/sendEmailPython
send_email.py
send_email.py
py
2,750
python
en
code
0
github-code
6
[ { "api_name": "csv.DictReader", "line_number": 17, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 28, "usage_type": "call" }, { "api_name": "json.load", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number"...
31975334850
import numpy as np import scipy.ndimage import scipy.misc import glob import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torch.optim as optim def loadPsf(psftype, fileformat): path='/gdata/zhoutk/Deconv/'+psftype files=glob.glob(path+'/'+'*'+filefor...
rickyim/DeconvNet
source/PSFConv.py
PSFConv.py
py
2,123
python
en
code
0
github-code
6
[ { "api_name": "glob.glob", "line_number": 15, "usage_type": "call" }, { "api_name": "scipy.ndimage.misc.imread", "line_number": 21, "usage_type": "call" }, { "api_name": "scipy.ndimage.misc", "line_number": 21, "usage_type": "attribute" }, { "api_name": "scipy.ndi...
28118192230
# -*- coding:utf-8 -*- from PySide2.QtCore import Signal from PySide2.QtWidgets import QDialog from core.options import MultiOption from ui.base.constants import ITEM_SEPARATORS from ui.base.ui_add_items import Ui_AddItemsDialog # noinspection PyTypeChecker from utils import warn, splitItems, isEmpty # noinspection P...
zimolab/PyInstallerGUI
ui/add_items_ui.py
add_items_ui.py
py
2,937
python
en
code
10
github-code
6
[ { "api_name": "PySide2.QtWidgets.QDialog", "line_number": 12, "usage_type": "name" }, { "api_name": "ui.base.ui_add_items.Ui_AddItemsDialog", "line_number": 12, "usage_type": "name" }, { "api_name": "PySide2.QtCore.Signal", "line_number": 24, "usage_type": "call" }, {...
26735943730
import numpy as np from .utils import LinearAnnealer,ExponentialAnnealer import tqdm import torch import torch.nn as nn import wandb from progress.bar import Bar from array2gif import write_gif import copy from .utils import set_seed from .utils import save_rewards_meanvar_plot,get_logger,MLP,ReplayMemory import loggi...
gauthierboeshertz/reel
algos/plearners/vpg.py
vpg.py
py
5,225
python
en
code
0
github-code
6
[ { "api_name": "copy.deepcopy", "line_number": 26, "usage_type": "call" }, { "api_name": "utils.set_seed", "line_number": 32, "usage_type": "call" }, { "api_name": "utils.MLP", "line_number": 36, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_n...
15257337134
# -*- coding: utf-8 -*- """ Created on Sat Nov 10 17:30:55 2018 @author: Wioletta """ import cv2 from localbinarypatterns import LocalBinaryPatterns img = cv2.imread('yaleB01_P00A+000E+00.pgm') cv2.imshow('Image',img) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) desc = LocalBinaryPatterns(24, 8) hist = desc.descr...
wiolettakolasa/IO
test.py
test.py
py
360
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 14, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_num...
22043825261
from flask import Response import json from presentation.contracts import HttpController, HttpRequest def adapt_route(flask_request, controller: HttpController): request = HttpRequest( params=flask_request.args, body=flask_request.json ) data = controller.handle(request) return Respons...
panda-coder/py-clean-flask
src/main/adapters/flask_route_adapter.py
flask_route_adapter.py
py
924
python
en
code
1
github-code
6
[ { "api_name": "presentation.contracts.HttpController", "line_number": 6, "usage_type": "name" }, { "api_name": "presentation.contracts.HttpRequest", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.Response", "line_number": 12, "usage_type": "call" }, { ...
71174455228
# -*- coding: utf-8 -*- import time, functools def metric(fn): def decorator(func): @functools.wraps(func) def wrapper(*args,**kw): print(fn) if fn.__str__()==fn else print('no metric args') start_time=time.time() return (func(*args,**kw),print('%s executed in %s...
kfusac/LearnPython
LiaoxuefengPython/5_FunctionalProgramming/decorator.py
decorator.py
py
756
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 9, "usage_type": "call" }, { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 6, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 16,...
72052703228
import sys, json from urllib.request import urlopen from collections import OrderedDict list_host = 'http://localhost:5000' list_url = list_host + '/api/3/action/organization_list' get_url = list_host + '/api/3/action/organization_show' contents = urlopen(list_url) org_list = json.load(contents)['result'] for org_n...
italia/public-opendata-sources
export_orgs.py
export_orgs.py
py
888
python
en
code
17
github-code
6
[ { "api_name": "urllib.request.urlopen", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "line_number": 10, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 17, "usage_type": "call" }, { "api_name": "json.load", ...
20538743319
# https://leetcode.com/problems/rotting-oranges/ """ Time complexity:- O(N) Space Complexity:- O(N) """ """ Intuition: The algorithm uses Breadth-First Search (BFS) to simulate the rotting process, starting from initially rotten oranges. The queue (q) is used to keep track of the rotten oranges and their coordinates...
Amit258012/100daysofcode
Day92/rotten_oranges.py
rotten_oranges.py
py
2,532
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 23, "usage_type": "call" } ]
28383267446
import copy import functools import os import random import torch import torch.nn.functional as F import blobfile as bf import torchvision.utils as vutils import numpy as np import torch as th import torch.distributed as dist from torch.nn.parallel.distributed import DistributedDataParallel as DDP from torch.optim impo...
JTT94/schrodinger_bridge
bridge/trainer/ipf_base.py
ipf_base.py
py
10,216
python
en
code
0
github-code
6
[ { "api_name": "torch.nn", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.distributed.get_rank", "line_number": 41, "usage_type": "call" }, { "api_name": "torch.distributed", "line_number": 41, "usage_type": "name" }, { "api_name": "plotters.I...
30728237360
import fileinput import sys from collections import deque, defaultdict, Counter from functools import lru_cache from itertools import permutations, combinations, combinations_with_replacement, product sys.setrecursionlimit(10000000) dd = defaultdict(lambda: 0) dx = [0, 0, -1, 1] # NSWE dy = [-1, 1, 0, 0] # NSWE p1 =...
mdaw323/alg
adventofcode2021/21.py
21.py
py
1,904
python
en
code
0
github-code
6
[ { "api_name": "sys.setrecursionlimit", "line_number": 6, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 44, "usage_type": "call" }, { "api_name": "colle...
26396707826
# Establish the Python Logger import logging # built in python library that does not need to be installed import time from datetime import datetime import os import talking_code as tc speaking_log = False speaking_steps = False def set_speaking_log(on_off_setting = False): global speaking_log speak...
JoeEberle/kids_ABC_book
quick_logger.py
quick_logger.py
py
5,079
python
en
code
1
github-code
6
[ { "api_name": "talking_code.say", "line_number": 25, "usage_type": "call" }, { "api_name": "time.time", "line_number": 29, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.INFO", "li...
16616067005
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager from selenium.common.exceptions import NoSuchElementException import logging def has_booking_started(url: str) -> bool: options ...
CreatorSky/cineplex-notifier
utils/selenium_utils.py
selenium_utils.py
py
1,128
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 10, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 10, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 15, "usage_type": "call" }, { "api...
70929713788
# -*- coding: utf-8 -*- """ Created on Wed Sep 6 11:55:47 2023 @author: Gilberto """ import pandas as pd from datetime import datetime, timedelta class StraightLineAmortization: def __init__(self, settlement_date, maturity_date, first_payment_date, notional_amount, rate, basis_numerator, basis_deno...
gdelacruzv/Amortization_calculator
straightline_v2.py
straightline_v2.py
py
4,582
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.strptime", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 15, "usage_type": "call" }, { "api_name"...
29188042884
""" Problem Statement A zero-indexed array A of length N contains all integers from 0 to N-1. Find and return the longest length of set S, where S[i] = {A[i], A[A[i]], A[A[A[i]]], ... } subjected to the rule below. Suppose the first element in S starts with the selection of element A[i] of index = i, the next e...
walterjgsp/algorithms
Python/problems/problem_0008_array_nesting.py
problem_0008_array_nesting.py
py
1,388
python
en
code
6
github-code
6
[ { "api_name": "typing.List", "line_number": 35, "usage_type": "name" } ]
10976102669
import numpy as np import matplotlib.pyplot as plt def linear_LS(xi, yi): a = np.empty(2) n = xi.shape[0] c0 = np.sum(xi) c1 = np.sum(xi ** 2) c2 = np.sum(yi) c3 = np.sum(xi * yi) a[0] = (c0*c3 - c1*c2) / (c0*c0 - n*c1) a[1] = (c0*c2 - n*c3) / (c0*c0 - n*c1) return a ...
LiBingbin/Computational_Physics
PythonProject/hw04/hw04_t2.py
hw04_t2.py
py
1,781
python
en
code
0
github-code
6
[ { "api_name": "numpy.empty", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 10, "...
73730402429
import boto3 import logging import os import json import time from datetime import datetime from jsonpath_ng.ext import parse import helpers logger = logging.getLogger() logger.setLevel(logging.INFO) utl = helpers.Utils() dyn = helpers.Dyn() ssm = boto3.client('ssm') ec2 = boto3.client('ec2') appValue = os.getenv('T...
arturlr/minecraft-server-dashboard
lambdas/configServer/index.py
index.py
py
8,475
python
en
code
2
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "helpers.Utils", "line_number": 13, "usage_type": "call" }, { "api_name": "helpers.Dyn", "...
46057888236
# -*- coding: utf-8 -*- import logging import datetime import pytz __all__ = ['timezones'] logger = logging.getLogger('django') def is_standard_time(time_zone, date_time): try: dst_delta = time_zone.dst(date_time, is_dst=False) except TypeError: dst_delta = time_zone.dst(date_time) r...
nitely/Spirit
spirit/core/utils/timezone.py
timezone.py
py
2,280
python
en
code
1,153
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 20, "usage_type": "call" }, { "api_name": "pytz.timezone", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime....
74519748667
import pyautogui from random import random import pyscreenshot as ImageGrab import math import cv2 as cv from utilities import inventory as inv from utilities.core import get_bounding_rect_from_pts def get_pickup_rects(o_img, cnts): # returns bounding rect(s) of item(s) to pickup items = [] line_pts = [] ...
009988b/2007scape-bot-functions
skills/combat.py
combat.py
py
5,029
python
en
code
0
github-code
6
[ { "api_name": "cv2.moments", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.line", "line_number": 31, "usage_type": "call" }, { "api_name": "math.dist", "line_number": 36, "usage_type": "call" }, { "api_name": "utilities.core.get_bounding_rect_from_...
35613748044
from collections import OrderedDict # from datetime import datetime from django.conf import settings from django.db import models from django.utils import timezone from jsonfield import JSONField # Create your models here. class fhir_Consent(models.Model): """ Store User:application consent in fhir format ...
shihuaxing/hhs_oauth_server
apps/fhir/fhir_consent/models.py
models.py
py
2,578
python
en
code
null
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 13, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 13, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 16, "usage_type": "call" }, { "api_name...
30827675825
import os import sys import json import logging from time import time from PyQt5.Qt import PYQT_VERSION_STR from PyQt5.QtCore import ( QT_VERSION_STR, QStandardPaths, QSysInfo, QLocale, QLibraryInfo, QTranslator ) from novelwriter.error import logException, formatException from novelwriter.common import spli...
vaelue/novelWriter
novelwriter/config.py
config.py
py
38,609
python
en
code
null
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QLocale.system", "line_number": 65, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QLocale", "line_number": 65, "usage_type": "name" }, { "api_name": "Py...
32681042902
import numpy as np from .BaseNB import BaseNaiveBayes # 高斯贝叶斯 class GaussianNaiveBayes(BaseNaiveBayes): # 训练 def fit(self, X: np.ndarray, y: np.ndarray): """ X: train dataset, shape = (n_samples, n_features) y: target, shape = (n_samples, ) """ # 计算 y 的先验概率 y_pr...
HuipengXu/Statistical-learning-method
naive_bayes/GaussianNB.py
GaussianNB.py
py
2,327
python
en
code
7
github-code
6
[ { "api_name": "BaseNB.BaseNaiveBayes", "line_number": 5, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.unique", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.size", ...
6264519181
import matplotlib.pyplot as plt class Drawer(): def __init__(self,y_pred, y_test, target_names,X_test,eigenfaces): self.y_pred=y_pred self.y_test=y_test self.target_names=target_names self.X_test=X_test self.eigenfaces=eigenfaces def plot_gallery(self,images, titles, h...
bartekskrabacz/python_project
src/python_project/Drawer.py
Drawer.py
py
1,774
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 14, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplots_adjust", "line_number": 15, "usage_type": "call" }, { "api_...
23995078592
import os from collections import deque from typing import Dict, List, Optional, Any import langchain import openai import pinecone from langchain.chains import LLMChain from langchain.chains.base import Chain from langchain.agents import AgentType, ZeroShotAgent, Tool, AgentExecutor, initialize_agent from langchain...
satpat2590/somelangchainfun
main.py
main.py
py
13,333
python
en
code
2
github-code
6
[ { "api_name": "langchain.embeddings.OpenAIEmbeddings", "line_number": 22, "usage_type": "call" }, { "api_name": "faiss.IndexFlatL2", "line_number": 26, "usage_type": "call" }, { "api_name": "langchain.vectorstores.FAISS", "line_number": 27, "usage_type": "call" }, { ...
31734423723
import sqlite3 class sqlcommands: def Open(self): if self.bOpen is False: self.conn = sqlite3.connect(self.db) self.curs = self.conn.cursor() self.bOpen = True return True def __init__(self, table): self.db = './~newsqlcommands.sqlt3' s...
Loondas/PythonGameTimer
GameTimer/cgi-bin/newsqlcommands.py
newsqlcommands.py
py
4,718
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 8, "usage_type": "call" } ]
34215736207
import logging import os import gzip import filetype import multiprocessing as mp import pandas as pd from moonstone.normalization.reads.read_downsize import DownsizePair logger = logging.getLogger(__name__) def pair_up(seq_files_info): paired_list = [] query = None for key in seq_files_info: if...
motleystate/moonstone
moonstone/normalization/reads/downsize_dir.py
downsize_dir.py
py
7,336
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 71, "usage_type": "call" }, { "api_name": "os.path", "line_...
18625152569
import os import json import requests from bs4 import BeautifulSoup from datetime import datetime as dt import pandas as pd from __common__ import user_choice def __load_json__(file): """ """ try: with open(file) as rf: data = json.load(rf) return data except: retu...
robbie-manolache/energy-market-analysis
nemtel/tracker.py
tracker.py
py
6,567
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 22, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 23, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "li...
26120509391
import os import sys import csv from collections import Counter, defaultdict import pandas as pd from statsmodels.stats.inter_rater import aggregate_raters, fleiss_kappa #from pptx import Presentation # configure Django so we can use models from the annotate app sys.path.append('/home/nejl/Dropbox/projects/tator/rep...
ned2/tator
notebooks/utils.py
utils.py
py
11,139
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.setup", "lin...
2694410426
import os import sys import signal import threading import multiprocessing import atexit import time from ctypes import c_bool from .module import StateIO from .config import Config class Controller: def __init__(self, config: Config) -> None: args, self.cfg = config.load() self.pidfile_pa...
bitula/minipupper-dev
controller/controller.py
controller.py
py
12,689
python
en
code
2
github-code
6
[ { "api_name": "config.Config", "line_number": 15, "usage_type": "name" }, { "api_name": "config.load", "line_number": 17, "usage_type": "call" }, { "api_name": "atexit.register", "line_number": 21, "usage_type": "call" }, { "api_name": "multiprocessing.Array", ...
9224654424
# Usage # python scripts/collect_pickle_states.py -i PICKLE_DATA_PATH import argparse import numpy as np import tqdm import structs def collect_stats(args): data = structs.load(args.input_path) sample_count = [] for key in tqdm.tqdm(data): sample_count.append(data[key]['rst'].shape[0]) val...
Tsinghua-MARS-Lab/InterSim
simulator/prediction/M2I/guilded_m_pred/scripts/collect_pickle_stats.py
collect_pickle_stats.py
py
816
python
en
code
119
github-code
6
[ { "api_name": "structs.load", "line_number": 12, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 18, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "li...
42168409282
from typing import List class Solution: def optimalArray(self, n : int, ar : List[int]) -> List[int]: # code here res = [] half, full = 0, 0 for i in range(n): full += ar[i] if i&1: res.append(full - 2*half) else: ...
shane-Coder/DailyCode
Optimal Array - GFG/optimal-array.py
optimal-array.py
py
1,007
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
30500996966
# ---------------------------------J.A.R.V.I.S.---------------------------------- import datetime import pyttsx3 import speech_recognition as sr import __name__ import comtypes.client # ----------------------------------------------------------------------------- engine = pyttsx3.init("sapi5") voices = engi...
ArcTix-09/codes
python/J.A.R.V.I.S..py
J.A.R.V.I.S..py
py
1,509
python
en
code
1
github-code
6
[ { "api_name": "pyttsx3.init", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "attribute" }, { "api_name": "speech_reco...
25229791277
import pandas as pd from sklearn.metrics.pairwise import linear_kernel from scipy.io import mmwrite, mmread import pickle from gensim.models import Word2Vec # 데이터 가져오기 df_reviews = pd.read_csv('./naver_crawling_data/naver_cleaned_reviews.csv') Tfidf_matrix = mmread('./naver_models/Tfidf_book_review.mtx').tocsr() with ...
sealamen/project_03_book_curator
07_book_recommendation.py
07_book_recommendation.py
py
1,305
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.io.mmread", "line_number": 9, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 11, "usage_type": "call" }, { "api_name": "gensim.models.Word2Vec.load...
30338122797
from collections import deque def bfs(graph, start): queue = deque([start]) #방문할 노드를 넣어두는 곳 visited = [] #방문한 노드들 while queue: v = queue.popleft() print(v, end=" ") if v not in visited: visited.append(v) queue += graph[v] return visited graph = [ [...
minju7346/CordingTest
bfs_test2.py
bfs_test2.py
py
472
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 4, "usage_type": "call" } ]
74326542907
import datetime import jsonlines # Appends json to a jsonl file def append_to_jsonl(timeline, file_path): print("Writing contents to jsonl...") # Sort major events array by timestamp sorted_timeline = sorted(timeline, key=lambda event: int(event['date'])) # Pretty print JSON of human datetime for event in sorte...
jeromechoo/gpt-for-you
helpers/write.py
write.py
py
618
python
en
code
4
github-code
6
[ { "api_name": "datetime.datetime.fromtimestamp", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" }, { "api_name": "jsonlines.open", "line_number": 17, "usage_type": "call" } ]
37211599965
import numpy as np import torch # # np.argwhere的用法 # a=np.zeros((4,3), dtype=np.uint32) # b=np.argwhere(np.zeros((4,3), dtype=np.uint32) == 0) # print(a) # print(b) # print(type(b),b.shape) # # reshape的用法,torch和numpy都有类似的用法 # a = torch.arange(4.) # print(a.shape) # a=torch.reshape(a, (2, 2)) # print(a.shape) # b = to...
hanquansanren/unified_doctransformer
simple_test/unit_test.py
unit_test.py
py
1,371
python
en
code
1
github-code
6
[ { "api_name": "torch.ones", "line_number": 53, "usage_type": "call" } ]
43622986430
# -*- coding: utf-8 -*- import html from gi.repository import Gtk from mcomix.preferences import config class MessageDialogRemember(Gtk.MessageDialog): __slots__ = ('__dialog_id', '__choices', '__remember_checkbox') def __init__(self): """ Creates a dialog window. """ supe...
thermitegod/mcomix-lite
mcomix/message_dialog/remember.py
remember.py
py
2,610
python
en
code
2
github-code
6
[ { "api_name": "gi.repository.Gtk.MessageDialog", "line_number": 10, "usage_type": "attribute" }, { "api_name": "gi.repository.Gtk", "line_number": 10, "usage_type": "name" }, { "api_name": "gi.repository.Gtk.CheckButton", "line_number": 27, "usage_type": "call" }, { ...
8670584413
import cv2 import cvzone from cvzone.PoseModule import PoseDetector import numpy as np cap = cv2.VideoCapture(1) detector = PoseDetector() per = 0 a1 = 0 color = (0,0,255) situps = 0 dir = 0 while True: __ , img = cap.read() #assert isinstance(img, object) img = detector.findPose(img) lmlist, bbox = ...
adirastogi235/PUSH-UP-COUNTER
main.py
main.py
py
1,392
python
en
code
0
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 6, "usage_type": "call" }, { "api_name": "cvzone.PoseModule.PoseDetector", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.interp", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.inte...