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
17646478091
import xml.etree.ElementTree as ET import gpxpy import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from datetime import datetime,timedelta import osmnx as ox import networkx as nx import xml.sax import fiona import csv fr...
aceacedey/Mode_Detection_and_Parking_Data
TrainTestModechangesCWSelected.py
TrainTestModechangesCWSelected.py
py
10,626
python
en
code
0
github-code
1
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 44, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 44, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 44, "usage_type": "name" }, { ...
23809878721
import os import time import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch from torch.autograd import Variable def save_results_in_csv(y_pred): ''' Saves the predictions of test lung images in the provided csv file :param y_pred: numpy array containing the boolean predictio...
rish01/CPSC340_Covid_Classification
utils.py
utils.py
py
5,273
python
en
code
1
github-code
1
[ { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "lin...
26849576202
import numpy as np from eigen_rootfinding.Macaulay import build_macaulay, find_degree, \ create_matrix from eigen_rootfinding.Multiplication import indexarray,indexarray_cheb,\ msroots,get_rand_combos_matrix from eigen_rootfinding.polyn...
tylerjarvis/eigen_rootfinding
eigen_rootfinding/Nullspace.py
Nullspace.py
py
17,548
python
en
code
0
github-code
1
[ { "api_name": "scipy.special.comb", "line_number": 29, "usage_type": "call" }, { "api_name": "itertools.combinations", "line_number": 32, "usage_type": "call" }, { "api_name": "scipy.special.comb", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.li...
29800726787
import tkinter as tk from tkinter import ttk import os from twisted.internet import tksupport, reactor from autobahn.twisted.component import Component from twisted.internet.defer import inlineCallbacks import pickle from pathlib import Path from googleapiclient.discovery import build import pandas as pd from itertools...
alan-carroll/public_auditory-behavior
src/GUI/server.py
server.py
py
16,621
python
en
code
0
github-code
1
[ { "api_name": "tkinter.Frame", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "tkinter.ttk.Frame", "line_number": 28, "usage_type": "call" }, { "api_name": "tkinter.ttk", ...
1629924878
import environ,os, boto3 from pathlib import Path import base64 import hashlib import datetime BASE_DIR = Path(__file__).resolve().parent.parent environ.Env.read_env(os.path.join(BASE_DIR, '.env')) env = environ.Env( DEBUG=(bool, True) ) def upload(user,image,*args): s3 = boto3.client('s3', aws_acce...
Super-fast-decision-making/Petrasche_back
user/s3upload.py
s3upload.py
py
816
python
en
code
2
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "call" }, { "api_name": "environ.Env.read_env", "line_number": 9, "usage_type": "call" }, { "api_name": "environ.Env", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.join", "l...
322552777
from graphviz import Digraph as DotGraph from wordcloud import WordCloud import matplotlib.pyplot as plt def showGraph(dot, show=True, file_name='textgraph.gv'): dot.render(file_name, view=show) ''' def gshow0(g, file_name='textgraph.gv', show=True): dot = DotGraph() for e in g.edges(): f, t = e # w = ...
ptarau/TextGraphCrafts
textcrafts/vis.py
vis.py
py
832
python
en
code
4
github-code
1
[ { "api_name": "wordcloud.WordCloud", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 24, "usage_type": "name" }, { "api_name": "matplo...
11484444157
from typing import Tuple from neural import * def parse_line(line: str) -> Tuple[List[float], List[float]]: """Splits line of CSV into inputs and output (transormfing output as appropriate) Args: line - one line of the CSV as a string Returns: tuple of input list and output list """ ...
LT-Intro-To-AI/assignment7-BryanD17
cleveland_data.py
cleveland_data.py
py
3,872
python
en
code
0
github-code
1
[ { "api_name": "typing.Tuple", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_number": 40, "usage_type": "name" } ]
32791046376
# uncompyle6 version 3.8.0 # Python bytecode 3.8.0 (3413) # Decompiled from: Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] # Embedded file name: hidden_treasure.pyw import time, queue, msilib, threading, base64, struct, sys, hashlib from Crypto.PublicKey import RSA import platf...
PKU-GeekGame/geekgame-1st
writeups/players/thezzisu/data/Algorithm/电子游戏概论/auto_treasure_nox.py
auto_treasure_nox.py
py
6,756
python
en
code
52
github-code
1
[ { "api_name": "hashlib.sha256", "line_number": 11, "usage_type": "call" }, { "api_name": "Crypto.PublicKey.RSA.construct", "line_number": 14, "usage_type": "call" }, { "api_name": "Crypto.PublicKey.RSA", "line_number": 14, "usage_type": "name" }, { "api_name": "pl...
13809327767
from flask import render_template, Blueprint, flash from flask import request, redirect, url_for, session from suchwow.models import Post, Comment, Profile from suchwow.utils.decorators import login_required bp = Blueprint("comment", "comment") @bp.route("/comment/create/post/<post_id>", methods=["GET", "POST"]) @lo...
t-900-a/suchwow
suchwow/routes/comment.py
comment.py
py
1,087
python
en
code
0
github-code
1
[ { "api_name": "flask.Blueprint", "line_number": 7, "usage_type": "call" }, { "api_name": "suchwow.models.Post.filter", "line_number": 12, "usage_type": "call" }, { "api_name": "suchwow.models.Post", "line_number": 12, "usage_type": "name" }, { "api_name": "flask.f...
36982929768
# !apt-get install -y xvfb python-opengl > /dev/null 2>&1 # !pip install gym pyvirtualdisplay > /dev/null 2>&1 import gym import numpy as np import random import math from tqdm import tqdm # We can also use CartPole-v1 but it's slower env_name = "CartPole-v0" # Information from OpenAi Gym's repository, velocity and ...
z1q1chen/Reinforcement-Learning
Assignment 2/Assignment.py
Assignment.py
py
3,726
python
en
code
1
github-code
1
[ { "api_name": "numpy.linspace", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.linspace", "li...
6697572936
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import datetime # Reading the data path = '/Users/iuliano/Documents/Proj/' df = pd.read_excel(path + 'Dataset - Case Study - BI Analyst Wunderflats.xlsx') # Rename columns df = df.rename(columns={'dteday': 'date', ...
MarioIuliano87/project_wf
python_code.py
python_code.py
py
6,217
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_excel", "line_number": 9, "usage_type": "call" }, { "api_name": "seaborn.heatmap", "line_number": 29, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 30, "usage_type": "call" }, { "api_name": "matplotlib.p...
73944272352
from functools import partial import os from argparse import ArgumentParser import numpy as np import open3d as o3d from utils.dyn_feasibility_check import check_dyn_feasible, check_dyn_feasible_parallel, simple_check_dyn_feasible from utils.kin_feasibility_check import check_kin_feasible, check_kin_feasible_parallel ...
Ericcsr/synthesize_pregrasp
data/scripts/generate_data_from_seeds.py
generate_data_from_seeds.py
py
6,266
python
en
code
8
github-code
1
[ { "api_name": "os.listdir", "line_number": 19, "usage_type": "call" }, { "api_name": "open3d.io.read_point_cloud", "line_number": 23, "usage_type": "call" }, { "api_name": "open3d.io", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.listdir", ...
26469890697
import os import random from collections import defaultdict import nltk from nltk.util import ngrams # Step 1: Import necessary libraries nltk.download('punkt') # Step 2: Read and preprocess the text from the files def read_text_files(folder_path): text_corpus = [] for filename in os.listdir(folder_path): ...
Shilpi-droid/IR-Lab-Repository
Experiment1.py
Experiment1.py
py
2,204
python
en
code
0
github-code
1
[ { "api_name": "nltk.download", "line_number": 8, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15,...
30979904425
# -*- coding: utf-8 -*- """ Created on Fri May 19 07:24:06 2017 @author: manuj """ import datetime from django.utils import timezone from dateutil.parser import parse import datefinder import difflib import time import numpy as np import pandas as pd from MovieScraper import MovieScraper from MovieListCleaner import...
manujosephv/MovieScraper
movielistview/Utils.py
Utils.py
py
8,333
python
en
code
0
github-code
1
[ { "api_name": "datetime.datetime", "line_number": 36, "usage_type": "attribute" }, { "api_name": "django.utils.timezone.make_aware", "line_number": 37, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 37, "usage_type": "name" }, { "api...
39304816896
''' An efficient program to solve loopover ''' from collections import deque def SOLVED(scrambled, solved, INVERSE): scrambled = list(map(lambda x: list(map(lambda y:INVERSE[tuple(y)], x)), scrambled)) return scrambled == solved def parity(board): Q = [[1 if board[i][j]!=[i, j] else 0 for j in range(len(boa...
XRFXLP/Puzzle-and-CSP-solvers
Loopover.py
Loopover.py
py
8,573
python
en
code
0
github-code
1
[ { "api_name": "collections.deque", "line_number": 39, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 54, "usage_type": "call" } ]
6864810139
import matplotlib.pyplot as plt import visuals import switch_functions as switch import looper import malus_calc import numpy as np """ These are the used functions. For instructions on how to use them navigate to the README.md solution = switch.single_loop(): switch.activity_switch_emptyslot(seconds,timeout_amount...
DutchProg/Roostermakers
__Main/rooster.py
rooster.py
py
2,554
python
en
code
0
github-code
1
[ { "api_name": "looper.loop_tuner", "line_number": 32, "usage_type": "call" }, { "api_name": "malus_calc.malus_calc", "line_number": 48, "usage_type": "call" }, { "api_name": "visuals.plotter", "line_number": 51, "usage_type": "call" }, { "api_name": "matplotlib.py...
27190966619
#Giải mã base64 --> ảnh from base64 import b64decode #print(b64decode('AQID')) f = open('imagebase64.txt') b64data = f.read() f.close() data = b64decode(b64data) print(len(data)) f = open('out.png', 'wb') f.write(data) f.close()
pytutorial/py2011E
Day10/vd4.py
vd4.py
py
236
python
vi
code
1
github-code
1
[ { "api_name": "base64.b64decode", "line_number": 9, "usage_type": "call" } ]
71869489635
from os import path from setuptools import setup, find_packages here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md'), encoding='utf-8') as readme_file: readme = readme_file.read() requirements = [ 'click' ] test_requirements = [ ] setup( name='intercom', version='0.9',...
bceylan/intercom
setup.py
setup.py
py
1,088
python
en
code
0
github-code
1
[ { "api_name": "os.path.abspath", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 4, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
21073123831
''' Created on 2019年4月8日 @author: bkd ''' from traceback import format_exception import sys from PyQt5.QtWidgets import QMessageBox class global_exception_hander: def new_except_hook(self,etype, evalue, tb): print(''.join(format_exception(etype, evalue, tb))) QMessageBox.information(None, ...
bkdwei/kdFileFinder
kdFileFinder/exception_handler.py
exception_handler.py
py
590
python
en
code
4
github-code
1
[ { "api_name": "traceback.format_exception", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QMessageBox.information", "line_number": 13, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QMessageBox", "line_number": 13, "usage_type": "name" ...
28698897403
from sqlalchemy import Column, MetaData, Table, Integer, String, DateTime from sqlalchemy.sql import func from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.dialects.postgresql import JSON Base = declarative_base() class VcmsFeaturePklFile(Base): __tablename__ = 'feature_pkl_files' sn =...
clubfly/python_flask
orm_models/vcmsfeaturepklfile.py
vcmsfeaturepklfile.py
py
2,353
python
en
code
1
github-code
1
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 11, "usage_type": "argument" }, { ...
2441317746
from asyncio import tasks from airflow import DAG from datetime import datetime, timedelta from airflow.operators.bash_operator import BashOperator default_args = { 'owner': 'airflow', 'retries': 2, 'retry_delay': timedelta(minutes=2) } with DAG( dag_id='my_first_dag', default_arg...
awaisajaz1/apache-airflow-yoda
dags/my_first_dags.py
my_first_dags.py
py
1,412
python
en
code
1
github-code
1
[ { "api_name": "datetime.timedelta", "line_number": 10, "usage_type": "call" }, { "api_name": "airflow.DAG", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "call" }, { "api_name": "airflow.operators.ba...
482110124
# Importing necessary files import os import discord from dotenv import load_dotenv import logging.handlers # .env load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') GUILD = os.getenv('GUILD_ID') # Set up logging logger = logging.getLogger('discord') logger.setLevel(logging.DEBUG) logging.getLogger('discord.http').setL...
D111GENT/The-Hacker-Hut_Discord-Bot
bot.py
bot.py
py
1,702
python
en
code
0
github-code
1
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.handlers.getLogger", ...
30710414666
import matplotlib.pylab as plt import numpy as np import scipy from scipy import interpolate import sys import os from linetools.isgm.abscomponent import AbsComponent import json from pyigm.guis import igmguesses from linetools.spectra.io import readspec import spectrum_analysis_tools as spa # inwave = REST wavelen...
ibutsky/synthetic_spectra
scripts/analysis/eqwrange.py
eqwrange.py
py
11,423
python
en
code
0
github-code
1
[ { "api_name": "numpy.diff", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.append", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.median", "line_number": 67, "usage_type": "call" }, { "api_name": "matplotlib.pylab.subplots", ...
33488482675
import tensorflow.compat.v2 as tf from scipy.optimize import minimize import numpy as np import tensorflow_probability as tfp import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter np.sum(np.array([a for a in ra...
Mikhail-Klochkov/diploma_project
another_variant.py
another_variant.py
py
5,991
python
en
code
0
github-code
1
[ { "api_name": "numpy.sum", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 13,...
3002930568
#!/usr/bin/env python # -*- coding: utf-8-*- import xml.etree.ElementTree as ET import tarfile import zipfile import re from pathlib import Path import shutil import os import pymysql import sys import traceback import subprocess import getpass import Archive as archive if __name__ in '__main__': print('処理対象の年度:範...
rise-pat/patent
fulltxt/Entry.py
Entry.py
py
3,310
python
en
code
0
github-code
1
[ { "api_name": "re.match", "line_number": 22, "usage_type": "call" }, { "api_name": "re.match", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 29, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 35, "usa...
35077688849
from django.db import models from django.utils import timezone from datetime import datetime, timedelta from django import forms #===========Project_Information============================= class ProjectInformation(models.Model): class Meta: verbose_name = 'Project Information Record' RESPON...
stan3000/Projectmanagement
management/models.py
models.py
py
9,328
python
en
code
1
github-code
1
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 22, "usage_type": "call" }, { "api_name": ...
31216769509
import logging from urllib.parse import unquote from datetime import datetime from biocontainers.common.models import MongoToolVersion, ContainerImage from biocontainers.common.utils import call_api from bs4 import BeautifulSoup logger = logging.getLogger('biocontainers.singularity.models') class SingularityReader:...
BioContainers/biocontainers-backend
biocontainers/singularity/models.py
models.py
py
2,279
python
en
code
3
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "biocontainers.common.utils.call_api", "line_number": 28, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 33, "usage_type": "call" }, { "api_name":...
3677143997
from datetime import date data_atual = date.today() data_em_texto = "0{}/0{}/{}".format(data_atual.day, data_atual.month,data_atual.year) listaNomes = ['Andre','Joao','Luccas'] listaIdades = [23,21,25] listaNascimento = ['23/11/1998','05/07/2000','18/01/1996'] listaMesMenor = ['04', '06', '09', '11'] def men...
andreduarte07/python
cadastroFunc.py
cadastroFunc.py
py
4,311
python
pt
code
1
github-code
1
[ { "api_name": "datetime.date.today", "line_number": 2, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 2, "usage_type": "name" } ]
19059817629
import pandas as pd #pip install pandas import pyttsx3 #pip install pyttsx3 import speech_recognition as sr #pip install SpeechRecognition engine = pyttsx3.init('sapi5') voices = engine.getProperty('voices') # print(voices[1].id) engine.setProperty('voice', voices[0].id) def speak(audio): engine.say(audio...
Ateeq1234/google_sheets
a.py
a.py
py
1,291
python
en
code
0
github-code
1
[ { "api_name": "pyttsx3.init", "line_number": 5, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 17, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 18, "usage_type": "call" }, { "api_name"...
74257419234
#from torchvision.datasets.vision import VisionDataset from core.VisionDataset import VisionDataset from PIL import Image import os import os.path import imageio import numpy as np import random from torchvision import transforms import torch def has_file_allowed_extension(filename, extensions): """Checks if...
cc-hpc-itwm/FacialGAN
Training/core/own_data_loader.py
own_data_loader.py
py
10,969
python
en
code
16
github-code
1
[ { "api_name": "os.path.expanduser", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path", "line_number": 45, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 55, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
37550127205
import numpy as np from scipy.stats import invwishart import matplotlib.pyplot as plt #Initialization mu0 = [0, 0] cov0 = [[5, 0], [0, 5]] dim = 2 df = 10 scale = np.eye(dim) scale[0,1] = 0.5 scale[1,0] = 0.5 #K = Number of Gaussian, N = Number of data per Gaussian K = 3 N = 1000 means = [] covariances = [] #Randoml...
nlhoang/Machine-Learning
GMM_generate.py
GMM_generate.py
py
1,628
python
en
code
0
github-code
1
[ { "api_name": "numpy.eye", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random.multivariate_normal", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 24, "usage_type": "attribute" }, { "api_name": "scipy.st...
31891553494
# pp_session.py import logging from datetime import datetime from enum import Enum import pandas as pd from typing import Optional from binance import enums as k_binance from src.pp_market import Market from src.pp_order import Order, OrderStatus from src.pp_account_balance import AccountBalance from src.xb_pt_calcu...
xavibenavent/polaris_plus
src/pp_session.py
pp_session.py
py
14,070
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 59, "usage_type": "name" }, { "api_name": "src.pp_market.Market", "line_number": 67, "usage_type": "call" }, { "api_name": "src.pp_balance_manag...
25202177087
import re import time import scrapy from common.domain.hotel import Hotel from common.domain.review import Review from database.database_connector import DatabaseConnector from google_trans_new import google_translator from scrapy import Request from textblob import TextBlob class TripAdvisorSpider(scrapy.Spider): ...
nbratanov/HotelSummaryGenerator
hotel_information/crawlers/spiders/trip_advisor_spider.py
trip_advisor_spider.py
py
5,953
python
en
code
0
github-code
1
[ { "api_name": "scrapy.Spider", "line_number": 13, "usage_type": "attribute" }, { "api_name": "google_trans_new.google_translator", "line_number": 16, "usage_type": "call" }, { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "datab...
44323054852
"""" Use Cases 1. Create an artifact for my project using 7zip. (This should not be the common installer's responsibility) 2. Install my artifact to my local maven repository. 3. Publish my artifact to a remote snapshot repository. 4. Publish my artifact to a remote release repository. 5. Pull down the latest release v...
chasefarmer2808/CommonInstaller
CommonInstaller.py
CommonInstaller.py
py
2,931
python
en
code
0
github-code
1
[ { "api_name": "subprocess.Popen", "line_number": 21, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 23, "usage_type": "attribute" }, { "api_name": "subprocess.PIPE", "line_number": 24, "usage_type": "attribute" }, { "api_name": "subprocess...
71894306274
from django.shortcuts import render from charts.echarts import line_chart, Colors def dashboard_view(request): total_page_views = { "x": ["mon", "tue", "wed", "thur", "fri", "sat", "sun"], "y": [8, 20, 15, 20, 50, 30, 35], "chart_title": "Total Page Views", } unique_visitors = { ...
KiwiKid/ai-budget-bot
app/charts/views.py
views.py
py
892
python
en
code
0
github-code
1
[ { "api_name": "charts.echarts", "line_number": 23, "usage_type": "name" }, { "api_name": "charts.echarts.line_chart", "line_number": 24, "usage_type": "call" }, { "api_name": "charts.echarts.line_chart", "line_number": 25, "usage_type": "call" }, { "api_name": "ch...
9349186636
from django.contrib import admin from .models import Question, Choice class ChoiceInline(admin.TabularInline): model = Choice extra = 3 class QuestionAdmin(admin.ModelAdmin): # Adjust which fields get shown on list display. list_display = ('question_text', 'pub_date', 'was_published_recently') ...
danielhanold/docker-compose-sandbox
django-gunicorn/web/polls/admin.py
admin.py
py
1,099
python
en
code
0
github-code
1
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 7, "usage_type": "name" }, { "api_name": "models.Choice", "line_number": 8, "usage_type": "name" }, { "api_name"...
25650586638
import requests if __name__ == '__main__': query = input("请输入搜索内容") data={ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" } url = f'https://www.baidu.com/s?wd={query}' resp = requests.get(url,headers=dat...
tgeuuy/Crawler
easy/01/request_get .py
request_get .py
py
379
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" } ]
553169162
"""Blogly application.""" from flask import Flask, request, render_template, redirect, flash, session from flask_debugtoolbar import DebugToolbarExtension from models import db, connect_db, User, Post, Tag, PostTag app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql:///users' app.config['SQLALC...
austindreosch/springboard
exercises/section2/sqlalchemy/users-posts-tags-part3/app.py
app.py
py
4,821
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_debugtoolbar.DebugToolbarExtension", "line_number": 13, "usage_type": "call" }, { "api_name": "models.connect_db", "line_number": 15, "usage_type": "call" }, { "api_name": ...
28610302176
#! /usr/bin/env python # -*- coding: utf-8 -*- # Authors: Veronika Kohler # Katharina Schwarz # Patrick Wieschollek <mail@patwie.com> """ Re-Implementation "Will People Like Your Image?" based on TensorPack to support reproducible multi-gpu training. """ from arod_provider import Triplets import arg...
cgtuebingen/will-people-like-your-image
training/ArodProcessing/triplets_to_txt_file.py
triplets_to_txt_file.py
py
1,309
python
en
code
60
github-code
1
[ { "api_name": "arod_provider.Triplets", "line_number": 22, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 40, "usage_type": "call" } ]
25238645318
from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from django.views.generic import ListView from .forms import OrderForm import datetime from django.utils import timezone from django.urls import reverse from image.models import Images from like.models import Likes from .seri...
MaxOstermann/projectInsta
insta/views.py
views.py
py
5,024
python
en
code
0
github-code
1
[ { "api_name": "forms.OrderForm", "line_number": 17, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 21, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 21, "usage_type": "call" }, { "api_name": "...
4762653150
from django.conf.urls import patterns, url, include from django.contrib import admin admin.autodiscover() from photos.views import * urlpatterns = patterns('', url(r'^login$', login), url(r'^register$', register), url(r'^logout$', logout), url(r'^index/$', index), url(r'^public/$', public), url(r'addPhotoSet/$',...
tcOops/photoShare
photos/urls.py
urls.py
py
438
python
en
code
1
github-code
1
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 3, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 3, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 6, "usage_type": "call" }, { "api...
1879661887
import json import time import pandas as pd start_time = time.time() counter=0 file_path="list.json" main_dictionary=dict() with open(file_path, "r") as file: for line in file: data = json.loads(line) if "tags" in data: for element in data["tags"]: if element not in main...
lorinco/ADM-HW2
AWSQ/start.py
start.py
py
865
python
en
code
0
github-code
1
[ { "api_name": "time.time", "line_number": 4, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 30, "usage_type": "call" }, { "api_name": "time.time", "line_number": 3...
74786758433
from conans import ConanFile, CMake, tools import os class TracyConan(ConanFile): name = "tracy" license = "BSD-3-Clause" author = "Stepan Gatilov stgatilov@gmail.com" description = "A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applicatio...
fholger/thedarkmodvr
ThirdParty/custom/tracy/conanfile.py
conanfile.py
py
1,668
python
en
code
62
github-code
1
[ { "api_name": "conans.ConanFile", "line_number": 5, "usage_type": "name" }, { "api_name": "conans.tools.get", "line_number": 15, "usage_type": "call" }, { "api_name": "conans.tools", "line_number": 15, "usage_type": "name" }, { "api_name": "os.rename", "line_n...
74419549154
import torch class PGDAttacker(): def __init__(self, radius, steps, step_size, random_start, norm_type, ascending=True): self.radius = radius / 255. self.steps = steps self.step_size = step_size / 255. self.random_start = random_start self.norm_type = norm_type self...
fshp971/robust-unlearnable-examples
attacks/pgd_attacker.py
pgd_attacker.py
py
2,643
python
en
code
35
github-code
1
[ { "api_name": "torch.rand_like", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.rand_like", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.autograd.grad", "line_number": 34, "usage_type": "call" }, { "api_name": "torch.autograd", ...
34166704308
#!/usr/bin/python3 import yaml, sys import numpy as np import matplotlib.pyplot as plt def latex_float(x): exp = int(np.log10(x*1.0)) if abs(exp) > 2: x /= 10.0**exp if ('%.1g' % x) == '1': return r'10^{%.0f}' % (exp) return r'%.1g\times10^{%.0f}' % (x, exp) else: ...
droundy/sad-monte-carlo
plotting/cluster.py
cluster.py
py
2,499
python
en
code
4
github-code
1
[ { "api_name": "numpy.log10", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 31, "usage_type": "attribute" }, { "api_name": "yaml.load", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 3...
41307346874
from tkinter import * import threading import hashlib from threading import Thread import time from time import sleep from random import randint import RPi.GPIO as GPIO import serial import mariadb from mfrc522 import SimpleMFRC522 GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(18, GPIO.OUT) GPIO.output(18...
MateuszLabun9/Bachelors-degree-project
last-form.py
last-form.py
py
16,324
python
pl
code
1
github-code
1
[ { "api_name": "RPi.GPIO.setmode", "line_number": 14, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 14, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", "line_number": 14, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setwarnings", ...
24504867120
from blog_handler import BlogHandler from models.post import Post from google.appengine.ext import db def blog_key(name='default'): return db.Key.from_path('blogs', name) class DeletePost(BlogHandler): """ Handler for deleting posts There is no GET because users shouldn't be visiting this POST: Ge...
sunwrobert/fullstack-nd
projects/multi-user-blog/handlers/delete_post.py
delete_post.py
py
1,121
python
en
code
1
github-code
1
[ { "api_name": "google.appengine.ext.db.Key.from_path", "line_number": 7, "usage_type": "call" }, { "api_name": "google.appengine.ext.db.Key", "line_number": 7, "usage_type": "attribute" }, { "api_name": "google.appengine.ext.db", "line_number": 7, "usage_type": "name" }...
30045890519
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
openstack/senlin
senlin/tests/unit/api/openstack/test_versions.py
test_versions.py
py
2,052
python
en
code
44
github-code
1
[ { "api_name": "senlin.tests.unit.common.base.SenlinTestCase", "line_number": 26, "usage_type": "attribute" }, { "api_name": "senlin.tests.unit.common.base", "line_number": 26, "usage_type": "name" }, { "api_name": "unittest.mock.Mock", "line_number": 29, "usage_type": "ca...
1498862699
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 19 06:57:07 2023 @author: dpw implement a Taylor series about x = 0 to calculate (approximate) the value of e or any power of e. """ from sympy import factorial def f(x, n): return float(x**n / factorial(n)) def sum_series(x, *args, **kw...
darrylwest/python-play
maths/euler-sum.py
euler-sum.py
py
560
python
en
code
0
github-code
1
[ { "api_name": "sympy.factorial", "line_number": 16, "usage_type": "call" } ]
35635247841
import os import sys import copy dir=os.getcwd() dir_list=dir.split("/") source_list=dir_list[:-1] + ["src"] source_loc=("/").join(source_list) sys.path.append(source_loc) from EIS_class import EIS from pandas import read_csv import numpy as np import matplotlib.pyplot as plt from EIS_optimiser import EIS_optimiser, EI...
HOLL95/General_electrochemistry
EIS/laviron_param_scans.py
laviron_param_scans.py
py
6,211
python
en
code
2
github-code
1
[ { "api_name": "os.getcwd", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "math.pi", "line_number": 37,...
20616988771
# -*- coding: utf-8 -*- from __future__ import unicode_literals import warnings warnings.filterwarnings( 'ignore', category=UserWarning) import nltk.tokenize as tk import nltk.corpus as nc import nltk.stem.snowball as sb import gensim.models.ldamodel as gm import gensim.corpora as gc doc = [] with open('topic.txt...
demo112/1809
PythonWeb/基础/前端课程资料/买的网页/MS/day6/topic1.py
topic1.py
py
1,417
python
en
code
0
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 4, "usage_type": "call" }, { "api_name": "nltk.tokenize.RegexpTokenizer", "line_number": 20, "usage_type": "call" }, { "api_name": "nltk.tokenize", "line_number": 20, "usage_type": "name" }, { "api_name": "nl...
72339719074
import math import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from locked_dropout import LockedDropout from ON_LSTM import ONLSTMStack from fakegcn import Graph class Pos_choser(nn.Module): ### Take in the tree currently generated, and return the distribution of positions to inser...
ZacharyChenpk/temp_model
model.py
model.py
py
7,679
python
en
code
3
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 11, "usage_type": "name" }, { "api_name": "torch.nn.Dropout", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
74386086752
from flask import Flask, request, render_template from flask_sqlalchemy import SQLAlchemy import math app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = ( 'mysql+pymysql://YanServer:123test@yanzzp.xyz:3306/test2' ) db = SQLAlchemy(app) class Calculation(db.Model): id = db.Column(db.Integer, primar...
Yanzzp/calculator
app.py
app.py
py
1,610
python
en
code
3
github-code
1
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.req...
71912287713
# Encode a text to prevent "shoulder surfing" import base64, sys if len(sys.argv) != 2: print("Usage: " + sys.argv[0] + " text") else: enc = [] msg = "warning:" for i, ch in enumerate(sys.argv[1]): key_c = msg[i % len(msg)] enc_c = chr((ord(ch) + ord(key_c)) % 256) enc.append(enc...
CAST-Extend/com.castsoftware.aip.datamart
utilities/encode.py
encode.py
py
405
python
en
code
1
github-code
1
[ { "api_name": "sys.argv", "line_number": 3, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "base64.urlsafe_b64encode", ...
16615457674
""" algorithm:实现软间隔化的核函数SVM二分类算法 reference:http://github.com/ajtulloch/svmpy Note:上面参考地址给出了基于凸优化库cvxopt的svm实现版本,代码写的很棒,但是对于cvxopt库了解不多,后面如果有机会希望重写一下这个算法,相信会加深理解的。 采用slearn实现svm dataset:lonosphere_dataset.txt author:crazicoco """ from sklearn.svm import SVC # sklearn.preprocessing 提供三种数据标准化的处理方式,...
crazicoco/ML-basic-algorithm
Soft-margin kernel SVM/main.py
main.py
py
2,464
python
en
code
0
github-code
1
[ { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 27, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 34, "usage_type": "call" }, { "api_name": "random.random", "line_number": 40, "usage_type": "call" }, { "api_name": "sklear...
21870447900
import sqlite3 import time import httplib2 import os import sys from apiclient.discovery import build from apiclient.errors import HttpError from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage from oauth2client.tools import argparser, run_flow ###############################...
penroff4/yt_tumblr_automation
ytdb_tools.py
ytdb_tools.py
py
13,715
python
en
code
0
github-code
1
[ { "api_name": "time.strftime", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", "line_num...
25185509753
import yaml import logging settings = dict() log_levels = { 'DEBUG': logging.DEBUG, 'INFO': logging.INFO, 'WARNING': logging.WARNING, 'ERROR': logging.ERROR, 'CRITICAL': logging.CRITICAL, } with open("../config.yaml", 'r') as stream: try: settings = yaml.safe_load(stream) sett...
rkaganda/MBTL_NN
src/config.py
config.py
py
427
python
en
code
2
github-code
1
[ { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.WARNING", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.ERROR"...
24324612905
# !/usr/bin/env python # ! _*_ coding:utf-8 _*_ # @TIME : 2018/12/14 19:26 # @Author : Noob # @File : basepage.py """ Project:基础类BasePage,封装所有页面都公用的方法; 定义open函数,重定义find_element,switch_frame,send_keys等函数; 在初始化方法中定义驱动driver,基本url,title; WebDriverWait提供了显示等待方式; """ from selenium.webdriver.support.ui import WebDrive...
NoobZeng/Selenium
chapter08/page_object/basepage.py
basepage.py
py
6,383
python
zh
code
1
github-code
1
[ { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 66, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expected_conditions.visibility_of_element_located", "line_number": 66, "usage_type": "call" }, { "api_name": "selenium.webdriver.suppo...
5856923631
from cgitb import html from keras.models import load_model from flask import * from PIL import Image from sqlalchemy import false, true from werkzeug.utils import secure_filename import cv2 import numpy as np import easyocr import os model = load_model('icrecognition.h5') classes = { 0 : 'No Pain', 1 : 'Pain...
Aqiliman24/icdetection
icrecognitionapp.py
icrecognitionapp.py
py
2,261
python
en
code
0
github-code
1
[ { "api_name": "keras.models.load_model", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", ...
40928928603
import base58 import json import time from Crypto.Hash import SHA3_256, SHA3_512, RIPEMD160 from Crypto.Signature import PKCS1_v1_5 from transaction import Transaction, TransactionMerkleTree from wallet import Wallet class Block: def __init__(self, index, transactions, timestamp, previous_hash, nonce=0): ...
BleuHund/BlockChainTest
main.py
main.py
py
4,775
python
en
code
0
github-code
1
[ { "api_name": "transaction.TransactionMerkleTree", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 28, "usage_type": "call" }, { "api_name": "Crypto.Hash.SHA3_512.new", "line_number": 29, "usage_type": "call" }, { "api_name": ...
2835711998
from cgi import test from basicsr.losses.losses import L_color import torch from collections import OrderedDict from os import path as osp from tqdm import tqdm from basicsr.archs import build_network from basicsr.losses import build_loss from basicsr.metrics import calculate_metric from basicsr.utils import get_root_...
zheng980629/CUE
basicsr/models/LearnablePrior_model.py
LearnablePrior_model.py
py
13,065
python
en
code
9
github-code
1
[ { "api_name": "base_model.BaseModel", "line_number": 17, "usage_type": "name" }, { "api_name": "basicsr.archs.build_network", "line_number": 24, "usage_type": "call" }, { "api_name": "basicsr.archs.build_network", "line_number": 28, "usage_type": "call" }, { "api_...
665721454
import json import cv2 # PDI from pipeline.PipelinePDI import PipelinePDI pipelinePDI = PipelinePDI() date, url_json, image = pipelinePDI.set_input('pdi_mocked.json') image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) cv2.imwrite('noe.jpg', image_rgb) results = pipelinePDI.detect_offers(url_json, image, date) with o...
maryane-castro/deploystreamlit
outro/main.py
main.py
py
669
python
en
code
1
github-code
1
[ { "api_name": "pipeline.PipelinePDI.PipelinePDI", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_number": 10, "usage_type": "attribute" }, { "api_name": "c...
71052805793
# -*- coding: utf-8 -*- import scrapy import re import json from Scrapy_Cnluqiao_V1.items import ScrapyCnluqiaoV1Item import time from scrapy.utils import request from Scrapy_Cnluqiao_V1.start_urls import url1 class CnluqiaoV1Spider(scrapy.Spider): name = 'cnluqiao_V1' # allowed_domains = ['123'] # start_...
JevisCHF/Building
Information/Spider/Scrapy_Cnluqiao_V1/Scrapy_Cnluqiao_V1/spiders/cnluqiao_V1.py
cnluqiao_V1.py
py
3,915
python
en
code
1
github-code
1
[ { "api_name": "scrapy.Spider", "line_number": 11, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 20, "usage_type": "call" }, { "api_name": "Scrapy_Cnluqiao_V1.items.ScrapyCnluqiaoV1Item", "line_number": 28, "usage_type": "call" }, { "a...
73100306274
""" Run a nongaussian Kalman Filter twin experiment with Lorenz-63 """ # Load modules import numpy as np import pickle import mod_KalmanDA as da import LorenzModels as LM import matplotlib.pyplot as plt import tikzplotlib as tpl # Options for DA run n_wind = 25 # Number of DA window...
SnnVL/DynamicalGaussianLognormalReverseLognormalKalmanfilter
run_KF_one.py
run_KF_one.py
py
13,036
python
en
code
0
github-code
1
[ { "api_name": "pickle.load", "line_number": 40, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 41, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 42, "usage_type": "call" }, { "api_name": "numpy.random.default_rng", "l...
72115662114
from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth import get_user_model from django.contrib.auth.decorators import login_required from account.models import User from .models import Task import sweetify from twilio.rest import Client import os import environ @login_required(log...
Geoslim/eattendance-with-face-recognition
eAttendance/tasks/views.py
views.py
py
3,637
python
en
code
0
github-code
1
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 15, "usage_type": "call" }, { "api_name": "account.models.User", "line_number": 15, "usage_type": "argument" }, { "api_name": "models.Task.objects.create", "line_number": 22, "usage_type": "call" }, { ...
72153307874
""" Browser (:mod:`pydent.browser`) ================================= .. versionadded:: 0.1 Browser class created .. currentmodule:: pydent.browser Browser class for searching and cacheing results. """ import re from collections import OrderedDict from difflib import get_close_matches from pprint import pformat ...
aquariumbio/pydent
pydent/browser.py
browser.py
py
47,188
python
en
code
6
github-code
1
[ { "api_name": "pydent.exceptions.TridentBaseException", "line_number": 42, "usage_type": "name" }, { "api_name": "pydent.interfaces.QueryInterfaceABC", "line_number": 46, "usage_type": "name" }, { "api_name": "pydent.interfaces.QueryInterface", "line_number": 51, "usage_t...
22474648795
import sys import torch import requests from PIL import Image from torchvision import transforms from matplotlib import pyplot as plt # from models.clipseg import ClipDensePredT from models.clipseg import CLIPDensePredT # load model # model = ClipDensePredT(version="ViT-B/16", reduce_dim=64) model = CLIPDensePredT...
Unknown-Box/tmp
main.py
main.py
py
1,877
python
en
code
0
github-code
1
[ { "api_name": "models.clipseg.CLIPDensePredT", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.load", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image.open"...
6033947324
from typing import List """ Summary: Iterate over the array in a while loop for len(arr) times. Pointer starts at 0. If element is not zero, move pointer -> one step. Else, pop the item and append to the end, don't move the pointer, the list shifts left. ---------------------------------------------------------------...
EvgeniiTitov/coding-practice
coding_practice/sample_problems/leet_code/easy/283_move_zeros.py
283_move_zeros.py
py
1,979
python
en
code
1
github-code
1
[ { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 50, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 61, "usage_type": "name" } ]
72228016995
# USAGE # python opencv-crop.py # loading image from disk loads as NumPy array # restate image = NumPy array # to crop you need to know how opencv slices # arrays start at 0 so the numbers are not inclusive # ratio is row:column format # if you go :, 3 you won't get 3..youll get up to 2 # 0 1 | 2| 3 4 5 # 10 11 |...
dmarcus-wire/opencv
cropping/opencv-crop.py
opencv-crop.py
py
1,088
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 29, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 30, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line...
14936093270
"""Unit tests model_utils functions.""" from remedi import models import pytest import torch def assert_equals(actual, expected, path="actual"): """Simple implementation of torch-friendly deep equality.""" assert type(actual) is type(expected), path if isinstance(actual, torch.Tensor): assert act...
evandez/REMEDI
tests/test_models.py
test_models.py
py
1,470
python
en
code
91
github-code
1
[ { "api_name": "torch.Tensor", "line_number": 11, "usage_type": "attribute" }, { "api_name": "remedi.models.map_to", "line_number": 39, "usage_type": "call" }, { "api_name": "remedi.models", "line_number": 39, "usage_type": "name" }, { "api_name": "pytest.mark.para...
32099441902
import cv2 import numpy as np def find_list_files(pattern_filename, path): ''' Find list of files following a pattern filename within a path This returns a list of results, void list [] if items not found ''' import os,fnmatch result = [] for root, dirs, files in os.walk(path): # o...
rcolomina/ALOCC_Keras
landsat_data_loader.py
landsat_data_loader.py
py
2,223
python
en
code
null
github-code
1
[ { "api_name": "os.walk", "line_number": 12, "usage_type": "call" }, { "api_name": "fnmatch.fnmatch", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15,...
74857798754
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.http import HttpResponse from .models import Tag, User, Image from rest_framework import status from rest_framework.request import Request import json from django.views.decorators.http import require_http_methods import logging from .utils impo...
muzzafer5/photosapp
backend/restapi/image_views.py
image_views.py
py
12,613
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.request.Request", "line_number": 14, "usage_type": "name" }, { "api_name": "logging.error", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.error", "line_number": 17, "usage_type": "call" }, { "api_name": "utils.vali...
3199037024
import telebot from telebot import types from aiogram.types import ReplyKeyboardRemove, \ ReplyKeyboardMarkup, KeyboardButton, \ InlineKeyboardMarkup, InlineKeyboardButton import os import django from backend import local2 as local from worker.models import Worker, TGBotCode os.environ.setdefault('DJANGO_SET...
ScrollPage/Case-In
backend/service.py
service.py
py
2,103
python
ru
code
0
github-code
1
[ { "api_name": "os.environ.setdefault", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "django.setup", "line_number": 14, "usage_type": "call" }, { "api_name": "telebot.TeleBot", ...
18112717135
from Client0 import Client from Seq1 import Seq from colorama import Fore, init init(autoreset=True) PRACTICE = 2 EXERCISE = 5 print(f"-----| Practice {PRACTICE}, Exercise {EXERCISE} |------") s1 = Seq() filename = Seq.get_file2() s1.read_fasta(filename) frag1 = s1.strbases[:10] frag2 = s1.strbases[11:20] frag...
loreaferreno/2021_2022-PNE-practices
P2 done again/Session 9 - Practice 2/Exercise 6.py
Exercise 6.py
py
1,319
python
en
code
0
github-code
1
[ { "api_name": "colorama.init", "line_number": 5, "usage_type": "call" }, { "api_name": "Seq1.Seq", "line_number": 16, "usage_type": "call" }, { "api_name": "Seq1.Seq.get_file2", "line_number": 17, "usage_type": "call" }, { "api_name": "Seq1.Seq", "line_number"...
15149130683
import subprocess import os from unittest import mock from unittest.mock import patch, Mock import pytest import logging import sys from src.build_java import build_java def test_update_path_for_jdk(): original_path = os.environ['PATH'] build_java.update_path_for_jdk('java8') expected_path = '/usr/lib/j...
ariadne-pereira/projeto
test_build_java.py
test_build_java.py
py
1,594
python
en
code
1
github-code
1
[ { "api_name": "os.environ", "line_number": 12, "usage_type": "attribute" }, { "api_name": "src.build_java.build_java.update_path_for_jdk", "line_number": 13, "usage_type": "call" }, { "api_name": "src.build_java.build_java", "line_number": 13, "usage_type": "name" }, ...
6383171021
import matplotlib.pyplot as plt import numpy as np import matplotlib.animation def getPerimeterPoints(targetPoint, S_inverse, angleStep, gateThreshold): """ Input: targetPoint : np.array(shape = (dimX, 1)) S_inverse : np.array(shape = (dimZ, dimZ)) angleStep : float ...
Royzon/2020_staj
madeUpTracking/myHelpers/visualizeHelper.py
visualizeHelper.py
py
9,581
python
en
code
null
github-code
1
[ { "api_name": "numpy.pi", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 24...
35681922206
import logging from conftest import Log_path class LogData: def getLogger(self): logger = logging.getLogger(__name__) logsone = logging.FileHandler(Log_path+"/logfile.log") formatter = logging.Formatter("%(asctime)s :%(levelname)s :%(name)s :%(message)s") logsone.setFormatter(forma...
harshalwarkar2020/AmazonApp
LogFeature/LogRecord.py
LogRecord.py
py
424
python
en
code
0
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.FileHandler", "line_number": 8, "usage_type": "call" }, { "api_name": "conftest.Log_path", "line_number": 8, "usage_type": "name" }, { "api_name": "logging.Formatte...
41933406706
import pandas as pd from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service import os import time from datetime import date, datetime from datetime import timedelta def wait_for_downloads(path): print("Waiting for downloads", end="") while...
rmmaf/Scraping-Indices-Economicos
scripts/sp500.py
sp500.py
py
3,190
python
en
code
0
github-code
1
[ { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17...
34863895895
""" create table product (name varchar(20) primary key, price float, qty int) drop table product # to delete the whole table insert into product values ('Prod1', 34.56, 23) select * from product select * from product where qty > 20 delete from product where qty=0 update product set price=price*1.25 where nam...
MehrdadKianiOsh/Database-API-SQL-
session 3/testSQLite.py
testSQLite.py
py
1,294
python
en
code
0
github-code
1
[ { "api_name": "sqlite3.connect", "line_number": 23, "usage_type": "call" } ]
22453535086
import os import json import io from wp import wp_database, wp_post_query from mailing import mailer WP_DB_CONFIG_FILE_PATH_VAR_KEY = "WP_DB_CONFIG_FILE_PATH" DEFAULT_WP_DB_CONFIG_FILE_PATH = "resource/wp_db_config.json" MAIL_CONFIG_FILE_PATH_VAR_KEY = "MAIL_CONFIG_FILE_PATH" DEFAULT_MAIL_CONFIG_FILE_PATH = "resource...
KEN-00/wp_post_alert
main.py
main.py
py
2,289
python
en
code
0
github-code
1
[ { "api_name": "wp.wp_database.validate_wp_db_config", "line_number": 20, "usage_type": "call" }, { "api_name": "wp.wp_database", "line_number": 20, "usage_type": "name" }, { "api_name": "mailing.mailer.validate_mail_config", "line_number": 30, "usage_type": "call" }, ...
21563575484
from typing import List # lapsolver is quite hard to install on Windows. Fortunately, scipy offers a similar, albeit slower, function. try: from lapsolver import solve_dense as solver except ImportError: from scipy.optimize import linear_sum_assignment as solver from authentication.models import User from rep...
Mines-Paristech-Students/Portail-des-eleves
backend/repartitions/algorithm.py
algorithm.py
py
8,907
python
en
code
23
github-code
1
[ { "api_name": "repartitions.models.UserCampaign", "line_number": 64, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 64, "usage_type": "name" }, { "api_name": "repartitions.models.Proposition", "line_number": 64, "usage_type": "name" }, { "api_...
70510325155
from __future__ import absolute_import import celery import json import sys import time from collections import OrderedDict from dateutil import parser from django.core.cache import cache from django.core.files.uploadedfile import InMemoryUploadedFile from django.core.urlresolvers import reverse from django.test.util...
orcasgit/django-fitbit
fitapp/tests/test_retrieval.py
test_retrieval.py
py
26,946
python
en
code
30
github-code
1
[ { "api_name": "base.FitappTestBase", "line_number": 33, "usage_type": "name" }, { "api_name": "fitapp.models.TimeSeriesDataType.objects.get", "line_number": 52, "usage_type": "call" }, { "api_name": "fitapp.models.TimeSeriesDataType.objects", "line_number": 52, "usage_typ...
44067529059
from urllib import request from urllib.parse import urljoin from bs4 import BeautifulSoup from dotFoods.celery import app from dotFoods import settings from wikiboto.utils import \ url_name_of, \ url_name_of_cat,\ LINK_FILTERS, \ bs_preprocess, \ can_access from wikipage.models import \ WikiL...
dotkrnl/dotFoods
wikiboto/tasks.py
tasks.py
py
3,869
python
en
code
0
github-code
1
[ { "api_name": "celery.utils.log.get_task_logger", "line_number": 21, "usage_type": "call" }, { "api_name": "wikiboto.models.BotoFinished.objects.filter", "line_number": 28, "usage_type": "call" }, { "api_name": "wikiboto.models.BotoFinished.objects", "line_number": 28, "u...
71728359075
import numpy as np import matplotlib.pyplot as plt from pylab import * from matplotlib.widgets import Slider import networkx as nx ########## Here we do some introductory stuff with percolation ########### #update function def update(val): GW = G.copy() for i,j in GW.edges(): if np.random.uniform(0,1) > val: GW....
mengsig/percolation
2DLatticePercolation/bernoulliPercolationNumpy.py
bernoulliPercolationNumpy.py
py
1,097
python
en
code
0
github-code
1
[ { "api_name": "numpy.random.uniform", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "networkx.connected_components", "line_number": 13, "usage_type": "call" }, { "api_name": "...
4364858639
from PPlay.gameimage import * from PPlay.gameobject import * from PPlay.sprite import * import pygame import pickle class Screen: def __init__(self, screen, platforms, sprite, keyboard, slime, mouse, font_screen): self.font_screen = font_screen self.window = screen self.platforms = platfor...
lscrispin/lab-jogos
camera.py
camera.py
py
6,219
python
en
code
0
github-code
1
[ { "api_name": "pygame.font.init", "line_number": 77, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 77, "usage_type": "attribute" }, { "api_name": "pygame.font.SysFont", "line_number": 78, "usage_type": "call" }, { "api_name": "pygame.font", ...
74541723872
import pytest from yarl import URL async def _get_username(web_client_session, app_url): """ Visits /hub/home to get an _xsrf token set to cookies, that we can then pass as a X-XSRFToken header when accessing /hub/api, then the function visit /hub/api/user to get the username as recognized by JupyterH...
jupyterhub/tmpauthenticator
tests/test_tmpauthenticator.py
test_tmpauthenticator.py
py
4,860
python
en
code
20
github-code
1
[ { "api_name": "yarl.URL", "line_number": 60, "usage_type": "call" }, { "api_name": "yarl.URL", "line_number": 61, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 36, "usage_type": "call" }, { "api_name": "pytest.mark", "line_num...
16351746211
import pandas as pd from sklearn.model_selection import GridSearchCV from sklearn.svm import SVC import pickle from sklearn.metrics import roc_curve from matplotlib import pyplot import numpy as np x_train = pd.read_csv('x_train') x_valid = pd.read_csv('x_valid') y_train = pd.read_csv('y_train') y_valid = pd.read_csv(...
Korge/MLProject
SVM K-Fold.py
SVM K-Fold.py
py
1,671
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
31793166667
import requests from datetime import date, datetime, timedelta from json import dump import sys def datespan(start, end, delta=timedelta(days=1)): current = start while current < end: yield current current += delta with open(sys.argv[1], 'w') as file: for dates in datespa...
ktshakhova/cloud_lab2
get_course.py
get_course.py
py
885
python
en
code
0
github-code
1
[ { "api_name": "datetime.timedelta", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "datetime.date", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.timedelta", ...
5254686523
import cirq def balanced(qubits): circuit = cirq.Circuit() for i in range(3): circuit.append(cirq.CNOT(qubits[i], qubits[3])) return circuit def constant(qubits): circuit = cirq.Circuit() circuit.append(cirq.X(qubits[3])) return circuit def run(gate): circuit = cirq.Circuit...
robertGGA/qubit
home2.py
home2.py
py
789
python
en
code
0
github-code
1
[ { "api_name": "cirq.Circuit", "line_number": 4, "usage_type": "call" }, { "api_name": "cirq.CNOT", "line_number": 6, "usage_type": "call" }, { "api_name": "cirq.Circuit", "line_number": 12, "usage_type": "call" }, { "api_name": "cirq.X", "line_number": 13, ...
28228601843
from flask import Flask from flask import render_template from os import environ import Function import requests app = Flask(__name__) # key=43a462f629d817bf91ca4bb95f9cd7b3 @app.route('/') def hello_world(): return render_template( 'Search.html' ) #192.168.191.1:8080 if __name__ == '__ma...
hetianle/AmapApplication
AMapApplication/Main.py
Main.py
py
536
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 11, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 16, "usage_type": "call" }, { "api_name": "os.environ", "lin...
14844254155
import logging from PyQt5.QtCore import QObject, pyqtSignal import ClientTools import zlib import serial import base64 scanner = None logger = logging.getLogger() class ScannerSignalHandler(QObject): barcode_result = pyqtSignal(str) scanner_signal_handler = ScannerSignalHandler() def get_scanner(): if sc...
B9527/pyqt_project
device/Scanner.py
Scanner.py
py
2,225
python
en
code
1
github-code
1
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QObject", "line_number": 12, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 13, "usage_type": "call" }, { "api_name": "serial....
8027393171
#!/usr/bin/env python # -*- coding: utf-8 -*- '''This module contains functions to perform operations on collections of FITS files. ''' ############# ## LOGGING ## ############# import logging from fitsbits import log_sub, log_fmt, log_date_fmt DEBUG = False if DEBUG: level = logging.DEBUG else: level = lo...
waqasbhatti/fitsbits
fitsbits/files.py
files.py
py
33,561
python
en
code
1
github-code
1
[ { "api_name": "logging.DEBUG", "line_number": 18, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 20, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "logging.basicC...
46251647661
from ...utils.exceptions import ArgumentException, AuthenticationException class SendUserRecoveryService: def __init__(self, user_repository, email_factory, email_sender, token_generator): self.user_repository = user_repository self.email_factory = email_factory self.email_sender = email_...
agarciavallejo/buitre
app/services/user/sendUserRecoveryService.py
sendUserRecoveryService.py
py
885
python
en
code
1
github-code
1
[ { "api_name": "utils.exceptions.ArgumentException", "line_number": 14, "usage_type": "call" }, { "api_name": "utils.exceptions.AuthenticationException", "line_number": 20, "usage_type": "call" } ]
74539033312
"""Execution and managing kernels.""" import os import warnings from logging import Logger from pathlib import Path import nbconvert from docutils.parsers.rst import Directive, directives from nbconvert.preprocessors import ExtractOutputPreprocessor from nbconvert.writers import FilesWriter from sphinx.errors import ...
jupyter/jupyter-sphinx
jupyter_sphinx/execute.py
execute.py
py
11,919
python
en
code
173
github-code
1
[ { "api_name": "nbconvert.version_info", "line_number": 15, "usage_type": "attribute" }, { "api_name": "traitlets.version_info", "line_number": 23, "usage_type": "attribute" }, { "api_name": "logging.Logger", "line_number": 25, "usage_type": "name" }, { "api_name":...
28646283616
''' SCRIPT: ReadStoichiometry @Authors: Alberto Cuoci [1] [1]: CRECK Modeling Lab, Department of Chemistry, Materials, and Chemical Engineering, Politecnico di Milano @Contacts: alberto.cuoci@polimi.it @Additional notes: This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRAN...
acuoci/PyTools4OpenSMOKEpp
examples/ReadStoichiometry.py
ReadStoichiometry.py
py
11,438
python
en
code
3
github-code
1
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 21, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_na...
23707946723
import random import sys import numpy as np from tqdm import tqdm import cv2 import os from skimage.util import random_noise from skimage import img_as_ubyte def __augment(img): options = [ 'gaussian', 'poisson', 's&p', ] option = random.choice(options) noise_img = (random_no...
nielsRocholl/pr-assignment-2
task_1/big_cats/pipeline_modules/feature_extraction.py
feature_extraction.py
py
2,555
python
en
code
0
github-code
1
[ { "api_name": "random.choice", "line_number": 19, "usage_type": "call" }, { "api_name": "skimage.util.random_noise", "line_number": 20, "usage_type": "call" }, { "api_name": "skimage.img_as_ubyte", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.ar...
25053880076
# https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ from typing import List """ Time O(n) Space O(1) """ class Solution: def maxProfit(self, prices: List[int]) -> int: prices_length= len(prices) max_profit=0 for i in range(1, prices_length): if prices[i] > pric...
snk95/Sarvesh-Code
Leetcode/Arrays/Best_Time_to_Buy_Sell_Stock_II.py
Best_Time_to_Buy_Sell_Stock_II.py
py
422
python
en
code
0
github-code
1
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" } ]
22526657259
import logging import os DEFAULT_LOGGING_LEVEL = os.environ.get("LOGGING_LEVEL", "INFO") class Logging: """ Singleton for logging. This eases the retrieval of loggers with a uniform format for all the library. """ def __init__(self, level=DEFAULT_LOGGING_LEVEL): self._level = level ...
cryptonglab/poktbot
poktbot/log/poktbot_logging.py
poktbot_logging.py
py
1,565
python
en
code
11
github-code
1
[ { "api_name": "os.environ.get", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.Formatter"...
26062127123
import numpy as np import pandas as pd from scipy.sparse.linalg import svds from scipy.sparse import csc_matrix users=pd.read_json("data/customers.json") users.columns = ["user_id",'username'] products=pd.read_json("data/products.json") products.columns = ["product_id","product_name","price"] ratings=pd.read_json("d...
TranHap/SheCodes-Recommendation-System
mf.py
mf.py
py
2,005
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_json", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_json", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.sparse.csc_mat...
42891539155
from django.urls import path from .views import DashboardView, ProfileView, SettingView, ReportHistoryView app_name = "doctor" urlpatterns = [ path('doctor/dashboard/', DashboardView, name="dashboard"), path('doctor/report/history/', ReportHistoryView, name="report-history"), path('doctor/profile/', Pr...
Zarar-Anwar/glucoma_detect
doctor/urls.py
urls.py
py
429
python
en
code
0
github-code
1
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "views.DashboardView", "line_number": 8, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "views.ReportH...