gt
stringclasses
1 value
context
stringlengths
2.49k
119k
#!/usr/bin/python import json import time import os import logging import boto3 import botocore import re from . import create_logger from datetime import datetime, timedelta from .utils import ( does_key_exist, read_s3, put_object_s3 ) from .vars import ( AWS_REGION, AWS_REGION_NAMES ) from .except...
# # Copyright 2014 Facebook # # 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, s...
from django.db import models from django.contrib.auth.models import User from jsonfield import JSONField from django.utils import timezone class Language(models.Model): def __unicode__(self): # __unicode__ on Python 2 return self.name TARGET = ( ('Test', 'Testsite'), ...
import sys import unittest import tkinter from tkinter import ttk from test.support import requires, run_unittest, swap_attr from tkinter.test.support import AbstractTkTest, destroy_default_root requires('gui') class LabeledScaleTest(AbstractTkTest, unittest.TestCase): def tearDown(self): self.root.updat...
#!/usr/bin/env python """ ==================== Generators - Classic ==================== Unit tests for various classic graph generators in generators/classic.py """ from nose.tools import * from networkx import * from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic is_isomorphic=graph_could_...
# 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...
# coding: utf-8 """ This file was originally derived from https://github.com/pypa/pip/blob/3e713708088aedb1cde32f3c94333d6e29aaf86e/src/pip/_internal/pep425tags.py The following license covers that code: Copyright (c) 2008-2018 The pip developers (see AUTHORS.txt file) Permission is hereby granted, free of charge, ...
from sqlalchemy import schema as sa_schema, types as sqltypes, sql import logging from .. import compat import re from ..compat import string_types log = logging.getLogger(__name__) def _render_potential_expr(value, autogen_context): if isinstance(value, sql.ClauseElement): if compat.sqla_08: ...
"""Support for ESPHome lights.""" from __future__ import annotations from typing import Any, cast from aioesphomeapi import APIVersion, LightColorCapability, LightInfo, LightState from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_FLASH, ATTR_RGB_COLO...
from ConfigParser import SafeConfigParser, NoOptionError import re import os import shlex __all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSet', 'read_config', 'parse_flags'] _VAR = re.compile('\$\{([a-zA-Z0-9_-]+)\}') class FormatError(IOError): """ Exception thrown when there is a p...
## # Copyright (c) 2010-2015 Apple 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 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 ...
# by amounra 0216 : http://www.aumhaa.com from itertools import imap from ableton.v2.control_surface.mode import * from aumhaa.v2.base.debug import initialize_debug debug = initialize_debug() class SendSysexMode(Mode): def __init__(self, script = None, sysex = None, *a, **k): super(SendSysexMode, self).__init...
# -*- coding: utf-8 -*- """ core runtime ~~~~~~~~~~~~ platform internals and logic to discover/load/inject. :author: Sam Gammon <sg@samgammon.com> :copyright: (c) Sam Gammon, 2014 :license: This software makes use of the MIT Open Source License. A copy of this license is included as ``LICENS...
""" 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 this ...
"""Zookeeper Serializers, Deserializers, and NamedTuple objects""" from collections import namedtuple import struct from kazoo.exceptions import EXCEPTIONS from kazoo.protocol.states import ZnodeStat from kazoo.security import ACL from kazoo.security import Id import six # Struct objects with formats compiled bool_s...
# Copyright 2017 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...
from csv2_common import check_keys, requests, show_active_user_groups, show_table from subprocess import Popen, PIPE import os # ---------------------------------------------------------------------------------------------------------------------- def get_form_data_and_update_count(gvar, mandatory, required, optiona...
#!/usr/bin/python # Copyright 2013 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. """Patch an orderfile. Starting with a list of symbols in a binary and an orderfile (ordered list of sections), matches the symbols in the...
# =============================================================================== # Copyright 2017 ross # # 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/LICE...
# Copyright 2015 DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2022 The Brax 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 agreed to in wri...
# Copyright 2017 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 -*- """ Created on Fri Oct 04 13:19:01 2013 Author: Josef Perktold """ from __future__ import print_function from statsmodels.compat.python import lrange, lmap import numpy as np from numpy.testing import assert_allclose, assert_almost_equal, assert_equal from statsmodels import iolib from statsm...
import numpy as N import os, sys try: import pycuda.autoinit GPU = True except:# ImportError or pycuda._driver.LogicError if NVIDIA graphic card is not available GPU = False try: import fftw3 FFTW = True except ImportError: FFTW = False if FFTW: MODULS = {N.float64: fftw3, ...
import mock import unittest from vnc_api.vnc_api import * from svc_monitor.virtual_machine_manager import VirtualMachineManager from svc_monitor.config_db import * import test_common_utils as test_utils class VirtualMachineManagerTest(unittest.TestCase): def setUp(self): VirtualMachineSM._cassandra = mock....
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2014 KenV99 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any l...
"""`PulseTrain`, `BiphasicPulseTrain`, `AsymmetricBiphasicPulseTrain`""" import numpy as np import logging # DT: Sampling time step (ms); defines the duration of the signal edge # transitions: from .base import Stimulus from .pulses import BiphasicPulse, AsymmetricBiphasicPulse, MonophasicPulse from ..utils.constants ...
""" This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) """ import datetime import decimal from gluon.storage import Storage from gluon.html import TAG, XmlComponent, xmlescape from gluon.languages import lazyT ...
# ccm clusters from six import print_, iteritems from six.moves import xrange import yaml import os import subprocess import shutil import time from ccmlib import common, repository from ccmlib.node import Node, NodeError from ccmlib.bulkloader import BulkLoader class Cluster(object): def __init__(self, path, n...
# Copyright 2011 Gilt Groupe, INC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
"""Alexa message handlers.""" import logging import math from homeassistant import core as ha from homeassistant.components import ( camera, cover, fan, group, input_number, light, media_player, timer, vacuum, ) from homeassistant.components.climate import const as climate from home...
from .common import * import av from fractions import Fraction from av.buffer import Buffer from av.packet import Packet from av.audio.resampler import AudioResampler def iter_frames(container, stream): for packet in container.demux(stream): for frame in packet.decode(): yield frame def iter_r...
# Copyright (c) The University of Edinburgh 2014-2015 # # 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...
""" Load mean geopotential heights and plot in colour """ import os, sys import matplotlib.pyplot as plt import matplotlib.cm as mpl_cm from mpl_toolkits.basemap import Basemap import iris import iris.analysis.cartography import numpy as np import imp import h5py import cartopy.crs as ccrs import scipy.interpolate ...
#! /usr/bin/env python """ Copyright [1999-2016] EMBL-European Bioinformatics Institute 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 requir...
#!/usr/bin/env pythoni # coding:utf-8 # # kobuki.py from serial import Serial import numpy as np import cv2 import time import csv import os from datetime import datetime from primesense import openni2#, niite2 from primesense import _openni2 as c_api # Path to OpenNI redistribution OpenNI2.so dist = '/usr/lib/' cla...
import pickle, datetime, os, shutil import percolation as P from twython import Twython from twython import TwythonStreamer import parsedatetime as pdt parser=pdt.Calendar() from dateutil.parser import parse from maccess import tw2 as tw c=P.utils.check def publishSearch(fname,fpath,aname=None,scriptpath=None,created...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") else: access = Ser...
import unittest import itertools import numpy import six import chainer from chainer import backend from chainer import functions from chainer import testing from chainer.utils import conv from chainer.utils import type_check def xs_iter(dims): return itertools.product(*[range(d) for d in dims]) def kxs_iter(...
import os from datetime import datetime, timedelta from focus import errors from focus.task import Task from focus.plugin import registration from focus_unittest import FocusTestCase, MockPlugin _ACTIVE_FILE_DATA = """active_task { name "test"; start_time "2012-04-23 15:18:22.000000"; } """ _TASK_FILE_DATA =...
""" Module for fetching artifacts from Artifactory """ import http.client import logging import os import urllib.request import xml.etree.ElementTree as ET from urllib.error import HTTPError, URLError import salt.utils.files import salt.utils.hashutils import salt.utils.stringutils from salt.exceptions import Command...
# Copyright 2019 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 functools from blinkbuild.name_style_converter import NameStyleConverter from .composition_parts import WithDebugInfo from .composition_parts import...
import os import logging from datetime import datetime, timedelta import requests from flask import Flask, request, session, url_for, redirect, abort, jsonify, render_template app = Flask(__name__) app.secret_key = os.environ['FLASK_SECRET_KEY'] logging.basicConfig(level='DEBUG') GITLAB_HOST = os.environ['GITLAB_...
from __future__ import print_function import sqlite3 import matplotlib import pandas as pd import flask from sys import maxint import os # http://stackoverflow.com/questions/2801882/generating-a-png-with-matplotlib-when-display-is-undefined#3054314 # Force matplotlib to not use any Xwindows backend. matplotlib.use('Ag...
# -*- coding: utf-8 -*- """ Tests for the standard library PEP 543 shim. """ import pep543 import pep543.stdlib import pytest from .backend_tests import SimpleNegotiation CONTEXTS = ( pep543.stdlib.STDLIB_BACKEND.client_context, pep543.stdlib.STDLIB_BACKEND.server_context ) def wrap_buffers(context): ...
# coding=utf-8 # Copyright 2022 The Tensor2Robot 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 ...
""" mbed SDK Copyright (c) 2011-2016 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
# -*- coding: utf-8 -*- """An extension of the objectfilter to provide plaso specific options.""" import datetime import logging from plaso.formatters import manager as formatters_manager from plaso.formatters import mediator as formatters_mediator # TODO: Changes this so it becomes an attribute instead of having ba...
# Copyright 2017 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 2020 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, sof...
from django import forms from django.contrib.auth import get_user_model from django.contrib.auth.models import Group, Permission from django.core.exceptions import ImproperlyConfigured from django.core.files.uploadedfile import SimpleUploadedFile from django.http import HttpRequest, HttpResponse from django.test import...
#!/usr/bin/env python # # Copyright (C) 2014 Narf Industries <info@narfindustries.com> # # 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 # th...
#---------------------------------------------------------------------------- # Name: clroses.py # Purpose: Class definitions for Roses interactive display programs. # # Author: Ric Werme # WWW: http://WermeNH.com/roses # # Created: June 2007 # CVS-ID: $Id$ # Copyright: Public ...
# 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 ...
#!/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 # "...
""" core implementation of testing process: init, session, runtest loop. """ from __future__ import absolute_import, division, print_function import contextlib import functools import os import pkgutil import six import sys import _pytest from _pytest import nodes import _pytest._code import py from _pytest.config i...
import search from math import(cos, pi) import numpy # A sample map problem sumner_map = search.UndirectedGraph(dict( Portland=dict(Mitchellville=7, Fairfield=17, Cottontown=18), Cottontown=dict(Portland=18), Fairfield=dict(Mitchellville=21, Portland=17), Mitchellville=dict(Portland=7, Fairfield=21), )) '...
"""Support for Toon sensors.""" import logging from homeassistant.config_entries import ConfigEntry from homeassistant.helpers.typing import HomeAssistantType from homeassistant.const import ENERGY_KILO_WATT_HOUR, POWER_WATT from . import ( ToonData, ToonEntity, ToonElectricityMeterDeviceEntity, ToonG...
# Copyright 2016 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...
""" Load npy xy, plot and save """ import os, sys import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! import matplotlib.pyplot as plt import matplotlib.cm as mpl_cm from matplotlib import rc from matplotlib.font_manager import FontProperties from matplotlib import rcPa...
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 # pylint: disable=W0621 # redefined-outer-name import hashlib import logging import os import subprocess import sys from typing import Any, Dict, List, TextIO import pexpect import pytest from _pytest.fixtures i...
import os import os.path import cherrypy from cherrypy.lib import static from cherrypy.lib.static import serve_file import shutil import tempfile import glob import random from clarityviz import claritybase from clarityviz import densitygraph as dg from clarityviz import atlasregiongraph as arg import networkx as nx...
# -*- Mode: Python -*- ############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompan...
#!/usr/bin/env python try: import gevent except ImportError: gevent = False import pickle import socket import struct import time import random from .formatter import GraphiteStructuredFormatter _module_instance = None default_graphite_pickle_port = 2004 default_graphite_plaintext_port = 2003 default_graph...
import os import tempfile import unittest from tempfile import TemporaryDirectory from mkdocs import exceptions from mkdocs.config import base, defaults from mkdocs.config.config_options import BaseConfigOption class ConfigBaseTests(unittest.TestCase): def test_unrecognised_keys(self): c = base.Config(...
# Copyright 2013 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. """Base class for linker-specific test cases. The custom dynamic linker can only be tested through a custom test case for various technical reasons: ...
import collections import os.path import sys import tempfile import textwrap import unittest from contextlib import ExitStack from unittest import mock import pyperf from pyperf import tests from pyperf._utils import create_pipe, MS_WINDOWS, shell_quote def check_args(loops, a, b): if a != 1: raise Value...
# # CORE # Copyright (c)2011-2015 the Boeing Company. # See the LICENSE file included in this distribution. # # Created on Dec 18, 2014 # # @author: santiago # import os import pwd import collections from core.netns import nodes from core.api import coreapi from core.misc.ipaddr import * from xml.dom.minidom import D...
# -*- encoding: utf-8 -*- import re import copy import operator from collections import OrderedDict try: from functools import reduce except ImportError: pass from django.core.exceptions import FieldDoesNotExist from django.template.loader import render_to_string from django.db.models import QuerySet try: ...
#!/usr/bin/env python # encoding: utf-8 ''' Created on Aug 4, 2016 @author: Yusuke Kawatsu ''' # built-in modules. import calendar import datetime # my modules. from server.util import connect_db class CostStore(object): ''' return & store estimated charge. ''' def __init__(self, aws_access_k...
# 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...
#!/usr/bin/env python """Distutils based setup script for SymPy. This uses Distutils (http://python.org/sigs/distutils-sig/) the standard python mechanism for installing packages. For the easiest installation just type the command (you'll probably need root privileges for that): python setup.py install This will...
#****************************************************************************** # (C) 2018, Stefan Korner, Austria * # * # The Space Python Library is free software; you can redistribute it and/or * ...
# -*- 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...
# -*- coding: utf-8 -*- # # 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 #...
#!/usr/bin/python # Copyright (c) 2012 The Native Client 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 os import re import struct import subprocess import sys import tempfile import test_format BUNDLE_SIZE = 32 def Create...
# -*- coding: utf-8 -*- # # 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 #...
import numpy import echidna.output as output from echidna.errors.custom_errors import LimitError, CompatibilityError from echidna.limit import summary from echidna.output import store import logging import time class Limit(object): """ Class to handle main limit setting. Args: signal (:class:`echidna...
import datetime from pprint import pprint from bs4 import BeautifulSoup from dateutil.parser import * from urllib.request import urlopen from DBManager import DBManager def calc_timedelta(fastest_time, driver_time): try: fastest = datetime.datetime.strptime(fastest_time, "%M:%S.%f") driver_best ...
from DistributedMinigameAI import * from toontown.ai.ToonBarrier import * from direct.fsm import ClassicFSM, State from direct.directnotify import DirectNotifyGlobal from toontown.minigame import ToonBlitzGlobals from math import sqrt class DistributedTwoDGameAI(DistributedMinigameAI): notify = DirectNotifyGlobal....
# pylint: disable=function-redefined from typing import Dict, Union from prompt_toolkit.application.current import get_app from prompt_toolkit.buffer import Buffer, SelectionType, indent, unindent from prompt_toolkit.completion import CompleteEvent from prompt_toolkit.filters import ( Condition, emacs_insert_m...
#=============================================================================== # Copyright (c) 2015, Max Zwiessele # 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 sour...
""" Tests for the backend objects. We instantiate local copies of the backends and invoke the entry points for the protocol methods. We do not set up any server processes or communicate over sockets. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals impor...
""" A place for code to be called from core C-code. Some things are more easily handled Python. """ from __future__ import division, absolute_import, print_function import re import sys from numpy.compat import asbytes, basestring from .multiarray import dtype, array, ndarray import ctypes from .numerictypes import...
# Copyright (c) 2015 Canonical 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 applicable law or ...
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import logging import sleekxmpp from optparse import OptionParser from xml.etree import cElementTree as ET import os import time import sys i...
# -*- coding: utf-8 -*- # Copyright (c) 2017-2020, XESS Corp. The MIT License (MIT). from __future__ import absolute_import, division, print_function, unicode_literals import json import math import operator from builtins import dict, int, str, super from collections import Counter, namedtuple from copy import copy ...
# # The Python Imaging Library. # $Id$ # ## # Image plugin for Palm pixmap images (output only). ## __version__ = "1.0" import Image, ImageFile _Palm8BitColormapValues = ( ( 255, 255, 255 ), ( 255, 204, 255 ), ( 255, 153, 255 ), ( 255, 102, 255 ), ( 255, 51, 255 ), ( 255, 0, 255 ), ( 255, 255, 204 ), ( 2...
# flake8: noqa I201 from .Child import Child from .Node import Node DECL_NODES = [ # type-assignment -> '=' type Node('TypeInitializerClause', kind='Syntax', children=[ Child('Equal', kind='EqualToken'), Child('Value', kind='Type'), ]), # typealias-declaration ...
"""Copyright (c) 2010-2012 David Rio Vierra Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA...
from snappy import * from random import randrange from collections import OrderedDict import multiprocessing class NeumannZagierDatum(): """ description of class, comment entire class """ def __init__(self, manifold, engine=None, verbose=False, file_name=None): self.manifold = manifold ...
# Copyright 2011 Andrew Bogott for the Wikimedia 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-...
# -*- coding: utf-8 -*- # OpenGL example code - Perspective # set up a perspective projection and render a rotating cube import ctypes import numpy as np from OpenGL.GL import * from OpenGL.GL import shaders from glfw import * import glm class Window(object): def __init__(self, width=640, height=480, title='...
"""Tests for auto_ptr feature""" from unittest import mock from django.contrib.auth import get_user_model from django.test import TestCase from powerdns.models import Domain, Record, get_ptr_obj from .utils import ( DomainFactory, DomainTemplateFactory, RecordFactory, RecordTemplateFactory, asser...
""" Test the importing module. This module relies heavily on an external service and requires quite a bit of mocking. """ import os import pytest from django.conf import settings from django.test import TestCase, override_settings from mock import patch from molo.core.api import importers from molo.core.api.errors imp...
# 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...
#!/usr/bin/env python ############################################################################### # Copyright 2017 The Apollo 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 ...
import mimeparse from django.contrib.auth.models import AnonymousUser from hyperadmin.states import State class APIRequest(object): """ An API Request """ def __init__(self, site, path, url_args, url_kwargs): self.site = site self.path = path self.url_args = url_args ...
import os import logging from django.conf import settings from django.contrib.gis.db import models from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator from django.template.defaultfilters import slugify from django.utils.translation import get_language, ugettext_lazy ...