gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright (c) 2014 Mirantis 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 to in writ... | |
import sys
import operator
import numpy as np
import matplotlib.pyplot as plt
import itertools, functools
import re
import argparse
from mdp_builder import Builder
""" Grid Layout
grid[0][0] = num_states
grid[0][1] = num_actions
"""
def load_args():
parser = argparse.ArgumentParser(description='Description o... | |
from __future__ import print_function
import sys
import re
from collections import defaultdict
if sys.version_info.major > 2:
# alias dict.items() as dict.iteritems() in python 3+
class compat_dict(defaultdict):
pass
compat_dict.iteritems = defaultdict.items
defaultdict = compat_dict
# add xrange to ... | |
# -*- coding: utf-8 -*-
"""Test suite for printing.
"""
# Standard library imports
import importlib.resources as ir
import io
import shutil
import struct
import unittest
import uuid
import warnings
# Third party library imports ...
import lxml.etree
# Local imports
import glymur
from glymur import Jp2k
from glymur.j... | |
# Copyright (C) 2012-2013 Claudio Guarnieri.
# Copyright (C) 2014-2018 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import ConfigParser
import click
import os
import logging
import re
from cuckoo.common.exceptions import ... | |
# -*- coding: utf-8 -*-
"""
Testing using the Test Client
The test client is a class that can act like a simple
browser for testing purposes.
It allows the user to compose GET and POST requests, and
obtain the response that the server gave to those requests.
The server Response objects are annotated with the details
... | |
'''
LICENSING
-------------------------------------------------
golix: A python library for Golix protocol object manipulation.
Copyright (C) 2016 Muterra, Inc.
Contributors
------------
Nick Badger
badg@muterra.io | badg@nickbadger.com | nickbadger.com
This library is free software; ... | |
# Copyright 2011 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... | |
from .base import (
Submodule,
UpdateProgress
)
from .util import find_first_remote_branch
from git.exc import InvalidGitRepositoryError
import git
import logging
# typing -------------------------------------------------------------------
from typing import TYPE_CHECKING, Union
from git.types import Commit... | |
#!/usr/bin/env python
import time
import numpy as np
from selfdrive.config import Conversions as CV
from selfdrive.car.honda.carstate import CarState
from selfdrive.car.honda.carcontroller import CarController, AH
from selfdrive.boardd.boardd import can_capnp_to_can_list
from cereal import car
import zmq
from selfdr... | |
import os
from gym import error, spaces
from gym.utils import seeding
import numpy as np
from os import path
import gym
import six
try:
import mujoco_py
from mujoco_py.mjlib import mjlib
except ImportError as e:
raise error.DependencyNotInstalled("{}. (HINT: you need to install mujoco_py, and also perform... | |
import re
from utils import *
SEARCH_LIMIT = 10000
def get_gene(db, gene_id):
return db.genes.find_one({'gene_id': gene_id}, projection={'_id': False})
def get_gene_by_name(db, gene_name):
# try gene_name field first
gene = db.genes.find_one({'gene_name': gene_name}, projection={'_id': False})
if g... | |
import json
import sys
from StringIO import StringIO
import nose
from nose.tools import assert_raises, eq_
from .helper import TestCase
from validator.contextgenerator import ContextGenerator
from validator.errorbundler import ErrorBundle
def test_message_completeness():
"""Test we're fully expecting all of th... | |
from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
e... | |
# Copyright 2016 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... | |
"""
pygments.lexers.webidl
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Web IDL, including some extensions.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, default, include, words
from pygments.token import... | |
import sys
sys.path.append("..") # Adds higher directory to python modules path.
import unittest, math
from Laminate import Laminate
class LaminateTestCase(unittest.TestCase):
"""
test cases for Laminate class
"""
laminate = None
def setUp(self):
kerf = 5.0/64 # usu. 1/8" for mos... | |
from discord import errors as discord_error
from discord.ext.commands import HelpCommand
from prettytable import PrettyTable
from discord.ext import commands
from .utils import utils
import traceback
import datetime
import logging
import discord
class Events(commands.Cog):
def __init__(self,bot):
self.bot ... | |
#!/usr/bin/python
'''This has been slightly modified from the original.
I believe there was an error that caused the icons to become random noise.
It is likely the fix only works for icons of exactly size 256x256
'''
# pyico
# Copyright (C) 2009 Nikolai Ugelvik
#
# This library is free software; you can redistribute ... | |
#
# Copyright (c) 2014, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of condit... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""The tests for the MQTT lock platform."""
import pytest
from homeassistant.components.lock import (
DOMAIN as LOCK_DOMAIN,
SERVICE_LOCK,
SERVICE_UNLOCK,
STATE_LOCKED,
STATE_UNLOCKED,
)
from homeassistant.const import ATTR_ASSUMED_STATE, ATTR_ENTITY_ID
from homeassistant.setup import async_setup_c... | |
"""
Functions for the MidBrain Segmentation Tool.
"""
# Author: Benjamin Garzon <benjamin.garzon@gmail.com>
# License: BSD 3 clause
from __future__ import division
from subprocess import call
from nipy import load_image, save_image
from nipy.core.api import Image, ImageList
import os
import numpy as np
import pickle
fr... | |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from beehive.compat import unicode
from beehive import model, i18n
DEFAULT_LANGUAGE = 'en'
def parse_file(filename, language=None):
with open(filename, 'rb') as f:
# file encoding is assumed to be utf8. Oh, yes.
data = f.read().decod... | |
# -*- coding: utf-8 -*-
"""
Rewriting standard tasks for the NLP pipeline using the ``Stanford CoreNLP`` server. The main motivation to do this lies
in the following problem: When the respective Stanford tools are run through their ``NLTK`` wrappers, they load their
necessary models from scratch every time. This slows ... | |
#!/usr/bin/python
## Some info should go here.
#TODO: add these features:
# [ ] works in login window
# [x] mirroring
# [x] brightness settings
# [ ] HDMI overscan
# [ ] AirPlay mirroring
# [x] set individual display settings
# [x] HiDPI/no HiDPI options
## Imports
import argparse
import objc
import os
import sys
i... | |
#!/usr/bin/env python
#
# Copyright (c) 2017 Alex Wang (@DarkAlexWang)
# released under The MIT license (MIT) http://opensource.org/licenses/MIT
#
"""
gitfiti
noun : Carefully crafted graffiti in a GitHub commit history calendar
"""
from datetime import datetime, timedelta
import itertools
import json
import math
try... | |
# -*- coding: utf-8 -*-
"""
3D Least-Squares Inversion of DC and IP Data
============================================
Here we invert 5 lines of DC and IP data to recover both an electrical
conductivity and a chargeability model. We formulate the corresponding
inverse problems as least-squares optimization problems.
Fo... | |
"""
This class is defined to override standard pickle functionality
The goals of it follow:
-Serialize lambdas and nested functions to compiled byte code
-Deal with main module correctly
-Deal with other non-serializable objects
It does not include an unpickler, as standard python unpickling suffices.
This module wa... | |
"""Weather data coordinator for the OpenWeatherMap (OWM) service."""
from datetime import timedelta
import logging
import async_timeout
from pyowm.commons.exceptions import APIRequestError, UnauthorizedError
from homeassistant.components.weather import (
ATTR_CONDITION_CLEAR_NIGHT,
ATTR_CONDITION_SUNNY,
A... | |
# coding: utf-8
# In[1]:
#
# LF test with noise
# C = S + N, where noise N = sigma^2 I, where I is the identity matrix
#
# We generate 20 values of parameters x for function logLF(x)
# We chose our parameters around the value of Boltzmann code generated C_3
# CAMB generated C_3 equals 5.88275e-10
#
# 1. Set all C_l ... | |
# Copyright 2016 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... | |
#!/usr/bin/env python
import datetime
import random
import numpy as np
import math
import copy
from scipy import ndimage
import networkx as nx
import statsmodels.api as sm
from .db import DB
from .graphics import Graphics
from .bee import Bee
from .logdata import LogData
class Experiment:
def __init__(self, hive... | |
from __future__ import (absolute_import, division, print_function)
from gridded.pysgrid.sgrid import SGrid
from gridded.pyugrid.ugrid import UGrid
import numpy as np
from gridded.utilities import get_dataset, gen_celltree_mask_from_center_mask
from six import string_types
class GridBase(object):
'''
Base ob... | |
import datetime
from flask import request, current_app, _request_ctx_stack
from flask.ext.restful import reqparse, Resource, abort, marshal
from flask.ext.restful.fields import Boolean, String, Integer, DateTime, Raw
from flask.ext.sqlalchemy import BaseQuery, Pagination, get_state
from flask.views import MethodViewTyp... | |
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
#
# 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... | |
#!/usr/bin/python3
'''
This module is for QIIME analysis of metagenomic data.
Our input pipeline is from Illumina based data.
This module will NOT attempt to install QIIME on this machine.
It is complicated.
Written by TicklishGiraffe
'''
import tkinter, os, sys, subprocess, shutil, logging, datetime, time, glob, cs... | |
# pylint: disable-msg=E1101,W0612
import operator
import pytest
from warnings import catch_warnings
from numpy import nan
import numpy as np
import pandas as pd
from pandas import Series, DataFrame, bdate_range, Panel
from pandas.core.dtypes.common import (
is_bool_dtype,
is_float_dtype,
is_object_dtype,... | |
"""
Sony .spi3d LUT Format Input / Output Utilities
===============================================
Defines the *Sony* *.spi3d* *LUT* format related input / output utilities
objects:
- :func:`colour.io.read_LUT_SonySPI3D`
- :func:`colour.io.write_LUT_SonySPI3D`
"""
from __future__ import annotations
import nump... | |
import os
import re
import sys
import subprocess
import socket
import time
import shutil
import logging
import string
from functools import lru_cache
# Store testdir for safe switch back to directory:
testdir = os.path.dirname(os.path.abspath(__file__))
logger = logging.getLogger("util")
def make_filename(s):
""... | |
#!/usr/bin/env python
# Copyright 2015 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import sys
import tempfile
import urllib2
from common_includes import *
class Preparation(Step):
MESSAG... | |
"""
tonality.py - Matrix representations of musical scores, corpara, and their tonality
Example: J. S. Bach's "Well Tempered Clavier" Books 1 and 2
2015, Michael A. Casey, Dartmouth College, Bregman Media Labs
License:
Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
http://creativecommon... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 12 20:41:09 2014
@author: nestor
"""
import matplotlib.pyplot as plt
import scipy as sp
from matplotlib.backends.backend_pdf import PdfPages as pp
xlabel_names = { 'symbol_size' : r"$Symbol\ Size\ [KB]$",
'symbols' : r"$Symbols$",
'loss... | |
"""
This file contain the viewsets for the course, offering, courseinfo and CourseHistory models.
Functionality Provided:
Course:
+ Add - (IsDeveloper)
+ Update, PartialUpdate, Delete - (IsCourseDeveloper)
+ List - (everyone allowed)
+ Retrieve - (IsRegisteredOrAnyInstructor)... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | |
import random
import operator
import copy
from collections import Counter
class Env(object):
directions = [[1, -1], [1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1]]
empty = 'empty'
@classmethod
def flatten_list(cls, ls):
l = []
for el in ls:
if isinstance(el, li... | |
import collections
import functools
import json
import os
import sys
import time
import traceback
import uuid
from django import http
from django.core.exceptions import PermissionDenied
from django.core.files.storage import default_storage as storage
from django.conf import settings
from django import forms as django_... | |
from copy import copy
import urllib
from datetime import datetime, timedelta
from django.template.loader import render_to_string
from django.utils.translation import ugettext_noop
from django.utils.translation import ugettext as _
from custom.bihar.utils import (get_team_members, get_all_owner_ids_from_group, SUPERVIS... | |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | |
#!/usr/bin/python
from libestateredis.estate_redis import estate as estater
from libestateredis.estate_redis_cluster import estate as estaterc
from cppesnode.estate_zmqclient import estate as estatez
from pyclient.estate import estate as estatep
from libestatelocal.estate import estate as estatelocal
from scapy.all im... | |
# Copyright (c) 2013 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 ... | |
"""Functions to set up models.
Any model can in principle be used and fit to photometry and spectra
using sdf, the models just need to be set up correctly. For the default
models most of that is done here.
Basic structure is that there are SpecModels (spectra) and PhotModels
(photometry in filters). PhotModels are de... | |
"""n-body simulator to derive TDV+TTV diagrams of planet-moon configurations.
Credit for part of the source is given to
https://github.com/akuchling/50-examples/blob/master/gravity.rst
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
"""
import numpy
import math
import matplotlib.pylab as plt... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'radtrack/ui/LaserInterface.ui'
#
# Created: Sat Apr 9 00:11:01 2016
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fro... | |
#!/usr/bin/env python
"""
A fast minimal static website builder.
Minimalsite generates web pages from a source file hierarchy. It supports
markdown and textile syntax, but plain txt and html can be evenly used.
Template files are python modules, providing huge flexibility and keeping the
codebase tiny and simple.
"""... | |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | |
from toontown.toonbase.ToontownBattleGlobals import *
import types
from direct.fsm import StateData
from direct.fsm import ClassicFSM, State
from direct.fsm import State
import TownBattleAttackPanelNEW
import TownBattleAttackPanelOLD
import TownBattleWaitPanel
import TownBattleChooseAvatarPanel
import TownBattleSOSPane... | |
""" View functions for tag related things
This includes both viewing the tag list, and manipulating tags on other things.
"""
from django.contrib.auth.decorators import login_required
from django.core.exceptions import SuspiciousOperation
from django.http import HttpResponse
from django.shortcuts import get_object_or_... | |
from dataclasses import field, Field, dataclass
from enum import Enum
from itertools import chain
from typing import (
Any, List, Optional, Dict, Union, Type, TypeVar, Callable
)
from dbt.dataclass_schema import (
dbtClassMixin, ValidationError, register_pattern,
)
from dbt.contracts.graph.unparsed import Addit... | |
# coding: utf-8
"""
AlertApi.py
Copyright 2016 SmartBear Software
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 ... | |
# -*- coding: utf-8 -*-
from datetime import date, datetime
from dateutil.relativedelta import relativedelta
from openerp import api, fields, models, _
from openerp.exceptions import UserError, ValidationError
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DF
from openerp.tools import float_compare
class A... | |
# Copyright (C) 2013-2014 Computer Sciences Corporation
#
# 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 a... | |
# Copyright 2022 The DDSP 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 wri... | |
"""
This modules handles HTTP RPC requests, by exposing them via proxies.
"""
import requests
from io import BytesIO
class ProxyError(Exception):
""" Raised when the HTTP server returns an error code. """
class Proxy:
"""
A proxy is a wrapper around an HTTP call to an specific path.
When you have... | |
# -*- coding: utf-8 -*-
"""Processes GCP cloud disks using Turbinia."""
import getpass
import os
import tempfile
# We import a class to avoid importing the whole turbinia module.
from turbinia import TurbiniaException
from turbinia import client as turbinia_client
from turbinia import config as turbinia_config
from t... | |
from __future__ import print_function
from __future__ import division
import os
import time
import numpy as np
import numpy.ma as ma
from scipy.misc import imsave
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib
# Force matplotlib to not use any Xwindows backend.
# See- https://stackoverflow... | |
import numpy as np
from matplotlib import pyplot as plt
def CalculateBranchingEvidence(d, Bsearch=None):
"""
:param d: output dictionary from FitModel
:param Bsearch: candidate list of branching points
:return: posterior probability of branching at each point and log Bayes factor
of branching vs n... | |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | |
'''
Created on Jun 17, 2014
@author: sstober
'''
import logging;
log = logging.getLogger(__name__);
from pylearn2.train_extensions import TrainExtension;
import numpy as np;
import theano;
from sklearn.metrics import confusion_matrix,precision_recall_fscore_support;
from pylearn2.space import CompositeSpace
fr... | |
# jsb/socklib/xmpp/bot.py
#
#
""" jabber bot definition """
## jsb imports
from jsb.lib.users import users
from jsb.utils.exception import handle_exception
from jsb.utils.trace import whichmodule
from jsb.utils.locking import lockdec
from jsb.utils.pdod import Pdod
from jsb.utils.dol import Dol
from jsb.lib.less imp... | |
#
# 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"); you may not us... | |
# -*- coding:utf-8 -*-
""" driver class management """
from sfa.util.sfalogging import logger
from sfa.util.xrn import Xrn, urn_to_hrn
from sfa.rspecs.version_manager import VersionManager
from sfa.rspecs.rspec import RSpec
from sfa.managers.driver import Driver
from sfa.iotlab.iotlabshell import IotLABShell
from sfa.... | |
import logging
from collections import defaultdict
import networkx
import claripy
from ..sim_type import SimType, SimTypePointer, SimTypeChar, SimTypeString, SimTypeReg
from ..calling_conventions import DEFAULT_CC
from ..knowledge_base import KnowledgeBase
from ..errors import AngrDirectorError
from . import Explor... | |
#!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) Greg Davill <greg.davill@gmail.com>
# SPDX-License-Identifier: BSD-2-Clause
import os
import sys
import argparse
from migen import *
from migen.genlib.misc import WaitTimer
from migen.genlib.resetsync import AsyncResetSynchronizer
from ... | |
from __future__ import division
import json
import os
import pickle
import pprint
from random import shuffle
import numpy
import patterny.semafor.frame as _frame
from patterny.db import dao
from patterny.config import Config
from patterny.ml.similarity import ProblemSimilarity
from patterny.semafor.adapter import Se... | |
# 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"); you may not u... | |
#!/usr/bin/env python
#
# T. Carman Spring/Summer 2016
#
import os # general path manipulations
import shutil # cleaning up files
import glob # listing/finding data files
import json # reading data files
import signal ... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2013 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 ... | |
#
# CORE
# Copyright (c)2010-2012 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# author: Tom Goff <thomas.goff@boeing.com>
#
'''
vnodeclient.py: implementation of the VnodeClient class for issuing commands
over a control channel to the vnoded process running in a network namespace.
The co... | |
from django.test import TestCase, Client
from django.http import HttpRequest, Http404
from django.contrib.auth.models import User
from wagtail.wagtailcore.models import Page, Site
from wagtail.tests.models import EventPage
class TestRouting(TestCase):
fixtures = ['test.json']
def test_find_site_for_request... | |
########################################################################
#
# Kevin Wecht 4 November 2014
#
# Bay Area Bicycle Share (BABS) Open Data Challenge
#
########################################################################
#
# This file begins a Qt window to support interactive
# ... | |
"""Provides classes used to construct a full ``Choices`` instance.
Notes
-----
The documentation format in this file is numpydoc_.
.. _numpydoc: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
"""
from __future__ import unicode_literals
try:
from collections.abc import Mapping
except Imp... | |
#! /bin/env python2
# coding: utf-8
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import random as rd
from pickle import dump
class Data:
def __init__(self):
self.m_list1 = []
self.m_list2 = []
N = 100
M = 100
MAX = N + M + 1
MAX_EDGE = 380
MAX_DEG = 450
ITERATIONS = 50... | |
"""
TODO
"""
__author__ = 'Chris Jones, Kenneth Love'
__version__ = '0.8.5'
__license__ = 'MIT'
import re
from flask import Flask, render_template, redirect, url_for, request, flash
from flask import session, jsonify
from flaskext.wtf import Form, TextField, Required, IntegerField, FloatField
import redis
from redi... | |
"""
Astra-Viso world object module.
"""
from __future__ import division
import numpy as np
from scipy.integrate import ode
from astraviso import pointingutils
class WorldObject:
"""
World object class.
"""
def __init__(self, name="Object1"):
"""
WorldObject class initialization.
... | |
# -*- coding: utf-8 -*-
"""modelgrid.py - Deprecated code for interpolating regular or irregular grids
of models. Use `scipy.interpolate.RegularGridInterpolator` or
`scipy.interpolate.LinearNDInterpolator`.
Kept here since it is used by some other (old) packages of mine.
"""
import numpy as np
from scipy.spatial i... | |
"""
test_remote.py
~~~~~~~~~~~~
clear; python -m unittest discover -v
"""
import asyncore
import boto.ec2
import logging
import random
import socket
import pprint
import sys
import time
import unittest
import PynamoDB.util as util
from PynamoDB.client import PynamoClient
from scripts import fabfile
loggi... | |
#!/usr/bin/env python
# coding=UTF-8
# Be warned, in Ubuntu 12.04 the fitting of the lognorm and genextreme distribution doesn't work with the default scipy 0.9.0 package
# Either update your scipy installation to version 0.14.0
# or install anaconda (from http://continuum.io/downloads) and prepend to your PATH the an... | |
from nose.tools import with_setup
from testconfig import config
from pyvcloud import vcloudair
from pyvcloud.vcloudair import VCA
from pyvcloud.schema.vcd.v1_5.schemas.vcloud.networkType import NatRuleType, GatewayNatRuleType, ReferenceType, NatServiceType, FirewallRuleType, ProtocolsType
class TestVCloud:
def __... | |
#import urllib2
import urllib
import subprocess
import time
import os.path
import sys
import getopt
from Bio.PDB import *
import openbabel
import pybel
import yaml
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Draw
import re
import os
from collections import Counter
import numpy as n... | |
# Copyright 2010 Google Inc.
#
# 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, merge, publish, dis-
# trib... | |
# Copyright (c) 2013-2014 Rackspace, 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 to ... | |
from pprint import pprint
import pytest
from etcdb.sqlparser.parser import SQLParser
@pytest.fixture
def parser():
return SQLParser()
def test_select_version(parser):
tree = parser.parse('SELECT VERSION()')
assert tree.query_type == "SELECT"
assert tree.expressions == [
{
'type'... | |
# Copyright 2018 The TensorFlow Probability 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 o... | |
# 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... | |
import os
import shutil
import tempfile
import functools
from getpass import getuser
from mock import patch
from StringIO import StringIO
from mock import Mock, patch
from zope.interface import implements
from twisted.trial import unittest
from twisted.test import proto_helpers
from twisted.internet import defer, err... | |
# Copyright (c) 2017 Museum Victoria
# This software is released under the MIT license (see license.txt for details)
''''Projection Design Node'''
### Libraries required by this Node
import socket
import struct
### Parameters used by this Node
PORT = 1025
param_ipAddress = Parameter('{"title":"IP Address","schema"... | |
"""
MAP Client, a program to generate detailed musculoskeletal models for OpenSim.
Copyright (C) 2012 University of Auckland
This file is part of MAP Client. (http://launchpad.net/mapclient)
MAP Client is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public Li... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import os
from collections import namedtuple
from datetime import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.