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
2649383638
# -*- coding: utf-8 -*- __author__ = 'Daniel Donovan' __email__ = 'spitfiredd@gmail.com' __version__ = '0.5.41' from collections import OrderedDict import xmltodict import requests import json import warnings import urllib import xml from lxml import etree from io import StringIO, BytesIO from requests.adapters impor...
spitfiredd/g2x_helpers
g2x_helpers/pyfpds/__init__.py
__init__.py
py
7,255
python
en
code
0
github-code
97
[ { "api_name": "warnings.filterwarnings", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 97, "usage_type": "call" }, { "api_name": "requests.packages.urllib3.util.retry.Retry", "line_number": 98, "usage_type": "call" }, { ...
30106447667
from classes.menu import * from classes.rangos import * from classes.obtención import * from classes.reporte import * import sys import matplotlib.pyplot as plt import matplotlib.animation as animation global pause pause = False global y_data y_data = [] def onclick(event): global pause print("pausa") ...
angiereina0610/lab_temp
main.py
main.py
py
1,620
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib.animation.FuncAnimation", "line_number": 48, "usage_type": "call" }, { "a...
24400688660
# This files contains your custom actions which can be used to run # custom Python code. # # See this guide on how to implement these action: # https://rasa.com/docs/rasa/custom-actions from typing import Any, Text, Dict, List, Union from rasa_sdk import Action, Tracker , FormValidationAction from rasa_sdk.events ...
ayaallaa/Delivery-Chatbot
Rasa_Chatbot/actions/actions.py
actions.py
py
13,314
python
en
code
0
github-code
97
[ { "api_name": "datetime.date.today", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 30, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 30, "usage_type": "call" }, { "api_name": "rasa_sdk.Action"...
7425467830
import pandas as pd import matplotlib.pyplot as plt aurora = pd.read_csv("tmp/rl_test/rl_test_log0.csv") cubic = pd.read_csv("tmp_cubic/cubic_test_log0.csv") fig, axes = plt.subplots(2, 2, figsize=(12, 8)) axes[0, 0].plot(aurora['timestamp'], aurora['throughput'] * 1500 * 8 / 1000000, c='C0', ...
zxxia/RL-CC
src/plot_scripts/plot_cubic_rl.py
plot_cubic_rl.py
py
2,019
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.py...
7636982610
from __future__ import unicode_literals from pn532 import PN532_SPI import vlc import random import re import unicodedata import RPi.GPIO as GPIO GPIO.setwarnings(False) class Reader: TIMEOUT = 1 # seconds DEFAULT = "downloads/default/endline.wav" def __init__(self, player, playlist_map) -> None: ...
craigwconway/joybox
joybox/reader.py
reader.py
py
2,139
python
en
code
0
github-code
97
[ { "api_name": "RPi.GPIO.setwarnings", "line_number": 10, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 10, "usage_type": "name" }, { "api_name": "pn532.PN532_SPI", "line_number": 27, "usage_type": "call" }, { "api_name": "pn532.get_firmware_vers...
853719817
from __future__ import unicode_literals #TODO Send try_dl of music after getting number of track if not automatic #TODO aioify blocking calls #TODO irs music dler #TODO torrent #TODO aria2 dler #TODO Go through WG-TE and add the spotify songs based on today's date: 8 Jun 2018 #TODO repeat n-times module #TODO self_only...
bottest123/forkborg
stdplugins/evil_lord.py
evil_lord.py
py
12,128
python
en
code
1
github-code
97
[ { "api_name": "aioify.aioify", "line_number": 36, "usage_type": "call" }, { "api_name": "aioify.aioify", "line_number": 37, "usage_type": "call" }, { "api_name": "aioify.aioify", "line_number": 38, "usage_type": "call" }, { "api_name": "re.compile", "line_numb...
95102243
#fourier transform in numpy import cv2 as cv import numpy as np from matplotlib import pyplot as plt img = cv.imread('Resources/messi5.jpg',0) # img = np.ones((3,3)) f = np.fft.fft2(img) fshift = np.fft.fftshift(f) fshift_magnitude = np.abs(fshift) magnitude_spectrum = 20*np.log(np.abs(fshift)) plt.subplot(121),plt.im...
hadleyhzy34/opencv
image_processing/image_transform.py
image_transform.py
py
3,958
python
en
code
0
github-code
97
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.fft.fft2", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.fft", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.fft.fftshift", "line_...
73436153918
import sys, os, pathlib, subprocess sys.path.append(os.path.join(pathlib.Path(__file__).resolve().parents[1], 'src')) import physion if os.path.isfile(sys.argv[-1]) and ('.nwb' in sys.argv[-1]): cmd, cwd = physion.assembling.build_NWB.build_cmd(sys.argv[-1]) p = subprocess.Popen(cmd, ...
yzerlaut/physion
tests/build_NWB.py
build_NWB.py
py
406
python
en
code
1
github-code
97
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
44482813728
import os import AtmelCom import time import numpy as np import utils from datetime import datetime th = 900 # threshold de corriente de pulsacion, default 700 tm = 1 # tiempo entre cada ciclo m = AtmelCom.Atmel() freq = [262, 294, 330, 349, 392] dbi = [20, 40, 60] mc = 0 cb = 0 cf = -1 cdbi = -1 duracionplay = 3...
unrealJuanpa/proyectoCortoTS
main.py
main.py
py
3,268
python
es
code
0
github-code
97
[ { "api_name": "AtmelCom.Atmel", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 41, "usage_type": "call" }, { "api_name": "utils.insert", "line_number...
27242146379
''' Neural Style Transfer - Drawing images in the style of another image ''' import IPython.display as display import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np import PIL.Image import time import os from datetime import datetime import tensorflow as tf global start_process, epochs, st...
MichaelCullen2011/NSTBackend
nst_detail.py
nst_detail.py
py
10,461
python
en
code
0
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "name" }, { "api_name": "matplotlib.rcParams", "line_number": 24, "usage_type": "attribute" }, { "api_name": "matp...
35109750778
import sys sys.path.append("./") from time import sleep # import data.dbase.djconn from data.dbase.db_tables import ( Tracking, TrackingBP, SessionCondition, Surgery, ) import pandas as pd dest_fld = "/Users/federicoclaudi/Desktop/mysql-server-locomotion/whole_session_tracking" # check if the folde...
BrancoLab/LocomotionControl
paper/export_whole_session_tracking.py
export_whole_session_tracking.py
py
1,369
python
en
code
3
github-code
97
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number...
75098785598
import bs4, requests, random class arrestorg(): def __init__(self): self.state = "" self.arrestsession = requests.session() self.page = self.arrestsession.get("https://arrests.org/", headers = {'User-Agent': self.RandomAgent()}) def RandomAgent(self): agents_list = [] w...
Beall619/ArrestOrg_Data_API
arrestorg.py
arrestorg.py
py
6,454
python
en
code
0
github-code
97
[ { "api_name": "requests.session", "line_number": 6, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...
28389926417
import torch from torch import nn, optim from torch.utils.data import DataLoader from torchvision import datasets from torchvision import transforms BATCH_SIZE = 128 LEARNING_RATE = 1e-3 EPOCHS = 5 NUM_CLASSES = 10 CHANNELS = 3 device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") print(device) tra...
benlin131020/PyTorch_CNN_CIFAR10
train.py
train.py
py
4,393
python
en
code
0
github-code
97
[ { "api_name": "torch.device", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torchvision.data...
36436380809
#! python3 # collections: Counter, namedtuple, OrderedDictionary, defaultdict, dequeue from collections import deque d = deque() d.append(1) d.append(2) d.appendleft(3) print(d) d.pop() print(d) d.extendleft([4, 5, 6]) print(d) d.rotate(1) print(d)
psyll0n/python-training
deque.py
deque.py
py
279
python
en
code
1
github-code
97
[ { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" } ]
73355647678
import xlwt import json import time import requests import queue as Queue import threading # 本脚本主要通过用户身份证号,已经回溯时间获取用户历史借贷特征 # 设置队列长度 workQueue = Queue.Queue(40000) class myThread(threading.Thread): def __init__(self, name, q,wf): threading.Thread.__init__(self) self.name = name self.q = q...
tianjiansmile/ML_filght
com/untils/get_jinpan_loan_timeback.py
get_jinpan_loan_timeback.py
py
7,687
python
en
code
0
github-code
97
[ { "api_name": "queue.Queue", "line_number": 11, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 13, "usage_type": "attribute" }, { "api_name": "threading.Thread.__init__", "line_number": 15, "usage_type": "call" }, { "api_name": "threading...
7620116274
from flask.ext.wtf import Form from wtforms import StringField, BooleanField, TextAreaField from wtforms.validators import DataRequired, Length, Email from app.models import User class LoginForm(Form): openid = StringField('openid', validators=[DataRequired()]) remember_me = BooleanField('remember_me', defaul...
totoropy/microblog
src/app/forms.py
forms.py
py
2,057
python
en
code
0
github-code
97
[ { "api_name": "flask.ext.wtf.Form", "line_number": 7, "usage_type": "name" }, { "api_name": "wtforms.StringField", "line_number": 8, "usage_type": "call" }, { "api_name": "wtforms.validators.DataRequired", "line_number": 8, "usage_type": "call" }, { "api_name": "w...
29232972379
from google.appengine.ext import db import logging class AdminController(object): def delete_all_entities(self, kind, where_clause=''): logging.info('deleting entities of kind %s' % kind) q = db.GqlQuery("SELECT __key__ FROM " + kind + where_clause) while q.count(): result...
codestorm1/com.roflcode.git.treasure-raider
app/apps/treasure_raider/controllers/adminController.py
adminController.py
py
463
python
en
code
0
github-code
97
[ { "api_name": "logging.info", "line_number": 8, "usage_type": "call" }, { "api_name": "google.appengine.ext.db.GqlQuery", "line_number": 9, "usage_type": "call" }, { "api_name": "google.appengine.ext.db", "line_number": 9, "usage_type": "name" }, { "api_name": "go...
18521247080
import pygame pygame.init() TILE_SIZE = 50 save = 0 WIDTH = 650 HEIGHT = 500 screen = pygame.display.set_mode((WIDTH,HEIGHT)) rem = pygame.sprite.Group.empty NUM_TILES_WIDTH = WIDTH / TILE_SIZE NUM_TILES_HEIGHT = HEIGHT / TILE_SIZE hero = pygame.sprite.Sprite() hero_group = pygame.sprite.GroupSingle(hero) walls ...
timwaganagado/grams
games/puzzle.py
puzzle.py
py
8,071
python
en
code
1
github-code
97
[ { "api_name": "pygame.init", "line_number": 2, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 9, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pygame.sprite", ...
27204599404
############################################### ################### Imports ################### ############################################### import os import sys import json import subprocess from datetime import date from datetime import datetime ############################################### ################# ...
BenSt099/FireCommit
FireCommit_v6/FireCommit.py
FireCommit.py
py
7,216
python
en
code
2
github-code
97
[ { "api_name": "json.load", "line_number": 20, "usage_type": "call" }, { "api_name": "json.JSONDecodeError", "line_number": 34, "usage_type": "attribute" }, { "api_name": "json.JSONDecodeError", "line_number": 44, "usage_type": "attribute" }, { "api_name": "os.path...
2197428616
#!/usr/bin/env python3 # coding=utf-8 # date 2022-12-14 10:56:05 # author calllivecn <c-all@qq.com> import time import asyncio import threading from datetime import datetime def my_func(): for i in range(3): print("sleep(1)") time.sleep(1) return datetime.now() async def fetch_async(func, *ar...
calllivecn/testing
asyncio--/block2async.py
block2async.py
py
1,775
python
en
code
0
github-code
97
[ { "api_name": "time.sleep", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "name" }, { "api_name": "asyncio.get_runnin...
3910576719
# -*- coding: utf-8 -*- import math import sys from typing import Dict import maths.lib as mlib from maths.parser import * from util.log import Logger from util.math import * DEBUG = False class Evaluator: def __init__(self, strict=False): self.frames = [{}] self.arguments = None self.b...
TuringApp/Turing
src/maths/evaluator.py
evaluator.py
py
15,670
python
en
code
37
github-code
97
[ { "api_name": "maths.lib.__dict__.items", "line_number": 22, "usage_type": "call" }, { "api_name": "maths.lib.__dict__", "line_number": 22, "usage_type": "attribute" }, { "api_name": "maths.lib", "line_number": 22, "usage_type": "name" }, { "api_name": "maths.lib....
14930137474
#!/usr/bin/python """ Bar chart demo with pairs of bars grouped for easy comparison. """ import numpy as np import matplotlib.pyplot as plt n_groups = 7 means_men = (0.0, 16.0, 27.4, 60.8, 81.6, 87.3, 81.0) #std_men = (2, 3, 4, 1, 2) means_women = (0.0,3.3, 08.8, 6.3, 11.2, 5.4,4.5) #women = (3, 5, 2, 3, 3) fig, ...
n-getty/iit-cs550-pa3
src/bar_plot.py
bar_plot.py
py
1,044
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.arange", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib....
18542874725
""" httpserver部分主程序 获取http请求 解析http请求 将请求发送给WebFrame 从WebFrame接收反馈数据 将数据组织为Response格式发送给客户端 """ from socket import * from threading import Thread from config import * import re import json # 与后端应用交互 def connect_frame(env): """ 将请求发送给WebFrame 从WebFrame接收反馈数据 """ s = socket() try: s.conn...
SpringSnowB/All-file
m2/d19/httpsever/httpserver.py
httpserver.py
py
2,787
python
en
code
0
github-code
97
[ { "api_name": "json.dumps", "line_number": 29, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 34, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 65, "usage_type": "call" }, { "api_name": "re.match", "line_number": ...
23380906973
import gym from gym import wrappers import numpy as np import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.distributions import Categorical from collections import deque from actor_critic import PolicyModel as Policy def reinforc...
921kiyo/policy-gradient
reinforce.py
reinforce.py
py
1,972
python
en
code
0
github-code
97
[ { "api_name": "gym.make", "line_number": 18, "usage_type": "call" }, { "api_name": "actor_critic.PolicyModel", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.optim", ...
73868064319
import os from sqlalchemy import Column, String, Integer, create_engine from flask_sqlalchemy import SQLAlchemy import json database_name = "postgres" database_path = "postgres://{}@{}/{}".format('postgres:Liszt762!','localhost:5432', database_name) db = SQLAlchemy() def setup_db(app, database_path=database_path): ...
ThePurpleClub/Casting_Agency
src/database/models.py
models.py
py
2,184
python
en
code
0
github-code
97
[ { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 25, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 25, "usage_type": "argument" }, { "api_name": "s...
40792744311
# -*- coding: utf-8 -*- """ Created on Sat Apr 21 11:13:44 2018 @author: walke """ from selenium import webdriver import requests import pandas as pd import time from selenium.webdriver.support.ui import Select from selenium.webdriver.support.ui import WebDriverWait from selenium.common.exceptions import TimeoutExcep...
wodell1/REIT_Scraper
scraper_for_REITS.py
scraper_for_REITS.py
py
3,665
python
en
code
0
github-code
97
[ { "api_name": "time.sleep", "line_number": 27, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 34, "usage_type": "call" }, { "api_name": "selenium.webdriver.Firefox", "line_number": 39, "usage_type": "call" }, { "api_name": "selenium.webdriver",...
25548455125
import urwid class SplashText(urwid.Frame): def __init__(self, text, parent, new_on_return=True): self.new_on_return = new_on_return self.parent = parent bt = urwid.BigText(text, font=urwid.HalfBlock7x7Font()) bt = urwid.Padding(bt, align='center', width='clip') bt = urwid.F...
kyle-silver/strongbad-email
sbemail/screens/SplashText.py
SplashText.py
py
733
python
en
code
1
github-code
97
[ { "api_name": "urwid.Frame", "line_number": 3, "usage_type": "attribute" }, { "api_name": "urwid.BigText", "line_number": 7, "usage_type": "call" }, { "api_name": "urwid.HalfBlock7x7Font", "line_number": 7, "usage_type": "call" }, { "api_name": "urwid.Padding", ...
22032789302
import logging from abc import ( ABC, abstractmethod, ) from collections import defaultdict from typing import Optional from reconcile.gql_definitions.common.ocm_environments import ( query as ocm_environment_query, ) from reconcile.gql_definitions.fragments.ocm_environment import OCMEnvironment from recon...
app-sre/qontract-reconcile
reconcile/oum/base.py
base.py
py
13,596
python
en
code
25
github-code
97
[ { "api_name": "reconcile.utils.runtime.integration.PydanticRunParams", "line_number": 58, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 59, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 60, "usage_type": "name" }, { ...
10640214194
from Tree import * #from gp import MUTATIONPERCENT, CROSSOVERPERCENT import random from GeneticOperators import mutation, crossover import copy import multiprocessing as mp import itertools MUTATIONPERCENT = 0.05 # probabilidade de mutacao CROSSOVERPERCENT = 0.95 # probabilidade de crossover def Generate_O...
NMVRodrigues/TFGP
ReproductionHandler.py
ReproductionHandler.py
py
1,910
python
en
code
2
github-code
97
[ { "api_name": "multiprocessing.Pool", "line_number": 16, "usage_type": "call" }, { "api_name": "itertools.chain.from_iterable", "line_number": 23, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 23, "usage_type": "attribute" }, { "api_name"...
31725822240
''' SpaceShip Logo Image :- Icons made by <a href="https://www.flaticon.com/authors/skyclick" title="Skyclick">Skyclick</a> from <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com</a> Spaceship in game :- Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> ...
Swapnil-Ghodse/Space-Invader
main.py
main.py
py
6,231
python
en
code
0
github-code
97
[ { "api_name": "pygame.init", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 22, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 22, "usage_type": "attribute" }, { "api_name": "pygame.displa...
38999870114
from selenium import webdriver import time import random from PIL import Image from chapter2.ShowapiRequest import ShowapiRequest from base.find_element import FindElement class RegisterFunction(object): def __init__(self,url): self.driver = self.get_driver(url) # 获取并打开url def get_dr...
doufuJ/seleniumpython1
chapter2/register_function.py
register_function.py
py
2,783
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "base.find_element.FindElement", "line_number": 27, "usage_type": "call" }, { "api_na...
31337980773
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'data/$', views.data, name='data'), url(r'model/$', views.model, name='model'), url(r'topic/$', views.topic, name='topic'), url(r'g_all/$', views.g_all, name='g_all'), url(r'g_bias/...
armandosrz/rPoliFact
poliFact/final/urls.py
urls.py
py
725
python
en
code
0
github-code
97
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.co...
71983941119
import typing import settings import discord import enum from discord.ext import commands from discord import app_commands logger = settings.logging.getLogger("bot") def is_owner(): def predicate(interaction: discord.Interaction): if interaction.user.id == interaction.guild.owner_id: ...
vtran0314/discord-bot-learning
Discord-Bot-Python/vid20_slashcommand_check.py
vid20_slashcommand_check.py
py
1,231
python
en
code
0
github-code
97
[ { "api_name": "settings.logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "settings.logging", "line_number": 8, "usage_type": "attribute" }, { "api_name": "discord.Interaction", "line_number": 11, "usage_type": "attribute" }, { "api_name"...
24058692780
"""Abstractions for setting up a Galaxy instance.""" from __future__ import absolute_import from __future__ import print_function import abc import contextlib import os import random import shutil from string import Template from tempfile import mkdtemp from galaxy.containers.docker_model import DockerVolume from gal...
MetabolomicsAustralia-Bioinformatics/galaxy-metabolomics
planemo-de/xenv/lib/python3.7/site-packages/planemo/galaxy/config.py
config.py
py
45,815
python
en
code
1
github-code
97
[ { "api_name": "contextlib.contextmanager", "line_number": 216, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 230, "usage_type": "call" }, { "api_name": "os.path", "line_number": 230, "usage_type": "attribute" }, { "api_name": "galaxy...
21375974611
from django.contrib import admin from VRMApp.models import * class PhysicalInvD_Inline(admin.TabularInline):model = PhysicalInvD @admin.register(PhysicalInvM) class PhysicalInvMAdmin(admin.ModelAdmin): save_on_top = True list_display = ['PInvNo','PInvDate','PInvSeq','RegDT','UptDT'] list_display_links = l...
qqoopp/VRManager
VRMApp/admin/admin_inventory.py
admin_inventory.py
py
1,055
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 4, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 7, "usage_type": "attribute" ...
38026474785
""" This file is part of nand2tetris, as taught in The Hebrew University, and was written by Aviv Yaish. It is an extension to the specifications given [here](https://www.nand2tetris.org) (Shimon Schocken and Noam Nisan, 2017), as allowed by the Creative Common Attribution-NonCommercial-ShareAlike 3.0 Unported [License...
BarDavid248/NAND11
CompilationEngine.py
CompilationEngine.py
py
22,529
python
en
code
0
github-code
97
[ { "api_name": "JackTokenizer.JackTokenizer", "line_number": 45, "usage_type": "name" }, { "api_name": "typing.TextIO", "line_number": 45, "usage_type": "attribute" }, { "api_name": "VMWriter.VMWriter", "line_number": 58, "usage_type": "call" } ]
4437388926
from __future__ import absolute_import, print_function, division from ..datadefs import BindDictFuncs from ..debuggable import Debuggable from ..parse import generic # For pylint-placating dummy defs from ..systems import xdatetime class Error(Exception): """Base class for all exceptions defined in formatter modu...
fhgwright/fwgnss
fwgnss/format/generic.py
generic.py
py
10,166
python
en
code
2
github-code
97
[ { "api_name": "debuggable.Debuggable", "line_number": 22, "usage_type": "name" }, { "api_name": "systems.xdatetime.Constants", "line_number": 26, "usage_type": "attribute" }, { "api_name": "systems.xdatetime", "line_number": 26, "usage_type": "name" }, { "api_name...
25444540472
from datetime import datetime, timedelta, date from django.core.mail import EmailMultiAlternatives import psycopg2 import smtplib from email.mime.text import MIMEText def testing1(): print ("testing1 - every 2 min...") def consultabbdd(): try: usuariosDestinos = [] hoy = datetime.now() ...
marjimveg1/tfgmaria_back
Universidad_back/clock_local.py
clock_local.py
py
3,105
python
es
code
0
github-code
97
[ { "api_name": "datetime.datetime.now", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 15, "usage_type": "call" }, { "api_name": "psycopg2.c...
43260835493
from datetime import datetime, timedelta import re from time import mktime, time from google.appengine.api import memcache from google.appengine.ext import db from werkzeug.contrib.securecookie import SecureCookie from werkzeug.contrib.sessions import ModificationTrackingDict, generate_key from werkzeug.security impo...
kosmikko/bloggart-tipfy
app/distlib/tipfy/ext/session.py
session.py
py
23,958
python
en
code
9
github-code
97
[ { "api_name": "tipfy.REQUIRED_VALUE", "line_number": 58, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 72, "usage_type": "call" }, { "api_name": "werkzeug.contrib.securecookie.SecureCookie.load_cookie", "line_number": 214, "usage_type": "call" }, ...
7836295437
import cv2 import numpy as np org = cv2.cvtColor(cv2.imread('examples/female.png'), cv2.COLOR_BGR2RGB) im = org.copy() mask = np.zeros_like(im) mask[500:700, 600:800, :] = 255 ## height, width, channel im[500:700, 600:800, :] = 255 #plt.imshow(im) cv2.imwrite('examples/pic3.jpg', cv2.cvtColor(im, cv2.COLOR_RGB2BGR)) ...
lognat0704/dlportfolio
inpainting/img_mask.py
img_mask.py
py
359
python
en
code
1
github-code
97
[ { "api_name": "cv2.cvtColor", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2RGB", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.zeros_like", "l...
39334594883
import cv2 import numpy as np from helpers import euc import socket ''' # GREEN HSV VALUES (10:45, 40:255, 10:255), (65:255, 255, 255) # RED HSV VALUES (0, 30:235, 0:230), (0:45, 255, 255) ''' YELLOW = (0,255,255) TERQUIZE = (255,255,0) BLUE = (255,0,0) ADDRESS = ('127.0.0.1', 55555) def main(cam=0): cap = c...
moaz-elesawey/drone-landing-with-vr_world
DroneLandReal.py
DroneLandReal.py
py
2,534
python
en
code
0
github-code
97
[ { "api_name": "cv2.VideoCapture", "line_number": 22, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 23, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 23, "usage_type": "attribute" }, { "api_name": "socket.SOCK_DGRAM"...
14100807820
## # @file # Comparison of the methods used to compute # CNF transformation # from matplotlib import pyplot as plt from sympy import * import time import signal from sympy.logic.boolalg import * try: # From folder from SATsolver import sat_solver from at_magi.Tseitin import tseitin except ImportError: ...
weytho/AttackTree
src/at_magi/Benchmark.py
Benchmark.py
py
14,471
python
en
code
1
github-code
97
[ { "api_name": "signal.signal", "line_number": 28, "usage_type": "call" }, { "api_name": "signal.SIGALRM", "line_number": 28, "usage_type": "attribute" }, { "api_name": "signal.alarm", "line_number": 29, "usage_type": "call" }, { "api_name": "signal.alarm", "li...
10193962109
# Homework 12 # E. Plotnychenko import csv import requests url = "http://api.forismatic.com/api/1.0/" def create_quote_list(quantity): quote_list = [] count = 0 while count < quantity: params = { "method": "getQuote", "format": "json", "key": count } ...
Plotnychenko/Hillel_31_03
homework_12.py
homework_12.py
py
1,274
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "csv.DictWriter", "line_number": 37, "usage_type": "call" } ]
20510875991
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import select2.fields class Migration(migrations.Migration): dependencies = [ ('apptest', '0001_initial'), ] operations = [ migrations.CreateModel( name='Entry', ...
misazr/test_m2m_project
apptest/migrations/0002_entry.py
0002_entry.py
py
562
python
en
code
0
github-code
97
[ { "api_name": "django.db.migrations.Migration", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 15, "usage_type": "call" }, ...
3083937027
from flask import Flask, request, jsonify import util app = Flask(__name__) @app.route('/get_home_teams',methods=['GET']) def get_home_teams(): response = jsonify({ 'home_team':util.get_home_teams() }) response.headers.add('Access-Control-Allow-Origin','*') return response @app.r...
adarshetty11/DSProject_Predict_PL_winner
server/server.py
server.py
py
1,048
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 8, "usage_type": "call" }, { "api_name": "util.get_home_teams", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_...
7863483297
import base64 import os import io import sendgrid from sendgrid.helpers.mail import Mail, Attachment from python_http_client.exceptions import HTTPError from jumpscale.loader import j from jumpscale.clients.base import Client from jumpscale.core.base import fields class SendGridClient(Client): apikey = fields.Str...
threefoldtech/js-sdk
jumpscale/clients/sendgrid/sendgrid.py
sendgrid.py
py
1,847
python
en
code
14
github-code
97
[ { "api_name": "jumpscale.clients.base.Client", "line_number": 12, "usage_type": "name" }, { "api_name": "jumpscale.core.base.fields.String", "line_number": 13, "usage_type": "call" }, { "api_name": "jumpscale.core.base.fields", "line_number": 13, "usage_type": "name" },...
34082337642
"""Tests example correlation""" import matplotlib.pyplot as plt import numpy as np import tensorflow as tf import tensorflow_probability as tfp import probflow as pf tfd = tfp.distributions def test_correlation(plot): """Tests correlation example""" class BayesianCorrelation(pf.Model): def __init...
brendanhasz/probflow
tests/examples/test_example_correlation.py
test_example_correlation.py
py
1,416
python
en
code
164
github-code
97
[ { "api_name": "tensorflow_probability.distributions", "line_number": 11, "usage_type": "attribute" }, { "api_name": "probflow.Model", "line_number": 17, "usage_type": "attribute" }, { "api_name": "probflow.BoundedParameter", "line_number": 19, "usage_type": "call" }, ...
73305115519
from django.contrib.auth.models import User from django.test import TestCase from tobaccocessation.activity_prescription_writing.models import Block from tobaccocessation.activity_prescription_writing.\ templatetags.prescription_state import GetPrescription class FakeRequest(object): pass class GetPrescript...
ccnmtl/tobaccocessation
tobaccocessation/activity_prescription_writing/tests/test_templatetags.py
test_templatetags.py
py
2,017
python
en
code
2
github-code
97
[ { "api_name": "django.test.TestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "tobaccocessation.activity_prescription_writing.models.Block", "line_number": 16, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects.create", "line_numbe...
41285544238
import streamlit as st import tensorflow.keras from PIL import Image, ImageOps import numpy as np from pycaret.classification import load_model, predict_model import pandas as pd import cv2 import os threshold = 0.95 width = 700 # Disable scientific notation for clarity np.set_printoptions(suppress=True) # Load the ...
NapsterZ4/saturdays_second_edition
cataratas_detection.py
cataratas_detection.py
py
12,544
python
en
code
0
github-code
97
[ { "api_name": "numpy.set_printoptions", "line_number": 14, "usage_type": "call" }, { "api_name": "tensorflow.keras.keras.models.load_model", "line_number": 17, "usage_type": "call" }, { "api_name": "tensorflow.keras.keras", "line_number": 17, "usage_type": "attribute" }...
35428903140
# https://leetcode.com/problems/summary-ranges/ from typing import List class Solution: def summaryRanges(self, nums: List[int]) -> List[str]: ranges = [] start = end = nums[0] i = 1 while i < len(nums): if nums[i] - end > 1: ranges.append(f"{start}->{e...
ahsan-007/Competitive-Programming
Daily Streak/Easy/SummaryRanges.py
SummaryRanges.py
py
732
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 7, "usage_type": "name" } ]
74373329598
from collections import deque data = input().split() operators = {'*': lambda a, b: a * b, '/': lambda a, b: a / b, '+': lambda a, b: a + b, '-': lambda a, b: a - b } nums = deque() for symbol in data: if symbol not in operators: nums.append(int(symbol)...
HristianBalevski/Python-Advanced
03.Stacks, Queues, Tuples and Sets - Exercise/02.Expression Evaluator.py
02.Expression Evaluator.py
py
805
python
en
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 10, "usage_type": "call" } ]
26412399821
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import torch from torch import nn as nn from torch.nn import functional as F from model.AutoNER import AutoNER PAD = '<pad>' PAD_id = 0 UNK = '<unk>' UNK_id = 1 BOS = '<bos>' BOS_id = 2 EOS = '<eos>' EOS_id = 3 space = ' ' class AutoNER_with_RL(nn.Module): def __...
tomoris/AutoNER_with_RL
model/AutoNER_with_RL.py
AutoNER_with_RL.py
py
9,615
python
en
code
1
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 22, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 22, "usage_type": "name" }, { "api_name": "model.AutoNER.AutoNER", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.nn.Linear",...
10086832775
import discord import logging import json import os import datetime from flask import Flask from threading import Thread from discord.ext import tasks from itertools import cycle app = Flask(__name__) @app.route('/') def main(): return "ready" def run(): app.run(host="0.0.0.0", port=8000) def keep_alive(...
unendiverse/potato
main.py
main.py
py
2,666
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 24, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.ERROR", ...
2561326517
""" Adopt from Nerfacc utils.py """ import random from typing import Optional import numpy as np import torch import collections # from datasets.utils import Rays, namedtuple_map from models.nerfacc import OccupancyGrid, ray_marching, rendering Rays = collections.namedtuple("Rays", ("origins", "viewdirs")) def nam...
junjy007/snerf2
utils/nerf_utils.py
nerf_utils.py
py
4,340
python
en
code
0
github-code
97
[ { "api_name": "collections.namedtuple", "line_number": 14, "usage_type": "call" }, { "api_name": "random.seed", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random", ...
40734519340
import glob import os import pickle import numpy as np from scipy import interpolate from scipy.spatial import ConvexHull from astropy.table import Table import pandas as pd import matplotlib.pyplot as plt import matplotlib from matplotlib import ticker, cm import seaborn as sns from astropy.io import ascii,fits import...
koconnor4/efficiency_pipeline
efficiency/efficiency_prediction.py
efficiency_prediction.py
py
8,602
python
en
code
0
github-code
97
[ { "api_name": "numpy.min", "line_number": 59, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 60, "usage_type": "call" }, { "api_name": "numpy.min", "line_number": 61, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 61, ...
24914973662
# This file is part of TorreArchimedeBot. # # TorreArchimedeBot is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # TorreArchimedeBot i...
Augugrumi/TorreArchimedeBot
torrearchimedebot/bot/handlers/utility.py
utility.py
py
2,574
python
en
code
14
github-code
97
[ { "api_name": "pytz.timezone", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "attribute" }, { "api_name": "datetime.t...
7009604667
#Python program to find if sudoku is valid import collections def validSudoku(board): rows = collections.defaultdict(set) cols = collections.defaultdict(set) squares = collections.defaultdict(set) for r in range(9): for c in range(9): if board[r][c] == ".": contin...
ajaykrupalk/Neetcode-150
Arrays&Hashing/validSudoku.py
validSudoku.py
py
656
python
en
code
0
github-code
97
[ { "api_name": "collections.defaultdict", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" } ]
31330058758
from typing import List from fastapi import APIRouter, Depends, HTTPException, status from sqlalchemy.orm import Session from .. import models, schemas, utils from ..database import get_db router = APIRouter(prefix="/users", tags=["Users"]) @router.get( "/", status_code=status.HTTP_200_OK, response_model=List[...
likith012/fastapi
app/routers/users.py
users.py
py
1,599
python
en
code
0
github-code
97
[ { "api_name": "fastapi.APIRouter", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 15, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 15, "usage_type": "call" }, { "api_name": "database.get_...
27661089665
from django.db import models class Etiqueta(models.Model): nombre = models.CharField(max_length=200, default="", help_text="") class Meta: ordering = ['-id'] db_table = 'etiquetas' verbose_name_plural = "etiquetas" class JSONAPIMeta: resource_name = 'etiquetas' def __...
EnjambreBit/presentes-backend
presentes/models/etiquetas.py
etiquetas.py
py
360
python
en
code
0
github-code
97
[ { "api_name": "django.db.models.Model", "line_number": 3, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 3, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 4, "usage_type": "call" }, { "api_name": "...
16791598642
from django.db import models from django.db.models import F from django.conf import settings from functools import lru_cache, partial import re import uuid from mptt.models import MPTTModel, TreeForeignKey class Identifier(models.Model): agency = models.CharField(max_length=64) context = models.CharField(max...
METS-Programme/simplemfl
facilities/models.py
models.py
py
6,701
python
en
code
0
github-code
97
[ { "api_name": "django.db.models.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 12, "usage_type": "call" }, { "api_name"...
608200871
from typing import Dict, List, Tuple, Union from sqllineage.core.holders import SubQueryLineageHolder from sqllineage.core.models import Column, Path, SubQuery, Table from sqllineage.exceptions import SQLLineageException from sqllineage.utils.constant import EdgeType class SourceHandlerMixin: tables: List[Union[...
AGoldian/sqllineage
sqllineage/core/parser/__init__.py
__init__.py
py
2,386
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 10, "usage_type": "name" }, { "api_name": "sqllineage.core.models.Path", "line_number": 10, "usage_type": "name" }, { "api_name": "sqllineage.core....
5596789731
import csv from appium import webdriver from appium.webdriver.common.appiumby import AppiumBy import datetime import openpyxl wb = openpyxl.Workbook() # 建立空白的 Excel 活页簿物件 wb.save('empty.xlsx') wb = openpyxl.load_workbook('empty.xlsx', data_only=True) #读取excel #防止excel资料表被洗掉 #dt = datetime.datetime.now() #excelNa...
megaking0801/appium
android-app/excelTest.py
excelTest.py
py
3,363
python
zh
code
0
github-code
97
[ { "api_name": "openpyxl.Workbook", "line_number": 9, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 31, "usage_type": "call" }, { "api_name": "datetim...
15010748742
# -*- coding: utf-8 -*- from django.shortcuts import render from django.core.urlresolvers import reverse from django.http import HttpResponse, JsonResponse from ..models.journal import Student_visiting from ..models.monthjournal import MonthJournal from ..models.students import Student from ..models.groups import Grou...
trivvet/studentsdb
students/views/journal.py
journal.py
py
4,339
python
en
code
0
github-code
97
[ { "api_name": "django.views.generic.base.TemplateView", "line_number": 18, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 25, "usage_type": "name" }, { ...
43621551045
import torch from torch import nn from torch.nn import functional as F from torch.autograd import Variable class BoxFilter(nn.Module): def __init__(self, r): super(BoxFilter, self).__init__() self.r = r def forward(self, x): assert x.dim() == 4 device = torch.device("cuda:0" i...
ArthurinRUC/FacialCartoonization
utils/guided_filter.py
guided_filter.py
py
1,833
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.device", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", ...
7247357626
from pathlib import Path, os myfiles = ['games','pictures','videos'] for file in myfiles: print(f" C:// This pc// {file}") print( Path.home() ) #Making directory from os function, it can make several directories at once # os.makedirs("C:/Users/Asus/Desktop/The folder created by Python") #Making directory wit...
sandarva3/Old-codes-of-python
Some stuffs with python/python part 1/File_handling(FirstHalf).py
File_handling(FirstHalf).py
py
1,506
python
en
code
0
github-code
97
[ { "api_name": "pathlib.Path.home", "line_number": 7, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 18, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_nu...
70879442560
import logging from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardMarkup, Update from telegram.ext import CallbackContext, CallbackQueryHandler, CommandHandler, Dispatcher, Filters, MessageHandler from app.models import Command, TelegramUser from app.report import generate_report logger = l...
wildhack-sentiment/sentiment-telegram-bot
src/app/bot.py
bot.py
py
6,521
python
ru
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "telegram.ReplyKeyboardMarkup", "line_number": 10, "usage_type": "call" }, { "api_name": "telegram.InlineKeyboardMarkup", "line_number": 11, "usage_type": "call" }, { "api_n...
14356088740
import json import bsddb3 from DashboardService.GenericClient import GenericClient class ServiceError(Exception): def __init__(self, name=None, code=None, message=None, data=None, error=None): super(ServiceError, self).__init__(message) self.name = name self.code = code self.message...
eapearson/kbase-sdk-module-dashboard-service
lib/DashboardService/cache/AppCache.1.py
AppCache.1.py
py
2,941
python
en
code
0
github-code
97
[ { "api_name": "bsddb3.db.DB", "line_number": 36, "usage_type": "call" }, { "api_name": "bsddb3.db", "line_number": 36, "usage_type": "attribute" }, { "api_name": "bsddb3.db", "line_number": 43, "usage_type": "attribute" }, { "api_name": "bsddb3.db", "line_numb...
24678431197
# # @lc app=leetcode.cn id=1046 lang=python3 # # [1046] 最后一块石头的重量 from typing import List # @lc code=start class Solution: def lastStoneWeight(self, stones: List[int]) -> int: n = len(stones) if n == 1: return stones[0] elif n == 2: return abs(stones[1] - stones[0]) ...
Leaderzhangyi/DailyProblem
每日一题/1046.最后一块石头的重量.py
1046.最后一块石头的重量.py
py
618
python
en
code
1
github-code
97
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" } ]
10204450381
import matplotlib.pyplot as plt n=10000 mod=100 lst=n*[0] sum=0 for i in range(n): if i%mod==0: sum+=i+1 else: sum+=1 lst[i]=sum/(i+1) plt.plot(lst) plt.show()
rishyfishy/Python-Code
untitled.py
untitled.py
py
189
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.show", "line_number": 14, "usage_type": "call" }, { "api_name": "matpl...
7925097753
#!/usr/bin/env python import numpy as np import h5py import glob import sys import os import multiprocessing as mp import ctypes import argparse parser = argparse.ArgumentParser(description='Lit pixel hit finder') parser.add_argument('run', help='Run number', type=int) parser.add_argument('-d', '--dark', help='Dark r...
FXIhub/xfel2013
offline/litpixels.py
litpixels.py
py
4,405
python
en
code
1
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.bool", "line_number": 33, "usage_type": "attribute" }, { "api_name": "h5py.File", "...
35273830063
from twilio.rest import Client import requests import os from dotenv import load_dotenv load_dotenv() OWM_Endpoint = os.getenv("END_POINT") api_key = os.getenv("API_KEY") account_sid = os.getenv('TWILIO_ACCOUNT_SID') auth_token = os.getenv('TWILIO_AUTH_TOKEN') my_number=os.getenv("PHONE") parametros = { "lat": ...
UlisesJuarez/Rain-Alert
main.py
main.py
py
1,246
python
en
code
0
github-code
97
[ { "api_name": "dotenv.load_dotenv", "line_number": 5, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 10...
26775364176
# encoding:utf-8 # @Author: Rilzob # @Time: 2019/3/31 下午7:23 import re from bs4 import BeautifulSoup, Tag from selenium import webdriver import time from Spider.HtmlDownloader import HtmlDownloader class HtmlParser(object): def __init__(self): super(HtmlParser, self).__init__() self.browser = w...
WhiteDOU/Easy-KG
Spider/HtmlParser.py
HtmlParser.py
py
7,447
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 17, "usage_type": "name" }, { "api_name": "Spider.HtmlDownloader.HtmlDownloader", "line_number": 26, "usage_type": "call" }, { ...
36605207861
''' CSRF Middleware ''' from masonite.exceptions import InvalidCSRFToken class CsrfMiddleware: ''' Verify CSRF Token Middleware ''' exempt = [] def __init__(self, Request, Csrf, ViewClass): self.request = Request self.csrf = Csrf self.view = ViewClass def before(self): ...
hellomasonite/masonite-forum
app/http/middleware/CsrfMiddleware.py
CsrfMiddleware.py
py
1,204
python
en
code
15
github-code
97
[ { "api_name": "masonite.exceptions.InvalidCSRFToken", "line_number": 44, "usage_type": "call" } ]
31510415149
import logging import subprocess import time from mdts.lib import subprocess_compat from mdts.lib.failure.failure_base import FailureBase LOG = logging.getLogger(__name__) class PktFailure(FailureBase): """Emulate network failure filtering packets using iptables @netns network namespace name @inter...
xavileon/mdts
mdts/lib/failure/pkt_failure.py
pkt_failure.py
py
1,405
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "mdts.lib.failure.failure_base.FailureBase", "line_number": 10, "usage_type": "name" }, { "api_name": "mdts.lib.subprocess_compat.check_output", "line_number": 31, "usage_type": "ca...
34151836396
import pytest import time from selenium.webdriver.common.keys import Keys import locators class LeftMenu(object): """ Testing area divided into 2 areas. This class contains 2 implementations of test cases for testing LeftMenu (white window with word "Конвертация"). """ def check_insert_convertatio...
mihmonah/test1_for_techops
menues.py
menues.py
py
4,951
python
en
code
0
github-code
97
[ { "api_name": "pytest.allure.step", "line_number": 20, "usage_type": "call" }, { "api_name": "pytest.allure", "line_number": 20, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 21, "usage_type": "call" }, { "api_name": "locators.LeftMenuLoc...
10085033253
#!/usr/bin/env python3 from typing import List def find_partition(nums: List[int], left: int, right: int) -> int: """Find partition index Args: nums (List[int]): list to sort left (int): left index right (int): right index Returns: int: partition index """ i = le...
JuanSebastianGB/algorithms
python/7-quick-sort.py
7-quick-sort.py
py
1,392
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 33, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 48, "usage_type": "name" } ]
70838650560
from django.urls import path from .views import ( CustomerListView, CustomerDetailView, CartListView, AddToCartView, ) urlpatterns = [ path('customers/', CustomerListView.as_view(), name='customer-list'), path('customers/<int:id>/', CustomerDetailView.as_view(), name='customer-detail'), pat...
JemimaNyaguthii/Django-Inventory
api/urls.py
urls.py
py
448
python
en
code
0
github-code
97
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "views.CustomerListView.as_view", "line_number": 10, "usage_type": "call" }, { "api_name": "views.CustomerListView", "line_number": 10, "usage_type": "name" }, { "api_name":...
5174467802
# En la provincia de Bs. As. se realizó una encuesta sobre la posesión de determinados vehículos. # Los datos obtenidos se agruparon de la siguiente manera: # En una lista los porcentajes de los que tienen moto = [14, 17, 9, 13, 15, 12] # En una tupla los porcentajes de los que tienen bicicleta = (17, 8, 9, 7, 10, 11,...
KZvilla/UNSAM
MATEIII/CLASE3/parcial2020.py
parcial2020.py
py
3,581
python
es
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 84, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 84, "usage_type": "name" }, { "api_name": "matplotlib_venn.venn3", "line_number": 86, "usage_type": "call" }, { "api_name": "matp...
36898019822
from ape import project, accounts, Contract, chain, networks from ape.utils import ZERO_ADDRESS from web3 import Web3, HTTPProvider from hexbytes import HexBytes import os import hashlib from copy import deepcopy # Add the wallet to use here. deployer = accounts.load("") def deploy_blueprint_and_factory(): print...
yearn/yearn-vaults-v3
scripts/deploy.py
deploy.py
py
2,729
python
en
code
69
github-code
97
[ { "api_name": "ape.accounts.load", "line_number": 10, "usage_type": "call" }, { "api_name": "ape.accounts", "line_number": 10, "usage_type": "name" }, { "api_name": "ape.chain.chain_id", "line_number": 14, "usage_type": "attribute" }, { "api_name": "ape.chain", ...
28542750659
import numpy as np import cv2 import matplotlib.pyplot as plt def figs_contrast_display(figs, titles, suptitle=''): """ Show figs in one line. Args: figs: list, numpy array [H, W, C], figs to display titles: list, str, titles to display suptitle: str Returns: plt: pypl...
WindFantasy98/ADVT
advt/utils/visualization.py
visualization.py
py
3,146
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 26, "usage_type": "call" }, { "api_name": "...
72621457280
import unittest import json from bqtag import BQTableView BQ_PROJECT = None # Update this with BQ Project Value CATALOG_PROJECT = None # Update this with Data Catalog Project Value TAXONOMY_DISPLAY_NAME = "test_taxonomy" # Update this with Taxonomy Name BQ_DATASET = "test_dataset" # Update this with BQ Dataset LOC...
GoogleCloudPlatform/professional-services
tools/bqtag/tests/test_bqtag.py
test_bqtag.py
py
5,897
python
en
code
2,602
github-code
97
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "bqtag.BQTableView", "line_number": 18, "usage_type": "call" }, { "api_name": "bqtag.BQTableView", "line_number": 42, "usage_type": "call" }, { "api_name": "bqtag.BQTa...
19288757921
import argparse import torch import numpy as np from torchvision import transforms from torch.utils.data import DataLoader from utils import NativeScalerWithGradNormCount as NativeScaler import torch.nn.functional as F from Denoisedataset import MyDataset from engine import train_one_epoch import argparse im...
WayneChuOfficial/OCC_program
makenoise.py
makenoise.py
py
9,767
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 65, "usage_type": "attribute" }, { "api_name": "torch.mean", "line_number": 72, "usage_type": "call" }, { "api_name": "torch.sqrt", "li...
18885720603
# coding: utf8 import hashlib import re import simplejson from datetime import datetime, timedelta from eddn.conf.Settings import Settings from threading import Lock, Thread from time import sleep class DuplicateMessages(Thread): max_minutes = Settings.RELAY_DUPLICATE_MAX_MINUTES caches = {} lock = Loc...
EDCD/EDDN
src/eddn/core/DuplicateMessages.py
DuplicateMessages.py
py
2,446
python
en
code
288
github-code
97
[ { "api_name": "threading.Thread", "line_number": 12, "usage_type": "name" }, { "api_name": "eddn.conf.Settings.Settings.RELAY_DUPLICATE_MAX_MINUTES", "line_number": 13, "usage_type": "attribute" }, { "api_name": "eddn.conf.Settings.Settings", "line_number": 13, "usage_typ...
73614541120
"""empty message Revision ID: 9d83b02365e6 Revises: 0bb786d88658 Create Date: 2022-06-05 18:12:19.369732 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '9d83b02365e6' down_revision = '0bb786d88658' branch_labels = None depe...
barbosa92/rest-api-star-wars
migrations/versions/9d83b02365e6_.py
9d83b02365e6_.py
py
2,381
python
en
code
0
github-code
97
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
3225180779
#!/usr/bin/env python3 #Cunren Liang, 10-MAY-2018 import os import sys import datetime import argparse def runCmd(cmd): print("{}".format(cmd)) status = os.system(cmd) if status != 0: raise Exception('error when running:\n{}\n'.format(cmd)) def runRecordCmd(cmd): with open('cmd.sh', ...
mzzhong/stack_procs
unw2gmt.py
unw2gmt.py
py
2,302
python
en
code
1
github-code
97
[ { "api_name": "os.system", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "attribute" }, { "api_name": "argparse.Argum...
38898613170
import os from pathlib import Path import subprocess from django.conf import settings from conditions.models import Condition, ConditionRaster from base.condition_types import ConditionScoreType from utils.cli_utils import psql, psql_pipe, raster2pgpsql def get_raster_path(condition): base = Path(settings.RASTER_...
romero61/Planscape
src/planscape/conditions/registry.py
registry.py
py
2,837
python
en
code
null
github-code
97
[ { "api_name": "base.condition_types", "line_number": 11, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.settings.RASTER_ROOT", "line_number": 11, "usage_type": "attribute" }, { "api_name"...
3561912366
# Databricks notebook source # MAGIC %md # MAGIC # MAGIC https://stackoverflow.com/questions/67602156/find-specific-word-in-input-file-and-read-the-data-from-next-row-in-pyspark/67605060 # COMMAND ---------- from pyspark.sql.window import Window import pyspark.sql.functions as f # COMMAND ---------- df = (spark ...
Kafels/StackOverflowAnswers
spark/python/remove_lines_before_header.py
remove_lines_before_header.py
py
1,047
python
en
code
0
github-code
97
[ { "api_name": "pyspark.sql.functions.monotonically_increasing_id", "line_number": 24, "usage_type": "call" }, { "api_name": "pyspark.sql.functions", "line_number": 24, "usage_type": "name" }, { "api_name": "pyspark.sql.functions.lag", "line_number": 25, "usage_type": "cal...
25291226651
import telebot import config import pymorphy2 from random import randint # from telebot import apihelper # apihelper.proxy = {'https': '{}'.format(config.proxy)} bot = telebot.TeleBot(config.access_token) def input_dict(): file = open('./dictionary.txt', 'r', encoding='utf-8') for line in file: key_...
YuriiShuginin/MoodBot
MoodBot.py
MoodBot.py
py
2,884
python
en
code
0
github-code
97
[ { "api_name": "telebot.TeleBot", "line_number": 9, "usage_type": "call" }, { "api_name": "config.access_token", "line_number": 9, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 43, "usage_type": "call" }, { "api_name": "random.randint"...
16520115778
import torch import dnnlib import legacy import PIL.Image import numpy as np #import imageio #from tqdm.notebook import tqdm import sys import argparse parser = argparse.ArgumentParser(description='CAN5600 & GAN5000 dataset; Han Seung Seog') parser.add_argument('--source', type=str, default="", help='source image e.g...
whria78/can
SCRIPTS/morph.py
morph.py
py
2,015
python
en
code
4
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.device", "lin...
8815216025
#! python import glob, os, time from Tkinter import * from pygame import mixer from bin.io.json_config import PodcastDirectoryConfig class PodcastCollection: # initialize. shows where the full path to the # podcast files are and sets the oldest file in the # directory to play next def __init__(self, podcast_pat...
jensenj08/mp3_scheduler
bin/podcast_collection.py
podcast_collection.py
py
1,139
python
en
code
0
github-code
97
[ { "api_name": "bin.io.json_config.PodcastDirectoryConfig", "line_number": 15, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os....
35905000908
import requests, os, csv, time, random, pandas as pd from bs4 import BeautifulSoup from datetime import date, datetime class SSW: def __init__(self, domain, cpf, user, password): self.domain = domain self.cpf = cpf self.user = user self.password = password self.header = self...
MatheusSRMO/SSW-API
ssw.py
ssw.py
py
14,767
python
en
code
0
github-code
97
[ { "api_name": "requests.post", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 44, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 45, "usage_type": "call" }, { "api_name": "requests.get", "lin...
21068034211
import cv2 import matplotlib.pyplot as plt face_cascade = cv2.CascadeClassifier('/Users/heisenberg/anaconda3/lib/python3.7/site-packages/cv2/data/haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeClassifier('/Users/heisenberg/anaconda3/lib/python3.7/site-packages/cv2/data/haarcascade_eye.xml') video_capt...
eduaman1489/Machine_Learning
Open_CV_Face_Eye_Detector/mouth_eyes_detector.py
mouth_eyes_detector.py
py
1,337
python
en
code
0
github-code
97
[ { "api_name": "cv2.CascadeClassifier", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.cvtColo...
231910229
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2021/1/29 20:49 # @Author : CoderCharm # @File : casbin_custom_orm.py # @Software: PyCharm # @Github : github/CoderCharm # @Email : wg_python@163.com # @Desc : """ 加一个自定义的解析函数 """ import casbin from casbin import util import casbin_sqlalchemy_adapt...
wxy2077/fastapi-mysql-generator
examples/demo_casbin/03_custom_orm.py
03_custom_orm.py
py
1,349
python
en
code
421
github-code
97
[ { "api_name": "casbin_sqlalchemy_adapter.Adapter", "line_number": 20, "usage_type": "call" }, { "api_name": "casbin.Enforcer", "line_number": 22, "usage_type": "call" }, { "api_name": "casbin.util.key_match2", "line_number": 39, "usage_type": "call" }, { "api_name...
3216198952
from flask import abort, Flask, json, redirect,\ render_template, request, Response, url_for, session, jsonify from werkzeug.utils import secure_filename from flask_sqlalchemy import SQLAlchemy from _thread import start_new_thread import threading import time from datetime import datetime from datetime import timed...
MicDMar/Reservation-System
reservation-system/app.py
app.py
py
7,210
python
en
code
0
github-code
97
[ { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 16, "usage_type": "call" }, { "api_name": "models.Comput...
10978670082
import argparse import utils import os def main(config): X_train = utils.read_csv(config["X_train_filepath"]) y_train = utils.read_csv(config["y_train_filepath"]) model = utils.train_model(X_train,y_train,config) utils.save_model(model,config) return model if __name__ == '__main__': ...
varunvohra94/assignment
experiments/kohls_assignment/train.py
train.py
py
612
python
en
code
0
github-code
97
[ { "api_name": "utils.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "utils.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "utils.train_model", "line_number": 10, "usage_type": "call" }, { "api_name": "utils.save_model", ...
1227264029
""" Created on 2022, 24 Aug (24/08/22) at 19:28 Title: main_grayscale.py - ... Description: - ... @author: Supantha Sen, sunnymac, IISc Bangalore """ # Importing Modules from matplotlib import image, pyplot as plt from PIL import Image # Importing Custom Modules from image_grayscale import color2gra...
sunnyiisc/Image-Conversions
main_grayscale.py
main_grayscale.py
py
767
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.image.imread", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.image", "line_number": 18, "usage_type": "name" }, { "api_name": "image_grayscale.color2gray", "line_number": 20, "usage_type": "call" }, { "api_name": "m...
25950012998
import shutil import os import re from collections import defaultdict import textgrid as tg import sys remove_regex = re.compile(r"<<?[A-Z@]+|[A-Z@]+>?>|\(?\((?!H)[A-Z\-]+\)\)?") sub_regex = re.compile(r"\[[\d!]?|[\d!]?\]|\.{2,3}|[<>!=_%+;`\/\\&~]") breath_regex = re.compile(r"\(H+x*\)") laugh_regex = re.compile(r"@+"...
MontrealCorpusTools/MFA-reorganization-scripts
SantaBarbara/convert_santa_barbara.py
convert_santa_barbara.py
py
11,796
python
en
code
39
github-code
97
[ { "api_name": "re.compile", "line_number": 8, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 11, ...
5831572938
# pip install thefuzz # pip install python-Levenshtein # Import needed libraries. Unless noted above, all libraries are available in the baseline conda environment. from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry from bs4 import BeautifulSoup from thefuzz import process import pandas as...
carl-schick-ds/national-parks
national_parks_dc.py
national_parks_dc.py
py
8,600
python
en
code
0
github-code
97
[ { "api_name": "urllib3.util.retry.Retry", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.adapters.HTTPAdapter", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.Session", "line_number": 29, "usage_type": "call" }, { "api_name"...
20916963769
from collections import deque #최단거리 문제: 넓은 범위를 탐색해나가는 BFS 알고리즘 사용 def solution(maps): # graph 변수에 이차원배열 maps를 저장 graph = maps # x의 directions 좌, 우 저장 dx = [-1,1,0,0] # y의 directions 상, 하 저장 dy = [0,0,-1,1] # 맵의 vertical 높이 v = len(maps)-1 # 맵의 horizontal 너비 h = len(maps[...
FEprojectStudy/algorithm
알렉스데브/게임맵최단거리/game_map_path.py
game_map_path.py
py
1,839
python
ko
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 24, "usage_type": "call" } ]
10043120275
import getopt import json import logging import sys from urllib import error import pandas as pd logger = logging.getLogger(__name__) source_url = 'https://drive.google.com/file/d/1zLdEcpzCp357s3Rse112Lch9EMUWzMLE/view?output=csv' url = 'https://drive.google.com/uc?id=' + source_url.split('/')[-2] def parse_args()...
denisyanisev/csv_scraper
run.py
run.py
py
1,287
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "getopt.getopt", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "l...