gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" ## Elements ### `<document>` ### `<line>` ### `<span>` attributes: - `width`: if not supplied, the span will be limited only by the width of the containing element. - `align`: one of `left`, `right`, `centerLeft`, `centerRight` or `center`. `center` is shorthand for `centerLeft`. Defaults ...
# 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...
from collections import OrderedDict def sorted_values_by_key(d): return [d[k] for k in sorted(d)] class OrderedSet: def __init__(self): self.d = OrderedDict() def add(self, x): if x not in self.d: self.d[x] = None def update(self, xs): for x in xs: ...
import furl from urlparse import urlparse from nose.tools import * # flake8: noqa from api.base.settings.defaults import API_BASE from framework.guid.model import Guid from website.addons.wiki.model import NodeWikiPage from tests.base import ApiWikiTestCase from tests.factories import (ProjectFactory, Registration...
from sympy.core.basic import Basic from sympy import (sympify, eye, sin, cos, rot_axis1, rot_axis2, rot_axis3, ImmutableMatrix as Matrix, Symbol) from sympy.core.cache import cacheit import sympy.vector class Orienter(Basic): """ Super-class for all orienter classes. """ def rotati...
# coding=utf-8 # Copyright 2022 The ML Fairness Gym Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# 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...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
r''' 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 agreed to i...
# 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 requ...
""" This module contains the base ``Instance`` classes that concrete classes inherit from. Specifically, there are three classes: 1. ``Instance``, that just exists as a base type with no functionality 2. ``TextInstance``, which adds a ``words()`` method and a method to convert strings to indices using a DataIndexer...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ tcpserver.py ------------ TxTrader TCP server module - Implement ASCII line oriented event interface. Copyright (c) 2015 Reliance Systems Inc. <mkrueger@rstms.net> Licensed under the MIT license. See LICENSE for details. """ from txtrader import VERSION, ...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Invenio module for information retrieval.""" from __future__ import absolute_impo...
"""Real-time information about public transport departures in Norway.""" from datetime import datetime, timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( ATTR_ATTRIBUTION, CONF_LATITUDE, CONF_LONGITUDE, CONF_...
# Copyright (C) 2015 Nippon Telegraph and Telephone Corporation. # # 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/python2.4 # Copyright (c) 2006-2008 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. '''A gatherer for the TotalRecall brand of HTML templates with replaceable portions. We wanted to reuse extern.tclib.api.handl...
import base64 import collections import datetime import logging import re import sys import time from urllib import urlencode import urlparse import configparser import dateutil.parser import requests import rethinkdb as r from termcolor import colored from db.github_repos import PluginGithubRepos, DotfilesGithubRepo...
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Test methods in twisted.internet.threads and reactor thread APIs. """ import sys, os, time from twisted.trial import unittest from twisted.internet import reactor, defer, interfaces, threads, protocol, error from twisted.python i...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
#!/usr/bin/python3 ## Autocompletion plugin # @package hive_autocomplete_plugin # @author Vincent Yahna # # Plugin that autocompletes # parameters, object names, elements # attributes, and enum values for HIVE files. # Assumption: Each tag has less than 9000 characters # (for optimization purposes) import subl...
import happyforms from django import forms from django.db.models import Q from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator from django.utils.timezone import make_naive, now from product_de...
# -*- coding: utf-8 -*- """Writer for setup configuration and script files.""" from __future__ import unicode_literals import glob import io import os import textwrap from l2tdevtools.dependency_writers import interface class SetupCfgWriter(interface.DependencyFileWriter): """Setup configuration file writer.""" ...
# # 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...
#!/usr/bin/env python2.7 import h5py, os, sys, csv import argparse # General from glob import glob import string from cStringIO import StringIO from collections import defaultdict from Bio import SeqIO from math import log10, log import numpy as np # Plotting import matplotlib.pyplot as plt # Fast5Tools from fast5too...
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.etree.ElementTree as ET import pprint import re import codecs import json """ Clean, format the osm data into a JSON format for import into mongodb """ # REGEX to check for all lower case characters in a string lower = re.compile(r'^([a-z]|_)*$') # REGEX to...
#!/usr/bin/env python # # Copyright 2009 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# BEGIN_COPYRIGHT # # Copyright 2009-2015 CRS4. # # 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 ...
from __future__ import with_statement import os from os.path import isabs, join from subprocess import Popen, check_call, PIPE, STDOUT import tempfile import shutil from cStringIO import StringIO from sympy.utilities.exceptions import SymPyDeprecationWarning from sympy.utilities.misc import find_executable from latex...
''' This is still a sketch. The goal is to to make this inherit from Cube, but it's created via c = Cube() bc = BinnedCube(c, binsize=50) but then has access to the same visualization, saving, and processing tools. ''' ''' The stuff below is mostly code that came out of the original Cube (some not) ### FIX ME #...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'IndustryProfile.create_date' db.add_column(u'account_industryprofile', 'create_date', ...
# # Collective Knowledge # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: Grigori Fursin # cfg={} # Will be updated by CK (meta description of this module) work={} # Will be updated by CK (temporal data) ck=None # Will be updated by CK (initialized CK kernel) ...
""" Tests for transformer objects. """ from __future__ import division from __future__ import unicode_literals from deepchem.molnet import load_delaney from deepchem.trans.transformers import FeaturizationTransformer __author__ = "Bharath Ramsundar" __copyright__ = "Copyright 2016, Stanford University" __license__ = ...
from unittest import TestCase from ..utils import FieldsParameterParseError, parse_boolean, parse_fields_parameter class TestParseFieldsParameter(TestCase): # GOOD STUFF def test_valid_single_field(self): parsed = parse_fields_parameter('test') self.assertEqual(parsed, [ ('test'...
"""Session implementation for CherryPy. You need to edit your config file to use sessions. Here's an example:: [/] tools.sessions.on = True tools.sessions.storage_class = cherrypy.lib.sessions.FileSession tools.sessions.storage_path = "/home/site/sessions" tools.sessions.timeout = 60 This sets th...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 t...
""" Support for Honeywell Round Connected and Honeywell Evohome thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.honeywell/ """ import logging import socket import datetime import voluptuous as vol import requests from homeassistant....
import pytest from flask import Response from werkzeug.exceptions import Forbidden from flask_allows import Allows from flask_allows.additional import Additional, current_additions from flask_allows.overrides import Override, current_overrides def test_warns_about_request_deprecation_with_old_style_requirement(membe...
""" Form classes """ from __future__ import absolute_import, unicode_literals import copy import warnings from django.core.exceptions import ValidationError from django.forms.fields import Field, FileField from django.forms.util import flatatt, ErrorDict, ErrorList from django.forms.widgets import Media, media_prope...
""" Interface and implementation of a Kademlia routing table. Classes: RoutingTable -- Interface OptimizedTreeRoutingTable -- Implementation """ from abc import ABCMeta, abstractmethod import logging import time from node import constants, guid, kbucket class RoutingTable(object): """ Interface for...
# Copyright (c) 2016 EMC 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 requir...
#!/usr/bin/env python3 """Implement configuration file parsing.""" # Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # Copyright (C) 2015--2019 The Contributors # # Licensed under the Apache License, Version 2.0 (the "Li...
# -*- coding: utf-8 -*- import mock import pytest import urlparse from django.db import connection, transaction from django.test import TransactionTestCase from django.test.utils import CaptureQueriesContext from osf.models import QuickFilesNode from website import util as website_utils from api.base.settings.default...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vispy: gallery 30 # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import argparse import numpy as np from vispy import gloo from vispy import app from vispy.util.transforms import perspective, tran...
"""Generate and tweet GIFs based on SDO imagery.""" import datetime import json import logging import logging.handlers import os import tempfile from time import sleep import shutil import subprocess import time import urllib.parse import backoff import click import lxml.html from PIL import Image import requests imp...
# Copyright (c) Hynek Schlawack, Richard Wall # See LICENSE for details. from __future__ import absolute_import, division, print_function import getdns from twisted.trial.unittest import SynchronousTestCase from twisted.python.filepath import FilePath from OpenSSL import crypto from danex import _dane class TLSAD...
#!/usr/bin/env python3 """ Rules for building C/API module with f2py2e. Here is a skeleton of a new wrapper function (13Dec2001): wrapper_function(args) declarations get_python_arguments, say, `a' and `b' get_a_from_python if (successful) { get_b_from_python if (successful) { callfortran ...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, print_function import contextlib import itertools import os import platform import random import subprocess import sys from contextlib import conte...
from __future__ import absolute_import, print_function, division import itertools import operator from collections import OrderedDict from petl.compat import next, string_types, reduce, text_type from petl.errors import ArgumentError from petl.util.base import Table, iterpeek, rowgroupby from petl.util.base import ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 Cisco Systems, 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...
"""The tests for the Template vacuum platform.""" import logging import pytest from homeassistant import setup from homeassistant.const import STATE_ON, STATE_OFF, STATE_UNKNOWN, STATE_UNAVAILABLE from homeassistant.components.vacuum import ( ATTR_BATTERY_LEVEL, STATE_CLEANING, STATE_DOCKED, STATE_IDLE...
import numpy as np import pytest from pandas._libs.tslibs.period import IncompatibleFrequency from pandas.core.dtypes.dtypes import PeriodDtype from pandas import ( Index, NaT, Period, PeriodIndex, Series, date_range, offsets, period_range, ) import pandas._testing as tm from pandas.c...
# Copyright 2013 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...
# Copyright 2013 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 requi...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Service.url' db.alter_column(u'operations_service', 'url', self.gf('django.db.models.fiel...
from sfepy.terms.terms import * from sfepy.terms.terms_base import ScalarScalar class DiffusionTerm( ScalarScalar, Term ): r""" :Description: General diffusion term with permeability :math:`K_{ij}`. Can be evaluated. Can use derivatives. :Definition: .. math:: \int_{\Omega} K_{ij} ...
# -*- coding: utf-8 -*- import pytest import six import pvl class DictLike(object): def keys(self): return ['a', 'b', 'a'] def __getitem__(self, key): return 42 def test_empty(): module = pvl.PVLModule() assert len(module) == 0 assert module.get('c', 42) == 42 with pytest....
# Copyright 2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Manages subcommands in a script. Each subcommand should look like this: @usage('[pet name]') def CMDpet(parser, args): '''Prints a pet. Many...
# Copyright 2011 Alex K (wtwf.com) __author__ = 'wtwf.com (Alex K)' import os import logging import datetime import urllib import PyRSS2Gen as rss from google.appengine.api import mail from google.appengine.api import users from google.appengine.ext import ndb from google.appengine.ext import webapp from google.app...
#!/usr/bin/env python """This file defines the base classes for Flows. A Flow is a state machine which executes actions on the client. Messages are transmitted between the flow object and the client with their responses introduced into a state handler within the flow. The flow can send messages to a client, or launch...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
# 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...
# Copyright 2019 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...
import sys from glob import glob import os from datetime import datetime from tasks import plotms ''' Plot visibility data for each spw to allow for easy manual flags ''' try: vis_name = sys.argv[1] field_names = sys.argv[2] corrstring = sys.argv[3] starting_spw = int(sys.argv[4]) bp_scan = sys....
from django.db.backends import BaseDatabaseOperations class DatabaseOperations(BaseDatabaseOperations): def __init__(self, connection): super(DatabaseOperations, self).__init__(connection) def date_extract_sql(self, lookup_type, field_name): # http://www.postgresql.org/docs/8.0/static/functio...
"""Deployment utilities for clld apps.""" # flake8: noqa import time import json from getpass import getpass import os from datetime import datetime, timedelta from importlib import import_module import contextlib from pytz import timezone, utc from fabric.api import sudo, run, local, put, env, cd, task, execute, set...
# -*- coding: utf-8 -*- """ Parse pykit IR in the form of C. """ from __future__ import print_function, division, absolute_import from io import StringIO from os.path import dirname, abspath, join import tempfile import json import tokenize from functools import partial from collections import defaultdict, namedtupl...
# -*- coding: utf-8 -*- # # Copyright 2015 Twitter 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 ...
import xlwt import numpy as np import colour from ..configuration.base_configuration import Filter from ..configuration.base_configuration import TimeOfDayFilter from ..core.status import Status class report: bold_style = xlwt.easyxf('font: bold 1') no_dp_style = xlwt.easyxf(num_format_str='0') one_dp_s...
# 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...
from functools import wraps from flask import (Flask, render_template, request, redirect, url_for, flash, make_response, jsonify) from flask import session as login_session from sqlalchemy import create_engine, asc from sqlalchemy.orm import sessionmaker from database_setup import (Base, User, Cat...
# Copyright 2013 the Melange 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 wr...
# 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...
# Copyright 2010-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 required by ap...
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime import sys # Import encoding now, to avoid implicit import later. # Implicit import within threads may cause LookupError when standard library is in a ZIP,...
"""Blueprint models.""" import asyncio import logging import pathlib from typing import Any, Dict, Optional, Union import voluptuous as vol from voluptuous.humanize import humanize_error from homeassistant.const import CONF_DOMAIN, CONF_NAME, CONF_PATH from homeassistant.core import HomeAssistant, callback from homea...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' This script is used to test Salt from a Jenkins server, specifically jenkins.saltstack.com. This script is intended to be shell-centric!! ''' # Import python libs from __future__ import absolute_import, print_function import glob import os import re import sys import ...
__author__ = 'croxis' from io import BytesIO import random import re from PIL import Image, ImageDraw, ImageFont import requests import lib.transforms as transforms import lib.utils as utils from lib.manalib import Manatext from . import magic_image from . import img_manager try: import textwrap import nltk...
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/details/3038/0>`_ , the Bro...
from __future__ import print_function import warnings from six.moves import range import numpy as np from time import sleep from landlab import ModelParameterDictionary, CLOSED_BOUNDARY, Component from landlab.core.model_parameter_dictionary import MissingKeyError from landlab.field.scalar_data_fields import FieldE...
# Copyright 2021 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 Synology NAS Sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.synologydsm/ """ import logging from datetime import timedelta from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.helpers.entity imp...
import random import math import benchmarkFunctions import copy NUM_DIMENSIONS = 20 NUM_ITERATIONS = 1000 POPULATION_SIZE = 50 START_EXPLOTATION = 600 random_range_value = 1 INERTIA_NEIGHBORS = 0.9 INERTIA_FOOD = 0.9 CT = 0.5 N_MAX = 0.02 FORAGING_SPEED = 0.02 DIFUSION_SPEED = 0.005 EPSILON = 10**-5 CONVERGENCE_...
# encoding: utf-8 """ supervisor.py Created by Thomas Mangin on 2011-11-29. Copyright (c) 2011-2013 Exa Networks. All rights reserved. """ import os import sys import signal import traceback from socket import has_ipv6 from .util.pid import PID from .util.daemon import Daemon from .util.alarm import alarm_thread f...
import json import itertools import rtree import requests from parse import search from geomet import wkt from datetime import datetime, timedelta from functools import partial, lru_cache import pyproj import numpy as np from time import time import logging from shapely.geometry import shape, mapping, box from shapel...
import os, sys from pip.req import InstallRequirement, RequirementSet from pip.req import parse_requirements from pip.log import logger from pip.locations import build_prefix, src_prefix from pip.basecommand import Command from pip.index import PackageFinder from pip.exceptions import InstallationError class InstallC...
# -*- coding: utf-8 -*- """ Survey Module -- a tool to create surveys. @author: Robert O'Connor """ prefix = request.controller resourcename = request.function if prefix not in deployment_settings.modules: session.error = T("Module disabled!") redirect(URL(r=request, c="default", f="index")) from gluo...
# -*- coding: utf-8 -*- from copy import deepcopy import numpy as np from scipy import linalg from ..bem import _check_origin from ..io.constants import FIFF from ..io.pick import pick_types, pick_info from ..surface import get_head_surf, get_meg_helmet_surf from ..io.proj import _has_eeg_average_ref_proj, make_pro...
from __future__ import unicode_literals import datetime import re from datetime import date from decimal import Decimal from django import forms from django.core.exceptions import ImproperlyConfigured from django.db import models from django.forms.models import (_get_foreign_key, inlineformset_factory, modelforms...
from __future__ import absolute_import from __future__ import print_function from contextlib import contextmanager from typing import (cast, Any, Callable, Dict, Generator, Iterable, Iterator, List, Mapping, Optional, Sized, Tuple, Union, IO) from django.core.urlresolvers import LocaleRegexURLResol...
from scipy.misc import imresize import utils import numpy as np from scipy import ndimage from utils import to_int def get_random_transform_params(input_shape, rotation_range = 0., height_shift_range = 0., width_shift_range = 0., shear_range = 0., zoom_range = (1, 1), horizontal_flip...
# Copyright (c) 2011 Intel Corporation # 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....
""" A lan connect class using udp """ __author__ = "Oliver Lindemann <oliver@expyriment.org>" __version__ = "0.5" import atexit import os import socket from multiprocessing import Process, Event, Queue import logging from .types import UDPData from .polling_time_profile import PollingTimeProfile from .process_priori...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import now, cint from frappe.model import no_value_fields from frappe.model.document import Document from frappe.model.db...
#!/usr/bin/env python # pylint: disable=protected-access, unused-variable, locally-disabled, len-as-condition """Lint helper to generate lint summary of source. Copyright by Contributors """ from __future__ import print_function import argparse import codecs import sys import re import os import cpplint from cpplint i...
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
"""A few small utilities.""" import pandas from dataclasses import dataclass from pathlib import Path from typing import Dict, List, Tuple from functools import reduce # # Join shortcuts # def join(sep, s): """Return 's' joined with 'sep'. Coerces to str.""" return sep.join(str(x) for x in list(s)) def...
# Copyright 2016 Raytheon BBN Technologies # # 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 import os import sys if sys.platform == 'win32' ...