src stringlengths 721 1.04M |
|---|
from __future__ import absolute_import
import logging
import six
import pandas as pd
import numpy as np
from ..plotting import curdoc
from ..models import ColumnDataSource, GridPlot, Panel, Tabs, Range
from ..models.widgets import Select, MultiSelect, InputWidget
# crossfilter plotting utilities
from .plotting impo... |
"""
WSGI config for roots project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... |
#!/usr/bin/env python
#
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... |
"""Tests for blobstore.py."""
import cgi
import cStringIO
import datetime
import pickle
import unittest
from .google_imports import namespace_manager
from .google_imports import datastore_types
from . import blobstore
from . import model
from . import tasklets
from . import test_utils
class BlobstoreTests(test_uti... |
from __future__ import absolute_import
from __future__ import unicode_literals
import os.path
import tarfile
import mock
import pytest
from pre_commit import make_archives
from pre_commit.util import cmd_output
from pre_commit.util import cwd
from testing.fixtures import git_dir
from testing.util import get_head_sha... |
# Django settings for dasBlog project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'blog.d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# Copyright 2017 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... |
# Copyright (c) 2013 OpenStack Foundation
# 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 ... |
"""
problem64.py
https://projecteuler.net/problem=64
The first ten continued fraction representations of (irrational) square roots are:
sqrt(2)=[1;(2)] period=1
sqrt(3)=[1;(1,2)] period=2
sqrt(5)=[2;(4)] period=1
sqrt(6)=[2;(2,4)] period=2
sqrt(7)=[2;(1,1,1,4)] ... |
# Detect all MetaToolKit depencies on Ubuntu and create a custom script to install them.
# Tested on Ubuntu 14.04, 16.04
# Author Brett G. Olivier (bgoli@users.sourceforge.net)
# (C) All rights reserved, Brett G. Olivier, Amsterdam 2016.
import os, subprocess, itertools, stat
UBUNTU = CONDA = False
try:
print(os.... |
# -*- coding: utf-8 -*-
"""
Clases utilizadas en la generación de un archivo Graphviz DOT con el
árbol de sintáxis abstracta creado a partir de un programa Tiger.
"""
class DotGenerator(object):
"""
Clase utilizada para la generación de grafos en formato Graphviz DOT.
"""
def __init__(self):
... |
# @INVIENT_COPYRIGHT@
# @MUNTJAC_LICENSE@
"""Window for Invient charts demo."""
from StringIO \
import StringIO
from random \
import random
from threading \
import Thread
from time \
import sleep
from muntjac.addon.invient.invient_charts_util \
import getDate
from datetime \
import dateti... |
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the MGTAXA package for the
# copyright and license terms.
#
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Some support for logging"""
import logging
def ... |
#!/usr/bin/python
import numpy as np
import re
import itertools
def animated_lights(input_string):
other_chars = re.compile("[^#\.]")
lights = []
for row in input_string.split("\n"):
if row == "":
continue
row = other_chars.sub("", row)
row = row.replace("#", "1")
... |
# docstrings not needed here (the type handler interfaces are fully
# documented in base.py)
# pylint: disable-msg=C0111
import struct
assert struct.calcsize('i') == 4 # assumption is made that sizeof(int) == 4 for all platforms pybindgen runs on
from base import ReturnValue, Parameter, PointerParameter, PointerRetu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# gff3 documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... |
from __future__ import unicode_literals
from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
from ...models import ElasticModel
class Command(BaseCommand):
help = 'Triggers indexing in Elasticsearch for all models in the project' \
' intended to be indexed.'
... |
#!/usr/bin/env python
# AtomPy - atomic calcalations in python
# Copyright (C) 2010 Davide Ceresoli <dceresoli@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 Software Foundation version 3 of the Licen... |
from django.dispatch import Signal
#: Sent whenever an Entity subclass has been "prepared" -- that is, after the processing necessary to make :mod:`.AttributeProxyField`\ s work has been completed. This will fire after :obj:`django.db.models.signals.class_prepared`.
#:
#: Arguments that are sent with this signal:
#: ... |
# Note: This file was taken mostly as is from the svg.path module (v 2.0)
#------------------------------------------------------------------------------
from __future__ import division, absolute_import, print_function
import unittest
from svgpathtools import *
class TestParser(unittest.TestCase):
def test_svg_e... |
import json
import os
import sys
import time
from collections import defaultdict
def sanity_check_fail(msg):
print(msg)
sys.exit(1)
class NonUniqException(Exception):
def __init__(self, message, iterable):
self.message = message
self.iterable = iterable
class Logger:
def __init__(self):
self.debug = Fal... |
from collections import defaultdict
from datetime import datetime
import json
import tensorflow as tf
import os, sys
import pandas as pd
#config dic
H = defaultdict(lambda: None)
#All possible config options:
H['optimizer'] = 'MomentumOptimizer'#'RMSPropOptimizer'
H['learning_rate'] = 0.001
H['momentum'] = 0.9 #0.9... |
__author__ = 'andriu'
import pygame, random, sys
from pygame.locals import *
COLLISION_VISIBLE = False
DEFAULT_FPS = 60
class GameObject(pygame.sprite.Sprite):
# Constructor.
def __init__(self, img_path, pos_xy=(0, 0)):
"""
Inicializa un objeto de juego, carga la imagen especificada
... |
# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## This is a samples controller
## - index is the default action of any application
## - user is required for authentication and authorizatio... |
"""Delete a kubeflow instance."""
import fire
import json
import logging
import retrying
from googleapiclient import discovery
from googleapiclient import errors
from oauth2client.client import GoogleCredentials
from kubeflow.testing import util
@retrying.retry(stop_max_delay=10*60*1000, wait_exponential_max=60*100... |
import os
import sys
sys.path.append('/n/denic_lab/Users/nweir/python_packages/')
import argparse
from pyto_segmenter import PexSegment, MitoSegment
import scipy.ndimage as ndimage
parser = argparse.ArgumentParser(description = 'Segment peroxisomes from \
images and return pickled obj... |
# This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
import dbus
from gosa.common.components.dbus_runner import DBusRunner
from logging import getLogger
... |
"""
Module.
"""
import io, os, sys, types
from IPython import nbformat
from IPython.core.interactiveshell import InteractiveShell
def find_notebook(fullname, path=None):
"""find a notebook, given its fully qualified name and an optional path
This turns "foo.bar" into "foo/bar.ipynb"
and tries turning "Foo... |
#!/usr/bin/python
from __future__ import division
from ttPoint import TINYNUM,Point,cross,matMul,angle,distance2,cart2uv
from ttPlane import pointDistPlane
from ttTriangle import Triangle
from ttSphere import Sphere
from ttBase import TTBase
from Draw.DrawRegion import DrawRegion
class Region(TTBase):
def __init... |
# This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2003-2013 Jan Decaluwe
#
# The myhdl 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 t... |
"""Generic pluggable modules
Copyright (C) 2012, Digium, Inc.
Kinsey Moore <kmoore@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
"""
import os
import sys
import logging
import shutil
import re
sys.path.append("lib/python")
from .ami import AMIEven... |
from Numberjack import *
def get_model(k, v, n):
design = Matrix(v, n)
pairs = Matrix(v * (v - 1) // 2, n)
index = [[0 for i in range(v)] for j in range(v)]
a = 0
for i in range(v - 1):
for j in range(i + 1, v):
index[i][j] = a
index[j][i] = a
a += 1
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Reporting class to gather information from the campaign
@author: Martin Dubé
@organization: Gosecure inc.
@license: MIT License
@contact: mdube@gosecure.ca
Copyright (c) 2018, Gosecure
All rights reserved.
Permission is hereby granted, free of charge, to any person... |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, \
unicode_literals
import os
import sys
import time
import socket
try:
import urllib.request as urllib
except ImportError:
import urllib
import hashlib
import argparse
import logging
from zeroconf import ServiceInfo, Ze... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from flask import request, current_app
from blinker import Namespace
from . import models, ext
from app.hia.config import HiaBlogSettings
hiablog_signals = Namespace()
post_visited = hiablog_signals.signal('post-visited')
post_published = hiablog_signals.signal('post-pu... |
#!/usr/bin/env python
# Copyright (c) 2016, Palo Alto Networks
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" A... |
from __future__ import print_function
import os
import re
import sys
import imp
import shutil
import unittest
import subprocess
import tempfile
from contextlib import contextmanager
from functools import wraps
from nose.tools import assert_true, assert_equal
from nose.plugins.attrib import attr
from nose.plugins.ski... |
"""Fig 2 figure
"""
import numpy as np
import matplotlib.pyplot as plt
#from scipy.stats import mstats
import pandas as pd
import geopandas as gpd
from scipy import stats
from shapely.geometry import Point
import matplotlib.pyplot as plt
from collections import defaultdict
from matplotlib.colors import Normalize
from ... |
from omf import feeder
import omf.solvers.gridlabd
feed = feeder.parse('GC-12.47-1.glm')
maxKey = feeder.getMaxKey(feed)
print(feed[1])
feed[maxKey + 1] = {
'object': 'node', 'name': 'test_solar_node', 'phases': 'ABCN',
'nominal_voltage': '7200'
}
feed[maxKey + 2] = {
'object': 'underground_line', 'name': 'test_s... |
# Copyright 2018 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 required by applicable law or a... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
long_desc = '''
This package contains the cindex Sphinx extension.
Allows declaring cindex specs wherever in the documentation (for instance,
in docstrings of UnitTest.test_* methods) and displaying them as a single
list.
'''
... |
#!/usr/bin/env python3
import click
import http.cookiejar
import json
import logging
import requests
import requests_cache
import sqlite3
from click_default_group import DefaultGroup
from functools import reduce
import sites
import ebook
__version__ = 2
USER_AGENT = 'Leech/%s +http://davidlynch.org' % __version__
l... |
from Vision.vision_commands import addVisionDevices
from functools import partial
import paho.mqtt.client as mqtt
import config as config
import json
import ev3control.slave as slave
import time
def get_behaviours_and_params(behaviour_json, params_json):
#Get {behaviour name: behavior function name} dictionary
... |
from flask_login import UserMixin
from app.extensions import cache ,bcrypt
import bcrypt as bcr
from .. import db
from ..mixins import CRUDMixin
import datetime
from rauth import OAuth1Service, OAuth2Service
from flask import current_app, url_for, request, redirect, session
class Oauth(CRUDMixin, UserMixin, db.Model)... |
__author__ = 'hayden'
import numpy as np
from matplotlib import pyplot as plt
import cv2
# Make sure that caffe is on the python path:
caffe_root = '/home/hayden/caffe-recurrent/' # this file is expected to be in {caffe_root}/examples
import sys
sys.path.insert(0, caffe_root + 'python')
import caffe
#plt.plot([1,2... |
# Copyright (c) 2010-2015 openpyxl
# Python stdlib imports
from io import BytesIO
# compatibility imports
from openpyxl import Workbook
from openpyxl.formatting import ConditionalFormatting
from openpyxl.formatting.rules import ColorScaleRule, CellIsRule, FormulaRule
# package imports
from openpyxl.reader.excel impo... |
"""Test class for ``katello-change-hostname``
:Requirement: katello-change-hostname
:CaseAutomation: Automated
:CaseLevel: System
:CaseComponent: satellite-change-hostname
:Assignee: pondrejk
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
from fauxfactory import gen_string
from nai... |
"""
This file is part of Agiliza.
Agiliza 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.
Agiliza is distributed in the hope that it will b... |
import json
from itertools import groupby
import xmltodict
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Generates zefania xml from different formats'
def handle(self, *args, **options):
with open('NTR.json') as f:
data = json.load(f)
cu... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Didotech Srl - OpenERP 7 migration by Matmoz d.o.o.
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General ... |
# GojiDNS - Developed by South Patron CC - http://www.southpatron.com/
#
# This file is part of GojiDNS.
#
# GojiDNS 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 yo... |
#!/usr/bin/env python3
from lib.rr_graph import graph2
from lib.rr_graph import tracks
from lib.rr_graph import points
import lib.rr_graph_xml.graph2 as xml_graph2
# bi-directional channels
def create_tracks(graph, grid_width, grid_height, rcw, verbose=False):
print("Creating tracks, channel width: %d" % rcw)
... |
# coding: utf-8
# script to assign hostname and ip address to machine
# In[63]:
import os
import random
import json
import shutil
# In[37]:
colordir = os.listdir('/home/wcmckee/colortest/')
# In[42]:
alcolrz = []
# In[43]:
for cold in colordir:
#print cold
if '.json' in cold:
print cold
... |
"""
AvcCacheThreshold - File ``/sys/fs/selinux/avc/cache_threshold``
================================================================
This parser reads the content of ``/sys/fs/selinux/avc/cache_threshold``.
"""
from .. import parser, CommandParser
from ..parsers import ParseException
from insights.specs import Spec... |
#!/usr/bin/env python
# Author:
# Rudiger Birkner (Networked Systems Group ETH Zurich)
class FlowModMsgBuilder(object):
def __init__(self, participant, key):
self.participant = participant
self.key = key
self.flow_mods = []
def add_flow_mod(self, mod_type, rule_type, priority, match... |
#!/usr/bin/env python
####################################################################
# Python 2.7 script for executing FA, MD calculations for one case #
####################################################################
# Directory where result data are located
experiment_dir = '/Users/eija/Documents/FinnBra... |
"""OO layer for several polynomial representations. """
from sympy.core.compatibility import cmp
class GenericPoly(object):
"""Base class for low-level polynomial representations. """
def ground_to_ring(f):
"""Make the ground domain a ring. """
return f.set_domain(f.dom.get_ring())
def g... |
d = {'key1': 1, 'key2': 2, 'key3': 3}
for k in d:
print(k)
# key1
# key2
# key3
for k in d.keys():
print(k)
# key1
# key2
# key3
keys = d.keys()
print(keys)
print(type(keys))
# dict_keys(['key1', 'key2', 'key3'])
# <class 'dict_keys'>
k_list = list(d.keys())
print(k_list)
print(type(k_list))
# ['key1', 'key... |
import numpy
from numpy import log
try:
from scipy.misc import logsumexp
except ImportError:
from numpy import logaddexp
logsumexp = logaddexp.reduce
def slice_dictionary(d, N, slice_index=0, slice_value=0):
"""
Take a three dimensional slice from a four dimensional
dictionary.
"""
s... |
# 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 ... |
# pylint: disable=E1101
from warnings import catch_warnings
from datetime import datetime, timedelta
from functools import partial
from textwrap import dedent
import pytz
import pytest
import dateutil
import numpy as np
import pandas as pd
import pandas.tseries.offsets as offsets
import pandas.util.testing as tm
fro... |
# ui.py - user interface bits for mercurial
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import errno
import getpass
import inspect
... |
import numpy as np
import matplotlib.pyplot as plt
from astropy.constants import c
from scipy.interpolate import splrep
from scipy.interpolate import splev
from scipy.interpolate import bisplrep
from scipy.interpolate import bisplev
from scipy.interpolate import RectBivariateSpline
from scipy.interpolate import Interpo... |
# Copyright 2015 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 mock
from dashboard import task_runner
from dashboard import testing_common
class TaskRunnerTest(testing_common.TestCase):
def setUp(self):
... |
from django.db import models
from django.contrib import admin
from django.db.models import signals
class Volunteer(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
email = models.EmailField(max_length=254, unique=True)
is_group = models.BooleanFie... |
# Lint as: python3
# Copyright 2016 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 required by a... |
"""
ePSproc vol module setOptions
Functions to read & write default set of plotting options to file.
If run as main:
- Check existing file from passed arg, or in default location (epsproc/vol/plotOptions.json)
- Read file if exists.
- If file is missing, prompt to write defaults to file.
08/08/20 v1, dev. See ... |
# -*- coding: utf-8 -*-
from django.db.utils import DatabaseError
from south.db import db
from south.v2 import DataMigration
class Migration(DataMigration):
def forwards(self, orm):
"""
Copy student data from old table to the new one.
Problem Builder stores student answers in 'problem_bu... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-22 05:10
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... |
'''
Created on Jul 22, 2014
@author: moloyc
'''
import os
import sys
sys.path.insert(0,os.path.abspath(os.path.dirname(__file__) + '/' + '../..')) #trick to make it run from CLI
import unittest
import shutil
from flexmock import flexmock
from jnpr.openclos.l3Clos import L3ClosMediation
from jnpr.openclos.model import... |
import pickle, os, logging,string
import pg
import locale
import time
from datetime import date
import logging
import settingReader
class DBInterface(object):
def __init__(self,Options):
self.Options=Options
self.InitDBConnection(self.Options)
self.IsOpen=Fal... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# mac 同时上内外网的路由设置,将以下代码保存为py文件,使用sudo跑py文件
import os
import re
def route():
# 获取路由表的网关IP地址
data = os.popen("netstat -rn|awk '{print $2}'").readlines()
# 外网网关IP的正则表达式
re_ip1 = re.compile(r'172.16.\d{1,3}.\d{1,3}')
# 内网网关IP的正则表达式
re_ip2 = re.com... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This is nefi's main view. Currently we deployed all controls of the
GUI in the MainView.ui. Static changes to the GUI should always been
done by the Qt designer since this reduces the amount of code dramatically.
To draw the complete UI the controllers are invoked and ... |
import unittest
import Milter
import sample
import template
import mime
import zipfile
from Milter.test import TestBase
from Milter.testctx import TestCtx
class TestMilter(TestBase,sample.sampleMilter):
def __init__(self):
TestBase.__init__(self)
sample.sampleMilter.__init__(self)
class BMSMilterTestCase(un... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# Copyright (C) 2006 Matthew Good <matt@matt-good.net>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac... |
'''Individual character handwriting data loading and preprocessing.
Based on https://archive.ics.uci.edu/ml/datasets/UJI+Pen+Characters+(Version+2)
'''
import re
import click
import itertools as it
import random
import json
import numpy as np
import h5py
import matplotlib.pyplot as plt
def parse_uji(lines):
'''... |
from collections import OrderedDict
from datetime import date, datetime, timedelta
import random
import re
import numpy as np
import pytest
from pandas.core.dtypes.common import is_categorical_dtype, is_object_dtype
from pandas.core.dtypes.dtypes import CategoricalDtype
import pandas as pd
from pandas import (
C... |
# -*- coding: utf-8 -*-
"""
Copyright 2012-2014 Olivier Cortès <oc@1flow.io>
This file is part of the 1flow project.
1flow is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either versio... |
# -*- coding: utf-8 -*-
from hashlib import sha1
from bencode import bdecode, BTFailure
from django.contrib import admin
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
from sorl.thumbnail.admin import AdminImageMixin
from markitup.widgets import AdminMarkItUpWidget
fr... |
import re
#################################################################################
# REGULAR EXPRESSIONS ARE COOL. Check out Kodos (http://kodos.sourceforge.net) #
#################################################################################
# DATE_FORMAT_REGEX = re.compile(r"""(?P<month>[A-z]{3,3})\s*(... |
# Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
from sfsimodels import models
import sfsimodels as sm
import json
import numpy as np
def test_link_building_and_soil():
number_of_storeys = 6
interstorey_height = 3.4 # m
n_bays = 3
fb = models.FrameBuilding(number_of_storeys, n_bays)
fb.id = 1
fb.interstorey_heights = interstorey_height * n... |
#! /usr/bin/env python
import sys
from classes.sitemanager import SiteManager
from classes.gui.main import MainWindow
from classes.printer import Printer
from PyQt4 import QtGui
import argparse
__author__ = 'snake'
def main():
if len(sys.argv) == 1:
app = QtGui.QApplication(sys.argv)
main = Main... |
# 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 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... |
# Created By: Virgil Dupras
# Created On: 2011-07-09
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPL v3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/lic... |
import os.path
import shutil
import sublime
import sublime_plugin
import subprocess
SETTINGS_FILE = "BeautifyRust.sublime-settings"
def which(program):
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
if fpath:
if is_exe(p... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import plot, show, xticks, xlabel, ylabel, legend, yscale, title, savefig, rcParams, figure, hist, text, bar, subplots
import Image
def file_process(filename):
fig = plt.gcf()
fig.set_size_inches(18.5,10.5)
fig.savefig("/home/rob/%s.... |
"""Stops a virtual machine."""
from baseCmd import *
from baseResponse import *
class stopVirtualMachineCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""The ID of the virtual machine"""
"""Required"""
self.id = None
self.typeInfo['id'] = 'uuid'... |
"""
p-corr.py - Code for "Correlated Parameters"
"""
# Copyright (c) 2017-20 G. Peter Lepage.
#
# 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 of the License, or
# any later ve... |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic list exercises
# Fill in the code for the functions below. main() is already set ... |
from pendulum.tz.zoneinfo.posix_timezone import JPosixTransition
from pendulum.tz.zoneinfo.posix_timezone import MPosixTransition
from pendulum.tz.zoneinfo.posix_timezone import posix_spec
def test_posix_spec_m():
spec = "CET-1CEST,M3.5.0,M10.5.0/3"
tz = posix_spec(spec)
assert tz.std_abbr == "CET"
a... |
import gzip
import re
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy import Column, Integer, String, DateTime, Text, func, desc
from config import config
db_spec = config.get('DATABASE', 'DB_SPEC')
en... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import importlib
import logging
import os
import sys
import unittest
user_requested_tags = []
Defaults = {
"test_dirs": ['tests'],
"config": 'te... |
#!/usr/bin/env python
import fileinput
import sys, os
def usage():
print '''
This script is compatible with MToolBox versions < 1.2 only
This script filters the MToolBox vcf file based on Heteroplasmy threshold
Usage:
filter_HF.py <sample_name> <vcf_file> <HF_threshold[float]> <DP_threshold[float]> <out_type[vc... |
import json
import logging
from pajbot.models.db import DBManager, Base
from pajbot.models.action import ActionParser
from pajbot.tbutil import find
from sqlalchemy import orm
from sqlalchemy import Column, Integer, String, Boolean
from sqlalchemy.dialects.mysql import TEXT
log = logging.getLogger('pajbot')
class ... |
# -*- coding: utf-8 -*-
"""
Tests for the fixture
"""
from __future__ import absolute_import, print_function, unicode_literals, division
from sqlalchemy_fixture_factory import sqla_fix_fact
from sqlalchemy_fixture_factory.sqla_fix_fact import BaseFix
from tests import TestCase
class TestFixFact(TestCase):
def... |
import registerClass
import onionGpio
import time
class sevenSegment:
#Initializes the GPIO objects based on the pin numbers
def __init__(self, digitOne, digitTwo, digitThree, digitFour):
self.shiftReg = registerClass.shiftRegister(1,2,3)
self.digitOne = onionGpio.OnionGpio(digitOne)
self.digitTwo = onio... |
# MIT License
#
# Copyright (c) 2017, Stefan Webb. All Rights Reserved.
#
# 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 us... |
import tempfile
from contextlib import contextmanager
from invoke import UnexpectedExit
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
HOME_DIR = os.path.expanduser('~')
def run_ignoring_failure(method, command):
try:
method(command)
except UnexpectedExit:
... |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the ZMQ API."""
from test_framework.test_framework import TrollcoinTestFramework
from test_framew... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.