text stringlengths 475 200k |
|---|
#
# Copyright 2012 Eigenlabs Ltd. http://www.eigenlabs.com
#
# This file is part of EigenD.
#
# EigenD 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) an... |
# -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2006,2007 Frank Scholz <[EMAIL]>
import os
import re
import traceback
from StringIO import StringIO
import urllib
from twisted.internet import defer
from twisted.web import static
from twisted.web i... |
# -*- coding: utf-8 -*-
import os
os_env = os.environ
class Config(object):
SECRET_KEY = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
# SECRET_KEY = os_env['SOLARPI_SECRET']
# SECRET_KEY = os_env['secretkey']
APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
PROJECT_ROOT = os.path.abspath(... |
#!/usr/bin/env python3
#
# Copyright (c) 2016 Roberto Riggio
#
# 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 applicabl... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.yang
~~~~~~~~~~~~~~~~~~~~
Lexer for the YANG 1.1 modeling language. See :rfc:`7950`.
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import (RegexLexer, bygroups, words)
... |
#!/usr/bin/env python3
import argparse
import hashlib
import os
import subprocess
import sys
from typing import Iterable, List
def expand_reqs_helper(fpath: str) -> List[str]:
result = [] # type: List[str]
with open(fpath) as f:
for line in f:
if line.strip().startswith(("#", "--hash")):... |
# Copyright 2008-2015 Canonical
#
# 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 the
# License, or (at your option) any later version.
#
# This program is distributed... |
import os, sys, getopt, cgi
import BaseHTTPServer
from dependencies.dependency import Pickler, Unpickler
class IDRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def run(self):
try:
self.counter_file = os.environ.get('counter')
self.get_id()
except:
self.s... |
"""
Contains mixin classes.
"""
import collections
from django.db import models
from django.utils.functional import cached_property
from taggit.models import TaggedItem
from wagtail.wagtailadmin.taggable import TagSearchable
from wagtail.wagtailcore.models import Page
class CustomTemplateMixin(models.M... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
"""
import StringIO
import json
from django.test import TestCase
from django.test.client import Client
from django.core.files.uploadedfile import SimpleUploadedFile
from django.contrib.auth import get_us... |
from django.utils.translation import ugettext as _
from django.http import HttpResponse
from darkoob.migration.forms import StartNewMigrationForm
from darkoob.book.models import Book
from darkoob.migration.models import Migration
import random
import string
def generate_private_key(len=10):
return ''.join(random.... |
from setuptools import setup, find_packages
import os
import re
here = os.path.abspath(os.path.dirname(__file__))
# Read the version number from a source file.
# Code taken from pip's setup.py
def find_version(*file_paths):
with open(os.path.join(here, *file_paths), 'r') as f:
version_file = f.read()
... |
import json
import os
import shutil
import tempfile
from pathlib import Path
import waffle
import olympia.core.logger
from olympia.amo.celery import task
from olympia.amo.decorators import use_primary_db
from olympia.amo.storage_utils import move_stored_file
from olympia.amo.utils import StopWatch
from olympia.devh... |
# -*- coding: utf-8 -*-
#
import sys, os
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_te... |
#!/usr/bin/env python
#
# Copyright 2004,2007,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gr_unittest, blocks
from gnuradio import fec
class test_ccsds_27 (gr_unittest.TestCase):
def setUp(self):
... |
#!/usr/bin/env python
"""Generates a tracklist file for use by gordon's audio_intake scripts
Usage: generate_tracklist_from_regexp <pattern> <outputfilename> file1 file2 ...
Extracts metadata from each of the given filenames using the specified
regexp pattern to generate a tracklist. The pattern must name
matching... |
"""
==================================
Comparing initial sampling methods
==================================
Holger Nahrstaedt 2020 Sigurd Carlsen October 2019
.. currentmodule:: skopt
When doing baysian optimization we often want to reserve some of the
early part of the optimization to pure exploration. By default... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2021 Ryan Roden-Corrent (rcorre) <[EMAIL]>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 Foundat... |
from flask import jsonify, g, current_app
from flask.ext.httpauth import HTTPBasicAuth
from .models import User
auth = HTTPBasicAuth()
auth_token = HTTPBasicAuth()
@auth.verify_password
def verify_password(username, password):
g.user = User.query.filter_by(username=username).first()
if g.user is None:
... |
"""API for Google Nest Device Access bound to Home Assistant OAuth."""
import datetime
from aiohttp import ClientSession
from google.oauth2.credentials import Credentials
from google_nest_sdm.auth import AbstractAuth
from homeassistant.helpers import config_entry_oauth2_flow
from .const import API_URL, OAUTH2_TOKEN... |
#!/usr/bin/python
import io
import random
import picamera
camera_rotation = 270
from PIL import Image, ImageChops
import io, os, time, datetime, picamera, cv2
import numpy as np
import math, operator
import logging
import datetime
dt = datetime.datetime.now()
logging.basicConfig(filename='/home/pi/MOTION/securitah_%i_%... |
import sys, copy
from itertools import *
from StringIO import StringIO
import benchbase
from benchbase import with_attributes, with_text, onlylib, serialized, children, nochange
############################################################
# Benchmarks
############################################################
clas... |
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is... |
#!/usr/bin/python
import logging
import os
import sys
import subprocess
import shlex
from subprocess import Popen, PIPE, STDOUT, call
import re
local_kit_base = os.environ['PIN_ROOT']
def info(msg):
logging.info(msg)
def debug(msg):
logging.debug(msg)
def warn(msg):
logging.warning(msg)
def extractErro... |
from __future__ import unicode_literals
from pygubu.builder.builderobject import *
from pygubu.widgets.tkscrolledframe import TkScrolledFrame
class TKScrolledFrameBO(BuilderObject):
class_ = TkScrolledFrame
container = True
# maxchildren = 1
# allowed_children = ('tk.Frame', 'ttk.Frame' )
OPTIONS_S... |
import re
from urllib2 import unquote
from django import forms
from django.forms.models import modelformset_factory
from django.utils.translation import ugettext_lazy as _lazy
from bleach import TLDS
from quieter_formset.formset import BaseModelFormSet
from olympia import amo, reviews
from olympia.amo.utils import r... |
import os
import string
import os.path as op
import sys
import shutil
from collections import namedtuple
try:
from seqcluster import prepare_data as prepare
from seqcluster import templates as template_seqcluster
except ImportError:
pass
from bcbio.utils import file_exists, safe_makedir
from bcbio.provena... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... |
#!/usr/bin/env python2
# Copyright (C) 2013:
# Gabes Jean, [EMAIL]
# Pasche Sebastien, [EMAIL]
#
# 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 withou... |
#!/usr/bin/env python2
"""Clean out an appliance DB
In the case where an appliance has been used for a lot of testing and filled up with old records,
this script will clean out an appliance's database and wait for the UI to come back online.
By default, it will use the appliance named in conf.env, but can be explici... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
notesapi test
~~~~~
testing for RESTful notes api with flask
"""
__author__ = 'aantonw'
__version__ = '0.0.1'
import os
import notesapi
import base64
import unittest
import tempfile
import json
import re
class NotesapiTestCase(unittest.TestCase):
de... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Brian Coca <[EMAIL]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... |
# -*- coding: utf-8 -*-
"""
@author: jaxankey
@author: jayich
This object was borrowed from the spinmob project (see https://github.com/Spinmob/spinmob).
I modified it slightly to make it work with this project
"""
import pyqtgraph as _pg
#import spinmob as _spinmob
#_d = _spinmob.data
#import os as _os
class egg_Tr... |
#!/usr/bin/env python
"""
setup.py for installing F2PY
Usage:
pip install .
Copyright 2001-2005 Pearu Peterson all rights reserved,
Pearu Peterson <[EMAIL]>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN ... |
import psycopg2
import sys
from mx.DateTime import *
import datetime
import pickle
from numpy import *
import csv
sys.path.append('../lib/')
from evecentral import display
db = psycopg2.connect(database='evec', user='evec', host = 'sb2', port = '5432')
# Column | Type | Modifiers
#-------------... |
#!/usr/bin/python
# Terminator by Chris Jones <[EMAIL]>
# GPL v2 only
"""activitywatch.py - Terminator Plugin to watch a terminal for activity"""
import time
import gtk
import gobject
import terminatorlib.plugin as plugin
from terminatorlib.translation import _
from terminatorlib.util import err, dbg
from terminatorl... |
# -*- coding: utf-8 -*-
import PyQt5.QtWidgets as Qw
import PyQt5.QtCore as Qc
import locale
import sys
class Foo:
def __init__(self, **args):
for key, value in args.items():
setattr(self, key, value)
def todic(self):
# Return a dictionary of attributes: values
dic = {}
... |
import math
def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=False):
"""
Add suffix to value, transform value to match new suffix and round it.
Keyword arguments:
val -- value to process
prec -- precision of final number (number of significant positions to show)
lo... |
# Copyright 2015-2016 Yelp Inc.
#
# 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 agreed to in writin... |
# -*- coding: utf-8 -*-
#
# 2015-05-15 Cornelius Kölbel <[EMAIL]>
# Initial writup
#
# License: AGPLv3
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
# License as published by the Free Software Foundation; either
# versio... |
# -------------------------------------------------------------------------
# Name: Data handling
# Purpose: Transforming netcdf to numpy arrays, checking mask file
#
# Author: PB
#
# Created: 13/07/2016
# Copyright: (c) PB 2016
# -------------------------------------------------------------------... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'AstakosUser.uuid'
db.alter_column('im_astakosuser', 'uuid', self.gf('django.db.models.fie... |
"""
.. todo::
WRITEME
"""
import functools
from pylearn2.datasets.dataset import Dataset
from pylearn2.utils import wraps
import logging
import numpy
import warnings
try:
import scipy.sparse
except ImportError:
warnings.warn("Couldn't import scipy.sparse")
import theano
import gzip
floatX = theano.config.... |
"""
A library of various helpers functions and classes
"""
import sys
import logging
class MissingModule(object):
__slots__ = ["__name"]
def __init__(self, name):
self.__name = name
def __getattr__(self, name):
if name.startswith("__"): # issue 71
raise AttributeError("module %... |
'''
Logger object
=============
The Kivy `Logger` class provides a singleton logger instance. This instance
exposes a standard Python
`logger <https://docs.python.org/3/library/logging.html>`_ object but adds
some convenient features.
All the standard logging levels are available : `trace`, `debug`, `info`,
`warning`... |
# -*- coding: utf-8 -*-
#
# test_connect_array_fixed_indegree.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 versio... |
# Copyright 2015 Intel Corporation.
# Copyright 2015 Isaku Yamahata <isaku.yamahata at intel com>
# <isaku.yamahata at gmail com>
# All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the Lic... |
from dockitcms.models import ModelCollection, Subsite
from dockitcms import fields
from dockitcms.viewpoints.categorypoint import CategoryViewPoint
from dockit import schema
from django.utils import unittest
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from dj... |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsSpatialIndex.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later versi... |
# Copyright 2017 FiberHome Telecommunication Technologies CO.,LTD
# 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/LI... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A set of routines for estimating the temporal components, given the spatial
components and temporal components
"""
from builtins import str
from builtins import map
from builtins import range
import logging
from scipy.sparse import spdiags, diags, coo_matrix, csc_matri... |
#!/usr/bin/python3
import sys, os, datetime, shutil
print("Arguments: %s" % (sys.argv))
if len(sys.argv) <= 1:
print("First argument must be the directory to create index HTML for.")
sys.exit(1)
root_dir = sys.argv[1]
print("Indexing directory " + root_dir)
index_html_template = "<html>" \
"<head>" \
"<tit... |
import imp
import sys
class TestImporter(object):
def find_module(self, name, path=None):
self.module_info = imp.find_module(name)
return self
def load_module(self, name):
if name in sys.modules:
return sys.modules[name]
path = self.module_info[1]
module... |
"""
Builds bootable CD images that have PXE-equivalent behavior
for all Cobbler distros/profiles/systems currently in memory.
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General... |
# -*- coding: utf-8 -*-
# HINT:image
import chainer
import chainer.functions as F
import chainer.links as L
"""
Alexnet:
ImageNet Classification with Deep Convolutional Neural Networks
http://www.cs.toronto.edu/~fritz/absps/imagenet.pdf
##############################
## DO NOT CHANGE CLASS NAME ##
###################... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
# This program is placed into the public domain.
"""
Gets the current version number.
If in a git repository, it is the current git tag.
Otherwise it is the one contained in the PKG-INFO file.
To use this script, simply import it in your setup.py file
and use the results of get_version() as your package version:
f... |
from tests.base import base
from steerclear.models import User
"""
SteerClearPermissionsTestCase
-----------------------
TestCase for testing permissions
"""
class SteerClearPermissionsTestCase(base.SteerClearBaseTestCase):
"""
setUp
-----
called before each test function. creates new test database
... |
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc.textTools import deHexStr
import filecmp
import tempfile
from subprocess import check_call
import sys
import os
import unittest
PIPE_SCRIPT = """\
import sys
binary_stdin = open(sys.stdin.fileno(), m... |
from pybrain.rl.agents.linearfa import LinearFA_Agent
from pybrain.rl.learners.valuebased.linearfa import LSPI
from pybrain.rl.experiments import EpisodicExperiment
from environment import Environment
from tasks import LSPIBalanceTask
from training import LinearFATraining
task = LSPIBalanceTask()
learner = LSPI(task.... |
"""Unit system for the spectral code."""
import math
import numpy as np
class UnitSystem(object):
"""Class to store the various physical constants and units that are relevant here. Factored out of Spectra."""
def __init__(self, UnitMass_in_g=1.98892e43, UnitLength_in_cm=3.085678e21, UnitVelocity_in_cm_per_s = ... |
'''
Created on May 2, 2013
@author: Jonas Zaddach <[EMAIL]>
'''
#!/usr/bin/env python3
import socket
import collections
import queue
import threading
from select import select
from avatar.interfaces.gdb.errors import ProtocolError
import functools
import logging
log = logging.getLogger(__name__)
ARM_REGISTERS = {"... |
"""
.. warning:: This code is not recommanded. It is not finished, it is
slower than the version in sandbox/neighbours.py, and it does not work
on the GPU.
We only keep this version here as it is a little bit more generic, so
it cover more cases. But thoses cases aren't needed frequently, so you
probably don't want to... |
from setuptools import setup
setup(
name = 'LatLon23',
packages = [
'LatLon23'
],
version = '1.0.7',
description = 'Methods for representing geographic coordinates',
long_description = open('README.rst', 'r').read(),
author = 'Gen Del Raye, Ryan Vennell',
author_email = '[EMAIL... |
# Copyright (C) 2014. Statoil ASA, Norway.
#
# This file is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
from flexget.config_schema import one_or_more
from flexget.utils import qualities
log = logging.... |
# -*- coding: utf-8 -*-
# Author: Gustavo Valverde <[EMAIL]> iterativo | Consultores
# Contributors: Edser Solis - iterativo
# Odoo 8.0 author: Eneldo Serrata <[EMAIL]>
# (Marcos Organizador de Negocios SRL..)
# Odoo 7.0 author: Jose Ernesto Mendez <[EMAIL]>
# (Open Business Solutions SRL.)
# Copyright (c) 2016 - Pr... |
# (c) 2012-2014, Michael DeHaan <[EMAIL]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... |
import cgi
import copy
import json
import logging
import random
import webapp2
from google.appengine.api import channel
from google.appengine.api import users
from google.appengine.ext import db
import geometry
ANCHOR_LOCATIONS = [
[0,4],
[0,7],
[2,5],
[2,7],
[2,9],
[2,11],
[3,3],
[4,... |
from __future__ import absolute_import, division
import os.path as op
from click.testing import CliRunner
from cooler.cli import cli
testdir = op.realpath(op.dirname(__file__))
datadir = op.join(testdir, "data")
def test_cp():
runner = CliRunner()
with runner.isolated_filesystem():
result = runner.i... |
"""
sentry.utils.http
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import six
import urllib
from collections import namedtuple
from django.conf import settings
from urlparse import... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
"""
Django settings for wecoders project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... |
import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-birkenhead',
version='0.1',... |
import json
from pathlib import Path
from typing import Dict, Set
from dtags.commons import normalize_tags
from dtags.exceptions import DtagsError
CONFIG_ROOT = ".dtags"
CONFIG_FILE = "config.json"
COMP_FILE = "completion" # used for tag name completion
DEST_FILE = "destination" # used for d command
ConfigType = D... |
from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from config import KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_OK, KEY_TOGGLEOW, KEY_ASCII, KEY_TIMEOUT, KEY_NUMBERS, ConfigElement, ConfigText, ConfigPassword
from Components.ActionMap import NumberActionMap... |
import os
import sys
import argparse
import datetime
videos=[]
frames=[]
fps=[]
width=[]
height=[]
# python ddrfc_simulation.py -qp 32 -ty 0 -bs 64 -ts 64 -dr
presets=["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"]
# presets=["fast"]
tipo_nomes=["bbc", "bbl... |
# Suppress pylint messages concerning missing class and method docstrings
# pylint: disable=C0111
# Suppress pylint warning about attribute defined outside __init__
# pylint: disable=W0201
# Suppress pylint warning about access to protected member
# pylint: disable=W0212
# Suppress pylint warning about unused argume... |
# Lint as: python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
#!/usr/bin/env python
"""
test_pacman-mirrors
----------------------------------
Tests for `pacman-mirrors` module.
"""
import unittest
from pacman_mirrors.constants import txt
class TestTextHelpArgMessages(unittest.TestCase):
"""Pacman Mirrors Test suite"""
def setUp(self):
"""Setup tests"""
... |
##############################################################################
#
# SEPA Credit Transfer module for OpenERP
# Copyright (C) 2010-2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <[EMAIL]>
# Copyright (C) 2014 Acysos S.L. (<http://acysos.com>).
# @author: Ignacio Ibeas <[... |
import sys
import cv2
import os #For Getting directory paths
import time # To know FPS processed
import argparse # To pass args in terminal`
import numpy as np # Sci Library for python
import tensorflow as tf # Tensorflow
import socket # To pass value of movement to Rasp
from gi.repository import Gst
from paths impor... |
from consensus import *
import pandas as pd
import csv
import operator
from ast import literal_eval
import numpy as np
import matplotlib.pyplot as plt
'''
Some very quick and dirty analysis on the outputs of the RGZ consensus code and testing the effect
of various weighting schemes. --- Kyle Willett (UMN), 25 May 20... |
# 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 ... |
#!/usr/bin/env python
# Copyright (c) 2007-2008 ActiveState Corp.
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
r"""A fast and complete Python implementation of Markdown.
[from http://daringfireball.net/projects/markdown/]
> Markdown is a text-to-HTML filter; it translates an easy-to-read /
> ea... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
... |
from behave import *
@given(u'I load /articles from the homepage')
def step_impl(context):
raise NotImplementedError(u'STEP: Given I load /articles from the homepage')
@then(u'I should see the list with the titles of all articles')
def step_impl(context):
raise NotImplementedError(u'STEP: Then I should see th... |
import os, csv, re, difflib, math, sys, time, json, sqlite3, plistlib
from pprint import pprint
reload(sys)
sys.setdefaultencoding('utf-8')
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d
# parse options from command line
from optparse import ... |
import fnmatch
import logging
import serial
import sys
import time
DEFAULT_BAUDRATE = 115200
log = logging.getLogger(__name__)
PY3 = sys.version_info[0] == 3
class SerialManagerError(Exception):
pass
def _auto_detect_serial_unix(preferred_list=None):
import glob
glist = glob.glob('/dev/ttyACM*') + gl... |
# coding=utf-8
"""
Cadasta Utilities -**Questionnaire**
This module provides: Login : Login for cadasta and save authnetication
.. note:: 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; ei... |
#!/usr/bin/env python
#
# -*- coding: utf-8 -*-
#
# server.py
#
# Copyright (C) 2006-2020 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either versi... |
# Copyright 2007 World Wide Workshop Foundation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is di... |
import copy
import os
import logging
import signal
import socket
import time
from multiprocessing import Process
from dreque.base import Dreque
from dreque.utils import setprocname
SUPPORTED_DISPATCHERS = ("nofork", "fork") # "pool"
class DrequeWorker(Dreque):
def __init__(self, queues, server="127.0.0.1", d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import os
import rando... |
# -*- coding: utf-8 -*-
import logging
import os
import sys
import yaml
from pushmanager.core.util import dict_copy_keys
configuration_file = os.environ.get('SERVICE_ENV_CONFIG_PATH')
Settings = {}
try:
with open(configuration_file) as settings_yaml:
Settings = yaml.safe_load(settings_yaml)
except:
... |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Nik Lutz <[EMAIL]>
#
# 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.
#
# Th... |
from .. import pylc3
import collections
import logging
import os
import six
import struct
import sys
import unittest
from pylc3.unittests import lc3_unit_test_case
from pylc3.unittests.lc3_unit_test_case import DataItem
# Note this file is not to be used as a template for writing student tests.
# See htt... |
import binascii
import os
KEY = "@ABCDEFGHIJKLMNO"
hotpKeyVersion = 0x03
counterFile = 0x42
kbFile = 0x0800
hidMappingFile = 0x0001
try:
from daplug.conv import *
from daplug.utils import *
from daplug.keyset import *
from daplug.keyboard import *
from daplug import *
secu01 = DaplugDongle... |
import numpy as np
from moviepy.editor import *
from moviepy.video.tools.segmenting import findObjects
# WE CREATE THE TEXT THAT IS GOING TO MOVE, WE CENTER IT.
screensize = (720,460)
txtClip = TextClip('Cool effect',color='white', font="Amiri-Bold",
kerning = 5, fontsize=100)
cvc = CompositeVideoC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.