gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt # SETUP: # install pip install --upgrade dropbox # # Create new Dropbox App # # in conf.py, set oauth2 settings # dropbox_access_key # dropbox_access_secret from __future__ im...
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requi...
# Copyright 2012 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. from __future__ import absolute_import import optparse import os import unittest from telemetry.internal.browser import browser_options import mock class ...
import json import os import random import unittest import warnings from copy import deepcopy import numpy as np from scipy.misc import central_diff_weights from pymatgen.core.lattice import Lattice from pymatgen.core.structure import Structure from pymatgen.analysis.elasticity.elastic import ( ComplianceTensor, ...
# coding=utf-8 """ Collect the solr stats for the local node #### Dependencies * posixpath * urllib2 * json """ import posixpath import urllib2 import re try: import json json # workaround for pyflakes issue #13 except ImportError: import simplejson as json import diamond.collector class SolrCo...
########################################################################## # # Copyright (c) 2013, 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...
"""The test for binary_sensor device automation.""" from datetime import timedelta from unittest.mock import patch import pytest import homeassistant.components.automation as automation from homeassistant.components.binary_sensor import DEVICE_CLASSES, DOMAIN from homeassistant.components.binary_sensor.device_conditi...
#!./env/bin/python """ OpenBazaar launcher script. Authors: Angel "gubatron" Leon """ import argparse import multiprocessing import os import shlex import sys import threading import psutil import node.network_util as network_util from node.openbazaar_daemon import node_starter, OpenBazaarContext, start_node import ...
#!/usr/bin/python # # linearize-data.py: Construct a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Deuscoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import print_fun...
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition def sigmoid(x): return numpy.tanh(x * 0.5) * 0.5 + 0.5 def _split(in...
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
""" codegen.py generates pika/spec.py The required spec json file can be found at https://github.com/rabbitmq/rabbitmq-codegen . After cloning it run the following to generate a spec.py file: python2 ./codegen.py ../../rabbitmq-codegen """ from __future__ import nested_scopes import os import re import sys if sys.v...
# -*- 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 # # Unless required by applicab...
import pytest from plenum.server.batch_handlers.node_reg_handler import NodeRegHandler from plenum.server.consensus.primary_selector import RoundRobinNodeRegPrimariesSelector from plenum.server.database_manager import DatabaseManager from plenum.test.greek import genNodeNames @pytest.fixture() def node_reg_handler()...
# -*- coding: utf-8 -*- import sys, os, re, time, getopt, marshal, fnmatch from StringIO import StringIO from glob import glob python3 = sys.version_info[0] == 3 if python3: xrange = range ## global vars encoding = None mode = 'class' # 'class' or 'dict' lang = None quiet = None template_dir = 'templat...
""" Implementation of Flexx' event loop based on asyncio. """ # Note: there are some unusual constructs here, such as ``if xx is True``. # These are there to avoid inefficient JS code as this code is transpiled # using PScript. This code is quite performance crirical. import asyncio import threading from . import lo...
"""Collection of useful functions for the HomeKit component.""" from collections import OrderedDict, namedtuple import logging import voluptuous as vol from homeassistant.components import fan, media_player, sensor from homeassistant.const import ( ATTR_CODE, ATTR_SUPPORTED_FEATURES, CONF_NAME, CONF_T...
#!/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...
# import pprint from simpletable import enum, SimpleTable table = SimpleTable TYPE = enum( # immutable types 'VOID', 'BOOLEAN', 'NUMBER', 'STRING', 'COMPOUND', 'PRIMITIVE', 'SYMBOL', # mutable types 'LIST', 'TABLE', # mapper key_mapper=lambda s: s ) def identical...
# -*- coding: utf-8 -*- '''The stages of the experiment. ''' from functools import partial from time import strftime, sleep from re import match, compile import csv from os.path import exists, splitext import tables as tb from random import randint, shuffle from fractions import Fraction from moa.stage import MoaSta...
# Copyright 2018 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
import logging log = logging.getLogger(__name__) import pickle as pickle from copy import deepcopy import numpy as np from atom.api import Typed, Bool, Str, observe, Property from enaml.application import deferred_call from enaml.layout.api import InsertItem, InsertTab from enaml.workbench.plugin import Plugin from...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Metacloud, 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 # ...
#!/usr/bin/env python from generator.actions import Actions from random import randint import random import math import numpy import struct VGF_MAGIC = 0x78330909 VGF_VERSION = 0x0001 VGF_OBJECT_RECT = 0 VGF_OBJECT_TRIANGLE = 1 VGF_OBJECT_LINE = 2 VGF_OBJECT_CIRCLE = 3 VGF_OBJECT_SQUARE = 4 VGF_OBJECT_SPRAY = 5 VGF_...
# Copyright 2011 OpenStack Foundation # 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 requ...
#!/usr/bin/python # -- Content-Encoding: UTF-8 -- """ Herald Remote Services discovery :author: Thomas Calmant :copyright: Copyright 2014, isandlaTech :license: Apache License 2.0 :version: 0.0.1 :status: Alpha .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); ...
#!/usr/bin/env python3 # Copyright (c) 2015-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Functionality to build scripts, as well as SignatureHash(). This file is modified from python-bitcoinl...
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
from __future__ import division, print_function, absolute_import import sys import math import numpy as np from numpy import sqrt, cos, sin, arctan, exp, log, pi, Inf from numpy.testing import (assert_, assert_allclose, assert_array_less, assert_almost_equal, assert_raises) import pytest from scipy.integrate ...
# Copyright 2018 The Oppia 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 applicable ...
import __future__ import struct import time import base64 import subprocess import random import time import datetime import os import sys import trace import shlex import zlib import threading import BaseHTTPServer import zipfile import io import imp from os.path import expanduser from StringIO import StringIO from th...
from core.himesis import Himesis, HimesisPreConditionPatternLHS import cPickle as pickle from uuid import UUID class HMoveOneInputRepeatedDirectMatchDiffRulesLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HMoveOneInputRepeatedDir...
"""The tests for the Google speech platform.""" import asyncio import os import shutil from homeassistant.components.media_player.const import ( ATTR_MEDIA_CONTENT_ID, DOMAIN as DOMAIN_MP, SERVICE_PLAY_MEDIA, ) import homeassistant.components.tts as tts from homeassistant.config import async_process_ha_cor...
#!/usr/bin/env python3 ## -*- coding: utf-8 -*- from __future__ import print_function from triton import * from unicorn import * from unicorn.arm_const import * import pprint import random import sys ADDR = 0x100000 STACK = 0x200000 HEAP = 0x300000 SIZE = 5 * 1024 * 1024 CODE ...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributi...
import threading import traceback from contextlib import contextmanager import smach __all__ = ['Iterator'] class Iterator(smach.container.Container): """Sequence Container This container inherits functionality from L{smach.StateMachine} and adds some auto-generated transitions that create a sequence o...
from django.core.management import call_command from django.test import TransactionTestCase, Client from django.core.exceptions import ValidationError from .. import models, forms import logging logging.disable(logging.ERROR) class DefaultCredentialFormTests(TransactionTestCase): c = Client() path = '/credent...
########################################################################## # # Copyright (c) 2013-2015, 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: # # * Redi...
# Copyright 2013-2016 The Meson development 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 law or agree...
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================= # Copyright (c) Ostap developpers. # ============================================================================= ## @file ostap/math/tests/test_math_interpolation.py # Test module for the fi...
# Copyright (C) 2016 Nippon Telegraph and Telephone 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Python-nvd3 is a Python wrapper for NVD3 graph library. NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. Project location : https://github.com/areski/python-nvd3 """ from optparse import Optio...
""" Highlight. A library for managing code highlighting. All Changes Copyright 2014-2017 Isaac Muse. --- CodeHilite Extension for Python-Markdown ======================================== Adds code/syntax highlighting to standard Python-Markdown code blocks. See <https://pythonhosted.org/Markdown/extensions/code_h...
#!/usr/bin/python # ex:set fileencoding=utf-8: from __future__ import unicode_literals from django.apps import apps from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ValidationErro...
""" Interface to communicate with Facebook Messenger https://developers.facebook.com/docs/messenger-platform/send-api-reference """ import json import requests import warnings from enum import Enum class NotificationType(Enum): REGULAR = "REGULAR" SILENT_PUSH = "SILENT_PUSH" NO_PUSH = "NO_PUSH" ...
#!/usr/bin/env python # Copyright 2012 Hewlett-Packard Development Company, L.P. # # 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...
# encoding: utf-8 # module sys # from (built-in) # by generator 1.138 """ This module provides access to some objects used or maintained by the interpreter and to functions that interact strongly with the interpreter. Dynamic objects: argv -- command line arguments; argv[0] is the script pathname if known path -- mod...
#!/usr/bin/env python import argparse import errno import os import subprocess import sys import tempfile from lib.config import PLATFORM, get_target_arch, get_chromedriver_version, \ get_platform_key from lib.util import atom_gyp, execute, get_atom_shell_version, parse_version, \ ...
from __future__ import unicode_literals import re from six.moves.urllib.parse import urlparse from moto.core.responses import BaseResponse from moto.core.utils import amz_crc32, amzn_request_id from .utils import parse_message_attributes from .models import sqs_backends from .exceptions import ( MessageAttributes...
from __future__ import unicode_literals from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.db.models.options import normalize_together from django.utils import six from django.utils.functional import cached_property fro...
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.parties.CalendarGuiDay from panda3d.core import Plane, PlaneNode, TextNode from direct.gui.DirectGui import DirectFrame, DirectLabel, DirectButton, DirectScrolledList, DGG from direct.gui import DirectGuiGlobals from toontown.ai import HolidayGlobals f...
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google 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: # # 1. Redistributions of source code must retain the above copyri...
#!/usr/bin/env python # -*- coding: utf-8 -*- # generated by wxGlade 0.6.3 on Thu Feb 11 04:08:55 2010 import wx import webbrowser import wx.lib.iewin_old as iewin import wx.lib.sized_controls as sc import config import update import time import httplib import os # begin wxGlade: extracode # end wxGlade class Upda...
"""Tests for the integration of a twinly device.""" from typing import Tuple from unittest.mock import patch from homeassistant.components.twinkly.const import ( CONF_ENTRY_HOST, CONF_ENTRY_ID, CONF_ENTRY_MODEL, CONF_ENTRY_NAME, DOMAIN as TWINKLY_DOMAIN, ) from homeassistant.components.twinkly.lig...
from __future__ import absolute_import from runcmd import runcmd, Run_Cmd_Error import celery import celery.utils.log import os import stat import pprint import pylut import redis_logger import fsitem import time import celeryconfig import broker_url # A note about naming convention of functions in this module: # sync...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright (c) 2021, TU Wien, Department of Geodesy and Geoinformation # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice,...
def getValues(hand): """Pull the values out of the hand. :param hand: list of 5 lists of value, suit pairs :return: list of 5 ints """ return sorted([c[0] for c in hand]) def getSuits(hand): """Pull the suits out of the hand :param hand: list of 5 lists of value, suit pairs :return: l...
# Copyright 2014 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. import logging import os import re import socket import struct import subprocess from telemetry.core.backends import adb_commands from telemetry.core import...
import decimal from threading import local from django.db import DEFAULT_DB_ALIAS from django.db.backends import util from django.utils import datetime_safe from django.utils.importlib import import_module class BaseDatabaseWrapper(local): """ Represents a database connection. """ ops = None vendo...
# 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 use ...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """Use blog post test to test user permissions logic""" import frappe import frappe.defaults import unittest import json import frappe.model.meta from frappe.core.page.user_permi...
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Bo Maryniuk <bo@suse.de>` ''' # Import Python Libs from __future__ import absolute_import # Import Salt Testing Libs from salttesting import TestCase, skipIf from salttesting.mock import ( Mock, MagicMock, call, patch, NO_MOCK, NO_MOCK_REASO...
# -*- coding: utf-8 -*- from nose.tools import * # noqa import mock import responses from tests.base import OsfTestCase from tests.factories import AuthUserFactory, ProjectFactory import urlparse from framework.auth.core import Auth from website.addons.mendeley.tests.factories import ( MendeleyAccountFactory...
import os import operator import sys import contextlib import itertools import unittest from distutils.errors import DistutilsError, DistutilsOptionError from distutils import log from unittest import TestLoader from pkg_resources import ( resource_listdir, resource_exists, normalize_path, working_set,...
from __future__ import absolute_import, division, print_function import numpy as np import json import pytest from ..state import (GlueSerializer, GlueUnSerializer, saver, loader, VersionedDict) from ...external import six from ... import core from ...qt.glue_application import GlueApplication f...
#!/usr/bin/env python import unittest2 as unittest import inspect from functools import wraps from nose.plugins.skip import SkipTest import redis import redis.client import fakeredis def redis_must_be_running(cls): # This can probably be improved. This will determines # at import time if the tests should ...
from insights.parsers.journald_conf import EtcJournaldConf, EtcJournaldConfD, UsrJournaldConfD from insights.combiners.journald_conf import JournaldConfAll from insights.tests import context_wrap # /etc/systemd/journald.conf JOURNALD_CONF_1 = """ [Journal] #Storage=auto Storage=persistent #Compress=yes #Seal=yes Seal=...
""" ******************************************************************************** geometry ******************************************************************************** .. currentmodule:: compas.geometry Primitives ========== Bases ----- .. autosummary:: :toctree: generated/ :nosignatures: Geomet...
import unittest from brennivin.pyobjcomparer import compare, get_compound_diff, assert_compare def make1(f=0.000000001): return [1, {}, {'a': [1, 2, 3], 'b': {'1': 1}}, 1.1 + 0.01, f] def make2(): return range(6) class sphere(object): def _...
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
############################################################################### ## fs.py ## 9te [angband.ornl.gov] ## Wed Jan 12 10:37:50 2011 ############################################################################### ## Copyright (C) 2008 Oak Ridge National Laboratory, UT-Battelle, LLC. ##------------------------...
# -*- coding: utf-8 -*- import itertools import os import random import string from django.test import RequestFactory from django.conf import settings from django.contrib.auth.models import Group, Permission from django.contrib.auth import get_user_model from django.contrib.messages.storage.fallback import FallbackSto...
#!/usr/bin/env python2 # This file is part of the dune-hdd project: # https://github.com/pymor/dune-hdd # Copyright Holders: Felix Schindler # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) '''Dune LRBMS demo. Usage: thermalblock_main.py CONFIGFILE Arguments: CONFIGFILE File that c...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
import os import sys import pygmaps import webbrowser import numpy as np from math import sin, radians, cos, asin, sqrt, atan2, pi from googleStreetView import GoogleStreetView from config import CONFIG EARTH_RADIUS_KM = 6371.0 class CustomedProgress(object): """ Used to print the progress for a long-running ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from future.utils import tobytes from past.builtins import basestring from future.moves.urllib.parse import urlparse import ...
import markdown import os from prose_wc import wc import pypandoc from django.contrib.auth.models import User from django.urls import reverse from django.db import models from django.template.defaultfilters import slugify from django.utils import timezone def original_file_path(instance, filename): return os.pat...
"""Tools to summarise the output of (multiple calls to) evaluation, confidence, etc.""" # TODO: PlotSystems: legend in plot # TODO: examples for documentation (including different output formats) # TODO: scores as percentage? from __future__ import print_function, absolute_import, division import os import math impor...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('lists', '0010_demographicsmapping'), ] operations = [ migrations.AlterField( mo...
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS # environment import ftplib import asyncore import asynchat import socket import StringIO import errno import os try: import ssl except ImportError: ssl = None from unittest import TestCase from test import t...
import os import re import sys from glob import glob import pkg_resources from distutils.command.sdist import sdist as _sdist from distutils.util import convert_path from distutils import log from setuptools import svn_utils READMES = ('README', 'README.rst', 'README.txt') def walk_revctrl(dirname=''): """Find ...
import numpy as np from scipy.io import loadmat # This module began as an excerpt from the one in python-gsw. # Based on Robert Kern's Bunch; taken from # http://currents.soest.hawaii.edu/hgstage/pycurrents/ # pycurrents/system/utilities.py def complex_interp(x, xp, fp, **kw): if fp.dtype.kind == "c": ...
import math import urllib.request as urlr import pickle class WeatherStation: def __init__(self): self.attributes = ["station_name", "latitude", "longitude", "xml_url"] self.station_info = {} def print_station_info(self): for attribute in self.attributes: print(attribut...
# -*- coding: utf-8 -*- """ celery.abstract ~~~~~~~~~~~~~~~ Implements components and boot-steps. :copyright: (c) 2009 - 2012 by Ask Solem. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from collections import defaultdict from importlib import import_mod...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack LLC. # 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/...
# -*- coding: utf-8 -*- import time from pokemongo_bot import logger from pokemongo_bot.human_behaviour import (normalized_reticle_size, sleep, spin_modifier) class PokemonCatchWorker(object): BAG_FULL = 'bag_full' NO_POKEBALLS = 'no_pokeballs' def __init__(self...
import unittest import os import numpy as np import geosoft import geosoft.gxapi as gxapi import geosoft.gxpy.gx as gx import geosoft.gxpy.map as gxmap import geosoft.gxpy.view as gxv import geosoft.gxpy.geometry as gxgm import geosoft.gxpy.coordinate_system as gxcs import geosoft.gxpy.system as gxsys import geosoft.g...
#!/usr/bin/env python # -*- coding: utf-8 -* """UdPyBlog: Multi User Blog Module""" import os import jinja2 import hashlib import hmac import string import random import datetime import webapp2 import re import logging import json import sys import cgi import time from paging import PagedQuery from webapp2_extras imp...
"""Tests for certbot.hooks.""" import os import stat import unittest import mock from certbot import errors from certbot.tests import util class ValidateHooksTest(unittest.TestCase): """Tests for certbot.hooks.validate_hooks.""" @classmethod def _call(cls, *args, **kwargs): from certbot.hooks i...
# -*- coding: utf-8 -*- from cleo.formatters import OutputFormatter, OutputFormatterStyle from .. import CleoTestCase class OutputFormatterTest(CleoTestCase): def test_empty_tag(self): formatter = OutputFormatter(True) self.assertEqual('foo<>bar', formatter.format('foo<>bar')) def test_lg_...
# coding=utf-8 """ Collect the solr stats for the local node #### Dependencies * posixpath * urllib2 * json """ import posixpath import urllib2 try: import json except ImportError: import simplejson as json import diamond.collector class SolrCollector(diamond.collector.Collector): def __init__(...
from __future__ import with_statement import sys import time import re import socket from select import select from fabric.state import env, output, win32 from fabric.auth import get_password, set_password import fabric.network from fabric.network import ssh, normalize from fabric.utils import RingBuffer from fabric....
#!/usr/bin/python2.4 # # Copyright 2009 Google 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...
from rest_framework import viewsets, permissions, status, generics from rest_framework.exceptions import APIException from rest_framework.decorators import list_route, detail_route from rest_framework.response import Response from django.db.models import Q from django_filters.rest_framework import DjangoFilterBackend f...