src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- # # Project Kimchi # # Copyright IBM, Corp. 2015 # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any lat...
from django.core.exceptions import ImproperlyConfigured from django_hosts.defaults import host, patterns from django_hosts.resolvers import get_host_patterns from .base import HostsTestCase class PatternsTests(HostsTestCase): def test_pattern(self): host_patterns = patterns('', host(r'api', ...
# USAGE # python color_kmeans.py --image images/jp.png --clusters 3 # Author: Adrian Rosebrock # Website: www.pyimagesearch.com # import the necessary packages from sklearn.cluster import KMeans import matplotlib.pyplot as plt import numpy as np import argparse import cv2 def centroid_histogram(clt): # grab the...
import os import cherrypy from rfid import RFIDClient, ten_digit_to_comma_format ip_address = "192.168.1.20" controller_serial = 123106461 client = RFIDClient(ip_address, controller_serial) class RootServer: @cherrypy.expose def index(self, apiKey=None, action=None, badge=None): if apiKey == "secre...
#!/usr/bin/env python """ Your task is to write a query that will return all cars manufactured by "Ford Motor Company" that are assembled in Germany, United Kingdom, or Japan. Please modify only 'in_query' function, as only that will be taken into account. Your code will be run against a MongoDB instance that we have ...
# # Delete a device program # Copyright © 2020 Dave Hocker # # 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, version 3 of the License. # # See the LICENSE file for more details. # from command...
""" Copyright 2013 Steven Diamond 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...
import wx from configtool.data import BSIZESMALL, reFloat, offsetChLabel, offsetTcLabel class CalcScrew(wx.Dialog): def __init__(self, parent, font, cbUse): wx.Dialog.__init__( self, parent, wx.ID_ANY, "Steps calculator for screw driven axes", si...
import json import logging import uuid from remoteable.command import Command __all__ = ('RemotingActual', 'RemotingHandler', 'RemotingServer', 'ThreadedRemotingServer') class RemotingActual(object): def __init__(self, name, exports = None): self._logger = logging.getLogger("remoting.actual.%s" % name) self._e...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from types import MethodType from future import standard_library # from abc import ABCMeta, abstractmethod from future.builtins import object from pyload.core.datatype.base import DownloadState, DownloadStatus, Permission from pyload.c...
# -*- coding: utf-8 -*- # #/* # This file is part of ddprint - a 3D printer firmware. # # Copyright 2021 erwin.rieger@ibrieger.de # # ddprint 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import numpy from util import sigmoid from abc import ABCMeta, abstractmethod from graph import Bipartite from collections import deque class MCMethod(object): """Interface for Monte Carlo-like methods.""" __metaclass__ = ABC...
"""Compute metrics related to user enrollments in courses""" import logging import datetime import luigi import luigi.task from edx.analytics.tasks.database_imports import ImportAuthUserProfileTask from edx.analytics.tasks.mapreduce import MapReduceJobTaskMixin, MapReduceJobTask from edx.analytics.tasks.pathutil imp...
# -*- coding: utf-8 -*- import sys import pytest from _utils import factorial, find_stats, foo from profiling.stats import RecordingStatistics from profiling.tracing import TracingProfiler def test_setprofile(): profiler = TracingProfiler() assert sys.getprofile() is None with profiler: assert s...
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import os import re import sys import urllib __all__ = ("abspath", "filepath_to_uri", "get_valid_filename", "import_module", "safe_join") def get_valid_filename(s): """ Returns the given string c...
from collections import defaultdict from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import models from django.db.models import Sum from django.urls import re...
import os import sys # spirit_py_dir = os.path.dirname(os.path.realpath(__file__)) spirit_py_dir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), "..")) sys.path.insert(0, spirit_py_dir) from spirit import state, geometry import unittest ########## cfgfile = spirit_py_dir + "/../test/input/fd_neighbours...
#!/opt/local/bin/python2 ''' The goal here is to unpreprocess the data from the MNIST database. It's too consistent with the piece of frame the digit takes in the middle of the image. I want to messy it up a bit to improve accuracy in the application. The training application assumes 28x28 size, so this and the tests ...
# Copyright 2015 The Meson development team # 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 ...
import string import re from base import Input from pyquery import PyQuery from collections import Counter from stats import dist_stats # from boltons _punct_ws_str = string.punctuation + string.whitespace _punct_ws_str = _punct_ws_str.replace('-', '') _punct_re = re.compile('[' + _punct_ws_str + ']+') def split_pu...
import numpy as np from ..helpers import article from ._gauss_legendre import gauss_legendre from ._helpers import C1Scheme source = article( authors=["T.N.L. Patterson"], title="The optimum addition of points to quadrature formulae", journal="Math. Comp.", volume="22", year="1968", pages="847...
"""Activate coverage at python startup if appropriate. The python site initialisation will ensure that anything we import will be removed and not visible at the end of python startup. However we minimise all work by putting these init actions in this separate module and only importing what is needed when needed. For...
import os import gc import json import numpy as np import gzip from gensim.models import TfidfModel, LsiModel from gensim.corpora import Dictionary from nlpia.data.loaders import BIGDATA_PATH, read_csv KEEP_N = 300000 # max vocab size NO_BELOW = 5 # min DF (count) NO_ABOVE = .7 # max DF (fraction) def l...
#!/usr/bin/env python # # ---------------------------------------------------------------------- # # Brad T. Aagaard, U.S. Geological Survey # Charles A. Williams, GNS Science # Matthew G. Knepley, University of Chicago # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://ge...
# @copyright # @license import collections import networkx as nx import pypetri.trellis as trellis ############################################################################# ############################################################################# class Graph(collections.Mapping, trellis.Component): CH...
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (C) 2006 Lukáš Lalinský # # 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 2 # of the License...
import os import json import time from subprocess import call from twisted.web.server import Site, NOT_DONE_YET from twisted.internet import ssl, reactor from twisted.web.resource import Resource import db_access class FileServerResource(Resource): def __init__(self): Resource.__init__(self) sel...
""" Multilayer Perceptron """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2012-2013, Universite de Montreal" __credits__ = ["Ian Goodfellow", "David Warde-Farley"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" import logging import math import operator import sys import warnings import numpy ...
# -*- encoding: utf-8 -*- ############################################################################## # # Avanzosc - Avanced Open Source Consulting # Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com> # # This program is free software: you can redistribute it and/or modify # it under the terms ...
import logging from bottle_utils.i18n import lazy_gettext as _ from streamline import XHRPartialFormRoute, RouteBase from ..core.contrib.templates.renderer import template from ..core.exts import ext_container as exts from ..forms.firmware import FirmwareUpdateForm from ..helpers.firmware import update_firmware, FIRM...
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
"""Armor components.""" from component_objects import Component, Element class ArmorAddModal(Component): """Definition of armor add modal component.""" modal_div_id = 'addArmor' name_id = 'armorAddNameInput' type_id = 'armorAddTypeInput' magical_modifier_id = 'armorAddMagicalModifierInput' p...
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
#! /usr/bin/python # -*- coding: utf-8 -*- # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the f...
from weakref import ref from kivy.app import App from kivy.clock import Clock from kivy.properties import (ObjectProperty, OptionProperty, NumericProperty, ListProperty, StringProperty) from kivy.metrics import sp from kivy.animation import Animation from kivy.graphics import Color, Ellip...
# -*- coding: utf-8 -*- """ Views of ``critica.apps.archives`` application. """ from django.shortcuts import render_to_response from django.template import RequestContext from django.core.exceptions import ObjectDoesNotExist from django.core.paginator import Paginator from django.core.paginator import InvalidPage fro...
#!/usr/bin/python # -*- coding: utf-8 -*- """tests.fibonacciTestCase Model test case for adding tests into the automatic suite. To add a test case: 3) modify methods in the class, building your test case 4) edit this docstring to show the correct name and short description 5) test by running this file. will automat...
#!/usr/bin/env python3 # lofarxml_to_momxml_translator.py # # Copyright (C) 2017 # ASTRON (Netherlands Institute for Radio Astronomy) # P.O.Box 2, 7990 AA Dwingeloo, The Netherlands # # This file is part of the LOFAR software suite. # The LOFAR software suite is free software: you can redistribute it # and/or modify i...
import pytest from six import iteritems def test_config_defaults(config): for key, value in iteritems(config.DEFAULTS): assert getattr(config, key) == value @pytest.mark.parametrize("address", ("127.0.0.1", "10.10.10.10")) def test_config_address(config, address): config.address = address asser...
#-*- coding:utf-8 -*- #/usr/bin/env python import sys,os import pickle import socket class ClientArgv(object): def __init__(self,argvs): self.argvs = argvs self.argvs_parser() self.handle() def handle(self): self.connect() #接收打印欢迎信息 server_data = self.client_socke...
# 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 unde...
# -*- coding: utf-8 -*- from django import forms from django.contrib import admin from django.contrib.auth.forms import ReadOnlyPasswordHashField from django.contrib.auth.models import Group from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin from django.contrib.contenttypes.models import ContentType fr...
#!/usr/bin/env python # # pKa - various programs and scripts for pKa value analysis, calculation and redesign # Copyright (C) 2010 Jens Erik Nielsen # # 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 Foundat...
from copy import deepcopy from random import shuffle def distinct(seq): seen = set() seen_add = seen.add return [x for x in seq if not (x in seen or seen_add(x))] def approx_equal(a, b, epsilon): return abs(a-b) <= epsilon class Wire: """A Wire is a directed edge that can be used in a neural net ...
from .most_common import MostCommonHeuristic from .most_time import MostTimeHeuristic from collections import defaultdict from itertools import product from mosek.fusion import Model, Domain, Expr, ObjectiveSense, AccSolutionStatus import sys class NetworkMosek(object): '''Network binary integer program: full mode...
#!/usr/bin/env python import json import base64 import urllib import urllib2 class RestUtil(object): def __init__(self, username=None, password=None): if not username: raise RuntimeError("missing rest api username") self.username = username if not password: raise R...
"""Attach meta data to phab diffs posted in Slack Wants these environment variables: PHAB_HOST -- the hostname where your phabricator lives PHAB_API_TOKEN -- a valid api token for some phabricator bot account PHAB_FILE_HOST -- hostname for instance of https://github.com/emarschner/phabricator-file-proxy ...
from __future__ import unicode_literals try: from html import escape from html.parser import HTMLParser except ImportError: from cgi import escape from HTMLParser import HTMLParser from wtforms.meta import DefaultMeta from wtforms.widgets.core import HTMLString class PolyglotHTMLParser(HTMLParser): ...
import os.path from zinc.models import * from zinc.helpers import * from tests import * class ZincIndexTestCase(TempDirTestCase): def test_versions_for_nonexistant_bundle(self): index = ZincIndex() self.assertTrue(len(index.versions_for_bundle("meep")) == 0) def test_add_version_for_bundle...
from collections import defaultdict, namedtuple from beancount.core.data import Custom from beancount.core.number import Decimal from fava.util.date import days_in_daterange, number_of_days_in_period Budget = namedtuple('Budget', 'account date_start period number currency') BudgetError = namedtuple('BudgetError', 's...
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-rahit-user', version='0.0.1', description='Registr...
from tehbot.plugins import * import urllib2 import urllib import lxml.html import lxml.etree import json # patch XPath 2.0 function into XPath 1.0 API oO etree_funcs = lxml.etree.FunctionNamespace(None) etree_funcs["lower-case"] = lambda ctx, x: x[0].text_content().lower() if x else "" url = "http://xkcd.com%s" # ht...
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2019 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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, eith...
#!/usr/bin/python # Copyright 2017 Northern.tech AS # # 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 a...
""" Painless environment setup for acceptance tests. Powered by behave. Visit the docs at https://behave.readthedocs.io/en/latest/tutorial.html#environmental-controls """ from contextlib import contextmanager from os import chdir, getcwd, system from os.path import dirname, join from shutil import rmtree from tempfile...
from element import Elem class OrganizemIllegalDataFormatException(Exception): pass class OrganizemIllegalDataTypeException(Exception): pass # A single Item in the data file, with a root 'item:' element and child # elements for each of the fields (Elements) in an Item # Only title is required and all other args ar...
#!/usr/bin/env python3 # The MIT License (MIT) # Copyright (c) 2016,2017 Massachusetts Institute of Technology # # Author: Cody Rude # This software has been created in projects supported by the US National # Science Foundation and NASA (PI: Pankratius) # # Permission is hereby granted, free of charge, to any person o...
from edc_dashboard.subject import RegisteredSubjectDashboard from bcvp.bcvp_lab.models import SubjectRequisition from bcvp.bcvp_subject.models import SubjectVisit, SubjectConsent, SubjectLocator from bcvp.bcvp_subject.models.subject_eligibility import SubjectEligibility class SubjectDashboard(RegisteredSubjectDashbo...
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2012-2015 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. import logging from auto...
# -*- coding: utf-8 -*- """ WSGI config for flood_mapper project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application ...
from django.conf import settings from apps.client_details.models import ClientDetailsBase from apps.tags.models import Tag from canvas import stickers from canvas.cache_patterns import CachedCall from canvas.redis_models import RealtimeChannel from canvas.util import base36encode, strip_template_chars class ContentD...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import math """ Utility methods for getting math word terms. """ BINARY_OPERATORS = { '^', '*', '/', '+', '-' } MATH_WORDS = { 'ENG': { 'unary_operators': { 'squared': '^ 2', 'cubed': '^ 3', 'square ro...
from bs4 import BeautifulSoup import urllib2 import requests import time from xml.dom.minidom import parseString import re import difflib import logging ahref="" #--list of non label data nonlabel=[] a_link=[] # list of label data label=[] ids=[] ids1=[] links=[] all_ids=[] parent_attrs_list=[] parent_name_list=...
from django.test import TestCase from wagtail.wagtailcore.models import Page from wagtail.tests.models import RoutablePageTest, routable_page_external_view class TestRoutablePage(TestCase): def setUp(self): self.home_page = Page.objects.get(id=2) self.routable_page = self.home_page.add_child(inst...
from math import floor def sqrt(S): """Given an integer, return the square root. A continued fraction expansion implementation. https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Continued_fraction_expansion Args: S: Any natural number """ i = 0 s = 1 i...
#!/usr/bin/python """ This will be a test for rave's two-jet feature """ width=0.0015 length=5.3 from vertigo import RaveVertexFactory, EventFactory, RaveConstantMagneticField, \ RaveVacuumPropagator, LoopSettings, RaveTrackContainer, WeightedRaveTrack, \ ObserverManager_Instance, RaveCovariance3D, Rav...
#!/usr/bin/env python """Updates JIRA release notes when deploying to an environment. This requires the JIRA_API_USER_PASSWORD and JIRA_API_USER_NAME environment variables to be set, and flags for version and instance to be provided. """ import logging import os import sys import jira from rdr_service.main_...
# -*- coding: utf-8 -*- """ This file is part of Radar. Radar is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Radar is distributed ...
import ast as python_ast from botlang.ast.ast import * class SExpression(object): """ https://en.wikipedia.org/wiki/S-expression """ OPENING_PARENS = ['(', '[', '{'] CLOSING_PARENS = [')', ']', '}'] def to_ast(self): raise NotImplementedError def accept(self, visitor): ra...
# -*- coding: utf-8 -*- # Copyright (C) 2013-2018 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, or (at your option) any later version. # This program is distributed ...
"""Classes that wrap protobufs.""" import json from typing import Union, List, Iterable import acton.database import acton.proto.acton_pb2 as acton_pb import acton.proto.io import google.protobuf.json_format as json_format import numpy import sklearn.preprocessing from sklearn.preprocessing import LabelEncoder as SKL...
# 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...
import httplib import os.path import requests import six from simplekit import settings from simplekit.exceptions import MailException PRIORITY_NORMAL = 0 PRIORITY_LOW = 1 PRIORITY_HIGH = 2 CONTENT_TYPE_HTML = 0 CONTENT_TYPE_TEXT = 1 ENCODING_UTF8 = 0 ENCODING_ASCII = 1 ENCODING_UTF32 = 2 ENCODI...
from enum import Enum from .namespaces import Namespaces from owlapy.model import IRI from owlapy.util.decorators import ClassProperty class OWLFacet(Enum): LENGTH = (Namespaces.XSD, 'length', 'length') MIN_LENGTH = (Namespaces.XSD, 'minLength', 'minLength') MAX_LENGTH = (Namespaces.XSD, 'maxLength', 'ma...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'Comments.datetime' db.add_column(u'chat_comments', 'datet...
import datetime from djangae.db.migrations import mapper_library from google.appengine.api import datastore from google.appengine.ext import ndb from . import index from .models import Paste, make_relative_path def entity_to_instance(entity): """Returns an ndb model instance for the datastore entity.""" key...
# This file is part of Korman. # # Korman 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. # # Korman is distributed i...
# *************************************************************************** # This file is part of the GAMer software. # Copyright (C) 2016-2018 # by Christopher Lee, Tom Bartol, John Moody, Rommie Amaro, J. Andrew McCammon, # and Michael Holst # This library is free software; you can redistribute it and/or # mod...
import os import sys import django from django.core import management def pytest_addoption(parser): parser.addoption( "--no-pkgroot", action="store_true", default=False, help="Remove package root directory from sys.path, ensuring that " "graphene_django_extras is imported ...
import os from .. import msg import re import xml.etree.ElementTree as ET from fortpy.testing.comparer import FileComparer class TemplateLine(object): """Represents a single line in the template file and how to format it. :arg element: the XML element that defines this line in the file. :arg group: the [g...
# Copyright 2018 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 (c) 2019 Cloudify Platform Ltd. 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...
#/usr/bin/env python # # Copyright (C) 2016-2017 DNW German-Dutch Wind Tunnels # # This file is part of nettools. # Nettools 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 ...
"""Read all matched data and make some plotting """ import os import re from glob import glob import numpy as np from matchobject_io import (readCaliopImagerMatchObj, CalipsoImagerTrackObject) from plot_kuipers_on_area_util import (PerformancePlottingObject, ...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 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 ...
# Copyright 2009-2012 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Unit tests for BranchSubscriptions.""" __metaclass__ = type from lp.app.enums import InformationType from lp.services.webapp.interfaces import IPrimaryContext from lp.tes...
from django.core.urlresolvers import reverse from zope.interface import implements from vumi.tests.helpers import generate_proxies, IHelper from go.base import utils as base_utils from go.base.tests.helpers import DjangoVumiApiHelper from go.vumitools.tests.helpers import GoMessageHelper from .helpers import Applica...
#!/usr/bin/env python """ A XMLTV compatible EPG grabber for the Amino EPG. The grabber should function for any provider that supplies IPTV from Glashart Media. """ # Set program version VERSION = "v0.5" from datetime import datetime, date, timedelta from lxml import etree import pytz import httplib ...
#!/usr/bin/python3 #import tensorflow as tf #gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.3) ## Configure the fraction here #sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options)) import keras import keras.backend as K #K.set_session(sess) import numpy as np from subprocess import Popen, ...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011 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 opt...
"""EasyEngine log module""" class Log: """ Logs messages with colors for different messages according to functions """ HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE...
import string from os.path import join, dirname, basename, abspath from biotest import biohypothesis, BioTestCase, seqrec from hypothesis import strategies as st from hypothesis import given, assume from nose.plugins.attrib import attr from . import THIS # This makes sure valid id for SeqRecord as SeqRecord doesn't ...
from django.db import models from instruments.base import BaseTable class English_American_WG(BaseTable): item_1_choices = [('yes', 'yes'), ('no', 'no')] item_1 = models.CharField(max_length=3, choices=item_1_choices, null=True) item_2_choices = [('yes', 'yes'), ('no', 'no')] item_2 = models.CharField...
from IPython.display import display from matplotlib import animation, rc import abc class IPythonChartAnimation(object): __metaclass__ = abc.ABCMeta VIDEO_TAG = """<video controls> <source src="data:video/x-m4v;base64,{0}" type="video/mp4"> Your browser does not support the...
# 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...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2013 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
# -*- coding: utf-8 -*- from __future__ import print_function,division,absolute_import import collections import itertools import numpy as np from numpy import sin,cos class Triclinic(object): def __init__(self,a=1,b=1,c=1,alpha=90,beta=90,gamma=90): self.a = a self.b = b self.c = c alpha = alpha*np...
# Default datasets for dungeon tiles. walls = { 'north' : True, 'east' : True, 'south' : True, 'west' : True } entities = { 'items' : [], 'objects' : [], 'enemies' : [], 'npcs' : [] } # Defines a series of tiles with walls. class Tile (object): def __init__ (self, walls=walls, entities=entities, text=...
# -*- coding: utf-8 -*- # Copyright 2014-2016 The HyperSpyUI developers # # This file is part of HyperSpyUI. # # HyperSpyUI 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 #...