text
stringlengths
17
737k
# -*- coding: utf-8 -*- import sublime, sublime_plugin import os import shutil import subprocess import zipfile import glob import sys import codecs import re import json import xml.etree.ElementTree ### ### Global Value ### PACKAGE_NAME = 'EPubMaker' OPEN_COMMAND = 'epub_maker_open' SAVE_COMMAND = 'epub_maker_s...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import import SimpleITK as sitk import tensorflow as tf import os import numpy as np from dltk.io.augmentation import extract_random_example_array from dltk.io.preprocessing im...
from __future__ import absolute_import import base64 import json import webbrowser import inspect import os from os.path import isdir import six from plotly.io import to_json, to_image, write_image, write_html from plotly import utils, optional_imports from plotly.io._orca import ensure_server from plotly.offline.offl...
""" Augmenters that overlay two images with each other. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Alpha(0.5, iaa.Add((-5, 5))) ]) List of augmenters: * Alpha ...
# -*- coding: utf-8 -*- import scipy.stats as ss import numpy.random as npr from functools import partial from . import core def npr_op(distribution, size, input): prng = npr.RandomState(0) prng.set_state(input['random_state']) distribution = getattr(prng, distribution) size = (input['n'],)+tuple(siz...
# coding=utf-8 """ Reusable widgets to be included in views. NOTE: code is currently quite messy. Needs to be refactored. """ import cgi import urlparse import re from itertools import ifilter from collections import namedtuple import bleach from flask import render_template, json, Markup, render_template_string from...
# python3 # Copyright 2018 DeepMind Technologies Limited. 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 re...
import yaml import shlex from . import globals as globs from syn.five import STR from functools import partial from operator import attrgetter from subprocess import Popen, PIPE from syn.type import List, Mapping from syn.base_utils import AttrDict from syn.base import Base, Attr, create_hook from .operation import Ope...
from __future__ import unicode_literals import logging import tornado.escape import tornado.web import tornado.websocket import mopidy from mopidy import core, models from mopidy.utils import jsonrpc logger = logging.getLogger(__name__) def construct_rpc(actor): inspector = jsonrpc.JsonRpcInspector( ...
from collections import Sized, OrderedDict import matplotlib.pyplot as plt from matplotlib import collections as mc import numpy as np import ipywidgets import IPython.display as ipydisplay from menpo.image import MaskedImage, Image from menpo.image.base import _convert_patches_list_to_single_array from .options imp...
import os, struct, time from disco.compat import BytesIO, file, basestring from disco.compat import pickle_dumps, str_to_bytes, bytes_to_str from inspect import getmodule, getsourcefile from zipfile import ZipFile, ZIP_DEFLATED from zlib import compress, crc32 from disco.error import DataError MB = 1024**2 MIN_DISK_S...
from queue import Queue from unittest.mock import MagicMock, patch, call from mpf.tests.MpfBcpTestCase import MockBcpClient from mpf.tests.MpfTestCase import MpfTestCase class TestBcpClient(MockBcpClient): def __init__(self, machine, name, bcp): super().__init__(machine, name, bcp) self.queue = Q...
import time from django.test import TestCase from django.contrib.auth.models import User from django.conf import settings from rest_framework.renderers import JSONRenderer from rest_framework.parsers import JSONParser from io import BytesIO import json from login.models import Profile, AmbulancePermission, HospitalP...
#!/usr/bin/env python # -*- encoding: utf8 -*- """ TODO: - Check address format - Format markdown as nice text - """ htmltemplate = u"""\ <html> <meta charset="utf-8" /> <head> <style> {style} </style> </head> <body> {body} </body> </html> """ def _unicode(string): if hasattr(str, 'decode'): return s...
import os import re from . import utils PARTIAL = re.compile('(?P<tag>{{>\s*(?P<name>.+?)\s*}})') PARTIAL_CUSTOM = re.compile('^(?P<whitespace>\s*)(?P<tag>{{>\s*(?P<name>.+?)\s*}}(?(1)\r?\n?))', re.M) # def get_template(path, ext='html', partials=None): # path = os.path.join(TEMPLATES_DIR, '{}.{}'.format(path, ...
from django.shortcuts import render, get_object_or_404 from django.views.generic.edit import CreateView from django.urls import reverse_lazy from django.contrib.auth.decorators import login_required, permission_required from django.utils.decorators import method_decorator from sendfile import sendfile from django_table...
#!/bin/python """Utility for grouping items and working with grouped items.""" import re import six from mtools.util import OrderedDict class Grouping(object): """Grouping object and related functions.""" def __init__(self, iterable=None, group_by=None): """Init object.""" self.groups = {}...
# -*- coding: utf-8 -*- """ The module :mod:`odoo.tests.common` provides unittest test cases and a few helpers and classes to write tests. """ import base64 import collections import errno import glob import importlib import itertools import json import logging import operator import os import re import requests impor...
"""Contains the MultiBall device class.""" from mpf.core.enable_disable_mixin import EnableDisableMixin from mpf.core.delays import DelayManager from mpf.core.device_monitor import DeviceMonitor from mpf.core.events import event_handler from mpf.core.mode_device import ModeDevice from mpf.core.placeholder_manager impo...
class Collection(object): """See 3.3.5 Emulating container types: http://docs.python.org/ref/sequence-types.html#l2h-232""" def __init__(self, graph, uri, seq=[]): self.graph = graph self.uri = uri or BNode() for item in seq: self.append(item) def _get_container(se...
import json import logging from django.conf import settings from django.utils import timezone from ambulance.models import Ambulance, \ AmbulanceStatus, CallStatus, CallPriority, Call, AmbulanceCallStatus from ambulance.serializers import CallSerializer from emstrack.tests.util import point2str from hospital.mode...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import six from cryptography import utils from cryptography.exceptions i...
# Copyright 2021 The mT5 Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
#!/usr/bin/env AFDKOPython # encoding: UTF-8 from __future__ import division, absolute_import, print_function, unicode_literals import collections, subprocess, os import defcon def draw(self, pen): """ Draw the contour with **pen**. """ # >>> # from ufoLib.pointPen import PointToSegmentPen # -...
# -*- coding: utf-8 -*- ''' Work with virtual machines managed by libvirt :depends: libvirt Python module ''' # Special Thanks to Michael Dehann, many of the concepts, and a few structures # of his in the virt func module have been used # Import python libs from __future__ import absolute_import, print_function, unic...
import sys from scenario import run_scenario def main(args=None): if args is None: args = sys.argv[1:] assert len(args) == 2, 'Usage: scenario <executable> <scenario>' executable_path = args[0] scenario_path = args[1] result, feedback = run_scenario(executable_path, scenario_path) ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Osma Suominen <osma.suominen@tkk.fi> # Copyright (c) 2010-2011 Aalto University and University of Helsinki # MIT License # see README.txt for more information import sys import time try: from rdflib import URIRef, BNode, Literal, Namespace, RDF, RDFS except ImportErr...
from mss import mss from PIL import Image, ImageTk from collections import deque import tkinter as tk import threading, queue, time, sys, pygame #window handling code, it has to be platform specific unfortunately if sys.platform == 'linux': #get window size/position using wnck (linux only) import gi gi.req...
import os import logging from tempfile import mkdtemp from ingestors.util import remove_directory from aleph.core import db, archive, celery from aleph.model import Document from aleph.logic.documents.manager import DocumentManager from aleph.logic.documents.result import DocumentResult from aleph.index import documen...
# LIBTBX_PRE_DISPATCHER_INCLUDE_SH export PHENIX_GUI_ENVIRONMENT=1 # LIBTBX_PRE_DISPATCHER_INCLUDE_SH export BOOST_ADAPTBX_FPE_DEFAULT=1 # DIALS_ENABLE_COMMAND_LINE_COMPLETION from __future__ import division from gltbx import wx_viewer import copy import wx import wxtbx.utils from gltbx.gl import * import gltbx from s...
""" Utility functions for atmospheric data wrangling / preparation. - ndarrays - netCDF files - Lat-lon geophysical data - Pressure level data and topography """ from __future__ import division import numpy as np import pandas as pd import collections import scipy.interpolate as interp from mpl_toolkits import basema...
# -*- coding: utf-8 -*- """ Created on Fri Mar 27 13:11:26 2015 @author: mcgibbon """ from __future__ import division, absolute_import, unicode_literals import numpy as np import re import six from scipy.ndimage.filters import convolve1d derivative_prog = re.compile(r'd(.+)d(p|x|y|theta|z|sigma|t|lat|lon)') from text...
import abc from pox.openflow.libopenflow_01 import * import headerspace.config_parser.openflow_parser as hsa class Fingerprint(object): __metaclass__ = abc.ABCMeta # This should really be a protected constructor def __init__(self, field2value): self._field2value = field2value def to_dict(self): retu...
from django.db import models from django.db.models.aggregates import Count from clubs.utils import is_coordinator_of_any_club, is_deputy_of_any_club, get_user_clubs, \ get_user_coordination_and_deputyships class ActivityManager(models.Manager): """ Custom manager for Activity model with custom querysets ...
# The MIT License (MIT) # # Copyright (c) 2013 cpelley # # 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, m...
# vim: tabstop=4 fileencoding=utf-8 # copyright Michael Weber (michael at xmw dot de) 2014 from config import STORAGE_DIR, LINK_DIR, FILE_SIZE_MAX, MIME_ALLOWED OUTPUT = 'default', 'raw', 'html', 'link', 'qr' import base64, hashlib, mod_python.apache, os, qrencode, PIL.ImageOps hsh = lambda s: base64.urlsafe_b64enco...
# coding=utf-8 from __future__ import absolute_import, division, print_function, unicode_literals __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2018 The OctoPrint Project - Released under terms of the AGPLv3 License" import octoprint.plugin fro...
import serpent import requests import json from ethereum import utils from ethereum.abi import ContractTranslator, encode_abi, decode_abi GETH_DEFAULT_RPC_PORT = 8545 ETH_DEFAULT_RPC_PORT = 8080 PYETHAPP_DEFAULT_RPC_PORT = 4000 class EthJsonRpc(object): DEFAULT_GAS_FOR_TRANSACTIONS = 500000 DEFAUL...
import os.path import webbrowser import re import json try: from . import api, msg, utils, reactor, shared as G, event_emitter from .handlers import account, credentials from .. import editor from ..common.exc_fmt import str_e except (ImportError, ValueError): from floo.common.exc_fmt import str_e ...
#!/usr/bin/env python3 from io import StringIO import pandas as pd import traceback import psycopg2 import boto3 import sys import os def connect_to_redshift(dbname, host, user, port = 5439, **kwargs): # connect to redshift global connect, cursor connect = psycopg2.connect(dbname = dbname, ...
import panoptes.utils.logger as logger import panoptes.utils.serial as serial class AbstractMount: """ Abstract Base class for controlling a mount """ def __init__(self, connect=False, logger=None): """ Create a new mount class. Sets the following properies: - self.non_s...
"""Tests for the plasma dispersion function and its derivative""" import numpy as np import pytest from astropy import units as u from ..mathematics import plasma_dispersion_func, plasma_dispersion_func_deriv # (zeta, expected) plasma_dispersion_func_table = [ (0, 1j * np.sqrt(np.pi)), (1, -1.076_159_01 + 0....
from django.test import TestCase import datetime from decimal import * from transactions.models import Portfolio, Transaction from securities.models import Security, Price from django.utils import timezone # Create your tests here. class TransactionTests(TestCase): def setUp(self): pass def tearDown...
#!/usr/bin/env python # coding: utf-8 # The MIT License (MIT) # Copyright (c) 2015 Pavel Vomacka # 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 limi...
import imp import sys from os import environ as env from os.path import abspath, dirname, join, normpath import dj_database_url # flake8: noqa DJANGO_ROOT = dirname(abspath(__file__)) SITE_ROOT = dirname(DJANGO_ROOT) PROJECT_ROOT = dirname(SITE_ROOT) SITE_TITLE = 'ResearchCompendia' sys.path.append(DJANGO_ROOT) D...
#!/usr/bin/python # # Check/update default wiki pages from the Trac project website. # # Note: This is a development tool used in Trac packaging/QA, not something # particularly useful for end-users. # # Author: Daniel Lundin <daniel@edgewall.com> import httplib import re import sys import getopt # Pages to inc...
# coding=utf8 """ weather.py - Willie Yahoo! Weather Module Copyright 2008, Sean B. Palmer, inamidst.com Copyright 2012, Edward Powell, embolalia.net Licensed under the Eiffel Forum License 2. http://willie.dftba.net """ from __future__ import unicode_literals from willie import web from willie.module import commands...
# Django settings for evething project. import os _PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '..')) # admins, obviously ADMINS = ( ('Freddie', 'freddie@wafflemonster.org'), ) MANAGERS = ADMINS # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki...
#! /usr/bin/env python3 """ copyright (c) 2014 by Nixarus. See LICENSE for more details. Created by Nixarus. [http://www.nixarus.com] """ import configparser import subprocess import sys import os from collections import OrderedDict REPOPATH = "/etc/yum.repos.d" REPOFILE = "redhat.repo" class RepoManager(object):...
#!/usr/bin/env python3 # Copyright (C) 2011, 2015-2017 Andrew Hamilton. All rights reserved. # Licensed under the Artistic License 2.0. import os import os.path import shutil import socket import stat import subprocess import tempfile import unittest import vigil.lscolors as lscolors class TempDirTestCase(unittest...
''' A collection of functions that other scripts can use. ''' from __future__ import print_function import subprocess import sys import time import smtplib import mimetypes import getpass import os import filecmp import hashlib import datetime import uuid import tempfile import csv import operator import json import ...
# Initialize App Engine and import the default settings (DB backend, etc.). # If you want to use a different backend you have to remove all occurences # of "djangoappengine" from this file. from djangoappengine.settings_base import * import os DEBUG = False # Activate django-dbindexer for the default database DATABA...
# -*- coding:utf-8 -*- import os import sys import socket from django.utils.translation import ugettext_lazy as _ # Django settings for i4p project. PROJECT_ROOT = os.path.dirname(__file__) sys.path.append(os.path.join(PROJECT_ROOT,'..')) # If we are on staging, then switch off debug if socket.gethostname() == 'i4p-...
""" Django settings for gettingstarted project, on Heroku. For more info, see: https://github.com/heroku/heroku-django-template For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/se...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 import os import logging from django.contrib import messages CACHE_BACKEND = 'memcached://127.0.0.1:11211/' DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = () MANAGERS = ADMINS # default to the system's timezone settings TIME_ZONE = "UTC" # Langua...
#-*-coding: utf-8 -*- from tornado.options import define import logging as logs define("port", default=8000) define("debug", True) define("logger", logs.getLogger("Tornado-data")) define("api_url", "https://api.github.com") define("contribution_url", lambda user: "https://github.com/users/" + user + "/cont...
from __future__ import division from __future__ import print_function import logging import os #Hack to get custom tags working django 1.3 + python27. INSTALLED_APPS = ( #'nothing', 'customtags', ) ROOT_DIR = os.path.abspath(os.path.dirname(__file__)) TEMPLATES = [ { 'BACKEND': 'django.template.backends....
## -*- coding: utf-8 -*- # settings.py # This file contains system level settings. # Settings include database, time zone, authentication, and installed apps. # New settings should not be added here. import os.path import posixpath import pinax PINAX_ROOT = os.path.abspath(os.path.dirname(pinax.__file__)) PROJECT_RO...
# Django settings for cualbondi project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG LOGIN_REDIRECT_URL = '/' ADMINS = ( # ('Your Name', 'your_email@example.com'), ) DEFAULT_FROM_EMAIL = "info@cualbondi.com.ar" MANAGERS = ADMINS BASE_PATH = os.path.dirname(os.path.abspath(__file__)) DATABASES = { 'defau...
import thread, time, getopt, sys import RPi.GPIO as GPIO from flask import Flask, render_template, request, jsonify app = Flask(__name__) GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) TEST_MODE = False doorSensor = 26 motionSensor = 12 doorRelay = 13 doorOpenSensor = 4 kitchenDoorSensor = 5 doorIsOpen = False door...
# Django settings for mechanicalmooc project. import os ROOT = os.path.dirname(os.path.abspath(__file__)) path = lambda *a: os.path.join(ROOT, *a) DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { } # Local time zone for this installat...
COURSEWARE_ENABLED = True if 'TRACK_DIR' not in locals(): ASKBOT_ENABLED = True if not COURSEWARE_ENABLED: ASKBOT_ENABLED = False # Defaults to be overridden EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' SITE_NAME = "localhost:8000" DEFAULT_FROM_EMAIL = 'registration@mitx.mit.edu' DEFAULT_FEE...
#!/usr/bin/env python # (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU Lesser General Public Lice...
from __future__ import absolute_import import os import re import difflib import sys from PyQt4 import QtCore, QtGui Qt = QtCore.Qt from maya import cmds, mel from sgfs import SGFS import ks.core.scene_name.core as scene_name from ks.core import product_select from . import utils sgfs = SGFS() def silk(name):...
#!/usr/bin/env python2 # Copyright (c) 2013 phrack. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from canvas_manager import CanvasManager import configurator from configurator import Configurator import cv2 import glob import imp import num...
import unittest from mock import patch from tempfile import mkdtemp from shutil import rmtree from os.path import join from django.test import TestCase from django.core.management import call_command import haystack from devilry.project.develop.testhelpers.corebuilder import NodeBuilder from devilry.project.develop.te...
"""Simple WSGI script to store the usage reports. """ import os import re DESTINATION = b'.' # Current directory MAX_SIZE = 524288 # 512 KiB date_format = re.compile(br'^[0-9]{2,12}\.[0-9]{3}$') def store(report, address): """Stores the report on disk. """ lines = [l for l in report.split(b'\n') i...
import json from operator import attrgetter import logging from django.http import HttpResponse from django.shortcuts import redirect from django.db.models.aggregates import Min, Max from django.views.decorators.csrf import csrf_exempt from django.views.generic import DetailView, View, FormView from django.utils impor...
# -*- coding: utf-8 -*- """ This file holds user profile information. (The base User model is part of Django; profiles extend that with locally useful information.) TWLight has three user types: * editors * coordinators * site administrators. _Editors_ are Wikipedia editors who are applying for TWL resource access g...
# Copyright 2014 Dave Kludt # # 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, s...
""" multiplication-table.py Author: Kai Credit: Me Assignment: Write and submit a Python program that prints a multiplication table. The user must be able to determine the width and height of the table before it is printed. The final multiplication table should look like this: Width of multiplication table: 10 Heig...
""" This file holds user profile information. (The base User model is part of Django; profiles extend that with locally useful information.) TWLight has three user types: * editors * coordinators * site administrators. _Editors_ are Wikipedia editors who are applying for TWL resource access grants. We track some of t...
from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.http import HttpResponseRedirect from django.utils.de...
#!/usr/bin/env python """ Author: John D. Anderson Email: jander43@vols.utk.edu Description: "grep"-ing for GitHub Repos Posted on Twitter Usage: ghrept ghrept test-api """ # libs import os import sys import fire import twitter import termcolor import slackclient # constants DOMAIN = 'userstream.twitter.com'...
from collections import OrderedDict from itertools import chain import json import random import re from nalaf.utils.qmath import arithmetic_mean from nalaf import print_debug, print_verbose import warnings class Dataset: """ Class representing a group of documents. Instances of this class are the main ob...
from mako.lookup import TemplateLookup import os from dl_data_validation_toolset import templates import tempfile import logging import h5py from scipy.misc import imsave from scipy.stats import threshold import numpy as np import tarfile import time import shutil import glob class ReportGenerator(object): logger =...
#!/usr/bin/env python # Copyright (c) 2014 OpenStack Foundation # # 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...
## Copyright (c) 2010 by Jose Antonio Martin <jantonio.martin AT gmail DOT com> ## 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 # encoding: utf-8 ''' Example pipeline for the GeoExtract package. ''' from __future__ import (absolute_import, division, print_function, unicode_literals) import re import geoextract # # LOCATIONS # # GeoExtract uses a database of known locations to geo-reference a ...
################################################################################ # Copyright (C) 2016 Advanced Micro Devices, Inc. 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 th...
""" This module gives a way to generate all of the creatures that fight in CyberBattles. Some creatures can attack from range in addition to melee, some creatures move via flight and aren't obstructed, and some creatures are slimy and can't be melee attacked by non-slime creatures. Some creatures double as a "mount", w...
## spotlight.py from datetime import datetime, timedelta import requests class SpotlightClient(object): '''Client for interacting with DBpedia Spotlight via REST API. http://wiki.dbpedia.org/spotlight/usersmanual?v=ssd :param base_url: Base URL for DBpedia Spotlight webservice, when not using t...
# Django settings for epiweb project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'epiweb.db' # Or path to dat...
import os import re from collections import Iterable, namedtuple, OrderedDict from itertools import chain import utils _rule_handlers = {} def rule_handler(rule_name): def decorator(fn): _rule_handlers[rule_name] = fn return fn return decorator MakeInclude = namedtuple('MakeInclude', ['name',...
# -*- coding: utf-8 -*- """ Created on Sun Nov 30 09:58:20 2014 @author: Anna Stuhlmacher taking an hdf5 -saving the parameters -transferring spherical coord -> cartesian coord -take slice at 300km -interpolate in geodata class (linear) -flatten to array -plot altitude slice (of NEL) """ from __future__ import divisi...
#!/usr/bin/env vpython # Copyright (c) 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. # Copyright (C) 2008 Evan Martin <martine@danga.com> """A git-command for integrating reviews on Gerrit.""" from __future__ impo...
import os import stat import shutil import filecmp from dvc.main import main from tests.basic_env import TestDvc from tests.test_repro import TestRepro class TestCheckout(TestRepro): def setUp(self): super(TestCheckout, self).setUp() self.orig = 'orig' shutil.copy(self.FOO, self.orig) ...
#!/usr/bin/python import RPi.GPIO as GPIO import nrf24 import sys import time import spidev import argparse import os import sqlite3 import datetime import errno import socket import select from collections import deque, defaultdict from Queue import Queue, Empty PIPES = ([0xe7, 0xe7, 0xe7, 0xe7, 0xe7], [0xc2, 0xc2,...
""" Equivalencies between different kinds of units """ # ----------------------------------------------------------------------------- # Copyright (c) 2018, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the LICENSE file, distributed with this software. # ...
#!/usr/bin/env python # Copyright (c) 2012 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. # Copyright (C) 2008 Evan Martin <martine@danga.com> """A git-command for integrating reviews on Rietveld.""" import json import ...
#!/usr/bin/env python3 import argparse import os import subprocess import sys def setup(): global args, workdir programs = ['ruby', 'git', 'make', 'wget', 'curl'] if args.kvm: programs += ['apt-cacher-ng', 'python-vm-builder', 'qemu-kvm', 'qemu-utils'] elif args.docker and not os.path.isfile('...
from .FittersChain import FittersChain from .ModelFitter import ModelFitter from .NelderMeadFitter import NelderMeadFitter from .GibbsSamplerFitter import GibbsSamplerFitter from .BruteForceFitter import BruteForceFitter from .BGDFitter import BGDFitter __all__ = ['FittersChain', 'ModelFitter', 'NelderMeadF...
import os from pywps.Process import WPSProcess import logging from flyingpigeon.log import init_process_logger logger = logging.getLogger(__name__) class AnalogsviewerProcess(WPSProcess): def __init__(self): WPSProcess.__init__(self, identifier="analogs_viewer", ...
#!/usr/bin/env python3.5 import requests import re from urllib.parse import urlsplit import traceback import sys class DEBUG(object): VERBOSE=3 DEBUG=2 INFO=1 QUIET=-1 class UrlParser(object): # anchor finder regexp URL_RE = re.compile(r'<a href="([^"]*)"', re.I) # protocol checker regexp PROT_RE = re.compil...
from functools import wraps from django.utils import timezone from rest_framework import exceptions, status from rest_framework.response import Response from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet from core import exceptions as core_exceptions from core.models import IdentityMembership fro...
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
import base64 from itertools import chain from operator import attrgetter from django.contrib import messages from django.contrib.auth.decorators import login_required from django.db.models import Q, F from django.http import Http404, HttpResponseRedirect, HttpResponse, HttpResponseForbidden from django.shortcuts impo...
import math import paddle.v2 as paddle from paddle.v2.layer import parse_network def ngram_lm(hidden_size, emb_size, dict_size, gram_num=4, is_train=True): emb_layers = [] embed_param_attr = paddle.attr.Param( name="_proj", initial_std=0.001, learning_rate=1, l2_rate=0) for i in range(gram_num): ...
from roglick.lib import libtcod SCREEN_WIDTH = 80 SCREEN_HEIGHT = 50 class PanelContext(object): """PanelContext is used to "switch" between sets of visible Panels. Client code should define a set of contexts as class attributes on this class. """ pass class PanelManager(object): """An ob...
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...