content stringlengths 4 20k |
|---|
# -*- coding: utf-8 -*-
import codecs ;
import datetime ;
import os ;
import yaml ;
import cherrypy ;
from application.version import Version ;
path = os.path.abspath(os.path.dirname(__file__))
defaultSetup = {
'view' : {
'title' : 'Peanut, Stars & Me' ,
'titlelink' : '/' ,
'favicon' :... |
import unittest
from PySide2.QtCore import QObject
from testbinding import TestObject
class Receiver(QObject):
def __init__(self):
QObject.__init__(self)
self.received = None
def slot(self, value):
self.received = value
class TypedefSignal(unittest.TestCase):
def testTypedef(se... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# https://raw.githubusercontent.com/blacklab/nyan/master/shared_modules/_smote.py
'''
The MIT License (MIT)
Copyright (c) 2012-2013 Karsten Jeschkies <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated docu... |
import pytest
from django.urls import reverse
from rest_framework import status
from openslides.core.config import config
from openslides.core.models import ChatMessage, Projector, Tag
from openslides.users.models import User
from openslides.utils.test import TestCase
from ..helpers import count_queries
@pytest.mar... |
from ovirt.node.utils.expose import Feature, Owner
import ipmi_page
"""
IPMI Plugin
"""
#
# Magic function to register all plugins to be used
#
def createPlugins(application):
ipmi_page.Plugin(application)
def createPluginFeatures(application):
application.register(Feature(owner=Owner(name=__package__),
... |
from __future__ import absolute_import
import six
from base64 import b64encode
from django.core.urlresolvers import reverse
from django.core import mail
from mock import patch
from sentry.models import (
Organization, OrganizationAvatar, OrganizationOption, OrganizationStatus
)
from sentry.signals import project... |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Lice... |
import json
from django.contrib.auth.models import User
from django.http import HttpRequest
from django.test import TestCase
from tastypie.api import Api
from tastypie.exceptions import NotRegistered, BadRequest
from tastypie.resources import ModelResource
from tastypie.serializers import Serializer
from core.models i... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import types
from textwrap import dedent
from pants.build_graph.target import Target
from pants_test.tasks.task_test_base import TaskTestBase
from pants.contrib.go i... |
import collections
import os
import click
import app.jira
def load_commands(f):
"""
Loads all modules found in /app/commands as commands for the given
click.group() instance. The module name must be equal to the command
name. The command callback must be an instance of click.command().
:param f... |
""" Test SMThread module """
import unittest
import mock
from smserver.smutils import smconn
from smserver.smutils import smthread
class BaseStepmaniaServerTest(unittest.TestCase):
""" Test Stepmania Server class """
def setUp(self):
self.server = smthread.StepmaniaServer([])
self.smthread ... |
import re
import logging
# Google specific modules
from google.appengine.ext import db
from google.appengine.ext.db import polymodel
from google.appengine.api.labs.taskqueue import Task
from google.appengine.ext.blobstore import blobstore
# local stuff
import util
import properties
## -------------------------------... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.files.storage import default_storage
from django.shortcuts import render
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.db.models.fields.files import FieldFile
from django.views.generic import FormVie... |
"""pw_toolchain"""
import setuptools # type: ignore
setuptools.setup(name='pw_toolchain',
version='0.0.1',
author='Pigweed Authors',
author_email='<EMAIL>',
description='Pigweed toolchain wrapper',
packages=setuptools.find_packages(... |
import proto # type: ignore
from google.ads.googleads.v7.resources.types import feed_item_set_link
__protobuf__ = proto.module(
package="google.ads.googleads.v7.services",
marshal="google.ads.googleads.v7",
manifest={
"GetFeedItemSetLinkRequest",
"MutateFeedItemSetLinksRequest",
... |
import logging
try:
import cx_Oracle as Database
except ImportError as e:
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured("Error loading cx_Oracle module: %s" % e)
from librdbms.server.rdbms_base_lib import BaseRDBMSDataTable, BaseRDBMSResult, BaseRDMSClient
LOG = logging.ge... |
from constants import LDA_DIR, FEAT_DATA_DIR
import pickle
import logging
import pandas as pd
from time import time
import gensim
from gensim import corpora
from gensim.models.ldamulticore import LdaMulticore
logging.basicConfig(
format='%(asctime)s : %(levelname)s : %(message)s',
level=logging.DEBUG,
... |
"""Tests for the insecure example auth provider."""
from unittest.mock import Mock
import uuid
import pytest
from homeassistant.auth import auth_store, models as auth_models, AuthManager
from homeassistant.auth.providers import insecure_example
from tests.common import mock_coro
@pytest.fixture
def store(hass):
... |
import datetime
import struct
import sys
from xml.etree import ElementTree as ET
import serial
from . import constants, crc16, database_records, packetwriter, util
class ReadPacket:
def __init__(self, command, data):
self._command = command
self._data = data
@property
def command(self):... |
from django.views.generic import View
from pulp.server.auth import authorization
from pulp.server.exceptions import MissingResource
from pulp.server.managers import factory
from pulp.server.webservices.views.decorators import auth_required
from pulp.server.webservices.views.util import (generate_json_response,
... |
import re
import httplib
from boto import exception
from boto.s3.connection import S3Connection
from boto.s3.connection import OrdinaryCallingFormat
from framework.exceptions import HTTPError
from addons.base.exceptions import InvalidAuthError, InvalidFolderError
from addons.s3.settings import BUCKET_LOCATIONS
def ... |
import argparse
import copy
import sys
from ros_buildfarm.argument import add_argument_build_name
from ros_buildfarm.argument import add_argument_config_url
from ros_buildfarm.argument import \
add_argument_distribution_repository_key_files
from ros_buildfarm.argument import add_argument_distribution_repository_ur... |
from Tkinter import *
from time import *
import socket
import threading
tLock = threading.Lock()
shutdown = False
def receving(name, sock):
while not shutdown:
try:
tLock.acquire()
while True:
data, addr = sock.recvfrom(1024)
print "Incoming: " + str... |
import doctest
import unittest
from Testing import ZopeTestCase as ztc
from Products.Five import zcml
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import PloneSite
from Products.PloneTestCase.layer import onsetup
import vfu.events
OPTION_FLAGS = doctest.NORMALIZE_WHITESP... |
"""Setuptools based setup script for the cassandra-codegen package."""
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
... |
from __future__ import unicode_literals
from pybtex.style.formatting.unsrt import Style as UnsrtStyle
class Style(UnsrtStyle):
default_sorting_style = 'author_year_title' |
from MAT.DocumentIO import getDocumentIO
from MAT.Document import AnnotatedDoc
_jsonIO = getDocumentIO("mat-json")
import urllib
from MAT import json
class WebClientError(Exception):
pass
class WebClient:
# E.g., "http://localhost:7801"
# Leaving proxies unset uses the env proxies. Otherwise,
# we... |
"""
Run tests by entering
$ pytest
on the command line.
"""
import pytest
from ..components import Turbine, Condenser, Pump, Boiler
from ..thermodynamics import State
def test_turbine_butane():
fluid = 'n-Butane'
p_hi = 3.5 # MPa
p_lo = 0.3 # MPa
turb_eff = 0.8
turb = Turbine(eff=turb_eff,... |
from __future__ import absolute_import
from __future__ import print_function
from future.utils import iteritems
from datetime import datetime
from fnmatch import fnmatch
from twisted.internet import defer
from buildbot import config
from buildbot.changes import base
from buildbot.util import ascii2unicode
from build... |
"""breadStore API utilities library."""
# Standard modules
import base64
import random
import re
import struct
import time
def case_transform_python(name):
"""Converts a camelCase name to a lower_with_under name."""
def converter(match):
return '_' + match.group(1).lower()
return re.sub('([A-Z])', converte... |
class PostDataBuilder:
def __init__(self):
self.content = 'Content not set'
self.status = ''
self.title = 'Title not set'
self.date = ''
self.tags = []
self.relative_url = ''
def with_content(self, content=""):
self.content = content
return self
... |
"""Generic (shallow and deep) copying operations.
Interface summary:
import copy
x = copy.copy(y) # make a shallow copy of y
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relev... |
# coding=utf-8
"""Django forms for User related routines."""
from builtins import object
from django.contrib.gis import forms
from django.contrib.auth.forms import PasswordResetForm
from leaflet.forms.widgets import LeafletWidget
from user_map.models.user import User
from user_map.models.inasafe_role import InasafeRol... |
"""
Code for managing the implementation cache.
"""
# Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from zeroinstall import _
import os
from logging import debug, info, warn
from zeroinstall.support import basedir
from zeroinstall import SafeException, support
c... |
##########################################################################
###Main view file for the request routes
###Currently supports search, view and submit of assistance and donation
###requests.
###Depends on const.py and auth.py
##########################################################################
from fl... |
#!/usr/bin/python
import Tkinter as tk
import ttk
import sys, os, os.path
PADDING=0
class ScrolledImage(tk.Frame):
def __init__(self, parent, autogrid=True, highlightthickness=0, **kwargs):
tk.Frame.__init__(self, parent, padx=PADDING, pady=PADDING, **kwargs)
if autogrid:
self.gr... |
"""DEPRECATED: Garbage collect in your local git repository.
Will safely clean up local branches which have already been landed.
::DEPRECATION NOTICE::
the 'refs/arcyd/landinglog' ref is no longer being updated, for new
branches do:
git fetch origin refs/arcyd/landed:refs/arcyd/landed
git branch --merged ref... |
from lxml import etree as ET
from django.core.management.base import BaseCommand, CommandError
from gcse.models import Annotation, CustomSearchEngine, Label
class Command(BaseCommand):
args = 'gid background_label path_to_opml.xml'
help = 'Import outline elements from the specified opml.xml into the specified... |
'''
Created on Oct 17, 2013
@author: moreno
'''
def do_pipe4_distmat(subject_ID, workflow_dir, output_dir, tract_number, is_left, use_sample=False):
"""
Packages and Data Setup
=======================
Import necessary modules from nipype.
"""
import nipype.interfaces.io as io ... |
from fontTools.misc.py23 import bytesjoin
from fontTools.misc import sstruct
from . import E_B_D_T_
from .BitmapGlyphMetrics import BigGlyphMetrics, bigGlyphMetricsFormat, SmallGlyphMetrics, smallGlyphMetricsFormat
from .E_B_D_T_ import BitmapGlyph, BitmapPlusSmallMetricsMixin, BitmapPlusBigMetricsMixin
import struct
... |
from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
from rpython.rtyper.test.test_llop import (BaseLLOpTest, str_gc_load,
newlist_and_gc_store)
from rpython.translator.c.test.test_genc import compile
class TestLLOp(BaseLLOpTest):
cache_load = {}
cache_stor... |
from webob import exc
from nova.api.openstack import common
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute
from nova import exception
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova.openstack.common impo... |
import arcpy
import func_app
class AppRio():
def __init__(self):
self.id_poligono_app = 0
self.diretorio_saida = None
self.dict_poligono_descricao = None
self.dict_app_poligonos = {}
self.projecao_plana = None
self.projecao_geo = None
def registrar_poligonos_app... |
# -*- coding: utf-8 -*-
from builtins import map
#from builtins import str
import sys
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
from threading import Timer
import xbmc
import xbmcaddon
import xbmcgui
from channelselector import get_thumb
from platformcode import conf... |
"""Tests for Email-related jobs."""
from __future__ import absolute_import # pylint: disable=import-only-modules
from __future__ import unicode_literals # pylint: disable=import-only-modules
import datetime
import types
from core.domain import email_jobs_one_off
from core.platform import models
from core.tests imp... |
# -*- 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):
# Adding field 'MailerMessage.bcc_address'
db.add_column('mailqueue_mailermessage', 'bcc_address',
... |
#!/usr/bin/python
"""
This code is part of the Arc-flow Vector Packing Solver (VPSolver).
Copyright (C) 2013-2015, Filipe Brandao
Faculdade de Ciencias, Universidade do Porto
Porto, Portugal. All rights reserved. E-mail: <<EMAIL>>.
This program is free software: you can redistribute it and/or modify
it under the term... |
import bpy
from bpy.app.handlers import persistent
def check_is_new_shading_ntree(node_tree):
for node in node_tree.nodes:
# If material has any node with ONLY new shading system
# compatibility then it's considered a Cycles material
# and versioning code would need to perform on it.
... |
import collections
import datetime
import os
import re
import uuid
from king_phisher import its
from king_phisher import utilities
import dateutil.tz
import icalendar
import pytz.tzfile
import tzlocal
import smoke_zephyr.utilities
DAY_ABBREVIATIONS = ('SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA')
"""The abbreviations of... |
from os import path
from collections import deque
import string
import io
from constants import SCRIPT_PATH
import opcodes
class Script:
'''
A script is code to be run by each agent
It has code
'''
def __init__(self, scripName):
self.ip = ip
self.data = []
self.keys = ... |
import os
from queue import Queue
from bears.general.TextLintBear import TextLintBear
from coalib.results.Result import Result
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.settings.Section import Section
from coalib.testing.BearTestHelper import generate_skip_decorator
from coalib.testing.Loc... |
import copy
import functools
import os
import unittest
import numpy as np
from numpy.linalg import LinAlgError
from autosklearn.data.competition_data_manager import CompetitionDataManager
from autosklearn.models.cv_evaluator import CVEvaluator
from autosklearn.models.paramsklearn import get_configuration_space
from P... |
"""
Copyright (C) 2019 Interactive Brokers LLC. All rights reserved. This code is subject to the terms
and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable.
"""
"""
This module has tools for implementing the IB low level messaging.
"""
import struct
import logging
fr... |
"""Collaborations API Tests for Version 1.0.
This is a testing template for the generated CollaborationsAPI Class.
"""
import unittest
import requests
import secrets
from py3canvas.apis.collaborations import CollaborationsAPI
from py3canvas.apis.collaborations import Collaborator
from py3canvas.apis.collabora... |
from gevent import monkey
#need to allow unpatching
monkey.patch_all()
import gevent
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, g, session, redirect, url_for, jsonify, current_app
import json, gevent, requests
from werkzeug.exceptions impo... |
# DeepLearning with DropOut
import numpy as np
import scipy.io as sio
import cPickle
import gzip
import os
import sys
import time
from collections import OrderedDict
import theano
import theano.tensor as T
from theano.ifelse import ifelse
import theano.printing
import theano.tensor.shared_randomstreams
from logistic_... |
"""
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... |
from popserver.tests import *
from fixture import DataTestCase
import popserver.tests.popfixtures as fx
from popserver.model import *
class TestServiceController(DataTestCase, TestController):
fixture = dbfixture
datasets = [fx.UserData,
fx.ServiceTypeData,
fx.ServiceData,
... |
from django.dispatch import receiver
from corehq import Domain
from corehq.apps.commtrack.const import RequisitionStatus
from corehq.apps.programs.models import Program
from corehq.apps.commtrack.signals import supply_point_modified, requisition_modified, send_notifications
from custom.openlmis.api import OpenLMISEndpo... |
from setuptools import setup
import os
import re
# Get the version string. Cannot be done with import!
with open(os.path.join('lumberjack', 'version.py'), 'rt') as f:
version = re.search(
'__version__\s*=\s*"(?P<version>.*)"\n',
f.read()
).group('version')
setup(
name='lumberjack',
ve... |
from oslo_log import log
import six
from keystone import auth
from keystone.auth.plugins import mapped
from keystone.common import dependency
from keystone.common import wsgi
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone.models import token_model
LOG = log.getLo... |
"""Tests for tensorflow.ops.numerics."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
fr... |
import os
import sys
import urllib2
import re
import shutil
from PyQt4 import QtCore, QtGui
from util import strtodate, datetostr, now, PREFSFILENAME
import util
import logging
from vault import luaparser
import warnings
import cStringIO
import zipfile
logger = logging.getLogger("faf.modvault")
lo... |
import os, sys, smtplib, datetime, tempfile, subprocess, datetime, shutil, time, ftplib
import getopt
import time
import smtplib
import zipfile
import socket
import urllib
import pwd
import locale
import gettext
import socket
from wpakFileManager import FileManager
class WpakGet:
def __init__(self, c, cfgcurrentso... |
#! /usr/bin/python3
"""Destroy a quantity of an asset."""
import struct
from dogepartylib.lib import util
from dogepartylib.lib import config
from dogepartylib.lib import script
from dogepartylib.lib.script import AddressError
from dogepartylib.lib.exceptions import *
FORMAT = '>QQ8s'
LENGTH = 8 + 8 + 8
ID = 110
d... |
from enigma import eTimer, eEnv
from Screens.Screen import Screen
from Components.ActionMap import ActionMap, NumberActionMap
from Components.Pixmap import Pixmap,MultiPixmap
from Components.Label import Label
from Components.Sources.StaticText import StaticText
from Components.Sources.List import List
from Components.... |
# -*- coding: utf-8 -*-
from ctypes import *
def _IOW_BAD(type,nr,size): return _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) # macro
def _IOR_BAD(type,nr,size): return _IOC(_IOC_READ,(type),(nr),sizeof(size)) # macro
def _IO(type,nr): return _IOC(_IOC_NONE,(type),(nr),0) # macro
def _IOC_SIZE(nr): return (((nr) >> _IOC_... |
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from actstream.exceptions import check_actionable_model
def follow(user, obj, send_action=True, actor_only=False, request=None):
"""
Creates a relationship all... |
import os
from requests.auth import HTTPBasicAuth
from watcher import SonoSiteWatcher
import requests
import shutil
import ConfigParser
CURRENT_PATH = os.path.dirname(os.path.abspath(__file__))
# This is the directory used on the SonoSite laptop in Lusaka
SCANNER_OUTPUT_DIR = "C:\\sonosite"
ATTEMPT_COUNT = 4
def g... |
# -*- coding: utf-8 -*-
'''module for post management class'''
import os
import textwrap
from datetime import datetime, date
from cray.craylib import post, utility
#from .Post import *
_LOGGER = utility.get_logger('cray.PostManager')
class PostManager(object):
"""The class to manage all the posts in the sites."... |
#!/usr/bin/env python3
input = "R2 L5 L4 L5 R4 R1 L4 R5 R3 R1 L1 L1 R4 L4 L1 R4 L4 R4 L3 R5 R4 R1 R3 L1 L1 R1 L2 R5 L4 L3 R1 L2 L2 R192 L3 R5 R48 R5 L2 R76 R4 R2 R1 L1 L5 L1 R185 L5 L1 R5 L4 R1 R3 L4 L3 R1 L5 R4 L4 R4 R5 L3 L1 L2 L4 L3 L4 R2 R2 L3 L5 R2 R5 L1 R1 L3 L5 L3 R4 L4 R3 L1 R5 L3 R2 R4 R2 L1 R3 L1 L3 L5 R4 R5... |
#!/usr/bin/env python3
"""
Starting point for Flask Web GUI
Copyright (C) 2020 Anders Lowinger, <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 ... |
"""Solum base exception handling.
Includes decorator for re-raising Solum-type exceptions.
"""
import functools
import pecan
import sys
import wsme
from keystoneclient import exceptions as keystone_exceptions
from oslo.config import cfg
import six
from solum.common import safe_utils
from solum.openstack.common imp... |
import plotly.graph_objs as go
from plotly.offline import plot
import cea.plots.demand
from cea.plots.variable_naming import NAMING, COLOR, LOGO
from cea.constants import HOURS_IN_YEAR
import pandas as pd
__author__ = "Jimeno A. Fonseca"
__copyright__ = "Copyright 2018, Architecture and Building Systems - ETH Zurich"
... |
"""
Example: Thompson sampling for Bayesian Optimization with GPs
=============================================================
In this example we show how to implement Thompson sampling for Bayesian optimization with Gaussian processes.
The implementation is based on this tutorial: https://gdmarmerola.github.io/ts-fo... |
"""
Tests for course dates fragment.
"""
from __future__ import absolute_import
from datetime import datetime, timedelta
import six
from django.urls import reverse
from student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import Module... |
# -*- coding: utf-8 -*-
from django import template
from hitcount.templatetags import hitcount_tags
register = template.Library()
def get_hit_count_from_obj_variable(context, obj_variable, tag_name):
"""
Helper function to return a HitCount for a given template object variable.
Raises TemplateSyntaxErr... |
#This is the function that defines the thread that listens to the bitcoin network continuously.
#It is called by backends.py. It uses a websocket to connect to blockchain.info
import websocket
import json
import thread
import logging
import datetime
#A transaction looks something like this:
#{u'inputs': [{u'prev_o... |
#!/usr/bin/env python
__author__ = 'Mike McCann,Duane Edgington,Reiko Michisaki'
__copyright__ = '2013'
__license__ = 'GPL v3'
__contact__ = 'duane at mbari.org'
__doc__ = '''
Master loader for all CANON activities in September 2013
Mike McCann; Modified by Duane Edgington and Reiko Michisaki
MBARI 02 Septemb... |
"""
Support for Homematic thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.homematic/
"""
import logging
import homeassistant.components.homematic as homematic
from homeassistant.components.climate import ClimateDevice, STATE_AUTO
from... |
from os.path import abspath, dirname, join
from alignak_test import unittest, AlignakTest
from alignak.objects.module import Module
from alignak.modulesmanager import ModulesManager
class TestModuleManager_And_Packages(AlignakTest):
''' Test to make sure that we correctly import alignak modules.
'''
de... |
"""Somewhat hackish way to eliminate non-ASCII characters in a text file,
such as a taxonomy mapping file, with QIIME. Reads through the file, and
removes all characters above decimal value 127. Additionally, asterisk "*"
characters are removed, as these inhibit the RDP classifier.
Usage:
python parse_nonstandard_cha... |
"""Fix @@@...@@@ format of variables in the installer script templates for Mac.
% python tweak_macinstaller_script.py --output=out.txt --input=in.txt \
--version_file=version.txt [--build_type=dev] \
"""
__author__ = "mukai"
import logging
import optparse
import mozc_version
def _ReplaceVariables(data, envi... |
"""
This file is part of Storm
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR ... |
"""Module for client (i.e. user to communication-device) interaction.
The debugged program is at the other end of the communcation."""
import atexit
# Our local modules
from import_relative import *
Muser = import_relative('user', top_name='trepan')
Mtcpclient = import_relative('tcpclient', '..inout', 'trepan')... |
#! /usr/bin/python
"""Replace the default dotfiles in the home directory with symlinks
pointing to the ones found in ~/.system/dotfiles/ . This may be used,
for example, to quickly install your prefered .bashrc, .profile,
.emacs.d/ or .emacs, .ssh, etc. Thus, the only thing you have to
"remember" to bring with you t... |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 02 18:20:40 2015
@author: Konstantin
"""
from scipy import optimize
import numpy as np
import configparser, os, csv
from fabric.api import env, execute, task, get
import cuisine
import vm_control
import pandas
import operator
import pickle
import scip... |
# coding: utf-8
from itertools import chain, count
from timeit import default_timer
from geopy.compat import sleep_at_least
from geopy.exc import GeocoderServiceError
from geopy.util import logger
def _is_last_gen(count):
"""list(_is_last_gen(2)) -> [False, False, True]"""
return chain((False for _ in range(... |
import sys
import os
import time
import re
class Plugin(indigo.PluginBase):
def __init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs):
indigo.PluginBase.__init__(self, pluginId, pluginDisplayName, pluginVersion, pluginPrefs)
self.defaultRadio = pluginPrefs.get("sonosRadio", "x-s... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ClipByExtent.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander bruy at gmail dot com
**************... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Library module of requests to genomebrowser service endpoints.
This module is separate from the CLI interface so that the underlying functions
may be imported and used in scripts or iPython sessions without the click
decorators.
The aim of each function is to fetch th... |
"""Jitting test for Sinkhorn."""
import functools
from absl.testing import absltest
from absl.testing import parameterized
import chex
import jax
import jax.numpy as jnp
import jax.test_util
from ott.core import sinkhorn
from ott.geometry import geometry
non_jitted_sinkhorn = functools.partial(sinkhorn.sinkhorn, jit=... |
import os
from monasca_agent.collector.checks import AgentCheck
class PostfixCheck(AgentCheck):
"""This check provides metrics on the number of messages in a given postfix queue
WARNING: the user that monasca-agent runs as must have sudo access for the 'find' command
sudo access is not require... |
import unittest
from openstack.tests.functional import base
@unittest.skipUnless(base.service_exists(service_type='object-store'),
'Object Storage service does not exist')
class TestAccount(base.BaseFunctionalTest):
@classmethod
def tearDownClass(cls):
super(TestAccount, cls).te... |
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2015, Johannes Köster"
__email__ = "<EMAIL>"
__license__ = "MIT"
import json
import os
import threading
from flask import Flask, render_template, request
from snakemake.version import __version__
LOCK = threading.Lock()
app = Flask("snakemake", template_fol... |
import argparse
import em.tools.input_output as IO
def register_parser(subparsers):
parser = subparsers.add_parser('fixpdb', usage=usage(), description=description())
add_arguments(parser)
def add_arguments(parser):
parser.add_argument("--input", metavar="FILE", help="Input File.", required=True)
p... |
import logging
import os
import numpy as np
import pandas as pd
from anndata import AnnData
from scvi.data import setup_anndata
from scvi.data._built_in_data._download import _download
logger = logging.getLogger(__name__)
def _load_retina(save_path: str = "data/", run_setup_anndata: bool = True) -> AnnData:
""... |
import os
import re
import subprocess
import tempfile
# Avoid using the slow (google-specific) wrapper around objdump.
OBJDUMP_BIN = "/usr/bin/objdump"
if not os.path.exists(OBJDUMP_BIN):
OBJDUMP_BIN = "objdump"
_COMMON_DISASM_OPTIONS = ["-M", "intel-mnemonic", "-C"]
_DISASM_HEADER_RE = re.compile(r"[a-f0-9]+\s+... |
import graphene
from graphene_django import DjangoObjectType
from graphene_django.debug import DjangoDebug
from pontoon.api.util import get_fields
from pontoon.base.models import (
Locale as LocaleModel,
Project as ProjectModel,
ProjectLocale as ProjectLocaleModel,
)
from pontoon.tags.models import Tag a... |
"""
This file contains the default values for parameters used in the journey planner.
This parameters are used on the creation of the instances in the tyr database, they will not be updated automatically.
This parameters can be used directly by jormungandr if the instance is not known in tyr, typically in development s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.