text stringlengths 17 737k |
|---|
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/graph.ui'
#
# Created: Mon Dec 31 15:23:35 2012
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attrib... |
import numpy as np
from scipy.ndimage import grey_opening
from common import WhittakerSmoother, Baseline
def mpls_baseline(intensities, smoothness_param=100, deriv_order=1,
window_length=100):
'''Perform morphological weighted penalized least squares baseline removal.
* paper: DOI: 10.1039/C3AN0... |
#===============================================================================
# Copyright 2007 Matt Chaput
#
# 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... |
from skimage.measure import ransac
from skimage.transform import AffineTransform
import pandas as pd
import numpy as np
import argparse
def landmark_registration(points_file1, points_file2, out_file, residual_threshold=2, max_trials=100, delimiter="\t"):
points1 = pd.read_csv(points_file1, delimiter=delimiter)
... |
from lightsweeper import wait
from lightsweeper import Move
from LSRealTile import LSRealTile
from LSRealTile import LSOpen
from LSEmulateTile import EmulateTile
from LSFloorConfigure import LSFloorConfig
from LSFloorConfigure import userSelect
import Colors
import Shapes
import sys
import time
import os
import rand... |
#
# Copyright (C) 2018-2019 - Dr. Maha Farhat
#
# 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 ... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
# Copyright 2021 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# pylint: disable=no-self-argument
# flake8: noqa
import graphene
from . import assembly_category
from .abstract import AbstractObject
class AbstractPowerLevel(AbstractObject):
name = graphene.String(required=True)
... |
# -*- coding: utf-8 -*-
# Author : Kowonsik, github.com/kowonsik
# Author : Jeonghoonkang, github.com/jeonghoonkang
import serial,os,time
|
# -*- coding: utf-8 -*-
import json
import time
from mock import patch
from nailgun.settings import settings
import nailgun
import nailgun.rpc as rpc
from nailgun.task.manager import DeploymentTaskManager
from nailgun.task.fake import FAKE_THREADS
from nailgun.errors import errors
from nailgun.test.base import BaseH... |
from django.template.loader import render_to_string
from django.utils.importlib import import_module
from pressgang.actions.options import Option, Options
from pressgang.utils.registry import create_registry
SiteOptionRegistry = create_registry('id')
class SiteOption(Option):
"""Base class for a single site option... |
from . import nfsstat
NfsStatCheck = nfsstat.NfsStatCheck
__version__ = "0.1.1"
__all__ = ['nfsstat']
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
# © 2018 FactorLibre - Álvaro Marcos <alvaro.marcos@factorlibre.com>
from openerp import models, api, fields
import datetime
import time
class ProductProduct(models.Model):
_inherit = 'product.product'
average_consumption_pvi = fields.Float("Av... |
from __future__ import division, print_function
import unittest
import warnings
import sympy
import types
import numpy as np
from symfit.api import *
from symfit.core.fit import *
from symfit.distributions import Gaussian
import matplotlib.pyplot as plt
import seaborn
class TestODE(unittest.TestCase):
"""
T... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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... |
"""
********
Overview
********
The ``synapseclient`` package provides an interface to `Synapse <http://www.synapse.org>`_, a collaborative workspace
for reproducible data intensive research projects, providing support for:
- integrated presentation of data, code and text
- fine grained access control
- provenance_ tr... |
#!/usr/bin/env python
import os, sys
import pexpect
import geom
from sfe.fem.mesh import Mesh
try:
from site_cfg import tetgen_path
except ImportError:
tetgen_path = '/usr/bin/tetgen'
def mesh():
if len( sys.argv ) == 3:
geomFileName = sys.argv[1]
vtkFileName = sys.argv[2]
else:
... |
import re
import sys
from OpenSSL import crypto
from pandaserver.taskbuffer import JobUtils
# get prefix for DQ2
def getDQ2Prefix(dq2SiteID):
try:
# prefix of DQ2 ID
tmpDQ2IDPrefix = re.sub('_[A-Z,0-9]+DISK$','',dq2SiteID)
# remove whitespace
tmpDQ2IDPrefix = tmpDQ2IDPrefix.strip()
... |
import json
import tangelo
import itertools
import cache
from utils import *
def convert(value, type):
if type == "tinyint":
return int(value)
elif type == "int":
return int(value)
elif type == "double":
return float(value)
elif type == "string":
return value
elif ty... |
################################################################################################################
## This is the implementation of the Multicorn ForeignDataWrapper class as an interface to the Philips Hue system
##
## We set up these endpoints:
## * Lights
## * Config
## * Sensors
## as separate cl... |
# -*- coding: utf-8 -*-
"""
MCLevel interfaces
Sample usage:
import mclevel
# Call mclevel.fromFile to identify and open any of these four file formats:
#
# Classic levels - gzipped serialized java objects. Returns an instance of MCJavalevel
# Indev levels - gzipped NBT data in a single file. Returns an MCIndevLev... |
import collections
import functools
import itertools
import operator
from contextlib import suppress
from typing import Any, Dict, List
import numpy as np
import toolz
from cached_property import cached_property
import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
import ibis.expr.rules as rlz
import... |
from __future__ import division
from django.db import models
import reversion
from django.contrib import admin
from reversion.admin import VersionAdmin
class Source(models.Model):
TYPE_CHOICES = (
("P", "Publication"),
("U", "URL"),
("E", "Expert"),
)
RELIABILIT... |
"""TODO: module-level docstring."""
__authors__ = "Pascal Lamblin and Razvan Pascanu"
__copyright__ = "Copyright 2010-2013, Universite de Montreal"
__credits__ = ["Pascal Lamblin", "Razvan Pascanu", "Ian Goodfellow", "Mehdi Mirza"]
__license__ = "3-clause BSD"
__maintainer__ = "Pascal Lamblin"
__email__ = "lamblinp@iro... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# auth: Philip J Grabner <grabner@cadit.com>
# date: 2014/05/07
# copy: (C) Copyright 2014-EOT Cadit Inc., All Rights Reserved.
#--------------------------------------------------------------------------... |
# Copyright 2017 Max Planck Society
# Distributed under the BSD-3 Software license,
# (See accompanying file ./LICENSE.txt or copy at
# https://opensource.org/licenses/BSD-3-Clause)
"""Class responsible for vizualizing and evaluating trained models.
"""
import os
import logging
import tensorflow as tf
import matplotli... |
"""Development settings and globals."""
from os.path import join, normpath, realpath, dirname
from base import *
########## DEBUG CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = False
ALLOWED_HOSTS = ['*']
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-deb... |
# -*- coding: utf-8 -*-
from pywikibot import family
__version__ = '$Id$'
#Family file for the original wikivoyage
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'oldwikivoyage'
self.langs = {
'de': u'www.wikivoyage-old.org',
... |
"""
Queue backend abstraction manager.
"""
import logging
import qcengine
import traceback
import json
from ..web_handlers import APIHandler
from ..interface import schema
class QueueNanny:
"""
This object maintains a computational queue and watches for finished jobs for different
queue backends. Finish... |
'''
@ Harris Christiansen (Harris@HarrisChristiansen.com)
January 2016
Generals.io Automated Client - https://github.com/harrischristiansen/generals-bot
Bot_blob: Creates a blob of troops.
'''
import logging
import random
import threading
import time
import client.generals as generals
from viewer import GeneralsV... |
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Breakpad for Python.
Sends a notification when a process stops on an exception."""
import atexit
import getpass
import urllib
import traceback
impor... |
# pylint: disable=too-few-public-methods,too-many-arguments,too-many-instance-attributes
from typing import TYPE_CHECKING
from eth_utils import encode_hex, to_canonical_address, to_checksum_address
from raiden.transfer.architecture import State
from raiden.transfer.state import (
EMPTY_MERKLE_ROOT,
BalancePro... |
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import uuid
from couchdbkit.exceptions import ResourceNotFound
from django.test.testcases import TestCase
from mock import patch
from corehq.apps.app_manager.exceptions import AppEditingError
from corehq.apps.app_manager.models i... |
from django.views.generic import CreateView
from sensordatainterface.base_views import *
from sensordatainterface.forms import *
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.contrib import messages
from copy import deepcopy
from django import forms
from datetime ... |
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Backend.Backend import Backend
from UM.Application import Application
from UM.Scene.SceneNode import SceneNode
from UM.Preferences import Preferences
from UM.Signal import Signal
from UM.Logger import Logger
from UM... |
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# 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... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Openstack, LLC.
# 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
# ... |
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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
#
# ... |
from __future__ import print_function, division, absolute_import
import numpy
import math
import sys
import itertools
from collections import namedtuple
from llvm.core import Constant, Type, ICMP_UGT
from .imputils import implement, Registry
from .. import typing, types, cgutils, numpy_support
from ..config import ... |
# -*- coding: utf-8 -*-
from openerp.report import report_sxw
from openerp.tools.translate import _
from osv import osv
from report_webkit.webkit_report import WebKitParser
class payment_notice_parser(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(payment_notice_parser, self).... |
"""Array printing function
$Id: arrayprint.py,v 1.9 2005/09/13 13:58:44 teoliphant Exp $
"""
from __future__ import division, absolute_import, print_function
__all__ = ["array2string", "array_str", "array_repr", "set_string_function",
"set_printoptions", "get_printoptions", "format_float_positional",
... |
"""
Implementation of optimized einsum.
"""
from __future__ import division, absolute_import, print_function
from numpy.core.multiarray import c_einsum
from numpy.core.numeric import asarray, asanyarray, result_type
__all__ = ['einsum', 'einsum_path']
einsum_symbols = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST... |
import libtcodpy as libtcod
import math
import time
from random import randint
from random import uniform
WORLD_WIDTH = 65
WORLD_HEIGHT = 65
SCREEN_WIDTH = 65
SCREEN_HEIGHT = 65
INITIAL_CIVS = 1
CIV_MAX_SITES = 10
MAX_SITE_POP = 20000
#################################################################... |
#!/usr/bin/python
import curses, time, sys, os
from threading import Thread
class PyClock(object):
# kBLOCK = '\033[7m'
# kRESET = '\033[0m'
# kCLEAR = '\033[2J\033[;H'
kCHAR_HEIGHT = 5
kCHAR_WIDTH = 4
kPUN_INDEX = 10
kSQUARE = " "
# default,grey,red,green,yellow,blue,purple,cyan,whit... |
"""
Authenticator to use GitHub OAuth with JupyterHub
"""
import json
import os
import re
import string
import warnings
from tornado.auth import OAuth2Mixin
from tornado import web
from tornado.httputil import url_concat
from tornado.httpclient import HTTPRequest, AsyncHTTPClient, HTTPError
from jupyterhub.auth im... |
#!/usr/bin/env python
"""
A Minicom like shell in Python
author: Carlo Lobrano
Usage:
pynicom [-d|--debug] [--port=port --baud=rate --bytesize=bytesize --parity=parity --stopbits=stopbits --sw-flow-ctrl=xonxoff --hw-rts-cts=rtscts --hw-dsr-dtr=dsrdtr --timeout=timeout] [--atcmd=atcmd]
"""
__version__ = "0.3.2"
f... |
# -*- coding: utf-8 -*-
#
# ocfis.py
#
# purpose: Some misc PO functions
# author: Filipe P. A. Fernandes
# e-mail: ocefpaf@gmail
# web: http://ocefpaf.tiddlyspot.com/
# created: 09-Sep-2011
# modified: Thu 18 Apr 2013 12:24:30 PM BRT
#
# obs:
#
from __future__ import division
import numpy as np
import num... |
import os
import time
from pathlib import Path
import pandas as pd
from Datasnakes.Orthologs.CompGenetics import CompGenAnalysis
from Datasnakes.Manager.logit import LogIt
import pkg_resources
import shutil
from Datasnakes.Manager import index
class BLASTAnalysis(CompGenAnalysis):
"""Perform Blast Analysis after c... |
#!/usr/bin/env python
# Copyright 2016,2019 Red Hat, 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... |
from collections import namedtuple
import os
import re
import jedi
from .structures import *
from .util import normalize
def _debug_print_tree(node, indent=0, func=repr):
""" Print visual representation of Jedi AST. """
ret = "\t" * indent + func(node) + "\n"
children = getattr(node, "children", None)
... |
import os
from re import compile as re, M
from datetime import datetime
import json
import logging
import psycopg2
from tornado import ioloop, log, web
from .alerts import BaseAlert
from .utils import parse_interval
from .handlers import registry
LOGGER = log.gen_log
COMMENT_RE = re('//\s+.*$', M)
class Reactor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date: 2015-10-16 12:52:35
# @Last Modified by: oesteban
# @Last Modified time: 2015-10-16 15:05:27
import os
import os.path as op
import time
import argparse
import yaml
from nipype import logging
logger = logging.getLogger('workflow')
class QAProtocolCLI:
"""... |
from __future__ import absolute_import
__author__ = 'chris'
import json
import errno
import os
import re
import sys
import six
import uuid
import traceback
from operator import itemgetter
from collections import OrderedDict, defaultdict
from pkg_resources import parse_version
from django.conf import settings
from djan... |
from weakref import ref
from decimal import Decimal
import re
import datetime
import traceback, sys
import threading
from kivy.app import App
from kivy.cache import Cache
from kivy.clock import Clock
from kivy.compat import string_types
from kivy.properties import (ObjectProperty, DictProperty, NumericProperty,
... |
# -*- coding: UTF-8
# config
# ******
#
# Configuration file do not contain GlobaLeaks Node information, like in the 0.1
# because all those infos are stored in the databased.
# Config contains some system variables usable for debug,
import os
import sys
import shutil
import traceback
import logging
import transac... |
from __future__ import absolute_import
from celery.signals import setup_logging
import orchestrator.logger
__version__ = '0.3.8'
__author__ = 'sukrit'
orchestrator.logger.init_logging()
setup_logging.connect(orchestrator.logger.init_celery_logging)
|
##########################################################################
#
# MRC FGU Computational Genomics Group
#
# $Id$
#
# Copyright (C) 2009 Tildon Grant Belgard
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as publis... |
#SPDX-License-Identifier: MIT
""" Helper methods constant across all workers """
import requests
import datetime
import time
import traceback
import json
import os
import sys
import math
import logging
import numpy
import copy
import concurrent
import multiprocessing
import psycopg2
import csv
import io
from logging im... |
# Copyright 2014 CloudFounders NV
#
# 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 writ... |
import getpass
import hashlib
import idiokit
from abusehelper.core import bot, events
from opencollab import wiki
def normalize(value):
if value.startswith("[[") and value.endswith("]]"):
return value[2:-2]
return value
class OpenCollabReader(bot.FeedBot):
poll_interval = bot.IntParam(default=6... |
##########################################################################
#
# Copyright (c) 2018, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... |
#!/usr/bin/python
from __future__ import print_function, absolute_import
"""####################################################################
# GoodVibes.py #
# Evaluation of quasi-harmonic thermochemistry from Gaussian. #
# Partion functions are evalu... |
"""Define Wallace's core models."""
from datetime import datetime
from .db import Base
from sqlalchemy import ForeignKey, or_, and_
from sqlalchemy import Column, String, Text, Enum, Integer, Boolean, DateTime
from sqlalchemy.orm import relationship, validates
import inspect
DATETIME_FMT = "%Y-%m-%dT%H:%M:%S.%f"
... |
# -*- coding: utf-8 -*-
"""
"""
from __future__ import print_function, division
import time
import warthog.core
import warthog.exceptions
import warthog.transport
class WarthogCommandFactory(object):
def __init__(self, transport):
self._transport = transport
def get_session_start(self, scheme_host... |
"""Implementation module for socket operations.
See the socket module for documentation."""
AF_APPLETALK = 16
AF_DECnet = 12
AF_INET = 2
AF_INET6 = 23
AF_IPX = 6
AF_IRDA = 26
AF_SNA = 11
AF_UNSPEC = 0
AI_ADDRCONFIG = 1024
AI_ALL = 256
AI_CANONNAME = 2
AI_NUMERICHOST = 4
AI_NUMERICSERV = 8
AI_PASSIVE = 1... |
import logging
import traceback
import unicodedata
import sys
import time
from xclib.ejabberdctl import ejabberdctl
from xclib.utf8 import utf8, unutf8, utf8l
def sanitize(name):
name = str(name)
printable = {'Lu', 'Ll', 'Lm', 'Lo', 'Nd', 'Nl', 'No', 'Pc', 'Pd', 'Ps', 'Pe', 'Pi', 'Pf', 'Po', 'Sm', 'Sc', 'Sk', ... |
import json
import operator
import requests
import time
LIMIT = 20000
BADGELIMIT = 400
USERS = 'https://badges.fedoraproject.org/leaderboard/json?limit={limit}'.format(limit=LIMIT)
USER = 'https://badges.fedoraproject.org/user/{user}/json'
def data(url, count=1):
"""
For given URL, returns dictionary with ... |
#!/usr/bin/env python
"""
xmind.core.workbook
~~~~~~~~~~~~~~~~~~~
:mod:``xmind.core.workbook`` implements the command XMind
manipulations.
:copyright:
:license:
"""
__author__ = "woody@xmind.net <Woody Ai>"
from . import Document
from . import const
from .mixin import WorkbookMixinElement... |
from spack import *
class Graphviz(Package):
"""Graph Visualization Software"""
homepage = "http://www.graphviz.org"
url = "http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.38.0.tar.gz"
version('2.38.0', '5b6a829b2ac94efcd5fa3c223ed6d3ae')
# By default disable optional Perl lan... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyScipy(PythonPackage):
"""SciPy (pronounced "Sigh Pie") is a Scientific Library for Pytho... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
"""
Words and static data
Please extend this file with more lvl=100 shibe wow.
"""
KNOWN_PROCESSES = (
# wow shells and terminals and etc
'urxvt', 'tmux', 'fish', 'ssh', 'mutt', 'screen', 'mosh-client',
'Terminal', 'sh', 'bash', 'zsh', 'tcsh', 'csh',
# pretty browsers
'chromium', 'luakit', 'uzb... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
doitlive
~~~~~~~~
A tool for "live" presentations in the terminal.
:copyright: (c) 2014 by Steven Loria.
:license: MIT, see LICENSE for more details.
"""
from __future__ import unicode_literals
import datetime as dt
import functools
import os
import sys
imp... |
"""
Test for weights in GLM, Poisson and OLS/WLS, continuous test_glm.py
Below is a table outlining the test coverage.
================================= ====================== ====== ===================== === ======= ======== ============== ============= ============== ============= ============== ==== =========
Tes... |
# -*- coding: utf-8 -*-
class Csv2Rdf:
def __init__(self, filename):
self.filename = filename
def readInputFile(self):
f = open(self.filename, 'r', encoding="utf-8")
text = []
for line in f:
text.append(line)
f.close()
return text
def readText... |
#!/usr/bin/env python
#
# testcase.py: Control of test case execution.
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2004 CollabNet. All rights reserved.
#
# This ... |
from my_settings import *
import sys
import mne
from mne.minimum_norm import make_inverse_operator
subject = sys.argv[1]
fwd = mne.read_forward_solution(mne_folder + "%s-fwd.fif" % subject,
surf_ori=True)
cov = mne.read_cov(mne_folder + "%s-cov.fif" % subject)
epochs = mne.read_epochs(... |
import pickle
from django.contrib.contenttypes.models import ContentType
from UserDict import DictMixin
import hashlib
import decimal
CART_INDEX = 'cart'
class ItemAlreadyExists(Exception):
pass
class ItemDoesNotExist(Exception):
pass
class ItemIntegrityError(Exception):
pass
class CartIntegri... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Account Analytic Online, for OpenERP
# 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 GNU... |
# -*- coding: utf-8 -*-
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
""" This file organizes the different answers from each query result to load
"""
from pprint import pprint
from gso import search_google
import stackexchange
SE_KEY = os.environ["SE_KEY"]
so = stackexchange.Site(
stackexchange.StackOverflow,
app_key=SE_KEY)
so.impose_throttling = True
so.throttle_stop = Fa... |
#
# Copyright (c) 2015, Open-RnD Sp. z o.o. All rights reserved.
#
from __future__ import absolute_import
import dbus
import glib
from dbus.mainloop.glib import DBusGMainLoop
import logging
from uuid import uuid4
_log = logging.getLogger(__name__)
def _make_variant(string):
"""Convert Python string to DBus.S... |
# -*- coding: utf-8 -*-
import json
from collections import OrderedDict
from ..geodis_decoder_rest_ws import GeodisTrackingListApi, GeodisDecoderRestWs
from ..geodis_encoder_rest_ws import GeodisEncoderRestWs
from ..geodis_transport_rest_ws import GeodisTransportRestWs
def test_encode():
encoder = GeodisEncoder... |
# pylint: disable=E0401,C0111,R0903
import os
import re
import json
import platform
import subprocess
import threading
from urllib import request
from urllib.error import HTTPError
from urllib.error import URLError
from deoplete.source.base import Base
is_window = platform.system() == 'Windows'
import_re = r'requi... |
__version__ = '0.3.2'
|
from zebra.conf import defaults
from django.conf import settings as _settings
from django.conf import UserSettingsHolder
ush = UserSettingsHolder(_settings)
for attr in dir(defaults):
if attr.upper().startswith('ZEBRA') or attr.upper().startswith('STRIPE'):
if not hasattr(ush, attr):
setattr(us... |
# encoding=utf8
__author__ = 'cadu'
from models import Feed, Magazine, Category, User, UserFavorite, Administrator, CoverArticle, PROFILE_OPTIONS
from serializers import AdministratorSerializer, MagazineSerializer, CategorySerializer, CoverArticleSerializer
from django.http import HttpResponse
from rest_framework.view... |
#!/usr/bin/env python
__author__ = 'Omry_Nachman'
from beheaviors import Scheduler, ConditionHandler
from sensors import SensorWithPower, PhSensor, ADS1x15
from pifacedigitalio import PiFaceDigital
import signal
from time import sleep
print "Starting monitor"
def log(x):
print x
scheduler = Scheduler(log=log)
... |
#!/usr/bin/python2.6
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
# vim:ts=4:sts=4:sw=4:expandtab
from django.db import models
from satori.core.dbev import Events
from satori.core.models import Entity
@ExportModel
class Global(Entity):
"""Model. Special Global object for privileges.
"""
guardian = models.IntegerField(unique=True)
anonymous = model... |
# 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... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2014, GEM Foundation.
#
# OpenQuake 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 Lice... |
# -*- coding: utf-8 -*-
"""
Display tasks in thunderbird calendar.
Configuration parameters:
cache_timeout: how often we refresh usage in seconds (default: 120s)
profile_path: path to the user thunderbird profile (not optional)
err_profile: error message regarding profile path and read access
err_excep... |
# Copyright (c) 2007-2008 The PyAMF Project.
# See LICENSE for details.
"""
RemoteObject Tests.
@author: U{Nick Joyce<mailto:nick@boxdesign.co.uk>}
@since: 0.1
"""
import unittest
import pyamf
from pyamf import remoting
from pyamf.remoting import amf3, gateway
from pyamf.flex import messaging
class RandomIdGenerat... |
import lmfit
import numpy as np
from numpy.linalg import inv
import scipy as sp
import itertools
import matplotlib as mpl
from collections import OrderedDict, defaultdict
from pycqed.utilities import timer as tm_mod
from sklearn.mixture import GaussianMixture as GM
from sklearn.tree import DecisionTreeClassifier as DT... |
from cloudshell.cp.vcenter.models.VCenterDeployVMFromLinkedCloneResourceModel import VCenterDeployVMFromLinkedCloneResourceModel
from cloudshell.cp.vcenter.models.DeployResultModel import DeployResult
from cloudshell.cp.vcenter.models.vCenterCloneVMFromVMResourceModel import vCenterCloneVMFromVMResourceModel
from cloud... |
import os
from datetime import datetime
from datetime import timedelta
class Datefile(object):
EPOCH = datetime(1970, 1, 1)
def __init__(self, pid_dir, file_name, format='%Y-%m-%d %H:%M:%S', timestamp=None):
if not os.path.exists(pid_dir):
os.mkdir(pid_dir)
self.format = format
... |
import getpass
import sys
import time
import numpy as np
from copy import deepcopy
from utils import calculate_perplexity, get_ptb_dataset, Vocab
from utils import ptb_iterator, sample
import tensorflow as tf
from tensorflow.contrib.seq2seq import sequence_loss
from model import LanguageModel
from q2_initialization ... |
# Copyright 2017 the Isard-vdi project authors:
# Josep Maria Viñolas Auquer
# Alberto Larraz Dalmases
# License: AGPLv3
#!/usr/bin/env python
# coding=utf-8
import random, queue
from threading import Thread
import time, json
from webapp import app
from flask_login import current_user
import rethinkdb as r
f... |
# Copyright 2017 Mycroft AI 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.