text
stringlengths
475
200k
'''OpenGL extension NV.framebuffer_multisample_coverage This module customises the behaviour of the OpenGL.raw.GL.NV.framebuffer_multisample_coverage to provide a more Python-friendly API Overview (from the spec) This extension extends the EXT_framebuffer_multisample specification by providing a new function, ...
#!/usr/bin/env python # # Copyright 2008, 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: # # * Redistributions of source code must retain the above copyright # notice, this list...
from .exception import NoMatches, MultipleMatches from .named import NamedExtensionManager class DriverManager(NamedExtensionManager): """Load a single plugin with a given name from the namespace. :param namespace: The namespace for the entry points. :type namespace: str :param name: The name of the ...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio 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 2 of the # License, or (at your option) any...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): for sp in orm['cms.StaticPlaceholder'].objects.all(): sp.site = None ...
# -*- coding: utf-8 -*- # # test_connect_symmetric_pairwise_bernoulli.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, eithe...
""" Grade book view for instructor and pagination work (for grade book) which is currently use by ccx and instructor apps. """ import math from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import transaction from django.views.decorators.cache import cache_control ...
# -*- coding: utf-8 -*- from django.db import models from django.contrib.auth.models import User from mapeo.models import Persona from sorl.thumbnail import ImageField from multiselectfield import MultiSelectField # Create your models here. class FichaSombra(models.Model): productor = models.ForeignKey( Pe...
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL 3' __copyright__ = '2006, Ed Summers <[EMAIL]>' __docformat__ = 'restructuredtext en' from urlparse import urlparse, urlunparse, parse_qs from urllib import urlencode class Query(object): ...
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ from .defaults import defaults from .models import Request from .hooks import dispatch_hook from .utils import header_expand from .packages...
#!/usr/bin/env python # Copyright 2015 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. ''' python %prog Convert a perf trybot JSON file into a pleasing HTML page. It can read from standard input or via the --filename opt...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: aws_caller_facts short_de...
b = 256 q = 2**255 - 19 l = 2**252 + 27742317777372353535851937790883648493 def expmod(b,e,m): if e == 0: return 1 t = expmod(b,e/2,m)**2 % m if e & 1: t = (t*b) % m return t def inv(x): return expmod(x,q-2,q) d = -121665 * inv(121666) I = expmod(2,(q-1)/4,q) def xrecover(y): xx = (y*y-1) * inv(d*y*y+1)...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import templatefield try: from setuptools import setup except ImportError: from distutils.core import setup version = templatefield.__version__ if sys.argv[-1] == 'publish': try: import wheel except ImportError: prin...
import matplotlib from matplotlib import pyplot as plt import numpy as np matplotlib.rcParams.update({'font.size': 24}) matplotlib.rcParams.update({'text.usetex': True}) def lpnorm_scaled(x, p, mu): return (lpnorm(x, p, mu) - lpnorm(0, p, mu)) / (lpnorm(1, p, mu) - lpnorm(0, p, mu)) def lpnorm(x, p, mu): r...
# -*- coding: utf-8 -*- """ WSI_BOT_APPLY Assigns all patches in an image to one of the clusters in the codebook. @author: vlad """ from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * __author__ = 'Vlad Popovici' __version__ = 0.01 import argparse as opt from...
# Copyright 2014 NEC Corporation. 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 ...
# # AirMassChart.py -- AirMass chart plugin # # Eric Jeschke ([EMAIL]) # from datetime import timedelta #from dateutil import tz from ginga.gw import Widgets, Plot from ginga.misc import Bunch from qplan.plugins import PlBase from qplan.plots.airmass import AirMassPlot class AirMassChart(PlBase.Plugin): def __...
import unittest from p2pool.bitcoin import data, networks from p2pool.util import pack class Test(unittest.TestCase): def test_header_hash(self): assert data.hash256(data.block_header_type.pack(dict( version=1, previous_block=0x000000000000038a2a86b72387f93c51298298a732079b3b686df...
import os.path import tarfile from unittest import mock import pytest import pre_commit.constants as C from pre_commit import parse_shebang from pre_commit.languages import ruby from pre_commit.prefix import Prefix from pre_commit.util import cmd_output from pre_commit.util import resource_bytesio from testing.util i...
# # 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 us...
''' MathDoku solver module. @author: Radian Baskoro ''' import itertools from datetime import datetime from Utility import Utility class Solver: ''' Solver class used to solve the MathDoku problem. ''' __debugLevel = 0 __iterationCount = 0 __initFlag = False boardSize = 0 ...
from __future__ import unicode_literals import warnings from django import forms from django.conf import settings from django.contrib.admin.templatetags.admin_static import static from django.contrib.admin.utils import ( display_for_field, flatten_fieldsets, help_text_for_field, label_for_field, lookup_field,...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
import logging import os import pandas as pd import pytest from great_expectations.core.batch_spec import ( RuntimeQueryBatchSpec, SqlAlchemyDatasourceBatchSpec, ) from great_expectations.data_context.util import file_relative_path from great_expectations.exceptions import GreatExpectationsError from great_ex...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import re from collections import namedtuple from io import BytesIO from PIL import Image from reportlab....
from docutils import nodes, utils from docutils.parsers.rst import Directive from pygments.lexers import get_lexer_by_name, PythonLexer PythonLexer.name = 'Python 2' def setup(app): app.add_directive('switcher', SwitcherDirective) app.add_directive('case', CaseDirective) class SwitcherDirective(Directive): ...
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio ([EMAIL])" __copyright__ = "Copyright 2006, Joe...
# -*- coding: utf-8 -*- # Copyright (c) 2012 - 2015 Detlev Offenbach <[EMAIL]> # """ Module implementing a user agent manager. """ from __future__ import unicode_literals import os from PyQt5.QtCore import pyqtSignal, QObject, QXmlStreamReader from E5Gui import E5MessageBox from Utilities.AutoSaver import AutoSa...
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends import * from django.db.back...
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 ...
# Copyright (c) 2018 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' inventory: statichost short_description: Add a single host descripti...
#!/usr/bin/env python import sys import os from subprocess import * if len(sys.argv) <= 1: print('Usage: {0} training_file [testing_file]'.format(sys.argv[0])) raise SystemExit # svm, grid, and gnuplot executable files is_win32 = (sys.platform == 'win32') if not is_win32: svmscale_exe = "../svm-scale" svmtrain_...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import unicode_literals """ This module implements various transmuter classes. Transmuters are essentially classes that generate TransformedStructures from various data sources. They enable the...
# -*- coding: iso-8859-1 -*- """A sample implementation of SHA-1 in pure Python. Framework adapted from Dinu Gherman's MD5 implementation by J. Hallén and L. Creighton. SHA-1 implementation based directly on the text of the NIST standard FIPS PUB 180-1. """ __date__ = '2004-11-17' __version__ = 0.91 # Mo...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( determine_ext, ExtractorError, js_to_json, strip_jsonp, try_get, unified_strdate, update_url_query, ur...
"""clustering_stats Extracts basic statistics (ie. number of clusters, incorrectly clustered spectra) from .clustering files. This script only creates meaningful results if the .clustering file contains identification data which will be used to evaluate correctly and incorrectly clustered spectra. Usage: clusteri...
from django.conf import settings from django.utils.safestring import mark_safe from django.utils import six def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='', force_grouping=False): """ Gets a number (as a number or string), and returns it as a string, using formats ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Ordinary Least Squares and Ridge Regression Variance ========================================================= Due to the few points in each dimension and the straight line that linear regression uses to follow thes...
# 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...
""" Allow users to set and activate scenes. For more details about this component, please refer to the documentation at https://home-assistant.io/components/scene/ """ import asyncio import logging import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, CONF_PLATFORM, SERVICE_TURN_ON) from hom...
"""Define the notification type and track sent notifications.""" import logging from smtplib import SMTPException from future.utils import python_2_unicode_compatible from model_utils import Choices from model_utils.fields import MonitorField from model_utils.models import TimeStampedModel from django.conf import se...
# coding=utf-8 # Author: Nic Wolfe <[EMAIL]> # Author: Gordon Turner <[EMAIL]> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 Fo...
# 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. # pylint: disable=W0401,W0614 from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class SkiaBuildbotDesk...
from django import http from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, modify_settings, override_settings from django.utils import six from .middleware import RedirectFallbackMiddleware from .models...
#!/usr/bin/python # -*- mode: python -*- # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the...
#!/usr/bin/env python from __future__ import absolute_import from collections import OrderedDict from linchpin.InventoryFilters.InventoryFilter import InventoryFilter class Inventory(InventoryFilter): DEFAULT_HOSTNAMES = ['metadata.name'] def get_host_data(self, res, cfgs): """ Returns a d...
"""Stuff that differs in different Python versions and platform distributions.""" from __future__ import absolute_import, division import os import sys from pip._vendor.six import text_type try: from logging.config import dictConfig as logging_dictConfig except ImportError: from pip.compat.dictconfig import ...
"""Syncronizes cell Zookeeper with LDAP data. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import collections import itertools import logging import math import time import click import six from treadmill im...
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
"""Test Z-Wave switches.""" from unittest.mock import patch from homeassistant.components.zwave import switch from tests.mock.zwave import MockEntityValues, MockNode, MockValue, value_changed def test_get_device_detects_switch(mock_openzwave): """Test get_device returns a Z-Wave switch.""" node = MockNode()...
""" Copyright 2011 Software Freedom Conservancy. 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...
"""Rules based permissions for the crowdsource app""" # pylint: disable=missing-docstring, unused-argument, invalid-unary-operand-type # Third Party from rules import add_perm, always_deny, is_staff, predicate # MuckRock from muckrock.foia.rules import has_feature_level, skip_if_not_obj, user_authenticated @predic...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( fix_xml_ampersands, ) class MetacriticIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?metacritic\.com/.+?/trailers/(?P<id>\d+)' _TESTS = [{ 'url': 'http://www.metacritic.com/game/plays...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.names.common}. """ from __future__ import division, absolute_import from zope.interface.verify import verifyClass from twisted.internet.interfaces import IResolver from twisted.trial.unittest import SynchronousTestCase f...
""" Script that trains graph-conv models on HOPV dataset. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import numpy as np from deepchem.models import GraphConvModel np.random.seed(123) import tensorflow as tf tf.random.set_seed(123) import deepchem...
from pulpo_forms.fieldtypes import ModelField from pulpo_forms.fieldtypes import FieldFactory from .models import PulpoUser, Club, Country class PulpoUserField(ModelField.ModelField): prp_template_name = "usuario/properties.html" model = PulpoUser name = "PulpoUser" def get_assets(): return [...
#!/usr/bin/env python # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # ...
# -*- coding: utf-8 -*- # Copyright (C) 2011, 2012 Sebastian Wiesner <[EMAIL]> # This library 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 2.1 of the License, or (at your # option) an...
import arrow from mendeley.models.common import Discipline, Photo, Location, Education, Employment from mendeley.response import SessionResponseObject class Profile(SessionResponseObject): """ A Mendeley profile. .. attribute:: id .. attribute:: first_name .. attribute:: last_name .. attribu...
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 "...
#!/usr/bin/env python #============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the...
#!/usr/bin/python # Copyright 2011 Software Freedom Conservancy. # # 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 app...
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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: # # * Redistributions of source code must retain the above ...
#!python import json import os.path import cherrypy from cherrypy import tools from mako.lookup import TemplateLookup from tentacle.cthulhu.operation import CthulhuData from tentacle.cthulhu.datastore import * from tentacle.shared.screed import Screed from aetypes import end print '------------- CThulhu is alive' c...
import signal from .daemon import Daemon from .signal_handler import SignalHandler class DaemonBuilder: """Builder class for Daemon""" @staticmethod def build(main_function, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): """Builds the daemon and returns SignalHandler instanc...
# -*- coding: windows-1252 -*- import BIFFRecords import Style from Cell import StrCell, BlankCell, NumberCell, FormulaCell, MulBlankCell, BooleanCell, ErrorCell, \ _get_cells_biff_data_mul import ExcelFormula import datetime as dt from Formatting import Font try: from decimal import Decimal except ImportErro...
"""Implementation of the DOM Level 3 'LS-Load' feature.""" import copy import xml.dom from xml.dom.NodeFilter import NodeFilter __all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"] class Options: """Features object that has variables set for each DOMBuilder feature. The DOMBuilder class uses a...
# 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...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the command-line interfaces to conch. """ try: import pyasn1 except ImportError: pyasn1Skip = "Cannot run without PyASN1" else: pyasn1Skip = None try: import Crypto except ImportError: cryptoSkip = "can't run w...
import cgi import json import os import traceback import urllib import urlparse from constants import content_types from pipes import Pipeline, template from ranges import RangeParser from request import Authentication from response import MultipartContent from utils import HTTPException __all__ = ["file_handler", "p...
# datalogger.py # Logs the data from the acceleromter to a file on the SD-card import pyb # creating objects accel = pyb.Accel() blue = pyb.LED(4) switch = pyb.Switch() # loop while True: # wait for interrupt # this reduces power consumption while waiting for switch press pyb.wfi() # start if switc...
from rx.core import ObservableBase, Observer, AnonymousObserver, Disposable from rx.disposables import CompositeDisposable from .subscription import Subscription from .reactive_assert import AssertList class ColdObservable(ObservableBase): def __init__(self, scheduler, messages): super(ColdObservable, se...
""" ======================================================= Gabors / Primary Visual Cortex "Simple Cells" from Lena ======================================================= How to build a (bio-plausible) "sparse" dictionary (or 'codebook', or 'filterbank') for e.g. image classification without any fancy math and with j...
#!/usr/bin/env python ## # wrapping: A program making it easy to use hyperparameter # optimization software. # Copyright (C) 2013 Katharina Eggensperger and Matthias Feurer # # 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 # ...
from xmodule import templates from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA_SPLIT_MODULESTORE from xmodule.course_module import CourseDescriptor from xmodule.seq...
# Copyright (C) 2015-2021 by the RBniCS authors # # This file is part of RBniCS. # # SPDX-License-Identifier: LGPL-3.0-or-later import inspect import types from rbnics.utils.cache import cache from rbnics.utils.decorators.dispatch import dispatch def ReductionMethodDecoratorFor(Algorithm, replaces=None, replaces_if=...
# Copyright 2014 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 ag...
import logging import time from datetime import datetime from boto.sdb.db.model import Model from boto.sdb.db.property import StringProperty, IntegerProperty, BooleanProperty from boto.sdb.db.property import DateTimeProperty, FloatProperty, ReferenceProperty from boto.sdb.db.property import PasswordProperty, ListPrope...
#!/usr/bin/env python3 import argparse import dataclasses import glob import os import subprocess import sys try: import colorama as c GREEN = c.Fore.GREEN YELLOW = c.Fore.YELLOW RED = c.Fore.RED RESET_ALL = c.Style.RESET_ALL BRIGHT = c.Style.BRIGHT except ImportError: GREEN = YELLOW = RED ...
import sys, os from esky.bdist_esky import Executable from distutils.core import setup import assetjet from deploy import exeName, appName from glob import glob def get_data_files(dirs): """ Recursively include data directories. """ results = [] for directory in dirs: for root, dirs, files ...
########################################################################## # # Copyright (c) 2009-2010, 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: # # * Redis...
from nose.tools import * import networkx as nx from networkx.utils import * class X(object): def __eq__(self, other): raise self is other def __ne__(self, other): raise self is not other def __lt__(self, other): raise TypeError('cannot compare') def __le__(self, other): ...
# -*- test-case-name: twisted.words.test.test_tap -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Shiny new words service maker """ import sys, socket from twisted.application import strports from twisted.application.service import MultiService from twisted.python import usage from twi...
# 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 # distributed under t...
#!/usr/bin/python2.6 # # Copyright 2011 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...
# 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 u...
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import errno import os import socket import stat import sys import time from gunicorn import util from gunicorn.six import string_types SD_LISTEN_FDS_START = 3 class BaseSocket(object): ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
"""Loading unittests.""" import os import re import sys import traceback import types import unittest from fnmatch import fnmatch from unittest2 import case, suite try: from os.path import relpath except ImportError: from unittest2.compatibility import relpath __unittest = True def _CmpToKey(mycmp): ...
import csv from cStringIO import StringIO from django.views.generic import TemplateView from django.utils.decorators import method_decorator from django.contrib.auth.decorators import user_passes_test from django.http import HttpResponse from . import models as hs_tracking class UseTrackingView(TemplateView): t...
#Your code here #You can import some modules or create additional functions def checkio(maze_map): #replace this for solution #This is just example for first maze MOVE = {"S": (1, 0), "N": (-1, 0), "W": (0, -1), "E": (0, 1)} copy_maze_map = [row[:] for row in maze_map] #print type(copy_maze_map) ...
# -*- coding: utf-8 -*- """ The module :mod:`openerp.tests.common` provides unittest2 test cases and a few helpers and classes to write tests. """ import errno import glob import importlib import json import logging import os import select import subprocess import threading import time import itertools import unittest...
import pygame import random from pygame.locals import* pygame.init() x = 800 y = 600 janela = pygame.display.set_mode((x, y)) fundo_verde = (4, 166, 1) # cor do fundo da tela cor_letra = (0, 0, 0) # cor da letra cor_cursor = (50, 60, 50) cor_cobra = (255, 55, 255) red = (255, 0, 0) # s...
# Copyright 2016-2021 The Matrix.org Foundation C.I.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...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, GeekChimp - Franck Nijhof <[EMAIL]> # # Ansible 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...
""" Initial configuration. """ from __future__ import unicode_literals __all__ = ( 'STARTUP_COMMANDS' ) STARTUP_COMMANDS = """ bind-key '"' split-window -v bind-key % split-window -h bind-key c new-window bind-key Right select-pane -R bind-key Left select-pane -L bind-key Up select-pane -U bind-key Down select-pa...
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import TestCase, assert_array_almost_equal, dec, \ assert_equal, assert_, run_module_suite from common import FUNCS_TP, FLAPACK_IS_EMPTY, CLAPACK_IS_EMPTY, FUNCS_FLAPACK, \ ...