gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.l...
from django.db.models.aggregates import Count from corehq.apps.accounting.filters import DateCreatedFilter from corehq.apps.reports.datatables import ( DataTablesColumn, DataTablesHeader, ) from corehq.apps.reports.generic import GenericTabularReport from corehq.apps.sms.models import ( INCOMING, OUTGOI...
############################################################################# # Code for managing and training a variational Iterative Refinement Model. # ############################################################################# # basic python import numpy as np import numpy.random as npr from collections import ...
""" HTML Widget classes """ from __future__ import absolute_import, unicode_literals import copy from itertools import chain import warnings from django.conf import settings from django.forms.util import flatatt, to_current_timezone from django.utils.datastructures import MultiValueDict, MergeDict from django.utils....
import numpy as np import scipy.optimize as opt import scipy.sparse as sps import numpy.linalg as nla import scipy.linalg as sla import time def nnlsm_blockpivot(A, B, is_input_prod=False, init=None): """ Nonnegativity-constrained least squares with block principal pivoting method and column grouping Solves ...
# Copyright (c) 2016 PaddlePaddle 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 applic...
#!/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...
# -*- coding: utf-8 -*- # Copyright 2022 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
#! /usr/bin/env python3 import sys import math import glob from mule.InfoError import * from mule.postprocessing.JobData import * from mule.postprocessing.JobsData import * from mule_local.postprocessing.PlaneDataPhysicalDiff import * class pickle_PlaneDataPhysicalDiff(InfoError): def __init__( se...
# # CatalogsBase.py -- Catalogs plugin for Ginga fits viewer # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # from ginga.misc import Bunch, Future from ginga import Gin...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
"""Support for Xiaomi Philips Lights.""" import asyncio import datetime from datetime import timedelta from functools import partial import logging from math import ceil import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_HS_COLOR, ATTR_COLOR_TEMP, ATTR_ENTITY_I...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright (c) 2014 Matthias Klumpp <mak@debian.org> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, me...
import datetime import json import operator from functools import reduce from pathlib import Path from django.conf import settings from django.core.cache import cache from django.db import models, transaction from django.utils.functional import cached_property from django.utils.html import strip_tags from django_hosts...
import pp, os, sys, time, dill, operator import readFromFile from SA_LCP import SA_LCP import Utils from ArrRef import ArrRef from ArrRef import eBits #from transpose import transpose #from transpose import blockTrans from compS import compS dill.settings['recurse'] = True _BSIZE = 2048 _SCAN_LOG_BSIZE = 10 _SCAN_BSI...
"""setuptools.command.bdist_egg Build .egg distributions""" from distutils.dir_util import remove_tree, mkpath from distutils import log from types import CodeType import sys import os import re import textwrap import marshal from pkg_resources import get_build_platform, Distribution from setuptools.extension import...
# LXC Python Library # for compatibility with LXC 0.8 and 0.9 # on Ubuntu 12.04/12.10/13.04 # Author: Elie Deloumeau # Contact: elie@deloumeau.fr # The MIT License (MIT) # Copyright (c) 2013 Elie Deloumeau # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associate...
from group import Group import itertools def start(force_algo, debug=False): create_groups(force_algo, debug) if debug: for group in force_algo.groups: print group find_special_groups(force_algo, debug) force_algo.groups = sorted(force_algo.groups, cmp=group_compare) find_...
#!/usr/bin/env python3 import locale locale.setlocale(locale.LC_ALL,'en_US.UTF-8') import prompt_lmfst import math import functools #NOTE: See the if __name__ == "__main__": block below for a description # The weights dict defines relative probabilities of transitions. # They are normalised at each state so that the ...
#!/usr/bin/env python3 """Extracts text samples from UDHR translations. Translations exist for myriad languages at varying levels of support. The tool focuses on Stage 4+ translations for which the UDHR translation has a reliable amount of content and structure for scraping text samples. See more at https://www.unico...
import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from numpy.testing import assert_raises from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix, dok_matrix, lil_matrix) from scipy.spatial import cKDTree from sklearn import neighbors,...
"""Implement configuration file parsing.""" # Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # Copyright (C) 2015--2017 The Contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not u...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
import copy import random import math PARTICLES = 108 TEMPERATURE = 2.0 TIME_STEP = 0.003 ANDERSEN_FREQUENCY = 0.01 CUTOFF = 2.5 class Particle: #Particle properties position = [0, 0, 0] previous_position = None velocity = [0, 0, 0] force = [0, 0, 0] potential = 0 virial = 0 def __in...
# 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 # distrib...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from abc i...
# -*- coding: utf-8 -*- """ The heart of the ecstasy package, containing the main *Parser* class. """ import re import warnings import collections import ecstasy.flags as flags import ecstasy.errors as errors def beautify(string, *args, **kwargs): """ Convenient interface to the ecstasy package. Arguments: ...
# Copyright 2020 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Expansion of realms_config.Realm into a flat form.""" import collections from components.auth.proto import realms_pb2 from components.config ...
import numpy import six import chainer from chainer import backend from chainer.backends import cuda from chainer import function_node from chainer.utils import argument from chainer.utils import type_check def _sigmoid_grad(x, y, gy): return chainer.functions.activation.sigmoid.SigmoidGrad((x,)).apply( ...
#!/usr/bin/env python """ VMat Class @author: Alicia Schep, Greenleaf Lab, Stanford University """ #Import necessary python modules from scipy import signal, ndimage import numpy as np from copy import copy import matplotlib.pyplot as plt class VMat_Error(Exception): """Class for errors in VMat function""" d...
# -*- coding: utf-8 -*- import os import sys import heapq from random import random, randint import tcod from .keys import wait_for_user_input, handle_game_user_input from ..logger import get_logger from .windows import create_windows from .rendering import render_all from ..algorithms.pathing import create_dijkstra_...
# coding: utf-8 import re import os import shutil import subprocess from string import Template from monty.io import zopen from monty.json import MSONable from pymatgen.core.structure import Molecule """ This module implements input and output processing for Fiesta (http://perso.neel.cnrs.fr/xavier.blase/fiesta/in...
# xpyBuild - eXtensible Python-based Build System # # Copyright (c) 2013 - 2019 Software AG, Darmstadt, Germany and/or its licensors # # 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 # # ...
# -*- coding: utf-8 -*- # Copyright 2013 Google Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to u...
from pandac.PandaModules import * from toontown.toonbase.ToonBaseGlobal import * from DistributedMinigame import * from direct.interval.IntervalGlobal import * from direct.fsm import ClassicFSM, State from direct.fsm import State from toontown.safezone import Walk from toontown.toonbase import ToontownTimer from direct...
# -*- coding: utf-8 -*- __doc__ = """ The manager module provides a selected classes to handle websocket's execution. Initially the rationale was to: - Externalize the way the CherryPy server had been setup as its websocket management was too tightly coupled with the plugin implementation. - Offer a management th...
import numpy import chainer from chainer import configuration from chainer import cuda from chainer import function from chainer.utils import argument from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn libcudnn = cudnn.cudnn def _as4darray(arr): if arr.ndim == 0: retu...
#!/usr/bin/env python # # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (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.moz...
# -*- coding: UTF-8 -*- """Easy to use object-oriented thread pool framework. A thread pool is an object that maintains a pool of worker threads to perform time consuming operations in parallel. It assigns jobs to the threads by putting them in a work request queue, where they are picked up by the next available threa...
# Copyright (C) 2013 Coders at Work from base import ComponentBase from keyvalue import KeyValueStore from environment import NullEnvironment, SystemEnvironment from executer import Executer from metadata import MetaDataFile import util from collections import OrderedDict import datetime import getpass import inspec...
import redis as rdb import traceback import datetime import platform import aiohttp import asyncio import json #############Color for Terminal############################### #Whole line, and easier to debug def prRed(prt): print("\033[91m{}\033[00m".format(prt)) def prGreen(prt): print("\033[92m{}\033[00m".format(prt)...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
""" This file contains some utility functions to calculate hessian matrix and its inverse. Author: Chen Shangyu (schen025@e.ntu.edu.sg) """ import torch import torch.nn as nn import torch.backends.cudnn as cudnn from torch.autograd import Variable from datetime import datetime import tensorflow as tf import os im...
# -*- coding: UTF-8 -*- __author__ = 'mcxiaoke' import sqlite3 from datetime import datetime from contextlib import closing from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash import config import utils # create app app = Flask(__name__) app...
import ConfigParser import os import itertools import logging import logging.config import logging.handlers import platform import string import subprocess import sys import glob import inspect import traceback import re import imp import socket from socket import gaierror from optparse import OptionParser, Values from...
import datetime from dateutil.parser import parse from decimal import Decimal import re from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.utils import datetime_safe, importlib from tastypie.bundle import Bundle from tastypie.exceptions import ApiFieldError, NotFound from tastypi...
from __future__ import unicode_literals from prompt_toolkit.application import get_app from prompt_toolkit.filters import has_focus, Condition from prompt_toolkit.key_binding import KeyBindings from prompt_toolkit.key_binding.bindings.scroll import scroll_page_up, scroll_page_down, scroll_one_line_down, scroll_one_line...
from evoplotter import utils from evoplotter import plotter from evoplotter import printer from evoplotter import reporting from evoplotter.dims import * from gecco19_utils import * def simplify_benchmark_name(name): """Shortens or modifies the path of the benchmark in order to make the table more readable.""" ...
#!/usr/bin/env python3 # # Copyright (c) 2020 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 import abc import binascii import logging logger = logging.getLogger("gdbstub") class GdbStub(abc.ABC): def __init__(self, logfile, elffile): self.logfile = logfile self.elffile = elffile ...
#!/usr/bin/env python # # Copyright (c) 2015 All rights reserved # This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # # http://www.apache.org/licenses/LICENSE-2.0 # """Rally testcases implement...
""" Helper functions for creating Form classes from Django models and database field objects. """ from __future__ import unicode_literals from collections import OrderedDict from django.core.exceptions import ( ImproperlyConfigured, ValidationError, NON_FIELD_ERRORS, FieldError) from django.forms.fields import F...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
""" #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This file is part of the Smart Developer Hub Project: http://www.smartdeveloperhub.org Center for Open Middleware http://www.centeropenmiddleware.com/ #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=...
# Copyright (c) 2011 Martin Vilcans # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php from __future__ import with_statement import os import os.path from screenplain.types import * from screenplain.richstring import plain class tag(object): """Handler for automatically openi...
#!usr/local/bin #sidgan from pylab import * import pylab import scipy import os import numpy import sys import sklearn from sklearn.kernel_approximation import RBFSampler import sklearn.cluster import optparse from sklearn.decomposition import RandomizedPCA from sklearn.neighbors import KNeighborsClassifier fr...
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
# 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 ...
from django.conf.urls import patterns, include, url from citizengrid import cg_api_views import os from . import settings # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() # Routers provide an easy way of automatically determining the URL conf. router = cg_api_v...
#!/usr/bin/env python from abc import ABCMeta, abstractmethod from os import listdir, path from re import findall from urllib2 import urlopen class Parser: __metaclass__ = ABCMeta def __init__(self, url, regex): self.url = url self.regex = regex def newest(self): if self.url is None: return ...
""" homeassistant.bootstrap ~~~~~~~~~~~~~~~~~~~~~~~ Provides methods to bootstrap a home assistant instance. Each method will return a tuple (bus, statemachine). After bootstrapping you can add your own components or start by calling homeassistant.start_home_assistant(bus) """ import os import logging from collectio...
from django import forms from django.conf import settings from django.template import loader from django.template import RequestContext from django.utils.translation import ugettext as _ from satchmo.configuration import config_value, config_choice_values from satchmo.contact.forms import ContactInfoForm from satchmo.c...
# coding=utf-8 # Copyright 2020 The SimCLR 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 or...
import os import unittest import vtk, qt, ctk, slicer from slicer.ScriptedLoadableModule import * import logging # # GraphCutSegmentSelfTest # class GraphCutSegmentSelfTest(ScriptedLoadableModule): """Uses ScriptedLoadableModule base class, available at: https://github.com/Slicer/Slicer/blob/master/Base/Python/sl...
#=============================================================================== # Copyright 2007 Matt Chaput # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/li...
import socket import select from struct import * import hashlib import base64 import json import gc import Client from urllib import quote #properties: # - The server will kick out the client if the server detects that the client tampered with the client-side code if the client breaks protocol # - Any special chara...
# -*- coding: utf-8 -*- """All classes and routines related to files.""" from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import logging import os import os.path import re import jinja2 import jinja2.meta import six import scd.utils try: from...
# KVS_test.py 27/05/2016 D.J.Whale # # Tester for Key Value Store import unittest from lifecycle import * from KVS import KVS, NotPersistableError #---- DUMMY TEST CLASSES ------------------------------------------------------ class TV(): def __init__(self, id): print("Creating TV %s" % id) sel...
"""Test the nuki config flow.""" from unittest.mock import patch from pynuki.bridge import InvalidCredentialsException from requests.exceptions import RequestException from homeassistant import config_entries, data_entry_flow from homeassistant.components import dhcp from homeassistant.components.nuki.const import DO...
""" Defines the RangeSelection controller class. """ # Major library imports import numpy # Chaco imports from range_selection import RangeSelection class RangeSelection2D(RangeSelection): """ Selects a range along the index or value axis for plots on 2D data, such as image plots The user right-clic...
''' Python wrapper for the Content Services API ''' import json import math from datetime import datetime from copy import deepcopy from wsgiref.handlers import format_date_time from time import mktime from cache import NoCache import utils import logging log = logging.getLogger('p2p') import requests from .adapter...
""" /*-------------------------------------------------------------------*/ /* */ /* Copyright IBM Corp. 2013 All Rights Reserved */ /* */ /*--------------------------...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging from os import getcwd from os.path import abspath from pyscaffold.log import ( DEFAULT_LOGGER, ColoredReportFormatter, ReportFormatter, ReportLogger, logger, configure_logger ) from .log_helpers import ansi_regex, last_log, make_reco...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import scipy.stats import matplotlib.lines import matplotlib.pyplot as plt import seaborn as sns from antlia import filter as ff from antlia import util metrics_dtype = np.dtype([ ('sinusoid amplitude', '<f8'), ('sinusoid period', '<f8'), ('...
from test.lib.testing import eq_ from sqlalchemy import * from test.lib import * from test.lib.schema import Table, Column from sqlalchemy.types import TypeDecorator from test.lib import fixtures class ReturningTest(fixtures.TestBase, AssertsExecutionResults): __requires__ = 'returning', def setup(self): ...
#!/usr/bin/env python3 # 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...
#!/usr/bin/env python """Bootstrap setuptools installation To use setuptools in your package's setup.py, include this file in the same directory and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() To require a specific version of setuptools, set a download mirror, ...
import errno import json import logging import os import select import subprocess import threading from io import BytesIO from typing import Any, Dict, List, Mapping, Text, Tuple, Union from pkg_resources import resource_stream class JavascriptException(Exception): pass _logger = logging.getLogger("cwltool") ...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- """ test_django-watchman ------------ Tests for `django-watchman` views module. """ from __future__ import unicode_literals import json import sys import unittest from importlib import reload from unittest.mock import patch import django from django.conf import settings from django.contrib....
#!/usr/bin/env python # Copyright (C) 2015 OpenStack, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# -*- coding: utf-8 -*- import httplib as http import pkgutil import mock from nose import SkipTest from nose.tools import * # flake8: noqa from tests.base import ApiTestCase from osf_tests import factories from framework.auth.oauth_scopes import CoreScopes from api.base.settings.defaults import API_BASE from api...
# # upip - Package manager for MicroPython # # Copyright (c) 2015-2018 Paul Sokolovsky # # Licensed under the MIT license. # import sys import gc import uos as os import uerrno as errno import ujson as json import uzlib import upip_utarfile as tarfile gc.collect() debug = False index_urls = ["https://micropython.org...
import csv import logging.config from datetime import datetime import numpy as np import requests from django.core.exceptions import ValidationError from django.db import close_old_connections from django.db.utils import OperationalError from lxml import html from scipy.sparse import dok_matrix from sklearn.metrics im...
import subprocess import binascii from zope.interface import implements from lbrynet.lbryfile.StreamDescriptor import save_sd_info from lbrynet.cryptstream.client.CryptStreamDownloader import CryptStreamDownloader from lbrynet.core.client.StreamProgressManager import FullStreamProgressManager from lbrynet.core.Stream...
import json import logging import markdown from django.contrib.auth.models import User from django.db import models from django.db.models import Q from django.template.defaultfilters import slugify from django.template.loader import render_to_string from django.utils import timezone from django.utils.translation import...
# Copyright 2013 OpenStack Foundation # # 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either version 3, or (at your option) any later # version. # # This program is distributed in the...
""" This module was taken from the PBSUITE (v 14.9.9) available at http://sourceforge.net/projects/pb-jelly/ It has been published with the follwing licencsing: ################################################## Copyright (c) '2013 Baylor College of Medicine Contributors: Adam English (english@bcm.ed...
""" CodeHilite Extension for Python-Markdown ======================================== Adds code/syntax highlighting to standard Python-Markdown code blocks. See <https://Python-Markdown.github.io/extensions/code_hilite> for documentation. Original code Copyright 2006-2008 [Waylan Limberg](http://achinghead.com/). A...
""" Tests for sigfoxapi. The following environment variables have to be set: SIGFOX_LOGIN_ID SIGFOX_PASSWORD SIGFOX_DEVICETYPE_ID SIGFOX_DEVICE_ID SIGFOX_USER_ID SIGFOX_GROUP_ID WARNING: These tests operate against the live Sigfox backend. Some tests are specific to my personal setup. """ from __future__ ...
import time def timer_counter(func): def wrapper(*args, **kwargs): start_time = int(round(time.time() * 1000)) result = func(*args, **kwargs) end_time = int(round(time.time() * 1000)) args[0].api_counter += 1 args[0].api_timer += (end_time - start_time) args[0].api_...
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
import functools import logging from typing import Callable, Optional, Any, Tuple, List import hw_intf from app_config import AppConfig from common import CancelException, HwNotInitialized from hw_common import HWDevice, HWType from wnd_utils import WndUtils log = logging.getLogger('dmt.wallet_tools_dlg') class Act...
import math, random, time, copy import pygame import pygame.gfxdraw from ttws_types import * from puzzle import Puzzle from loader import decode_pb # Taken from http://pygame.org/project-AAfilledRoundedRect-2349-.html def aafilled_rounded_rect(surface, rect, colour, radius=0.4, angle=0): """ Radius is corner r...
""" Tests for the following offsets: - BMonthBegin - BMonthEnd """ from __future__ import annotations from datetime import datetime import pytest from pandas._libs.tslibs.offsets import MonthOffset import pandas as pd from pandas.tests.tseries.offsets.common import ( Base, assert_is_on_offset, assert_of...
# Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. from zope.interface import implements from twisted.internet import defer from twisted.trial import unittest from twisted.words.protocols.jabber import sasl, sasl_mechanisms, xmlstream, jid from twisted.words.xish import domish NS_XMPP_S...
import codecs import json import os import shutil import socket import subprocess import tempfile from contextlib import contextmanager from cStringIO import StringIO from django.conf import settings from django.core import mail from django.core.files.storage import default_storage as storage from django.core.urlresol...
from __future__ import division, absolute_import, print_function import sys import time from datetime import date import numpy as np from numpy.testing import ( assert_, assert_equal, assert_allclose, assert_raises, ) from numpy.lib._iotools import ( LineSplitter, NameValidator, StringConverter, has_n...
""" setuptools must be installed first. If you do not have setuptools installed please download and install it from http://pypi.python.org/pypi/setuptools """ import os import sys import subprocess import re import setuptools from numpy.distutils.core import setup import numpy curdir = os.path.abspath(os.path.dirname...