gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Ported from a Java benchmark whose history is : # This is adapted from a benchmark written by John Ellis and Pete Kovac # of Post Communications. # It was modified by Hans Boehm of Silicon Graphics. # # This is no substitute for real applications. No actual application # is likely to behave in exactl...
#!/usr/bin/env python3 # # Copyright 2018 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. """Deploys and runs a test package on a Fuchsia target.""" import argparse import os import shutil import sys import tempfile impo...
#! /usr/bin/env python """ Module with S/N calculation functions. We strongly recommend users to read Mawet et al. (2014) before using routines of this module: https://ui.adsabs.harvard.edu/abs/2014ApJ...792...97M/abstract """ __author__ = 'Carlos Alberto Gomez Gonzalez, O. Absil @ ULg, V. Christiaens' __all__ = ['s...
# Copyright (c) 2010-2012 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 agree...
import html from collections import namedtuple from django.urls import reverse from django.utils.html import format_html from django.utils.translation import ugettext as _ from corehq.apps.data_interfaces.models import AutomaticUpdateRule from corehq.apps.sms.models import ( INCOMING, OUTGOING, SMS, W...
""" Design Matrix ============= This tutorial illustrates how to use the Design_Matrix class to flexibly create design matrices that can then be used with the Brain_Data class to perform univariate regression. Design Matrices can be thought of as "enhanced" pandas dataframes; they can do everything a pandas dataframe...
import six import warnings from datetime import datetime from .. import errors from .. import utils from ..utils.utils import create_networking_config, create_endpoint_config class ContainerApiMixin(object): @utils.check_resource def attach(self, container, stdout=True, stderr=True, stream=Fal...
from __future__ import print_function, absolute_import from pymatgen.io.adf import AdfKey, AdfTask, AdfOutput, AdfInput from pymatgen.core.structure import Molecule import unittest import os from os.path import join __author__ = 'Xin Chen, chenxin13@mails.tsinghua.edu.cn' test_dir = os.path.join(os.path.dirname(__f...
""" Storefront and Metadata Model Access """ import logging from django.core.urlresolvers import reverse from django.db import connection from django.db.models import Count from django.db.models.functions import Lower from django.db.models import F import msgpack # import ozpcenter.api.listing.serializers as listing...
import bcrypt import calendar import os import time import model WEB_SESSION_DB_NAME = 'websdb.dat' DEFAULT_EXPIRY_SECS = 60 * 60 def ensure_string( s ): if( isinstance( s, unicode ) ): return s.encode( 'utf-8' ) else: return str( s ) class WebSessionAccess: def __init__( self ): ...
# Copyright (c) 2010-2011 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 agree...
# -*- coding: utf-8 -*- import socket import struct import errno import json from binascii import hexlify, unhexlify from django.db import models try: from django.utils.timezone import now as dt_now except ImportError: import datetime dt_now = datetime.datetime.now from django_fields.fields import Encryp...
"""Node (User) Class for Paxos Calendar.""" import os import sys import time import thread import pickle import socket import logging from Bully import bully_algorithm from Appointment import Appointment from Calendar import Calendar from Proposer import Proposer from Acceptor import Acceptor class Node(object): ...
# -*- coding: utf-8 -*- """ Sahana Eden Supply Model @copyright: 2009-2012 (c) Sahana Software Foundation @license: MIT 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 withou...
#!/system/xbin/env python3 # {{{ # Added changes necessary to make a full device manifest run to completion # on a Samsung SM-P607T lt03ltetmo with python-3.4.2 # }}} # {{{ # 20151125.224423.4390855 Added changes to compensate for failed # surrogateescape conversion of filenames in the recycle bin. # since it is possib...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from guildwars2api.base import BaseResource class Item(BaseResource): """ BaseResource class for an Item. See https://wiki.guildwars2.com/wiki/API:2/items Parameters for a request id: a single ID ids: a comma-delimited string of IDs ...
# -*- 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 #...
# CRITs environment chooser import errno import glob import os import sys import django import subprocess from pymongo import ReadPreference, MongoClient from mongoengine import connect sys.path.insert(0, os.path.dirname(__file__)) # calculated paths for django and the site # used as starting points for various oth...
# Copyright (c) 2019 UAVCAN Consortium # This software is distributed under the terms of the MIT License. # Author: Pavel Kirienko <pavel@uavcan.org> import typing import asyncio import logging import warnings import dataclasses import pyuavcan.transport from ._session import RedundantInputSession, RedundantOutputSess...
# Copyright 2015 Christian Kramer # # 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 writ...
# Copyright 2019 DeepMind Technologies Limited. 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 ...
# # 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...
"""sympify -- convert objects SymPy internal format""" from __future__ import print_function, division from inspect import getmro from .core import all_classes as sympy_classes from .compatibility import iterable, string_types, range from .evaluate import global_evaluate class SympifyError(ValueError): def __i...
""" Jennifer's scientific computing cheatsheet - arrays and numerical analysis. Contents: - numpy & ndarray basics - Basic operations and functions with ndarrays - Type conversions - Basic indexing and slicing - Boolean indexing - Fancy indexing - Conditional logic and array operations - Transposing arrays and swappin...
"""The tests for generic camera component.""" import asyncio from http import HTTPStatus from unittest.mock import patch import aiohttp import httpx import pytest import respx from homeassistant import config as hass_config from homeassistant.components.camera import async_get_mjpeg_stream from homeassistant.componen...
from folder import Folder from article import Article import permissions from pyramid import security from bson.objectid import ObjectId import pyes from cms import dbutil from users import UserCollection, GroupCollection, User, generate_random_password from trash import Trash class Root(Folder): _object_ty...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
import math import os import click import time import datetime from time import mktime from itertools import chain, islice import json import copy import pandas as pd from cachetools import cached, TTLCache from pymongo.errors import DuplicateKeyError from tqdm import tqdm from mwclient import Site from pymongo import ...
#!/usr/bin/env python """ Copyright 2010-2017 University Of Southern California Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by appli...
""" Form classes """ from __future__ import unicode_literals import copy import datetime from collections import OrderedDict from django.core.exceptions import NON_FIELD_ERRORS, ValidationError from django.forms.fields import Field, FileField from django.forms.utils import ErrorDict, ErrorList, flatatt from django.f...
from string import rfind from string import digits from Evaluation import Evaluation class Algorithm: """Gives a cluster list after running HAC""" def __init__(self,similarity_table,unordered_filelist, list_of_files): self._list_of_files = list_of_files #given as parameter, this is result of ...
# Copyright 2020 The Forseti Security 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 a...
"""Strptime-related classes and functions. CLASSES: LocaleTime -- Discovers and stores locale-specific time information TimeRE -- Creates regexes for pattern matching a string of text containing time information FUNCTIONS: _getlang -- Figure out what language is being used for the locale ...
# Copyright 2014 Insight Software Consortium. # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt """ defines classes, that describe C++ types """ from . import compilers from . import algorithms_cache class type_t(object): ...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import contextlib import copy import importlib.util import logging import math import os import sys import warnings from collections import de...
""" kombu.utils =========== Internal utilities. """ from __future__ import absolute_import, print_function import importlib import random import sys from contextlib import contextmanager from itertools import count, repeat from time import sleep from uuid import UUID, uuid4 as _uuid4, _uuid_generate_random from ko...
#!/usr/bin/python """ Mr Freeze A simple Python-based backup script to make sure your websites are kept on ice (aka, backed up). """ import os import imp import time import glob import logging import smtplib import argparse import subprocess logger = logging.getLogger('mr_freeze') def snapshot(interval, site, settin...
# ---------------------------------------------------------------------------- # cocos2d # Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa, # Lucio Torre # Copyright (c) 2009-2015 Richard Jones, Claudio Canepa # All rights reserved. # # Redistribution and use in source and binary forms, with o...
# # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # BitBake Toaster Implementation # # Copyright (C) 2013 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # pub...
"""Tests for disco_config utilities.""" from unittest import TestCase from copy import deepcopy from ConfigParser import NoOptionError from mock import patch, Mock from disco_aws_automation import disco_config, exceptions from tests.helpers.patch_disco_aws import MockAsiaqConfig @patch("disco_aws_automation.disco_c...
''' update: 2014/09/03: softmax in the last layer ''' import theano import theano.tensor as T import gzip import cPickle import numpy import time class HiddenLayer(object): def __init__(self, rng, input, n_in, n_out, W=None, b=None, activation=T.tanh): self.input =...
import random from unittest import TestCase import mock import werkzeug from steinie import app from steinie import routing from . import utils def generate_example_environ(method="GET"): return { 'HTTP_HOST': 'example.com', 'PATH_INFO': '/', 'REQUEST_METHOD': method, 'wsgi.url_...
#!/usr/bin/python2 # 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 Creat...
# -*- test-case-name: twisted.test.test_pb -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ This module represents flavors of remotely acessible objects. Currently this is only objects accessible through Perspective Broker, but will hopefully encompass all forms of remote access which c...
# -*- coding: utf-8 -*- # Authors: Denis A. Engemann <denis.engemann@gmail.com> # Eric Larson <larson.eric.d@gmail.com> # License: Simplified BSD from os import path as op import numpy as np from scipy.sparse import csc_matrix from .open import read_tag, fiff_open from .tree import dir_tree_find from .write...
# Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# Copyright 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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 # -------------------------------------------------------------------------- # 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 ...
# -*- coding: utf-8 -*- import datetime import os import random import subprocess import time import traceback from urllib.parse import urlparse import github3 import unidiff from ..interfaces.base import InterfaceBase from ..util import git, system class GitHubInterface(InterfaceBase): def __init__( s...
# 2005/08/28 # v1.4.0 # listquote.py # Lists 'n' Quotes # Handling lists and quoted strings # Can be used for parsing/creating lists - or lines in a CSV file # And also quoting or unquoting elements. # Homepage : http://www.voidspace.org.uk/python/modules.shtml # Copyright Michael Foord, 2004 & 2005. # Released sub...
""" Allows for the computation of the PQ-Gram edit distance of two trees. To calculate the distance, a Profile object must first be created for each tree, then the edit_distance function can be called. For more information on the PQ-Gram algorithm, please see the README. """ import tree, copy class P...
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import logging import os import signal import time import traceback from builtins import ...
#!/usr/bin/env python2.1 """ Convert Intel HEX files to C code to embed USAGE: ihex2c.py input.a43 outname [const] This generates a file named "outname.ci" which contains an array named "unsigned short funclet_outname[]". That array contains the machine code from the input file. The optional argument "const" changes...
"""The WaveBlocks Project IOM plugin providing functions for handling various overlap matrices of linear combinations of general wavepackets. @author: R. Bourquin @copyright: Copyright (C) 2013 R. Bourquin @license: Modified BSD License """ import numpy as np def add_overlaplcwp(self, parameters, timeslots=None, m...
# Copyright (C) 2012-2013 Red Hat, 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 la...
import datetime import decimal import hashlib import logging import re from time import time from django.conf import settings from django.utils.encoding import force_bytes from django.utils.timezone import utc logger = logging.getLogger('django.db.backends') class CursorWrapper: def __init__(self, cursor, db): ...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import print_function, unicode_literals, absolute_import from functools import wraps import json import os import numbers impo...
import sys import re import textwrap from doctest import OutputChecker, ELLIPSIS from tests.test_pip import reset_env, run_pip, write_file, get_env, pyversion from tests.local_repos import local_checkout, local_repo distribute_re = re.compile('^distribute==[0-9.]+\n', re.MULTILINE) def _check_output(result, expecte...
# sql/coercions.py # Copyright (C) 2005-2021 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php import numbers import re from . import operators from . import roles from . impor...
# Author: Mark Wronkiewicz <wronk@uw.edu> # # License: BSD (3-clause) import os.path as op import warnings import numpy as np import sys import scipy from numpy.testing import assert_equal, assert_allclose from nose.tools import assert_true, assert_raises from nose.plugins.skip import SkipTest from distutils.version i...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, determine_ext, int_or_none, float_or_none, js_to_json, orderedSet, strip_jsonp, strip_or_none, unified_strdate, ...
'''Utility functions. Created on Sep 13, 2010 @author: jnaous ''' import os import re from django.conf import settings from expedient.common.federation.geni.util.urn_util import URN from expedient.common.federation.geni.util.cert_util import create_cert from expedient.common.federation.sfa.trust.gid import GID from dj...
# -*- coding: utf-8 -*- """ Command line configuration parser """ import sys import os.path import ConfigParser import re import ast from copy import deepcopy try: from collections import OrderedDict as ordereddict except ImportError: from ordereddict import OrderedDict as ordereddict TABLE_CONFIG_OPTIONS = [...
# encoding: utf8 from __future__ import unicode_literals from optparse import make_option from collections import OrderedDict from importlib import import_module import itertools import traceback from django.apps import apps from django.core.management import call_command from django.core.management.base import BaseCo...
################################### ### ### ### Joshua G. Mausolf ### ### Department of Sociology ### ### Computation Institute ### ### University of Chicago ### ### ### ################################### import re import pandas as pd i...
# PyAlgoTrade # # Copyright 2011-2015 Gabriel Martin Becedillas Ruiz # # 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 ap...
# 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 __future__ import absolute_import, division, print_function, \ unicode_literals from logging import getLogger from unittest import TestCase from octodns.record import Create, Delete, Record, Update from octodns.provider.base import BaseProvider from octodns.provider.plan import Plan, UnsafePlan from o...
from __future__ import absolute_import, unicode_literals import logging import random from mopidy import exceptions from mopidy.core import listener from mopidy.internal import deprecation, validation from mopidy.models import TlTrack, Track logger = logging.getLogger(__name__) class TracklistController(object): ...
# -*- coding: utf-8 -*- import json import re from django.shortcuts import render_to_response from django import forms from django.contrib import admin from django.contrib import messages from django.core.exceptions import ImproperlyConfigured, ValidationError from django.template.defaultfilters import force_escape f...
# Copyright 2012 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 ...
#!/usr/bin/env python """Creates the pin file for the Teensy.""" from __future__ import print_function import argparse import sys import csv SUPPORTED_FN = { 'FTM' : ['CH0', 'CH1', 'CH2', 'CH3', 'CH4', 'CH5', 'CH6', 'CH7', 'QD_PHA', 'QD_PHB'], 'I2C' : ['SDA', 'SCL'], 'UART' : ['RX'...
# Copyright (c) 2019 Nordic Semiconductor ASA # SPDX-License-Identifier: BSD-3-Clause import contextlib import io from logging import WARNING import os from pathlib import Path import pytest from devicetree import edtlib # Test suite for edtlib.py. # # Run it using pytest (https://docs.pytest.org/en/stable/usage.ht...
# Copyright 2013 Mirantis 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 ...
"""Tests for the SmartThings component init module.""" from http import HTTPStatus from unittest.mock import Mock, patch from uuid import uuid4 from aiohttp import ClientConnectionError, ClientResponseError from pysmartthings import InstalledAppStatus, OAuthToken import pytest from homeassistant import config_entries...
# Copyright (c) 2018 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 app...
# The MIT License (MIT) # # Copyright (c) 2014 Richard Moore # # 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, mod...
import ptypes from ptypes import * from . import portable from .headers import * import logging class Signature(portable.IMAGE_FILE_HEADER): _fields_ = [ (Machine, 'Machine'), (uint16, 'NumberOfSections'), ] def isImportSignature(self): return all((self['Machine'].li.int() == sel...
#!/usr/bin/env python import setpath import unittest from rename import rename from bike.transformer.save import save from bike.testutils import * import compiler class RenameClassTests: def testRenamesClassDcl(self): srcBefore=trimLines(""" class TheClass: def theMethod(): ...
'''local, adjusted version from scipy.linalg.basic.py changes: The only changes are that additional results are returned ''' from __future__ import print_function from statsmodels.compat.python import lmap, range import numpy as np from scipy.linalg import svd as decomp_svd from scipy.linalg.lapack import get_lapack...
import os from flask import Blueprint, render_template, abort, jsonify from util.security import api_security from database import SessionLoader, DummySession, dSIPMultiDomainMapping from shared import showApiError,debugEndpoint,StatusCodes, getRequestData from enum import Enum from werkzeug import exceptions as http_e...
# Natural Language Toolkit: Earley Parser Demo # # Copyright (C) 2003 University of Pennsylvania # Author: Robert Berwick <berwick@ai.mit.edu> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT # # $Id: earley.py,v 1.1.1.1 2004/02/25 17:16:48 adastra Exp $ import Tkinter import math from nltk.pars...
from cloudify import ctx from cloudify.exceptions import NonRecoverableError from cloudify.state import ctx_parameters as inputs import subprocess import os import re import sys import time import threading import platform from StringIO import StringIO from cloudify_rest_client import CloudifyClient from cloudify impo...
import sublime import sublime_plugin import re import imp import json import sys import os.path import traceback BASE_PATH = os.path.abspath(os.path.dirname(__file__)) PACKAGES_PATH = sublime.packages_path() or os.path.dirname(BASE_PATH) # EMMET_GRAMMAR = os.path.join(BASE_PATH, 'Emmet.tmLanguage') EMMET_GRAMMAR = 'P...
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch try: from cStringIO import StringIO except ImportError: ...
"""This module generates tvtk (Traited VTK) classes from the VTK-Python API. """ # Author: Prabhu Ramachandran # Copyright (c) 2004-2007, Enthought, Inc. # License: BSD Style. import vtk import os import os.path import zipfile import tempfile import shutil import glob from optparse import OptionParser # Local impor...
import hashlib import hmac import uuid from django.conf import settings from django.contrib import auth from django.contrib.auth.signals import user_logged_in import basket import commonware.log from django_browserid import get_audience from django_statsd.clients import statsd from rest_framework import status from r...
import sys import random import curses class Cell(object): def __init__(self, x, y): self.x = x self.y = y self.opened = False self.checked = False self.mine = False class Command(object): def __init__(self): self.x = -1 self.y = -1 self.open_cell = False self.check_cell = Fa...
# 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...
from PyQt4 import QtCore, QtGui, Qt from EditorMisc import Constants try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtGui.QApplication.translate...
# Copyright 2017 the GPflow 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 writi...
# PyMoBu - Python enhancement for Autodesk's MotionBuilder # Copyright (C) 2010 Scott Englert # scott@scottenglert.com # # 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 ...
import csv from urllib.request import Request, urlopen import dateutil.parser import datetime import re from sys import argv from bs4 import BeautifulSoup import scrape_util default_sale, base_url, prefix = scrape_util.get_market(argv) report_path = 'index_files/Page452.htm' report_date_path = 'index_files/Page648.h...
import datetime import os import time import torch import torch.utils.data from filelock import FileLock from torch import nn import torchvision import ray from ray.util.sgd.torch.examples.segmentation.coco_utils import get_coco import ray.util.sgd.torch.examples.segmentation.transforms as T import ray.util.sgd.torch...
# Copyright (c) 2011 OpenStack, LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
import unittest2 from .random_samples import \ ReservoirSampler, Reservoir, MultiplexedReservoir from zounds.timeseries import TimeDimension, Seconds from zounds.spectral import FrequencyDimension, FrequencyBand, LinearScale from zounds.core import ArrayWithUnits, IdentityDimension import numpy as np class TestRe...
""" This module reimplements Python's native threading module using Panda threading constructs. It's designed as a drop-in replacement for the threading module for code that works with Panda; it is necessary because in some compilation models, Panda's threading constructs are incompatible with the OS-provided threads ...
#/usr/bin/python # # 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 later version. # # Written (W) 2009-2014 Andre Kahles, Jonas Behr, G...