src stringlengths 721 1.04M |
|---|
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... |
# -*- coding: utf-8 -*-
import xbmc,xbmcaddon,xbmcgui
import sys, os, random, json, zlib
import urllib, urllib2, cookielib
import string, re, base64
import contact
SEP = os.sep
addonInfo = xbmcaddon.Addon ('plugin.video.burningseries')
dataPath = xbmc.translatePath(addonInfo.getAddonInfo('profile'))
addonPath = addonI... |
import pyglet
from pyglet.gl import *
class TextFloat (object):
def __init__(self, text, x, y, width, font_name=None, font_size=None):
self.label = pyglet.text.Label(text, x=x, y=y,
font_name=font_name, font_size=font_size,
multiline=True, width=width,
anchor... |
#!/usr/bin/env python
# coding: utf-8
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import os
import posixpath
import re
import io
import errno
import log... |
"""
End to end tests for Instructor Dashboard.
"""
from bok_choy.web_app_test import WebAppTest
from regression.pages.lms.course_page_lms import CourseHomePageExtended
from regression.pages.lms.dashboard_lms import DashboardPageExtended
from regression.pages.lms.instructor_dashboard import InstructorDashboardPageExte... |
import sys, os, re, types, HTMLParser, urllib2
import parser, db, data, constants
def _rune_cost(generator, filter_data, record, *args):
cost = 0
for rune_type in xrange(0, 3):
for i in xrange(0, getattr(record, 'rune_cost_%d' % (rune_type + 1))):
cost |= 1 << (rune_type * 2 + i)
... |
# -- coding: utf-8 --
###########################################################################
# #
# WebText #
# ... |
"""
This test module has tests relating to t-plots
All functions in /calculations/tplot.py are tested here.
The purposes are:
- testing the user-facing API function (tplot)
- testing individual low level functions against known results.
Functions are tested against pre-calculated values on real isotherms.
Al... |
# -*- coding: utf-8 -*-
try:
import simplejson as json
except ImportError:
import json
from django.shortcuts import render
from django.http import HttpResponse
from django.core import serializers
from django.views.decorators.csrf import csrf_exempt
import watson
from models import *
def JsonResponse(json):
... |
#coding:utf-8
import datetime
import sys
import os
sys.path.append(os.path.dirname(__file__))
import shutil
import web
import markdown2
perpage = 5
try:
import conf
path = conf.path
css_path = conf.csspath
web.config.debug=conf.debug
domain = conf.domain
suffix = conf.suffix
except:
icopath ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 IBM Corp.
#
# 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
#
# ... |
# -*- coding: utf-8 -*-
# Nemubot is a modulable IRC bot, built around XML configuration files.
# Copyright (C) 2012 Mercier Pierre-Olivier
#
# 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 Foundat... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2011-2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... |
# coding=utf-8
# coding=utf-8
# Copyright 2019 The RecSim 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 ap... |
############################################################################
# Project: The Lenard effect of preciptation at the RUAO,
# Title: Ensemble processing of the PG, Time and Rain Rate data,
# Author: James Gilmore,
# Email: james.gilmore@pgr.reading.ac.uk.
# Version: 1.0.5
# Date: 07/12/15
###################... |
"""
This example shows how to create a vtkPolyData object with multiple
scalar attributes (strength and time), and how to efficiently extract
quakes within a specified time interval.
Author: Johan Nysjo
"""
import ReadPointsCSV
import vtk
# Load the earthquake data
points, strength, time_, = ReadPointsCSV.readPoin... |
import requests
import json
import os
import tempfile
import re
url = "http://db3sqepoi5n3s.cloudfront.net/files/pmb5_2013.pdf"
url = "http://db3sqepoi5n3s.cloudfront.net/files/130416pmb3-2013.pdf"
url = "http://db3sqepoi5n3s.cloudfront.net/files/131031b18b-2013.pdf"
url = "http://db3sqepoi5n3s.cloudfront.net/files/13... |
# -*- coding: utf-8 -*-
# This is an app-specific example router
#
# This simple router is used for setting languages from app/languages directory
# as a part of the application path: app/<lang>/controller/function
# Language from default.py or 'en' (if the file is not found) is used as
# a default_language
#
# ... |
from django.conf.urls import url
from . import views
from django.conf.urls.static import static, settings
urlpatterns = [
# ex: /oblicarcy/
url(r'^$', views.index, name='index'),
url(r'^firehose/$', views.firehose, name='firehose'),
url(r'^profile/$', views.profile, name='profile'),
# ex: /obliga... |
from shared.card import CARD_BLACK, CARD_PLACEHOLDER_LENGTH, CARD_WHITE
from shared.exceptions import CardValidityError
from .const import *
class CurrCardWindow(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent=parent,
name="current card panel")
frame = self.GetT... |
# -*- coding: utf-8 -*-
from organizations.models import Organization
from organizations.views.base import ViewFactory
from organizations.views.mixins import AdminRequiredMixin
from organizations.views.mixins import MembershipRequiredMixin
from organizations.views.mixins import OwnerRequiredMixin
bases = ViewFactory(... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
import numpy as np
import gurobipy as gurobi
from .problem import Problem
class PC(Problem):
_ATTRIBUTES = [
('cpu', 37),
('hd', 10),
('manufacturer', 8),
('ram', 10),
('monitor', 8),
('pctype', 3),
]
_ATTR_TO_COSTS = {
'pctype': [50, 0, 80],
... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Plotting scripts for the vanilla genome paper.
"""
import logging
import sys
from jcvi.apps.base import ActionDispatcher, OptionParser
from jcvi.compara.synteny import AnchorFile, check_beds
from jcvi.formats.base import get_number
from jcvi.formats.bed import Bed
fro... |
# Copyright 2016 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core 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 versio... |
# -*- coding: utf-8 -*-
"""
This module executes vsgen unittests (i.e. all tests in the current folder). It exists as an alernative to the command line interface::
> python -m unittest discover --start-directory . --pattern test*.py
For more testing options see the unittest documentation available at https://doc... |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import enum
import io
import itertools
import logging
import os
import pickle
from abc import ABC, abstractmethod
from collections import abc, defaultdict
from dataclasses import dataclass... |
import numpy as np
class ParticleRegularizeL2(object):
"""
L2 regularizer for charges
"""
def __init__(self, coeff_lambda=0.0, zeta=8.0):
self.coeff_lambda = coeff_lambda
self.zeta = zeta
self.n = 1
def cost(self, particle_input, layers):
c = 0.0
# c = np... |
""" Cumulus Deployment Suite
APACHE LICENSE 2.0
Copyright 2013-2014 Skymill Solutions
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... |
'''
Created on Jan 8, 2016
@author: elioth010
'''
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.sql.expression import text
from model.orm.DB import DB
class Model(DB):
'''
classdocs
'''
base = None
SessionFactory = No... |
import numpy as np
from . import dtypes, nputils
def dask_rolling_wrapper(moving_func, a, window, min_count=None, axis=-1):
"""Wrapper to apply bottleneck moving window funcs on dask arrays
"""
import dask.array as da
dtype, fill_value = dtypes.maybe_promote(a.dtype)
a = a.astype(dtype)
# in... |
from StringIO import StringIO
import logging
from couchdbkit.exceptions import (
BulkSaveError,
MultipleResultsFound,
ResourceNotFound,
)
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
from corehq.apps.groups.models import Group
from corehq.apps.users.f... |
#!/usr/bin/env python
#
# Cert: Some extra CERT checkers
#
# Cppcheck itself handles many CERT rules. Cppcheck warns when there is undefined behaviour.
#
# Example usage of this addon (scan a sourcefile main.cpp)
# cppcheck --dump main.cpp
# python cert.py main.cpp.dump
import cppcheckdata
import sys
import re
def r... |
#!/usr/bin/python3
import asyncio
import threading
loop = asyncio.get_event_loop()
class LoopThread(threading.Thread):
def __init__(self):
super(LoopThread, self).__init__()
self.finalizing = False
def run(self):
asyncio.set_event_loop(loop)
loop.run_forever()
pending = a... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
import unittest
from crispys_webkit.urls import LazyUrl
stackoverflow_url = 'http://stackoverflow.com/'
def create_stackoverflow_lazyurl():
return LazyUrl(stackoverflow_url)
class LazyUrlMixin(object):
def check_stackoverflow_url(self, url):
self.assertEqual(url.scheme, 'http')
self.assertEqual(url.host, 's... |
#!/usr/bin/env python2.7
#
# Copyright 2013 Richard Pausch
#
# This file is part of PIConGPU.
#
# PIConGPU 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)... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
# 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 "License");... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... |
#!/usr/bin/env python
import unittest
from TMCL import *
import random as rnd
MAXITER = 200
REQUEST_KEYS = codec.REQUEST_KEYS + ['value']
REPLY_KEYS = codec.REPLY_KEYS + ['value']
class CodecTestCase(unittest.TestCase):
def _gen_byte(self, min_i=0, max_i=256):
return rnd.randint(min_i, max_i-1)... |
"""
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Base classes and constants for library creation ticket.
AAB
"""
from thelma.tools.iso.poolcreation.base import StockSampleCreationLayout
from thelma.tools.u... |
#!/usr/bin/env python
import SimpleITK as sitk
import skimage as ski
import skimage.segmentation
import numpy as np
import timeit
def mask_label_contour(image, seg):
"""Combine an image and segmentation by masking the segmentation contour.
For an input image (scalar or vector), and a multi-label
segmentati... |
from rest_framework.generics import ListAPIView, RetrieveAPIView
from catalogo.models import CatalogoLandsat, CatalogoRapidEye
from .serializers import LandsatSerializer, RapidEyeSerializer
class LandsatListAPI(ListAPIView):
serializer_class = LandsatSerializer
def get_queryset(self):
bbox = self.re... |
# Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
# -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module tests the cros deploy command."""
from __future__ import print_function
import sys
from chromite.cli import comm... |
import unittest
import mock
import logging
import json
import requests
import esgfpid.solr.solr
import tests.resources.responsemock
# Logging:
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(logging.NullHandler())
# Test resources:
from tests.resources.IGNORE.TESTVALUES_IGNORE import TESTVALUES_SOLR
SOLR_URL ... |
#
# Illustrates reducing single computed values
# in each process to one final value. Both sum and max
# of the value are illustratrated.
#
# Libby Shoop, Macalester College, July 2019
#
# Example usage:
# python run.py ./12reduction.py N
# Here the N signifies the number of processes to start up in mpi... |
class character:
def __init__(self, name, gender ,health, race, role, status, strength, defense, magic, bounty, income, reputation):
self.name = name
self.health = health
self.status = status
self.strength = strength
self.defense = defense
self.race = race
sel... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# https://radimrehurek.com/gensim/tut2.html
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
import os
from gensim import corpora, models, similarities
if (os.path.exists("/tmp/deerwester.dict")):
dictionary = ... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Operator, Region, NumberingPlan, NumberingPlanRange
class OperatorAdmin(admin.ModelAdmin):
list_display = ('id', 'name')
search_fields = ('name',)
admin.site.register(Operator, OperatorAdmin)
class RegionAdmin(admin.ModelAdmin):
... |
#!/usr/bin/env python3
#
# Scrape recipes from pepperplate.com.
#
import requests
from bs4 import BeautifulSoup
import lxml.html
import json
import time
import getpass
import re
import os
class pepperplate_recipe:
def __init__(self, id, html):
self.id = id
self.soup = BeautifulSoup(html)
def... |
# -*- coding: utf-8 -*-
import re
import os
import sys
import logging
from argparse import ArgumentParser
from decimal import Decimal
import datetime
import calendar
import time
from functools import partial
from pymongo import MongoClient
from pymongo.errors import BulkWriteError
from bson.code import Code
from gedc... |
from __future__ import print_function
import subprocess
import os
import errno
import shutil
import time
import signal
__test_files__ = ["sample_data/albacore_1d_original.fast5", "sample_data/metrichor_2d_original.fast5"]
__test_runs__ = ["lossless", "deep-lossless"]
__prefix__ = "picopore.test"
__raw_runs__ = [["--fa... |
from datetime import (
date,
timedelta,
)
import numpy as np
import pytest
from pandas._libs.tslibs.timezones import maybe_get_tz
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Series,
Timestamp,
date_range,
)
import pandas._te... |
# -*- coding: utf-8 -*-
from django.utils.translation import get_language
from cms import constants
from cms.apphook_pool import apphook_pool
from cms.utils.permissions import load_view_restrictions, has_global_page_permission
from cms.utils import get_language_from_request
from cms.utils.conf import get_cms_setting
f... |
# -*- coding: utf-8 -*-
# Copyright Martin Manns
# Distributed under the terms of the GNU General Public License
# --------------------------------------------------------------------
# pyspread is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... |
#!/usr/bin/env python
########################################################################
##
## Copyright 2014 PMC-Sierra, 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
## htt... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import applications.delivery2.models
class Migration(migrations.Migration):
dependencies = [
('delivery2', '0001_initial'),
]
operations = [
migrations.CreateModel(
name=... |
# -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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) any ... |
from . import base
from functools import partial
from buildercore import utils
from mock import patch, MagicMock
import logging
LOG = logging.getLogger(__name__)
class Simple(base.BaseCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_ordered_dump(self):
case_list = [... |
from functools import partial
import requests
try:
import urlparse as parse
except:
from urllib import parse
class InvalidEndpointException(Exception):
pass
class BaseClient(object):
endpoints = []
separator = '/'
base_url = ''
def __init__(self, path='', path_params=None, **kwargs):
self.path = path
... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
# Copyright 2013 New Dream Network, LLC (DreamHost)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... |
APP_MODULE = 'tests.test_app'
APP_FUNCTION = 'hello_world'
DJANGO_SETTINGS = None
DEBUG = 'True'
LOG_LEVEL = 'DEBUG'
SCRIPT_NAME = 'hello_world'
DOMAIN = None
API_STAGE = 'ttt888'
PROJECT_NAME = 'ttt888'
REMOTE_ENV='s3://lmbda/test_env.json'
## test_env.json
#{
# "hello": "world"
#}
#
AWS_EVENT_MAPPING = {
'arn:... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import unittest
import sys
import os
sys.path += [ "./dsat" ]
import dsat
#TODO call make text with sphinx (please don't use system) before
#building/install
fcontent = lambda f: open(f).read()
def test():
print "TEST SKIP... |
#!/usr/bin/env python
import glob
import os
import site
import sys
from cx_Freeze import setup, Executable
import meld.build_helpers
import meld.conf
site_dir = site.getsitepackages()[1]
include_dll_path = os.path.join(site_dir, "gnome")
missing_dll = [
'libgtk-3-0.dll',
'libgdk-3-0.dll',
'libatk-1.0-0... |
import errno
import logging
import os
from paramiko.client import SSHClient, AutoAddPolicy
from paramiko.ssh_exception import AuthenticationException, SSHException, \
NoValidConnectionsError
import pytest
import requests
import shutil
def _create_or_update_symplink(target, link_name):
"""
Create or updat... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
#
# author: javi santana
from fabric.api import *
def install_mysql():
""" ripped from http://www.muhuk.com/2010/05/how-to-install-mysql-with-fabric/
"""
with settings(hide('warnings', 'stderr'), warn_only=True):
result = sudo('dpkg-query --show mysql-se... |
# pylint:disable=abstract-method
import json
import os
import uuid
from functools import partialmethod
import pytest
from funcy import cached_property, retry
from dvc.fs.gdrive import GDriveFileSystem
from dvc.path_info import CloudURLInfo
from dvc.utils import tmp_fname
from .base import Base
TEST_GDRIVE_REPO_BUCK... |
import calendar
import random
import datetime
import string
import uuid
from collections import namedtuple
from decimal import Decimal
from dimagi.utils.data import generator as data_gen
from corehq.apps.accounting.models import Currency
from corehq.apps.sms.models import INCOMING, OUTGOING, SMS
from corehq.apps.sms.... |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2012 Sigurd Gartmann sigurdga-ubuntu@sigurdga.no
# 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 F... |
"""K-means clustering"""
# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Thomas Rueckstiess <ruecksti@in.tum.de>
# James Bergstra <james.bergstra@umontreal.ca>
# Jan Schlueter <scikit-learn@jan-schlueter.de>
# Nelle Varoquaux
# Peter Prettenhofer <peter.prettenh... |
#!/usr/bin/env python
from __future__ import print_function
import importlib
import logging
import optparse
import os
import sys
our_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, our_dir)
from bot_lib import run_message_handler_for_bot
def get_lib_module(lib_fn):
lib_fn = os.path.abspath(l... |
# -*- coding: utf-8 -*-
from config import *
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} ban.py importado.{/cyan}'))
@bot.message_handler(commands=['ban'])
def command_ban(m):
cid = m.chat.id
uid = m.from_user.id
date = m.date
if not is_recent(m):
ret... |
# -*- coding: utf-8 -*-
#
# This file is part of bd808's stashbot application
# Copyright (C) 2015 Bryan Davis and contributors
#
# 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... |
import numpy as np
import math
class Section:
"""region"""
def __init__(self, x1, y1, x2, y2):
self.x1 = x1
self.y1 = y1
self.x2 = x2
self.y2 = y2
def crop(self, img):
return img[self.y1: self.y2, self.x1: self.x2]
def coordinates(self):
return self.x... |
# -*- coding: utf-8 -*-
# Copyright (c) 2004-2014 Alterra, Wageningen-UR
# Allard de Wit (allard.dewit@wur.nl), April 2014
from ..traitlets import Float, Int, Instance, Dict, AfgenTrait
from ..decorators import prepare_rates, prepare_states
from ..base_classes import ParamTemplate, SimulationObject
class WOFOST... |
#!/bin/python
import os
import re
import subprocess
import sys
re_ls_obj = re.compile('.*o- ([^ ]*) .*')
re_tpg_num = re.compile('.*o- tpg([0-9]*).*')
re_lun_num = re.compile('.*o- lun([0-9]*).*fileio/([^ ]*)\s.*')
def save_config(env):
subprocess.call(['targetcli', 'saveconfig'], stdout=open(os.devnull, 'wb'), ... |
#!/usr/bin/python
from participantCollection import ParticipantCollection
import re
import datetime
import pyperclip
# Edit Me!
# This script gets run on the first day of the following month, and that month's URL is
# what goes here. E.g. If this directory is the directory for February, this script gets
# run on Marc... |
"""Assertions for testing of conditions.
This module contains assertions that can be used in unit testing.
"""
def assertEqual(expected, actual, message=""):
"""Checks whether expected is equal to actual.
Args:
expected (object): The expected object.
actual (object): The actual o... |
# Copyright (C) 2105 wysiwyng
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is d... |
import smbus
from .smb import IO, IOGroup
class MCP23008:
'''
call create to return a IOGroup with a IO
linked to the 8 gpio pins of a MCP23008
'''
SLOTS = {
0: "A"}
IODIR = 0x00 # Pin direction register
GPIO = 0x09 # Register for inputs
OLAT = 0x0A # Register for outputs
... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the OCBC API
# Copyright (C) 2016
# Naveen Sanmane <naveen.sanmane@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the Free Software Foundat... |
"""
This is the base class on which to build a hierarchical category-like model
with customizable metadata and its own name space.
"""
from django.contrib import admin
from django.db import models
from django import forms
from django.utils.encoding import force_unicode
from django.utils.translation import ugettext as ... |
from flask import render_template, request, redirect, url_for
from flask_login import current_user, login_required
from bson import ObjectId
from . import science
from .compute import compute
from .forms import populate_form_from_instance, ComputeForm
from .. import db_s
from ..models_science import Compute
# http... |
# -*- coding: utf-8 -*-
import datetime
import calendar
from mfiles_sync.models import (Vault, Document, DocumentView, PropertyDef,
Property, DocumentProperty)
from django.conf import settings
from django.core.management.base import BaseCommand
from win32com.client import gencache
mfi... |
# -*- 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 'Team.token'
db.add_column(u'account_team', 'token',
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
make-release
~~~~~~~~~~~~
Helper script that performs a release. Does pretty much everything
automatically for us.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import os
import re
from dat... |
import numpy as np
import pandas as pd
import scipy as sp
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os, sys
try:
import cPickle as pickle
except:
import pickle
#connect echoRD Tools
pathdir='../echoRD' #path to echoRD
lib_path = os.path.abspath(pathdir)
#sys.path.append(lib_pa... |
import wx, sys, os, logging
log = logging.getLogger( __name__ )
from squaremap import squaremap
from runsnakerun import pstatsloader
class PStatsAdapter(squaremap.DefaultAdapter):
percentageView = False
total = 0
TREE = pstatsloader.TREE_CALLS
def value(self, node, parent=None):
if isins... |
import re
import unicodedata
import json
from django.core.exceptions import ImproperlyConfigured
from django.core.validators import validate_email, ValidationError
from django.core import urlresolvers
from django.db.models import FieldDoesNotExist
from django.db.models.fields import (DateTimeField, DateField,
... |
import sys
from Tkinter import *
import Tkconstants, tkFileDialog
import datetime
import ttk
import main
import createISO
dirtext = 'Select your pictures folder'
filetext = 'Select your exception file'
dirtext1 = 'Select destination of image'
# file and directory function
root = Tk()
Ldir = []
Ldirignore = []
dirn = ... |
from django.shortcuts import render
from rest_framework import views, generics, viewsets
from rest_framework.response import Response
from rest_framework.parsers import MultiPartParser, FormParser, FileUploadParser
from rest_framework.renderers import JSONRenderer
from django.template.loader import render_to_string
fro... |
#!/usr/bin/env python
import unittest
import grandma
from nose.tools import ok_, assert_false, assert_almost_equal
from sample_sut_sin import sut_sin
from sample_sut_ziggzagg import sut_ziggzagg
from sample_sut_sin_error import sut_sin_error
from sample_sut_sin_wrong import sut_sin_wrong
def run_constraints(tests, h... |
import os
import logging
import time
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.backends import default_backend
from googleapiclient import discovery, errors
logger = logging.getLogger(__name__)
crm = discovery.build("cl... |
import pytest
import os
import mock
import json
import semver
from copy import deepcopy
from paramiko import AuthenticationException
from paramiko.ssh_exception import NoValidConnectionsError
from pexpect.pxssh import ExceptionPxssh
from aeon_ztp.bin import cumulus_bootstrap
from aeon.cumulus.device import Device
arg... |
#!/usr/bin/env python
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) 2008-2016 NIWA
#
# 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 yo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.