text stringlengths 2 999k |
|---|
import tensorflow as tf
import numpy as np
from models import sequential as sq
def seq_encoder(x, slens, vocab_size, embed_size, n_units, n_z, n_layers, init, scope):
"""
RNN encoder using GRUs.
"""
with tf.variable_scope(scope):
nonlin = tf.nn.elu
bidirectional = True
if ini... |
import os
import sys
import textwrap
import unittest
import subprocess
from test import test_support
from test.script_helper import assert_python_ok
class TestTool(unittest.TestCase):
data = """
[["blorpie"],[ "whoops" ] , [
],\t"d-shtaeou",\r"d-nthiouh",
... |
#!/usr/bin/env python
import rospy
import threading
import cmdMotores
from feedCamera import FeedCamera
from byakugan.msg import CtrlMotores
class ProcuraVitima:
def __init__(self):
rospy.init_node("ProcuraVitima", anonymous=False)
self.fc = FeedCamera()
self.pubMotores = rospy.Publisher("... |
# Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
def foo():
a = 2
a
|
"""
This is the main file that holds the Tokenizer, Parser, and Interpreter
that actually compile the PDF.
"""
import os.path as path
import re
import copy as _copy
from decimal import Decimal
from placer.placer import Placer
from constants import CMND_CHARS, END_LINE_CHARS, ALIGNMENT, TT, TT_M, WHITE_SPACE_CHARS,... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-08 14:32
from __future__ import unicode_literals
import uuid
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ciudadano', '0045_ciudadano_ultima_actualizacio... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Register your models here.
# admin.site.register(Project)
|
from __future__ import division
import pytest
import sys
from pybind11_tests import pytypes as m
from pybind11_tests import debug_enabled
def test_int(doc):
assert doc(m.get_int) == "get_int() -> int"
def test_iterator(doc):
assert doc(m.get_iterator) == "get_iterator() -> Iterator"
def test_iterable(doc... |
# This silly script exists because you can't call a within-module file to start a program, you gotta import it
# first with python =(
import lsw_slackbot
lsw_slackbot.client_loop()
|
"""
Support for getting statistical data from a DWD Weather Warnings.
Data is fetched from DWD:
https://rcccm.dwd.de/DE/wetter/warnungen_aktuell/objekt_einbindung/objekteinbindung.html
Warnungen vor extremem Unwetter (Stufe 4)
Unwetterwarnungen (Stufe 3)
Warnungen vor markantem Wetter (Stufe 2)
Wetterwarnungen (Stufe... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
replaces = [
("migrations", "0001_initial"),
("migrations", "0002_second"),
]
|
from django import forms
class BaseFormAllFields(forms.ModelForm):
title = None
class Meta:
model = None
fields = '__all__'
|
from django.urls import path
from testproject import views
urlpatterns = [
path("", views.test_view),
path("async/", views.test_async_view),
]
|
champions = [{'id': u'62', 'key': u'MonkeyKing'}, {'id': u'24', 'key': u'Jax'}, {'id': u'35', 'key': u'Shaco'}, {'id': u'19', 'key': u'Warwick'}, {'id': u'76', 'key': u'Nidalee'}, {'id': u'143', 'key': u'Zyra'}, {'id': u'63', 'key': u'Brand'}, {'id': u'33', 'key': u'Rammus'}, {'id': u'420', 'key': u'Illaoi'}, {'id': u'... |
from yeast.step import Step
from yeast.errors import YeastValidationError
class FilterRowsStep(Step):
"""
Step in charge of filtering out rows based on boolean conditions.
Operators:
- `&`, `|`, `and`, `or`, `(`, `)`
- `in`, `not in`, `==`, `!=`, `>`, `<`, `<=`, `>=`
- `+`, `~`, `not`
... |
"""
Functions for setting up and starting the DockCI application server
"""
import logging
import mimetypes
from flask import Flask
from flask_mail import Mail
from dockci.models.config import Config
from dockci.util import setup_templates
APP = Flask(__name__)
MAIL = Mail()
CONFIG = Config()
APP.config.model = C... |
# Generated by Django 3.2 on 2021-10-11 00:36
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0005_social_link_profile'),
('community', '0004_project_question_models'),
('ideas', '0001_project_qu... |
#
# reviewboard/admin/urls.py -- URLs for the admin app
#
# Copyright (c) 2008-2009 Christian Hammond
# Copyright (c) 2009 David Trowbridge
#
# 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... |
from flask import Flask, request, jsonify, render_template
from chatbot import FAQ
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
# Data
list_QandA = [["Menstrual health What is menstruation? I don’t know about menstruation. What is it?",
" Menstruation or periods is when the uterus lining shed... |
#!C:\Users\Jeff\Documents\GitHub\BridgeMaster\Web\Member\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install'
__requires__ = 'setuptools==39.1.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(... |
from collections import namedtuple
from carim.global_resources import locations
def get_markers():
return [Marker(
name=m[0],
icon=Icon.DEFAULT,
color=WHITE,
position=m[1],
active=True,
active_3d=True
) for m in locations.marks]
def get_config():
return {... |
import numpy as np
import numba
import scipy.optimize as sopt
import json
sin = np.sin
cos = np.cos
atan2 = np.arctan2
sqrt = np.sqrt
class vsc_lcl_class:
def __init__(self):
self.t_end = 10.000000
self.Dt = 0.0010000
self.decimation = 10.000000
self.itol = 1e-6
s... |
#!/usr/bin/python
import os
import re
import json
from lxml import etree as et
import config
import messages as msg
# pcbmode modules
import svg
import utils
import place
import copy
from style import Style
from point import Point
from shape import Shape
class Footprint():
"""
"""
def __init__(self,... |
from bpy.props import PointerProperty, StringProperty, BoolProperty, \
EnumProperty, IntProperty, FloatProperty, \
CollectionProperty
from ...rman_utils import filepath_utils
from ...rman_utils import property_utils
from ...rfb_logger import rfb_log
from ... import rman_render
from ... import rman_bl_nodes
fro... |
# Generated by Django 4.0.4 on 2022-05-26 13:57
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('news', '0002_category_subscribers'),
]
operation... |
import numpy as np
class Correlated2D(object):
"""
This class generates points from an arbitrary 2D probability distribution
"""
def __init__(self, geometry, smooth_scale=1.):
"""
:param geometry: an instance of Geometry
:param smooth_scale: a smoothing scale that removes the ... |
# -*- coding: utf-8 -*-
import numpy as np
from nose.tools import raises, timed, eq_
from jismesh import utils as ju
def _data_scalar():
return [
({'meshcode': 5339}, 1),
({'meshcode': 53392}, 40000),
({'meshcode': 5339235}, 20000),
({'meshcode': 5339467... |
# (C) Copyright 2018 Hewlett Packard Enterprise Development LP.
#
# 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 rights to use, copy,... |
# Databricks notebook source
# MAGIC %md
# MAGIC
# MAGIC # [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/)
# MAGIC
# MAGIC This is used in a non-profit educational setting with kind permission of [Adam Breindel](https://www.linkedin.com/in/adbreind).
# MAGIC This is not lic... |
# -*- coding: utf-8 -*-
from datetime import datetime
from django.db.models import Q
from django.contrib.sites.models import Site
from cms.publisher.query import PublisherQuerySet
from django.conf import settings
from cms.exceptions import NoHomeFound
#from cms.utils.urlutils import levelize_path
class PageQuerySet(... |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.core import checks
from django.core.exceptions import ImproperlyConfigured
from yepes.types import Undefined
from yepes.utils.deconstruct import clean_keywords
class CalculatedField(object):
def __init__(self, *args, **kwargs):
... |
"""
@brief test tree node (time=2s)
"""
import sys
import os
import unittest
import pandas
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode.pip_helper import get_packages_list, package2dict
from pyquickhelper.pycode import ExtTestCase
from pyquickhelper.pycode.pip_helper import PQPipError
cla... |
"""
Linux mountpoints
"""
from .base import Mountpoint, Filesystem, MountpointOptions, MountpointUsage
LINUX_VIRTUAL_FILESYSTEMS = (
'proc',
'sysfs',
'cgroup',
'autofs',
'hugetlbfs',
'mqueue',
'devpts',
'devtmpfs',
'tmpfs',
'fusectl',
'pstore',
'configfs',
'selinuxfs... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
from loguru import logger
import torch
import torch.backends.cudnn as cudnn
from torch.nn.parallel import DistributedDataParallel as DDP
from yolox.core import launch
from yolox.exp import get_exp
from yolox.ut... |
from setuptools import setup
setup(
name = 'pyVerge',
version = '1.2',
description ='libary to interact with verge blockchain',
author ='gavin goodship',
packages=['PyVerge'],
install_requires=["requests","pyqrcode","bs4"]
)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#==============================================================================
# DOCS
#==============================================================================
"""Move data
"""
#==============================================================================
# IMP... |
def max_product_of_two(list_param):
# Initialize max_product variable
max_product = 0
# Loop through the numbers in the list
for num_one in list_param:
# Print the num_one
print(num_one)
# Loop through the numbers in the list again
for num_two in list_param:
... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
import gensim, nltk, re, json, os, pymongo
from gensim import corpora,similarities, models
from nltk.tokenize import word_tokenize
from datetime import date, datetime
from scrapy import settings
FILTER_ONE_WEEK = 7
format="%d/%m/%Y"
class DataProcess(object):
@staticmethod
def date_filter(dateNews):
... |
import os
import sys
from shutil import rmtree
from setuptools import Command, find_packages, setup
# RELEASE STEPS
# $ python setup.py upload
__title__ = "cutecharts"
__description__ = "Hand drawing style charts library for Python."
__url__ = "https://github.com/chenjiandongx/cutecharts"
__author_email__ = "chenji... |
from ...isa.inst import *
import numpy as np
class Vmadc_vim(Inst):
name = 'vmadc.vim'
# vmadc.vim vd, vs2, imm, v0
def golden(self):
if self['vl']==0:
return self['ori']
if self['ori'].dtype != np.uint8:
self['ori'].dtype = np.uint8
bit = np.unpack... |
"""
Functions that ignore NaN.
Functions
---------
- `nanmin` -- minimum non-NaN value
- `nanmax` -- maximum non-NaN value
- `nanargmin` -- index of minimum non-NaN value
- `nanargmax` -- index of maximum non-NaN value
- `nansum` -- sum of non-NaN values
- `nanprod` -- product of non-NaN values
- `nancumsum` -- cumul... |
#!/usr/bin/env python
#Author: Amit Dhamne
# [START imports]
import os
import urllib
import hashlib
import datetime
from google.appengine.api import users
from google.appengine.ext import ndb
from google.appengine.api import mail
import jinja2
import webapp2
#following loads jinja2
JINJA_ENVIRONMENT = jinja2.Environ... |
# hpgl2dv.py
#
# Copyright (c) 2009, Dan Heeks
# This program is released under the BSD license. See the file COPYING for details.
#
# This is the same as the hpgl2d machine, but uses units of 0.25mm instead of 0.01mm
import nc
import hpgl2d
class Creator(hpgl2d.Creator):
def init(self):
hp... |
# -*- coding: utf-8 -*-
from __future__ import annotations
import re
from unittest import TestCase
from PyR3.factory.fields.String import Regex, String
class TestString(TestCase):
def test_digest(self):
s0 = "Some random string"
self.assertEqual(String().digest(s0), s0)
def test_digest_min_... |
# -*- coding: utf-8 -*-
'''
Management of Gentoo make.conf
==============================
A state module to manage Gentoo's ``make.conf`` file
.. code-block:: yaml
makeopts:
makeconf.present:
- value: '-j3'
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import 3rd-p... |
# Copyright 1997 - 2018 by IXIA Keysight
#
# 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 rights to use, copy, modify, merge, p... |
import numpy as np
import tensorflow as tf
import math
from tqdm import tqdm
from skimage import io
from skimage.transform import resize
from skimage.morphology import label
from models.unet.common import IoU, mIoU, dice, SEGMENTATION_THRESHOLD
from models.unet.data_provider import TestDataProvider
cla... |
from games import Game
from math import nan, isnan
from queue import PriorityQueue
from copy import deepcopy
from utils import isnumber
from grading.util import print_table
class GameState:
def __init__(self, to_move, board, position, label=None, depth=15):
self.to_move = to_move
self.position = po... |
import unittest
from pygromos.files.blocks import imd_blocks
class test_imd_block(unittest.TestCase):
def test_some_blocks(self):
test = imd_blocks.REPLICA_EDS( NRES=2, NUMSTATES=5, RES=6, EIR=8,
NRETRIAL=9, NREQUIL=10, CONT=11)
test2 ... |
from .fields import * # noqa: F401, F403
from .forms import * # noqa: F401, F403
|
def branch(path):
"""
Builds a tuple containing all path above this one.
None of the returned paths or the given paths is required to
actually have a corresponding Node.
Expample:
>>> branch("/a/b/c/")
('/', '/a/', '/a/b/', '/a/b/c/')
"""
li = tuple(p for p in path.split('/') if p)
... |
is_acceptable_password = lambda p: (0 < sum(c.isdigit() for c in p) < len(p) > 6 or len(p) > 9) and 'password' not in p.lower() and len(set(p)) >= 3 |
# -*- coding: utf-8 -*-
""" Example of simulation of a geothermal system and comparison between
single and double U-tube pipe configurations.
The g-function of a single borehole is calculated for boundary condition of
uniform borehole wall temperature along the borehole. Then, the borehole
wall tempera... |
import riot
import tkinter as tk
from tkinter import ttk
LARGE_FONT=("Comic Sans MS", 12)
def main(name, displayResult, rank, a, b ,c , d, e, f, g, h, rankText, regVal):
#defining globale variables
summonerName = " "
realsummonerName = " "
tempName = str(name)
tempRegion = str(regVal)
if t... |
import config_tb
from config_db import config
import requests
from datetime import datetime
from bs4 import BeautifulSoup
import telebot
from db import UseDataBase
from emoji import *
# заглавная страница сервиса Яндекс.Погода с прогнозом
# по текущему месту положения
URL = 'https://yandex.ru/pogoda/'
... |
from datetime import datetime, date
from marqeta.response_models.jit_funding_paymentcard_funding_source import JitFundingPaymentcardFundingSource
from marqeta.response_models.jit_funding_programgateway_funding_source import JitFundingProgramgatewayFundingSource
from marqeta.response_models.jit_funding_program_funding_s... |
# Generated by Django 3.2.4 on 2021-06-12 15:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('examaltersys', '0006_auto_20210612_1956'),
]
operations = [
migrations.AlterField(
model_name='exam',
name='day',
... |
import sys
import unittest
from nose.tools import assert_true, assert_false, assert_is_not_none, \
assert_equal, assert_is_none
from robotide.robotapi import (
TestCaseFile, Resource, VariableTable, TestDataDirectory)
from robotide.context import IS_WINDOWS
from robotide.namespace.namespace import _VariableSta... |
import unittest
import numpy as np
import pandas as pd
from pymatgen.util.testing import PymatgenTest
from matminer.featurizers.site.fingerprint import (
AGNIFingerprints,
OPSiteFingerprint,
CrystalNNFingerprint,
VoronoiFingerprint,
ChemEnvSiteFingerprint,
)
from matminer.featurizers.site.tests.ba... |
# Copyright 2015 The TensorFlow Authors. 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 required by applica... |
import colorama
import spacy
import torch
import torch.nn.functional as F
from nltk.corpus import stopwords
from spacy.pipeline import EntityRuler
from spacy.tokens import Token
from transformers import GPT2Tokenizer
from KID.agent import BaseAgent
from KID.agent.agent_utils import calc_banned_ngram_tokens, top_k_filt... |
import socket
def Main():
host = '127.0.0.1'
port = 5000
s = socket.socket()
s.connect((host, port))
message = input("->")
while message != 'q':
s.send(message.encode('utf-8'))
data = s.recv(1024).decode('utf-8')
print("Received from server: ", data)
message =... |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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 app... |
"""
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
from typing import Union, Any, TypeVar, Iterator
from proto... |
# coding=utf-8
# Copyright 2021 Google LLC
#
# 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 law or agreed ... |
#!/usr/bin/python
"""
Created on Sun Jul 19 17:17:24 2020
ASCII art generator.
@author: Joseph Lai
"""
import random
from pyfiglet import Figlet
from utils.Cli import CheckArgs, Parser
from utils.Examples import Examples
from utils.Fonts import FONTS
from utils.List import List
from utils.Make import Make
from util... |
"""
This script is meant to be used as a template to step through a provided DB file
for debugging a specific issue.
It constructs the chain_state through the state_manager and uses the WAL
to replay all state changes through the state machines until all state changes are consumed.
The parameters (token_network_identif... |
import FWCore.ParameterSet.Config as cms
import CondTools.Ecal.conddb_init as conddb_init
import CondTools.Ecal.db_credentials as auth
process = cms.Process("ProcessOne")
process.MessageLogger = cms.Service("MessageLogger",
debugModules = cms.untracked.vstring('*'),
cout = cms.untracked.PSet(
threshol... |
# Author: Joan Massich <mailsik@gmail.com>
#
# License: BSD (3-clause)
from struct import Struct
from collections import namedtuple
from math import modf
from datetime import datetime
from ...utils import warn
def _read_teeg(f, teeg_offset):
"""
Read TEEG structure from an open CNT file.
# from TEEG st... |
numFile = open('numbers.txt', 'r')
summ = 0
for i in numFile:
for i_2 in i:
if i_2.isdigit():
summ += int(i)
numFile.close()
answerFile = open('answer.txt', 'w')
answerFile.write(str(summ))
answerFile.close() |
from typing import Dict
from fastapi import FastAPI, status
from pydantic import BaseModel
class PostBase(BaseModel):
title: str
content: str
class PostCreate(PostBase):
pass
class PostPublic(PostBase):
id: int
class PostDB(PostBase):
id: int
nb_views: int = 0
class DummyDatabase:
... |
# $Id$
# Authors: Nicola Larosa <docutils@tekNico.net>;
# Lele Gaifax <lele@seldati.it>
# Copyright: This module has been placed in the public domain.
# Beware: the italian translation of the reStructuredText documentation
# at http://docit.bice.dyndns.org/static/ReST, in particular
# http://docit.bice.dyndns... |
"""scrape all the URLs from the article segment of a Wikipedia page
and write them into a plain-text file, omitting all links that
begin with #, /wiki/File:, or /wiki/Template
"""
from bs4 import BeautifulSoup
import requests
# get the contents of one page
start = 'http://en.wikipedia.org/wiki/Harrison_Ford'
pa... |
_base_ = './mask_rcnn_hrnetv2p_w18_1x_coco.py'
model = dict(
backbone=dict(
type='HRNet',
extra=dict(
stage2=dict(num_channels=(40, 80)),
stage3=dict(num_channels=(40, 80, 160)),
stage4=dict(num_channels=(40, 80, 160, 320))),
init_cfg=dict(
typ... |
# _*_ coding:utf-8 _*_
'''
IsotonicRegression
'''
from pyspark.sql import SparkSession
from pyspark.ml.regression import IsotonicRegression,IsotonicRegressionModel
spark = SparkSession.builder.appName("AFTSurvivalRegression").getOrCreate()
paths="/export/home/ry/spark-2.2.1-bin-hadoop2.7/data/mllib/"
... |
# License: EPL
import os
import re
import sys
from _pydev_imps._pydev_saved_modules import threading
from _pydevd_bundle.pydevd_constants import get_global_debugger, IS_WINDOWS, IS_JYTHON, get_current_thread_id, \
sorted_dict_repr
from _pydev_bundle import pydev_log
from contextlib import contextmanager
fr... |
from sympy import (
Abs, acos, Add, atan, Basic, binomial, besselsimp, collect,cos, cosh, cot,
coth, count_ops, Derivative, diff, E, Eq, erf, exp, exp_polar, expand,
expand_multinomial, factor, factorial, Float, fraction, Function,
gamma, GoldenRatio, hyper, hypersimp, I, Integral, integrate, log,
l... |
from __future__ import unicode_literals
import difflib
import errno
import json
import os
import posixpath
import socket
import sys
import threading
import unittest
import warnings
from collections import Counter
from contextlib import contextmanager
from copy import copy
from functools import wraps
from unittest.util... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import inspect
import itertools
import math
import os
from functools import reduce
from functools import wraps
from itertools import repeat
import tensorflow as tf
from trident.models.pretra... |
import sys
n, m, *lr = map(int, sys.stdin.read().split())
lr = zip(*[iter(lr)] * 2)
def main():
cnt = [0] * (n + 1)
for l, r in lr:
cnt[l-1] += 1
cnt[r] -= 1
for i in range(n):
cnt[i+1] += cnt[i]
res = 0
for i in range(n):
res += (cnt[i] == m) & 1
... |
import logging
import json
import os
import sys
from os.path import join, abspath, dirname
import settings
import github_api as gh
THIS_DIR = dirname(abspath(__file__))
__log = logging.getLogger("pull_requests")
def poll_pull_requests(api):
__log.info("looking for PRs")
# get voting window
voting_wind... |
"""Module for contestants adapter."""
import copy
import logging
import os
from typing import List
from aiohttp import ClientSession
from aiohttp import hdrs, web
from multidict import MultiDict
from .raceclasses_adapter import RaceclassesAdapter
EVENTS_HOST_SERVER = os.getenv("EVENTS_HOST_SERVER", "localhost")
EVEN... |
from torchero.models.vision.model import *
from torchero.models.vision.nn.torchvision import *
|
import pglet
from pglet import Message
with pglet.page("basic-messages") as page:
page.add(
Message(value='This is just a message.'),
Message(value='Success message with dismiss button', dismiss=True, type='success'),
Message(value='Error message with dismiss button', dismiss=True, type='error')) |
import ctypes
import errno
from pyarcan import arcan_tui
from pyarcan import arcan_tui_listwnd
connection = arcan_tui.arcan_tui_open_display('Listwnd'.encode(), ''.encode())
config = arcan_tui.TuiCbcfg()
context = arcan_tui.arcan_tui_setup(connection, None, ctypes.byref(config),
ct... |
#! /usr/bin/env python
import importlib
import numpy
import operator
import re
from collections import namedtuple
class Point(namedtuple('Point', 'x y')):
def __new__(cls, *args):
if len(args) == 2:
return tuple.__new__(cls, args)
elif len(args) == 1:
arg = args[0]
if type(arg) == str:
if arg[0... |
import json
from dateutil.parser import parse as parse_date
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.views.decorators.http import require_POST
from django.views.decorators.csrf import csrf_exempt
from .view_helper import *
from .models import CoinbaseEvent, PriceDat... |
import numexpr as ne
import numpy as np
from scipy.interpolate import interp1d
from . import DATA_DIR
class InternalNoiseModel:
"""
Calculate internal noise function ofpowertrain and size, based on http://www.auto-decibel-db.com/index.html.
:param cycle: Driving cycle. Pandas Series of second-by-second ... |
from __future__ import print_function
import calendar
import datetime
import ec2
import time
def cleanup():
"""
Cleans up old Packer resources. They can be left behind
when Packer does not shut down cleanly.
"""
# Terminate old Packer EC2 instances.
instance_ids = []
for instance in get... |
import pymongo
import csvHandler as fiHandl
import pandas as pd
import numpy as np
from pymongo import MongoClient
import pandasCleaning as pdClean
import hashlib
import pickle
from datetime import datetime
# To setup a local db for testing use
# docker run -d -p 27017-27019:27017-27019 --net-alias mongodb --name mong... |
from ..utils.device import Device
from ..utils.log import logger
from ..utils.recognize import Recognizer, Scene, RecognizeError
from ..utils.solver import BaseSolver
class MissionSolver(BaseSolver):
"""
点击确认完成每日任务和每周任务
"""
def __init__(self, device: Device = None, recog: Recognizer = None) -> None:
... |
# model settings
model = dict(
type='SOLO',
pretrained='/versa/dyy/pretrained_models/vovnet39.pth',
backbone=dict(
type='VoVNet',
model_name='vovnet39',
out_indices=(0, 1, 2, 3),
frozen_stages=1),
neck=dict(
type='FPN',
in_channels=[256, 512, 768, 1024],
... |
# -*- coding: utf-8 -*-
"""
flaskrst.modules.pygments
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by Christoph Heer.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import time
from docutils import nodes
from docutils.parsers.rst import Directive
from flas... |
"""
Configuration File Permissions parsers
======================================
Parsers included in this module are:
SshdConfigPerms - command ``/bin/ls -l /etc/ssh/sshd_config``
-------------------------------------------------------------
Grub1ConfigPerms - command ``/bin/ls -l /boot/grub/grub.conf``
------------... |
from CyberSource import *
import json
import os
# Assigning the configuration properties in the configuration dictionary
def get_configuration():
authentication_type ="mutual_auth"
run_environment = "api-matest.cybersource.com"
enable_client_cert = True
client_cert_dir = os.path.join(os.getcwd(), "... |
# Copyright 2013 Mirantis 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 required by ... |
from __future__ import division, print_function, absolute_import
from collections import defaultdict, namedtuple
import json
import sqlite3
from contextlib import contextmanager
class Transaction(object):
def __init__(self, connection):
self.connection = connection
self.cursor = self.connection.cur... |
from typing import Any, Callable, Dict, Iterator, List, Optional, Type, cast
import blacksmith
from blacksmith import (
CollectionParser,
HTTPTimeout,
PrometheusMetrics,
SyncAbstractServiceDiscovery,
SyncAbstractTransport,
SyncClient,
SyncClientFactory,
SyncConsulDiscovery,
SyncHTTP... |
#!/usr/bin/env python3
from typing import List, Dict, Tuple, NamedTuple, Generator, Mapping, Iterable
import matplotlib.pyplot as plt
import gcode as g
Coordinate = Tuple[int, int]
Path = List[Coordinate]
Charpath = List[Path]
class Glyph(NamedTuple):
left: int
right: int
paths: Charpath
# box: Tup... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.