gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
"""
Django settings for braonly project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.pat... | |
import asyncio
import functools
import ssl
import sys
import traceback
import warnings
from collections import defaultdict
from hashlib import md5, sha1, sha256
from types import MappingProxyType
from . import hdrs, helpers
from .client_exceptions import (ClientConnectorError, ClientHttpProxyError,
... | |
#!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
try:
from cStringIO import StringIO
StringIO # work... | |
"""
HDF5 Pricing File Format
------------------------
At the top level, the file is keyed by country (to support regional
files containing multiple countries).
Within each country, there are 4 subgroups:
``/data``
^^^^^^^^^
Each field (OHLCV) is stored in a dataset as a 2D array, with a row per
sid and a column per s... | |
##%
import sfsimodels as sm
from sfsimodels.num.mesh import mesh2d_vary_y
import numpy as np
import sys
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import o3plot
#%%
vs = 150.0
rho = 1.8
g_mod = vs ** 2 * rho
sl1 = sm.Soil(g_mod=g_mod, unit_dry_weight=rho * 9.8, poissons_ratio=0.32)
sl2 = sm.Soil(g_... | |
from django.shortcuts import render
from django.core import serializers
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.conf import settings
from registrar.m... | |
"""
Defining various quadrature routines.
Based on the quadrature routines found in the CompEcon toolbox by
Miranda and Fackler.
References
----------
Miranda, Mario J, and Paul L Fackler. Applied Computational Economics
and Finance, MIT Press, 2002.
"""
import math
import numpy as np
import scipy.linalg as la
from ... | |
# 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... | |
"""Assorted codetools utility functions."""
# technical debt
# --------------
# - package
from datetime import datetime
from pkg_resources import get_distribution
from public import public
import argparse
import gitconfig
import os
import shutil
import sys
import tempfile
import textwrap
# configured by setup_loggin... | |
# Copyright 2013 Josh Durgin
# 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 a... | |
# Copyright 2017-present Open Networking 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 agr... | |
import bisect
import math
import warnings
from fractions import Fraction
from typing import Any, Dict, List, Optional, Callable, Union, Tuple, TypeVar, cast
import torch
from torchvision.io import (
_probe_video_from_file,
_read_video_from_file,
read_video,
read_video_timestamps,
)
from .utils import ... | |
"""
Timezone-related classes and functions.
"""
import functools
from contextlib import ContextDecorator
from datetime import datetime, timedelta, timezone, tzinfo
import pytz
from asgiref.local import Local
from django.conf import settings
__all__ = [
'utc', 'get_fixed_timezone',
'get_default_timezone', 'g... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | |
import json
import logging
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.core.validators import URLValidator
from django.utils.datetime_safe import datetime
from app.ciscoeox.exception import ConnectionFailedException, CiscoApiCallFailed
from app.ciscoeox.base_api import CiscoEoxAp... | |
'''
Reverse mode automatic differentiation algorithm.
Representation - GRAPH
Build the computation graph, with variables as nodes, corresponding to graph VERTICES.
And vertices are connected by EDGES, a.k.a operators in computation context.
And the gradient are also represented as a node, thus the computation graph
o... | |
import os
import setuptools
import pytest
from flexmock import flexmock
import pyp2rpm.metadata_extractors as me
from pyp2rpm.name_convertor import NameConvertor
from pyp2rpm import utils
tests_dir = os.path.split(os.path.abspath(__file__))[0]
class TestMetadataExtractor(object):
td_dir = '{0}/test_data/'.for... | |
# -*- coding: utf-8 -*-
from __future__ import (
absolute_import, division, print_function, unicode_literals)
import mock
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from django_dynamic_fixture import get
from textclassifier.validato... | |
#instruction = (prefix( opcode, modrm, sib, disp, immediate))
from ptypes import bitmap
from . import optable,typesize
prefix_string = b'\x26\x2e\x36\x3e\x64\x65\x66\x67\xf0\xf2\xf3'
prefix_lookup = {item : None for item in prefix_string}
def isprefix(byte):
try:
prefix_lookup[byte]
return True
... | |
import dateparser
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from dateutil import parser
import copy
from typing import Optional, Dict
import traceback
# XDR_FIELDS
INCIDENT_ID_XDR_FIELD = "incident_id"
MANUAL_SEVERITY_XDR_FIELD = "manual_severity"
MANUAL_DESC... | |
# Copyright 2015 MongoDB, 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 writing, s... | |
from gusto import *
from firedrake import (as_vector, SpatialCoordinate,
PeriodicRectangleMesh, ExtrudedMesh,
cos, sin, cosh, sinh, tanh, pi, Function, sqrt)
import sys
day = 24.*60.*60.
hour = 60.*60.
dt = 100.
if '--running-tests' in sys.argv:
tmax = dt
tdump = d... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""boids -- Boids implementation using Owyl behavior trees.
This module provides example code using the L{owyl} library to
implement the Boids flocking algorithm.
Requirements
============
Note: this demo requires Pyglet, Rabbyt, cocos2d
- B{Pyglet}: U{http://pypi.p... | |
from contextlib import contextmanager
import os
import pickle
from tempfile import mkstemp
import unittest
from unittest.mock import patch, Mock
import warnings
from Orange.widgets.settings import SettingsHandler, Setting, SettingProvider,\
VERSION_KEY, rename_setting, Context, migrate_str_to_variable
class Setti... | |
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
import logging
import numpy as np
import matplotlib.pyplot as pl
from matplotlib.ticker import MaxNLocator, NullLocator
from matplotlib.colors import LinearSegmentedColormap, colorConverter
from matplotlib.ticker import ScalarFormatter
tr... | |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | |
# Copyright 2018-2019 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | |
#!/usr/bin/python2.5
# Copyright (C) 2009 Google 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 la... | |
import collections
import itertools
import functools
import traceback
import sys
from multiprocessing import Pool, Semaphore, Process, Pipe, Queue, Lock
from threading import Thread
from clopure import extras, basics
from clopure.exceptions import ClopureRuntimeError
def input_semaphore_hook(g, s):
for x in g:
... | |
from __future__ import unicode_literals
__author__ = 'luissaguas'
import frappe
import re
from frappe import _
from frappe.modules.import_file import import_doc
from ast import literal_eval
from . cache import *
from . jasper_document import *
from . jasper_email import set_jasper_email_doctype
import jasper_erpnext_re... | |
#!/usr/bin/env python
"""Stubs of client actions.
Client actions shouldn't be used on the server, stubs should be used instead.
This way we prevent loading effectively the whole client code into ours
server parts.
"""
from grr.lib import rdfvalue
from grr.lib import registry
from grr.lib.rdfvalues import client as r... | |
# 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 ... | |
# 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... | |
try: # Python 3
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
import logging
import ssl
import sys
import unittest
import mock
from dummyserver.testcase import HTTPSDummyServerTestCase
from dummyserver.server import DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS
f... | |
#!/usr/bin/env python
#
# Test cases for tournament.py
from tournament_extra import *
import os
def clearScreen():
os.system('cls' if os.name == 'nt' else 'clear')
def testDeleteTournaments():
deleteMatches()
print "1. Tournaments can be deleted."
def testDeleteMatches():
deleteMatches()
prin... | |
#!/usr/bin/env python
"""Memory Map File Analyser for ARM mbed"""
from abc import abstractmethod, ABCMeta
from sys import stdout, exit, argv
from os import sep
from os.path import basename, dirname, join, relpath, commonprefix
import re
import csv
import json
from argparse import ArgumentParser
from copy import deepc... | |
"""
File-based Checkpoints implementations.
"""
import os
import shutil
from tornado.web import HTTPError
from .checkpoints import (
Checkpoints,
GenericCheckpointsMixin,
)
from .fileio import FileManagerMixin
from ipython_genutils.path import ensure_dir_exists
from ipython_genutils.py3compat import getcwd
f... | |
# stdlib
import time
# project
from checks import AgentCheck
from util import Platform
# 3rd party
import psutil
class ProcessCheck(AgentCheck):
SOURCE_TYPE_NAME = 'system'
PROCESS_GAUGE = (
'system.processes.threads',
'system.processes.cpu.pct',
'system.processes.mem.rss',
... | |
# Copyright 2012 Grid Dynamics
# Copyright 2013 Inktank Storage, Inc.
# Copyright 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.or... | |
#!/usr/bin/python
#-----------------------------------------------------------------------
# Copyright 2012, Google 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... | |
#!/usr/bin/env python
#############################################################
# #
# bandcamp-sniffer #
# writen by - Ricardo Silva (github.com/Ricardo-Silva91) #
# ... | |
import itertools, math
from utils.utils import range_union
# adapted from ips-util for python 3.2 (https://pypi.org/project/ips-util/)
class IPS_Patch(object):
def __init__(self, patchDict=None):
self.records = []
self.truncate_length = None
self.max_size = 0
if patchDict is not No... | |
# Copyright (c) 2018 PaddlePaddle 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 app... | |
"""
Character categories and charsets.
"""
import sys
from rpython.rlib.rlocale import tolower, toupper, isalnum
from rpython.rlib.unroll import unrolling_iterable
from rpython.rlib import jit
from rpython.rlib.rarithmetic import int_between
# Note: the unicode parts of this module require you to call
# rsre_char.set_... | |
<<<<<<< HEAD
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.forms import (
CheckboxSelectMultiple, ClearableFileInput, RadioSelect, TextInput,
)
from django.forms.widgets import (
ChoiceFieldRenderer, ChoiceInput... | |
import operator
import pytest
from marshmallow import Schema, fields, validate
from sqlalchemy import Boolean, Column, Integer, Text
from flask_resty import (
Api,
Filtering,
GenericModelView,
LimitOffsetPagination,
LimitPagination,
MaxLimitPagination,
PagePagination,
RelayCursorPagina... | |
# 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 a... | |
# -*- coding: utf-8 -*-
__revision__ = '$Id: countrynames.py 7386 2006-04-30 11:12:55Z matt $'
countryNames = {
u'BD': u'Bangladesh',
u'BE': u'Belgium',
u'BF': u'Burkina Faso',
u'BG': u'Bulgaria',
u'BB': u'Barbados',
u'WF': u'Wallis and Futuna Islands',
u'BM': u'Bermuda',
u'BN': u'Brunei Darussalam',
u'BO': ... | |
import numpy as np
from numpy.testing import assert_array_almost_equal
import pytest
from sklearn.neighbors.kd_tree import (KDTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dist_metr... | |
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2006, Frank Scholz <coherence@beebits.net>
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
from twisted.internet.defer import Deferred
from twisted.python import failure
from twisted.sprea... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | |
#!/usr/bin/env python
# Python Network Interface Library
#
# Author: Yandy Ramirez
# Twitter: @IPyandy (https://twitter.com/IPyandy)
# Site: http://ipyandy.net
# Code Verion: 0.0.1
#
# ----------------------------------------------------------------
'''
Library to make A... | |
#!/usr/bin/python
from gevent import monkey
monkey.patch_all()
import logging
import gevent
from gevent.coros import BoundedSemaphore
from kafka import KafkaClient, KeyedProducer, SimpleConsumer, common
from uveserver import UVEServer
import os
import json
import copy
import traceback
import uuid
import struct
import ... | |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# 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 ddt import data, ddt, unpack
from django.test import TestCase
from django.test.client import RequestFactory
import mock
import pytest
from bridge_lti.models import LtiLmsPlatform, OutcomeService
from module.models import (
Activity, BridgeUser, Collection, CollectionOrder, Engine, GRADING_POLICY_NAME_TO_CLS, ... | |
import os
from director.componentgraph import ComponentFactory
from director import consoleapp
import director.objectmodel as om
import director.visualization as vis
from director.fieldcontainer import FieldContainer
from director import applogic
from director import appsettings
from director import drcargs
import fun... | |
# -*- coding: utf-8 -*-
from bson import ObjectId
import copy
import time
from eve.tests import TestBase
from eve.tests.utils import DummyEvent
from eve import STATUS, STATUS_OK, ETAG
from eve.tests.test_settings import MONGO_DBNAME
class TestVersioningBase(TestBase):
def setUp(self):
self.versioned_fiel... | |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import asyncio
import functools
import inspect
import logging
import unittest
import unittest.mock as _mock
import warn... | |
# Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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/LIC... | |
"""This module implements the built-in data types of the Scheme language, along
with a parser for Scheme expressions.
In addition to the types defined in this file, some data types in Scheme are
represented by their corresponding type in Python:
number: int or float
symbol: string
boolean: ... | |
from django.core.exceptions import ObjectDoesNotExist
from rdkit.Chem import AllChem
from rdkit import Chem
from rdkit.Chem.Draw import rdMolDraw2D
from rdkit.Chem import rdDepictor
from django_rdkit import models
import datetime
from django.contrib.auth.models import User
class Molecule(models.Model):
"""
Rep... | |
import asyncio
import json
import logging
import re
from collections import namedtuple
from copy import copy
from uuid import uuid4
from hbmqtt.client import MQTTClient, ConnectException, ClientException
from hbmqtt.errors import NoDataException
from hbmqtt.mqtt.constants import QOS_0, QOS_1, QOS_2
from nyuki.services... | |
#! /usr/bin/python
#
# -*- coding: utf-8 -*-
# Copyright 2014-2015 National Institute of Advanced Indus... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
from __future__ import print_function
import base64
import requests
import os
import json
import time
import sys
# Workaround to support both python 2 & 3
try:
import urllib.request, urllib.error
import urllib.parse as urllibparse
except ImportError:
import urllib as urllibparse
class SpotifyOauthError... | |
#!/usr/bin/python3
# check_synology_snmp.py - Python script that checks synology Rackstations
#
# copyright C-Store 2015
# Author Mattis Haase
#
# usage: python check_synology_snmp.py user passwd command ip warn crit
# available commands: system - returns system information, OK if system online, else critical. warn... | |
import win32api
import win32con
import win32security
import win32process
import win32ts
import win32profile
import ctypes
import win32netcon
import ntsecuritycon
import win32net
import wmi
import traceback
import shutil
import random
import os
# Need this for winsys exceptions
import winsys
from winsys import accounts... | |
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Traverses the source tree, parses all found DEPS files, and constructs
a dependency rule table to be used by subclasses.
The format... | |
"""
Asynchronous Shared-Memory Scheduler for Dask Graphs.
This scheduler coordinates several workers to execute tasks in a dask graph in
parallel. It depends on an apply_async function as would be found in thread or
process Pools and a corresponding Queue for worker-to-scheduler communication.
It tries to execute ta... | |
<<<<<<< HEAD
<<<<<<< HEAD
import test.support
# Skip tests if _multiprocessing wasn't built.
test.support.import_module('_multiprocessing')
# Skip tests if sem_open implementation is broken.
test.support.import_module('multiprocessing.synchronize')
# import threading after _multiprocessing to raise a more revelant err... | |
# encoding: utf-8
"""
An embedded IPython shell.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
import warnings
from IPython.core import ultratb, compilerop
from IPython.core import magic_arguments
from IPython.core.magic import Magics, magics_clas... | |
# coding: utf-8
""" From the mockstream runs, find the best mockstream that fits the data """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os
import sys
# Third-party
from astropy import log as logger
import astropy.coordinates as coord
imp... | |
import os
import re
import sys
import glob
import readline
from django.db import transaction
from django.core.files.storage import default_storage
from django.core.management.base import BaseCommand, CommandError
from django.utils.datastructures import SortedDict
from musicdb.common.models import File, MusicFile
fro... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Common functions and classes that are required by all query classes.
"""
import re
import warnings
import os
import shutil
import socket
import requests
from six.moves.urllib_error import URLError
import six
import astropy.units as u
from astropy im... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
im... | |
# Author: Andreas Christian Mueller <amueller@ais.uni-bonn.de>
# (c) 2012
# Modified by: Paul Nechifor <paul@nechifor.net>
# License: MIT
#Modified by jack wu
import random
import os
import numpy as np
import math
import imp
try:
imp.find_module('PIL')
found = True
except ImportError:
found = False
if fo... | |
#!/usr/bin/env python
from __future__ import print_function
import os
import string
import sys
from pulsar.main import (
ArgumentParser,
DEFAULT_APP_YAML,
DEFAULT_INI
)
try:
import pip
except ImportError:
pip = None
try:
import virtualenv
except ImportError:
virtualenv = None
IS_WINDOWS... | |
from collections import defaultdict
import jmespath
from .invocation_tools import _extract_invocations, _name_of
class VaqueroException(Exception):
pass
def _make_pairs_table(d, sort_ks=True, depth=""):
rows = [depth + "<table>"]
ks = d.keys() if not sort_ks else sorted(d.keys())
for k in ks:
... | |
"""
Public API for all plots supported by HoloViews, regardless of
plotting package or backend. Every plotting classes must be a subclass
of this Plot baseclass.
"""
from itertools import groupby, product
from collections import Counter, defaultdict
import numpy as np
import param
from ..core import OrderedDict
from... | |
# This file is part of beets.
# Copyright 2011, Adrian Sampson.
#
# 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, ... | |
# 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 applicable ... | |
import numpy as np
import scipy.interpolate, scipy.integrate
from openmdao.api import Component, Problem, Group
import os
class Battery(Component):
"""The `Battery` class represents a battery component in an OpenMDAO model.
A `Battery` models battery performance by finding a general battery voltage
... | |
#!/usr/bin/env python
"""
Listens to incoming cleartext and enryched documents on zmq;
packages them into gzip files;
makes those files available via HTTP.
The HTTP interface is public facing and the final stage of the pipeline.
ZMQ subscribes to: zmq2zmq_enrych.py
ZMQ subscribers: none; HTTP is used from here on
"... | |
from __future__ import unicode_literals
from django import forms, http
from django.conf import settings
from django.test import TestCase
from django.template.response import TemplateResponse
from django.utils.importlib import import_module
from django.contrib.auth.models import User
from django.contrib.formtools.wiz... | |
#!/usr/bin/env python
#
# Simple cache simulator. Implements an N-way set-associative LRU cache, used
# for exploring the cache hit and miss rates when feeding in address traces
# from two programs, generated by the pinatrace Pin tool. These accesses are
# interleaved to simulate context switching between different thr... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2018 TinEye. All rights reserved worldwide.
from .image import Image
from .metadata_request import MetadataRequest
class MulticolorEngineRequest(MetadataRequest):
"""
Class to send requests to a MulticolorEngine API.
Adding an image using data:
>>> from t... | |
import httptools
import unittest
from unittest import mock
RESPONSE1_HEAD = b'''HTTP/1.1 200 OK
Date: Mon, 23 May 2005 22:38:34 GMT
Server: Apache/1.3.3.7
(Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
ETag: "3f80f-1b6-3e1cb03b"
Content-Type: text/html;
charset=UTF-8
Content-Length: 13... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack, LLC
# 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
#
# https://www.apache.org... | |
import collections
import context
import typed_ast
class Evaluator(object):
def __init__(self, tables_by_name):
self.tables_by_name = tables_by_name
def evaluate_select(self, select_ast):
"""Given a select statement, return a Context with the results."""
assert isinstance(select_ast,... | |
from .base import HPXMLtoHEScoreTranslatorBase
from collections import OrderedDict
from .exceptions import TranslationError
def convert_to_type(type_, value):
if value is None:
return value
else:
return type_(value)
class HPXML3toHEScoreTranslator(HPXMLtoHEScoreTranslatorBase):
SCHEMA_DI... | |
# 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 use ... | |
# Copyright 2012 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 ... | |
"""Visualizer for rllib experiments.
Attributes
----------
EXAMPLE_USAGE : str
Example call to the function, which is
::
python ./visualizer_rllib.py /tmp/ray/result_dir 1
parser : ArgumentParser
Command-line argument parser
"""
import argparse
from datetime import datetime
import gym
import num... | |
# Lint as: python2, python3
# Copyright 2020 Google LLC. 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 req... | |
#!/usr/bin/env python
#
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# On Android we build unit test bundles as shared libraries. To run
# tests, we launch a special "test runner" apk which loads t... | |
from rest_framework import serializers as ser
from modularodm.exceptions import ValidationValueError
from api.base.exceptions import InvalidModelValueError, JSONAPIException, Conflict
from api.base.serializers import AllowMissing, JSONAPIRelationshipSerializer, HideIfDisabled
from website.models import User
from api... | |
#! /usr/bin/env python
## @file: src/sdm/rest_backend.py
# Configure the rest backend
#
# @author Illyoung Choi
#
# @copyright Copyright 2016 The Trustees of University of Arizona\n
# Licensed under the Apache License, Version 2.0 (the "License" );
# you may not use this file except in compliance with the L... | |
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - PackagePages action
This action allows you to package pages.
TODO: use ActionBase class
@copyright: 2005 MoinMoin:AlexanderSchremmer
2007-2009 MoinMoin:ReimarBauer
@license: GNU GPL, see COPYING for details.
"""
import cStringIO
import o... | |
#!/usr/bin/env python
#
# Copyright 2014-2017 42 Lines, Inc.
# Original Author: Jack Neely <jjneely@42lines.net>
#
# 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... | |
from __future__ import print_function
import sys
import os
import fcntl
import struct
import weakref
from threading import RLock
from select import select
from .pencode import pencode, pdecode
__metaclass__ = type
PY2 = sys.version_info < (3,)
if PY2:
bytes = str
def nonblocking_fd(fd):
if hasattr(fd, 'f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.