gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# # 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...
#!/usr/bin/env python """ Commands related to the syncing assets. """ from glob import glob import logging import os from fabric.api import prompt, task import app_config from fnmatch import fnmatch import utils logging.basicConfig(format=app_config.LOG_FORMAT) logger = logging.getLogger(__name__) logger.setLevel(app...
# coding=utf-8 import datetime from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from tracker.models import DischargePlan, DischargePlanForm from tracker.models imp...
# -*- coding: utf-8 -*- # # 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 ...
# -*- coding: utf-8 -*- import mock from nose.tools import * # noqa (PEP8 asserts) from box import BoxClientException from framework.auth import Auth from framework.exceptions import HTTPError from website.addons.box.model import ( BoxUserSettings, BoxNodeSettings ) from tests.base import OsfTestCase from tests....
# -*- coding: utf-8 -*- import os import numpy as np from sklearn.metrics import average_precision_score from sklearn.metrics import confusion_matrix from sklearn.metrics import f1_score from sklearn.metrics import roc_auc_score, f1_score import xgboost as xgb from hyperopt import hp, fmin, tpe, STATUS_OK, Trials from ...
"""Support for non-delivered packages recorded in AfterShip.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY, CONF_NAME from homeassistant.helpers.aiohttp_client import ...
#!/usr/bin/env python #-------------------------------------------------------------- # The functions for the lattice modifications to replace the base # RF gap nodes with The Axis Fields nodes that can overlap with # quadrupoles. # The initial base RF gap nodes have zero length, and the length # of new nodes is de...
#!/usr/bin/env python """ exceptions.py """ ################################################################################ # # exceptions.py # # # Copyright (c) 10/9/2009 Leo Goodstadt # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated doc...
""" Sphinx plugins for Django documentation. """ import json import os import re from docutils import nodes from docutils.parsers.rst import Directive, directives from sphinx import addnodes from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.domains.std import Cmdoption from sphinx.util.console import ...
# Copyright 2012 OpenStack Foundation # Copyright 2013 IBM Corp. # 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/LIC...
# Copyright 2015 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 unittest import mock import webapp2 import webtest # pylint: disable=unused-import from dashboard import mock_oauth2_decorator # pylint: enable=unus...
import unittest import time from rdkit import Chem from rdkit.Chem import MCS def load_smiles(text): mols = [] for line in text.strip().splitlines(): smiles = line.split()[0] mol = Chem.MolFromSmiles(smiles) assert mol is not None, smiles mols.append(mol) return mols _ignore = object() clas...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Hoverlabel(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "cone" _path_str = "cone.hoverlabel" _valid_props = { "align", "alignsrc"...
from __future__ import division from cyvlfeat.kmeans import kmeans, kmeans_quantize, ikmeans, ikmeans_push, hikmeans, hikmeans_push import numpy as np def set_distance(values1, values2): """ Compare two sets of values and returns the maximum distance between the closest pairs Parameters ---------- ...
# -*- coding: utf-8 -*- # Copyright 2021 Google 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 require...
# -*- coding: utf-8 -*- """HTML widgets for GUIs.""" # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- import json import logging from functools import partial from qtconsole.rich_jupyter_widget ...
# Copyright 2019 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 agreed to in writing, ...
"""Support for Xiaomi Mi Flora BLE plant sensor.""" from datetime import timedelta import logging import btlewrap from btlewrap import BluetoothBackendException from miflora import miflora_poller import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA, STATE_CLASS_MEASUREMENT, ...
#======================================================================= # sim.py #======================================================================= # This is the common top-level simulator. ISA implementations can use # various hooks to configure the behavior. import os import sys # ensure we know where the py...
import logging import string import sys from collections import deque import numpy as np from scipy import linalg, special from sklearn.base import BaseEstimator from sklearn.utils import check_array, check_random_state from . import _hmmc, _utils from .utils import normalize, log_normalize, log_mask_zero _log = lo...
""" Dynamic Factors model Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function from warnings import warn import numpy as np from .model import Model from .tools import ( concat ) class FAVAR(Model): r""" Factor-Augmented Vector Autoregression ...
# Copyright 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
import pytest # pylint: disable=unused-import import os import pandas as pd import numpy as np import calliope import calliope.exceptions as exceptions from calliope.core.attrdict import AttrDict from calliope.core.preprocess import time from calliope.test.common.util import build_test_model as build_model from cal...
from warnings import warn as Warn from ..cg.shapes import asShape from ..io.FileIO import FileIO from .weights import W, WSP from ._contW_lists import ContiguityWeightsLists from .util import get_ids WT_TYPE = {'rook': 2, 'queen': 1} # for _contW_Binning __author__ = "Sergio J. Rey <srey@asu.edu> , Levi John Wolf <le...
""" Binary Decision Diagrams Interface Functions: bddvar bddnode bdd expr2bddnode expr2bdd bdd2expr Interface Classes: BinaryDecisionDiagram BDDConstant BDDVariable """ # Disable "redefining name from outer scope" # pylint: disable=W0621 import random import weakref from pyeda.b...
############################################################################### # # Format - A class for writing the Excel XLSX Worksheet file. # # Copyright 2013-2016, John McNamara, jmcnamara@cpan.org # # Package imports. from . import xmlwriter class Format(xmlwriter.XMLwriter): """ A class for writing th...
"""Test data purging.""" from datetime import datetime, timedelta import json from sqlalchemy.orm.session import Session from homeassistant.components import recorder from homeassistant.components.recorder.models import Events, RecorderRuns, States from homeassistant.components.recorder.purge import purge_old_data fr...
#!/usr/bin/python ''' Copyright (c) 2005 Hewlett-Packard Company 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 li...
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
# (c) 2014, Chris Church <chris@ninemoreminutes.com> # Copyright (c) 2017 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 = """ author: Ansible Core Te...
#!/usr/bin/env python3 ''' Generates SIPS by calling various microservices and functions. add in a check at the start - check if AF number is actually in the CSV. ''' import os import argparse import sys import shutil import datetime import time import copyit import ififuncs import package_update import accession imp...
# coding: utf-8 from __future__ import division, unicode_literals """ This module implements a FloatWithUnit, which is a subclass of float. It also defines supported units for some commonly used units for energy, length, temperature, time and charge. FloatWithUnit also support conversion to one another, and additions...
''' Created on Oct 7, 2015 @author: Lucas Lehnert (lucas.lehnert@mail.mcgill.ca) ''' import numpy as np from mdp import mspbeStateActionValues, mstdeStateActionValues def experimentSampleTransitions( iterations, mdp, pi, agent, errorMeasures=[] ): ''' Sample transitions using the state distribution of the MDP...
from collections import defaultdict from datetime import date, datetime, timedelta import json import logging import os import re from google.appengine.api import taskqueue from google.appengine.ext import ndb from google.appengine.ext.webapp import template from consts.award_type import AwardType from consts.client_...
# Copyright 2015 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. """Provides the web interface for changing internal_only property of a Bot.""" import logging from google.appengine.api import taskqueue from google.appeng...
import sys import json from meta.MetaProcessor import MetaProcessor from meta.utils import Utils import re import copy import traceback class Platform(MetaProcessor): """docstring for Platform""" def __init__(self,config,stringUtils): super(Platform, self).__init__(config, stringUtils) ...
def prototype_state(): state = {} # Random seed state['seed'] = 1234 # Logging level state['level'] = 'DEBUG' # ----- DATA ----- # (all Nones in this section are placeholders for required values) # Source sequences (must be singleton list for backward compatibility) state['source'...
# 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, ...
#!/usr/bin/env python # Copyright 2017 The Kubernetes 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 appli...
#!/usr/bin/env python from __future__ import division, print_function import logging FORMAT = '[%(asctime)s] %(name)-15s %(message)s' DATEFMT = "%H:%M:%S" logging.basicConfig(format=FORMAT, datefmt=DATEFMT, level=logging.INFO) import theano import theano.tensor as T import ipdb import fuel from argparse import Arg...
# Copyright (c) 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
import base64 import os import shutil import string import sys import tempfile import unittest from datetime import timedelta from http import cookies from django.conf import settings from django.contrib.sessions.backends.base import UpdateError from django.contrib.sessions.backends.cache import SessionStore as CacheS...
import logging import sys from collections import OrderedDict from types import ModuleType from typing import Dict, Union, List, Tuple, Any, Optional from django.contrib import admin from django.contrib.admin import AdminSite from django.db import DatabaseError from django.db.models import Model, Field from .exceptio...
""" mbed CMSIS-DAP debugger Copyright (c) 2015-2015 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 ...
""" Contains a variety of sensory models, specifically models for the visual pathway. """ import topo import param import numbergen import lancet import numpy import imagen from imagen.patterncoordinator import PatternCoordinator, PatternCoordinatorImages from topo.base.arrayutil import DivideWithConstant from topo....
# mssql/pyodbc.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php r""" .. dialect:: mssql+pyodbc :name: PyODBC :dbapi: pyodbc :connectstri...
#!/usr/bin/env python import weakref import logging l = logging.getLogger("claripy.frontends.replacement_frontend") from .constrained_frontend import ConstrainedFrontend class ReplacementFrontend(ConstrainedFrontend): def __init__(self, actual_frontend, allow_symbolic=None, replacements=None, replacement_cache=...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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...
"""NginxParser is a member object of the NginxConfigurator class.""" import copy import glob import logging import os import pyparsing import re from certbot import errors from certbot_nginx import obj from certbot_nginx import nginxparser logger = logging.getLogger(__name__) class NginxParser(object): """Cla...
import datetime import re import flask import jinja2 import requests from pluss.app import app, full_url_for from pluss.handlers import oauth2 from pluss.util import dateutils from pluss.util.cache import Cache from pluss.util.config import Config from pluss.util.ratelimit import ratelimited GPLUS_API_ACTIVITIES_END...
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
import unittest import tempfile import inspect import shutil import sys import os import re from os.path import basename, dirname, exists, join, normpath from robot.errors import DataError from robot.utils import abspath, JYTHON, WINDOWS from robot.utils.importer import Importer, ByPathImporter from robot.utils.assert...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: Bertrand256 # Created on: 2018-03 import logging import math import re import os from functools import partial from typing import List, Optional, Tuple from PyQt5.QtGui import QPen, QBrush, QTextDocument, QFont, QFontMetrics, QPalette from PyQt5 import QtCore, Q...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright (c) 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
from rest_framework import status from hs_core.hydroshare import resource from hs_core.hydroshare.utils import resource_post_create_actions from .base import HSRESTTestCase class TestResourceScienceMetadata(HSRESTTestCase): def setUp(self): super(TestResourceScienceMetadata, self).setUp() self....
# Copyright 2016 Quora, 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, so...
# 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 # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a globalboostyd o...
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import numpy as np from numpy import (abs, asarray, cos, exp, floor, pi, sign, sin, sqrt, sum, size, tril, isnan, atleast_2d, repeat) from numpy.testing import assert_almost_equal from .go_benchmark import Benc...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# 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 the...
import os import sys import tempfile import unittest import warnings from io import StringIO from unittest import mock from django.apps import apps from django.contrib.sites.models import Site from django.core import management from django.core.files.temp import NamedTemporaryFile from django.core.management import Co...
## ####################################################################################################################### # # Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associ...
import datetime import mock import unittest from fakes import FakeReading from usage.fields import field_function from usage.fields.item import billing_entity from usage.fields.item import currency_code from usage.fields.item import description from usage.fields.item import item_rate from usage.fields.item import line...
# # Copyright 2012 New Dream Network, LLC (DreamHost) # # 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...
# 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 agree...
# Copyright 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 law or agre...
"""Base and mixin classes for nearest neighbors""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl> # Multi-output...
from collections import defaultdict from enum import Enum from sklearn.base import ClassifierMixin, RegressorMixin, BaseEstimator from sklearn_pmml import pmml from sklearn_pmml.convert.utils import pmml_row, assert_equal from sklearn_pmml.convert.features import * from pyxb.utils.domutils import BindingDOMSupport as b...
""" This module assumes that OpenCanary has been installed and is running. In particular it assumes that OpenCanary is logging to /var/tmp/opencanary.log and that the services it's testing are enabled. It would be much better to setup tests to start the services needed and provide the configuration files so that test...
from __future__ import absolute_import import os import sys import argparse import subprocess import shutil import time from cass_functions import (cassandra_query, get_data_dir, get_keyspaces, get_table_directories, get_dir_structure) from cleaner import data_cleaner def parse_cmd(): ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Rackspace # 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-...
import copy import datetime import logging import pandas as pd from qstrader import settings from qstrader.broker.portfolio.portfolio_event import PortfolioEvent from qstrader.broker.portfolio.position_handler import PositionHandler class Portfolio(object): """ Represents a portfolio of assets. It contains ...
# 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...
from Tkinter import * from idlelib import SearchEngine from idlelib.SearchDialogBase import SearchDialogBase import re def replace(text): root = text._root() engine = SearchEngine.get(root) if not hasattr(engine, "_replacedialog"): engine._replacedialog = ReplaceDialog(root, engine) dialog = ...
import unittest from mock import MagicMock from mock import patch from mock import call import jbosscli from jbosscli import Jbosscli from jbosscli import ServerGroup from jbosscli import Deployment from jbosscli import ServerInstance from jbosscli import CliError class TestJbosscli(unittest.TestCase): @patch("j...
#!/usr/bin/python import ConfigParser from collections import namedtuple from funcs import * from Config import * from FsUtil import * from HawqUtil import * from HiveUtil import * from HdfsUtil import * from PostgresUtil import * from UserUtil import * if len(sys.argv) == 1: print "Available tools:" print ...
# # 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...
# Copyright (c) 2016 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
# 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, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import shu...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import sys import subprocess import os import urllib from zipfile import ZipFile from shutil import rmtree import urlparse spark_versions = \ { "2.3.0": {"hadoop_versions": ["2.6", "2.7"]}, "2.2....
# 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...
#!flask/bin/python import unittest import os from datetime import time from sqlalchemy.exc import IntegrityError from app import app, db from config import basedir from app.models import Address, FoodResource, TimeSlot, User, Role, PhoneNumber from app.utils import * class TestCase(unittest.TestCase): # Run at th...
# Copyright 2015-present MongoDB, 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 wri...
# # Copyright (c) 2018 Juniper Networks, Inc. All rights reserved. # """ Contains functions that invoke the playbook. """ import sys import json import traceback import argparse from collections import namedtuple import errno from ansible.module_utils._text import to_bytes, to_text from ansible.utils.color import stri...
# Pixie - last updated for NodeBox 1.9.3 # Author: Tom De Smedt <tomdesmedt@organisms.be> # Manual: http://nodebox.net/code/index.php/Pixie # Copyright (c) 2007 by Tom De Smedt. # See LICENSE.txt for details. # Remember to install the fonts before running the library. from random import choice from nodebox.graphics i...
import unittest import datetime import decimal import Spartacus.Database class TestPostgreSQL94(unittest.TestCase): @classmethod def setUpClass(cls): cls.v_database = Spartacus.Database.PostgreSQL( "127.0.0.1", 5494, "spartacus", "spartacus", "spartacus" ) cls.v_database.Op...
from itertools import cycle, islice import re ascii_alphabet = 'abcdefghijklmnopqrstuvwxyz' alpha_numerics = 'abcdefghijklmnopqrstuvwxyz0123456789' vowels = 'aeiou' consonants = 'bcdfghjklmnpqrstvwxyz' vowels_and_consonants = (vowels, consonants) def number_to_multi_base(n, b): """ Convert a number to a mult...
"""Alarm Script.""" import sys import time from . import config as cg from . import all_off, fade, lcd from .context import IO # FIXME: Re-implement as a thread with an interrupt Exception ########################### # Configuration: ########################### # Electronic Pin Numbering Globals: off_button = cg.g...
from functools import reduce from operator import mul import numpy as np import pytest from devito import (Grid, Function, TimeFunction, SparseTimeFunction, SpaceDimension, Dimension, SubDimension, Eq, Inc, Operator, info) from devito.exceptions import InvalidArgument from devito.ir.iet import Cal...
import contextlib import logging import math import shutil import tempfile import uuid import warnings import numpy as np import pandas as pd import tlz as toolz from .. import base, config from ..base import compute, compute_as_if_collection, is_dask_collection, tokenize from ..highlevelgraph import HighLevelGraph f...
# coding=utf-8 """Probabilistic Context Free Grammar.""" from collections import defaultdict import random import re import sys import os VERBS = {"research": "researching", "mine": "mining", "craft": "crafting"} class MaximumDepthExceeded(Exception): """Exception that is raised if the parse tree runs too dee...
# 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 ...
import os import StringIO from datetime import datetime, date from django.utils.translation import ugettext_lazy as _ from django.core import urlresolvers from django.db import models from django.contrib.auth import models as auth_models from filer.models.filemodels import File from filer.utils.pil_exif import get_exif...
import os import sys import json from datetime import date, timedelta from .normalize import slugify, get_date_year, get_eprint_id, get_object_type, has_creator_ids, has_editor_ids, has_contributor_ids, make_label, get_sort_name, get_sort_year, get_sort_subject, get_sort_publication, get_sort_collection, get_sort_eve...
# Generated from JsonSQL.g4 by ANTLR 4.5.1 from antlr4 import * from io import StringIO def serializedATN(): with StringIO() as buf: buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\u009f") buf.write("\u05ae\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") buf.write("\t\7\4...
from __future__ import unicode_literals from datetime import datetime import functools from django.db.models import Q from django.conf import settings from modeltree.tree import trees, MODELTREE_DEFAULT_ALIAS from preserialize.serialize import serialize from restlib2.http import codes from restlib2.params import Param...