text
stringlengths
12
6.59M
# -*- coding: utf-8 -*- """ @author: Sebi File: czitools.py Date: 11.05.2017 Version. 1.0 """ from __future__ import print_function import misctools as misc from czifile import * import numpy as np import re from collections import Counter def get_metainfo_channel_description(filename): try: czi = CziF...
#!/usr/bin/env python # Based on previous work by # Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process) # and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/) # Adapted by M.Hendrix [2015] # daemon99....
import re from django.conf import settings from django.http import HttpResponse from django.db.models.base import ModelBase class Api(object): def __init__(self): self._registry = {} # model_class class -> api_class instance def register(self, model_or_iterable, api_class=None, **op...
import sublime import sublime_plugin import os import subprocess import threading import re class DartLint(sublime_plugin.EventListener): def __init__(self, *args, **kwargs): sublime_plugin.EventListener.__init__(self, *args, **kwargs) print("Dart lint active.") def on_post_save(self, view): ...
# Copyright (C) 2015 Schweitzer Engineering Laboratories, Inc. # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. import unittest import urllib2 import pytest try: import unittest.mock as mock except ImportError: # mock is required as an e...
from __future__ import absolute_import, division, print_function import networkx as nx from dask.core import istask, get_dependencies from toolz import first def make_hashable(x): try: hash(x) return x except TypeError: return hash(str(x)) def lower(func): while hasattr(func, 'fu...
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ import os from textwrap import dedent import path import pytest from click.testing import CliRunner from pytablereader.interface import AbstractTableReader from simplesqlite import SimpleSQLite from sqliteschema import SQLiteSchemaExtractor fro...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import unicode_literals import collections from textwrap import dedent import pytablereader as ptr import pytablewriter as ptw import pytest from path import Path from pytablereader.interface import TableLoader...
"""Formatter producing CSV data.""" import sys import csv from collections import OrderedDict import formatter import executor # TO BE DEFINED # - wrong lines # - return_code/code/section status # - difference/similarity class CSVFormatter(formatter.Formatter): _RESULT_TABLE = { executor.ER_OK: "ok", ...
from random import shuffle from base import ObjectCubeTestCase from objectcube.data_objects import Object, Tag, Tagging, Plugin from objectcube.exceptions import ObjectCubeException from objectcube.factory import get_service from types import IntType, LongType class TestTaggingService(ObjectCubeTestCase): def __...
from django.db.migrations.operations.base import Operation from .fields.composite import composite_type_created class LoadSQLFromScript(Operation): def __init__(self, filename): self.filename = filename @property def reversible(self): return False def state_forwards(self, app_label,...
#!/usr/bin/python # write out the data in a form useful to pass to the sba (demo) program # it appears camera poses are basically given as [ R | t ] where R is # the same R we use throughout and t is the 'tvec' # todo, run sba and automatically parse output ... import sys sys.path.insert(0, "/usr/local/lib/python2....
# a class to manage SRTM surfaces import json import numpy as np import os from pylab import * import random import scipy.interpolate import struct import urllib.request import zipfile import navpy # return the lower left corner of the 1x1 degree tile containing # the specified lla coordinate def lla_ll_corner(lat_d...
# Copyright 2017,2018 James McCauley # # 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 ...
# Copyright 2012,2013 James McCauley # # 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 ...
from datetime import datetime import todoRedis class Repo: def __init__(self): self.userName = '' self.repoName = '' self.gitUrl = '' self.status = "New" self.Todos = [] self.tagDate = datetime.now().strftime("%m/%d/%Y %H:%M:%S") def key(self): return ...
# Copyright 2012 James McCauley # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
import sys import typing # TODO: In Py3.9 onwards, ABCs can be subscripted directly import warnings from collections.abc import Mapping, Sequence from dataclasses import dataclass from math import atan2, copysign, cos, degrees, hypot, isclose, radians, sin, sqrt from typing import Optional, SupportsFloat, Tuple, Union...
# Predict the background radiation level at a certain location # Betabetabetabetabetabetabetabetabetabetabetabetabetabeta, so don't rely on this just yet :) import numpy as np from PIL import Image import sys from scipy import interpolate import geopy.distance import os # Predicts the (electon, proton) count per fram...
# # # Copyright (C) 2010, 2011 Google Inc. # # 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, or # (at your option) any later version. # # This program is distri...
import os import cv2 import h5py import matplotlib.pyplot as plt import numpy as np import bilinear import utils from utils import util class Predictor: def __init__(self, input_shapes, transformers=None, name=None): self.input_shapes = input_shapes self.transformers = transformers or [] w...
# Copyright 2012-2014 Ravello Systems, 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 t...
#------------------------------------------------------------------------------- import sqlite3 import bcrypt import os import shutil import data import htpasswd import re from email.utils import parseaddr import config #------------------------------------------------------------------------------- BCRYPT_ROUNDS = 5 ...
# Copyright (c) 2014 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or implied, # including the impl...
# Copyright (c) 2015-2018 Patricio Cubillos and contributors. # MC3 is open-source software under the MIT license (see LICENSE). __all__ = ["trace", "pairwise", "histogram", "RMS", "modelfit", "subplotter"] import sys, os import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import scipy.interpo...
""" Defines Database class which contains and organizes all transaction records.""" import sys from datetime import timedelta, date import transaction # Defines Database class, the main workhorse in the Snidget program # It is basically a container object for all the transactions on record, # including the functions ...
from __future__ import with_statement from StringIO import StringIO import json import logging import re import struct from eventlet.green import socket import tarfile import datetime import random from urllib import urlencode import mock import sys import swift import unittest import os import cPickle as pickle from ...
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2013 Stanford University and the Authors # # Authors: Jason Swails # Contributors: # # MDTraj is free software: you ...
import os from django.core.management.commands.makemessages import TranslatableFile from django.test import SimpleTestCase class TranslatableFileTests(SimpleTestCase): def test_repr(self): dirpath = 'dir' file_name = 'example' trans_file = TranslatableFile(dirpath=dirpath, file_name=file...
# President.py was created by MrSuicide # This will create a system.JSON file and a data folder # This will modify values your government.py import os import asyncio import random import time import discord from operator import itemgetter from discord.ext import commands from .utils.dataIO import dataIO from random ...
import socket import sys # from six.moves import BaseHTTPServer # from six.moves import urllib from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler import urlparse import urllib class ClientRedirectServer(HTTPServer): """ A server to handle OAuth 2.0 redirects back to localhost. Waits for a single re...
''' Created on May 31, 2013 @author: teddydestodes ''' from rfk.database.base import Permission, Setting, User import rfk.database def setup_settings(): settings = [] settings.append(Setting.add_setting('use_icy', 'Use ICY-Tags for unplanned Shows', Setting.TYPES.INT)) settings.append(Setting.add_settin...
# -*- coding: utf-8 -*- from __future__ import unicode_literals #pylint: disable-msg=redefined-builtin from builtins import str, range, object from dns import reversename from nose_parameterized import parameterized from spam_lists.exceptions import InvalidHostError, InvalidHostnameError, \ InvalidIPv4Error, InvalidI...
from __future__ import print_function, division import time from .delay_import import import_ from .arrays import ensure_type from .unit import in_units_of from .unitcell import (lengths_and_angles_to_box_vectors, box_vectors_to_lengths_and_angles) __all__ = ["ensure_type", "import_", "in_units_...
# President.py was created by MrSuicide # This will create a system.JSON file and a data folder # This will modify values your government.py import os import asyncio import random import time from operator import itemgetter from discord.ext import commands from .utils.dataIO import dataIO from random import randint ...
import os.path from os import listdir import re from collections import OrderedDict, deque, Sequence import logging default_tokenizer = re.compile(r'\S+\s*') class ToolboxError(Exception): pass class ToolboxInitError(ToolboxError): pass def find_project_file(path): proj_path = None if os.path.isfile(path): ...
#!/bin/env python2.2 import types,re,sys,time,os,random,math,gzip,pickle,optparse, threading, csv, htmlentitydefs, odict, collections, operator, functools, subprocess, colorsys, base64 try: import mx.DateTime except: print "Ik kon mx>DateTime niet importeren" from datetime import datetime _USE_CURSES = 1 def val...
#!/usr/bin/python ################################################################################################ # # Copyright (c) 2017 Jason Resch # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the...
#!/usr/bin/python # 0xCCCCCCCC import json from flask import Flask, request, Response, url_for app = Flask('__name__') @app.route('/') def root(): return 'Welcome and see the instruction manual as follows' @app.route('/preupload') def prepare_upload(): profile = request.args['profile'] mid = request....
# # fullbuild creates everything that needs to be created before a # distribution can be made, and puts it all in the right place. # # It expects the projects to be in the places where Jack likes them: # in directories named like 'build.mac'. That is fixable, # however. # # NOTE: You should proably make a copy of pytho...
from __future__ import absolute_import from Queue import Empty, Full from contextlib import closing from multiprocessing.queues import Queue from random import randint from time import sleep from unittest import TestCase from mock import MagicMock, patch from hermes.connectors import PostgresConnector from hermes.lis...
# -*- coding: utf-8 -*- """ toolset working with cboe data @author: Jev Kuznetsov Licence: BSD """ import datetime from datetime import datetime, date import urllib2 from pandas import DataFrame, Index from pandas.core import datetools import numpy as np def monthCode(month): """ perform m...
import os import sys import glob import json import subprocess from collections import defaultdict from utils import UnicodeReader, slugify, count_pages, combine_pdfs, parser import addresscleaner from click2mail import Click2MailBatch parser.add_argument("directory", help="Path to downloaded mail batch") def fix_li...
# # Copyright (c) Elliot Peele <elliot@bentlogic.net> # # This program is distributed under the terms of the MIT License as found # in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/licenses/mit-license.php. # # This program is distributed in the hope that it...
#!/usr/bin/env python3 """ Nick Hahner 2017-2020 Ever wanted to automate finding the top cute cat picture from /r/aww to send to your friends? All you need to do is run ./top_cat.py and your life will change forever. You'll need to create ~/.top_cat/config.toml if you want to find dogs instead! You can also add your ...
# -*- coding: utf-8 -*- import os import json import pyaml import pytest import click from click.testing import CliRunner from boussole.cli.console_script import cli_frontend @pytest.mark.parametrize("options,filename", [ ([], 'settings.json'), (['--backend=yaml'], 'settings.yml'), (['--backend=json'],...
# -*- coding: iso8859-1 -*- # # Copyright (C) 2003, 2004 Edgewall Software # Copyright (C) 2003, 2004 Jonas Borgstrm <jonas@edgewall.com> # # Trac 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...
#!/usr/bin/env python # $Id$ """ A module for reading and writing FITS files and manipulating their contents. A module for reading and writing Flexible Image Transport System (FITS) files. This file format was endorsed by the International Astronomical Union in 1999 and mandated by NASA as the standard format for s...
# This file is part of Maker Keeper Framework. # # Copyright (C) 2017 reverendus # # 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 option) a...
#!/usr/bin/env python ''' Created on 05/10/2012 @author: Alex Ip ''' import os import sys import argparse import ConfigParser import logging import errno import psycopg2 import socket from ULA3.utils import execute from ULA3.utils import log_multiline # Set top level standard output console_handler = logging.Stream...
""" Django settings for auswertung project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
#!/usr/bin/env python # # vim: sw=2 ts=2 sts=2 # Copyright 2007 The Python-Twitter Developers # # 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....
# crow C++ Web Framework # https://github.com/ipkn/crow # crow is a header only C++ framework # 1. Clone crow from https://github.com/ipkn/crow # 2. Add `crow/amalgamate` to the include path # 3. Include `crow_all.h` import subprocess if __name__=="__main__": subprocess.call([ "git", "clone", "https://github.com...
""" Created on Sun Oct 04 23:10:41 2015 @author: ujjwal.karn """ #first, install pip by following instructions here: http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows #then, to install tweepy library, go to Anaconda command prompt and type: pip install tweepy #once tweepy is installed, run the ...
""" Parse and traverse a Data Loaf grammar. """ from __future__ import print_function import argparse import random import re import sys __version__ = '0.1.0' # TODO: Make a WeightedMapping that caches sum def random_weighted(list_): total = sum([x[0] for x in list_]) n = random.uniform(0, total) for wei...
class Producer(object): """ Base class for producers. __init__ must be called by inheriting classes. Inheriting classes must implement: - ``_run`` to run the producer, after running `out` attribute has to be set to path to produced output - ``configure(jvm, *options)`` to configure i...
#!/usr/bin/env python # # vim: sw=2 ts=2 sts=2 # # Copyright 2007 The Python-Twitter Developers # # 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-...
from UM.Qt.ListModel import ListModel from PyQt5.QtCore import pyqtProperty, Qt, pyqtSignal, pyqtSlot, QUrl from UM.Settings.ContainerRegistry import ContainerRegistry from UM.Settings.InstanceContainer import InstanceContainer ## Model that holds instance containers. By setting the filter property the instances h...
""" Task object to generate / manage assessors and cluster """ import os import shutil import errno import time import logging from datetime import date import cluster from cluster import PBS from dax_settings import DAX_Settings DAX_SETTINGS = DAX_Settings() RESULTS_DIR = DAX_SETTINGS.get_results_dir() DEFAULT_EMAIL...
#!/usr/bin/python # mininet tests for FAUCET # # * must be run as root # * you can run a specific test case only, by adding the class name of the test # case to the command. Eg ./faucet_mininet_test.py FaucetUntaggedIPv4RouteTest # # REQUIRES: # # * mininet 2.2.0 or later (Ubuntu 14 ships with 2.1.0, which is not su...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
#!/usr/bin/python # # Copyright 2007 Google Inc. All Rights Reserved. '''A library that provides a python interface to the Twitter API''' __author__ = 'dewitt@google.com' __version__ = '0.4' import md5 import os import simplejson import tempfile import time import urllib import urllib2 import urlparse import twitte...
import discord, feedparser, praw # Need installing. import logging # Builtins. from discord.ext import commands logging.basicConfig(level=logging.WARNING) # Set up discord vars. description = "This is a WIP bot to work discord. Use !bothelp." bot_prefix = "!" global client client = commands.Bot(descriptio...
""" Task object to generate / manage assessors and cluster """ import os import shutil import errno import time import logging from datetime import date import cluster from cluster import PBS from dax_settings import DAX_Settings DAX_SETTINGS = DAX_Settings() #Logger to print logs LOGGER = logging.getLogger('dax') ...
#!/usr/bin/python # mininet tests for FAUCET # # * must be run as root # * you can run a specific test case only, by adding the class name of the test # case to the command. Eg ./faucet_mininet_test.py FaucetUntaggedIPv4RouteTest # # TODO: # # * bridge hardware OF switch for comparison with OVS # # REQUIRES: # # * m...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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...
#!/usr/bin/env python3 """ twsetup: Copyright (c) 2013, Andrew Plotkin (Available under the MIT License; see LICENSE file.) This script sets up the Mongo database with the bare minimum of data needed to run Tworld. You will typically run this exactly once when setting up your server. """ import sys import os import ...
import json import time import os import argparse import sys import logging import threading import subprocess from datetime import datetime from helpers import get_chatters, get_subscribers from models.user import UserManager from models.emote import Emote from models.setting import Setting from models.connection im...
import subprocess import os import sys import time import sqlite3 import urlparse import irc.client import yaml import py.test class TestingClient(object): def __init__(self, server, port, nickname): self.irc = irc.client.IRC() self.c = self.irc.server() self.c.connect(server, port, nickname) self.irc.proce...
import subprocess import os import sys import time import sqlite3 import urlparse import irc.client import yaml import py.test class TestingClient(object): def __init__(self, server, port, nickname): self.irc = irc.client.IRC() self.c = self.irc.server() self.c.connect(server, port, nickname) self.irc.proce...
# standard libraries import unittest import os import logging # project-specific libraries from VAPr.base import AnnotationProject from VAPr import definitions from VAPr.parsers import HgvsParser, TxtParser from VAPr.parsers import VariantParsing from VAPr.parsers import parse_by_step logger = logging.getLogger() log...
#!/usr/bin/python import argh import json import sys import pandas as pd from datetime import * from sqlalchemy import create_engine, literal, or_, inspection from os import path from common_classes import * from sqlalchemy.orm import sessionmaker, aliased import sqlalchemy allowed_classes = { "Animal": Animal, ...
# Built-in modules # Base import os import ctypes import traceback import datetime import time # Main # import [module] # Pygame import pygame try: import pygame._view # sometimes necessary. If it isn't this will cause an error #! UPDATE: this might only be necessary for py2exe to work, so if...
from qqbot import QQBotSlot as qqbotslot, QQBot from qqbot.qcontactdb import QContact from tenhoubot import main as starttenhou import threading import re import random import time is_playing = False qq_group = None class BotConnector(object): def __init__(self, qqbot): self.qbot = qqbot self.stop...
""" Top-level functions for ``propagator``. This contains main functions use propagate and accumlate catchment properties in a larger watershed. (c) Geosyntec Consultants, 2015. Released under the BSD 3-clause license (see LICENSE file for more info) Written by Paul Hobson (phobson@geosyntec.com) """ import os i...
import xmlrpclib import socket import time import sys try: from xml.parsers.expat import ExpatError except ImportError: ExpatError = None # Support for Jython 2.2 from robot.errors import RemoteError class Remote: ROBOT_LIBRARY_SCOPE = 'TEST SUITE' def __init__(self, uri='http://localhost:827...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ GPLv3 license (ASTRA toolbox) Note that the TomoPhantom package is released under Apache License, Version 2.0 * Script to generate 3D analytical phantoms and their projection data using TomoPhantom * Synthetic flat fields are also genererated and noise incorporated in...
# new features introduced by itk module # each new feature use a name in lower case clrLine = "\033[2K\033E\033[1A" def auto_not_in_place( v=True ) : """Force it to not run in place """ import itkConfig itkConfig.NotInPlace = v def auto_progress( progressType = 1 ): """Set up auto progress report progr...
import time from pylinkirc import utils, conf from pylinkirc.log import log from pylinkirc.classes import Protocol, IrcUser, IrcServer class ClientbotWrapperProtocol(Protocol): def __init__(self, irc): super().__init__(irc) # FIXME: Grab this from 005 / RPL_ISUPPORT instead of hardcoding. ...
""" nefarious.py: Nefarious IRCu protocol module for PyLink. """ import base64 import struct from ipaddress import ip_address import time from pylinkirc import utils, structures from pylinkirc.classes import * from pylinkirc.log import log from pylinkirc.protocols.ircs2s_common import * class P10UIDGenerator(utils.I...
'''Python implemetation of the W3C Provenance Data Model (PROV-DM) Support for PROV-JSON import/export References: PROV-DM: http://www.w3.org/TR/prov-dm/ @author: Trung Dong Huynh <trungdong@donggiang.com> @copyright: University of Southampton 2012 ''' import logging import datetime import json import re import co...
import StringIO import hashlib import io import os import pickle import tempfile import time import errno import zlib from django.core.cache.backends import filebased import shutil from proxy import utils __author__ = 'alex' class Iterator(object): def __init__(self, data): self.data = data def s...
# 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 applicable law or ...
# Copyright (c) 2008, Aldo Cortesi. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify...
# -*- coding: iso-8859-1 -*- import socket, base64, codecs, os class EResponse(Exception): pass class EDuplicate(EResponse): pass _field_parsers = { "created": lambda x: int(x, 16), "width" : lambda x: int(x, 16), "height" : lambda x: int(x, 16), "score" : int, } def _utf(s): if type(s) is not unicode: try...
# -*- coding: utf-8 -*- import urllib from xml.dom import minidom class Bill: """Represents the bills as maintained by Open Legislation """ @staticmethod def loadFromXML(xml): """Loads a list of bills from an XML string or minidom class Converts into into minidom and ...
""" This file implements an http server. It serves up HDF5 datasets over http using the DVID REST API. The server can also be started up in stand-alone mode: $ cd mockserver $ PYTHONPATH=.. python h5mockserver.py my_hdf5_file.h5 Internally, your hdf5 file must be a hierarchy, with symlinks for easy access to...
# Copyright 2012 Calvin Rien # # 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...
# # # Copyright (C) 2006, 2007, 2011, 2012, 2014 Google Inc. # # 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, or # (at your option) any later version. # # This...
""" Support for example tables wrapping data stored on a PostgreSQL server. """ from urllib import parse import numpy as np import psycopg2 from .. import domain, variable, value, table, instance, filter from Orange.data.sql import filter as sql_filter class SqlTable(table.Table): connection = None table_na...
# Copyright 2006 James Tauber and contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
from pybrain.structure import FeedForwardNetwork, LinearLayer, TanhLayer from pybrain.structure.connections import FullConnection, IdentityConnection, MotherConnection, SharedFullConnection from pybrain.structure.connections.connection import Connection from pybrain.structure.moduleslice import ModuleSlice class FFN:...
# Copyright 2006 James Tauber and contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
from typing import Generator, Tuple, Union from .program_members import (Attribute, Subroutine, Uniform, UniformBlock, Varying) __all__ = ['ComputeShader'] class ComputeShader: ''' A Compute Shader is a Shader Stage that is used entirely for computing arbitrary info...
#!/usr/bin/env python import sqlite3 #Using sqlite to store the data of devices. #os.system('./db_init.sql') #create database and init the tables def create_db(): con = sqlite3.connect('gw.db') print(con) def create_table(): con = sqlite3.connect('gw.db') c = con.cursor() sql_str = '''CREATE TABLE DEVICE( ...
from calendar import month_name from datetime import datetime, timedelta from django.contrib.auth.models import User from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.template import RequestContext from mezzanine.blog.forms import CommentForm from m...
# Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
from __future__ import absolute_import, unicode_literals from future.builtins import int, open, str import os import mimetypes from json import dumps from django.template.response import TemplateResponse try: from urllib.parse import urljoin, urlparse except ImportError: from urlparse import urljoin, urlpar...
import os import sys import argparse import agasc from kadi import events from Ska.engarchive import fetch, fetch_sci from astropy.table import Table, Column from Chandra.Time import DateTime import mica.archive.obspar from mica.starcheck import get_starcheck_catalog, get_starcheck_catalog_at_date import tables import ...
# -*- coding: utf-8 -*- """ =========================== Enhancing off-disk emission =========================== How to enhance emission above the limb. """ import numpy as np import matplotlib.pyplot as plt import astropy.units as u from astropy.visualization.mpl_normalize import ImageNormalize import sunpy.map fro...