src stringlengths 721 1.04M |
|---|
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible 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, eithe... |
# -*- coding: utf-8 -*-
'''
Created on 13.03.2016 by Artem Tiumentcev
@author: Sergey Prokhorov <me@seriyps.ru>
'''
import unittest
from num2t4ru import num2text, decimal2text
class TestStrToText(unittest.TestCase):
def test_units(self):
self.assertEqual(num2text(0), u'ноль')
self.assertEqual(n... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# bts_tools - Tools to easily manage the bitshares client
# Copyright (c) 2014 Nicolas Wack <wackou@gmail.com>
#
# This program 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 Softwa... |
import os
class Board:
SIZE = 15
def __init__(self):
self.board = [['+' for _ in range(self.SIZE)] for _ in range(self.SIZE)]
self.player1 = input("player1의 이름을 입력하시오 : ")
self.player2 = input("player2의 이름을 입력하시오 : ")
self.startgame()
def printboard(self):
"""Prin... |
# Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# 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 in the top-level directory
# of this distribution and at:
#
# http://... |
"""Implementation of GLU Nurbs structure and callback methods
Same basic pattern as seen with the gluTess* functions, just need to
add some bookkeeping to the structure class so that we can keep the
Python function references alive during the calling process.
"""
from OpenGL.raw import GLU as simple
from OpenGL import... |
# -*- coding: utf-8 -*-
# vispy: gallery 2000
# -----------------------------------------------------------------------------
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# ---------------------------------------------------------... |
from django.db import models
from apps.core.models import TimeStampedModel
from .dropdown_options import COMPANY_TYPES
from .tasks import create_site_folder_and_subfolders
# Create your models here.
class Company(TimeStampedModel):
name = models.CharField(max_length=32, unique=True)
company_type = models.Cha... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Mohier Frédéric frederic.mohier@gmail.com
# Karfusehr Andreas, frescha@unitedseed.de
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms o... |
px8 / python cartridge
version 1
__python__
# Original code from rez
# https://www.lexaloffle.com/bbs/?tid=29529
SIZE = 128
A = None
cr = None
cg = None
cb = None
cw = None
def _init():
global SIZE, A, cr, cg, cb, cw
mode(SIZE, SIZE, 1)
cls()
A = SIZE - 1
cr = [0] * SIZE
cg = [0] * SIZE
... |
"""Provides a number of objects to help with managing certain elements in the CFME UI.
Specifically there are two categories of objects, organizational and elemental.
* **Organizational**
* :py:class:`Region`
* :py:mod:`cfme.web_ui.menu`
* **Elemental**
* :py:class:`AngularCalendarInput`
* :py:class:`Angu... |
#
# @file TestSBMLDocument.py
# @brief SBMLDocument unit tests
#
# @author Akiya Jouraku (Python conversion)
# @author Ben Bornstein
#
# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
#
# DO NOT EDIT THIS FILE.
#
# This file was generated automatically by converting the file loca... |
#------------------------------------------------------------------------------
# Copyright (c) 2009 Richard W. Lincoln
#
# 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 restricti... |
#!/usr/bin/env python3
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ho... |
# -*- coding: utf-8 -*-
from resources.lib.util import cUtil
from resources.lib.gui.gui import cGui
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.parser import cParser
from resources.lib.config import cConfig
from resources.lib ... |
#!/usr/bin/env python
# internal modules
import hasy_tools
import numpy as np
# 3rd party modules
from keras.callbacks import CSVLogger, ModelCheckpoint
from keras.layers import Conv2D, Dense, Dropout, Flatten, MaxPooling2D
from keras.models import Sequential
# Load the data
data = hasy_tools.load_data()
x_train = d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# dbload.py
#
# Copyright 2015 Hartland PC LLC
#
# This file is part of the of the database loader for CCE 4.0 (open source version).
#
# This package is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... |
#!/usr/bin/python
#
# Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
import webob
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute
from nova import exception
from nova.openstack.common import log as logging
from nova.openstack.common.gettextutils import _
LOG = logging.getLogger(__name__)
class ExtendedActionsController(wsgi.Con... |
# Copyright 2017 The Tangram Developers. See the AUTHORS file at the
# top-level directory of this distribution and at
# https://github.com/renatoGarcia/tangram/blob/master/AUTHORS.
#
# This file is part of Tangram.
#
# Tangram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Less... |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- http://www.mdanalysis.org
# Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
... |
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import dni
# Training settings
parser = argparse.ArgumentParser(description='PyTorch MNIS... |
#-----------------------------------------------------------------------------
# Copyright (c) 2008-2016, David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""Routines for IPv4 a... |
# pylint: disable-msg=W0401,W0511,W0611,W0612,W0614,R0201,E1102
"""Tests suite for MaskedArray & subclassing.
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
"""
__author__ = "Pierre GF Gerard-Marchant"
import types
import warnings
import numpy as np
import numpy.core.fromnumeric as fromnumeric
fr... |
#!/usr/bin/env python
#
# CLUES - Cluster Energy Saving System
# Copyright (C) 2015 - GRyCAP - Universitat Politecnica de Valencia
#
# This program 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 versi... |
from datetime import date, datetime
import hashlib, inspect
from django.db.models import Q
from django.contrib.auth import authenticate, login, logout, models as auth_models
from django.contrib.auth.hashers import make_password
from django.conf.urls import url
from django.utils import timezone
from tastypie import re... |
import logging
from django.conf import settings
log = logging.getLogger("k.wiki")
# Why is this a mixin if it can only be used for the Document model?
# Good question! My only good reason is to keep the permission related
# code organized and contained in one place.
class DocumentPermissionMixin(object):
"""Ad... |
from ROOT import TFile, gROOT, gPad, TVectorD, TObject
from ROOT import TGraphErrors, TH1D, TLegend, TCanvas, TLatex
TGraphErrors.__init__._creates= False
TH1D.__init__._creates= False
TLegend.__init__._creates= False
TCanvas.__init__._creates= False
TLatex.__init__._creates= False
gROOT.LoadMacro( "libAnalysisDict.... |
import math
class Circle:
def __init__(self, r=1):
self._radius = self._validate_dimension(r)
def radius(self, r=None):
if r is None:
return self._radius
else:
self._radius = self._validate_dimension(r)
def diameter(self, d=None):
if d is None:
... |
#!/usr/bin/env python3
"""
Extract image links from a web page
===================================
Author: Laszlo Szathmary, 2011 (jabba.laci@gmail.com)
GitHub: https://github.com/jabbalaci/Bash-Utils
Given a webpage, extract all image links.
Usage:
------
get_images.py URL [URL]... [options]
Options:
-l, --len... |
from base64 import b64encode, b16encode, b32decode
from datetime import timedelta
from hashlib import sha1
import os.path
import re
import traceback
from bencode import bencode as benc, bdecode
from couchpotato.core._base.downloader.main import DownloaderBase, ReleaseDownloadList
from couchpotato.core.helpers.encoding... |
"""
wxPieTool - wxPython Image Embedding Tool
Copyright 2016 Simon Wu <swprojects@gmx.com>
This program 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 2 of the License, or
(at your option) any la... |
import dabam
if __name__ == '__main__':
#
# get summary table
#
text = dabam.dabam_summary()
print(text)
out = dabam.dabam_summary_dictionary()
for i in range(len(out)):
print("i=:%d, entry:%d"%(i,(out[i])["entry"]))
print(out[13])
#
# load a given entry (=14)
... |
#!/usr/bin/env python3
# chameleon-crawler
#
# Copyright 2016 ghostwords.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from multiprocessing import Process, Queue
... |
#!/usr/bin/env python
# encoding: utf-8
import struct, plistlib, datetime
# TODO
# - dicts with more than 14 keys
# - allow pathOrFile to be a file-like object
# - raise TypeError for unsupported types
# - add writePlistToString to match plistlib API
# - implement binary plist parser (readPlist)
# - support >8 byte i... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('commerce', '0004_auto_20150110_1947'),
]
operations = [
migrations.AlterModelOptions(
name='orderdetail',
... |
'''
Establish custom log levels for rexlexer's verbose output.
'''
import logging
from rexlex.config import LOG_MSG_MAXWIDTH
# ---------------------------------------------------------------------------
# Establish custom log levels.
# ---------------------------------------------------------------------------
# Use... |
# 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 ... |
from toontown.hood import HoodAI
from toontown.toonbase import ToontownGlobals
from toontown.distributed.DistributedTimerAI import DistributedTimerAI
from toontown.classicchars import DistributedChipAI
from toontown.classicchars import DistributedDaleAI
from toontown.dna.DNAParser import DNAGroup, DNAVisGroup
from toon... |
from __future__ import absolute_import
import mock
from random import random
from .MockPrinter import MockPrinter
from redeem.Gcode import Gcode
class M114_Tests(MockPrinter):
def test_gcodes_M114(self):
A = round(random() * 200, 1)
B = round(random() * 200, 1)
C = round(random() * 200, 1)
X = rou... |
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import random
import time
from django.http import HttpResponse
from django.contrib.auth.signals import user_login_failed
import python_digest
from django_digest.utils import get_backend, get_setting, DEFAULT_REALM
import si... |
import numpy as np
import tectosaur.mesh.mesh_gen as mesh_gen
from tectosaur.mesh.find_near_adj import *
from tectosaur.util.test_decorators import golden_master
import logging
logger = logging.getLogger(__name__)
def find_adjacents(tris):
pts = np.random.rand(np.max(tris) + 1, 3)
close_pairs = find_close_o... |
import scipy.stats
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from ...utils import parse_computed_grs_file
def correlation(args):
grs1 = parse_computed_grs_file(args.grs_filename)
grs1.columns = ["grs1"]
grs2 = parse_computed_grs_file(args.grs_filename2)
grs2.columns = ["... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
MISC_HTML_SOURCE = """
<font size="2" style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; ">test1</font>
<div style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; font-size: 12px; fo... |
"""evaluation_framework.py -- All that is needed to evaluate feature selection algorithms."""
import numpy as np
import tables as tb
import subprocess
import shlex
import math
from sklearn import linear_model, metrics, model_selection
def consistency_index(sel1, sel2, num_features):
""" Compute the consistency ... |
import re
import sys
import os
import os.path as osp
from fnmatch import fnmatch
from pytd.gui.dialogs import promptDialog
from pytd.util.logutils import logMsg
from pytd.util.sysutils import importModule, toStr, inDevMode, getCaller
from pytd.util.fsutils import pathSplitDirs, pathResolve, pathNorm, pathJoin
from py... |
import threading
import transaction
import zope.interface
import transaction.interfaces
class CelerySession(threading.local):
"""Thread local session of data to be sent to Celery."""
def __init__(self):
self.tasks = []
self._needs_to_join = True
def add_call(self, method, *args, **kw):
... |
import json
import re
from udj.views.views07.decorators import NeedsJSON
from udj.views.views07.decorators import AcceptsMethods
from udj.views.views07.decorators import HasNZJSONParams
from udj.views.views07.authdecorators import NeedsAuth
from udj.views.views07.responses import HttpResponseConflictingResource
from u... |
# -*- coding: utf-8 -*-
# Copyright(C) 2019-2020 Célande Adrien
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from . import write_organisation
from .. import helpers
logger = logging.getLogger(__name__)
# Module API
def write_fda_applica... |
#!/usr/bin/python
'''
The MIT License (MIT)
Copyright (c) 2013-2014 winlin
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, cop... |
import re, time, os, shutil, string
from subprocess import Popen, PIPE, STDOUT
from random import randint, seed
__all__ = ['find', 'removedirs', 'source', 'tempfile', 'copy', 'rm', 'template, template_dir']
def find(path='.', regex='*', ctime=0):
r = []
regex = str(regex).strip()
if regex == '*': regex = ... |
__author__ = 'kevin'
import re
from attacksurfacemeter.loaders.base_line_parser import BaseLineParser
class CflowLineParser(BaseLineParser):
""""""
_instance = None
@staticmethod
def get_instance(cflow_line=None):
if CflowLineParser._instance is None:
CflowLineParser._instance =... |
# grammar.py, part of Yapps 2 - yet another python parser system
# Copyright 1999-2003 by Amit J. Patel <amitp@cs.stanford.edu>
# Enhancements copyright 2003-2004 by Matthias Urlichs <smurf@debian.org>
#
# This version of the Yapps 2 grammar can be distributed under the
# terms of the MIT open source license, either fo... |
#
# Copyright John Reid 2008
#
"""
Code to rank PSSMs by "interesting-ness".
Information content.
Low-order predictability.
Number of sequences with sites.
"""
from gapped_pssms.parse_gapped_format import parse_models
from itertools import imap
from gapped_pssms.pssm_score import *
from cookbook import DictOfLists
i... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Watson - Auth documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 17 14:49:48 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in thi... |
#
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019, 2020 Vladimír Vondruš <mosra@centrum.cz>
#
# 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, inc... |
from functools import partial as curry
from django.contrib import admin
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from pinax.images.admin import ImageInline
from pinax.images.models import ImageSet
from .conf import settings
from .forms import AdminPostForm
from .model... |
#####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Ky?stil? ... |
#!/usr/bin/env python3
import sys
import os
import argparse
import pkgutil
import re
# Don't make .pyc files
sys.dont_write_bytecode = True
# Go and get all the relevant directories and variables from cmake
nuclear_dir = os.path.dirname(os.path.realpath(__file__))
project_dir = os.path.dirname(nuclear_dir)
# Get the... |
from __future__ import absolute_import
'''Copyright 2015 LinkedIn 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 applicable law... |
from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
cm_data = [[0., 0., 0.],
[0.588235, 0., 0.588235],
[0.588235, 0., 0.588235],
[0.588235, 0., 0.588235],
[0.588235, 0., 0.588235],
[0.588235, 0., 0.588235],
[0.588235, 0., 0.588235],
[0.588235, 0., 0.588235],
[0.588235, 0., 0.588235],
[0.588... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import sys
import signal
from contextlib import contextmanager
from datetime import datetime
from flask import current_app
from flask_script import prompt_bool
from udata.commands import submanager, IS_INTERACTIVE
from udata.search impor... |
"""
This module is the main part of the library. It houses the Scheduler class
and related exceptions.
"""
from threading import Thread, Event, Lock
from datetime import datetime, timedelta
from logging import getLogger
import os
import sys
from napscheduler.util import *
from napscheduler.triggers import SimpleTrigg... |
import datetime
from django.db.models import Count, Min, Sum, Avg, Max
from billing.models import Transaction
from digitalmarket.mixins import LoginRequiredMixin
from products.models import Product
from .models import SellerAccount
class SellerAccountMixin(LoginRequiredMixin, object):
account = None
products = ... |
import html
from bs4.element import Tag
from forum.base.models import Comment
from html2text import html2text
def markdown_smilies(img_tag: Tag):
img_src = img_tag.get('src', '')
if img_src.startswith('/static/images/smiliereplace/'):
img_alt = img_tag.get('alt', '')
img_tag.replace_with(img... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the vsftpd parser."""
from __future__ import unicode_literals
import unittest
from plaso.parsers import vsftpd
from tests.parsers import test_lib
class VsftpdLogParserTest(test_lib.ParserTestCase):
"""Tests for the vsftpd parser."""
def testParse(se... |
import unittest
from ropeide.outline import PythonOutline
from ropetest import testutils
class OutlineTest(unittest.TestCase):
def setUp(self):
super(OutlineTest, self).setUp()
self.project = testutils.sample_project()
self.outline = PythonOutline(self.project)
def tearDown(self):
... |
# -*- coding: utf-8 -*-
""" Example plugin for tests. This plugin should be able to install
SQL database server.
"""
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import uuid
from kanzo.core.puppet import update_manifest_inline
from kanzo.utils.shell im... |
"""
This module provides the functions for the one-loop finite
temperature corrections to a potential in QFT. The two basic
functions are:
Jb(x) = int[0->inf] dy +y^2 log( 1 - exp(-sqrt(x^2 + y^2)) )
Jf(x) = int[0->inf] dy -y^2 log( 1 + exp(-sqrt(x^2 + y^2)) )
Call them by:
Jb(x, approx='high', deriv=0... |
# downscale cru data in a CLI way
if __name__ == '__main__':
import glob, os, itertools, rasterio
from downscale import DeltaDownscale, Baseline, Dataset, utils, Mask
from functools import partial
import numpy as np
import argparse
# parse the commandline arguments
parser = argparse.ArgumentParser( description... |
# -*- coding: utf-8 -*-
# Flrn-gtk: panneau sommaire
# Rémy Oudompheng, Noël 2005-Septembre 2006
# Modules GTK
import pygtk
pygtk.require('2.0')
import gtk
import gtk.gdk
import gobject
import pango
# Modules Python
import email.Utils
import time
import os, sys
from tempfile import mkstemp
import re
# Modules
impo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Part of the Reusables package.
#
# Copyright (c) 2014-2020 - Chris Griffith - MIT License
import os
import sys
import subprocess
from multiprocessing import pool
from functools import partial
from reusables.shared_variables import *
__all__ = ["run", "run_in_pool"]
... |
#!/usr/bin/env python
#
# vimui.py
#
# User Interface for Vim
import functools
import vim
class Ui:
def __init__(self, skype):
self.skype = skype
self.is_open = False
self.tabnr = None
def open(self):
if self.is_open:
return
# try:
self.messages =... |
import csv
import io
import logging
from typing import Optional, Set
import discord
from redbot.core import checks, commands
from .abc import MixinMeta
from .converters import (
ComplexActionConverter,
ComplexSearchConverter,
RoleSyntaxConverter,
)
from .exceptions import RoleManagementException
log = lo... |
# -*- coding: utf-8 -*-
# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, o... |
'''
Created on 20 feb. 2017
@author: fara
'''
import numpy as np
from matplotlib import pyplot as plt
from mapFeature import mapFeature
from show import show
def plotDecisionBoundary(ax,theta, X, y):
'''
%PLOTDECISIONBOUNDARY Plots the data points X and y into a new figure with
%the decision boundary def... |
import sys
import os
import numpy as np
data_dir = sys.argv[1]
filenames = os.listdir(data_dir)
timeseries = []
preprocessing = np.load('model/preprocessing.npz')
timeseries_means = preprocessing['means']
timeseries_stds = preprocessing['stds']
change = preprocessing['change']
print "Reading files from", data_dir
... |
""" Sorted input and output.
"""
from collections import deque
from operator import itemgetter
from .buffer import _ReaderBuffer
from .buffer import _WriterBuffer
__all__ = "SortReader", "SortWriter"
class _Sorter(object):
""" Abstract base class for SortReader and SortWriter.
"""
def __init__(se... |
from __future__ import division
import os
import ui_trigger
import sys
import numpy
from PyQt4 import QtCore, QtGui, Qt
import PyQt4.Qwt5 as Qwt
import serial
import serial.tools.list_ports
import logging
import logging.handlers
from datetime import datetime
from pprint import pprint
TRIGGER_PULSE_CODE = 100000
SIXTE... |
from __future__ import print_function
import os
from burlap import Satchel
from burlap.constants import *
from burlap.decorators import task
class EC2MonitorSatchel(Satchel):
"""
Wraps the EC2 monitor script provided by Amazon:
http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-s... |
# -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... |
from reportlab.lib import colors
from reportlab.graphics.shapes import *
from reportlab.graphics import renderPDF
data = [
# Year Month Predicted High Low
(2007, 8, 113.2, 114.2, 112.2),
(2007, 9, 112.8, 115.8, 109.8),
(2007, 10, 111.0, 116.0, 106.0),
(2007, 11, 109.8, ... |
#!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot3/blob/master/LICENSE
from __future__ import absolute_import
import keyword
import numbers
import os
import re
import struct
import sys
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlpars... |
from dataclasses import dataclass
from threading import Event
from pymuse.utils.stoppablequeue import StoppableQueue
@dataclass
class SignalData():
"""
Dataclass for a signal data point. Event_marker attribute is optional
"""
time: float
values: list
event_marker: list = None
class Signal():... |
#!/usr/bin/env python
# Copyright (c) 2002 Brad Stewart
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This pro... |
# -*- coding: utf-8 -*-
"""
Virtual Identity
~~~~~~~~~~~~~~~~
:Copyright: (c) 2017 DELL Inc. or its subsidiaries. All Rights Reserved.
:License: Apache 2.0, see LICENSE for more details.
:Author: Akash Kwatra
Created on May 4, 2017
"""
import unittest
import sys
import logging
import config
from resttestms import h... |
"""
Functions for parsing MCNP input files.
"""
import re
import warnings
# regular expressions
re_int = re.compile('\D{0,1}\d+') # integer with one prefix character
re_ind = re.compile('\[.+\]') # interior of square brackets for tally in lattices
re_rpt = re.compile('\d+[rRiI]') # repitition syntax of MCNP inpu... |
"""
three.js/Cannon.js pool table definition
"""
from copy import deepcopy
import numpy as np
from three import *
INCH2METER = 0.0254
FT2METER = INCH2METER / 12
def pool_table(L_table=2.3368, W_table=None, H_table=0.77,
L_playable=None, W_playable=None,
ball_diameter=2.25*INCH2METER,... |
# -*- coding: utf-8 -*-
"""
@file
@author Chrisitan Urich <christian.urich@gmail.com>
@version 1.0
@section LICENSE
This file is part of DynaMind
Copyright (C) 2015 Christian Urich
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as publishe... |
import pytest
from tests.utils.loop import CounterLoop
@pytest.fixture(autouse=True)
def _(module_launcher_launch):
pass
def test_move_from_rep1(module_launcher):
module_launcher.create_file('default', 'to_move1')
module_launcher.move_file('default', 'to_move1', 'moved1',
... |
# -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
#!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib Authors.
#
# 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
#
# ... |
# Using bt601 with Python
import pexpect
import time
import socket
import sys
import os
import syslog
UNIX_SER="/tmp/ud_bluetooth_main"
# function to transform hex string like "0a" into signed integer
def hexStrToInt(hexstr):
val = int(hexstr[0:2],16)
val = (val * 6.0 - 20)/100.0
return val
def sendMessa... |
import kite.maildir
import unittest
import types
mockdata = {"from": {"address": "gerard", "name": ""}, "subject": "test", "contents": "empty", "to": "gerard", "date": "November 13, 2007"}
class EmptyObject(object):
"""Empty class used by mocks. Required because python doesn't let us add attributes
to an empt... |
"""
proximity.py
---------------
Query mesh- point proximity.
"""
import numpy as np
from . import util
from .grouping import group_min
from .constants import tol, log_time
from .triangles import closest_point as closest_point_corresponding
from .triangles import points_to_barycentric
try:
from scipy.spatial im... |
#!/usr/bin/env python
# encoding: utf-8
# python setup.py sdist upload -r pypi
from setuptools import setup
setup(name="tailor",
version='0.0.2',
description='cross platform photo booth',
author='Leif Theden',
author_email='leif.theden@gmail.com',
packages=['tailor'],
install_requir... |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program 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 ... |
# vi: ts=4 expandtab syntax=python
##############################################################################
# Copyright (c) 2008 IBM Corporation
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distr... |
# -*- coding: utf-8 -*-
from collections import OrderedDict
from datetime import datetime
from flask import redirect, abort
from baseframe.forms import render_form
from ..models import db, agelimit, Location, JobLocation, JobPost, POSTSTATUS
from ..forms import NewLocationForm, EditLocationForm
from .. import app, las... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.