content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
from dataclasses import dataclass, field from typing import Optional from serde import deserialize from metaphor.common.filter import DatasetFilter from metaphor.snowflake.auth import SnowflakeAuthConfig from metaphor.snowflake.utils import DEFAULT_THREAD_POOL_SIZE @deserialize @dataclass class SnowflakeRunConfig(S...
nilq/baby-python
python
# -*- coding: utf-8 -*- ##################################################################### # Peach - Python para Inteligência Computacional # José Alexandre Nalon # # Este arquivo: demo07.py # Demonstração e teste, Mapeamento de uma função não linear. ################################################################...
nilq/baby-python
python
from django.conf.urls import url from .import views from django.conf import settings from django.conf.urls.static import static urlpatterns = [ url(r'^$', views.home_teamlead), url(r'^index_teamlead$', views.index_teamlead, name='index_teamlead'), url(r'^holidays_teamlead$', views.holidays_teamlead, name='...
nilq/baby-python
python
from base64 import b64decode from zlib import decompress from os import system inputFile = "handcrafted-pyc.py_bc552f58fe2709225ca0768c131dd14934a47305" magicHeader = b"\x03\xf3\x0d\x0a\xfb\x1c\x32\x59" outputPycFile = "dump.pyc" outputSrcFile = "output.py" uncompyleExe = "uncompyle6" code = 'eJyNVktv00AQXm/eL0igiaFA...
nilq/baby-python
python
import numpy as np from scipy.signal import find_peaks import os import pycst_ctrl class PyCstDataAnalyser: """ Used to analyse data exported by CST""" def __init__(self, opts): # Initialize attributes # Polarization indicator self.pol_ind = opts.get('pol_ind', 'lin_dir') #...
nilq/baby-python
python
# -*- coding:utf-8 -*- """ @description: """ import os import sys import numpy as np import torch from jiwer import wer import sacrebleu sys.path.append('..') import config from data_reader import load_word_dict from seq2seq_model import Seq2SeqModel from utils.logger import logger device = torch.device("cuda" if t...
nilq/baby-python
python
# Copyright 2016, 2017 John J. Rofrano. All Rights Reserved. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
nilq/baby-python
python
"""Helper neural network training module.""" from collections import OrderedDict from pathlib import Path from time import time import torch from torch import nn from torch.utils.tensorboard import SummaryWriter from ..datasets import IMAGE_SHAPES, get_loader from ..models import fit_to_dataset, get_model from ..mod...
nilq/baby-python
python
from PyQt5 import QtWidgets from otter.OListView import OListView class TemplatesTab(QtWidgets.QWidget): """ List of recent file that show on the MainWindow """ def __init__(self, parent): super().__init__(parent) main_layout = QtWidgets.QVBoxLayout() main_layout.setContentsM...
nilq/baby-python
python
import string def alphabetSubsequence(s): seen = -1 for i in s: index = string.ascii_lowercase.find(i) if index > seen: seen = index else: return False return True s = "effg" print(alphabetSubsequence(s))
nilq/baby-python
python
import os import sys import inspect import string import numpy as np PycQED_py3_dir = "D:\\Github\\PycQED_py3" AssemblerDir = PycQED_py3_dir + \ "\\instrument_drivers\\physical_instruments\\_controlbox" currentdir = os.path.dirname(os.path.abspath( inspect.getfile(inspect.currentframe()...
nilq/baby-python
python
val = input().split() a, b, c = val a = float(a) b = float(b) c = float(c) if a < (a+b) and b < (c+a) and c < (a+b): per = a + b + c print('Area = %.2f' %per)
nilq/baby-python
python
import pandas import numpy import filepaths import utils def fetch_ng_inflation_cpi(): stats_metadata = utils.read_stats_metadata() url = stats_metadata['NG']['inflation']['CPI']['url'] tmp_filepath = utils.download_file(url) df = pandas.read_excel(tmp_filepath, sheet_name='Table1', header=None) ...
nilq/baby-python
python
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import datetime UNIQUE_REDIS_KEY_PREFIX = 'celery_unique' class UniqueTaskMixin(object): abstract = True unique_key = None redis_client = None def apply_asyn...
nilq/baby-python
python
from . import hist, quality
nilq/baby-python
python
import requests # Vuln Base Info def info(): return { "author": "cckuailong", "name": '''Node.js st module Directory Traversal''', "description": '''A directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary files via a %2e%2e (e...
nilq/baby-python
python
__copyright__ = "Copyright 2015 Contributing Entities" __license__ = """ 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 re...
nilq/baby-python
python
import spacy nlp = spacy.load('en_core_web_sm') from spacy.matcher import Matcher, PhraseMatcher from spacy.tokens import Span import string from nltk.corpus import stopwords import pandas as pd def phrase_template(): ''' This function returns a list of all the possible technical terms that has high possibilit...
nilq/baby-python
python
# Import the agent class #from .agenttemplate import AgentTemplate
nilq/baby-python
python
# Copyright © 2020 Arm Ltd and Contributors. All rights reserved. # SPDX-License-Identifier: MIT """ Contains functions specific to decoding and processing inference results for YOLO V3 Tiny models. """ import cv2 import numpy as np def iou(box1: list, box2: list): """ Calculates the intersection-over-union...
nilq/baby-python
python
from xml.etree.ElementTree import tostring from f1_telemetry.server import get_telemetry from kusto.ingest import ingest_kusto from datetime import datetime batch_freq_high = 9 # 20 cars per packet * batch_freq_high(x) packets batch_freq_low = 2 ingest_cartelemetrydataCnt = 0 ingest_cartelemetryBuffer = "" ingest_ses...
nilq/baby-python
python
"""Integration test for pytype.""" from __future__ import print_function import csv import hashlib import os import shutil import subprocess import sys import tempfile import textwrap from pytype import config from pytype import main as main_module from pytype import utils from pytype.pyi import parser from pytype.py...
nilq/baby-python
python
#!/usr/bin/env python import argparse def main(args): """ This is some doc """ print(args) def sub_function(): """ Here is some doc about this sub function """ pass def parse_arguments(): parser = argparse.ArgumentParser(description="") parser.add_argument("-t", "--type", d...
nilq/baby-python
python
while (True): print("mohammed uddin made changes") print(":D")
nilq/baby-python
python
# logic.py to be import random global actual_score def start_game(): # declaring an empty list then # appending 4 list each with four # elements as 0. mat = [] for i in range(4): mat.append([0] * 4) # calling the function to add # a new 2 in grid after every step add_new_2(ma...
nilq/baby-python
python
import os from flask import request, render_template, redirect, session, Blueprint, flash, jsonify, abort, send_from_directory from werkzeug.utils import secure_filename import indieweb_utils from bs4 import BeautifulSoup import requests from config import ENDPOINT_URL, TWITTER_BEARER_TOKEN, UPLOAD_FOLDER, MEDIA_ENDP...
nilq/baby-python
python
"""Docstring for varnet.py Normalized U-Net implemetnation for unrolled block network. """ import math from typing import List, Tuple import fastmri import torch import torch.nn as nn import torch.nn.functional as F from fastmri.data import transforms from unet import MHUnet from att_unet import AttUnet class Nor...
nilq/baby-python
python
import pygame import numpy as np from time import sleep class GameOfLife: def __init__(self): pygame.init() self.size = 800 self.divisions = 100 self.length = self.size // self.divisions self.screen = pygame.display.set_mode((self.size, self.size)) self.fps = 120 ...
nilq/baby-python
python
import numpy as np import torch import torchvision import matplotlib.pyplot as plt import matplotlib.cm as cm from sklearn.manifold import TSNE import os from .model import resnet from PIL import ImageFilter import random def adjust_learning_rate(args, optimizer, epoch, lr): # if args.cosine: # eta_min = l...
nilq/baby-python
python
x = int(input()) if x % 2 == 0: y = x + 1 print(y) y = y + 2 print(y) y = y + 2 print(y) y = y + 2 print(y) else: y = x print(y) y = y + 2 print(y) y = y + 2 print(y) y = y + 2 print(y)
nilq/baby-python
python
from datetime import datetime from django.utils import timezone from django.shortcuts import render, get_object_or_404 from django.db.models import Q from django.contrib.auth.models import User, Group from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http...
nilq/baby-python
python
# https://leetcode.com/problems/palindrome-number/ class Solution: def isPalindrome(self, x: int) -> bool: if x < 0: return False p, res = x, 0 while p: res = res * 10 + p % 10 p = int(p/10) return res == x
nilq/baby-python
python
import numpy as np import multiprocessing import xgboost as xgb # requires xgboost package, installed e.g. via 'pip install xgboost' class XGBoost: def __init__(self, train_loader, val_loader, x_shape, dim_out, args): self.args = args self.dim_out = dim_out if args.regression: ...
nilq/baby-python
python
import os import time # 请求用户输入要循环开关闭的网卡名称 eth_name = input('请输入要循环启用关闭的网卡名称:') # 记录循环次数 i = 1 while True: # 关闭指定网卡 os.popen('ifconfig ' + eth_name + ' down') print(eth_name + '网卡关闭了') # 休眠5S time.sleep(5) # 开启指定网卡 os.popen('ifconfig ' + eth_name + ' up') print(eth_name + '网卡开启了') # ...
nilq/baby-python
python
import wx class Example(wx.Frame): def __init__(self, parent, title): super(Example, self).__init__(parent, title=title, size=(400, 200)) self.Move((800, 250)) #self.Centre() def main(): app = wx.App() ex = Example(None, title='M2I & MQL - Moving Wind') ...
nilq/baby-python
python
""" This file defines common tags to use in templates """ from django import template from django.contrib import messages from django.template.defaultfilters import safe register = template.Library() @register.filter(name="make_spaces") def make_spaces(in_string: str) -> str: """ This filter takes a...
nilq/baby-python
python
import json from google.protobuf import json_format from services.doubler.doubler_pb2 import Number def build_request_from_dict(d, request): json_str = json.dumps(d) return json_format.Parse(json_str, request) def build_request_from_file(filename, request): with open(filename) as f: json_str = ...
nilq/baby-python
python
from .convLSTM import StConvLSTM from .GRU import StGRU from .additive import StAdditive from .LSTM import StLSTM
nilq/baby-python
python
#!/usr/bin/env python """ Example of a telnet application that displays a dialog window. """ from __future__ import unicode_literals from prompt_toolkit.contrib.telnet.server import TelnetServer from prompt_toolkit.shortcuts.dialogs import yes_no_dialog from prompt_toolkit.eventloop import From, get_event_loop import...
nilq/baby-python
python
from __future__ import print_function import pickle import os.path from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request def contruindo_relatorio(service, creds, SAMPLE_SPREADSHEET_ID, lista): # Quantidade Ped...
nilq/baby-python
python
''' Created on Jan 6, 2016 @author: T0157129 ''' import logging import logging.config from Items.PotionObject import PotionObject class MyCharacter: ''' This class represents a basic character. Attributes: int HP : represents the Health Points of the character. If HP==0 the chara...
nilq/baby-python
python
# Definition for an interval. # class Interval(object): # def __init__(self, s=0, e=0): # self.start = s # self.end = e class Solution(object): def merge(self, intervals): """ :type intervals: List[Interval] :rtype: List[Interval] """ ans = [] for intv in sorted(intervals,...
nilq/baby-python
python
from __future__ import division import os,time,cv2 import scipy.io as sio import tensorflow as tf import tensorflow.contrib.slim as slim import numpy as np from numpy import * import scipy.linalg from copy import copy, deepcopy def lrelu(x): return tf.maximum(x*0.2,x) def identity_initializer(): def _initiali...
nilq/baby-python
python
import tweepy from tweepy.parsers import JSONParser # This class creates an instance of the Twitter API class API(object): # Initiates the API def __init__(self): # Keys for Twitter API (maybe reading it from a .txt) self.consumer_key = 'EfbgNEMgmXNSweNDcWmoaSwm0' self.consumer_secret ...
nilq/baby-python
python
# coding=utf-8 import threading, time, re, os, sys, json, random try: import requests except ImportError: print '---------------------------------------------------' print '[*] pip install requests' print ' [-] you need to install requests Module' sys.exit() ''' \ \ / /__ _ ...
nilq/baby-python
python
""" methods for processing mapping results in SAM/BAM format def parse_deltas(sam_file, ...): parse a sam/bam file into dicts of coverage changes by position def deltas_to_cov(cov_deltas, x_max=None, nan_for_zero=True): convert coverage deltas into coverage array class SAMFlag(IntFlag): class for dec...
nilq/baby-python
python
""" Module for requesting to URL and get page's html code from there, download media files, check that the request if correct, page in RNC exists. """ __all__ = ( 'get_htmls', 'is_request_correct', 'download_docs' ) import asyncio import logging import time from typing import List, Optional, Tuple, Union import ...
nilq/baby-python
python
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2013-2014 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the...
nilq/baby-python
python
from maskcnn import training_aux_wrapper from sys import argv def main(): dataset, image_subset, neuron_subset, seed, arch_name, opt_name = argv[1:] training_aux_wrapper.train_one_wrapper(dataset, image_subset, neuron_subset, int(seed), arch_name, opt_name) if __name__ == '__main__': main()
nilq/baby-python
python
import numpy import unittest import sycomore from sycomore.units import * class TestBloch(unittest.TestCase): def test_pulse(self): M = sycomore.bloch.pulse(47*deg, 23*deg) numpy.testing.assert_almost_equal( M, [[ 0.95145043, 0.11437562, 0.28576266, 0. ], ...
nilq/baby-python
python
from django.urls import include, path from rest_framework.routers import DefaultRouter from project.tweets.views import TweetsViewset router = DefaultRouter() router.register(r"tweets", TweetsViewset, basename="tweets") urlpatterns = [ path("", include(router.urls)), ]
nilq/baby-python
python
import random import names import csv from django.template.defaultfilters import slugify from orcamentos.crm.models import Customer, Person, PhonePerson from orcamentos.utils.lists import COMPANY_LIST from orcamentos.utils.gen_random_values import ( gen_cpf, gen_digits, gen_phone, gen_rg, ) from orcamen...
nilq/baby-python
python
from urllib.request import urlopen def get_page_3(url): pagina = urlopen(url) codigoHtml = pagina.read().decode('utf') pagina.close() return codigoHtml def get_next_target(website): start_link= website.find('<a href') if (start_link) != -1: start_quote= website.find('"',start_link...
nilq/baby-python
python
/home/runner/.cache/pip/pool/cf/51/25/b749cb02a5396340ce9fda7fffc4272d66af9443a947242291d6202aba
nilq/baby-python
python
def proc(): str = input() fp = open('./dict/person.dic', mode='rt', encoding='utf-8') while True: line = fp.readline() if not line: break if str in line: return fp.close() fp = open('./dict/person.dic', mode='at', encoding='utf-8') fp.write('\n%s/...
nilq/baby-python
python
import numpy as np import libs.state_node as STTREE class HillClimbing: def __init__(self, initialPuzzle, answerPuzzle, k): self.totalExpansions = 0 self.k = k self.answerPuzzle = answerPuzzle.puzzle self.frontier = [] self.frontier.append( ( ST...
nilq/baby-python
python
# Generated by Django 3.1.13 on 2021-09-28 03:33 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('property', '0010_auto_20210928_0430'), ] operations = [ migrations.AlterField( model_name='property', name='propert...
nilq/baby-python
python
from supermarket import Supermarket from Markov import Get_Entry entry = Get_Entry() lidl = Supermarket(name='LIDL', entry = entry) while lidl.is_open(): # increase the time of the supermarket by one minute # generate new customers at their initial location # repeat from step 1 lidl.add_new_cust...
nilq/baby-python
python
""" Timeseries plots with error bands ================================= _thumb: .5, .45 """ import seaborn as sns sns.set(style="darkgrid") # Load an example dataset with long-form data fmri = sns.load_dataset("fmri") # Plot the responses for different events and regions sns.lineplot(x="timepoint", y="signal", ...
nilq/baby-python
python
from typing import Literal, Any, List, Dict from flask_sqlalchemy import SQLAlchemy from base64 import b32encode from flask import session from globals import * import xml.etree.ElementTree as ET import sqlite3 import secrets import random import error import re import os db = SQLAlchemy(app) Role = Literal['s', 'u'...
nilq/baby-python
python
import bitwise as bw class TestStackPointer: def test_StackPointer(self): up = bw.wire.Wire() down = bw.wire.Wire() clock = bw.wire.Wire() output_bus = bw.wire.Bus16() a = bw.processor.StackPointer(up, down, clock, output_bus) clock.value = 0 clock.value =...
nilq/baby-python
python
from django.db import models class Suggestion(models.Model): name = models.CharField(max_length=100, unique=True) class ImageTag(models.Model): game = models.CharField(max_length=100) image = models.CharField(max_length=50) tag = models.CharField(max_length=200) class Favorite(models.Model): u...
nilq/baby-python
python
""" byceps.blueprints.site.core.views ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from __future__ import annotations from typing import Optional from flask import g, url_for from .... import config from ....services.party im...
nilq/baby-python
python
from .qtscraper import * from ._version import __version__ def setup(app): from .qtgallery import setup return setup(app)
nilq/baby-python
python
# -*- coding: utf-8 -*- # Copyright 2012 Google Inc. All Rights Reserved. # # 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 require...
nilq/baby-python
python
from keras.models import Sequential from keras.layers import Dense, Flatten, Dropout from keras.layers.convolutional import Conv2D, MaxPooling2D class VGG19(Sequential): def __init__(self): super().__init__() self.add(Conv2D(64, (3, 3), strides=(1, 1), input_shape=(224, 224, 3), padding='same', a...
nilq/baby-python
python
import sys import time import numpy as np import pandas as pd import datetime as dt import multiprocessing as mp class MultiProcessingFunctions: """ This static functions in this class enable multi-processing""" def __init__(self): pass @staticmethod def lin_parts(num_atoms, num_threads): """ This function...
nilq/baby-python
python
#!/usr/bin/python3 # ============================================================================ # Airbnb Configuration module, for use in web scraping and analytics # ============================================================================ import logging import os import configparser import sys from bnb_kanpora.m...
nilq/baby-python
python
import _hgdb class DebugSymbolTableException(Exception): def __init__(self, what): super().__init__(what) # wrapper class class DebugSymbolTable: def __init__(self, filename): self.db = _hgdb.init_debug_db(filename) def store_variable(self, id_: int, value: str, is_rtl: bool = True): ...
nilq/baby-python
python
#This program takes a csv file of financial data as input and produces #a statistical report stored to a csv file and printed to the terminal. #The input file must contain a series of months with corresponding profits #and losses. The output report includes the total number of months analyzed, #the net total amount of ...
nilq/baby-python
python
import numpy as np import tensorflow as tf import time # Load TFLite model and allocate tensors. interpreter = tf.lite.Interpreter(model_path="output/model.tflite") interpreter.allocate_tensors() # Get input and output tensors. input_details = interpreter.get_input_details() output_details = interpreter.get_output_de...
nilq/baby-python
python
#!/usr/bin/env python2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import datetime import optparse import os import re import sys import urlparse import gclient_utils import subprocess2 USAGE = ...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ MagicTelecomAPILib.Models.Account This file was automatically generated by APIMATIC v2.0 on 06/22/2016 """ from MagicTelecomAPILib.APIHelper import APIHelper class Account(object): """Implementation of the 'Account' model. TODO: type model description here. ...
nilq/baby-python
python
# Linear regression on iris dataset import numpy as np import matplotlib.pyplot as plt import os figdir = os.path.join(os.environ["PYPROBML"], "figures") def save_fig(fname): plt.savefig(os.path.join(figdir, fname)) import seaborn as sns from sklearn.linear_model import LinearRegression from sklearn import datasets...
nilq/baby-python
python
from clases.dia_mañana import * from clases.yinyang import * from clases.alternativa import * if __name__ == "__main__": print("¿Qué ejercicio quieres ver?:", "\n","1)Dia del mañana", "\n","2)Inmortal", "\n","3)Alternativa herencia multiple") n =int(input("Número del ejercicio: ")) if n == 1: des...
nilq/baby-python
python
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'expstatus.ui' ## ## Created by: Qt User Interface Compiler version 5.15.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################...
nilq/baby-python
python
first = list(input()) sec = list(input()) te = first + sec te.sort() third = list(input()) third.sort() if te==third: print("YES") else: print("NO") s,i=sorted,input;print('YNEOS'[s(i()+i())!=s(i())::2])
nilq/baby-python
python
# -*- coding: utf-8 -*- from ..components import * from ..container import * from ..elements import * __all__ = ['regression_report'] def regression_report(truth, predict, label=None, per_target=True, target_names=None, title=None): """Regression report. This method will compose a sta...
nilq/baby-python
python
# encoding: utf-8 # Copyright 2011 California Institute of Technology. ALL RIGHTS # RESERVED. U.S. Government Sponsorship acknowledged. def nullUpgradeStep(setupTool): '''A null step for when a profile upgrade requires no custom activity.'''
nilq/baby-python
python
#range_test function definition goes here def range_test(num): if num < 1 or num > 500: return False else: return True num = int(input("Enter a number: ")) if range_test(num): print( "{:d} is in range.".format(num)) else: print("The number you entered is outside the range!")
nilq/baby-python
python
# Python - 3.6.0 def is_sator_square(tablet): n = len(tablet) for r in range(n): for c in range(n): if not (tablet[r][c] == tablet[-(r + 1)][-(c + 1)] == tablet[c][r] == tablet[-(c + 1)][-(r + 1)]): return False return True
nilq/baby-python
python
from platform import system, release from sys import version_info from configparser import ConfigParser from pyrfc import Connection, get_nwrfclib_version config = ConfigParser() config.read('pyrfc.cfg') params = config._sections['test'] conn = Connection(**params) print(('Platform:', system(), release())) print(('P...
nilq/baby-python
python
import platform, sys if platform.system() == 'Windows': # pragma: no cover WIN = True else: WIN = False # True if we are running on Python 2. PY2 = sys.version_info[0] == 2 if not PY2: # pragma: no cover from urllib.parse import quote, unquote string_type = str unicode_text = str byte_st...
nilq/baby-python
python
"""Tests for flake8.plugins.manager.PluginManager.""" import mock from flake8.plugins import manager def create_entry_point_mock(name): """Create a mocked EntryPoint.""" ep = mock.Mock(spec=['name']) ep.name = name return ep @mock.patch('entrypoints.get_group_all') def test_calls_entrypoints_on_ins...
nilq/baby-python
python
PyV8 = "PyV8" Node = "Node" JavaScriptCore = "JavaScriptCore" SpiderMonkey = "SpiderMonkey" JScript = "JScript" PhantomJS = "PhantomJS" SlimerJS = "SlimerJS" Nashorn = "Nashorn" Deno = "Deno"
nilq/baby-python
python
from flask.sessions import SessionInterface, SessionMixin from flask.json.tag import TaggedJSONSerializer from werkzeug.datastructures import CallbackDict from itsdangerous import BadSignature, want_bytes from CTFd.cache import cache from CTFd.utils import text_type from CTFd.utils.security.signing import sign, unsign ...
nilq/baby-python
python
import math n = int(input("Enter the number till where the series ius to be printed = ")) for i in range(1,n+1): k = math.pow(i,3) j = k + 2*i print(j)
nilq/baby-python
python
#Write a function that prompts user to input his/her full name. #After user enter's his/her full name, split it and store it in variables first_name and last_name. count=0 k=0 name=str(input("Enter your full name: ")) s=name.split(" ") print("The first name is:",s[0]) if len(s)==3: print("The middle name is:",s[...
nilq/baby-python
python
from typing import Tuple, Optional from abc import ABC, abstractmethod from mercury.msg.smart_grid import ElectricityOffer from xdevs.models import Atomic, Port, PHASE_PASSIVE, INFINITY from mercury.utils.history_buffer import EventHistoryBuffer class EnergyProvider(Atomic, ABC): def __init__(self, **kwargs): ...
nilq/baby-python
python
from abc import abstractmethod from dataclasses import dataclass from typing import List, Any, Callable, Dict, Tuple, NamedTuple, Union from data_splitting import split_splits, LearnCurveJob, EvalJob from seq_tag_util import calc_seqtag_f1_scores, Sequences from util.worker_pool import GenericTask @dataclass class ...
nilq/baby-python
python
from SeeThru_Feeds.Model.Attribution import Attribution from SeeThru_Feeds.Model.Properties.Properties import * from SeeThru_Feeds.Model.Properties.PropertyManager import PropertyManager class ComponentBase(PropertyManager, Attribution): def component_execute(self): """ This function should be ove...
nilq/baby-python
python
''' Copyright 2021 Kyle Kowalczyk 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 ...
nilq/baby-python
python
# Copyright (c) 2019, MD2K Center of Excellence # - Nasir Ali <nasir.ali08@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above cop...
nilq/baby-python
python
import pytesseract import jiwer from PIL import Image from os import listdir from os.path import join, isfile TEST_PATH = '/train/tesstrain/data/storysquad-ground-truth' extractions = [] ground_truths = [] count = 0 for file_name in listdir(TEST_PATH): file_path = join(TEST_PATH, file_name) if...
nilq/baby-python
python
from typing import ( IO, Any, Iterable, Sequence, Tuple, ) from eth_utils import ( ValidationError, to_tuple, ) from eth_utils.toolz import ( sliding_window, ) from ssz.exceptions import ( DeserializationError, SerializationError, ) from ssz.sedes.base import ( CompositeSed...
nilq/baby-python
python
import pytest from lendingblock.const import Side, OrderType, Ccy @pytest.fixture async def wallets_org_id(lb, org_id): for ccy in Ccy.BTC.name, Ccy.ETH.name, Ccy.LND.name: await lb.execute( f'organizations/{org_id}/wallets', 'POST', json={ 'address': f...
nilq/baby-python
python
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import import numpy as np import tensorflow as tf import scipy import cPickle import os import glob import random import imageio import scipy.misc as misc log_device_placement = True allow_soft_placement = True gpu_option...
nilq/baby-python
python
from flask_wtf import FlaskForm from wtforms.validators import DataRequired, Length, Email, EqualTo, ValidationError from wtforms import TextField, TextAreaField, SubmitField, validators, ValidationError,StringField, PasswordField, SubmitField, BooleanField class LoginForm(FlaskForm): email = StringField('Email', ...
nilq/baby-python
python
# # Copyright (c) 2020 Carsten Igel. # # This file is part of puckdb # (see https://github.com/carstencodes/puckdb). # # License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause # import unittest import tempfile import os import time import puckdb class BasicTest(unittest.TestCase): def test_no_c...
nilq/baby-python
python
#!/usr/bin/env python """ Inherits the stuff from tests.csvk – i.e. csvkit.tests.utils """ from tests.csvk import * from tests.csvk import CSVKitTestCase as BaseCsvkitTestCase import unittest from unittest.mock import patch from unittest import skip as skiptest from unittest import TestCase import warnings from io ...
nilq/baby-python
python