text stringlengths 12 6.59M |
|---|
import json
import logging
from time import time, sleep
import requests
log = logging.getLogger(__name__)
# logging.basicConfig(filename='example2.log', level=logging.DEBUG)
class APIError(Exception):
pass
class Controller(object):
"""Interact with a UniFi controller.
Uses the JSON interface on port... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Functions used by dax_tools like in dax_upload/dax_test/dax_setup.
"""
from collections import OrderedDict
import ConfigParser
import csv
from datetime import datetime
from email.mime.text import MIMEText
import getpass
import glob
import imp
import json
import loggin... |
import six
from easy_thumbnails.conf import settings
class Aliases(object):
"""
A container which stores and retrieves named easy-thumbnail options
dictionaries.
"""
def __init__(self, populate_from_settings=True):
"""
Initialize the Aliases object.
:param populate_from_... |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import subprocess
import sys
import tempfile
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))... |
# -*- coding: utf-8 -*-
import os
import re
import io
import sys
import json
import hashlib
import zipfile
try:
from fontTools import ttLib
except ImportError:
ttLib = None
from urllib.request import urlopen
import distutils.cmd
import distutils.log
HERE = os.path.abspath(os.path.dirname(__file__))
def re... |
# -*- coding: utf-8 -*-
"""
pyvisa-py.session
~~~~~~~~~~~~~~~~~
Base Session class.
:copyright: 2014 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from __future__ import division, unicode_literals, print_function, absolute_import
import abc... |
# -*- coding: utf-8 -*-
#
# Author: François Rossigneux <francois.rossigneux@inria.fr>
#
# 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
#
# Unles... |
import datetime
import re
import time
import dateutil
from dateutil import parser
from funcy import contextmanager, decorator
from werkzeug.contrib.cache import SimpleCache
@contextmanager
def timeit():
t1 = time.time()
yield
print("Time Elapsed: %.2f" % (time.time() - t1))
@decorator
def simple_cache... |
#!/usr/bin/python
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
BOT_ASSIGNMENT = {
##################################################################... |
"""
shapefile.py
Provides read and write support for ESRI Shapefiles.
author: jlawhead<at>geospatialpython.com
version: 2.1.0
Compatible with Python versions 2.7-3.x
"""
__version__ = "2.1.0"
from struct import pack, unpack, calcsize, error, Struct
import os
import sys
import time
import array
import t... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from time import sleep
import paramiko
import socket
import re
from slugify import slugify as slugify_function
from django.contrib.auth.models import User
from django.http import HttpResponse
import json
import logging
import subprocess
im... |
# -*- coding: utf-8 -*-
"""
pyvisa-py.session
~~~~~~~~~~~~~~~~~
Base Session class.
:copyright: 2014 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
from __future__ import division, unicode_literals, print_function, absolute_import
import abc... |
"""
Created on 6th September 2017
:author: Alan Greer
"""
import json
import logging
from odin_data.ipc_tornado_client import IpcTornadoClient
from odin_data.util import remove_prefix, remove_suffix
from odin.adapters.adapter import ApiAdapter, ApiAdapterResponse, request_types, response_types
from tornado import esca... |
from StringIO import StringIO
from xml4h.impls.interface import _XmlImplAdapter
from xml4h import nodes
try:
import xml.dom
import xml.dom.minidom
except ImportError:
pass
class XmlDomImplAdapter(_XmlImplAdapter):
@classmethod
def is_available(cls):
try:
xml.dom.Node
... |
"""
Django settings for wedding project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
im... |
# -*- coding: utf-8 -*-
"""
pyvisa-sim.devices
~~~~~~~~~~~~~~~~~~
Classes to simulate devices.
:copyright: 2014 by PyVISA-sim Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
try:
import Queue as queue
except ImportError:
import queue
import stringp... |
# Debian packaging tools: Automated tests.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: January 27, 2017
# URL: https://github.com/xolox/python-deb-pkg-tools
"""Test suite for the `deb-pkg-tools` package."""
# Standard library modules.
import functools
import logging
import os
import random
import ... |
# Copyright (c) 2015 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import logging
import o... |
# -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
# (C) Pywikibot team, 2008-2020
#
# Distributed under the terms of the MIT license.
#
import atexit
import datetime
import math
import re
import threading
import time
from contextlib import suppress
from decimal import Decimal
from qu... |
import yaml
from .errors import ConfigError
class ConfigLoader(object):
config_root_class = None
def __init__(self, config_text, context={}, *args, **kwargs):
assert self.config_root_class is not None
self.config_text = config_text
self.config_dict = None
self.config_root = ... |
# -*- coding: utf-8 -*-
import numpy as np # type: ignore
from PIL import Image # type: ignore
import matplotlib.cm # type: ignore
def format_as_image(expl,
interpolation=Image.LANCZOS,
colormap=matplotlib.cm.magma,
alpha_limit=0.65,
):
""" Format a :class:`eli5.base.Explanation` object as an ima... |
"""
Methods for representing and manipulating transects
in xarray datasets.
Transects being a dataset with the form
x(s), y(s), z(s,k) or z(k)
u(s,k), v(s,k), etc.
where x(s),y(s) describes a polyline.
names are somewhat standardized, but can generally be provided
U: vector valued velocity in geographic coordinate ... |
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import serializers
from rest_framework import generics
from rest_framework import viewsets
from rest_framework.decorators import detail_route, list_route
from rest_f... |
# -*- coding: utf-8 -*-
"""
Interface functions to Mediawiki's api.php
"""
#
# (C) Pywikipedia bot team, 2007
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id: $'
import urllib
import http
import simplejson as json
import warnings
class APIError(Exception):
"""The wiki site returned an e... |
import unittest
from pydal import DAL, Field
from pydal.validators import IS_NOT_IN_DB
from pydal.restapi import RestAPI, ALLOW_ALL_POLICY, DENY_ALL_POLICY, __version__
class TestRestAPI(unittest.TestCase):
def setUp(self):
db = DAL('sqlite:memory')
db.define_table('color', Field('name', require... |
'''
Created on Oct 23, 2014
@author: Itay Moav
'''
import app.iterator
import os
import config
from app import logging as L
class Install(app.iterator.AssetFilesDBConn):
def iterate(self):
'''
Main iteration processor bala bala
'''
# NOTICE! assets folder is not tested for as the... |
from __future__ import absolute_import
import logging
import time
from datetime import datetime
from hashlib import md5
from django.conf import settings
from django.db.models.loading import get_model
from ella.core.cache.utils import get_cached_objects
from ella.core.managers import ListingHandler
log = logging.get... |
# -*- coding: utf-8 -*-
"""
Interface functions to Mediawiki's api.php
"""
#
# (C) Pywikipedia bot team, 2007-08
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
from UserDict import DictMixin
from datetime import datetime, timedelta
import simplejson as json
import logging
import re
import ... |
import discord
from discord.ext import commands
import requests
from .utils.dataIO import dataIO, fileIO
from cogs.utils import checks
class shop:
"""Legend Family Shop for credits"""
def __init__(self, bot):
self.bot = bot
self.banks = dataIO.load_json('data/economy/bank.json')
self.c... |
from hashlib import md5
import logging
from django.dispatch import receiver
from django.db.models import ObjectDoesNotExist
from django.db.models.loading import get_model
from django.db.models.signals import post_save, post_delete
from django.core.cache import cache
from django.core.cache.backends.dummy import DummyCa... |
import unittest
import picopayments
SPEND_SECRET_HASH = "a7ec62542b0d393d43442aadf8d55f7da1e303cb"
SCRIPT_TEXT = (
"OP_IF OP_2 0389bdba52b9820a4d672bbb14b6c01aa54963cc0f1419b14a01e9e"
"beb62ebef1f 0327f017c35a46b759536309e6de256ad44ad609c1c4aed0e2cdb8"
"2f62490f75f8 OP_2 OP_CHECKMULTISIG OP_ELSE OP_IF OP_... |
# -*- coding: utf-8 -*-
"""Storj command-line interface package."""
import os
import click
import ConfigParser
from storj.http import Client
APP_NAME = 'storj'
CFG_EMAIL = 'storj.email'
CFG_PASSWORD = 'storj.password'
def get_client():
"""Returns a pre-configured Storj HTTP client.
Returns:
(:py... |
"""
API classes for content (text, data, autdio, video, packages) resources.
"""
from __future__ import absolute_import
import poster.encode
from . import base
from . import links
from .schemes import PricingScheme, RightsScheme
from .orgs import Org
from .categories import Category
class User(object):
"""
A... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import six
import sys
import h5py
import numpy as np
import os
from collections import OrderedDict
import pandas as pd
import json
import skimage.io as sio
from PIL import Image
import copy
import glob
import a... |
from PIL import Image, ExifTags
from ella.photos.conf import photos_settings
TAGS = dict((b,a) for a,b in ExifTags.TAGS.items())
class Formatter(object):
def __init__(self, image, format, crop_box=None, important_box=None):
self.image = image
self.fmt = format
self.crop_box = crop_box
... |
# -*- coding: utf-8 -*-
""" IntelMQ parser for Netlab 360 data feeds. """
from intelmq.lib.bot import ParserBot
from intelmq.lib.harmonization import DateTime
class Netlab360ParserBot(ParserBot):
DGA_FEED = {'http://data.netlab.360.com/feeds/dga/dga.txt'}
MAGNITUDE_FEED = {'http://data.netlab.360.com/feeds/e... |
import sys
import requests
import logging
import ssl
import json
import time
import pkg_resources
from requests.adapters import HTTPAdapter
from datetime import datetime
try:
from requests.packages.urllib3.poolmanager import PoolManager
except ImportError:
from urllib3.poolmanager import PoolManager
from qds_sd... |
"""
Support for the public-facing portion of web applications.
"""
from zope.interface import implements
from twisted.internet import defer
from nevow import inevow, rend
from axiom import item, attributes, upgrade
from xmantissa import ixmantissa, website, publicresource
class PublicWeb(item.Item, website.Prefi... |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Intercompany Trade - Account',
'version': '1.0',
'category': 'Intercompany Trade',
... |
import numpy as np
def average_cell(traj):
axesl = [atoms.get_cell() for atoms in traj]
axes = np.mean(axesl, axis=0)
return axes
def average_frames(traj):
"""Average atomic positions from a segment of MD trajectory.
Assume atomic displacement between frames < L/2.
Args:
list: list of ASE Atoms
Ret... |
# Standard libs
from collections import defaultdict
from datetime import datetime
from dateutil import tz
import math
import os
# Our libs
from .database import Database
# Constants
LOCAL_TIMEZONE = os.getenv('TZ', 'America/Los_Angeles')
class MongoDocument(object):
database = Database
COLLECTION = ''
@... |
# -*- coding: utf-8 -*-
import os
import unittest
import string
import random
import urllib
try:
import zlib as binascii
except ImportError:
import binascii
import cStringIO
from qiniu import conf
from qiniu import rs
from qiniu import io
conf.ACCESS_KEY = os.getenv("QINIU_ACCESS_KEY")
conf.SECRET_KEY = os.getenv("... |
# Copyright (c) 2016 Intracom S.A. Telecom Solutions. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0 which accompanies this distribution,
# and is available at http://www.eclipse.org/legal/epl-v10.html
""" Oftraf Class- All o... |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
# -*- coding: utf-8 -*-
"""
xobox.utils.dynamic
~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2017 by the Stormrose Project team, see AUTHORS.
:license: MIT License, see LICENSE for details.
"""
from collections import UserDict
class Dynamic(object):
"""
Dynamic class generating properties from... |
import os
import sys
import argparse
import ConfigParser
import time
import requests
import urllib3
import socket
import smtplib
# from email.mime.text import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
paths = [
'/srv'
]
for path in paths:
if path not in sys.pat... |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
import re
import string
from .pathfeatures import PathFeature, PATH_PATTERN
from .util import ReadableException
class Constraint(PathFeature):
"""
A class representing constraints on a query
===========================================
All constraints inherit from this class, which
simply defines t... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# QTPyLib: Quantitative Trading Python Library
# https://github.com/ranaroussi/qtpylib
#
# Copyright 2016 Ran Aroussi
#
# Licensed under the GNU Lesser General Public License, v3.0 (the "License");
# you may not use this file except in compliance with the License.
# You m... |
#!/usr/bin/env python2.7
from sts.util.procutils import kill_procs
from sts.control_flow import Fuzzer
from sts.simulation_state import SimulationConfig
import signal
import sys
import argparse
import logging
import logging.config
description = """
Run a simulation.
Example usage:
$ %s -c config.fat_tree
""" % (sy... |
"""
Django settings for qually_dj project.
Generated by 'django-admin startproject' using Django 1.10.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import ... |
#
# The Qubes OS Project, https://www.qubes-os.org/
#
# Copyright (C) 2015 Joanna Rutkowska <joanna@invisiblethingslab.com>
# Copyright (C) 2013-2015 Marek Marczykowski-Górecki
# <marmarek@invisiblethingslab.com>
# Copyright (C) 2015 Wojtek Porczyk <woju@invisiblethingslab.com>
#
# This ... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2021 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.
"""Community schema."""
import re
from uuid import UUID
from flask_babelex import l... |
# -*- encoding: utf8 -*-
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2015-2016 Wojtek Porczyk <woju@invisiblethingslab.com>
# Copyright (C) 2016 Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
# Copyright (C) 2017 Marek Marczykowski-Górecki
# <marmarek@invisib... |
#!/usr/bin/env python
'''
@author Luke Campbell <lcampbell@asascience.com>
@file pyon/ion/replayagent.py
@description Implementation for the Replay Agent
'''
from pyon.ion.endpoint import StreamPublisherRegistrar
from interface.services.dm.ireplay_agent import BaseReplayAgent
from pyon.public import log
from pyon.data... |
"""
quilt.QuiltingRoom
Main module to quilt a static site by stitching html page together
{: .lead}
1. set `source` to users directory containing the [appropriate files](#exampledir) (default output is `quilted_` + `source`)
2. read `config.json` and override [default configuration](#configuration)
3. load quilt file... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import logging
import datetime
import random
from flask import url_for, current_app, redirect, request
from flask.ext.mistune import markdown
from quokka.core import TEXT_FORMATS
from quokka.core.db import db
from quokka.core.fields import MultipleObjectsRetur... |
# Copyright (c) 2013, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import cybox
import cybox.bindings.win_executable_file_object as win_executable_file_binding
from cybox.objects.win_file_object import WinFile
from cybox.common.digitalsignature import DigitalSignature
from cybox.co... |
import logging
import logging.config
import functools
import re
import os
import json
import sys
import random
import rq
import redis
import requests
from flask import Flask, request, g, session, redirect, jsonify, Response
from flask.ext.github import GitHub, GitHubError
from rabix import CONFIG
from rabix.common.ut... |
#!/usr/bin/python3
import errno
import json
import os
import os.path
import re
import shlex
import shutil
import subprocess
import sys
import tempfile
if any(s == "--help" for s in sys.argv):
print("""Usage:
GenerateFlowTestCase.py specsToTest.csv projectPom.xml outdir [--force]
This generates test cases exercis... |
__version__ = (1, 4, 0, 'alpha', 0)
|
'''
Classes for representing and manipulating Datalog programs.
In particular, they can be compiled to (iterative) relational algebra expressions.
'''
import networkx as nx
import raco.boolean
import raco.algebra
import raco.scheme
import raco.catalog
class Program:
def __init__(self, rules):
self.rules = rule... |
import random
import string
import os
from subprocess import check_call
from c_index_strings import indexing
def get_name(basename, fields):
return basename + str(fields)
def generate_random_int(basename, fields, tuples, datarange):
random.seed(1)
fn = get_name(basename, fields)
with open(fn, 'w') a... |
from __future__ import unicode_literals
from __future__ import division
import hashlib
import json
import logging
import math
import os.path
import re
from collections import defaultdict
from dirtyfields import DirtyFieldsMixin
from six.moves import reduce
from six.moves.urllib.parse import (urlencode, urlparse)
fro... |
#!/usr/bin/env python
import re
from sys import argv
def enum(**enums):
return type('Enum', (), enums)
def word_number_split(word):
match = re.match(r"([a-z]+)([0-9]+[A-Z]*$)", word, re.I)
if match:
items = match.groups()
else:
items = [word]
return list(items)
def is_course_word(word):
if re.match(... |
import os
import time
import sys
import binascii
import unittest
sys.path.insert(0, os.path.abspath('..'))
from py8583 import *
class AsciiParse1987(unittest.TestCase):
def setUp(self):
self.IsoPacket = py8583.Iso8583(IsoSpec = py8583spec.IsoSpec1987ASCII())
self.IsoPacket.Strict(True)
... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""
Generator of histology report
"""
import logging
logger = logging.getLogger(__name__)
import argparse
# import sys
import numpy as np
# import traceback
import copy
import time
def removeFromOneAxis():
pass
def writeFile(filename, vertexes, faces):
with op... |
import sys
import math
from PyQt4 import QtGui
from PyQt4.QtCore import Qt
import numpy as np
import sklearn.cross_validation as skl_cross_validation
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting
from Orange.data import Table
from Orange.data.sql.table import SqlTable
class OWD... |
import nested_admin
from django import forms
from django.contrib import admin
from django.db import models
from django.urls import reverse_lazy
from callisto_core.wizard_builder.models import (
Choice, ChoiceOption, FormQuestion,
)
class ChoiceOptionInline(nested_admin.NestedStackedInline):
extra = 0
mo... |
#!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
import mdtraj as md
def check_atoms_ok(top0, top1, atoms):
"""Check if two topologies are equal on an atom level"""
genatom = (top0.atom(i) == top1.atom(i) for i in atoms)
# This needs try except in case one topology does not have the atom index
try:
all_atoms_ok = all(genatom)
except Inde... |
import collections
import datetime
import hashlib
import json
import logging
import os.path
import urllib
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Sum, Prefetch
from django.d... |
# Authors: Paulius Sarka <paulius.sarka@gmail.com>
#
# Based on sklearn/tree/tree.py (BSD 3 clause)
#
# Licence: BSD 3 clause
from abc import ABC
from abc import abstractmethod
from math import ceil
import numbers
import numpy as np
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..base impor... |
#!/usr/bin/python
#
""" read from the arxiv search API or RSS feed
read a list of tag names from a text file
and create a webpage that allows you to tag preprints with
javascript buttons or similar, and write the tagging data to a text file
Requires feedparser - pip install feedparser
arxiv_fortune_cookie is a simpli... |
from six import string_types
from six.moves import xrange
from py_stringmatching import utils
from py_stringmatching.tokenizer.definition_tokenizer import DefinitionTokenizer
class QgramTokenizer(DefinitionTokenizer):
"""Returns tokens that are sequences of q consecutive characters.
A qgram of an input ... |
#!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
from django.shortcuts import render
from django.db.models import Q, F, Prefetch, Avg, StdDev
from django.db.models.functions import Concat
from django.views.decorators.cache import cache_page
from django.core.cache import cache
from django.db import connection
from collections import defaultdict
from django.conf impor... |
import rdflib
import six
from .graphObject import GraphObject
class PropertyValue(GraphObject):
""" Holds a literal value for a property """
def __init__(self, value):
super(PropertyValue, self).__init__()
if not isinstance(value, rdflib.term.Identifier):
self.value = rdflib.Litera... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 XCG Consulting (www.xcg-consulting.fr)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
# -*- coding: utf-8 -*-
"""API test module."""
#
# (C) Pywikibot team, 2007-2019
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
from collections import defaultdict
import datetime
import types
import pywikibot.data.api as api
import pywikibot.f... |
"""Portal view functions (i.e. not part of the API or auth)"""
from celery.result import AsyncResult
from flask import current_app, Blueprint, jsonify, render_template
from flask import abort, make_response, redirect, request, session, url_for
from flask import render_template_string
from flask_babel import gettext as ... |
# A Segment is the building block of Sequence Class. They are responsible
# for resolving pulse timing, Z gates, generating trigger pulses and adding
# charge compensation
#
# author: Michael Kerschbaum
# created: 4/2019
import numpy as np
import math
import logging
log = logging.getLogger(__name__)
from copy import d... |
import os
import common
import unittest
import pyuv
BAD_FILE = 'test_file_bad'
TEST_FILE = 'test_file_1234'
TEST_FILE2 = 'test_file_1234_2'
TEST_LINK = 'test_file_1234_link'
TEST_DIR = 'test-dir'
BAD_DIR = 'test-dir-bad'
class FSTest(common.UVTestCase):
def setUp(self):
self.loop = pyuv.Loop.default_l... |
'''This plugin controls a linter meant to work in the background
and to provide information as a file is edited.
It requires that the user setting "sublimelint" be set to true
to be activated - or, alternatively, that the user runs the command
view.run_command("lint", "on")
Questions: andre.roberge (at) gmail.com
'''... |
import sys
from PyFBA import lp
def reaction_bounds(reactions, reactions_to_run, media, lower=-1000.0, mid=0.0, upper=1000.0, verbose=False):
"""
Set the bounds for each reaction. We set the reactions to run between
either lower/mid, mid/upper, or lower/upper depending on whether the
reaction runs <=... |
import requests
import json
from celery.task import Task
from celery.utils.log import get_task_logger
from celery.exceptions import SoftTimeLimitExceeded
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Max
from go_http.metrics import MetricsApiClient... |
#!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
#!/usr/bin/python
import ctypes
import os
from time import time
from errno import errorcode
class MessageQueueError(Exception):
"""Base error class for problems from the underlying library."""
class Timeout(MessageQueueError):
"""Exception for tiemouts on send, recv operations."""
class MessageQueueAttribut... |
# -*- Mode: Python; py-indent-offset: 4 -*-
# coding=utf-8
# vim: tabstop=4 shiftwidth=4 expandtab
import sys
import pygtk
pygtk.require("2.0")
import unittest
from gi.repository import GObject
import gobject
from gi.repository import GIMarshallingTests
if sys.version_info < (3, 0):
CONSTANT_UTF8 = "const \xe2\... |
# Copyright 2011 James McCauley
# Copyright 2008 (C) Nicira, Inc.
#
# This file is part of POX.
#
# POX 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... |
from __future__ import absolute_import, unicode_literals
import json
from django import forms, VERSION
from django.contrib.admin.checks import InlineModelAdminChecks, ModelAdminChecks
from django.contrib.admin.options import ModelAdmin, StackedInline
from django.contrib.admin.utils import flatten_fieldsets
from djang... |
import responses
import json
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from django.contrib.auth.models import User
from django.test import TestCase
from django.db.models.signals import post_save
from django.conf import settings
from rest_framework import status
... |
#!/usr/lib/env python
import sys
import os
import cv2
from emotionpi import emotion_api
import pyimgur
import random
import time
import numpy as np
class PartyPi(object):
def __init__(self, piCam=False, resolution=(1280 / 2, 1024 / 2), windowSize=(1200, 1024)):
self.piCam = piCam
self.windowSize ... |
#!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
'''
Copyright 2013 Raytheon BBN Technologies
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 writing... |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2021 PyMeasure Developers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... |
# -*- coding: utf-8 -*-
#
# Subliminal - Subtitles, faster than your thoughts
# Copyright (c) 2011 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of Subliminal.
#
# Subliminal is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published b... |
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from waldo.go.models import Term
import waldo.go.load
import waldo.go.go
def test_is_cellular_component():
engine = create_engine('sqlite://')
metadata = waldo.go.models.Base.metadata
metadata.bind = engine
metadata.create_all... |
# Copyright 2012 James McCauley
# Copyright 2008 (C) Nicira, Inc.
#
# This file is part of POX.
#
# POX 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... |
#!/usr/lib/env python
import sys
import os
import cv2
from emotionpi import emotion_api
import pyimgur
import random
import time
import numpy as np
class PartyPi(object):
def __init__(self, piCam=False, resolution=(1280 / 2, 1024 / 2), windowSize=(1200, 1024)):
self.piCam = piCam
self.windowSize ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.