text
stringlengths
475
200k
import random import warnings from time import time from collections import deque from functools import partial from twisted.internet import reactor, defer from twisted.python.failure import Failure from scrapy.utils.defer import mustbe_deferred from scrapy.utils.signal import send_catch_log from scrapy.utils.httpobj...
#!/usr/bin/python # # Copyright (C) 2007 SIOS Technology, 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 appli...
# genome_test.py - unit tests for genome.py # Authors: # * Erich Blume <[EMAIL]> # # Copyright 2011 Erich Blume <[EMAIL]> # # This file is part of Tiger Lily. # # Tiger Lily is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fre...
#!/usr/bin/python import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) from scapy.all import * import time import os import re import sys import datetime sys.path.append('/usr/share/subterfuge') #Ignore Deprication Warnings import warnings warnings.filterwarnings("ignore", category...
from importlib import import_module from unittest.case import SkipTest from fuel.utils import find_in_data_path from fuel import config def skip_if_not_available(modules=None, datasets=None, configurations=None): """Raises a SkipTest exception when requirements are not met. Parameters ---------- mod...
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from urbansim.functions import attribute_label from variable_functions import my_attribute_label class number_of_surveyed_households(Variable)...
#!/usr/bin/env python3 # Copyright (c) 2016-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test various net timeouts. - Create three bitcoind nodes: no_verack_node - we never send a verack...
# Copyright (c) 2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.words.im.ircsupport}. """ from twisted.trial.unittest import TestCase from twisted.test.proto_helpers import StringTransport from twisted.words.im.basechat import Conversation, ChatUI from twisted.words.im.ircsupport...
""" DataStore is the service for inserting accounting reports (rows) in the Accounting DB This service CAN be duplicated iff the first is a "master" and all the others are slaves. """ import datetime from DIRAC import S_OK, S_ERROR, gConfig, gLogger from DIRAC.AccountingSystem.DB.MultiAccountingDB import MultiA...
import sys import types import unittest class Test_TestLoader(unittest.TestCase): ### Tests for TestLoader.loadTestsFromTestCase ################################################################ # "Return a suite of all tests cases contained in the TestCase-derived # class testCaseClass" def te...
#!/usr/bin/env python # -*- coding: utf-8 -*- #---------------------------------------------------------------------- # Setup script for carlae package import sys from setuptools import setup, find_packages ### CONFIGURE BUILD VARIABLES VERSION = "0.0.2" ### END OF CONFIGURATION # Get requirements from file with op...
# -*- coding: utf-8 -*- from amzqr.mylibs.constant import alig_location, format_info_str, version_info_str, lindex def get_qrmatrix(ver, ecl, bits): num = (ver - 1) * 4 + 21 qrmatrix = [[None] * num for i in range(num)] # [([None] * num * num)[i:i+num] for i in range(num * num) if i % num == 0] ...
__copyright__ = "Uwe Krien" __license__ = "GPLv3" import config as cfg import os from oemof.tools import logger class ConfigurationDe21: def __init__(self): self.pattern = dict() self.files = dict() self.general = dict() self.url = dict() self.pv = dict() target_...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
#!/usr/bin/python # # Copyright 2009 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 ...
""" Utilities for writing plugins. This is different from bokeh.pluginutils because these are ways of patching routes and objects directly into the bokeh server. You would run this type of code using the --script option """ from __future__ import absolute_import import uuid from flask import abort, render_template...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Mathias Neef # Copyright 2015 copadoMEDIA UG # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
import unittest import os import random import shutil import sys import py_compile import warnings import marshal from test.test_support import unlink, TESTFN, unload, run_unittest, check_warnings def remove_files(name): for f in (name + os.extsep + "py", name + os.extsep + "pyc", name...
""" Generate a 5-frame trajectory that is pretty degenerates so is good for testing. It starts from (0,0,0) and moves in a straight line on the x axis, at a slow velocity. """ import numpy as np from optv.calibration import Calibration from optv.parameters import ControlParams from optv.imgcoord import image_coordina...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
# 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...
# testing/assertions.py # Copyright (C) 2005-2015 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 from __future__ import absolute_import from . import util as testutil from sq...
# 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 ...
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import functools import os from appengine_wrappers import GetAppVersion from compiled_file_system import CompiledFileSystem from copy ...
# -*- coding: utf-8 -*- """ Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U This file is part of Orion Context Broker. Orion Context Broker is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation,...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document class CourseSchedule(Document): def validate(self): self.instruc...
"""Tests to ensure that the lxml tree builder generates good trees.""" import re import warnings try: import lxml.etree LXML_PRESENT = True LXML_VERSION = lxml.etree.LXML_VERSION except ImportError, e: LXML_PRESENT = False LXML_VERSION = (0,) if LXML_PRESENT: from bs4.builder import LXMLTreeB...
from django.conf.urls.defaults import * from django.contrib.comments.urls import urlpatterns from osl_comments.models import OslComment urlpatterns += patterns('osl_comments.views', (r'^comment/(?P<comment_id>\d+)/$', 'get_comment'), (r'^delete_comment/(?P<comment_id>\d+)/$', 'delete_comment'), (r'^delete...
""" ======================== Cycle finding algorithms ======================== """ # Copyright (C) 2010-2012 by # Aric Hagberg <[EMAIL]> # Dan Schult <[EMAIL]> # Pieter Swart <[EMAIL]> # All rights reserved. # BSD license. from collections import defaultdict import networkx as nx from networkx.utils...
#!/usr/bin/python #coding: utf-8 -*- # pylint: disable=C0111 # (c) 2013, David Stygstra <[EMAIL]> # # Portions copyright @ 2015 VMware, Inc. # # This file is part of Ansible # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by #...
# 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 applicab...
from __future__ import division, absolute_import, print_function import warnings import numpy.core.numeric as _nx from numpy.core.numeric import ( asarray, zeros, outer, concatenate, isscalar, array, asanyarray ) from numpy.core.fromnumeric import product, reshape from numpy.core import vstack, atleast_3d _...
from __future__ import unicode_literals import re import json import base64 from .common import InfoExtractor from ..utils import ( unescapeHTML, ExtractorError, determine_ext, int_or_none, ) class OoyalaBaseIE(InfoExtractor): def _extract_result(self, info, more_info): embedCode = info[...
"Dummy cache backend" from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache class DummyCache(BaseCache): def __init__(self, host, *args, **kwargs): BaseCache.__init__(self, *args, **kwargs) def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): key = self.make_key...
""" A container of sheets No caching. """ from cheat import cheatsheets from cheat.utils import * import os def default_path(): """ Returns the default cheatsheet path """ # determine the default cheatsheet dir default_sheets_dir = os.environ.get('DEFAULT_CHEAT_DIR') or os.path.join(os.path.expanduser('...
import unittest import re import textwrap import antlr3 import testbase # Left-recursion resolution is not yet enabled in the tool. # class TestLeftRecursion(testbase.ANTLRTest): # def parserClass(self, base): # class TParser(base): # def __init__(self, *args, **kwargs): # bas...
from bokeh.charts import Bar, output_file, show, vplot, hplot, defaults from bokeh.sampledata.autompg import autompg as df df['neg_mpg'] = 0 - df['mpg'] defaults.width = 450 defaults.height = 350 bar_plot = Bar(df, label='cyl', title="label='cyl'") bar_plot2 = Bar(df, label='cyl', bar_width=0.4, title="label='cyl' ...
# 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 a...
########################################################################## # # Copyright (c) 2019, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
# Numbers game # # Hawk and his little brother, Stone, are playing a little game with # the following rules. Initially 8 random integers, from 1 to 100 (inclusive), # are laid on the table for both players to see. The players then have # 2 minutes to construct a sequence of numbers, from the given 8 numbers...
#!/usr/bin/python import sys from .common import FAILURE, SUCCESS from .dbmake_cli import get_command, print_help, get_command_class_reference from .common import CommandNotExists, BadCommandArguments, DBMAKE_VERSION class App: def __init__(self): self.ide_stop_bothering_with_static_method = "!!!" ...
import numpy as np from bokeh.plotting import figure, show, output_file, vplot N = 9 x = np.linspace(-2, 2, N) y = x**2 sizes = np.linspace(10, 20, N) xpts = np.array([-.09, -.12, .0, .12, .09]) ypts = np.array([-.1, .02, .1, .02, -.1]) output_file("glyphs.html", title="glyphs.py example") vplot = vplot() p = fi...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from past.builtins import basestring import logging import os from collections import MutableSet from datetime import datetime, date, time from sqlalchemy import Column, U...
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your ...
""" Django settings for main project. Generated by 'django-admin startproject' using Django 1.10.2. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os #...
#!/usr/bin/python from matplotlib.patches import Rectangle, Circle, RegularPolygon, Arrow from fitness import FITNESS_SECTION class BasicDrawing(object): def __init__(self,config): self.config = config self.grid_x = self.config.getint(FITNESS_SECTION,"grid_x") self.grid_y = self....
# -*- coding: utf-8 -*- #!/usr/bin/env python import warnings import pandas as pd import numpy as np import scipy.cluster.hierarchy as hac from dots_arrays import Experiment from sklearn.decomposition import PCA from itertools import combinations from scipy.stats import ttest_ind, f_oneway from statsmodels.stats.multi...
# -*- coding: utf-8 -*- """ werkzeug ~~~~~~~~ Werkzeug is the Swiss Army knife of Python web development. It provides useful classes and functions for any WSGI application to make the life of a python web developer much easier. All of the provided classes are independent from each other so yo...
#!/usr/bin/python from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.uic import * from blur.Stone import * from blur.Classes import * from blur.Classesui import HostSelector from blur.absubmit import Submitter from blur import RedirectOutputToLog import sys import time import os.path import r...
# # Copyright 2018 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansibl...
''' Script to check the correctness of the analysis. The analysis is done on raw data and all results are compared to a recorded analysis. ''' import os import shutil import unittest from testbeam_analysis import track_analysis from testbeam_analysis.tools import analysis_utils, test_tools testing_path = os.path.dirn...
# Copyright 2011 Google 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,...
from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from rest_framework import routers from comments.serializers import CommentViewSet from comments.views import...
# 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...
#!/usr/bin/env python3 # This file is part of ofxstatement-austrian. # See README.rst for more information. import csv import re from ofxstatement import statement from ofxstatement.parser import CsvStatementParser from ofxstatement.plugin import Plugin from ofxstatement.statement import generate_transaction_id from o...
""" Expressions ----------- Offer fast expression evaluation through numexpr """ import warnings import numpy as np from pandas.core.common import _values_from_object from pandas.core.computation.check import _NUMEXPR_INSTALLED from pandas.core.config import get_option if _NUMEXPR_INSTALLED: import numexpr as n...
#!/usr/bin/env python # Copyright (c) 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Waterfall monitoring script. This script checks all builders specified in the config file and sends status email about any s...
''' Created on May 16, 2011 @author: bungeman ''' import sys import getopt import bench_util def usage(): """Prints simple usage information.""" print '-o <file> the old bench output file.' print '-n <file> the new bench output file.' print '-h causes headers to be output.' print '-f <fieldSp...
#!/usr/bin/env python3 # Written by Chesley Tan. # Tweaked by Will Smith. import traceback import time import sys import math import itertools import cv2 import numpy as np import shm from vision.modules.base import ModuleBase from vision.framework.color import bgr_to_lab, elementwise_color_dist, range_threshold fro...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any l...
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <[EMAIL]> # # The licence is in the file __openerp__.py # ###...
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
#!/usr/bin/env python import sys, os, re from hashlib import md5 import primer3 import pysam import subprocess from collections import defaultdict, OrderedDict '''just a wrapper for pysam''' class MultiFasta(object): def __init__(self,file): self.file = file def createPrimers(self,db,bowtie='bowtie2'...
""" Tests for the linecache module """ import linecache import unittest import os.path from test import support FILENAME = linecache.__file__ INVALID_NAME = '!@$)(!@#_1' EMPTY = '' TESTS = 'inspect_fodder inspect_fodder2 mapping_tests' TESTS = TESTS.split() TEST_PATH = os.path.dirname(support.__file__) MODULES = "li...
"""Minio helper methods.""" from collections.abc import Iterable import json import logging from queue import Queue import re import threading import time from typing import Iterator, List from urllib.parse import unquote from minio import Minio from urllib3.exceptions import HTTPError _LOGGER = logging.getLogger(__n...
#!/usr/bin/env python # Copyright 2015 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...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from future.moves.urllib.parse import unquote import hashlib import io import logging import mimetypes import os import shutil import socket import sys import tempfile fro...
""" GravMag: Calculate the gravity disturbance and Bouguer anomaly for Hawaii """ from fatiando.gravmag import normal_gravity from fatiando.vis import mpl import numpy as np import urllib # Download the gravity and topography data url = 'https://raw.githubusercontent.com/leouieda/geofisica1/master/data/' urllib.urlret...
""" A saml2 backend module for the satosa proxy """ import copy import functools import json import logging from base64 import urlsafe_b64encode from urllib.parse import urlparse from saml2.client_base import Base from saml2.config import SPConfig from saml2.extension.ui import NAMESPACE as UI_NAMESPACE from saml2.met...
# -*- 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...
# Copyright (c) 2011-2016 Rackspace US, 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 ...
#!/usr/bin/env python # Copyright 2016 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...
# -*- 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...
#!/usr/bin/env python """Threshold Graphs ================ """ from nose.tools import * from nose import SkipTest from nose.plugins.attrib import attr import networkx as nx import networkx.algorithms.threshold as nxt from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic cnlti = nx.convert_no...
# -*- coding: utf-8 -*- from django.conf import settings from django.template import RequestContext from django.template.loader import render_to_string from django.contrib.contenttypes.models import ContentType from django.http import Http404 from djangorestframework.response import Response, ErrorResponse from django...
from __future__ import unicode_literals from moto.core.responses import BaseResponse from .models import iam_backend, User class IamResponse(BaseResponse): def attach_role_policy(self): policy_arn = self._get_param('PolicyArn') role_name = self._get_param('RoleName') iam_backend.attach_...
#! /usr/bin/env python import requests from requests.auth import HTTPBasicAuth import sys if len(sys.argv) != 6: print "usage: create-flow onos-node name device in-port out-port" sys.exit(1) node = sys.argv[1] name = sys.argv[2] device = sys.argv[3] inPort = sys.argv[4] outPort = sys.argv[5] flowJsonTemp...
""" LICENCE ------- Copyright 2015 by Kitware, Inc. All Rights Reserved. Please refer to KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. """ from . import Indexer import cPickle import os.path as osp import numpy from sklearn.naive...
#!/usr/bin/env python3 # # Copyright (c) 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/LICE...
from __future__ import unicode_literals from django.db import models class Parceiro(models.Model): #Na verdade é o Cliente com nome mais bonito nome_parceiro = models.CharField(max_length=255) nome_representante = models.CharField(max_length=255) telefone = models.CharField(max_length=255) email = ...
from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.models import Group from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.views.decorators.vary import ...
# # Chris Lumens <[EMAIL]> # # Copyright 2007 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope that it # will be useful, but WIT...
#!/usr/bin/python3 ''' Created on Aug 18, 2019 @author: johnrabsonjr ''' # potential colors are WHITE, PERIWINKLE, YELLOW, GREEN, VIOLET, BLUE, RED, BLACK import os from time import sleep from atxraspisettings import * os.system('systemctl stop atxraspihello') # Stop the shutdownirq.py script daemon setup_gpio()...
def _Qperm(user=None): from django.db.models.query import Q exQ = Q() if user is None or user.is_anonymous(): exQ = (Q(user_type__exact = 'A') | Q(user_type__exact = 'E')) & Q( groups__isnull=True) elif user.is_superuser: exQ = ~Q(user_type__exact = 'A') elif user.is_sta...
from django.conf import settings from django.contrib.auth.middleware import AuthenticationMiddleware from django.contrib.auth.models import AnonymousUser from django.utils.translation import ugettext as _ from oauth.oauth import OAuthError from oauth_provider.decorators import CheckOAuth from oauth_provider.utils impor...
## Bokeh server for MultiSelect import pandas as pd from bokeh.io import curdoc from bokeh.layouts import row from bokeh.models import ColumnDataSource from bokeh.models.widgets import MultiSelect from bokeh.plotting import figure x=[3,4,6,12,10,1] y=[7,1,3,4,1,6] label=['Red', 'Orange', 'Red', 'Orange','Red', 'Orange...
''' This is a standalone script that is to be used to load the vocab into the server's mongo database. This only needs to be run once, with the appropriate vocabulary on the filesystem as a one column flat list text file. ''' import re import sys import pymongo as pm from optparse import OptionParser ''' Thi...
#! /usr/bin/env python # -*- coding: UTF8 -*- # Este arquivo é parte do programa Vittolino # Copyright 2011-2017 Carlo Oliveira <[EMAIL]>, # `Labase <http://labase.selfip.org/>`__; `GPL <http://is.gd/3Udt>`__. # # Vittolino é um software livre; você pode redistribuí-lo e/ou # modificá-lo dentro dos termos da Licença Pú...
#This file is distributed under the terms of the GNU General Public license. #Copyright (C) 2001 Al Riddoch (See the file COPYING for details). from cyphesis.Thing import Thing from atlas import * from Vector3D import Vector3D # bbox = 8,8,2.5 # bmedian = 7.5,7.5,2.5 # offset = SW corner = -0.5,-0.5,0 class Farmhous...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2013, Peter Sprygada <[EMAIL]> # # 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...
from proteus.default_n import * from proteus import (StepControl, TimeIntegration, NonlinearSolvers, LinearSolvers, LinearAlgebraTools, NumericalFlux) import ls_consrv_p as physics from proteus import Context ct = ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Module : main.py # Author : bssthu # Project : L5MapEditor # Creation date : 2015-09-24 # Description : # import math import os import sqlite3 from PyQt5 import QtWidgets from PyQt5.QtCore import pyqtSlot, Qt, QObject from PyQt5.QtGui import QCur...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. try: from twisted.python.dist import setup, ConditionalExtension as Extension except ImportError: raise SystemExit("twisted.python.dist module not found. Make sure you " "have installed the Twisted core package before...
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> from behave import given from factory.fuzzy import FuzzyChoice import tests.ggrc.behave.factories as factories from ggrc import models from ggrc_workflows.models import ( Workflow, TaskGroup, Work...
import gzip import os import struct import h5py import numpy from fuel.converters.base import fill_hdf5_file, check_exists MNIST_IMAGE_MAGIC = 2051 MNIST_LABEL_MAGIC = 2049 TRAIN_IMAGES = 'train-images-idx3-ubyte.gz' TRAIN_LABELS = 'train-labels-idx1-ubyte.gz' TEST_IMAGES = 't10k-images-idx3-ubyte.gz' TEST_LABELS =...
"""TestCase for reseting File ID. """ import os import shutil import unittest from test_all import db, test_support, get_new_environment_path, get_new_database_path class FileidResetTestCase(unittest.TestCase): def setUp(self): self.db_path_1 = get_new_database_path() self.db_path_2 =...
import collections import re import sys import warnings from bs4.dammit import EntitySubstitution DEFAULT_OUTPUT_ENCODING = "utf-8" PY3K = (sys.version_info[0] > 2) whitespace_re = re.compile("\s+") def _alias(attr): """Alias one attribute name to another for backward compatibility""" @property def alias...