content string |
|---|
from spack import *
class PyPytest(PythonPackage):
"""pytest: simple powerful testing with Python."""
homepage = "http://pytest.org/"
url = "https://pypi.io/packages/source/p/pytest/pytest-3.7.1.tar.gz"
import_modules = [
'_pytest', '_pytest.assertion', '_pytest._code',
'_pytest... |
import bpy
from bpy.props import FloatProperty
from mathutils import Vector
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import (fullList, updateNode)
def interp_v3_v3v3(a, b, t=0.5):
if t == 0.0: return a
elif t == 1.0: return b
else:
s = 1.0 - t
retur... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import xlrd
from string import Template
import re
import time
from datetime import date
today = date.today()
excel_file = 'GW portal list of icons new structure 20170830.xlsx'
# excel_file = 'GW portal list of icons new structure 20170317.xlsx'
# excel_file = 'GW portal... |
import asyncio
def proc_main(pk, row, arg):
'''
Defines the 'stats' trigger coroutine - used to calculate the mean and
standard deviation of time series data.
Note: used directly for augmented selects.
Parameters
----------
pk : any hashable type
The primary key of the database en... |
import base64
import json
import logging
import os
import re
import sys
import unittest
from Crypto.PublicKey import RSA
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
import test_env
test_env.setup_test_env()
import dev_appserver
dev_appserver.fix_sys_path()
import endpoints
from protorpc.r... |
#!/usr/bin/env python3
import sys
# Parameters
# 1. filename (for the .md in _posts/ folder)
filename = sys.argv[1]
# 2. Bot token to post the message to the channel
token_bot = sys.argv[2]
# 3. Page token to post the message to the facebook page
token_page = sys.argv[3]
import requests
import yaml
import re
print("... |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext as _
from django.utils import six
if six.PY2:
from urlparse import urljoin
if six.PY3:
from urllib.parse import urljoin
DEFAULT_APP_SETTINGS = {
'OAUTH_BASE_URL': 'http:... |
import re
from json import dumps
from traceback import format_exc
from aiohttp_wrapper import HTTPStatusError
from discord import File, Game, Guild, Message, TextChannel
from discord.abc import Messageable
from discord.ext.commands import CommandNotFound, Context
from bot import Yasen
from bot.error_handler import co... |
"""Test compilation database flags generation."""
import imp
from os import path
from unittest import TestCase
from EasyClangComplete.plugin.flags_sources import compilation_db
from EasyClangComplete.plugin.utils import tools
from EasyClangComplete.plugin.utils import flag
from EasyClangComplete.plugin.utils import se... |
#$Id$
class DefaultTemplate:
"""This class is used to create object for default templates."""
def __init__(self):
"""Initialize the parameters for default temmplates."""
self.invoice_template_id = ''
self.invoice_template_name = ''
self.estimate_template_id = ''
self.est... |
'''
Amazon Cloud Drive for KODI / XBMC Plugin
Copyright (C) 2013-2015 ddurdle
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 ... |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
'''
Wammu - Phone manager
Main Wammu application
'''
from __future__ import unicode_literals
from __future__ import print_function
import wx
import sys
import Wammu.Main
import Wammu.Error
from Wammu.Locales import StrConv
from Wammu.Locales import ugettext as _
class WammuApp(wx.App):
'''
Wammu appliction c... |
#! /usr/bin/env python
# https://www.python.org/dev/peps/pep-0263/
# coding=UTF-8
percol.view.PROMPT = ur"<blue>Input:</blue> %q"
percol.view.RPROMPT = ur"(%F) [%i/%I]"
# Emacs like
percol.import_keymap({
"C-h" : lambda percol: percol.command.delete_backward_char(),
"C-d" : lambda percol: percol.command.delet... |
# -*- coding: utf-8 -*-
from itertools import chain
from django.conf import settings
from django.db import migrations, models
from django.utils import translation
from django.utils.translation import ugettext_lazy as _
# We need to keep a reference for the following translations
LEGACY_TRANSLATIONS = (
_("Not ... |
"""Manually applies a shared preference JSON file.
If needed during automation, use the --shared-prefs-file in test_runner.py
instead.
"""
import argparse
import sys
# pylint: disable=ungrouped-imports
from pylib.constants import host_paths
if host_paths.DEVIL_PATH not in sys.path:
sys.path.append(host_paths.DEVIL... |
import pytest
# Hooks to add command line options or set other custom behaviors.
# They must be placed here to be found by pytest. See:
#
# https://docs.pytest.org/en/latest/writing_plugins.html
#
def pytest_addoption(parser):
group = parser.getgroup("Spack specific command line options")
group.addoption(
... |
"""Setup Celery."""
import os
import logging
from urllib.parse import quote
from celery.signals import setup_logging
from f8a_worker.defaults import configuration
_logger = logging.getLogger(__name__)
def _use_sqs():
"""Check if worker should use Amazon SQS.
:return: True if worker should use Amazon SQS
... |
from django.contrib.auth.models import User
from django.contrib.contenttypes import models
from django.core import exceptions
from rest_framework import viewsets, generics
from rest_framework.views import APIView
from rest_framework.authtoken.models import Token
from rest_framework import authentication
from rest_fram... |
from prisoner.gateway.ServiceGateway import ServiceGateway, WrappedResponse
import prisoner.SocialObjects as SocialObjects
import json
import urlparse
import oauth2
import datetime
import urllib
class TwitterServiceGateway(ServiceGateway):
""" Service Gateway for Twitter.
This gateway supports reading a user's t... |
from tkinter import *
class WidgetRedirector:
"""Support for redirecting arbitrary widget subcommands.
Some Tk operations don't normally pass through Tkinter. For example, if a
character is inserted into a Text widget by pressing a key, a default Tk
binding to the widget's 'insert' operation... |
"""Common layers for car models.
These are usually sub-classes of base_layer.BaseLayer used by builder_lib.
"""
from lingvo import compat as tf
from lingvo.core import base_layer
from lingvo.core import py_utils
from lingvo.tasks.car import car_lib
class SamplingAndGroupingLayer(base_layer.BaseLayer):
"""Sampling... |
# coding:utf-8
from ..Global import *
def test1(request):
'''
测试
'''
text = request.POST.get('text', 'not var')
rl = request.GET.get('reload', 'not var')
if rl == 'reload':
uwsgi.reload()
return HttpResponseRedirect('/test/')
var = '木有返回'
exec(text)
return render_... |
from pygeo import *
# testing of factory function for constrained pickable points
# on unit sphere
v=display(scale=3,camera_vector=[0,4,-1])
# CLASS being called
""" the unit sphere """
u=uSphere() # uSphere
#---------------... |
import datetime
import json
from django.db import models
from OctaHomeCore.models import *
from OctaHomeCore.communication_controller import *
class TempMonitorDevice(InputDevice):
LastTemp = models.IntegerField()
LastUpdate = models.DateTimeField()
def updateTemp(temp):
self.LastTemp = temp
self.LastUpdate ... |
from oslo_log import log as logging
import testtools
from tempest.common import waiters
from tempest import config
from tempest.lib import decorators
from tempest.scenario import manager
from tempest import test
CONF = config.CONF
LOG = logging.getLogger(__name__)
class TestServerAdvancedOps(manager.ScenarioTest):... |
import mock
from nova import test
from nova.virt.disk.mount import api
from nova.virt.disk.mount import block
from nova.virt.disk.mount import loop
from nova.virt.disk.mount import nbd
from nova.virt.image import model as imgmodel
PARTITION = 77
ORIG_DEVICE = "/dev/null"
AUTOMAP_PARTITION = "/dev/nullp77"
MAP_PARTIT... |
"""Test class for iSCSI deploy mechanism."""
import os
import tempfile
import mock
from oslo.config import cfg
from ironic.common import exception
from ironic.common import keystone
from ironic.common import utils
from ironic.drivers.modules import deploy_utils
from ironic.drivers.modules import iscsi_deploy
from ir... |
#!/usr/bin/env python
import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
import pickle
"""
Script to generate iteration plots of fluid count:
"""
def ParseArguments():
parser = argparse.ArgumentParser(description="Plot times")
parser.add_argument('--input', type=str, required=True,
... |
from msrest.serialization import Model
class OperationMetricAvailability(Model):
"""Defines how often data for a metric becomes available.
:param time_grain: The granularity for the metric.
:type time_grain: str
:param blob_duration: Blob created in the customer storage account, per
hour.
:t... |
"""
This module provides the L{MainPanel} component. That contains the editors main
notebook and command bar.
@summary: Main Panel
"""
__author__ = "Cody Precord <<EMAIL>>"
__svnid__ = "$Id: ed_mpane.py 69061 2011-09-11 17:04:41Z CJP $"
__revision__ = "$Revision: 69061 $"
#-----------------------------------------... |
"""
This file is part of L3Morpho.
Copyright (C) 2012, 2013.
Michael Gasser
L3Morpho is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later ... |
from tempest.api.identity import base
from tempest.common.utils import data_utils
from tempest import test
class EndPointsTestJSON(base.BaseIdentityV3AdminTest):
@classmethod
def setup_clients(cls):
super(EndPointsTestJSON, cls).setup_clients()
cls.identity_client = cls.client
cls.cli... |
import random
import sys
def subnet_calc():
try:
print "\n"
#Checking IP address validity
while True:
ip_address = raw_input("Enter an IP address: ")
#Checking octets
a = ip_address.split('.')
... |
import sys
import apt
import apt_pkg
import gettext
import aptsources.distro
import Parser
import Helpers
from Helpers import utf8, _, _n
from aptsources.sourceslist import SourcesList, is_mirror
from optparse import OptionParser
import os
import os.path
# adding new repositories is currently disabled because some ... |
__author__ = 'John Kusner'
import datetime
_1_jan_1000 = datetime.datetime(1000, 1, 1)
class CACBarcode:
"""
Generic barcode class, constructing this will do nothing
"""
def __init__(self):
pass
def read(self, data, count):
return data[:count], data[count:]
def readnum(self, ... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import pymongo
import optparse
import sys
import requests
import json
import datetime
import time
import ujson
import threading
import redis
import urllib2
reload(sys)
sys.setdefaultencoding('utf8')
def call_service(service_url, data):
req = urllib2.Request(service_ur... |
from __future__ import division
from multiprocessing import Pipe
from threading import Thread
from sys import version_info, platform
from misc import calcCRC
from collections import OrderedDict
from math import ceil, floor
from threading import Timer
#switch timer based on platform
if platform == 'win32':
... |
import jax
from jax import numpy as jnp, random, lax
from flax import linen as nn
from flax.linen import Module
import numpy as np
from pprint import pprint
from dense import Dense
# Here submodules are explicitly defined during init, but still materialized
# lazily only once a first input is passed through and shape... |
# coding: utf8
from collections import OrderedDict
from django.core.urlresolvers import reverse
from django.apps import apps
from django.test import TestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.utils.six.moves.urllib.parse import urlparse, parse_qs, \
... |
"""
AMF Remoting support.
A Remoting request from the client consists of a short preamble, headers, and
bodies. The preamble contains basic information about the nature of the
request. Headers can be used to request debugging information, send
authentication info, tag transactions, etc. Bodies contain actual Remoting
... |
# Python test set -- part 6, built-in types
from test_support import *
print_test('Built-in types (test_types.py)', 1)
print_test('Truth value testing', 2)
assert not None
assert not 0
assert not 0L
assert not 0.0
assert not ''
assert not ()
assert not []
assert not {}
assert 1
assert 1L
assert 1.0
... |
import os
import sys
from requestbuilder import Arg
import requestbuilder.auth.aws
from requestbuilder.mixins import TabifyingMixin
from requestbuilder.request import AWSQueryRequest
import requestbuilder.service
from euca2ools.commands import Euca2ools
from euca2ools.exceptions import AWSError
from euca2ools.util im... |
#!/usr/bin/env python3
import argparse
import re
from biocode import utils, gff, things
"""
Example with a match extending far past a gene
DEBUG: g8713.t1:(3529) overlaps (size:2893) nucleotide_to_protein_match.158742:(6245), match target id:jgi|Copci1|10482|CC1G_12482T0, length:1764
mRNA % cov: 81.97789742136582
... |
from misago.models import Role
from misago.utils.translation import ugettext_lazy as _
def load():
role = Role(name=_("Administrator").message, _special='admin', protected=True)
role.permissions = {
'name_changes_allowed': 5,
'changes_expire': 7,
... |
__author__ = "Felix Brezo, Yaiza Rubio <<EMAIL>>"
__version__ = "2.0"
from osrframework.utils.platforms import Platform
class Ello(Platform):
"""A <Platform> object for Ello"""
def __init__(self):
self.platformName = "Ello"
self.tags = ["social"]
########################
# ... |
import os
from setuptools import setup, find_packages
def find_data_files(source):
result = []
for directory, _, files in os.walk(source):
files = [os.path.join(directory, x) for x in files]
result.append((directory, files))
return result
data_files = (["aclcheck_cmdline.py", "aclgen.py", "definate.py"]... |
from __future__ import with_statement
import os, xmlrpclib, datetime, sys, SocketServer
sys.path.insert(0, os.path.join(os.path.normpath(os.path.dirname(os.path.abspath(sys.argv[0]))), 'lib'))
from DocXMLRPCServer import DocXMLRPCServer, DocXMLRPCRequestHandler
from SimpleXMLRPCServer import SimpleXMLRPCServer
from S... |
"""Tests for Direct API."""
import json
import webob
from nova import compute
from nova import context
from nova import exception
from nova import network
from nova import test
from nova import volume
from nova import utils
from nova.api import direct
from nova.tests import test_cloud
class ArbitraryObject(object)... |
# coding: utf-8
'''
Usage:
main.py [options] [<path>...]
Options:
-r --root=<path> the folder you want to share. This will shadow `<path>`
-c --config=<config> the extra details for each file under <path>, if not provide, will try to find `.config.json` file under each `<path>`
-p --port=<port> ... |
#!/usr/bin/python
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import sys
from multiprocessing import Process
ERR_SLEEP = 15
MAX_NONCE = 1000000L
settings = {}
pp = pprint.PrettyPrinter(indent=4)
class BitcreditRPC:
OBJID = 1
def __init__(self, host, p... |
#
# example of SHADOW <-> GENERIC WAVEFRONT conversion
#
# First draft: plane wave
import Shadow
from wofryshadow.propagator.wavefront2D.shadow3_wavefront import SHADOW3Wavefront
from wofry.propagator.wavefront2D.generic_wavefront import GenericWavefront2D
import scipy.constants as codata
m_to_eV = codata.h*codata.... |
from blockext import *
import blockext
import threading
import time
import nxt
from nxt.motor import *
from nxt.sensor import *
try:
from usb import USBError
except ImportError:
USBError = None
__version__ = '0.1'
# Connecting to the brick
brick = None
lock = threading.Lock()
last_command = None
def try... |
import sys
import os
def read_json(json_name):
json_text = open(json_name).read()
json_dict = eval(json_text)
json = sorted(json_dict.items(),
key=lambda x: json_text.index('"{}"'.format(x[0])))
#print(json)
#json_lowercase = dict((k.lower(), v) for k, v in json.iteritems())
... |
from uuid import uuid4
from django.conf import settings
from social_auth.models import User
from social_auth.backends.pipeline import USERNAME, USERNAME_MAX_LENGTH, warn_setting
from social_auth.signals import socialauth_not_registered, \
socialauth_registered, \
... |
__author__ = 'mdavid'
import json
from mock import *
from unittest import TestCase
from bcresolver.namecoin import NamecoinClient, NamecoinException
class TestNamecoinException(TestCase):
def test_go_right(self):
ex = NamecoinException(message='test_message', code=42)
msg = str(ex)
self.... |
import unittest
from mongokit import *
from bson.objectid import ObjectId
from mongokit.helpers import i18nDotedDict
class i18nTestCase(unittest.TestCase):
def setUp(self):
self.connection = Connection()
self.col = self.connection['test']['mongokit']
def tearDown(self):
self.... |
from struct import pack
from twisted.internet import protocol, reactor
from twisted.internet.defer import Deferred
from smartanthill.exception import NetworkSATPMessageLost
from smartanthill.network.cdc import CHANNEL_URGENT
from smartanthill.util import calc_crc16
class ControlMessage(object):
def __init__(se... |
# coding:utf-8
import os
import time
import signal
import threading
import multiprocessing
from multiprocessing import Process, Pipe, Queue, Event, dummy
data = []
def test_global_in_multiprocess():
'''
测试结果global声明全局变量后,多进程仍然不会修改,多线程可以修改,
'''
p_list = []
for i in range(2):
#p = threading.... |
# coding is utf-8
from bs4 import BeautifulSoup, SoupStrainer
import re
import json
import csv
from csv import DictWriter
import requests
import codecs
import datetime
# Get main page of Time values
url = requests.get("http://www.os.amsterdam.nl/feiten-en-cijfers/buurtcombinaties")
#print url.text
# Create iterable v... |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline ... |
"""Unit tests for the :mod:`iris.analysis` package."""
from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
# Import iris.tests first so that some things can be initialised before
# importing anything else.
import iris.tests as tests
import... |
import collections
import bpy
from mathutils import Matrix
from ..lib import unit, mesh, gemlib
from . import report_warn
class _Data:
__slots__ = ("gems", "materials", "notes", "warnings")
def __init__(self):
self.gems = collections.defaultdict(int)
self.materials = collections.defaultdict... |
'''
@author: Vikram Udyawer
@date: 25th March 2017 Saturday
@summary: PWM controlled RGB LED
@description:
Code for a Raspberry Pi to switch ON
an RGB LED its different colors using PWM.
'''
import RPi.GPIO as GPIO
import threading
import time
... |
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import qitkat_swig as qitkat
class qa_extract_hardware_sdc (gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block ()
def tearDown (self):
self.tb = None
def test_001_t (self):
# set up fg
self.tb.r... |
"""
This module handles serialization of arbitrary python structural data,
intended primarily to be stored in the database. It also supports
storing Django model instances (which plain pickle cannot do).
This serialization is used internally by the server, notably for
storing data in Attributes and for piping data to ... |
import json
from helper import web
from default import db, with_context
from factories import ProjectFactory, BlogpostFactory
from mock import patch
from pybossa.repositories import BlogRepository
from pybossa.repositories import UserRepository
blog_repo = BlogRepository(db)
user_repo = UserRepository(db)
class Tes... |
"""Sensors for National Weather Service (NWS)."""
import pytest
from homeassistant.components.nws.const import (
ATTR_LABEL,
ATTRIBUTION,
DOMAIN,
SENSOR_TYPES,
)
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import ATTR_ATTRIBUTION, STATE_UNKNOWN
from home... |
from kubeflow.kubeflow.crud_backend import api, status
def pvc_status(pvc):
"""
Set the status of the pvc
"""
if pvc.metadata.deletion_timestamp is not None:
return status.create_status(
status.STATUS_PHASE.TERMINATING,
"Deleting Volume...",
key={
... |
import threading
import Queue
import bitcoin
from util import print_error
from transaction import Transaction
import stealth
class WalletSynchronizer(threading.Thread):
def __init__(self, wallet, network):
threading.Thread.__init__(self)
self.daemon = True
self.wallet = wallet
sel... |
import pdb
import time
import random
import pickle
import dryscrape
from django.core.cache import get_cache
from dryscrape.driver.webkit import Node
class BMS():
def __init__(self):
# set up a web scraping session
#self.r = get_cache('event')
#return
self.sess = dryscrape.Session(ba... |
"""
Do index check. Iterate over all elements in the member database, check if
the entry is in the index. If not - log warning and add to index.
Annoying but There Be Bugs.
"""
from google.appengine.ext import db
import logging
from google.appengine.api import search
from model import Member
LIMIT_ALL = 4000
def d... |
import functools
__author__ = 'Adam'
"""
Merge of basic.LineReceiver and cyclone.json-rpc
Also supports mapped arguments
"""
import types
class JSONError(Exception):
def __init__(self, err):
self.error = err
def __str__(self):
return self.error
class JSONCallable:
def __init__(self):
... |
import re
import argparse
import numpy as np
# return v position
def to_vertex(v_line):
vertex = v_line.split(" ")
vertex = list( map(lambda x: float(x), vertex[1:]))
assert( len(vertex) == 3 )
return np.array(vertex)
# return surface pair (set(face_v), face_v)
def to_face(f_line):
face = f_line.s... |
from i3pystatus.core.settings import SettingsBase
from i3pystatus.core.threading import Manager
from i3pystatus.core.util import convert_position
from i3pystatus.core.command import run_through_shell
class Module(SettingsBase):
output = None
position = 0
settings = ('on_leftclick', "Callback called on le... |
import sys
try:
import weaver.client as client
except ImportError:
import client
config_file=''
if len(sys.argv) > 1:
config_file = sys.argv[1]
# creating line graph
nodes = []
num_nodes = 200
c = client.Client('127.0.0.1', 2002, config_file)
c.begin_tx()
for i in range(num_nodes):
nodes.append(c.c... |
# -*- coding: utf-8 -*-
import os
from gridsync.config import Config
def test_config_set(tmpdir):
config = Config(os.path.join(str(tmpdir), "test_set.ini"))
config.set("test_section", "test_option", "test_value")
with open(config.filename) as f:
assert f.read() == "[test_section]\ntest_option = ... |
"""Utilities for scanning source files to determine code authorship.
"""
import itertools
def ForwardSlashesToOsPathSeps(input_api, path):
"""Converts forward slashes ('/') in the input path to OS-specific
path separators. Used when the paths come from outside and are using
UNIX path separators. Only works for ... |
#!/usr/bin/env python
'''
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")... |
import socket
import telnetlib
import supybot.utils as utils
from supybot.commands import *
from supybot.utils.iter import any
import supybot.callbacks as callbacks
class Internet(callbacks.Plugin):
"""Add the help for "@help Internet" here."""
threaded = True
def dns(self, irc, msg, args, host):
... |
from argparse import ArgumentParser
from datetime import datetime
from itertools import izip
import sqlite3
from sqlalchemy.engine import create_engine
from sqlalchemy.orm.session import sessionmaker
from edsudoku.server.boards import DBBoard
from edsudoku.server.database import Base
from edsudoku.server.... |
import sys
import enchant
from .space_delimited import SpaceDelimited
try:
import enchant
dictionary = enchant.Dict("id")
except enchant.errors.DictNotFoundError:
raise ImportError("No enchant-compatible dictionary found for 'id'. " +
"Consider installing 'aspell-id'.")
# STOPWORD... |
import json
import os
import unittest
from unittest import TestCase
import runtime.feature.column as fc
import runtime.feature.field_desc as fd
import runtime.testing as testing
import runtime.xgboost as xgboost_extended # noqa: F401
import tensorflow as tf # noqa: E0401,F401
from runtime.pai import (evaluate, expla... |
#!/usr/bin/env python
"""s2reader setup configuration."""
from setuptools import setup
setup(
name='s2reader',
version='0.5',
description='simple metadata reader for Sentinel-2 SAFE files',
author='Joachim Ungar',
author_email='<EMAIL>',
url='https://github.com/ungarj/s2reader',
license='M... |
import proto # type: ignore
from google.ads.googleads.v6.resources.types import batch_job
from google.ads.googleads.v6.services.types import google_ads_service
from google.rpc import status_pb2 as gr_status # type: ignore
__protobuf__ = proto.module(
package="google.ads.googleads.v6.services",
marshal="go... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('oppia', '0010_move_userprofile'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from wechatpy.client.api.menu import WeChatMenu # NOQA
from wechatpy.client.api.user import WeChatUser # NOQA
from wechatpy.client.api.card import WeChatCard # NOQA
from wechatpy.client.api.group import WeChatGroup # NOQA
from wechatp... |
"""Locations and real-time occupancy of city bike stations."""
__version__ = "1.2.2"
try:
import pyotherside
except ImportError:
import sys
# Allow testing Python backend alone.
print("PyOtherSide not found, continuing anyway!",
file=sys.stderr)
class pyotherside:
def atexit(*arg... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
AlgorithmDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... |
__author__ = 'Joe Linn'
#import pylastica
from .abstract import AbstractQuery
class CustomFiltersScore(AbstractQuery):
SCORE_MODE_FIRST = 'first'
SCORE_MODE_MIN = 'min'
SCORE_MODE_MAX = 'max'
SCORE_MODE_TOTAL = 'total'
SCORE_MOD_AVG = 'avg'
SCORE_MODE_MULTIPLY = 'multiply'
def __init__(se... |
import asyncio
from .tsdb_serialization import serialize, LENGTH_FIELD_LENGTH, Deserializer
from .tsdb_ops import *
from .tsdb_error import *
class TSDBClient(object):
"client"
def __init__(self, port=9999):
self.port = port
def insert_ts(self, primary_key, ts):
#your code here, construct ... |
import numbers
import os
import os.path
import traceback
import sys
try:
from unittest2 import TestCase
except ImportError:
from unittest import TestCase
from .source_enumerator import SourceEnumerator
from ecl.util.util import installAbortSignals
from ecl.util.util import Version
# Function wrapper which c... |
# Django settings for geodjango project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# set this!
ADMINS = (
('Lisa Zorn', '<EMAIL>'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'countdracula_geodjango', # set this!
'USER... |
import sys
from six.moves import range
import pycbc
from pycbc.fft.fftw import set_measure_level
set_measure_level(0)
from pycbc.filter import matched_filter_core
from pycbc.types import Array, TimeSeries, FrequencySeries, float32, complex64, zeros
from pycbc.types import complex_same_precision_as,real_same_precision_... |
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 19 11:00:35 2017
@author: vijay
"""
import os
import cv2
from shutil import copyfile
from random import randint,shuffle
###############################################################################
def dir_check(location):
if not os.path.exists(location):
... |
from django.db import models
from django.db.models import Q
from jamjar.base.models import BaseModel
import operator
class Venue(BaseModel):
name = models.CharField(max_length=100)
place_id = models.CharField(max_length=100, null=True, blank=True)
unofficial = models.BooleanField(default=False) # If this p... |
#r# This example depicts half and full wave rectification.
####################################################################################################
import matplotlib.pyplot as plt
####################################################################################################
import PySpice.Logging.... |
# -*- coding: utf-8 -*-
# view imports
from django.views.generic import DetailView
# Only authenticated users can access views using this.
from braces.views import JSONResponseMixin
from rest_framework import viewsets, permissions
# Import the customized User model
from .models import Users
from .serializers import ... |
# coding: u8
from hashlib import md5 as _m5
from itertools import izip
import cPickle as pickle
import os
import time
from PIL import Image
import Levenshtein
md5 = lambda s: _m5(s).hexdigest()
class Otsu(object):
FAST_VAL = 255 # 只要是非0就可以
BINARY_THRESHOLD = 190 # 二值化阈值
def __init__(self, path=Non... |
from distutils.core import setup, Command
import os
import sys
import nose
class TestRunner(Command):
description = 'Run the metOcean unit tests'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
lib_dir = os.path.join(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.