code stringlengths 1 199k |
|---|
import os
import random
import logging
import tempfile
import operator
import itertools
from collections import defaultdict
from multiprocessing import Pool
from functools import reduce
from angrop import rop_utils
import claripy
from cle import CLEError
from povsim import CGCPovSimulator
import angr
import tracer
impo... |
import os
from ..file_utilities import (copy_embedded_file, get_embedded_dir,
get_embedded_dir_names)
from ..targets import normalised_target
from ..user_exception import UserException
_TARGET_PYPLATFORM_MAP = {
'linux': 'linux',
'win': 'win32',
'osx': 'darwin',
'ios': 'darwin'... |
from django.conf.urls import url
from workshift import views
base = r"workshift(?:/(?P<sem_url>\w+\d+))?"
urlpatterns = [
url(
r"^workshift/start/$",
views.start_semester_view,
name="start_semester",
),
url(
base + r"/$",
views.semester_view,
name="view_semest... |
from ilastik.gui.ribbons.ilastikTabBase import IlastikTabBase, TabButton
from PyQt4 import QtGui, QtCore
from ilastik.gui.iconMgr import ilastikIcons
from ilastik.gui.overlaySelectionDlg import OverlaySelectionDialog
from ilastik.gui.overlayWidget import OverlayWidget
from ilastik.modules.unsupervised_decomposition.gui... |
from bit.cxx.configure import CXXConfigure
from bit.cxx.compile import CXXCompile
from bit.cxx.link import CXXLink
from bit.cxx.cxx import CXX |
import json
import time
from elastic_manager import ES
from hbase_manager import HbaseManager
from pyspark import SparkContext, SparkConf
new_crawler = False
fields_cdr = ["obj_stored_url", "crawl_data.image_id", "crawl_data.memex_ht_id", "timestamp", "obj_original_url", "obj_parent"]
filter_crawldata_image_id = "exist... |
"""
HPC/PF PDIサブシステム
パラメータ記述データ
"""
import sys, os
try:
import pdi_log
log = pdi_log._log
LogMsg = pdi_log.LogMsg
from xml.dom import minidom
except Exception, e:
sys.exit('PDI: ' + str(e))
try:
import pdi_desc
except Exception, e:
log.error(LogMsg(51, 'pdi_desc module import failed'))
l... |
def _load_odf_array(self, odf_array):
self.volume_grid = odf_array.shape[:3]
aff = np.ones(4,dtype=np.float)
aff[:3] = self.real_affine[0][0]
self.ras_affine = np.diag(aff)
numSamples = odf_array.shape[-1]//2
odf_array = odf_array[::-1,::-1,:,:numSamples]
odf_array = odf_array.reshape(np.pro... |
"""
Module which allows control via buttons and switches and status reporting via
LEDs.
"""
from litex.build.generic_platform import ConstraintError
from litex.soc.interconnect.csr import AutoCSR
from litex.soc.interconnect.csr_eventmanager import *
from litex.gen.genlib.misc import WaitTimer
from litex.soc.cores.gpio ... |
from __future__ import absolute_import, division, print_function
import numpy as np
from pymor.algorithms.timestepping import ExplicitEulerTimeStepper
from pymor.analyticalproblems.advection import InstationaryAdvectionProblem
from pymor.core.interfaces import inject_sid
from pymor.discretizations.basic import Instatio... |
"""
ooniprobe: a network interference detection tool
================================================
.. image:: https://travis-ci.org/TheTorProject/ooni-probe.png?branch=master
:target: https://travis-ci.org/TheTorProject/ooni-probe
.. image:: https://coveralls.io/repos/TheTorProject/ooni-probe/badge.png
:targ... |
from myhdl import Signal, always, always_comb, instances, instance, delay, now
from MyHDLSim.combinational import Not, Mux21
def ClkDriver(clk, period=20):
""" Clock Driver helper
Credit to http://www.myhdl.org/doc/current/manual/intro.html
This will generate a clock of any period (default 20)
clk -- cl... |
from numba import autojit, jit
@autojit
def closure_modulo(a, b):
@jit('int32()')
def foo():
return a % b
return foo()
def test_closure_modulo():
assert closure_modulo(100, 48) == 4
if __name__ == '__main__':
test_closure_modulo() |
"""
btab format, used by BLAST and NUCMER, found spec here:
<http://www.agcol.arizona.edu/~matthew/formats.html>
btab format used by aat, found spec here:
<http://ergatis.diagcomputing.org/cgi/documentation.cgi?article=components&page=aat_aa>
"""
import sys
from jcvi.formats.base import LineFile, must_open
from jcvi.fo... |
import sys
extras = {}
try:
from setuptools import setup
extras['zip_safe'] = False
if sys.version_info < (2, 6):
extras['install_requires'] = ['multiprocessing']
except ImportError:
from distutils.core import setup
setup(name='futures',
version='2.1.2',
description='Backport of the ... |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.set_filename('table26.xlsx')
def test_create_file(self):
... |
from .. import Availability, Class, Constant, Define, Method, Parameter, Type
gx_class = Class('DATAMINE',
doc="""
:class:`DATAMINE` functions provide an interface to Datamine Software Limited files.
See also :class:`GIS` for various other Datamine-specific functions.
... |
import libcontext, bee
from bee.segments import *
class if_(bee.worker):
"""The if processor has a trigger and an input. When it is triggered, it forwards the trigger only if the input is
True."""
inp = antenna("pull", "bool")
b_inp = buffer("pull", "bool")
trig = antenna("push", "trigger")
outp... |
import logging
import urllib.parse
import clipy.agents
import clipy.models
import clipy.request
from clipy.utils import take_first as tf
logger = logging.getLogger(__name__)
class YoutubeAgent(clipy.agents.Agent):
def __init__(self, *args):
super().__init__(*args)
async def _get_video(self):
vid... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assopy', '0009_rename_assopy_user'),
]
operations = [
migrations.AddField(
model_name='order',
name='uuid',
field=mod... |
import sys
import glob
import re
import math
import fnmatch
import argparse
from os import listdir
from os.path import join, isfile, basename
import numpy as np
from numpy import float32, int32, uint8, dtype, genfromtxt
import pandas
import cPickle as pickle
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyp... |
"""
Example File.
A wrapper around CryptoPAn with some (probably unsound) features. It anonymizes
IP addresses, but there is an option not to anonymize certain IP addresses
or to preserve the prefix for certain ranges.
The module fails if an anonymized IP accidentally maps into one of these special ranges.
"""
import s... |
import binascii
from celestia.utility.gluid import GluidError, retrieve_gluid
class SaveData(object):
def __init__(self,
savefile, gluid, dbfile,
usedb, legacy):
self.savefile = savefile
self._gluid = gluid if gluid else b''
self.dbfile = dbfile
self... |
"""Tests of disco_ssm"""
import random
import copy
import json
from unittest import TestCase
from mock import MagicMock, patch, call
from botocore.exceptions import ClientError
from disco_aws_automation import DiscoSSM
from disco_aws_automation import disco_ssm
from disco_aws_automation.disco_ssm import SSM_DOCUMENTS_D... |
"""
@package mi.dataset.driver.sio_eng.sio_mule.test.test_driver
@file marine-integrations/mi/dataset/driver/sio_eng/sio_mule/driver.py
@author Mike Nicoletti
@brief Test cases for sio_eng_sio_mule driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/dsa/test_driver
$ bin/dsa/test_... |
"""Block device abstraction"""
import re
import errno
import stat
import os
import logging
import math
from ganeti import utils
from ganeti import errors
from ganeti import constants
from ganeti import objects
from ganeti import compat
from ganeti import serializer
from ganeti.storage import base
from ganeti.storage im... |
""""
Script to import the set of MSRA-TD500 training/testing data into the rigor testing framework.
http://www.iapr-tc11.org/mediawiki/index.php/MSRA_Text_Detection_500_Database_(MSRA-TD500)
"""
from rigor.importer import Importer
import os
import glob
import string
import math
import copy
kExcludeHard = False
kDataTyp... |
import requests
from django.conf import settings
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
from django.core.mail import send_mail as django_send_mail
from django.db.models import Model
from django.db.models.fields.files import FieldFile
from django.template.loader import r... |
import datetime
from mock import MagicMock
from django.test import TestCase
from django import template
from django.utils import six
from django.core.urlresolvers import reverse
from wagtail.wagtailimages.utils import generate_signature, verify_signature
from wagtail.wagtailimages.rect import Rect
from wagtail.wagtaili... |
import os.path
import requests_mock
import unittest
import vps.vultr.key
from invoke import Context
from unittest.mock import patch
from urllib.parse import parse_qs
from vps.tool.provision import provision_vultr, _VultrProvision
class use_once(object):
def __init__(self, mock, return_value, *args):
self.mo... |
import cherrypy
from cherrypy.process import plugins
__all__ = ['Jinja2TemplatePlugin', 'Jinja2Tool']
class Jinja2Tool(cherrypy.Tool):
def __init__(self):
cherrypy.Tool.__init__(self, 'before_finalize',
self._render,
priority=10)
def _render(self, template=N... |
from bokeh.core.enums import SizingMode
from bokeh.layouts import column
from bokeh.models import Select
from bokeh.plotting import figure, show, output_file
from bokeh.sampledata.iris import flowers as df
colormap = {'setosa': 'red', 'versicolor': 'green', 'virginica': 'blue'}
colors = [colormap[x] for x in df.species... |
import time
import os.path
import mmap
import re
import binascii
import StringIO
import gzip
from glideinwms.lib import condorLogParser
from glideinwms.factory import glideFactoryLogParser
def get_glideins(log_dir_name,date_arr,time_arr):
glidein_list=[]
cldata=glideFactoryLogParser.dirSummaryTimingsOutFull(log... |
"""
Script for inserting Kihei SCADA temperature and humidity data.
Usage:
With the current working directory set to the path containing the data files,
python insertSCADAWeatherData.py
"""
__author__ = 'Daniel Zhang (張道博)'
__copyright__ = 'Copyright (c) 2013, University of Hawaii Smart Energy Project'
__license__ ... |
""" A Layered panel. """
import sys
import wx
from wx.lib.scrolledpanel import ScrolledPanel
from enthought.traits.api import Any, Str, Int
from widget import Widget
class LayeredPanel(Widget):
""" A Layered panel.
A layered panel contains one or more named layers, with only one layer
visible at any one tim... |
'''
Context processors for blog app
Copyright 2012 Faraz Masood Khan, mk.faraz@gmail.com
'''
from foo import settings
from foo.blog.models import Category, Post
def bootstrip(request):
return {
'featured_categories': Category.objects.filter(featured=True)[:5],
'top_posts': Post.top()[:7],
'site_name': s... |
"""
workflow.py
RAPIDpy
Created by Alan D Snow, 2016.
Based on RAPID_Toolbox for ArcMap
License: BSD 3-Clause
"""
import os
from .network import (CreateNetworkConnectivity,
CreateNetworkConnectivityTauDEMTree,
CreateNetworkConnectivityNHDPlus,
... |
import xml.etree.ElementTree as ET
import Tinker, Memory
import abc, sys
from IP import parse_list, parse_string, parse_int, parse_id, parse_float, parse_macros, IP
class Phy(Memory.Memory):
_C_BURST_WIDTHS = []
_C_BURST_DEFAULT = 0
_C_MAX_DATA_BUS_WIDTH = 2048
_C_FPHY_MHZ_RANGE = (1,2000)
_C_FPGA_M... |
"""
flask.ctx
~~~~~~~~~
Implements the objects required to keep the context.
:copyright: (c) 2016 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
from functools import update_wrapper
from werkzeug.exceptions import HTTPException
from .globals import _request_ctx_stack,... |
from setuptools import setup
from setuptools import find_packages
with open('README.rst') as readme:
long_description = readme.read()
with open('requirements.txt') as requirements:
lines = requirements.readlines()
libraries = [lib for lib in lines if not lib.startswith('-')]
dependency_links = [link.spl... |
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.hazmat.backends import default_backend
from crypt... |
from __future__ import print_function
from permuta import *
import permstruct
import permstruct.dag
from permstruct import *
from permstruct.dag import taylor_dag
import sys
patts = [Permutation([1,4,3,2]), Permutation([2,3,4,1]), Permutation([3,2,1,4]), Permutation([4,1,2,3])]
struct(patts, size = 8, perm_bound = 10, ... |
from corehq.apps.sms.api import incoming
from corehq.apps.sms.views import IncomingBackendView
from corehq.messaging.smsbackends.push.models import PushBackend
from django.http import HttpResponse, HttpResponseBadRequest
from lxml import etree
from xml.sax.saxutils import unescape
class PushIncomingView(IncomingBackend... |
class Scene(object):
def __init__(self, parent=None):
self.parent = parent
def set_director(self, director):
self.director = director
def on_draw(self, window):
window.clear() |
"""This tutorial introduces the LeNet5 neural network architecture
using Theano. LeNet5 is a convolutional neural network, good for
classifying images. This tutorial shows how to build the architecture,
and comes with all the hyper-parameters you need to reproduce the
paper's MNIST results.
This implementation simplif... |
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('inter_consultas', '0005_auto_20150426_1545'),
]
operations = [
migrations.AlterField(
model_name='interconsultas',
... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['MovingMedian'] , ['NoCycle'] , ['NoAR'] ); |
from journal_bot.components.commands.create_event import create_event
from sleekxmpp.plugins.base import register_plugin
def load_commands():
register_plugin(create_event) |
import json
from django.http import HttpResponse
from django.conf import settings
from django.core.serializers.json import DjangoJSONEncoder
FORMAT_TYPES = {
'application/json': lambda response: json.dumps(response, cls=DjangoJSONEncoder),
'text/json': lambda response: json.dumps(response, cls=DjangoJSON... |
from __future__ import absolute_import, print_function
from django.utils import timezone
from rest_framework import serializers
from rest_framework.response import Response
from sentry.api.base import DocSection, Endpoint
from sentry.api.fields import UserField
from sentry.api.permissions import assert_perm
from sentry... |
"""
Solve Nth-order Chebyshev polynomial coefficients with Powell's method.
Launch optimizers with python's map.
Requires: development version of mystic, pathos
http://pypi.python.org/pypi/mystic
http://pypi.python.org/pypi/pathos
"""
def optimize(solver, mapper, nodes, target='rosen', **kwds):
if target == 'ro... |
from __future__ import unicode_literals
from django.db import migrations, models
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Event',
fields=[
('id', models.AutoField(... |
info = {
"name": "rwk",
"date_order": "DMY",
"january": [
"jan",
"januari"
],
"february": [
"feb",
"februari"
],
"march": [
"mac",
"machi"
],
"april": [
"apr",
"aprilyi"
],
"may": [
"mei"
],
"june... |
from distutils.core import setup
from coap import coapVersion
VERSION = '.'.join([str(v) for v in coapVersion.VERSION])
with open('README.md') as f:
LONG_DESCRIPTION = f.read()
with open('COPYING.txt') as f:
LICENSE = f.read()
setup(
name = "openwsn-coap",
packages = [... |
import diesel
from diesel.protocols.redis import *
class RedisHarness(object):
def setup(self):
self.client = RedisClient()
self.client.select(11)
self.client.flushdb()
class TestRedis(RedisHarness):
def test_basic(self):
r = self.client
assert r.get('newdb') == None
... |
import numpy as np
from mirdata.datasets import medleydb_melody
from mirdata import annotations
from tests.test_utils import run_track_tests
def test_track():
default_trackid = "MusicDelta_Beethoven"
data_home = "tests/resources/mir_datasets/medleydb_melody"
dataset = medleydb_melody.Dataset(data_home)
... |
"""Draw a NinePatch image.
NinePatch is a format for storing how to cut up a 9-part resizable
rectangular image within the image pixel data directly.
For more information on the NinePatch format, see
http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch.
"""
__all__ = ["NinePatch"]
from pyglet.... |
"""
Tests for the download module of GLDAS.
"""
import os
from datetime import datetime
from gldas.download import get_last_formatted_dir_in_dir
from gldas.download import get_first_formatted_dir_in_dir
from gldas.download import get_last_gldas_folder
from gldas.download import get_first_gldas_folder
from gldas.downloa... |
"""
pyexcel_cli
~~~~~~~~~~~~~~~~~~~
command line interface for pyexcel
:copyright: (c) 2016 by Onni Software Ltd.
:license: MIT License, see LICENSE for more details
"""
import click
from pyexcel_cli.diff import diff
from pyexcel_cli.view import view
from pyexcel_cli.split import split
from pyexcel_... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from keras.optimizers import SGD
from keras.optimizers import Adam
from keras import backend as K
from keras.optimizers import RMSprop
K.set_image_dim_ordering('tf')
import socket
import os
hostname = socket.get... |
""" For minipulating msms_refs files """
import io
import json
import logging
from typing import cast, List, Sequence, Tuple, TypedDict
import ipywidgets as widgets
import numpy as np
import pandas as pd
import traitlets
from matplotlib import pyplot as plt
from matplotlib.figure import Figure
from traitlets import Flo... |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^', include('gitlist.urls')),
) |
import os
from framework.Targets import ApacheTarget
class Target(ApacheTarget):
def get_path(filename):
return os.path.dirname(os.path.realpath(__file__)) + '/' + filename
name = "Drupal 6.14"
application_dir_mapping = [get_path("application"), "/var/www"]
database_filename = get_path("database... |
import datetime
from django.contrib.auth.models import User
from django.shortcuts import render
from django.utils import timezone
from django.db.models import Sum
from django.template.defaultfilters import filesizeformat
from jsonview.decorators import json_view
from airmozilla.main.models import (
Event,
Sugge... |
def is_attr_set(check_instance, attrib_name):
''' Checks to see if the attribute is set '''
if hasattr(check_instance, attrib_name):
return getattr(check_instance, attrib_name) is not None
return False |
import unittest
from mixbox.fields import TypedField
class TestTypedField(unittest.TestCase):
def test_names(self):
# The actual type is not important for this test
a = TypedField("Some_Field", None)
self.assertEqual("Some_Field", a.name)
self.assertEqual("some_field", a.key_name)
... |
import os.path as op
from itertools import count
import numpy as np
from ...utils import logger, verbose, sum_squared
from ...transforms import (combine_transforms, invert_transform, apply_trans,
Transform)
from ..constants import FIFF
from .. import _BaseRaw, _coil_trans_to_loc, _loc_to_coil... |
from pyechonest import artist
be_results = artist.search(name='bright eyes')
if be_results:
be = be_results[0]
print 'Audio for %s:' % (be.name,)
for audio_document in be.audio:
print '%s' % (audio_document['artist'],)
for key, val in audio_document.iteritems():
print ' \'%s\'... |
from .access_token import AccessToken
from .access_token_provider import AccessTokenProvider |
import time, copy, pickle
import os, os.path
import sys
import numpy, pylab
from fcns_generatecompositions import *
sys.path.append('Z:/Documents/PythonCode/JCAP')
from readplatemap import *
modelpath='Z:/Documents/CaltechWork/platemaps/Epson6Elementcombinations/xx0037-04-0730-mp.txt'
newpath='Z:/Documents/CaltechWork/... |
"""
Otsu, Yamamoto and Hachisuka (2018) - Reflectance Recovery
==========================================================
Defines the objects for reflectance recovery, i.e. spectral upsampling, using
*Otsu et al. (2018)* method:
- :class:`colour.recovery.Dataset_Otsu2018`
- :func:`colour.recovery.XYZ_to_sd_Otsu2018... |
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.core.exceptions import ObjectDoesNotExist
class CheckEula(object):
def process_request(self, request):
if request.user.is_authenticated() and 'eula_accepted' \
not in request.session and '/accou... |
import os, os.path
from django.template import Context
from django.template.loader import select_template
SIMPLEADMINDOC_PATH = "docs"
def write(filename, content):
pathname = os.path.split(filename)[0]
if not os.path.exists(pathname):
os.makedirs(pathname)
f = open(filename, "w")
f.write(conten... |
""" Test cases for DataFrame.plot """
from datetime import (
date,
datetime,
)
import itertools
import re
import string
import warnings
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas.core.dtypes.api import is_list_like
import pandas as pd
from pandas import (
DataFram... |
__author__ = 'Nigel Cleland'
__email__ = 'nigel.cleland@gmail.com'
__version__ = '0.1.0'
from Frames import Frame, load_offerframe |
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'tt.views.home', name='home'),
url('', include('openstack_auth.urls')),
url(r'^admin/', inc... |
__version__=''' $Id$ '''
__doc__="""Experimental class to generate Tables of Contents easily
This module defines a single TableOfContents() class that can be used to
create automatically a table of tontents for Platypus documents like
this:
story = []
toc = TableOfContents()
story.append(toc)
# some hea... |
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
testinfo = "s, t 1, s, t 1.9, s, t 2.1, s, q"
tags = "Scene, Rotate"
import cocos
from cocos.director import director
from cocos.actions import RotateBy
from cocos.sprite import Sprite
from cocos.layer import *
import pyglet
class Te... |
from unittest import TestCase
from chatterbot.corpus import Corpus
import os
class CorpusUtilsTestCase(TestCase):
def setUp(self):
self.corpus = Corpus()
def test_get_file_path(self):
"""
Test that a dotted path is properly converted to a file address.
"""
path = self.cor... |
import re
from math import floor
from django import template
from django.contrib.messages import constants as message_constants
from django.template import Context
from django.utils.encoding import force_str
from django.utils.safestring import mark_safe
from ..bootstrap import css_url, get_bootstrap_setting, javascript... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0033_auto_20170124_1300'),
]
operations = [
migrations.AlterField(
model_name='event',
name='is_page_live',
f... |
__version__ = '0.1'
foo = 1 |
from flexbe_core import EventState, Logger
import rospy
from dynamic_reconfigure.client import Client
"""
Created on 11/03/2014
@author: Philipp Schillinger
"""
class ReadDynamicParameterState(EventState):
"""
Reads a given trajectory controller parameter.
"""
LEFT_ARM_WRX = ['left_arm_traj_controller', 'l_arm_wrx'... |
try: import json
except ImportError: import simplejson as json
import sys
import urllib2
def usage():
print 'Usage: list.py url [-n num_assets] [-r report_value] [-t type] [-a action]'
def grab_list(url, num, value, model_type, action):
download_url = url + '/download'
meerkat_url = 'meerkat://'
browse_... |
import numpy as np
from autosklearn.pipeline.components.feature_preprocessing.pca import PCA
from autosklearn.pipeline.util import _test_preprocessing, PreprocessingTestCase
class PCAComponentTest(PreprocessingTestCase):
def test_default_configuration(self):
transformations = []
for i in range(2):
... |
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
urlpatterns = [] |
import datetime
from django.test import TestCase
from django.utils import timezone
from django.core.urlresolvers import reverse
from .models import Question
def create_question(question_text, days):
"""
Creates a question with the given `question_text` published the given
number of `days` offset to now (negative for... |
"""
osgUtil module
Part of osgpyplusplus python bindings for OpenSceneGraph C++ library
https://github.com/JaneliaSciComp/osgpyplusplus
The osgUtil library provides general purpose utility classes such as update,
cull and draw traverses, scene graph operators such a scene graph optimisation,
tri stripping, and tessella... |
from django.db.models import get_model
from django.template import Node, TemplateSyntaxError, Library, Variable
from django.utils.translation import ugettext as _
from tagging.models import TaggedItem
register = Library()
class TaggedGetRelatedNode(Node):
def __init__(self, obj, queryset_or_model, context_var, **kw... |
"""
Automated tests for all defined adjoint sources. Essentially just checks
that they all work and do something.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2015
:license:
BSD 3-Clause ("BSD New" or "BSD Simplified")
"""
from __future__ import (absolute_import, division, print_function,
... |
from .coloredstring import *
import ropper
import re
import sys
def getFileNameFromPath(path):
if '/' in path:
name = path.split('/')[-1]
elif '\\' in path:
name = path.split('\\')[-1]
else:
name = path
return name
def isHex(num):
return re.match('^0x[0-9A-Fa-f]+$', num) != N... |
from __future__ import absolute_import
from .classification import ImageClassificationModelJob
from .generic import GenericImageModelJob
from .job import ImageModelJob
__all__ = [
'ImageClassificationModelJob',
'GenericImageModelJob',
'ImageModelJob',
] |
"""Module containing the AutoLoader class."""
from imp import reload
import inspect
import importlib
import os
from autoloader.rules import DEFAULT
class AutoLoader:
"""Class containing the autoloader's behaviour.
The AutoLoader objects are meant to import Pythohn files and extract
their content. Plus, the... |
from SimpleCV.Color import Color
from SimpleCV.base import time, cv, np
from SimpleCV.Features.Features import Feature, FeatureSet
from SimpleCV.ImageClass import Image
class TrackSet(FeatureSet):
"""
**SUMMARY**
TrackSet is a class extended from FeatureSet which is a class
extended from Python's list. ... |
from django import forms
from django.contrib.auth.forms import (UserCreationForm, UserChangeForm,
AdminPasswordChangeForm, PasswordChangeForm)
from django.contrib.auth.models import Group, Permission
from django.core.exceptions import PermissionDenied
from django.template.response... |
from defs import (SelectKBest, LogisticRegressionCV,
GroupKFold, cross_validate, make_pipeline, X, y, my_groups,
my_weights, my_other_weights)
lr = LogisticRegressionCV(
cv=GroupKFold(),
scoring='accuracy',
prop_routing={'cv': ['groups'],
'scoring': ['sa... |
"""
fs.base
=======
This module defines the most basic filesystem abstraction, the FS class.
Instances of FS represent a filesystem containing files and directories
that can be queried and manipulated. To implement a new kind of filesystem,
start by sublcassing the base FS class.
For more information regarding impleme... |
"""
LICENCE
-------
Copyright 2013-2015 by Kitware, Inc. All Rights Reserved. Please refer to
KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
"""
import logging
import multiprocessing
import numpy as np
from smqtk.utils import ReadWri... |
"""
Created on Fri Feb 13 16:13:11 2015
functions storing training / testdata combinations to ensure consistent usage
of datasets (same combinations / normalizations / ...)
@author: wirkert
"""
import numpy as np
import helper.monteCarloHelper as mch
def perfect(dataFolder):
trainingParameters = np.load(dataFolde... |
"""
This allows ownership control of a resource without a graphical user interface.
WARNING: As these routines run in administrative mode, no access control is used.
Care must be taken to generate reasonable metadata, specifically, concerning
who owns what. Non-sensical options are possible to create.
This code is not ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.