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
6227495516
#Dependencies """ !pip install -U sklearn !pip install pmdarima !pip install river !pip install tslearn !pip install arch !pip install skorch """ #Imports import json import math import calendar from datetime import timedelta from datetime import datetime as dt import numpy as np import pandas as pd import warnings...
amarabuco/codrift
codrift3.py
codrift3.py
py
60,743
python
en
code
0
github-code
1
[ { "api_name": "warnings.simplefilter", "line_number": 23, "usage_type": "call" }, { "api_name": "seaborn.set_theme", "line_number": 65, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 69, "usage_type": "call" }, { "api_name": "logging.W...
35947650994
# -*- coding: utf-8 -*- import os import csv import ast from itertools import islice import matplotlib.pyplot as plt from sklearn import preprocessing import numpy """ This script is plotting all of bad sample data """ if __name__ == '__main__': root=os.getcwd() bsxs=["bs1","bs2","bs3","bs4","bs5","bs6","bs...
s-okugawa/HDNNP-tools
tools/bad-sample/plot-allbs.py
plot-allbs.py
py
1,785
python
en
code
0
github-code
1
[ { "api_name": "os.getcwd", "line_number": 14, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 32, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
38069299722
import os import glob import shutil import re import gi gi.require_version('Limba', '1.0') gi.require_version('AppStream', '1.0') from gi.repository import Limba from gi.repository import AppStream from hashlib import sha256 from ..utils import build_cpt_path from ..repository.models import * from ..user import User f...
limbahq/limba-hub
lihub/maintain/ipkimport.py
ipkimport.py
py
6,824
python
en
code
2
github-code
1
[ { "api_name": "gi.require_version", "line_number": 6, "usage_type": "call" }, { "api_name": "gi.require_version", "line_number": 7, "usage_type": "call" }, { "api_name": "gi.repository.AppStream.Metadata", "line_number": 23, "usage_type": "call" }, { "api_name": "...
5310216277
from collections import deque from typing import List, Tuple def shortest_distance(maze: List[List[int]], src: Tuple[int, int], dest: Tuple[int, int]) -> int: row = len(maze) col = len(maze[0]) visited = [[False for i in range(col)] for j in range(row)] distance = [[float('inf') for i in range(col)] f...
Sourolio10/Leetcode-Practice
Graph/Shortest_distance/shortest_dist_in_matrix_using_djitras_queue.py
shortest_dist_in_matrix_using_djitras_queue.py
py
1,376
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 5, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 13, "usage_type": "call" } ]
16954723069
# Link For Problem: https://leetcode.com/problems/longest-increasing-path-in-a-matrix/ import functools class Solution: """ DFS + Memoization Approach. TC : O(n) SC : O(n) """ def longestIncreasingPath(self, matrix: list[list[int]]) -> int: R, C = len(matrix), len(matr...
loopclub2022/MonthLongChallenge
Anurag_19_CSE/Python/day19.py
day19.py
py
857
python
en
code
9
github-code
1
[ { "api_name": "functools.lru_cache", "line_number": 30, "usage_type": "call" } ]
1585593679
from typing import Optional from decimal import Decimal from validator_collection import validators from highcharts_core import errors from highcharts_core.metaclasses import HighchartsMeta from highcharts_core.utility_classes.gradients import Gradient from highcharts_core.utility_classes.patterns import Pattern cl...
highcharts-for-python/highcharts-core
highcharts_core/options/axes/data_classes.py
data_classes.py
py
3,874
python
en
code
40
github-code
1
[ { "api_name": "highcharts_core.metaclasses.HighchartsMeta", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 27, "usage_type": "name" }, { "api_name": "highcharts_core.utility_classes.gradients.Gradient", "line_number": 27, "usage...
6584194716
from typing import Dict, Optional, Tuple, TYPE_CHECKING from UM.Logger import Logger from UM.Version import Version from cura.Backups.Backup import Backup if TYPE_CHECKING: from cura.CuraApplication import CuraApplication class BackupsManager: """ The BackupsManager is responsible for managing the creat...
Ultimaker/Cura
cura/Backups/BackupsManager.py
BackupsManager.py
py
3,130
python
en
code
5,387
github-code
1
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 7, "usage_type": "name" }, { "api_name": "cura.Backups.Backup.Backup", "line_number": 30, "usage_type": "call" }, { "api_name": "typing.Tuple", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Op...
30644851301
from ..math_basics import is_RealIntervalFieldElement # type: ignore from ..exceptions import InsufficientPrecisionError # type: ignore from typing import Sequence __all__ = ['floor_as_intergers', 'SpatialDict'] def floor_as_integers(x) -> Sequence[int]: """ Computes floor of a number or interval, returning ...
ekim1919/SnapPy
python/drilling/spatial_dict.py
spatial_dict.py
py
3,952
python
en
code
null
github-code
1
[ { "api_name": "math_basics.is_RealIntervalFieldElement", "line_number": 27, "usage_type": "call" }, { "api_name": "exceptions.InsufficientPrecisionError", "line_number": 34, "usage_type": "call" }, { "api_name": "typing.Sequence", "line_number": 8, "usage_type": "name" ...
20068242046
from tkinter import Tk, Label, Button, Entry, Text, messagebox from os import environ from source.email import Email from dotenv import load_dotenv #se crea la ventana venatana = Tk() #se pone el titulo, color y tamaño de la ventana venatana.title("Semana 12") venatana.geometry("500x400") venatana.config(bg="#5F6A6...
DanCastSV/S12
S12/main.py
main.py
py
1,511
python
es
code
0
github-code
1
[ { "api_name": "tkinter.Tk", "line_number": 7, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_number": 15, "usage_type": "call" }, { "api_name": "tkinter.Label", "line_number": 16, "usage_type": "call" }, { "api_name": "tkinter.Entry", "line_numbe...
73740570595
# Face Recognition/Identification import cv2 as cv import face_recognition as fr import os # training data knownFaces = [ { "file": "JoeBiden.jpg", "name": "Joe Biden", "code": None, }, { "file": "FumioKishida.jpg", "name": "Fumio Kishida", "code": None, ...
smstong/ai
ai012.py
ai012.py
py
2,130
python
en
code
0
github-code
1
[ { "api_name": "face_recognition.load_image_file", "line_number": 33, "usage_type": "call" }, { "api_name": "face_recognition.face_locations", "line_number": 34, "usage_type": "call" }, { "api_name": "face_recognition.face_encodings", "line_number": 35, "usage_type": "call...
33397514940
import numpy as np import matplotlib.pyplot as plt import torch import torch.nn as nn import os os.environ['KMP_DUPLICATE_LIB_OK'] = 'TRUE' startPoint = 5 state1 = np.loadtxt('1.0_2.0_state')[:,0].reshape(1,201,1) encoder_input1 = state1[:,:startPoint,:] decoder_input1 = state1[:,startPoint:-1,:] output1 = state1[:,s...
Bonbon-Tang/DL-for-dynamical-systems
MSSPartial/noiseFree/Train_RNNS2.py
Train_RNNS2.py
py
5,234
python
en
code
0
github-code
1
[ { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.loadtxt", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_...
15103185485
import calendar import pandas as pd import numpy as np def remove_high_corr(df,target='Israelis_Count',threshold=0.5): ''' return dataframe without corrlation that can be drop. args: df = dataframe target = string of the target threshold = default 0.5 ''' target_col = df.pop(target) df.insert(len(...
LiavCohn/nature-reserves-paper
function.py
function.py
py
11,566
python
en
code
0
github-code
1
[ { "api_name": "numpy.triu", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.bool", "line_number": 17, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.cla", "li...
39473584807
import numpy as np from keras.models import load_model test_images = np.load("mnist_test_images.npy") test_labels = np.load("mnist_test_labels.npy") network = load_model("mnist_model.h5") # Evaluate the model print("Evaluating...") test_loss, test_acc = network.evaluate(test_images, test_labels) print() print("Test ...
byelipk/deep-mnist
mnist_eval.py
mnist_eval.py
py
373
python
en
code
0
github-code
1
[ { "api_name": "numpy.load", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 5, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 7, "usage_type": "call" } ]
15143059359
#!/usr/bin/env python # coding: utf-8 # # COURSE: Master statistics and machine learning: Intuition, Math, code # ##### COURSE URL: udemy.com/course/statsml_x/?couponCode=202006 # ## SECTION: The t-test family # ### VIDEO: Mann-Whitney U test # #### TEACHER: Mike X Cohen, sincxpress.com # In[ ]: # import libraries...
mikexcohen/Statistics_course
Python/ttest/stats_ttest_MannWhitneyU.py
stats_ttest_MannWhitneyU.py
py
900
python
en
code
18
github-code
1
[ { "api_name": "numpy.random.poisson", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.random.poisson", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.ran...
70599120354
from dask.distributed import Client import dask.dataframe as dd from fastapi import FastAPI client = Client() app = FastAPI() # Import data opioids_data = dd.read_csv( "/Users/lorna/Documents/MIDS 2022/First Semester/720 Practicing Data Science/dask/arcos_2011_2012.tsv", sep="\t", usecols=["BUYER_STATE","...
lornamariak/dask-api
app/main.py
main.py
py
2,589
python
en
code
0
github-code
1
[ { "api_name": "dask.distributed.Client", "line_number": 5, "usage_type": "call" }, { "api_name": "fastapi.FastAPI", "line_number": 6, "usage_type": "call" }, { "api_name": "dask.dataframe.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "dask.dat...
19752788443
import tempfile import os import torch from kaner.common import save_text, save_json from kaner.adapter.tokenizer.char import CharTokenizer def test_chartokenizer(): """Test the class `CharTokenizer`.""" tokens = ["[UNK]", "[PAD]", "南", "京", "市", "长", "江", "大", "桥"] token_embeddings = [ [0.0, 0.0]...
knowledgeresearch/kaner
tests/adapter/tokenizer/test_char.py
test_char.py
py
1,483
python
en
code
4
github-code
1
[ { "api_name": "tempfile.TemporaryDirectory", "line_number": 22, "usage_type": "call" }, { "api_name": "kaner.common.save_text", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.save", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.t...
1041291189
import logging.config import logging.handlers def set_logging(project_name, logging_path='mylog.log'): formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(project_name) logger.setLevel(logging.DEBUG) filehandler = logging.handlers.TimedRot...
Maxsparrow/StatMouse2
statmouse/logger.py
logger.py
py
700
python
en
code
0
github-code
1
[ { "api_name": "logging.config.Formatter", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.config", "line_number": 6, "usage_type": "name" }, { "api_name": "logging.config.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging...
35911465282
import torch from torch.nn.utils.rnn import pad_sequence class Translator: def __init__(self, model, dataset): self.model = model self.dataset = dataset def translate(self, src_strs, device="cuda"): src_field, trg_field = self.dataset.src, self.dataset.trg src_v...
r-gould/transformer
src/translator.py
translator.py
py
2,422
python
en
code
0
github-code
1
[ { "api_name": "torch.tensor", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.int64", "line_number": 29, "usage_type": "attribute" }, { "api_name": "torch.nn.utils.rnn.pad_sequence", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.o...
27783022168
import pandas as pd from pathlib import Path from configs import Config, configs from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from tensorflow.keras.preprocessing.sequence import pad_sequences from tensorflow.keras.utils import to_categorical from typing import Unio...
ClementJu/kaggle-novozymes-enzyme-stability-prediction
src/data_preparation/dataset.py
dataset.py
py
5,745
python
en
code
1
github-code
1
[ { "api_name": "typing.Union", "line_number": 14, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 15, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_numbe...
20275942333
import openpyxl wb = openpyxl.load_workbook('NUMBER_PLATE_LIST (Autosaved)1.xlsx') ws=wb.active count=0 i=0 first=ws['C'] second=ws['D'] a=[] for(cell,cell_1) in zip(first,second): if str(cell.value) == str(cell_1.value).split()[-1]: count=count+1 if str(cell.value) != str(cell_1.value).split()[-1]: ...
drishtiramesh/Python_Scripts
Extract_Wrong_Detections.py
Extract_Wrong_Detections.py
py
647
python
en
code
0
github-code
1
[ { "api_name": "openpyxl.load_workbook", "line_number": 2, "usage_type": "call" } ]
1498623289
#!/usr/bin/env python3 # dpw@Darryls-iMac.localdomain # 2023-03-10 21:45:37 # # @see https://schedule.readthedocs.io/ import threading import time import schedule # no input args; with args, use functools.partial to define def job(): print( f"working at {time.time()} on thread {threading.current_thread...
darrylwest/python-play
concurrency/run-at.py
run-at.py
py
588
python
en
code
0
github-code
1
[ { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "threading.current_thread", "line_number": 17, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 22, "usage_type": "call" }, { "api_name": "schedule.every", ...
25015396838
from typing import Optional, List, Dict from src.db_models import LabelGroup, LabelFormat, FieldScope, CalculatedField, Driver, DriverChange from src.data_models import LabelFormatApi, LabelFormatApiList from src.data_models import CalculatedFieldApi, CalculatedFieldApiList from src.data_models import DriverApi, Drive...
krezac/tesla-race-analyzer
src/backup.py
backup.py
py
6,723
python
en
code
1
github-code
1
[ { "api_name": "typing.Optional", "line_number": 13, "usage_type": "name" }, { "api_name": "src.db_models.FieldScope", "line_number": 13, "usage_type": "name" }, { "api_name": "src.db_models.FieldScope.query.filter_by", "line_number": 13, "usage_type": "call" }, { ...
10541671700
from collections import deque # 각 노드가 연결된 정보를 표현(2차원 리스트) n, m = map(int, input().split(' ')) graph = [[] for _ in range(n+1)] for i in range(m): a,b = map(int,input().split(' ')) graph[a].append(b) # 서로 마주하기 때문에 해당 인덱스의 리스트에 값을 추가한다. graph[b].append(a) #print(graph) def bfs(start) : #...
Lee-han-seok/Solving_Algorithm_SQL
백준/Silver/1389. 케빈 베이컨의 6단계 법칙/케빈 베이컨의 6단계 법칙.py
케빈 베이컨의 6단계 법칙.py
py
1,220
python
ko
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 16, "usage_type": "call" } ]
25015394148
from flask import url_for, flash, Markup, redirect, Response from flask_admin import expose from flask_jwt_extended import create_access_token import pendulum from src.admin.admin_forms import TestLabelFormatForm, TestCalculatedFieldForm, DriverChangeForm, \ ConfigRestoreForm, ConfigBackupForm, GenerateJwtTokenFor...
krezac/tesla-race-analyzer
src/admin/admin_views.py
admin_views.py
py
13,674
python
en
code
1
github-code
1
[ { "api_name": "src.parent_views.MyRoleRequiredCustomView", "line_number": 13, "usage_type": "name" }, { "api_name": "src.admin.admin_forms.TestCalculatedFieldForm", "line_number": 18, "usage_type": "call" }, { "api_name": "src.db_models.FieldScope.query.all", "line_number": 2...
32894121704
import os from PyQt5.QtCore import QObject,pyqtSignal,pyqtSlot import pyautogui from time import sleep class Worker(QObject): 'Object managing the simulation' finished = pyqtSignal() sbMessage = pyqtSignal(list) def __init__(self): super(Worker, self).__init__() def control(self,acti...
konexis/Automate
worker.py
worker.py
py
8,191
python
en
code
0
github-code
1
[ { "api_name": "PyQt5.QtCore.QObject", "line_number": 7, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 9, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 10, "usage_type": "call" }, { "api_name": "py...
39309134173
import tornado.ioloop import tornado.web import requests import argparse class MainHandler(tornado.web.RequestHandler): def get(self, slug): url = "http://osu.ppy.sh/api/{}?".format(slug) # Build URL with all get params for i in self.request.arguments: url += "{}={}&".format(i, self.get_argument(i)) # Re...
osuripple/osuapiproxy
osuapiproxy.py
osuapiproxy.py
py
1,617
python
en
code
1
github-code
1
[ { "api_name": "tornado.ioloop.web", "line_number": 6, "usage_type": "attribute" }, { "api_name": "tornado.ioloop", "line_number": 6, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 19, "usage_type": "call" }, { "api_name": "tornado.ioloop.web"...
5812455236
''' Bitwise operations done on the files ''' import cv2 import numpy as np img1 = np.zeros((250, 500, 3),np.uint8) img1 = cv2.rectangle(img1, (200,0), (300, 100), (255,255,255), -1) img2 = np.zeros((250, 500, 3),np.uint8) img2 = cv2.rectangle(img2, (0, 0), (250, 250), (255,255,255), -1) cv2.imshow('image...
Utkichaps/opencv-tutorial-practice
g.bitwise_ops.py
g.bitwise_ops.py
py
598
python
en
code
0
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.uint8", "line_number": 7, "usage_type": "attribute" }, { "api_name": "cv2.rectangle", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_numbe...
8765523962
#!/usr/bin/env python __author__ = 'MidnightInAPythonWorld' # Check for Python3 import sys if sys.version_info[0] != 3: print("[-] This script requires Python 3") print("[-] Exiting script") exit() # stdlib import json,os,requests,argparse # Check for Pandas try: import pandas as pd except: print...
MidnightInAPythonWorld/API-GreyNoise
api_grey_noise_gnql.py
api_grey_noise_gnql.py
py
2,808
python
en
code
0
github-code
1
[ { "api_name": "sys.version_info", "line_number": 6, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 39, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path.isfile", ...
13430467993
""" Usage: Start the flask server by running: $ python tests/test_map_flask.py And then head to http://127.0.0.1:5000/ in your browser to see the map displayed """ import base64 from flask import Flask import folium from folium import IFrame from mongoengine import connect from PhotoManagement.db ...
ydethe/photomanagement
tests/test_map_flask.py
test_map_flask.py
py
2,130
python
en
code
0
github-code
1
[ { "api_name": "PhotoManagement.db.Address.objects", "line_number": 28, "usage_type": "call" }, { "api_name": "PhotoManagement.db.Address", "line_number": 28, "usage_type": "name" }, { "api_name": "base64.b64encode", "line_number": 50, "usage_type": "call" }, { "ap...
15592539446
#!/usr/bin/env python import sys import string import xml.dom.minidom class NamedElement: def __init__(self, xml_element): name_element = xml_element.getElementsByTagName('name')[0] self.name = name_element.firstChild.data.strip() class DocumentedElement: def __init__(self, xml_element): doc_element = xml_ele...
niahoo/exmms2
priv/genipc/genipc.py
genipc.py
py
5,278
python
en
code
0
github-code
1
[ { "api_name": "xml.dom.minidom.dom.minidom.parse", "line_number": 171, "usage_type": "call" }, { "api_name": "xml.dom.minidom.dom", "line_number": 171, "usage_type": "attribute" }, { "api_name": "xml.dom.minidom", "line_number": 171, "usage_type": "name" } ]
12476247076
from keras.models import load_model import keras import numpy as np from keras import backend as K from sklearn.metrics import accuracy_score import sys import tensorflow as tf tf.compat.v1.disable_eager_execution() def cal_adversis_epsilon(data,gradient,epsilon): adversaries=data + epsilon * np.sign(g...
Suraj-Jha1508/Deep_Learning_CS677
assignment_10/test.py
test.py
py
1,919
python
en
code
1
github-code
1
[ { "api_name": "tensorflow.compat.v1.disable_eager_execution", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.compat", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.sign", "line_number": 13, "usage_type": "call" }, { "api_...
23003384613
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on Feb 20, 2013 @author: Maribel Acosta @author: Fabian Floeck @author: Michael Ruster ''' from mw.xml_dump import Iterator as mwIterator from mw.xml_dump.functions import EXTENSIONS as mwExtensions from mw.xml_dump.functions import open_file from functions.print...
0nse/WikiWho
WikiWho.py
WikiWho.py
py
5,085
python
en
code
null
github-code
1
[ { "api_name": "os.path.isdir", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 31, "usage_type": "call" }, { "api_name": "mw.xml_dump.functions.EXTENSION...
22817131703
# -*- coding: utf-8 -*- # @Author: Jeremiah # @Date: 2017-05-26 23:27:33 # @Last Modified by: jemarks # @Last Modified time: 2017-05-31 20:13:15 #This file exists in order to provider some basic objects for SRs, SPs, Stores, and backstop reports. import datetime import os import pandas import collections from p...
jeremiahmarks/vcde
backstop_automation/backstop_objects.py
backstop_objects.py
py
3,841
python
en
code
0
github-code
1
[ { "api_name": "collections.namedtuple", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 58, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 58, "usage_type": "attribute" }, { "api_name...
12889471327
import numpy as np import torch from torch.utils.data.dataloader import DataLoader from torchvision import transforms from functions import* import os ''' bbvi without Rao_Blackwellization and Control Variates ''' num_epochs=1 batchSize=500 num_S=5#训练的采样数量 dim=1000000+1 eta=0.05#步长 num_St=100#测试的采样数量 interval=20 #读取数据...
allenzhangzju/Black_Box_Variational_Inference
bbvi_criteo4000000/bbvi_basic.py
bbvi_basic.py
py
2,620
python
en
code
1
github-code
1
[ { "api_name": "numpy.linspace", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.utils.data.dataloader.DataLoader", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 24, "usage_type": "call" }, { "api_name": "tor...
40365228173
#encoding=utf-8 import sktensor import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import sys import os import scipy.io as scio import numpy as np np.seterr(divide='ignore', invalid='ignore') from random import random from scipy.sparse import rand as sprand from compt_methods import * from road_sim...
qiushye/ITS_217
tensor_cpt.py
tensor_cpt.py
py
21,683
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.seterr", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.io", "line_numb...
3415780911
import os from reportlab.pdfgen import canvas from reportlab.lib.utils import ImageReader def img2pdf(filepath): name = filepath + '.pdf' raw_file = os.listdir(filepath) ''' get img file''' img_list = [] for i in raw_file: end = i.split('.')[-1] if end in ['jpg','jpeg','pn...
ll104567/image2pdf
image2pdf.py
image2pdf.py
py
792
python
en
code
0
github-code
1
[ { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "reportlab.pdfgen.canvas.Canvas", "line_number": 19, "usage_type": "call" }, { "api_name": "reportlab.pdfgen.canvas", "line_number": 19, "usage_type": "name" }, { "api_name": "repo...
73742107553
# detect jolly jumpers import sys from functools import reduce def is_jolly(nums): if len(nums) == 1: return True # else check the diffs mask = [False for x in range(len(nums))] mask[0] = True # the zero diff does not count i = 0 j = 1 while j < len(nums): diff = abs(nums[j...
DylanMeeus/CompetitiveProgramming3
UVa/chapter2/10038.py
10038.py
py
863
python
en
code
1
github-code
1
[ { "api_name": "functools.reduce", "line_number": 21, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 28, "usage_type": "attribute" } ]
75205683873
#!/usr/bin/env python # -*- coding: utf-8 -*- """ files_to_database.py Create a database with all files in selected directory """ import os import sys import sqlite3 from pathlib import Path import hashlib class Database: def __init__(self, name): self.conn = sqlite3.connect(name) self.cur = self....
thejoltjoker/python
files/files_to_database.py
files_to_database.py
py
1,842
python
en
code
0
github-code
1
[ { "api_name": "sqlite3.connect", "line_number": 16, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 45, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_number": 50, "usage_type": "call" }, { "api_name": "sys.argv", "line_number"...
32738209475
import argparse from colorama import init from .common import Fore, Messages, Path from .. import Havok def parse_args(): parser = argparse.ArgumentParser( description="Compare Havok packfiles.\nAlso works between Wii U and Switch packfiles." ) parser.add_argument( "hkFiles", type=Path, ...
krenyy/botw_havok
botw_havok/cli/hk_compare.py
hk_compare.py
py
1,257
python
en
code
4
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" }, { "api_name": "common.Path", "line_number": 14, "usage_type": "name" }, { "api_name": "colorama.init", "line_number": 21, "usage_type": "call" }, { "api_name": "common.Messages.loa...
29783814673
#!/usr/bin/env python from StringIO import StringIO import pycurl # The BeautifulSoup module from bs4 import BeautifulSoup import lxml import argparse url = 'http://kotaku.com/' storage = StringIO() storage = StringIO() c = pycurl.Curl() c.setopt(c.URL, url) c.setopt(c.WRITEFUNCTION, storage.write) # again setting hea...
jmgamboa/Scrapers
ScrapeStringio.py
ScrapeStringio.py
py
791
python
en
code
2
github-code
1
[ { "api_name": "StringIO.StringIO", "line_number": 10, "usage_type": "call" }, { "api_name": "StringIO.StringIO", "line_number": 11, "usage_type": "call" }, { "api_name": "pycurl.Curl", "line_number": 12, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...
42776218853
import numpy as np import plotly.graph_objs as go alpha = 0.01 length = 1 # length of the kernel a = 1 t = 1 # time for modeling h = 1e-2 # x-axis step of the mesh tau = 1e-2 # time step of the mesh M = int(length / h) + 1 # amount of x-axis nodes of the mesh : 11 now y = np.array([]) # array with y(n, i) values...
lehakofficial/HARD_KERNEL
Gauss_method.py
Gauss_method.py
py
2,789
python
en
code
0
github-code
1
[ { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.append", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_numb...
18544973064
#!/usr/bin/env python3 import os import secrets import sqlite3 from flask import Flask from flask import Response from flask import jsonify from flask import redirect from flask import render_template from flask import request from flask import url_for app = Flask(__name__) app.config["API_URL"] = os.environ.get("AP...
Varbin/historisch-gewachsen.de
app.py
app.py
py
2,185
python
en
code
2
github-code
1
[ { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 16, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "lin...
33622872466
# coding:utf-8 import requests from lxml import html import os import datetime from multiprocessing.dummy import Pool as ThreadPool import multiprocessing import re from multiprocessing import Pool def header(referer): headers = { 'Host': 'i.meizitu.net', 'Pragma': 'no-cache', 'Accept-Enco...
liuyongliu/liuyong_code
妹子图爬取.py
妹子图爬取.py
py
3,570
python
en
code
0
github-code
1
[ { "api_name": "lxml.html.fromstring", "line_number": 30, "usage_type": "call" }, { "api_name": "lxml.html", "line_number": 30, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "lxml.html.fromstring", ...
40759539134
import json import pickle import random from os.path import join, dirname import nltk from random import shuffle from string import punctuation from sklearn.feature_extraction import DictVectorizer from sklearn.pipeline import Pipeline from sklearn.svm import LinearSVC from JarbasModelZoo.features import extract_word...
OpenJarbas/ModelZoo
train/postag/sklearn_macmorpho_udep_svm.py
sklearn_macmorpho_udep_svm.py
py
3,791
python
en
code
1
github-code
1
[ { "api_name": "nltk.download", "line_number": 26, "usage_type": "call" }, { "api_name": "string.punctuation", "line_number": 86, "usage_type": "name" }, { "api_name": "nltk.corpus.mac_morpho.tagged_sents", "line_number": 90, "usage_type": "call" }, { "api_name": "...
20255221258
import os from collections import namedtuple from pathlib import Path import string import random from PIL import Image from PIL.ImageFile import ImageFile from werkzeug.utils import secure_filename from configuration import SoccerConfig Chunk = namedtuple("Chunk", "path url") STORAGE_PATH = Path(SoccerConfig.STORA...
IsnandaZain/bola-app
soccer/libs/file.py
file.py
py
2,953
python
en
code
1
github-code
1
[ { "api_name": "collections.namedtuple", "line_number": 14, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "call" }, { "api_name": "configuration.SoccerConfig.STORAGE_PATH", "line_number": 15, "usage_type": "attribute" }, { "...
29489219323
import math from typing import Callable import pandas as pd import numpy as np import matplotlib.pyplot as plt def GetInterval(start:int,end:int,step:float, fn:Callable[[float],float]) -> dict[str,list[int]]: x = np.linspace(start,end,math.ceil((end-start)/step)) my_dict = {"X":[],"Y":[]} for i in x: ...
Grinduim/Bosch-2022.2
Bosch/Revisão Python - Queila/Arquivos Prova/untitled1.py
untitled1.py
py
806
python
en
code
0
github-code
1
[ { "api_name": "typing.Callable", "line_number": 7, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 8, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", ...
15651178657
# -*- coding: utf-8 -*- import multiprocessing import os def do_this(what): whoami(what) def whoami(what): print("进程 %s 说: %s" % (os.getpid(), what)) if __name__ == '__main__': whoami('我是主程序') for n in range(4): p = multiprocessing.Process(target=do_this, args=("我是 #%s 进程" % n,)) ...
ivix-me/note-introducing-python
ch10/1003/100302/mp.py
mp.py
py
357
python
en
code
0
github-code
1
[ { "api_name": "os.getpid", "line_number": 13, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 19, "usage_type": "call" } ]
33764436406
''' using :keyword:`with` statement ''' from easyprocess import EasyProcess from pyvirtualdisplay.smartdisplay import SmartDisplay if __name__ == "__main__": with SmartDisplay(visible=0, bgcolor='black') as disp: with EasyProcess('xmessage hello'): img = disp.waitgrab() img.show()...
tawfiqul-islam/RM_DeepRL
venv/lib/python3.6/site-packages/pyvirtualdisplay/examples/screenshot3.py
screenshot3.py
py
321
python
en
code
12
github-code
1
[ { "api_name": "pyvirtualdisplay.smartdisplay.SmartDisplay", "line_number": 8, "usage_type": "call" }, { "api_name": "easyprocess.EasyProcess", "line_number": 9, "usage_type": "call" } ]
42233449488
from http import HTTPStatus from django.test import TestCase from konekt.forms import CandidateForm, EducationFormset, ExperienceFormset, SkillsFormset class TestForms(TestCase): def test_candidate_form(self): form = CandidateForm({ 'name': 'Pierre Dupont', 'job': 'DevOps', ...
sebabert/Konekt-pub
konekt/konekt/tests.py
tests.py
py
2,701
python
en
code
0
github-code
1
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "konekt.forms.CandidateForm", "line_number": 10, "usage_type": "call" }, { "api_name": "konekt.forms.EducationFormset", "line_number": 43, "usage_type": "argument" }, { "...
23030254845
from django.db import models from django.contrib.auth.models import AbstractUser from django.utils.translation import gettext_lazy as _ # Create your models here. def user_avatar_path(user, filename: str): return 'avatar/user_{0}/{1}'.format(user.username, filename) def user_thumbnail_path(user, filename: str):...
blueglasses1995/VideoRecomApp
users/models.py
models.py
py
1,341
python
en
code
0
github-code
1
[ { "api_name": "django.contrib.auth.models.AbstractUser", "line_number": 15, "usage_type": "name" }, { "api_name": "django.db.models.EmailField", "line_number": 16, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 16, "usage_type": "name" }, { ...
9919923837
import logging import json from flask import request, jsonify; from codeitsuisse import app; logger = logging.getLogger(__name__) @app.route('/encryption', methods=['POST']) def encrypt(): data = request.get_json(); logging.info("data sent for evaluation {}".format(data)) result = [] f...
hlx1024/pythondemo25th
codeitsuisse/routes/secret_message.py
secret_message.py
py
1,023
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request", "line_number": 12, "usage_type": "name" }, { "api_name": "logging.info", ...
72919674913
from django.urls import path, include from . import views urlpatterns = [ path('', views.IndexView.as_view()), path('alumno/', views.AlumnoView.as_view(),name='alumnos'), path('alumno/<int:alumno_id>', views.AlumnoDetailView.as_view()), path('alumno_horario/', views.Alumno_HorarioView.as_view()), # Co...
aaronbarra040998/avanve-proy03
Avance API ALumnos/lab13/api/urls.py
urls.py
py
434
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
73799501155
#Data analaysis using Instagram from IPython.display import Image from IPython.display import display from InstagramAPI import InstagramAPI username="krisha_mehta" InstagramAPI = InstagramAPI(username,"prideandprejudice") InstagramAPI.login() InstagramAPI.getProfileData() result = InstagramAPI.LastJson #print(result)...
krishamehta/InstagramAnalysis
instagram.py
instagram.py
py
1,145
python
en
code
0
github-code
1
[ { "api_name": "InstagramAPI.InstagramAPI", "line_number": 7, "usage_type": "name" }, { "api_name": "InstagramAPI.InstagramAPI.login", "line_number": 8, "usage_type": "call" }, { "api_name": "InstagramAPI.InstagramAPI", "line_number": 8, "usage_type": "name" }, { "...
29710262008
from datetime import datetime from db import db class BookCopieModel(db.Model): __tablename__ = 'book_copie' id = db.Column(db.Integer, primary_key=True) contribution_date = db.Column( db.DateTime(timezone=True), default=datetime.utcnow) book_id = contributor_user_id = db.Column(db.Integer,...
rezid/api-rest
models/book_copie.py
book_copie.py
py
1,339
python
en
code
0
github-code
1
[ { "api_name": "db.db.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "db.db", "line_number": 5, "usage_type": "name" }, { "api_name": "db.db.Column", "line_number": 8, "usage_type": "call" }, { "api_name": "db.db", "line_number": 8, "u...
8077731236
import json def get_historique_user(user): # Load existing user data from the file (if any) try: with open('users.json', 'r') as f: users = json.load(f) except FileNotFoundError: users = [] # Search for the user in the list for u in users: if u['user...
RadouaneElarfaoui/BankSystem
get_history.py
get_history.py
py
724
python
en
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" } ]
18558221401
""" Implementation of a language predictor based on a transformer architecture by the wonderful OpenNMT team at Harvard. SOURCE: OpenNMT: Open-Source Toolkit for Neural Machine Translation AUTHORS: Guillaume Klein Yoon Kim Yuntian Deng Jean Senellart Alexander M. Rush EDITORS: Lu...
nonas-hunter/adventure-generator
transformer.py
transformer.py
py
23,533
python
en
code
3
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 27, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 27, "usage_type": "name" }, { "api_name": "torch.tensor", "line_number": 103, "usage_type": "call" }, { "api_name": "torch.tensor", "line_...
26465804587
##### Sales Prediction with Linear Regression import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns pd.set_option("display.float_format", lambda x: "%.2f" % x) from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_absolute_error, mean_squared_error ...
seymagkts/machine_learning
Module_4/linear_reg_exercises.py
linear_reg_exercises.py
py
5,376
python
tr
code
0
github-code
1
[ { "api_name": "pandas.set_option", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 27, "usage_type": "call" }, { "api_name":...
9348809940
from flask import Flask, request, jsonify, make_response from functools import lru_cache import json app = Flask(__name__) """ comma_separtaed_params_to_list splits string when comma occurs and append splitted tokens to a list input_str: input string Returns: a list of tokens separated by commas """ def comma_separ...
johnlgtmchung/flask_api_practice
app.py
app.py
py
3,142
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.make_response", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 24, "usage_type": "call" }, { "api_name": "json.load", "line_nu...
2957910804
#!/usr/bin/python3 import sys from q import run, run_text if len(sys.argv) == 1: while True: text = input('> ') if text == 'exit': break print(run_text(text)) elif len(sys.argv) == 2: run(sys.argv[1]) else: print('Usage: q [file]')
nirvanasupermind/qlang
build/lib/cli.py
cli.py
py
277
python
en
code
0
github-code
1
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "q.run_text", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "q.run", "line_number": 13, ...
6055001780
import glob import os import json import re import tqdm import pickle import pandas as pd import arguments as args files = glob.glob(os.path.join(args.scopes_dir, '*.scopes.json')) os.makedirs(args.cooc_dir, exist_ok=True) def str_normalize(value): return re.sub(r'\s+', ' ', value).lower() def get_item_string_by...
ewoij/cooccurrences-graph
02_build_cooccurrences.py
02_build_cooccurrences.py
py
2,271
python
en
code
0
github-code
1
[ { "api_name": "glob.glob", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "arguments.scopes_dir", "line_...
12826388315
import numpy as np import h5py as hp import sys first = sys.argv[1] second = sys.argv[2] third= sys.argv[3] fourth = sys.argv[4] process = sys.argv[5] grid = (2048,2048,2048) def get_mass(path): try: f=hp.File(path,'r') except IOError: print('files not found') return ...
calvinosinga/HIColor
previous_versions/combine_fields.py
combine_fields.py
py
1,200
python
en
code
0
github-code
1
[ { "api_name": "sys.argv", "line_number": 5, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": ...
10856186589
from collections import Counter def MostPopularNumbers(array, size): c = Counter(array) values = c.most_common(size) return min(values) a = [1, 1, 2, 2, 3, 4, 5, 6] MostPopularNumbers(a, a.count)
luizvictorPa/intro-to-computer-science-with-python
testes_extras/ex3.py
ex3.py
py
213
python
en
code
0
github-code
1
[ { "api_name": "collections.Counter", "line_number": 4, "usage_type": "call" } ]
40057309346
from __future__ import print_function import os,sys,inspect from termcolor import colored currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) import models as Models import global_vars as Global from utils.args imp...
ashafaei/OD-test
setup/model_setup.py
model_setup.py
py
3,061
python
en
code
61
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "inspect.getfile", "line...
36270372978
# -*- coding: utf-8 -*- '''从自己选出的优质股中,读取excel值,查看每个股票的K图,和证券公司的研报,筛选出好的股票存入excel''' import time import pandas as pd from selenium import webdriver from openpyxl import load_workbook class ShowK: def __init__(self): self.share_list0 = [] self.share_list1 = [] def read_from_excel(self): ...
zhouxiongaaa/myproject
my_stock/check_k.py
check_k.py
py
2,757
python
en
code
0
github-code
1
[ { "api_name": "openpyxl.load_workbook", "line_number": 16, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 26, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 45, "usage_type": "call" }, { "api_name"...
35730064961
# -*- coding: utf-8 -*- """ Created on Tue Mar 2 09:47:56 2021 @author: ebbek """ import pandas as pd import numpy as np from inflhist import inflhist import scipy.stats as sp from infl_concat import infl_concat from inflhist import inflhist from figure_formatting import figure_formatting from AUcolor import AUcolor ...
ebbekyhl/Future-operation-of-hydropower-in-Europe
scripts/model_evaluation.py
model_evaluation.py
py
13,813
python
en
code
0
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 23, "usage_type": "call" }, { "api_name": "AUcolor.AUcolor", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.font_manager.FontProperties", "line_number": 25, "usage_type": "call" }, { "ap...
38206554377
from flask_app import app from flask import render_template, redirect, request, session from flask_app.models.dojo import Dojo from flask_app.models.ninja import Ninja @app.route('/create_dojo', methods=['POST']) def create_user(): data={ 'name':request.form['name'], } Dojo.create_dojo(data) ...
megikapo18/dojo_ninjas
flask_app/controllers/dojos.py
dojos.py
py
620
python
en
code
0
github-code
1
[ { "api_name": "flask.request.form", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 12, "usage_type": "name" }, { "api_name": "flask_app.models.dojo.Dojo.create_dojo", "line_number": 14, "usage_type": "call" }, { "api_...
413332120
from pathlib import Path from copy import deepcopy from typing import Callable, Optional, Any, \ Union, Generator, TextIO import numpy as np from dae.utils.variant_utils import get_interval_locus_ploidy from dae.variants_loaders.raw.flexible_variant_loader import \ flexible_variant_loader from dae.variants....
iossifovlab/gpf
dae/dae/variants_loaders/cnv/flexible_cnv_loader.py
flexible_cnv_loader.py
py
13,075
python
en
code
1
github-code
1
[ { "api_name": "typing.Any", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Callable", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 19, "usage_type": "name" }, { "api_name": "typing.Any", "line_number":...
31383412316
from lingpy import * from collections import defaultdict from sinopy import sinopy import re csv1 = csv2list('2017-02-18-Behr-1-197-draft-2-western.csv', strip_lines=False) csv2 = csv2list('2017-02-18-Behr-1-197-draft-2-eastern.csv', strip_lines=False) chars = defaultdict(list) for i, line in enumerate(csv2[1:]+csv1...
digling/rhymes
datasets/Behr2008/raw/helper-2017-01-03.py
helper-2017-01-03.py
py
1,929
python
en
code
2
github-code
1
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" }, { "api_name": "sinopy.sinopy.character_from_structure", "line_number": 25, "usage_type": "call" }, { "api_name": "sinopy.sinopy", "line_number": 25, "usage_type": "name" }, { "api_n...
30337427434
#import libraries import os import string import glob import subprocess from subprocess import Popen import shutil import time import datetime from datetime import datetime import pandas as pd import requests import tkinter as tk from tkinter import * from tkinter import ttk from tkinter import messagebox from PIL imp...
simremy/versadb_tk
packages/ginfo.py
ginfo.py
py
29,035
python
en
code
2
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "packages.tool_path.get_current_path", "line_number": 28, "usage_type": "call" }, { "api_name": "packages.tool_path", "line_number": 28, "usage_type": "name" }, { "api_name":...
9333482415
#!/usr/bin/env python3 """ Tests for the `pre_commit.git` submodule. """ from os import path from tempfile import TemporaryDirectory from unittest import ( main, TestCase ) from pre_commit.git import ( ForbiddenCharacterError, GitHandle, RepositoryError ) from tests.util import BasicRepo class T...
spreemohealth/style
tests/test_git.py
test_git.py
py
5,403
python
en
code
2
github-code
1
[ { "api_name": "unittest.TestCase", "line_number": 21, "usage_type": "name" }, { "api_name": "tests.util.BasicRepo", "line_number": 27, "usage_type": "call" }, { "api_name": "pre_commit.git.GitHandle", "line_number": 30, "usage_type": "call" }, { "api_name": "os.pa...
22388472051
from flask import Flask, jsonify, request app = Flask(__name__) accounts = [ {"name":"Billy", 'balance':457.74}, {"name":"Renesmee", 'balance':-150.0}, {"name":"Edward", 'balance':4156.9}, {"name":"Marla", 'balance':321.31}, {"name":"Andrew", 'balance':-120.1}, {"name":"Roxane", 'balance':-10....
Kroha1999/3KURS
Univer/REST +/lab 2/get.py
get.py
py
2,190
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 38, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 43, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_numb...
3203865574
import fire,os,sys import numpy as np from tqdm import tqdm from skimage import io,morphology from keras.utils import to_categorical import cv2 from ulitities.base_functions import get_file,send_message_callback,load_label def post_process_segment(inf,outf,Flag_cv=True, minsize=10, area_threshold=1000): # pass ...
scrssys/SCRS_RS_AI
mask_process/remove_small_object.py
remove_small_object.py
py
2,935
python
en
code
1
github-code
1
[ { "api_name": "ulitities.base_functions.load_label", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.o...
38736890564
import numpy as np from matplotlib import pyplot as plt import matplotlib.colors import random as rand class Board: def __init__(self,dim,targetTerrain): #set default values for a board self.board = np.zeros((dim,dim), dtype= float) self.target = (rand.randint(0,dim-1),rand.randint(0,dim-1)) ...
akaashp/ProbabilisticHunting
Board.py
Board.py
py
1,315
python
en
code
0
github-code
1
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 9, "usage_type": "call" }, { "api_name": "random.choices", "line_number": 20, "usage_type": "call" }, { "api_name": "random.randint", "line_nu...
38777068404
""" Aprenda a manipular datas Realizar conversao de texto para data e vice-versa realizar soma e subtracao em datas - Como recuperar a data atual(DATE) - Como trabalhar com a data, alterando sua formatação - Como gerar um horário(TIME) - Retornar data e hora atual(DATETIME) - Alterar formação do DATETIME - Realizar som...
Ademilson12/Aulas_Digital
Basico/aula10.py
aula10.py
py
1,756
python
pt
code
0
github-code
1
[ { "api_name": "datetime.date.today", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 16, "usage_type": "name" }, { "api_name": "datetime.time", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime.now...
32886110882
from nltk.corpus import stopwords from settings.common import word_tf_df from preprocessing_pipeline.NextGen import NextGen from preprocessing_pipeline import (Preprocess, RemovePunctuation, Capitalization, RemoveStopWords, RemoveShortWords, TwitterCleaner, RemoveUrls) def load_fl...
GU-DataLab/topic-modeling-textPrep
process_dataset.py
process_dataset.py
py
2,946
python
en
code
5
github-code
1
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 34, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 34, "usage_type": "name" }, { "api_name": "preprocessing_pipeline.Preprocess", "line_number": 37, "usage_type": "call" }, { ...
21024956783
import os from music21 import humdrum from music21 import converter import chant21 class MultipleSpinesException(Exception): """An exception raised when encountering multiple spines while expecting only 1""" pass def extract_phrases_from_spine(spine): """Enxtract the phrases as music21 streams from k...
bacor/cosine-contours
src/phrases.py
phrases.py
py
2,919
python
en
code
4
github-code
1
[ { "api_name": "music21.humdrum.spineParser.KernSpine", "line_number": 29, "usage_type": "call" }, { "api_name": "music21.humdrum.spineParser", "line_number": 29, "usage_type": "attribute" }, { "api_name": "music21.humdrum", "line_number": 29, "usage_type": "name" }, {...
36279239216
import os import time import threading from dotenv import load_dotenv import pyttsx3 import data_handler from datetime import datetime from datetime import timedelta from task import Task class AssistantApp: def __init__(self): # Initialize text to speech self.engine = pyttsx3.init() # Ini...
johku/Assistant
assistant.py
assistant.py
py
5,966
python
en
code
0
github-code
1
[ { "api_name": "pyttsx3.init", "line_number": 14, "usage_type": "call" }, { "api_name": "data_handler.DataHandler", "line_number": 19, "usage_type": "call" }, { "api_name": "time.split", "line_number": 47, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
39926577938
from datetime import datetime import requests from flask import Flask, render_template app = Flask(__name__) year = datetime.now().year # print(year) response = requests.get('https://api.npoint.io/362a61befce3d173e925') blog_posts = response.json() # print(blog_posts) @app.route('/') def home(): ...
vytautasmatukynas/Python-Random-Learning-Testing
WEB_DEV/flask/flask_1st_templates_forms/flask_project_3_blog_sample/server.py
server.py
py
714
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "requests.get", "...
38317304274
# Importing Required Libraries import cv2 # define a class called ImageReader class ImageReader: def __init__(self, filename): self.filename = filename def read_image(self): try: img = cv2.imread(self.filename) if img is None: raise Exception("Err...
dsvijayvenkat/Computer_Vision_-_OpenCV
1.Reading_an_Image.py
1.Reading_an_Image.py
py
1,890
python
en
code
0
github-code
1
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 24, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "line_n...
3260640635
from collections import deque import sys input = lambda: sys.stdin.readline().rstrip() def bfs(x, y): q = deque() q.append((x, y)) field[x][y] = 0 while (q): a, b = q.popleft() for i in range(8): nx = a + dx[i] ny = b + dy[i] if 0 <= nx <...
zinnnn37/BaekJoon
백준/Silver/4963. 섬의 개수/섬의 개수.py
섬의 개수.py
py
913
python
en
code
0
github-code
1
[ { "api_name": "sys.stdin.readline", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" } ]
74246591074
import tweepy import json import time import datetime import ConfigParser import tweepy from tweepy.streaming import StreamListener ''' Get API keys from Configurations document ''' config = ConfigParser.ConfigParser() config.readfp(open(r'./configurations.txt')) consumerKey=config.get('API Keys', 'consumerKey') con...
kevinjye/EverTweet
tweet_listener.py
tweet_listener.py
py
1,336
python
en
code
1
github-code
1
[ { "api_name": "ConfigParser.ConfigParser", "line_number": 13, "usage_type": "call" }, { "api_name": "tweepy.AppAuthHandler", "line_number": 27, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 28, "usage_type": "call" }, { "api_name": "time.mktim...
18022219984
import cv2 import numpy as np import os os.environ["OPENCV_IO_ENABLE_OPENEXR"]="1" from PIL import Image from utils.metrics_nocs import align, prepare_data_posefitting, draw_detections from datasets.datasets import exr_loader,load_meta syn_depth_path = '/data/sensor/data/real_data/test_0/0000_gt_depth.exr' nocs_path =...
PKU-EPIC/DREDS
CatePoseEstimation/align.py
align.py
py
3,904
python
en
code
89
github-code
1
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 54, "usage_type": "call" }, { "api_name": "cv2.IMREAD_ANYCOLOR", "line...
72107723554
import json import time import datetime import os.path import GlobalConstants import GlobalEnums import Tools from os import path class ChatManager: """ Chat Manager """ def __init__(self): #self.chatChannelGlobal = {} self.createChannel(GlobalEnums.ChatChannel.CHAT_CHANNEL_GLOBAL) def createChannel(self, ...
RottenVisions/ouroboros-prototyping
prototyping/Chat.py
Chat.py
py
2,536
python
en
code
0
github-code
1
[ { "api_name": "GlobalEnums.ChatChannel", "line_number": 18, "usage_type": "attribute" }, { "api_name": "GlobalEnums.ChatChannel", "line_number": 21, "usage_type": "attribute" }, { "api_name": "Tools.getDate", "line_number": 28, "usage_type": "call" }, { "api_name"...
31281558255
import torch import pandas as pd import numpy as np import torch.nn as nn import statistics from DLDUlib import device, train, optimize_ols, center, normalize, r_squared, cross_validate_train import copy names = ['SalePrice','1st_Flr_SF','2nd_Flr_SF','Lot_Area','Overall_Qual', 'Overall_Cond','Year_Built','Year_Rem...
cpsiff/DLDU-Projects
2_nonlinear/my_imp_nonlinear_crossv_train.py
my_imp_nonlinear_crossv_train.py
py
2,166
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.float", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.FloatTensor", "line_number": 16, "usage_type": "call" }, { "api_name": "DLDUlib.center", ...
13953011427
## Code to make a PCR reaction using a pre-mixed master-mix, distribute it between wells ## of a 96-well plate, add primers and add a given number of template samples. ###INPUT### PCR variables num_replicates = 8 num_templates = 4 total_PCR_volume = 20 master_mix_volume = 8 template_volume = 1 primer_volume = 2.5 #...
Arne444/PCR_premixedMM
PCR_premixedMM.py
PCR_premixedMM.py
py
3,516
python
en
code
0
github-code
1
[ { "api_name": "opentrons.containers.load", "line_number": 18, "usage_type": "call" }, { "api_name": "opentrons.containers", "line_number": 18, "usage_type": "name" }, { "api_name": "opentrons.containers.load", "line_number": 19, "usage_type": "call" }, { "api_name...
7087899911
from utils.terminal import clear from utils.Database import Database import requests from utils.OpenApi import OpenApi class Dialogue: def __init__(self): self.database = Database() self.main_menu() self.open_api = OpenApi() def main_menu(self) -> None: """ This funct...
adrien914/P5_Utilisez_les_donnees_publiques_de_OpenFoodFacts
utils/Dialogue.py
Dialogue.py
py
11,416
python
en
code
0
github-code
1
[ { "api_name": "utils.Database.Database", "line_number": 10, "usage_type": "call" }, { "api_name": "utils.OpenApi.OpenApi", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.terminal.clear", "line_number": 23, "usage_type": "call" }, { "api_name": "ut...
1323528673
import pathlib import tarfile import datetime import argparse import json class ConfigParser(): """Configuration file parser.""" def __init__(self, config_file_name: str): """Intialization.""" self._config_file = config_file_name self._config = dict() def parse(self) -> bool: ...
sandeepbhat/home-made-backup
hmb.py
hmb.py
py
3,031
python
en
code
0
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "call" }, { "api_name": "json.load", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 54, "usage_type": "call" }, { "api_name": "datetime.datetime", ...
31584008482
""" Class for weather data. """ from json import loads from requests import get from .location import Location class Weather: """Class for weather data.""" def __init__(self, measure, location: Location, apikey=None): self.apikey = apikey self.measure = measure self.location = locatio...
PiSmartTV/PiTV
PiTV/weather.py
weather.py
py
1,454
python
en
code
14
github-code
1
[ { "api_name": "location.Location", "line_number": 12, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 34, "usage_type": "call" }, { "api_name": "json.loads", "line_nu...
15162365309
import numpy as np import pygplates from scipy import spatial def marsaglias_method(N): ## Marsaglia's method dim = 3 norm = np.random.normal normal_deviates = norm(size=(dim, N)) radius = np.sqrt((normal_deviates**2).sum(axis=0)) points = normal_deviates/radius return points ...
atom-model/ATOM
reconstruction/sphere_tools.py
sphere_tools.py
py
2,408
python
en
code
13
github-code
1
[ { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.sqrt", "line_number": 14, "usage_type": "call" }, { "api_name": "pygplates.PointOnSphere", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.array", ...
4200238882
import itertools import json import math import random import statistics from collections import defaultdict from html.parser import HTMLParser import boto3 import requests from rating import RatingSystem, ContestType old_sponsored_contests = { "code-festival-2014-exhibition", "code-festival-2014-final", ...
kenkoooo/AtCoderProblems
lambda-functions/time-estimator/function.py
function.py
py
20,781
python
en
code
1,291
github-code
1
[ { "api_name": "html.parser.HTMLParser", "line_number": 68, "usage_type": "name" }, { "api_name": "html.parser", "line_number": 79, "usage_type": "argument" }, { "api_name": "math.log", "line_number": 98, "usage_type": "call" }, { "api_name": "math.exp", "line_...
15685183129
import csv from selenium import webdriver import pandas from pandas import DataFrame import requests test_url = "https://downtowndallas.com/experience/stay/" chrome_driver_path = "E:\softwares/chromedriver.exe" driver = webdriver.Chrome(executable_path=chrome_driver_path) driver.get(test_url) driver....
PRANJALI1901/assesment
main.py
main.py
py
1,349
python
en
code
0
github-code
1
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 51, "usage_type": "call" } ]
27587876211
from typing import Dict,List,Tuple,Union,NamedTuple,Optional from typing_extensions import Literal import json,re import daa_luigi from common_functions import ExecutionFolder,raise_exception,as_inputs from copy import copy import pandas as pd from pathlib import Path import sissopp from sissopp.py_interface import get...
MilenaOehlers/cluster-based-SISSO
cluster_based_sisso/__init__.py
__init__.py
py
21,087
python
en
code
5
github-code
1
[ { "api_name": "typing.Dict", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 16, "usage_type": "name" }, { "api_name": "typing_extensions.Literal", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.NamedTuple",...
32509486669
from ftplib import FTP import ftplib import os import xml.etree.ElementTree as EleTree import VAPublishUtil as VAUtil import shutil import EchoItemXML __author__ = 'Jiao Zhongxiao' # 选择的功能分支 FEATURE_BRANCH = None # 确认的版本号 VERSION_NUM = None ASSET_EXT = ".json,.jpg,.png,.swf,.xml,.mp3,.wdp,.xcom" IGNORE_EXT = ".xc...
jiaox99/publishTools
pythonScripts/VACommonPublishTool.py
VACommonPublishTool.py
py
8,536
python
en
code
3
github-code
1
[ { "api_name": "VAPublishUtil.parse_publish_config", "line_number": 26, "usage_type": "call" }, { "api_name": "VAPublishUtil.publish_dir", "line_number": 37, "usage_type": "call" }, { "api_name": "EchoItemXML.scan_dir", "line_number": 39, "usage_type": "call" }, { ...
15662447246
import json import os from flask import ( Flask, jsonify, render_template, request, send_from_directory, redirect, session, url_for, ) import oci from oci.ai_anomaly_detection.models import DetectAnomaliesDetails import postgrest from supabase import create_client, Client from io import...
Salomon-mtz/oxxogas.github.io
app.py
app.py
py
24,643
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 26, "usage_type": "call" }, { "api_name": "os.urandom", "line_number": 29, "usage_type": "call" }, { "api_name": "oci.config.from_file", "line_number": 64, "usage_type": "call" }, { "api_name": "oci.config", "line_nu...
30989959642
# from locale import setlocale, LC_ALL from calendar import month_name, mdays from functools import reduce # setlocale(LC_ALL, 'pt_BR') Lista_meses = filter(lambda x: mdays[x] == 31, range(1, 13)) nome_meses = map(lambda x: month_name[x], Lista_meses) juntar = reduce(lambda todos, nome_mes: f'{todos}\n {nome_mes}', ...
higorsantana-omega/Programacao_funcional_Python
imutabilidade_v1.py
imutabilidade_v1.py
py
381
python
pt
code
0
github-code
1
[ { "api_name": "calendar.mdays", "line_number": 7, "usage_type": "name" }, { "api_name": "calendar.month_name", "line_number": 8, "usage_type": "name" }, { "api_name": "functools.reduce", "line_number": 9, "usage_type": "call" } ]
16692902771
#!/usr/bin/env python import cv2 from lib import tracker BLUE = (255, 50, 50) GREEN = (50, 255, 50) RED = (50, 50, 255) WHITE = (255, 255, 255) def main(): markers = tracker.find_markers(img) for m_id, marker in markers.iteritems(): cv2.drawContours(img, [marker.contour], -1, GREEN, 2) cv2....
antoneri/rover-follow-target
examples/track_all_markers.py
track_all_markers.py
py
1,174
python
en
code
13
github-code
1
[ { "api_name": "lib.tracker.find_markers", "line_number": 13, "usage_type": "call" }, { "api_name": "lib.tracker", "line_number": 13, "usage_type": "name" }, { "api_name": "cv2.drawContours", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.line", ...
20521636348
from turtle import Turtle from paddle import Paddle from scoreboard import Scoreboard from random import randint from time import sleep BALL_RADIUS = 12 # supposedly 10 BALL_SPEED = 9 WINDOW_WIDTH = 960 WINDOW_HEIGHT = 640 class Ball(Turtle): def __init__(self) -> None: super().__init__() ...
LetSleepingFoxesLie/100DaysOfCode_py
22_Pong/ball.py
ball.py
py
2,597
python
en
code
0
github-code
1
[ { "api_name": "turtle.Turtle", "line_number": 14, "usage_type": "name" }, { "api_name": "random.randint", "line_number": 20, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 21, "usage_type": "call" }, { "api_name": "random.randint", "lin...
2090654629
import firebase_admin from firebase_admin import credentials from firebase_admin import firestore import urllib.request import os def to_image_name(user_info): return f'{user_info["name"]}_({user_info["updatedAt"]}).jpg' def get_local_user_from_image_name(image_name): image_name_without_ext = os.path.spli...
huuquyen2606/FID
fast_api.py
fast_api.py
py
1,610
python
en
code
0
github-code
1
[ { "api_name": "os.path.splitext", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "firebase_admin.credentials.Certificate", "line_number": 28, "usage_type": "call" }, { "api_name": "...
2144866290
import requests import re from bs4 import BeautifulSoup from headers import HEADERS from csvImporter import CsvImporter class InfoFinder: def __init__(self, url_tuple_set, file_name): self.url_tuple = url_tuple_set self.has_contact_set = set() self.no_contact_set = set() self.impor...
redvox27/innovatiespotter
omleidingsSites/infoFinderController.py
infoFinderController.py
py
4,517
python
en
code
0
github-code
1
[ { "api_name": "csvImporter.CsvImporter", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "headers.HEADERS", "line_number": 20, "usage_type": "argument" }, { "api_name": "bs4.Beautifu...
38730450704
# raw_to_evoked # simple utility to plot_joint from file name import sys raw_file=sys.argv[1] event_id=1 import mne Raw=mne.io.read_raw_fif(raw_file) Events=mne.find_events(Raw) reject = dict(grad=4e-10, mag=4e-12, eog=150e-6) Epochs=mne.Epochs(Raw, Events, event_id=event_id, tmin=-0.1, tmax=0.8, baseline=(...
smonto/cibr-meg
raw2plot_joint.py
raw2plot_joint.py
py
400
python
en
code
0
github-code
1
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "mne.io.read_raw_fif", "line_number": 11, "usage_type": "call" }, { "api_name": "mne.io", "line_number": 11, "usage_type": "attribute" }, { "api_name": "mne.find_events", "l...