text stringlengths 12 6.59M |
|---|
# Modified from https://github.com/adobe-type-tools/psautohint/blob/08b346865710ed3c172f1eb581d6ef243b203f99/python/psautohint/ufoFont.py#L800-L838
import hashlib
from fontTools.pens.pointPen import AbstractPointPen
from fontTools.pens.transformPen import TransformPointPen
class HashPointPen(AbstractPointPen):
DE... |
#!/usr/bin/env python
from __future__ import print_function
from functools import partial
import os
import sys
import boto.exception
import boto.ec2
import datetime
import time
import subprocess
from fabric.api import (
env,
settings,
sudo,
prefix,
put,
cd,
run,
)
from fabric.tasks import ... |
# -*- coding: utf-8 -*-
from __future__ import with_statement
__author__ = 'Marc Abramowitz'
__version__ = '0.0.0'
__license__ = 'MIT'
__all__ = ['convert', 'get_pandoc_formats']
from tempfile import NamedTemporaryFile
import os
import requests
DOCVERTER_DEFAULT_URL = 'http://c.docverter.com/convert'
def convert(... |
#! /usr/bin/env python
"""\
bundlebuilder.py -- Tools to assemble MacOS X (application) bundles.
This module contains two classes to build so called "bundles" for
MacOS X. BundleBuilder is a general tool, AppBuilder is a subclass
specialized in building application bundles.
[Bundle|App]Builder objects are instantiat... |
def string2object(message, data):
splitted = data.split()
_get_headers_from_string(message, splitted[:3])
_get_ies_from_string(message,splitted[3:])
def _get_headers_from_string(message, all_headers):
message.header.append(['Request Method', all_headers[0]])
message.header.append(['Request URI', al... |
#!bin/bash
"""
New object that generates training data in a sparter way.
Rather than firing off many jobs to do the training, will do everying with MPI in one program.
Will also write to an hdf5 file, to reduce the enormous clutter produced so far.
"""
from os import path
from time import time
import warnings
from iter... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 kirmani <sean@kirmani.io>
#
# Distributed under terms of the MIT license.
"""
Speak action.
"""
from action import Action
from action_process import ActionProcess
from speak import Speak
from speak_actively import SpeakActively
from ... |
import contextlib
from sublime import Region
def append(view, text):
"""Appends text to view."""
with in_one_edit(view) as edit:
view.insert(edit, view.size(), text)
@contextlib.contextmanager
def in_one_edit(view):
"""Context manager to group edits in a view.
Example:
... |
##############################################################################
#
# Copyright (C) 2020 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py
#
#####################... |
__author__ = 'katharine'
import json
import os
import os.path
import uuid
SDK_VERSION = "3"
from pebble_tool.exceptions import (InvalidProjectException, InvalidJSONException, OutdatedProjectException,
PebbleProjectException)
from pebble_tool.sdk import sdk_version
from . import pe... |
# Test some Unicode file name semantics
# We dont test many operations on files other than
# that their names can be used with Unicode characters.
import os, glob, time, shutil
import unicodedata
import unittest
from test.test_support import run_unittest, TestSkipped, TESTFN_UNICODE
from test.test_support import TESTF... |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services: Common dispatcher
Calls services according to the given method name and parameters
:author: Thomas Calmant
:copyright: Copyright 2015, isandlaTech
:license: Apache License 2.0
:version: 0.6.1
:status: Beta
..
Copyright 2015 isandla... |
# This file is part of Redmill.
#
# Redmill 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 version 3 of the License, or
# (at your option) any later version.
#
# Redmill is distributed in the ho... |
# Figures can be saved either to pdf or pptx (or both). Comment out
# lines as appropriate.
import os
from datetime import date, timedelta
from functools import reduce
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy as sp
from matplotlib import gri... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2015 Jean Nassar
# Released under BSD version 4
"""
Reduce /ardrone/image_raw framerate from 30 Hz to 2 Hz.
"""
import rospy
from sensor_msgs.msg import Image
class FramerateReducer(object):
"""
A ROS image Publisher/Subscriber.
"""
def __init__(s... |
#!/usr/bin/env python
# encoding: utf-8
from collections import namedtuple
from tornado.gen import coroutine, Return, sleep
from tornado.httpclient import HTTPRequest
from tornado.ioloop import IOLoop
from tornado.log import app_log as log
from ujson import loads
from .storage import Storage
from .elasticsearch imp... |
# -*- coding: utf-8 -*-
import os
from distutils.version import StrictVersion
from docker_squash.v1_image import V1Image
from docker_squash.v2_image import V2Image
from docker_squash.lib import common
from docker_squash.errors import SquashError
from docker_squash.version import version
class Squash(object):
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import docker
from .config import ClientConfiguration
from .container import ContainerMap
from .policy import ResumeUpdatePolicy
class MappingDockerClient(object):
"""
Reflects a :class:`~dockermap.map.container.ContainerMap` instance on a Dock... |
#!/usr/bin/env python2.3
#
# (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Public ... |
"""Adapted LSLSStream object from Real Time EEG repo found here: https://github.com/kaczmarj/rteeg.
Forms classes which update their EEG and marker/stimulus data in real time over lsl. Pre-processes data and makes it
available for analysis.
"""
import base
import numpy as np
import pylsl
from mne import create_info, Ep... |
# -*- coding: utf-8 -*-
"""
Django settings for SatNOGS project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.pat... |
from dateutil.relativedelta import relativedelta
from user_agents import parse as parse_ua_string
from datetime import timedelta
from collections import Counter
from django.utils import timezone
from django.shortcuts import get_object_or_404, redirect
from django.urls import reverse
from django.contrib import messages... |
from PyQt5.QtCore import Qt, QCoreApplication, pyqtSlot
from UM.Qt.ListModel import ListModel
from UM.Settings.Setting import Setting
from UM.Resources import Resources
from UM.Application import Application
class SettingsFromCategoryModel(ListModel):
NameRole = Qt.UserRole + 1
TypeRole = Qt.UserRole + 2
... |
from math import sqrt
from RULEngine.controllers.PID import PID
from RULEngine.controllers.controller_base_class import ControllerBaseClass
from RULEngine.robot import Robot
from Util import Pose, Position
from Util.geometry import wrap_to_pi, rotate
class RealVelocityController(ControllerBaseClass):
def __ini... |
import os
import sys
import shutil
import logging
import numpy as np
import pandas as pd
import collections
import geoalchemy2.shape
import matlab_wrapper as matlab
from cached_property import cached_property
from sqlalchemy.orm.exc import NoResultFound
import tmlib.models as tm
from tmlib.utils import autocreate_dire... |
# -*- coding: utf-8 -*-
# vim: set ts=4
# Copyright 2013 Rémi Duraffort
# This file is part of RandoAmisSecours.
#
# RandoAmisSecours 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 version 3 of... |
#!/usr/bin/env python
"""
The Resource Expert Droid Response Analyser.
Provides two classes: ResponseHeaderParser and ResponseStatusChecker.
Both take a RedFetcher instance (post-done()) as their only argument.
ResponseHeaderParser will examine the response headers and set messages
on the RedFetcher instance as app... |
# Add footway properties to pedestrian paths and piers
# Pedestrian path
# http://www.openstreetmap.org/way/8919991
assert_has_feature(
13, 1309, 3165, 'roads',
{ 'id': 8919991, 'kind': 'path', 'is_bicycle_related': True, 'bicycle': 'designated'})
# Pier
# http://www.openstreetmap.org/way/133920164
assert_has... |
import os, math, string, sys
if sys.version_info[0] == 3:
from tkinter import *
from tkinter.filedialog import askopenfilename
else:
from Tkinter import *
from tkFileDialog import askopenfilename
from cantera import *
import numpy as np
from .GraphFrame import Graph
from .DataGraph import DataGraph, p... |
"""
How to run from root:
PYTHONPATH=`pwd`/src:$PYTHONPATH python -m righter.web.main
"""
from flask import Flask, jsonify, request, send_from_directory
from righter.analyse import precision, recall
from righter.predict import apply_algorithm
app = Flask(__name__)
app.debug = True
SUPPORTED_ALGORITHMS = [
"pye... |
from glob import glob
from django.test import TestCase
from webassets.bundle import get_all_bundle_files
from jarbas.frontend.assets import elm
class TestDependencies(TestCase):
def test_dependencies(self):
expected = len(glob('jarbas/frontend/elm/**/*.elm', recursive=True))
files = set(get_all_... |
#! /usr/bin/env python
import shutil
from os import path, makedirs, remove
import subprocess
from glob import glob
import numpy as np
import sys
# centrality list
cen_list = ['0-5', '5-10', '10-20', '20-30', '30-40',
'40-50', '50-60', '60-70', '70-80']
# charged multiplicity dN/deta for 0-5% centrality
... |
#! /usr/bin/env python
"""
Main execution script for fMRI analysis in the Lyman ecosystem.
"""
import os
import sys
import time
import shutil
import os.path as op
import matplotlib as mpl
mpl.use("Agg")
from nipype.pipeline.engine import Node
from nipype.interfaces.io import DataGrabber, DataSink
from nipype.interfac... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Version information for Invenio-Base.
This file is imported by ``invenio_base.__i... |
import bottle
import json
from bottle import route, template, response
from maildir import *
@route('/kite/<user>/mail')
def index(user):
response.content_type = "application/json"
mdir = read_mail("/home/kite/Maildir")
return json.dumps(get_emails(mdir))
@route('/kite/<user>/mail/... |
#!/usr/bin/env python3
import sys
import subprocess
import argparse
from pathlib import Path
import typing as T
modules = [
# fully typed submodules
'mesonbuild/ast',
'mesonbuild/compilers/mixins',
'mesonbuild/scripts',
'mesonbuild/wrap',
# specific files
'mesonbuild/arglist.py',
'mesonbuild/compiler... |
__version_info__ = (0, 9, 2)
__version__ = '.'.join(map(str, __version_info__))
|
import json
import sys
import subprocess
grappa_srun = '../../bin/grappa_srun'
cmd_template = """{0} \
--ppn={{ppn}} \
--nnode={{nnode}} \
-- \
./{{exe}} \
2>&1""".format(grappa_srun)
for trial in ... |
from __future__ import unicode_literals
import logging
import os
import sys
import filecmp
import unittest
import shutil
from tempfile import NamedTemporaryFile
from requests import ConnectionError
from click.testing import CliRunner
import grablib
from grablib.cli import cli
from grablib.common import logger
try:
... |
#!/usr/bin/python
import os
import sys
import re
import gc
import locale
import codecs
import shutil
import time
import unittest
import doctest
import operator
import subprocess
import tempfile
import traceback
import warnings
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
try... |
#!/usr/bin/env python
import os
import sys
from optparse import OptionParser
os.environ['DJANGO_SETTINGS_MODULE'] = 'example.settings'
from django.conf import settings
if not settings.configured:
#load django settings from example project for tests
from example import settings as example_settings
setting... |
#!/usr/bin/env python
import os
import sys
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db',
}
},
INSTALLED_APPS=(
... |
"""
This is just a way to see which method alluded to in the README will produce the
best result.
Think of it as a test, I guess.
"""
import randompi
import statistics
import time
print("Starting timer")
start_time = time.time()
# Basically, I'm going to make a bunch of lists holding a thousand (1000) of values of ... |
"""Run all unittests.
Usage:
python3 runtests.py [-v] [-q] [pattern] ...
Where:
-v: verbose
-q: quiet
pattern: optional regex patterns to match test ids (default all tests)
Note that the test id is the fully qualified name of the test,
including package, module, class and method,
e.g. 'tulip.events_test.Poli... |
import getopt
import sys
import warnings
from abelfunctions import __version__
def usage():
s = """
------------------------------------------------------------
Abelfunctions Version %s Test Suite
------------------------------------------------------------
Usage:
$ sage -python runtests [-hv] [module nam... |
#!/usr/bin/env python
"""Regression testing framework
Borrowed from http://www.diveintopython.org/
This module will search for scripts in the same directory named
XYZtest.py. Each such script should be a test suite that tests a
module through PyUnit. (As of Python 2.1, PyUnit is included in
the standard library as... |
#!/usr/bin/env python
"""
runtests.py [OPTIONS] [-- ARGS]
Run tests, building the project first.
Examples::
$ python runtests.py
$ python runtests.py -s {SAMPLE_SUBMODULE}
$ python runtests.py -t {SAMPLE_TEST}
$ python runtests.py --ipython
$ python runtests.py --python somescript.py
"""
#
# Th... |
import os
from django.conf import settings
os.environ['REUSE_DB'] = '1'
if not settings.configured:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django_nose',
'markitup',
'... |
"""Simple HTTP Server.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
__version__ = "0.6"
__all__ = ["SimpleHTTPRequestHandler"]
import os
import posixpath
import BaseHTTPServer
import urllib
import cgi
import shutil
import mimetypes... |
"""cffLib.py -- read/write tools for Adobe CFF fonts."""
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc import sstruct
from fontTools.misc import psCharStrings
from fontTools.misc.textTools import safeEval
import struct
import logging
# mute cff... |
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright 2010 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/l... |
"""cffLib.py -- read/write tools for Adobe CFF fonts."""
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc import sstruct
from fontTools.misc import psCharStrings
from fontTools.misc.textTools import safeEval
import struct
import logging
# mute cff... |
'''
Copyright 2011 SRI International
Copyright (c) 2007 Michael Twomey
@author: jklo
'''
import unittest,iso8601
class Test(unittest.TestCase):
def test_iso8601_regex(self):
assert iso8601.ISO8601_REGEX.match("2006-10-11T00:14:33Z")
def test_timezone_regex(self):
assert iso8601.TIMEZONE... |
"""cffLib.py -- read/write tools for Adobe CFF fonts."""
#
# $Id: cffLib.py,v 1.32 2006-10-21 13:41:18 jvr Exp $
#
import struct, sstruct
import string
from types import FloatType, ListType, StringType, TupleType
from fontTools.misc import psCharStrings
from fontTools.misc.textTools import safeEval
DEBUG = 0
cffHe... |
from __future__ import print_function
import os
import sys
import contextlib
import subprocess
import tempfile
import shutil
import itertools
import functools
from pip._vendor import pkg_resources
filterfalse = getattr(itertools, 'filterfalse', None) or itertools.ifilterfalse
@contextlib.contextmanager
def _updat... |
# Copyright 2013 Google, Inc. All Rights Reserved.
#
# Google Author(s): Behdad Esfahbod
"""Python OpenType Layout Subsetter.
Later grown into full OpenType subsetter, supporting all standard tables.
"""
from __future__ import print_function, division
from fontTools.misc.py23 import *
from fontTools import ttLib
fro... |
# Copyright 2013 Google, Inc. All Rights Reserved.
#
# Google Author(s): Behdad Esfahbod
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools import ttLib
from fontTools.ttLib.tables import otTables
from fontTools.misc import psCharStrings
from fontTools.pen... |
#!/usr/bin/env python
import boto
import sys
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import json
################################################################
# 1. Get s3connection object
# 2. Get the bucket from the connection
# 3. List the keys and inormation under the bucket for ... |
from test.test_support import run_unittest, verbose, TestSkipped
import unittest
import locale
import sys
import codecs
enUS_locale = None
def get_enUS_locale():
global enUS_locale
if sys.platform == 'darwin':
import os
tlocs = ("en_US.UTF-8", "en_US.ISO8859-1", "en_US")
if int(os.una... |
"""
The API for s3s3.
"""
import tempfile
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from . import config
from .log import logger
if config.pubsub['redis']:
import redis
r = redis.Redis()
else:
Exception('Only redis is supported right now.')
def create_connection(connectio... |
#!/usr/bin/env python3
import unittest
from test import support
import errno
import io
import socket
import select
import time
import traceback
import queue
import sys
import os
import array
from weakref import proxy
import signal
def try_address(host, port=0, family=socket.AF_INET):
"""Try to bind a socket on t... |
# Tests for the correctly-rounded string -> float conversions
# introduced in Python 2.7 and 3.1.
import random
import struct
import unittest
import re
import sys
from test import test_support
# Correctly rounded str -> float in pure Python, for comparison.
strtod_parser = re.compile(r""" # A numeric string consi... |
from test_support import TestFailed, verbose, verify
import struct
## import pdb
import sys
ISBIGENDIAN = sys.byteorder == "big"
del sys
verify((struct.pack('=i', 1)[0] == chr(0)) == ISBIGENDIAN,
"bigendian determination appears wrong")
def string_reverse(s):
chars = list(s)
chars.reverse()
return ... |
# Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
import os, sys
import unittest
from test import test_support
threading = test_support.import_module("threading")
from platform import machine
# Do this first so test will be skipped if module doesn't exi... |
from __future__ import print_function, division
import os,os.path
import logging
import re
from configobj import ConfigObj
try:
import numpy as np
except ImportError:
np = None
try:
import pandas as pd
except ImportError:
pd = None
import numpy.random as rand
import scipy.optimize
try:
impo... |
"""
Tests for `txacme.challenges`.
"""
from acme import challenges
from acme.jose import b64encode
from hypothesis import strategies as s
from hypothesis import example, given
from testtools import TestCase
from testtools.matchers import Contains, Equals, Is, MatchesPredicate, Not
from zope.interface.verify import veri... |
"""
IPython shell integration extension
Enables iTerm2 shell integration in the IPython shell.
To load, use::
%load_ext iterm2_tools.ipython
To load every time IPython starts, add::
try:
import iterm2_tools.ipython
c.TerminalIPythonApp.extensions.append('iterm2_tools.ipython')
except Im... |
#!/usr/bin/env python
import tornado.ioloop
import tornado.web
import tornado.websocket
import tornado.httpclient
import tornado.gen
import json
import multiprocessing
import os
import random
import shutil
import threading
import utilities
import settings
import redditUserImageScraper
# Require a username and passw... |
"""
Class to perform least_squares fitting of RT-1 models to given datasets.
"""
import warnings
import numpy as np
import sympy as sp
from sympy.abc import _clash
import pandas as pd
from scipy.optimize import least_squares
from scipy.sparse import vstack
from scipy.sparse import csr_matrix, isspmatrix
from scipy.in... |
"""
Class to perform least_squares fitting of given datasets.
(wrapper for scipy.optimize.least_squares)
"""
import numpy as np
import sympy as sp
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from scipy.optimize import least_squar... |
"""
Watstock's market prediction neural network.
"""
from __future__ import print_function
import time
import os
import numpy as np
import pandas as pd
import math
import json
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import GRU
from keras.layer... |
import re
import sys
import os
import logging
import time
import hashlib
from urlparse import urlparse
from malware import utils
from malware.snort import SnortRule
from malware import sql_tool
from malware import apikey
from virus_total_apis import PrivateApi as VirusTotal
logger = logging.getLogger(__name__)
REQUES... |
import datetime
import traceback
import progressbar
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.db.models import Q
from django.utils.timezone import now
from inthe_am.taskmanager.models import TaskStore, TaskStoreStatistic
from inthe_am.taskmanager.lock... |
from contextlib import contextmanager
import datetime
import os
import traceback
import uuid
import progressbar
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.db.models import Q
from django.utils.timezone import now
from inthe_am.taskmanager.models import ... |
import re
import sys
import os
import logging
import time
import hashlib
from malware import utils
from malware.snort import SnortRule
from malware import pickle_tool
from malware import apikey
from virus_total_apis import PrivateApi as VirusTotal
logger = logging.getLogger(__name__)
class RuleEngineBase(object):
... |
import asyncio
import contextlib
import functools
import inspect
import weakref
import aiopg
import peewee
import tasklocals
from ormageddon.fields import *
from ormageddon.utils import *
class LazyCursor:
def __init__(self, cursor_getter, loop=None):
self._real_cursor = asyncio.Future(loop=loop)
... |
import hashlib
from db import conn
from flask import session, flash, redirect, url_for
from functools import wraps
from postmark import PMMail
import os
def loginrequired(f):
@wraps(f)
def wrappedf(*args, **kwargs):
if 'uid' in session:
return f()
flash("You need to be logged in to ... |
# -*- coding: utf-8 -*-
#
# NLTK documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 2 17:02:59 2011.
#
# 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
# autogenerated file.
#
# All co... |
import cgi
class Tag:
def __init__(self, name):
self.name = name
self.id = ''
self.classes = []
self.attributes = []
def setId(self, id):
self.id = id
return self
def addClass(self, className):
self.classes.append(className)
return self
... |
import time
import sys
import logging
import socket
logger = logging.getLogger("job")
TASK_STARTING = 0
TASK_RUNNING = 1
TASK_FINISHED = 2
TASK_FAILED = 3
TASK_KILLED = 4
TASK_LOST = 5
class Job:
def __init__(self):
self.id = self.newJobId()
self.start = time.time()
def slaveOffer(... |
# Copyright (c) 2014 VMware, 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/histos/histos.py
# Module with decoration of TH* objects for efficient use in python
#
# @author Vanya BELYAEV Ivan.Belyaev@itep.ru
# @date 2011-06-07
# ====================... |
__author__ = 'rvuine'
import math
import micropsi_core.tools
from abc import ABCMeta, abstractmethod
from micropsi_core.nodenet.stepoperators import StepOperator, Propagate, Calculate
class DictPropagate(Propagate):
"""
The default dict implementation of the Propagate operator.
"""
def execute(self,... |
from types import *
from robot import utils
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.common.exceptions import NoSuchWindowException
class WindowManager(object):
def __init__(self):
self._strategies = {
'title': self._select_by_title,
'name': self._sel... |
from devicehive.api_response import ApiResponse
from devicehive.api_response import ApiResponseError
from devicehive.transports.transport import TransportError
class ApiRequest(object):
"""Api request class."""
def __init__(self, transport):
self._transport = transport
self._action = None
... |
#!/usr/bin/python2.4
#
# Copyright (c) 2005-2007 rPath, Inc.
#
# All Rights Reserved
#
import os
import shutil
import testsuite
testsuite.setup()
import mint_rephelp
from mint_rephelp import MINT_PROJECT_DOMAIN
from repostest import testRecipe
from conary import versions
from conary.conaryclient import ConaryClient
... |
"""
A collection of algorithms to analyze and decorate :class:`Iteration` in an
Iteration/Expression tree. Decoration comes in the form of :class:`IterationProperty`
objects, attached to Iterations in the Iteration/Expression tree. The algorithms
perform actual data dependence analysis.
"""
from collections import Ord... |
# coding: utf8
# WeasyPrint converts web documents (HTML, CSS, ...) to PDF.
# Copyright (C) 2011 Simon Sapin
#
# This program 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 version 3 of t... |
from collections import namedtuple
from ctypes import Structure, c_int, c_void_p, sizeof
from itertools import product
from math import ceil
import atexit
from cached_property import cached_property
from cgen import Struct, Value
import numpy as np
from devito.parameters import configuration
from devito.types import... |
# coding: utf-8
"""
weasyprint.layout.inline
------------------------
Line breaking and layout for inline-level boxes.
:copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division, unicode_literals
import ... |
import datetime
from unittest import TestCase
from asserts import (assert_false, assert_true,
assert_is_none,
assert_equal, assert_is,
assert_raises)
from htmlgen import (
Form, Input, TextInput, SubmitButton, Button,
NumberInput, SearchInput, Pas... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! 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.or... |
# -*- coding: utf-8 -*-
'''
The Salt Key backend API and interface used by the CLI. The Key class can be
used to manage salt keys directly without interfacing with the CLI.
'''
# Import python libs
from __future__ import print_function
import os
import stat
import shutil
import fnmatch
import hashlib
import json
impor... |
#!/usr/bin/env python
from sys import exit
try:
import sympy
except ImportError:
print("SymPy must be installed for the tutorial")
if sympy.__version__ != '1.1':
print("SymPy 1.1 is required for the tutorial. Note SymPy 1.1 will be released before July 10.")
try:
import numpy
except ImportError:
... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
# Copyright (C) 2012 New Dream Network, LLC (DreamHost) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the Licens... |
"""this module appears to be where I collect functionality
that is built upon by the more specialised parts of builder.
suggestions for a better name than 'core' welcome."""
import os, glob, json, re
from os.path import join
from . import utils, config, project, decorators # BE SUPER CAREFUL OF CIRCULAR DEPENDENCIES
... |
'''
salt.log
~~~~~~~~
This is where Salt's logging gets set up.
:copyright: 2011-2012 :email:`Pedro Algarvio (pedro@algarvio.me)`
:license: Apache 2.0, see LICENSE for more details.
'''
import re
import sys
import logging
import logging.handlers
TRACE = logging.TRACE = 5
GARBAGE = logging.GARBA... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! 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.or... |
#!/usr/bin/env python2.7
# coding: utf-8
from __future__ import unicode_literals, print_function
import signal
import platform
import time
from nhentai.cmdline import cmd_parser, banner
from nhentai.parser import doujinshi_parser, search_parser, print_doujinshi, favorites_parser
from nhentai.doujinshi import Doujinshi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#@created: 09.10.2013
#@author: Aleksey Komissarov
#@contact: ad3002@gmail.com
import sys
sys.path.append("c:/Users/Master/Dropbox/workspace")
sys.path.append("/Users/akomissarov/Dropbox/workspace")
import Image, ImageDraw, ImageFont
import yaml
# fix for Windows-specif... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.