content
string
from vanilla import * from AppKit import NSColor from defconAppKit.windows.baseWindow import BaseWindowController from glyphLayerPreview import GlyphLayerPreview from mojo.events import addObserver, removeObserver from mojo.roboFont import * class LayerWindow(BaseWindowController): def __init__(self): ...
"""Installers for programming language specific libraries. """ import os from fabric.api import env, cd, settings from cloudbio import fabutils from cloudbio.custom import shared def r_library_installer(config): """Install R libraries using CRAN and Bioconductor. """ with shared._make_tmp_dir() as tmp_dir...
'''Test cases for the zim.fs module.''' from __future__ import with_statement import tests import os import time import zim.fs from zim.fs import * from zim.errors import Error def modify_file_mtime(path, func): '''Helper function to modify a file in such a way that mtime changed. ''' mtime = os.stat(path).st...
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...
import os, time, struct, getopt, sys, bgp, isis, mrtd, pprint from mutils import * ################################################################################ if __name__ == "__main__": VERBOSE = 1 #--------------------------------------------------------------------------- def usage(): p...
from mastodon import Mastodon import os import json import threading HOME = os.environ.get('HOME') CONFIG_DIR = HOME + '/.config' CONFIG_FILE = CONFIG_DIR + '/org.gabmus.mastodon-gtk.config.json' CLIENT_CREDENTIALS_FILE = CONFIG_DIR + '/org.gabmus.mastodon-gtk.client-credentials' USER_CREDENTIALS_FILE = CONFIG_DIR + '...
#!/usr/bin/env python # coding:utf8 import json ##### from django.contrib.auth.decorators import login_required from django.shortcuts import render, HttpResponse, HttpResponseRedirect from openstack import get_openstack_info from openstack.page import cloud, ceph, nova, neutron, cinder from one_finger.cloud_logging im...
"""Tests for NginxAccessLogTailer and supporting bits. TODO(swfrench): Add test for SimpleTailer. """ import unittest import mock from nginx_access_tailer import NginxAccessLogTailer class SleepExit(Exception): """Exception used to exit the wait loop via side-effect.""" pass class TestNginxAccessLogTail...
from com.puffinware.pistat.models import Category,Thermostat,Alert from com.puffinware.pistat.helpers import NavHelper from flask import render_template, request, redirect, url_for from logging import getLogger log = getLogger(__name__) def setup_routes(app, **kwargs): @app.route('/config/thermostat', methods=['PO...
from __future__ import unicode_literals import frappe import os import time import redis from frappe.utils import get_site_path from frappe import conf END_LINE = '<!-- frappe: end-file -->' TASK_LOG_MAX_AGE = 86400 # 1 day in seconds redis_server = None @frappe.whitelist() def get_pending_tasks_for_doc(doctype, d...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Agency', fields=[ ('id', models.AutoField(verbo...
from collections import deque from day13_input import puzzle_input def is_wall(pos): x, y = pos if x < 0 or y < 0: return True bin_num = str(bin(x * x + 3 * x + 2 * x * y + y + y * y + puzzle_input))[2:] return bin_num.count('1') % 2 == 1 def find_path(start, goal, max_cost=-1): front ...
# -*- coding: utf-8 -*- """Tests for LinkedIn Add to Profile configuration. """ from __future__ import absolute_import import ddt from django.conf import settings from django.test import TestCase from opaque_keys.edx.locator import CourseLocator from six.moves.urllib.parse import quote, urlencode from openedx.core.d...
# import required modules and extensions import arcpy import os import re arcpy.CheckOutExtension('Spatial') pf_path = r"C:\etal\Shared\Projects\USA\California\SierraNevada\BRAT\wrk_Data" ownership_path = r"C:\etal\Shared\Projects\USA\California\SierraNevada\BRAT\wrk_Data\00_Projectwide\LandOwnership\BLM_National_Sur...
# -*- coding: utf8 -*- import os import time import sys import json # check configuration token_id = os.environ.get('PYOTSDB_OPENSTDB_USERNAME') if not token_id: exit("Please : export PYOTSDB_OPENSTDB_USERNAME='XXXXXXXXX'") token_key = os.environ.get('PYOTSDB_OPENSTDB_PASSWORD') if not token_key: exit("Plea...
"""Tests for python.compiler.mlir.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.compiler.mlir import mlir from tensorflow.python.eager import def_function from tensorflow.python.framework import dtypes from tensorflow.python.fra...
from flask import Flask, render_template, json, request, redirect app = Flask(__name__) @app.route('/') def main(): return render_template('index.html') @app.route('/getQuestion', methods=['GET']) def showQuestion(): # getQuestion?no_of_questions=25&username=sidath&type=MCQ&module_id=1 # validate the rec...
from collections import OrderedDict def into_ordered_dict(blocklist): """ Puts the blocklist into an ordered dict """ into_dict = OrderedDict() for block in blocklist: x, y, color = block if y not in into_dict: into_dict[y] = OrderedDict() into_dict[y][x] = color o...
""" Reverse proxy requests to the server under test with injected JavaScript. Used to inject JavaScript to instrument XHR requests so they can be tracked and counted. """ from __future__ import absolute_import, unicode_literals, print_function import re from flask import Flask, request, Response, make_response import...
# Test for one implementation of the interface from lexicon.providers.cloudns import Provider from lexicon.common.options_handler import env_auth_options from integration_tests import IntegrationTests from unittest import TestCase import pytest # Hook into testing framework by inheriting unittest.TestCase and reuse #...
import numpy as np import pytest import pandas as pd from pandas import ( DatetimeIndex, Index, ) import pandas._testing as tm dtlike_dtypes = [ np.dtype("timedelta64[ns]"), np.dtype("datetime64[ns]"), pd.DatetimeTZDtype("ns", "Asia/Tokyo"), pd.PeriodDtype("ns"), ] @pytest.mark.parametrize("...
import matplotlib.pyplot as pp import roslib; roslib.load_manifest('hrl_fabric_based_tactile_sensor') import hrl_lib.util as ut import hrl_lib.matplotlib_util as mpu import numpy as np def force_vs_adc_hysteresis(d): ft_l = d['ft'][10:] adc_l = (d['adc_bias'] - np.array(d['adc'][10:])).tolist() #adc_l = d...
import json import os import sys import unittest from cStringIO import StringIO from validator.validate import validate FIREFOX_GUID = '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}' MOBILE_GUID = '{a23983c0-fd0e-11dc-95ff-0800200c9a66}' THUNDERBIRD_GUID = '{3550f703-e582-4d05-9a08-453d09bdfdc6}' def _validator(file_path...
from mr1 import * # ------------------------------------------------------------------------------ if __name__=="xxx__main__": import multiprocessing as mp pool = mp.Pool(2) def get_part_path(part): return 'data/{}'.format(part) out = map_sql(""" select x, count(1) as count from test group by x """...
# log.info("Retrieving bugIDs") # bugzilla.init_first_url(self.dispatcher.url_queue, # self.url_storage_list, # self.dispatcher.conf) # # log.info("Scraping remote") # self.dispatcher.scrape_target("cache", 1) # # lo...
import logging import stripe from logging.handlers import RotatingFileHandler from flask import Flask, render_template, redirect, request, send_from_directory from config import testkey, prodkey, testsecretkey, prodsecretkey KEY = prodkey SECRET = prodsecretkey QUANTITIES = [1, 2, 3, 4, 5] app = Flask(__name__) handl...
from django.conf.urls import include, url from django.views.generic import TemplateView from django.contrib import admin from django.conf import settings handler500 = 'utils.views.server_error' urlpatterns = [] # Debug/Development URLs if settings.DEBUG is True: urlpatterns += [ url(r'^admin/doc/', inclu...
from __future__ import print_function from distutils.core import setup from distutils.command.build import build from platform import system from os.path import expanduser class calibrateRunner(build): def run(self): """Calibrating pyZipHMM for multi-threaded applications""" from pyZipHMM.pyZipHMM...
from time import gmtime, strftime from fabric.decorators import task from fabric.api import settings, cd, hide, run, env from base import Component, s3_upload, s3_file_exists, s3_latest_file_in_bucket class PostgresComponent(Component): def __init__(self, site_name, raw_data): super(type(self), self).__in...
#!/usr/bin/env python """ Setup script for Doorstop. """ import setuptools from doorstop import __project__, __version__, CLI, GUI, SERVER, DESCRIPTION import os if os.path.exists('README.rst'): README = open('README.rst').read() else: README = "" # a placeholder, readme is generated on release CHANGES = o...
import os import tempfile from io import StringIO from unittest.mock import patch from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase from wagtail.contrib.redirects.models import Redirect from wagtail.core.models import Site TEST_ROOT...
# encoding: utf-8 # module PyQt4.QtScriptTools # from /usr/lib/python2.7/dist-packages/PyQt4/QtScriptTools.so # by generator 1.135 # no doc # imports import PyQt4.QtCore as __PyQt4_QtCore # no functions # classes class QScriptEngineDebugger(__PyQt4_QtCore.QObject): """ QScriptEngineDebugger(QObject parent=None)...
{ 'name': 'Marketplace for project', 'version': '1.0', 'category': 'Community', 'author': 'Yannick Buron and Valeureux', 'license': 'AGPL-3', 'description': """ Marketplace for Project ======================= Link project to the marketplace ------------------------------- * Publish your tas...
# coding: utf-8 # # Code to extract out the chi2 values for many different SNR values combinations. # Like excel sheet # # In[1]: import os import matplotlib.pyplot as plt get_ipython().run_line_magic('matplotlib', 'inline') import numpy as np home = "/home/jneal/Phd/Analysis/fake_sims_with_var_teff1" import panda...
#encoding: utf-8 from responsemodule import IModule import bitly_api ''' Example config: [url_short] service=bitly user=username api_key=R_12345678901234567890123456789012 ''' settings_name_g = u'url_short' api_key_g = u'api_key' user_g = u'user' service_g = u'service' class Shortener(IModule): ...
# ---------------------------------------------------------------------- * # * A Monte Carlo simulation to estimate the probability that the * # * determinant of a 3 by 3 matrix of random numbers is positive. * # * * # * Name ...
"""Tools for setting up a package using config files. The benefit of subclassing `PackageConfig` over using something like `configparser` is that you can easily store default `h5config` values in the configuration file. Consider the following example: TODO > class _MyConfig """ import logging as _logging import os....
# $Id: cdp.py,v 1.1.1.1 2005/10/29 18:20:48 provos Exp $ import struct from dpkt import Packet, in_cksum as _cdp_cksum CDP_DEVID = 1 CDP_ADDRESS = 2 CDP_PORTID = 3 CDP_CAPABILITIES = 4 CDP_VERSION = 5 CDP_PLATFORM = 6 CDP_IPPREFIX = 7 class CDP(Packet): """Cisco Discovery Protocol....
import requests import json from pprint import pprint def main(): seriesidlist = ['21845','5495'] episodes = [] for identity in seriesidlist: urlPath = 'http://api.tvmaze.com/shows/{value}/episodes'.format(value=identity) response = read_seriesEpisodes(urlPath) episodes.append(res...
"""URLs for API access management.""" from __future__ import absolute_import from django.conf.urls import include, url from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required from openedx.core.djangoapps.api_admin.decorators import api_access_...
"""Tests for distutils.ccompiler.""" import os import unittest from test.test_support import captured_stdout from distutils.ccompiler import (gen_lib_options, CCompiler, get_default_compiler) from distutils.sysconfig import customize_compiler from distutils import debug from d...
#!/usr/bin/env python from ctypes import * from ctypes.util import find_library import sys import os ex_svm_lib = os.path.split(__file__)[0] + '/liblinear' # For unix the prefix 'lib' is not considered. if find_library('linear'): liblinear = CDLL(find_library('linear')) elif find_library('liblinear'): liblinear = ...
import numpy as n import scipy.stats import inspect import copy import sys from dashi.odict import OrderedDict from logging import getLogger class model(object): """ This class represents a model that can be fitted to data. It is a wrapper around a callable object that gives names to the paramet...
#!!!! YOU MUST LAUNCH HEASOFT PRIOR TO EXECUTING THIS SCRIPT!!!! # ('heainit' is the default method of launching) #import some python packages import os import uvotgrism import pyfits ra, dec = 210.7738750, +54.2736389 #SET VARIABLES REQUIRED FOR UVOTPY (TARGET LOCATION ON SKY) os.chdir('00032094004/uvot/image') #...
import os import json import sys import pytest from nipype.interfaces.bids_utils import BIDSDataGrabber from nipype.utils.filemanip import dist_is_editable have_pybids = True try: import bids from bids import grabbids as gb filepath = os.path.realpath(os.path.dirname(bids.__file__)) datadir = os.path....
# -*- coding: UTF-8 -*- from urllib import unquote_plus, urlencode import base64 import pdb import logging from django.test import TestCase from django.test.client import Client from django.utils.datastructures import SortedDict from webtopay.forms import WebToPayResponseForm from webtopay.signals import payment_was...
from flask import Blueprint from app import app from services.RolesService import RolesService from flask import jsonify from flask import flash, request from flask_jwt_extended import ( jwt_required, fresh_jwt_required, JWTManager, jwt_refresh_token_required, jwt_optional, create_access_token, create_refresh_t...
""" Exceptions raised by :mod:`django_wsgi.` """ __all__ = ("DjangoWSGIException", "ApplicationCallError") class DjangoWSGIException(Exception): """Base class for exceptions raised by :mod:`django_wsgi`.""" pass class ApplicationCallError(DjangoWSGIException): """ Exception raised when an embedded...
from recipelinks import RecipeLinks from recipepage import RecipePage import random import time class Scraper: def __init__(self, recipe_path, review_path, log_path): self.recipe_path = recipe_path self.review_path = review_path self.log_path = log_path def writeIteration(self, recipes...
#-*- coding: utf-8 -*- from django.conf.urls.defaults import patterns, include, url from django.conf import settings from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap from django.contrib import admin from django.core.urlresolvers import reverse_lazy from django.views.generic import RedirectView from ...
from test_framework.test_framework import DankcoinTestFramework from test_framework.util import * class MempoolLimitTest(DankcoinTestFramework): def setup_network(self): self.nodes = [] self.nodes.append(start_node(0, self.options.tmpdir, ["-maxmempool=5", "-spendzeroconfchange=0", "-debug"])) ...
from __future__ import absolute_import from enum import Enum from itertools import imap, repeat from operator import eq, or_ import numpy as np def fold(f, iterable): out = None for pos, val in enumerate(iterable): if pos == 0: out = val else: out = f(out, val) r...
from test_framework.test_framework import PresidentielcoinTestFramework from test_framework.util import * import threading class LongpollThread(threading.Thread): def __init__(self, node): threading.Thread.__init__(self) # query current longpollid templat = node.getblocktemplate() ...
''' A view functions is simply a Python function that takes a Web request and returns a Web response. This response can be the HTML contents of a Web page, or a redirect, or the 404 and 500 error, or an XML document, or an image... or anything.''' import os import traceback import logging from django.core.urlresol...
#!/usr/bin/python import argparse import requests,json from requests.auth import HTTPBasicAuth from subprocess import call from faas_mininet_config import * import time import sys import os DEFAULT_PORT='8181' USERNAME='admin' PASSWORD='admin' OPER_OVSDB_TOPO='/restconf/operational/network-topology:network-topology/...
""" Copyright (C) <2010> Autin L. This file ePMV_git/__init__.py is part of ePMV. ePMV 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 op...
""" Base class for webdriver test suites. Pre-instantiates a webdriver instance and stashes it in the config object. """ from .selenium import webdriver from .selenium.webdriver.support.ui import WebDriverWait from .selenium.webdriver.support import expected_conditions from pycopia.QA import core CAPS = { "fire...
# coding=utf-8 """Модуль, описывающий класс корневого объекта леса. Корневой объект - синглтон, поверх которого инициализируются все дополнительные модули леса. Название 'Trunk' он получил из-за того, что по логике работы именно к нему крепятся корни ('Roots'), ветки ('Branch') и воздух ('Air', это уже не так логично,...
""" script to create the HDF5 database from the raw data of XOP. this file is only needed for administration and also used during the build It accepts two command line arguments. The first one is the filename of the database (required). The second optional argument is the directory of the source data file used to gen...
import dateutil.parser import threading import time import json from gpsd.gps import gps, WATCH_ENABLE class GpsPoller(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.session = gps(mode=WATCH_ENABLE) self.current_value = None self.clock_offset = None ...
import subprocess import os import time; from datetime import datetime global_user = "mendozagabe" global_input_dir = "input_title_url" global_append = "_TEST" def getLocalTime_Formatted(): d = datetime.now() formatted = d.strftime('%Y%m%d@%H-%M') return formatted # user = "mendozagabe" def execute(comm...
#!/usr/bin/env python ''' now that I have already been tormenting for a month to produce a plethora of task data for the long dragging project, the DTI seeding resolution/fiber density study, they were built in three dimension (partial brain to load, fiber bundle focus, task-specific parameters like box positions, fibe...
import logging from pyjamas.ui.FlowPanel import FlowPanel from pyjamas.ui.ScrollPanel import ScrollPanel from pyjamas.ui.ToggleButton import ToggleButton console = logging.getLogger() class HorizontalCollapsePanel(FlowPanel): def __init__(self, *args, **kwargs): # set defaults if not 'StyleName' i...
from django.db import models from clave.models import Product from decimal import Decimal from django.core.validators import MinValueValidator, \ MaxValueValidator from coupons.models import Coupon from django.utils.translation import gettext_lazy as _ class Order(models.Model): first_name = models.CharField(...
import os.path import re import tornado.web import tornado.websocket import logging import json from .. import version, filt class APIError(tornado.web.HTTPError): pass class RequestHandler(tornado.web.RequestHandler): def set_default_headers(self): super(RequestHandler, self).set_default_headers() ...
################################################################# # Program: toolib """ Bean utils """ __author__ = "Oleg Noga" __date__ = "$Date: 2004/12/30 15:28:05 $" __version__ = "$Revision: 1.1 $" # $Source: D:/HOME/cvs/toolib/util/beans.py,v $ # # ##############################################...
from __future__ import division, absolute_import, print_function import os import sys import subprocess import shutil from setuptools import setup def _read(fn): path = os.path.join(os.path.dirname(__file__), fn) return open(path).read() def build_manpages(): # Go into the docs directory and build the ...
import unittest from itertools import chain from nineml.utils.comprehensive_example import (doc1, dynPropA) from nineml.exceptions import ( NineMLXMLAttributeError, NineMLXMLBlockError, NineMLUsageError) from nineml.user import Projection, Population, Definition, DynamicsProperties from nineml.reference import Refe...
"""Support for MQTT binary sensors.""" import logging import voluptuous as vol from homeassistant.components import binary_sensor, mqtt from homeassistant.components.binary_sensor import ( DEVICE_CLASSES_SCHEMA, BinarySensorDevice, ) from homeassistant.const import ( CONF_DEVICE, CONF_DEVICE_CLASS, ...
from openerp.osv import orm, fields class res_partner_category(orm.Model): _inherit = 'res.partner.category' _order = "name"
import os import unittest import numpy as np import fwdpy11 def setup_pdict(demog, simlen): nregions = [] sregions = [] recregions = [] pdict = { "nregions": nregions, "sregions": sregions, "recregions": recregions, "rates": (0, 0, None), "gvalue": fwdpy11.Mu...
from __future__ import unicode_literals from wtforms.fields import BooleanField, SelectField, TextAreaField from wtforms.fields.html5 import URLField from wtforms.fields.simple import StringField from wtforms.validators import DataRequired, Optional, ValidationError from indico.core.config import config from indico.m...
# -*- coding: utf-8 -*- from django.db import transaction, Error from osb.billing.models import Accounts, Services from osb.billing.Services.AccountsService import AccountsService import datetime import json import logging logger = logging.getLogger('osb') class ServiceService(object): """ ServiceServic...
""" Entry handler will query,get,add and delete entrys, that is documents of the entry collection """ import tornado from bson.objectid import ObjectId from bson.json_util import dumps, loads class EntryHandler(tornado.web.RequestHandler): def initialize(self, db): """ Initializes the instance with...
from nose.tools import * from lapurge.types import * from datetime import datetime, date from nose.tools import with_setup from tempfile import mkstemp, mkdtemp import shutil import os # To support python 2.7 and 3.x try: from StringIO import StringIO except: from io import StringIO tempdir = None saved_stder...
import pytest from unittest import mock from mitmproxy.test import tflow from mitmproxy import io from mitmproxy import exceptions from mitmproxy.addons import clientplayback from mitmproxy.test import taddons def tdump(path, flows): w = io.FlowWriter(open(path, "wb")) for i in flows: w.add(i) cla...
import fcntl import string import sys HOST_FORMAT = 'Host format is [user:[password]@]host[:port] [user]' def read_host_files(paths, default_user=None, default_port=None, default_password=None): """Reads the given host files. Returns a list of (host, port, user) quadruples. """ hosts = [] if pat...
"""Production settings and globals.""" from os import environ from base import * # Normally you should not import ANYTHING from Django directly # into your settings, but ImproperlyConfigured is an exception. from django.core.exceptions import ImproperlyConfigured def get_env_setting(setting): """ Get the envi...
from hypothesis import given, strategies from senf import fsnative, text2fsn, fsn2text, bytes2fsn, fsn2bytes, print_ from senf._compat import text_type, StringIO @given(strategies.lists(strategies.text()), strategies.text(), strategies.text(), strategies.booleans()) def test_print(objects, sep, end, flush): ...
from urllib import urlencode import fnmatch import re class SearchHelper(object): @staticmethod def appendQuery(url, qargs={}): '''Appends url params to url''' matrix_params = '' query_params = '' if (qargs and len(qargs) > 0): for k, v in qargs.items(): ...
# encoding: utf-8 """ Some functions that cannot be in pdf.py file to prevent import loop. """ from io import BytesIO import logging from django.core.files import File from membership.billing import pdf logger = logging.getLogger("membership.billing.pdf") def create_reminder_pdf(cycles, output_file, payments=Non...
""" Plug-in to display menus and players on a LCD display To activate, put the following line in local_conf.py:: plugin.activate('lcd2') """ import logging logger = logging.getLogger("freevo.plugins.lcd2") import config import plugin from event import * from menu import MenuItem from time import strftime try: ...
import pydevd_constants if pydevd_constants.USE_LIB_COPY: import _pydev_socket as socket else: import socket _cache = None def get_localhost(): ''' Should return 127.0.0.1 in ipv4 and ::1 in ipv6 localhost is not used because on windows vista/windows 7, there can be issues where the resolving ...
import unittest import importlib.util import tested.parsers.module_finder as mf class TestModuleFinder(unittest.TestCase): def setUp(self): self.files = [ '/', '/home/', '/home/test/', '/home/test/Project/', '/home/test/Project/setup.py', ...
""" Copyright (c) 2010, John Burwell 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 copyright notice, this list of conditions and the ...
from tests.unit.dataactcore.factories.staging import AppropriationFactory from tests.unit.dataactvalidator.utils import number_of_errors, query_columns _FILE = 'a3_appropriations' def test_column_headers(database): expected_subset = {"row_number", "other_budgetary_resources_cpe", "contract_authority_amount_cpe", ...
__version__ = '2.5.3' import logging import os import sys from datetime import datetime, time from functools import wraps from urlparse import urlparse, urljoin import flask from fedora.client import AuthError, AppError from fedora.client.fas2 import AccountSystem from flask.ext.fas_openid import FAS import dogpil...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'TitleWidget.ui' # # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda ...
# encoding: utf-8 # module _lzma # from /usr/lib/python3.4/lib-dynload/_lzma.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # no imports # Variables with simple values CHECK_CRC32 = 1 CHECK_CRC64 = 4 CHECK_ID_MAX = 15 CHECK_NONE = 0 CHECK_SHA256 = 10 CHECK_UNKNOWN = 16 FILTER_ARM = 7 FILTER_ARMTHUMB...
import json from base64 import b64decode from time import time from math import floor import dateutil.parser from logging import getLogger from events.models import GroupLog from events.group.dispatch import ImportGroupDispatch, CourseGroupDispatch from events.group.dispatch import UWGroupDispatch, Dispatch from aws_me...
def bad_fibonacci(n): """Return the nth Fibonacci number.""" if n <= 1: return n else: return bad_fibonacci(n-2) + bad_fibonacci(n-1) def good_fibonacci(n): """Return pair of Fibonacci numbers, F(n) and F(n-1).""" if n <= 1: return (n,0) else: (a, b) = good_fibon...
from decimal import Decimal from django.core.cache import cache from django.core import exceptions from nose.tools import eq_ from test_utils import ExtraAppTestCase from amo.fields import DecimalCharField from fieldtestapp.models import DecimalCharFieldModel class DecimalCharFieldTestCase(ExtraAppTestCase): ...
# -*- coding: utf-8 -*- """ Created on Fri Oct 28 16:48:42 2016 @author: k nityan suman Sam's house has an apple tree and an orange tree that yield an abundance of fruit. S is the start point & t is the end point of the house. The apple tree is to the left of his house, and the orange tree is to its right. ...
from __future__ import unicode_literals import collections import restea.errors as errors import restea.formats as formats import restea.fields as fields # TODO: Add fileds with validation class Resource(object): ''' Resource class implements all the logic of mapping HTTP methods to methods and error ha...
#!/usr/bin/env python3 # wordcounter II -- this is not really a lineal version of wordcounter; rather # it's a branch that I use to deal with special problems associated with currency words # wordcounter.py # Ted Underwood / version 1 / Sept 8, 2014 # # This module is based on NormalizeVolume.py, a more complex work...
# Fire30 from Card import Card #import time #import Functions import json import urllib2 #import ConfigParser """Make sure to change false to False""" class UrlRequestor(object): def __init__(self, url, headers, data): self.url = url self.headers = headers sel...
__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py 2014/08/24 12:12:31 garyo" __doc__ = """Module for Visual C/C++ detection and configuration. """ import SCons.compat import os import platform from string import digits as string_digits import SCons.Warnings import common debug = common.debug import sdk get_i...
from math import radians, pi, tan, cos, acos, degrees from gearbox.libs.maths import involute from gearbox.transmission.gears import Transmission class Optmization(object): def __init__(self, transmission): self.transmission = transmission def pitting(self, standard='ISO'): sh1 = 1 s...
import pkgutil import sys import traceback from _pydev_bundle import pydev_log try: import pydevd_plugins.extensions as extensions except: traceback.print_exc() extensions = None class ExtensionManager(object): def __init__(self): self.loaded_extensions = None self.type_to_instance...
import os import logging import sys from .configuration import Const as Const loggers = dict() DEFAULT_FORMATTER = '%(asctime)s %(name)s %(levelname)s %(message)s' def getLogger(name='unknown'): if loggers.get(name, None) is None: # default file logging log_filepath = "/var/tmp/cloudlet/log-synth...