gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#
# IRAFBase.py -- IRAF plugin base class for Ginga fits viewer
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
The IRAF plugin implements a remote control interfa... | |
"""Tests for the pages app."""
from django.db import models
from django.test import TestCase
from django.core.management import call_command
from django.contrib.contenttypes.models import ContentType
from cms.externals import External
from ..models import filter_indexable_pages, ContentBase, Page, PageSearchAdapter, ... | |
# Copyright 2014 PerfKitBenchmarker 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 appli... | |
# 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 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
import logging
import os
import sys
import time
import numpy as np
import tensorflow as tf
import bigru_model
import data_util
tf.app.flags.DEFINE_float("learning_rate", 1., "Learning rate.")
tf.app.flags.DEFINE_integer("size", 400, "Size of hidden layers.")
tf.app.flags.DEFINE_integer("embsize", 200, "Size of embed... | |
# -*- coding: utf-8 -*-
import re
import mock
from typing import Dict, Any, Set
from django.conf import settings
import zerver.lib.openapi as openapi
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.openapi import (
get_openapi_fixture, get_openapi_parameters,
validate_against_openapi_schema... | |
CORRECTNESS_PTS = 2
QUESTION_PTS = 10
SMALL_QUESTION_PTS = 4
# deduct 75% of points if students allocate maximum resources
NO_ELASTIC_DEDUCTION = .75
SMALL_NO_ELASTIC_DEDUCTION = .5
USAGE_DEDUCTION = .5
def perf_eval(actual, low, high):
if actual < low:
return 1.0;
elif actual >= high:
ret... | |
# Copyright 2019 The Sonnet 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 applicable l... | |
#------------------------------------------------------------------------------
# pycparser: c_generator.py
#
# C code generator from pycparser AST nodes.
#
# Eli Bendersky [http://eli.thegreenplace.net]
# License: BSD
#------------------------------------------------------------------------------
from . import c_ast
... | |
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import os
import sys
import re
import csv
import time
from datetime import datetime, timedelta
from itertools import izip
from collections import OrderedDict, defaultdict
THRESHOLD = 50.0
MINUTE_THRESHOLD = 1023
SENSOR_TYPE = 1
timest... | |
"""
Octave (and Matlab) code printer
The `OctaveCodePrinter` converts SymPy expressions into Octave expressions.
It uses a subset of the Octave language for Matlab compatibility.
A complete code generator, which uses `octave_code` extensively, can be found
in `sympy.utilities.codegen`. The `codegen` module can be us... | |
# Copyright 2016 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 ... | |
import colander
from datetime import date
from uuid import uuid4
@colander.deferred
def merchant_id(node, kw):
return uuid4().hex[:20]
@colander.deferred
def today(node, kw):
return date.today().isoformat()
class AddressSchema(colander.MappingSchema):
first_name = colander.SchemaNode(colander.String(... | |
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softw... | |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistribu... | |
from __future__ import absolute_import
import unittest
import numpy as np
from bokeh.properties import (
HasProps, NumberSpec, ColorSpec, Bool, Int, Float, Complex, String,
Regex, List, Dict, Tuple, Array, Instance, Any, Interval, Either,
Enum, Color, Align, DashPattern, Size, Percent, Angle, AngleSpec,
... | |
#!/usr/bin/env python2.5
#
# Copyright 2008 the Melange 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 applic... | |
# Copyright (c) 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 ... | |
import unittest
from reactivex import operators as ops
from reactivex.testing import ReactiveTest, TestScheduler
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest.subscribed
disposed = ReactiveTest.disp... | |
# -*- coding: utf-8 -*-
import random
import pytest
import vdirsyncer.exceptions as exceptions
from vdirsyncer.storage.base import Item
from vdirsyncer.utils.compat import iteritems, text_type
from .. import EVENT_TEMPLATE, TASK_TEMPLATE, VCARD_TEMPLATE, \
assert_item_equals
def format_item(item_template, uid... | |
# 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... | |
# Copyright 2013 Red Hat, 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... | |
"""
Github-tools Models.
"""
from __future__ import with_statement
from urllib import urlencode
from ConfigParser import RawConfigParser
import urllib2
import os
from git.errors import GitCommandError
try:
import json #@UnresolvedImport
except ImportError:
import simplejson as json
from git import Git, Repo ... | |
import sys, os
from email.utils import parsedate
from threading import Thread
import logging
import time
import simplejson
import twilio
try:
from sqlalchemy import Table, Column, Integer, String, DateTime, MetaData, ForeignKey, create_engine, Text, Boolean
from sqlalchemy.ext.declarative import declarative_b... | |
"""
Utility functions and classes for the dashboard
"""
import logging
from decimal import Decimal
from django.db import transaction
from django.db.models import Q, Count
from django.urls import reverse
from courses.models import CourseRun, Course
from dashboard.api_edx_cache import CachedEdxUserData
from dashboard.m... | |
from dicomweb_client.uri import URI, URISuffix, URIType
import pytest
_STUDY_UID = '1.2.3'
_SERIES_UID = '4.5.6'
_INSTANCE_UID = '7.8.9'
_FRAMES = (3, 4, 5)
# DICOMweb URLs constructed from the UIDs above.
_BASE_URL = 'https://lalalala.com'
_STUDY_URI = f'{_BASE_URL}/studies/{_STUDY_UID}'
_SERIES_URI = f'{_STUDY_URI... | |
# Copyright 2014 Cirruspath, 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 wri... | |
from django import shortcuts
from django.conf import settings
from django.core.urlresolvers import set_script_prefix
from django.test.client import Client, RequestFactory
import pytest
from nose.tools import eq_, assert_not_equal
import amo.tests
from amo import urlresolvers
from amo.middleware import LocaleAndAppURL... | |
# -*- coding: utf-8 -*-
#
# Elephant documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 5 17:11:26 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
"""
This script generates much of the implementation of that provides a
"""
import sys
import os
if __name__ == '__m... | |
from __future__ import unicode_literals
import datetime
import json
import re
from jinja2 import Environment, DictLoader, TemplateNotFound
import six
from six.moves.urllib.parse import parse_qs, urlparse
from werkzeug.exceptions import HTTPException
from moto.core.utils import camelcase_to_underscores, method_names_... | |
import traceback
from datetime import datetime
from copy import deepcopy
from sqlalchemy import (
create_engine,
Column,
Integer,
String,
DateTime,
Boolean,
TEXT
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Session
from .connectionprovider import Con... | |
#!/usr/bin/python
# Copyright 2015-2016 Nervana Systems 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... | |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# mininode.p... | |
# Copyright 2014 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 ag... | |
# Copyright 2014 OneConvergence, 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 requir... | |
import numpy as np
import scipy.stats.stats
from . import distributions
from .._lib._bunch import _make_tuple_bunch
__all__ = ['_find_repeats', 'linregress', 'theilslopes', 'siegelslopes']
# This is not a namedtuple for backwards compatibility. See PR #12983
LinregressResult = _make_tuple_bunch('LinregressResult',
... | |
#!/usr/bin/env python
import argparse
import json
import os
import shlex
import shutil
import subprocess
import sys
import tarfile
import tempfile
from argparse import ArgumentTypeError
from pathlib import Path
import requests
ETCD_DATA_DIR = "/var/lib/dcos/etcd/default.etcd"
CLUSTER_NODES_PATH = "/var/lib/dcos/etc... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | |
from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql, oracle, no_mysql, no_oracle, no_spatialite
from django.test import TestCase
if HAS_GEOS:
from django.contrib.gis.db.models import ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Palladium documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 2 12:58:06 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... | |
# Copyright 2014 ETH Zurich
# Copyright 2018 ETH Zurich, Anapaya Systems
#
# 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 b... | |
"""Testing for the boost module (sklearn.ensemble.boost)."""
import numpy as np
from sklearn.utils.testing import assert_array_equal, assert_array_less
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_raises, assert_rais... | |
#!/usr/bin/env python3
import argparse
import math
import numpy
import os
import sys
sys.setrecursionlimit(10000)
class Input(object):
""" Class object to parse input."""
def __init__(self, filename='map.txt'):
self._filename = filename
self._size = ()
self._start = ()
self._... | |
# Copyright 2011 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 applicable law or a... | |
# Authors: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
from io import BytesIO
import os
import os.path as op
from functools import reduce, partial
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_allclose, assert_e... | |
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
#
# 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, incl... | |
# Copyright 2014 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 unittest
from alfpy import word_pattern
from alfpy import word_vector
from alfpy import word_distance
from alfpy.utils import distmatrix
from . import utils
class DistanceTest(unittest.TestCase, utils.ModulesCommonTest):
def __init__(self, *args, **kwargs):
super(DistanceTest, self).__init__(*ar... | |
# -*- coding: utf-8 -*-
"""Calendar is a dictionary like Python object that can render itself as VCAL
files according to rfc2445.
These are the defined components.
"""
from datetime import datetime, timedelta
from icalendar.caselessdict import CaselessDict
from icalendar.parser import Contentline
from icalendar.parser... | |
from bpy.props import (StringProperty, BoolProperty, EnumProperty, IntProperty)
from ..rman_ui.rman_ui_base import CollectionPanel
from ..rfb_utils.draw_utils import _draw_ui_from_rman_config, draw_node_properties_recursive
from ..rfb_utils import scene_utils
from ..rfb_utils import shadergraph_utils
from ..rfb_uti... | |
#!/usr/bin/env python3
# vim: set fileencoding=utf-8 tabstop=4 shiftwidth=4 softtabstop=4:
_karma = { 'karma' : (0, 0, None), }
_vendor = { 'vendor' : (0, 0, None), }
_dont_buy = ( 'dontbuy', (0, 0, None) )
_gear = {
'Deldrimor_Steel_Ingot' : (46738, 1,
{
'Darksteel Ingot' : (19681, 20,
{
'Platinum Ore' : (1... | |
# ******************************************************************************
# pysimm.utils module
# ******************************************************************************
#
# ******************************************************************************
# License
# *****************************************... | |
#!/usr/bin/env python
from argparse import ArgumentParser, FileType
from bz2 import BZ2File
from csv import writer
from sys import stdin, exit
from termios import tcflush, TCIFLUSH
from time import time as seconds
import numpy as np
import matplotlib
# Lazy loading so that we can set the backend
plt = None
manimatio... | |
from __future__ import division, unicode_literals, print_function
"""
Compute the reduced matching lattice vectors for heterostructure
interfaces as described in the paper by Zur and McGill:
Journal of Applied Physics 55, 378 (1984); doi: 10.1063/1.333084
"""
import sys
from math import sqrt
import numpy as np
from... | |
# 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... | |
# $Id$
#
# Copyright (C) 2003-2006 Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
"""unit testing code for graph-theoret... | |
# -*- coding: utf-8 -*-
#
#
# Project name: OpenVAS2Report: A set of tools to manager OpenVAS XML report files.
# Project URL: https://github.com/cr0hn/openvas_to_report
#
# Copyright (c) 2015, cr0hn<-AT->cr0hn.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modificatio... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------
# File: analysis/analysis_sqlite.py
# Created: 2015-02-01
# Purpose: Analysis functionalities based on SQLite models
#
# Copyright
# -----------------------------------------... | |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...styles import Styles
from ...format import Format
class TestWriteFont(unittest.Test... | |
"""
This module is used by agent to execute spider task.
"""
# pylint: disable=missing-module-docstring
# pylint: disable=missing-class-docstring
# pylint: disable=missing-function-docstring
import asyncio
import os
import logging
import tempfile
import shutil
from urllib.parse import urlparse
from configparser import ... | |
"""The test for the statistics sensor platform."""
from datetime import datetime, timedelta
import statistics
import unittest
import pytest
from homeassistant.components import recorder
from homeassistant.components.statistics.sensor import StatisticsSensor
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, ST... | |
# Copyright 2012 Nebula, 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 agree... | |
# 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... | |
from ctypes import c_char_p, c_int, c_float, cdll, byref, Structure, POINTER
import numpy
from scipy import interpolate
try:
_lib = cdll.LoadLibrary('libopesci.so')
except:
_lib = cdll.LoadLibrary('libopesci.dylib')
class c_Shot(Structure):
_fields_ = [("filename", c_char_p),
("start", c_... | |
#!/usr/bin/python
import os
import sys
import re
import time
import datetime
from pprint import pprint as pp
PROG_NAME = 'kgml2svg'
PROG_VER = '201509111735'
RUN_TIME = datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S')
#http://rest.kegg.jp/list/pathway/pti
#wget http://rest.kegg.jp/get/pti... | |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2012-12-17 11:07:19
from __future__ import unicode_literals
import six
import copy
import time
import json
import logging
import threading
import tornado.... | |
# 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... | |
"""Handler for Type nodes from the clang AST tree."""
from clang.cindex import TypeKind
from ctypeslib.codegen import typedesc
from ctypeslib.codegen.util import log_entity
from ctypeslib.codegen.handler import ClangHandler
from ctypeslib.codegen.handler import InvalidDefinitionError
import logging
log = logging.get... | |
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) 2013-2015, Michigan State University.
# Copyright (C) 2015-2016, The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... | |
from __future__ import absolute_import
from collections import defaultdict
from sentry.tasks.merge import merge_group, rehash_group_events
from sentry.models import Event, Group, GroupMeta, GroupRedirect, GroupTagKey, GroupTagValue
from sentry.testutils import TestCase
class MergeGroupTest(TestCase):
def test_m... | |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
im... | |
import os
import sys
import math
import time
from fractions import Fraction
from multiprocessing import Process, Queue
import tft_utils
import tft_expr
import tft_error_form
import tft_ask_gurobi
import tft_ask_glpk
import tft_ask_gelpia
import tft_alloc
import tft_ir_api as IR
import tft_mathprog_backend
... | |
"""
This tutorial introduces the multilayer perceptron using Theano.
A multilayer perceptron is a logistic regressor where
instead of feeding the input to the logistic regression you insert a
intermediate layer, called the hidden layer, that has a nonlinear
activation function (usually tanh or sigmoid) . One can use ... | |
import os
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
BASE_DIR = PACKAGE_ROOT
DEBUG = True
TEMPLATE_DEBUG = DEBUG
EMAIL_DEBUG = DEBUG
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
... | |
###NormalizeDataset
#Copyright 2012 J. David Gladstone Institutes, San Francisco California
#Author Nathan Salomonis - nsalomonis@gmail.com
#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 wit... | |
import copy
import re
import astropy.io.fits as fits
import numpy as np
from threeML.exceptions.custom_exceptions import custom_warnings
from threeML.io.file_utils import file_existing_and_readable
from threeML.io.progress_bar import progress_bar
from threeML.plugins.DispersionSpectrumLike import DispersionSpectrumLi... | |
#!/usr/bin/env python
"""
Mutliple Read Property Hammer
This application blasts a list of ReadPropertyRequest messages with no
regard to the number of simultaneous requests to the same device. The
ReadPointListApplication is constructed like the BIPSimpleApplication but
without the ApplicationIOController interface ... | |
# Copyright (c) 2014 Alex Meade. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2014 Andrew Kerr. All rights reserved.
# Copyright (c) 2015 Tom Barron. All rights reserved.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); y... | |
# Copyright (C) 2013-2015 eNovance SAS <licensing@enovance.com>
#
# 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 appl... | |
# -*- coding: UTF-8 -*-
import numpy as np
from caid.cad_geometry import square as domain
from caid.core.bspline import bsp
# ------------------------------
def findSpan(list_x, list_t, list_p, list_n):
x = list_x[0]
y = list_x[1]
tx = list_t[0]
ty = list_t[1]
px = list_p[0]
py = list_p[1]
... | |
import weakref
from AppKit import NSView, NSSegmentStyleSmallSquare, NSSmallSquareBezelStyle
import vanilla
from defconAppKit.controls.glyphCellView import DefconAppKitGlyphCellNSView, gridColor, GlyphInformationPopUpWindow, GlyphCellItem
from defconAppKit.controls.fontInfoView import GradientButtonBar
class DefconAp... | |
import threading
import weakref
from django.utils.inspect import func_accepts_kwargs
def _make_id(target):
if hasattr(target, '__func__'):
return (id(target.__self__), id(target.__func__))
return id(target)
NONE_ID = _make_id(None)
# A marker for caching
NO_RECEIVERS = object()
class Signal:
... | |
from collections import defaultdict
from datetime import datetime
import six
from testtools.matchers import Contains, Not
import falcon
import falcon.testing as testing
class StatusTestResource:
sample_body = testing.rand_string(0, 128 * 1024)
def __init__(self, status):
self.status = status
d... | |
import config
import utils
import sublime
import sublime_plugin
####################################################################################
# VIEW
####################################################################################
class SwiDebugView(object):
""" The SWIDebugView wraps a normal view, a... | |
# 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... | |
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softw... | |
"""
Stack-In-A-WSGI: stackinawsgi.wsgi.request.Request testing
"""
import unittest
import ddt
from stackinawsgi.wsgi.request import Request
from stackinawsgi.test.helpers import (
make_environment
)
@ddt.ddt
class TestWsgiRequest(unittest.TestCase):
"""
Test the interaction of StackInAWSGI's Request obj... | |
"""Shark IQ Wrapper."""
from __future__ import annotations
from collections.abc import Iterable
import logging
from sharkiqpy import OperatingModes, PowerModes, Properties, SharkIqVacuum
from homeassistant.components.vacuum import (
STATE_CLEANING,
STATE_DOCKED,
STATE_IDLE,
STATE_PAUSED,
STATE_RE... | |
# ===================================================================
#
# Copyright (c) 2015, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributio... | |
import os
import re
import json
import time
import math
import random
import logging
import argparse
import operator
import functools
from collections import Counter, OrderedDict
import asyncio
import numpy as np
import pandas as pd
from aiohttp import ClientSession
from angular_flask import app
from angular_flask im... | |
import sys
import RPi.GPIO as GPIO
import os, urlparse
import time
import datetime
import ConfigParser
import smtplib
from SocketServer import ThreadingMixIn
import threading
from email.mime.text import MIMEText
from array import array
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class PiBell:
de... | |
"""Recipes for making changes to EnergyPlus IDF files.
These are generally exposed and methods on the IDF object, e.g. `set_default_constructions(idf)`
can be called on an existing `IDF` object like ``myidf.set_default_constructions()``.
"""
from typing import List, Optional, Tuple, Union # noqa
import warnings
fro... | |
from __future__ import division, unicode_literals
"""
This is essentially just a clone of the MPRester object in pymatgen with
slight modifications to work with MaterialsWeb.
This module provides classes to interface with the MaterialsWeb REST
API v2 to enable the creation of data structures and pymatgen objects usin... | |
import re
import collections
from rest_framework import exceptions
from rest_framework import serializers as ser
from django.core.urlresolvers import resolve, reverse
from rest_framework.fields import SkipField
from framework.auth import core as auth_core
from website import settings
from website.util.sanitize import... | |
#!/usr/bin/env python
import argparse
import os
import tempfile
import shutil
import subprocess
import sys
# Constants giving names of file formats
FMT_PLINK_ASSOC = 'plink_assoc' # Treated as a list of locations to use
FMT_GENEMANIA_INTER ='genemania_interaction'
# 3 columns tab-separated no header:
#
# gen... | |
"""
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from atomic_reactor.core import DockerTasker
from atomic_reactor.inner import DockerBuildWorkflow
fr... | |
import mailcap
import os
import copy
import test.support
import unittest
# Location of mailcap file
MAILCAPFILE = test.support.findfile("mailcap.txt")
# Dict to act as mock mailcap entry for this test
# The keys and values should match the contents of MAILCAPFILE
MAILCAPDICT = {
'application/x-movie':
[{'... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'DirectMessage'
db.delete_table('foundry_directmessage')
# Deleting model 'MemberF... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.